import { KnownErrors } from "@hexclave/shared"; import { Result } from "@hexclave/shared/dist/utils/results"; import { GenericQueryCtx } from "convex/server"; import { AsyncStoreProperty, GetCurrentPartialUserOptions, GetCurrentUserOptions } from "../../common.js"; import { ServerListTeamsOptions, ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from "../../teams/index.js"; import { ProjectCurrentServerUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, SyncedPartialServerUser, TokenPartialUser } from "../../users/index.js"; import { CustomerProductsList, CustomerProductsRequestOptions, InlineProduct, ServerItem } from "../../customers/index.js"; import { AnalyticsQueryOptions, AnalyticsQueryResponse } from "@hexclave/shared/dist/interface/crud/analytics"; import { DataVaultStore } from "../../data-vault/index.js"; import { EmailDeliveryInfo, SendEmailOptions } from "../../email/index.js"; import { StackClientApp, StackClientAppConstructorOptions } from "./client-app.js"; //#region src/lib/hexclave-app/apps/interfaces/server-app.d.ts /** @deprecated Use `HexclaveServerAppConstructorOptions` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */ type StackServerAppConstructorOptions = StackClientAppConstructorOptions & { secretServerKey?: string; }; /** @deprecated Use `HexclaveServerApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */ 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; createCheckoutUrl(options: (({ userId: string; } | { teamId: string; } | { customCustomerId: string; }) & ({ productId: string; } | { product: InlineProduct; }) & { returnUrl?: string; })): Promise; 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; getTeam(id: string): Promise; getTeam(options: { apiKey: string; }): Promise; listUsers(options?: ServerListUsersOptions): Promise; /** * Returns every direct (or recursive) team permission grant for every * member of the given team in one request. Use this instead of calling * `user.listPermissions(team)` per row when rendering a roster — that * pattern produces an N+1 over the team-member endpoint. */ listTeamMemberPermissions(teamId: string, options?: { recursive?: boolean; }): Promise<{ userId: string; permissionId: string; }[]>; createOAuthProvider(options: { userId: string; accountId: string; providerConfigId: string; email: string; allowSignIn: boolean; allowConnectedAccounts: boolean; }): Promise>>; sendEmail(options: SendEmailOptions): Promise; getEmailDeliveryStats(): Promise; activateEmailCapacityBoost(): Promise; queryAnalytics(options: AnalyticsQueryOptions): Promise; } & AsyncStoreProperty<"user", [id: string], ServerUser | null, false> & Omit, "listUsers" | "useUsers"> & AsyncStoreProperty<"teams", [options?: ServerListTeamsOptions], ServerTeam[] & { nextCursor: string | null; }, 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); /** @deprecated Use `HexclaveServerAppConstructor` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */ type StackServerAppConstructor = { new (options: StackServerAppConstructorOptions): StackServerApp; new (options: StackServerAppConstructorOptions): StackServerApp; }; type HexclaveServerAppConstructorOptions = StackServerAppConstructorOptions; type HexclaveServerApp = StackServerApp; type HexclaveServerAppConstructor = StackServerAppConstructor; declare const HexclaveServerApp: HexclaveServerAppConstructor; /** @deprecated Use `HexclaveServerApp` from the `@hexclave/*` package instead — same symbol, new brand name. See https://docs.hexclave.com/migration. */ declare const StackServerApp: StackServerAppConstructor; //#endregion export { HexclaveServerApp, HexclaveServerAppConstructor, HexclaveServerAppConstructorOptions, StackServerApp, StackServerAppConstructor, StackServerAppConstructorOptions }; //# sourceMappingURL=server-app.d.ts.map