@cosmicdrift/kumiko-bundled-features 0.367.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-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 +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 +1 -1
- package/dist/delivery/handlers/log.query.js +2 -3
- package/dist/delivery/handlers/preferences.query.js +1 -1
- 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 +7 -0
- package/dist/mail-foundation/feature.js +48 -42
- 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/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/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/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/crypto-shredding/changes.json +6 -0
- package/src/file-provider-s3/changes.json +10 -1
- package/src/personal-access-tokens/changes.json +6 -0
- package/src/user/changes.json +6 -0
- package/dist/file-provider-s3-env/feature.d.ts +0 -3
- package/dist/file-provider-s3-env/feature.js +0 -46
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/env-helper.d.ts +0 -0
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/env-helper.js +0 -0
- /package/dist/{files-provider-s3 → file-provider-s3/lib}/s3-provider.d.ts +0 -0
|
@@ -1,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: {
|
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
export declare function createReadinessFeature(): import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
2
|
+
readonly exports: {
|
|
3
|
+
queries: {
|
|
4
|
+
status: import("@cosmicdrift/kumiko-types/handlers").HandlerRef;
|
|
5
|
+
};
|
|
6
|
+
};
|
|
7
|
+
};
|
|
8
|
+
/** @deprecated Use createReadinessFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
1
9
|
export declare const readinessFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
2
10
|
readonly exports: {
|
|
3
11
|
queries: {
|
|
@@ -9,17 +9,21 @@
|
|
|
9
9
|
// `ready` boolean — the settings-checklist call for admin UIs.
|
|
10
10
|
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
11
11
|
import { statusQuery } from "./handlers/status.query.js";
|
|
12
|
-
export
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
}
|
|
12
|
+
export function createReadinessFeature() {
|
|
13
|
+
return defineFeature("readiness", (r) => {
|
|
14
|
+
r.describe("One-call tenant-onboarding probe: `readiness:query:status` rolls up every config key and secret declared `required: true` across all mounted features and reports which still lack a usable value for the calling tenant, plus a single `ready` boolean. Provider-features under an `r.extensionSelector`-declared extension point count only while their provider is the selected one — a tenant on the inmemory mail transport is not blocked by unset SMTP keys. Mount it (together with `config` and `secrets`) when an admin UI needs a settings checklist before the first mail-send or file-write; the per-concern lists stay available via `config:query:readiness` and `secrets:query:list`.");
|
|
15
|
+
r.uiHints({
|
|
16
|
+
displayLabel: "Readiness · Onboarding Probe",
|
|
17
|
+
category: "operations",
|
|
18
|
+
recommended: false,
|
|
19
|
+
});
|
|
20
|
+
r.requires({ features: ["config"] });
|
|
21
|
+
r.requires({ features: ["secrets"] });
|
|
22
|
+
const queries = {
|
|
23
|
+
status: r.queryHandler(statusQuery),
|
|
24
|
+
};
|
|
25
|
+
return { queries };
|
|
26
|
+
}, { dedupeOptions: {} });
|
|
27
|
+
}
|
|
28
|
+
/** @deprecated Use createReadinessFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
29
|
+
export const readinessFeature = createReadinessFeature();
|
package/dist/readiness/index.js
CHANGED
|
@@ -1,2 +1,2 @@
|
|
|
1
1
|
export { READINESS_FEATURE, ReadinessQueries } from "./constants.js";
|
|
2
|
-
export { readinessFeature } from "./feature.js";
|
|
2
|
+
export { createReadinessFeature, readinessFeature } from "./feature.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asRawClient } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { asRawClient } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
export async function selectTenantSecretEnvelope(db, tenantId, key) {
|
|
3
3
|
const rows = await asRawClient(db).unsafe(`SELECT envelope FROM read_tenant_secrets WHERE tenant_id = $1 AND key = $2 LIMIT 1`, [tenantId, key]);
|
|
4
4
|
return rows[0]?.envelope;
|
|
@@ -25,6 +25,9 @@ export { type StoredEnvelope, type StoredMetadata, tenantSecretsTable } from "./
|
|
|
25
25
|
export declare function requireSecretsContext(ctx: {
|
|
26
26
|
readonly secrets?: SecretsContext;
|
|
27
27
|
readonly _userId?: string | undefined;
|
|
28
|
+
readonly user?: {
|
|
29
|
+
readonly id: string;
|
|
30
|
+
};
|
|
28
31
|
}, handlerName: string): SecretsContext;
|
|
29
32
|
export type SecretsFeatureOptions = {
|
|
30
33
|
/** Access rule for the `set`, `delete` and `list` handlers. Default
|
package/dist/secrets/feature.js
CHANGED
|
@@ -53,6 +53,7 @@ export { tenantSecretsTable } from "./table.js";
|
|
|
53
53
|
// FileProviderContext-Pfade (S3-Plugin im Worker) liefern dieselben
|
|
54
54
|
// zwei Felder, also reicht die schmale ctx-shape — kein voller
|
|
55
55
|
// HandlerContext-Import noetig.
|
|
56
|
+
// Handler contexts carry the caller as ctx.user, provider contexts set _userId (takes precedence).
|
|
56
57
|
export function requireSecretsContext(ctx, handlerName) {
|
|
57
58
|
if (!ctx.secrets) {
|
|
58
59
|
throw new InternalError({
|
|
@@ -60,10 +61,10 @@ export function requireSecretsContext(ctx, handlerName) {
|
|
|
60
61
|
"createSecretsContext({db, masterKeyProvider, registry}) via extraContext.secrets at boot.",
|
|
61
62
|
});
|
|
62
63
|
}
|
|
63
|
-
const userId = ctx._userId;
|
|
64
|
+
const userId = ctx._userId ?? ctx.user?.id;
|
|
64
65
|
if (!userId) {
|
|
65
66
|
throw new InternalError({
|
|
66
|
-
message: `[${handlerName}] ctx._userId missing — cannot audit secret reads without a caller identity.`,
|
|
67
|
+
message: `[${handlerName}] ctx._userId missing (and no ctx.user) — cannot audit secret reads without a caller identity.`,
|
|
67
68
|
});
|
|
68
69
|
}
|
|
69
70
|
const withAudit = (raw) => ({
|
|
@@ -16,8 +16,7 @@
|
|
|
16
16
|
// check to the executor's stream-version check; a parallel secrets.set
|
|
17
17
|
// that landed the row on the new kekVersion first surfaces here as a
|
|
18
18
|
// version_conflict error (counted as "skipped", not "failed").
|
|
19
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
20
|
-
import { createEventStoreExecutor, createTenantDb, } from "@cosmicdrift/kumiko-framework/db";
|
|
19
|
+
import { createEventStoreExecutor, createTenantDb, selectMany, } from "@cosmicdrift/kumiko-framework/db";
|
|
21
20
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
22
21
|
import { decodeStoredEnvelope, encodeStoredEnvelope, rewrapDek, } from "@cosmicdrift/kumiko-framework/secrets";
|
|
23
22
|
import { runChunkedMigration } from "../../shared/index.js";
|
|
@@ -48,7 +47,7 @@ export async function rotateJob(rawPayload, ctx, db) {
|
|
|
48
47
|
function tdbFor(tenantId) {
|
|
49
48
|
let existing = tdbCache.get(tenantId);
|
|
50
49
|
if (!existing) {
|
|
51
|
-
existing = createTenantDb(db, tenantId, "system");
|
|
50
|
+
existing = createTenantDb({ db, tenantId, mode: "system" });
|
|
52
51
|
tdbCache.set(tenantId, existing);
|
|
53
52
|
}
|
|
54
53
|
return existing;
|
|
@@ -11,8 +11,7 @@
|
|
|
11
11
|
// race on the secret's own version). The audit invariant ("every
|
|
12
12
|
// read logged") now sits on the events-table instead of a
|
|
13
13
|
// dedicated audit-table.
|
|
14
|
-
import { fetchOne, transaction } from "@cosmicdrift/kumiko-framework/
|
|
15
|
-
import { createEventStoreExecutor, createTenantDb, } from "@cosmicdrift/kumiko-framework/db";
|
|
14
|
+
import { createEventStoreExecutor, createTenantDb, fetchOne, transaction, } from "@cosmicdrift/kumiko-framework/db";
|
|
16
15
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
17
16
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
18
17
|
import { createDekCache, createSecret, decodeStoredEnvelope, decryptValue, encodeStoredEnvelope, encryptValue, withDekCache, } from "@cosmicdrift/kumiko-framework/secrets";
|
|
@@ -140,7 +139,7 @@ function buildSecretsContext(opts, provider, db, runnerIsTransaction) {
|
|
|
140
139
|
tenantId,
|
|
141
140
|
roles: SYSTEM_ROLES,
|
|
142
141
|
};
|
|
143
|
-
const tdb = createTenantDb(db, tenantId, "system");
|
|
142
|
+
const tdb = createTenantDb({ db, tenantId, mode: "system" });
|
|
144
143
|
const existing = await lookup(tenantId, key);
|
|
145
144
|
const commonFields = {
|
|
146
145
|
envelope: stored,
|
|
@@ -194,7 +193,7 @@ function buildSecretsContext(opts, provider, db, runnerIsTransaction) {
|
|
|
194
193
|
tenantId,
|
|
195
194
|
roles: SYSTEM_ROLES,
|
|
196
195
|
};
|
|
197
|
-
const tdb = createTenantDb(db, tenantId, "system");
|
|
196
|
+
const tdb = createTenantDb({ db, tenantId, mode: "system" });
|
|
198
197
|
const result = await executor.delete({ id: existing.id }, actor, tdb);
|
|
199
198
|
return result.isSuccess;
|
|
200
199
|
},
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { asRawClient } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { asRawClient } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
export async function deleteStaleSessionsBatch(db, olderThanDays, batchSize) {
|
|
3
3
|
const rows = await asRawClient(db).unsafe(`DELETE FROM "store_user_sessions"
|
|
4
4
|
WHERE "id" IN (
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { access, definePagedQueryHandler, MAX_LIST_LIMIT, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -6,7 +6,7 @@ import { decryptStoredPii } from "../../shared/index.js";
|
|
|
6
6
|
import { userSessionTable } from "../schema/user-session.js";
|
|
7
7
|
// `sort` arrives raw from the client's query string. selectMany's orderBy
|
|
8
8
|
// has no column-existence check — an unrecognised field just gets
|
|
9
|
-
// snake_cased and quoted as-is (
|
|
9
|
+
// snake_cased and quoted as-is (db/query.ts columnOf) — so this
|
|
10
10
|
// allowlist is what stops a client sorting by ip/userAgent or any other
|
|
11
11
|
// non-exposed column.
|
|
12
12
|
const SORTABLE_COLUMNS = ["id", "userId", "createdAt", "expiresAt", "revokedAt"];
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { definePagedQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { decryptStoredPii } from "../../shared/index.js";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { requestContext } from "@cosmicdrift/kumiko-framework/api";
|
|
2
|
-
import { updateMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
+
import { updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { access, defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
5
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { UnprocessableError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { generateId } from "@cosmicdrift/kumiko-framework/utils";
|
|
@@ -1,11 +1,11 @@
|
|
|
1
|
-
import { fetchOne, insertOne, transaction, updateMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne, insertOne, transaction, updateMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { buildSessionRoles, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { append } from "@cosmicdrift/kumiko-framework/event-store";
|
|
4
4
|
import { generateId, parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
5
5
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
6
6
|
import { encryptForDirectWrite } from "../shared/index.js";
|
|
7
7
|
import { tenantMembershipsTable } from "../tenant/index.js";
|
|
8
|
-
import { isPrincipalBlocked, userTable } from "../user/index.js";
|
|
8
|
+
import { isPrincipalBlocked, isPrincipalRowBlocked, userTable, } from "../user/index.js";
|
|
9
9
|
import { DEFAULT_SESSION_EXPIRY_MS, LAST_SEEN_REFRESH_MS, USER_SESSION_ENTITY_NAME, } from "./constants.js";
|
|
10
10
|
import { userSessionEntity, userSessionTable } from "./schema/user-session.js";
|
|
11
11
|
import { SESSION_REVOKED_AGGREGATE_TYPE, SESSION_REVOKED_EVENT_QN, sessionRevokedSchema, } from "./session-revoked-event.js";
|
|
@@ -112,16 +112,14 @@ export function createSessionCallbacks(opts) {
|
|
|
112
112
|
// falls back to the JWT's frozen roles claim.
|
|
113
113
|
let user;
|
|
114
114
|
try {
|
|
115
|
-
user = await fetchOne(db, userTable, {
|
|
116
|
-
id: expectedUserId,
|
|
117
|
-
});
|
|
115
|
+
user = await fetchOne(db, userTable, { id: expectedUserId });
|
|
118
116
|
}
|
|
119
117
|
catch {
|
|
120
118
|
return "live";
|
|
121
119
|
}
|
|
122
120
|
if (!user)
|
|
123
121
|
return "live";
|
|
124
|
-
if (
|
|
122
|
+
if (isPrincipalRowBlocked(user))
|
|
125
123
|
return "blocked";
|
|
126
124
|
// Same fail-open reasoning as the userTable lookup above — a transient
|
|
127
125
|
// DB error on the membership read must not lock the user out. A
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { AuthRoutesConfig, SessionCreator } from "@cosmicdrift/kumiko-framework/api";
|
|
2
2
|
import type { SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
-
import type { LateBoundHolder } from "@cosmicdrift/kumiko-
|
|
3
|
+
import type { LateBoundHolder } from "@cosmicdrift/kumiko-testing/helpers";
|
|
4
4
|
import type { SessionCallbacks, SessionMassRevoker } from "./session-callbacks.js";
|
|
5
5
|
export type BoundSessionCallbacks = {
|
|
6
6
|
/** auth-config fragment: creator + revoker + checker, all late-bound. */
|
package/dist/tags/feature.d.ts
CHANGED
|
@@ -2,7 +2,7 @@ import { type AccessRule, type EntityDefinition } from "@cosmicdrift/kumiko-fram
|
|
|
2
2
|
type TagsToggleable = {
|
|
3
3
|
readonly default: boolean;
|
|
4
4
|
};
|
|
5
|
-
|
|
5
|
+
declare const defaultTagsFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
6
6
|
readonly exports: void;
|
|
7
7
|
};
|
|
8
8
|
export type TagsFeatureOptions = {
|
|
@@ -44,5 +44,9 @@ export type TagsFeatureOptions = {
|
|
|
44
44
|
* otherwise considers every registered entity as a candidate host. */
|
|
45
45
|
readonly parents?: readonly string[];
|
|
46
46
|
};
|
|
47
|
-
export declare function createTagsFeature(opts?: TagsFeatureOptions): typeof
|
|
47
|
+
export declare function createTagsFeature(opts?: TagsFeatureOptions): typeof defaultTagsFeature;
|
|
48
|
+
/** @deprecated Use createTagsFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
49
|
+
export declare const tagsFeature: import("@cosmicdrift/kumiko-types/feature").FeatureDefinition & {
|
|
50
|
+
readonly exports: void;
|
|
51
|
+
};
|
|
48
52
|
export {};
|
package/dist/tags/feature.js
CHANGED
|
@@ -84,7 +84,7 @@ function registerTags(r, access, toggleable, ownership, parents) {
|
|
|
84
84
|
r.screen(createTagEditScreen(access));
|
|
85
85
|
r.translations({ keys: TAGS_FEATURE_I18N });
|
|
86
86
|
}
|
|
87
|
-
|
|
87
|
+
const defaultTagsFeature = defineFeature(TAGS_FEATURE_NAME, (r) => registerTags(r, DEFAULT_TAG_ACCESS, undefined, undefined, undefined));
|
|
88
88
|
function resolveAccess(opts) {
|
|
89
89
|
if (opts.access !== undefined)
|
|
90
90
|
return opts.access;
|
|
@@ -101,7 +101,7 @@ export function createTagsFeature(opts = {}) {
|
|
|
101
101
|
opts.toggleable === undefined &&
|
|
102
102
|
opts.ownership === undefined &&
|
|
103
103
|
opts.parents === undefined) {
|
|
104
|
-
return
|
|
104
|
+
return defaultTagsFeature;
|
|
105
105
|
}
|
|
106
106
|
if (opts.parents !== undefined && opts.parents.length === 0) {
|
|
107
107
|
throw new Error("createTagsFeature({ parents }): parents must not be an empty array — " +
|
|
@@ -113,3 +113,5 @@ export function createTagsFeature(opts = {}) {
|
|
|
113
113
|
const access = resolveAccess(opts);
|
|
114
114
|
return defineFeature(TAGS_FEATURE_NAME, (r) => registerTags(r, access, opts.toggleable, opts.ownership, opts.parents));
|
|
115
115
|
}
|
|
116
|
+
/** @deprecated Use createTagsFeature(). Run `bun kumiko-upgrade --apply`. Removed in the first release after 2026-10-29. */
|
|
117
|
+
export const tagsFeature = createTagsFeature();
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
// TemplateResolverApi — cross-feature interface. renderer-foundation,
|
|
2
2
|
// delivery and apps import types ONLY and take the implementation from
|
|
3
3
|
// ctx.templateResolver at runtime.
|
|
4
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
4
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
5
5
|
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
6
6
|
import { FALLBACK_LOCALE, SYSTEM_TENANT_ID } from "./constants.js";
|
|
7
7
|
import { fileAttachmentsOf, imageLinksOf, parseLinkedResourceEntries, pdfAttachmentLinksOf, } from "./linked-resources.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { requireForTenant } from "../../shared/index.js";
|
|
4
4
|
import { attachmentLimitFailure, attachmentNeedsMailTemplate, createPreparedBundleResourceEntry, prepareTemplateAttachmentBeforeTransaction, prepareTemplateResourceBeforeTransaction, readTemplateResourceMaxBytes, releaseAll, } from "../store-template-resource.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { TEXT_BLOCK_KIND } from "../constants.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
-
import { castTenantRows } from "@cosmicdrift/kumiko-framework/db";
|
|
1
|
+
import { castTenantRows, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
import { TEXT_BLOCK_KIND } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { collectionStore, DEFAULT_COLLECTION_ACCESS, toCollectionEntry, } from "./collection-shared.js";
|
|
@@ -1,5 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
-
import { castTenantRows } from "@cosmicdrift/kumiko-framework/db";
|
|
1
|
+
import { castTenantRows, selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
2
|
import { defineQueryHandler, } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
3
|
import * as z from "zod";
|
|
5
4
|
import { collectionStore, DEFAULT_COLLECTION_ACCESS, toCollectionEntry, } from "./collection-shared.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID, } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { AccessDeniedError, NotFoundError, ValidationError, writeFailure, } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { isDeepStrictEqual } from "node:util";
|
|
2
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
2
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
3
3
|
import { defineQueryHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import { NotFoundError, ValidationError } from "@cosmicdrift/kumiko-framework/errors";
|
|
5
5
|
import * as z from "zod";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { templateResourcesTable } from "../table.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { FALLBACK_LOCALE } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { TEMPLATE_KINDS, TEMPLATE_STATUSES } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import * as z from "zod";
|
|
4
4
|
import { DEFAULT_MAIL_LAYOUT_SLUG, FALLBACK_LOCALE } from "../constants.js";
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { fetchOne } from "@cosmicdrift/kumiko-framework/
|
|
1
|
+
import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
2
2
|
import { defineWriteHandler, SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import { NotFoundError, ValidationError, writeFailure } from "@cosmicdrift/kumiko-framework/errors";
|
|
4
4
|
import * as z from "zod";
|