@cosmicdrift/kumiko-bundled-features 0.367.0 → 0.369.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/audit/handlers/details.query.js +1 -1
- package/dist/audit/handlers/list.query.js +1 -1
- package/dist/audit/run-escape-hatch-retention.js +1 -1
- package/dist/auth-email-password/bootstrap.js +1 -1
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +6 -3
- package/dist/auth-email-password/handlers/invite-accept.write.js +6 -3
- package/dist/auth-email-password/handlers/invite-info.query.js +1 -1
- package/dist/auth-email-password/handlers/invite-signup-complete.write.js +6 -3
- package/dist/auth-email-password/handlers/signup-confirm.write.js +1 -1
- package/dist/auth-email-password/seeding.js +2 -2
- package/dist/auth-foundation/feature.d.ts +4 -0
- package/dist/auth-foundation/feature.js +37 -33
- package/dist/auth-foundation/index.d.ts +1 -1
- package/dist/auth-foundation/index.js +1 -1
- package/dist/auth-mfa/db/queries.js +1 -2
- package/dist/auth-mfa/handlers/enable-confirm-preauth.write.js +1 -1
- package/dist/auth-mfa/handlers/enable-start-preauth.write.js +1 -1
- package/dist/auth-mfa/handlers/reencrypt.job.js +2 -3
- package/dist/auth-mfa/handlers/status.query.js +1 -1
- package/dist/auth-mfa/handlers/verify.write.js +1 -1
- package/dist/auth-mfa/mfa-code-verifier.js +1 -1
- package/dist/auth-mfa/mfa-status-checker.js +1 -1
- package/dist/auth-mfa-user-data/index.d.ts +4 -0
- package/dist/auth-mfa-user-data/index.js +13 -9
- package/dist/billing-foundation/billing-info-query.js +1 -1
- package/dist/billing-foundation/feature.d.ts +1 -0
- package/dist/billing-foundation/feature.js +5 -6
- package/dist/billing-foundation/handlers/create-portal-session.write.js +1 -1
- package/dist/billing-foundation/projection.js +1 -2
- package/dist/cap-counter/calendar-cap-usage-reservation.d.ts +7 -0
- package/dist/cap-counter/calendar-cap-usage-reservation.js +28 -2
- package/dist/cap-counter/cap-reservation.d.ts +16 -0
- package/dist/cap-counter/cap-reservation.js +144 -14
- package/dist/cap-counter/feature.d.ts +4 -0
- package/dist/cap-counter/feature.js +74 -68
- package/dist/cap-counter/handlers/increment-rolling.write.js +3 -4
- package/dist/cap-counter/index.d.ts +3 -2
- package/dist/cap-counter/index.js +3 -2
- package/dist/cap-counter/tables.js +10 -3
- package/dist/cap-overview/handlers/caps-usage.query.js +1 -2
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +1 -2
- package/dist/cap-overview/handlers/tenant-options.query.js +1 -1
- package/dist/channel-email/email-channel.d.ts +13 -5
- package/dist/channel-email/email-channel.js +17 -3
- package/dist/channel-email/feature.js +1 -1
- package/dist/channel-email/index.d.ts +1 -1
- package/dist/channel-email/index.js +1 -1
- package/dist/channel-in-app/handlers/inbox.query.js +1 -1
- package/dist/channel-in-app/handlers/mark-all-read.write.js +1 -1
- package/dist/channel-in-app/handlers/mark-read.write.js +1 -1
- package/dist/channel-in-app/handlers/unread-count.query.js +1 -1
- package/dist/channel-in-app/tables.js +1 -2
- package/dist/compliance-profiles/handlers/for-tenant.query.js +1 -1
- package/dist/compliance-profiles/handlers/needs-profile.query.js +1 -1
- package/dist/compliance-profiles/handlers/set-profile.write.js +1 -2
- package/dist/compliance-profiles/resolve-for-tenant.js +1 -1
- package/dist/compliance-profiles/seeding.js +3 -5
- package/dist/compliance-profiles-ops/index.d.ts +8 -0
- package/dist/compliance-profiles-ops/index.js +19 -15
- package/dist/config/db/queries/resolver.js +1 -1
- package/dist/config/handlers/reencrypt.job.js +2 -2
- package/dist/config/resolver.js +1 -1
- package/dist/config/web/i18n.js +1 -2
- package/dist/config/write-helpers.js +1 -1
- package/dist/crypto-shredding/handlers/forget-subject.write.js +6 -3
- package/dist/custom-fields/db/queries/field-access.js +1 -1
- package/dist/custom-fields/db/queries/projection.js +1 -1
- package/dist/custom-fields/db/queries/quota.js +1 -1
- package/dist/custom-fields/db/queries/retention.js +1 -2
- package/dist/custom-fields/db/queries/user-data-rights.js +1 -1
- package/dist/custom-fields/feature.d.ts +20 -2
- package/dist/custom-fields/feature.js +9 -13
- package/dist/custom-fields/handlers/clear-custom-field.write.js +2 -2
- package/dist/custom-fields/handlers/delete-system-field.write.js +2 -2
- package/dist/custom-fields/handlers/delete-tenant-field.write.js +2 -2
- package/dist/custom-fields/handlers/set-custom-field.write.js +2 -2
- package/dist/custom-fields/wire-for-entity.js +4 -4
- package/dist/data-retention/resolve-for-tenant.js +1 -1
- package/dist/data-retention/run-retention-cleanup.js +17 -13
- package/dist/delivery/address-opt-out.js +1 -2
- package/dist/delivery/attempt-log-retention.js +1 -1
- package/dist/delivery/channel-context.js +1 -1
- package/dist/delivery/db/queries/address-opt-outs.js +1 -1
- package/dist/delivery/db/queries/preferences.js +1 -1
- package/dist/delivery/delivery-service.js +16 -7
- package/dist/delivery/feature.js +2 -2
- package/dist/delivery/handlers/log.query.js +2 -3
- package/dist/delivery/handlers/preferences.query.js +1 -1
- package/dist/delivery/index.d.ts +3 -2
- package/dist/delivery/index.js +3 -2
- package/dist/delivery/unsubscribe.d.ts +13 -0
- package/dist/delivery/unsubscribe.js +32 -27
- package/dist/delivery/upsert-preference.js +1 -2
- package/dist/derivatives-sharp/feature.d.ts +4 -0
- package/dist/derivatives-sharp/feature.js +15 -11
- package/dist/derivatives-sharp/index.d.ts +1 -1
- package/dist/derivatives-sharp/index.js +1 -1
- package/dist/document-ingest-foundation/feature.d.ts +7 -0
- package/dist/document-ingest-foundation/feature.js +94 -90
- package/dist/document-ingest-foundation/forget-extract-with-file-ref.js +3 -3
- package/dist/document-ingest-foundation/index.d.ts +1 -1
- package/dist/document-ingest-foundation/index.js +1 -1
- package/dist/feature-toggles/global-feature-state-table.js +1 -2
- package/dist/feature-toggles/handlers/set.write.js +3 -5
- package/dist/feature-toggles/toggle-runtime.js +1 -1
- package/dist/file-derivatives/feature.d.ts +1 -0
- package/dist/file-derivatives/feature.js +2 -1
- package/dist/file-derivatives/handlers/public-variant-by-file-ref.query.js +1 -1
- package/dist/file-derivatives/handlers/public-variant.query.js +1 -1
- package/dist/file-foundation/feature.d.ts +6 -0
- package/dist/file-foundation/feature.js +29 -25
- package/dist/file-foundation/index.d.ts +1 -1
- package/dist/file-foundation/index.js +1 -1
- package/dist/file-foundation/read-file-ref-content.js +1 -1
- package/dist/file-provider-inmemory/feature.d.ts +4 -0
- package/dist/file-provider-inmemory/feature.js +24 -20
- package/dist/file-provider-inmemory/index.d.ts +1 -1
- package/dist/file-provider-inmemory/index.js +1 -1
- package/dist/file-provider-s3/env-feature.d.ts +3 -0
- package/dist/file-provider-s3/env-feature.js +46 -0
- package/dist/file-provider-s3/feature.d.ts +26 -0
- package/dist/file-provider-s3/feature.js +84 -72
- package/dist/file-provider-s3/index.d.ts +1 -1
- package/dist/file-provider-s3/index.js +1 -1
- package/dist/file-provider-s3/lib/index.d.ts +3 -0
- package/dist/file-provider-s3/lib/index.js +2 -0
- package/dist/{files-provider-s3 → file-provider-s3/lib}/s3-provider.js +19 -19
- package/dist/file-provider-s3-env/index.d.ts +8 -1
- package/dist/file-provider-s3-env/index.js +7 -2
- package/dist/files-provider-s3/index.d.ts +5 -3
- package/dist/files-provider-s3/index.js +5 -2
- package/dist/files-tenant-data/handlers/sweep-orphaned-derivatives.job.js +1 -1
- package/dist/files-tenant-data/hooks.js +1 -2
- package/dist/folders/feature.d.ts +6 -2
- package/dist/folders/feature.js +4 -2
- package/dist/folders-user-data/index.d.ts +4 -0
- package/dist/folders-user-data/index.js +21 -17
- package/dist/form-draft/db/queries/cleanup.js +1 -1
- package/dist/form-draft/db/queries/draft-count.js +1 -1
- package/dist/form-draft/db/queries/owned-file-refs.js +1 -2
- package/dist/form-draft/feature.d.ts +4 -0
- package/dist/form-draft/feature.js +5 -1
- package/dist/form-draft/handlers/cleanup.job.js +2 -2
- package/dist/form-draft/index.d.ts +1 -1
- package/dist/form-draft/index.js +1 -1
- package/dist/form-draft/lookup.js +1 -1
- package/dist/form-draft-user-data/index.d.ts +4 -0
- package/dist/form-draft-user-data/index.js +13 -9
- package/dist/inbound-mail-foundation/feature.d.ts +4 -0
- package/dist/inbound-mail-foundation/feature.js +151 -147
- package/dist/inbound-mail-foundation/handlers/ingest-message.write.js +1 -2
- package/dist/inbound-mail-foundation/index.d.ts +1 -1
- package/dist/inbound-mail-foundation/index.js +1 -1
- package/dist/inbound-mail-foundation/oauth-access-token.js +1 -2
- package/dist/inbound-mail-foundation/projection.js +1 -2
- package/dist/inbound-mail-foundation/watch-supervisor.js +1 -1
- package/dist/inbound-provider-imap/feature.d.ts +4 -0
- package/dist/inbound-provider-imap/feature.js +16 -12
- package/dist/inbound-provider-imap/index.d.ts +1 -1
- package/dist/inbound-provider-imap/index.js +1 -1
- package/dist/inbound-provider-inmemory/feature.d.ts +4 -0
- package/dist/inbound-provider-inmemory/feature.js +14 -10
- package/dist/inbound-provider-inmemory/index.d.ts +1 -1
- package/dist/inbound-provider-inmemory/index.js +1 -1
- package/dist/jobs/db/queries/retention.js +1 -1
- package/dist/jobs/db/queries/stale-run-sweep.js +1 -1
- package/dist/jobs/handlers/detail.query.js +1 -1
- package/dist/jobs/handlers/list.query.js +1 -2
- package/dist/jobs/handlers/retry.write.js +1 -1
- package/dist/jobs/handlers/tenant-failures.query.js +1 -1
- package/dist/jobs/handlers/tenant-runs.query.js +1 -1
- package/dist/jobs/job-run-logger.js +1 -2
- package/dist/jobs/tenant-job-failure-table.js +1 -2
- package/dist/jobs/tenant-job-run-table.js +1 -2
- package/dist/ledger/feature.d.ts +6 -2
- package/dist/ledger/feature.js +4 -2
- package/dist/mail-foundation/feature.d.ts +11 -0
- package/dist/mail-foundation/feature.js +52 -42
- package/dist/mail-foundation/i18n.d.ts +14 -0
- package/dist/mail-foundation/i18n.js +8 -0
- package/dist/mail-foundation/index.d.ts +1 -1
- package/dist/mail-foundation/index.js +1 -1
- package/dist/mail-transport-inmemory/feature.d.ts +4 -0
- package/dist/mail-transport-inmemory/feature.js +26 -16
- package/dist/mail-transport-inmemory/index.d.ts +1 -1
- package/dist/mail-transport-inmemory/index.js +1 -1
- package/dist/mail-transport-smtp/config-keys.d.ts +7 -0
- package/dist/mail-transport-smtp/config-keys.js +65 -0
- package/dist/mail-transport-smtp/feature.d.ts +17 -1
- package/dist/mail-transport-smtp/feature.js +58 -80
- package/dist/mail-transport-smtp/i18n.d.ts +41 -0
- package/dist/mail-transport-smtp/i18n.js +28 -0
- package/dist/mail-transport-smtp/index.d.ts +1 -1
- package/dist/mail-transport-smtp/index.js +1 -1
- package/dist/managed-pages/handlers/by-slug.query.js +1 -1
- package/dist/managed-pages/handlers/by-tenant-published.query.js +1 -2
- package/dist/managed-pages/handlers/set.write.js +1 -2
- package/dist/managed-pages/seeding.js +3 -5
- package/dist/metrics/compute.d.ts +1 -1
- package/dist/metrics/filters.d.ts +1 -1
- package/dist/metrics/filters.js +1 -1
- package/dist/metrics/validate.js +1 -1
- package/dist/notes-history/feature.d.ts +7 -2
- package/dist/notes-history/feature.js +4 -2
- package/dist/notes-history/handlers/add-note.write.js +1 -1
- package/dist/notes-history-user-data/hooks.js +1 -1
- package/dist/notes-history-user-data/index.d.ts +4 -0
- package/dist/notes-history-user-data/index.js +21 -17
- package/dist/personal-access-tokens/feature.d.ts +4 -1
- package/dist/personal-access-tokens/feature.js +10 -2
- package/dist/personal-access-tokens/handlers/create.write.js +1 -1
- package/dist/personal-access-tokens/handlers/list.query.js +2 -2
- package/dist/personal-access-tokens/handlers/revoke.write.js +1 -1
- package/dist/personal-access-tokens/resolver.js +1 -1
- package/dist/personal-access-tokens/revoke-for-user.js +1 -1
- package/dist/personal-access-tokens/roles.js +3 -5
- package/dist/personal-access-tokens/screens.js +2 -0
- package/dist/readiness/feature.d.ts +8 -0
- package/dist/readiness/feature.js +18 -14
- package/dist/readiness/index.d.ts +1 -1
- package/dist/readiness/index.js +1 -1
- package/dist/secrets/db/queries/read.js +1 -1
- package/dist/secrets/feature.d.ts +4 -0
- package/dist/secrets/feature.js +19 -6
- package/dist/secrets/handlers/delete.write.js +3 -2
- package/dist/secrets/handlers/rotate.job.js +2 -3
- package/dist/secrets/handlers/set.write.js +3 -2
- package/dist/secrets/secrets-context.js +3 -4
- package/dist/sessions/db/queries/cleanup.js +1 -1
- package/dist/sessions/handlers/detail.query.js +1 -1
- package/dist/sessions/handlers/list.query.js +2 -2
- package/dist/sessions/handlers/mine.query.js +1 -1
- package/dist/sessions/handlers/revoke-all-for-user.write.js +1 -1
- package/dist/sessions/handlers/revoke-all-others.write.js +1 -1
- package/dist/sessions/handlers/revoke.write.js +1 -1
- package/dist/sessions/session-callbacks.js +4 -6
- package/dist/sessions/testing.d.ts +1 -1
- package/dist/tags/feature.d.ts +6 -2
- package/dist/tags/feature.js +4 -2
- package/dist/template-resolver/api.js +1 -1
- package/dist/template-resolver/constants.d.ts +0 -1
- package/dist/template-resolver/constants.js +0 -1
- package/dist/template-resolver/handlers/bundle-import.js +1 -1
- package/dist/template-resolver/handlers/by-slug.query.js +1 -1
- package/dist/template-resolver/handlers/by-tenant.query.js +1 -2
- package/dist/template-resolver/handlers/collection-item.query.js +1 -1
- package/dist/template-resolver/handlers/collection-list.query.js +1 -2
- package/dist/template-resolver/handlers/collection-set.write.js +1 -1
- package/dist/template-resolver/handlers/copy-locale.write.js +1 -1
- package/dist/template-resolver/handlers/diff-to-system.query.js +1 -1
- package/dist/template-resolver/handlers/export-bundle.query.js +1 -1
- package/dist/template-resolver/handlers/find-by-id.query.js +1 -1
- package/dist/template-resolver/handlers/layout-source.query.js +1 -1
- package/dist/template-resolver/handlers/list.query.js +1 -1
- package/dist/template-resolver/handlers/overview.query.js +1 -1
- package/dist/template-resolver/handlers/reset-to-system.write.js +1 -1
- package/dist/template-resolver/handlers/resource-remove.write.js +1 -1
- package/dist/template-resolver/handlers/send-test.write.js +4 -2
- package/dist/template-resolver/handlers/set.write.js +1 -1
- package/dist/template-resolver/handlers/template-write.js +1 -1
- package/dist/template-resolver/handlers/tenant-overrides.query.js +1 -1
- package/dist/template-resolver/handlers/toggle-status.write.js +1 -1
- package/dist/template-resolver/handlers/usage.query.js +1 -1
- package/dist/template-resolver/handlers/validate.query.js +1 -1
- package/dist/template-resolver/seeding.js +3 -4
- package/dist/template-resolver/store-template-resource.js +1 -1
- package/dist/template-resolver/template-preview.js +1 -1
- package/dist/template-resolver/template-resources.js +1 -1
- package/dist/template-resolver/testing.js +1 -1
- package/dist/template-resolver-user-data/index.d.ts +4 -0
- package/dist/template-resolver-user-data/index.js +17 -13
- package/dist/tenant/handlers/active-tenant-ids.query.js +1 -1
- package/dist/tenant/handlers/add-member.write.js +1 -2
- package/dist/tenant/handlers/cancel-invitation.write.js +1 -1
- package/dist/tenant/handlers/invitations.query.js +1 -1
- package/dist/tenant/handlers/me.query.js +1 -1
- package/dist/tenant/handlers/member-directory.query.js +1 -1
- package/dist/tenant/handlers/members.query.js +1 -1
- package/dist/tenant/handlers/memberships.query.js +1 -1
- package/dist/tenant/handlers/remove-member.write.js +1 -2
- package/dist/tenant/handlers/resolve-user-ids.query.js +1 -1
- package/dist/tenant/handlers/team-list.query.js +1 -1
- package/dist/tenant/handlers/tenant-directory.query.js +1 -1
- package/dist/tenant/handlers/update-member-roles.write.js +1 -2
- package/dist/tenant/invited-membership.js +2 -3
- package/dist/tenant/last-tenant-admin.js +1 -2
- package/dist/tenant/seeding.js +12 -6
- package/dist/tenant-lifecycle/handlers/cancel-destruction.write.js +1 -2
- package/dist/tenant-lifecycle/handlers/request-destruction.write.js +1 -2
- package/dist/tenant-lifecycle/lib/revoke-tenant-sessions.js +1 -1
- package/dist/tenant-lifecycle/lifecycle-gate.js +1 -1
- package/dist/tenant-lifecycle/run-tenant-destroy.js +3 -5
- package/dist/tenant-lifecycle/stages.js +10 -6
- package/dist/tenant-lifecycle/testing.d.ts +1 -1
- package/dist/tenant-lifecycle/testing.js +2 -2
- package/dist/tenant-settings/feature.d.ts +1 -0
- package/dist/tenant-settings/feature.js +2 -1
- package/dist/tier-engine/feature.d.ts +1 -8
- package/dist/tier-engine/feature.js +71 -78
- package/dist/tier-engine/handlers/get-tenant-tier.query.js +2 -3
- package/dist/tier-engine/handlers/set-tenant-tier.write.js +1 -2
- package/dist/user/db/queries/stream-tenant-backfill.js +1 -1
- package/dist/user/handlers/create.write.js +1 -2
- package/dist/user/handlers/find-for-auth.query.js +1 -1
- package/dist/user/handlers/list.query.js +1 -1
- package/dist/user/handlers/update-roles.js +1 -2
- package/dist/user/index.d.ts +1 -1
- package/dist/user/index.js +1 -1
- package/dist/user/invited-global-roles.js +2 -3
- package/dist/user/principal-status.d.ts +4 -0
- package/dist/user/principal-status.js +9 -3
- package/dist/user/resolve-display-names.js +1 -1
- package/dist/user/seeding.js +5 -6
- package/dist/user-data-rights/audit-download.js +2 -2
- package/dist/user-data-rights/db/queries/export-jobs.js +1 -1
- package/dist/user-data-rights/db/queries/forget-cleanup.js +1 -1
- package/dist/user-data-rights/feature.js +7 -4
- package/dist/user-data-rights/handlers/download-by-job.query.js +1 -1
- package/dist/user-data-rights/handlers/download-by-token.query.js +1 -1
- package/dist/user-data-rights/handlers/export-status.query.js +1 -1
- package/dist/user-data-rights/handlers/list-download-attempts.query.js +1 -1
- package/dist/user-data-rights/handlers/my-audit-log.query.js +1 -1
- package/dist/user-data-rights/handlers/request-export.write.js +1 -2
- package/dist/user-data-rights/handlers/run-forget-cleanup.write.js +3 -3
- package/dist/user-data-rights/lib/default-mailers.d.ts +3 -0
- package/dist/user-data-rights/lib/default-mailers.js +25 -3
- package/dist/user-data-rights/lib/deny-if-target-outside-admin-tenant.d.ts +1 -1
- package/dist/user-data-rights/lib/deny-if-target-outside-admin-tenant.js +1 -1
- package/dist/user-data-rights/lib/update-user-lifecycle.d.ts +1 -0
- package/dist/user-data-rights/lib/update-user-lifecycle.js +3 -3
- package/dist/user-data-rights/run-export-jobs.js +2 -3
- package/dist/user-data-rights/run-forget-cleanup.js +9 -5
- package/dist/user-data-rights/run-user-export.js +9 -5
- package/dist/waitlist/handlers/invite.write.js +1 -2
- package/dist/waitlist/handlers/reject.write.js +1 -1
- package/dist/waitlist/lib.js +1 -2
- package/dist/workflow-runner/event-subscriber.js +1 -1
- package/dist/workflow-runner/feature.d.ts +4 -0
- package/dist/workflow-runner/feature.js +44 -40
- package/dist/workflow-runner/handlers/resume-run.write.js +1 -1
- package/dist/workflow-runner/index.d.ts +1 -1
- package/dist/workflow-runner/index.js +1 -1
- package/dist/workflow-runner/pending-projection.js +1 -1
- package/package.json +28 -11
- package/src/cap-counter/changes.json +13 -0
- package/src/channel-email/changes.json +7 -0
- package/src/crypto-shredding/changes.json +6 -0
- package/src/delivery/changes.json +6 -0
- package/src/file-provider-s3/changes.json +10 -1
- package/src/mail-transport-smtp/changes.json +7 -0
- package/src/personal-access-tokens/changes.json +6 -0
- package/src/secrets/changes.json +6 -0
- package/src/user/changes.json +6 -0
- package/src/user-data-rights/changes.json +6 -0
- package/dist/file-provider-s3-env/feature.d.ts +0 -3
- package/dist/file-provider-s3-env/feature.js +0 -46
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/env-helper.d.ts +0 -0
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/env-helper.js +0 -0
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/s3-provider.d.ts +0 -0
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export declare function createReadinessFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
2
|
+
readonly exports: {
|
|
3
|
+
queries: {
|
|
4
|
+
status: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/** @deprecated Use createReadinessFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
1
9
|
export declare const readinessFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
2
10
|
readonly exports: {
|
|
3
11
|
queries: {
|
|
@@ -9,17 +9,21 @@
|
|
|
9
9
|
// `ready` boolean — the settings-checklist call for admin UIs.
|
|
10
10
|
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
11
11
|
import { statusQuery } from "./handlers/status.query.js";
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
12
|
+
export function createReadinessFeature() {
|
|
13
|
+
return defineFeature("readiness", (r) => {
|
|
14
|
+
r.describe("One-call tenant-onboarding probe: `readiness:query:status` rolls up every config key and secret declared `required: true` across all mounted features and reports which still lack a usable value for the calling tenant, plus a single `ready` boolean. Provider-features under an `r.extensionSelector`-declared extension point count only while their provider is the selected one — a tenant on the inmemory mail transport is not blocked by unset SMTP keys. Mount it (together with `config` and `secrets`) when an admin UI needs a settings checklist before the first mail-send or file-write; the per-concern lists stay available via `config:query:readiness` and `secrets:query:list`.");
|
|
15
|
+
r.uiHints({
|
|
16
|
+
displayLabel: "Readiness · Onboarding Probe",
|
|
17
|
+
category: "operations",
|
|
18
|
+
recommended: false,
|
|
19
|
+
});
|
|
20
|
+
r.requires({ features: ["config"] });
|
|
21
|
+
r.requires({ features: ["secrets"] });
|
|
22
|
+
const queries = {
|
|
23
|
+
status: r.queryHandler(statusQuery),
|
|
24
|
+
};
|
|
25
|
+
return { queries };
|
|
26
|
+
}, { dedupeOptions: {} });
|
|
27
|
+
}
|
|
28
|
+
/** @deprecated Use createReadinessFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
29
|
+
export const readinessFeature = createReadinessFeature();
|
package/dist/readiness/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { READINESS_FEATURE, ReadinessQueries } from "./constants.js";
|
|
2
|
-
export { readinessFeature } from "./feature.js";
|
|
2
|
+
export { createReadinessFeature, readinessFeature } from "./feature.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asRawClient } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { asRawClient } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
export async function selectTenantSecretEnvelope(db, tenantId, key) {
|
|
3
3
|
const rows = await asRawClient(db).unsafe(`SELECT envelope FROM read_tenant_secrets WHERE tenant_id = $1 AND key = $2 LIMIT 1`, [tenantId, key]);
|
|
4
4
|
return rows[0]?.envelope;
|
|
@@ -22,9 +22,13 @@ export declare const secretsEnvSchema: z.ZodObject<{
|
|
|
22
22
|
}, z.core.$strip>;
|
|
23
23
|
export { createSecretsContext, type SecretsContext, type SecretsContextOptions, TENANT_SECRET_READ_EVENT, } from "./secrets-context.js";
|
|
24
24
|
export { type StoredEnvelope, type StoredMetadata, tenantSecretsTable } from "./table.js";
|
|
25
|
+
export declare const JOIN_REQUEST_TRANSACTION_REASON = "the secret write runs on the request transaction so a failing batch rolls it back together with the config writes";
|
|
25
26
|
export declare function requireSecretsContext(ctx: {
|
|
26
27
|
readonly secrets?: SecretsContext;
|
|
27
28
|
readonly _userId?: string | undefined;
|
|
29
|
+
readonly user?: {
|
|
30
|
+
readonly id: string;
|
|
31
|
+
};
|
|
28
32
|
}, handlerName: string): SecretsContext;
|
|
29
33
|
export type SecretsFeatureOptions = {
|
|
30
34
|
/** Access rule for the `set`, `delete` and `list` handlers. Default
|
package/dist/secrets/feature.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { defineFeature, } from "@cosmicdrift/kumiko-framework/engine";
|
|
1
|
+
import { defineFeature, SYSTEM_ROLE, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { SETTINGS_HUB_I18N } from "@cosmicdrift/kumiko-framework/i18n";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -44,6 +44,9 @@ export const secretsEnvSchema = z.object({
|
|
|
44
44
|
});
|
|
45
45
|
export { createSecretsContext, TENANT_SECRET_READ_EVENT, } from "./secrets-context.js";
|
|
46
46
|
export { tenantSecretsTable } from "./table.js";
|
|
47
|
+
// The settings form saves config values and secrets in one /api/batch; the secret
|
|
48
|
+
// write has to join that transaction so a rejected command rolls it back too.
|
|
49
|
+
export const JOIN_REQUEST_TRANSACTION_REASON = "the secret write runs on the request transaction so a failing batch rolls it back together with the config writes";
|
|
47
50
|
// AppContext carries ctx.secrets via extraContext. requireSecretsContext
|
|
48
51
|
// wraps that raw context so every `.get(...)` call auto-includes the
|
|
49
52
|
// current user + handler as audit metadata — feature code can't forget
|
|
@@ -53,6 +56,7 @@ export { tenantSecretsTable } from "./table.js";
|
|
|
53
56
|
// FileProviderContext-Pfade (S3-Plugin im Worker) liefern dieselben
|
|
54
57
|
// zwei Felder, also reicht die schmale ctx-shape — kein voller
|
|
55
58
|
// HandlerContext-Import noetig.
|
|
59
|
+
// Handler contexts carry the caller as ctx.user, provider contexts set _userId (takes precedence).
|
|
56
60
|
export function requireSecretsContext(ctx, handlerName) {
|
|
57
61
|
if (!ctx.secrets) {
|
|
58
62
|
throw new InternalError({
|
|
@@ -60,10 +64,10 @@ export function requireSecretsContext(ctx, handlerName) {
|
|
|
60
64
|
"createSecretsContext({db, masterKeyProvider, registry}) via extraContext.secrets at boot.",
|
|
61
65
|
});
|
|
62
66
|
}
|
|
63
|
-
const userId = ctx._userId;
|
|
67
|
+
const userId = ctx._userId ?? ctx.user?.id;
|
|
64
68
|
if (!userId) {
|
|
65
69
|
throw new InternalError({
|
|
66
|
-
message: `[${handlerName}] ctx._userId missing — cannot audit secret reads without a caller identity.`,
|
|
70
|
+
message: `[${handlerName}] ctx._userId missing (and no ctx.user) — cannot audit secret reads without a caller identity.`,
|
|
67
71
|
});
|
|
68
72
|
}
|
|
69
73
|
const withAudit = (raw) => ({
|
|
@@ -89,10 +93,19 @@ function resolveSecretsAccess(opts) {
|
|
|
89
93
|
return { roles: opts.roles };
|
|
90
94
|
return DEFAULT_SECRETS_ACCESS;
|
|
91
95
|
}
|
|
96
|
+
// Server-side system writes (dispatchSystemWrite, e.g. a wire hook migrating credentials) take the
|
|
97
|
+
// same declared-key gate, value check and cache-sync announce as an admin instead of bypassing them
|
|
98
|
+
// via SecretsContext.set. The system role is in-process only and never minted into a session.
|
|
99
|
+
function withSystemWriter(rule) {
|
|
100
|
+
if (!("roles" in rule) || rule.roles.includes(SYSTEM_ROLE))
|
|
101
|
+
return rule;
|
|
102
|
+
return { ...rule, roles: [SYSTEM_ROLE, ...rule.roles] };
|
|
103
|
+
}
|
|
92
104
|
export function createSecretsFeature(opts = {}) {
|
|
93
105
|
const access = resolveSecretsAccess(opts);
|
|
106
|
+
const writeAccess = withSystemWriter(access);
|
|
94
107
|
return defineFeature(SECRETS_FEATURE_NAME, (r) => {
|
|
95
|
-
r.describe('Stores arbitrary per-tenant secrets (API keys, tokens, credentials) encrypted at rest using AES-256 with a KEK loaded from `KUMIKO_SECRETS_MASTER_KEY_V1` (and successive versions for rotation). Read a secret in handlers via `ctx.secrets.get(tenantId, handle)`, which automatically appends a `tenantSecretRead` audit event so every access is traceable. A `rotate` job re-encrypts all envelopes after a KEK version bump. The `set`/`delete`/`list` handlers share one access rule — default { roles: ["TenantAdmin"] }; adopt the host\'s role vocabulary with createSecretsFeature({ roles }) or open it to every authenticated tenant user with { access: { openToAll: { reason } } } (larger blast radius: any tenant member can then read secret previews and write/delete secrets, not just admins).');
|
|
108
|
+
r.describe('Stores arbitrary per-tenant secrets (API keys, tokens, credentials) encrypted at rest using AES-256 with a KEK loaded from `KUMIKO_SECRETS_MASTER_KEY_V1` (and successive versions for rotation). Read a secret in handlers via `ctx.secrets.get(tenantId, handle)`, which automatically appends a `tenantSecretRead` audit event so every access is traceable. A `rotate` job re-encrypts all envelopes after a KEK version bump. The `set`/`delete`/`list` handlers share one access rule — default { roles: ["TenantAdmin"] }; adopt the host\'s role vocabulary with createSecretsFeature({ roles }) or open it to every authenticated tenant user with { access: { openToAll: { reason } } } (larger blast radius: any tenant member can then read secret previews and write/delete secrets, not just admins). Server-side code writes a tenant secret with `dispatchSystemWrite({ handlerQn: "secrets:write:set", payload, tenantId })`: set and delete also admit the in-process system identity, so such writes pass the same declared-key and value checks.');
|
|
96
109
|
r.uiHints({
|
|
97
110
|
displayLabel: "Tenant Secrets",
|
|
98
111
|
category: "infrastructure",
|
|
@@ -127,8 +140,8 @@ export function createSecretsFeature(opts = {}) {
|
|
|
127
140
|
// The rotation job deliberately reaches for ctx.db.unsafeRaw() (raw,
|
|
128
141
|
// cross-tenant) because rotation is a deployment-wide operation — no
|
|
129
142
|
// feature-wide r.systemScope() needed.
|
|
130
|
-
r.writeHandler(createSetHandler(
|
|
131
|
-
r.writeHandler(createDeleteHandler(
|
|
143
|
+
r.writeHandler(createSetHandler(writeAccess));
|
|
144
|
+
r.writeHandler(createDeleteHandler(writeAccess));
|
|
132
145
|
r.queryHandler(createListHandler(access));
|
|
133
146
|
// Manual-only by design: ops triggers rotation after a KEK version flip.
|
|
134
147
|
// BullMQ delivers to exactly one worker, so running it against a busy
|
|
@@ -3,7 +3,7 @@ import { failNotFound } from "@cosmicdrift/kumiko-framework/errors";
|
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { announceSecretChange } from "../announce-secret-change.js";
|
|
5
5
|
import { DEFAULT_SECRETS_ACCESS } from "../constants.js";
|
|
6
|
-
import { requireSecretsContext } from "../feature.js";
|
|
6
|
+
import { JOIN_REQUEST_TRANSACTION_REASON, requireSecretsContext } from "../feature.js";
|
|
7
7
|
import { checkSecretKeyWrite } from "../write-gate.js";
|
|
8
8
|
export function createDeleteHandler(access = DEFAULT_SECRETS_ACCESS) {
|
|
9
9
|
return defineWriteHandler({
|
|
@@ -14,8 +14,9 @@ export function createDeleteHandler(access = DEFAULT_SECRETS_ACCESS) {
|
|
|
14
14
|
key: z.string().min(1).max(100),
|
|
15
15
|
}),
|
|
16
16
|
access,
|
|
17
|
+
escapeHatch: { grants: ["unsafeRaw"], reason: JOIN_REQUEST_TRANSACTION_REASON },
|
|
17
18
|
handler: async (event, ctx) => {
|
|
18
|
-
const secrets = requireSecretsContext(ctx, "secrets:write:delete");
|
|
19
|
+
const secrets = requireSecretsContext(ctx, "secrets:write:delete").withRunner(ctx.db.unsafeRaw());
|
|
19
20
|
const gate = checkSecretKeyWrite(ctx.registry, event.user.roles, event.payload.key, {
|
|
20
21
|
allowUndeclared: true,
|
|
21
22
|
});
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
// check to the executor's stream-version check; a parallel secrets.set
|
|
17
17
|
// that landed the row on the new kekVersion first surfaces here as a
|
|
18
18
|
// version_conflict error (counted as "skipped", not "failed").
|
|
19
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
20
|
-
import { createEventStoreExecutor, createTenantDb, } from "@cosmicdrift/kumiko-framework/db";
|
|
19
|
+
import { createEventStoreExecutor, createTenantDb, selectMany, } from "@cosmicdrift/kumiko-framework/db";
|
|
21
20
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
22
21
|
import { decodeStoredEnvelope, encodeStoredEnvelope, rewrapDek, } from "@cosmicdrift/kumiko-framework/secrets";
|
|
23
22
|
import { runChunkedMigration } from "../../shared/index.js";
|
|
@@ -48,7 +47,7 @@ export async function rotateJob(rawPayload, ctx, db) {
|
|
|
48
47
|
function tdbFor(tenantId) {
|
|
49
48
|
let existing = tdbCache.get(tenantId);
|
|
50
49
|
if (!existing) {
|
|
51
|
-
existing = createTenantDb(db, tenantId, "system");
|
|
50
|
+
existing = createTenantDb({ db, tenantId, mode: "system" });
|
|
52
51
|
tdbCache.set(tenantId, existing);
|
|
53
52
|
}
|
|
54
53
|
return existing;
|
|
@@ -2,7 +2,7 @@ import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { announceSecretChange } from "../announce-secret-change.js";
|
|
4
4
|
import { DEFAULT_SECRETS_ACCESS } from "../constants.js";
|
|
5
|
-
import { requireSecretsContext } from "../feature.js";
|
|
5
|
+
import { JOIN_REQUEST_TRANSACTION_REASON, requireSecretsContext } from "../feature.js";
|
|
6
6
|
import { checkSecretKeyWrite, checkSecretValue } from "../write-gate.js";
|
|
7
7
|
export function createSetHandler(access = DEFAULT_SECRETS_ACCESS) {
|
|
8
8
|
return defineWriteHandler({
|
|
@@ -21,8 +21,9 @@ export function createSetHandler(access = DEFAULT_SECRETS_ACCESS) {
|
|
|
21
21
|
hint: z.string().max(200).optional(),
|
|
22
22
|
}),
|
|
23
23
|
access,
|
|
24
|
+
escapeHatch: { grants: ["unsafeRaw"], reason: JOIN_REQUEST_TRANSACTION_REASON },
|
|
24
25
|
handler: async (event, ctx) => {
|
|
25
|
-
const secrets = requireSecretsContext(ctx, "secrets:write:set");
|
|
26
|
+
const secrets = requireSecretsContext(ctx, "secrets:write:set").withRunner(ctx.db.unsafeRaw());
|
|
26
27
|
const { key, value, redactedPreview, hint } = event.payload;
|
|
27
28
|
// Preview-priority: explicit payload param > feature-declared redact
|
|
28
29
|
// (via r.secret()) > generic default. A feature that declared a
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
// race on the secret's own version). The audit invariant ("every
|
|
12
12
|
// read logged") now sits on the events-table instead of a
|
|
13
13
|
// dedicated audit-table.
|
|
14
|
-
import { fetchOne, transaction } from "@cosmicdrift/kumiko-framework/
|
|
15
|
-
import { createEventStoreExecutor, createTenantDb, } from "@cosmicdrift/kumiko-framework/db";
|
|
14
|
+
import { createEventStoreExecutor, createTenantDb, fetchOne, transaction, } from "@cosmicdrift/kumiko-framework/db";
|
|
16
15
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
17
16
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
18
17
|
import { createDekCache, createSecret, decodeStoredEnvelope, decryptValue, encodeStoredEnvelope, encryptValue, withDekCache, } from "@cosmicdrift/kumiko-framework/secrets";
|
|
@@ -140,7 +139,7 @@ function buildSecretsContext(opts, provider, db, runnerIsTransaction) {
|
|
|
140
139
|
tenantId,
|
|
141
140
|
roles: SYSTEM_ROLES,
|
|
142
141
|
};
|
|
143
|
-
const tdb = createTenantDb(db, tenantId, "system");
|
|
142
|
+
const tdb = createTenantDb({ db, tenantId, mode: "system" });
|
|
144
143
|
const existing = await lookup(tenantId, key);
|
|
145
144
|
const commonFields = {
|
|
146
145
|
envelope: stored,
|
|
@@ -194,7 +193,7 @@ function buildSecretsContext(opts, provider, db, runnerIsTransaction) {
|
|
|
194
193
|
tenantId,
|
|
195
194
|
roles: SYSTEM_ROLES,
|
|
196
195
|
};
|
|
197
|
-
const tdb = createTenantDb(db, tenantId, "system");
|
|
196
|
+
const tdb = createTenantDb({ db, tenantId, mode: "system" });
|
|
198
197
|
const result = await executor.delete({ id: existing.id }, actor, tdb);
|
|
199
198
|
return result.isSuccess;
|
|
200
199
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asRawClient } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { asRawClient } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
export async function deleteStaleSessionsBatch(db, olderThanDays, batchSize) {
|
|
3
3
|
const rows = await asRawClient(db).unsafe(`DELETE FROM "store_user_sessions"
|
|
4
4
|
WHERE "id" IN (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { access, definePagedQueryHandler, MAX_LIST_LIMIT, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -6,7 +6,7 @@ import { decryptStoredPii } from "../../shared/index.js";
|
|
|
6
6
|
import { userSessionTable } from "../schema/user-session.js";
|
|
7
7
|
// `sort` arrives raw from the client's query string. selectMany's orderBy
|
|
8
8
|
// has no column-existence check — an unrecognised field just gets
|
|
9
|
-
// snake_cased and quoted as-is (
|
|
9
|
+
// snake_cased and quoted as-is (db/query.ts columnOf) — so this
|
|
10
10
|
// allowlist is what stops a client sorting by ip/userAgent or any other
|
|
11
11
|
// non-exposed column.
|
|
12
12
|
const SORTABLE_COLUMNS = ["id", "userId", "createdAt", "expiresAt", "revokedAt"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { definePagedQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requestContext } from "@cosmicdrift/kumiko-framework/api";
|
|
2
|
-
import { updateMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
+
import { updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { access, defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
5
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { fetchOne, insertOne, transaction, updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, insertOne, transaction, updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { buildSessionRoles, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
4
4
|
import { generateId, parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
5
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import { encryptForDirectWrite } from "../shared/index.js";
|
|
7
7
|
import { tenantMembershipsTable } from "../tenant/index.js";
|
|
8
|
-
import { isPrincipalBlocked, userTable } from "../user/index.js";
|
|
8
|
+
import { isPrincipalBlocked, isPrincipalRowBlocked, userTable, } from "../user/index.js";
|
|
9
9
|
import { DEFAULT_SESSION_EXPIRY_MS, LAST_SEEN_REFRESH_MS, USER_SESSION_ENTITY_NAME, } from "./constants.js";
|
|
10
10
|
import { userSessionEntity, userSessionTable } from "./schema/user-session.js";
|
|
11
11
|
import { SESSION_REVOKED_AGGREGATE_TYPE, SESSION_REVOKED_EVENT_QN, sessionRevokedSchema, } from "./session-revoked-event.js";
|
|
@@ -112,16 +112,14 @@ export function createSessionCallbacks(opts) {
|
|
|
112
112
|
// falls back to the JWT's frozen roles claim.
|
|
113
113
|
let user;
|
|
114
114
|
try {
|
|
115
|
-
user = await fetchOne(db, userTable, {
|
|
116
|
-
id: expectedUserId,
|
|
117
|
-
});
|
|
115
|
+
user = await fetchOne(db, userTable, { id: expectedUserId });
|
|
118
116
|
}
|
|
119
117
|
catch {
|
|
120
118
|
return "live";
|
|
121
119
|
}
|
|
122
120
|
if (!user)
|
|
123
121
|
return "live";
|
|
124
|
-
if (
|
|
122
|
+
if (isPrincipalRowBlocked(user))
|
|
125
123
|
return "blocked";
|
|
126
124
|
// Same fail-open reasoning as the userTable lookup above — a transient
|
|
127
125
|
// DB error on the membership read must not lock the user out. A
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthRoutesConfig, SessionCreator } from "@cosmicdrift/kumiko-framework/api";
|
|
2
2
|
import type { SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import type { LateBoundHolder } from "@cosmicdrift/kumiko-
|
|
3
|
+
import type { LateBoundHolder } from "@cosmicdrift/kumiko-testing/helpers";
|
|
4
4
|
import type { SessionCallbacks, SessionMassRevoker } from "./session-callbacks.js";
|
|
5
5
|
export type BoundSessionCallbacks = {
|
|
6
6
|
/** auth-config fragment: creator + revoker + checker, all late-bound. */
|
package/dist/tags/feature.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type AccessRule, type EntityDefinition } from "@cosmicdrift/kumiko-fram
|
|
|
2
2
|
type TagsToggleable = {
|
|
3
3
|
readonly default: boolean;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
declare const defaultTagsFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
6
6
|
readonly exports: void;
|
|
7
7
|
};
|
|
8
8
|
export type TagsFeatureOptions = {
|
|
@@ -44,5 +44,9 @@ export type TagsFeatureOptions = {
|
|
|
44
44
|
* otherwise considers every registered entity as a candidate host. */
|
|
45
45
|
readonly parents?: readonly string[];
|
|
46
46
|
};
|
|
47
|
-
export declare function createTagsFeature(opts?: TagsFeatureOptions): typeof
|
|
47
|
+
export declare function createTagsFeature(opts?: TagsFeatureOptions): typeof defaultTagsFeature;
|
|
48
|
+
/** @deprecated Use createTagsFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
49
|
+
export declare const tagsFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
50
|
+
readonly exports: void;
|
|
51
|
+
};
|
|
48
52
|
export {};
|
package/dist/tags/feature.js
CHANGED
|
@@ -84,7 +84,7 @@ function registerTags(r, access, toggleable, ownership, parents) {
|
|
|
84
84
|
r.screen(createTagEditScreen(access));
|
|
85
85
|
r.translations({ keys: TAGS_FEATURE_I18N });
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
const defaultTagsFeature = defineFeature(TAGS_FEATURE_NAME, (r) => registerTags(r, DEFAULT_TAG_ACCESS, undefined, undefined, undefined));
|
|
88
88
|
function resolveAccess(opts) {
|
|
89
89
|
if (opts.access !== undefined)
|
|
90
90
|
return opts.access;
|
|
@@ -101,7 +101,7 @@ export function createTagsFeature(opts = {}) {
|
|
|
101
101
|
opts.toggleable === undefined &&
|
|
102
102
|
opts.ownership === undefined &&
|
|
103
103
|
opts.parents === undefined) {
|
|
104
|
-
return
|
|
104
|
+
return defaultTagsFeature;
|
|
105
105
|
}
|
|
106
106
|
if (opts.parents !== undefined && opts.parents.length === 0) {
|
|
107
107
|
throw new Error("createTagsFeature({ parents }): parents must not be an empty array — " +
|
|
@@ -113,3 +113,5 @@ export function createTagsFeature(opts = {}) {
|
|
|
113
113
|
const access = resolveAccess(opts);
|
|
114
114
|
return defineFeature(TAGS_FEATURE_NAME, (r) => registerTags(r, access, opts.toggleable, opts.ownership, opts.parents));
|
|
115
115
|
}
|
|
116
|
+
/** @deprecated Use createTagsFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
117
|
+
export const tagsFeature = createTagsFeature();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// TemplateResolverApi — cross-feature interface. renderer-foundation,
|
|
2
2
|
// delivery and apps import types ONLY and take the implementation from
|
|
3
3
|
// ctx.templateResolver at runtime.
|
|
4
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
4
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
5
5
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
6
6
|
import { FALLBACK_LOCALE, SYSTEM_TENANT_ID } from "./constants.js";
|
|
7
7
|
import { fileAttachmentsOf, imageLinksOf, parseLinkedResourceEntries, pdfAttachmentLinksOf, } from "./linked-resources.js";
|
|
@@ -23,7 +23,6 @@ export declare const HEX_COLOR_PATTERN: RegExp;
|
|
|
23
23
|
export declare const DEFAULT_MAIL_LAYOUT_SLUG = "default";
|
|
24
24
|
export declare const DEFAULT_PDF_LAYOUT_SLUG = "default";
|
|
25
25
|
export declare const MAIL_PREVIEW_MAX_BYTES: number;
|
|
26
|
-
export declare const TEST_MAIL_NOTIFICATION_TYPE = "template-resolver:test-mail";
|
|
27
26
|
export declare const TEST_MAIL_SUBJECT_PREFIX = "[TEST] ";
|
|
28
27
|
export { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
29
28
|
export declare const FALLBACK_LOCALE = "de";
|
|
@@ -59,7 +59,6 @@ export const DEFAULT_MAIL_LAYOUT_SLUG = "default";
|
|
|
59
59
|
export const DEFAULT_PDF_LAYOUT_SLUG = "default";
|
|
60
60
|
// The mail transport enforces no size limit of its own; 10 MiB is a common provider ceiling.
|
|
61
61
|
export const MAIL_PREVIEW_MAX_BYTES = 10 * 1024 * 1024;
|
|
62
|
-
export const TEST_MAIL_NOTIFICATION_TYPE = "template-resolver:test-mail";
|
|
63
62
|
export const TEST_MAIL_SUBJECT_PREFIX = "[TEST] ";
|
|
64
63
|
// System-Templates leben unter der canonical SYSTEM_TENANT_ID-Sentinel-UUID.
|
|
65
64
|
// Re-Export aus framework — single source of truth, vermeidet Drift.
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { requireForTenant } from "../../shared/index.js";
|
|
4
4
|
import { attachmentLimitFailure, attachmentNeedsMailTemplate, createPreparedBundleResourceEntry, prepareTemplateAttachmentBeforeTransaction, prepareTemplateResourceBeforeTransaction, readTemplateResourceMaxBytes, releaseAll, } from "../store-template-resource.js";
|
|
@@ -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 { TEXT_BLOCK_KIND } from "../constants.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
-
import { castTenantRows } from "@cosmicdrift/kumiko-framework/db";
|
|
1
|
+
import { castTenantRows, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
import { TEXT_BLOCK_KIND } from "../constants.js";
|
|
@@ -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 { collectionStore, DEFAULT_COLLECTION_ACCESS, toCollectionEntry, } from "./collection-shared.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
-
import { castTenantRows } from "@cosmicdrift/kumiko-framework/db";
|
|
1
|
+
import { castTenantRows, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
2
|
import { defineQueryHandler, } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
import { collectionStore, DEFAULT_COLLECTION_ACCESS, toCollectionEntry, } from "./collection-shared.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { AccessDeniedError, NotFoundError, ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from "node:util";
|
|
2
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { NotFoundError, ValidationError } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -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 { templateResourcesTable } from "../table.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { FALLBACK_LOCALE } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { TEMPLATE_KINDS, TEMPLATE_STATUSES } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { DEFAULT_MAIL_LAYOUT_SLUG, FALLBACK_LOCALE } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError, ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -3,7 +3,7 @@ import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/
|
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { collectChannels, createEmailAttachmentReader, EMAIL_CHANNEL_NAME, } from "../../delivery/index.js";
|
|
5
5
|
import { fileContextForTenant } from "../../file-foundation/index.js";
|
|
6
|
-
import {
|
|
6
|
+
import { TEST_MAIL_SUBJECT_PREFIX } from "../constants.js";
|
|
7
7
|
import { TemplateResolverErrors } from "../qualified-names.js";
|
|
8
8
|
import { renderTemplatePreview } from "../template-preview.js";
|
|
9
9
|
import { localeSchema, templateSlugSchema } from "./shared.js";
|
|
@@ -61,6 +61,7 @@ export const sendTestWrite = defineWriteHandler({
|
|
|
61
61
|
sseBroker: undefined,
|
|
62
62
|
tenantId: event.user.tenantId,
|
|
63
63
|
secrets: ctx.secrets,
|
|
64
|
+
config: ctx.config,
|
|
64
65
|
readAttachment: createEmailAttachmentReader(ctx.db, ctx.registry, event.user.tenantId, ctx.config, (tenantId) => fileContextForTenant(ctx, ctx.user.tenantId, tenantId)),
|
|
65
66
|
};
|
|
66
67
|
const address = (await channel.resolve?.(event.user.id, channelContext)) ?? null;
|
|
@@ -73,7 +74,8 @@ export const sendTestWrite = defineWriteHandler({
|
|
|
73
74
|
let sentStatus;
|
|
74
75
|
try {
|
|
75
76
|
const result = await channel.send(address, {
|
|
76
|
-
|
|
77
|
+
// The template slug is the notification name, so the test mail takes the transport the real mail takes.
|
|
78
|
+
notificationType: event.payload.slug,
|
|
77
79
|
title: subject,
|
|
78
80
|
body: undefined,
|
|
79
81
|
data: undefined,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { AccessDeniedError, ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { requireForTenant } from "../../shared/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { TenantQueries } from "../../tenant/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError, ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { TEMPLATE_KINDS } from "../constants.js";
|