import { t as GenericQueryCtx } from "../../../../storage-kTmOAWHW.js"; import { AsyncStoreProperty, GetCurrentPartialUserOptions, GetCurrentUserOptions } from "../../common.js"; import { CustomerProductsList, CustomerProductsRequestOptions, InlineProduct, ServerItem } from "../../customers/index.js"; import { EmailDeliveryInfo, SendEmailOptions } from "../../email/index.js"; import { DataVaultStore } from "../../data-vault/index.js"; import { ProjectCurrentServerUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, SyncedPartialServerUser, TokenPartialUser } from "../../users/index.js"; import { ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from "../../teams/index.js"; import { StackClientApp, StackClientAppConstructorOptions } from "./client-app.js"; import { KnownErrors } from "@stackframe/stack-shared"; import { Result } from "@stackframe/stack-shared/dist/utils/results"; //#region src/lib/stack-app/apps/interfaces/server-app.d.ts type StackServerAppConstructorOptions = StackClientAppConstructorOptions & { secretServerKey?: string; }; type StackServerApp = ({ createTeam(data: ServerTeamCreateOptions): Promise; /** * @deprecated use `getUser()` instead */ getServerUser(): Promise | null>; createUser(options: ServerUserCreateOptions): Promise; grantProduct(options: (({ userId: string; } | { teamId: string; } | { customCustomerId: string; }) & ({ productId: string; } | { product: InlineProduct; }) & { quantity?: number; })): Promise; useUser(options: GetCurrentUserOptions & { or: 'redirect'; }): ProjectCurrentServerUser; useUser(options: GetCurrentUserOptions & { or: 'throw'; }): ProjectCurrentServerUser; useUser(options: GetCurrentUserOptions & { or: 'anonymous'; }): ProjectCurrentServerUser; useUser(options?: GetCurrentUserOptions): ProjectCurrentServerUser | null; useUser(id: string): ServerUser | null; useUser(options: { apiKey: string; or?: "return-null" | "anonymous"; }): ServerUser | null; useUser(options: { from: "convex"; ctx: GenericQueryCtx; or?: "return-null" | "anonymous"; }): ServerUser | null; getUser(options: GetCurrentUserOptions & { or: 'redirect'; }): Promise>; getUser(options: GetCurrentUserOptions & { or: 'throw'; }): Promise>; getUser(options: GetCurrentUserOptions & { or: 'anonymous'; }): Promise>; getUser(options?: GetCurrentUserOptions): Promise | null>; getUser(id: string): Promise; getUser(options: { apiKey: string; or?: "return-null" | "anonymous"; }): Promise; getUser(options: { from: "convex"; ctx: GenericQueryCtx; or?: "return-null" | "anonymous"; }): Promise; getPartialUser(options: GetCurrentPartialUserOptions & { from: 'token'; }): Promise; getPartialUser(options: GetCurrentPartialUserOptions & { from: 'convex'; }): Promise; getPartialUser(options: GetCurrentPartialUserOptions): Promise; usePartialUser(options: GetCurrentPartialUserOptions & { from: 'token'; }): TokenPartialUser | null; usePartialUser(options: GetCurrentPartialUserOptions & { from: 'convex'; }): TokenPartialUser | null; usePartialUser(options: GetCurrentPartialUserOptions): SyncedPartialServerUser | TokenPartialUser | null; useTeam(id: string): ServerTeam | null; useTeam(options: { apiKey: string; }): ServerTeam | null; getTeam(id: string): Promise; getTeam(options: { apiKey: string; }): Promise; useUsers(options?: ServerListUsersOptions): ServerUser[] & { nextCursor: string | null; }; listUsers(options?: ServerListUsersOptions): Promise; createOAuthProvider(options: { userId: string; accountId: string; providerConfigId: string; email: string; allowSignIn: boolean; allowConnectedAccounts: boolean; }): Promise>>; sendEmail(options: SendEmailOptions): Promise; getEmailDeliveryStats(): Promise; useEmailDeliveryStats(): EmailDeliveryInfo; activateEmailCapacityBoost(): Promise; } & AsyncStoreProperty<"user", [id: string], ServerUser | null, false> & Omit, "listUsers" | "useUsers"> & AsyncStoreProperty<"teams", [], ServerTeam[], true> & AsyncStoreProperty<"dataVaultStore", [id: string], DataVaultStore, false> & AsyncStoreProperty<"item", [{ itemId: string; userId: string; } | { itemId: string; teamId: string; } | { itemId: string; customCustomerId: string; }], ServerItem, false> & AsyncStoreProperty<"products", [options: CustomerProductsRequestOptions], CustomerProductsList, true> & StackClientApp); type StackServerAppConstructor = { new (options: StackServerAppConstructorOptions): StackServerApp; new (options: StackServerAppConstructorOptions): StackServerApp; }; declare const StackServerApp: StackServerAppConstructor; //#endregion export { StackServerApp, StackServerAppConstructor, StackServerAppConstructorOptions }; //# sourceMappingURL=server-app.d.ts.map