/** * Users Resource * * Organization member management: * - List members with their roles * - Invite users with intended roles * - Remove members * - List/manage invitations * - Assign/revoke roles */ import type { AssignUserRoleInput, Locale, RevokeUserRoleInput, UserRoleResponse } from "@artu-ai/shared"; export interface Member { id: string; userId: string; email: string; firstName: string | null; lastName: string | null; profilePictureUrl: string | null; status: "active" | "inactive" | "pending"; createdAt: string; roles: { id: string; name: string; slug: string; }[]; } /** Lightweight user summary returned by `users.get`. Excludes roles and * membership status — those belong to the full `Member` shape that * org-settings surfaces consume. */ export interface UserSummary { userId: string; email: string; firstName: string | null; lastName: string | null; profilePictureUrl: string | null; } export interface Invitation { id: string; email: string; state: "pending" | "accepted" | "expired" | "revoked"; expiresAt: string; createdAt: string; roles: { id: string; name: string; slug: string; }[]; } export interface InviteUserInput { emails: string[]; roleIds: string[]; } export declare class UsersResource { private readonly trpc; listMembers(): Promise; /** * Resolve a single user by id, scoped to the caller's org. Returns * `null` when the user isn't a member (cross-org probes look * indistinguishable from "user doesn't exist"). Two WorkOS calls * round-trip; cache client-side via React Query if you're calling * this from a list surface. */ get(userId: string): Promise; removeMember(membershipId: string): Promise; listInvitations(options?: { status?: "pending" | "accepted" | "expired" | "revoked"; }): Promise; invite(input: InviteUserInput): Promise; revokeInvitation(invitationId: string): Promise; listRoleAssignments(): Promise; listRolesForUser(userId: string): Promise; myRoles(): Promise; /** * Persist the current user's preferred locale to their WorkOS profile. * The dashboard cookie remains the immediate render source of truth; this * makes the choice durable across devices and cleared cookies. */ updateLocale(locale: Locale): Promise<{ locale: Locale; }>; /** Record the current user's acceptance of the Terms & Conditions. */ acceptTerms(): Promise<{ termsAcceptedAt: string; termsVersion: string; }>; assignRole(input: AssignUserRoleInput): Promise; revokeRole(input: RevokeUserRoleInput): Promise; private execute; }