@cosmicdrift/kumiko-bundled-features 0.406.0 → 0.410.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/account-security/feature.js +9 -1
- package/dist/admin-shell/feature.d.ts +3 -0
- package/dist/admin-shell/feature.js +1 -1
- package/dist/agent-tools/agent-manifest.js +1 -0
- package/dist/agent-tools/tool-catalog.js +1 -0
- package/dist/agent-tools/types.d.ts +4 -1
- package/dist/audit/event-classification.js +1 -0
- package/dist/auth-email-password/bootstrap.js +1 -0
- package/dist/auth-email-password/errors.js +16 -41
- package/dist/auth-email-password/handlers/login-options.query.js +1 -1
- package/dist/auth-email-password/handlers/self-registration-status.query.js +1 -1
- package/dist/auth-email-password/web/auth-client.d.ts +8 -32
- package/dist/auth-email-password/web/auth-client.js +18 -52
- package/dist/auth-email-password/web/auth-redirect.js +2 -2
- package/dist/auth-email-password/web/confirm-account-unlock-screen.d.ts +2 -2
- package/dist/auth-email-password/web/confirm-account-unlock-screen.js +14 -35
- package/dist/auth-email-password/web/index.d.ts +1 -0
- package/dist/auth-email-password/web/index.js +1 -0
- package/dist/auth-email-password/web/read-path-param.d.ts +1 -0
- package/dist/auth-email-password/web/read-path-param.js +4 -0
- package/dist/auth-email-password/web/return-path.js +2 -2
- package/dist/auth-email-password/web/token-confirm-screen.d.ts +20 -0
- package/dist/auth-email-password/web/token-confirm-screen.js +38 -0
- package/dist/auth-email-password/web/verify-email-screen.d.ts +2 -2
- package/dist/auth-email-password/web/verify-email-screen.js +14 -37
- package/dist/auth-foundation/boot-checks.js +24 -12
- package/dist/auth-foundation/boot-rules.d.ts +27 -0
- package/dist/auth-foundation/boot-rules.js +27 -0
- package/dist/auth-mfa/errors.d.ts +1 -1
- package/dist/auth-mfa/errors.js +11 -24
- package/dist/auth-mfa/feature-exports.js +6 -45
- package/dist/auth-mfa/feature.js +7 -18
- package/dist/auth-mfa/web/mfa-client.js +11 -25
- package/dist/billing-foundation/consumer-protection/termination-notify.js +1 -0
- package/dist/billing-foundation/web/plan-price.js +7 -8
- package/dist/cap-counter/stock-cap-guard.js +1 -0
- package/dist/channel-in-app/constants.d.ts +1 -0
- package/dist/channel-in-app/feature.js +2 -0
- package/dist/channel-in-app/handlers/read-state-by-keys.query.d.ts +9 -0
- package/dist/channel-in-app/handlers/read-state-by-keys.query.js +21 -0
- package/dist/channel-in-app/in-app-channel.js +1 -0
- package/dist/channel-in-app/tables.js +5 -1
- package/dist/compliance-profiles/handlers/sub-processors.query.js +4 -1
- package/dist/contact/challenge.d.ts +14 -0
- package/dist/contact/challenge.js +30 -0
- package/dist/contact/client/contact-client-source.d.ts +1 -0
- package/dist/contact/client/contact-client-source.js +203 -0
- package/dist/contact/client/contact-website-client.d.ts +26 -0
- package/dist/contact/client/contact-website-client.js +1 -0
- package/dist/contact/client/index.d.ts +2 -0
- package/dist/contact/client/index.js +1 -0
- package/dist/contact/entity.d.ts +777 -0
- package/dist/contact/entity.js +145 -0
- package/dist/contact/feature.d.ts +3 -0
- package/dist/contact/feature.js +134 -0
- package/dist/contact/handlers/access.d.ts +7 -0
- package/dist/contact/handlers/access.js +9 -0
- package/dist/contact/handlers/attempts.d.ts +14 -0
- package/dist/contact/handlers/attempts.js +54 -0
- package/dist/contact/handlers/challenge.query.d.ts +9 -0
- package/dist/contact/handlers/challenge.query.js +35 -0
- package/dist/contact/handlers/forward-request.write.d.ts +9 -0
- package/dist/contact/handlers/forward-request.write.js +61 -0
- package/dist/contact/handlers/mark-done.write.d.ts +7 -0
- package/dist/contact/handlers/mark-done.write.js +30 -0
- package/dist/contact/handlers/notify-reporter-in-app.write.d.ts +10 -0
- package/dist/contact/handlers/notify-reporter-in-app.write.js +36 -0
- package/dist/contact/handlers/open-count.d.ts +2 -0
- package/dist/contact/handlers/open-count.js +11 -0
- package/dist/contact/handlers/open-count.query.d.ts +3 -0
- package/dist/contact/handlers/open-count.query.js +13 -0
- package/dist/contact/handlers/replies.query.d.ts +11 -0
- package/dist/contact/handlers/replies.query.js +28 -0
- package/dist/contact/handlers/reply.write.d.ts +12 -0
- package/dist/contact/handlers/reply.write.js +118 -0
- package/dist/contact/handlers/report.write.d.ts +16 -0
- package/dist/contact/handlers/report.write.js +90 -0
- package/dist/contact/handlers/request-delivery.query.d.ts +16 -0
- package/dist/contact/handlers/request-delivery.query.js +85 -0
- package/dist/contact/handlers/request-detail.query.d.ts +41 -0
- package/dist/contact/handlers/request-detail.query.js +32 -0
- package/dist/contact/handlers/request-list.query.d.ts +2 -0
- package/dist/contact/handlers/request-list.query.js +9 -0
- package/dist/contact/handlers/send-reply-mail.write.d.ts +8 -0
- package/dist/contact/handlers/send-reply-mail.write.js +82 -0
- package/dist/contact/handlers/send-test.write.d.ts +5 -0
- package/dist/contact/handlers/send-test.write.js +36 -0
- package/dist/contact/handlers/submit.write.d.ts +20 -0
- package/dist/contact/handlers/submit.write.js +137 -0
- package/dist/contact/handlers/take-over-uploads.d.ts +9 -0
- package/dist/contact/handlers/take-over-uploads.js +33 -0
- package/dist/contact/i18n.d.ts +6 -0
- package/dist/contact/i18n.js +189 -0
- package/dist/contact/index.d.ts +5 -0
- package/dist/contact/index.js +4 -0
- package/dist/contact/lib.d.ts +101 -0
- package/dist/contact/lib.js +109 -0
- package/dist/contact/mail.d.ts +91 -0
- package/dist/contact/mail.js +279 -0
- package/dist/contact/options.d.ts +51 -0
- package/dist/contact/options.js +32 -0
- package/dist/contact/panels.d.ts +2 -0
- package/dist/contact/panels.js +21 -0
- package/dist/contact/payloads.d.ts +56 -0
- package/dist/contact/payloads.js +82 -0
- package/dist/contact/pow.d.ts +6 -0
- package/dist/contact/pow.js +19 -0
- package/dist/contact/screens.d.ts +5 -0
- package/dist/contact/screens.js +465 -0
- package/dist/contact/subject.d.ts +1 -0
- package/dist/contact/subject.js +13 -0
- package/dist/contact/user-agent.d.ts +1 -0
- package/dist/contact/user-agent.js +35 -0
- package/dist/contact/user-data-hooks.d.ts +3 -0
- package/dist/contact/user-data-hooks.js +129 -0
- package/dist/contact/web/constants.d.ts +127 -0
- package/dist/contact/web/constants.js +126 -0
- package/dist/contact/web/index.d.ts +1 -0
- package/dist/contact/web/index.js +1 -0
- package/dist/crypto-shredding/handlers/forget-subject.write.js +5 -13
- package/dist/data-retention/feature.js +16 -2
- package/dist/data-retention/index.d.ts +1 -0
- package/dist/data-retention/index.js +1 -0
- package/dist/data-retention/run-retention-cleanup.d.ts +14 -2
- package/dist/data-retention/run-retention-cleanup.js +102 -36
- package/dist/data-retention/tenant-destruction-hold.d.ts +23 -0
- package/dist/data-retention/tenant-destruction-hold.js +132 -0
- package/dist/delivery/address-opt-out.js +1 -0
- package/dist/delivery/channel-context.d.ts +1 -1
- package/dist/delivery/channel-context.js +2 -1
- package/dist/delivery/delivery-service.js +18 -8
- package/dist/delivery/events.d.ts +1 -0
- package/dist/delivery/events.js +2 -0
- package/dist/delivery/feature.js +3 -0
- package/dist/delivery/handlers/attempts-by-keys.query.d.ts +15 -0
- package/dist/delivery/handlers/attempts-by-keys.query.js +35 -0
- package/dist/delivery/handlers/log.query.d.ts +1 -0
- package/dist/delivery/handlers/log.query.js +1 -1
- package/dist/delivery/jobs.js +5 -2
- package/dist/delivery/tables.js +12 -2
- package/dist/delivery/types.d.ts +2 -0
- package/dist/delivery/unsubscribe-page.js +2 -0
- package/dist/delivery/web/delivery-channel-cell.js +1 -1
- package/dist/delivery/web/delivery-error-cell.js +1 -1
- package/dist/delivery/web/delivery-status-cell.js +1 -1
- package/dist/delivery/web/delivery-time-cell.js +3 -2
- package/dist/delivery/web/delivery-type-cell.js +1 -1
- package/dist/delivery/web/public-names.d.ts +1 -0
- package/dist/delivery/web/public-names.js +1 -0
- package/dist/document-ingest-foundation/boot-checks.js +19 -11
- package/dist/document-ingest-foundation/boot-rules.d.ts +17 -0
- package/dist/document-ingest-foundation/boot-rules.js +17 -0
- package/dist/document-ingest-foundation/events.d.ts +8 -0
- package/dist/document-ingest-foundation/events.js +12 -0
- package/dist/document-ingest-foundation/feature.js +30 -2
- package/dist/document-ingest-foundation/index.d.ts +3 -1
- package/dist/document-ingest-foundation/index.js +3 -1
- package/dist/document-ingest-foundation/report-ingest-progress.d.ts +14 -0
- package/dist/document-ingest-foundation/report-ingest-progress.js +20 -0
- package/dist/document-ingest-foundation/tables.d.ts +3 -0
- package/dist/document-ingest-foundation/tables.js +26 -0
- package/dist/file-derivatives/handlers/public-variant-by-file-ref.query.js +1 -1
- package/dist/file-derivatives/handlers/public-variant.query.js +1 -1
- package/dist/files-tenant-data/hooks.js +4 -1
- package/dist/folders/web/folder-manager.js +3 -10
- package/dist/folders/web/folder-section.js +1 -1
- package/dist/form-draft-user-data/index.js +4 -1
- package/dist/inbound-mail-foundation/entities.d.ts +3 -0
- package/dist/inbound-mail-foundation/entities.js +2 -0
- package/dist/inbound-mail-foundation/events.d.ts +2 -0
- package/dist/inbound-mail-foundation/events.js +2 -0
- package/dist/inbound-mail-foundation/feature.js +6 -6
- package/dist/inbound-mail-foundation/handlers/attach-message-content.write.js +3 -1
- package/dist/inbound-mail-foundation/handlers/ingest-message.write.js +5 -0
- package/dist/inbound-mail-foundation/handlers/list-messages.query.js +4 -2
- package/dist/inbound-mail-foundation/handlers/message-content.d.ts +1 -0
- package/dist/inbound-mail-foundation/handlers/message-content.js +8 -0
- package/dist/inbound-mail-foundation/handlers/message-content.query.d.ts +2 -0
- package/dist/inbound-mail-foundation/handlers/message-content.query.js +1 -0
- package/dist/inbound-mail-foundation/projection.d.ts +3 -0
- package/dist/inbound-mail-foundation/projection.js +2 -0
- package/dist/inbound-mail-foundation/sanitize-inbound-html.d.ts +2 -0
- package/dist/inbound-mail-foundation/sanitize-inbound-html.js +135 -0
- package/dist/inbound-mail-foundation/types.js +1 -0
- package/dist/jobs/job-run-logger.js +16 -20
- package/dist/ledger/handlers/reports.query.js +25 -27
- package/dist/ledger/recurring.js +1 -0
- package/dist/managed-pages/handlers/branding.query.js +1 -1
- package/dist/managed-pages/handlers/by-slug.query.js +1 -1
- package/dist/managed-pages/handlers/by-tenant-published.query.js +1 -1
- package/dist/notes-history/web/notes-section.js +3 -2
- package/dist/personal-access-tokens/feature.js +5 -18
- package/dist/personal-access-tokens/handlers/create.write.js +2 -5
- package/dist/secrets/handlers/delete.write.d.ts +4 -0
- package/dist/secrets/handlers/delete.write.js +9 -4
- package/dist/secrets/handlers/list.query.d.ts +6 -1
- package/dist/secrets/handlers/list.query.js +7 -3
- package/dist/secrets/handlers/set.write.d.ts +4 -0
- package/dist/secrets/handlers/set.write.js +10 -4
- package/dist/secrets/secret-scope.d.ts +17 -0
- package/dist/secrets/secret-scope.js +18 -0
- package/dist/seo/handlers/seo-config.query.js +1 -1
- package/dist/sessions/feature.d.ts +3 -0
- package/dist/sessions/feature.js +13 -19
- package/dist/sessions/handlers/last-activity-probe.query.d.ts +7 -0
- package/dist/sessions/handlers/last-activity-probe.query.js +40 -0
- package/dist/sessions/handlers/last-activity-probe.route.d.ts +2 -0
- package/dist/sessions/handlers/last-activity-probe.route.js +30 -0
- package/dist/sessions/screens.js +1 -0
- package/dist/sessions/session-callbacks.d.ts +2 -0
- package/dist/sessions/session-callbacks.js +9 -7
- package/dist/sessions/web/i18n.js +4 -1
- package/dist/shared/assert-billing-live.d.ts +2 -0
- package/dist/shared/assert-billing-live.js +7 -0
- package/dist/shared/collect-extension-options.d.ts +1 -0
- package/dist/shared/collect-extension-options.js +8 -0
- package/dist/shared/index.d.ts +7 -1
- package/dist/shared/index.js +7 -1
- package/dist/shared/late-bound-slot.d.ts +5 -0
- package/dist/shared/late-bound-slot.js +13 -0
- package/dist/shared/mail-locale-templates.d.ts +1 -0
- package/dist/shared/mail-locale-templates.js +1 -1
- package/dist/shared/price-env-shape.d.ts +11 -0
- package/dist/shared/price-env-shape.js +15 -0
- package/dist/shared/purge-row-file-refs.d.ts +1 -0
- package/dist/shared/purge-row-file-refs.js +1 -1
- package/dist/shared/read-feature-export-fn.d.ts +2 -0
- package/dist/shared/read-feature-export-fn.js +11 -0
- package/dist/shared/signup-handover.js +3 -5
- package/dist/shared/tenant-destruction-hold.d.ts +23 -0
- package/dist/shared/tenant-destruction-hold.js +15 -0
- package/dist/shared/unprocessable.d.ts +4 -0
- package/dist/shared/unprocessable.js +4 -0
- package/dist/shared/web/index.d.ts +3 -0
- package/dist/shared/web/index.js +3 -0
- package/dist/subscription-paddle/checkout-config.query.js +1 -1
- package/dist/subscription-paddle/feature.d.ts +1 -5
- package/dist/subscription-paddle/feature.js +7 -9
- package/dist/subscription-paddle/runtime.js +3 -7
- package/dist/subscription-stripe/feature.d.ts +1 -5
- package/dist/subscription-stripe/feature.js +7 -9
- package/dist/subscription-stripe/runtime.js +3 -7
- package/dist/tags/entity.js +1 -0
- package/dist/tags/web/tag-chip.d.ts +7 -0
- package/dist/tags/web/tag-chip.js +4 -0
- package/dist/tags/web/tag-filter.js +2 -5
- package/dist/tags/web/tag-manager.js +1 -1
- package/dist/tags/web/tag-section.js +3 -6
- package/dist/tags/web/tags-cell.js +2 -5
- package/dist/template-resolver/compile-document-body.js +12 -17
- package/dist/template-resolver/handlers/by-slug.query.js +1 -1
- package/dist/template-resolver/handlers/by-tenant.query.js +4 -2
- package/dist/template-resolver/handlers/discard-draft.write.js +1 -0
- package/dist/template-resolver/handlers/overview.query.js +3 -1
- package/dist/template-resolver/handlers/send-test.write.js +2 -4
- package/dist/template-resolver/handlers/toggle-status.write.js +3 -0
- package/dist/template-resolver/linked-resources.js +6 -5
- package/dist/template-resolver/store-template-resource.js +5 -10
- package/dist/template-resolver/web/document-images.js +6 -6
- package/dist/template-resolver/web/document-insert-fields.js +22 -4
- package/dist/template-resolver/web/document-schema.js +11 -12
- package/dist/template-resolver/web/tiptap-attribute-parse-rule.d.ts +15 -0
- package/dist/template-resolver/web/tiptap-attribute-parse-rule.js +11 -0
- package/dist/tenant/i18n.js +3 -0
- package/dist/tenant/schema/tenant.d.ts +9 -7
- package/dist/tenant/schema/tenant.js +1 -0
- package/dist/tenant/web/member-roles-cell.js +1 -1
- package/dist/tenant/web/member-status-cell.js +1 -1
- package/dist/tenant-inactivity/check-inactive-tenants.d.ts +3 -0
- package/dist/tenant-inactivity/check-inactive-tenants.js +184 -0
- package/dist/tenant-inactivity/constants.d.ts +10 -0
- package/dist/tenant-inactivity/constants.js +10 -0
- package/dist/tenant-inactivity/email-templates.d.ts +3 -0
- package/dist/tenant-inactivity/email-templates.js +16 -0
- package/dist/tenant-inactivity/feature.d.ts +8 -0
- package/dist/tenant-inactivity/feature.js +45 -0
- package/dist/tenant-inactivity/handlers/inactivity-state.query.d.ts +11 -0
- package/dist/tenant-inactivity/handlers/inactivity-state.query.js +45 -0
- package/dist/tenant-inactivity/handlers/keep-account.write.d.ts +8 -0
- package/dist/tenant-inactivity/handlers/keep-account.write.js +51 -0
- package/dist/tenant-inactivity/inactivity-plan.d.ts +51 -0
- package/dist/tenant-inactivity/inactivity-plan.js +113 -0
- package/dist/tenant-inactivity/index.d.ts +5 -0
- package/dist/tenant-inactivity/index.js +3 -0
- package/dist/tenant-inactivity/keep-token.d.ts +16 -0
- package/dist/tenant-inactivity/keep-token.js +24 -0
- package/dist/tenant-inactivity/mail-notifications.d.ts +4 -0
- package/dist/tenant-inactivity/mail-notifications.js +42 -0
- package/dist/tenant-inactivity/options.d.ts +27 -0
- package/dist/tenant-inactivity/options.js +5 -0
- package/dist/tenant-inactivity/remote-activity.d.ts +15 -0
- package/dist/tenant-inactivity/remote-activity.js +24 -0
- package/dist/tenant-inactivity/state-store.d.ts +10 -0
- package/dist/tenant-inactivity/state-store.js +50 -0
- package/dist/tenant-inactivity/state-table.d.ts +109 -0
- package/dist/tenant-inactivity/state-table.js +38 -0
- package/dist/tenant-lifecycle/boot-checks.js +8 -3
- package/dist/tenant-lifecycle/boot-rules.d.ts +12 -0
- package/dist/tenant-lifecycle/boot-rules.js +12 -0
- package/dist/tenant-lifecycle/feature.js +17 -2
- package/dist/tenant-lifecycle/handlers/request-destruction.write.js +11 -67
- package/dist/tenant-lifecycle/index.d.ts +1 -0
- package/dist/tenant-lifecycle/index.js +1 -0
- package/dist/tenant-lifecycle/request-tenant-destruction.d.ts +20 -0
- package/dist/tenant-lifecycle/request-tenant-destruction.js +66 -0
- package/dist/tenant-lifecycle/retention-config-destroy-hooks.d.ts +5 -0
- package/dist/tenant-lifecycle/retention-config-destroy-hooks.js +29 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.d.ts +3 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.js +43 -5
- package/dist/tenant-lifecycle/stages.d.ts +2 -0
- package/dist/tenant-lifecycle/stages.js +23 -2
- package/dist/tenant-lifecycle/testing.js +1 -1
- package/dist/tier-engine/caps-for-tier-from-map.d.ts +5 -0
- package/dist/tier-engine/caps-for-tier-from-map.js +12 -0
- package/dist/tier-engine/compose-app.d.ts +0 -22
- package/dist/tier-engine/compose-app.js +9 -16
- package/dist/tier-engine/index.d.ts +1 -0
- package/dist/tier-engine/index.js +1 -0
- package/dist/user/handlers/detail.query.d.ts +1 -1
- package/dist/user-data-rights/feature.js +2 -0
- package/dist/user-data-rights/handlers/confirm-deletion-by-token.write.js +4 -1
- package/dist/user-data-rights/handlers/download-by-token.query.js +1 -0
- package/dist/user-data-rights/handlers/request-deletion-by-email.write.js +4 -1
- package/dist/user-data-rights/run-forget-cleanup.js +2 -0
- package/dist/user-data-rights/web/privacy-center-screen.js +1 -1
- package/dist/user-data-rights/zip-path.js +1 -0
- package/dist/user-data-rights-defaults/hooks/config-value.userdata-hook.d.ts +1 -1
- package/dist/user-data-rights-defaults/hooks/config-value.userdata-hook.js +7 -20
- package/dist/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.js +3 -1
- package/dist/user-data-rights-defaults/hooks/forget-own-rows-delete-hook.d.ts +10 -0
- package/dist/user-data-rights-defaults/hooks/forget-own-rows-delete-hook.js +26 -0
- package/dist/user-data-rights-defaults/hooks/notification-preference.userdata-hook.d.ts +1 -1
- package/dist/user-data-rights-defaults/hooks/notification-preference.userdata-hook.js +7 -20
- package/dist/user-profile/handlers/change-email.write.js +2 -4
- package/dist/user-profile/web/profile-screen.js +2 -3
- package/dist/waitlist/handlers/submit.write.js +1 -2
- package/kumiko-es-tables.json +12 -0
- package/package.json +54 -12
- package/src/admin-shell/changes.json +6 -0
- package/src/agent-tools/changes.json +6 -0
- package/src/channel-in-app/changes.json +7 -0
- package/src/contact/changes.json +33 -0
- package/src/data-retention/changes.json +6 -0
- package/src/delivery/changes.json +7 -0
- package/src/document-ingest-foundation/changes.json +6 -0
- package/src/files-tenant-data/changes.json +6 -0
- package/src/inbound-mail-foundation/changes.json +13 -0
- package/src/secrets/changes.json +6 -0
- package/src/sessions/changes.json +6 -0
- package/src/tenant-inactivity/changes.json +8 -0
- package/src/tenant-lifecycle/changes.json +18 -0
- package/src/tier-engine/changes.json +6 -0
- package/src/waitlist/changes.json +6 -0
|
@@ -27,23 +27,31 @@ export function createAccountSecurityFeature(options = {}) {
|
|
|
27
27
|
panels: [
|
|
28
28
|
{
|
|
29
29
|
kind: "screen",
|
|
30
|
+
chromeless: true,
|
|
30
31
|
id: "mfa-enable",
|
|
31
32
|
screen: `auth-mfa:screen:${MFA_ENABLE_SCREEN_ID}`,
|
|
32
33
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: false },
|
|
33
34
|
},
|
|
34
35
|
{
|
|
35
36
|
kind: "screen",
|
|
37
|
+
chromeless: true,
|
|
36
38
|
id: "mfa-regenerate",
|
|
37
39
|
screen: `auth-mfa:screen:${MFA_REGENERATE_RECOVERY_SCREEN_ID}`,
|
|
38
40
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: true },
|
|
39
41
|
},
|
|
40
42
|
{
|
|
41
43
|
kind: "screen",
|
|
44
|
+
chromeless: true,
|
|
42
45
|
id: "mfa-disable",
|
|
43
46
|
screen: `auth-mfa:screen:${MFA_DISABLE_SCREEN_ID}`,
|
|
44
47
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: true },
|
|
45
48
|
},
|
|
46
|
-
{
|
|
49
|
+
{
|
|
50
|
+
kind: "screen",
|
|
51
|
+
chromeless: true,
|
|
52
|
+
id: "sessions",
|
|
53
|
+
screen: `sessions:screen:${SESSION_MINE_SCREEN_ID}`,
|
|
54
|
+
},
|
|
47
55
|
],
|
|
48
56
|
});
|
|
49
57
|
if (nav !== undefined) {
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import type { DashboardPanelDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
3
|
import { type MetricDefinition } from "../metrics/index.ts";
|
|
3
4
|
export type CreateAdminShellOptions = {
|
|
4
5
|
/** Short workspace id for tenant operators (URL segment). Default `tenant-admin`. */
|
|
@@ -24,5 +25,7 @@ export type CreateAdminShellOptions = {
|
|
|
24
25
|
* createMetricsFeature / createSystemMetricsFeature. Panels exist only for
|
|
25
26
|
* ids in this list. Default DEFAULT_METRICS. */
|
|
26
27
|
readonly metrics?: readonly MetricDefinition[];
|
|
28
|
+
/** Panels appended to the platform overview, for tiles a mounted feature owns (e.g. the contact inbox count). */
|
|
29
|
+
readonly extraPlatformPanels?: readonly DashboardPanelDefinition[];
|
|
27
30
|
};
|
|
28
31
|
export declare function createAdminShellFeature(options?: CreateAdminShellOptions): FeatureDefinition;
|
|
@@ -91,7 +91,7 @@ export function createAdminShellFeature(options = {}) {
|
|
|
91
91
|
timeRange: OVERVIEW_TIME_RANGE,
|
|
92
92
|
// The picker needs a SystemAdmin {rows:{value,label}} tenant query; only cap-overview ships one.
|
|
93
93
|
...(includeCapOverview && { filter: PLATFORM_TENANT_FILTER }),
|
|
94
|
-
panels: [...platformOverviewPanels(metrics)],
|
|
94
|
+
panels: [...platformOverviewPanels(metrics), ...(options.extraPlatformPanels ?? [])],
|
|
95
95
|
});
|
|
96
96
|
r.nav({
|
|
97
97
|
id: "platform-overview",
|
|
@@ -203,6 +203,7 @@ function buildHandlerEntry(qn, kind, def, roles, getHandlerEntity, denyQns) {
|
|
|
203
203
|
kind,
|
|
204
204
|
...(description !== undefined && { description }),
|
|
205
205
|
risk: exposure.risk,
|
|
206
|
+
...(exposure.effect !== undefined && { effect: exposure.effect }),
|
|
206
207
|
inputSchema,
|
|
207
208
|
...(entity !== undefined && { entity }),
|
|
208
209
|
...(excludedFields !== undefined && { excludedFields }),
|
|
@@ -426,6 +426,7 @@ function addWriteHandlerTools(manifest, detailQnByEntity, denyQns, sink) {
|
|
|
426
426
|
op: "write",
|
|
427
427
|
qn: handler.qn,
|
|
428
428
|
risk: handler.risk,
|
|
429
|
+
...(handler.effect !== undefined && { effect: handler.effect }),
|
|
429
430
|
...(handler.entity !== undefined && { entity: handler.entity }),
|
|
430
431
|
...(detailQn !== undefined && { detailQn }),
|
|
431
432
|
...(injectsVersion && { injectsVersion: true }),
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { AgentRisk, EntityDefinition, FeatureDefinition, NavDefinition, QueryHandlerDef, ScreenDefinition, TranslationKeys, WorkspaceDefinition, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
1
|
+
import type { AgentEffect, AgentRisk, EntityDefinition, FeatureDefinition, NavDefinition, QueryHandlerDef, ScreenDefinition, TranslationKeys, WorkspaceDefinition, WriteHandlerDef } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
export type AgentToolMode = "read-only" | "approval" | "edit";
|
|
3
3
|
export type ToolCatalogOptions = {
|
|
4
4
|
readonly mode: AgentToolMode;
|
|
@@ -59,6 +59,8 @@ export type ToolDispatchDescriptor = {
|
|
|
59
59
|
readonly op: "write";
|
|
60
60
|
readonly qn: string;
|
|
61
61
|
readonly risk: AgentRisk;
|
|
62
|
+
/** "proposal": the write changes a suggestion a person still approves, so no approval step. */
|
|
63
|
+
readonly effect?: AgentEffect;
|
|
62
64
|
readonly entity?: string;
|
|
63
65
|
/** `<feature>:query:<entity>:detail` QN when one is mounted and readable.
|
|
64
66
|
* Dispatch reads the current `version` from it before an optimistic-lock
|
|
@@ -128,6 +130,7 @@ export type AgentManifestHandler = {
|
|
|
128
130
|
readonly kind: "query" | "write";
|
|
129
131
|
readonly description?: string;
|
|
130
132
|
readonly risk: AgentRisk;
|
|
133
|
+
readonly effect?: AgentEffect;
|
|
131
134
|
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
132
135
|
readonly entity?: string;
|
|
133
136
|
/** Fields this generic create/update handler never writes; sending one fails validation. */
|
|
@@ -14,6 +14,7 @@ export const AUDIT_EVENT_STANCES = {
|
|
|
14
14
|
"inbound-mail-foundation:event:inbound-message-received": TECHNICAL_EVENT,
|
|
15
15
|
"inbound-mail-foundation:event:inbound-message-content-fetched": TECHNICAL_EVENT,
|
|
16
16
|
"inbound-mail-foundation:event:mail-thread-updated": TECHNICAL_EVENT,
|
|
17
|
+
"document-ingest-foundation:event:document-ingest-progress": TECHNICAL_EVENT,
|
|
17
18
|
"document-ingest-foundation:event:document-ingest-requested": TECHNICAL_EVENT,
|
|
18
19
|
"document-ingest-foundation:event:document-ingest-skipped": TECHNICAL_EVENT,
|
|
19
20
|
"tenant-lifecycle:event:tenant-destruction-stage-started": TECHNICAL_EVENT,
|
|
@@ -141,6 +141,7 @@ function isMailingOutcome(outcome) {
|
|
|
141
141
|
return outcome === "invited" || outcome === "resent";
|
|
142
142
|
}
|
|
143
143
|
// A one-shot operator process, not a tenant request: it looks up users, memberships and invitations across tenants.
|
|
144
|
+
// guard:dup-ok the single runInSystemRowLevelSecurityScope call with this entry point's own reason
|
|
144
145
|
export function bootstrapTenants(deps, plan) {
|
|
145
146
|
return runInSystemRowLevelSecurityScope("boot tenant bootstrap creates tenants and memberships before any tenant exists", () => bootstrapTenantsInScope(deps, plan));
|
|
146
147
|
}
|
|
@@ -1,82 +1,57 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unprocessable } from "../shared/index.js";
|
|
2
2
|
import { AuthErrors } from "./web/constants.js";
|
|
3
3
|
// @wrapper-known error-helper
|
|
4
4
|
export function invalidCredentials() {
|
|
5
|
-
return
|
|
6
|
-
i18nKey: "auth.errors.invalidCredentials",
|
|
7
|
-
}));
|
|
5
|
+
return unprocessable(AuthErrors.invalidCredentials, "auth.errors.invalidCredentials");
|
|
8
6
|
}
|
|
9
7
|
// @wrapper-known error-helper
|
|
10
8
|
export function invalidInviteToken() {
|
|
11
|
-
return
|
|
12
|
-
i18nKey: "auth.errors.invalidInviteToken",
|
|
13
|
-
}));
|
|
9
|
+
return unprocessable(AuthErrors.invalidInviteToken, "auth.errors.invalidInviteToken");
|
|
14
10
|
}
|
|
15
11
|
// @wrapper-known error-helper
|
|
16
12
|
export function inviteEmailMismatch() {
|
|
17
|
-
return
|
|
18
|
-
i18nKey: "auth.errors.inviteEmailMismatch",
|
|
19
|
-
}));
|
|
13
|
+
return unprocessable(AuthErrors.inviteEmailMismatch, "auth.errors.inviteEmailMismatch");
|
|
20
14
|
}
|
|
21
15
|
// @wrapper-known error-helper
|
|
22
16
|
export function inviteAlreadyAccepted() {
|
|
23
|
-
return
|
|
24
|
-
i18nKey: "auth.errors.inviteAlreadyAccepted",
|
|
25
|
-
}));
|
|
17
|
+
return unprocessable(AuthErrors.inviteAlreadyAccepted, "auth.errors.inviteAlreadyAccepted");
|
|
26
18
|
}
|
|
27
19
|
// @wrapper-known error-helper
|
|
28
20
|
export function invalidResetToken() {
|
|
29
|
-
return
|
|
30
|
-
i18nKey: "auth.errors.invalidResetToken",
|
|
31
|
-
}));
|
|
21
|
+
return unprocessable(AuthErrors.invalidResetToken, "auth.errors.invalidResetToken");
|
|
32
22
|
}
|
|
33
23
|
// @wrapper-known error-helper
|
|
34
24
|
export function invalidUnlockToken() {
|
|
35
|
-
return
|
|
36
|
-
i18nKey: "auth.errors.invalidUnlockToken",
|
|
37
|
-
}));
|
|
25
|
+
return unprocessable(AuthErrors.invalidUnlockToken, "auth.errors.invalidUnlockToken");
|
|
38
26
|
}
|
|
39
27
|
// @wrapper-known error-helper
|
|
40
28
|
export function invalidVerificationToken() {
|
|
41
|
-
return
|
|
42
|
-
i18nKey: "auth.errors.invalidVerificationToken",
|
|
43
|
-
}));
|
|
29
|
+
return unprocessable(AuthErrors.invalidVerificationToken, "auth.errors.invalidVerificationToken");
|
|
44
30
|
}
|
|
45
31
|
// @wrapper-known error-helper
|
|
46
32
|
export function invalidSignupToken() {
|
|
47
|
-
return
|
|
48
|
-
i18nKey: "auth.errors.invalidSignupToken",
|
|
49
|
-
}));
|
|
33
|
+
return unprocessable(AuthErrors.invalidSignupToken, "auth.errors.invalidSignupToken");
|
|
50
34
|
}
|
|
51
35
|
// @wrapper-known error-helper
|
|
52
36
|
export function signupEmailAlreadyRegistered() {
|
|
53
|
-
return
|
|
54
|
-
i18nKey: "auth.errors.signupEmailAlreadyRegistered",
|
|
55
|
-
}));
|
|
37
|
+
return unprocessable(AuthErrors.signupEmailAlreadyRegistered, "auth.errors.signupEmailAlreadyRegistered");
|
|
56
38
|
}
|
|
57
39
|
// @wrapper-known error-helper
|
|
58
40
|
export function noMembership() {
|
|
59
|
-
return
|
|
60
|
-
i18nKey: "auth.errors.noMembership",
|
|
61
|
-
}));
|
|
41
|
+
return unprocessable(AuthErrors.noMembership, "auth.errors.noMembership");
|
|
62
42
|
}
|
|
63
43
|
// @wrapper-known error-helper
|
|
64
44
|
export function emailNotVerified() {
|
|
65
|
-
return
|
|
66
|
-
i18nKey: "auth.errors.emailNotVerified",
|
|
67
|
-
}));
|
|
45
|
+
return unprocessable(AuthErrors.emailNotVerified, "auth.errors.emailNotVerified");
|
|
68
46
|
}
|
|
69
47
|
// retryAfterSeconds drives the login/signup UI countdown — must stay > 0.
|
|
70
48
|
// @wrapper-known error-helper
|
|
71
49
|
export function accountLocked(retryAfterSeconds) {
|
|
72
|
-
return
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
}));
|
|
50
|
+
return unprocessable(AuthErrors.accountLocked, "auth.errors.accountLocked", {
|
|
51
|
+
retryAfterSeconds,
|
|
52
|
+
});
|
|
76
53
|
}
|
|
77
54
|
// @wrapper-known error-helper
|
|
78
55
|
export function accountRestricted() {
|
|
79
|
-
return
|
|
80
|
-
i18nKey: "auth.errors.accountRestricted",
|
|
81
|
-
}));
|
|
56
|
+
return unprocessable(AuthErrors.accountRestricted, "auth.errors.accountRestricted");
|
|
82
57
|
}
|
|
@@ -7,7 +7,7 @@ import { AuthHandlers } from "../web/constants.js";
|
|
|
7
7
|
export const loginOptionsQuery = defineQueryHandler({
|
|
8
8
|
name: "login-options",
|
|
9
9
|
schema: z.object({}),
|
|
10
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
10
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
11
11
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
12
12
|
description: "Reports which optional login-page flows (password reset, account unlock) are available, readable without signing in, so the login screen links only to flows that exist.",
|
|
13
13
|
handler: async (_query, ctx) => ({
|
|
@@ -12,7 +12,7 @@ import { AUTH_SELF_REGISTRATION_FEATURE } from "../self-registration-toggle.js";
|
|
|
12
12
|
export const selfRegistrationStatusQuery = defineQueryHandler({
|
|
13
13
|
name: "signup-registration-status",
|
|
14
14
|
schema: z.object({}),
|
|
15
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
15
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
16
16
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
17
17
|
description: "Reports whether self-registration is currently switched on, readable without signing in, so a signup page can hide its own form instead of collecting an address that would be silently ignored.",
|
|
18
18
|
handler: async (_query, ctx) => {
|
|
@@ -50,42 +50,18 @@ export type AuthTokenFailure = {
|
|
|
50
50
|
};
|
|
51
51
|
export type ResetPasswordFailure = AuthTokenFailure;
|
|
52
52
|
export type VerifyEmailFailure = AuthTokenFailure;
|
|
53
|
-
|
|
53
|
+
type AuthTokenResult = {
|
|
54
54
|
ok: true;
|
|
55
55
|
} | {
|
|
56
56
|
ok: false;
|
|
57
57
|
error: AuthTokenFailure;
|
|
58
|
-
}
|
|
59
|
-
export declare function
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
export declare function requestEmailVerification(email: string): Promise<{
|
|
66
|
-
ok: true;
|
|
67
|
-
} | {
|
|
68
|
-
ok: false;
|
|
69
|
-
error: AuthTokenFailure;
|
|
70
|
-
}>;
|
|
71
|
-
export declare function verifyEmail(token: string): Promise<{
|
|
72
|
-
ok: true;
|
|
73
|
-
} | {
|
|
74
|
-
ok: false;
|
|
75
|
-
error: AuthTokenFailure;
|
|
76
|
-
}>;
|
|
77
|
-
export declare function requestAccountUnlock(email: string): Promise<{
|
|
78
|
-
ok: true;
|
|
79
|
-
} | {
|
|
80
|
-
ok: false;
|
|
81
|
-
error: AuthTokenFailure;
|
|
82
|
-
}>;
|
|
83
|
-
export declare function confirmAccountUnlock(token: string): Promise<{
|
|
84
|
-
ok: true;
|
|
85
|
-
} | {
|
|
86
|
-
ok: false;
|
|
87
|
-
error: AuthTokenFailure;
|
|
88
|
-
}>;
|
|
58
|
+
};
|
|
59
|
+
export declare function requestPasswordReset(email: string, returnTo?: string): Promise<AuthTokenResult>;
|
|
60
|
+
export declare function resetPassword(token: string, newPassword: string): Promise<AuthTokenResult>;
|
|
61
|
+
export declare function requestEmailVerification(email: string): Promise<AuthTokenResult>;
|
|
62
|
+
export declare function verifyEmail(token: string): Promise<AuthTokenResult>;
|
|
63
|
+
export declare function requestAccountUnlock(email: string): Promise<AuthTokenResult>;
|
|
64
|
+
export declare function confirmAccountUnlock(token: string): Promise<AuthTokenResult>;
|
|
89
65
|
export declare function requestSignup(email: string, handover?: {
|
|
90
66
|
readonly entityType: string;
|
|
91
67
|
readonly token: string;
|
|
@@ -90,21 +90,27 @@ async function parseTokenFailure(res) {
|
|
|
90
90
|
const reason = body.error?.details?.reason ?? body.error?.code ?? "unknown";
|
|
91
91
|
return { reason };
|
|
92
92
|
}
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
// enumeration. Server only triggers the mail internally when a user is
|
|
96
|
-
// found. 429 → typed rate-limit failure. 5xx → unknown-error.
|
|
97
|
-
export async function requestPasswordReset(email, returnTo) {
|
|
98
|
-
const res = await fetch("/api/auth/request-password-reset", {
|
|
93
|
+
async function postTokenRequest(path, payload) {
|
|
94
|
+
const res = await fetch(path, {
|
|
99
95
|
method: "POST",
|
|
100
96
|
credentials: "same-origin",
|
|
101
97
|
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
102
|
-
body: JSON.stringify(
|
|
98
|
+
body: JSON.stringify(payload),
|
|
103
99
|
});
|
|
104
100
|
if (res.ok)
|
|
105
101
|
return { ok: true };
|
|
106
102
|
return { ok: false, error: await parseTokenFailure(res) };
|
|
107
103
|
}
|
|
104
|
+
// POST /api/auth/request-password-reset. 200 silent-success: even if the
|
|
105
|
+
// email doesn't exist, the caller sees `{ ok: true }` — no account
|
|
106
|
+
// enumeration. Server only triggers the mail internally when a user is
|
|
107
|
+
// found. 429 → typed rate-limit failure. 5xx → unknown-error.
|
|
108
|
+
export async function requestPasswordReset(email, returnTo) {
|
|
109
|
+
return postTokenRequest("/api/auth/request-password-reset", {
|
|
110
|
+
email,
|
|
111
|
+
...(returnTo !== undefined && { returnTo }),
|
|
112
|
+
});
|
|
113
|
+
}
|
|
108
114
|
// POST /api/auth/reset-password. The token comes from the URL and the
|
|
109
115
|
// request includes the new password. On 422, the server collapses all
|
|
110
116
|
// token-verification errors (malformed, bad signature, expired) into the
|
|
@@ -112,55 +118,23 @@ export async function requestPasswordReset(email, returnTo) {
|
|
|
112
118
|
// failures (newPassword < 8) use a separate 4xx code, "validation_failed".
|
|
113
119
|
// The UI maps reason to an i18n key.
|
|
114
120
|
export async function resetPassword(token, newPassword) {
|
|
115
|
-
|
|
116
|
-
method: "POST",
|
|
117
|
-
credentials: "same-origin",
|
|
118
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
119
|
-
body: JSON.stringify({ token, newPassword }),
|
|
120
|
-
});
|
|
121
|
-
if (res.ok)
|
|
122
|
-
return { ok: true };
|
|
123
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
121
|
+
return postTokenRequest("/api/auth/reset-password", { token, newPassword });
|
|
124
122
|
}
|
|
125
123
|
// POST /api/auth/request-email-verification. Same silent-success
|
|
126
124
|
// semantics as request-password-reset. 429 → rate-limit failure.
|
|
127
125
|
export async function requestEmailVerification(email) {
|
|
128
|
-
|
|
129
|
-
method: "POST",
|
|
130
|
-
credentials: "same-origin",
|
|
131
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
132
|
-
body: JSON.stringify({ email }),
|
|
133
|
-
});
|
|
134
|
-
if (res.ok)
|
|
135
|
-
return { ok: true };
|
|
136
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
126
|
+
return postTokenRequest("/api/auth/request-email-verification", { email });
|
|
137
127
|
}
|
|
138
128
|
// POST /api/auth/verify-email. VerifyEmailScreen submits this automatically
|
|
139
129
|
// after parsing `?token=...`. The server collapses all verification failures
|
|
140
130
|
// into `invalid_verification_token` to prevent enumeration, as with reset.
|
|
141
131
|
export async function verifyEmail(token) {
|
|
142
|
-
|
|
143
|
-
method: "POST",
|
|
144
|
-
credentials: "same-origin",
|
|
145
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
146
|
-
body: JSON.stringify({ token }),
|
|
147
|
-
});
|
|
148
|
-
if (res.ok)
|
|
149
|
-
return { ok: true };
|
|
150
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
132
|
+
return postTokenRequest("/api/auth/verify-email", { token });
|
|
151
133
|
}
|
|
152
134
|
// POST /api/auth/request-account-unlock. Same silent-success semantics as
|
|
153
135
|
// request-password-reset. 429 → rate-limit failure.
|
|
154
136
|
export async function requestAccountUnlock(email) {
|
|
155
|
-
|
|
156
|
-
method: "POST",
|
|
157
|
-
credentials: "same-origin",
|
|
158
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
159
|
-
body: JSON.stringify({ email }),
|
|
160
|
-
});
|
|
161
|
-
if (res.ok)
|
|
162
|
-
return { ok: true };
|
|
163
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
137
|
+
return postTokenRequest("/api/auth/request-account-unlock", { email });
|
|
164
138
|
}
|
|
165
139
|
// POST /api/auth/confirm-account-unlock. Auto-submitted by
|
|
166
140
|
// ConfirmAccountUnlockScreen after parsing `?token=...`. Server collapses
|
|
@@ -168,15 +142,7 @@ export async function requestAccountUnlock(email) {
|
|
|
168
142
|
// parallel to reset/verify). Only clears the Redis lockout state, no
|
|
169
143
|
// entity write.
|
|
170
144
|
export async function confirmAccountUnlock(token) {
|
|
171
|
-
|
|
172
|
-
method: "POST",
|
|
173
|
-
credentials: "same-origin",
|
|
174
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
175
|
-
body: JSON.stringify({ token }),
|
|
176
|
-
});
|
|
177
|
-
if (res.ok)
|
|
178
|
-
return { ok: true };
|
|
179
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
145
|
+
return postTokenRequest("/api/auth/confirm-account-unlock", { token });
|
|
180
146
|
}
|
|
181
147
|
// POST /api/auth/signup-request. Always returns 200 to prevent enumeration;
|
|
182
148
|
// the response does not reveal whether the email is already registered. The
|
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
// string, so anything read back from it is untrusted: only same-origin
|
|
3
3
|
// root-relative paths pass (no "//host", no "/\host", no scheme).
|
|
4
4
|
import { appendReturnTo, NEXT_QUERY_PARAM } from "./login-url.js";
|
|
5
|
+
import { readPathParam } from "./read-path-param.js";
|
|
5
6
|
import { isSafeReturnPath, readReturnToFromSearch } from "./return-path.js";
|
|
6
7
|
export { appendReturnTo, NEXT_QUERY_PARAM };
|
|
7
8
|
export const isSafeNextPath = isSafeReturnPath;
|
|
8
9
|
export function readNextFromSearch(search) {
|
|
9
|
-
|
|
10
|
-
return isSafeNextPath(candidate) ? candidate : null;
|
|
10
|
+
return readPathParam(search, NEXT_QUERY_PARAM, isSafeNextPath);
|
|
11
11
|
}
|
|
12
12
|
// The returnTo a mail link or sibling auth page carried in this page's own URL; null on native, where there is no window.
|
|
13
13
|
export function readReturnToFromWindow() {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
export type ConfirmAccountUnlockScreenProps = {
|
|
3
3
|
readonly title?: string;
|
|
4
4
|
/** Override for the token from the URL. Default: parsed from `?token=...`. */
|
|
@@ -6,4 +6,4 @@ export type ConfirmAccountUnlockScreenProps = {
|
|
|
6
6
|
/** href for the "go to sign in" link. Default "/login". */
|
|
7
7
|
readonly loginHref?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function ConfirmAccountUnlockScreen({ title, token
|
|
9
|
+
export declare function ConfirmAccountUnlockScreen({ title, token, loginHref, }: ConfirmAccountUnlockScreenProps): ReactNode;
|
|
@@ -1,42 +1,21 @@
|
|
|
1
|
-
import { jsx as _jsx
|
|
1
|
+
import { jsx as _jsx } from "react/jsx-runtime";
|
|
2
2
|
// ConfirmAccountUnlockScreen — reads `?token=...` from the URL, auto-posts
|
|
3
3
|
// it to /api/auth/confirm-account-unlock on mount, shows success/error.
|
|
4
4
|
// Idempotent server-side (clearLockoutState is a no-op when already
|
|
5
5
|
// unlocked), so no re-submit risk. Mirrors VerifyEmailScreen 1:1.
|
|
6
|
-
|
|
7
|
-
// useEffect with empty deps + a once-guard so React Strict Mode's double
|
|
8
|
-
// useEffect dispatch in dev fires the confirm call only once.
|
|
9
|
-
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
10
|
-
import { useEffect, useRef, useState } from "react";
|
|
6
|
+
import { useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
11
7
|
import { confirmAccountUnlock } from "./auth-client.js";
|
|
12
|
-
import {
|
|
13
|
-
|
|
8
|
+
import { TokenConfirmScreen } from "./token-confirm-screen.js";
|
|
9
|
+
// guard:dup-ok TokenConfirmScreen holds the logic; each screen only supplies its own literal label keys
|
|
10
|
+
export function ConfirmAccountUnlockScreen({ title, token, loginHref = "/login", }) {
|
|
14
11
|
const t = useTranslation();
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
return;
|
|
25
|
-
startedRef.current = true;
|
|
26
|
-
void (async () => {
|
|
27
|
-
const res = await confirmAccountUnlock(token);
|
|
28
|
-
setStatus(res.ok ? "success" : "error");
|
|
29
|
-
})();
|
|
30
|
-
}, [status, token]);
|
|
31
|
-
if (status === "missing-token") {
|
|
32
|
-
return (_jsxs(AuthCard, { title: title ?? t("auth.unlockAccount.errorTitle"), children: [_jsx("p", { className: "text-sm text-muted-foreground", children: t("auth.unlockAccount.missingToken") }), _jsx(Link, { href: loginHref, variant: "muted", children: t("auth.unlockAccount.goToLogin") })] }));
|
|
33
|
-
}
|
|
34
|
-
if (status === "verifying") {
|
|
35
|
-
return (_jsx(AuthCard, { children: _jsx("div", { className: "p-6", children: _jsx("p", { className: "text-sm text-muted-foreground", role: "status", children: t("auth.unlockAccount.verifying") }) }) }));
|
|
36
|
-
}
|
|
37
|
-
if (status === "success") {
|
|
38
|
-
return (_jsxs(AuthCard, { title: title ?? t("auth.unlockAccount.successTitle"), children: [_jsx("p", { className: "text-sm text-muted-foreground", children: t("auth.unlockAccount.successBody") }), _jsx(Link, { href: loginHref, variant: "button", children: t("auth.unlockAccount.goToLogin") })] }));
|
|
39
|
-
}
|
|
40
|
-
// status === "error"
|
|
41
|
-
return (_jsxs(AuthCard, { title: title ?? t("auth.unlockAccount.errorTitle"), children: [_jsx("p", { className: "text-sm text-muted-foreground", children: t("auth.unlockAccount.errorBody") }), _jsx(Link, { href: loginHref, variant: "muted", children: t("auth.unlockAccount.goToLogin") })] }));
|
|
12
|
+
return (_jsx(TokenConfirmScreen, { title: title, token: token, loginHref: loginHref, confirm: confirmAccountUnlock, labels: {
|
|
13
|
+
errorTitle: t("auth.unlockAccount.errorTitle"),
|
|
14
|
+
missingToken: t("auth.unlockAccount.missingToken"),
|
|
15
|
+
goToLogin: t("auth.unlockAccount.goToLogin"),
|
|
16
|
+
verifying: t("auth.unlockAccount.verifying"),
|
|
17
|
+
successTitle: t("auth.unlockAccount.successTitle"),
|
|
18
|
+
successBody: t("auth.unlockAccount.successBody"),
|
|
19
|
+
errorBody: t("auth.unlockAccount.errorBody"),
|
|
20
|
+
} }));
|
|
42
21
|
}
|
|
@@ -9,6 +9,7 @@ export type { EmailPasswordClientFeature, EmailPasswordClientOptions, } from "./
|
|
|
9
9
|
export { emailPasswordClient } from "./client-plugin.ts";
|
|
10
10
|
export type { ConfirmAccountUnlockScreenProps } from "./confirm-account-unlock-screen.tsx";
|
|
11
11
|
export { ConfirmAccountUnlockScreen } from "./confirm-account-unlock-screen.tsx";
|
|
12
|
+
export { AuthHandlers } from "./constants.ts";
|
|
12
13
|
export type { DefaultTopbarActionsProps } from "./default-topbar-actions.tsx";
|
|
13
14
|
export { DefaultTopbarActions } from "./default-topbar-actions.tsx";
|
|
14
15
|
export type { ForgotPasswordScreenProps } from "./forgot-password-screen.tsx";
|
|
@@ -9,6 +9,7 @@ export { createLoginRoute, makeAuthGate, makeSessionAuthGate } from "./auth-gate
|
|
|
9
9
|
export { buildLoginRedirectUrl, isSafeNextPath, NEXT_QUERY_PARAM, readNextFromSearch, } from "./auth-redirect.js";
|
|
10
10
|
export { emailPasswordClient } from "./client-plugin.js";
|
|
11
11
|
export { ConfirmAccountUnlockScreen } from "./confirm-account-unlock-screen.js";
|
|
12
|
+
export { AuthHandlers } from "./constants.js";
|
|
12
13
|
export { DefaultTopbarActions } from "./default-topbar-actions.js";
|
|
13
14
|
export { ForgotPasswordScreen } from "./forgot-password-screen.js";
|
|
14
15
|
export { defaultTranslations, mergeTranslations } from "./i18n.js";
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export declare function readPathParam(search: string, paramName: string, isSafePath: (candidate: unknown) => candidate is string): string | null;
|
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
// Shared by the server (mail link) and the web pages (landing page), so it is plain string logic:
|
|
2
2
|
// no DOM, no window, no `new URL` (React Native's URL getters throw).
|
|
3
|
+
import { readPathParam } from "./read-path-param.js";
|
|
3
4
|
export const RETURN_TO_QUERY_PARAM = "returnTo";
|
|
4
5
|
export const MAX_RETURN_PATH_LENGTH = 2048;
|
|
5
6
|
const DOT_SEGMENTS = new Set([".", "..", ".%2e", "%2e.", "%2e%2e", "%2e"]);
|
|
@@ -29,6 +30,5 @@ export function isSafeReturnPath(candidate) {
|
|
|
29
30
|
return !hasForbiddenCharacter(candidate) && !hasDotSegment(candidate);
|
|
30
31
|
}
|
|
31
32
|
export function readReturnToFromSearch(search) {
|
|
32
|
-
|
|
33
|
-
return isSafeReturnPath(candidate) ? candidate : null;
|
|
33
|
+
return readPathParam(search, RETURN_TO_QUERY_PARAM, isSafeReturnPath);
|
|
34
34
|
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { type ReactNode } from "react";
|
|
2
|
+
export type TokenConfirmLabels = {
|
|
3
|
+
readonly errorTitle: string;
|
|
4
|
+
readonly missingToken: string;
|
|
5
|
+
readonly goToLogin: string;
|
|
6
|
+
readonly verifying: string;
|
|
7
|
+
readonly successTitle: string;
|
|
8
|
+
readonly successBody: string;
|
|
9
|
+
readonly errorBody: string;
|
|
10
|
+
};
|
|
11
|
+
export type TokenConfirmScreenProps = {
|
|
12
|
+
readonly title?: string | undefined;
|
|
13
|
+
readonly token?: string | undefined;
|
|
14
|
+
readonly loginHref: string;
|
|
15
|
+
readonly confirm: (token: string) => Promise<{
|
|
16
|
+
readonly ok: boolean;
|
|
17
|
+
}>;
|
|
18
|
+
readonly labels: TokenConfirmLabels;
|
|
19
|
+
};
|
|
20
|
+
export declare function TokenConfirmScreen({ title, token: tokenProp, loginHref, confirm, labels, }: TokenConfirmScreenProps): ReactNode;
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
// Reads `?token=...` from the URL, auto-posts it on mount and shows success/error. The server
|
|
3
|
+
// side is idempotent, so a repeated call is safe.
|
|
4
|
+
//
|
|
5
|
+
// useEffect with empty deps + a once-guard so React Strict Mode's double
|
|
6
|
+
// useEffect dispatch in dev fires the confirm call only once.
|
|
7
|
+
import { usePrimitives } from "@cosmicdrift/kumiko-renderer";
|
|
8
|
+
import { useEffect, useRef, useState } from "react";
|
|
9
|
+
import { AuthCard, useUrlToken } from "./auth-form-primitives.js";
|
|
10
|
+
export function TokenConfirmScreen({ title, token: tokenProp, loginHref, confirm, labels, }) {
|
|
11
|
+
const { Link } = usePrimitives();
|
|
12
|
+
const token = useUrlToken(tokenProp);
|
|
13
|
+
const [status, setStatus] = useState(token === "" ? "missing-token" : "verifying");
|
|
14
|
+
const startedRef = useRef(false);
|
|
15
|
+
// kumiko-lint-ignore no-raw-hooks not yet converted to the framework hook set
|
|
16
|
+
useEffect(() => {
|
|
17
|
+
if (status !== "verifying")
|
|
18
|
+
return;
|
|
19
|
+
if (startedRef.current)
|
|
20
|
+
return;
|
|
21
|
+
startedRef.current = true;
|
|
22
|
+
void (async () => {
|
|
23
|
+
const res = await confirm(token);
|
|
24
|
+
setStatus(res.ok ? "success" : "error");
|
|
25
|
+
})();
|
|
26
|
+
}, [status, token, confirm]);
|
|
27
|
+
if (status === "missing-token") {
|
|
28
|
+
return (_jsxs(AuthCard, { title: title ?? labels.errorTitle, children: [_jsx("p", { className: "text-sm text-muted-foreground", children: labels.missingToken }), _jsx(Link, { href: loginHref, variant: "muted", children: labels.goToLogin })] }));
|
|
29
|
+
}
|
|
30
|
+
if (status === "verifying") {
|
|
31
|
+
return (_jsx(AuthCard, { children: _jsx("div", { className: "p-6", children: _jsx("p", { className: "text-sm text-muted-foreground", role: "status", children: labels.verifying }) }) }));
|
|
32
|
+
}
|
|
33
|
+
if (status === "success") {
|
|
34
|
+
return (_jsxs(AuthCard, { title: title ?? labels.successTitle, children: [_jsx("p", { className: "text-sm text-muted-foreground", children: labels.successBody }), _jsx(Link, { href: loginHref, variant: "button", children: labels.goToLogin })] }));
|
|
35
|
+
}
|
|
36
|
+
// status === "error"
|
|
37
|
+
return (_jsxs(AuthCard, { title: title ?? labels.errorTitle, children: [_jsx("p", { className: "text-sm text-muted-foreground", children: labels.errorBody }), _jsx(Link, { href: loginHref, variant: "muted", children: labels.goToLogin })] }));
|
|
38
|
+
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import type { ReactNode } from "react";
|
|
2
2
|
export type VerifyEmailScreenProps = {
|
|
3
3
|
readonly title?: string;
|
|
4
4
|
/** Override the token from the URL. Default: parsed from `?token=...`. */
|
|
@@ -6,4 +6,4 @@ export type VerifyEmailScreenProps = {
|
|
|
6
6
|
/** href for the "Zum Login" link. Default "/login". */
|
|
7
7
|
readonly loginHref?: string;
|
|
8
8
|
};
|
|
9
|
-
export declare function VerifyEmailScreen({ title, token
|
|
9
|
+
export declare function VerifyEmailScreen({ title, token, loginHref, }: VerifyEmailScreenProps): ReactNode;
|