@stackframe/js 2.8.58 → 2.8.60
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/esm/index.js.map +1 -1
- package/dist/esm/integrations/convex/component/convex.config.js.map +1 -1
- package/dist/esm/integrations/convex.js.map +1 -1
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/cookie.js.map +1 -1
- package/dist/esm/lib/stack-app/api-keys/index.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +59 -4
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/index.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/index.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/esm/lib/stack-app/common.js.map +1 -1
- package/dist/esm/lib/stack-app/contact-channels/index.js.map +1 -1
- package/dist/esm/lib/stack-app/email-templates/index.js.map +1 -1
- package/dist/esm/lib/stack-app/index.js.map +1 -1
- package/dist/esm/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/esm/lib/stack-app/permissions/index.js.map +1 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -1
- package/dist/esm/lib/stack-app/teams/index.js.map +1 -1
- package/dist/esm/lib/stack-app/users/index.js.map +1 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/index.d.mts +36 -1
- package/dist/index.d.ts +36 -1
- package/dist/index.js.map +1 -1
- package/dist/integrations/convex/component/convex.config.js.map +1 -1
- package/dist/integrations/convex.js.map +1 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/cookie.js.map +1 -1
- package/dist/lib/stack-app/api-keys/index.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +59 -4
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js +1 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/index.js.map +1 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/index.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/lib/stack-app/common.js.map +1 -1
- package/dist/lib/stack-app/connected-accounts/index.js.map +1 -1
- package/dist/lib/stack-app/contact-channels/index.js.map +1 -1
- package/dist/lib/stack-app/customers/index.js.map +1 -1
- package/dist/lib/stack-app/data-vault/index.js.map +1 -1
- package/dist/lib/stack-app/email/index.js.map +1 -1
- package/dist/lib/stack-app/email-templates/index.js.map +1 -1
- package/dist/lib/stack-app/index.js.map +1 -1
- package/dist/lib/stack-app/internal-api-keys/index.js.map +1 -1
- package/dist/lib/stack-app/notification-categories/index.js.map +1 -1
- package/dist/lib/stack-app/permissions/index.js.map +1 -1
- package/dist/lib/stack-app/project-configs/index.js.map +1 -1
- package/dist/lib/stack-app/projects/index.js.map +1 -1
- package/dist/lib/stack-app/teams/index.js.map +1 -1
- package/dist/lib/stack-app/users/index.js.map +1 -1
- package/dist/utils/url.js.map +1 -1
- package/package.json +13 -13
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/interfaces/server-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { KnownErrors } from \"@stackframe/stack-shared\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport type { GenericQueryCtx } from \"convex/server\";\nimport { AsyncStoreProperty, GetCurrentPartialUserOptions, GetCurrentUserOptions } from \"../../common\";\nimport { CustomerProductsList, CustomerProductsRequestOptions, InlineProduct, ServerItem } from \"../../customers\";\nimport { DataVaultStore } from \"../../data-vault\";\nimport { EmailDeliveryInfo, SendEmailOptions } from \"../../email\";\nimport { ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from \"../../teams\";\nimport { ProjectCurrentServerUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, SyncedPartialServerUser, TokenPartialUser } from \"../../users\";\nimport { _StackServerAppImpl } from \"../implementations\";\nimport { StackClientApp, StackClientAppConstructorOptions } from \"./client-app\";\n\n\nexport type StackServerAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & {\n secretServerKey?: string,\n};\n\nexport type StackServerApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n createTeam(data: ServerTeamCreateOptions): Promise<ServerTeam>,\n /**\n * @deprecated use `getUser()` instead\n */\n getServerUser(): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n\n createUser(options: ServerUserCreateOptions): Promise<ServerUser>,\n grantProduct(options: (\n ({ userId: string } | { teamId: string } | { customCustomerId: string }) &\n ({ productId: string } | { product: InlineProduct }) &\n { quantity?: number }\n )): Promise<void>,\n\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n getUser(id: string): Promise<ServerUser | null>,\n getUser(options: { apiKey: string, or?: \"return-null\" | \"anonymous\" }): Promise<ServerUser | null>,\n getUser(options: { from: \"convex\", ctx: GenericQueryCtx<any>, or?: \"return-null\" | \"anonymous\" }): Promise<ServerUser | null>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialServerUser | TokenPartialUser | null>,\n getTeam(id: string): Promise<ServerTeam | null>,\n getTeam(options: { apiKey: string }): Promise<ServerTeam | null>,\n\n\n listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & { nextCursor: string | null }>,\n\n createOAuthProvider(options: {\n userId: string,\n accountId: string,\n providerConfigId: string,\n email: string,\n allowSignIn: boolean,\n allowConnectedAccounts: boolean,\n }): Promise<Result<ServerOAuthProvider, InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>>>,\n\n sendEmail(options: SendEmailOptions): Promise<void>,\n\n getEmailDeliveryStats(): Promise<EmailDeliveryInfo>,\n }\n & AsyncStoreProperty<\"user\", [id: string], ServerUser | null, false>\n & Omit<AsyncStoreProperty<\"users\", [], ServerUser[], true>, \"listUsers\" | \"useUsers\">\n & AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\n & AsyncStoreProperty<\"dataVaultStore\", [id: string], DataVaultStore, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n ServerItem,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & StackClientApp<HasTokenStore, ProjectId>\n);\nexport type StackServerAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackServerAppConstructorOptions<HasTokenStore, ProjectId>): StackServerApp<HasTokenStore, ProjectId>,\n new (options: StackServerAppConstructorOptions<boolean, string>): StackServerApp<boolean, string>,\n};\nexport const StackServerApp: StackServerAppConstructor = _StackServerAppImpl;\n"],"mappings":";AAaA,SAAS,2BAA2B;AAiF7B,IAAM,iBAA4C;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/interfaces/server-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors } from \"@stackframe/stack-shared\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport type { GenericQueryCtx } from \"convex/server\";\nimport { AsyncStoreProperty, GetCurrentPartialUserOptions, GetCurrentUserOptions } from \"../../common\";\nimport { CustomerProductsList, CustomerProductsRequestOptions, InlineProduct, ServerItem } from \"../../customers\";\nimport { DataVaultStore } from \"../../data-vault\";\nimport { EmailDeliveryInfo, SendEmailOptions } from \"../../email\";\nimport { ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from \"../../teams\";\nimport { ProjectCurrentServerUser, ServerOAuthProvider, ServerUser, ServerUserCreateOptions, SyncedPartialServerUser, TokenPartialUser } from \"../../users\";\nimport { _StackServerAppImpl } from \"../implementations\";\nimport { StackClientApp, StackClientAppConstructorOptions } from \"./client-app\";\n\n\nexport type StackServerAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = StackClientAppConstructorOptions<HasTokenStore, ProjectId> & {\n secretServerKey?: string,\n};\n\nexport type StackServerApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & {\n createTeam(data: ServerTeamCreateOptions): Promise<ServerTeam>,\n /**\n * @deprecated use `getUser()` instead\n */\n getServerUser(): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n\n createUser(options: ServerUserCreateOptions): Promise<ServerUser>,\n grantProduct(options: (\n ({ userId: string } | { teamId: string } | { customCustomerId: string }) &\n ({ productId: string } | { product: InlineProduct }) &\n { quantity?: number }\n )): Promise<void>,\n\n\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetCurrentUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options?: GetCurrentUserOptions<HasTokenStore>): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n getUser(id: string): Promise<ServerUser | null>,\n getUser(options: { apiKey: string, or?: \"return-null\" | \"anonymous\" }): Promise<ServerUser | null>,\n getUser(options: { from: \"convex\", ctx: GenericQueryCtx<any>, or?: \"return-null\" | \"anonymous\" }): Promise<ServerUser | null>,\n\n // note: we don't special-case 'anonymous' here to return non-null, see GetPartialUserOptions for more details\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'token' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore> & { from: 'convex' }): Promise<TokenPartialUser | null>,\n getPartialUser(options: GetCurrentPartialUserOptions<HasTokenStore>): Promise<SyncedPartialServerUser | TokenPartialUser | null>,\n getTeam(id: string): Promise<ServerTeam | null>,\n getTeam(options: { apiKey: string }): Promise<ServerTeam | null>,\n\n\n listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & { nextCursor: string | null }>,\n\n createOAuthProvider(options: {\n userId: string,\n accountId: string,\n providerConfigId: string,\n email: string,\n allowSignIn: boolean,\n allowConnectedAccounts: boolean,\n }): Promise<Result<ServerOAuthProvider, InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>>>,\n\n sendEmail(options: SendEmailOptions): Promise<void>,\n\n getEmailDeliveryStats(): Promise<EmailDeliveryInfo>,\n }\n & AsyncStoreProperty<\"user\", [id: string], ServerUser | null, false>\n & Omit<AsyncStoreProperty<\"users\", [], ServerUser[], true>, \"listUsers\" | \"useUsers\">\n & AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\n & AsyncStoreProperty<\"dataVaultStore\", [id: string], DataVaultStore, false>\n & AsyncStoreProperty<\n \"item\",\n [{ itemId: string, userId: string } | { itemId: string, teamId: string } | { itemId: string, customCustomerId: string }],\n ServerItem,\n false\n >\n & AsyncStoreProperty<\n \"products\",\n [options: CustomerProductsRequestOptions],\n CustomerProductsList,\n true\n >\n & StackClientApp<HasTokenStore, ProjectId>\n);\nexport type StackServerAppConstructor = {\n new <\n TokenStoreType extends string,\n HasTokenStore extends (TokenStoreType extends {} ? true : boolean),\n ProjectId extends string\n >(options: StackServerAppConstructorOptions<HasTokenStore, ProjectId>): StackServerApp<HasTokenStore, ProjectId>,\n new (options: StackServerAppConstructorOptions<boolean, string>): StackServerApp<boolean, string>,\n};\nexport const StackServerApp: StackServerAppConstructor = _StackServerAppImpl;\n"],"mappings":";AAaA,SAAS,2BAA2B;AAiF7B,IAAM,iBAA4C;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/stack-app/common.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ProviderType } from \"@stackframe/stack-shared/dist/utils/oauth\";\nimport type { GenericQueryCtx, UserIdentity } from \"convex/server\";\n\nexport type RedirectToOptions = {\n replace?: boolean,\n noRedirectBack?: boolean,\n};\n\nexport type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultiple extends boolean> =\n & { [key in `${IsMultiple extends true ? \"list\" : \"get\"}${Capitalize<Name>}`]: (...args: Args) => Promise<Value> }\n\nexport type EmailConfig = {\n host: string,\n port: number,\n username: string,\n password: string,\n senderEmail: string,\n senderName: string,\n}\n\nexport type RedirectMethod = \"window\"\n | \"none\"\n | {\n useNavigate: () => (to: string) => void,\n navigate?: (to: string) => void,\n }\n\n\nexport type GetCurrentUserOptions<HasTokenStore> =\n & {\n or?: 'redirect' | 'throw' | 'return-null' | 'anonymous' | /** @deprecated */ 'anonymous-if-exists[deprecated]',\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements like email verification).\n * By default, restricted users are filtered out (treated similar to anonymous users).\n *\n * Note: This option cannot be set to false when `or: 'anonymous'` is used, as all anonymous users are also restricted.\n *\n * @default false\n */\n includeRestricted?: boolean,\n tokenStore?: TokenStoreInit,\n }\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type ConvexCtx =\n| GenericQueryCtx<any>\n| { auth: { getUserIdentity: () => Promise<UserIdentity | null> } };\n\nexport type GetCurrentPartialUserOptions<HasTokenStore> =\n & {\n or?: 'return-null' | 'anonymous', // note: unlike normal getUser, 'anonymous' still returns null sometimes (eg. if no token is present)\n tokenStore?: TokenStoreInit,\n }\n & (\n | {\n from: 'token',\n }\n | {\n from: 'convex',\n ctx: ConvexCtx,\n }\n )\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type RequestLike = {\n headers: {\n get: (name: string) => string | null,\n },\n};\n\nexport type TokenStoreInit<HasTokenStore extends boolean = boolean> =\n HasTokenStore extends true ? (\n | \"cookie\"\n | \"nextjs-cookie\"\n | \"memory\"\n | RequestLike\n | { accessToken: string, refreshToken: string }\n )\n : HasTokenStore extends false ? null\n : TokenStoreInit<true> | TokenStoreInit<false>;\n\nexport type HandlerUrls = {\n handler: string,\n signIn: string,\n signUp: string,\n afterSignIn: string,\n afterSignUp: string,\n signOut: string,\n afterSignOut: string,\n emailVerification: string,\n passwordReset: string,\n forgotPassword: string,\n home: string,\n oauthCallback: string,\n magicLinkCallback: string,\n accountSettings: string,\n teamInvitation: string,\n mfa: string,\n error: string,\n onboarding: string,\n}\n\nexport type OAuthScopesOnSignIn = {\n [key in ProviderType]: string[];\n};\n\n/**\n * Contains the authentication methods without session-related fields.\n * Used for apps that have token storage capabilities.\n */\nexport type AuthLike<ExtraOptions = {}> = {\n signOut(options?: { redirectUrl?: URL | string } & ExtraOptions): Promise<void>,\n signOut(options?: { redirectUrl?: URL | string }): Promise<void>,\n\n /**\n * Returns the current access token, or null if the user is not signed in.\n *\n * The access token is a short-lived JWT that can be used to authenticate requests to external servers.\n * It will be automatically refreshed when it expires.\n */\n getAccessToken(options?: {} & ExtraOptions): Promise<string | null>,\n\n /**\n * Returns the current refresh token, or null if the user is not signed in.\n *\n * The refresh token is a long-lived token that can be used to obtain new access tokens.\n * It should be kept secret and never exposed to the client.\n */\n getRefreshToken(options?: {} & ExtraOptions): Promise<string | null>,\n\n /**\n * Returns headers for sending authenticated HTTP requests to external servers. Most commonly used in cross-origin\n * requests. Similar to `getAuthJson`, but specifically for HTTP requests.\n *\n * If you are using `tokenStore: \"cookie\"`, you don't need this for same-origin requests. However, most\n * browsers now disable third-party cookies by default, so we must pass authentication tokens by header instead\n * if the client and server are on different origins.\n *\n * This function returns a header object that can be used with `fetch` or other HTTP request libraries to send\n * authenticated requests.\n *\n * On the server, you can then pass in the `Request` object to the `tokenStore` option\n * of your Stack app. Please note that CORS does not allow most headers by default, so you\n * must include `x-stack-auth` in the [`Access-Control-Allow-Headers` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers)\n * of the CORS preflight response.\n *\n * If you are not using HTTP (and hence cannot set headers), you will need to use the `getAccessToken()` and\n * `getRefreshToken()` functions instead.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await fetch(\"https://api.example.com\", {\n * headers: {\n * ...await stackApp.getAuthHeaders()\n * // you can also add your own headers here\n * },\n * });\n *\n * // server\n * function handleRequest(req: Request) {\n * const user = await stackServerApp.getUser({ tokenStore: req });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthHeaders(options?: {} & ExtraOptions): Promise<{ \"x-stack-auth\": string }>,\n\n /**\n * @deprecated Use `getAccessToken()` and `getRefreshToken()` instead.\n *\n * Creates a JSON-serializable object containing the information to authenticate a user on an external server.\n * Similar to `getAuthHeaders`, but returns an object that can be sent over any protocol instead of just\n * HTTP headers.\n *\n * While `getAuthHeaders` is the recommended way to send authentication tokens over HTTP, your app may use\n * a different protocol, for example WebSockets or gRPC. This function returns a token object that can be JSON-serialized and sent to the server in any way you like.\n *\n * On the server, you can pass in this token object into the `tokenStore` option to fetch user details.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await rpcCall(rpcEndpoint, {\n * data: {\n * auth: await stackApp.getAuthJson(),\n * },\n * });\n *\n * // server\n * function handleRequest(data) {\n * const user = await stackServerApp.getUser({ tokenStore: data.auth });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthJson(options?: {} & ExtraOptions): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n /** @deprecated Use `useAccessToken()` and `useRefreshToken()` instead. */\n};\n\n/** @internal */\nexport const stackAppInternalsSymbol = Symbol.for(\"StackAuth--DO-NOT-USE-OR-YOU-WILL-BE-FIRED--StackAppInternals\");\n"],"mappings":";AAmNO,IAAM,0BAA0B,OAAO,IAAI,+DAA+D;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/stack-app/common.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ProviderType } from \"@stackframe/stack-shared/dist/utils/oauth\";\nimport type { GenericQueryCtx, UserIdentity } from \"convex/server\";\n\nexport type RedirectToOptions = {\n replace?: boolean,\n noRedirectBack?: boolean,\n};\n\nexport type AsyncStoreProperty<Name extends string, Args extends any[], Value, IsMultiple extends boolean> =\n & { [key in `${IsMultiple extends true ? \"list\" : \"get\"}${Capitalize<Name>}`]: (...args: Args) => Promise<Value> }\n\nexport type EmailConfig = {\n host: string,\n port: number,\n username: string,\n password: string,\n senderEmail: string,\n senderName: string,\n}\n\nexport type RedirectMethod = \"window\"\n | \"none\"\n | {\n useNavigate: () => (to: string) => void,\n navigate?: (to: string) => void,\n }\n\n\nexport type GetCurrentUserOptions<HasTokenStore> =\n & {\n or?: 'redirect' | 'throw' | 'return-null' | 'anonymous' | /** @deprecated */ 'anonymous-if-exists[deprecated]',\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements like email verification).\n * By default, restricted users are filtered out (treated similar to anonymous users).\n *\n * Note: This option cannot be set to false when `or: 'anonymous'` is used, as all anonymous users are also restricted.\n *\n * @default false\n */\n includeRestricted?: boolean,\n tokenStore?: TokenStoreInit,\n }\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type ConvexCtx =\n| GenericQueryCtx<any>\n| { auth: { getUserIdentity: () => Promise<UserIdentity | null> } };\n\nexport type GetCurrentPartialUserOptions<HasTokenStore> =\n & {\n or?: 'return-null' | 'anonymous', // note: unlike normal getUser, 'anonymous' still returns null sometimes (eg. if no token is present)\n tokenStore?: TokenStoreInit,\n }\n & (\n | {\n from: 'token',\n }\n | {\n from: 'convex',\n ctx: ConvexCtx,\n }\n )\n & (HasTokenStore extends false ? {\n tokenStore: TokenStoreInit,\n } : {});\n\nexport type RequestLike = {\n headers: {\n get: (name: string) => string | null,\n },\n};\n\nexport type TokenStoreInit<HasTokenStore extends boolean = boolean> =\n HasTokenStore extends true ? (\n | \"cookie\"\n | \"nextjs-cookie\"\n | \"memory\"\n | RequestLike\n | { accessToken: string, refreshToken: string }\n )\n : HasTokenStore extends false ? null\n : TokenStoreInit<true> | TokenStoreInit<false>;\n\nexport type HandlerUrls = {\n handler: string,\n signIn: string,\n signUp: string,\n afterSignIn: string,\n afterSignUp: string,\n signOut: string,\n afterSignOut: string,\n emailVerification: string,\n passwordReset: string,\n forgotPassword: string,\n home: string,\n oauthCallback: string,\n magicLinkCallback: string,\n accountSettings: string,\n teamInvitation: string,\n mfa: string,\n error: string,\n onboarding: string,\n}\n\nexport type OAuthScopesOnSignIn = {\n [key in ProviderType]: string[];\n};\n\n/**\n * Contains the authentication methods without session-related fields.\n * Used for apps that have token storage capabilities.\n */\nexport type AuthLike<ExtraOptions = {}> = {\n signOut(options?: { redirectUrl?: URL | string } & ExtraOptions): Promise<void>,\n signOut(options?: { redirectUrl?: URL | string }): Promise<void>,\n\n /**\n * Returns the current access token, or null if the user is not signed in.\n *\n * The access token is a short-lived JWT that can be used to authenticate requests to external servers.\n * It will be automatically refreshed when it expires.\n */\n getAccessToken(options?: {} & ExtraOptions): Promise<string | null>,\n\n /**\n * Returns the current refresh token, or null if the user is not signed in.\n *\n * The refresh token is a long-lived token that can be used to obtain new access tokens.\n * It should be kept secret and never exposed to the client.\n */\n getRefreshToken(options?: {} & ExtraOptions): Promise<string | null>,\n\n /**\n * Returns headers for sending authenticated HTTP requests to external servers. Most commonly used in cross-origin\n * requests. Similar to `getAuthJson`, but specifically for HTTP requests.\n *\n * If you are using `tokenStore: \"cookie\"`, you don't need this for same-origin requests. However, most\n * browsers now disable third-party cookies by default, so we must pass authentication tokens by header instead\n * if the client and server are on different origins.\n *\n * This function returns a header object that can be used with `fetch` or other HTTP request libraries to send\n * authenticated requests.\n *\n * On the server, you can then pass in the `Request` object to the `tokenStore` option\n * of your Stack app. Please note that CORS does not allow most headers by default, so you\n * must include `x-stack-auth` in the [`Access-Control-Allow-Headers` header](https://developer.mozilla.org/en-US/docs/Web/HTTP/Headers/Access-Control-Allow-Headers)\n * of the CORS preflight response.\n *\n * If you are not using HTTP (and hence cannot set headers), you will need to use the `getAccessToken()` and\n * `getRefreshToken()` functions instead.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await fetch(\"https://api.example.com\", {\n * headers: {\n * ...await stackApp.getAuthHeaders()\n * // you can also add your own headers here\n * },\n * });\n *\n * // server\n * function handleRequest(req: Request) {\n * const user = await stackServerApp.getUser({ tokenStore: req });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthHeaders(options?: {} & ExtraOptions): Promise<{ \"x-stack-auth\": string }>,\n\n /**\n * @deprecated Use `getAccessToken()` and `getRefreshToken()` instead.\n *\n * Creates a JSON-serializable object containing the information to authenticate a user on an external server.\n * Similar to `getAuthHeaders`, but returns an object that can be sent over any protocol instead of just\n * HTTP headers.\n *\n * While `getAuthHeaders` is the recommended way to send authentication tokens over HTTP, your app may use\n * a different protocol, for example WebSockets or gRPC. This function returns a token object that can be JSON-serialized and sent to the server in any way you like.\n *\n * On the server, you can pass in this token object into the `tokenStore` option to fetch user details.\n *\n * Example:\n *\n * ```ts\n * // client\n * const res = await rpcCall(rpcEndpoint, {\n * data: {\n * auth: await stackApp.getAuthJson(),\n * },\n * });\n *\n * // server\n * function handleRequest(data) {\n * const user = await stackServerApp.getUser({ tokenStore: data.auth });\n * return new Response(\"Welcome, \" + user.displayName);\n * }\n * ```\n */\n getAuthJson(options?: {} & ExtraOptions): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n /** @deprecated Use `useAccessToken()` and `useRefreshToken()` instead. */\n};\n\n/** @internal */\nexport const stackAppInternalsSymbol = Symbol.for(\"StackAuth--DO-NOT-USE-OR-YOU-WILL-BE-FIRED--StackAppInternals\");\n"],"mappings":";AAmNO,IAAM,0BAA0B,OAAO,IAAI,+DAA+D;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/contact-channels/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ContactChannelsCrud } from \"@stackframe/stack-shared/dist/interface/crud/contact-channels\";\n\n\nexport type ContactChannel = {\n id: string,\n value: string,\n type: 'email',\n isPrimary: boolean,\n isVerified: boolean,\n usedForAuth: boolean,\n\n sendVerificationEmail(options?: { callbackUrl?: string }): Promise<void>,\n update(data: ContactChannelUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n}\n\nexport type ContactChannelCreateOptions = {\n value: string,\n type: 'email',\n usedForAuth: boolean,\n isPrimary?: boolean,\n}\n\nexport function contactChannelCreateOptionsToCrud(userId: string, options: ContactChannelCreateOptions): ContactChannelsCrud[\"Client\"][\"Create\"] {\n return {\n value: options.value,\n type: options.type,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n user_id: userId,\n };\n}\n\nexport type ContactChannelUpdateOptions = {\n usedForAuth?: boolean,\n value?: string,\n isPrimary?: boolean,\n}\n\nexport function contactChannelUpdateOptionsToCrud(options: ContactChannelUpdateOptions): ContactChannelsCrud[\"Client\"][\"Update\"] {\n return {\n value: options.value,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n\nexport type ServerContactChannel = ContactChannel & {\n update(data: ServerContactChannelUpdateOptions): Promise<void>,\n}\nexport type ServerContactChannelUpdateOptions = ContactChannelUpdateOptions & {\n isVerified?: boolean,\n}\n\nexport function serverContactChannelUpdateOptionsToCrud(options: ServerContactChannelUpdateOptions): ContactChannelsCrud[\"Server\"][\"Update\"] {\n return {\n value: options.value,\n is_verified: options.isVerified,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n\nexport type ServerContactChannelCreateOptions = ContactChannelCreateOptions & {\n isVerified?: boolean,\n}\nexport function serverContactChannelCreateOptionsToCrud(userId: string, options: ServerContactChannelCreateOptions): ContactChannelsCrud[\"Server\"][\"Create\"] {\n return {\n type: options.type,\n value: options.value,\n is_verified: options.isVerified,\n user_id: userId,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n"],"mappings":";AA2BO,SAAS,kCAAkC,QAAgB,SAA+E;AAC/I,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,MAAM,QAAQ;AAAA,IACd,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,IACpB,SAAS;AAAA,EACX;AACF;AAQO,SAAS,kCAAkC,SAA+E;AAC/H,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;AASO,SAAS,wCAAwC,SAAqF;AAC3I,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,aAAa,QAAQ;AAAA,IACrB,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;AAKO,SAAS,wCAAwC,QAAgB,SAAqF;AAC3J,SAAO;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,OAAO,QAAQ;AAAA,IACf,aAAa,QAAQ;AAAA,IACrB,SAAS;AAAA,IACT,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/contact-channels/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ContactChannelsCrud } from \"@stackframe/stack-shared/dist/interface/crud/contact-channels\";\n\n\nexport type ContactChannel = {\n id: string,\n value: string,\n type: 'email',\n isPrimary: boolean,\n isVerified: boolean,\n usedForAuth: boolean,\n\n sendVerificationEmail(options?: { callbackUrl?: string }): Promise<void>,\n update(data: ContactChannelUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n}\n\nexport type ContactChannelCreateOptions = {\n value: string,\n type: 'email',\n usedForAuth: boolean,\n isPrimary?: boolean,\n}\n\nexport function contactChannelCreateOptionsToCrud(userId: string, options: ContactChannelCreateOptions): ContactChannelsCrud[\"Client\"][\"Create\"] {\n return {\n value: options.value,\n type: options.type,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n user_id: userId,\n };\n}\n\nexport type ContactChannelUpdateOptions = {\n usedForAuth?: boolean,\n value?: string,\n isPrimary?: boolean,\n}\n\nexport function contactChannelUpdateOptionsToCrud(options: ContactChannelUpdateOptions): ContactChannelsCrud[\"Client\"][\"Update\"] {\n return {\n value: options.value,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n\nexport type ServerContactChannel = ContactChannel & {\n update(data: ServerContactChannelUpdateOptions): Promise<void>,\n}\nexport type ServerContactChannelUpdateOptions = ContactChannelUpdateOptions & {\n isVerified?: boolean,\n}\n\nexport function serverContactChannelUpdateOptionsToCrud(options: ServerContactChannelUpdateOptions): ContactChannelsCrud[\"Server\"][\"Update\"] {\n return {\n value: options.value,\n is_verified: options.isVerified,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n\nexport type ServerContactChannelCreateOptions = ContactChannelCreateOptions & {\n isVerified?: boolean,\n}\nexport function serverContactChannelCreateOptionsToCrud(userId: string, options: ServerContactChannelCreateOptions): ContactChannelsCrud[\"Server\"][\"Create\"] {\n return {\n type: options.type,\n value: options.value,\n is_verified: options.isVerified,\n user_id: userId,\n used_for_auth: options.usedForAuth,\n is_primary: options.isPrimary,\n };\n}\n"],"mappings":";AA2BO,SAAS,kCAAkC,QAAgB,SAA+E;AAC/I,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,MAAM,QAAQ;AAAA,IACd,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,IACpB,SAAS;AAAA,EACX;AACF;AAQO,SAAS,kCAAkC,SAA+E;AAC/H,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;AASO,SAAS,wCAAwC,SAAqF;AAC3I,SAAO;AAAA,IACL,OAAO,QAAQ;AAAA,IACf,aAAa,QAAQ;AAAA,IACrB,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;AAKO,SAAS,wCAAwC,QAAgB,SAAqF;AAC3J,SAAO;AAAA,IACL,MAAM,QAAQ;AAAA,IACd,OAAO,QAAQ;AAAA,IACf,aAAa,QAAQ;AAAA,IACrB,SAAS;AAAA,IACT,eAAe,QAAQ;AAAA,IACvB,YAAY,QAAQ;AAAA,EACtB;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/email-templates/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { EmailTemplateCrud, EmailTemplateType } from \"@stackframe/stack-shared/dist/interface/crud/email-templates\";\n\n\nexport type AdminEmailTemplate = {\n type: EmailTemplateType,\n subject: string,\n content: any,\n isDefault: boolean,\n}\n\nexport type AdminEmailTemplateUpdateOptions = {\n subject?: string,\n content?: any,\n};\nexport function adminEmailTemplateUpdateOptionsToCrud(options: AdminEmailTemplateUpdateOptions): EmailTemplateCrud['Admin']['Update'] {\n return {\n subject: options.subject,\n content: options.content,\n };\n}\n"],"mappings":";AAkBO,SAAS,sCAAsC,SAAgF;AACpI,SAAO;AAAA,IACL,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EACnB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/email-templates/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { EmailTemplateCrud, EmailTemplateType } from \"@stackframe/stack-shared/dist/interface/crud/email-templates\";\n\n\nexport type AdminEmailTemplate = {\n type: EmailTemplateType,\n subject: string,\n content: any,\n isDefault: boolean,\n}\n\nexport type AdminEmailTemplateUpdateOptions = {\n subject?: string,\n content?: any,\n};\nexport function adminEmailTemplateUpdateOptionsToCrud(options: AdminEmailTemplateUpdateOptions): EmailTemplateCrud['Admin']['Update'] {\n return {\n subject: options.subject,\n content: options.content,\n };\n}\n"],"mappings":";AAkBO,SAAS,sCAAsC,SAAgF;AACpI,SAAO;AAAA,IACL,SAAS,QAAQ;AAAA,IACjB,SAAS,QAAQ;AAAA,EACnB;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/lib/stack-app/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nexport {\n StackAdminApp, StackClientApp,\n StackServerApp\n} from \"./apps\";\nexport type {\n StackAdminAppConstructor,\n StackAdminAppConstructorOptions,\n StackClientAppConstructor,\n StackClientAppConstructorOptions,\n StackClientAppJson,\n StackServerAppConstructor,\n StackServerAppConstructorOptions\n} from \"./apps\";\n\nexport type {\n EmailOutboxListOptions,\n EmailOutboxListResult,\n EmailOutboxUpdateOptions\n} from \"./apps/interfaces/admin-app\";\n\nexport type {\n ProjectConfig\n} from \"./project-configs\";\n\nexport type {\n InternalApiKey,\n InternalApiKeyBase,\n InternalApiKeyBaseCrudRead,\n InternalApiKeyCreateOptions,\n InternalApiKeyFirstView\n} from \"./internal-api-keys\";\n\nexport {\n stackAppInternalsSymbol\n} from \"./common\";\nexport type {\n GetCurrentUserOptions,\n /** @deprecated Use GetCurrentUserOptions instead */\n GetCurrentUserOptions as GetUserOptions,\n HandlerUrls,\n OAuthScopesOnSignIn\n} from \"./common\";\n\nexport type {\n Connection,\n OAuthConnection\n} from \"./connected-accounts\";\n\nexport type {\n ContactChannel,\n ServerContactChannel\n} from \"./contact-channels\";\n\nexport type {\n AdminEmailOutbox,\n AdminEmailOutboxRecipient,\n AdminEmailOutboxSimpleStatus,\n AdminEmailOutboxStatus,\n AdminSentEmail\n} from \"./email\";\n\nexport type {\n AdminProjectPermission,\n AdminProjectPermissionDefinition,\n AdminProjectPermissionDefinitionCreateOptions,\n AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission,\n AdminTeamPermissionDefinition,\n AdminTeamPermissionDefinitionCreateOptions,\n AdminTeamPermissionDefinitionUpdateOptions\n} from \"./permissions\";\n\nexport type {\n AdminDomainConfig,\n AdminEmailConfig,\n AdminOAuthProviderConfig,\n AdminProjectConfig,\n AdminProjectConfigUpdateOptions,\n OAuthProviderConfig\n} from \"./project-configs\";\n\nexport type {\n AdminOwnedProject,\n AdminProject,\n AdminProjectCreateOptions,\n AdminProjectUpdateOptions,\n Project\n} from \"./projects\";\n\nexport type {\n EditableTeamMemberProfile,\n ServerListUsersOptions,\n ServerTeam,\n ServerTeamCreateOptions,\n ServerTeamMemberProfile,\n ServerTeamUpdateOptions,\n ServerTeamUser,\n Team,\n TeamCreateOptions,\n TeamInvitation,\n TeamMemberProfile,\n TeamUpdateOptions,\n TeamUser\n} from \"./teams\";\n\nexport type {\n Auth,\n CurrentInternalServerUser,\n CurrentInternalUser,\n CurrentServerUser,\n CurrentUser,\n OAuthProvider,\n ServerOAuthProvider,\n ServerUser,\n User\n} from \"./users\";\n\n"],"mappings":";AAIA;AAAA,EACE;AAAA,EAAe;AAAA,EACf;AAAA,OACK;AA6BP;AAAA,EACE;AAAA,OACK;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/lib/stack-app/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nexport {\n StackAdminApp, StackClientApp,\n StackServerApp\n} from \"./apps\";\nexport type {\n StackAdminAppConstructor,\n StackAdminAppConstructorOptions,\n StackClientAppConstructor,\n StackClientAppConstructorOptions,\n StackClientAppJson,\n StackServerAppConstructor,\n StackServerAppConstructorOptions\n} from \"./apps\";\n\nexport type {\n EmailOutboxListOptions,\n EmailOutboxListResult,\n EmailOutboxUpdateOptions\n} from \"./apps/interfaces/admin-app\";\n\nexport type {\n ProjectConfig\n} from \"./project-configs\";\n\nexport type {\n InternalApiKey,\n InternalApiKeyBase,\n InternalApiKeyBaseCrudRead,\n InternalApiKeyCreateOptions,\n InternalApiKeyFirstView\n} from \"./internal-api-keys\";\n\nexport {\n stackAppInternalsSymbol\n} from \"./common\";\nexport type {\n GetCurrentUserOptions,\n /** @deprecated Use GetCurrentUserOptions instead */\n GetCurrentUserOptions as GetUserOptions,\n HandlerUrls,\n OAuthScopesOnSignIn\n} from \"./common\";\n\nexport type {\n Connection,\n OAuthConnection\n} from \"./connected-accounts\";\n\nexport type {\n ContactChannel,\n ServerContactChannel\n} from \"./contact-channels\";\n\nexport type {\n AdminEmailOutbox,\n AdminEmailOutboxRecipient,\n AdminEmailOutboxSimpleStatus,\n AdminEmailOutboxStatus,\n AdminSentEmail\n} from \"./email\";\n\nexport type {\n AdminProjectPermission,\n AdminProjectPermissionDefinition,\n AdminProjectPermissionDefinitionCreateOptions,\n AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission,\n AdminTeamPermissionDefinition,\n AdminTeamPermissionDefinitionCreateOptions,\n AdminTeamPermissionDefinitionUpdateOptions\n} from \"./permissions\";\n\nexport type {\n AdminDomainConfig,\n AdminEmailConfig,\n AdminOAuthProviderConfig,\n AdminProjectConfig,\n AdminProjectConfigUpdateOptions,\n OAuthProviderConfig\n} from \"./project-configs\";\n\nexport type {\n AdminOwnedProject,\n AdminProject,\n AdminProjectCreateOptions,\n AdminProjectUpdateOptions,\n Project\n} from \"./projects\";\n\nexport type {\n EditableTeamMemberProfile,\n ServerListUsersOptions,\n ServerTeam,\n ServerTeamCreateOptions,\n ServerTeamMemberProfile,\n ServerTeamUpdateOptions,\n ServerTeamUser,\n Team,\n TeamCreateOptions,\n TeamInvitation,\n TeamMemberProfile,\n TeamUpdateOptions,\n TeamUser\n} from \"./teams\";\n\nexport type {\n Auth,\n CurrentInternalServerUser,\n CurrentInternalUser,\n CurrentServerUser,\n CurrentUser,\n OAuthProvider,\n ServerOAuthProvider,\n ServerUser,\n User\n} from \"./users\";\n\n"],"mappings":";AAIA;AAAA,EACE;AAAA,EAAe;AAAA,EACf;AAAA,OACK;AA6BP;AAAA,EACE;AAAA,OACK;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/internal-api-keys/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\n\nimport { InternalApiKeyCreateCrudRequest } from \"@stackframe/stack-shared/dist/interface/admin-interface\";\nimport { InternalApiKeysCrud } from \"@stackframe/stack-shared/dist/interface/crud/internal-api-keys\";\n\nexport type InternalApiKeyBase = {\n id: string,\n description: string,\n expiresAt: Date,\n manuallyRevokedAt: Date | null,\n createdAt: Date,\n isValid(): boolean,\n whyInvalid(): \"expired\" | \"manually-revoked\" | null,\n revoke(): Promise<void>,\n};\n\nexport type InternalApiKeyBaseCrudRead = Pick<InternalApiKeysCrud[\"Admin\"][\"Read\"], \"id\" | \"created_at_millis\" | \"description\" | \"expires_at_millis\" | \"manually_revoked_at_millis\">;\n\nexport type InternalApiKeyFirstView = {\n publishableClientKey?: string,\n secretServerKey?: string,\n superSecretAdminKey?: string,\n} & InternalApiKeyBase;\n\nexport type InternalApiKey = {\n publishableClientKey: null | {\n lastFour: string,\n },\n secretServerKey: null | {\n lastFour: string,\n },\n superSecretAdminKey: null | {\n lastFour: string,\n },\n} & InternalApiKeyBase;\n\nexport type InternalApiKeyCreateOptions = {\n description: string,\n expiresAt: Date,\n hasPublishableClientKey: boolean,\n hasSecretServerKey: boolean,\n hasSuperSecretAdminKey: boolean,\n};\nexport function internalApiKeyCreateOptionsToCrud(options: InternalApiKeyCreateOptions): InternalApiKeyCreateCrudRequest {\n return {\n description: options.description,\n expires_at_millis: options.expiresAt.getTime(),\n has_publishable_client_key: options.hasPublishableClientKey,\n has_secret_server_key: options.hasSecretServerKey,\n has_super_secret_admin_key: options.hasSuperSecretAdminKey,\n };\n}\n"],"mappings":";AA8CO,SAAS,kCAAkC,SAAuE;AACvH,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,mBAAmB,QAAQ,UAAU,QAAQ;AAAA,IAC7C,4BAA4B,QAAQ;AAAA,IACpC,uBAAuB,QAAQ;AAAA,IAC/B,4BAA4B,QAAQ;AAAA,EACtC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/internal-api-keys/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\n\nimport { InternalApiKeyCreateCrudRequest } from \"@stackframe/stack-shared/dist/interface/admin-interface\";\nimport { InternalApiKeysCrud } from \"@stackframe/stack-shared/dist/interface/crud/internal-api-keys\";\n\nexport type InternalApiKeyBase = {\n id: string,\n description: string,\n expiresAt: Date,\n manuallyRevokedAt: Date | null,\n createdAt: Date,\n isValid(): boolean,\n whyInvalid(): \"expired\" | \"manually-revoked\" | null,\n revoke(): Promise<void>,\n};\n\nexport type InternalApiKeyBaseCrudRead = Pick<InternalApiKeysCrud[\"Admin\"][\"Read\"], \"id\" | \"created_at_millis\" | \"description\" | \"expires_at_millis\" | \"manually_revoked_at_millis\">;\n\nexport type InternalApiKeyFirstView = {\n publishableClientKey?: string,\n secretServerKey?: string,\n superSecretAdminKey?: string,\n} & InternalApiKeyBase;\n\nexport type InternalApiKey = {\n publishableClientKey: null | {\n lastFour: string,\n },\n secretServerKey: null | {\n lastFour: string,\n },\n superSecretAdminKey: null | {\n lastFour: string,\n },\n} & InternalApiKeyBase;\n\nexport type InternalApiKeyCreateOptions = {\n description: string,\n expiresAt: Date,\n hasPublishableClientKey: boolean,\n hasSecretServerKey: boolean,\n hasSuperSecretAdminKey: boolean,\n};\nexport function internalApiKeyCreateOptionsToCrud(options: InternalApiKeyCreateOptions): InternalApiKeyCreateCrudRequest {\n return {\n description: options.description,\n expires_at_millis: options.expiresAt.getTime(),\n has_publishable_client_key: options.hasPublishableClientKey,\n has_secret_server_key: options.hasSecretServerKey,\n has_super_secret_admin_key: options.hasSuperSecretAdminKey,\n };\n}\n"],"mappings":";AA8CO,SAAS,kCAAkC,SAAuE;AACvH,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,mBAAmB,QAAQ,UAAU,QAAQ;AAAA,IAC7C,4BAA4B,QAAQ;AAAA,IACpC,uBAAuB,QAAQ;AAAA,IAC/B,4BAA4B,QAAQ;AAAA,EACtC;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/permissions/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ProjectPermissionDefinitionsCrud } from \"@stackframe/stack-shared/dist/interface/crud/project-permissions\";\nimport { TeamPermissionDefinitionsCrud } from \"@stackframe/stack-shared/dist/interface/crud/team-permissions\";\n\n\nexport type TeamPermission = {\n id: string,\n};\n\nexport type AdminTeamPermission = TeamPermission;\n\nexport type AdminTeamPermissionDefinition = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n isDefaultUserPermission?: boolean,\n};\n\nexport type AdminTeamPermissionDefinitionCreateOptions = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n isDefaultUserPermission?: boolean,\n};\nexport function adminTeamPermissionDefinitionCreateOptionsToCrud(options: AdminTeamPermissionDefinitionCreateOptions): TeamPermissionDefinitionsCrud[\"Admin\"][\"Create\"] {\n return {\n id: options.id,\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type AdminTeamPermissionDefinitionUpdateOptions = Pick<Partial<AdminTeamPermissionDefinitionCreateOptions>, \"description\" | \"containedPermissionIds\">;\nexport function adminTeamPermissionDefinitionUpdateOptionsToCrud(options: AdminTeamPermissionDefinitionUpdateOptions): TeamPermissionDefinitionsCrud[\"Admin\"][\"Update\"] {\n return {\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type ProjectPermission = {\n id: string,\n};\n\nexport type AdminProjectPermission = ProjectPermission;\n\nexport type AdminProjectPermissionDefinition = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n};\n\nexport type AdminProjectPermissionDefinitionCreateOptions = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n};\nexport function adminProjectPermissionDefinitionCreateOptionsToCrud(options: AdminProjectPermissionDefinitionCreateOptions): ProjectPermissionDefinitionsCrud[\"Admin\"][\"Create\"] {\n return {\n id: options.id,\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type AdminProjectPermissionDefinitionUpdateOptions = Pick<Partial<AdminProjectPermissionDefinitionCreateOptions>, \"description\" | \"containedPermissionIds\">;\nexport function adminProjectPermissionDefinitionUpdateOptionsToCrud(options: AdminProjectPermissionDefinitionUpdateOptions): ProjectPermissionDefinitionsCrud[\"Admin\"][\"Update\"] {\n return {\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n"],"mappings":";AA2BO,SAAS,iDAAiD,SAAuG;AACtK,SAAO;AAAA,IACL,IAAI,QAAQ;AAAA,IACZ,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAGO,SAAS,iDAAiD,SAAuG;AACtK,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAmBO,SAAS,oDAAoD,SAA6G;AAC/K,SAAO;AAAA,IACL,IAAI,QAAQ;AAAA,IACZ,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAGO,SAAS,oDAAoD,SAA6G;AAC/K,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/permissions/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ProjectPermissionDefinitionsCrud } from \"@stackframe/stack-shared/dist/interface/crud/project-permissions\";\nimport { TeamPermissionDefinitionsCrud } from \"@stackframe/stack-shared/dist/interface/crud/team-permissions\";\n\n\nexport type TeamPermission = {\n id: string,\n};\n\nexport type AdminTeamPermission = TeamPermission;\n\nexport type AdminTeamPermissionDefinition = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n isDefaultUserPermission?: boolean,\n};\n\nexport type AdminTeamPermissionDefinitionCreateOptions = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n isDefaultUserPermission?: boolean,\n};\nexport function adminTeamPermissionDefinitionCreateOptionsToCrud(options: AdminTeamPermissionDefinitionCreateOptions): TeamPermissionDefinitionsCrud[\"Admin\"][\"Create\"] {\n return {\n id: options.id,\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type AdminTeamPermissionDefinitionUpdateOptions = Pick<Partial<AdminTeamPermissionDefinitionCreateOptions>, \"description\" | \"containedPermissionIds\">;\nexport function adminTeamPermissionDefinitionUpdateOptionsToCrud(options: AdminTeamPermissionDefinitionUpdateOptions): TeamPermissionDefinitionsCrud[\"Admin\"][\"Update\"] {\n return {\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type ProjectPermission = {\n id: string,\n};\n\nexport type AdminProjectPermission = ProjectPermission;\n\nexport type AdminProjectPermissionDefinition = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n};\n\nexport type AdminProjectPermissionDefinitionCreateOptions = {\n id: string,\n description?: string,\n containedPermissionIds: string[],\n};\nexport function adminProjectPermissionDefinitionCreateOptionsToCrud(options: AdminProjectPermissionDefinitionCreateOptions): ProjectPermissionDefinitionsCrud[\"Admin\"][\"Create\"] {\n return {\n id: options.id,\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n\nexport type AdminProjectPermissionDefinitionUpdateOptions = Pick<Partial<AdminProjectPermissionDefinitionCreateOptions>, \"description\" | \"containedPermissionIds\">;\nexport function adminProjectPermissionDefinitionUpdateOptionsToCrud(options: AdminProjectPermissionDefinitionUpdateOptions): ProjectPermissionDefinitionsCrud[\"Admin\"][\"Update\"] {\n return {\n description: options.description,\n contained_permission_ids: options.containedPermissionIds,\n };\n}\n"],"mappings":";AA2BO,SAAS,iDAAiD,SAAuG;AACtK,SAAO;AAAA,IACL,IAAI,QAAQ;AAAA,IACZ,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAGO,SAAS,iDAAiD,SAAuG;AACtK,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAmBO,SAAS,oDAAoD,SAA6G;AAC/K,SAAO;AAAA,IACL,IAAI,QAAQ;AAAA,IACZ,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;AAGO,SAAS,oDAAoD,SAA6G;AAC/K,SAAO;AAAA,IACL,aAAa,QAAQ;AAAA,IACrB,0BAA0B,QAAQ;AAAA,EACpC;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/projects/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ProductionModeError } from \"@stackframe/stack-shared/dist/helpers/production-mode\";\nimport { AdminUserProjectsCrud, ProjectsCrud } from \"@stackframe/stack-shared/dist/interface/crud/projects\";\n\nimport { CompleteConfig, EnvironmentConfigNormalizedOverride, EnvironmentConfigOverrideOverride } from \"@stackframe/stack-shared/dist/config/schema\";\nimport { StackAdminApp } from \"../apps/interfaces/admin-app\";\nimport { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from \"../project-configs\";\n\n\nexport type Project = {\n readonly id: string,\n readonly displayName: string,\n readonly config: ProjectConfig,\n};\n\nexport type AdminProject = {\n readonly id: string,\n readonly displayName: string,\n readonly description: string | null,\n readonly createdAt: Date,\n readonly isProductionMode: boolean,\n readonly ownerTeamId: string | null,\n readonly logoUrl: string | null | undefined,\n readonly logoFullUrl: string | null | undefined,\n readonly logoDarkModeUrl: string | null | undefined,\n readonly logoFullDarkModeUrl: string | null | undefined,\n\n readonly config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getConfig(this: AdminProject): Promise<CompleteConfig>,\n\n // We have some strict types here in order to prevent accidental overwriting of a top-level property of a config object\n updateConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride & {\n [K in keyof EnvironmentConfigNormalizedOverride]: \"............................ERROR MESSAGE AFTER THIS LINE............................ You have attempted to update a config object with a top-level property in it (for example `emails`). This is very likely a mistake, and you probably meant to update a nested property instead (for example `emails.server`). If you really meant to update a top-level property (resetting all nested properties to their defaults), cast as any (the code will work at runtime) ............................ERROR MESSAGE BEFORE THIS LINE............................\";\n }\n ): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n} & Project;\n\nexport type AdminOwnedProject = {\n readonly app: StackAdminApp<false>,\n} & AdminProject;\n\nexport type AdminProjectUpdateOptions = {\n displayName?: string,\n description?: string,\n isProductionMode?: boolean,\n logoUrl?: string | null,\n logoFullUrl?: string | null,\n logoDarkModeUrl?: string | null,\n logoFullDarkModeUrl?: string | null,\n config?: AdminProjectConfigUpdateOptions,\n};\nexport function adminProjectUpdateOptionsToCrud(options: AdminProjectUpdateOptions): ProjectsCrud[\"Admin\"][\"Update\"] {\n return {\n display_name: options.displayName,\n description: options.description,\n is_production_mode: options.isProductionMode,\n logo_url: options.logoUrl,\n logo_full_url: options.logoFullUrl,\n logo_dark_mode_url: options.logoDarkModeUrl,\n logo_full_dark_mode_url: options.logoFullDarkModeUrl,\n /**\n * NOTE: Do not update this config anymore. It's been superseded by the new config in schema.ts.\n * @deprecated\n */\n config: {\n domains: options.config?.domains?.map((d) => ({\n domain: d.domain,\n handler_path: d.handlerPath\n })),\n oauth_providers: options.config?.oauthProviders?.map((p) => ({\n id: p.id as any,\n type: p.type,\n ...(p.type === 'standard' && {\n client_id: p.clientId,\n client_secret: p.clientSecret,\n facebook_config_id: p.facebookConfigId,\n microsoft_tenant_id: p.microsoftTenantId,\n }),\n })),\n email_config: options.config?.emailConfig && (\n options.config.emailConfig.type === 'shared' ? {\n type: 'shared',\n } : {\n type: 'standard',\n host: options.config.emailConfig.host,\n port: options.config.emailConfig.port,\n username: options.config.emailConfig.username,\n password: options.config.emailConfig.password,\n sender_name: options.config.emailConfig.senderName,\n sender_email: options.config.emailConfig.senderEmail,\n }\n ),\n email_theme: options.config?.emailTheme,\n sign_up_enabled: options.config?.signUpEnabled,\n credential_enabled: options.config?.credentialEnabled,\n magic_link_enabled: options.config?.magicLinkEnabled,\n passkey_enabled: options.config?.passkeyEnabled,\n allow_localhost: options.config?.allowLocalhost,\n create_team_on_sign_up: options.config?.createTeamOnSignUp,\n client_team_creation_enabled: options.config?.clientTeamCreationEnabled,\n client_user_deletion_enabled: options.config?.clientUserDeletionEnabled,\n team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,\n team_member_default_permissions: options.config?.teamMemberDefaultPermissions,\n user_default_permissions: options.config?.userDefaultPermissions,\n oauth_account_merge_strategy: options.config?.oauthAccountMergeStrategy,\n allow_user_api_keys: options.config?.allowUserApiKeys,\n allow_team_api_keys: options.config?.allowTeamApiKeys,\n },\n };\n}\n\nexport type AdminProjectCreateOptions = Omit<AdminProjectUpdateOptions, 'displayName'> & {\n displayName: string,\n teamId: string,\n};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n owner_team_id: options.teamId,\n };\n}\n"],"mappings":";AA8DO,SAAS,gCAAgC,SAAqE;AACnH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,aAAa,QAAQ;AAAA,IACrB,oBAAoB,QAAQ;AAAA,IAC5B,UAAU,QAAQ;AAAA,IAClB,eAAe,QAAQ;AAAA,IACvB,oBAAoB,QAAQ;AAAA,IAC5B,yBAAyB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjC,QAAQ;AAAA,MACN,SAAS,QAAQ,QAAQ,SAAS,IAAI,CAAC,OAAO;AAAA,QAC5C,QAAQ,EAAE;AAAA,QACV,cAAc,EAAE;AAAA,MAClB,EAAE;AAAA,MACF,iBAAiB,QAAQ,QAAQ,gBAAgB,IAAI,CAAC,OAAO;AAAA,QAC3D,IAAI,EAAE;AAAA,QACN,MAAM,EAAE;AAAA,QACR,GAAI,EAAE,SAAS,cAAc;AAAA,UAC3B,WAAW,EAAE;AAAA,UACb,eAAe,EAAE;AAAA,UACjB,oBAAoB,EAAE;AAAA,UACtB,qBAAqB,EAAE;AAAA,QACzB;AAAA,MACF,EAAE;AAAA,MACF,cAAc,QAAQ,QAAQ,gBAC5B,QAAQ,OAAO,YAAY,SAAS,WAAW;AAAA,QAC7C,MAAM;AAAA,MACR,IAAI;AAAA,QACF,MAAM;AAAA,QACN,MAAM,QAAQ,OAAO,YAAY;AAAA,QACjC,MAAM,QAAQ,OAAO,YAAY;AAAA,QACjC,UAAU,QAAQ,OAAO,YAAY;AAAA,QACrC,UAAU,QAAQ,OAAO,YAAY;AAAA,QACrC,aAAa,QAAQ,OAAO,YAAY;AAAA,QACxC,cAAc,QAAQ,OAAO,YAAY;AAAA,MAC3C;AAAA,MAEF,aAAa,QAAQ,QAAQ;AAAA,MAC7B,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,oBAAoB,QAAQ,QAAQ;AAAA,MACpC,oBAAoB,QAAQ,QAAQ;AAAA,MACpC,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,wBAAwB,QAAQ,QAAQ;AAAA,MACxC,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,kCAAkC,QAAQ,QAAQ;AAAA,MAClD,iCAAiC,QAAQ,QAAQ;AAAA,MACjD,0BAA0B,QAAQ,QAAQ;AAAA,MAC1C,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,qBAAqB,QAAQ,QAAQ;AAAA,MACrC,qBAAqB,QAAQ,QAAQ;AAAA,IACvC;AAAA,EACF;AACF;AAMO,SAAS,gCAAgC,SAA+E;AAC7H,SAAO;AAAA,IACL,GAAG,gCAAgC,OAAO;AAAA,IAC1C,cAAc,QAAQ;AAAA,IACtB,eAAe,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/projects/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { ProductionModeError } from \"@stackframe/stack-shared/dist/helpers/production-mode\";\nimport { AdminUserProjectsCrud, ProjectsCrud } from \"@stackframe/stack-shared/dist/interface/crud/projects\";\n\nimport { CompleteConfig, EnvironmentConfigNormalizedOverride, EnvironmentConfigOverrideOverride } from \"@stackframe/stack-shared/dist/config/schema\";\nimport { StackAdminApp } from \"../apps/interfaces/admin-app\";\nimport { AdminProjectConfig, AdminProjectConfigUpdateOptions, ProjectConfig } from \"../project-configs\";\n\n\nexport type Project = {\n readonly id: string,\n readonly displayName: string,\n readonly config: ProjectConfig,\n};\n\nexport type AdminProject = {\n readonly id: string,\n readonly displayName: string,\n readonly description: string | null,\n readonly createdAt: Date,\n readonly isProductionMode: boolean,\n readonly ownerTeamId: string | null,\n readonly logoUrl: string | null | undefined,\n readonly logoFullUrl: string | null | undefined,\n readonly logoDarkModeUrl: string | null | undefined,\n readonly logoFullDarkModeUrl: string | null | undefined,\n\n readonly config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getConfig(this: AdminProject): Promise<CompleteConfig>,\n\n // We have some strict types here in order to prevent accidental overwriting of a top-level property of a config object\n updateConfig(\n this: AdminProject,\n config: EnvironmentConfigOverrideOverride & {\n [K in keyof EnvironmentConfigNormalizedOverride]: \"............................ERROR MESSAGE AFTER THIS LINE............................ You have attempted to update a config object with a top-level property in it (for example `emails`). This is very likely a mistake, and you probably meant to update a nested property instead (for example `emails.server`). If you really meant to update a top-level property (resetting all nested properties to their defaults), cast as any (the code will work at runtime) ............................ERROR MESSAGE BEFORE THIS LINE............................\";\n }\n ): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n} & Project;\n\nexport type AdminOwnedProject = {\n readonly app: StackAdminApp<false>,\n} & AdminProject;\n\nexport type AdminProjectUpdateOptions = {\n displayName?: string,\n description?: string,\n isProductionMode?: boolean,\n logoUrl?: string | null,\n logoFullUrl?: string | null,\n logoDarkModeUrl?: string | null,\n logoFullDarkModeUrl?: string | null,\n config?: AdminProjectConfigUpdateOptions,\n};\nexport function adminProjectUpdateOptionsToCrud(options: AdminProjectUpdateOptions): ProjectsCrud[\"Admin\"][\"Update\"] {\n return {\n display_name: options.displayName,\n description: options.description,\n is_production_mode: options.isProductionMode,\n logo_url: options.logoUrl,\n logo_full_url: options.logoFullUrl,\n logo_dark_mode_url: options.logoDarkModeUrl,\n logo_full_dark_mode_url: options.logoFullDarkModeUrl,\n /**\n * NOTE: Do not update this config anymore. It's been superseded by the new config in schema.ts.\n * @deprecated\n */\n config: {\n domains: options.config?.domains?.map((d) => ({\n domain: d.domain,\n handler_path: d.handlerPath\n })),\n oauth_providers: options.config?.oauthProviders?.map((p) => ({\n id: p.id as any,\n type: p.type,\n ...(p.type === 'standard' && {\n client_id: p.clientId,\n client_secret: p.clientSecret,\n facebook_config_id: p.facebookConfigId,\n microsoft_tenant_id: p.microsoftTenantId,\n }),\n })),\n email_config: options.config?.emailConfig && (\n options.config.emailConfig.type === 'shared' ? {\n type: 'shared',\n } : {\n type: 'standard',\n host: options.config.emailConfig.host,\n port: options.config.emailConfig.port,\n username: options.config.emailConfig.username,\n password: options.config.emailConfig.password,\n sender_name: options.config.emailConfig.senderName,\n sender_email: options.config.emailConfig.senderEmail,\n }\n ),\n email_theme: options.config?.emailTheme,\n sign_up_enabled: options.config?.signUpEnabled,\n credential_enabled: options.config?.credentialEnabled,\n magic_link_enabled: options.config?.magicLinkEnabled,\n passkey_enabled: options.config?.passkeyEnabled,\n allow_localhost: options.config?.allowLocalhost,\n create_team_on_sign_up: options.config?.createTeamOnSignUp,\n client_team_creation_enabled: options.config?.clientTeamCreationEnabled,\n client_user_deletion_enabled: options.config?.clientUserDeletionEnabled,\n team_creator_default_permissions: options.config?.teamCreatorDefaultPermissions,\n team_member_default_permissions: options.config?.teamMemberDefaultPermissions,\n user_default_permissions: options.config?.userDefaultPermissions,\n oauth_account_merge_strategy: options.config?.oauthAccountMergeStrategy,\n allow_user_api_keys: options.config?.allowUserApiKeys,\n allow_team_api_keys: options.config?.allowTeamApiKeys,\n },\n };\n}\n\nexport type AdminProjectCreateOptions = Omit<AdminProjectUpdateOptions, 'displayName'> & {\n displayName: string,\n teamId: string,\n};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n owner_team_id: options.teamId,\n };\n}\n"],"mappings":";AA8DO,SAAS,gCAAgC,SAAqE;AACnH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,aAAa,QAAQ;AAAA,IACrB,oBAAoB,QAAQ;AAAA,IAC5B,UAAU,QAAQ;AAAA,IAClB,eAAe,QAAQ;AAAA,IACvB,oBAAoB,QAAQ;AAAA,IAC5B,yBAAyB,QAAQ;AAAA;AAAA;AAAA;AAAA;AAAA,IAKjC,QAAQ;AAAA,MACN,SAAS,QAAQ,QAAQ,SAAS,IAAI,CAAC,OAAO;AAAA,QAC5C,QAAQ,EAAE;AAAA,QACV,cAAc,EAAE;AAAA,MAClB,EAAE;AAAA,MACF,iBAAiB,QAAQ,QAAQ,gBAAgB,IAAI,CAAC,OAAO;AAAA,QAC3D,IAAI,EAAE;AAAA,QACN,MAAM,EAAE;AAAA,QACR,GAAI,EAAE,SAAS,cAAc;AAAA,UAC3B,WAAW,EAAE;AAAA,UACb,eAAe,EAAE;AAAA,UACjB,oBAAoB,EAAE;AAAA,UACtB,qBAAqB,EAAE;AAAA,QACzB;AAAA,MACF,EAAE;AAAA,MACF,cAAc,QAAQ,QAAQ,gBAC5B,QAAQ,OAAO,YAAY,SAAS,WAAW;AAAA,QAC7C,MAAM;AAAA,MACR,IAAI;AAAA,QACF,MAAM;AAAA,QACN,MAAM,QAAQ,OAAO,YAAY;AAAA,QACjC,MAAM,QAAQ,OAAO,YAAY;AAAA,QACjC,UAAU,QAAQ,OAAO,YAAY;AAAA,QACrC,UAAU,QAAQ,OAAO,YAAY;AAAA,QACrC,aAAa,QAAQ,OAAO,YAAY;AAAA,QACxC,cAAc,QAAQ,OAAO,YAAY;AAAA,MAC3C;AAAA,MAEF,aAAa,QAAQ,QAAQ;AAAA,MAC7B,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,oBAAoB,QAAQ,QAAQ;AAAA,MACpC,oBAAoB,QAAQ,QAAQ;AAAA,MACpC,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,iBAAiB,QAAQ,QAAQ;AAAA,MACjC,wBAAwB,QAAQ,QAAQ;AAAA,MACxC,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,kCAAkC,QAAQ,QAAQ;AAAA,MAClD,iCAAiC,QAAQ,QAAQ;AAAA,MACjD,0BAA0B,QAAQ,QAAQ;AAAA,MAC1C,8BAA8B,QAAQ,QAAQ;AAAA,MAC9C,qBAAqB,QAAQ,QAAQ;AAAA,MACrC,qBAAqB,QAAQ,QAAQ;AAAA,IACvC;AAAA,EACF;AACF;AAMO,SAAS,gCAAgC,SAA+E;AAC7H,SAAO;AAAA,IACL,GAAG,gCAAgC,OAAO;AAAA,IAC1C,cAAc,QAAQ;AAAA,IACtB,eAAe,QAAQ;AAAA,EACzB;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/teams/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { TeamsCrud } from \"@stackframe/stack-shared/dist/interface/crud/teams\";\nimport { ReadonlyJson } from \"@stackframe/stack-shared/dist/utils/json\";\n\nimport { ApiKeyCreationOptions, TeamApiKey, TeamApiKeyFirstView } from \"../api-keys\";\nimport { AsyncStoreProperty } from \"../common\";\nimport { Customer } from \"../customers\";\nimport { ServerUser } from \"../users\";\n\n\nexport type TeamMemberProfile = {\n displayName: string | null,\n profileImageUrl: string | null,\n}\n\nexport type TeamMemberProfileUpdateOptions = {\n displayName?: string,\n profileImageUrl?: string | null,\n};\n\nexport type EditableTeamMemberProfile = TeamMemberProfile & {\n update(update: TeamMemberProfileUpdateOptions): Promise<void>,\n}\n\nexport type TeamUser = {\n id: string,\n teamProfile: TeamMemberProfile,\n}\n\nexport type TeamInvitation = {\n id: string,\n recipientEmail: string | null,\n expiresAt: Date,\n revoke(): Promise<void>,\n}\n\nexport type Team = {\n id: string,\n displayName: string,\n profileImageUrl: string | null,\n clientMetadata: any,\n clientReadOnlyMetadata: any,\n inviteUser(options: { email: string, callbackUrl?: string }): Promise<void>,\n listUsers(): Promise<TeamUser[]>,\n listInvitations(): Promise<TeamInvitation[]>,\n update(update: TeamUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n createApiKey(options: ApiKeyCreationOptions<\"team\">): Promise<TeamApiKeyFirstView>,\n} & AsyncStoreProperty<\"apiKeys\", [], TeamApiKey[], true> & Customer;\n\nexport type TeamUpdateOptions = {\n displayName?: string,\n profileImageUrl?: string | null,\n clientMetadata?: ReadonlyJson,\n};\nexport function teamUpdateOptionsToCrud(options: TeamUpdateOptions): TeamsCrud[\"Client\"][\"Update\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n client_metadata: options.clientMetadata,\n };\n}\n\nexport type TeamCreateOptions = {\n displayName: string,\n profileImageUrl?: string,\n}\nexport function teamCreateOptionsToCrud(options: TeamCreateOptions, creatorUserId: string): TeamsCrud[\"Client\"][\"Create\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n creator_user_id: creatorUserId,\n };\n}\n\n\nexport type ServerTeamMemberProfile = TeamMemberProfile;\n\nexport type ServerTeamUser = ServerUser & {\n teamProfile: ServerTeamMemberProfile,\n}\n\nexport type ServerTeam = {\n createdAt: Date,\n serverMetadata: any,\n listUsers(): Promise<ServerTeamUser[]>,\n update(update: ServerTeamUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n addUser(userId: string): Promise<void>,\n inviteUser(options: { email: string, callbackUrl?: string }): Promise<void>,\n removeUser(userId: string): Promise<void>,\n} & Team;\n\nexport type ServerListUsersOptions = {\n cursor?: string,\n limit?: number,\n orderBy?: 'signedUpAt',\n desc?: boolean,\n query?: string,\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements).\n * Defaults to false.\n */\n includeRestricted?: boolean,\n /**\n * Whether to include anonymous users (and restricted users).\n * Defaults to false.\n */\n includeAnonymous?: boolean,\n};\n\nexport type ServerTeamCreateOptions = TeamCreateOptions & {\n creatorUserId?: string,\n};\nexport function serverTeamCreateOptionsToCrud(options: ServerTeamCreateOptions): TeamsCrud[\"Server\"][\"Create\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n creator_user_id: options.creatorUserId,\n };\n}\n\nexport type ServerTeamUpdateOptions = TeamUpdateOptions & {\n clientReadOnlyMetadata?: ReadonlyJson,\n serverMetadata?: ReadonlyJson,\n};\nexport function serverTeamUpdateOptionsToCrud(options: ServerTeamUpdateOptions): TeamsCrud[\"Server\"][\"Update\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n };\n}\n"],"mappings":";AA0DO,SAAS,wBAAwB,SAA2D;AACjG,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,EAC3B;AACF;AAMO,SAAS,wBAAwB,SAA4B,eAAsD;AACxH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB;AAAA,EACnB;AACF;AAyCO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,EAC3B;AACF;AAMO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,EAC3B;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/teams/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { TeamsCrud } from \"@stackframe/stack-shared/dist/interface/crud/teams\";\nimport { ReadonlyJson } from \"@stackframe/stack-shared/dist/utils/json\";\n\nimport { ApiKeyCreationOptions, TeamApiKey, TeamApiKeyFirstView } from \"../api-keys\";\nimport { AsyncStoreProperty } from \"../common\";\nimport { Customer } from \"../customers\";\nimport { ServerUser } from \"../users\";\n\n\nexport type TeamMemberProfile = {\n displayName: string | null,\n profileImageUrl: string | null,\n}\n\nexport type TeamMemberProfileUpdateOptions = {\n displayName?: string,\n profileImageUrl?: string | null,\n};\n\nexport type EditableTeamMemberProfile = TeamMemberProfile & {\n update(update: TeamMemberProfileUpdateOptions): Promise<void>,\n}\n\nexport type TeamUser = {\n id: string,\n teamProfile: TeamMemberProfile,\n}\n\nexport type TeamInvitation = {\n id: string,\n recipientEmail: string | null,\n expiresAt: Date,\n revoke(): Promise<void>,\n}\n\nexport type Team = {\n id: string,\n displayName: string,\n profileImageUrl: string | null,\n clientMetadata: any,\n clientReadOnlyMetadata: any,\n inviteUser(options: { email: string, callbackUrl?: string }): Promise<void>,\n listUsers(): Promise<TeamUser[]>,\n listInvitations(): Promise<TeamInvitation[]>,\n update(update: TeamUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n createApiKey(options: ApiKeyCreationOptions<\"team\">): Promise<TeamApiKeyFirstView>,\n} & AsyncStoreProperty<\"apiKeys\", [], TeamApiKey[], true> & Customer;\n\nexport type TeamUpdateOptions = {\n displayName?: string,\n profileImageUrl?: string | null,\n clientMetadata?: ReadonlyJson,\n};\nexport function teamUpdateOptionsToCrud(options: TeamUpdateOptions): TeamsCrud[\"Client\"][\"Update\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n client_metadata: options.clientMetadata,\n };\n}\n\nexport type TeamCreateOptions = {\n displayName: string,\n profileImageUrl?: string,\n}\nexport function teamCreateOptionsToCrud(options: TeamCreateOptions, creatorUserId: string): TeamsCrud[\"Client\"][\"Create\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n creator_user_id: creatorUserId,\n };\n}\n\n\nexport type ServerTeamMemberProfile = TeamMemberProfile;\n\nexport type ServerTeamUser = ServerUser & {\n teamProfile: ServerTeamMemberProfile,\n}\n\nexport type ServerTeam = {\n createdAt: Date,\n serverMetadata: any,\n listUsers(): Promise<ServerTeamUser[]>,\n update(update: ServerTeamUpdateOptions): Promise<void>,\n delete(): Promise<void>,\n addUser(userId: string): Promise<void>,\n inviteUser(options: { email: string, callbackUrl?: string }): Promise<void>,\n removeUser(userId: string): Promise<void>,\n} & Team;\n\nexport type ServerListUsersOptions = {\n cursor?: string,\n limit?: number,\n orderBy?: 'signedUpAt',\n desc?: boolean,\n query?: string,\n /**\n * Whether to include restricted users (users who haven't completed onboarding requirements).\n * Defaults to false.\n */\n includeRestricted?: boolean,\n /**\n * Whether to include anonymous users (and restricted users).\n * Defaults to false.\n */\n includeAnonymous?: boolean,\n};\n\nexport type ServerTeamCreateOptions = TeamCreateOptions & {\n creatorUserId?: string,\n};\nexport function serverTeamCreateOptionsToCrud(options: ServerTeamCreateOptions): TeamsCrud[\"Server\"][\"Create\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n creator_user_id: options.creatorUserId,\n };\n}\n\nexport type ServerTeamUpdateOptions = TeamUpdateOptions & {\n clientReadOnlyMetadata?: ReadonlyJson,\n serverMetadata?: ReadonlyJson,\n};\nexport function serverTeamUpdateOptionsToCrud(options: ServerTeamUpdateOptions): TeamsCrud[\"Server\"][\"Update\"] {\n return {\n display_name: options.displayName,\n profile_image_url: options.profileImageUrl,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n };\n}\n"],"mappings":";AA0DO,SAAS,wBAAwB,SAA2D;AACjG,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,EAC3B;AACF;AAMO,SAAS,wBAAwB,SAA4B,eAAsD;AACxH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB;AAAA,EACnB;AACF;AAyCO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,EAC3B;AACF;AAMO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,mBAAmB,QAAQ;AAAA,IAC3B,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,EAC3B;AACF;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../src/lib/stack-app/users/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { KnownErrors } from \"@stackframe/stack-shared\";\nimport { CurrentUserCrud } from \"@stackframe/stack-shared/dist/interface/crud/current-user\";\nimport { UsersCrud } from \"@stackframe/stack-shared/dist/interface/crud/users\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { encodeBase64 } from \"@stackframe/stack-shared/dist/utils/bytes\";\nimport { GeoInfo } from \"@stackframe/stack-shared/dist/utils/geo\";\nimport { ReadonlyJson } from \"@stackframe/stack-shared/dist/utils/json\";\nimport { ProviderType } from \"@stackframe/stack-shared/dist/utils/oauth\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { ApiKeyCreationOptions, UserApiKey, UserApiKeyFirstView } from \"../api-keys\";\nimport { AsyncStoreProperty, AuthLike } from \"../common\";\nimport { OAuthConnection } from \"../connected-accounts\";\nimport { ContactChannel, ContactChannelCreateOptions, ServerContactChannel, ServerContactChannelCreateOptions } from \"../contact-channels\";\nimport { Customer } from \"../customers\";\nimport { NotificationCategory } from \"../notification-categories\";\nimport { AdminTeamPermission, TeamPermission } from \"../permissions\";\nimport { AdminOwnedProject, AdminProjectCreateOptions } from \"../projects\";\nimport { EditableTeamMemberProfile, ServerTeam, ServerTeamCreateOptions, Team, TeamCreateOptions } from \"../teams\";\n\nconst userGetterErrorMessage = \"Stack Auth: useUser() already returns the user object. Use `const user = useUser()` (or `const user = await app.getUser()`) instead of destructuring it like `const { user } = ...`.\";\n\nexport function withUserDestructureGuard<T extends object>(target: T): T {\n Object.freeze(target);\n return new Proxy(target, {\n get(target, prop, receiver) {\n if (prop === \"user\") {\n return guardGetter();\n }\n return target[prop as keyof T];\n },\n });\n}\n\nfunction guardGetter(): never {\n throw new Error(userGetterErrorMessage);\n}\n\nexport type OAuthProvider = {\n readonly id: string,\n readonly type: string,\n readonly userId: string,\n readonly accountId?: string,\n readonly email?: string,\n readonly allowSignIn: boolean,\n readonly allowConnectedAccounts: boolean,\n update(data: { allowSignIn?: boolean, allowConnectedAccounts?: boolean }): Promise<Result<void,\n InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>\n >>,\n delete(): Promise<void>,\n};\n\nexport type ServerOAuthProvider = {\n readonly id: string,\n readonly type: string,\n readonly userId: string,\n readonly accountId: string,\n readonly email?: string,\n readonly allowSignIn: boolean,\n readonly allowConnectedAccounts: boolean,\n update(data: { accountId?: string, email?: string, allowSignIn?: boolean, allowConnectedAccounts?: boolean }): Promise<Result<void,\n InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>\n >>,\n delete(): Promise<void>,\n};\n\n\n/**\n * Contains everything related to the current user session.\n */\nexport type Auth = AuthLike<{}> & {\n readonly _internalSession: InternalSession,\n readonly currentSession: {\n getTokens(): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n },\n};\n\n/**\n * ```\n * +----------+-------------+-------------------+\n * | \\ | !Server | Server |\n * +----------+-------------+-------------------+\n * | !Session | User | ServerUser |\n * | Session | CurrentUser | CurrentServerUser |\n * +----------+-------------+-------------------+\n * ```\n *\n * The fields on each of these types are available iff:\n * BaseUser: true\n * Auth: Session\n * ServerBaseUser: Server\n * UserExtra: Session OR Server\n *\n * The types are defined as follows (in the typescript manner):\n * User = BaseUser\n * CurrentUser = BaseUser & Auth & UserExtra\n * ServerUser = BaseUser & ServerBaseUser & UserExtra\n * CurrentServerUser = BaseUser & ServerBaseUser & Auth & UserExtra\n **/\n\nexport type BaseUser = {\n readonly id: string,\n\n readonly displayName: string | null,\n\n /**\n * The user's email address.\n *\n * Note: This might NOT be unique across multiple users, so always use `id` for unique identification.\n */\n readonly primaryEmail: string | null,\n readonly primaryEmailVerified: boolean,\n readonly profileImageUrl: string | null,\n\n readonly signedUpAt: Date,\n\n readonly clientMetadata: any,\n readonly clientReadOnlyMetadata: any,\n\n /**\n * Whether the user has a password set.\n */\n readonly hasPassword: boolean,\n readonly otpAuthEnabled: boolean,\n readonly passkeyAuthEnabled: boolean,\n\n readonly isMultiFactorRequired: boolean,\n readonly isAnonymous: boolean,\n /**\n * Whether the user is in restricted state (signed up but hasn't completed onboarding requirements).\n * For example, if email verification is required but the user hasn't verified their email yet.\n */\n readonly isRestricted: boolean,\n /**\n * The reason why the user is restricted, e.g., { type: \"email_not_verified\" } or { type: \"anonymous\" }.\n * Null if the user is not restricted.\n */\n readonly restrictedReason: { type: \"anonymous\" | \"email_not_verified\" } | null,\n toClientJson(): CurrentUserCrud[\"Client\"][\"Read\"],\n\n /**\n * @deprecated, use contact channel's usedForAuth instead\n */\n readonly emailAuthEnabled: boolean,\n /**\n * @deprecated\n */\n readonly oauthProviders: readonly { id: string }[],\n}\n\nexport type UserExtra = {\n setDisplayName(displayName: string | null): Promise<void>,\n /** @deprecated Use contact channel's sendVerificationEmail instead */\n sendVerificationEmail(): Promise<KnownErrors[\"EmailAlreadyVerified\"] | void>,\n setClientMetadata(metadata: any): Promise<void>,\n updatePassword(options: { oldPassword: string, newPassword: string}): Promise<KnownErrors[\"PasswordConfirmationMismatch\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | void>,\n setPassword(options: { password: string }): Promise<KnownErrors[\"PasswordRequirementsNotMet\"] | void>,\n\n /**\n * A shorthand method to update multiple fields of the user at once.\n */\n update(update: UserUpdateOptions): Promise<void>,\n\n listContactChannels(): Promise<ContactChannel[]>,\n createContactChannel(data: ContactChannelCreateOptions): Promise<ContactChannel>,\n\n listNotificationCategories(): Promise<NotificationCategory[]>,\n\n delete(): Promise<void>,\n\n getConnectedAccount(id: ProviderType, options: { or: 'redirect', scopes?: string[] }): Promise<OAuthConnection>,\n getConnectedAccount(id: ProviderType, options?: { or?: 'redirect' | 'throw' | 'return-null', scopes?: string[] }): Promise<OAuthConnection | null>,\n\n\n hasPermission(scope: Team, permissionId: string): Promise<boolean>,\n hasPermission(permissionId: string): Promise<boolean>,\n\n getPermission(scope: Team, permissionId: string): Promise<TeamPermission | null>,\n getPermission(permissionId: string): Promise<TeamPermission | null>,\n\n listPermissions(scope: Team, options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n listPermissions(options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n\n\n readonly selectedTeam: Team | null,\n setSelectedTeam(teamOrId: string | Team | null): Promise<void>,\n createTeam(data: TeamCreateOptions): Promise<Team>,\n leaveTeam(team: Team): Promise<void>,\n\n getActiveSessions(): Promise<ActiveSession[]>,\n revokeSession(sessionId: string): Promise<void>,\n getTeamProfile(team: Team): Promise<EditableTeamMemberProfile>,\n\n createApiKey(options: ApiKeyCreationOptions<\"user\">): Promise<UserApiKeyFirstView>,\n\n listOAuthProviders(): Promise<OAuthProvider[]>,\n\n getOAuthProvider(id: string): Promise<OAuthProvider | null>,\n\n registerPasskey(options?: { hostname?: string }): Promise<Result<undefined, KnownErrors[\"PasskeyRegistrationFailed\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n}\n& AsyncStoreProperty<\"apiKeys\", [], UserApiKey[], true>\n& AsyncStoreProperty<\"team\", [id: string], Team | null, false>\n& AsyncStoreProperty<\"teams\", [], Team[], true>\n& AsyncStoreProperty<\"permission\", [scope: Team, permissionId: string, options?: { recursive?: boolean }], TeamPermission | null, false>\n& AsyncStoreProperty<\"permissions\", [scope: Team, options?: { recursive?: boolean }], TeamPermission[], true>;\n\nexport type InternalUserExtra =\n & {\n createProject(newProject: AdminProjectCreateOptions): Promise<AdminOwnedProject>,\n transferProject(projectIdToTransfer: string, newTeamId: string): Promise<void>,\n }\n & AsyncStoreProperty<\"ownedProjects\", [], AdminOwnedProject[], true>\n\nexport type User = BaseUser;\n\nexport type CurrentUser = BaseUser & Auth & UserExtra & Customer;\n\nexport type CurrentInternalUser = CurrentUser & InternalUserExtra;\n\nexport type ProjectCurrentUser<ProjectId> = ProjectId extends \"internal\" ? CurrentInternalUser : CurrentUser;\n\nexport type TokenPartialUser = Pick<\n User,\n | \"id\"\n | \"displayName\"\n | \"primaryEmail\"\n | \"primaryEmailVerified\"\n | \"isAnonymous\"\n | \"isRestricted\"\n | \"restrictedReason\"\n>\n\nexport type SyncedPartialUser = TokenPartialUser & Pick<\n User,\n | \"id\"\n | \"displayName\"\n | \"primaryEmail\"\n | \"primaryEmailVerified\"\n | \"profileImageUrl\"\n | \"signedUpAt\"\n | \"clientMetadata\"\n | \"clientReadOnlyMetadata\"\n | \"isAnonymous\"\n | \"hasPassword\"\n | \"isRestricted\"\n | \"restrictedReason\"\n>;\n\n\nexport type ActiveSession = {\n id: string,\n userId: string,\n createdAt: Date,\n isImpersonation: boolean,\n lastUsedAt: Date | undefined,\n isCurrentSession: boolean,\n geoInfo?: GeoInfo,\n};\n\nexport type UserUpdateOptions = {\n displayName?: string | null,\n clientMetadata?: ReadonlyJson,\n selectedTeamId?: string | null,\n totpMultiFactorSecret?: Uint8Array | null,\n profileImageUrl?: string | null,\n otpAuthEnabled?: boolean,\n passkeyAuthEnabled?: boolean,\n primaryEmail?: string | null,\n}\nexport function userUpdateOptionsToCrud(options: UserUpdateOptions): CurrentUserCrud[\"Client\"][\"Update\"] {\n return {\n display_name: options.displayName,\n client_metadata: options.clientMetadata,\n selected_team_id: options.selectedTeamId,\n totp_secret_base64: options.totpMultiFactorSecret != null ? encodeBase64(options.totpMultiFactorSecret) : options.totpMultiFactorSecret,\n profile_image_url: options.profileImageUrl,\n otp_auth_enabled: options.otpAuthEnabled,\n passkey_auth_enabled: options.passkeyAuthEnabled,\n primary_email: options.primaryEmail,\n };\n}\n\n\nexport type ServerBaseUser = {\n setPrimaryEmail(email: string | null, options?: { verified?: boolean | undefined }): Promise<void>,\n\n readonly lastActiveAt: Date,\n\n readonly serverMetadata: any,\n setServerMetadata(metadata: any): Promise<void>,\n setClientReadOnlyMetadata(metadata: any): Promise<void>,\n\n createTeam(data: Omit<ServerTeamCreateOptions, \"creatorUserId\">): Promise<ServerTeam>,\n\n listContactChannels(): Promise<ServerContactChannel[]>,\n createContactChannel(data: ServerContactChannelCreateOptions): Promise<ServerContactChannel>,\n\n update(user: ServerUserUpdateOptions): Promise<void>,\n\n grantPermission(scope: Team, permissionId: string): Promise<void>,\n grantPermission(permissionId: string): Promise<void>,\n\n revokePermission(scope: Team, permissionId: string): Promise<void>,\n revokePermission(permissionId: string): Promise<void>,\n\n getPermission(scope: Team, permissionId: string): Promise<TeamPermission | null>,\n getPermission(permissionId: string): Promise<TeamPermission | null>,\n\n hasPermission(scope: Team, permissionId: string): Promise<boolean>,\n hasPermission(permissionId: string): Promise<boolean>,\n\n listPermissions(scope: Team, options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n listPermissions(options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n\n\n listOAuthProviders(): Promise<ServerOAuthProvider[]>,\n\n getOAuthProvider(id: string): Promise<ServerOAuthProvider | null>,\n\n /**\n * Creates a new session object with a refresh token for this user. Can be used to impersonate them.\n */\n createSession(options?: { expiresInMillis?: number, isImpersonation?: boolean }): Promise<{\n getTokens(): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n }>,\n}\n& AsyncStoreProperty<\"team\", [id: string], ServerTeam | null, false>\n& AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\n& AsyncStoreProperty<\"permission\", [scope: Team, permissionId: string, options?: { direct?: boolean }], AdminTeamPermission | null, false>\n& AsyncStoreProperty<\"permissions\", [scope: Team, options?: { direct?: boolean }], AdminTeamPermission[], true>;\n\n/**\n * A user including sensitive fields that should only be used on the server, never sent to the client\n * (such as sensitive information and serverMetadata).\n */\nexport type ServerUser = ServerBaseUser & BaseUser & UserExtra & Customer<true>;\n\nexport type CurrentServerUser = Auth & ServerUser;\n\nexport type CurrentInternalServerUser = CurrentServerUser & InternalUserExtra;\n\nexport type ProjectCurrentServerUser<ProjectId> = ProjectId extends \"internal\" ? CurrentInternalServerUser : CurrentServerUser;\n\nexport type SyncedPartialServerUser = SyncedPartialUser & Pick<\n ServerUser,\n | \"serverMetadata\"\n>;\n\nexport type ServerUserUpdateOptions = {\n primaryEmail?: string | null,\n primaryEmailVerified?: boolean,\n primaryEmailAuthEnabled?: boolean,\n clientReadOnlyMetadata?: ReadonlyJson,\n serverMetadata?: ReadonlyJson,\n password?: string,\n} & UserUpdateOptions;\nexport function serverUserUpdateOptionsToCrud(options: ServerUserUpdateOptions): CurrentUserCrud[\"Server\"][\"Update\"] {\n return {\n display_name: options.displayName,\n primary_email: options.primaryEmail,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n selected_team_id: options.selectedTeamId,\n primary_email_auth_enabled: options.primaryEmailAuthEnabled,\n primary_email_verified: options.primaryEmailVerified,\n password: options.password,\n profile_image_url: options.profileImageUrl,\n totp_secret_base64: options.totpMultiFactorSecret != null ? encodeBase64(options.totpMultiFactorSecret) : options.totpMultiFactorSecret,\n };\n}\n\n\nexport type ServerUserCreateOptions = {\n primaryEmail?: string | null,\n primaryEmailAuthEnabled?: boolean,\n password?: string,\n otpAuthEnabled?: boolean,\n displayName?: string,\n primaryEmailVerified?: boolean,\n clientMetadata?: any,\n clientReadOnlyMetadata?: any,\n serverMetadata?: any,\n}\nexport function serverUserCreateOptionsToCrud(options: ServerUserCreateOptions): UsersCrud[\"Server\"][\"Create\"] {\n return {\n primary_email: options.primaryEmail,\n password: options.password,\n otp_auth_enabled: options.otpAuthEnabled,\n primary_email_auth_enabled: options.primaryEmailAuthEnabled,\n display_name: options.displayName,\n primary_email_verified: options.primaryEmailVerified,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n };\n}\n"],"mappings":";AAQA,SAAS,oBAAoB;AAe7B,IAAM,yBAAyB;AAExB,SAAS,yBAA2C,QAAc;AACvE,SAAO,OAAO,MAAM;AACpB,SAAO,IAAI,MAAM,QAAQ;AAAA,IACvB,IAAIA,SAAQ,MAAM,UAAU;AAC1B,UAAI,SAAS,QAAQ;AACnB,eAAO,YAAY;AAAA,MACrB;AACA,aAAOA,QAAO,IAAe;AAAA,IAC/B;AAAA,EACF,CAAC;AACH;AAEA,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,sBAAsB;AACxC;AA0OO,SAAS,wBAAwB,SAAiE;AACvG,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,iBAAiB,QAAQ;AAAA,IACzB,kBAAkB,QAAQ;AAAA,IAC1B,oBAAoB,QAAQ,yBAAyB,OAAO,aAAa,QAAQ,qBAAqB,IAAI,QAAQ;AAAA,IAClH,mBAAmB,QAAQ;AAAA,IAC3B,kBAAkB,QAAQ;AAAA,IAC1B,sBAAsB,QAAQ;AAAA,IAC9B,eAAe,QAAQ;AAAA,EACzB;AACF;AA4EO,SAAS,8BAA8B,SAAuE;AACnH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,eAAe,QAAQ;AAAA,IACvB,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,IACzB,kBAAkB,QAAQ;AAAA,IAC1B,4BAA4B,QAAQ;AAAA,IACpC,wBAAwB,QAAQ;AAAA,IAChC,UAAU,QAAQ;AAAA,IAClB,mBAAmB,QAAQ;AAAA,IAC3B,oBAAoB,QAAQ,yBAAyB,OAAO,aAAa,QAAQ,qBAAqB,IAAI,QAAQ;AAAA,EACpH;AACF;AAcO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,eAAe,QAAQ;AAAA,IACvB,UAAU,QAAQ;AAAA,IAClB,kBAAkB,QAAQ;AAAA,IAC1B,4BAA4B,QAAQ;AAAA,IACpC,cAAc,QAAQ;AAAA,IACtB,wBAAwB,QAAQ;AAAA,IAChC,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,EAC3B;AACF;","names":["target"]}
|
|
1
|
+
{"version":3,"sources":["../../../../../src/lib/stack-app/users/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownErrors } from \"@stackframe/stack-shared\";\nimport { CurrentUserCrud } from \"@stackframe/stack-shared/dist/interface/crud/current-user\";\nimport { UsersCrud } from \"@stackframe/stack-shared/dist/interface/crud/users\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { encodeBase64 } from \"@stackframe/stack-shared/dist/utils/bytes\";\nimport { GeoInfo } from \"@stackframe/stack-shared/dist/utils/geo\";\nimport { ReadonlyJson } from \"@stackframe/stack-shared/dist/utils/json\";\nimport { ProviderType } from \"@stackframe/stack-shared/dist/utils/oauth\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { ApiKeyCreationOptions, UserApiKey, UserApiKeyFirstView } from \"../api-keys\";\nimport { AsyncStoreProperty, AuthLike } from \"../common\";\nimport { OAuthConnection } from \"../connected-accounts\";\nimport { ContactChannel, ContactChannelCreateOptions, ServerContactChannel, ServerContactChannelCreateOptions } from \"../contact-channels\";\nimport { Customer } from \"../customers\";\nimport { NotificationCategory } from \"../notification-categories\";\nimport { AdminTeamPermission, TeamPermission } from \"../permissions\";\nimport { AdminOwnedProject, AdminProjectCreateOptions } from \"../projects\";\nimport { EditableTeamMemberProfile, ServerTeam, ServerTeamCreateOptions, Team, TeamCreateOptions } from \"../teams\";\n\nconst userGetterErrorMessage = \"Stack Auth: useUser() already returns the user object. Use `const user = useUser()` (or `const user = await app.getUser()`) instead of destructuring it like `const { user } = ...`.\";\n\nexport function withUserDestructureGuard<T extends object>(target: T): T {\n Object.freeze(target);\n return new Proxy(target, {\n get(target, prop, receiver) {\n if (prop === \"user\") {\n return guardGetter();\n }\n return target[prop as keyof T];\n },\n });\n}\n\nfunction guardGetter(): never {\n throw new Error(userGetterErrorMessage);\n}\n\nexport type OAuthProvider = {\n readonly id: string,\n readonly type: string,\n readonly userId: string,\n readonly accountId?: string,\n readonly email?: string,\n readonly allowSignIn: boolean,\n readonly allowConnectedAccounts: boolean,\n update(data: { allowSignIn?: boolean, allowConnectedAccounts?: boolean }): Promise<Result<void,\n InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>\n >>,\n delete(): Promise<void>,\n};\n\nexport type ServerOAuthProvider = {\n readonly id: string,\n readonly type: string,\n readonly userId: string,\n readonly accountId: string,\n readonly email?: string,\n readonly allowSignIn: boolean,\n readonly allowConnectedAccounts: boolean,\n update(data: { accountId?: string, email?: string, allowSignIn?: boolean, allowConnectedAccounts?: boolean }): Promise<Result<void,\n InstanceType<typeof KnownErrors.OAuthProviderAccountIdAlreadyUsedForSignIn>\n >>,\n delete(): Promise<void>,\n};\n\n\n/**\n * Contains everything related to the current user session.\n */\nexport type Auth = AuthLike<{}> & {\n readonly _internalSession: InternalSession,\n readonly currentSession: {\n getTokens(): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n },\n};\n\n/**\n * ```\n * +----------+-------------+-------------------+\n * | \\ | !Server | Server |\n * +----------+-------------+-------------------+\n * | !Session | User | ServerUser |\n * | Session | CurrentUser | CurrentServerUser |\n * +----------+-------------+-------------------+\n * ```\n *\n * The fields on each of these types are available iff:\n * BaseUser: true\n * Auth: Session\n * ServerBaseUser: Server\n * UserExtra: Session OR Server\n *\n * The types are defined as follows (in the typescript manner):\n * User = BaseUser\n * CurrentUser = BaseUser & Auth & UserExtra\n * ServerUser = BaseUser & ServerBaseUser & UserExtra\n * CurrentServerUser = BaseUser & ServerBaseUser & Auth & UserExtra\n **/\n\nexport type BaseUser = {\n readonly id: string,\n\n readonly displayName: string | null,\n\n /**\n * The user's email address.\n *\n * Note: This might NOT be unique across multiple users, so always use `id` for unique identification.\n */\n readonly primaryEmail: string | null,\n readonly primaryEmailVerified: boolean,\n readonly profileImageUrl: string | null,\n\n readonly signedUpAt: Date,\n\n readonly clientMetadata: any,\n readonly clientReadOnlyMetadata: any,\n\n /**\n * Whether the user has a password set.\n */\n readonly hasPassword: boolean,\n readonly otpAuthEnabled: boolean,\n readonly passkeyAuthEnabled: boolean,\n\n readonly isMultiFactorRequired: boolean,\n readonly isAnonymous: boolean,\n /**\n * Whether the user is in restricted state (signed up but hasn't completed onboarding requirements).\n * For example, if email verification is required but the user hasn't verified their email yet.\n */\n readonly isRestricted: boolean,\n /**\n * The reason why the user is restricted, e.g., { type: \"email_not_verified\" } or { type: \"anonymous\" }.\n * Null if the user is not restricted.\n */\n readonly restrictedReason: { type: \"anonymous\" | \"email_not_verified\" } | null,\n toClientJson(): CurrentUserCrud[\"Client\"][\"Read\"],\n\n /**\n * @deprecated, use contact channel's usedForAuth instead\n */\n readonly emailAuthEnabled: boolean,\n /**\n * @deprecated\n */\n readonly oauthProviders: readonly { id: string }[],\n}\n\nexport type UserExtra = {\n setDisplayName(displayName: string | null): Promise<void>,\n /** @deprecated Use contact channel's sendVerificationEmail instead */\n sendVerificationEmail(): Promise<KnownErrors[\"EmailAlreadyVerified\"] | void>,\n setClientMetadata(metadata: any): Promise<void>,\n updatePassword(options: { oldPassword: string, newPassword: string}): Promise<KnownErrors[\"PasswordConfirmationMismatch\"] | KnownErrors[\"PasswordRequirementsNotMet\"] | void>,\n setPassword(options: { password: string }): Promise<KnownErrors[\"PasswordRequirementsNotMet\"] | void>,\n\n /**\n * A shorthand method to update multiple fields of the user at once.\n */\n update(update: UserUpdateOptions): Promise<void>,\n\n listContactChannels(): Promise<ContactChannel[]>,\n createContactChannel(data: ContactChannelCreateOptions): Promise<ContactChannel>,\n\n listNotificationCategories(): Promise<NotificationCategory[]>,\n\n delete(): Promise<void>,\n\n getConnectedAccount(id: ProviderType, options: { or: 'redirect', scopes?: string[] }): Promise<OAuthConnection>,\n getConnectedAccount(id: ProviderType, options?: { or?: 'redirect' | 'throw' | 'return-null', scopes?: string[] }): Promise<OAuthConnection | null>,\n\n\n hasPermission(scope: Team, permissionId: string): Promise<boolean>,\n hasPermission(permissionId: string): Promise<boolean>,\n\n getPermission(scope: Team, permissionId: string): Promise<TeamPermission | null>,\n getPermission(permissionId: string): Promise<TeamPermission | null>,\n\n listPermissions(scope: Team, options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n listPermissions(options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n\n\n readonly selectedTeam: Team | null,\n setSelectedTeam(teamOrId: string | Team | null): Promise<void>,\n createTeam(data: TeamCreateOptions): Promise<Team>,\n leaveTeam(team: Team): Promise<void>,\n\n getActiveSessions(): Promise<ActiveSession[]>,\n revokeSession(sessionId: string): Promise<void>,\n getTeamProfile(team: Team): Promise<EditableTeamMemberProfile>,\n\n createApiKey(options: ApiKeyCreationOptions<\"user\">): Promise<UserApiKeyFirstView>,\n\n listOAuthProviders(): Promise<OAuthProvider[]>,\n\n getOAuthProvider(id: string): Promise<OAuthProvider | null>,\n\n registerPasskey(options?: { hostname?: string }): Promise<Result<undefined, KnownErrors[\"PasskeyRegistrationFailed\"] | KnownErrors[\"PasskeyWebAuthnError\"]>>,\n}\n& AsyncStoreProperty<\"apiKeys\", [], UserApiKey[], true>\n& AsyncStoreProperty<\"team\", [id: string], Team | null, false>\n& AsyncStoreProperty<\"teams\", [], Team[], true>\n& AsyncStoreProperty<\"permission\", [scope: Team, permissionId: string, options?: { recursive?: boolean }], TeamPermission | null, false>\n& AsyncStoreProperty<\"permissions\", [scope: Team, options?: { recursive?: boolean }], TeamPermission[], true>;\n\nexport type InternalUserExtra =\n & {\n createProject(newProject: AdminProjectCreateOptions): Promise<AdminOwnedProject>,\n transferProject(projectIdToTransfer: string, newTeamId: string): Promise<void>,\n }\n & AsyncStoreProperty<\"ownedProjects\", [], AdminOwnedProject[], true>\n\nexport type User = BaseUser;\n\nexport type CurrentUser = BaseUser & Auth & UserExtra & Customer;\n\nexport type CurrentInternalUser = CurrentUser & InternalUserExtra;\n\nexport type ProjectCurrentUser<ProjectId> = ProjectId extends \"internal\" ? CurrentInternalUser : CurrentUser;\n\nexport type TokenPartialUser = Pick<\n User,\n | \"id\"\n | \"displayName\"\n | \"primaryEmail\"\n | \"primaryEmailVerified\"\n | \"isAnonymous\"\n | \"isRestricted\"\n | \"restrictedReason\"\n>\n\nexport type SyncedPartialUser = TokenPartialUser & Pick<\n User,\n | \"id\"\n | \"displayName\"\n | \"primaryEmail\"\n | \"primaryEmailVerified\"\n | \"profileImageUrl\"\n | \"signedUpAt\"\n | \"clientMetadata\"\n | \"clientReadOnlyMetadata\"\n | \"isAnonymous\"\n | \"hasPassword\"\n | \"isRestricted\"\n | \"restrictedReason\"\n>;\n\n\nexport type ActiveSession = {\n id: string,\n userId: string,\n createdAt: Date,\n isImpersonation: boolean,\n lastUsedAt: Date | undefined,\n isCurrentSession: boolean,\n geoInfo?: GeoInfo,\n};\n\nexport type UserUpdateOptions = {\n displayName?: string | null,\n clientMetadata?: ReadonlyJson,\n selectedTeamId?: string | null,\n totpMultiFactorSecret?: Uint8Array | null,\n profileImageUrl?: string | null,\n otpAuthEnabled?: boolean,\n passkeyAuthEnabled?: boolean,\n primaryEmail?: string | null,\n}\nexport function userUpdateOptionsToCrud(options: UserUpdateOptions): CurrentUserCrud[\"Client\"][\"Update\"] {\n return {\n display_name: options.displayName,\n client_metadata: options.clientMetadata,\n selected_team_id: options.selectedTeamId,\n totp_secret_base64: options.totpMultiFactorSecret != null ? encodeBase64(options.totpMultiFactorSecret) : options.totpMultiFactorSecret,\n profile_image_url: options.profileImageUrl,\n otp_auth_enabled: options.otpAuthEnabled,\n passkey_auth_enabled: options.passkeyAuthEnabled,\n primary_email: options.primaryEmail,\n };\n}\n\n\nexport type ServerBaseUser = {\n setPrimaryEmail(email: string | null, options?: { verified?: boolean | undefined }): Promise<void>,\n\n readonly lastActiveAt: Date,\n\n readonly serverMetadata: any,\n setServerMetadata(metadata: any): Promise<void>,\n setClientReadOnlyMetadata(metadata: any): Promise<void>,\n\n createTeam(data: Omit<ServerTeamCreateOptions, \"creatorUserId\">): Promise<ServerTeam>,\n\n listContactChannels(): Promise<ServerContactChannel[]>,\n createContactChannel(data: ServerContactChannelCreateOptions): Promise<ServerContactChannel>,\n\n update(user: ServerUserUpdateOptions): Promise<void>,\n\n grantPermission(scope: Team, permissionId: string): Promise<void>,\n grantPermission(permissionId: string): Promise<void>,\n\n revokePermission(scope: Team, permissionId: string): Promise<void>,\n revokePermission(permissionId: string): Promise<void>,\n\n getPermission(scope: Team, permissionId: string): Promise<TeamPermission | null>,\n getPermission(permissionId: string): Promise<TeamPermission | null>,\n\n hasPermission(scope: Team, permissionId: string): Promise<boolean>,\n hasPermission(permissionId: string): Promise<boolean>,\n\n listPermissions(scope: Team, options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n listPermissions(options?: { recursive?: boolean }): Promise<TeamPermission[]>,\n\n\n listOAuthProviders(): Promise<ServerOAuthProvider[]>,\n\n getOAuthProvider(id: string): Promise<ServerOAuthProvider | null>,\n\n /**\n * Creates a new session object with a refresh token for this user. Can be used to impersonate them.\n */\n createSession(options?: { expiresInMillis?: number, isImpersonation?: boolean }): Promise<{\n getTokens(): Promise<{ accessToken: string | null, refreshToken: string | null }>,\n }>,\n}\n& AsyncStoreProperty<\"team\", [id: string], ServerTeam | null, false>\n& AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\n& AsyncStoreProperty<\"permission\", [scope: Team, permissionId: string, options?: { direct?: boolean }], AdminTeamPermission | null, false>\n& AsyncStoreProperty<\"permissions\", [scope: Team, options?: { direct?: boolean }], AdminTeamPermission[], true>;\n\n/**\n * A user including sensitive fields that should only be used on the server, never sent to the client\n * (such as sensitive information and serverMetadata).\n */\nexport type ServerUser = ServerBaseUser & BaseUser & UserExtra & Customer<true>;\n\nexport type CurrentServerUser = Auth & ServerUser;\n\nexport type CurrentInternalServerUser = CurrentServerUser & InternalUserExtra;\n\nexport type ProjectCurrentServerUser<ProjectId> = ProjectId extends \"internal\" ? CurrentInternalServerUser : CurrentServerUser;\n\nexport type SyncedPartialServerUser = SyncedPartialUser & Pick<\n ServerUser,\n | \"serverMetadata\"\n>;\n\nexport type ServerUserUpdateOptions = {\n primaryEmail?: string | null,\n primaryEmailVerified?: boolean,\n primaryEmailAuthEnabled?: boolean,\n clientReadOnlyMetadata?: ReadonlyJson,\n serverMetadata?: ReadonlyJson,\n password?: string,\n} & UserUpdateOptions;\nexport function serverUserUpdateOptionsToCrud(options: ServerUserUpdateOptions): CurrentUserCrud[\"Server\"][\"Update\"] {\n return {\n display_name: options.displayName,\n primary_email: options.primaryEmail,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n selected_team_id: options.selectedTeamId,\n primary_email_auth_enabled: options.primaryEmailAuthEnabled,\n primary_email_verified: options.primaryEmailVerified,\n password: options.password,\n profile_image_url: options.profileImageUrl,\n totp_secret_base64: options.totpMultiFactorSecret != null ? encodeBase64(options.totpMultiFactorSecret) : options.totpMultiFactorSecret,\n };\n}\n\n\nexport type ServerUserCreateOptions = {\n primaryEmail?: string | null,\n primaryEmailAuthEnabled?: boolean,\n password?: string,\n otpAuthEnabled?: boolean,\n displayName?: string,\n primaryEmailVerified?: boolean,\n clientMetadata?: any,\n clientReadOnlyMetadata?: any,\n serverMetadata?: any,\n}\nexport function serverUserCreateOptionsToCrud(options: ServerUserCreateOptions): UsersCrud[\"Server\"][\"Create\"] {\n return {\n primary_email: options.primaryEmail,\n password: options.password,\n otp_auth_enabled: options.otpAuthEnabled,\n primary_email_auth_enabled: options.primaryEmailAuthEnabled,\n display_name: options.displayName,\n primary_email_verified: options.primaryEmailVerified,\n client_metadata: options.clientMetadata,\n client_read_only_metadata: options.clientReadOnlyMetadata,\n server_metadata: options.serverMetadata,\n };\n}\n"],"mappings":";AAQA,SAAS,oBAAoB;AAe7B,IAAM,yBAAyB;AAExB,SAAS,yBAA2C,QAAc;AACvE,SAAO,OAAO,MAAM;AACpB,SAAO,IAAI,MAAM,QAAQ;AAAA,IACvB,IAAIA,SAAQ,MAAM,UAAU;AAC1B,UAAI,SAAS,QAAQ;AACnB,eAAO,YAAY;AAAA,MACrB;AACA,aAAOA,QAAO,IAAe;AAAA,IAC/B;AAAA,EACF,CAAC;AACH;AAEA,SAAS,cAAqB;AAC5B,QAAM,IAAI,MAAM,sBAAsB;AACxC;AA0OO,SAAS,wBAAwB,SAAiE;AACvG,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,iBAAiB,QAAQ;AAAA,IACzB,kBAAkB,QAAQ;AAAA,IAC1B,oBAAoB,QAAQ,yBAAyB,OAAO,aAAa,QAAQ,qBAAqB,IAAI,QAAQ;AAAA,IAClH,mBAAmB,QAAQ;AAAA,IAC3B,kBAAkB,QAAQ;AAAA,IAC1B,sBAAsB,QAAQ;AAAA,IAC9B,eAAe,QAAQ;AAAA,EACzB;AACF;AA4EO,SAAS,8BAA8B,SAAuE;AACnH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,eAAe,QAAQ;AAAA,IACvB,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,IACzB,kBAAkB,QAAQ;AAAA,IAC1B,4BAA4B,QAAQ;AAAA,IACpC,wBAAwB,QAAQ;AAAA,IAChC,UAAU,QAAQ;AAAA,IAClB,mBAAmB,QAAQ;AAAA,IAC3B,oBAAoB,QAAQ,yBAAyB,OAAO,aAAa,QAAQ,qBAAqB,IAAI,QAAQ;AAAA,EACpH;AACF;AAcO,SAAS,8BAA8B,SAAiE;AAC7G,SAAO;AAAA,IACL,eAAe,QAAQ;AAAA,IACvB,UAAU,QAAQ;AAAA,IAClB,kBAAkB,QAAQ;AAAA,IAC1B,4BAA4B,QAAQ;AAAA,IACpC,cAAc,QAAQ;AAAA,IACtB,wBAAwB,QAAQ;AAAA,IAChC,iBAAiB,QAAQ;AAAA,IACzB,2BAA2B,QAAQ;AAAA,IACnC,iBAAiB,QAAQ;AAAA,EAC3B;AACF;","names":["target"]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../src/utils/url.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { StackAssertionError } from \"@stackframe/stack-shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new StackAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n const retainedQueryParams = [\"after_auth_return_to\"];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n if (currentUrl.searchParams.has(param)) {\n url.searchParams.set(param, currentUrl.searchParams.get(param)!);\n }\n }\n url.hash = \"\";\n return url.toString();\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAG7B,SAAS,qBAAqB,aAAuC,iBAAyB;AAEnG,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,UAAU;AACrD,UAAM,IAAI,oBAAoB,GAAG,eAAe,qDAAqD,EAAE,YAAY,CAAC;AAAA,EACtH;AAEA,QAAM,sBAAsB,CAAC,sBAAsB;AACnD,QAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;AAC/C,QAAM,MAAM,cAAc,IAAI,IAAI,aAAa,OAAO,SAAS,IAAI,IAAI,IAAI,IAAI,OAAO,SAAS,IAAI;AACnG,aAAW,SAAS,qBAAqB;AACvC,QAAI,WAAW,aAAa,IAAI,KAAK,GAAG;AACtC,UAAI,aAAa,IAAI,OAAO,WAAW,aAAa,IAAI,KAAK,CAAE;AAAA,IACjE;AAAA,EACF;AACA,MAAI,OAAO;AACX,SAAO,IAAI,SAAS;AACtB;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../src/utils/url.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { StackAssertionError } from \"@stackframe/stack-shared/dist/utils/errors\";\n\n\nexport function constructRedirectUrl(redirectUrl: URL | string | undefined, callbackUrlName: string) {\n // eslint-disable-next-line @typescript-eslint/no-unnecessary-condition\n if (typeof window === 'undefined' || !window.location) {\n throw new StackAssertionError(`${callbackUrlName} option is required in a non-browser environment.`, { redirectUrl });\n }\n\n const retainedQueryParams = [\"after_auth_return_to\"];\n const currentUrl = new URL(window.location.href);\n const url = redirectUrl ? new URL(redirectUrl, window.location.href) : new URL(window.location.href);\n for (const param of retainedQueryParams) {\n if (currentUrl.searchParams.has(param)) {\n url.searchParams.set(param, currentUrl.searchParams.get(param)!);\n }\n }\n url.hash = \"\";\n return url.toString();\n}\n"],"mappings":";AAIA,SAAS,2BAA2B;AAG7B,SAAS,qBAAqB,aAAuC,iBAAyB;AAEnG,MAAI,OAAO,WAAW,eAAe,CAAC,OAAO,UAAU;AACrD,UAAM,IAAI,oBAAoB,GAAG,eAAe,qDAAqD,EAAE,YAAY,CAAC;AAAA,EACtH;AAEA,QAAM,sBAAsB,CAAC,sBAAsB;AACnD,QAAM,aAAa,IAAI,IAAI,OAAO,SAAS,IAAI;AAC/C,QAAM,MAAM,cAAc,IAAI,IAAI,aAAa,OAAO,SAAS,IAAI,IAAI,IAAI,IAAI,OAAO,SAAS,IAAI;AACnG,aAAW,SAAS,qBAAqB;AACvC,QAAI,WAAW,aAAa,IAAI,KAAK,GAAG;AACtC,UAAI,aAAa,IAAI,OAAO,WAAW,aAAa,IAAI,KAAK,CAAE;AAAA,IACjE;AAAA,EACF;AACA,MAAI,OAAO;AACX,SAAO,IAAI,SAAS;AACtB;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -234,6 +234,17 @@ type CustomerProduct = {
|
|
|
234
234
|
customerType: "user" | "team" | "custom";
|
|
235
235
|
isServerOnly: boolean;
|
|
236
236
|
stackable: boolean;
|
|
237
|
+
type: "one_time" | "subscription";
|
|
238
|
+
subscription: null | {
|
|
239
|
+
currentPeriodEnd: Date | null;
|
|
240
|
+
cancelAtPeriodEnd: boolean;
|
|
241
|
+
isCancelable: boolean;
|
|
242
|
+
};
|
|
243
|
+
switchOptions?: Array<{
|
|
244
|
+
productId: string;
|
|
245
|
+
displayName: string;
|
|
246
|
+
prices: InlineProduct["prices"];
|
|
247
|
+
}>;
|
|
237
248
|
};
|
|
238
249
|
type CustomerProductsList = CustomerProduct[] & {
|
|
239
250
|
nextCursor: string | null;
|
|
@@ -249,6 +260,21 @@ type CustomerProductsRequestOptions = ({
|
|
|
249
260
|
} & CustomerProductsListOptions) | ({
|
|
250
261
|
customCustomerId: string;
|
|
251
262
|
} & CustomerProductsListOptions);
|
|
263
|
+
type CustomerDefaultPaymentMethod = {
|
|
264
|
+
id: string;
|
|
265
|
+
brand: string | null;
|
|
266
|
+
last4: string | null;
|
|
267
|
+
exp_month: number | null;
|
|
268
|
+
exp_year: number | null;
|
|
269
|
+
} | null;
|
|
270
|
+
type CustomerBilling = {
|
|
271
|
+
hasCustomer: boolean;
|
|
272
|
+
defaultPaymentMethod: CustomerDefaultPaymentMethod;
|
|
273
|
+
};
|
|
274
|
+
type CustomerPaymentMethodSetupIntent = {
|
|
275
|
+
clientSecret: string;
|
|
276
|
+
stripeAccountId: string;
|
|
277
|
+
};
|
|
252
278
|
type Customer<IsServer extends boolean = false> = {
|
|
253
279
|
readonly id: string;
|
|
254
280
|
createCheckoutUrl(options: ({
|
|
@@ -258,7 +284,16 @@ type Customer<IsServer extends boolean = false> = {
|
|
|
258
284
|
product: InlineProduct;
|
|
259
285
|
returnUrl?: string;
|
|
260
286
|
} : never))): Promise<string>;
|
|
261
|
-
|
|
287
|
+
createPaymentMethodSetupIntent(): Promise<CustomerPaymentMethodSetupIntent>;
|
|
288
|
+
setDefaultPaymentMethodFromSetupIntent(setupIntentId: string): Promise<CustomerDefaultPaymentMethod>;
|
|
289
|
+
switchSubscription(options: {
|
|
290
|
+
fromProductId: string;
|
|
291
|
+
toProductId: string;
|
|
292
|
+
priceId?: string;
|
|
293
|
+
quantity?: number;
|
|
294
|
+
}): Promise<void>;
|
|
295
|
+
} & AsyncStoreProperty<"billing", [
|
|
296
|
+
], CustomerBilling, false> & AsyncStoreProperty<"item", [
|
|
262
297
|
itemId: string
|
|
263
298
|
], IsServer extends true ? ServerItem : Item, false> & AsyncStoreProperty<"products", [
|
|
264
299
|
options?: CustomerProductsListOptions
|
package/dist/index.d.ts
CHANGED
|
@@ -234,6 +234,17 @@ type CustomerProduct = {
|
|
|
234
234
|
customerType: "user" | "team" | "custom";
|
|
235
235
|
isServerOnly: boolean;
|
|
236
236
|
stackable: boolean;
|
|
237
|
+
type: "one_time" | "subscription";
|
|
238
|
+
subscription: null | {
|
|
239
|
+
currentPeriodEnd: Date | null;
|
|
240
|
+
cancelAtPeriodEnd: boolean;
|
|
241
|
+
isCancelable: boolean;
|
|
242
|
+
};
|
|
243
|
+
switchOptions?: Array<{
|
|
244
|
+
productId: string;
|
|
245
|
+
displayName: string;
|
|
246
|
+
prices: InlineProduct["prices"];
|
|
247
|
+
}>;
|
|
237
248
|
};
|
|
238
249
|
type CustomerProductsList = CustomerProduct[] & {
|
|
239
250
|
nextCursor: string | null;
|
|
@@ -249,6 +260,21 @@ type CustomerProductsRequestOptions = ({
|
|
|
249
260
|
} & CustomerProductsListOptions) | ({
|
|
250
261
|
customCustomerId: string;
|
|
251
262
|
} & CustomerProductsListOptions);
|
|
263
|
+
type CustomerDefaultPaymentMethod = {
|
|
264
|
+
id: string;
|
|
265
|
+
brand: string | null;
|
|
266
|
+
last4: string | null;
|
|
267
|
+
exp_month: number | null;
|
|
268
|
+
exp_year: number | null;
|
|
269
|
+
} | null;
|
|
270
|
+
type CustomerBilling = {
|
|
271
|
+
hasCustomer: boolean;
|
|
272
|
+
defaultPaymentMethod: CustomerDefaultPaymentMethod;
|
|
273
|
+
};
|
|
274
|
+
type CustomerPaymentMethodSetupIntent = {
|
|
275
|
+
clientSecret: string;
|
|
276
|
+
stripeAccountId: string;
|
|
277
|
+
};
|
|
252
278
|
type Customer<IsServer extends boolean = false> = {
|
|
253
279
|
readonly id: string;
|
|
254
280
|
createCheckoutUrl(options: ({
|
|
@@ -258,7 +284,16 @@ type Customer<IsServer extends boolean = false> = {
|
|
|
258
284
|
product: InlineProduct;
|
|
259
285
|
returnUrl?: string;
|
|
260
286
|
} : never))): Promise<string>;
|
|
261
|
-
|
|
287
|
+
createPaymentMethodSetupIntent(): Promise<CustomerPaymentMethodSetupIntent>;
|
|
288
|
+
setDefaultPaymentMethodFromSetupIntent(setupIntentId: string): Promise<CustomerDefaultPaymentMethod>;
|
|
289
|
+
switchSubscription(options: {
|
|
290
|
+
fromProductId: string;
|
|
291
|
+
toProductId: string;
|
|
292
|
+
priceId?: string;
|
|
293
|
+
quantity?: number;
|
|
294
|
+
}): Promise<void>;
|
|
295
|
+
} & AsyncStoreProperty<"billing", [
|
|
296
|
+
], CustomerBilling, false> & AsyncStoreProperty<"item", [
|
|
262
297
|
itemId: string
|
|
263
298
|
], IsServer extends true ? ServerItem : Item, false> & AsyncStoreProperty<"products", [
|
|
264
299
|
options?: CustomerProductsListOptions
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nexport * from './lib/stack-app';\n\nexport { getConvexProvidersConfig } from \"./integrations/convex\";\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAc,qCAJd;AAMA,oBAAyC;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../src/index.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nexport * from './lib/stack-app';\n\nexport { getConvexProvidersConfig } from \"./integrations/convex\";\n\n"],"mappings":";;;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAc,qCAJd;AAMA,oBAAyC;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../src/integrations/convex/component/convex.config.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { defineComponent } from \"convex/server\";\n\nconst component = defineComponent(\"stack_auth\");\n\nexport default component;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAgC;AAEhC,IAAM,gBAAY,+BAAgB,YAAY;AAE9C,IAAO,wBAAQ;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../../../src/integrations/convex/component/convex.config.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { defineComponent } from \"convex/server\";\n\nconst component = defineComponent(\"stack_auth\");\n\nexport default component;\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,oBAAgC;AAEhC,IAAM,gBAAY,+BAAgB,YAAY;AAE9C,IAAO,wBAAQ;","names":[]}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/integrations/convex.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { urlString } from \"@stackframe/stack-shared/dist/utils/urls\";\nimport { defaultBaseUrl } from \"../lib/stack-app/apps/implementations/common\";\n\nexport function getConvexProvidersConfig(options: {\n baseUrl?: string,\n projectId: string,\n}) {\n const baseUrl = options.baseUrl || defaultBaseUrl;\n const projectId = options.projectId;\n return [\n {\n type: \"customJwt\",\n issuer: new URL(urlString`/api/v1/projects/${projectId}`, baseUrl),\n jwks: new URL(urlString`/api/v1/projects/${projectId}/.well-known/jwks.json`, baseUrl),\n algorithm: \"ES256\",\n },\n {\n type: \"customJwt\",\n issuer: new URL(urlString`/api/v1/projects-anonymous-users/${projectId}`, baseUrl),\n jwks: new URL(urlString`/api/v1/projects/${projectId}/.well-known/jwks.json?include_anonymous=true`, baseUrl),\n algorithm: \"ES256\",\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAA0B;AAC1B,oBAA+B;AAExB,SAAS,yBAAyB,SAGtC;AACD,QAAM,UAAU,QAAQ,WAAW;AACnC,QAAM,YAAY,QAAQ;AAC1B,SAAO;AAAA,IACL;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,IAAI,IAAI,yCAA6B,SAAS,IAAI,OAAO;AAAA,MACjE,MAAM,IAAI,IAAI,yCAA6B,SAAS,0BAA0B,OAAO;AAAA,MACrF,WAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,IAAI,IAAI,yDAA6C,SAAS,IAAI,OAAO;AAAA,MACjF,MAAM,IAAI,IAAI,yCAA6B,SAAS,iDAAiD,OAAO;AAAA,MAC5G,WAAW;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/integrations/convex.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { urlString } from \"@stackframe/stack-shared/dist/utils/urls\";\nimport { defaultBaseUrl } from \"../lib/stack-app/apps/implementations/common\";\n\nexport function getConvexProvidersConfig(options: {\n baseUrl?: string,\n projectId: string,\n}) {\n const baseUrl = options.baseUrl || defaultBaseUrl;\n const projectId = options.projectId;\n return [\n {\n type: \"customJwt\",\n issuer: new URL(urlString`/api/v1/projects/${projectId}`, baseUrl),\n jwks: new URL(urlString`/api/v1/projects/${projectId}/.well-known/jwks.json`, baseUrl),\n algorithm: \"ES256\",\n },\n {\n type: \"customJwt\",\n issuer: new URL(urlString`/api/v1/projects-anonymous-users/${projectId}`, baseUrl),\n jwks: new URL(urlString`/api/v1/projects/${projectId}/.well-known/jwks.json?include_anonymous=true`, baseUrl),\n algorithm: \"ES256\",\n },\n ];\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,kBAA0B;AAC1B,oBAA+B;AAExB,SAAS,yBAAyB,SAGtC;AACD,QAAM,UAAU,QAAQ,WAAW;AACnC,QAAM,YAAY,QAAQ;AAC1B,SAAO;AAAA,IACL;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,IAAI,IAAI,yCAA6B,SAAS,IAAI,OAAO;AAAA,MACjE,MAAM,IAAI,IAAI,yCAA6B,SAAS,0BAA0B,OAAO;AAAA,MACrF,WAAW;AAAA,IACb;AAAA,IACA;AAAA,MACE,MAAM;AAAA,MACN,QAAQ,IAAI,IAAI,yDAA6C,SAAS,IAAI,OAAO;AAAA,MACjF,MAAM,IAAI,IAAI,yCAA6B,SAAS,iDAAiD,OAAO;AAAA,MAC5G,WAAW;AAAA,IACb;AAAA,EACF;AACF;","names":[]}
|
package/dist/lib/auth.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../src/lib/auth.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { KnownError, StackClientInterface } from \"@stackframe/stack-shared\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { StackAssertionError, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { neverResolve } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { deindent } from \"@stackframe/stack-shared/dist/utils/strings\";\nimport { constructRedirectUrl } from \"../utils/url\";\nimport { consumeVerifierAndStateCookie, saveVerifierAndState } from \"./cookie\";\n\nexport async function signInWithOAuth(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n codeChallenge,\n state,\n type: \"authenticate\",\n providerScope: options.providerScope,\n session,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\nexport async function addNewOAuthProviderOrScope(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n afterCallbackRedirectUrl: constructRedirectUrl(window.location.href, \"afterCallbackRedirectUrl\"),\n codeChallenge,\n state,\n type: \"link\",\n session,\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\n/**\n * Checks if the current URL has the query parameters for an OAuth callback, and if so, removes them.\n *\n * Must be synchronous for the logic in callOAuthCallback to work without race conditions.\n */\nfunction consumeOAuthCallbackQueryParams() {\n const requiredParams = [\"code\", \"state\"];\n const originalUrl = new URL(window.location.href);\n for (const param of requiredParams) {\n if (!originalUrl.searchParams.has(param)) {\n console.warn(new Error(`Missing required query parameter on OAuth callback: ${param}. Maybe you opened or reloaded the oauth-callback page from your history?`));\n return null;\n }\n }\n\n const expectedState = originalUrl.searchParams.get(\"state\") ?? throwErr(\"This should never happen; isn't state required above?\");\n const cookieResult = consumeVerifierAndStateCookie(expectedState);\n\n if (!cookieResult) {\n // If the state can't be found in the cookies, then the callback wasn't meant for us.\n // Maybe the website uses another OAuth library?\n console.warn(deindent`\n Stack found an outer OAuth callback state in the query parameters, but not in cookies.\n \n This could have multiple reasons:\n - The cookie expired, because the OAuth flow took too long.\n - The user's browser deleted the cookie, either manually or because of a very strict cookie policy.\n - The cookie was already consumed by this page, and the user already logged in.\n - You are using another OAuth client library with the same callback URL as Stack.\n - The user opened the OAuth callback page from their history.\n\n Either way, it is probably safe to ignore this warning unless you are debugging an OAuth issue.\n `);\n return null;\n }\n\n\n const newUrl = new URL(originalUrl);\n for (const param of requiredParams) {\n newUrl.searchParams.delete(param);\n }\n\n // let's get rid of the authorization code in the history as we\n // don't redirect to `redirectUrl` if there's a validation error\n // (as the redirectUrl might be malicious!).\n //\n // We use history.replaceState instead of location.assign(...) to\n // prevent an unnecessary reload\n window.history.replaceState({}, \"\", newUrl.toString());\n\n return {\n originalUrl,\n codeVerifier: cookieResult.codeVerifier,\n state: expectedState,\n };\n}\n\nexport async function callOAuthCallback(\n iface: StackClientInterface,\n redirectUrl: string,\n) {\n // note: this part of the function (until the return) needs\n // to be synchronous, to prevent race conditions when\n // callOAuthCallback is called multiple times in parallel\n const consumed = consumeOAuthCallbackQueryParams();\n if (!consumed) return Result.ok(undefined);\n\n // the rest can be asynchronous (we now know that we are the\n // intended recipient of the callback, and the only instance\n // of callOAuthCallback that's running)\n try {\n return Result.ok(await iface.callOAuthCallback({\n oauthParams: consumed.originalUrl.searchParams,\n redirectUri: constructRedirectUrl(redirectUrl, \"redirectUri\"),\n codeVerifier: consumed.codeVerifier,\n state: consumed.state,\n }));\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n throw e;\n }\n throw new StackAssertionError(\"Error signing in during OAuth callback. Please try again.\", { cause: e });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAiD;AAEjD,oBAA8C;AAC9C,sBAA6B;AAC7B,qBAAuB;AACvB,qBAAyB;AACzB,iBAAqC;AACrC,oBAAoE;AAEpE,eAAsB,gBACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,IACvB;AAAA,EACF,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAEA,eAAsB,2BACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF,8BAA0B,iCAAqB,OAAO,SAAS,MAAM,0BAA0B;AAAA,IAC/F;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA,eAAe,QAAQ;AAAA,EACzB,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAOA,SAAS,kCAAkC;AACzC,QAAM,iBAAiB,CAAC,QAAQ,OAAO;AACvC,QAAM,cAAc,IAAI,IAAI,OAAO,SAAS,IAAI;AAChD,aAAW,SAAS,gBAAgB;AAClC,QAAI,CAAC,YAAY,aAAa,IAAI,KAAK,GAAG;AACxC,cAAQ,KAAK,IAAI,MAAM,uDAAuD,KAAK,2EAA2E,CAAC;AAC/J,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,gBAAgB,YAAY,aAAa,IAAI,OAAO,SAAK,wBAAS,uDAAuD;AAC/H,QAAM,mBAAe,6CAA8B,aAAa;AAEhE,MAAI,CAAC,cAAc;AAGjB,YAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAWZ;AACD,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,IAAI,IAAI,WAAW;AAClC,aAAW,SAAS,gBAAgB;AAClC,WAAO,aAAa,OAAO,KAAK;AAAA,EAClC;AAQA,SAAO,QAAQ,aAAa,CAAC,GAAG,IAAI,OAAO,SAAS,CAAC;AAErD,SAAO;AAAA,IACL;AAAA,IACA,cAAc,aAAa;AAAA,IAC3B,OAAO;AAAA,EACT;AACF;AAEA,eAAsB,kBACpB,OACA,aACA;AAIA,QAAM,WAAW,gCAAgC;AACjD,MAAI,CAAC,SAAU,QAAO,sBAAO,GAAG,MAAS;AAKzC,MAAI;AACF,WAAO,sBAAO,GAAG,MAAM,MAAM,kBAAkB;AAAA,MAC7C,aAAa,SAAS,YAAY;AAAA,MAClC,iBAAa,iCAAqB,aAAa,aAAa;AAAA,MAC5D,cAAc,SAAS;AAAA,MACvB,OAAO,SAAS;AAAA,IAClB,CAAC,CAAC;AAAA,EACJ,SAAS,GAAG;AACV,QAAI,+BAAW,aAAa,CAAC,GAAG;AAC9B,YAAM;AAAA,IACR;AACA,UAAM,IAAI,kCAAoB,6DAA6D,EAAE,OAAO,EAAE,CAAC;AAAA,EACzG;AACF;","names":[]}
|
|
1
|
+
{"version":3,"sources":["../../src/lib/auth.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY, INSTEAD EDIT THE CORRESPONDING FILE IN packages/template\n//===========================================\nimport { KnownError, StackClientInterface } from \"@stackframe/stack-shared\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { StackAssertionError, throwErr } from \"@stackframe/stack-shared/dist/utils/errors\";\nimport { neverResolve } from \"@stackframe/stack-shared/dist/utils/promises\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { deindent } from \"@stackframe/stack-shared/dist/utils/strings\";\nimport { constructRedirectUrl } from \"../utils/url\";\nimport { consumeVerifierAndStateCookie, saveVerifierAndState } from \"./cookie\";\n\nexport async function signInWithOAuth(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n codeChallenge,\n state,\n type: \"authenticate\",\n providerScope: options.providerScope,\n session,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\nexport async function addNewOAuthProviderOrScope(\n iface: StackClientInterface,\n options: {\n provider: string,\n redirectUrl: string,\n errorRedirectUrl: string,\n providerScope?: string,\n },\n session: InternalSession,\n) {\n const { codeChallenge, state } = await saveVerifierAndState();\n const location = await iface.getOAuthUrl({\n provider: options.provider,\n redirectUrl: constructRedirectUrl(options.redirectUrl, \"redirectUrl\"),\n errorRedirectUrl: constructRedirectUrl(options.errorRedirectUrl, \"errorRedirectUrl\"),\n afterCallbackRedirectUrl: constructRedirectUrl(window.location.href, \"afterCallbackRedirectUrl\"),\n codeChallenge,\n state,\n type: \"link\",\n session,\n providerScope: options.providerScope,\n });\n window.location.assign(location);\n await neverResolve();\n}\n\n/**\n * Checks if the current URL has the query parameters for an OAuth callback, and if so, removes them.\n *\n * Must be synchronous for the logic in callOAuthCallback to work without race conditions.\n */\nfunction consumeOAuthCallbackQueryParams() {\n const requiredParams = [\"code\", \"state\"];\n const originalUrl = new URL(window.location.href);\n for (const param of requiredParams) {\n if (!originalUrl.searchParams.has(param)) {\n console.warn(new Error(`Missing required query parameter on OAuth callback: ${param}. Maybe you opened or reloaded the oauth-callback page from your history?`));\n return null;\n }\n }\n\n const expectedState = originalUrl.searchParams.get(\"state\") ?? throwErr(\"This should never happen; isn't state required above?\");\n const cookieResult = consumeVerifierAndStateCookie(expectedState);\n\n if (!cookieResult) {\n // If the state can't be found in the cookies, then the callback wasn't meant for us.\n // Maybe the website uses another OAuth library?\n console.warn(deindent`\n Stack found an outer OAuth callback state in the query parameters, but not in cookies.\n \n This could have multiple reasons:\n - The cookie expired, because the OAuth flow took too long.\n - The user's browser deleted the cookie, either manually or because of a very strict cookie policy.\n - The cookie was already consumed by this page, and the user already logged in.\n - You are using another OAuth client library with the same callback URL as Stack.\n - The user opened the OAuth callback page from their history.\n\n Either way, it is probably safe to ignore this warning unless you are debugging an OAuth issue.\n `);\n return null;\n }\n\n\n const newUrl = new URL(originalUrl);\n for (const param of requiredParams) {\n newUrl.searchParams.delete(param);\n }\n\n // let's get rid of the authorization code in the history as we\n // don't redirect to `redirectUrl` if there's a validation error\n // (as the redirectUrl might be malicious!).\n //\n // We use history.replaceState instead of location.assign(...) to\n // prevent an unnecessary reload\n window.history.replaceState({}, \"\", newUrl.toString());\n\n return {\n originalUrl,\n codeVerifier: cookieResult.codeVerifier,\n state: expectedState,\n };\n}\n\nexport async function callOAuthCallback(\n iface: StackClientInterface,\n redirectUrl: string,\n) {\n // note: this part of the function (until the return) needs\n // to be synchronous, to prevent race conditions when\n // callOAuthCallback is called multiple times in parallel\n const consumed = consumeOAuthCallbackQueryParams();\n if (!consumed) return Result.ok(undefined);\n\n // the rest can be asynchronous (we now know that we are the\n // intended recipient of the callback, and the only instance\n // of callOAuthCallback that's running)\n try {\n return Result.ok(await iface.callOAuthCallback({\n oauthParams: consumed.originalUrl.searchParams,\n redirectUri: constructRedirectUrl(redirectUrl, \"redirectUri\"),\n codeVerifier: consumed.codeVerifier,\n state: consumed.state,\n }));\n } catch (e) {\n if (KnownError.isKnownError(e)) {\n throw e;\n }\n throw new StackAssertionError(\"Error signing in during OAuth callback. Please try again.\", { cause: e });\n }\n}\n"],"mappings":";;;;;;;;;;;;;;;;;;;;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAIA,0BAAiD;AAEjD,oBAA8C;AAC9C,sBAA6B;AAC7B,qBAAuB;AACvB,qBAAyB;AACzB,iBAAqC;AACrC,oBAAoE;AAEpE,eAAsB,gBACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN,eAAe,QAAQ;AAAA,IACvB;AAAA,EACF,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAEA,eAAsB,2BACpB,OACA,SAMA,SACA;AACA,QAAM,EAAE,eAAe,MAAM,IAAI,UAAM,oCAAqB;AAC5D,QAAM,WAAW,MAAM,MAAM,YAAY;AAAA,IACvC,UAAU,QAAQ;AAAA,IAClB,iBAAa,iCAAqB,QAAQ,aAAa,aAAa;AAAA,IACpE,sBAAkB,iCAAqB,QAAQ,kBAAkB,kBAAkB;AAAA,IACnF,8BAA0B,iCAAqB,OAAO,SAAS,MAAM,0BAA0B;AAAA,IAC/F;AAAA,IACA;AAAA,IACA,MAAM;AAAA,IACN;AAAA,IACA,eAAe,QAAQ;AAAA,EACzB,CAAC;AACD,SAAO,SAAS,OAAO,QAAQ;AAC/B,YAAM,8BAAa;AACrB;AAOA,SAAS,kCAAkC;AACzC,QAAM,iBAAiB,CAAC,QAAQ,OAAO;AACvC,QAAM,cAAc,IAAI,IAAI,OAAO,SAAS,IAAI;AAChD,aAAW,SAAS,gBAAgB;AAClC,QAAI,CAAC,YAAY,aAAa,IAAI,KAAK,GAAG;AACxC,cAAQ,KAAK,IAAI,MAAM,uDAAuD,KAAK,2EAA2E,CAAC;AAC/J,aAAO;AAAA,IACT;AAAA,EACF;AAEA,QAAM,gBAAgB,YAAY,aAAa,IAAI,OAAO,SAAK,wBAAS,uDAAuD;AAC/H,QAAM,mBAAe,6CAA8B,aAAa;AAEhE,MAAI,CAAC,cAAc;AAGjB,YAAQ,KAAK;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA;AAAA,KAWZ;AACD,WAAO;AAAA,EACT;AAGA,QAAM,SAAS,IAAI,IAAI,WAAW;AAClC,aAAW,SAAS,gBAAgB;AAClC,WAAO,aAAa,OAAO,KAAK;AAAA,EAClC;AAQA,SAAO,QAAQ,aAAa,CAAC,GAAG,IAAI,OAAO,SAAS,CAAC;AAErD,SAAO;AAAA,IACL;AAAA,IACA,cAAc,aAAa;AAAA,IAC3B,OAAO;AAAA,EACT;AACF;AAEA,eAAsB,kBACpB,OACA,aACA;AAIA,QAAM,WAAW,gCAAgC;AACjD,MAAI,CAAC,SAAU,QAAO,sBAAO,GAAG,MAAS;AAKzC,MAAI;AACF,WAAO,sBAAO,GAAG,MAAM,MAAM,kBAAkB;AAAA,MAC7C,aAAa,SAAS,YAAY;AAAA,MAClC,iBAAa,iCAAqB,aAAa,aAAa;AAAA,MAC5D,cAAc,SAAS;AAAA,MACvB,OAAO,SAAS;AAAA,IAClB,CAAC,CAAC;AAAA,EACJ,SAAS,GAAG;AACV,QAAI,+BAAW,aAAa,CAAC,GAAG;AAC9B,YAAM;AAAA,IACR;AACA,UAAM,IAAI,kCAAoB,6DAA6D,EAAE,OAAO,EAAE,CAAC;AAAA,EACzG;AACF;","names":[]}
|