@hexclave/js 1.0.0
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/LICENSE +7 -0
- package/README.md +26 -0
- package/dist/chunk-BE-pF4vm.js +34 -0
- package/dist/dev-tool/dev-tool-core.d.ts +7 -0
- package/dist/dev-tool/dev-tool-core.d.ts.map +1 -0
- package/dist/dev-tool/dev-tool-core.js +2116 -0
- package/dist/dev-tool/dev-tool-core.js.map +1 -0
- package/dist/dev-tool/dev-tool-styles.d.ts +5 -0
- package/dist/dev-tool/dev-tool-styles.d.ts.map +1 -0
- package/dist/dev-tool/dev-tool-styles.js +2757 -0
- package/dist/dev-tool/dev-tool-styles.js.map +1 -0
- package/dist/dev-tool/dev-tool-trigger-position.d.ts +36 -0
- package/dist/dev-tool/dev-tool-trigger-position.d.ts.map +1 -0
- package/dist/dev-tool/dev-tool-trigger-position.js +70 -0
- package/dist/dev-tool/dev-tool-trigger-position.js.map +1 -0
- package/dist/dev-tool/dev-tool-trigger-position.test.d.ts +1 -0
- package/dist/dev-tool/dev-tool-trigger-position.test.js +155 -0
- package/dist/dev-tool/dev-tool-trigger-position.test.js.map +1 -0
- package/dist/dev-tool/index.d.ts +19 -0
- package/dist/dev-tool/index.d.ts.map +1 -0
- package/dist/dev-tool/index.js +119 -0
- package/dist/dev-tool/index.js.map +1 -0
- package/dist/esm/dev-tool/dev-tool-core.d.ts +7 -0
- package/dist/esm/dev-tool/dev-tool-core.d.ts.map +1 -0
- package/dist/esm/dev-tool/dev-tool-core.js +2114 -0
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -0
- package/dist/esm/dev-tool/dev-tool-styles.d.ts +5 -0
- package/dist/esm/dev-tool/dev-tool-styles.d.ts.map +1 -0
- package/dist/esm/dev-tool/dev-tool-styles.js +2755 -0
- package/dist/esm/dev-tool/dev-tool-styles.js.map +1 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.d.ts +36 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.d.ts.map +1 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.js +65 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.js.map +1 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.test.d.ts +1 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.test.js +155 -0
- package/dist/esm/dev-tool/dev-tool-trigger-position.test.js.map +1 -0
- package/dist/esm/dev-tool/index.d.ts +19 -0
- package/dist/esm/dev-tool/index.d.ts.map +1 -0
- package/dist/esm/dev-tool/index.js +117 -0
- package/dist/esm/dev-tool/index.js.map +1 -0
- package/dist/esm/index.d.ts +4 -0
- package/dist/esm/index.js +7 -0
- package/dist/esm/integrations/convex/component/convex.config.d.ts +7 -0
- package/dist/esm/integrations/convex/component/convex.config.d.ts.map +1 -0
- package/dist/esm/integrations/convex/component/convex.config.js +8 -0
- package/dist/esm/integrations/convex/component/convex.config.js.map +1 -0
- package/dist/esm/integrations/convex.d.ts +13 -0
- package/dist/esm/integrations/convex.d.ts.map +1 -0
- package/dist/esm/integrations/convex.js +23 -0
- package/dist/esm/integrations/convex.js.map +1 -0
- package/dist/esm/internal/deprecation-warning.d.ts +1 -0
- package/dist/esm/internal/deprecation-warning.js +24 -0
- package/dist/esm/internal/deprecation-warning.js.map +1 -0
- package/dist/esm/lib/auth.d.ts +31 -0
- package/dist/esm/lib/auth.d.ts.map +1 -0
- package/dist/esm/lib/auth.js +108 -0
- package/dist/esm/lib/auth.js.map +1 -0
- package/dist/esm/lib/auth.test.d.ts +1 -0
- package/dist/esm/lib/auth.test.js +60 -0
- package/dist/esm/lib/auth.test.js.map +1 -0
- package/dist/esm/lib/cookie.d.ts +42 -0
- package/dist/esm/lib/cookie.d.ts.map +1 -0
- package/dist/esm/lib/cookie.js +287 -0
- package/dist/esm/lib/cookie.js.map +1 -0
- package/dist/esm/lib/env.d.ts +42 -0
- package/dist/esm/lib/env.d.ts.map +1 -0
- package/dist/esm/lib/env.js +93 -0
- package/dist/esm/lib/env.js.map +1 -0
- package/dist/esm/lib/stack-app/api-keys/index.d.ts +53 -0
- package/dist/esm/lib/stack-app/api-keys/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/api-keys/index.js +22 -0
- package/dist/esm/lib/stack-app/api-keys/index.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts +364 -0
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js +924 -0
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js +55 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts +542 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js +2504 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js +32 -0
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/common.d.ts +65 -0
- package/dist/esm/lib/stack-app/apps/implementations/common.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/common.js +127 -0
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.d.ts +42 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.js +211 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.test.js +87 -0
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.test.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/index.d.ts +9 -0
- package/dist/esm/lib/stack-app/apps/implementations/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/index.js +27 -0
- package/dist/esm/lib/stack-app/apps/implementations/index.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.d.ts +35 -0
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.js +197 -0
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.d.ts +203 -0
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js +1094 -0
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.d.ts +28 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.js +31 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.test.js +82 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.test.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.d.ts +111 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.js +241 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.test.js +29 -0
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.test.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/index.d.ts +4 -0
- package/dist/esm/lib/stack-app/apps/index.js +5 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.d.ts +244 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js +9 -0
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.d.ts +208 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js +9 -0
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.d.ts +116 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js +9 -0
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js.map +1 -0
- package/dist/esm/lib/stack-app/common.d.ts +174 -0
- package/dist/esm/lib/stack-app/common.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/common.js +7 -0
- package/dist/esm/lib/stack-app/common.js.map +1 -0
- package/dist/esm/lib/stack-app/connected-accounts/index.d.ts +40 -0
- package/dist/esm/lib/stack-app/connected-accounts/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/connected-accounts/index.js +1 -0
- package/dist/esm/lib/stack-app/contact-channels/index.d.ts +43 -0
- package/dist/esm/lib/stack-app/contact-channels/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/contact-channels/index.js +39 -0
- package/dist/esm/lib/stack-app/contact-channels/index.js.map +1 -0
- package/dist/esm/lib/stack-app/customers/index.d.ts +129 -0
- package/dist/esm/lib/stack-app/customers/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/customers/index.js +1 -0
- package/dist/esm/lib/stack-app/data-vault/index.d.ts +14 -0
- package/dist/esm/lib/stack-app/data-vault/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/data-vault/index.js +1 -0
- package/dist/esm/lib/stack-app/email/index.d.ts +204 -0
- package/dist/esm/lib/stack-app/email/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/email/index.js +1 -0
- package/dist/esm/lib/stack-app/email-templates/index.d.ts +17 -0
- package/dist/esm/lib/stack-app/email-templates/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/email-templates/index.js +11 -0
- package/dist/esm/lib/stack-app/email-templates/index.js.map +1 -0
- package/dist/esm/lib/stack-app/index.d.ts +14 -0
- package/dist/esm/lib/stack-app/index.js +5 -0
- package/dist/esm/lib/stack-app/internal-api-keys/index.d.ts +42 -0
- package/dist/esm/lib/stack-app/internal-api-keys/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/internal-api-keys/index.js +14 -0
- package/dist/esm/lib/stack-app/internal-api-keys/index.js.map +1 -0
- package/dist/esm/lib/stack-app/notification-categories/index.d.ts +11 -0
- package/dist/esm/lib/stack-app/notification-categories/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/notification-categories/index.js +1 -0
- package/dist/esm/lib/stack-app/permissions/index.d.ts +43 -0
- package/dist/esm/lib/stack-app/permissions/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/permissions/index.js +31 -0
- package/dist/esm/lib/stack-app/permissions/index.js.map +1 -0
- package/dist/esm/lib/stack-app/project-configs/index.d.ts +99 -0
- package/dist/esm/lib/stack-app/project-configs/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/project-configs/index.js +1 -0
- package/dist/esm/lib/stack-app/projects/index.d.ts +145 -0
- package/dist/esm/lib/stack-app/projects/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/projects/index.js +66 -0
- package/dist/esm/lib/stack-app/projects/index.js.map +1 -0
- package/dist/esm/lib/stack-app/session-replays/index.d.ts +66 -0
- package/dist/esm/lib/stack-app/session-replays/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/session-replays/index.js +1 -0
- package/dist/esm/lib/stack-app/teams/index.d.ts +160 -0
- package/dist/esm/lib/stack-app/teams/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/teams/index.js +35 -0
- package/dist/esm/lib/stack-app/teams/index.js.map +1 -0
- package/dist/esm/lib/stack-app/url-targets.d.ts +39 -0
- package/dist/esm/lib/stack-app/url-targets.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/url-targets.js +266 -0
- package/dist/esm/lib/stack-app/url-targets.js.map +1 -0
- package/dist/esm/lib/stack-app/url-targets.test.d.ts +1 -0
- package/dist/esm/lib/stack-app/url-targets.test.js +213 -0
- package/dist/esm/lib/stack-app/url-targets.test.js.map +1 -0
- package/dist/esm/lib/stack-app/users/index.d.ts +357 -0
- package/dist/esm/lib/stack-app/users/index.d.ts.map +1 -0
- package/dist/esm/lib/stack-app/users/index.js +71 -0
- package/dist/esm/lib/stack-app/users/index.js.map +1 -0
- package/dist/esm/utils/url.d.ts +5 -0
- package/dist/esm/utils/url.d.ts.map +1 -0
- package/dist/esm/utils/url.js +16 -0
- package/dist/esm/utils/url.js.map +1 -0
- package/dist/index.d.ts +17 -0
- package/dist/index.js +31 -0
- package/dist/integrations/convex/component/convex.config.d.ts +61 -0
- package/dist/integrations/convex/component/convex.config.d.ts.map +1 -0
- package/dist/integrations/convex/component/convex.config.js +9 -0
- package/dist/integrations/convex/component/convex.config.js.map +1 -0
- package/dist/integrations/convex.d.ts +13 -0
- package/dist/integrations/convex.d.ts.map +1 -0
- package/dist/integrations/convex.js +25 -0
- package/dist/integrations/convex.js.map +1 -0
- package/dist/internal/deprecation-warning.d.ts +1 -0
- package/dist/internal/deprecation-warning.js +24 -0
- package/dist/internal/deprecation-warning.js.map +1 -0
- package/dist/lib/auth.d.ts +31 -0
- package/dist/lib/auth.d.ts.map +1 -0
- package/dist/lib/auth.js +111 -0
- package/dist/lib/auth.js.map +1 -0
- package/dist/lib/auth.test.d.ts +1 -0
- package/dist/lib/auth.test.js +60 -0
- package/dist/lib/auth.test.js.map +1 -0
- package/dist/lib/cookie.d.ts +42 -0
- package/dist/lib/cookie.d.ts.map +1 -0
- package/dist/lib/cookie.js +305 -0
- package/dist/lib/cookie.js.map +1 -0
- package/dist/lib/env.d.ts +42 -0
- package/dist/lib/env.d.ts.map +1 -0
- package/dist/lib/env.js +95 -0
- package/dist/lib/env.js.map +1 -0
- package/dist/lib/stack-app/api-keys/index.d.ts +53 -0
- package/dist/lib/stack-app/api-keys/index.d.ts.map +1 -0
- package/dist/lib/stack-app/api-keys/index.js +25 -0
- package/dist/lib/stack-app/api-keys/index.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts +362 -0
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js +926 -0
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.d.ts +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js +55 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts +541 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js +2507 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.d.ts +1 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js +32 -0
- package/dist/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/common.d.ts +65 -0
- package/dist/lib/stack-app/apps/implementations/common.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/common.js +144 -0
- package/dist/lib/stack-app/apps/implementations/common.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.d.ts +42 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.js +213 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.d.ts +1 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.js +87 -0
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/index.d.ts +9 -0
- package/dist/lib/stack-app/apps/implementations/index.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/index.js +31 -0
- package/dist/lib/stack-app/apps/implementations/index.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.d.ts +35 -0
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.js +201 -0
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts +203 -0
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js +1096 -0
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.d.ts +28 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.js +33 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.test.d.ts +1 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.test.js +82 -0
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.test.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.d.ts +111 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.js +250 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.js.map +1 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.test.d.ts +1 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.test.js +29 -0
- package/dist/lib/stack-app/apps/implementations/session-replay.test.js.map +1 -0
- package/dist/lib/stack-app/apps/index.d.ts +4 -0
- package/dist/lib/stack-app/apps/index.js +42 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts +244 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.js +12 -0
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +1 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts +208 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.js +12 -0
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +1 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts +116 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts.map +1 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.js +12 -0
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +1 -0
- package/dist/lib/stack-app/common.d.ts +174 -0
- package/dist/lib/stack-app/common.d.ts.map +1 -0
- package/dist/lib/stack-app/common.js +9 -0
- package/dist/lib/stack-app/common.js.map +1 -0
- package/dist/lib/stack-app/connected-accounts/index.d.ts +40 -0
- package/dist/lib/stack-app/connected-accounts/index.d.ts.map +1 -0
- package/dist/lib/stack-app/connected-accounts/index.js +0 -0
- package/dist/lib/stack-app/contact-channels/index.d.ts +43 -0
- package/dist/lib/stack-app/contact-channels/index.d.ts.map +1 -0
- package/dist/lib/stack-app/contact-channels/index.js +44 -0
- package/dist/lib/stack-app/contact-channels/index.js.map +1 -0
- package/dist/lib/stack-app/customers/index.d.ts +129 -0
- package/dist/lib/stack-app/customers/index.d.ts.map +1 -0
- package/dist/lib/stack-app/customers/index.js +0 -0
- package/dist/lib/stack-app/data-vault/index.d.ts +14 -0
- package/dist/lib/stack-app/data-vault/index.d.ts.map +1 -0
- package/dist/lib/stack-app/data-vault/index.js +0 -0
- package/dist/lib/stack-app/email/index.d.ts +204 -0
- package/dist/lib/stack-app/email/index.d.ts.map +1 -0
- package/dist/lib/stack-app/email/index.js +0 -0
- package/dist/lib/stack-app/email-templates/index.d.ts +17 -0
- package/dist/lib/stack-app/email-templates/index.d.ts.map +1 -0
- package/dist/lib/stack-app/email-templates/index.js +13 -0
- package/dist/lib/stack-app/email-templates/index.js.map +1 -0
- package/dist/lib/stack-app/index.d.ts +15 -0
- package/dist/lib/stack-app/index.js +54 -0
- package/dist/lib/stack-app/internal-api-keys/index.d.ts +42 -0
- package/dist/lib/stack-app/internal-api-keys/index.d.ts.map +1 -0
- package/dist/lib/stack-app/internal-api-keys/index.js +16 -0
- package/dist/lib/stack-app/internal-api-keys/index.js.map +1 -0
- package/dist/lib/stack-app/notification-categories/index.d.ts +11 -0
- package/dist/lib/stack-app/notification-categories/index.d.ts.map +1 -0
- package/dist/lib/stack-app/notification-categories/index.js +0 -0
- package/dist/lib/stack-app/permissions/index.d.ts +43 -0
- package/dist/lib/stack-app/permissions/index.d.ts.map +1 -0
- package/dist/lib/stack-app/permissions/index.js +36 -0
- package/dist/lib/stack-app/permissions/index.js.map +1 -0
- package/dist/lib/stack-app/project-configs/index.d.ts +99 -0
- package/dist/lib/stack-app/project-configs/index.d.ts.map +1 -0
- package/dist/lib/stack-app/project-configs/index.js +0 -0
- package/dist/lib/stack-app/projects/index.d.ts +145 -0
- package/dist/lib/stack-app/projects/index.d.ts.map +1 -0
- package/dist/lib/stack-app/projects/index.js +69 -0
- package/dist/lib/stack-app/projects/index.js.map +1 -0
- package/dist/lib/stack-app/session-replays/index.d.ts +66 -0
- package/dist/lib/stack-app/session-replays/index.d.ts.map +1 -0
- package/dist/lib/stack-app/session-replays/index.js +0 -0
- package/dist/lib/stack-app/teams/index.d.ts +160 -0
- package/dist/lib/stack-app/teams/index.d.ts.map +1 -0
- package/dist/lib/stack-app/teams/index.js +40 -0
- package/dist/lib/stack-app/teams/index.js.map +1 -0
- package/dist/lib/stack-app/url-targets.d.ts +39 -0
- package/dist/lib/stack-app/url-targets.d.ts.map +1 -0
- package/dist/lib/stack-app/url-targets.js +274 -0
- package/dist/lib/stack-app/url-targets.js.map +1 -0
- package/dist/lib/stack-app/url-targets.test.d.ts +1 -0
- package/dist/lib/stack-app/url-targets.test.js +213 -0
- package/dist/lib/stack-app/url-targets.test.js.map +1 -0
- package/dist/lib/stack-app/users/index.d.ts +357 -0
- package/dist/lib/stack-app/users/index.d.ts.map +1 -0
- package/dist/lib/stack-app/users/index.js +76 -0
- package/dist/lib/stack-app/users/index.js.map +1 -0
- package/dist/storage-CKsyME2q.d.ts +1912 -0
- package/dist/storage-CKsyME2q.d.ts.map +1 -0
- package/dist/utils/url.d.ts +5 -0
- package/dist/utils/url.d.ts.map +1 -0
- package/dist/utils/url.js +18 -0
- package/dist/utils/url.js.map +1 -0
- package/package.json +88 -0
|
@@ -0,0 +1,926 @@
|
|
|
1
|
+
Object.defineProperty(exports, Symbol.toStringTag, { value: 'Module' });
|
|
2
|
+
const require_chunk = require('../../../../chunk-BE-pF4vm.js');
|
|
3
|
+
let _stackframe_stack_shared_dist_utils_errors = require("@hexclave/shared/dist/utils/errors");
|
|
4
|
+
let _stackframe_stack_shared = require("@hexclave/shared");
|
|
5
|
+
let _stackframe_stack_shared_dist_utils_results = require("@hexclave/shared/dist/utils/results");
|
|
6
|
+
let __common_js = require("./common.js");
|
|
7
|
+
let _stackframe_stack_shared_dist_utils_objects = require("@hexclave/shared/dist/utils/objects");
|
|
8
|
+
let _stackframe_stack_shared_dist_helpers_production_mode = require("@hexclave/shared/dist/helpers/production-mode");
|
|
9
|
+
let ______common_js = require("../../common.js");
|
|
10
|
+
let ______internal_api_keys_index_js = require("../../internal-api-keys/index.js");
|
|
11
|
+
let ______permissions_index_js = require("../../permissions/index.js");
|
|
12
|
+
let ______projects_index_js = require("../../projects/index.js");
|
|
13
|
+
let __server_app_impl_js = require("./server-app-impl.js");
|
|
14
|
+
|
|
15
|
+
//#region src/lib/stack-app/apps/implementations/admin-app-impl.ts
|
|
16
|
+
/**
|
|
17
|
+
* Converts a PushedConfigSource (SDK camelCase) to BranchConfigSourceApi (API snake_case).
|
|
18
|
+
*/
|
|
19
|
+
function pushedConfigSourceToApi(source) {
|
|
20
|
+
if (source.type === "pushed-from-github") return {
|
|
21
|
+
type: "pushed-from-github",
|
|
22
|
+
owner: source.owner,
|
|
23
|
+
repo: source.repo,
|
|
24
|
+
branch: source.branch,
|
|
25
|
+
commit_hash: source.commitHash,
|
|
26
|
+
config_file_path: source.configFilePath,
|
|
27
|
+
workflow_path: source.workflowPath
|
|
28
|
+
};
|
|
29
|
+
return source;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Converts a BranchConfigSourceApi (API snake_case) to PushedConfigSource (SDK camelCase).
|
|
33
|
+
*/
|
|
34
|
+
function apiToPushedConfigSource(source) {
|
|
35
|
+
if (source.type === "pushed-from-github") return {
|
|
36
|
+
type: "pushed-from-github",
|
|
37
|
+
owner: source.owner,
|
|
38
|
+
repo: source.repo,
|
|
39
|
+
branch: source.branch,
|
|
40
|
+
commitHash: source.commit_hash,
|
|
41
|
+
configFilePath: source.config_file_path,
|
|
42
|
+
workflowPath: source.workflow_path
|
|
43
|
+
};
|
|
44
|
+
return source;
|
|
45
|
+
}
|
|
46
|
+
var _StackAdminAppImplIncomplete = class extends __server_app_impl_js._StackServerAppImplIncomplete {
|
|
47
|
+
constructor(options, extraOptions) {
|
|
48
|
+
const resolvedOptions = (0, __common_js.resolveConstructorOptions)(options);
|
|
49
|
+
const publishableClientKey = resolvedOptions.publishableClientKey ?? (0, __common_js.getDefaultPublishableClientKey)();
|
|
50
|
+
super(resolvedOptions, {
|
|
51
|
+
...extraOptions,
|
|
52
|
+
interface: extraOptions?.interface ?? (() => {
|
|
53
|
+
const apiUrls = (0, __common_js.resolveApiUrls)(resolvedOptions.baseUrl);
|
|
54
|
+
return new _stackframe_stack_shared.HexclaveAdminInterface({
|
|
55
|
+
getBaseUrl: () => apiUrls()[0],
|
|
56
|
+
getApiUrls: apiUrls,
|
|
57
|
+
projectId: resolvedOptions.projectId ?? (0, __common_js.getDefaultProjectId)(),
|
|
58
|
+
extraRequestHeaders: resolvedOptions.extraRequestHeaders ?? (0, __common_js.getDefaultExtraRequestHeaders)(),
|
|
59
|
+
clientVersion: __common_js.clientVersion,
|
|
60
|
+
...resolvedOptions.projectOwnerSession ? { projectOwnerSession: resolvedOptions.projectOwnerSession } : {
|
|
61
|
+
...publishableClientKey ? { publishableClientKey } : {},
|
|
62
|
+
secretServerKey: resolvedOptions.secretServerKey ?? (0, __common_js.getDefaultSecretServerKey)(),
|
|
63
|
+
superSecretAdminKey: resolvedOptions.superSecretAdminKey ?? (0, __common_js.getDefaultSuperSecretAdminKey)()
|
|
64
|
+
}
|
|
65
|
+
});
|
|
66
|
+
})()
|
|
67
|
+
});
|
|
68
|
+
this._adminProjectCache = (0, __common_js.createCache)(async () => {
|
|
69
|
+
return await this._interface.getProject();
|
|
70
|
+
});
|
|
71
|
+
this._internalApiKeysCache = (0, __common_js.createCache)(async () => {
|
|
72
|
+
return await this._interface.listInternalApiKeys();
|
|
73
|
+
});
|
|
74
|
+
this._adminEmailThemeCache = (0, __common_js.createCache)(async ([id]) => {
|
|
75
|
+
return await this._interface.getEmailTheme(id);
|
|
76
|
+
});
|
|
77
|
+
this._adminEmailThemesCache = (0, __common_js.createCache)(async () => {
|
|
78
|
+
return await this._interface.listEmailThemes();
|
|
79
|
+
});
|
|
80
|
+
this._adminEmailTemplatesCache = (0, __common_js.createCache)(async () => {
|
|
81
|
+
return await this._interface.listInternalEmailTemplates();
|
|
82
|
+
});
|
|
83
|
+
this._adminEmailDraftsCache = (0, __common_js.createCache)(async () => {
|
|
84
|
+
return await this._interface.listInternalEmailDrafts();
|
|
85
|
+
});
|
|
86
|
+
this._adminTeamPermissionDefinitionsCache = (0, __common_js.createCache)(async () => {
|
|
87
|
+
return await this._interface.listTeamPermissionDefinitions();
|
|
88
|
+
});
|
|
89
|
+
this._adminProjectPermissionDefinitionsCache = (0, __common_js.createCache)(async () => {
|
|
90
|
+
return await this._interface.listProjectPermissionDefinitions();
|
|
91
|
+
});
|
|
92
|
+
this._svixTokenCache = (0, __common_js.createCache)(async () => {
|
|
93
|
+
return await this._interface.getSvixToken();
|
|
94
|
+
});
|
|
95
|
+
this._metricsCache = (0, __common_js.createCache)(async ([includeAnonymous]) => {
|
|
96
|
+
return await this._interface.getMetrics(includeAnonymous);
|
|
97
|
+
});
|
|
98
|
+
this._userActivityCache = (0, __common_js.createCache)(async ([userId]) => {
|
|
99
|
+
return await this._interface.getUserActivity(userId);
|
|
100
|
+
});
|
|
101
|
+
this._metricsUserCountsCache = (0, __common_js.createCache)(async () => {
|
|
102
|
+
return await this._interface.getMetricsUserCounts();
|
|
103
|
+
});
|
|
104
|
+
this._emailPreviewCache = (0, __common_js.createCache)(async ([themeId, themeTsxSource, templateId, templateTsxSource]) => {
|
|
105
|
+
return await this._interface.renderEmailPreview({
|
|
106
|
+
themeId,
|
|
107
|
+
themeTsxSource,
|
|
108
|
+
templateId,
|
|
109
|
+
templateTsxSource
|
|
110
|
+
});
|
|
111
|
+
});
|
|
112
|
+
this._emailPreviewWithEditableMarkersCache = (0, __common_js.createCache)(async ([themeId, themeTsxSource, templateId, templateTsxSource, editableSource]) => {
|
|
113
|
+
return await this._interface.renderEmailPreview({
|
|
114
|
+
themeId,
|
|
115
|
+
themeTsxSource,
|
|
116
|
+
templateId,
|
|
117
|
+
templateTsxSource,
|
|
118
|
+
editableMarkers: true,
|
|
119
|
+
editableSource
|
|
120
|
+
});
|
|
121
|
+
});
|
|
122
|
+
this._configOverridesCache = (0, __common_js.createCache)(async () => {
|
|
123
|
+
return await this._interface.getConfig();
|
|
124
|
+
});
|
|
125
|
+
this._stripeAccountInfoCache = (0, __common_js.createCache)(async () => {
|
|
126
|
+
try {
|
|
127
|
+
return await this._interface.getStripeAccountInfo();
|
|
128
|
+
} catch (error) {
|
|
129
|
+
if (error?.status === 404) return null;
|
|
130
|
+
throw error;
|
|
131
|
+
}
|
|
132
|
+
});
|
|
133
|
+
this._transactionsCache = (0, __common_js.createCache)(async ([cursor, limit, type, customerType, customerId]) => {
|
|
134
|
+
return await this._interface.listTransactions({
|
|
135
|
+
cursor,
|
|
136
|
+
limit,
|
|
137
|
+
type,
|
|
138
|
+
customerType,
|
|
139
|
+
customerId
|
|
140
|
+
});
|
|
141
|
+
});
|
|
142
|
+
}
|
|
143
|
+
_adminConfigFromCrud(data) {
|
|
144
|
+
return JSON.parse(data.config_string);
|
|
145
|
+
}
|
|
146
|
+
_adminOwnedProjectFromCrud(data, onRefresh) {
|
|
147
|
+
if (this._tokenStoreInit !== null) throw new _stackframe_stack_shared_dist_utils_errors.HexclaveAssertionError("Owned apps must always have tokenStore === null — did you not create this project with app._createOwnedApp()?");
|
|
148
|
+
return {
|
|
149
|
+
...this._adminProjectFromCrud(data, onRefresh),
|
|
150
|
+
app: this
|
|
151
|
+
};
|
|
152
|
+
}
|
|
153
|
+
_adminProjectFromCrud(data, onRefresh) {
|
|
154
|
+
if (data.id !== this.projectId) throw new _stackframe_stack_shared_dist_utils_errors.HexclaveAssertionError(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${this.projectId})!`);
|
|
155
|
+
const app = this;
|
|
156
|
+
return {
|
|
157
|
+
id: data.id,
|
|
158
|
+
displayName: data.display_name,
|
|
159
|
+
description: data.description,
|
|
160
|
+
createdAt: new Date(data.created_at_millis),
|
|
161
|
+
isProductionMode: data.is_production_mode,
|
|
162
|
+
isDevelopmentEnvironment: data.is_development_environment,
|
|
163
|
+
ownerTeamId: data.owner_team_id,
|
|
164
|
+
onboardingStatus: data.onboarding_status,
|
|
165
|
+
logoUrl: data.logo_url,
|
|
166
|
+
logoFullUrl: data.logo_full_url,
|
|
167
|
+
logoDarkModeUrl: data.logo_dark_mode_url,
|
|
168
|
+
logoFullDarkModeUrl: data.logo_full_dark_mode_url,
|
|
169
|
+
config: {
|
|
170
|
+
signUpEnabled: data.config.sign_up_enabled,
|
|
171
|
+
credentialEnabled: data.config.credential_enabled,
|
|
172
|
+
magicLinkEnabled: data.config.magic_link_enabled,
|
|
173
|
+
passkeyEnabled: data.config.passkey_enabled,
|
|
174
|
+
clientTeamCreationEnabled: data.config.client_team_creation_enabled,
|
|
175
|
+
clientUserDeletionEnabled: data.config.client_user_deletion_enabled,
|
|
176
|
+
allowLocalhost: data.config.allow_localhost,
|
|
177
|
+
oauthAccountMergeStrategy: data.config.oauth_account_merge_strategy,
|
|
178
|
+
allowUserApiKeys: data.config.allow_user_api_keys,
|
|
179
|
+
allowTeamApiKeys: data.config.allow_team_api_keys,
|
|
180
|
+
oauthProviders: data.config.oauth_providers.map((p) => p.type === "shared" ? {
|
|
181
|
+
id: p.id,
|
|
182
|
+
type: "shared"
|
|
183
|
+
} : {
|
|
184
|
+
id: p.id,
|
|
185
|
+
type: "standard",
|
|
186
|
+
clientId: p.client_id ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Client ID is missing"),
|
|
187
|
+
clientSecret: p.client_secret ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Client secret is missing"),
|
|
188
|
+
facebookConfigId: p.facebook_config_id,
|
|
189
|
+
microsoftTenantId: p.microsoft_tenant_id,
|
|
190
|
+
appleBundleIds: p.apple_bundle_ids
|
|
191
|
+
}),
|
|
192
|
+
emailConfig: data.config.email_config.type === "shared" ? { type: "shared" } : {
|
|
193
|
+
type: "standard",
|
|
194
|
+
host: data.config.email_config.host ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email host is missing"),
|
|
195
|
+
port: data.config.email_config.port ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email port is missing"),
|
|
196
|
+
username: data.config.email_config.username ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email username is missing"),
|
|
197
|
+
password: data.config.email_config.password ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email password is missing"),
|
|
198
|
+
senderName: data.config.email_config.sender_name ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email sender name is missing"),
|
|
199
|
+
senderEmail: data.config.email_config.sender_email ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email sender email is missing")
|
|
200
|
+
},
|
|
201
|
+
emailTheme: data.config.email_theme,
|
|
202
|
+
domains: data.config.domains.map((d) => ({
|
|
203
|
+
domain: d.domain,
|
|
204
|
+
handlerPath: d.handler_path
|
|
205
|
+
})),
|
|
206
|
+
createTeamOnSignUp: data.config.create_team_on_sign_up,
|
|
207
|
+
teamCreatorDefaultPermissions: data.config.team_creator_default_permissions,
|
|
208
|
+
teamMemberDefaultPermissions: data.config.team_member_default_permissions,
|
|
209
|
+
userDefaultPermissions: data.config.user_default_permissions
|
|
210
|
+
},
|
|
211
|
+
async getConfig() {
|
|
212
|
+
return app._adminConfigFromCrud(await app._interface.getConfig());
|
|
213
|
+
},
|
|
214
|
+
async updateConfig(configOverride) {
|
|
215
|
+
await app._interface.updateConfigOverride("environment", configOverride);
|
|
216
|
+
await app._refreshProjectConfig();
|
|
217
|
+
},
|
|
218
|
+
async pushConfig(config, options) {
|
|
219
|
+
await app._interface.setConfigOverride("branch", config, pushedConfigSourceToApi(options.source));
|
|
220
|
+
await app._refreshProjectConfig();
|
|
221
|
+
},
|
|
222
|
+
async updatePushedConfig(config) {
|
|
223
|
+
await app._interface.updateConfigOverride("branch", config);
|
|
224
|
+
await app._refreshProjectConfig();
|
|
225
|
+
},
|
|
226
|
+
async getPushedConfigSource() {
|
|
227
|
+
return apiToPushedConfigSource(await app._interface.getPushedConfigSource());
|
|
228
|
+
},
|
|
229
|
+
async unlinkPushedConfigSource() {
|
|
230
|
+
await app._interface.unlinkPushedConfigSource();
|
|
231
|
+
await app._refreshProjectConfig();
|
|
232
|
+
},
|
|
233
|
+
async resetConfigOverrideKeys(level, keys) {
|
|
234
|
+
await app._interface.resetConfigOverrideKeys(level, keys);
|
|
235
|
+
await app._refreshProjectConfig();
|
|
236
|
+
},
|
|
237
|
+
async getConfigOverride(level) {
|
|
238
|
+
const result = await app._interface.getConfigOverride(level);
|
|
239
|
+
return JSON.parse(result.config_string);
|
|
240
|
+
},
|
|
241
|
+
async replaceConfigOverride(level, config) {
|
|
242
|
+
if (level === "branch") {
|
|
243
|
+
const source = await app._interface.getPushedConfigSource();
|
|
244
|
+
await app._interface.setConfigOverride(level, config, source);
|
|
245
|
+
} else await app._interface.setConfigOverride(level, config);
|
|
246
|
+
await app._refreshProjectConfig();
|
|
247
|
+
},
|
|
248
|
+
async update(update) {
|
|
249
|
+
const { requirePublishableClientKey, ...projectUpdate } = update;
|
|
250
|
+
const updateOptions = (0, ______projects_index_js.adminProjectUpdateOptionsToCrud)(projectUpdate);
|
|
251
|
+
const hasConfigUpdate = !!updateOptions.config && (0, _stackframe_stack_shared_dist_utils_objects.typedValues)(updateOptions.config).some((value) => value !== void 0);
|
|
252
|
+
if ((0, _stackframe_stack_shared_dist_utils_objects.typedEntries)(updateOptions).some(([key, value]) => {
|
|
253
|
+
if (key === "config") return hasConfigUpdate;
|
|
254
|
+
return value !== void 0;
|
|
255
|
+
})) {
|
|
256
|
+
await app._interface.updateProject(updateOptions);
|
|
257
|
+
await onRefresh();
|
|
258
|
+
}
|
|
259
|
+
if (requirePublishableClientKey !== void 0) {
|
|
260
|
+
await app._interface.updateConfigOverride("project", { "project.requirePublishableClientKey": requirePublishableClientKey });
|
|
261
|
+
await app._refreshProjectConfig();
|
|
262
|
+
}
|
|
263
|
+
},
|
|
264
|
+
async delete() {
|
|
265
|
+
await app._interface.deleteProject();
|
|
266
|
+
},
|
|
267
|
+
async getProductionModeErrors() {
|
|
268
|
+
return (0, _stackframe_stack_shared_dist_helpers_production_mode.getProductionModeErrors)(data);
|
|
269
|
+
}
|
|
270
|
+
};
|
|
271
|
+
}
|
|
272
|
+
_adminEmailTemplateFromCrud(data) {
|
|
273
|
+
return {
|
|
274
|
+
type: data.type,
|
|
275
|
+
subject: data.subject,
|
|
276
|
+
content: data.content,
|
|
277
|
+
isDefault: data.is_default
|
|
278
|
+
};
|
|
279
|
+
}
|
|
280
|
+
async getProject() {
|
|
281
|
+
return this._adminProjectFromCrud(_stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminProjectCache.getOrWait([], "write-only")), () => this._refreshProject());
|
|
282
|
+
}
|
|
283
|
+
_createInternalApiKeyBaseFromCrud(data) {
|
|
284
|
+
const app = this;
|
|
285
|
+
return {
|
|
286
|
+
id: data.id,
|
|
287
|
+
description: data.description,
|
|
288
|
+
expiresAt: new Date(data.expires_at_millis),
|
|
289
|
+
manuallyRevokedAt: data.manually_revoked_at_millis ? new Date(data.manually_revoked_at_millis) : null,
|
|
290
|
+
createdAt: new Date(data.created_at_millis),
|
|
291
|
+
isValid() {
|
|
292
|
+
return this.whyInvalid() === null;
|
|
293
|
+
},
|
|
294
|
+
whyInvalid() {
|
|
295
|
+
if (this.expiresAt.getTime() < Date.now()) return "expired";
|
|
296
|
+
if (this.manuallyRevokedAt) return "manually-revoked";
|
|
297
|
+
return null;
|
|
298
|
+
},
|
|
299
|
+
async revoke() {
|
|
300
|
+
const res = await app._interface.revokeInternalApiKeyById(data.id);
|
|
301
|
+
await app._refreshInternalApiKeys();
|
|
302
|
+
return res;
|
|
303
|
+
}
|
|
304
|
+
};
|
|
305
|
+
}
|
|
306
|
+
_createInternalApiKeyFromCrud(data) {
|
|
307
|
+
return {
|
|
308
|
+
...this._createInternalApiKeyBaseFromCrud(data),
|
|
309
|
+
publishableClientKey: data.publishable_client_key ? { lastFour: data.publishable_client_key.last_four } : null,
|
|
310
|
+
secretServerKey: data.secret_server_key ? { lastFour: data.secret_server_key.last_four } : null,
|
|
311
|
+
superSecretAdminKey: data.super_secret_admin_key ? { lastFour: data.super_secret_admin_key.last_four } : null
|
|
312
|
+
};
|
|
313
|
+
}
|
|
314
|
+
_createInternalApiKeyFirstViewFromCrud(data) {
|
|
315
|
+
return {
|
|
316
|
+
...this._createInternalApiKeyBaseFromCrud(data),
|
|
317
|
+
publishableClientKey: data.publishable_client_key,
|
|
318
|
+
secretServerKey: data.secret_server_key,
|
|
319
|
+
superSecretAdminKey: data.super_secret_admin_key
|
|
320
|
+
};
|
|
321
|
+
}
|
|
322
|
+
async listInternalApiKeys() {
|
|
323
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._internalApiKeysCache.getOrWait([], "write-only")).map((j) => this._createInternalApiKeyFromCrud(j));
|
|
324
|
+
}
|
|
325
|
+
async createInternalApiKey(options) {
|
|
326
|
+
const crud = await this._interface.createInternalApiKey((0, ______internal_api_keys_index_js.internalApiKeyCreateOptionsToCrud)(options));
|
|
327
|
+
await this._refreshInternalApiKeys();
|
|
328
|
+
return this._createInternalApiKeyFirstViewFromCrud(crud);
|
|
329
|
+
}
|
|
330
|
+
async listEmailThemes() {
|
|
331
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminEmailThemesCache.getOrWait([], "write-only")).map((theme) => ({
|
|
332
|
+
id: theme.id,
|
|
333
|
+
displayName: theme.display_name
|
|
334
|
+
}));
|
|
335
|
+
}
|
|
336
|
+
async listEmailTemplates() {
|
|
337
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], "write-only")).map((template) => ({
|
|
338
|
+
id: template.id,
|
|
339
|
+
displayName: template.display_name,
|
|
340
|
+
themeId: template.theme_id,
|
|
341
|
+
tsxSource: template.tsx_source
|
|
342
|
+
}));
|
|
343
|
+
}
|
|
344
|
+
async listEmailDrafts() {
|
|
345
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminEmailDraftsCache.getOrWait([], "write-only")).map((draft) => ({
|
|
346
|
+
id: draft.id,
|
|
347
|
+
displayName: draft.display_name,
|
|
348
|
+
themeId: draft.theme_id,
|
|
349
|
+
tsxSource: draft.tsx_source,
|
|
350
|
+
sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null
|
|
351
|
+
}));
|
|
352
|
+
}
|
|
353
|
+
async createTeamPermissionDefinition(data) {
|
|
354
|
+
const crud = await this._interface.createTeamPermissionDefinition((0, ______permissions_index_js.adminTeamPermissionDefinitionCreateOptionsToCrud)(data));
|
|
355
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
356
|
+
return this._serverTeamPermissionDefinitionFromCrud(crud);
|
|
357
|
+
}
|
|
358
|
+
async updateTeamPermissionDefinition(permissionId, data) {
|
|
359
|
+
await this._interface.updateTeamPermissionDefinition(permissionId, (0, ______permissions_index_js.adminTeamPermissionDefinitionUpdateOptionsToCrud)(data));
|
|
360
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
361
|
+
}
|
|
362
|
+
async deleteTeamPermissionDefinition(permissionId) {
|
|
363
|
+
await this._interface.deleteTeamPermissionDefinition(permissionId);
|
|
364
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
365
|
+
}
|
|
366
|
+
async listTeamPermissionDefinitions() {
|
|
367
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminTeamPermissionDefinitionsCache.getOrWait([], "write-only")).map((p) => this._serverTeamPermissionDefinitionFromCrud(p));
|
|
368
|
+
}
|
|
369
|
+
async listTeamPermissionDefinitionsPaginated(options) {
|
|
370
|
+
const result = await this._interface.listTeamPermissionDefinitionsPaginated(options);
|
|
371
|
+
return {
|
|
372
|
+
items: result.items.map((p) => this._serverTeamPermissionDefinitionFromCrud(p)),
|
|
373
|
+
nextCursor: result.nextCursor
|
|
374
|
+
};
|
|
375
|
+
}
|
|
376
|
+
async createProjectPermissionDefinition(data) {
|
|
377
|
+
const crud = await this._interface.createProjectPermissionDefinition((0, ______permissions_index_js.adminProjectPermissionDefinitionCreateOptionsToCrud)(data));
|
|
378
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
379
|
+
return this._serverProjectPermissionDefinitionFromCrud(crud);
|
|
380
|
+
}
|
|
381
|
+
async updateProjectPermissionDefinition(permissionId, data) {
|
|
382
|
+
await this._interface.updateProjectPermissionDefinition(permissionId, (0, ______permissions_index_js.adminProjectPermissionDefinitionUpdateOptionsToCrud)(data));
|
|
383
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
384
|
+
}
|
|
385
|
+
async deleteProjectPermissionDefinition(permissionId) {
|
|
386
|
+
await this._interface.deleteProjectPermissionDefinition(permissionId);
|
|
387
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
388
|
+
}
|
|
389
|
+
async listProjectPermissionDefinitions() {
|
|
390
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._adminProjectPermissionDefinitionsCache.getOrWait([], "write-only")).map((p) => this._serverProjectPermissionDefinitionFromCrud(p));
|
|
391
|
+
}
|
|
392
|
+
async _refreshProject() {
|
|
393
|
+
await Promise.all([super._refreshProject(), this._adminProjectCache.refresh([])]);
|
|
394
|
+
}
|
|
395
|
+
async _refreshProjectConfig() {
|
|
396
|
+
await Promise.all([this._configOverridesCache.refresh([]), this._adminProjectCache.refresh([])]);
|
|
397
|
+
}
|
|
398
|
+
async _refreshInternalApiKeys() {
|
|
399
|
+
await this._internalApiKeysCache.refresh([]);
|
|
400
|
+
}
|
|
401
|
+
async _refreshUsers() {
|
|
402
|
+
await Promise.all([
|
|
403
|
+
super._refreshUsers(),
|
|
404
|
+
this._metricsCache.refresh([false]),
|
|
405
|
+
this._metricsCache.refresh([true]),
|
|
406
|
+
this._metricsUserCountsCache.refresh([])
|
|
407
|
+
]);
|
|
408
|
+
}
|
|
409
|
+
get [______common_js.stackAppInternalsSymbol]() {
|
|
410
|
+
return { ...super[______common_js.stackAppInternalsSymbol] };
|
|
411
|
+
}
|
|
412
|
+
async sendTestEmail(options) {
|
|
413
|
+
let response;
|
|
414
|
+
try {
|
|
415
|
+
response = await this._interface.sendTestEmail({
|
|
416
|
+
recipient_email: options.recipientEmail,
|
|
417
|
+
email_config: {
|
|
418
|
+
...(0, _stackframe_stack_shared_dist_utils_objects.pick)(options.emailConfig, [
|
|
419
|
+
"host",
|
|
420
|
+
"port",
|
|
421
|
+
"username",
|
|
422
|
+
"password"
|
|
423
|
+
]),
|
|
424
|
+
sender_email: options.emailConfig.senderEmail,
|
|
425
|
+
sender_name: options.emailConfig.senderName
|
|
426
|
+
}
|
|
427
|
+
});
|
|
428
|
+
} catch (error) {
|
|
429
|
+
if (error instanceof _stackframe_stack_shared.KnownErrors.ItemQuantityInsufficientAmount) return _stackframe_stack_shared_dist_utils_results.Result.error({ errorMessage: "Monthly email sending limit exceeded for your plan. Please upgrade your plan or wait until next month before sending more test emails." });
|
|
430
|
+
throw error;
|
|
431
|
+
}
|
|
432
|
+
if (response.success) return _stackframe_stack_shared_dist_utils_results.Result.ok(void 0);
|
|
433
|
+
else return _stackframe_stack_shared_dist_utils_results.Result.error({ errorMessage: response.error_message ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Email test error not specified") });
|
|
434
|
+
}
|
|
435
|
+
async sendTestWebhook(options) {
|
|
436
|
+
const response = await this._interface.sendTestWebhook({ endpoint_id: options.endpointId });
|
|
437
|
+
if (response.success) return _stackframe_stack_shared_dist_utils_results.Result.ok(void 0);
|
|
438
|
+
else return _stackframe_stack_shared_dist_utils_results.Result.error({ errorMessage: response.error_message ?? (0, _stackframe_stack_shared_dist_utils_errors.throwErr)("Webhook test error not specified") });
|
|
439
|
+
}
|
|
440
|
+
async listSentEmails() {
|
|
441
|
+
return (await this._interface.listSentEmails()).items.map((email) => ({
|
|
442
|
+
id: email.id,
|
|
443
|
+
to: email.to ?? [],
|
|
444
|
+
subject: email.subject,
|
|
445
|
+
recipient: email.to?.[0] ?? "",
|
|
446
|
+
sentAt: new Date(email.sent_at_millis),
|
|
447
|
+
error: email.error
|
|
448
|
+
}));
|
|
449
|
+
}
|
|
450
|
+
async setupManagedEmailProvider(options) {
|
|
451
|
+
const response = await this._interface.setupManagedEmailProvider({
|
|
452
|
+
subdomain: options.subdomain,
|
|
453
|
+
sender_local_part: options.senderLocalPart
|
|
454
|
+
});
|
|
455
|
+
return {
|
|
456
|
+
domainId: response.domain_id,
|
|
457
|
+
subdomain: response.subdomain,
|
|
458
|
+
senderLocalPart: response.sender_local_part,
|
|
459
|
+
nameServerRecords: response.name_server_records,
|
|
460
|
+
status: response.status
|
|
461
|
+
};
|
|
462
|
+
}
|
|
463
|
+
async checkManagedEmailStatus(options) {
|
|
464
|
+
return { status: (await this._interface.checkManagedEmailStatus({
|
|
465
|
+
domain_id: options.domainId,
|
|
466
|
+
subdomain: options.subdomain,
|
|
467
|
+
sender_local_part: options.senderLocalPart
|
|
468
|
+
})).status };
|
|
469
|
+
}
|
|
470
|
+
async listManagedEmailDomains() {
|
|
471
|
+
return (await this._interface.listManagedEmailDomains()).items.map((item) => ({
|
|
472
|
+
domainId: item.domain_id,
|
|
473
|
+
subdomain: item.subdomain,
|
|
474
|
+
senderLocalPart: item.sender_local_part,
|
|
475
|
+
status: item.status,
|
|
476
|
+
nameServerRecords: item.name_server_records
|
|
477
|
+
}));
|
|
478
|
+
}
|
|
479
|
+
async applyManagedEmailProvider(options) {
|
|
480
|
+
const result = await this._interface.applyManagedEmailProvider({ domain_id: options.domainId });
|
|
481
|
+
await this._refreshProjectConfig();
|
|
482
|
+
return result;
|
|
483
|
+
}
|
|
484
|
+
async deleteManagedEmailDomain(options) {
|
|
485
|
+
return await this._interface.deleteManagedEmailDomain({ resend_domain_id: options.resendDomainId });
|
|
486
|
+
}
|
|
487
|
+
async sendSignInInvitationEmail(email, callbackUrl) {
|
|
488
|
+
await this._interface.sendSignInInvitationEmail(email, callbackUrl);
|
|
489
|
+
}
|
|
490
|
+
async createEmailTemplate(displayName) {
|
|
491
|
+
const result = await this._interface.createEmailTemplate(displayName);
|
|
492
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
493
|
+
return result;
|
|
494
|
+
}
|
|
495
|
+
async deleteEmailTemplate(id) {
|
|
496
|
+
await this._interface.deleteEmailTemplate(id);
|
|
497
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
498
|
+
}
|
|
499
|
+
async createEmailDraft(options) {
|
|
500
|
+
const result = await this._interface.createEmailDraft({
|
|
501
|
+
display_name: options.displayName,
|
|
502
|
+
theme_id: options.themeId,
|
|
503
|
+
tsx_source: options.tsxSource
|
|
504
|
+
});
|
|
505
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
506
|
+
return result;
|
|
507
|
+
}
|
|
508
|
+
async updateEmailDraft(id, data) {
|
|
509
|
+
await this._interface.updateEmailDraft(id, {
|
|
510
|
+
display_name: data.displayName,
|
|
511
|
+
theme_id: data.themeId,
|
|
512
|
+
tsx_source: data.tsxSource
|
|
513
|
+
});
|
|
514
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
515
|
+
}
|
|
516
|
+
async deleteEmailDraft(id) {
|
|
517
|
+
await this._interface.deleteEmailDraft(id);
|
|
518
|
+
const current = this._adminEmailDraftsCache.getIfCached([]);
|
|
519
|
+
if (current.status === "ok" && current.data.status === "ok") this._adminEmailDraftsCache.forceSetCachedValue([], _stackframe_stack_shared_dist_utils_results.Result.ok(current.data.data.filter((d) => d.id !== id)));
|
|
520
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
521
|
+
}
|
|
522
|
+
async refreshEmailDrafts() {
|
|
523
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
524
|
+
}
|
|
525
|
+
async saveChatMessage(threadId, message) {
|
|
526
|
+
await this._interface.saveChatMessage(threadId, message);
|
|
527
|
+
}
|
|
528
|
+
async listChatMessages(threadId) {
|
|
529
|
+
return await this._interface.listChatMessages(threadId);
|
|
530
|
+
}
|
|
531
|
+
async rewriteTemplateSourceWithAI(templateTsxSource) {
|
|
532
|
+
return { tsxSource: (await this._interface.rewriteTemplateSourceWithAI(templateTsxSource)).tsx_source };
|
|
533
|
+
}
|
|
534
|
+
async createEmailTheme(displayName) {
|
|
535
|
+
const result = await this._interface.createEmailTheme(displayName);
|
|
536
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
537
|
+
return result;
|
|
538
|
+
}
|
|
539
|
+
async getEmailPreview(options) {
|
|
540
|
+
return (await this._interface.renderEmailPreview(options)).html;
|
|
541
|
+
}
|
|
542
|
+
async getEmailPreviewWithEditableMarkers(options) {
|
|
543
|
+
const result = await this._interface.renderEmailPreview({
|
|
544
|
+
...options,
|
|
545
|
+
editableMarkers: true,
|
|
546
|
+
editableSource: options.editableSource
|
|
547
|
+
});
|
|
548
|
+
return {
|
|
549
|
+
html: result.html,
|
|
550
|
+
editableRegions: result.editable_regions
|
|
551
|
+
};
|
|
552
|
+
}
|
|
553
|
+
async updateEmailTheme(id, tsxSource) {
|
|
554
|
+
await this._interface.updateEmailTheme(id, tsxSource);
|
|
555
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
556
|
+
await this._adminEmailThemeCache.invalidate([id]);
|
|
557
|
+
}
|
|
558
|
+
async deleteEmailTheme(id) {
|
|
559
|
+
await this._interface.deleteEmailTheme(id);
|
|
560
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
561
|
+
await this._adminEmailThemeCache.invalidate([id]);
|
|
562
|
+
}
|
|
563
|
+
async updateEmailTemplate(id, tsxSource, themeId) {
|
|
564
|
+
const result = await this._interface.updateEmailTemplate(id, tsxSource, themeId);
|
|
565
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
566
|
+
return { renderedHtml: result.rendered_html };
|
|
567
|
+
}
|
|
568
|
+
async setupPayments() {
|
|
569
|
+
return await this._interface.setupPayments();
|
|
570
|
+
}
|
|
571
|
+
async createStripeWidgetAccountSession() {
|
|
572
|
+
return await this._interface.createStripeWidgetAccountSession();
|
|
573
|
+
}
|
|
574
|
+
async getPaymentMethodConfigs() {
|
|
575
|
+
return await this._interface.getPaymentMethodConfigs();
|
|
576
|
+
}
|
|
577
|
+
async updatePaymentMethodConfigs(configId, updates) {
|
|
578
|
+
await this._interface.updatePaymentMethodConfigs(configId, updates);
|
|
579
|
+
}
|
|
580
|
+
async createItemQuantityChange(options) {
|
|
581
|
+
await this._interface.updateItemQuantity({
|
|
582
|
+
itemId: options.itemId,
|
|
583
|
+
..."userId" in options ? { userId: options.userId } : "teamId" in options ? { teamId: options.teamId } : { customCustomerId: options.customCustomerId }
|
|
584
|
+
}, {
|
|
585
|
+
delta: options.quantity,
|
|
586
|
+
expires_at: options.expiresAt,
|
|
587
|
+
description: options.description,
|
|
588
|
+
allow_negative: true
|
|
589
|
+
});
|
|
590
|
+
}
|
|
591
|
+
async refundTransaction(options) {
|
|
592
|
+
const result = await this._interface.refundTransaction({
|
|
593
|
+
type: options.type,
|
|
594
|
+
id: options.id,
|
|
595
|
+
invoiceId: options.invoiceId,
|
|
596
|
+
amountUsd: options.amountUsd,
|
|
597
|
+
endAction: options.endAction
|
|
598
|
+
});
|
|
599
|
+
await this._transactionsCache.invalidateWhere(() => true);
|
|
600
|
+
return { refundTransactionId: result.refundTransactionId };
|
|
601
|
+
}
|
|
602
|
+
async listTransactions(params) {
|
|
603
|
+
return _stackframe_stack_shared_dist_utils_results.Result.orThrow(await this._transactionsCache.getOrWait([
|
|
604
|
+
params.cursor,
|
|
605
|
+
params.limit,
|
|
606
|
+
params.type,
|
|
607
|
+
params.customerType,
|
|
608
|
+
params.customerId
|
|
609
|
+
], "write-only"));
|
|
610
|
+
}
|
|
611
|
+
_emailOutboxCrudToAdmin(crud) {
|
|
612
|
+
const recipient = crud.to;
|
|
613
|
+
let to;
|
|
614
|
+
if (recipient.type === "user-primary-email") to = {
|
|
615
|
+
type: "user-primary-email",
|
|
616
|
+
userId: recipient.user_id
|
|
617
|
+
};
|
|
618
|
+
else if (recipient.type === "user-custom-emails") to = {
|
|
619
|
+
type: "user-custom-emails",
|
|
620
|
+
userId: recipient.user_id,
|
|
621
|
+
emails: recipient.emails
|
|
622
|
+
};
|
|
623
|
+
else to = {
|
|
624
|
+
type: "custom-emails",
|
|
625
|
+
emails: recipient.emails
|
|
626
|
+
};
|
|
627
|
+
const base = {
|
|
628
|
+
id: crud.id,
|
|
629
|
+
createdAt: new Date(crud.created_at_millis),
|
|
630
|
+
updatedAt: new Date(crud.updated_at_millis),
|
|
631
|
+
tsxSource: crud.tsx_source,
|
|
632
|
+
themeId: crud.theme_id ?? null,
|
|
633
|
+
to,
|
|
634
|
+
scheduledAt: new Date(crud.scheduled_at_millis),
|
|
635
|
+
createdWith: crud.created_with,
|
|
636
|
+
emailDraftId: crud.email_draft_id,
|
|
637
|
+
emailProgrammaticCallTemplateId: crud.email_programmatic_call_template_id,
|
|
638
|
+
variables: crud.variables ?? {},
|
|
639
|
+
isPaused: false,
|
|
640
|
+
hasRendered: false,
|
|
641
|
+
hasDelivered: false,
|
|
642
|
+
sendRetries: crud.send_retries,
|
|
643
|
+
nextSendRetryAt: crud.next_send_retry_at_millis ? new Date(crud.next_send_retry_at_millis) : null,
|
|
644
|
+
sendAttemptErrors: crud.send_attempt_errors ? crud.send_attempt_errors.map((e) => ({
|
|
645
|
+
attemptNumber: e.attempt_number,
|
|
646
|
+
timestamp: e.timestamp,
|
|
647
|
+
externalMessage: e.external_message,
|
|
648
|
+
externalDetails: e.external_details,
|
|
649
|
+
internalMessage: e.internal_message,
|
|
650
|
+
internalDetails: e.internal_details
|
|
651
|
+
})) : null
|
|
652
|
+
};
|
|
653
|
+
const rendered = crud.has_rendered ? {
|
|
654
|
+
...base,
|
|
655
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis),
|
|
656
|
+
renderedAt: new Date(crud.rendered_at_millis),
|
|
657
|
+
subject: crud.subject,
|
|
658
|
+
html: crud.html,
|
|
659
|
+
text: crud.text,
|
|
660
|
+
isTransactional: crud.is_transactional,
|
|
661
|
+
isHighPriority: crud.is_high_priority,
|
|
662
|
+
notificationCategoryId: crud.notification_category_id,
|
|
663
|
+
hasRendered: true
|
|
664
|
+
} : null;
|
|
665
|
+
const startedSending = rendered && crud.started_sending_at_millis ? {
|
|
666
|
+
...rendered,
|
|
667
|
+
startedSendingAt: new Date(crud.started_sending_at_millis)
|
|
668
|
+
} : null;
|
|
669
|
+
const finishedDelivering = startedSending && crud.has_delivered ? {
|
|
670
|
+
...startedSending,
|
|
671
|
+
deliveredAt: new Date(crud.delivered_at_millis),
|
|
672
|
+
hasDelivered: true
|
|
673
|
+
} : null;
|
|
674
|
+
return (() => {
|
|
675
|
+
switch (crud.status) {
|
|
676
|
+
case "paused": return {
|
|
677
|
+
...base,
|
|
678
|
+
status: "paused",
|
|
679
|
+
simpleStatus: "in-progress",
|
|
680
|
+
isPaused: true
|
|
681
|
+
};
|
|
682
|
+
case "preparing": return {
|
|
683
|
+
...base,
|
|
684
|
+
status: "preparing",
|
|
685
|
+
simpleStatus: "in-progress"
|
|
686
|
+
};
|
|
687
|
+
case "rendering": return {
|
|
688
|
+
...base,
|
|
689
|
+
status: "rendering",
|
|
690
|
+
simpleStatus: "in-progress",
|
|
691
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis)
|
|
692
|
+
};
|
|
693
|
+
case "render-error": return {
|
|
694
|
+
...base,
|
|
695
|
+
status: "render-error",
|
|
696
|
+
simpleStatus: "error",
|
|
697
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis),
|
|
698
|
+
renderedAt: new Date(crud.rendered_at_millis),
|
|
699
|
+
renderError: crud.render_error
|
|
700
|
+
};
|
|
701
|
+
case "scheduled": return {
|
|
702
|
+
...rendered,
|
|
703
|
+
status: "scheduled",
|
|
704
|
+
simpleStatus: "in-progress"
|
|
705
|
+
};
|
|
706
|
+
case "queued": return {
|
|
707
|
+
...rendered,
|
|
708
|
+
status: "queued",
|
|
709
|
+
simpleStatus: "in-progress"
|
|
710
|
+
};
|
|
711
|
+
case "sending": return {
|
|
712
|
+
...startedSending,
|
|
713
|
+
status: "sending",
|
|
714
|
+
simpleStatus: "in-progress"
|
|
715
|
+
};
|
|
716
|
+
case "server-error": return {
|
|
717
|
+
...startedSending,
|
|
718
|
+
status: "server-error",
|
|
719
|
+
simpleStatus: "error",
|
|
720
|
+
errorAt: new Date(crud.error_at_millis),
|
|
721
|
+
serverError: crud.server_error
|
|
722
|
+
};
|
|
723
|
+
case "skipped": return {
|
|
724
|
+
...base,
|
|
725
|
+
status: "skipped",
|
|
726
|
+
simpleStatus: "ok",
|
|
727
|
+
skippedAt: new Date(crud.skipped_at_millis),
|
|
728
|
+
skippedReason: crud.skipped_reason,
|
|
729
|
+
skippedDetails: crud.skipped_details ?? {},
|
|
730
|
+
hasRendered: crud.has_rendered,
|
|
731
|
+
startedRenderingAt: crud.started_rendering_at_millis ? new Date(crud.started_rendering_at_millis) : void 0,
|
|
732
|
+
renderedAt: crud.rendered_at_millis ? new Date(crud.rendered_at_millis) : void 0,
|
|
733
|
+
subject: crud.subject,
|
|
734
|
+
html: crud.html,
|
|
735
|
+
text: crud.text,
|
|
736
|
+
isTransactional: crud.is_transactional,
|
|
737
|
+
isHighPriority: crud.is_high_priority,
|
|
738
|
+
notificationCategoryId: crud.notification_category_id,
|
|
739
|
+
startedSendingAt: crud.started_sending_at_millis ? new Date(crud.started_sending_at_millis) : void 0
|
|
740
|
+
};
|
|
741
|
+
case "bounced": return {
|
|
742
|
+
...startedSending,
|
|
743
|
+
status: "bounced",
|
|
744
|
+
simpleStatus: "error",
|
|
745
|
+
bouncedAt: new Date(crud.bounced_at_millis)
|
|
746
|
+
};
|
|
747
|
+
case "delivery-delayed": return {
|
|
748
|
+
...startedSending,
|
|
749
|
+
status: "delivery-delayed",
|
|
750
|
+
simpleStatus: "ok",
|
|
751
|
+
deliveryDelayedAt: new Date(crud.delivery_delayed_at_millis)
|
|
752
|
+
};
|
|
753
|
+
case "sent": return {
|
|
754
|
+
...finishedDelivering,
|
|
755
|
+
status: "sent",
|
|
756
|
+
simpleStatus: "ok",
|
|
757
|
+
canHaveDeliveryInfo: crud.can_have_delivery_info
|
|
758
|
+
};
|
|
759
|
+
case "opened": return {
|
|
760
|
+
...finishedDelivering,
|
|
761
|
+
status: "opened",
|
|
762
|
+
simpleStatus: "ok",
|
|
763
|
+
openedAt: new Date(crud.opened_at_millis),
|
|
764
|
+
canHaveDeliveryInfo: true
|
|
765
|
+
};
|
|
766
|
+
case "clicked": return {
|
|
767
|
+
...finishedDelivering,
|
|
768
|
+
status: "clicked",
|
|
769
|
+
simpleStatus: "ok",
|
|
770
|
+
clickedAt: new Date(crud.clicked_at_millis),
|
|
771
|
+
canHaveDeliveryInfo: true
|
|
772
|
+
};
|
|
773
|
+
case "marked-as-spam": return {
|
|
774
|
+
...finishedDelivering,
|
|
775
|
+
status: "marked-as-spam",
|
|
776
|
+
simpleStatus: "ok",
|
|
777
|
+
markedAsSpamAt: new Date(crud.marked_as_spam_at_millis),
|
|
778
|
+
canHaveDeliveryInfo: true
|
|
779
|
+
};
|
|
780
|
+
default: throw new _stackframe_stack_shared_dist_utils_errors.HexclaveAssertionError(`Unknown email outbox status: ${crud.status}`, { status: crud.status });
|
|
781
|
+
}
|
|
782
|
+
})();
|
|
783
|
+
}
|
|
784
|
+
async listOutboxEmails(options) {
|
|
785
|
+
const response = await this._interface.listOutboxEmails({
|
|
786
|
+
status: options?.status,
|
|
787
|
+
simple_status: options?.simpleStatus,
|
|
788
|
+
limit: options?.limit,
|
|
789
|
+
cursor: options?.cursor
|
|
790
|
+
});
|
|
791
|
+
return {
|
|
792
|
+
items: response.items.map((item) => this._emailOutboxCrudToAdmin(item)),
|
|
793
|
+
nextCursor: response.pagination?.next_cursor ?? null
|
|
794
|
+
};
|
|
795
|
+
}
|
|
796
|
+
async getOutboxEmail(id) {
|
|
797
|
+
const response = await this._interface.getOutboxEmail(id);
|
|
798
|
+
return this._emailOutboxCrudToAdmin(response);
|
|
799
|
+
}
|
|
800
|
+
async updateOutboxEmail(id, options) {
|
|
801
|
+
const response = await this._interface.updateOutboxEmail(id, {
|
|
802
|
+
is_paused: options.isPaused,
|
|
803
|
+
scheduled_at_millis: options.scheduledAtMillis,
|
|
804
|
+
cancel: options.cancel,
|
|
805
|
+
tsx_source: options.tsxSource,
|
|
806
|
+
theme_id: options.themeId
|
|
807
|
+
});
|
|
808
|
+
return this._emailOutboxCrudToAdmin(response);
|
|
809
|
+
}
|
|
810
|
+
async pauseOutboxEmail(id) {
|
|
811
|
+
return await this.updateOutboxEmail(id, { isPaused: true });
|
|
812
|
+
}
|
|
813
|
+
async unpauseOutboxEmail(id) {
|
|
814
|
+
return await this.updateOutboxEmail(id, { isPaused: false });
|
|
815
|
+
}
|
|
816
|
+
async cancelOutboxEmail(id) {
|
|
817
|
+
return await this.updateOutboxEmail(id, { cancel: true });
|
|
818
|
+
}
|
|
819
|
+
async getStripeAccountInfo() {
|
|
820
|
+
return await this._interface.getStripeAccountInfo();
|
|
821
|
+
}
|
|
822
|
+
async queryAnalytics(options) {
|
|
823
|
+
return await this._interface.queryAnalytics(options);
|
|
824
|
+
}
|
|
825
|
+
async listSessionReplays(options) {
|
|
826
|
+
const response = await this._interface.listSessionReplays({
|
|
827
|
+
cursor: options?.cursor,
|
|
828
|
+
limit: options?.limit,
|
|
829
|
+
user_ids: options?.userIds,
|
|
830
|
+
team_ids: options?.teamIds,
|
|
831
|
+
duration_ms_min: options?.durationMsMin,
|
|
832
|
+
duration_ms_max: options?.durationMsMax,
|
|
833
|
+
last_event_at_from_millis: options?.lastEventAtFromMillis,
|
|
834
|
+
last_event_at_to_millis: options?.lastEventAtToMillis,
|
|
835
|
+
click_count_min: options?.clickCountMin
|
|
836
|
+
});
|
|
837
|
+
return {
|
|
838
|
+
items: response.items.map((r) => ({
|
|
839
|
+
id: r.id,
|
|
840
|
+
projectUser: {
|
|
841
|
+
id: r.project_user.id,
|
|
842
|
+
displayName: r.project_user.display_name,
|
|
843
|
+
primaryEmail: r.project_user.primary_email
|
|
844
|
+
},
|
|
845
|
+
startedAt: new Date(r.started_at_millis),
|
|
846
|
+
lastEventAt: new Date(r.last_event_at_millis),
|
|
847
|
+
chunkCount: r.chunk_count,
|
|
848
|
+
eventCount: r.event_count
|
|
849
|
+
})),
|
|
850
|
+
nextCursor: response.pagination.next_cursor
|
|
851
|
+
};
|
|
852
|
+
}
|
|
853
|
+
async getSessionReplay(sessionReplayId) {
|
|
854
|
+
const response = await this._interface.getSessionReplay(sessionReplayId);
|
|
855
|
+
return {
|
|
856
|
+
id: response.id,
|
|
857
|
+
projectUser: {
|
|
858
|
+
id: response.project_user.id,
|
|
859
|
+
displayName: response.project_user.display_name,
|
|
860
|
+
primaryEmail: response.project_user.primary_email
|
|
861
|
+
},
|
|
862
|
+
startedAt: new Date(response.started_at_millis),
|
|
863
|
+
lastEventAt: new Date(response.last_event_at_millis),
|
|
864
|
+
chunkCount: response.chunk_count,
|
|
865
|
+
eventCount: response.event_count
|
|
866
|
+
};
|
|
867
|
+
}
|
|
868
|
+
async listSessionReplayChunks(sessionReplayId, options) {
|
|
869
|
+
const response = await this._interface.listSessionReplayChunks(sessionReplayId, {
|
|
870
|
+
cursor: options?.cursor,
|
|
871
|
+
limit: options?.limit
|
|
872
|
+
});
|
|
873
|
+
return {
|
|
874
|
+
items: response.items.map((c) => ({
|
|
875
|
+
id: c.id,
|
|
876
|
+
batchId: c.batch_id,
|
|
877
|
+
sessionReplaySegmentId: c.session_replay_segment_id,
|
|
878
|
+
browserSessionId: c.browser_session_id,
|
|
879
|
+
eventCount: c.event_count,
|
|
880
|
+
byteLength: c.byte_length,
|
|
881
|
+
firstEventAt: new Date(c.first_event_at_millis),
|
|
882
|
+
lastEventAt: new Date(c.last_event_at_millis),
|
|
883
|
+
createdAt: new Date(c.created_at_millis)
|
|
884
|
+
})),
|
|
885
|
+
nextCursor: response.pagination.next_cursor
|
|
886
|
+
};
|
|
887
|
+
}
|
|
888
|
+
async getSessionReplayChunkEvents(sessionReplayId, chunkId) {
|
|
889
|
+
return await this._interface.getSessionReplayChunkEvents(sessionReplayId, chunkId);
|
|
890
|
+
}
|
|
891
|
+
async getSessionReplayEvents(sessionReplayId, options) {
|
|
892
|
+
const response = await this._interface.getSessionReplayEvents(sessionReplayId, options);
|
|
893
|
+
return {
|
|
894
|
+
chunks: response.chunks.map((c) => ({
|
|
895
|
+
id: c.id,
|
|
896
|
+
batchId: c.batch_id,
|
|
897
|
+
sessionReplaySegmentId: c.session_replay_segment_id,
|
|
898
|
+
eventCount: c.event_count,
|
|
899
|
+
byteLength: c.byte_length,
|
|
900
|
+
firstEventAt: new Date(c.first_event_at_millis),
|
|
901
|
+
lastEventAt: new Date(c.last_event_at_millis),
|
|
902
|
+
createdAt: new Date(c.created_at_millis)
|
|
903
|
+
})),
|
|
904
|
+
chunkEvents: response.chunk_events.map((ce) => ({
|
|
905
|
+
chunkId: ce.chunk_id,
|
|
906
|
+
events: ce.events
|
|
907
|
+
}))
|
|
908
|
+
};
|
|
909
|
+
}
|
|
910
|
+
async previewAffectedUsersByOnboardingChange(onboarding, limit) {
|
|
911
|
+
const result = await this._interface.previewAffectedUsersByOnboardingChange({ require_email_verification: onboarding.requireEmailVerification }, limit);
|
|
912
|
+
return {
|
|
913
|
+
affectedUsers: result.affected_users.map((u) => ({
|
|
914
|
+
id: u.id,
|
|
915
|
+
displayName: u.display_name,
|
|
916
|
+
primaryEmail: u.primary_email,
|
|
917
|
+
restrictedReason: u.restricted_reason
|
|
918
|
+
})),
|
|
919
|
+
totalAffectedCount: result.total_affected_count
|
|
920
|
+
};
|
|
921
|
+
}
|
|
922
|
+
};
|
|
923
|
+
|
|
924
|
+
//#endregion
|
|
925
|
+
exports._StackAdminAppImplIncomplete = _StackAdminAppImplIncomplete;
|
|
926
|
+
//# sourceMappingURL=admin-app-impl.js.map
|