@cosmicdrift/kumiko-samples 0.366.0 → 0.368.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 +16 -2
- package/packages/bundled-features/src/audit/handlers/details.query.ts +1 -1
- package/packages/bundled-features/src/audit/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +10 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +10 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +6 -2
- package/packages/bundled-features/src/auth-email-password/handlers/signup-confirm.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/seeding.ts +2 -2
- package/packages/bundled-features/src/auth-foundation/feature.ts +43 -34
- package/packages/bundled-features/src/auth-foundation/index.ts +1 -0
- package/packages/bundled-features/src/auth-mfa/db/queries.ts +5 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/reencrypt.job.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/status.query.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-code-verifier.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +1 -1
- package/packages/bundled-features/src/auth-mfa-user-data/index.ts +19 -10
- package/packages/bundled-features/src/billing-foundation/billing-info-query.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/feature.ts +138 -135
- package/packages/bundled-features/src/billing-foundation/handlers/create-portal-session.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/projection.ts +3 -2
- package/packages/bundled-features/src/cap-counter/calendar-cap-usage-reservation.ts +52 -1
- package/packages/bundled-features/src/cap-counter/cap-reservation.ts +203 -15
- package/packages/bundled-features/src/cap-counter/changes.json +13 -0
- package/packages/bundled-features/src/cap-counter/feature.ts +84 -73
- package/packages/bundled-features/src/cap-counter/handlers/increment-rolling.write.ts +3 -4
- package/packages/bundled-features/src/cap-counter/index.ts +9 -1
- package/packages/bundled-features/src/cap-counter/tables.ts +10 -3
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -2
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +6 -2
- package/packages/bundled-features/src/cap-overview/handlers/tenant-options.query.ts +1 -1
- package/packages/bundled-features/src/channel-email/changes.json +6 -0
- package/packages/bundled-features/src/channel-email/email-channel.ts +12 -2
- package/packages/bundled-features/src/channel-email/feature.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/inbox.query.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/mark-all-read.write.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/mark-read.write.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +1 -1
- package/packages/bundled-features/src/channel-in-app/tables.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/for-tenant.query.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/needs-profile.query.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/handlers/set-profile.write.ts +1 -2
- package/packages/bundled-features/src/compliance-profiles/resolve-for-tenant.ts +1 -1
- package/packages/bundled-features/src/compliance-profiles/seeding.ts +8 -4
- package/packages/bundled-features/src/compliance-profiles-ops/index.ts +26 -17
- package/packages/bundled-features/src/config/db/queries/resolver.ts +1 -1
- package/packages/bundled-features/src/config/handlers/reencrypt.job.ts +2 -2
- package/packages/bundled-features/src/config/resolver.ts +1 -1
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/crypto-shredding/changes.json +6 -0
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +9 -7
- package/packages/bundled-features/src/custom-fields/db/queries/field-access.ts +1 -1
- package/packages/bundled-features/src/custom-fields/db/queries/projection.ts +1 -1
- package/packages/bundled-features/src/custom-fields/db/queries/quota.ts +1 -1
- package/packages/bundled-features/src/custom-fields/db/queries/retention.ts +6 -2
- package/packages/bundled-features/src/custom-fields/db/queries/user-data-rights.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +11 -14
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +2 -2
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +2 -2
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +2 -2
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +2 -2
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +4 -4
- package/packages/bundled-features/src/data-retention/resolve-for-tenant.ts +1 -1
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +16 -10
- package/packages/bundled-features/src/delivery/address-opt-out.ts +5 -2
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +1 -1
- package/packages/bundled-features/src/delivery/changes.json +12 -0
- package/packages/bundled-features/src/delivery/channel-context.ts +2 -1
- package/packages/bundled-features/src/delivery/db/queries/address-opt-outs.ts +1 -1
- package/packages/bundled-features/src/delivery/db/queries/preferences.ts +1 -1
- package/packages/bundled-features/src/delivery/delivery-service.ts +70 -8
- package/packages/bundled-features/src/delivery/feature.ts +2 -2
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +3 -2
- package/packages/bundled-features/src/delivery/handlers/preferences.query.ts +1 -1
- package/packages/bundled-features/src/delivery/handlers/unsubscribe-address.write.ts +10 -5
- package/packages/bundled-features/src/delivery/index.ts +6 -0
- package/packages/bundled-features/src/delivery/testing.ts +2 -0
- package/packages/bundled-features/src/delivery/types.ts +4 -0
- package/packages/bundled-features/src/delivery/unsubscribe-link.ts +73 -0
- package/packages/bundled-features/src/delivery/unsubscribe-page-strings.ts +17 -0
- package/packages/bundled-features/src/delivery/unsubscribe.ts +94 -31
- package/packages/bundled-features/src/delivery/upsert-preference.ts +5 -2
- package/packages/bundled-features/src/derivatives-sharp/feature.ts +21 -12
- package/packages/bundled-features/src/derivatives-sharp/index.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +112 -103
- package/packages/bundled-features/src/document-ingest-foundation/forget-extract-with-file-ref.ts +3 -3
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +4 -1
- package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -5
- package/packages/bundled-features/src/feature-toggles/toggle-runtime.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/feature.ts +134 -129
- 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/file-foundation/feature.ts +38 -29
- package/packages/bundled-features/src/file-foundation/index.ts +1 -0
- package/packages/bundled-features/src/file-foundation/read-file-ref-content.ts +1 -1
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +32 -21
- package/packages/bundled-features/src/file-provider-inmemory/index.ts +6 -1
- package/packages/bundled-features/src/file-provider-s3/changes.json +10 -1
- package/packages/bundled-features/src/file-provider-s3/env-feature.ts +62 -0
- package/packages/bundled-features/src/file-provider-s3/feature.ts +107 -73
- package/packages/bundled-features/src/file-provider-s3/index.ts +6 -1
- package/packages/bundled-features/src/file-provider-s3/lib/index.ts +3 -0
- package/packages/bundled-features/src/{files-provider-s3 → file-provider-s3/lib}/s3-provider.ts +19 -19
- package/packages/bundled-features/src/file-provider-s3-env/index.ts +7 -2
- package/packages/bundled-features/src/files-provider-s3/index.ts +11 -3
- package/packages/bundled-features/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +1 -1
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +1 -2
- package/packages/bundled-features/src/folders/feature.ts +8 -3
- package/packages/bundled-features/src/folders-user-data/index.ts +27 -18
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +1 -1
- package/packages/bundled-features/src/form-draft/db/queries/draft-count.ts +1 -1
- package/packages/bundled-features/src/form-draft/db/queries/owned-file-refs.ts +3 -2
- package/packages/bundled-features/src/form-draft/feature.ts +6 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +2 -2
- package/packages/bundled-features/src/form-draft/index.ts +1 -1
- package/packages/bundled-features/src/form-draft/lookup.ts +1 -1
- package/packages/bundled-features/src/form-draft-user-data/index.ts +19 -10
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +165 -154
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +1 -2
- package/packages/bundled-features/src/inbound-mail-foundation/index.ts +1 -1
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-access-token.ts +5 -2
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +3 -2
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +1 -1
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +22 -13
- package/packages/bundled-features/src/inbound-provider-imap/index.ts +6 -1
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +20 -12
- package/packages/bundled-features/src/inbound-provider-inmemory/index.ts +1 -0
- package/packages/bundled-features/src/jobs/db/queries/retention.ts +1 -1
- package/packages/bundled-features/src/jobs/db/queries/stale-run-sweep.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/detail.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/list.query.ts +7 -2
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/tenant-failures.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/tenant-runs.query.ts +1 -1
- package/packages/bundled-features/src/jobs/job-run-logger.ts +11 -10
- package/packages/bundled-features/src/jobs/tenant-job-failure-table.ts +1 -1
- package/packages/bundled-features/src/jobs/tenant-job-run-table.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +6 -3
- package/packages/bundled-features/src/mail-foundation/feature.ts +107 -55
- package/packages/bundled-features/src/mail-foundation/index.ts +4 -0
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +25 -17
- package/packages/bundled-features/src/mail-transport-inmemory/index.ts +6 -1
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +91 -79
- package/packages/bundled-features/src/mail-transport-smtp/index.ts +1 -0
- 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 -2
- package/packages/bundled-features/src/managed-pages/handlers/set.write.ts +1 -2
- package/packages/bundled-features/src/managed-pages/seeding.ts +8 -4
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/filters.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +6 -3
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/notes-history-user-data/index.ts +27 -18
- package/packages/bundled-features/src/personal-access-tokens/changes.json +6 -0
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +17 -2
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/revoke-for-user.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/roles.ts +8 -6
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -0
- package/packages/bundled-features/src/readiness/feature.ts +25 -16
- package/packages/bundled-features/src/readiness/index.ts +1 -1
- package/packages/bundled-features/src/secrets/db/queries/read.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +8 -3
- package/packages/bundled-features/src/secrets/handlers/rotate.job.ts +2 -2
- package/packages/bundled-features/src/secrets/secrets-context.ts +4 -3
- package/packages/bundled-features/src/sessions/db/queries/cleanup.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/detail.query.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/list.query.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/mine.query.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +1 -1
- package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/sessions/session-callbacks.ts +14 -7
- package/packages/bundled-features/src/sessions/testing.ts +1 -1
- package/packages/bundled-features/src/tags/feature.ts +6 -3
- package/packages/bundled-features/src/template-resolver/api.ts +1 -1
- package/packages/bundled-features/src/template-resolver/changes.json +25 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +61 -9
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +19 -0
- package/packages/bundled-features/src/template-resolver/document-schema.ts +33 -0
- package/packages/bundled-features/src/template-resolver/handlers/bundle-import.ts +10 -2
- 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 +1 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +9 -3
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +9 -2
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +7 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +8 -3
- package/packages/bundled-features/src/template-resolver/handlers/reset-to-system.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-remove.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +22 -2
- package/packages/bundled-features/src/template-resolver/handlers/tenant-overrides.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/index.ts +4 -0
- package/packages/bundled-features/src/template-resolver/qualified-names.ts +1 -0
- package/packages/bundled-features/src/template-resolver/seeding.ts +57 -10
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-preview.ts +3 -1
- package/packages/bundled-features/src/template-resolver/template-resources.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-system-only.ts +21 -0
- package/packages/bundled-features/src/template-resolver/template-validation.ts +48 -24
- package/packages/bundled-features/src/template-resolver/testing.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +2 -0
- package/packages/bundled-features/src/template-resolver-user-data/index.ts +23 -14
- package/packages/bundled-features/src/tenant/handlers/active-tenant-ids.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -2
- package/packages/bundled-features/src/tenant/handlers/cancel-invitation.write.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/invitations.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/me.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/members.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/memberships.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/remove-member.write.ts +2 -1
- package/packages/bundled-features/src/tenant/handlers/resolve-user-ids.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/tenant-directory.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/update-member-roles.write.ts +1 -2
- package/packages/bundled-features/src/tenant/invited-membership.ts +2 -2
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -2
- package/packages/bundled-features/src/tenant/seeding.ts +12 -12
- package/packages/bundled-features/src/tenant-lifecycle/handlers/cancel-destruction.write.ts +1 -2
- package/packages/bundled-features/src/tenant-lifecycle/handlers/request-destruction.write.ts +1 -2
- package/packages/bundled-features/src/tenant-lifecycle/lib/revoke-tenant-sessions.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/lifecycle-gate.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +3 -3
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +10 -5
- package/packages/bundled-features/src/tenant-lifecycle/testing.ts +3 -3
- package/packages/bundled-features/src/tenant-settings/feature.ts +34 -29
- package/packages/bundled-features/src/tier-engine/feature.ts +426 -428
- package/packages/bundled-features/src/tier-engine/handlers/get-tenant-tier.query.ts +2 -3
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +5 -2
- package/packages/bundled-features/src/user/changes.json +6 -0
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +1 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -2
- package/packages/bundled-features/src/user/handlers/find-for-auth.query.ts +1 -1
- package/packages/bundled-features/src/user/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +2 -1
- package/packages/bundled-features/src/user/index.ts +5 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +2 -2
- package/packages/bundled-features/src/user/principal-status.ts +13 -3
- package/packages/bundled-features/src/user/resolve-display-names.ts +1 -1
- package/packages/bundled-features/src/user/seeding.ts +5 -5
- package/packages/bundled-features/src/user-data-rights/audit-download.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/changes.json +6 -0
- package/packages/bundled-features/src/user-data-rights/db/queries/export-jobs.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/db/queries/forget-cleanup.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-job.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/export-status.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/handlers/request-export.write.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/handlers/run-forget-cleanup.write.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/lib/deny-if-target-outside-admin-tenant.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/update-user-lifecycle.ts +7 -2
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +7 -3
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +11 -5
- package/packages/bundled-features/src/user-data-rights/run-user-export.ts +10 -5
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +1 -2
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/lib.ts +5 -2
- package/packages/bundled-features/src/workflow-runner/event-subscriber.ts +1 -1
- package/packages/bundled-features/src/workflow-runner/feature.ts +58 -47
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +1 -1
- package/packages/bundled-features/src/workflow-runner/index.ts +1 -1
- package/packages/bundled-features/src/workflow-runner/pending-projection.ts +1 -1
- package/samples/apps/admin-console/src/run-config.ts +2 -2
- package/samples/apps/cap-billing-demo/package.json +3 -0
- package/samples/apps/cap-billing-demo/src/feature.ts +2 -2
- package/samples/apps/cap-billing-demo/src/run-config.ts +8 -8
- package/samples/apps/marketing-demo/src/app/seed.ts +1 -1
- package/samples/apps/marketing-demo/src/db/queries/seed-counts.ts +1 -1
- package/samples/apps/showcase/package.json +3 -0
- package/samples/apps/showcase/src/app/seed-items.ts +1 -1
- package/samples/apps/styleguide/src/app/seed.ts +2 -2
- package/samples/apps/styleguide/src/features/ai-settings/seed.ts +2 -2
- package/samples/apps/ui-walkthrough/scripts/emit-e2e-data.ts +1 -1
- package/samples/apps/ui-walkthrough/src/app/auth-constants.ts +1 -1
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +2 -2
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +2 -0
- package/samples/apps/ui-walkthrough/src/app/seed-vehicles.ts +1 -1
- package/samples/apps/ui-walkthrough/src/app/seed.ts +1 -1
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +12 -0
- package/samples/apps/ui-walkthrough/src/db/queries/row-counts.ts +1 -1
- package/samples/apps/ui-walkthrough/src/db/queries/task-counts.ts +1 -1
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +7 -0
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +2 -0
- package/samples/apps/use-all-bundled/feature-manifest.json +4 -4
- package/samples/apps/use-all-bundled/package.json +4 -0
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +2 -2
- package/samples/apps/use-all-bundled/src/app/auth-constants.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/cap-overview-caps.ts +2 -2
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/seed-documents.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/seed.ts +11 -5
- package/samples/apps/use-all-bundled/src/run-config.ts +55 -56
- package/samples/apps/user-data-rights-demo/README.md +2 -2
- package/samples/apps/user-data-rights-demo/package.json +3 -0
- package/samples/apps/user-data-rights-demo/src/run-config.ts +7 -7
- package/samples/apps/workspaces/package.json +3 -0
- package/samples/recipes/access-control/package.json +3 -0
- package/samples/recipes/anonymous-access/package.json +3 -0
- package/samples/recipes/anonymous-access-multitenant/package.json +3 -0
- package/samples/recipes/apex-landing/package.json +1 -0
- package/samples/recipes/apex-surface-auth/package.json +3 -0
- package/samples/recipes/apex-surface-auth/src/feature.ts +2 -2
- package/samples/recipes/api-worker-split/package.json +3 -0
- package/samples/recipes/api-worker-split/src/feature.ts +1 -2
- package/samples/recipes/auth-claims/package.json +3 -0
- package/samples/recipes/auth-foundation-providers/src/feature.ts +1 -1
- package/samples/recipes/auth-mfa/package.json +3 -0
- package/samples/recipes/basic-entity/package.json +3 -0
- package/samples/recipes/chat-channels/package.json +3 -0
- package/samples/recipes/compliance-profiles-demo/package.json +3 -0
- package/samples/recipes/cross-feature-events/package.json +3 -1
- package/samples/recipes/cross-feature-events/src/feature.ts +1 -1
- package/samples/recipes/crypto-shredding-hr/package.json +3 -0
- package/samples/recipes/currencies-global/package.json +3 -0
- package/samples/recipes/currencies-per-tenant/package.json +3 -0
- package/samples/recipes/custom-fields-basic/package.json +3 -0
- package/samples/recipes/custom-handlers/package.json +3 -0
- package/samples/recipes/dashboard-stats/package.json +3 -0
- package/samples/recipes/delivery-notifications/package.json +3 -0
- package/samples/recipes/e2e-generator/package.json +3 -0
- package/samples/recipes/embedded/package.json +3 -0
- package/samples/recipes/embedded-entity-form/package.json +1 -0
- package/samples/recipes/encrypted-tenant-config/README.md +1 -1
- package/samples/recipes/encrypted-tenant-config/package.json +3 -0
- package/samples/recipes/error-contract/package.json +3 -0
- package/samples/recipes/event-sourcing/package.json +3 -1
- package/samples/recipes/event-sourcing/src/feature.ts +16 -20
- package/samples/recipes/event-sourcing/tsconfig.json +2 -6
- package/samples/recipes/feature-toggles/package.json +3 -0
- package/samples/recipes/field-access/package.json +3 -0
- package/samples/recipes/files-post-processing/package.json +1 -0
- package/samples/recipes/golden-path/README.md +30 -0
- package/samples/recipes/golden-path/package.json +11 -0
- package/samples/recipes/golden-path/src/feature.ts +70 -0
- package/samples/recipes/idempotency/package.json +3 -0
- package/samples/recipes/inbound-mail-triage/package.json +3 -0
- package/samples/recipes/lane-routing/package.json +3 -0
- package/samples/recipes/ledger-banking/package.json +3 -0
- package/samples/recipes/ledger-invoicing/package.json +3 -0
- package/samples/recipes/legal-pages/package.json +3 -0
- package/samples/recipes/lifecycle-hooks/package.json +3 -0
- package/samples/recipes/managed-config/package.json +3 -0
- package/samples/recipes/managed-pages/package.json +3 -0
- package/samples/recipes/notes-history-basic/package.json +3 -0
- package/samples/recipes/ownership/package.json +3 -0
- package/samples/recipes/pdf-audit-export/package.json +1 -0
- package/samples/recipes/pipeline-basics/package.json +3 -0
- package/samples/recipes/public-share-token/package.json +3 -0
- package/samples/recipes/public-share-token/src/feature.ts +1 -1
- package/samples/recipes/rate-limiting/package.json +3 -0
- package/samples/recipes/realtime-sse/package.json +3 -0
- package/samples/recipes/record-detail-layout/package.json +1 -0
- package/samples/recipes/reference-data/package.json +3 -0
- package/samples/recipes/relations/package.json +3 -0
- package/samples/recipes/screens-nav/package.json +3 -0
- package/samples/recipes/search/package.json +3 -0
- package/samples/recipes/secrets-demo/package.json +3 -0
- package/samples/recipes/security-baseline/src/feature.ts +2 -2
- package/samples/recipes/session-revocation/README.md +1 -1
- package/samples/recipes/session-revocation/package.json +3 -0
- package/samples/recipes/session-revocation/src/feature.ts +1 -1
- package/samples/recipes/state-machine/package.json +3 -1
- package/samples/recipes/state-machine/src/entities/invoice.ts +2 -2
- package/samples/recipes/state-machine/src/events.ts +19 -0
- package/samples/recipes/state-machine/src/feature.ts +25 -30
- package/samples/recipes/state-machine/src/handlers/_helpers.ts +13 -14
- package/samples/recipes/state-machine/src/handlers/create.ts +1 -1
- package/samples/recipes/state-machine/src/handlers/transitions.ts +129 -122
- package/samples/recipes/state-machine/src/reducer.ts +1 -1
- package/samples/recipes/state-machine/tsconfig.json +2 -6
- package/samples/recipes/tags-basic/package.json +3 -0
- package/samples/recipes/tenant-isolation/package.json +3 -0
- package/samples/recipes/tenant-settings/package.json +3 -0
- package/samples/recipes/tier-admin/package.json +3 -0
- package/samples/recipes/timezones/package.json +3 -0
- package/samples/recipes/tsconfig.base.json +1 -1
- package/samples/recipes/user-data-rights/package.json +3 -0
- package/samples/recipes/user-data-rights/src/feature.ts +6 -2
- package/samples/recipes/user-profile/package.json +3 -0
- package/samples/recipes/user-profile/src/feature.ts +2 -2
- package/samples/recipes/webhook-step/package.json +3 -0
- package/samples/recipes/wizard-form/package.json +1 -0
- package/samples/recipes/workflow-engine/package.json +3 -0
- package/samples/recipes/workflow-engine/src/db/queries/suspended-runs.ts +5 -2
- package/samples/recipes/writeform-section/package.json +1 -0
- package/packages/bundled-features/src/file-provider-s3-env/feature.ts +0 -58
- /package/packages/bundled-features/src/{files-provider-s3 → file-provider-s3/lib}/env-helper.ts +0 -0
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.368.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": "BUSL-1.1",
|
|
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.368.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
5
|
"license": "BUSL-1.1",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
@@ -73,6 +73,7 @@
|
|
|
73
73
|
"./mail-transport-inmemory": "./src/mail-transport-inmemory/index.ts",
|
|
74
74
|
"./file-foundation": "./src/file-foundation/index.ts",
|
|
75
75
|
"./file-provider-s3": "./src/file-provider-s3/index.ts",
|
|
76
|
+
"./file-provider-s3/lib": "./src/file-provider-s3/lib/index.ts",
|
|
76
77
|
"./document-ingest-foundation": "./src/document-ingest-foundation/index.ts",
|
|
77
78
|
"./file-provider-s3-env": "./src/file-provider-s3-env/index.ts",
|
|
78
79
|
"./file-provider-inmemory": "./src/file-provider-inmemory/index.ts",
|
|
@@ -397,6 +398,10 @@
|
|
|
397
398
|
"types": "./dist/file-provider-s3/index.d.ts",
|
|
398
399
|
"default": "./dist/file-provider-s3/index.js"
|
|
399
400
|
},
|
|
401
|
+
"./file-provider-s3/lib": {
|
|
402
|
+
"types": "./dist/file-provider-s3/lib/index.d.ts",
|
|
403
|
+
"default": "./dist/file-provider-s3/lib/index.js"
|
|
404
|
+
},
|
|
400
405
|
"./document-ingest-foundation": {
|
|
401
406
|
"types": "./dist/document-ingest-foundation/index.d.ts",
|
|
402
407
|
"default": "./dist/document-ingest-foundation/index.js"
|
|
@@ -707,6 +712,15 @@
|
|
|
707
712
|
"@cosmicdrift/kumiko-locale-es": "workspace:*",
|
|
708
713
|
"@cosmicdrift/kumiko-renderer-mail-html": "workspace:*",
|
|
709
714
|
"jsqr": "^1.4.0",
|
|
710
|
-
"unpdf": "^1.8.1"
|
|
715
|
+
"unpdf": "^1.8.1",
|
|
716
|
+
"@cosmicdrift/kumiko-testing": "workspace:*"
|
|
717
|
+
},
|
|
718
|
+
"peerDependencies": {
|
|
719
|
+
"@cosmicdrift/kumiko-testing": ">=0.366.0 <1.0.0"
|
|
720
|
+
},
|
|
721
|
+
"peerDependenciesMeta": {
|
|
722
|
+
"@cosmicdrift/kumiko-testing": {
|
|
723
|
+
"optional": true
|
|
724
|
+
}
|
|
711
725
|
}
|
|
712
726
|
}
|
|
@@ -3,7 +3,7 @@
|
|
|
3
3
|
// can only read events in their own tenant; a SystemAdmin can pass scope
|
|
4
4
|
// "system" to read app-instance system events (e.g. app.started).
|
|
5
5
|
|
|
6
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
6
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
7
7
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
9
9
|
import * as z from "zod";
|
|
@@ -12,7 +12,7 @@
|
|
|
12
12
|
// Event payloads hold PII as subject-KMS ciphertext; it is replaced by
|
|
13
13
|
// REDACTED_PII_PLACEHOLDER before returning, since the API leak guard refuses ciphertext.
|
|
14
14
|
|
|
15
|
-
import { selectMany, type WhereObject } from "@cosmicdrift/kumiko-framework/
|
|
15
|
+
import { selectMany, type WhereObject } from "@cosmicdrift/kumiko-framework/db";
|
|
16
16
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
17
17
|
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
18
18
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
@@ -1,13 +1,13 @@
|
|
|
1
|
-
import {
|
|
2
|
-
aggregateWhere,
|
|
3
|
-
runnerCanBeginTransaction,
|
|
4
|
-
selectMany,
|
|
5
|
-
} from "@cosmicdrift/kumiko-framework/bun-db";
|
|
6
1
|
import {
|
|
7
2
|
COMPLIANCE_PROFILES,
|
|
8
3
|
subtractRetentionSpec,
|
|
9
4
|
} from "@cosmicdrift/kumiko-framework/compliance";
|
|
10
5
|
import type { DbConnection, DbRunner } from "@cosmicdrift/kumiko-framework/db";
|
|
6
|
+
import {
|
|
7
|
+
aggregateWhere,
|
|
8
|
+
runnerCanBeginTransaction,
|
|
9
|
+
selectMany,
|
|
10
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
11
11
|
import {
|
|
12
12
|
type ConfigResolver,
|
|
13
13
|
parseTenantId,
|
|
@@ -10,8 +10,8 @@ import {
|
|
|
10
10
|
makeDispatchWriteAs,
|
|
11
11
|
type RoleDispatchArgs,
|
|
12
12
|
} from "@cosmicdrift/kumiko-framework/api";
|
|
13
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
14
13
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
14
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
15
15
|
import {
|
|
16
16
|
ConfigScopes,
|
|
17
17
|
createSystemUser,
|
package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts
CHANGED
|
@@ -21,8 +21,11 @@
|
|
|
21
21
|
// both already exist. The magic is the combined login+accept operation in
|
|
22
22
|
// one round trip.
|
|
23
23
|
|
|
24
|
-
import {
|
|
25
|
-
|
|
24
|
+
import {
|
|
25
|
+
createEventStoreExecutor,
|
|
26
|
+
createTenantDb,
|
|
27
|
+
fetchOne,
|
|
28
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
26
29
|
import {
|
|
27
30
|
buildSessionRoles,
|
|
28
31
|
createSystemUser,
|
|
@@ -235,7 +238,11 @@ export function createInviteAcceptWithLoginHandler(opts: InviteAcceptWithLoginOp
|
|
|
235
238
|
if (!globalGrant.isSuccess) return globalGrant;
|
|
236
239
|
|
|
237
240
|
// Invitation → accepted: TenantDb for the invitation's tenant.
|
|
238
|
-
const invitationTdb = createTenantDb(
|
|
241
|
+
const invitationTdb = createTenantDb({
|
|
242
|
+
db: dbConn,
|
|
243
|
+
tenantId: invitationTenantId,
|
|
244
|
+
mode: "system",
|
|
245
|
+
});
|
|
239
246
|
const updateResult = await invitationExecutor.update(
|
|
240
247
|
{
|
|
241
248
|
id: invitationId,
|
|
@@ -15,8 +15,11 @@
|
|
|
15
15
|
// Session"-Flow. Branch 2 (anon + existing email) und Branch 3 (anon +
|
|
16
16
|
// new email) kommen als separate Handler.
|
|
17
17
|
|
|
18
|
-
import {
|
|
19
|
-
|
|
18
|
+
import {
|
|
19
|
+
createEventStoreExecutor,
|
|
20
|
+
createTenantDb,
|
|
21
|
+
fetchOne,
|
|
22
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
20
23
|
import {
|
|
21
24
|
createSystemUser,
|
|
22
25
|
defineWriteHandler,
|
|
@@ -170,7 +173,11 @@ export function createInviteAcceptHandler() {
|
|
|
170
173
|
// Tenant-scoping: ctx.db ist auf event.user.tenantId gescopt
|
|
171
174
|
// (= NICHT der invitation-tenant). Eigene TenantDb für den
|
|
172
175
|
// invitation-tenant bauen damit der executor die row findet.
|
|
173
|
-
const invitationTdb = createTenantDb(
|
|
176
|
+
const invitationTdb = createTenantDb({
|
|
177
|
+
db: dbConn,
|
|
178
|
+
tenantId: invitationTenantId,
|
|
179
|
+
mode: "system",
|
|
180
|
+
});
|
|
174
181
|
const updateResult = await invitationExecutor.update(
|
|
175
182
|
{
|
|
176
183
|
id: invitationId,
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// the token store — the token is not burned and stays usable for the
|
|
6
6
|
// actual accept call.
|
|
7
7
|
|
|
8
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
8
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
9
9
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
10
10
|
import { UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
|
|
11
11
|
import * as z from "zod";
|
package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts
CHANGED
|
@@ -17,11 +17,11 @@
|
|
|
17
17
|
// e. Invitation → accepted, Token gelöscht
|
|
18
18
|
// 5. Response: SessionUser + tenantId für Auto-Login
|
|
19
19
|
|
|
20
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
21
20
|
import {
|
|
22
21
|
createEventStoreExecutor,
|
|
23
22
|
createTenantDb,
|
|
24
23
|
type DbConnection,
|
|
24
|
+
fetchOne,
|
|
25
25
|
} from "@cosmicdrift/kumiko-framework/db";
|
|
26
26
|
import {
|
|
27
27
|
buildSessionRoles,
|
|
@@ -185,7 +185,11 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
|
|
|
185
185
|
});
|
|
186
186
|
|
|
187
187
|
// Invitation → accepted: TenantDb für invitation-tenant
|
|
188
|
-
const invitationTdb = createTenantDb(
|
|
188
|
+
const invitationTdb = createTenantDb({
|
|
189
|
+
db: dbConn,
|
|
190
|
+
tenantId: invitationTenantId,
|
|
191
|
+
mode: "system",
|
|
192
|
+
});
|
|
189
193
|
const updateResult = await invitationExecutor.update(
|
|
190
194
|
{
|
|
191
195
|
id: invitationId,
|
|
@@ -19,8 +19,8 @@
|
|
|
19
19
|
// bei !committed wird der burn released damit ein legitimer Retry
|
|
20
20
|
// nicht durch einen stale Marker geblockt wird (wie reset/verify).
|
|
21
21
|
|
|
22
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
23
22
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
23
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
24
24
|
import {
|
|
25
25
|
defineWriteHandler,
|
|
26
26
|
type HandlerContext,
|
|
@@ -12,7 +12,6 @@
|
|
|
12
12
|
// Damit Sample-Server und Tests keine drei sub-paths zusammensammeln
|
|
13
13
|
// müssen.
|
|
14
14
|
|
|
15
|
-
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
16
15
|
import {
|
|
17
16
|
configuredBlindIndexKey,
|
|
18
17
|
configuredPiiSubjectKms,
|
|
@@ -20,10 +19,11 @@ import {
|
|
|
20
19
|
type LocalKeyKmsAdapter,
|
|
21
20
|
} from "@cosmicdrift/kumiko-framework/crypto";
|
|
22
21
|
import type { DbConnection } from "@cosmicdrift/kumiko-framework/db";
|
|
22
|
+
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
23
23
|
import type { SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
24
24
|
import { ConflictError } from "@cosmicdrift/kumiko-framework/errors";
|
|
25
25
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
26
|
-
import { TestUsers } from "@cosmicdrift/kumiko-framework/
|
|
26
|
+
import { TestUsers } from "@cosmicdrift/kumiko-framework/seeding";
|
|
27
27
|
import { hashPassword } from "../shared/index.js";
|
|
28
28
|
// kumiko-lint-ignore cross-feature-import auth-tests need user+tenant seed-helpers
|
|
29
29
|
import { type SeedTenantHooks, seedTenant, seedTenantMembership } from "../tenant/seeding.js";
|
|
@@ -44,45 +44,54 @@ export {
|
|
|
44
44
|
|
|
45
45
|
const FEATURE_NAME = "auth-foundation";
|
|
46
46
|
|
|
47
|
-
export
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
47
|
+
export function createAuthFoundationFeature() {
|
|
48
|
+
return defineFeature(
|
|
49
|
+
FEATURE_NAME,
|
|
50
|
+
(r) => {
|
|
51
|
+
r.describe(
|
|
52
|
+
"Declares auth-middleware extension points: `tokenVerifier` (Bearer), `sessionStore` (revocable JWT sid), optional `tenantResolver` + `tenantExistence` for anonymous multi-tenant. Provider-features register via r.useExtension; mount auth-foundation with the matching provider features.",
|
|
53
|
+
);
|
|
54
|
+
r.uiHints({
|
|
55
|
+
displayLabel: "Auth Provider Foundation",
|
|
56
|
+
category: "identity",
|
|
57
|
+
recommended: false,
|
|
58
|
+
});
|
|
56
59
|
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
60
|
+
r.extendsRegistrar(EXT_TOKEN_VERIFIER, {
|
|
61
|
+
onRegister: () => {
|
|
62
|
+
// No side-effects at register-time — registry stores the usage,
|
|
63
|
+
// resolveTokenVerifier looks it up at request-time.
|
|
64
|
+
},
|
|
65
|
+
});
|
|
66
|
+
r.bootCheck(({ features }) => validateTokenVerifierMultiplicity(features));
|
|
64
67
|
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
68
|
+
r.extendsRegistrar(EXT_SESSION_STORE, {
|
|
69
|
+
onRegister: () => {
|
|
70
|
+
// No side-effects at register-time — resolveSessionStore at boot/request.
|
|
71
|
+
},
|
|
72
|
+
});
|
|
73
|
+
r.bootCheck(({ features }) => validateSessionStoreMultiplicity(features));
|
|
71
74
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
75
|
+
r.extendsRegistrar(EXT_TENANT_RESOLVER, {
|
|
76
|
+
onRegister: () => {
|
|
77
|
+
// Optional — zero providers is fine (single-tenant / header-cookie).
|
|
78
|
+
},
|
|
79
|
+
});
|
|
80
|
+
r.bootCheck(({ features }) => validateTenantResolverMultiplicity(features));
|
|
78
81
|
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
|
|
82
|
+
r.extendsRegistrar(EXT_TENANT_EXISTENCE, {
|
|
83
|
+
onRegister: () => {
|
|
84
|
+
// Optional — zero providers skips the existence check.
|
|
85
|
+
},
|
|
86
|
+
});
|
|
87
|
+
r.bootCheck(({ features }) => validateTenantExistenceMultiplicity(features));
|
|
82
88
|
},
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
}
|
|
89
|
+
{ dedupeOptions: {} },
|
|
90
|
+
);
|
|
91
|
+
}
|
|
92
|
+
|
|
93
|
+
/** @deprecated Use createAuthFoundationFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
94
|
+
export const authFoundationFeature = createAuthFoundationFeature();
|
|
86
95
|
|
|
87
96
|
/**
|
|
88
97
|
* Tries every registered tokenVerifier provider's shape against `rawToken`
|
|
@@ -1,5 +1,8 @@
|
|
|
1
|
-
import {
|
|
2
|
-
|
|
1
|
+
import {
|
|
2
|
+
createEventStoreExecutor,
|
|
3
|
+
fetchOne,
|
|
4
|
+
type TenantDb,
|
|
5
|
+
} from "@cosmicdrift/kumiko-framework/db";
|
|
3
6
|
import type { SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
7
|
import { parseJsonOrThrow } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
8
|
import { userMfaEntity, userMfaTable } from "../schema/user-mfa.js";
|
|
@@ -134,7 +134,7 @@ export function createEnableConfirmPreauthHandler(opts: EnableConfirmPreauthOpti
|
|
|
134
134
|
|
|
135
135
|
// "system" mode: no session exists yet, tenantId comes from the
|
|
136
136
|
// verified token, mirroring enable-start-preauth.write.ts.
|
|
137
|
-
const scopedDb = createTenantDb(ctx.db.unsafeRaw(), tenantId, "system");
|
|
137
|
+
const scopedDb = createTenantDb({ db: ctx.db.unsafeRaw(), tenantId, mode: "system" });
|
|
138
138
|
const scopedUser: SessionUser = { id: userId, tenantId, roles: ["User"] };
|
|
139
139
|
const existing = await findUserMfaRow(scopedDb, scopedUser);
|
|
140
140
|
if (existing) return mfaAlreadyEnabled();
|
|
@@ -62,7 +62,7 @@ export function createEnableStartPreauthHandler(opts: EnableStartPreauthOptions)
|
|
|
62
62
|
// "system" mode: the guest dispatch identity's own tenantId is
|
|
63
63
|
// meaningless here — the preauthSetupToken is the source of truth
|
|
64
64
|
// for which tenant's row to read, mirroring verify.write.ts.
|
|
65
|
-
const scopedDb = createTenantDb(ctx.db.unsafeRaw(), tenantId, "system");
|
|
65
|
+
const scopedDb = createTenantDb({ db: ctx.db.unsafeRaw(), tenantId, mode: "system" });
|
|
66
66
|
const scopedUser: SessionUser = { id: userId, tenantId, roles: ["User"] };
|
|
67
67
|
const existing = await findUserMfaRow(scopedDb, scopedUser);
|
|
68
68
|
if (existing) return mfaAlreadyEnabled();
|
|
@@ -23,7 +23,6 @@
|
|
|
23
23
|
// an old-KEK wrap would happen if rotation only touched the read-side
|
|
24
24
|
// projection instead of appending a real `.updated` event).
|
|
25
25
|
|
|
26
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
27
26
|
import {
|
|
28
27
|
collectPiiSubjectFields,
|
|
29
28
|
configuredPiiSubjectKms,
|
|
@@ -34,6 +33,7 @@ import {
|
|
|
34
33
|
createEventStoreExecutor,
|
|
35
34
|
createTenantDb,
|
|
36
35
|
type DbConnection,
|
|
36
|
+
selectMany,
|
|
37
37
|
type TenantDb,
|
|
38
38
|
} from "@cosmicdrift/kumiko-framework/db";
|
|
39
39
|
import type { JobContext, SessionUser, TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
@@ -109,7 +109,7 @@ export async function mfaReencryptJob(
|
|
|
109
109
|
function tdbFor(tenantId: TenantId): TenantDb {
|
|
110
110
|
let existing = tdbCache.get(tenantId);
|
|
111
111
|
if (!existing) {
|
|
112
|
-
existing = createTenantDb(db, tenantId, "system");
|
|
112
|
+
existing = createTenantDb({ db, tenantId, mode: "system" });
|
|
113
113
|
tdbCache.set(tenantId, existing);
|
|
114
114
|
}
|
|
115
115
|
return existing;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { userMfaTable } from "../schema/user-mfa.js";
|
|
@@ -98,7 +98,7 @@ export function createMfaVerifyHandler(opts: MfaVerifyOptions) {
|
|
|
98
98
|
// "system" mode: this handler runs with a guest identity whose own
|
|
99
99
|
// tenantId is meaningless here — the challenge token is the source
|
|
100
100
|
// of truth for which tenant's row to read.
|
|
101
|
-
const scopedDb = createTenantDb(ctx.db.unsafeRaw(), tenantId, "system");
|
|
101
|
+
const scopedDb = createTenantDb({ db: ctx.db.unsafeRaw(), tenantId, mode: "system" });
|
|
102
102
|
const scopedUser: SessionUser = { id: userId, tenantId, roles: ["User"] };
|
|
103
103
|
const row = await findUserMfaRow(scopedDb, scopedUser);
|
|
104
104
|
// MFA got disabled between login and verify (race, or a stale
|
|
@@ -29,7 +29,7 @@ export function createMfaCodeVerifier(): MfaCodeVerifier {
|
|
|
29
29
|
reason:
|
|
30
30
|
"reads the MFA enrollment of the user being re-authenticated on the caller's handler context; the calling handler declares its own escapeHatch",
|
|
31
31
|
});
|
|
32
|
-
const scopedDb = createTenantDb(ctx.db.unsafeRaw(), tenantId, "system");
|
|
32
|
+
const scopedDb = createTenantDb({ db: ctx.db.unsafeRaw(), tenantId, mode: "system" });
|
|
33
33
|
const row = await findUserMfaRow(scopedDb, { id: userId, tenantId, roles: [] });
|
|
34
34
|
if (!row) return { enrolled: false, ok: false };
|
|
35
35
|
// Fail closed without ctx.redis, matching disable.write.ts/verify.write.ts —
|
|
@@ -47,7 +47,7 @@ export function createMfaStatusChecker(opts: {
|
|
|
47
47
|
reason:
|
|
48
48
|
"reads the MFA enrollment of the tenant named in the signed login/setup token, not the guest dispatch tenant, on the caller's handler context; the calling handler declares its own escapeHatch",
|
|
49
49
|
});
|
|
50
|
-
const scopedDb = createTenantDb(ctx.db.unsafeRaw(), tenantId, "system");
|
|
50
|
+
const scopedDb = createTenantDb({ db: ctx.db.unsafeRaw(), tenantId, mode: "system" });
|
|
51
51
|
const scopedUser: SessionUser = { id: userId, tenantId, roles: ["User"] };
|
|
52
52
|
const row = await findUserMfaRow(scopedDb, scopedUser);
|
|
53
53
|
|
|
@@ -8,14 +8,23 @@
|
|
|
8
8
|
import { defineFeature, EXT_USER_DATA } from "@cosmicdrift/kumiko-framework/engine";
|
|
9
9
|
import { userMfaDeleteHook, userMfaExportHook } from "./hooks.js";
|
|
10
10
|
|
|
11
|
-
export
|
|
12
|
-
|
|
13
|
-
"
|
|
11
|
+
export function createAuthMfaUserDataFeature() {
|
|
12
|
+
return defineFeature(
|
|
13
|
+
"auth-mfa-user-data",
|
|
14
|
+
(r) => {
|
|
15
|
+
r.describe(
|
|
16
|
+
"GDPR (Art. 20 export / Art. 17 erasure) coverage for the `auth-mfa` feature's `user-mfa` entity. Mounts the EXT_USER_DATA export + delete hooks so 2FA enrollment status is included in the user-data export bundle and a user's TOTP secret + recovery codes are hard-deleted (via executor.forget, rebuild-safe) on a data-subject erasure request. Kept separate from `auth-mfa` so consumers without the user-data-rights pipeline don't pull a hard dependency — requires `user-data-rights`, optionalRequires `auth-mfa`.",
|
|
17
|
+
);
|
|
18
|
+
r.requires({ features: ["user-data-rights"] });
|
|
19
|
+
r.optionalRequires("auth-mfa");
|
|
20
|
+
r.useExtension(EXT_USER_DATA, "user-mfa", {
|
|
21
|
+
export: userMfaExportHook,
|
|
22
|
+
delete: userMfaDeleteHook,
|
|
23
|
+
});
|
|
24
|
+
},
|
|
25
|
+
{ dedupeOptions: {} },
|
|
14
26
|
);
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
delete: userMfaDeleteHook,
|
|
20
|
-
});
|
|
21
|
-
});
|
|
27
|
+
}
|
|
28
|
+
|
|
29
|
+
/** @deprecated Use createAuthMfaUserDataFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
30
|
+
export const authMfaUserDataFeature = createAuthMfaUserDataFeature();
|
|
@@ -5,7 +5,7 @@
|
|
|
5
5
|
// off the app's extraContext.
|
|
6
6
|
//
|
|
7
7
|
// Deliberately does NOT call defineQueryHandler itself: apps use different
|
|
8
|
-
// wrappers around it (publicstatus's
|
|
8
|
+
// wrappers around it (publicstatus's own wrapper, which adds
|
|
9
9
|
// `agent: { expose: false }`; show-pony's plain framework
|
|
10
10
|
// `defineQueryHandler`). Calling defineQueryHandler here would bypass
|
|
11
11
|
// whatever an app's own wrapper does. Instead this factory returns just the
|