@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
|
@@ -3,7 +3,7 @@ export declare const mailTransportSmtpEnvSchema: import("zod").ZodObject<{
|
|
|
3
3
|
KUMIKO_MAIL_ALLOWED_PRIVATE_HOSTS: import("zod").ZodOptional<import("zod").ZodString>;
|
|
4
4
|
}, import("zod/v4/core").$strip>;
|
|
5
5
|
export declare function setSmtpMailHostLookup(fn: typeof lookup | undefined): void;
|
|
6
|
-
export declare
|
|
6
|
+
export declare function createMailTransportSmtpFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
7
7
|
readonly exports: {
|
|
8
8
|
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
9
9
|
* consumer handlers. */
|
|
@@ -11,8 +11,24 @@ export declare const mailTransportSmtpFeature: import("@cosmicdrift/kumiko-types
|
|
|
11
11
|
readonly host: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
12
12
|
readonly port: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"number">;
|
|
13
13
|
readonly secure: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"boolean">;
|
|
14
|
+
readonly authUser: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
14
15
|
readonly from: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
16
|
+
};
|
|
17
|
+
/** Secret-handle for the SMTP password. */
|
|
18
|
+
password: import("@cosmicdrift/kumiko-types/feature").SecretKeyHandle;
|
|
19
|
+
};
|
|
20
|
+
};
|
|
21
|
+
/** @deprecated Use createMailTransportSmtpFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
22
|
+
export declare const mailTransportSmtpFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
23
|
+
readonly exports: {
|
|
24
|
+
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
25
|
+
* consumer handlers. */
|
|
26
|
+
configKeys: {
|
|
27
|
+
readonly host: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
28
|
+
readonly port: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"number">;
|
|
29
|
+
readonly secure: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"boolean">;
|
|
15
30
|
readonly authUser: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
31
|
+
readonly from: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
16
32
|
};
|
|
17
33
|
/** Secret-handle for the SMTP password. */
|
|
18
34
|
password: import("@cosmicdrift/kumiko-types/feature").SecretKeyHandle;
|
|
@@ -28,9 +28,11 @@ import { createSmtpTransport, } from "@cosmicdrift/kumiko-bundled-features/chann
|
|
|
28
28
|
import { BlockedHostError, HostResolutionError, mailAllowedPrivateHostsEnvSchema, readAllowedPrivateMailHostsFromEnv, requireDefined, requireNonEmpty, requireSecretSet, resolveMailConnectTarget, } from "@cosmicdrift/kumiko-bundled-features/foundation-shared";
|
|
29
29
|
import { MAIL_TRANSPORT_EXTENSION, } from "@cosmicdrift/kumiko-bundled-features/mail-foundation";
|
|
30
30
|
import { requireSecretsContext } from "@cosmicdrift/kumiko-bundled-features/secrets";
|
|
31
|
-
import {
|
|
31
|
+
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
32
32
|
import { UnconfiguredError } from "@cosmicdrift/kumiko-framework/errors";
|
|
33
33
|
import { createFallbackLogger } from "@cosmicdrift/kumiko-framework/logging";
|
|
34
|
+
import { SMTP_CONFIG_KEYS } from "./config-keys.js";
|
|
35
|
+
import { MAIL_TRANSPORT_SMTP_I18N } from "./i18n.js";
|
|
34
36
|
const FEATURE_NAME = "mail-transport-smtp";
|
|
35
37
|
const log = createFallbackLogger(FEATURE_NAME);
|
|
36
38
|
// Operator escape hatch for an internal relay or a dev/test SMTP server
|
|
@@ -50,82 +52,58 @@ export function setSmtpMailHostLookup(fn) {
|
|
|
50
52
|
// =============================================================================
|
|
51
53
|
// Feature-definition
|
|
52
54
|
// =============================================================================
|
|
53
|
-
export
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
79
|
-
|
|
80
|
-
|
|
81
|
-
keys:
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
}),
|
|
103
|
-
authUser: createTenantConfig("text", {
|
|
104
|
-
required: true,
|
|
105
|
-
default: "",
|
|
106
|
-
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
107
|
-
read: access.roles("TenantAdmin", "SystemAdmin"),
|
|
108
|
-
}),
|
|
109
|
-
},
|
|
110
|
-
});
|
|
111
|
-
// Plugin: register against mail-foundation's "mailTransport" extension.
|
|
112
|
-
// `entityName` "smtp" is what tenants set in mail-foundation's
|
|
113
|
-
// `provider` config-key to pick this transport.
|
|
114
|
-
const plugin = {
|
|
115
|
-
build: async (ctx, tenantId) => buildSmtpTransport(ctx, tenantId), // @wrapper-known semantic-alias
|
|
116
|
-
};
|
|
117
|
-
r.useExtension(MAIL_TRANSPORT_EXTENSION, "smtp", plugin);
|
|
118
|
-
return {
|
|
119
|
-
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
120
|
-
* consumer handlers. */
|
|
121
|
-
configKeys,
|
|
122
|
-
/** Secret-handle for the SMTP password. */
|
|
123
|
-
password,
|
|
124
|
-
};
|
|
125
|
-
});
|
|
55
|
+
export function createMailTransportSmtpFeature() {
|
|
56
|
+
return defineFeature(FEATURE_NAME, (r) => {
|
|
57
|
+
r.describe('Registers itself as the `"smtp"` provider for `mail-foundation` and owns the per-tenant config keys (`host`, `port`, `secure`, `from`, `authUser`) and the encrypted `smtp.password` secret. Tenants set `mail-foundation`\'s `provider` config key to `"smtp"` to activate it; set the SMTP credentials via the admin UI or a seed handler before sending the first mail.');
|
|
58
|
+
r.uiHints({
|
|
59
|
+
displayLabel: "Mail Transport · SMTP",
|
|
60
|
+
category: "notifications",
|
|
61
|
+
recommended: false,
|
|
62
|
+
});
|
|
63
|
+
r.requires({ features: ["config"] });
|
|
64
|
+
r.requires({ features: ["secrets"] });
|
|
65
|
+
r.requires({ features: ["mail-foundation"] });
|
|
66
|
+
r.envSchema(mailTransportSmtpEnvSchema);
|
|
67
|
+
// Provider-secret. Sensitive: redact-helper for admin-UI display.
|
|
68
|
+
const password = r.secret("smtp.password", {
|
|
69
|
+
label: { en: "SMTP password" },
|
|
70
|
+
hint: {
|
|
71
|
+
en: "Login password at the SMTP server. Brevo/Postmark/SES call it 'API key' or 'SMTP credentials'.",
|
|
72
|
+
},
|
|
73
|
+
redact: (plaintext) => {
|
|
74
|
+
if (plaintext.length < 8)
|
|
75
|
+
return "•".repeat(plaintext.length);
|
|
76
|
+
return `${plaintext.slice(0, 3)}...${plaintext.slice(-2)}`;
|
|
77
|
+
},
|
|
78
|
+
scope: "tenant",
|
|
79
|
+
// required: true ↔ the missing-secret throw in readPassword — keep in sync.
|
|
80
|
+
required: true,
|
|
81
|
+
});
|
|
82
|
+
const configKeys = r.config({ keys: SMTP_CONFIG_KEYS });
|
|
83
|
+
r.translations({ keys: MAIL_TRANSPORT_SMTP_I18N });
|
|
84
|
+
// Plugin: register against mail-foundation's "mailTransport" extension.
|
|
85
|
+
// `entityName` "smtp" is what tenants set in mail-foundation's
|
|
86
|
+
// `provider` config-key to pick this transport.
|
|
87
|
+
const plugin = {
|
|
88
|
+
build: async (ctx, tenantId) => buildSmtpTransport(ctx, tenantId), // @wrapper-known semantic-alias
|
|
89
|
+
};
|
|
90
|
+
r.useExtension(MAIL_TRANSPORT_EXTENSION, "smtp", plugin);
|
|
91
|
+
return {
|
|
92
|
+
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
93
|
+
* consumer handlers. */
|
|
94
|
+
configKeys,
|
|
95
|
+
/** Secret-handle for the SMTP password. */
|
|
96
|
+
password,
|
|
97
|
+
};
|
|
98
|
+
}, { dedupeOptions: {} });
|
|
99
|
+
}
|
|
100
|
+
// The typed handles below come from one shared instance; each factory call builds its own handle objects.
|
|
101
|
+
const sharedMailTransportSmtpFeature = createMailTransportSmtpFeature();
|
|
102
|
+
/** @deprecated Use createMailTransportSmtpFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
103
|
+
export const mailTransportSmtpFeature = sharedMailTransportSmtpFeature;
|
|
126
104
|
/** Typed handle for the SMTP password — exported so seeds + tests can
|
|
127
105
|
* set it via `secrets:write:set` with the full qualified-name. */
|
|
128
|
-
export const SMTP_PASSWORD =
|
|
106
|
+
export const SMTP_PASSWORD = sharedMailTransportSmtpFeature.exports.password;
|
|
129
107
|
// =============================================================================
|
|
130
108
|
// Internal: build the EmailTransport from tenant config + secret
|
|
131
109
|
// =============================================================================
|
|
@@ -146,11 +124,11 @@ async function buildSmtpTransport(ctx, tenantId) {
|
|
|
146
124
|
throw new Error(`${FEATURE_NAME}: ctx.config is missing — feature requires the config-feature mounted in the registry`);
|
|
147
125
|
}
|
|
148
126
|
const SMTP_HINT = "Set via tenant-admin UI or seed-handler before sending mail.";
|
|
149
|
-
const host = requireNonEmpty(await ctxConfig(
|
|
150
|
-
const port = requireDefined(await ctxConfig(
|
|
151
|
-
const secure = requireDefined(await ctxConfig(
|
|
152
|
-
const from = requireNonEmpty(await ctxConfig(
|
|
153
|
-
const authUser = requireNonEmpty(await ctxConfig(
|
|
127
|
+
const host = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.host), FEATURE_NAME, "host", SMTP_HINT);
|
|
128
|
+
const port = requireDefined(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.port), FEATURE_NAME, "port"); // @cast-boundary engine-payload
|
|
129
|
+
const secure = requireDefined(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.secure), FEATURE_NAME, "secure"); // @cast-boundary engine-payload
|
|
130
|
+
const from = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.from), FEATURE_NAME, "from", SMTP_HINT);
|
|
131
|
+
const authUser = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.authUser), FEATURE_NAME, "authUser", SMTP_HINT);
|
|
154
132
|
const password = await readPassword(ctx, tenantId);
|
|
155
133
|
let target;
|
|
156
134
|
try {
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
export declare const MAIL_TRANSPORT_SMTP_I18N: {
|
|
2
|
+
readonly "mail-transport-smtp.settings": {
|
|
3
|
+
readonly en: "SMTP server";
|
|
4
|
+
};
|
|
5
|
+
readonly "mail-transport-smtp.settings.secrets": {
|
|
6
|
+
readonly en: "SMTP sign-in";
|
|
7
|
+
};
|
|
8
|
+
readonly "mail-transport-smtp.settings.description": {
|
|
9
|
+
readonly en: "The connection details come from your mail provider, for example Brevo, Postmark, Amazon SES or your own server.";
|
|
10
|
+
};
|
|
11
|
+
readonly "mail-transport-smtp.host": {
|
|
12
|
+
readonly en: "Server address";
|
|
13
|
+
};
|
|
14
|
+
readonly "mail-transport-smtp.host.description": {
|
|
15
|
+
readonly en: "Host name of the SMTP server, for example smtp.example.com.";
|
|
16
|
+
};
|
|
17
|
+
readonly "mail-transport-smtp.port": {
|
|
18
|
+
readonly en: "Port number";
|
|
19
|
+
};
|
|
20
|
+
readonly "mail-transport-smtp.port.description": {
|
|
21
|
+
readonly en: "Usually 587. Use 465 when your provider asks for SSL/TLS.";
|
|
22
|
+
};
|
|
23
|
+
readonly "mail-transport-smtp.secure": {
|
|
24
|
+
readonly en: "SSL/TLS from the start";
|
|
25
|
+
};
|
|
26
|
+
readonly "mail-transport-smtp.secure.description": {
|
|
27
|
+
readonly en: "Turn on for port 465. Leave off for 587, which switches to encryption by itself.";
|
|
28
|
+
};
|
|
29
|
+
readonly "mail-transport-smtp.authUser": {
|
|
30
|
+
readonly en: "User name";
|
|
31
|
+
};
|
|
32
|
+
readonly "mail-transport-smtp.authUser.description": {
|
|
33
|
+
readonly en: "Login name at the SMTP server, often an email address.";
|
|
34
|
+
};
|
|
35
|
+
readonly "mail-transport-smtp.from": {
|
|
36
|
+
readonly en: "Sender address";
|
|
37
|
+
};
|
|
38
|
+
readonly "mail-transport-smtp.from.description": {
|
|
39
|
+
readonly en: "The address mails are sent from, for example status@example.com. Your provider must allow it.";
|
|
40
|
+
};
|
|
41
|
+
};
|
|
@@ -0,0 +1,28 @@
|
|
|
1
|
+
export const MAIL_TRANSPORT_SMTP_I18N = {
|
|
2
|
+
// Also the option label of mail-foundation's provider select.
|
|
3
|
+
"mail-transport-smtp.settings": { en: "SMTP server" },
|
|
4
|
+
"mail-transport-smtp.settings.secrets": { en: "SMTP sign-in" },
|
|
5
|
+
"mail-transport-smtp.settings.description": {
|
|
6
|
+
en: "The connection details come from your mail provider, for example Brevo, Postmark, Amazon SES or your own server.",
|
|
7
|
+
},
|
|
8
|
+
"mail-transport-smtp.host": { en: "Server address" },
|
|
9
|
+
"mail-transport-smtp.host.description": {
|
|
10
|
+
en: "Host name of the SMTP server, for example smtp.example.com.",
|
|
11
|
+
},
|
|
12
|
+
"mail-transport-smtp.port": { en: "Port number" },
|
|
13
|
+
"mail-transport-smtp.port.description": {
|
|
14
|
+
en: "Usually 587. Use 465 when your provider asks for SSL/TLS.",
|
|
15
|
+
},
|
|
16
|
+
"mail-transport-smtp.secure": { en: "SSL/TLS from the start" },
|
|
17
|
+
"mail-transport-smtp.secure.description": {
|
|
18
|
+
en: "Turn on for port 465. Leave off for 587, which switches to encryption by itself.",
|
|
19
|
+
},
|
|
20
|
+
"mail-transport-smtp.authUser": { en: "User name" },
|
|
21
|
+
"mail-transport-smtp.authUser.description": {
|
|
22
|
+
en: "Login name at the SMTP server, often an email address.",
|
|
23
|
+
},
|
|
24
|
+
"mail-transport-smtp.from": { en: "Sender address" },
|
|
25
|
+
"mail-transport-smtp.from.description": {
|
|
26
|
+
en: "The address mails are sent from, for example status@example.com. Your provider must allow it.",
|
|
27
|
+
},
|
|
28
|
+
};
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { mailTransportSmtpEnvSchema, mailTransportSmtpFeature, SMTP_PASSWORD, setSmtpMailHostLookup, } from "./feature.js";
|
|
1
|
+
export { createMailTransportSmtpFeature, mailTransportSmtpEnvSchema, mailTransportSmtpFeature, SMTP_PASSWORD, setSmtpMailHostLookup, } from "./feature.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Public API of the mail-transport-smtp bundled-feature.
|
|
2
|
-
export { mailTransportSmtpEnvSchema, mailTransportSmtpFeature, SMTP_PASSWORD, setSmtpMailHostLookup, } from "./feature.js";
|
|
2
|
+
export { createMailTransportSmtpFeature, mailTransportSmtpEnvSchema, mailTransportSmtpFeature, SMTP_PASSWORD, setSmtpMailHostLookup, } from "./feature.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 { pagesTable } from "../table.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 { pagesTable } from "../table.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
2
|
-
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
1
|
+
import { createEventStoreExecutor, fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
3
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
import { requireForTenant } from "../../shared/index.js";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
1
|
// Test-/Seed-Helper für managed-pages. Legt eine Page direkt über den
|
|
2
2
|
// Event-Store-Executor an — gleicher Pfad wie der echte set-Handler, aber
|
|
3
3
|
// ohne Access-Check. Default ifExists="skip".
|
|
4
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
5
|
-
import {
|
|
6
|
-
import { runEventStoreSeed } from "@cosmicdrift/kumiko-framework/seeding";
|
|
7
|
-
import { TestUsers } from "@cosmicdrift/kumiko-framework/stack";
|
|
4
|
+
import { createEventStoreExecutor, createTenantDb, fetchOne, } from "@cosmicdrift/kumiko-framework/db";
|
|
5
|
+
import { runEventStoreSeed, TestUsers, } from "@cosmicdrift/kumiko-framework/seeding";
|
|
8
6
|
import { pageEntity, pagesTable } from "./table.js";
|
|
9
7
|
const executor = createEventStoreExecutor(pagesTable, pageEntity, { entityName: "page" });
|
|
10
8
|
export async function seedPage(db, opts) {
|
|
@@ -12,7 +10,7 @@ export async function seedPage(db, opts) {
|
|
|
12
10
|
// der event-store-stream im falschen tenant-bucket → version_conflict
|
|
13
11
|
// bei späteren echten writes). TestUsers.systemAdmin ist testTenantId(1).
|
|
14
12
|
const by = opts.by ?? { ...TestUsers.systemAdmin, tenantId: opts.tenantId };
|
|
15
|
-
const tdb = createTenantDb(db, opts.tenantId, "system");
|
|
13
|
+
const tdb = createTenantDb({ db, tenantId: opts.tenantId, mode: "system" });
|
|
16
14
|
const existing = await fetchOne(db, pagesTable, {
|
|
17
15
|
tenantId: opts.tenantId,
|
|
18
16
|
slug: opts.slug,
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { WhereObject } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import type { WhereObject } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
3
3
|
import type { TenantDb } from "@cosmicdrift/kumiko-types/tenant-db-types";
|
|
4
4
|
import { type MetricRange } from "./constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type WhereObject } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { type WhereObject } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import type { HandlerContext } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import type { MetricDefinition, MetricFilterResolver } from "./types.js";
|
package/dist/metrics/filters.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractTableInfo } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { extractTableInfo } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
export const RESERVED_PAYLOAD_KEYS = ["range", "timeZone", "tenantId"];
|
|
4
4
|
// Dashboard select options always send strings.
|
package/dist/metrics/validate.js
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { extractTableInfo, isTimestamptzType } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { extractTableInfo, isTimestamptzType } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { METRIC_RANGES } from "./constants.js";
|
|
3
3
|
import { filterValueKindOf, metricFilterEntries, RESERVED_PAYLOAD_KEYS } from "./filters.js";
|
|
4
4
|
const KEBAB_ID = /^[a-z][a-z0-9]*(-[a-z0-9]+)*$/;
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type AccessRule, type EntityDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
|
|
2
|
+
declare const defaultNotesHistoryFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
3
3
|
readonly exports: void;
|
|
4
4
|
};
|
|
5
5
|
export type NotesHistoryFeatureOptions = {
|
|
@@ -38,4 +38,9 @@ export type NotesHistoryFeatureOptions = {
|
|
|
38
38
|
* consider every registered entity as a candidate host. */
|
|
39
39
|
readonly parents?: readonly string[];
|
|
40
40
|
};
|
|
41
|
-
export declare function createNotesHistoryFeature(opts?: NotesHistoryFeatureOptions): typeof
|
|
41
|
+
export declare function createNotesHistoryFeature(opts?: NotesHistoryFeatureOptions): typeof defaultNotesHistoryFeature;
|
|
42
|
+
/** @deprecated Use createNotesHistoryFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
43
|
+
export declare const notesHistoryFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
44
|
+
readonly exports: void;
|
|
45
|
+
};
|
|
46
|
+
export {};
|
|
@@ -41,7 +41,7 @@ function registerNotesHistory(r, access, ownership, parents) {
|
|
|
41
41
|
}));
|
|
42
42
|
r.translations({ keys: NOTES_HISTORY_FEATURE_I18N });
|
|
43
43
|
}
|
|
44
|
-
|
|
44
|
+
const defaultNotesHistoryFeature = defineFeature(NOTES_HISTORY_FEATURE_NAME, (r) => registerNotesHistory(r, DEFAULT_NOTES_HISTORY_ACCESS, undefined, undefined));
|
|
45
45
|
function resolveAccess(opts) {
|
|
46
46
|
if (opts.access !== undefined)
|
|
47
47
|
return opts.access;
|
|
@@ -56,7 +56,7 @@ export function createNotesHistoryFeature(opts = {}) {
|
|
|
56
56
|
opts.roles === undefined &&
|
|
57
57
|
opts.ownership === undefined &&
|
|
58
58
|
opts.parents === undefined) {
|
|
59
|
-
return
|
|
59
|
+
return defaultNotesHistoryFeature;
|
|
60
60
|
}
|
|
61
61
|
assertNoWhereRuleInOwnershipWrite("createNotesHistoryFeature", opts.ownership?.write);
|
|
62
62
|
// A mount that accepts no parents at all can never take a note write —
|
|
@@ -69,3 +69,5 @@ export function createNotesHistoryFeature(opts = {}) {
|
|
|
69
69
|
}
|
|
70
70
|
return defineFeature(NOTES_HISTORY_FEATURE_NAME, (r) => registerNotesHistory(r, resolveAccess(opts), opts.ownership, opts.parents));
|
|
71
71
|
}
|
|
72
|
+
/** @deprecated Use createNotesHistoryFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
73
|
+
export const notesHistoryFeature = createNotesHistoryFeature();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne, runInSavepointIfSupported } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, runInSavepointIfSupported } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { decryptStoredPii, denyUnlessJoinRowParentVisible } from "../../shared/index.js";
|
|
4
4
|
import { tenantMembershipsTable } from "../../tenant/index.js";
|
|
@@ -3,8 +3,8 @@
|
|
|
3
3
|
// notes consumers without the user-data-rights pipeline don't pull a hard
|
|
4
4
|
// dependency. Mirrors job-run/delivery-attempt (user-data-rights-defaults):
|
|
5
5
|
// export-only, erasure via crypto-shredding.
|
|
6
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/bun-db";
|
|
7
6
|
import { configuredPiiSubjectKms } from "@cosmicdrift/kumiko-framework/crypto";
|
|
7
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
8
8
|
import { noteEntryTable, noteMentionTable } from "../notes-history/index.js";
|
|
9
9
|
// note-entry has no per-tenant scope quirk (unlike folders) — it's genuinely
|
|
10
10
|
// per-user content, so the export filters by authorId directly.
|
|
@@ -1,4 +1,8 @@
|
|
|
1
1
|
export { eraseNoteBodiesReachingSubject } from "./hooks.js";
|
|
2
|
+
export declare function createNotesHistoryUserDataFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
3
|
+
readonly exports: void;
|
|
4
|
+
};
|
|
5
|
+
/** @deprecated Use createNotesHistoryUserDataFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
2
6
|
export declare const notesHistoryUserDataFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
3
7
|
readonly exports: void;
|
|
4
8
|
};
|
|
@@ -7,20 +7,24 @@
|
|
|
7
7
|
import { defineFeature, EXT_USER_DATA } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
8
|
import { noteEntryDeleteHook, noteEntryExportHook, noteMentionDeleteHook, noteMentionExportHook, } from "./hooks.js";
|
|
9
9
|
export { eraseNoteBodiesReachingSubject } from "./hooks.js";
|
|
10
|
-
export
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
});
|
|
10
|
+
export function createNotesHistoryUserDataFeature() {
|
|
11
|
+
return defineFeature("notes-history-user-data", (r) => {
|
|
12
|
+
r.describe("GDPR (Art. 20 export / Art. 17 erasure) coverage for the `notes-history` feature's `note-entry` and `note-mention` entities. Mounts the export hook so a user's authored notes are included in the user-data export bundle; the note-entry delete hook crypto-shreds the row-subject key of each note that structurally @-mentions the forgotten user (`note-mention`) or hangs on the user as host entity (regardless of the host entity's retention strategy: the note text is free PII, the host's anonymize/blockDelete protects the row, not the content), keeping the append-only history intact for all other notes. The manual `crypto-shredding` forget-subject command reaches the same notes for user and record subjects through the exported `eraseNoteBodiesReachingSubject`, and the export lists them under `note-mention`. `note-mention`'s own hooks are a no-op — it is a plain FK pointer, not separately exportable content. Kept separate from `notes-history` so notes consumers without the user-data-rights pipeline don't pull a hard dependency — requires `user-data-rights`, optionalRequires `notes-history`.");
|
|
13
|
+
// user-data-rights is the hard dependency (EXT_USER_DATA host). notes-history
|
|
14
|
+
// is OPTIONAL: if it's mounted toggleable(default=false), a hard r.requires
|
|
15
|
+
// would throw an "effectively disabled" boot warning even though the
|
|
16
|
+
// note-entry entity exists and the hooks work fine.
|
|
17
|
+
r.requires({ features: ["user-data-rights"] });
|
|
18
|
+
r.optionalRequires("notes-history");
|
|
19
|
+
r.useExtension(EXT_USER_DATA, "note-entry", {
|
|
20
|
+
export: noteEntryExportHook,
|
|
21
|
+
delete: noteEntryDeleteHook,
|
|
22
|
+
});
|
|
23
|
+
r.useExtension(EXT_USER_DATA, "note-mention", {
|
|
24
|
+
export: noteMentionExportHook,
|
|
25
|
+
delete: noteMentionDeleteHook,
|
|
26
|
+
});
|
|
27
|
+
}, { dedupeOptions: {} });
|
|
28
|
+
}
|
|
29
|
+
/** @deprecated Use createNotesHistoryUserDataFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
30
|
+
export const notesHistoryUserDataFeature = createNotesHistoryUserDataFeature();
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
1
|
+
import { type FeatureDefinition, type ProjectionListScreenDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { type PatRateLimit } from "./constants.js";
|
|
3
3
|
import { type CreatePatOptions } from "./handlers/create.write.js";
|
|
4
4
|
import type { PatScopeConfig } from "./scopes.js";
|
|
@@ -17,6 +17,9 @@ export type PersonalAccessTokensOptions = {
|
|
|
17
17
|
* shown in place of the token screens when the tenant's tier excludes the
|
|
18
18
|
* feature, e.g. an upgrade notice. Default: the standard "unavailable" notice. */
|
|
19
19
|
readonly lockedFallbackScreen?: string;
|
|
20
|
+
/** Description (i18n key) and slots rendered on the token list screen, e.g. an
|
|
21
|
+
* explanatory text or a header component above the list. Default: neither. */
|
|
22
|
+
readonly listScreen?: Pick<ProjectionListScreenDefinition, "description" | "slots">;
|
|
20
23
|
readonly mfaVerifier?: CreatePatOptions["mfaVerifier"];
|
|
21
24
|
readonly autoRevokeOnPasswordChange?: (userId: string) => Promise<number>;
|
|
22
25
|
};
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { EXT_TOKEN_VERIFIER, } from "@cosmicdrift/kumiko-bundled-features/auth-foundation";
|
|
2
2
|
import { PAT_TOKEN_PREFIX } from "@cosmicdrift/kumiko-framework/api";
|
|
3
3
|
import { deriveEntityTableMeta } from "@cosmicdrift/kumiko-framework/db";
|
|
4
|
-
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
+
import { defineFeature, } from "@cosmicdrift/kumiko-framework/engine";
|
|
5
5
|
import { API_TOKEN_ENTITY_NAME, PAT_DEFAULT_RATE_LIMIT, PAT_FEATURE, } from "./constants.js";
|
|
6
6
|
import { availabilityQuery } from "./handlers/availability.query.js";
|
|
7
7
|
import { buildAvailableScopesQuery } from "./handlers/available-scopes.query.js";
|
|
@@ -116,7 +116,15 @@ export function createPersonalAccessTokensFeature(options) {
|
|
|
116
116
|
// Declarative screens — list-with-revoke + mint-with-reveal. The app
|
|
117
117
|
// places `patListScreen` via r.nav in its logged-in settings area.
|
|
118
118
|
const lockedFallback = options.lockedFallbackScreen === undefined ? {} : { fallback: options.lockedFallbackScreen };
|
|
119
|
-
|
|
119
|
+
// Copy the two fields explicitly: a wider object passed as a variable
|
|
120
|
+
// escapes the Pick check and would override agent/access otherwise.
|
|
121
|
+
const { description, slots } = options.listScreen ?? {};
|
|
122
|
+
r.screen({
|
|
123
|
+
...patListScreen,
|
|
124
|
+
...(description === undefined ? {} : { description }),
|
|
125
|
+
...(slots === undefined ? {} : { slots }),
|
|
126
|
+
...lockedFallback,
|
|
127
|
+
});
|
|
120
128
|
r.screen({ ...createPatMintScreen(scopes), ...lockedFallback });
|
|
121
129
|
r.translations({ keys: { ...PAT_FEATURE_I18N, ...patScopeOptionTranslations(scopes) } });
|
|
122
130
|
// rateLimit flows into feature.exports so run-prod-app builds the
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { insertOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { insertOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { createSystemUser, 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 { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { 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";
|
|
@@ -7,7 +7,7 @@ import { isExpiredAt } from "../expiry.js";
|
|
|
7
7
|
import { apiTokenTable } from "../schema/api-token.js";
|
|
8
8
|
// `sort` arrives raw from the client's query string. selectMany's orderBy has
|
|
9
9
|
// no column-existence check — an unrecognised field just gets snake_cased and
|
|
10
|
-
// quoted as-is (
|
|
10
|
+
// quoted as-is (db/query.ts columnOf) — so this allowlist is what stops a
|
|
11
11
|
// client sorting by tokenHash or any other non-exposed column.
|
|
12
12
|
const SORTABLE_COLUMNS = ["id", "name", "createdAt", "expiresAt", "revokedAt"];
|
|
13
13
|
function isSortableColumn(value) {
|
|
@@ -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 { runnerCanBeginTransaction, transaction, updateMany, } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { runnerCanBeginTransaction, transaction, updateMany, } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { buildSessionRoles } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
4
|
-
// kumiko-lint-ignore cross-feature-import shared lifecycle-status gate with session auth
|
|
5
|
-
import { isPrincipalBlocked } from "../sessions/index.js";
|
|
6
4
|
import { tenantMembershipsTable } from "../tenant/index.js";
|
|
7
|
-
import { userTable } from "../user/index.js";
|
|
5
|
+
import { isPrincipalRowBlocked, userTable } from "../user/index.js";
|
|
8
6
|
// Live role resolution for a (userId, tenantId), mirroring login.write.ts:
|
|
9
7
|
// global roles (users.roles) ∪ tenant-membership roles (forbidden roles
|
|
10
8
|
// stripped via stripForbiddenMembershipRoles, see engine/membership-roles).
|
|
@@ -26,7 +24,7 @@ export async function resolvePatRoles(db, userId, tenantId) {
|
|
|
26
24
|
const userRow = await fetchOne(db, userTable, {
|
|
27
25
|
id: userId,
|
|
28
26
|
});
|
|
29
|
-
if (userRow &&
|
|
27
|
+
if (userRow && isPrincipalRowBlocked(userRow))
|
|
30
28
|
return null;
|
|
31
29
|
const globalRoles = parseRoles(userRow?.roles ?? null);
|
|
32
30
|
return buildSessionRoles(globalRoles, parseRoles(membership.roles));
|
|
@@ -16,6 +16,7 @@ const PAT_SCREEN_VISIBLE_WHEN = {
|
|
|
16
16
|
export const patListScreen = {
|
|
17
17
|
id: PAT_SCREEN_ID,
|
|
18
18
|
type: "projectionList",
|
|
19
|
+
agent: { expose: false },
|
|
19
20
|
visibleWhen: PAT_SCREEN_VISIBLE_WHEN,
|
|
20
21
|
query: PatQueries.mine,
|
|
21
22
|
// The `mine` handler honours `limit` only (no offset/total), so a pager would
|
|
@@ -97,6 +98,7 @@ export function createPatMintScreen(scopes) {
|
|
|
97
98
|
return {
|
|
98
99
|
id: PAT_MINT_SCREEN_ID,
|
|
99
100
|
type: "secretMint",
|
|
101
|
+
agent: { expose: false },
|
|
100
102
|
visibleWhen: PAT_SCREEN_VISIBLE_WHEN,
|
|
101
103
|
handler: PatHandlers.create,
|
|
102
104
|
fields: {
|