@cosmicdrift/kumiko-bundled-features 0.366.0 → 0.368.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/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 +5 -1
- package/dist/channel-email/email-channel.js +8 -2
- package/dist/channel-email/feature.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/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 +2 -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.d.ts +2 -0
- package/dist/delivery/delivery-service.js +46 -11
- 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/handlers/unsubscribe-address.write.d.ts +6 -0
- package/dist/delivery/handlers/unsubscribe-address.write.js +8 -5
- package/dist/delivery/index.d.ts +3 -0
- package/dist/delivery/index.js +2 -0
- package/dist/delivery/testing.d.ts +2 -0
- package/dist/delivery/types.d.ts +2 -1
- package/dist/delivery/unsubscribe-link.d.ts +25 -0
- package/dist/delivery/unsubscribe-link.js +40 -0
- package/dist/delivery/unsubscribe-page-strings.d.ts +11 -0
- package/dist/delivery/unsubscribe-page-strings.js +15 -0
- package/dist/delivery/unsubscribe.d.ts +3 -0
- package/dist/delivery/unsubscribe.js +65 -29
- 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 +23 -1
- package/dist/mail-foundation/feature.js +76 -49
- 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 +20 -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/feature.d.ts +16 -0
- package/dist/mail-transport-smtp/feature.js +85 -79
- 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 +3 -0
- package/dist/secrets/feature.js +3 -2
- package/dist/secrets/handlers/rotate.job.js +2 -3
- 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/compile-document-body.js +47 -11
- package/dist/template-resolver/document-sanitizer.d.ts +2 -0
- package/dist/template-resolver/document-sanitizer.js +16 -1
- package/dist/template-resolver/document-schema.d.ts +2 -0
- package/dist/template-resolver/document-schema.js +31 -0
- package/dist/template-resolver/handlers/bundle-import.js +4 -3
- 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 +4 -3
- 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 +6 -2
- package/dist/template-resolver/handlers/layout-source.query.js +1 -1
- package/dist/template-resolver/handlers/list.query.js +4 -2
- package/dist/template-resolver/handlers/overview.query.js +5 -3
- 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/set.write.js +1 -1
- package/dist/template-resolver/handlers/template-write.d.ts +2 -1
- package/dist/template-resolver/handlers/template-write.js +13 -2
- 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/index.d.ts +3 -2
- package/dist/template-resolver/index.js +3 -2
- package/dist/template-resolver/qualified-names.d.ts +1 -0
- package/dist/template-resolver/qualified-names.js +1 -0
- package/dist/template-resolver/seeding.d.ts +4 -0
- package/dist/template-resolver/seeding.js +43 -9
- package/dist/template-resolver/store-template-resource.js +1 -1
- package/dist/template-resolver/template-preview.js +3 -1
- package/dist/template-resolver/template-resources.js +1 -1
- package/dist/template-resolver/template-system-only.d.ts +8 -0
- package/dist/template-resolver/template-system-only.js +11 -0
- package/dist/template-resolver/template-validation.js +42 -28
- package/dist/template-resolver/testing.js +1 -1
- package/dist/template-resolver/web/i18n.js +1 -0
- 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/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/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 +6 -0
- package/src/crypto-shredding/changes.json +6 -0
- package/src/delivery/changes.json +12 -0
- package/src/file-provider-s3/changes.json +10 -1
- package/src/personal-access-tokens/changes.json +6 -0
- package/src/template-resolver/changes.json +25 -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
package/dist/ledger/feature.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type AccessRule } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
2
2
|
type LedgerToggleable = {
|
|
3
3
|
readonly default: boolean;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
declare const defaultLedgerFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
6
6
|
readonly exports: void;
|
|
7
7
|
};
|
|
8
8
|
export type LedgerFeatureOptions = {
|
|
@@ -15,5 +15,9 @@ export type LedgerFeatureOptions = {
|
|
|
15
15
|
* for fail-closed gating. Omit to keep the ledger always-on (default). */
|
|
16
16
|
readonly toggleable?: LedgerToggleable;
|
|
17
17
|
};
|
|
18
|
-
export declare function createLedgerFeature(opts?: LedgerFeatureOptions): typeof
|
|
18
|
+
export declare function createLedgerFeature(opts?: LedgerFeatureOptions): typeof defaultLedgerFeature;
|
|
19
|
+
/** @deprecated Use createLedgerFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
20
|
+
export declare const ledgerFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
21
|
+
readonly exports: void;
|
|
22
|
+
};
|
|
19
23
|
export {};
|
package/dist/ledger/feature.js
CHANGED
|
@@ -90,7 +90,7 @@ function registerLedger(r, access, toggleable) {
|
|
|
90
90
|
r.queryHandler(createIncomeStatementHandler(access));
|
|
91
91
|
r.queryHandler(createBalanceSheetHandler(access));
|
|
92
92
|
}
|
|
93
|
-
|
|
93
|
+
const defaultLedgerFeature = defineFeature(LEDGER_FEATURE_NAME, (r) => registerLedger(r, DEFAULT_LEDGER_ACCESS, undefined));
|
|
94
94
|
function resolveAccess(opts) {
|
|
95
95
|
if (opts.access !== undefined)
|
|
96
96
|
return opts.access;
|
|
@@ -102,8 +102,10 @@ function resolveAccess(opts) {
|
|
|
102
102
|
// rebuild). access/roles/toggleable build a fresh feature-definition.
|
|
103
103
|
export function createLedgerFeature(opts = {}) {
|
|
104
104
|
if (opts.access === undefined && opts.roles === undefined && opts.toggleable === undefined) {
|
|
105
|
-
return
|
|
105
|
+
return defaultLedgerFeature;
|
|
106
106
|
}
|
|
107
107
|
const access = resolveAccess(opts);
|
|
108
108
|
return defineFeature(LEDGER_FEATURE_NAME, (r) => registerLedger(r, access, opts.toggleable));
|
|
109
109
|
}
|
|
110
|
+
/** @deprecated Use createLedgerFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
111
|
+
export const ledgerFeature = createLedgerFeature();
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { type EmailTransport } from "@cosmicdrift/kumiko-bundled-features/channel-email";
|
|
2
|
-
import { type ConfigAccessor, type Registry } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { type ConfigAccessor, type Registry, type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
export declare const MAIL_TRANSPORT_EXTENSION: "mailTransport";
|
|
4
4
|
/**
|
|
5
5
|
* Schmaler Surface-Type fuer Transport-Plugins — gespiegelt von
|
|
@@ -53,6 +53,13 @@ declare module "@cosmicdrift/kumiko-framework/engine" {
|
|
|
53
53
|
[MAIL_TRANSPORT_EXTENSION]: MailTransportPlugin;
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
|
+
export declare function createMailFoundationFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
57
|
+
readonly exports: {
|
|
58
|
+
/** Config-key-handle for the provider-selector. */
|
|
59
|
+
providerConfigKey: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
60
|
+
};
|
|
61
|
+
};
|
|
62
|
+
/** @deprecated Use createMailFoundationFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
56
63
|
export declare const mailFoundationFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
57
64
|
readonly exports: {
|
|
58
65
|
/** Config-key-handle for the provider-selector. */
|
|
@@ -69,3 +76,18 @@ export declare const mailFoundationFeature: import("@cosmicdrift/kumiko-types/fe
|
|
|
69
76
|
* await transport.send({ to, subject, html });
|
|
70
77
|
*/
|
|
71
78
|
export declare function createTransportForTenant(ctx: MailTransportContext, tenantId: string, handlerName?: string): Promise<EmailTransport>;
|
|
79
|
+
/**
|
|
80
|
+
* Like createTransportForTenant, but an empty `provider` key means "this tenant has no
|
|
81
|
+
* mail provider" and yields null. Every other problem (unknown provider, plugin build
|
|
82
|
+
* failure) still throws, so a configured tenant never silently falls back.
|
|
83
|
+
*/
|
|
84
|
+
export declare function createTransportForTenantIfConfigured(ctx: MailTransportContext, tenantId: string, handlerName?: string): Promise<EmailTransport | null>;
|
|
85
|
+
export type TenantMailTransportScope = {
|
|
86
|
+
readonly tenantId: TenantId;
|
|
87
|
+
readonly config?: ConfigAccessor | undefined;
|
|
88
|
+
readonly registry: Registry;
|
|
89
|
+
readonly secrets?: import("@cosmicdrift/kumiko-framework/secrets").SecretsContext | undefined;
|
|
90
|
+
};
|
|
91
|
+
/** The `tenantTransport` resolver for `createChannelEmailFeature`: the tenant's configured
|
|
92
|
+
* provider, or null so the channel falls back to its app transport. */
|
|
93
|
+
export declare function tenantMailTransport(scope: TenantMailTransportScope): Promise<EmailTransport | null>;
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
// — additive Feature.
|
|
33
33
|
import { withPiiCiphertextGuard, } from "@cosmicdrift/kumiko-bundled-features/channel-email";
|
|
34
34
|
import { requireDefined } from "@cosmicdrift/kumiko-bundled-features/foundation-shared";
|
|
35
|
-
import { access, createTenantConfig, defineFeature, } from "@cosmicdrift/kumiko-framework/engine";
|
|
35
|
+
import { access, createSystemUser, createTenantConfig, defineFeature, } from "@cosmicdrift/kumiko-framework/engine";
|
|
36
36
|
const FEATURE_NAME = "mail-foundation";
|
|
37
37
|
// Extension-point name for transport-provider plugins (mail-transport-smtp,
|
|
38
38
|
// mail-transport-brevo-api, ...).
|
|
@@ -45,47 +45,53 @@ export function isMailTransportPlugin(o) {
|
|
|
45
45
|
// =============================================================================
|
|
46
46
|
// Feature-definition
|
|
47
47
|
// =============================================================================
|
|
48
|
-
export
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
}
|
|
48
|
+
export function createMailFoundationFeature() {
|
|
49
|
+
return defineFeature(FEATURE_NAME, (r) => {
|
|
50
|
+
r.describe("Defines the `mailTransport` extension point and a per-tenant `provider` config key that selects which registered transport plugin to use at runtime. Call `createTransportForTenant(ctx, tenantId)` to get an `EmailTransport` ready for sending \u2014 use this feature together with at least one `mail-transport-*` feature; use `delivery` + `channel-email` instead when you need the full notification pipeline with delivery attempts and user preferences. Pass `tenantMailTransport` as `tenantTransport` to `createChannelEmailFeature` so a tenant with a provider configured sends delivery mails through its own transport and other tenants through the app transport.");
|
|
51
|
+
r.uiHints({
|
|
52
|
+
displayLabel: "Mail Transport Foundation",
|
|
53
|
+
category: "notifications",
|
|
54
|
+
recommended: false,
|
|
55
|
+
});
|
|
56
|
+
r.requires({ features: ["config"] });
|
|
57
|
+
// Plugin extension-point. Provider-features register here. The
|
|
58
|
+
// entityName at registration time becomes the value tenants pick in
|
|
59
|
+
// `provider` config-key (e.g. "smtp", "brevo-api").
|
|
60
|
+
r.extendsRegistrar(MAIL_TRANSPORT_EXTENSION, {
|
|
61
|
+
onRegister: () => {
|
|
62
|
+
// No side-effects at register-time — the registry stores the
|
|
63
|
+
// usage, factory looks it up at request-time. Same shape as
|
|
64
|
+
// delivery's extendsRegistrar.
|
|
65
|
+
},
|
|
66
|
+
});
|
|
67
|
+
// Provider-selector. Default empty so the boot-validator throws if a
|
|
68
|
+
// tenant tries to send mail without first picking + setting up a
|
|
69
|
+
// provider — better than a silent fallback. The actual list of valid
|
|
70
|
+
// values lives in the registered plugins, not here — Designer-UI can
|
|
71
|
+
// render `getExtensionUsages("mailTransport").map(u => u.entityName)`
|
|
72
|
+
// as the option-list.
|
|
73
|
+
const providerConfigKey = r.config("provider", createTenantConfig("text", {
|
|
74
|
+
default: "",
|
|
75
|
+
// required: without a chosen provider createTransportForTenant throws —
|
|
76
|
+
// readiness used to report ready:true and the first mail send
|
|
77
|
+
// surfaced the UnconfiguredError (280/1).
|
|
78
|
+
required: true,
|
|
79
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
80
|
+
read: access.roles("TenantAdmin", "SystemAdmin", "User"),
|
|
81
|
+
}));
|
|
82
|
+
// Readiness gating: transport-plugins' required keys/secrets count only
|
|
83
|
+
// while their plugin is the one this key selects.
|
|
84
|
+
r.extensionSelector(MAIL_TRANSPORT_EXTENSION, providerConfigKey);
|
|
85
|
+
return {
|
|
86
|
+
/** Config-key-handle for the provider-selector. */
|
|
87
|
+
providerConfigKey,
|
|
88
|
+
};
|
|
89
|
+
}, { dedupeOptions: {} });
|
|
90
|
+
}
|
|
91
|
+
// The typed handles below come from one shared instance; each factory call builds its own handle objects.
|
|
92
|
+
const sharedMailFoundationFeature = createMailFoundationFeature();
|
|
93
|
+
/** @deprecated Use createMailFoundationFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
94
|
+
export const mailFoundationFeature = sharedMailFoundationFeature;
|
|
89
95
|
// =============================================================================
|
|
90
96
|
// Transport-factory — looks up the registered plugin + delegates
|
|
91
97
|
// =============================================================================
|
|
@@ -99,6 +105,21 @@ export const mailFoundationFeature = defineFeature(FEATURE_NAME, (r) => {
|
|
|
99
105
|
* await transport.send({ to, subject, html });
|
|
100
106
|
*/
|
|
101
107
|
export async function createTransportForTenant(ctx, tenantId, handlerName = "mail-foundation:transport-factory") {
|
|
108
|
+
const transport = await createTransportForTenantIfConfigured(ctx, tenantId, handlerName);
|
|
109
|
+
if (transport === null) {
|
|
110
|
+
const usages = ctx.registry?.getExtensionUsages(MAIL_TRANSPORT_EXTENSION) ?? [];
|
|
111
|
+
const known = usages.map((u) => u.entityName).join(", ") || "<none>";
|
|
112
|
+
throw new Error(`${FEATURE_NAME}: no provider selected — set the 'provider' config-key to one of: ${known}. ` +
|
|
113
|
+
`Mount a mail-transport-* feature first if no plugins are registered.`);
|
|
114
|
+
}
|
|
115
|
+
return transport;
|
|
116
|
+
}
|
|
117
|
+
/**
|
|
118
|
+
* Like createTransportForTenant, but an empty `provider` key means "this tenant has no
|
|
119
|
+
* mail provider" and yields null. Every other problem (unknown provider, plugin build
|
|
120
|
+
* failure) still throws, so a configured tenant never silently falls back.
|
|
121
|
+
*/
|
|
122
|
+
export async function createTransportForTenantIfConfigured(ctx, tenantId, handlerName = "mail-foundation:transport-factory") {
|
|
102
123
|
const ctxConfig = ctx.config;
|
|
103
124
|
if (!ctxConfig) {
|
|
104
125
|
throw new Error(`${handlerName}: ctx.config is missing — feature requires the config-feature mounted in the registry`);
|
|
@@ -106,13 +127,9 @@ export async function createTransportForTenant(ctx, tenantId, handlerName = "mai
|
|
|
106
127
|
if (!ctx.registry) {
|
|
107
128
|
throw new Error(`${handlerName}: ctx.registry is missing — required to look up registered mail-transport plugins`);
|
|
108
129
|
}
|
|
109
|
-
const provider = requireDefined(await ctxConfig(
|
|
110
|
-
if (provider.length === 0)
|
|
111
|
-
|
|
112
|
-
const known = usages.map((u) => u.entityName).join(", ") || "<none>";
|
|
113
|
-
throw new Error(`${FEATURE_NAME}: no provider selected — set the 'provider' config-key to one of: ${known}. ` +
|
|
114
|
-
`Mount a mail-transport-* feature first if no plugins are registered.`);
|
|
115
|
-
}
|
|
130
|
+
const provider = requireDefined(await ctxConfig(sharedMailFoundationFeature.exports.providerConfigKey), FEATURE_NAME, "provider"); // @cast-boundary engine-payload
|
|
131
|
+
if (provider.length === 0)
|
|
132
|
+
return null;
|
|
116
133
|
const usages = ctx.registry.getExtensionUsages(MAIL_TRANSPORT_EXTENSION);
|
|
117
134
|
const usage = usages.find((u) => u.entityName === provider);
|
|
118
135
|
if (!usage) {
|
|
@@ -126,3 +143,13 @@ export async function createTransportForTenant(ctx, tenantId, handlerName = "mai
|
|
|
126
143
|
}
|
|
127
144
|
return withPiiCiphertextGuard(await usage.options.build(ctx, tenantId));
|
|
128
145
|
}
|
|
146
|
+
/** The `tenantTransport` resolver for `createChannelEmailFeature`: the tenant's configured
|
|
147
|
+
* provider, or null so the channel falls back to its app transport. */
|
|
148
|
+
export function tenantMailTransport(scope) {
|
|
149
|
+
return createTransportForTenantIfConfigured({
|
|
150
|
+
config: scope.config,
|
|
151
|
+
registry: scope.registry,
|
|
152
|
+
secrets: scope.secrets,
|
|
153
|
+
_userId: createSystemUser(scope.tenantId).id,
|
|
154
|
+
}, scope.tenantId, "channel-email");
|
|
155
|
+
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { createTransportForTenant, isMailTransportPlugin, MAIL_TRANSPORT_EXTENSION, type MailTransportContext, type MailTransportPlugin, mailFoundationFeature, } from "./feature.js";
|
|
1
|
+
export { createMailFoundationFeature, createTransportForTenant, createTransportForTenantIfConfigured, isMailTransportPlugin, MAIL_TRANSPORT_EXTENSION, type MailTransportContext, type MailTransportPlugin, mailFoundationFeature, type TenantMailTransportScope, tenantMailTransport, } from "./feature.js";
|
|
@@ -6,4 +6,4 @@
|
|
|
6
6
|
// up the registered transport-plugin, returns its EmailTransport
|
|
7
7
|
// - `MailTransportPlugin` — type that provider-features implement
|
|
8
8
|
// when registering via `r.useExtension("mailTransport", ...)`
|
|
9
|
-
export { createTransportForTenant, isMailTransportPlugin, MAIL_TRANSPORT_EXTENSION, mailFoundationFeature, } from "./feature.js";
|
|
9
|
+
export { createMailFoundationFeature, createTransportForTenant, createTransportForTenantIfConfigured, isMailTransportPlugin, MAIL_TRANSPORT_EXTENSION, mailFoundationFeature, tenantMailTransport, } from "./feature.js";
|
|
@@ -9,6 +9,10 @@ export declare function getInbox(tenantId: string): readonly EmailMessage[];
|
|
|
9
9
|
* Szenarien).
|
|
10
10
|
*/
|
|
11
11
|
export declare function clearInbox(tenantId: string): void;
|
|
12
|
+
export declare function createMailTransportInMemoryFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
13
|
+
readonly exports: void;
|
|
14
|
+
};
|
|
15
|
+
/** @deprecated Use createMailTransportInMemoryFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
12
16
|
export declare const mailTransportInMemoryFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
13
17
|
readonly exports: void;
|
|
14
18
|
};
|
|
@@ -60,19 +60,23 @@ export function clearInbox(tenantId) {
|
|
|
60
60
|
// =============================================================================
|
|
61
61
|
// Feature-definition
|
|
62
62
|
// =============================================================================
|
|
63
|
-
export
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
|
|
70
|
-
|
|
71
|
-
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
|
|
77
|
-
|
|
78
|
-
|
|
63
|
+
export function createMailTransportInMemoryFeature() {
|
|
64
|
+
return defineFeature(FEATURE_NAME, (r) => {
|
|
65
|
+
r.describe('Registers an in-process `"inmemory"` provider for `mail-foundation` that buffers sent mails per tenant instead of contacting an SMTP server. Use `getInbox(tenantId)` and `clearInbox(tenantId)` in demo apps and tests; not for production (buffer is process-memory, lost on restart).');
|
|
66
|
+
// Kein requires auf "config" oder "secrets" — der
|
|
67
|
+
// In-Memory-Transport hat keine Config (nichts zu konfigurieren) und
|
|
68
|
+
// kein Secret. Der einzige hard-require ist mail-foundation, das den
|
|
69
|
+
// extension-point "mailTransport" definiert.
|
|
70
|
+
r.requires({ features: ["mail-foundation"] });
|
|
71
|
+
const plugin = {
|
|
72
|
+
build: async (_ctx, tenantId) => {
|
|
73
|
+
// Returns the per-tenant buffer. Identity-stable across calls so the
|
|
74
|
+
// demo inbox keeps accumulating.
|
|
75
|
+
return getOrCreateTransportForTenant(tenantId);
|
|
76
|
+
}, // @wrapper-known semantic-alias
|
|
77
|
+
};
|
|
78
|
+
r.useExtension(MAIL_TRANSPORT_EXTENSION, "inmemory", plugin);
|
|
79
|
+
}, { dedupeOptions: {} });
|
|
80
|
+
}
|
|
81
|
+
/** @deprecated Use createMailTransportInMemoryFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
82
|
+
export const mailTransportInMemoryFeature = createMailTransportInMemoryFeature();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
export { clearInbox, getInbox, mailTransportInMemoryFeature } from "./feature.js";
|
|
1
|
+
export { clearInbox, createMailTransportInMemoryFeature, getInbox, mailTransportInMemoryFeature, } from "./feature.js";
|
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
// Public API of the mail-transport-inmemory bundled-feature.
|
|
2
|
-
export { clearInbox, getInbox, mailTransportInMemoryFeature } from "./feature.js";
|
|
2
|
+
export { clearInbox, createMailTransportInMemoryFeature, getInbox, mailTransportInMemoryFeature, } from "./feature.js";
|
|
@@ -3,6 +3,22 @@ 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 function createMailTransportSmtpFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
7
|
+
readonly exports: {
|
|
8
|
+
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
9
|
+
* consumer handlers. */
|
|
10
|
+
configKeys: {
|
|
11
|
+
readonly host: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
12
|
+
readonly port: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"number">;
|
|
13
|
+
readonly secure: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"boolean">;
|
|
14
|
+
readonly from: import("@cosmicdrift/kumiko-types/config").ConfigKeyHandle<"text">;
|
|
15
|
+
readonly authUser: 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. */
|
|
6
22
|
export declare const mailTransportSmtpFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
7
23
|
readonly exports: {
|
|
8
24
|
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
@@ -50,82 +50,88 @@ export function setSmtpMailHostLookup(fn) {
|
|
|
50
50
|
// =============================================================================
|
|
51
51
|
// Feature-definition
|
|
52
52
|
// =============================================================================
|
|
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
|
-
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
90
|
-
|
|
91
|
-
|
|
92
|
-
|
|
93
|
-
|
|
94
|
-
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
|
|
98
|
-
|
|
99
|
-
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
|
|
104
|
-
|
|
105
|
-
|
|
106
|
-
|
|
107
|
-
|
|
108
|
-
|
|
109
|
-
|
|
110
|
-
|
|
111
|
-
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
}
|
|
53
|
+
export function createMailTransportSmtpFeature() {
|
|
54
|
+
return defineFeature(FEATURE_NAME, (r) => {
|
|
55
|
+
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.');
|
|
56
|
+
r.uiHints({
|
|
57
|
+
displayLabel: "Mail Transport · SMTP",
|
|
58
|
+
category: "notifications",
|
|
59
|
+
recommended: false,
|
|
60
|
+
});
|
|
61
|
+
r.requires({ features: ["config"] });
|
|
62
|
+
r.requires({ features: ["secrets"] });
|
|
63
|
+
r.requires({ features: ["mail-foundation"] });
|
|
64
|
+
r.envSchema(mailTransportSmtpEnvSchema);
|
|
65
|
+
// Provider-secret. Sensitive: redact-helper for admin-UI display.
|
|
66
|
+
const password = r.secret("smtp.password", {
|
|
67
|
+
label: { en: "SMTP password" },
|
|
68
|
+
hint: {
|
|
69
|
+
en: "Login password at the SMTP server. Brevo/Postmark/SES call it 'API key' or 'SMTP credentials'.",
|
|
70
|
+
},
|
|
71
|
+
redact: (plaintext) => {
|
|
72
|
+
if (plaintext.length < 8)
|
|
73
|
+
return "•".repeat(plaintext.length);
|
|
74
|
+
return `${plaintext.slice(0, 3)}...${plaintext.slice(-2)}`;
|
|
75
|
+
},
|
|
76
|
+
scope: "tenant",
|
|
77
|
+
// required: true ↔ the missing-secret throw in readPassword — keep in sync.
|
|
78
|
+
required: true,
|
|
79
|
+
});
|
|
80
|
+
// required: true ↔ the requireNonEmpty calls in buildSmtpTransport — keep in sync.
|
|
81
|
+
const configKeys = r.config({
|
|
82
|
+
keys: {
|
|
83
|
+
host: createTenantConfig("text", {
|
|
84
|
+
required: true,
|
|
85
|
+
default: "",
|
|
86
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
87
|
+
read: access.roles("TenantAdmin", "SystemAdmin"),
|
|
88
|
+
}),
|
|
89
|
+
port: createTenantConfig("number", {
|
|
90
|
+
default: 587,
|
|
91
|
+
bounds: { min: 1, max: 65535 },
|
|
92
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
93
|
+
}),
|
|
94
|
+
secure: createTenantConfig("boolean", {
|
|
95
|
+
default: false,
|
|
96
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
97
|
+
}),
|
|
98
|
+
from: createTenantConfig("text", {
|
|
99
|
+
required: true,
|
|
100
|
+
default: "",
|
|
101
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
102
|
+
read: access.roles("TenantAdmin", "SystemAdmin"),
|
|
103
|
+
}),
|
|
104
|
+
authUser: createTenantConfig("text", {
|
|
105
|
+
required: true,
|
|
106
|
+
default: "",
|
|
107
|
+
write: access.roles("TenantAdmin", "SystemAdmin"),
|
|
108
|
+
read: access.roles("TenantAdmin", "SystemAdmin"),
|
|
109
|
+
}),
|
|
110
|
+
},
|
|
111
|
+
});
|
|
112
|
+
// Plugin: register against mail-foundation's "mailTransport" extension.
|
|
113
|
+
// `entityName` "smtp" is what tenants set in mail-foundation's
|
|
114
|
+
// `provider` config-key to pick this transport.
|
|
115
|
+
const plugin = {
|
|
116
|
+
build: async (ctx, tenantId) => buildSmtpTransport(ctx, tenantId), // @wrapper-known semantic-alias
|
|
117
|
+
};
|
|
118
|
+
r.useExtension(MAIL_TRANSPORT_EXTENSION, "smtp", plugin);
|
|
119
|
+
return {
|
|
120
|
+
/** Config-key-handles — typed reads via `ctx.config(...)` in
|
|
121
|
+
* consumer handlers. */
|
|
122
|
+
configKeys,
|
|
123
|
+
/** Secret-handle for the SMTP password. */
|
|
124
|
+
password,
|
|
125
|
+
};
|
|
126
|
+
}, { dedupeOptions: {} });
|
|
127
|
+
}
|
|
128
|
+
// The typed handles below come from one shared instance; each factory call builds its own handle objects.
|
|
129
|
+
const sharedMailTransportSmtpFeature = createMailTransportSmtpFeature();
|
|
130
|
+
/** @deprecated Use createMailTransportSmtpFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
131
|
+
export const mailTransportSmtpFeature = sharedMailTransportSmtpFeature;
|
|
126
132
|
/** Typed handle for the SMTP password — exported so seeds + tests can
|
|
127
133
|
* set it via `secrets:write:set` with the full qualified-name. */
|
|
128
|
-
export const SMTP_PASSWORD =
|
|
134
|
+
export const SMTP_PASSWORD = sharedMailTransportSmtpFeature.exports.password;
|
|
129
135
|
// =============================================================================
|
|
130
136
|
// Internal: build the EmailTransport from tenant config + secret
|
|
131
137
|
// =============================================================================
|
|
@@ -146,11 +152,11 @@ async function buildSmtpTransport(ctx, tenantId) {
|
|
|
146
152
|
throw new Error(`${FEATURE_NAME}: ctx.config is missing — feature requires the config-feature mounted in the registry`);
|
|
147
153
|
}
|
|
148
154
|
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(
|
|
155
|
+
const host = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.host), FEATURE_NAME, "host", SMTP_HINT);
|
|
156
|
+
const port = requireDefined(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.port), FEATURE_NAME, "port"); // @cast-boundary engine-payload
|
|
157
|
+
const secure = requireDefined(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.secure), FEATURE_NAME, "secure"); // @cast-boundary engine-payload
|
|
158
|
+
const from = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.from), FEATURE_NAME, "from", SMTP_HINT);
|
|
159
|
+
const authUser = requireNonEmpty(await ctxConfig(sharedMailTransportSmtpFeature.exports.configKeys.authUser), FEATURE_NAME, "authUser", SMTP_HINT);
|
|
154
160
|
const password = await readPassword(ctx, tenantId);
|
|
155
161
|
let target;
|
|
156
162
|
try {
|
|
@@ -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.
|