@cosmicdrift/kumiko-samples 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/package.json +1 -1
- package/packages/bundled-features/package.json +31 -4
- package/packages/bundled-features/src/account-security/feature.ts +9 -1
- package/packages/bundled-features/src/admin-shell/changes.json +6 -0
- package/packages/bundled-features/src/admin-shell/feature.ts +4 -1
- package/packages/bundled-features/src/agent-tools/agent-manifest.ts +1 -0
- package/packages/bundled-features/src/agent-tools/changes.json +6 -0
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +1 -0
- package/packages/bundled-features/src/agent-tools/types.ts +4 -0
- package/packages/bundled-features/src/audit/event-classification.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +18 -66
- package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +30 -64
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +20 -66
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -0
- package/packages/bundled-features/src/auth-email-password/web/read-path-param.ts +8 -0
- package/packages/bundled-features/src/auth-email-password/web/return-path.ts +3 -2
- package/packages/bundled-features/src/auth-email-password/web/token-confirm-screen.tsx +97 -0
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +20 -68
- package/packages/bundled-features/src/auth-foundation/boot-checks.ts +22 -15
- package/packages/bundled-features/src/auth-foundation/boot-rules.ts +33 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +12 -42
- package/packages/bundled-features/src/auth-mfa/feature-exports.ts +6 -45
- package/packages/bundled-features/src/auth-mfa/feature.ts +8 -19
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +19 -33
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -0
- package/packages/bundled-features/src/billing-foundation/web/plan-price.ts +20 -7
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +1 -0
- package/packages/bundled-features/src/channel-in-app/changes.json +7 -0
- package/packages/bundled-features/src/channel-in-app/feature.ts +2 -0
- package/packages/bundled-features/src/channel-in-app/handlers/read-state-by-keys.query.ts +35 -0
- package/packages/bundled-features/src/channel-in-app/in-app-channel.ts +1 -0
- package/packages/bundled-features/src/channel-in-app/tables.ts +5 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +4 -1
- package/packages/bundled-features/src/contact/challenge.ts +41 -0
- package/packages/bundled-features/src/contact/changes.json +33 -0
- package/packages/bundled-features/src/contact/client/contact-client-source.ts +203 -0
- package/packages/bundled-features/src/contact/client/contact-website-client.ts +29 -0
- package/packages/bundled-features/src/contact/client/index.ts +9 -0
- package/packages/bundled-features/src/contact/entity.ts +168 -0
- package/packages/bundled-features/src/contact/feature.ts +174 -0
- package/packages/bundled-features/src/contact/handlers/access.ts +17 -0
- package/packages/bundled-features/src/contact/handlers/attempts.ts +76 -0
- package/packages/bundled-features/src/contact/handlers/challenge.query.ts +44 -0
- package/packages/bundled-features/src/contact/handlers/forward-request.write.ts +98 -0
- package/packages/bundled-features/src/contact/handlers/mark-done.write.ts +40 -0
- package/packages/bundled-features/src/contact/handlers/notify-reporter-in-app.write.ts +48 -0
- package/packages/bundled-features/src/contact/handlers/open-count.query.ts +15 -0
- package/packages/bundled-features/src/contact/handlers/open-count.ts +17 -0
- package/packages/bundled-features/src/contact/handlers/replies.query.ts +29 -0
- package/packages/bundled-features/src/contact/handlers/reply.write.ts +197 -0
- package/packages/bundled-features/src/contact/handlers/report.write.ts +126 -0
- package/packages/bundled-features/src/contact/handlers/request-delivery.query.ts +143 -0
- package/packages/bundled-features/src/contact/handlers/request-detail.query.ts +50 -0
- package/packages/bundled-features/src/contact/handlers/request-list.query.ts +14 -0
- package/packages/bundled-features/src/contact/handlers/send-reply-mail.write.ts +124 -0
- package/packages/bundled-features/src/contact/handlers/send-test.write.ts +45 -0
- package/packages/bundled-features/src/contact/handlers/submit.write.ts +194 -0
- package/packages/bundled-features/src/contact/handlers/take-over-uploads.ts +47 -0
- package/packages/bundled-features/src/contact/i18n.ts +192 -0
- package/packages/bundled-features/src/contact/index.ts +29 -0
- package/packages/bundled-features/src/contact/lib.ts +176 -0
- package/packages/bundled-features/src/contact/mail.ts +401 -0
- package/packages/bundled-features/src/contact/options.ts +95 -0
- package/packages/bundled-features/src/contact/panels.ts +28 -0
- package/packages/bundled-features/src/contact/payloads.ts +106 -0
- package/packages/bundled-features/src/contact/pow.ts +22 -0
- package/packages/bundled-features/src/contact/screens.ts +507 -0
- package/packages/bundled-features/src/contact/subject.ts +13 -0
- package/packages/bundled-features/src/contact/user-agent.ts +39 -0
- package/packages/bundled-features/src/contact/user-data-hooks.ts +180 -0
- package/packages/bundled-features/src/contact/web/constants.ts +160 -0
- package/packages/bundled-features/src/contact/web/index.ts +29 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +5 -16
- package/packages/bundled-features/src/data-retention/changes.json +6 -0
- package/packages/bundled-features/src/data-retention/feature.ts +16 -2
- package/packages/bundled-features/src/data-retention/index.ts +5 -0
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +138 -41
- package/packages/bundled-features/src/data-retention/tenant-destruction-hold.ts +196 -0
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -0
- package/packages/bundled-features/src/delivery/changes.json +7 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +2 -0
- package/packages/bundled-features/src/delivery/delivery-service.ts +29 -5
- package/packages/bundled-features/src/delivery/events.ts +2 -0
- package/packages/bundled-features/src/delivery/feature.ts +3 -2
- package/packages/bundled-features/src/delivery/handlers/attempts-by-keys.query.ts +55 -0
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +1 -1
- package/packages/bundled-features/src/delivery/jobs.ts +5 -0
- package/packages/bundled-features/src/delivery/tables.ts +13 -2
- package/packages/bundled-features/src/delivery/types.ts +3 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +2 -0
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +3 -2
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +1 -1
- package/packages/bundled-features/src/delivery/web/public-names.ts +1 -0
- package/packages/bundled-features/src/document-ingest-foundation/boot-checks.ts +14 -9
- package/packages/bundled-features/src/document-ingest-foundation/boot-rules.ts +22 -0
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +17 -0
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +39 -1
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +10 -0
- package/packages/bundled-features/src/document-ingest-foundation/report-ingest-progress.ts +43 -0
- package/packages/bundled-features/src/document-ingest-foundation/tables.ts +43 -0
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant-by-file-ref.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/files-tenant-data/changes.json +6 -0
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +4 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +8 -9
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -1
- package/packages/bundled-features/src/form-draft-user-data/index.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +13 -0
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +6 -6
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/attach-message-content.write.ts +7 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +6 -2
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/message-content.query.ts +3 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/message-content.ts +19 -0
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +2 -0
- package/packages/bundled-features/src/inbound-mail-foundation/sanitize-inbound-html.ts +150 -0
- package/packages/bundled-features/src/inbound-mail-foundation/types.ts +1 -0
- package/packages/bundled-features/src/jobs/job-run-logger.ts +24 -25
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +46 -31
- package/packages/bundled-features/src/ledger/recurring.ts +1 -0
- package/packages/bundled-features/src/managed-pages/handlers/branding.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +1 -1
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +3 -1
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +9 -17
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +2 -7
- package/packages/bundled-features/src/secrets/changes.json +6 -0
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +8 -4
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +6 -3
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +9 -4
- package/packages/bundled-features/src/secrets/secret-scope.ts +33 -0
- package/packages/bundled-features/src/seo/handlers/seo-config.query.ts +1 -1
- package/packages/bundled-features/src/sessions/changes.json +6 -0
- package/packages/bundled-features/src/sessions/feature.ts +21 -18
- package/packages/bundled-features/src/sessions/handlers/last-activity-probe.query.ts +53 -0
- package/packages/bundled-features/src/sessions/handlers/last-activity-probe.route.ts +39 -0
- package/packages/bundled-features/src/sessions/screens.ts +1 -0
- package/packages/bundled-features/src/sessions/session-callbacks.ts +13 -12
- package/packages/bundled-features/src/sessions/web/i18n.ts +4 -1
- package/packages/bundled-features/src/shared/assert-billing-live.ts +14 -0
- package/packages/bundled-features/src/shared/collect-extension-options.ts +12 -0
- package/packages/bundled-features/src/shared/index.ts +16 -0
- package/packages/bundled-features/src/shared/late-bound-slot.ts +19 -0
- package/packages/bundled-features/src/shared/mail-locale-templates.ts +7 -1
- package/packages/bundled-features/src/shared/price-env-shape.ts +44 -0
- package/packages/bundled-features/src/shared/purge-row-file-refs.ts +1 -1
- package/packages/bundled-features/src/shared/read-feature-export-fn.ts +16 -0
- package/packages/bundled-features/src/shared/signup-handover.ts +3 -4
- package/packages/bundled-features/src/shared/tenant-destruction-hold.ts +49 -0
- package/packages/bundled-features/src/shared/unprocessable.ts +19 -0
- package/packages/bundled-features/src/shared/web/index.ts +3 -0
- package/packages/bundled-features/src/subscription-paddle/checkout-config.query.ts +1 -1
- package/packages/bundled-features/src/subscription-paddle/feature.ts +7 -15
- package/packages/bundled-features/src/subscription-paddle/runtime.ts +4 -7
- package/packages/bundled-features/src/subscription-stripe/feature.ts +7 -15
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +4 -7
- package/packages/bundled-features/src/tags/entity.ts +1 -0
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +14 -0
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +4 -5
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +1 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +3 -6
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +27 -15
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +12 -9
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +1 -0
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +1 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +3 -0
- package/packages/bundled-features/src/template-resolver/linked-resources.ts +11 -6
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +15 -12
- package/packages/bundled-features/src/template-resolver/web/document-images.ts +6 -6
- package/packages/bundled-features/src/template-resolver/web/document-insert-fields.tsx +41 -36
- package/packages/bundled-features/src/template-resolver/web/document-schema.ts +11 -12
- package/packages/bundled-features/src/template-resolver/web/tiptap-attribute-parse-rule.ts +19 -0
- package/packages/bundled-features/src/tenant/i18n.ts +3 -0
- package/packages/bundled-features/src/tenant/schema/tenant.ts +1 -0
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +1 -1
- package/packages/bundled-features/src/tenant-inactivity/changes.json +8 -0
- package/packages/bundled-features/src/tenant-inactivity/check-inactive-tenants.ts +260 -0
- package/packages/bundled-features/src/tenant-inactivity/constants.ts +12 -0
- package/packages/bundled-features/src/tenant-inactivity/email-templates.ts +24 -0
- package/packages/bundled-features/src/tenant-inactivity/feature.ts +66 -0
- package/packages/bundled-features/src/tenant-inactivity/handlers/inactivity-state.query.ts +49 -0
- package/packages/bundled-features/src/tenant-inactivity/handlers/keep-account.write.ts +59 -0
- package/packages/bundled-features/src/tenant-inactivity/inactivity-plan.ts +187 -0
- package/packages/bundled-features/src/tenant-inactivity/index.ts +5 -0
- package/packages/bundled-features/src/tenant-inactivity/keep-token.ts +44 -0
- package/packages/bundled-features/src/tenant-inactivity/mail-notifications.ts +62 -0
- package/packages/bundled-features/src/tenant-inactivity/options.ts +38 -0
- package/packages/bundled-features/src/tenant-inactivity/remote-activity.ts +32 -0
- package/packages/bundled-features/src/tenant-inactivity/state-store.ts +71 -0
- package/packages/bundled-features/src/tenant-inactivity/state-table.ts +50 -0
- package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +8 -6
- package/packages/bundled-features/src/tenant-lifecycle/boot-rules.ts +16 -0
- package/packages/bundled-features/src/tenant-lifecycle/changes.json +18 -0
- package/packages/bundled-features/src/tenant-lifecycle/feature.ts +24 -1
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +12 -87
- package/packages/bundled-features/src/tenant-lifecycle/index.ts +4 -0
- package/packages/bundled-features/src/tenant-lifecycle/request-tenant-destruction.ts +108 -0
- package/packages/bundled-features/src/tenant-lifecycle/retention-config-destroy-hooks.ts +62 -0
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +58 -5
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +31 -2
- package/packages/bundled-features/src/tenant-lifecycle/testing.ts +1 -1
- package/packages/bundled-features/src/tier-engine/caps-for-tier-from-map.ts +16 -0
- package/packages/bundled-features/src/tier-engine/changes.json +6 -0
- package/packages/bundled-features/src/tier-engine/compose-app.ts +21 -20
- package/packages/bundled-features/src/tier-engine/index.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/feature.ts +2 -0
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +4 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -0
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +4 -1
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +2 -0
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -1
- package/packages/bundled-features/src/user-data-rights/zip-path.ts +1 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/config-value.userdata-hook.ts +8 -27
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +11 -8
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/forget-own-rows-delete-hook.ts +42 -0
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +8 -27
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +2 -6
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +1 -2
- package/samples/apps/styleguide/src/features/widgets/i18n.ts +6 -0
- package/samples/apps/styleguide/src/features/widgets/web/InboxReaderExamples.tsx +158 -0
- package/samples/apps/styleguide/src/features/widgets/web/Widgets.tsx +2 -0
- package/samples/apps/styleguide/src/features/widgets/web/sample-pdf.ts +28 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +113 -2
- package/samples/apps/use-all-bundled/kumiko/migrations/0063_contact.rebuild.json +4 -0
- package/samples/apps/use-all-bundled/package.json +1 -0
- package/samples/apps/use-all-bundled/src/app/client.tsx +3 -0
- package/samples/apps/use-all-bundled/src/app/screens-feature.ts +46 -2
- package/samples/apps/use-all-bundled/src/run-config.ts +23 -1
- package/samples/recipes/anonymous-access/README.md +2 -0
- package/samples/recipes/anonymous-access/src/feature.ts +7 -1
- package/samples/recipes/contact/README.md +52 -0
- package/samples/recipes/contact/package.json +12 -0
- package/samples/recipes/contact/src/feature.ts +27 -0
- package/samples/recipes/delivery-notifications/src/feature.ts +3 -0
- package/samples/recipes/record-detail-layout/src/feature.ts +9 -1
- package/samples/recipes/search/README.md +2 -0
- package/samples/recipes/search/src/feature.ts +27 -2
- package/samples/recipes/secrets-demo/README.md +1 -0
- package/samples/recipes/secrets-demo/src/feature.ts +56 -0
- package/samples/recipes/tenant-inactivity/README.md +21 -0
- package/samples/recipes/tenant-inactivity/package.json +12 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.410.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.410.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -93,6 +93,8 @@
|
|
|
93
93
|
"./tenant/constants": "./src/tenant/web/constants.ts",
|
|
94
94
|
"./tenant/web": "./src/tenant/web/index.ts",
|
|
95
95
|
"./tenant/seeding": "./src/tenant/seeding.ts",
|
|
96
|
+
"./tenant-inactivity": "./src/tenant-inactivity/index.ts",
|
|
97
|
+
"./tenant-inactivity/email-templates": "./src/tenant-inactivity/email-templates.ts",
|
|
96
98
|
"./tenant-lifecycle": "./src/tenant-lifecycle/index.ts",
|
|
97
99
|
"./tenant-lifecycle/testing": "./src/tenant-lifecycle/testing.ts",
|
|
98
100
|
"./tenant-handover": "./src/tenant-handover/index.ts",
|
|
@@ -151,6 +153,9 @@
|
|
|
151
153
|
"./legal-pages": "./src/legal-pages/index.ts",
|
|
152
154
|
"./legal-pages/constants": "./src/legal-pages/web/constants.ts",
|
|
153
155
|
"./legal-pages/web": "./src/legal-pages/web/index.ts",
|
|
156
|
+
"./contact": "./src/contact/index.ts",
|
|
157
|
+
"./contact/web": "./src/contact/web/index.ts",
|
|
158
|
+
"./contact/client": "./src/contact/client/index.ts",
|
|
154
159
|
"./waitlist": "./src/waitlist/index.ts",
|
|
155
160
|
"./page-render": "./src/page-render/index.ts",
|
|
156
161
|
"./page-render/web": "./src/page-render/web.ts",
|
|
@@ -192,6 +197,7 @@
|
|
|
192
197
|
"qrcode": "^1.5.4",
|
|
193
198
|
"react": "^19.3.1",
|
|
194
199
|
"react-dom": "^19.3.1",
|
|
200
|
+
"sanitize-html": "^2.18.1",
|
|
195
201
|
"sharp": "^0.35.5",
|
|
196
202
|
"stripe": "^22.6.2",
|
|
197
203
|
"tailwind-merge": "^3.7.0",
|
|
@@ -479,6 +485,14 @@
|
|
|
479
485
|
"types": "./dist/tenant/seeding.d.ts",
|
|
480
486
|
"default": "./dist/tenant/seeding.js"
|
|
481
487
|
},
|
|
488
|
+
"./tenant-inactivity": {
|
|
489
|
+
"types": "./dist/tenant-inactivity/index.d.ts",
|
|
490
|
+
"default": "./dist/tenant-inactivity/index.js"
|
|
491
|
+
},
|
|
492
|
+
"./tenant-inactivity/email-templates": {
|
|
493
|
+
"types": "./dist/tenant-inactivity/email-templates.d.ts",
|
|
494
|
+
"default": "./dist/tenant-inactivity/email-templates.js"
|
|
495
|
+
},
|
|
482
496
|
"./tenant-lifecycle": {
|
|
483
497
|
"types": "./dist/tenant-lifecycle/index.d.ts",
|
|
484
498
|
"default": "./dist/tenant-lifecycle/index.js"
|
|
@@ -711,6 +725,18 @@
|
|
|
711
725
|
"types": "./dist/legal-pages/web/index.d.ts",
|
|
712
726
|
"default": "./dist/legal-pages/web/index.js"
|
|
713
727
|
},
|
|
728
|
+
"./contact": {
|
|
729
|
+
"types": "./dist/contact/index.d.ts",
|
|
730
|
+
"default": "./dist/contact/index.js"
|
|
731
|
+
},
|
|
732
|
+
"./contact/web": {
|
|
733
|
+
"types": "./dist/contact/web/index.d.ts",
|
|
734
|
+
"default": "./dist/contact/web/index.js"
|
|
735
|
+
},
|
|
736
|
+
"./contact/client": {
|
|
737
|
+
"types": "./dist/contact/client/index.d.ts",
|
|
738
|
+
"default": "./dist/contact/client/index.js"
|
|
739
|
+
},
|
|
714
740
|
"./waitlist": {
|
|
715
741
|
"types": "./dist/waitlist/index.d.ts",
|
|
716
742
|
"default": "./dist/waitlist/index.js"
|
|
@@ -757,15 +783,16 @@
|
|
|
757
783
|
"LICENSE"
|
|
758
784
|
],
|
|
759
785
|
"devDependencies": {
|
|
760
|
-
"@testing-library/user-event": "^14.6.8",
|
|
761
786
|
"@cosmicdrift/kumiko-locale-de": "workspace:*",
|
|
762
787
|
"@cosmicdrift/kumiko-locale-es": "workspace:*",
|
|
763
788
|
"@cosmicdrift/kumiko-locale-fr": "workspace:*",
|
|
764
789
|
"@cosmicdrift/kumiko-locale-it": "workspace:*",
|
|
765
790
|
"@cosmicdrift/kumiko-renderer-mail-html": "workspace:*",
|
|
791
|
+
"@cosmicdrift/kumiko-testing": "workspace:*",
|
|
792
|
+
"@testing-library/user-event": "^14.6.8",
|
|
793
|
+
"@types/sanitize-html": "^2.16.2",
|
|
766
794
|
"jsqr": "^1.4.0",
|
|
767
|
-
"unpdf": "^1.9.1"
|
|
768
|
-
"@cosmicdrift/kumiko-testing": "workspace:*"
|
|
795
|
+
"unpdf": "^1.9.1"
|
|
769
796
|
},
|
|
770
797
|
"peerDependencies": {
|
|
771
798
|
"@cosmicdrift/kumiko-testing": "workspace:*"
|
|
@@ -66,23 +66,31 @@ export function createAccountSecurityFeature(
|
|
|
66
66
|
panels: [
|
|
67
67
|
{
|
|
68
68
|
kind: "screen",
|
|
69
|
+
chromeless: true,
|
|
69
70
|
id: "mfa-enable",
|
|
70
71
|
screen: `auth-mfa:screen:${MFA_ENABLE_SCREEN_ID}`,
|
|
71
72
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: false },
|
|
72
73
|
},
|
|
73
74
|
{
|
|
74
75
|
kind: "screen",
|
|
76
|
+
chromeless: true,
|
|
75
77
|
id: "mfa-regenerate",
|
|
76
78
|
screen: `auth-mfa:screen:${MFA_REGENERATE_RECOVERY_SCREEN_ID}`,
|
|
77
79
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: true },
|
|
78
80
|
},
|
|
79
81
|
{
|
|
80
82
|
kind: "screen",
|
|
83
|
+
chromeless: true,
|
|
81
84
|
id: "mfa-disable",
|
|
82
85
|
screen: `auth-mfa:screen:${MFA_DISABLE_SCREEN_ID}`,
|
|
83
86
|
visibleWhen: { ...accountSecurityMfaStatusVisibility, eq: true },
|
|
84
87
|
},
|
|
85
|
-
{
|
|
88
|
+
{
|
|
89
|
+
kind: "screen",
|
|
90
|
+
chromeless: true,
|
|
91
|
+
id: "sessions",
|
|
92
|
+
screen: `sessions:screen:${SESSION_MINE_SCREEN_ID}`,
|
|
93
|
+
},
|
|
86
94
|
],
|
|
87
95
|
});
|
|
88
96
|
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.409.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "createAdminShellFeature extraPlatformPanels",
|
|
6
|
+
"detail": "`createAdminShellFeature({ extraPlatformPanels })` appends dashboard panels to the platform \"Overview\" dashboard, so a feature can put a tile (for example the open contact requests) there instead of mounting a dashboard of its own."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.392.0",
|
|
4
10
|
"type": "improvement",
|
|
@@ -7,6 +7,7 @@ import {
|
|
|
7
7
|
defineFeature,
|
|
8
8
|
type FeatureDefinition,
|
|
9
9
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
10
|
+
import type { DashboardPanelDefinition } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
10
11
|
import { DEFAULT_METRICS, type MetricDefinition } from "../metrics/index.ts";
|
|
11
12
|
import {
|
|
12
13
|
OVERVIEW_TIME_RANGE,
|
|
@@ -48,6 +49,8 @@ export type CreateAdminShellOptions = {
|
|
|
48
49
|
* createMetricsFeature / createSystemMetricsFeature. Panels exist only for
|
|
49
50
|
* ids in this list. Default DEFAULT_METRICS. */
|
|
50
51
|
readonly metrics?: readonly MetricDefinition[];
|
|
52
|
+
/** Panels appended to the platform overview, for tiles a mounted feature owns (e.g. the contact inbox count). */
|
|
53
|
+
readonly extraPlatformPanels?: readonly DashboardPanelDefinition[];
|
|
51
54
|
};
|
|
52
55
|
|
|
53
56
|
type NavIdOptions = {
|
|
@@ -148,7 +151,7 @@ export function createAdminShellFeature(options: CreateAdminShellOptions = {}):
|
|
|
148
151
|
timeRange: OVERVIEW_TIME_RANGE,
|
|
149
152
|
// The picker needs a SystemAdmin {rows:{value,label}} tenant query; only cap-overview ships one.
|
|
150
153
|
...(includeCapOverview && { filter: PLATFORM_TENANT_FILTER }),
|
|
151
|
-
panels: [...platformOverviewPanels(metrics)],
|
|
154
|
+
panels: [...platformOverviewPanels(metrics), ...(options.extraPlatformPanels ?? [])],
|
|
152
155
|
});
|
|
153
156
|
r.nav({
|
|
154
157
|
id: "platform-overview",
|
|
@@ -304,6 +304,7 @@ function buildHandlerEntry(
|
|
|
304
304
|
kind,
|
|
305
305
|
...(description !== undefined && { description }),
|
|
306
306
|
risk: exposure.risk,
|
|
307
|
+
...(exposure.effect !== undefined && { effect: exposure.effect }),
|
|
307
308
|
inputSchema,
|
|
308
309
|
...(entity !== undefined && { entity }),
|
|
309
310
|
...(excludedFields !== undefined && { excludedFields }),
|
|
@@ -1,4 +1,10 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.409.0",
|
|
4
|
+
"type": "improvement",
|
|
5
|
+
"title": "Agent write handlers can be marked as proposal changes",
|
|
6
|
+
"detail": "AgentHandlerHints takes effect \"proposal\" for a write whose result is itself a suggestion that a person approves later (for example a plan step the clerk still checks). resolveAgentExposure, the agent manifest handler entry and the write ToolDispatchDescriptor carry the effect, so an agent runtime can skip its own approval step for these calls. Boot rejects effect \"proposal\" unless the handler declares risk \"low\" explicitly (the write default is mid), and rejects any effect on a query handler."
|
|
7
|
+
},
|
|
2
8
|
{
|
|
3
9
|
"version": "0.402.0",
|
|
4
10
|
"type": "breaking",
|
|
@@ -575,6 +575,7 @@ function addWriteHandlerTools(
|
|
|
575
575
|
op: "write",
|
|
576
576
|
qn: handler.qn,
|
|
577
577
|
risk: handler.risk,
|
|
578
|
+
...(handler.effect !== undefined && { effect: handler.effect }),
|
|
578
579
|
...(handler.entity !== undefined && { entity: handler.entity }),
|
|
579
580
|
...(detailQn !== undefined && { detailQn }),
|
|
580
581
|
...(injectsVersion && { injectsVersion: true as const }),
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type {
|
|
2
|
+
AgentEffect,
|
|
2
3
|
AgentRisk,
|
|
3
4
|
EntityDefinition,
|
|
4
5
|
FeatureDefinition,
|
|
@@ -74,6 +75,8 @@ export type ToolDispatchDescriptor =
|
|
|
74
75
|
readonly op: "write";
|
|
75
76
|
readonly qn: string;
|
|
76
77
|
readonly risk: AgentRisk;
|
|
78
|
+
/** "proposal": the write changes a suggestion a person still approves, so no approval step. */
|
|
79
|
+
readonly effect?: AgentEffect;
|
|
77
80
|
readonly entity?: string;
|
|
78
81
|
/** `<feature>:query:<entity>:detail` QN when one is mounted and readable.
|
|
79
82
|
* Dispatch reads the current `version` from it before an optimistic-lock
|
|
@@ -150,6 +153,7 @@ export type AgentManifestHandler = {
|
|
|
150
153
|
readonly kind: "query" | "write";
|
|
151
154
|
readonly description?: string;
|
|
152
155
|
readonly risk: AgentRisk;
|
|
156
|
+
readonly effect?: AgentEffect;
|
|
153
157
|
readonly inputSchema: Readonly<Record<string, unknown>>;
|
|
154
158
|
readonly entity?: string;
|
|
155
159
|
/** Fields this generic create/update handler never writes; sending one fails validation. */
|
|
@@ -20,6 +20,7 @@ export const AUDIT_EVENT_STANCES: Readonly<Record<string, AuditEventStance>> = {
|
|
|
20
20
|
"inbound-mail-foundation:event:inbound-message-received": TECHNICAL_EVENT,
|
|
21
21
|
"inbound-mail-foundation:event:inbound-message-content-fetched": TECHNICAL_EVENT,
|
|
22
22
|
"inbound-mail-foundation:event:mail-thread-updated": TECHNICAL_EVENT,
|
|
23
|
+
"document-ingest-foundation:event:document-ingest-progress": TECHNICAL_EVENT,
|
|
23
24
|
"document-ingest-foundation:event:document-ingest-requested": TECHNICAL_EVENT,
|
|
24
25
|
"document-ingest-foundation:event:document-ingest-skipped": TECHNICAL_EVENT,
|
|
25
26
|
"tenant-lifecycle:event:tenant-destruction-stage-started": TECHNICAL_EVENT,
|
|
@@ -295,6 +295,7 @@ function isMailingOutcome(outcome: BootstrapInviteOutcome): boolean {
|
|
|
295
295
|
}
|
|
296
296
|
|
|
297
297
|
// A one-shot operator process, not a tenant request: it looks up users, memberships and invitations across tenants.
|
|
298
|
+
// guard:dup-ok the single runInSystemRowLevelSecurityScope call with this entry point's own reason
|
|
298
299
|
export function bootstrapTenants(
|
|
299
300
|
deps: BootstrapDeps,
|
|
300
301
|
plan: BootstrapPlan,
|
|
@@ -1,121 +1,73 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { unprocessable } from "../shared/index.ts";
|
|
2
2
|
import { AuthErrors } from "./web/constants.ts";
|
|
3
3
|
|
|
4
4
|
// @wrapper-known error-helper
|
|
5
5
|
export function invalidCredentials() {
|
|
6
|
-
return
|
|
7
|
-
new UnprocessableError(AuthErrors.invalidCredentials, {
|
|
8
|
-
i18nKey: "auth.errors.invalidCredentials",
|
|
9
|
-
}),
|
|
10
|
-
);
|
|
6
|
+
return unprocessable(AuthErrors.invalidCredentials, "auth.errors.invalidCredentials");
|
|
11
7
|
}
|
|
12
8
|
|
|
13
9
|
// @wrapper-known error-helper
|
|
14
10
|
export function invalidInviteToken() {
|
|
15
|
-
return
|
|
16
|
-
new UnprocessableError(AuthErrors.invalidInviteToken, {
|
|
17
|
-
i18nKey: "auth.errors.invalidInviteToken",
|
|
18
|
-
}),
|
|
19
|
-
);
|
|
11
|
+
return unprocessable(AuthErrors.invalidInviteToken, "auth.errors.invalidInviteToken");
|
|
20
12
|
}
|
|
21
13
|
|
|
22
14
|
// @wrapper-known error-helper
|
|
23
15
|
export function inviteEmailMismatch() {
|
|
24
|
-
return
|
|
25
|
-
new UnprocessableError(AuthErrors.inviteEmailMismatch, {
|
|
26
|
-
i18nKey: "auth.errors.inviteEmailMismatch",
|
|
27
|
-
}),
|
|
28
|
-
);
|
|
16
|
+
return unprocessable(AuthErrors.inviteEmailMismatch, "auth.errors.inviteEmailMismatch");
|
|
29
17
|
}
|
|
30
18
|
|
|
31
19
|
// @wrapper-known error-helper
|
|
32
20
|
export function inviteAlreadyAccepted() {
|
|
33
|
-
return
|
|
34
|
-
new UnprocessableError(AuthErrors.inviteAlreadyAccepted, {
|
|
35
|
-
i18nKey: "auth.errors.inviteAlreadyAccepted",
|
|
36
|
-
}),
|
|
37
|
-
);
|
|
21
|
+
return unprocessable(AuthErrors.inviteAlreadyAccepted, "auth.errors.inviteAlreadyAccepted");
|
|
38
22
|
}
|
|
39
23
|
|
|
40
24
|
// @wrapper-known error-helper
|
|
41
25
|
export function invalidResetToken() {
|
|
42
|
-
return
|
|
43
|
-
new UnprocessableError(AuthErrors.invalidResetToken, {
|
|
44
|
-
i18nKey: "auth.errors.invalidResetToken",
|
|
45
|
-
}),
|
|
46
|
-
);
|
|
26
|
+
return unprocessable(AuthErrors.invalidResetToken, "auth.errors.invalidResetToken");
|
|
47
27
|
}
|
|
48
28
|
|
|
49
29
|
// @wrapper-known error-helper
|
|
50
30
|
export function invalidUnlockToken() {
|
|
51
|
-
return
|
|
52
|
-
new UnprocessableError(AuthErrors.invalidUnlockToken, {
|
|
53
|
-
i18nKey: "auth.errors.invalidUnlockToken",
|
|
54
|
-
}),
|
|
55
|
-
);
|
|
31
|
+
return unprocessable(AuthErrors.invalidUnlockToken, "auth.errors.invalidUnlockToken");
|
|
56
32
|
}
|
|
57
33
|
|
|
58
34
|
// @wrapper-known error-helper
|
|
59
35
|
export function invalidVerificationToken() {
|
|
60
|
-
return
|
|
61
|
-
new UnprocessableError(AuthErrors.invalidVerificationToken, {
|
|
62
|
-
i18nKey: "auth.errors.invalidVerificationToken",
|
|
63
|
-
}),
|
|
64
|
-
);
|
|
36
|
+
return unprocessable(AuthErrors.invalidVerificationToken, "auth.errors.invalidVerificationToken");
|
|
65
37
|
}
|
|
66
38
|
|
|
67
39
|
// @wrapper-known error-helper
|
|
68
40
|
export function invalidSignupToken() {
|
|
69
|
-
return
|
|
70
|
-
new UnprocessableError(AuthErrors.invalidSignupToken, {
|
|
71
|
-
i18nKey: "auth.errors.invalidSignupToken",
|
|
72
|
-
}),
|
|
73
|
-
);
|
|
41
|
+
return unprocessable(AuthErrors.invalidSignupToken, "auth.errors.invalidSignupToken");
|
|
74
42
|
}
|
|
75
43
|
|
|
76
44
|
// @wrapper-known error-helper
|
|
77
45
|
export function signupEmailAlreadyRegistered() {
|
|
78
|
-
return
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
}),
|
|
46
|
+
return unprocessable(
|
|
47
|
+
AuthErrors.signupEmailAlreadyRegistered,
|
|
48
|
+
"auth.errors.signupEmailAlreadyRegistered",
|
|
82
49
|
);
|
|
83
50
|
}
|
|
84
51
|
|
|
85
52
|
// @wrapper-known error-helper
|
|
86
53
|
export function noMembership() {
|
|
87
|
-
return
|
|
88
|
-
new UnprocessableError(AuthErrors.noMembership, {
|
|
89
|
-
i18nKey: "auth.errors.noMembership",
|
|
90
|
-
}),
|
|
91
|
-
);
|
|
54
|
+
return unprocessable(AuthErrors.noMembership, "auth.errors.noMembership");
|
|
92
55
|
}
|
|
93
56
|
|
|
94
57
|
// @wrapper-known error-helper
|
|
95
58
|
export function emailNotVerified() {
|
|
96
|
-
return
|
|
97
|
-
new UnprocessableError(AuthErrors.emailNotVerified, {
|
|
98
|
-
i18nKey: "auth.errors.emailNotVerified",
|
|
99
|
-
}),
|
|
100
|
-
);
|
|
59
|
+
return unprocessable(AuthErrors.emailNotVerified, "auth.errors.emailNotVerified");
|
|
101
60
|
}
|
|
102
61
|
|
|
103
62
|
// retryAfterSeconds drives the login/signup UI countdown — must stay > 0.
|
|
104
63
|
// @wrapper-known error-helper
|
|
105
64
|
export function accountLocked(retryAfterSeconds: number) {
|
|
106
|
-
return
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
details: { retryAfterSeconds },
|
|
110
|
-
}),
|
|
111
|
-
);
|
|
65
|
+
return unprocessable(AuthErrors.accountLocked, "auth.errors.accountLocked", {
|
|
66
|
+
retryAfterSeconds,
|
|
67
|
+
});
|
|
112
68
|
}
|
|
113
69
|
|
|
114
70
|
// @wrapper-known error-helper
|
|
115
71
|
export function accountRestricted() {
|
|
116
|
-
return
|
|
117
|
-
new UnprocessableError(AuthErrors.accountRestricted, {
|
|
118
|
-
i18nKey: "auth.errors.accountRestricted",
|
|
119
|
-
}),
|
|
120
|
-
);
|
|
72
|
+
return unprocessable(AuthErrors.accountRestricted, "auth.errors.accountRestricted");
|
|
121
73
|
}
|
|
@@ -8,7 +8,7 @@ import { AuthHandlers } from "../web/constants.ts";
|
|
|
8
8
|
export const loginOptionsQuery = defineQueryHandler({
|
|
9
9
|
name: "login-options",
|
|
10
10
|
schema: z.object({}),
|
|
11
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
11
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
12
12
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
13
13
|
description:
|
|
14
14
|
"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.",
|
package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts
CHANGED
|
@@ -13,7 +13,7 @@ import { AUTH_SELF_REGISTRATION_FEATURE } from "../self-registration-toggle.ts";
|
|
|
13
13
|
export const selfRegistrationStatusQuery = defineQueryHandler({
|
|
14
14
|
name: "signup-registration-status",
|
|
15
15
|
schema: z.object({}),
|
|
16
|
-
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
|
|
16
|
+
access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"], anySignedIn: true },
|
|
17
17
|
rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
|
|
18
18
|
description:
|
|
19
19
|
"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.",
|
|
@@ -178,6 +178,22 @@ async function parseTokenFailure(res: Response): Promise<AuthTokenFailure> {
|
|
|
178
178
|
return { reason };
|
|
179
179
|
}
|
|
180
180
|
|
|
181
|
+
type AuthTokenResult = { ok: true } | { ok: false; error: AuthTokenFailure };
|
|
182
|
+
|
|
183
|
+
async function postTokenRequest(
|
|
184
|
+
path: string,
|
|
185
|
+
payload: Record<string, unknown>,
|
|
186
|
+
): Promise<AuthTokenResult> {
|
|
187
|
+
const res = await fetch(path, {
|
|
188
|
+
method: "POST",
|
|
189
|
+
credentials: "same-origin",
|
|
190
|
+
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
191
|
+
body: JSON.stringify(payload),
|
|
192
|
+
});
|
|
193
|
+
if (res.ok) return { ok: true };
|
|
194
|
+
return { ok: false, error: await parseTokenFailure(res) };
|
|
195
|
+
}
|
|
196
|
+
|
|
181
197
|
// POST /api/auth/request-password-reset. 200 silent-success: even if the
|
|
182
198
|
// email doesn't exist, the caller sees `{ ok: true }` — no account
|
|
183
199
|
// enumeration. Server only triggers the mail internally when a user is
|
|
@@ -185,15 +201,11 @@ async function parseTokenFailure(res: Response): Promise<AuthTokenFailure> {
|
|
|
185
201
|
export async function requestPasswordReset(
|
|
186
202
|
email: string,
|
|
187
203
|
returnTo?: string,
|
|
188
|
-
): Promise<
|
|
189
|
-
|
|
190
|
-
|
|
191
|
-
|
|
192
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
193
|
-
body: JSON.stringify({ email, ...(returnTo !== undefined && { returnTo }) }),
|
|
204
|
+
): Promise<AuthTokenResult> {
|
|
205
|
+
return postTokenRequest("/api/auth/request-password-reset", {
|
|
206
|
+
email,
|
|
207
|
+
...(returnTo !== undefined && { returnTo }),
|
|
194
208
|
});
|
|
195
|
-
if (res.ok) return { ok: true };
|
|
196
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
197
209
|
}
|
|
198
210
|
|
|
199
211
|
// POST /api/auth/reset-password. The token comes from the URL and the
|
|
@@ -202,64 +214,27 @@ export async function requestPasswordReset(
|
|
|
202
214
|
// single code `invalid_reset_token` to prevent enumeration. Zod validation
|
|
203
215
|
// failures (newPassword < 8) use a separate 4xx code, "validation_failed".
|
|
204
216
|
// The UI maps reason to an i18n key.
|
|
205
|
-
export async function resetPassword(
|
|
206
|
-
token
|
|
207
|
-
newPassword: string,
|
|
208
|
-
): Promise<{ ok: true } | { ok: false; error: AuthTokenFailure }> {
|
|
209
|
-
const res = await fetch("/api/auth/reset-password", {
|
|
210
|
-
method: "POST",
|
|
211
|
-
credentials: "same-origin",
|
|
212
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
213
|
-
body: JSON.stringify({ token, newPassword }),
|
|
214
|
-
});
|
|
215
|
-
if (res.ok) return { ok: true };
|
|
216
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
217
|
+
export async function resetPassword(token: string, newPassword: string): Promise<AuthTokenResult> {
|
|
218
|
+
return postTokenRequest("/api/auth/reset-password", { token, newPassword });
|
|
217
219
|
}
|
|
218
220
|
|
|
219
221
|
// POST /api/auth/request-email-verification. Same silent-success
|
|
220
222
|
// semantics as request-password-reset. 429 → rate-limit failure.
|
|
221
|
-
export async function requestEmailVerification(
|
|
222
|
-
email
|
|
223
|
-
): Promise<{ ok: true } | { ok: false; error: AuthTokenFailure }> {
|
|
224
|
-
const res = await fetch("/api/auth/request-email-verification", {
|
|
225
|
-
method: "POST",
|
|
226
|
-
credentials: "same-origin",
|
|
227
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
228
|
-
body: JSON.stringify({ email }),
|
|
229
|
-
});
|
|
230
|
-
if (res.ok) return { ok: true };
|
|
231
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
223
|
+
export async function requestEmailVerification(email: string): Promise<AuthTokenResult> {
|
|
224
|
+
return postTokenRequest("/api/auth/request-email-verification", { email });
|
|
232
225
|
}
|
|
233
226
|
|
|
234
227
|
// POST /api/auth/verify-email. VerifyEmailScreen submits this automatically
|
|
235
228
|
// after parsing `?token=...`. The server collapses all verification failures
|
|
236
229
|
// into `invalid_verification_token` to prevent enumeration, as with reset.
|
|
237
|
-
export async function verifyEmail(
|
|
238
|
-
token
|
|
239
|
-
): Promise<{ ok: true } | { ok: false; error: AuthTokenFailure }> {
|
|
240
|
-
const res = await fetch("/api/auth/verify-email", {
|
|
241
|
-
method: "POST",
|
|
242
|
-
credentials: "same-origin",
|
|
243
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
244
|
-
body: JSON.stringify({ token }),
|
|
245
|
-
});
|
|
246
|
-
if (res.ok) return { ok: true };
|
|
247
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
230
|
+
export async function verifyEmail(token: string): Promise<AuthTokenResult> {
|
|
231
|
+
return postTokenRequest("/api/auth/verify-email", { token });
|
|
248
232
|
}
|
|
249
233
|
|
|
250
234
|
// POST /api/auth/request-account-unlock. Same silent-success semantics as
|
|
251
235
|
// request-password-reset. 429 → rate-limit failure.
|
|
252
|
-
export async function requestAccountUnlock(
|
|
253
|
-
email
|
|
254
|
-
): Promise<{ ok: true } | { ok: false; error: AuthTokenFailure }> {
|
|
255
|
-
const res = await fetch("/api/auth/request-account-unlock", {
|
|
256
|
-
method: "POST",
|
|
257
|
-
credentials: "same-origin",
|
|
258
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
259
|
-
body: JSON.stringify({ email }),
|
|
260
|
-
});
|
|
261
|
-
if (res.ok) return { ok: true };
|
|
262
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
236
|
+
export async function requestAccountUnlock(email: string): Promise<AuthTokenResult> {
|
|
237
|
+
return postTokenRequest("/api/auth/request-account-unlock", { email });
|
|
263
238
|
}
|
|
264
239
|
|
|
265
240
|
// POST /api/auth/confirm-account-unlock. Auto-submitted by
|
|
@@ -267,17 +242,8 @@ export async function requestAccountUnlock(
|
|
|
267
242
|
// every verify failure into `invalid_unlock_token` (anti-enumeration,
|
|
268
243
|
// parallel to reset/verify). Only clears the Redis lockout state, no
|
|
269
244
|
// entity write.
|
|
270
|
-
export async function confirmAccountUnlock(
|
|
271
|
-
token
|
|
272
|
-
): Promise<{ ok: true } | { ok: false; error: AuthTokenFailure }> {
|
|
273
|
-
const res = await fetch("/api/auth/confirm-account-unlock", {
|
|
274
|
-
method: "POST",
|
|
275
|
-
credentials: "same-origin",
|
|
276
|
-
headers: { "Content-Type": "application/json", ...csrfHeader() },
|
|
277
|
-
body: JSON.stringify({ token }),
|
|
278
|
-
});
|
|
279
|
-
if (res.ok) return { ok: true };
|
|
280
|
-
return { ok: false, error: await parseTokenFailure(res) };
|
|
245
|
+
export async function confirmAccountUnlock(token: string): Promise<AuthTokenResult> {
|
|
246
|
+
return postTokenRequest("/api/auth/confirm-account-unlock", { token });
|
|
281
247
|
}
|
|
282
248
|
|
|
283
249
|
// POST /api/auth/signup-request. Always returns 200 to prevent enumeration;
|
|
@@ -3,6 +3,7 @@
|
|
|
3
3
|
// root-relative paths pass (no "//host", no "/\host", no scheme).
|
|
4
4
|
|
|
5
5
|
import { appendReturnTo, NEXT_QUERY_PARAM } from "./login-url.ts";
|
|
6
|
+
import { readPathParam } from "./read-path-param.ts";
|
|
6
7
|
import { isSafeReturnPath, readReturnToFromSearch } from "./return-path.ts";
|
|
7
8
|
|
|
8
9
|
export { appendReturnTo, NEXT_QUERY_PARAM };
|
|
@@ -10,8 +11,7 @@ export { appendReturnTo, NEXT_QUERY_PARAM };
|
|
|
10
11
|
export const isSafeNextPath = isSafeReturnPath;
|
|
11
12
|
|
|
12
13
|
export function readNextFromSearch(search: string): string | null {
|
|
13
|
-
|
|
14
|
-
return isSafeNextPath(candidate) ? candidate : null;
|
|
14
|
+
return readPathParam(search, NEXT_QUERY_PARAM, isSafeNextPath);
|
|
15
15
|
}
|
|
16
16
|
|
|
17
17
|
// The returnTo a mail link or sibling auth page carried in this page's own URL; null on native, where there is no window.
|