import { ReadonlyJson } from "@stackframe/stack-shared/dist/utils/json"; import { TeamsCrud } from "@stackframe/stack-shared/dist/interface/crud/teams"; import { AsyncStoreProperty } from "../common"; import { ApiKeyCreationOptions, TeamApiKey, TeamApiKeyFirstView } from "../api-keys"; import { Customer } from "../customers"; import { ServerUser } from "../users"; //#region src/lib/stack-app/teams/index.d.ts type TeamMemberProfile = { displayName: string | null; profileImageUrl: string | null; }; type TeamMemberProfileUpdateOptions = { displayName?: string; profileImageUrl?: string | null; }; type EditableTeamMemberProfile = TeamMemberProfile & { update(update: TeamMemberProfileUpdateOptions): Promise; }; type TeamUser = { id: string; teamProfile: TeamMemberProfile; }; /** * A team invitation as seen from the team's perspective (ie. the sender). * * Returned by `team.listInvitations()`. Contains the recipient email and allows * revoking the invitation. */ type SentTeamInvitation = { id: string; recipientEmail: string | null; expiresAt: Date; revoke(): Promise; }; /** * @deprecated Use `SentTeamInvitation` instead. */ type TeamInvitation = SentTeamInvitation; /** * A team invitation as seen from the invited user's perspective (ie. the receiver). * * Returned by `user.listTeamInvitations()`. Contains information about teams that have * sent invitations to any of the user's verified email addresses, and allows accepting * the invitation to join the team. */ type ReceivedTeamInvitation = { id: string; teamId: string; teamDisplayName: string; recipientEmail: string; expiresAt: Date; /** * Accepts the invitation, adding the current user to the team. * * The user must have a verified email address matching the invitation's recipient email. */ accept(): Promise; }; type Team = { id: string; displayName: string; profileImageUrl: string | null; clientMetadata: any; clientReadOnlyMetadata: any; inviteUser(options: { email: string; callbackUrl?: string; }): Promise; listUsers(): Promise; useUsers(): TeamUser[]; listInvitations(): Promise; useInvitations(): SentTeamInvitation[]; update(update: TeamUpdateOptions): Promise; delete(): Promise; createApiKey(options: ApiKeyCreationOptions<"team">): Promise; } & AsyncStoreProperty<"apiKeys", [], TeamApiKey[], true> & Customer; type TeamUpdateOptions = { displayName?: string; profileImageUrl?: string | null; clientMetadata?: ReadonlyJson; }; declare function teamUpdateOptionsToCrud(options: TeamUpdateOptions): TeamsCrud["Client"]["Update"]; type TeamCreateOptions = { displayName: string; profileImageUrl?: string; }; declare function teamCreateOptionsToCrud(options: TeamCreateOptions, creatorUserId: string): TeamsCrud["Client"]["Create"]; type ServerTeamMemberProfile = TeamMemberProfile; type ServerTeamUser = ServerUser & { teamProfile: ServerTeamMemberProfile; }; type ServerTeam = { createdAt: Date; serverMetadata: any; listUsers(): Promise; useUsers(): ServerUser[]; update(update: ServerTeamUpdateOptions): Promise; delete(): Promise; addUser(userId: string): Promise; inviteUser(options: { email: string; callbackUrl?: string; }): Promise; removeUser(userId: string): Promise; } & Team; type ServerListUsersOptionsBase = { cursor?: string; limit?: number; orderBy?: 'signedUpAt'; desc?: boolean; query?: string; /** * Whether to include restricted users (users who haven't completed onboarding requirements). * Defaults to false. */ includeRestricted?: boolean; /** * Whether to include anonymous users (and restricted users). * Defaults to false. */ includeAnonymous?: boolean; }; type ServerListUsersOptions = ServerListUsersOptionsBase & ({ onlyAnonymous?: false; } | { /** * Whether to return only anonymous users. * Requires includeAnonymous=true. * Defaults to false. */ onlyAnonymous: true; includeAnonymous: true; }); type ServerTeamCreateOptions = TeamCreateOptions & { creatorUserId?: string; }; declare function serverTeamCreateOptionsToCrud(options: ServerTeamCreateOptions): TeamsCrud["Server"]["Create"]; type ServerTeamUpdateOptions = TeamUpdateOptions & { clientReadOnlyMetadata?: ReadonlyJson; serverMetadata?: ReadonlyJson; }; declare function serverTeamUpdateOptionsToCrud(options: ServerTeamUpdateOptions): TeamsCrud["Server"]["Update"]; //#endregion export { EditableTeamMemberProfile, ReceivedTeamInvitation, SentTeamInvitation, ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions, ServerTeamMemberProfile, ServerTeamUpdateOptions, ServerTeamUser, Team, TeamCreateOptions, TeamInvitation, TeamMemberProfile, TeamMemberProfileUpdateOptions, TeamUpdateOptions, TeamUser, serverTeamCreateOptionsToCrud, serverTeamUpdateOptionsToCrud, teamCreateOptionsToCrud, teamUpdateOptionsToCrud }; //# sourceMappingURL=index.d.ts.map