@stackframe/stack 2.8.25 → 2.8.28
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/CHANGELOG.md +30 -0
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js +2 -2
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/components-page/account-settings.js +10 -1
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js +2 -2
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/esm/components-page/account-settings.js +11 -2
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +34 -42
- package/dist/esm/lib/stack-app/apps/implementations/admin-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/server-app-impl.js +3 -0
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.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/server-app.js.map +1 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -1
- package/dist/index.d.mts +43 -27
- package/dist/index.d.ts +43 -27
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +34 -42
- package/dist/lib/stack-app/apps/implementations/admin-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/server-app-impl.js +3 -0
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +1 -1
- package/dist/lib/stack-app/email/index.js.map +1 -1
- package/dist/lib/stack-app/projects/index.js.map +1 -1
- package/package.json +4 -4
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/interfaces/admin-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ChatContent } from \"@stackframe/stack-shared/dist/interface/admin-interface\";\nimport {
|
|
1
|
+
{"version":3,"sources":["../../../../../../src/lib/stack-app/apps/interfaces/admin-app.ts"],"sourcesContent":["\n//===========================================\n// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY\n//===========================================\nimport { ChatContent } from \"@stackframe/stack-shared/dist/interface/admin-interface\";\nimport { InternalSession } from \"@stackframe/stack-shared/dist/sessions\";\nimport { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { AsyncStoreProperty, EmailConfig } from \"../../common\";\nimport { AdminSentEmail } from \"../../email\";\nimport { InternalApiKey, InternalApiKeyCreateOptions, InternalApiKeyFirstView } from \"../../internal-api-keys\";\nimport { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions } from \"../../permissions\";\nimport { AdminProject } from \"../../projects\";\nimport { _StackAdminAppImpl } from \"../implementations\";\nimport { StackServerApp, StackServerAppConstructorOptions } from \"./server-app\";\n\n\nexport type StackAdminAppConstructorOptions<HasTokenStore extends boolean, ProjectId extends string> = (\n | (\n & StackServerAppConstructorOptions<HasTokenStore, ProjectId>\n & {\n superSecretAdminKey?: string,\n }\n )\n | (\n & Omit<StackServerAppConstructorOptions<HasTokenStore, ProjectId>, \"publishableClientKey\" | \"secretServerKey\">\n & {\n projectOwnerSession: InternalSession,\n }\n )\n);\n\n\nexport type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends string = string> = (\n & AsyncStoreProperty<\"project\", [], AdminProject, false>\n & AsyncStoreProperty<\"internalApiKeys\", [], InternalApiKey[], true>\n & AsyncStoreProperty<\"teamPermissionDefinitions\", [], AdminTeamPermissionDefinition[], true>\n & AsyncStoreProperty<\"projectPermissionDefinitions\", [], AdminProjectPermissionDefinition[], true>\n & AsyncStoreProperty<\"emailThemes\", [], { id: string, displayName: string }[], true>\n & AsyncStoreProperty<\"emailPreview\", [{ themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }], string, false>\n & AsyncStoreProperty<\"emailTemplates\", [], { id: string, displayName: string, themeId?: string, tsxSource: string }[], true>\n & {\n useEmailTemplates(): { id: string, displayName: string, tsxSource: string }[], // THIS_LINE_PLATFORM react-like\n listEmailTemplates(): Promise<{ id: string, displayName: string, tsxSource: string }[]>,\n\n createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView>,\n\n createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission>,\n updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions): Promise<void>,\n deleteTeamPermissionDefinition(permissionId: string): Promise<void>,\n\n createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise<AdminProjectPermission>,\n updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions): Promise<void>,\n deleteProjectPermissionDefinition(permissionId: string): Promise<void>,\n\n useSvixToken(): string, // THIS_LINE_PLATFORM react-like\n\n sendTestEmail(options: {\n recipientEmail: string,\n emailConfig: EmailConfig,\n }): Promise<Result<undefined, { errorMessage: string }>>,\n\n sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void>,\n\n listSentEmails(): Promise<AdminSentEmail[]>,\n\n useEmailTheme(id: string): { displayName: string, tsxSource: string }, // THIS_LINE_PLATFORM react-like\n createEmailTheme(displayName: string): Promise<{ id: string }>,\n updateEmailTheme(id: string, tsxSource: string): Promise<void>,\n\n sendChatMessage(\n threadId: string,\n contextType: \"email-theme\" | \"email-template\",\n messages: Array<{ role: string, content: any }>,\n abortSignal?: AbortSignal,\n ): Promise<{ content: ChatContent }>,\n saveChatMessage(threadId: string, message: any): Promise<void>,\n listChatMessages(threadId: string): Promise<{ messages: Array<any> }>,\n updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ renderedHtml: string }>,\n createEmailTemplate(displayName: string): Promise<{ id: string }>,\n }\n & StackServerApp<HasTokenStore, ProjectId>\n);\nexport type StackAdminAppConstructor = {\n new <\n HasTokenStore extends boolean,\n ProjectId extends string\n >(options: StackAdminAppConstructorOptions<HasTokenStore, ProjectId>): StackAdminApp<HasTokenStore, ProjectId>,\n new (options: StackAdminAppConstructorOptions<boolean, string>): StackAdminApp<boolean, string>,\n};\nexport const StackAdminApp: StackAdminAppConstructor = _StackAdminAppImpl;\n"],"mappings":";AAYA,SAAS,0BAA0B;AA6E5B,IAAM,gBAA0C;","names":[]}
|
|
@@ -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 { AsyncStoreProperty, GetUserOptions } from \"../../common\";\nimport { ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from \"../../teams\";\nimport { ProjectCurrentServerUser, ServerUser, ServerUserCreateOptions } 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\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options?: GetUserOptions<HasTokenStore>): ProjectCurrentServerUser<ProjectId> | null,\n useUser(id: string): ServerUser | null,\n useUser(options: { apiKey: string }): ServerUser | null,\n\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options?: GetUserOptions<HasTokenStore>): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n getUser(id: string): Promise<ServerUser | null>,\n getUser(options: { apiKey: string }): Promise<ServerUser | null>,\n\n useTeam(id: string): ServerTeam | null,\n useTeam(options: { apiKey: string }): ServerTeam | null,\n\n getTeam(id: string): Promise<ServerTeam | null>,\n getTeam(options: { apiKey: string }): Promise<ServerTeam | null>,\n\n\n useUsers(options?: ServerListUsersOptions): ServerUser[] & { nextCursor: string | null }, // THIS_LINE_PLATFORM react-like\n listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & { nextCursor: string | null }>,\n }\n & AsyncStoreProperty<\"user\", [id: string], ServerUser | null, false>\n & Omit<AsyncStoreProperty<\"users\", [], ServerUser[], true>, \"listUsers\" | \"useUsers\">\n & AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\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":";
|
|
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 { Result } from \"@stackframe/stack-shared/dist/utils/results\";\nimport { AsyncStoreProperty, GetUserOptions } from \"../../common\";\nimport { ServerListUsersOptions, ServerTeam, ServerTeamCreateOptions } from \"../../teams\";\nimport { ProjectCurrentServerUser, ServerUser, ServerUserCreateOptions } from \"../../users\";\nimport { _StackServerAppImpl } from \"../implementations\";\nimport { StackClientApp, StackClientAppConstructorOptions } from \"./client-app\";\nimport { KnownErrors } from \"@stackframe/stack-shared\";\nimport { SendEmailOptions } from \"../../email\";\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\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'redirect' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'throw' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options: GetUserOptions<HasTokenStore> & { or: 'anonymous' }): ProjectCurrentServerUser<ProjectId>,\n useUser(options?: GetUserOptions<HasTokenStore>): ProjectCurrentServerUser<ProjectId> | null,\n useUser(id: string): ServerUser | null,\n useUser(options: { apiKey: string }): ServerUser | null,\n\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'redirect' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'throw' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options: GetUserOptions<HasTokenStore> & { or: 'anonymous' }): Promise<ProjectCurrentServerUser<ProjectId>>,\n getUser(options?: GetUserOptions<HasTokenStore>): Promise<ProjectCurrentServerUser<ProjectId> | null>,\n getUser(id: string): Promise<ServerUser | null>,\n getUser(options: { apiKey: string }): Promise<ServerUser | null>,\n\n useTeam(id: string): ServerTeam | null,\n useTeam(options: { apiKey: string }): ServerTeam | null,\n\n getTeam(id: string): Promise<ServerTeam | null>,\n getTeam(options: { apiKey: string }): Promise<ServerTeam | null>,\n\n\n useUsers(options?: ServerListUsersOptions): ServerUser[] & { nextCursor: string | null }, // THIS_LINE_PLATFORM react-like\n listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & { nextCursor: string | null }>,\n sendEmail(options: SendEmailOptions): Promise<Result<void, KnownErrors[\"RequiresCustomEmailServer\"] | KnownErrors[\"SchemaError\"] | KnownErrors[\"UserIdDoesNotExist\"]>>,\n }\n & AsyncStoreProperty<\"user\", [id: string], ServerUser | null, false>\n & Omit<AsyncStoreProperty<\"users\", [], ServerUser[], true>, \"listUsers\" | \"useUsers\">\n & AsyncStoreProperty<\"teams\", [], ServerTeam[], true>\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":";AAQA,SAAS,2BAA2B;AA0D7B,IAAM,iBAA4C;","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 { 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 config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n useProductionModeErrors(this: AdminProject): 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 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 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};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n };\n}\n"],"mappings":";
|
|
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 { EnvironmentConfigOverrideOverride, OrganizationRenderedConfig } 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 config: AdminProjectConfig,\n\n update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>,\n delete(this: AdminProject): Promise<void>,\n\n getConfig(this: AdminProject): Promise<OrganizationRenderedConfig>,\n useConfig(this: AdminProject): OrganizationRenderedConfig,\n updateConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride): Promise<void>,\n\n getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>,\n useProductionModeErrors(this: AdminProject): 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 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 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};\nexport function adminProjectCreateOptionsToCrud(options: AdminProjectCreateOptions): AdminUserProjectsCrud[\"Server\"][\"Create\"] {\n return {\n ...adminProjectUpdateOptionsToCrud(options),\n display_name: options.displayName,\n };\n}\n"],"mappings":";AA+CO,SAAS,gCAAgC,SAAqE;AACnH,SAAO;AAAA,IACL,cAAc,QAAQ;AAAA,IACtB,aAAa,QAAQ;AAAA,IACrB,oBAAoB,QAAQ;AAAA,IAC5B,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;AAKO,SAAS,gCAAgC,SAA+E;AAC7H,SAAO;AAAA,IACL,GAAG,gCAAgC,OAAO;AAAA,IAC1C,cAAc,QAAQ;AAAA,EACxB;AACF;","names":[]}
|
package/dist/index.d.mts
CHANGED
|
@@ -3,15 +3,15 @@ import { CurrentUserCrud } from '@stackframe/stack-shared/dist/interface/crud/cu
|
|
|
3
3
|
import { Result } from '@stackframe/stack-shared/dist/utils/results';
|
|
4
4
|
import { ProviderType } from '@stackframe/stack-shared/dist/utils/oauth';
|
|
5
5
|
import { ProductionModeError } from '@stackframe/stack-shared/dist/helpers/production-mode';
|
|
6
|
+
import { OrganizationRenderedConfig, EnvironmentConfigOverrideOverride } from '@stackframe/stack-shared/dist/config/schema';
|
|
6
7
|
import { ChatContent } from '@stackframe/stack-shared/dist/interface/admin-interface';
|
|
7
|
-
import { EmailTemplateType } from '@stackframe/stack-shared/dist/interface/crud/email-templates';
|
|
8
8
|
import { InternalSession } from '@stackframe/stack-shared/dist/sessions';
|
|
9
9
|
import { InternalApiKeysCrud } from '@stackframe/stack-shared/dist/interface/crud/internal-api-keys';
|
|
10
10
|
import { ReadonlyJson } from '@stackframe/stack-shared/dist/utils/json';
|
|
11
11
|
import { PrettifyType, IfAndOnlyIf } from '@stackframe/stack-shared/dist/utils/types';
|
|
12
12
|
import { GeoInfo } from '@stackframe/stack-shared/dist/utils/geo';
|
|
13
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
|
-
import
|
|
14
|
+
import * as lucide_react from 'lucide-react';
|
|
15
15
|
import React$1 from 'react';
|
|
16
16
|
|
|
17
17
|
type RedirectToOptions = {
|
|
@@ -83,17 +83,17 @@ type AdminSentEmail = {
|
|
|
83
83
|
sentAt: Date;
|
|
84
84
|
error?: unknown;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
subject: string;
|
|
90
|
-
content: any;
|
|
91
|
-
isDefault: boolean;
|
|
92
|
-
};
|
|
93
|
-
type AdminEmailTemplateUpdateOptions = {
|
|
86
|
+
type SendEmailOptions = {
|
|
87
|
+
userIds: string[];
|
|
88
|
+
themeId?: string | null | false;
|
|
94
89
|
subject?: string;
|
|
95
|
-
|
|
96
|
-
}
|
|
90
|
+
notificationCategoryName?: string;
|
|
91
|
+
} & ({
|
|
92
|
+
html: string;
|
|
93
|
+
} | {
|
|
94
|
+
templateId: string;
|
|
95
|
+
variables?: Record<string, any>;
|
|
96
|
+
});
|
|
97
97
|
|
|
98
98
|
type InternalApiKeyBase = {
|
|
99
99
|
id: string;
|
|
@@ -712,6 +712,7 @@ type StackServerApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
712
712
|
listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & {
|
|
713
713
|
nextCursor: string | null;
|
|
714
714
|
}>;
|
|
715
|
+
sendEmail(options: SendEmailOptions): Promise<Result<void, KnownErrors["RequiresCustomEmailServer"] | KnownErrors["SchemaError"] | KnownErrors["UserIdDoesNotExist"]>>;
|
|
715
716
|
} & AsyncStoreProperty<"user", [id: string], ServerUser | null, false> & Omit<AsyncStoreProperty<"users", [], ServerUser[], true>, "listUsers" | "useUsers"> & AsyncStoreProperty<"teams", [], ServerTeam[], true> & StackClientApp<HasTokenStore, ProjectId>);
|
|
716
717
|
declare const StackServerApp: StackServerAppConstructor;
|
|
717
718
|
|
|
@@ -728,20 +729,26 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
728
729
|
id: string;
|
|
729
730
|
displayName: string;
|
|
730
731
|
}[], true> & AsyncStoreProperty<"emailPreview", [{
|
|
731
|
-
themeId?: string;
|
|
732
|
+
themeId?: string | null | false;
|
|
732
733
|
themeTsxSource?: string;
|
|
733
734
|
templateId?: string;
|
|
734
735
|
templateTsxSource?: string;
|
|
735
|
-
}], string, false> & AsyncStoreProperty<"
|
|
736
|
+
}], string, false> & AsyncStoreProperty<"emailTemplates", [], {
|
|
736
737
|
id: string;
|
|
737
|
-
subject: string;
|
|
738
738
|
displayName: string;
|
|
739
|
+
themeId?: string;
|
|
739
740
|
tsxSource: string;
|
|
740
741
|
}[], true> & {
|
|
741
|
-
useEmailTemplates():
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
742
|
+
useEmailTemplates(): {
|
|
743
|
+
id: string;
|
|
744
|
+
displayName: string;
|
|
745
|
+
tsxSource: string;
|
|
746
|
+
}[];
|
|
747
|
+
listEmailTemplates(): Promise<{
|
|
748
|
+
id: string;
|
|
749
|
+
displayName: string;
|
|
750
|
+
tsxSource: string;
|
|
751
|
+
}[]>;
|
|
745
752
|
createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView>;
|
|
746
753
|
createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission>;
|
|
747
754
|
updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions): Promise<void>;
|
|
@@ -758,12 +765,6 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
758
765
|
}>>;
|
|
759
766
|
sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void>;
|
|
760
767
|
listSentEmails(): Promise<AdminSentEmail[]>;
|
|
761
|
-
sendEmail(options: {
|
|
762
|
-
userIds: string[];
|
|
763
|
-
subject: string;
|
|
764
|
-
content: string;
|
|
765
|
-
notificationCategoryName: string;
|
|
766
|
-
}): Promise<void>;
|
|
767
768
|
useEmailTheme(id: string): {
|
|
768
769
|
displayName: string;
|
|
769
770
|
tsxSource: string;
|
|
@@ -782,9 +783,12 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
782
783
|
listChatMessages(threadId: string): Promise<{
|
|
783
784
|
messages: Array<any>;
|
|
784
785
|
}>;
|
|
785
|
-
|
|
786
|
+
updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{
|
|
786
787
|
renderedHtml: string;
|
|
787
788
|
}>;
|
|
789
|
+
createEmailTemplate(displayName: string): Promise<{
|
|
790
|
+
id: string;
|
|
791
|
+
}>;
|
|
788
792
|
} & StackServerApp<HasTokenStore, ProjectId>);
|
|
789
793
|
declare const StackAdminApp: StackAdminAppConstructor;
|
|
790
794
|
|
|
@@ -892,6 +896,9 @@ type AdminProject = {
|
|
|
892
896
|
readonly config: AdminProjectConfig;
|
|
893
897
|
update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>;
|
|
894
898
|
delete(this: AdminProject): Promise<void>;
|
|
899
|
+
getConfig(this: AdminProject): Promise<OrganizationRenderedConfig>;
|
|
900
|
+
useConfig(this: AdminProject): OrganizationRenderedConfig;
|
|
901
|
+
updateConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride): Promise<void>;
|
|
895
902
|
getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>;
|
|
896
903
|
useProductionModeErrors(this: AdminProject): ProductionModeError[];
|
|
897
904
|
} & Project;
|
|
@@ -1014,6 +1021,15 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
1014
1021
|
});
|
|
1015
1022
|
declare const StackClientApp: StackClientAppConstructor;
|
|
1016
1023
|
|
|
1024
|
+
declare const iconMap: {
|
|
1025
|
+
readonly Contact: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1026
|
+
readonly ShieldCheck: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1027
|
+
readonly Bell: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1028
|
+
readonly Monitor: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1029
|
+
readonly Key: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1030
|
+
readonly Settings: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1031
|
+
readonly CirclePlus: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1032
|
+
};
|
|
1017
1033
|
declare function AccountSettings(props: {
|
|
1018
1034
|
fullPage?: boolean;
|
|
1019
1035
|
extraItems?: ({
|
|
@@ -1023,7 +1039,7 @@ declare function AccountSettings(props: {
|
|
|
1023
1039
|
} & ({
|
|
1024
1040
|
icon?: React$1.ReactNode;
|
|
1025
1041
|
} | {
|
|
1026
|
-
iconName?: keyof typeof
|
|
1042
|
+
iconName?: keyof typeof iconMap;
|
|
1027
1043
|
}))[];
|
|
1028
1044
|
mockUser?: {
|
|
1029
1045
|
displayName?: string;
|
package/dist/index.d.ts
CHANGED
|
@@ -3,15 +3,15 @@ import { CurrentUserCrud } from '@stackframe/stack-shared/dist/interface/crud/cu
|
|
|
3
3
|
import { Result } from '@stackframe/stack-shared/dist/utils/results';
|
|
4
4
|
import { ProviderType } from '@stackframe/stack-shared/dist/utils/oauth';
|
|
5
5
|
import { ProductionModeError } from '@stackframe/stack-shared/dist/helpers/production-mode';
|
|
6
|
+
import { OrganizationRenderedConfig, EnvironmentConfigOverrideOverride } from '@stackframe/stack-shared/dist/config/schema';
|
|
6
7
|
import { ChatContent } from '@stackframe/stack-shared/dist/interface/admin-interface';
|
|
7
|
-
import { EmailTemplateType } from '@stackframe/stack-shared/dist/interface/crud/email-templates';
|
|
8
8
|
import { InternalSession } from '@stackframe/stack-shared/dist/sessions';
|
|
9
9
|
import { InternalApiKeysCrud } from '@stackframe/stack-shared/dist/interface/crud/internal-api-keys';
|
|
10
10
|
import { ReadonlyJson } from '@stackframe/stack-shared/dist/utils/json';
|
|
11
11
|
import { PrettifyType, IfAndOnlyIf } from '@stackframe/stack-shared/dist/utils/types';
|
|
12
12
|
import { GeoInfo } from '@stackframe/stack-shared/dist/utils/geo';
|
|
13
13
|
import * as react_jsx_runtime from 'react/jsx-runtime';
|
|
14
|
-
import
|
|
14
|
+
import * as lucide_react from 'lucide-react';
|
|
15
15
|
import React$1 from 'react';
|
|
16
16
|
|
|
17
17
|
type RedirectToOptions = {
|
|
@@ -83,17 +83,17 @@ type AdminSentEmail = {
|
|
|
83
83
|
sentAt: Date;
|
|
84
84
|
error?: unknown;
|
|
85
85
|
};
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
subject: string;
|
|
90
|
-
content: any;
|
|
91
|
-
isDefault: boolean;
|
|
92
|
-
};
|
|
93
|
-
type AdminEmailTemplateUpdateOptions = {
|
|
86
|
+
type SendEmailOptions = {
|
|
87
|
+
userIds: string[];
|
|
88
|
+
themeId?: string | null | false;
|
|
94
89
|
subject?: string;
|
|
95
|
-
|
|
96
|
-
}
|
|
90
|
+
notificationCategoryName?: string;
|
|
91
|
+
} & ({
|
|
92
|
+
html: string;
|
|
93
|
+
} | {
|
|
94
|
+
templateId: string;
|
|
95
|
+
variables?: Record<string, any>;
|
|
96
|
+
});
|
|
97
97
|
|
|
98
98
|
type InternalApiKeyBase = {
|
|
99
99
|
id: string;
|
|
@@ -712,6 +712,7 @@ type StackServerApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
712
712
|
listUsers(options?: ServerListUsersOptions): Promise<ServerUser[] & {
|
|
713
713
|
nextCursor: string | null;
|
|
714
714
|
}>;
|
|
715
|
+
sendEmail(options: SendEmailOptions): Promise<Result<void, KnownErrors["RequiresCustomEmailServer"] | KnownErrors["SchemaError"] | KnownErrors["UserIdDoesNotExist"]>>;
|
|
715
716
|
} & AsyncStoreProperty<"user", [id: string], ServerUser | null, false> & Omit<AsyncStoreProperty<"users", [], ServerUser[], true>, "listUsers" | "useUsers"> & AsyncStoreProperty<"teams", [], ServerTeam[], true> & StackClientApp<HasTokenStore, ProjectId>);
|
|
716
717
|
declare const StackServerApp: StackServerAppConstructor;
|
|
717
718
|
|
|
@@ -728,20 +729,26 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
728
729
|
id: string;
|
|
729
730
|
displayName: string;
|
|
730
731
|
}[], true> & AsyncStoreProperty<"emailPreview", [{
|
|
731
|
-
themeId?: string;
|
|
732
|
+
themeId?: string | null | false;
|
|
732
733
|
themeTsxSource?: string;
|
|
733
734
|
templateId?: string;
|
|
734
735
|
templateTsxSource?: string;
|
|
735
|
-
}], string, false> & AsyncStoreProperty<"
|
|
736
|
+
}], string, false> & AsyncStoreProperty<"emailTemplates", [], {
|
|
736
737
|
id: string;
|
|
737
|
-
subject: string;
|
|
738
738
|
displayName: string;
|
|
739
|
+
themeId?: string;
|
|
739
740
|
tsxSource: string;
|
|
740
741
|
}[], true> & {
|
|
741
|
-
useEmailTemplates():
|
|
742
|
-
|
|
743
|
-
|
|
744
|
-
|
|
742
|
+
useEmailTemplates(): {
|
|
743
|
+
id: string;
|
|
744
|
+
displayName: string;
|
|
745
|
+
tsxSource: string;
|
|
746
|
+
}[];
|
|
747
|
+
listEmailTemplates(): Promise<{
|
|
748
|
+
id: string;
|
|
749
|
+
displayName: string;
|
|
750
|
+
tsxSource: string;
|
|
751
|
+
}[]>;
|
|
745
752
|
createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView>;
|
|
746
753
|
createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission>;
|
|
747
754
|
updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions): Promise<void>;
|
|
@@ -758,12 +765,6 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
758
765
|
}>>;
|
|
759
766
|
sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void>;
|
|
760
767
|
listSentEmails(): Promise<AdminSentEmail[]>;
|
|
761
|
-
sendEmail(options: {
|
|
762
|
-
userIds: string[];
|
|
763
|
-
subject: string;
|
|
764
|
-
content: string;
|
|
765
|
-
notificationCategoryName: string;
|
|
766
|
-
}): Promise<void>;
|
|
767
768
|
useEmailTheme(id: string): {
|
|
768
769
|
displayName: string;
|
|
769
770
|
tsxSource: string;
|
|
@@ -782,9 +783,12 @@ type StackAdminApp<HasTokenStore extends boolean = boolean, ProjectId extends st
|
|
|
782
783
|
listChatMessages(threadId: string): Promise<{
|
|
783
784
|
messages: Array<any>;
|
|
784
785
|
}>;
|
|
785
|
-
|
|
786
|
+
updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{
|
|
786
787
|
renderedHtml: string;
|
|
787
788
|
}>;
|
|
789
|
+
createEmailTemplate(displayName: string): Promise<{
|
|
790
|
+
id: string;
|
|
791
|
+
}>;
|
|
788
792
|
} & StackServerApp<HasTokenStore, ProjectId>);
|
|
789
793
|
declare const StackAdminApp: StackAdminAppConstructor;
|
|
790
794
|
|
|
@@ -892,6 +896,9 @@ type AdminProject = {
|
|
|
892
896
|
readonly config: AdminProjectConfig;
|
|
893
897
|
update(this: AdminProject, update: AdminProjectUpdateOptions): Promise<void>;
|
|
894
898
|
delete(this: AdminProject): Promise<void>;
|
|
899
|
+
getConfig(this: AdminProject): Promise<OrganizationRenderedConfig>;
|
|
900
|
+
useConfig(this: AdminProject): OrganizationRenderedConfig;
|
|
901
|
+
updateConfig(this: AdminProject, config: EnvironmentConfigOverrideOverride): Promise<void>;
|
|
895
902
|
getProductionModeErrors(this: AdminProject): Promise<ProductionModeError[]>;
|
|
896
903
|
useProductionModeErrors(this: AdminProject): ProductionModeError[];
|
|
897
904
|
} & Project;
|
|
@@ -1014,6 +1021,15 @@ type StackClientApp<HasTokenStore extends boolean = boolean, ProjectId extends s
|
|
|
1014
1021
|
});
|
|
1015
1022
|
declare const StackClientApp: StackClientAppConstructor;
|
|
1016
1023
|
|
|
1024
|
+
declare const iconMap: {
|
|
1025
|
+
readonly Contact: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1026
|
+
readonly ShieldCheck: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1027
|
+
readonly Bell: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1028
|
+
readonly Monitor: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1029
|
+
readonly Key: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1030
|
+
readonly Settings: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1031
|
+
readonly CirclePlus: React$1.ForwardRefExoticComponent<Omit<lucide_react.LucideProps, "ref"> & React$1.RefAttributes<SVGSVGElement>>;
|
|
1032
|
+
};
|
|
1017
1033
|
declare function AccountSettings(props: {
|
|
1018
1034
|
fullPage?: boolean;
|
|
1019
1035
|
extraItems?: ({
|
|
@@ -1023,7 +1039,7 @@ declare function AccountSettings(props: {
|
|
|
1023
1039
|
} & ({
|
|
1024
1040
|
icon?: React$1.ReactNode;
|
|
1025
1041
|
} | {
|
|
1026
|
-
iconName?: keyof typeof
|
|
1042
|
+
iconName?: keyof typeof iconMap;
|
|
1027
1043
|
}))[];
|
|
1028
1044
|
mockUser?: {
|
|
1029
1045
|
displayName?: string;
|
|
@@ -30,7 +30,6 @@ var import_objects = require("@stackframe/stack-shared/dist/utils/objects");
|
|
|
30
30
|
var import_results = require("@stackframe/stack-shared/dist/utils/results");
|
|
31
31
|
var import_react = require("react");
|
|
32
32
|
var import_common = require("../../common.js");
|
|
33
|
-
var import_email_templates = require("../../email-templates/index.js");
|
|
34
33
|
var import_internal_api_keys = require("../../internal-api-keys/index.js");
|
|
35
34
|
var import_permissions = require("../../permissions/index.js");
|
|
36
35
|
var import_projects = require("../../projects/index.js");
|
|
@@ -68,17 +67,14 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
68
67
|
const res = await this._interface.listInternalApiKeys();
|
|
69
68
|
return res;
|
|
70
69
|
});
|
|
71
|
-
this._adminEmailTemplatesCache = (0, import_common2.createCache)(async () => {
|
|
72
|
-
return await this._interface.listEmailTemplates();
|
|
73
|
-
});
|
|
74
70
|
this._adminEmailThemeCache = (0, import_common2.createCache)(async ([id]) => {
|
|
75
71
|
return await this._interface.getEmailTheme(id);
|
|
76
72
|
});
|
|
77
73
|
this._adminEmailThemesCache = (0, import_common2.createCache)(async () => {
|
|
78
74
|
return await this._interface.listEmailThemes();
|
|
79
75
|
});
|
|
80
|
-
this.
|
|
81
|
-
return await this._interface.
|
|
76
|
+
this._adminEmailTemplatesCache = (0, import_common2.createCache)(async () => {
|
|
77
|
+
return await this._interface.listInternalEmailTemplates();
|
|
82
78
|
});
|
|
83
79
|
this._adminTeamPermissionDefinitionsCache = (0, import_common2.createCache)(async () => {
|
|
84
80
|
return await this._interface.listTeamPermissionDefinitions();
|
|
@@ -95,6 +91,12 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
95
91
|
this._emailPreviewCache = (0, import_common2.createCache)(async ([themeId, themeTsxSource, templateId, templateTsxSource]) => {
|
|
96
92
|
return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource });
|
|
97
93
|
});
|
|
94
|
+
this._configOverridesCache = (0, import_common2.createCache)(async () => {
|
|
95
|
+
return await this._interface.getConfig();
|
|
96
|
+
});
|
|
97
|
+
}
|
|
98
|
+
_adminConfigFromCrud(data) {
|
|
99
|
+
return JSON.parse(data.config_string);
|
|
98
100
|
}
|
|
99
101
|
_adminOwnedProjectFromCrud(data, onRefresh) {
|
|
100
102
|
if (this._tokenStoreInit !== null) {
|
|
@@ -159,8 +161,19 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
159
161
|
teamMemberDefaultPermissions: data.config.team_member_default_permissions,
|
|
160
162
|
userDefaultPermissions: data.config.user_default_permissions
|
|
161
163
|
},
|
|
164
|
+
async getConfig() {
|
|
165
|
+
return app._adminConfigFromCrud(await app._interface.getConfig());
|
|
166
|
+
},
|
|
167
|
+
useConfig() {
|
|
168
|
+
const config = (0, import_common3.useAsyncCache)(app._configOverridesCache, [], "useConfig()");
|
|
169
|
+
return (0, import_react.useMemo)(() => app._adminConfigFromCrud(config), [config]);
|
|
170
|
+
},
|
|
171
|
+
async updateConfig(configOverride) {
|
|
172
|
+
await app._interface.updateConfig({ configOverride });
|
|
173
|
+
},
|
|
162
174
|
async update(update) {
|
|
163
|
-
|
|
175
|
+
const updateOptions = (0, import_projects.adminProjectUpdateOptionsToCrud)(update);
|
|
176
|
+
await app._interface.updateProject(updateOptions);
|
|
164
177
|
await onRefresh();
|
|
165
178
|
},
|
|
166
179
|
async delete() {
|
|
@@ -249,16 +262,6 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
249
262
|
await this._refreshInternalApiKeys();
|
|
250
263
|
return this._createInternalApiKeyFirstViewFromCrud(crud);
|
|
251
264
|
}
|
|
252
|
-
useEmailTemplates() {
|
|
253
|
-
const crud = (0, import_common3.useAsyncCache)(this._adminEmailTemplatesCache, [], "useEmailTemplates()");
|
|
254
|
-
return (0, import_react.useMemo)(() => {
|
|
255
|
-
return crud.map((j) => this._adminEmailTemplateFromCrud(j));
|
|
256
|
-
}, [crud]);
|
|
257
|
-
}
|
|
258
|
-
async listEmailTemplates() {
|
|
259
|
-
const crud = import_results.Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], "write-only"));
|
|
260
|
-
return crud.map((j) => this._adminEmailTemplateFromCrud(j));
|
|
261
|
-
}
|
|
262
265
|
useEmailThemes() {
|
|
263
266
|
const crud = (0, import_common3.useAsyncCache)(this._adminEmailThemesCache, [], "useEmailThemes()");
|
|
264
267
|
return (0, import_react.useMemo)(() => {
|
|
@@ -268,13 +271,13 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
268
271
|
}));
|
|
269
272
|
}, [crud]);
|
|
270
273
|
}
|
|
271
|
-
|
|
272
|
-
const crud = (0, import_common3.useAsyncCache)(this.
|
|
274
|
+
useEmailTemplates() {
|
|
275
|
+
const crud = (0, import_common3.useAsyncCache)(this._adminEmailTemplatesCache, [], "useEmailTemplates()");
|
|
273
276
|
return (0, import_react.useMemo)(() => {
|
|
274
277
|
return crud.map((template) => ({
|
|
275
278
|
id: template.id,
|
|
276
|
-
subject: template.subject,
|
|
277
279
|
displayName: template.display_name,
|
|
280
|
+
themeId: template.theme_id,
|
|
278
281
|
tsxSource: template.tsx_source
|
|
279
282
|
}));
|
|
280
283
|
}, [crud]);
|
|
@@ -286,23 +289,15 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
286
289
|
displayName: theme.display_name
|
|
287
290
|
}));
|
|
288
291
|
}
|
|
289
|
-
async
|
|
290
|
-
const crud = import_results.Result.orThrow(await this.
|
|
292
|
+
async listEmailTemplates() {
|
|
293
|
+
const crud = import_results.Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], "write-only"));
|
|
291
294
|
return crud.map((template) => ({
|
|
292
295
|
id: template.id,
|
|
293
|
-
subject: template.subject,
|
|
294
296
|
displayName: template.display_name,
|
|
297
|
+
themeId: template.theme_id,
|
|
295
298
|
tsxSource: template.tsx_source
|
|
296
299
|
}));
|
|
297
300
|
}
|
|
298
|
-
async updateEmailTemplate(type, data) {
|
|
299
|
-
await this._interface.updateEmailTemplate(type, (0, import_email_templates.adminEmailTemplateUpdateOptionsToCrud)(data));
|
|
300
|
-
await this._adminEmailTemplatesCache.refresh([]);
|
|
301
|
-
}
|
|
302
|
-
async resetEmailTemplate(type) {
|
|
303
|
-
await this._interface.resetEmailTemplate(type);
|
|
304
|
-
await this._adminEmailTemplatesCache.refresh([]);
|
|
305
|
-
}
|
|
306
301
|
async createTeamPermissionDefinition(data) {
|
|
307
302
|
const crud = await this._interface.createTeamPermissionDefinition((0, import_permissions.adminTeamPermissionDefinitionCreateOptionsToCrud)(data));
|
|
308
303
|
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
@@ -396,17 +391,14 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
396
391
|
error: email.error
|
|
397
392
|
}));
|
|
398
393
|
}
|
|
399
|
-
async sendEmail(options) {
|
|
400
|
-
await this._interface.sendEmail({
|
|
401
|
-
user_ids: options.userIds,
|
|
402
|
-
subject: options.subject,
|
|
403
|
-
html: options.content,
|
|
404
|
-
notification_category_name: options.notificationCategoryName
|
|
405
|
-
});
|
|
406
|
-
}
|
|
407
394
|
async sendSignInInvitationEmail(email, callbackUrl) {
|
|
408
395
|
await this._interface.sendSignInInvitationEmail(email, callbackUrl);
|
|
409
396
|
}
|
|
397
|
+
async createEmailTemplate(displayName) {
|
|
398
|
+
const result = await this._interface.createEmailTemplate(displayName);
|
|
399
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
400
|
+
return result;
|
|
401
|
+
}
|
|
410
402
|
async sendChatMessage(threadId, contextType, messages, abortSignal) {
|
|
411
403
|
return await this._interface.sendChatMessage(threadId, contextType, messages, abortSignal);
|
|
412
404
|
}
|
|
@@ -438,9 +430,9 @@ var _StackAdminAppImplIncomplete = class extends import_server_app_impl._StackSe
|
|
|
438
430
|
async updateEmailTheme(id, tsxSource) {
|
|
439
431
|
await this._interface.updateEmailTheme(id, tsxSource);
|
|
440
432
|
}
|
|
441
|
-
async
|
|
442
|
-
const result = await this._interface.
|
|
443
|
-
await this.
|
|
433
|
+
async updateEmailTemplate(id, tsxSource, themeId) {
|
|
434
|
+
const result = await this._interface.updateEmailTemplate(id, tsxSource, themeId);
|
|
435
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
444
436
|
return { renderedHtml: result.rendered_html };
|
|
445
437
|
}
|
|
446
438
|
};
|