@hexclave/next 1.0.3 → 1.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/components/api-key-dialogs.d.ts +1 -1
- package/dist/components/api-key-dialogs.js.map +1 -1
- package/dist/components/api-key-table.d.ts +1 -1
- package/dist/components/api-key-table.js.map +1 -1
- package/dist/components/credential-sign-in.js.map +1 -1
- package/dist/components/credential-sign-up.js.map +1 -1
- package/dist/components/elements/form-warning.js.map +1 -1
- package/dist/components/elements/maybe-full-page.js.map +1 -1
- package/dist/components/elements/separator-with-text.js.map +1 -1
- package/dist/components/elements/sidebar-layout.js.map +1 -1
- package/dist/components/elements/ssr-layout-effect.js.map +1 -1
- package/dist/components/elements/user-avatar.js.map +1 -1
- package/dist/components/link.js.map +1 -1
- package/dist/components/magic-link-sign-in.js +2 -2
- package/dist/components/magic-link-sign-in.js.map +1 -1
- package/dist/components/message-cards/known-error-message-card.js +2 -2
- package/dist/components/message-cards/known-error-message-card.js.map +1 -1
- package/dist/components/message-cards/message-card.js.map +1 -1
- package/dist/components/message-cards/predefined-message-card.js +9 -9
- package/dist/components/message-cards/predefined-message-card.js.map +1 -1
- package/dist/components/oauth-button-group.js +2 -2
- package/dist/components/oauth-button-group.js.map +1 -1
- package/dist/components/oauth-button.js +2 -2
- package/dist/components/oauth-button.js.map +1 -1
- package/dist/components/passkey-button.js +2 -2
- package/dist/components/passkey-button.js.map +1 -1
- package/dist/components/profile-image-editor.js.map +1 -1
- package/dist/components/selected-team-switcher.d.ts +1 -1
- package/dist/components/selected-team-switcher.js.map +1 -1
- package/dist/components/team-icon.d.ts +1 -1
- package/dist/components/team-icon.js.map +1 -1
- package/dist/components/team-switcher.d.ts +1 -1
- package/dist/components/team-switcher.js.map +1 -1
- package/dist/components/use-in-iframe.js.map +1 -1
- package/dist/components/user-button.js.map +1 -1
- package/dist/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/components-page/account-settings/api-keys/api-keys-page.js.map +1 -1
- package/dist/components-page/account-settings/editable-text.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/email-and-auth-page.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/mfa-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/otp-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/passkey-section.js.map +1 -1
- package/dist/components-page/account-settings/email-and-auth/password-section.js.map +1 -1
- package/dist/components-page/account-settings/notifications/notifications-page.js.map +1 -1
- package/dist/components-page/account-settings/page-layout.js.map +1 -1
- package/dist/components-page/account-settings/payments/payments-page.d.ts +1 -1
- package/dist/components-page/account-settings/payments/payments-page.js.map +1 -1
- package/dist/components-page/account-settings/payments/payments-panel.d.ts +1 -1
- package/dist/components-page/account-settings/payments/payments-panel.js +3 -3
- package/dist/components-page/account-settings/payments/payments-panel.js.map +1 -1
- package/dist/components-page/account-settings/profile-page/profile-page.js.map +1 -1
- package/dist/components-page/account-settings/section.js.map +1 -1
- package/dist/components-page/account-settings/settings/delete-account-section.js.map +1 -1
- package/dist/components-page/account-settings/settings/settings-page.js.map +1 -1
- package/dist/components-page/account-settings/settings/sign-out-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/leave-team-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-api-keys-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-api-keys-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-creation-page.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-display-name-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-display-name-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-invitation-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-member-list-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-member-list-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-page.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-page.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-profile-image-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-image-section.js.map +1 -1
- package/dist/components-page/account-settings/teams/team-profile-user-section.d.ts +1 -1
- package/dist/components-page/account-settings/teams/team-profile-user-section.js.map +1 -1
- package/dist/components-page/account-settings.js.map +1 -1
- package/dist/components-page/auth-page.d.ts.map +1 -1
- package/dist/components-page/auth-page.js +55 -10
- package/dist/components-page/auth-page.js.map +1 -1
- package/dist/components-page/cli-auth-confirm.js +3 -3
- package/dist/components-page/cli-auth-confirm.js.map +1 -1
- package/dist/components-page/cli-auth-confirm.test.js +4 -4
- package/dist/components-page/cli-auth-confirm.test.js.map +1 -1
- package/dist/components-page/email-verification.js +4 -4
- package/dist/components-page/email-verification.js.map +1 -1
- package/dist/components-page/error-page.js +9 -9
- package/dist/components-page/error-page.js.map +1 -1
- package/dist/components-page/forgot-password.js +4 -4
- package/dist/components-page/forgot-password.js.map +1 -1
- package/dist/components-page/{stack-handler-client.d.ts → hexclave-handler-client.d.ts} +4 -4
- package/dist/components-page/hexclave-handler-client.d.ts.map +1 -0
- package/dist/components-page/{stack-handler-client.js → hexclave-handler-client.js} +19 -18
- package/dist/components-page/hexclave-handler-client.js.map +1 -0
- package/dist/components-page/{stack-handler.d.ts → hexclave-handler.d.ts} +5 -5
- package/dist/components-page/hexclave-handler.d.ts.map +1 -0
- package/dist/components-page/{stack-handler.js → hexclave-handler.js} +4 -4
- package/dist/components-page/hexclave-handler.js.map +1 -0
- package/dist/components-page/magic-link-callback.js +7 -7
- package/dist/components-page/magic-link-callback.js.map +1 -1
- package/dist/components-page/mfa.js +4 -4
- package/dist/components-page/mfa.js.map +1 -1
- package/dist/components-page/oauth-callback.js +3 -3
- package/dist/components-page/oauth-callback.js.map +1 -1
- package/dist/components-page/onboarding.js +3 -3
- package/dist/components-page/onboarding.js.map +1 -1
- package/dist/components-page/password-reset.js +8 -8
- package/dist/components-page/password-reset.js.map +1 -1
- package/dist/components-page/sign-in.js.map +1 -1
- package/dist/components-page/sign-out.d.ts +1 -0
- package/dist/components-page/sign-out.d.ts.map +1 -1
- package/dist/components-page/sign-out.js +11 -5
- package/dist/components-page/sign-out.js.map +1 -1
- package/dist/components-page/sign-up.js.map +1 -1
- package/dist/components-page/team-creation.js.map +1 -1
- package/dist/components-page/team-invitation.js +16 -16
- package/dist/components-page/team-invitation.js.map +1 -1
- package/dist/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/dev-tool/dev-tool-core.js +11 -11
- package/dist/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/dev-tool/dev-tool-styles.d.ts +1 -1
- package/dist/dev-tool/dev-tool-styles.js +371 -371
- package/dist/dev-tool/dev-tool-styles.js.map +1 -1
- package/dist/dev-tool/dev-tool-trigger-position.js.map +1 -1
- package/dist/dev-tool/dev-tool-trigger-position.test.js.map +1 -1
- package/dist/dev-tool/index.d.ts +4 -4
- package/dist/dev-tool/index.js +4 -4
- package/dist/dev-tool/index.js.map +1 -1
- package/dist/esm/components/api-key-dialogs.d.ts +1 -1
- package/dist/esm/components/api-key-dialogs.js.map +1 -1
- package/dist/esm/components/api-key-table.d.ts +1 -1
- package/dist/esm/components/api-key-table.js.map +1 -1
- package/dist/esm/components/credential-sign-in.js.map +1 -1
- package/dist/esm/components/credential-sign-up.js.map +1 -1
- package/dist/esm/components/elements/form-warning.js.map +1 -1
- package/dist/esm/components/elements/maybe-full-page.js.map +1 -1
- package/dist/esm/components/elements/separator-with-text.js.map +1 -1
- package/dist/esm/components/elements/sidebar-layout.js.map +1 -1
- package/dist/esm/components/elements/ssr-layout-effect.js.map +1 -1
- package/dist/esm/components/elements/user-avatar.js.map +1 -1
- package/dist/esm/components/link.js.map +1 -1
- package/dist/esm/components/magic-link-sign-in.js +2 -2
- package/dist/esm/components/magic-link-sign-in.js.map +1 -1
- package/dist/esm/components/message-cards/known-error-message-card.js +2 -2
- package/dist/esm/components/message-cards/known-error-message-card.js.map +1 -1
- package/dist/esm/components/message-cards/message-card.js.map +1 -1
- package/dist/esm/components/message-cards/predefined-message-card.js +9 -9
- package/dist/esm/components/message-cards/predefined-message-card.js.map +1 -1
- package/dist/esm/components/oauth-button-group.js +2 -2
- package/dist/esm/components/oauth-button-group.js.map +1 -1
- package/dist/esm/components/oauth-button.js +2 -2
- package/dist/esm/components/oauth-button.js.map +1 -1
- package/dist/esm/components/passkey-button.js +2 -2
- package/dist/esm/components/passkey-button.js.map +1 -1
- package/dist/esm/components/profile-image-editor.js.map +1 -1
- package/dist/esm/components/selected-team-switcher.js.map +1 -1
- package/dist/esm/components/team-icon.js.map +1 -1
- package/dist/esm/components/team-switcher.js.map +1 -1
- package/dist/esm/components/use-in-iframe.js.map +1 -1
- package/dist/esm/components/user-button.js.map +1 -1
- package/dist/esm/components-page/account-settings/active-sessions/active-sessions-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/api-keys/api-keys-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/editable-text.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/email-and-auth-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/emails-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/mfa-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/otp-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/passkey-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/email-and-auth/password-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/notifications/notifications-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/page-layout.js.map +1 -1
- package/dist/esm/components-page/account-settings/payments/payments-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/payments/payments-panel.d.ts +1 -1
- package/dist/esm/components-page/account-settings/payments/payments-panel.js +3 -3
- package/dist/esm/components-page/account-settings/payments/payments-panel.js.map +1 -1
- package/dist/esm/components-page/account-settings/profile-page/profile-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/section.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/delete-account-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/settings-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/settings/sign-out-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/leave-team-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-api-keys-section.d.ts +1 -1
- package/dist/esm/components-page/account-settings/teams/team-api-keys-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-creation-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-display-name-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-member-invitation-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-member-list-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-page.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-profile-image-section.js.map +1 -1
- package/dist/esm/components-page/account-settings/teams/team-profile-user-section.js.map +1 -1
- package/dist/esm/components-page/account-settings.js.map +1 -1
- package/dist/esm/components-page/auth-page.d.ts.map +1 -1
- package/dist/esm/components-page/auth-page.js +56 -11
- package/dist/esm/components-page/auth-page.js.map +1 -1
- package/dist/esm/components-page/cli-auth-confirm.js +3 -3
- package/dist/esm/components-page/cli-auth-confirm.js.map +1 -1
- package/dist/esm/components-page/cli-auth-confirm.test.js +4 -4
- package/dist/esm/components-page/cli-auth-confirm.test.js.map +1 -1
- package/dist/esm/components-page/email-verification.js +4 -4
- package/dist/esm/components-page/email-verification.js.map +1 -1
- package/dist/esm/components-page/error-page.js +9 -9
- package/dist/esm/components-page/error-page.js.map +1 -1
- package/dist/esm/components-page/forgot-password.js +4 -4
- package/dist/esm/components-page/forgot-password.js.map +1 -1
- package/dist/esm/components-page/{stack-handler-client.d.ts → hexclave-handler-client.d.ts} +4 -4
- package/dist/esm/components-page/hexclave-handler-client.d.ts.map +1 -0
- package/dist/esm/components-page/{stack-handler-client.js → hexclave-handler-client.js} +17 -16
- package/dist/esm/components-page/hexclave-handler-client.js.map +1 -0
- package/dist/esm/components-page/{stack-handler.d.ts → hexclave-handler.d.ts} +5 -5
- package/dist/esm/components-page/hexclave-handler.d.ts.map +1 -0
- package/dist/esm/components-page/{stack-handler.js → hexclave-handler.js} +4 -4
- package/dist/esm/components-page/hexclave-handler.js.map +1 -0
- package/dist/esm/components-page/magic-link-callback.js +7 -7
- package/dist/esm/components-page/magic-link-callback.js.map +1 -1
- package/dist/esm/components-page/mfa.js +4 -4
- package/dist/esm/components-page/mfa.js.map +1 -1
- package/dist/esm/components-page/oauth-callback.js +3 -3
- package/dist/esm/components-page/oauth-callback.js.map +1 -1
- package/dist/esm/components-page/onboarding.js +3 -3
- package/dist/esm/components-page/onboarding.js.map +1 -1
- package/dist/esm/components-page/password-reset.js +8 -8
- package/dist/esm/components-page/password-reset.js.map +1 -1
- package/dist/esm/components-page/sign-in.js.map +1 -1
- package/dist/esm/components-page/sign-out.d.ts +1 -0
- package/dist/esm/components-page/sign-out.d.ts.map +1 -1
- package/dist/esm/components-page/sign-out.js +11 -5
- package/dist/esm/components-page/sign-out.js.map +1 -1
- package/dist/esm/components-page/sign-up.js.map +1 -1
- package/dist/esm/components-page/team-creation.js.map +1 -1
- package/dist/esm/components-page/team-invitation.js +16 -16
- package/dist/esm/components-page/team-invitation.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-core.d.ts +1 -1
- package/dist/esm/dev-tool/dev-tool-core.js +10 -10
- package/dist/esm/dev-tool/dev-tool-core.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-styles.d.ts +1 -1
- package/dist/esm/dev-tool/dev-tool-styles.js +371 -371
- package/dist/esm/dev-tool/dev-tool-styles.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-trigger-position.js.map +1 -1
- package/dist/esm/dev-tool/dev-tool-trigger-position.test.js.map +1 -1
- package/dist/esm/dev-tool/index.d.ts +4 -4
- package/dist/esm/dev-tool/index.js +4 -4
- package/dist/esm/dev-tool/index.js.map +1 -1
- package/dist/esm/generated/global-css.d.ts +1 -1
- package/dist/esm/generated/global-css.js +1 -1
- package/dist/esm/generated/global-css.js.map +1 -1
- package/dist/esm/generated/quetzal-translations.js.map +1 -1
- package/dist/esm/index.d.ts +4 -4
- package/dist/esm/index.js +3 -3
- package/dist/esm/integrations/convex/component/convex.config.js.map +1 -1
- package/dist/esm/integrations/convex.js +1 -1
- package/dist/esm/integrations/convex.js.map +1 -1
- package/dist/esm/lib/auth.js.map +1 -1
- package/dist/esm/lib/auth.test.js.map +1 -1
- package/dist/esm/lib/cookie.js +2 -2
- package/dist/esm/lib/cookie.js.map +1 -1
- package/dist/esm/lib/env.js.map +1 -1
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/api-keys/index.d.ts +2 -2
- package/dist/esm/lib/hexclave-app/api-keys/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/api-keys/index.js +1 -1
- package/dist/esm/lib/hexclave-app/api-keys/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/admin-app-impl.d.ts +6 -6
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/admin-app-impl.js +7 -7
- package/dist/esm/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.cross-domain.test.js +2 -2
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.d.ts +13 -13
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.js +23 -30
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.oauth-prefetch.test.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/apps/implementations/common.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/common.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/common.js +7 -7
- package/dist/esm/lib/hexclave-app/apps/implementations/common.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.test.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/index.d.ts +9 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/index.d.ts.map +1 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/index.js +27 -0
- package/dist/esm/lib/hexclave-app/apps/implementations/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/redirect-page-urls.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/redirect-page-urls.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/server-app-impl.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/server-app-impl.js +6 -6
- package/dist/esm/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/apps/implementations/session-refresh-subscription.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-refresh-subscription.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-refresh-subscription.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.test.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-refresh-subscription.test.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.test.js +1 -1
- package/dist/esm/lib/hexclave-app/apps/implementations/session-replay.test.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/admin-app.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/admin-app.js +3 -3
- package/dist/esm/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/client-app.d.ts +4 -4
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/client-app.js +3 -3
- package/dist/esm/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/server-app.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/apps/interfaces/server-app.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/apps/interfaces/server-app.js +3 -3
- package/dist/esm/lib/hexclave-app/apps/interfaces/server-app.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/common.d.ts +7 -7
- package/dist/esm/lib/hexclave-app/common.d.ts.map +1 -0
- package/dist/esm/lib/hexclave-app/common.js +7 -0
- package/dist/esm/lib/hexclave-app/common.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/connected-accounts/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/connected-accounts/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/contact-channels/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/contact-channels/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/contact-channels/index.js +1 -1
- package/dist/esm/lib/hexclave-app/contact-channels/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/customers/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/customers/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/data-vault/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/data-vault/index.d.ts.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/email/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/email/index.d.ts.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/email-templates/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/email-templates/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/email-templates/index.js +1 -1
- package/dist/esm/lib/hexclave-app/email-templates/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/index.d.ts +2 -2
- package/dist/esm/lib/{stack-app → hexclave-app}/index.js +2 -2
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/internal-api-keys/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/internal-api-keys/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/internal-api-keys/index.js +1 -1
- package/dist/esm/lib/hexclave-app/internal-api-keys/index.js.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/notification-categories/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/notification-categories/index.d.ts.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/permissions/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/permissions/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/permissions/index.js +1 -1
- package/dist/esm/lib/hexclave-app/permissions/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/project-configs/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/project-configs/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/projects/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/projects/index.js +1 -1
- package/dist/esm/lib/hexclave-app/projects/index.js.map +1 -0
- package/dist/{lib/stack-app → esm/lib/hexclave-app}/session-replays/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/session-replays/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/teams/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/teams/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/teams/index.js +1 -1
- package/dist/esm/lib/hexclave-app/teams/index.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/url-targets.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/url-targets.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/url-targets.js +2 -2
- package/dist/esm/lib/hexclave-app/url-targets.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/url-targets.test.js +1 -1
- package/dist/esm/lib/hexclave-app/url-targets.test.js.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/users/index.d.ts +1 -1
- package/dist/esm/lib/hexclave-app/users/index.d.ts.map +1 -0
- package/dist/esm/lib/{stack-app → hexclave-app}/users/index.js +1 -1
- package/dist/esm/lib/hexclave-app/users/index.js.map +1 -0
- package/dist/esm/lib/hooks.d.ts +1 -1
- package/dist/esm/lib/hooks.js +9 -9
- package/dist/esm/lib/hooks.js.map +1 -1
- package/dist/esm/lib/translations.js.map +1 -1
- package/dist/esm/providers/hexclave-context.d.ts +11 -0
- package/dist/esm/providers/hexclave-context.d.ts.map +1 -0
- package/dist/esm/providers/hexclave-context.js +12 -0
- package/dist/esm/providers/hexclave-context.js.map +1 -0
- package/dist/esm/providers/{stack-provider-client.d.ts → hexclave-provider-client.d.ts} +5 -5
- package/dist/esm/providers/hexclave-provider-client.d.ts.map +1 -0
- package/dist/esm/providers/hexclave-provider-client.js +30 -0
- package/dist/esm/providers/hexclave-provider-client.js.map +1 -0
- package/dist/esm/providers/{stack-provider.d.ts → hexclave-provider.d.ts} +3 -3
- package/dist/esm/providers/hexclave-provider.d.ts.map +1 -0
- package/dist/esm/providers/{stack-provider.js → hexclave-provider.js} +6 -6
- package/dist/esm/providers/hexclave-provider.js.map +1 -0
- package/dist/esm/providers/theme-provider.js.map +1 -1
- package/dist/esm/providers/translation-provider-client.js.map +1 -1
- package/dist/esm/providers/translation-provider.js.map +1 -1
- package/dist/esm/tanstack-start-server-context.d.ts +1 -1
- package/dist/esm/utils/browser-script.js.map +1 -1
- package/dist/esm/utils/constants.js.map +1 -1
- package/dist/esm/utils/url.js.map +1 -1
- package/dist/generated/global-css.d.ts +1 -1
- package/dist/generated/global-css.js +1 -1
- package/dist/generated/global-css.js.map +1 -1
- package/dist/generated/quetzal-translations.js.map +1 -1
- package/dist/index.d.ts +18 -18
- package/dist/index.js +9 -9
- package/dist/integrations/convex/component/convex.config.d.ts +2 -2
- package/dist/integrations/convex/component/convex.config.d.ts.map +1 -1
- package/dist/integrations/convex/component/convex.config.js.map +1 -1
- package/dist/integrations/convex.js +2 -2
- package/dist/integrations/convex.js.map +1 -1
- package/dist/lib/auth.js.map +1 -1
- package/dist/lib/auth.test.js.map +1 -1
- package/dist/lib/cookie.js +2 -2
- package/dist/lib/cookie.js.map +1 -1
- package/dist/lib/env.js.map +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/api-keys/index.d.ts +2 -2
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/api-keys/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/api-keys/index.js +1 -1
- package/dist/lib/hexclave-app/api-keys/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/admin-app-impl.d.ts +6 -6
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.d.ts.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/admin-app-impl.js +5 -5
- package/dist/lib/hexclave-app/apps/implementations/admin-app-impl.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.cross-domain.test.js +2 -2
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.d.ts +13 -13
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.d.ts.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.js +22 -29
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.oauth-prefetch.test.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +1 -0
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/common.d.ts +4 -4
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/common.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/common.js +6 -6
- package/dist/lib/hexclave-app/apps/implementations/common.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/event-tracker.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.test.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/event-tracker.test.js.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts +9 -0
- package/dist/lib/hexclave-app/apps/implementations/index.d.ts.map +1 -0
- package/dist/lib/hexclave-app/apps/implementations/index.js +31 -0
- package/dist/lib/hexclave-app/apps/implementations/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/redirect-page-urls.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/redirect-page-urls.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/redirect-page-urls.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/redirect-page-urls.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/server-app-impl.d.ts +4 -4
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/server-app-impl.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/server-app-impl.js +5 -5
- package/dist/lib/hexclave-app/apps/implementations/server-app-impl.js.map +1 -0
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/session-refresh-subscription.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/session-refresh-subscription.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-refresh-subscription.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.test.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-refresh-subscription.test.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/implementations/session-replay.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.test.js +1 -1
- package/dist/lib/hexclave-app/apps/implementations/session-replay.test.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/admin-app.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/interfaces/admin-app.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/admin-app.js +2 -2
- package/dist/lib/hexclave-app/apps/interfaces/admin-app.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/client-app.d.ts +4 -4
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/interfaces/client-app.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/client-app.js +2 -2
- package/dist/lib/hexclave-app/apps/interfaces/client-app.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/server-app.d.ts +2 -2
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/apps/interfaces/server-app.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/apps/interfaces/server-app.js +2 -2
- package/dist/lib/hexclave-app/apps/interfaces/server-app.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/common.d.ts +8 -8
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/common.d.ts.map +1 -1
- package/dist/lib/hexclave-app/common.js +9 -0
- package/dist/lib/hexclave-app/common.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/connected-accounts/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/connected-accounts/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/contact-channels/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/contact-channels/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/contact-channels/index.js +1 -1
- package/dist/lib/hexclave-app/contact-channels/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/customers/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/customers/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/data-vault/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/data-vault/index.d.ts.map +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/email/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/email/index.d.ts.map +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/email-templates/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/email-templates/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/email-templates/index.js +1 -1
- package/dist/lib/hexclave-app/email-templates/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/index.d.ts +2 -2
- package/dist/lib/{stack-app → hexclave-app}/index.js +2 -2
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/internal-api-keys/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/internal-api-keys/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/internal-api-keys/index.js +1 -1
- package/dist/lib/hexclave-app/internal-api-keys/index.js.map +1 -0
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/notification-categories/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/notification-categories/index.d.ts.map +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/permissions/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/permissions/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/permissions/index.js +1 -1
- package/dist/lib/hexclave-app/permissions/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/project-configs/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/project-configs/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/projects/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/projects/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/projects/index.js +1 -1
- package/dist/lib/hexclave-app/projects/index.js.map +1 -0
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/session-replays/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/session-replays/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/teams/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/teams/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/teams/index.js +1 -1
- package/dist/lib/hexclave-app/teams/index.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/url-targets.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/url-targets.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/url-targets.js +2 -2
- package/dist/lib/hexclave-app/url-targets.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/url-targets.test.js +1 -1
- package/dist/lib/hexclave-app/url-targets.test.js.map +1 -0
- package/dist/lib/{stack-app → hexclave-app}/users/index.d.ts +1 -1
- package/dist/{esm/lib/stack-app → lib/hexclave-app}/users/index.d.ts.map +1 -1
- package/dist/lib/{stack-app → hexclave-app}/users/index.js +1 -1
- package/dist/lib/hexclave-app/users/index.js.map +1 -0
- package/dist/lib/hooks.d.ts +3 -3
- package/dist/lib/hooks.d.ts.map +1 -1
- package/dist/lib/hooks.js +9 -9
- package/dist/lib/hooks.js.map +1 -1
- package/dist/lib/translations.js.map +1 -1
- package/dist/providers/hexclave-context.d.ts +11 -0
- package/dist/providers/hexclave-context.d.ts.map +1 -0
- package/dist/providers/hexclave-context.js +15 -0
- package/dist/providers/hexclave-context.js.map +1 -0
- package/dist/providers/{stack-provider-client.d.ts → hexclave-provider-client.d.ts} +5 -5
- package/dist/providers/hexclave-provider-client.d.ts.map +1 -0
- package/dist/providers/{stack-provider-client.js → hexclave-provider-client.js} +9 -9
- package/dist/providers/hexclave-provider-client.js.map +1 -0
- package/dist/providers/{stack-provider.d.ts → hexclave-provider.d.ts} +5 -5
- package/dist/providers/hexclave-provider.d.ts.map +1 -0
- package/dist/providers/{stack-provider.js → hexclave-provider.js} +6 -6
- package/dist/providers/hexclave-provider.js.map +1 -0
- package/dist/providers/theme-provider.js.map +1 -1
- package/dist/providers/translation-provider-client.js.map +1 -1
- package/dist/providers/translation-provider.js.map +1 -1
- package/dist/{storage-kTmOAWHW.d.ts → storage-CKzvsBxG.d.ts} +18 -18
- package/dist/{storage-kTmOAWHW.d.ts.map → storage-CKzvsBxG.d.ts.map} +1 -1
- package/dist/tanstack-start-server-context.d.ts +1 -1
- package/dist/utils/browser-script.js.map +1 -1
- package/dist/utils/constants.js.map +1 -1
- package/dist/utils/url.js.map +1 -1
- package/package.json +6 -5
- package/src/components/api-key-dialogs.tsx +173 -0
- package/src/components/api-key-table.tsx +127 -0
- package/src/components/credential-sign-in.tsx +83 -0
- package/src/components/credential-sign-up.tsx +108 -0
- package/src/components/elements/form-warning.tsx +17 -0
- package/src/components/elements/maybe-full-page.tsx +60 -0
- package/src/components/elements/separator-with-text.tsx +22 -0
- package/src/components/elements/sidebar-layout.tsx +136 -0
- package/src/components/elements/ssr-layout-effect.tsx +24 -0
- package/src/components/elements/user-avatar.tsx +32 -0
- package/src/components/link.tsx +40 -0
- package/src/components/magic-link-sign-in.tsx +143 -0
- package/src/components/message-cards/known-error-message-card.tsx +33 -0
- package/src/components/message-cards/message-card.tsx +46 -0
- package/src/components/message-cards/predefined-message-card.tsx +88 -0
- package/src/components/oauth-button-group.tsx +35 -0
- package/src/components/oauth-button.tsx +222 -0
- package/src/components/passkey-button.tsx +43 -0
- package/src/components/profile-image-editor.tsx +194 -0
- package/src/components/selected-team-switcher.tsx +97 -0
- package/src/components/team-icon.tsx +30 -0
- package/src/components/team-switcher.tsx +191 -0
- package/src/components/use-in-iframe.tsx +18 -0
- package/src/components/user-button.tsx +157 -0
- package/src/components-page/account-settings/active-sessions/active-sessions-page.tsx +238 -0
- package/src/components-page/account-settings/api-keys/api-keys-page.tsx +157 -0
- package/src/components-page/account-settings/editable-text.tsx +53 -0
- package/src/components-page/account-settings/email-and-auth/email-and-auth-page.tsx +24 -0
- package/src/components-page/account-settings/email-and-auth/emails-section.tsx +201 -0
- package/src/components-page/account-settings/email-and-auth/mfa-section.tsx +139 -0
- package/src/components-page/account-settings/email-and-auth/otp-section.tsx +102 -0
- package/src/components-page/account-settings/email-and-auth/passkey-section.tsx +112 -0
- package/src/components-page/account-settings/email-and-auth/password-section.tsx +174 -0
- package/src/components-page/account-settings/notifications/notifications-page.tsx +44 -0
- package/src/components-page/account-settings/page-layout.tsx +11 -0
- package/src/components-page/account-settings/payments/payments-page.tsx +73 -0
- package/src/components-page/account-settings/payments/payments-panel.tsx +543 -0
- package/src/components-page/account-settings/profile-page/profile-page.tsx +61 -0
- package/src/components-page/account-settings/section.tsx +26 -0
- package/src/components-page/account-settings/settings/delete-account-section.tsx +85 -0
- package/src/components-page/account-settings/settings/settings-page.tsx +19 -0
- package/src/components-page/account-settings/settings/sign-out-section.tsx +40 -0
- package/src/components-page/account-settings/teams/leave-team-section.tsx +57 -0
- package/src/components-page/account-settings/teams/team-api-keys-section.tsx +74 -0
- package/src/components-page/account-settings/teams/team-creation-page.tsx +92 -0
- package/src/components-page/account-settings/teams/team-display-name-section.tsx +31 -0
- package/src/components-page/account-settings/teams/team-member-invitation-section.tsx +128 -0
- package/src/components-page/account-settings/teams/team-member-list-section.tsx +59 -0
- package/src/components-page/account-settings/teams/team-page.tsx +28 -0
- package/src/components-page/account-settings/teams/team-profile-image-section.tsx +33 -0
- package/src/components-page/account-settings/teams/team-profile-user-section.tsx +29 -0
- package/src/components-page/account-settings.tsx +343 -0
- package/src/components-page/auth-page.tsx +206 -0
- package/src/components-page/cli-auth-confirm.test.tsx +204 -0
- package/src/components-page/cli-auth-confirm.tsx +278 -0
- package/src/components-page/email-verification.tsx +76 -0
- package/src/components-page/error-page.tsx +105 -0
- package/src/components-page/forgot-password.tsx +105 -0
- package/src/components-page/hexclave-handler-client.tsx +325 -0
- package/src/components-page/hexclave-handler.tsx +48 -0
- package/src/components-page/magic-link-callback.tsx +92 -0
- package/src/components-page/mfa.tsx +222 -0
- package/src/components-page/oauth-callback.tsx +78 -0
- package/src/components-page/onboarding.tsx +176 -0
- package/src/components-page/password-reset.tsx +185 -0
- package/src/components-page/section.tsx +27 -0
- package/src/components-page/sign-in.tsx +34 -0
- package/src/components-page/sign-out.tsx +37 -0
- package/src/components-page/sign-up.tsx +24 -0
- package/src/components-page/team-creation.tsx +78 -0
- package/src/components-page/team-invitation.tsx +150 -0
- package/src/dev-tool/dev-tool-core.ts +2460 -0
- package/src/dev-tool/dev-tool-styles.ts +2758 -0
- package/src/dev-tool/dev-tool-trigger-position.test.ts +113 -0
- package/src/dev-tool/dev-tool-trigger-position.ts +109 -0
- package/src/dev-tool/index.ts +149 -0
- package/src/generated/.gitignore +3 -0
- package/src/generated/quetzal-translations.ts +4312 -0
- package/src/global.css +13 -0
- package/src/global.d.ts +5 -0
- package/src/index.ts +39 -0
- package/src/integrations/convex/component/README.md +74 -0
- package/src/integrations/convex/component/convex.config.ts +9 -0
- package/src/integrations/convex.ts +28 -0
- package/src/lib/auth.test.ts +67 -0
- package/src/lib/auth.ts +175 -0
- package/src/lib/cookie.ts +421 -0
- package/src/lib/env.ts +93 -0
- package/src/lib/hexclave-app/api-keys/index.ts +73 -0
- package/src/lib/hexclave-app/apps/implementations/admin-app-impl.ts +1261 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.cross-domain.test.ts +141 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.oauth-prefetch.test.ts +36 -0
- package/src/lib/hexclave-app/apps/implementations/client-app-impl.ts +3912 -0
- package/src/lib/hexclave-app/apps/implementations/common.ts +244 -0
- package/src/lib/hexclave-app/apps/implementations/event-tracker.test.ts +105 -0
- package/src/lib/hexclave-app/apps/implementations/event-tracker.ts +306 -0
- package/src/lib/hexclave-app/apps/implementations/index.ts +35 -0
- package/src/lib/hexclave-app/apps/implementations/redirect-page-urls.ts +342 -0
- package/src/lib/hexclave-app/apps/implementations/server-app-impl.ts +1619 -0
- package/src/lib/hexclave-app/apps/implementations/session-refresh-subscription.test.ts +106 -0
- package/src/lib/hexclave-app/apps/implementations/session-refresh-subscription.ts +52 -0
- package/src/lib/hexclave-app/apps/implementations/session-replay.test.ts +33 -0
- package/src/lib/hexclave-app/apps/implementations/session-replay.ts +356 -0
- package/src/lib/hexclave-app/apps/index.ts +40 -0
- package/src/lib/hexclave-app/apps/interfaces/admin-app.ts +192 -0
- package/src/lib/hexclave-app/apps/interfaces/client-app.ts +180 -0
- package/src/lib/hexclave-app/apps/interfaces/server-app.ts +129 -0
- package/src/lib/hexclave-app/common.ts +216 -0
- package/src/lib/hexclave-app/connected-accounts/index.ts +49 -0
- package/src/lib/hexclave-app/contact-channels/index.ts +80 -0
- package/src/lib/hexclave-app/customers/index.ts +158 -0
- package/src/lib/hexclave-app/data-vault/index.ts +12 -0
- package/src/lib/hexclave-app/email/index.ts +280 -0
- package/src/lib/hexclave-app/email-templates/index.ts +24 -0
- package/src/lib/hexclave-app/index.ts +146 -0
- package/src/lib/hexclave-app/internal-api-keys/index.ts +55 -0
- package/src/lib/hexclave-app/notification-categories/index.ts +12 -0
- package/src/lib/hexclave-app/permissions/index.ts +75 -0
- package/src/lib/hexclave-app/project-configs/index.ts +103 -0
- package/src/lib/hexclave-app/projects/index.ts +236 -0
- package/src/lib/hexclave-app/session-replays/index.ts +72 -0
- package/src/lib/hexclave-app/teams/index.ts +206 -0
- package/src/lib/hexclave-app/url-targets.test.ts +253 -0
- package/src/lib/hexclave-app/url-targets.ts +395 -0
- package/src/lib/hexclave-app/users/index.ts +523 -0
- package/src/lib/hooks.tsx +63 -0
- package/src/lib/translations.tsx +23 -0
- package/src/providers/hexclave-context.tsx +20 -0
- package/src/providers/hexclave-provider-client.tsx +39 -0
- package/src/providers/hexclave-provider.tsx +48 -0
- package/src/providers/theme-provider.tsx +121 -0
- package/src/providers/translation-provider-client.tsx +35 -0
- package/src/providers/translation-provider.tsx +25 -0
- package/src/tanstack-start-server-context.d.ts +13 -0
- package/src/utils/browser-script.tsx +135 -0
- package/src/utils/constants.tsx +58 -0
- package/src/utils/url.ts +24 -0
- package/dist/components-page/stack-handler-client.d.ts.map +0 -1
- package/dist/components-page/stack-handler-client.js.map +0 -1
- package/dist/components-page/stack-handler.d.ts.map +0 -1
- package/dist/components-page/stack-handler.js.map +0 -1
- package/dist/esm/components-page/stack-handler-client.d.ts.map +0 -1
- package/dist/esm/components-page/stack-handler-client.js.map +0 -1
- package/dist/esm/components-page/stack-handler.d.ts.map +0 -1
- package/dist/esm/components-page/stack-handler.js.map +0 -1
- package/dist/esm/lib/stack-app/api-keys/index.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/admin-app-impl.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/common.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/event-tracker.test.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/index.d.ts +0 -9
- package/dist/esm/lib/stack-app/apps/implementations/index.d.ts.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/index.js +0 -27
- package/dist/esm/lib/stack-app/apps/implementations/index.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/redirect-page-urls.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/server-app-impl.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-refresh-subscription.test.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/implementations/session-replay.test.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/interfaces/admin-app.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/interfaces/client-app.js.map +0 -1
- package/dist/esm/lib/stack-app/apps/interfaces/server-app.js.map +0 -1
- package/dist/esm/lib/stack-app/common.js +0 -7
- package/dist/esm/lib/stack-app/common.js.map +0 -1
- package/dist/esm/lib/stack-app/contact-channels/index.js.map +0 -1
- package/dist/esm/lib/stack-app/email-templates/index.js.map +0 -1
- package/dist/esm/lib/stack-app/internal-api-keys/index.js.map +0 -1
- package/dist/esm/lib/stack-app/permissions/index.js.map +0 -1
- package/dist/esm/lib/stack-app/projects/index.js.map +0 -1
- package/dist/esm/lib/stack-app/teams/index.js.map +0 -1
- package/dist/esm/lib/stack-app/url-targets.js.map +0 -1
- package/dist/esm/lib/stack-app/url-targets.test.js.map +0 -1
- package/dist/esm/lib/stack-app/users/index.js.map +0 -1
- package/dist/esm/providers/stack-context.d.ts +0 -11
- package/dist/esm/providers/stack-context.d.ts.map +0 -1
- package/dist/esm/providers/stack-context.js +0 -12
- package/dist/esm/providers/stack-context.js.map +0 -1
- package/dist/esm/providers/stack-provider-client.d.ts.map +0 -1
- package/dist/esm/providers/stack-provider-client.js +0 -30
- package/dist/esm/providers/stack-provider-client.js.map +0 -1
- package/dist/esm/providers/stack-provider.d.ts.map +0 -1
- package/dist/esm/providers/stack-provider.js.map +0 -1
- package/dist/lib/stack-app/api-keys/index.d.ts.map +0 -1
- package/dist/lib/stack-app/api-keys/index.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/admin-app-impl.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.cross-domain.test.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/client-app-impl.oauth-prefetch.test.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/common.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/common.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/event-tracker.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/event-tracker.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/event-tracker.test.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/index.d.ts +0 -9
- package/dist/lib/stack-app/apps/implementations/index.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/index.js +0 -31
- package/dist/lib/stack-app/apps/implementations/index.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/redirect-page-urls.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/server-app-impl.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-refresh-subscription.test.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-replay.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-replay.js.map +0 -1
- package/dist/lib/stack-app/apps/implementations/session-replay.test.js.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/admin-app.js.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/client-app.js.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.d.ts.map +0 -1
- package/dist/lib/stack-app/apps/interfaces/server-app.js.map +0 -1
- package/dist/lib/stack-app/common.d.ts.map +0 -1
- package/dist/lib/stack-app/common.js +0 -9
- package/dist/lib/stack-app/common.js.map +0 -1
- package/dist/lib/stack-app/connected-accounts/index.d.ts.map +0 -1
- package/dist/lib/stack-app/contact-channels/index.d.ts.map +0 -1
- package/dist/lib/stack-app/contact-channels/index.js.map +0 -1
- package/dist/lib/stack-app/customers/index.d.ts.map +0 -1
- package/dist/lib/stack-app/data-vault/index.d.ts.map +0 -1
- package/dist/lib/stack-app/email/index.d.ts.map +0 -1
- package/dist/lib/stack-app/email-templates/index.d.ts.map +0 -1
- package/dist/lib/stack-app/email-templates/index.js.map +0 -1
- package/dist/lib/stack-app/internal-api-keys/index.d.ts.map +0 -1
- package/dist/lib/stack-app/internal-api-keys/index.js.map +0 -1
- package/dist/lib/stack-app/notification-categories/index.d.ts.map +0 -1
- package/dist/lib/stack-app/permissions/index.d.ts.map +0 -1
- package/dist/lib/stack-app/permissions/index.js.map +0 -1
- package/dist/lib/stack-app/project-configs/index.d.ts.map +0 -1
- package/dist/lib/stack-app/projects/index.d.ts.map +0 -1
- package/dist/lib/stack-app/projects/index.js.map +0 -1
- package/dist/lib/stack-app/session-replays/index.d.ts.map +0 -1
- package/dist/lib/stack-app/teams/index.d.ts.map +0 -1
- package/dist/lib/stack-app/teams/index.js.map +0 -1
- package/dist/lib/stack-app/url-targets.d.ts.map +0 -1
- package/dist/lib/stack-app/url-targets.js.map +0 -1
- package/dist/lib/stack-app/url-targets.test.js.map +0 -1
- package/dist/lib/stack-app/users/index.d.ts.map +0 -1
- package/dist/lib/stack-app/users/index.js.map +0 -1
- package/dist/providers/stack-context.d.ts +0 -11
- package/dist/providers/stack-context.d.ts.map +0 -1
- package/dist/providers/stack-context.js +0 -15
- package/dist/providers/stack-context.js.map +0 -1
- package/dist/providers/stack-provider-client.d.ts.map +0 -1
- package/dist/providers/stack-provider-client.js.map +0 -1
- package/dist/providers/stack-provider.d.ts.map +0 -1
- package/dist/providers/stack-provider.js.map +0 -1
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.cross-domain.test.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.oauth-prefetch.test.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.test.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.test.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.test.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/index.d.ts +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/apps/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/connected-accounts/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/customers/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/data-vault/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/email/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/notification-categories/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/project-configs/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/session-replays/index.js +0 -0
- /package/dist/esm/lib/{stack-app → hexclave-app}/url-targets.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.cross-domain.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/implementations/client-app-impl.oauth-prefetch.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/implementations/event-tracker.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-refresh-subscription.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/implementations/session-replay.test.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/index.d.ts +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/apps/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/connected-accounts/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/customers/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/data-vault/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/email/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/notification-categories/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/project-configs/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/session-replays/index.js +0 -0
- /package/dist/lib/{stack-app → hexclave-app}/url-targets.test.d.ts +0 -0
|
@@ -0,0 +1,1261 @@
|
|
|
1
|
+
|
|
2
|
+
//===========================================
|
|
3
|
+
// THIS FILE IS AUTO-GENERATED FROM TEMPLATE. DO NOT EDIT IT DIRECTLY UNLESS YOU ALSO EDIT THE CORRESPONDING FILE IN packages/template
|
|
4
|
+
//===========================================
|
|
5
|
+
import { KnownErrors, HexclaveAdminInterface } from "@hexclave/shared";
|
|
6
|
+
import { getProductionModeErrors } from "@hexclave/shared/dist/helpers/production-mode";
|
|
7
|
+
import { InternalApiKeyCreateCrudResponse } from "@hexclave/shared/dist/interface/admin-interface";
|
|
8
|
+
import type { MetricsResponse, MetricsUserCounts, UserActivityResponse } from "@hexclave/shared/dist/interface/admin-metrics";
|
|
9
|
+
import { AnalyticsQueryOptions, AnalyticsQueryResponse } from "@hexclave/shared/dist/interface/crud/analytics";
|
|
10
|
+
import { EmailTemplateCrud } from "@hexclave/shared/dist/interface/crud/email-templates";
|
|
11
|
+
import { InternalApiKeysCrud } from "@hexclave/shared/dist/interface/crud/internal-api-keys";
|
|
12
|
+
import { ProjectsCrud } from "@hexclave/shared/dist/interface/crud/projects";
|
|
13
|
+
import type { AdminGetSessionReplayChunkEventsResponse } from "@hexclave/shared/dist/interface/crud/session-replays";
|
|
14
|
+
import type { Transaction, TransactionType } from "@hexclave/shared/dist/interface/crud/transactions";
|
|
15
|
+
import type { RestrictedReason } from "@hexclave/shared/dist/schema-fields";
|
|
16
|
+
import type { MoneyAmount } from "@hexclave/shared/dist/utils/currency-constants";
|
|
17
|
+
import { HexclaveAssertionError, throwErr } from "@hexclave/shared/dist/utils/errors";
|
|
18
|
+
import type { Json } from "@hexclave/shared/dist/utils/json";
|
|
19
|
+
import { pick, typedEntries, typedValues } from "@hexclave/shared/dist/utils/objects";
|
|
20
|
+
import { Result } from "@hexclave/shared/dist/utils/results";
|
|
21
|
+
import { useMemo } from "react"; // THIS_LINE_PLATFORM react-like
|
|
22
|
+
import { AdminEmailOutbox, AdminSentEmail } from "../..";
|
|
23
|
+
import { EmailConfig, hexclaveAppInternalsSymbol } from "../../common";
|
|
24
|
+
import { AdminEmailTemplate } from "../../email-templates";
|
|
25
|
+
import { InternalApiKey, InternalApiKeyBase, InternalApiKeyBaseCrudRead, InternalApiKeyCreateOptions, InternalApiKeyFirstView, internalApiKeyCreateOptionsToCrud } from "../../internal-api-keys";
|
|
26
|
+
import { AdminProjectPermission, AdminProjectPermissionDefinition, AdminProjectPermissionDefinitionCreateOptions, AdminProjectPermissionDefinitionUpdateOptions, AdminTeamPermission, AdminTeamPermissionDefinition, AdminTeamPermissionDefinitionCreateOptions, AdminTeamPermissionDefinitionUpdateOptions, adminProjectPermissionDefinitionCreateOptionsToCrud, adminProjectPermissionDefinitionUpdateOptionsToCrud, adminTeamPermissionDefinitionCreateOptionsToCrud, adminTeamPermissionDefinitionUpdateOptionsToCrud } from "../../permissions";
|
|
27
|
+
import { AdminOwnedProject, AdminProject, AdminProjectUpdateOptions, PushConfigOptions, adminProjectUpdateOptionsToCrud } from "../../projects";
|
|
28
|
+
import type { AdminSessionReplay, AdminSessionReplayChunk, ListSessionReplayChunksOptions, ListSessionReplayChunksResult, ListSessionReplaysOptions, ListSessionReplaysResult, SessionReplayAllEventsResult } from "../../session-replays";
|
|
29
|
+
import { ManagedEmailProviderListItem, ManagedEmailProviderSetupResult, ManagedEmailProviderStatus, EmailOutboxUpdateOptions, StackAdminApp, StackAdminAppConstructorOptions } from "../interfaces/admin-app";
|
|
30
|
+
import { clientVersion, createCache, getDefaultExtraRequestHeaders, getDefaultProjectId, getDefaultPublishableClientKey, getDefaultSecretServerKey, getDefaultSuperSecretAdminKey, resolveApiUrls, resolveConstructorOptions } from "./common";
|
|
31
|
+
import { _HexclaveServerAppImplIncomplete } from "./server-app-impl";
|
|
32
|
+
|
|
33
|
+
import { CompleteConfig, EnvironmentConfigOverrideOverride } from "@hexclave/shared/dist/config/schema";
|
|
34
|
+
import { branchConfigSourceSchema } from "@hexclave/shared/dist/schema-fields";
|
|
35
|
+
import * as yup from "yup";
|
|
36
|
+
import { PushedConfigSource } from "../../projects";
|
|
37
|
+
import { useAsyncCache } from "./common"; // THIS_LINE_PLATFORM react-like
|
|
38
|
+
|
|
39
|
+
type BranchConfigSourceApi = yup.InferType<typeof branchConfigSourceSchema>;
|
|
40
|
+
/**
|
|
41
|
+
* Converts a PushedConfigSource (SDK camelCase) to BranchConfigSourceApi (API snake_case).
|
|
42
|
+
*/
|
|
43
|
+
function pushedConfigSourceToApi(source: PushedConfigSource): BranchConfigSourceApi {
|
|
44
|
+
if (source.type === "pushed-from-github") {
|
|
45
|
+
return {
|
|
46
|
+
type: "pushed-from-github",
|
|
47
|
+
owner: source.owner,
|
|
48
|
+
repo: source.repo,
|
|
49
|
+
branch: source.branch,
|
|
50
|
+
commit_hash: source.commitHash,
|
|
51
|
+
config_file_path: source.configFilePath,
|
|
52
|
+
workflow_path: source.workflowPath,
|
|
53
|
+
};
|
|
54
|
+
}
|
|
55
|
+
return source;
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
/**
|
|
59
|
+
* Converts a BranchConfigSourceApi (API snake_case) to PushedConfigSource (SDK camelCase).
|
|
60
|
+
*/
|
|
61
|
+
function apiToPushedConfigSource(source: BranchConfigSourceApi): PushedConfigSource {
|
|
62
|
+
if (source.type === "pushed-from-github") {
|
|
63
|
+
return {
|
|
64
|
+
type: "pushed-from-github",
|
|
65
|
+
owner: source.owner,
|
|
66
|
+
repo: source.repo,
|
|
67
|
+
branch: source.branch,
|
|
68
|
+
commitHash: source.commit_hash,
|
|
69
|
+
configFilePath: source.config_file_path,
|
|
70
|
+
workflowPath: source.workflow_path,
|
|
71
|
+
};
|
|
72
|
+
}
|
|
73
|
+
return source;
|
|
74
|
+
}
|
|
75
|
+
|
|
76
|
+
export class _HexclaveAdminAppImplIncomplete<HasTokenStore extends boolean, ProjectId extends string> extends _HexclaveServerAppImplIncomplete<HasTokenStore, ProjectId> implements StackAdminApp<HasTokenStore, ProjectId> {
|
|
77
|
+
declare protected _interface: HexclaveAdminInterface;
|
|
78
|
+
|
|
79
|
+
private readonly _adminProjectCache = createCache(async () => {
|
|
80
|
+
return await this._interface.getProject();
|
|
81
|
+
});
|
|
82
|
+
private readonly _internalApiKeysCache = createCache(async () => {
|
|
83
|
+
const res = await this._interface.listInternalApiKeys();
|
|
84
|
+
return res;
|
|
85
|
+
});
|
|
86
|
+
private readonly _adminEmailThemeCache = createCache(async ([id]: [string]) => {
|
|
87
|
+
return await this._interface.getEmailTheme(id);
|
|
88
|
+
});
|
|
89
|
+
private readonly _adminEmailThemesCache = createCache(async () => {
|
|
90
|
+
return await this._interface.listEmailThemes();
|
|
91
|
+
});
|
|
92
|
+
private readonly _adminEmailTemplatesCache = createCache(async () => {
|
|
93
|
+
return await this._interface.listInternalEmailTemplates();
|
|
94
|
+
});
|
|
95
|
+
private readonly _adminEmailDraftsCache = createCache(async () => {
|
|
96
|
+
return await this._interface.listInternalEmailDrafts();
|
|
97
|
+
});
|
|
98
|
+
private readonly _adminTeamPermissionDefinitionsCache = createCache(async () => {
|
|
99
|
+
return await this._interface.listTeamPermissionDefinitions();
|
|
100
|
+
});
|
|
101
|
+
private readonly _adminProjectPermissionDefinitionsCache = createCache(async () => {
|
|
102
|
+
return await this._interface.listProjectPermissionDefinitions();
|
|
103
|
+
});
|
|
104
|
+
private readonly _svixTokenCache = createCache(async () => {
|
|
105
|
+
return await this._interface.getSvixToken();
|
|
106
|
+
});
|
|
107
|
+
private readonly _metricsCache = createCache(async ([includeAnonymous]: [boolean]) => {
|
|
108
|
+
return await this._interface.getMetrics(includeAnonymous);
|
|
109
|
+
});
|
|
110
|
+
private readonly _userActivityCache = createCache(async ([userId]: [string]) => {
|
|
111
|
+
return await this._interface.getUserActivity(userId);
|
|
112
|
+
});
|
|
113
|
+
private readonly _metricsUserCountsCache = createCache(async () => {
|
|
114
|
+
return await this._interface.getMetricsUserCounts();
|
|
115
|
+
});
|
|
116
|
+
private readonly _emailPreviewCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined]) => {
|
|
117
|
+
return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource });
|
|
118
|
+
});
|
|
119
|
+
private readonly _emailPreviewWithEditableMarkersCache = createCache(async ([themeId, themeTsxSource, templateId, templateTsxSource, editableSource]: [string | null | false | undefined, string | undefined, string | undefined, string | undefined, 'template' | 'theme' | 'both' | undefined]) => {
|
|
120
|
+
return await this._interface.renderEmailPreview({ themeId, themeTsxSource, templateId, templateTsxSource, editableMarkers: true, editableSource });
|
|
121
|
+
});
|
|
122
|
+
private readonly _configOverridesCache = createCache(async () => {
|
|
123
|
+
return await this._interface.getConfig();
|
|
124
|
+
});
|
|
125
|
+
private readonly _stripeAccountInfoCache = createCache(async () => {
|
|
126
|
+
try {
|
|
127
|
+
return await this._interface.getStripeAccountInfo();
|
|
128
|
+
} catch (error: any) {
|
|
129
|
+
if (error?.status === 404) {
|
|
130
|
+
return null;
|
|
131
|
+
}
|
|
132
|
+
throw error;
|
|
133
|
+
}
|
|
134
|
+
});
|
|
135
|
+
private readonly _transactionsCache = createCache(async ([cursor, limit, type, customerType, customerId]: [string | undefined, number | undefined, TransactionType | undefined, 'user' | 'team' | 'custom' | undefined, string | undefined]) => {
|
|
136
|
+
return await this._interface.listTransactions({ cursor, limit, type, customerType, customerId });
|
|
137
|
+
});
|
|
138
|
+
|
|
139
|
+
constructor(options: StackAdminAppConstructorOptions<HasTokenStore, ProjectId>, extraOptions?: { uniqueIdentifier?: string, checkString?: string, interface?: HexclaveAdminInterface }) {
|
|
140
|
+
const resolvedOptions = resolveConstructorOptions(options);
|
|
141
|
+
|
|
142
|
+
const publishableClientKey = resolvedOptions.publishableClientKey ?? getDefaultPublishableClientKey();
|
|
143
|
+
|
|
144
|
+
super(resolvedOptions, {
|
|
145
|
+
...extraOptions,
|
|
146
|
+
interface: extraOptions?.interface ?? (() => {
|
|
147
|
+
const apiUrls = resolveApiUrls(resolvedOptions.baseUrl);
|
|
148
|
+
return new HexclaveAdminInterface({
|
|
149
|
+
getBaseUrl: () => apiUrls()[0],
|
|
150
|
+
getApiUrls: apiUrls,
|
|
151
|
+
projectId: resolvedOptions.projectId ?? getDefaultProjectId(),
|
|
152
|
+
extraRequestHeaders: resolvedOptions.extraRequestHeaders ?? getDefaultExtraRequestHeaders(),
|
|
153
|
+
clientVersion,
|
|
154
|
+
...resolvedOptions.projectOwnerSession ? {
|
|
155
|
+
projectOwnerSession: resolvedOptions.projectOwnerSession,
|
|
156
|
+
} : {
|
|
157
|
+
...(publishableClientKey ? { publishableClientKey } : {}),
|
|
158
|
+
secretServerKey: resolvedOptions.secretServerKey ?? getDefaultSecretServerKey(),
|
|
159
|
+
superSecretAdminKey: resolvedOptions.superSecretAdminKey ?? getDefaultSuperSecretAdminKey(),
|
|
160
|
+
},
|
|
161
|
+
});
|
|
162
|
+
})(),
|
|
163
|
+
});
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
_adminConfigFromCrud(data: { config_string: string }): CompleteConfig {
|
|
167
|
+
return JSON.parse(data.config_string);
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
_adminOwnedProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminOwnedProject {
|
|
171
|
+
if (this._tokenStoreInit !== null) {
|
|
172
|
+
throw new HexclaveAssertionError("Owned apps must always have tokenStore === null — did you not create this project with app._createOwnedApp()?");
|
|
173
|
+
}
|
|
174
|
+
return {
|
|
175
|
+
...this._adminProjectFromCrud(data, onRefresh),
|
|
176
|
+
app: this as StackAdminApp<false>,
|
|
177
|
+
};
|
|
178
|
+
}
|
|
179
|
+
|
|
180
|
+
_adminProjectFromCrud(data: ProjectsCrud['Admin']['Read'], onRefresh: () => Promise<void>): AdminProject {
|
|
181
|
+
if (data.id !== this.projectId) {
|
|
182
|
+
throw new HexclaveAssertionError(`The project ID of the provided project JSON (${data.id}) does not match the project ID of the app (${this.projectId})!`);
|
|
183
|
+
}
|
|
184
|
+
|
|
185
|
+
const app = this;
|
|
186
|
+
return {
|
|
187
|
+
id: data.id,
|
|
188
|
+
displayName: data.display_name,
|
|
189
|
+
description: data.description,
|
|
190
|
+
createdAt: new Date(data.created_at_millis),
|
|
191
|
+
isProductionMode: data.is_production_mode,
|
|
192
|
+
isDevelopmentEnvironment: data.is_development_environment,
|
|
193
|
+
ownerTeamId: data.owner_team_id,
|
|
194
|
+
onboardingStatus: data.onboarding_status,
|
|
195
|
+
logoUrl: data.logo_url,
|
|
196
|
+
logoFullUrl: data.logo_full_url,
|
|
197
|
+
logoDarkModeUrl: data.logo_dark_mode_url,
|
|
198
|
+
logoFullDarkModeUrl: data.logo_full_dark_mode_url,
|
|
199
|
+
config: {
|
|
200
|
+
signUpEnabled: data.config.sign_up_enabled,
|
|
201
|
+
credentialEnabled: data.config.credential_enabled,
|
|
202
|
+
magicLinkEnabled: data.config.magic_link_enabled,
|
|
203
|
+
passkeyEnabled: data.config.passkey_enabled,
|
|
204
|
+
clientTeamCreationEnabled: data.config.client_team_creation_enabled,
|
|
205
|
+
clientUserDeletionEnabled: data.config.client_user_deletion_enabled,
|
|
206
|
+
allowLocalhost: data.config.allow_localhost,
|
|
207
|
+
oauthAccountMergeStrategy: data.config.oauth_account_merge_strategy,
|
|
208
|
+
allowUserApiKeys: data.config.allow_user_api_keys,
|
|
209
|
+
allowTeamApiKeys: data.config.allow_team_api_keys,
|
|
210
|
+
oauthProviders: data.config.oauth_providers.map((p) => ((p.type === 'shared' ? {
|
|
211
|
+
id: p.id,
|
|
212
|
+
type: 'shared',
|
|
213
|
+
} as const : {
|
|
214
|
+
id: p.id,
|
|
215
|
+
type: 'standard',
|
|
216
|
+
clientId: p.client_id ?? throwErr("Client ID is missing"),
|
|
217
|
+
clientSecret: p.client_secret ?? throwErr("Client secret is missing"),
|
|
218
|
+
facebookConfigId: p.facebook_config_id,
|
|
219
|
+
microsoftTenantId: p.microsoft_tenant_id,
|
|
220
|
+
appleBundleIds: p.apple_bundle_ids,
|
|
221
|
+
} as const))),
|
|
222
|
+
emailConfig: data.config.email_config.type === 'shared' ? {
|
|
223
|
+
type: 'shared'
|
|
224
|
+
} : {
|
|
225
|
+
type: 'standard',
|
|
226
|
+
host: data.config.email_config.host ?? throwErr("Email host is missing"),
|
|
227
|
+
port: data.config.email_config.port ?? throwErr("Email port is missing"),
|
|
228
|
+
username: data.config.email_config.username ?? throwErr("Email username is missing"),
|
|
229
|
+
password: data.config.email_config.password ?? throwErr("Email password is missing"),
|
|
230
|
+
senderName: data.config.email_config.sender_name ?? throwErr("Email sender name is missing"),
|
|
231
|
+
senderEmail: data.config.email_config.sender_email ?? throwErr("Email sender email is missing"),
|
|
232
|
+
},
|
|
233
|
+
emailTheme: data.config.email_theme,
|
|
234
|
+
domains: data.config.domains.map((d) => ({
|
|
235
|
+
domain: d.domain,
|
|
236
|
+
handlerPath: d.handler_path,
|
|
237
|
+
})),
|
|
238
|
+
createTeamOnSignUp: data.config.create_team_on_sign_up,
|
|
239
|
+
teamCreatorDefaultPermissions: data.config.team_creator_default_permissions,
|
|
240
|
+
teamMemberDefaultPermissions: data.config.team_member_default_permissions,
|
|
241
|
+
userDefaultPermissions: data.config.user_default_permissions,
|
|
242
|
+
},
|
|
243
|
+
async getConfig() {
|
|
244
|
+
return app._adminConfigFromCrud(await app._interface.getConfig());
|
|
245
|
+
},
|
|
246
|
+
useConfig() {
|
|
247
|
+
const config = useAsyncCache(app._configOverridesCache, [], "project.useConfig()");
|
|
248
|
+
return useMemo(() => app._adminConfigFromCrud(config), [config]);
|
|
249
|
+
},
|
|
250
|
+
async updateConfig(configOverride: EnvironmentConfigOverrideOverride) {
|
|
251
|
+
await app._interface.updateConfigOverride("environment", configOverride);
|
|
252
|
+
await app._refreshProjectConfig();
|
|
253
|
+
},
|
|
254
|
+
async pushConfig(config: EnvironmentConfigOverrideOverride, options: PushConfigOptions) {
|
|
255
|
+
await app._interface.setConfigOverride("branch", config, pushedConfigSourceToApi(options.source));
|
|
256
|
+
await app._refreshProjectConfig();
|
|
257
|
+
},
|
|
258
|
+
async updatePushedConfig(config: EnvironmentConfigOverrideOverride) {
|
|
259
|
+
await app._interface.updateConfigOverride("branch", config);
|
|
260
|
+
await app._refreshProjectConfig();
|
|
261
|
+
},
|
|
262
|
+
async getPushedConfigSource(): Promise<PushedConfigSource> {
|
|
263
|
+
const apiSource = await app._interface.getPushedConfigSource();
|
|
264
|
+
return apiToPushedConfigSource(apiSource);
|
|
265
|
+
},
|
|
266
|
+
async unlinkPushedConfigSource(): Promise<void> {
|
|
267
|
+
await app._interface.unlinkPushedConfigSource();
|
|
268
|
+
await app._refreshProjectConfig();
|
|
269
|
+
},
|
|
270
|
+
async resetConfigOverrideKeys(level: "branch" | "environment", keys: string[]): Promise<void> {
|
|
271
|
+
await app._interface.resetConfigOverrideKeys(level, keys);
|
|
272
|
+
await app._refreshProjectConfig();
|
|
273
|
+
},
|
|
274
|
+
async getConfigOverride(level: "branch" | "environment"): Promise<Record<string, unknown>> {
|
|
275
|
+
const result = await app._interface.getConfigOverride(level);
|
|
276
|
+
return JSON.parse(result.config_string);
|
|
277
|
+
},
|
|
278
|
+
async replaceConfigOverride(level: "branch" | "environment", config: Record<string, unknown>): Promise<void> {
|
|
279
|
+
if (level === "branch") {
|
|
280
|
+
const source = await app._interface.getPushedConfigSource();
|
|
281
|
+
await app._interface.setConfigOverride(level, config, source);
|
|
282
|
+
} else {
|
|
283
|
+
await app._interface.setConfigOverride(level, config);
|
|
284
|
+
}
|
|
285
|
+
await app._refreshProjectConfig();
|
|
286
|
+
},
|
|
287
|
+
async update(update: AdminProjectUpdateOptions) {
|
|
288
|
+
const { requirePublishableClientKey, ...projectUpdate } = update;
|
|
289
|
+
const updateOptions = adminProjectUpdateOptionsToCrud(projectUpdate);
|
|
290
|
+
const hasConfigUpdate = !!updateOptions.config
|
|
291
|
+
&& typedValues(updateOptions.config).some((value) => value !== undefined);
|
|
292
|
+
const hasProjectUpdate = typedEntries(updateOptions).some(([key, value]) => {
|
|
293
|
+
if (key === "config") return hasConfigUpdate;
|
|
294
|
+
return value !== undefined;
|
|
295
|
+
});
|
|
296
|
+
|
|
297
|
+
if (hasProjectUpdate) {
|
|
298
|
+
await app._interface.updateProject(updateOptions);
|
|
299
|
+
await onRefresh();
|
|
300
|
+
}
|
|
301
|
+
|
|
302
|
+
if (requirePublishableClientKey !== undefined) {
|
|
303
|
+
await app._interface.updateConfigOverride("project", {
|
|
304
|
+
"project.requirePublishableClientKey": requirePublishableClientKey,
|
|
305
|
+
});
|
|
306
|
+
await app._refreshProjectConfig();
|
|
307
|
+
}
|
|
308
|
+
},
|
|
309
|
+
async delete() {
|
|
310
|
+
await app._interface.deleteProject();
|
|
311
|
+
},
|
|
312
|
+
async getProductionModeErrors() {
|
|
313
|
+
return getProductionModeErrors(data);
|
|
314
|
+
},
|
|
315
|
+
useProductionModeErrors() {
|
|
316
|
+
return getProductionModeErrors(data);
|
|
317
|
+
},
|
|
318
|
+
};
|
|
319
|
+
}
|
|
320
|
+
|
|
321
|
+
_adminEmailTemplateFromCrud(data: EmailTemplateCrud['Admin']['Read']): AdminEmailTemplate {
|
|
322
|
+
return {
|
|
323
|
+
type: data.type,
|
|
324
|
+
subject: data.subject,
|
|
325
|
+
content: data.content,
|
|
326
|
+
isDefault: data.is_default,
|
|
327
|
+
};
|
|
328
|
+
}
|
|
329
|
+
|
|
330
|
+
override async getProject(): Promise<AdminProject> {
|
|
331
|
+
return this._adminProjectFromCrud(
|
|
332
|
+
Result.orThrow(await this._adminProjectCache.getOrWait([], "write-only")),
|
|
333
|
+
() => this._refreshProject()
|
|
334
|
+
);
|
|
335
|
+
}
|
|
336
|
+
|
|
337
|
+
override useProject(): AdminProject {
|
|
338
|
+
const crud = useAsyncCache(this._adminProjectCache, [], "adminApp.useProject()");
|
|
339
|
+
return useMemo(() => this._adminProjectFromCrud(
|
|
340
|
+
crud,
|
|
341
|
+
() => this._refreshProject()
|
|
342
|
+
), [crud]);
|
|
343
|
+
}
|
|
344
|
+
|
|
345
|
+
protected _createInternalApiKeyBaseFromCrud(data: InternalApiKeyBaseCrudRead): InternalApiKeyBase {
|
|
346
|
+
const app = this;
|
|
347
|
+
return {
|
|
348
|
+
id: data.id,
|
|
349
|
+
description: data.description,
|
|
350
|
+
expiresAt: new Date(data.expires_at_millis),
|
|
351
|
+
manuallyRevokedAt: data.manually_revoked_at_millis ? new Date(data.manually_revoked_at_millis) : null,
|
|
352
|
+
createdAt: new Date(data.created_at_millis),
|
|
353
|
+
isValid() {
|
|
354
|
+
return this.whyInvalid() === null;
|
|
355
|
+
},
|
|
356
|
+
whyInvalid() {
|
|
357
|
+
if (this.expiresAt.getTime() < Date.now()) return "expired";
|
|
358
|
+
if (this.manuallyRevokedAt) return "manually-revoked";
|
|
359
|
+
return null;
|
|
360
|
+
},
|
|
361
|
+
async revoke() {
|
|
362
|
+
const res = await app._interface.revokeInternalApiKeyById(data.id);
|
|
363
|
+
await app._refreshInternalApiKeys();
|
|
364
|
+
return res;
|
|
365
|
+
}
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
protected _createInternalApiKeyFromCrud(data: InternalApiKeysCrud["Admin"]["Read"]): InternalApiKey {
|
|
370
|
+
return {
|
|
371
|
+
...this._createInternalApiKeyBaseFromCrud(data),
|
|
372
|
+
publishableClientKey: data.publishable_client_key ? { lastFour: data.publishable_client_key.last_four } : null,
|
|
373
|
+
secretServerKey: data.secret_server_key ? { lastFour: data.secret_server_key.last_four } : null,
|
|
374
|
+
superSecretAdminKey: data.super_secret_admin_key ? { lastFour: data.super_secret_admin_key.last_four } : null,
|
|
375
|
+
};
|
|
376
|
+
}
|
|
377
|
+
|
|
378
|
+
protected _createInternalApiKeyFirstViewFromCrud(data: InternalApiKeyCreateCrudResponse): InternalApiKeyFirstView {
|
|
379
|
+
return {
|
|
380
|
+
...this._createInternalApiKeyBaseFromCrud(data),
|
|
381
|
+
publishableClientKey: data.publishable_client_key,
|
|
382
|
+
secretServerKey: data.secret_server_key,
|
|
383
|
+
superSecretAdminKey: data.super_secret_admin_key,
|
|
384
|
+
};
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
async listInternalApiKeys(): Promise<InternalApiKey[]> {
|
|
388
|
+
const crud = Result.orThrow(await this._internalApiKeysCache.getOrWait([], "write-only"));
|
|
389
|
+
return crud.map((j) => this._createInternalApiKeyFromCrud(j));
|
|
390
|
+
}
|
|
391
|
+
|
|
392
|
+
useInternalApiKeys(): InternalApiKey[] {
|
|
393
|
+
const crud = useAsyncCache(this._internalApiKeysCache, [], "adminApp.useInternalApiKeys()");
|
|
394
|
+
return useMemo(() => {
|
|
395
|
+
return crud.map((j) => this._createInternalApiKeyFromCrud(j));
|
|
396
|
+
}, [crud]);
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
async createInternalApiKey(options: InternalApiKeyCreateOptions): Promise<InternalApiKeyFirstView> {
|
|
400
|
+
const crud = await this._interface.createInternalApiKey(internalApiKeyCreateOptionsToCrud(options));
|
|
401
|
+
await this._refreshInternalApiKeys();
|
|
402
|
+
return this._createInternalApiKeyFirstViewFromCrud(crud);
|
|
403
|
+
}
|
|
404
|
+
|
|
405
|
+
|
|
406
|
+
useEmailThemes(): { id: string, displayName: string }[] {
|
|
407
|
+
const crud = useAsyncCache(this._adminEmailThemesCache, [], "adminApp.useEmailThemes()");
|
|
408
|
+
return useMemo(() => {
|
|
409
|
+
return crud.map((theme) => ({
|
|
410
|
+
id: theme.id,
|
|
411
|
+
displayName: theme.display_name,
|
|
412
|
+
}));
|
|
413
|
+
}, [crud]);
|
|
414
|
+
}
|
|
415
|
+
useEmailTemplates(): { id: string, displayName: string, themeId?: string, tsxSource: string }[] {
|
|
416
|
+
const crud = useAsyncCache(this._adminEmailTemplatesCache, [], "adminApp.useEmailTemplates()");
|
|
417
|
+
return useMemo(() => {
|
|
418
|
+
return crud.map((template) => ({
|
|
419
|
+
id: template.id,
|
|
420
|
+
displayName: template.display_name,
|
|
421
|
+
themeId: template.theme_id,
|
|
422
|
+
tsxSource: template.tsx_source,
|
|
423
|
+
}));
|
|
424
|
+
}, [crud]);
|
|
425
|
+
}
|
|
426
|
+
useEmailDrafts(): { id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[] {
|
|
427
|
+
const crud = useAsyncCache(this._adminEmailDraftsCache, [], "adminApp.useEmailDrafts()");
|
|
428
|
+
return useMemo(() => {
|
|
429
|
+
return crud.map((draft) => ({
|
|
430
|
+
id: draft.id,
|
|
431
|
+
displayName: draft.display_name,
|
|
432
|
+
themeId: draft.theme_id,
|
|
433
|
+
tsxSource: draft.tsx_source,
|
|
434
|
+
sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,
|
|
435
|
+
}));
|
|
436
|
+
}, [crud]);
|
|
437
|
+
}
|
|
438
|
+
async listEmailThemes(): Promise<{ id: string, displayName: string }[]> {
|
|
439
|
+
const crud = Result.orThrow(await this._adminEmailThemesCache.getOrWait([], "write-only"));
|
|
440
|
+
return crud.map((theme) => ({
|
|
441
|
+
id: theme.id,
|
|
442
|
+
displayName: theme.display_name,
|
|
443
|
+
}));
|
|
444
|
+
}
|
|
445
|
+
|
|
446
|
+
async listEmailTemplates(): Promise<{ id: string, displayName: string, themeId?: string, tsxSource: string }[]> {
|
|
447
|
+
const crud = Result.orThrow(await this._adminEmailTemplatesCache.getOrWait([], "write-only"));
|
|
448
|
+
return crud.map((template) => ({
|
|
449
|
+
id: template.id,
|
|
450
|
+
displayName: template.display_name,
|
|
451
|
+
themeId: template.theme_id,
|
|
452
|
+
tsxSource: template.tsx_source,
|
|
453
|
+
}));
|
|
454
|
+
}
|
|
455
|
+
|
|
456
|
+
async listEmailDrafts(): Promise<{ id: string, displayName: string, themeId: string | undefined | false, tsxSource: string, sentAt: Date | null }[]> {
|
|
457
|
+
const crud = Result.orThrow(await this._adminEmailDraftsCache.getOrWait([], "write-only"));
|
|
458
|
+
return crud.map((draft) => ({
|
|
459
|
+
id: draft.id,
|
|
460
|
+
displayName: draft.display_name,
|
|
461
|
+
themeId: draft.theme_id,
|
|
462
|
+
tsxSource: draft.tsx_source,
|
|
463
|
+
sentAt: draft.sent_at_millis ? new Date(draft.sent_at_millis) : null,
|
|
464
|
+
}));
|
|
465
|
+
}
|
|
466
|
+
|
|
467
|
+
|
|
468
|
+
async createTeamPermissionDefinition(data: AdminTeamPermissionDefinitionCreateOptions): Promise<AdminTeamPermission> {
|
|
469
|
+
const crud = await this._interface.createTeamPermissionDefinition(adminTeamPermissionDefinitionCreateOptionsToCrud(data));
|
|
470
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
471
|
+
return this._serverTeamPermissionDefinitionFromCrud(crud);
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
async updateTeamPermissionDefinition(permissionId: string, data: AdminTeamPermissionDefinitionUpdateOptions) {
|
|
475
|
+
await this._interface.updateTeamPermissionDefinition(permissionId, adminTeamPermissionDefinitionUpdateOptionsToCrud(data));
|
|
476
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
477
|
+
}
|
|
478
|
+
|
|
479
|
+
async deleteTeamPermissionDefinition(permissionId: string): Promise<void> {
|
|
480
|
+
await this._interface.deleteTeamPermissionDefinition(permissionId);
|
|
481
|
+
await this._adminTeamPermissionDefinitionsCache.refresh([]);
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
async listTeamPermissionDefinitions(): Promise<AdminTeamPermissionDefinition[]> {
|
|
485
|
+
const crud = Result.orThrow(await this._adminTeamPermissionDefinitionsCache.getOrWait([], "write-only"));
|
|
486
|
+
return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));
|
|
487
|
+
}
|
|
488
|
+
|
|
489
|
+
async listTeamPermissionDefinitionsPaginated(
|
|
490
|
+
options: { limit: number, cursor?: string, query?: string },
|
|
491
|
+
): Promise<{ items: AdminTeamPermissionDefinition[], nextCursor: string | null }> {
|
|
492
|
+
const result = await this._interface.listTeamPermissionDefinitionsPaginated(options);
|
|
493
|
+
return {
|
|
494
|
+
items: result.items.map((p) => this._serverTeamPermissionDefinitionFromCrud(p)),
|
|
495
|
+
nextCursor: result.nextCursor,
|
|
496
|
+
};
|
|
497
|
+
}
|
|
498
|
+
|
|
499
|
+
useTeamPermissionDefinitions(): AdminTeamPermissionDefinition[] {
|
|
500
|
+
const crud = useAsyncCache(this._adminTeamPermissionDefinitionsCache, [], "adminApp.useTeamPermissionDefinitions()");
|
|
501
|
+
return useMemo(() => {
|
|
502
|
+
return crud.map((p) => this._serverTeamPermissionDefinitionFromCrud(p));
|
|
503
|
+
}, [crud]);
|
|
504
|
+
}
|
|
505
|
+
|
|
506
|
+
async createProjectPermissionDefinition(data: AdminProjectPermissionDefinitionCreateOptions): Promise<AdminProjectPermission> {
|
|
507
|
+
const crud = await this._interface.createProjectPermissionDefinition(adminProjectPermissionDefinitionCreateOptionsToCrud(data));
|
|
508
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
509
|
+
return this._serverProjectPermissionDefinitionFromCrud(crud);
|
|
510
|
+
}
|
|
511
|
+
|
|
512
|
+
async updateProjectPermissionDefinition(permissionId: string, data: AdminProjectPermissionDefinitionUpdateOptions) {
|
|
513
|
+
await this._interface.updateProjectPermissionDefinition(permissionId, adminProjectPermissionDefinitionUpdateOptionsToCrud(data));
|
|
514
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
515
|
+
}
|
|
516
|
+
|
|
517
|
+
async deleteProjectPermissionDefinition(permissionId: string): Promise<void> {
|
|
518
|
+
await this._interface.deleteProjectPermissionDefinition(permissionId);
|
|
519
|
+
await this._adminProjectPermissionDefinitionsCache.refresh([]);
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
async listProjectPermissionDefinitions(): Promise<AdminProjectPermissionDefinition[]> {
|
|
523
|
+
const crud = Result.orThrow(await this._adminProjectPermissionDefinitionsCache.getOrWait([], "write-only"));
|
|
524
|
+
return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));
|
|
525
|
+
}
|
|
526
|
+
|
|
527
|
+
useProjectPermissionDefinitions(): AdminProjectPermissionDefinition[] {
|
|
528
|
+
const crud = useAsyncCache(this._adminProjectPermissionDefinitionsCache, [], "adminApp.useProjectPermissionDefinitions()");
|
|
529
|
+
return useMemo(() => {
|
|
530
|
+
return crud.map((p) => this._serverProjectPermissionDefinitionFromCrud(p));
|
|
531
|
+
}, [crud]);
|
|
532
|
+
}
|
|
533
|
+
useSvixToken(): { token: string, url: string | undefined } {
|
|
534
|
+
const crud = useAsyncCache(this._svixTokenCache, [], "adminApp.useSvixToken()");
|
|
535
|
+
return { token: crud.token, url: crud.url };
|
|
536
|
+
}
|
|
537
|
+
|
|
538
|
+
protected override async _refreshProject() {
|
|
539
|
+
await Promise.all([
|
|
540
|
+
super._refreshProject(),
|
|
541
|
+
this._adminProjectCache.refresh([]),
|
|
542
|
+
]);
|
|
543
|
+
}
|
|
544
|
+
|
|
545
|
+
protected async _refreshProjectConfig() {
|
|
546
|
+
await Promise.all([
|
|
547
|
+
this._configOverridesCache.refresh([]),
|
|
548
|
+
this._adminProjectCache.refresh([]),
|
|
549
|
+
]);
|
|
550
|
+
}
|
|
551
|
+
|
|
552
|
+
protected async _refreshInternalApiKeys() {
|
|
553
|
+
await this._internalApiKeysCache.refresh([]);
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
protected override async _refreshUsers() {
|
|
557
|
+
await Promise.all([
|
|
558
|
+
super._refreshUsers(),
|
|
559
|
+
this._metricsCache.refresh([false]),
|
|
560
|
+
this._metricsCache.refresh([true]),
|
|
561
|
+
this._metricsUserCountsCache.refresh([]),
|
|
562
|
+
]);
|
|
563
|
+
}
|
|
564
|
+
|
|
565
|
+
get [hexclaveAppInternalsSymbol]() {
|
|
566
|
+
return {
|
|
567
|
+
...super[hexclaveAppInternalsSymbol],
|
|
568
|
+
useMetrics: (includeAnonymous: boolean = false): MetricsResponse => {
|
|
569
|
+
return useAsyncCache(this._metricsCache, [includeAnonymous] as const, "adminApp.useMetrics()") as MetricsResponse;
|
|
570
|
+
},
|
|
571
|
+
useUserActivity: (userId: string): UserActivityResponse => {
|
|
572
|
+
return useAsyncCache(this._userActivityCache, [userId] as const, "adminApp.useUserActivity()") as UserActivityResponse;
|
|
573
|
+
},
|
|
574
|
+
useMetricsUserCounts: (): MetricsUserCounts => {
|
|
575
|
+
return useAsyncCache(this._metricsUserCountsCache, [] as const, "adminApp.useMetricsUserCounts()") as MetricsUserCounts;
|
|
576
|
+
},
|
|
577
|
+
};
|
|
578
|
+
}
|
|
579
|
+
|
|
580
|
+
async sendTestEmail(options: {
|
|
581
|
+
recipientEmail: string,
|
|
582
|
+
emailConfig: EmailConfig,
|
|
583
|
+
}): Promise<Result<undefined, { errorMessage: string }>> {
|
|
584
|
+
let response: { success: boolean, error_message?: string };
|
|
585
|
+
try {
|
|
586
|
+
response = await this._interface.sendTestEmail({
|
|
587
|
+
recipient_email: options.recipientEmail,
|
|
588
|
+
email_config: {
|
|
589
|
+
...(pick(options.emailConfig, ['host', 'port', 'username', 'password'])),
|
|
590
|
+
sender_email: options.emailConfig.senderEmail,
|
|
591
|
+
sender_name: options.emailConfig.senderName,
|
|
592
|
+
},
|
|
593
|
+
});
|
|
594
|
+
} catch (error) {
|
|
595
|
+
// Translate the quota-exhaustion KnownError into the existing
|
|
596
|
+
// Result.error shape so SDK/dashboard callers don't need to branch on
|
|
597
|
+
// exceptions. The backend throws `ItemQuantityInsufficientAmount`
|
|
598
|
+
// (consistent with every other limit-rejection endpoint), but this
|
|
599
|
+
// method's historical contract has always been a `Result`.
|
|
600
|
+
if (error instanceof KnownErrors.ItemQuantityInsufficientAmount) {
|
|
601
|
+
return Result.error({
|
|
602
|
+
errorMessage: "Monthly email sending limit exceeded for your plan. Please upgrade your plan or wait until next month before sending more test emails.",
|
|
603
|
+
});
|
|
604
|
+
}
|
|
605
|
+
throw error;
|
|
606
|
+
}
|
|
607
|
+
|
|
608
|
+
if (response.success) {
|
|
609
|
+
return Result.ok(undefined);
|
|
610
|
+
} else {
|
|
611
|
+
return Result.error({ errorMessage: response.error_message ?? throwErr("Email test error not specified") });
|
|
612
|
+
}
|
|
613
|
+
}
|
|
614
|
+
|
|
615
|
+
async sendTestWebhook(options: { endpointId: string }): Promise<Result<undefined, { errorMessage: string }>> {
|
|
616
|
+
const response = await this._interface.sendTestWebhook({
|
|
617
|
+
endpoint_id: options.endpointId,
|
|
618
|
+
});
|
|
619
|
+
|
|
620
|
+
if (response.success) {
|
|
621
|
+
return Result.ok(undefined);
|
|
622
|
+
} else {
|
|
623
|
+
return Result.error({ errorMessage: response.error_message ?? throwErr("Webhook test error not specified") });
|
|
624
|
+
}
|
|
625
|
+
}
|
|
626
|
+
|
|
627
|
+
async listSentEmails(): Promise<AdminSentEmail[]> {
|
|
628
|
+
const response = await this._interface.listSentEmails();
|
|
629
|
+
return response.items.map((email) => ({
|
|
630
|
+
id: email.id,
|
|
631
|
+
to: email.to ?? [],
|
|
632
|
+
subject: email.subject,
|
|
633
|
+
recipient: email.to?.[0] ?? "",
|
|
634
|
+
sentAt: new Date(email.sent_at_millis),
|
|
635
|
+
error: email.error,
|
|
636
|
+
}));
|
|
637
|
+
}
|
|
638
|
+
|
|
639
|
+
async setupManagedEmailProvider(options: { subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderSetupResult> {
|
|
640
|
+
const response = await this._interface.setupManagedEmailProvider({
|
|
641
|
+
subdomain: options.subdomain,
|
|
642
|
+
sender_local_part: options.senderLocalPart,
|
|
643
|
+
});
|
|
644
|
+
return {
|
|
645
|
+
domainId: response.domain_id,
|
|
646
|
+
subdomain: response.subdomain,
|
|
647
|
+
senderLocalPart: response.sender_local_part,
|
|
648
|
+
nameServerRecords: response.name_server_records,
|
|
649
|
+
status: response.status,
|
|
650
|
+
};
|
|
651
|
+
}
|
|
652
|
+
|
|
653
|
+
async checkManagedEmailStatus(options: { domainId: string, subdomain: string, senderLocalPart: string }): Promise<ManagedEmailProviderStatus> {
|
|
654
|
+
const response = await this._interface.checkManagedEmailStatus({
|
|
655
|
+
domain_id: options.domainId,
|
|
656
|
+
subdomain: options.subdomain,
|
|
657
|
+
sender_local_part: options.senderLocalPart,
|
|
658
|
+
});
|
|
659
|
+
return {
|
|
660
|
+
status: response.status,
|
|
661
|
+
};
|
|
662
|
+
}
|
|
663
|
+
|
|
664
|
+
async listManagedEmailDomains(): Promise<ManagedEmailProviderListItem[]> {
|
|
665
|
+
const response = await this._interface.listManagedEmailDomains();
|
|
666
|
+
return response.items.map((item) => ({
|
|
667
|
+
domainId: item.domain_id,
|
|
668
|
+
subdomain: item.subdomain,
|
|
669
|
+
senderLocalPart: item.sender_local_part,
|
|
670
|
+
status: item.status,
|
|
671
|
+
nameServerRecords: item.name_server_records,
|
|
672
|
+
}));
|
|
673
|
+
}
|
|
674
|
+
|
|
675
|
+
async applyManagedEmailProvider(options: { domainId: string }): Promise<{ status: "applied" }> {
|
|
676
|
+
const result = await this._interface.applyManagedEmailProvider({
|
|
677
|
+
domain_id: options.domainId,
|
|
678
|
+
});
|
|
679
|
+
await this._refreshProjectConfig();
|
|
680
|
+
return result;
|
|
681
|
+
}
|
|
682
|
+
|
|
683
|
+
async deleteManagedEmailDomain(options: { resendDomainId: string }): Promise<{ status: "deleted" }> {
|
|
684
|
+
return await this._interface.deleteManagedEmailDomain({
|
|
685
|
+
resend_domain_id: options.resendDomainId,
|
|
686
|
+
});
|
|
687
|
+
}
|
|
688
|
+
|
|
689
|
+
async sendSignInInvitationEmail(email: string, callbackUrl: string): Promise<void> {
|
|
690
|
+
await this._interface.sendSignInInvitationEmail(email, callbackUrl);
|
|
691
|
+
}
|
|
692
|
+
|
|
693
|
+
async createEmailTemplate(displayName: string): Promise<{ id: string }> {
|
|
694
|
+
const result = await this._interface.createEmailTemplate(displayName);
|
|
695
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
696
|
+
|
|
697
|
+
return result;
|
|
698
|
+
}
|
|
699
|
+
|
|
700
|
+
async deleteEmailTemplate(id: string): Promise<void> {
|
|
701
|
+
await this._interface.deleteEmailTemplate(id);
|
|
702
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
703
|
+
}
|
|
704
|
+
|
|
705
|
+
async createEmailDraft(options: { displayName: string, themeId?: string | false, tsxSource?: string }): Promise<{ id: string }> {
|
|
706
|
+
const result = await this._interface.createEmailDraft({
|
|
707
|
+
display_name: options.displayName,
|
|
708
|
+
theme_id: options.themeId,
|
|
709
|
+
tsx_source: options.tsxSource,
|
|
710
|
+
});
|
|
711
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
712
|
+
return result;
|
|
713
|
+
}
|
|
714
|
+
|
|
715
|
+
async updateEmailDraft(id: string, data: { displayName?: string, themeId?: string | undefined | false, tsxSource?: string }): Promise<void> {
|
|
716
|
+
await this._interface.updateEmailDraft(id, {
|
|
717
|
+
display_name: data.displayName,
|
|
718
|
+
theme_id: data.themeId,
|
|
719
|
+
tsx_source: data.tsxSource,
|
|
720
|
+
});
|
|
721
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
722
|
+
}
|
|
723
|
+
|
|
724
|
+
async deleteEmailDraft(id: string): Promise<void> {
|
|
725
|
+
await this._interface.deleteEmailDraft(id);
|
|
726
|
+
const current = this._adminEmailDraftsCache.getIfCached([]);
|
|
727
|
+
if (current.status === "ok" && current.data.status === "ok") {
|
|
728
|
+
this._adminEmailDraftsCache.forceSetCachedValue([], Result.ok(current.data.data.filter((d) => d.id !== id)));
|
|
729
|
+
}
|
|
730
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
731
|
+
}
|
|
732
|
+
|
|
733
|
+
async refreshEmailDrafts(): Promise<void> {
|
|
734
|
+
await this._adminEmailDraftsCache.refresh([]);
|
|
735
|
+
}
|
|
736
|
+
|
|
737
|
+
async saveChatMessage(threadId: string, message: any): Promise<void> {
|
|
738
|
+
await this._interface.saveChatMessage(threadId, message);
|
|
739
|
+
}
|
|
740
|
+
|
|
741
|
+
async listChatMessages(threadId: string): Promise<{ messages: Array<any> }> {
|
|
742
|
+
return await this._interface.listChatMessages(threadId);
|
|
743
|
+
}
|
|
744
|
+
|
|
745
|
+
async rewriteTemplateSourceWithAI(templateTsxSource: string): Promise<{ tsxSource: string }> {
|
|
746
|
+
const result = await this._interface.rewriteTemplateSourceWithAI(templateTsxSource);
|
|
747
|
+
return { tsxSource: result.tsx_source };
|
|
748
|
+
}
|
|
749
|
+
|
|
750
|
+
async createEmailTheme(displayName: string): Promise<{ id: string }> {
|
|
751
|
+
const result = await this._interface.createEmailTheme(displayName);
|
|
752
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
753
|
+
return result;
|
|
754
|
+
}
|
|
755
|
+
|
|
756
|
+
async getEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): Promise<string> {
|
|
757
|
+
return (await this._interface.renderEmailPreview(options)).html;
|
|
758
|
+
}
|
|
759
|
+
useEmailPreview(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string }): string {
|
|
760
|
+
const crud = useAsyncCache(this._emailPreviewCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource] as const, "adminApp.useEmailPreview()");
|
|
761
|
+
return crud.html;
|
|
762
|
+
}
|
|
763
|
+
async getEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): Promise<{ html: string, editableRegions?: Record<string, unknown> }> {
|
|
764
|
+
const result = await this._interface.renderEmailPreview({ ...options, editableMarkers: true, editableSource: options.editableSource });
|
|
765
|
+
return { html: result.html, editableRegions: result.editable_regions };
|
|
766
|
+
}
|
|
767
|
+
useEmailPreviewWithEditableMarkers(options: { themeId?: string | null | false, themeTsxSource?: string, templateId?: string, templateTsxSource?: string, editableSource?: 'template' | 'theme' | 'both' }): { html: string, editableRegions?: Record<string, unknown> } {
|
|
768
|
+
const crud = useAsyncCache(this._emailPreviewWithEditableMarkersCache, [options.themeId, options.themeTsxSource, options.templateId, options.templateTsxSource, options.editableSource] as const, "adminApp.useEmailPreviewWithEditableMarkers()");
|
|
769
|
+
return { html: crud.html, editableRegions: crud.editable_regions };
|
|
770
|
+
}
|
|
771
|
+
useEmailTheme(id: string): { displayName: string, tsxSource: string } {
|
|
772
|
+
const crud = useAsyncCache(this._adminEmailThemeCache, [id] as const, "adminApp.useEmailTheme()");
|
|
773
|
+
return {
|
|
774
|
+
displayName: crud.display_name,
|
|
775
|
+
tsxSource: crud.tsx_source,
|
|
776
|
+
};
|
|
777
|
+
}
|
|
778
|
+
async updateEmailTheme(id: string, tsxSource: string): Promise<void> {
|
|
779
|
+
await this._interface.updateEmailTheme(id, tsxSource);
|
|
780
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
781
|
+
await this._adminEmailThemeCache.invalidate([id]);
|
|
782
|
+
}
|
|
783
|
+
|
|
784
|
+
async deleteEmailTheme(id: string): Promise<void> {
|
|
785
|
+
await this._interface.deleteEmailTheme(id);
|
|
786
|
+
await this._adminEmailThemesCache.refresh([]);
|
|
787
|
+
await this._adminEmailThemeCache.invalidate([id]);
|
|
788
|
+
}
|
|
789
|
+
|
|
790
|
+
async updateEmailTemplate(id: string, tsxSource: string, themeId: string | null | false): Promise<{ renderedHtml: string }> {
|
|
791
|
+
const result = await this._interface.updateEmailTemplate(id, tsxSource, themeId);
|
|
792
|
+
await this._adminEmailTemplatesCache.refresh([]);
|
|
793
|
+
return { renderedHtml: result.rendered_html };
|
|
794
|
+
}
|
|
795
|
+
|
|
796
|
+
async setupPayments(): Promise<{ url: string }> {
|
|
797
|
+
const result = await this._interface.setupPayments();
|
|
798
|
+
await this._stripeAccountInfoCache.refresh([]);
|
|
799
|
+
return result;
|
|
800
|
+
}
|
|
801
|
+
|
|
802
|
+
async createStripeWidgetAccountSession(): Promise<{ client_secret: string }> {
|
|
803
|
+
return await this._interface.createStripeWidgetAccountSession();
|
|
804
|
+
}
|
|
805
|
+
|
|
806
|
+
async getPaymentMethodConfigs(): Promise<{ configId: string, methods: Array<{ id: string, name: string, enabled: boolean, available: boolean, overridable: boolean }> } | null> {
|
|
807
|
+
return await this._interface.getPaymentMethodConfigs();
|
|
808
|
+
}
|
|
809
|
+
|
|
810
|
+
async updatePaymentMethodConfigs(configId: string, updates: Record<string, 'on' | 'off'>): Promise<void> {
|
|
811
|
+
await this._interface.updatePaymentMethodConfigs(configId, updates);
|
|
812
|
+
}
|
|
813
|
+
|
|
814
|
+
async createItemQuantityChange(options: (
|
|
815
|
+
{ userId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |
|
|
816
|
+
{ teamId: string, itemId: string, quantity: number, expiresAt?: string, description?: string } |
|
|
817
|
+
{ customCustomerId: string, itemId: string, quantity: number, expiresAt?: string, description?: string }
|
|
818
|
+
)): Promise<void> {
|
|
819
|
+
await this._interface.updateItemQuantity(
|
|
820
|
+
{ itemId: options.itemId, ...("userId" in options ? { userId: options.userId } : ("teamId" in options ? { teamId: options.teamId } : { customCustomerId: options.customCustomerId })) },
|
|
821
|
+
{
|
|
822
|
+
delta: options.quantity,
|
|
823
|
+
expires_at: options.expiresAt,
|
|
824
|
+
description: options.description,
|
|
825
|
+
allow_negative: true,
|
|
826
|
+
}
|
|
827
|
+
);
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
async refundTransaction(options: {
|
|
831
|
+
type: "subscription" | "one-time-purchase",
|
|
832
|
+
id: string,
|
|
833
|
+
invoiceId?: string,
|
|
834
|
+
amountUsd: MoneyAmount,
|
|
835
|
+
endAction?: "now" | "at-period-end",
|
|
836
|
+
}): Promise<{ refundTransactionId: string }> {
|
|
837
|
+
const result = await this._interface.refundTransaction({
|
|
838
|
+
type: options.type,
|
|
839
|
+
id: options.id,
|
|
840
|
+
invoiceId: options.invoiceId,
|
|
841
|
+
amountUsd: options.amountUsd,
|
|
842
|
+
endAction: options.endAction,
|
|
843
|
+
});
|
|
844
|
+
await this._transactionsCache.invalidateWhere(() => true);
|
|
845
|
+
return { refundTransactionId: result.refundTransactionId };
|
|
846
|
+
}
|
|
847
|
+
|
|
848
|
+
async listTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): Promise<{ transactions: Transaction[], nextCursor: string | null }> {
|
|
849
|
+
const crud = Result.orThrow(await this._transactionsCache.getOrWait([params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, "write-only"));
|
|
850
|
+
return crud;
|
|
851
|
+
}
|
|
852
|
+
|
|
853
|
+
// Email Outbox methods
|
|
854
|
+
|
|
855
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any -- Complex discriminated union conversion from API response
|
|
856
|
+
private _emailOutboxCrudToAdmin(crud: any): AdminEmailOutbox {
|
|
857
|
+
const recipient = crud.to;
|
|
858
|
+
let to: AdminEmailOutbox["to"];
|
|
859
|
+
if (recipient.type === "user-primary-email") {
|
|
860
|
+
to = { type: "user-primary-email", userId: recipient.user_id };
|
|
861
|
+
} else if (recipient.type === "user-custom-emails") {
|
|
862
|
+
to = { type: "user-custom-emails", userId: recipient.user_id, emails: recipient.emails };
|
|
863
|
+
} else {
|
|
864
|
+
to = { type: "custom-emails", emails: recipient.emails };
|
|
865
|
+
}
|
|
866
|
+
|
|
867
|
+
// Base fields present on all emails
|
|
868
|
+
const base = {
|
|
869
|
+
id: crud.id as string,
|
|
870
|
+
createdAt: new Date(crud.created_at_millis),
|
|
871
|
+
updatedAt: new Date(crud.updated_at_millis),
|
|
872
|
+
tsxSource: crud.tsx_source as string,
|
|
873
|
+
themeId: (crud.theme_id as string | null) ?? null,
|
|
874
|
+
to,
|
|
875
|
+
scheduledAt: new Date(crud.scheduled_at_millis),
|
|
876
|
+
// Source tracking for grouping emails by template/draft
|
|
877
|
+
createdWith: crud.created_with as "draft" | "programmatic-call",
|
|
878
|
+
emailDraftId: crud.email_draft_id as string | null,
|
|
879
|
+
emailProgrammaticCallTemplateId: crud.email_programmatic_call_template_id as string | null,
|
|
880
|
+
variables: (crud.variables ?? {}) as Record<string, Json>,
|
|
881
|
+
isPaused: false as const,
|
|
882
|
+
hasRendered: false as const,
|
|
883
|
+
hasDelivered: false as const,
|
|
884
|
+
// Retry tracking fields
|
|
885
|
+
sendRetries: crud.send_retries as number,
|
|
886
|
+
nextSendRetryAt: crud.next_send_retry_at_millis ? new Date(crud.next_send_retry_at_millis) : null,
|
|
887
|
+
sendAttemptErrors: crud.send_attempt_errors ? (crud.send_attempt_errors as Array<{
|
|
888
|
+
attempt_number: number,
|
|
889
|
+
timestamp: string,
|
|
890
|
+
external_message: string,
|
|
891
|
+
external_details: Record<string, unknown>,
|
|
892
|
+
internal_message: string,
|
|
893
|
+
internal_details: Record<string, unknown>,
|
|
894
|
+
}>).map((e) => ({
|
|
895
|
+
attemptNumber: e.attempt_number,
|
|
896
|
+
timestamp: e.timestamp,
|
|
897
|
+
externalMessage: e.external_message,
|
|
898
|
+
externalDetails: e.external_details,
|
|
899
|
+
internalMessage: e.internal_message,
|
|
900
|
+
internalDetails: e.internal_details,
|
|
901
|
+
})) : null,
|
|
902
|
+
};
|
|
903
|
+
|
|
904
|
+
// Rendered fields (available after rendering completes successfully)
|
|
905
|
+
const rendered = crud.has_rendered ? {
|
|
906
|
+
...base,
|
|
907
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis),
|
|
908
|
+
renderedAt: new Date(crud.rendered_at_millis),
|
|
909
|
+
subject: crud.subject as string,
|
|
910
|
+
html: crud.html as string | null,
|
|
911
|
+
text: crud.text as string | null,
|
|
912
|
+
isTransactional: crud.is_transactional as boolean,
|
|
913
|
+
isHighPriority: crud.is_high_priority as boolean,
|
|
914
|
+
notificationCategoryId: crud.notification_category_id as string | null,
|
|
915
|
+
hasRendered: true as const,
|
|
916
|
+
} : null;
|
|
917
|
+
|
|
918
|
+
// Started sending fields
|
|
919
|
+
const startedSending = rendered && crud.started_sending_at_millis ? {
|
|
920
|
+
...rendered,
|
|
921
|
+
startedSendingAt: new Date(crud.started_sending_at_millis),
|
|
922
|
+
} : null;
|
|
923
|
+
|
|
924
|
+
// Finished delivering fields
|
|
925
|
+
const finishedDelivering = startedSending && crud.has_delivered ? {
|
|
926
|
+
...startedSending,
|
|
927
|
+
deliveredAt: new Date(crud.delivered_at_millis),
|
|
928
|
+
hasDelivered: true as const,
|
|
929
|
+
} : null;
|
|
930
|
+
|
|
931
|
+
// Use type assertion at the end because TypeScript has trouble with
|
|
932
|
+
// spread + override patterns on discriminated unions with const literal types
|
|
933
|
+
const result = (() => {
|
|
934
|
+
switch (crud.status) {
|
|
935
|
+
case "paused": {
|
|
936
|
+
return {
|
|
937
|
+
...base,
|
|
938
|
+
status: "paused" as const,
|
|
939
|
+
simpleStatus: "in-progress" as const,
|
|
940
|
+
isPaused: true as const,
|
|
941
|
+
};
|
|
942
|
+
}
|
|
943
|
+
case "preparing": {
|
|
944
|
+
return {
|
|
945
|
+
...base,
|
|
946
|
+
status: "preparing" as const,
|
|
947
|
+
simpleStatus: "in-progress" as const,
|
|
948
|
+
};
|
|
949
|
+
}
|
|
950
|
+
case "rendering": {
|
|
951
|
+
return {
|
|
952
|
+
...base,
|
|
953
|
+
status: "rendering" as const,
|
|
954
|
+
simpleStatus: "in-progress" as const,
|
|
955
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis),
|
|
956
|
+
};
|
|
957
|
+
}
|
|
958
|
+
case "render-error": {
|
|
959
|
+
return {
|
|
960
|
+
...base,
|
|
961
|
+
status: "render-error" as const,
|
|
962
|
+
simpleStatus: "error" as const,
|
|
963
|
+
startedRenderingAt: new Date(crud.started_rendering_at_millis),
|
|
964
|
+
renderedAt: new Date(crud.rendered_at_millis),
|
|
965
|
+
renderError: crud.render_error,
|
|
966
|
+
};
|
|
967
|
+
}
|
|
968
|
+
case "scheduled": {
|
|
969
|
+
return {
|
|
970
|
+
...rendered!,
|
|
971
|
+
status: "scheduled" as const,
|
|
972
|
+
simpleStatus: "in-progress" as const,
|
|
973
|
+
};
|
|
974
|
+
}
|
|
975
|
+
case "queued": {
|
|
976
|
+
return {
|
|
977
|
+
...rendered!,
|
|
978
|
+
status: "queued" as const,
|
|
979
|
+
simpleStatus: "in-progress" as const,
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
case "sending": {
|
|
983
|
+
return {
|
|
984
|
+
...startedSending!,
|
|
985
|
+
status: "sending" as const,
|
|
986
|
+
simpleStatus: "in-progress" as const,
|
|
987
|
+
};
|
|
988
|
+
}
|
|
989
|
+
case "server-error": {
|
|
990
|
+
return {
|
|
991
|
+
...startedSending!,
|
|
992
|
+
status: "server-error" as const,
|
|
993
|
+
simpleStatus: "error" as const,
|
|
994
|
+
errorAt: new Date(crud.error_at_millis),
|
|
995
|
+
serverError: crud.server_error,
|
|
996
|
+
};
|
|
997
|
+
}
|
|
998
|
+
case "skipped": {
|
|
999
|
+
return {
|
|
1000
|
+
...base,
|
|
1001
|
+
status: "skipped" as const,
|
|
1002
|
+
simpleStatus: "ok" as const,
|
|
1003
|
+
skippedAt: new Date(crud.skipped_at_millis),
|
|
1004
|
+
skippedReason: crud.skipped_reason,
|
|
1005
|
+
skippedDetails: crud.skipped_details ?? {},
|
|
1006
|
+
hasRendered: crud.has_rendered as boolean,
|
|
1007
|
+
// Optional fields
|
|
1008
|
+
startedRenderingAt: crud.started_rendering_at_millis ? new Date(crud.started_rendering_at_millis) : undefined,
|
|
1009
|
+
renderedAt: crud.rendered_at_millis ? new Date(crud.rendered_at_millis) : undefined,
|
|
1010
|
+
subject: crud.subject,
|
|
1011
|
+
html: crud.html,
|
|
1012
|
+
text: crud.text,
|
|
1013
|
+
isTransactional: crud.is_transactional,
|
|
1014
|
+
isHighPriority: crud.is_high_priority,
|
|
1015
|
+
notificationCategoryId: crud.notification_category_id,
|
|
1016
|
+
startedSendingAt: crud.started_sending_at_millis ? new Date(crud.started_sending_at_millis) : undefined,
|
|
1017
|
+
};
|
|
1018
|
+
}
|
|
1019
|
+
case "bounced": {
|
|
1020
|
+
return {
|
|
1021
|
+
...startedSending!,
|
|
1022
|
+
status: "bounced" as const,
|
|
1023
|
+
simpleStatus: "error" as const,
|
|
1024
|
+
bouncedAt: new Date(crud.bounced_at_millis),
|
|
1025
|
+
};
|
|
1026
|
+
}
|
|
1027
|
+
case "delivery-delayed": {
|
|
1028
|
+
return {
|
|
1029
|
+
...startedSending!,
|
|
1030
|
+
status: "delivery-delayed" as const,
|
|
1031
|
+
simpleStatus: "ok" as const,
|
|
1032
|
+
deliveryDelayedAt: new Date(crud.delivery_delayed_at_millis),
|
|
1033
|
+
};
|
|
1034
|
+
}
|
|
1035
|
+
case "sent": {
|
|
1036
|
+
return {
|
|
1037
|
+
...finishedDelivering!,
|
|
1038
|
+
status: "sent" as const,
|
|
1039
|
+
simpleStatus: "ok" as const,
|
|
1040
|
+
canHaveDeliveryInfo: crud.can_have_delivery_info,
|
|
1041
|
+
};
|
|
1042
|
+
}
|
|
1043
|
+
case "opened": {
|
|
1044
|
+
return {
|
|
1045
|
+
...finishedDelivering!,
|
|
1046
|
+
status: "opened" as const,
|
|
1047
|
+
simpleStatus: "ok" as const,
|
|
1048
|
+
openedAt: new Date(crud.opened_at_millis),
|
|
1049
|
+
canHaveDeliveryInfo: true as const,
|
|
1050
|
+
};
|
|
1051
|
+
}
|
|
1052
|
+
case "clicked": {
|
|
1053
|
+
return {
|
|
1054
|
+
...finishedDelivering!,
|
|
1055
|
+
status: "clicked" as const,
|
|
1056
|
+
simpleStatus: "ok" as const,
|
|
1057
|
+
clickedAt: new Date(crud.clicked_at_millis),
|
|
1058
|
+
canHaveDeliveryInfo: true as const,
|
|
1059
|
+
};
|
|
1060
|
+
}
|
|
1061
|
+
case "marked-as-spam": {
|
|
1062
|
+
return {
|
|
1063
|
+
...finishedDelivering!,
|
|
1064
|
+
status: "marked-as-spam" as const,
|
|
1065
|
+
simpleStatus: "ok" as const,
|
|
1066
|
+
markedAsSpamAt: new Date(crud.marked_as_spam_at_millis),
|
|
1067
|
+
canHaveDeliveryInfo: true as const,
|
|
1068
|
+
};
|
|
1069
|
+
}
|
|
1070
|
+
default: {
|
|
1071
|
+
throw new HexclaveAssertionError(`Unknown email outbox status: ${crud.status}`, { status: crud.status });
|
|
1072
|
+
}
|
|
1073
|
+
}
|
|
1074
|
+
})();
|
|
1075
|
+
// The type system has difficulty with spread + override patterns on discriminated unions,
|
|
1076
|
+
// so we use a type assertion here. The switch statement above ensures we return the correct shape.
|
|
1077
|
+
return result as AdminEmailOutbox;
|
|
1078
|
+
}
|
|
1079
|
+
|
|
1080
|
+
async listOutboxEmails(options?: { status?: string, simpleStatus?: string, limit?: number, cursor?: string }): Promise<{ items: AdminEmailOutbox[], nextCursor: string | null }> {
|
|
1081
|
+
const response = await this._interface.listOutboxEmails({
|
|
1082
|
+
status: options?.status,
|
|
1083
|
+
simple_status: options?.simpleStatus,
|
|
1084
|
+
limit: options?.limit,
|
|
1085
|
+
cursor: options?.cursor,
|
|
1086
|
+
});
|
|
1087
|
+
return {
|
|
1088
|
+
items: response.items.map((item) => this._emailOutboxCrudToAdmin(item)),
|
|
1089
|
+
nextCursor: response.pagination?.next_cursor ?? null,
|
|
1090
|
+
};
|
|
1091
|
+
}
|
|
1092
|
+
|
|
1093
|
+
async getOutboxEmail(id: string): Promise<AdminEmailOutbox> {
|
|
1094
|
+
const response = await this._interface.getOutboxEmail(id);
|
|
1095
|
+
return this._emailOutboxCrudToAdmin(response);
|
|
1096
|
+
}
|
|
1097
|
+
|
|
1098
|
+
async updateOutboxEmail(id: string, options: EmailOutboxUpdateOptions): Promise<AdminEmailOutbox> {
|
|
1099
|
+
const response = await this._interface.updateOutboxEmail(id, {
|
|
1100
|
+
is_paused: options.isPaused,
|
|
1101
|
+
scheduled_at_millis: options.scheduledAtMillis,
|
|
1102
|
+
cancel: options.cancel,
|
|
1103
|
+
tsx_source: options.tsxSource,
|
|
1104
|
+
theme_id: options.themeId,
|
|
1105
|
+
});
|
|
1106
|
+
return this._emailOutboxCrudToAdmin(response);
|
|
1107
|
+
}
|
|
1108
|
+
|
|
1109
|
+
async pauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {
|
|
1110
|
+
return await this.updateOutboxEmail(id, { isPaused: true });
|
|
1111
|
+
}
|
|
1112
|
+
|
|
1113
|
+
async unpauseOutboxEmail(id: string): Promise<AdminEmailOutbox> {
|
|
1114
|
+
return await this.updateOutboxEmail(id, { isPaused: false });
|
|
1115
|
+
}
|
|
1116
|
+
|
|
1117
|
+
async cancelOutboxEmail(id: string): Promise<AdminEmailOutbox> {
|
|
1118
|
+
return await this.updateOutboxEmail(id, { cancel: true });
|
|
1119
|
+
}
|
|
1120
|
+
|
|
1121
|
+
useTransactions(params: { cursor?: string, limit?: number, type?: TransactionType, customerType?: 'user' | 'team' | 'custom', customerId?: string }): { transactions: Transaction[], nextCursor: string | null } {
|
|
1122
|
+
const data = useAsyncCache(this._transactionsCache, [params.cursor, params.limit, params.type, params.customerType, params.customerId] as const, "adminApp.useTransactions()");
|
|
1123
|
+
return data;
|
|
1124
|
+
}
|
|
1125
|
+
|
|
1126
|
+
async getStripeAccountInfo(): Promise<null | { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean }> {
|
|
1127
|
+
return await this._interface.getStripeAccountInfo();
|
|
1128
|
+
}
|
|
1129
|
+
|
|
1130
|
+
useStripeAccountInfo(): { account_id: string, charges_enabled: boolean, details_submitted: boolean, payouts_enabled: boolean } | null {
|
|
1131
|
+
const data = useAsyncCache(this._stripeAccountInfoCache, [], "adminApp.useStripeAccountInfo()");
|
|
1132
|
+
return data;
|
|
1133
|
+
}
|
|
1134
|
+
|
|
1135
|
+
async queryAnalytics(options: AnalyticsQueryOptions): Promise<AnalyticsQueryResponse> {
|
|
1136
|
+
return await this._interface.queryAnalytics(options);
|
|
1137
|
+
}
|
|
1138
|
+
|
|
1139
|
+
async listSessionReplays(options?: ListSessionReplaysOptions): Promise<ListSessionReplaysResult> {
|
|
1140
|
+
const response = await this._interface.listSessionReplays({
|
|
1141
|
+
cursor: options?.cursor,
|
|
1142
|
+
limit: options?.limit,
|
|
1143
|
+
user_ids: options?.userIds,
|
|
1144
|
+
team_ids: options?.teamIds,
|
|
1145
|
+
duration_ms_min: options?.durationMsMin,
|
|
1146
|
+
duration_ms_max: options?.durationMsMax,
|
|
1147
|
+
last_event_at_from_millis: options?.lastEventAtFromMillis,
|
|
1148
|
+
last_event_at_to_millis: options?.lastEventAtToMillis,
|
|
1149
|
+
click_count_min: options?.clickCountMin,
|
|
1150
|
+
});
|
|
1151
|
+
|
|
1152
|
+
const items: AdminSessionReplay[] = response.items.map((r) => ({
|
|
1153
|
+
id: r.id,
|
|
1154
|
+
projectUser: {
|
|
1155
|
+
id: r.project_user.id,
|
|
1156
|
+
displayName: r.project_user.display_name,
|
|
1157
|
+
primaryEmail: r.project_user.primary_email,
|
|
1158
|
+
},
|
|
1159
|
+
startedAt: new Date(r.started_at_millis),
|
|
1160
|
+
lastEventAt: new Date(r.last_event_at_millis),
|
|
1161
|
+
chunkCount: r.chunk_count,
|
|
1162
|
+
eventCount: r.event_count,
|
|
1163
|
+
}));
|
|
1164
|
+
|
|
1165
|
+
return {
|
|
1166
|
+
items,
|
|
1167
|
+
nextCursor: response.pagination.next_cursor,
|
|
1168
|
+
};
|
|
1169
|
+
}
|
|
1170
|
+
|
|
1171
|
+
async getSessionReplay(sessionReplayId: string): Promise<AdminSessionReplay> {
|
|
1172
|
+
const response = await this._interface.getSessionReplay(sessionReplayId);
|
|
1173
|
+
return {
|
|
1174
|
+
id: response.id,
|
|
1175
|
+
projectUser: {
|
|
1176
|
+
id: response.project_user.id,
|
|
1177
|
+
displayName: response.project_user.display_name,
|
|
1178
|
+
primaryEmail: response.project_user.primary_email,
|
|
1179
|
+
},
|
|
1180
|
+
startedAt: new Date(response.started_at_millis),
|
|
1181
|
+
lastEventAt: new Date(response.last_event_at_millis),
|
|
1182
|
+
chunkCount: response.chunk_count,
|
|
1183
|
+
eventCount: response.event_count,
|
|
1184
|
+
};
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
async listSessionReplayChunks(sessionReplayId: string, options?: ListSessionReplayChunksOptions): Promise<ListSessionReplayChunksResult> {
|
|
1188
|
+
const response = await this._interface.listSessionReplayChunks(sessionReplayId, {
|
|
1189
|
+
cursor: options?.cursor,
|
|
1190
|
+
limit: options?.limit,
|
|
1191
|
+
});
|
|
1192
|
+
|
|
1193
|
+
const items: AdminSessionReplayChunk[] = response.items.map((c) => ({
|
|
1194
|
+
id: c.id,
|
|
1195
|
+
batchId: c.batch_id,
|
|
1196
|
+
sessionReplaySegmentId: c.session_replay_segment_id,
|
|
1197
|
+
browserSessionId: c.browser_session_id,
|
|
1198
|
+
eventCount: c.event_count,
|
|
1199
|
+
byteLength: c.byte_length,
|
|
1200
|
+
firstEventAt: new Date(c.first_event_at_millis),
|
|
1201
|
+
lastEventAt: new Date(c.last_event_at_millis),
|
|
1202
|
+
createdAt: new Date(c.created_at_millis),
|
|
1203
|
+
}));
|
|
1204
|
+
|
|
1205
|
+
return {
|
|
1206
|
+
items,
|
|
1207
|
+
nextCursor: response.pagination.next_cursor,
|
|
1208
|
+
};
|
|
1209
|
+
}
|
|
1210
|
+
|
|
1211
|
+
async getSessionReplayChunkEvents(sessionReplayId: string, chunkId: string): Promise<AdminGetSessionReplayChunkEventsResponse> {
|
|
1212
|
+
return await this._interface.getSessionReplayChunkEvents(sessionReplayId, chunkId);
|
|
1213
|
+
}
|
|
1214
|
+
|
|
1215
|
+
async getSessionReplayEvents(sessionReplayId: string, options?: { offset?: number, limit?: number }): Promise<SessionReplayAllEventsResult> {
|
|
1216
|
+
const response = await this._interface.getSessionReplayEvents(sessionReplayId, options);
|
|
1217
|
+
return {
|
|
1218
|
+
chunks: response.chunks.map((c) => ({
|
|
1219
|
+
id: c.id,
|
|
1220
|
+
batchId: c.batch_id,
|
|
1221
|
+
sessionReplaySegmentId: c.session_replay_segment_id,
|
|
1222
|
+
eventCount: c.event_count,
|
|
1223
|
+
byteLength: c.byte_length,
|
|
1224
|
+
firstEventAt: new Date(c.first_event_at_millis),
|
|
1225
|
+
lastEventAt: new Date(c.last_event_at_millis),
|
|
1226
|
+
createdAt: new Date(c.created_at_millis),
|
|
1227
|
+
})),
|
|
1228
|
+
chunkEvents: response.chunk_events.map((ce) => ({
|
|
1229
|
+
chunkId: ce.chunk_id,
|
|
1230
|
+
events: ce.events,
|
|
1231
|
+
})),
|
|
1232
|
+
};
|
|
1233
|
+
}
|
|
1234
|
+
|
|
1235
|
+
async previewAffectedUsersByOnboardingChange(
|
|
1236
|
+
onboarding: { requireEmailVerification?: boolean },
|
|
1237
|
+
limit?: number,
|
|
1238
|
+
): Promise<{
|
|
1239
|
+
affectedUsers: Array<{
|
|
1240
|
+
id: string,
|
|
1241
|
+
displayName: string | null,
|
|
1242
|
+
primaryEmail: string | null,
|
|
1243
|
+
restrictedReason: RestrictedReason,
|
|
1244
|
+
}>,
|
|
1245
|
+
totalAffectedCount: number,
|
|
1246
|
+
}> {
|
|
1247
|
+
const result = await this._interface.previewAffectedUsersByOnboardingChange(
|
|
1248
|
+
{ require_email_verification: onboarding.requireEmailVerification },
|
|
1249
|
+
limit,
|
|
1250
|
+
);
|
|
1251
|
+
return {
|
|
1252
|
+
affectedUsers: result.affected_users.map(u => ({
|
|
1253
|
+
id: u.id,
|
|
1254
|
+
displayName: u.display_name,
|
|
1255
|
+
primaryEmail: u.primary_email,
|
|
1256
|
+
restrictedReason: u.restricted_reason as RestrictedReason,
|
|
1257
|
+
})),
|
|
1258
|
+
totalAffectedCount: result.total_affected_count,
|
|
1259
|
+
};
|
|
1260
|
+
}
|
|
1261
|
+
}
|