@cosmicdrift/kumiko-bundled-features 0.413.1 → 0.414.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/admin-shell/feature.js +2 -2
- package/dist/agent-tools/agent-doc-lint.js +2 -1
- package/dist/agent-tools/agent-manifest.js +33 -25
- package/dist/agent-tools/api-docs/collect-events.js +4 -1
- package/dist/agent-tools/api-docs/collect.js +3 -3
- package/dist/agent-tools/api-docs/generate.js +4 -1
- package/dist/agent-tools/api-docs/index.d.ts +1 -0
- package/dist/agent-tools/api-docs/index.js +1 -0
- package/dist/agent-tools/api-docs/problems.d.ts +21 -0
- package/dist/agent-tools/api-docs/problems.js +11 -1
- package/dist/agent-tools/api-docs/render-openapi.js +2 -0
- package/dist/agent-tools/api-docs/resolve-config.d.ts +9 -0
- package/dist/agent-tools/api-docs/resolve-config.js +11 -0
- package/dist/agent-tools/api-docs/scope-slug-collisions.d.ts +4 -0
- package/dist/agent-tools/api-docs/scope-slug-collisions.js +10 -0
- package/dist/agent-tools/api-docs/translation-gaps.d.ts +4 -0
- package/dist/agent-tools/api-docs/translation-gaps.js +29 -0
- package/dist/agent-tools/api-docs/webhook-example-problems.d.ts +6 -0
- package/dist/agent-tools/api-docs/webhook-example-problems.js +25 -0
- package/dist/agent-tools/index.d.ts +1 -1
- package/dist/agent-tools/index.js +1 -1
- package/dist/agent-tools/labels.d.ts +3 -2
- package/dist/agent-tools/labels.js +21 -4
- package/dist/agent-tools/tool-catalog.d.ts +5 -5
- package/dist/agent-tools/tool-catalog.js +12 -10
- package/dist/agent-tools/tool-dispatch.js +11 -1
- package/dist/agent-tools/types.d.ts +4 -0
- package/dist/audit/event-classification.js +6 -0
- package/dist/audit/web/i18n.js +1 -0
- package/dist/auth-email-password/errors.js +0 -13
- package/dist/auth-email-password/handlers/invite-signup-complete.write.js +101 -84
- package/dist/auth-email-password/handlers/login-options.query.js +1 -1
- package/dist/auth-email-password/handlers/request-account-unlock.write.js +1 -1
- package/dist/auth-email-password/handlers/request-email-verification.write.js +0 -1
- package/dist/auth-email-password/handlers/request-password-reset.write.js +0 -1
- package/dist/auth-email-password/handlers/self-registration-status.query.js +1 -1
- package/dist/auth-email-password/reset-token.js +0 -2
- package/dist/auth-email-password/seeding.js +34 -8
- package/dist/auth-email-password/unlock-token.js +0 -2
- package/dist/auth-email-password/verification-token.js +0 -2
- package/dist/auth-email-password/web/auth-form-primitives.js +2 -2
- package/dist/auth-email-password/web/auth-gate.js +2 -2
- package/dist/auth-email-password/web/auth-redirect.d.ts +1 -0
- package/dist/auth-email-password/web/auth-redirect.js +4 -0
- package/dist/auth-email-password/web/forgot-password-screen.js +1 -5
- package/dist/auth-email-password/web/invite-accept-screen.js +1 -1
- package/dist/auth-email-password/web/return-path.d.ts +2 -1
- package/dist/auth-email-password/web/return-path.js +2 -1
- package/dist/auth-email-password/web/session.js +11 -12
- package/dist/auth-email-password/web/signup-screen.js +1 -5
- package/dist/auth-email-password/web/static-account.js +6 -2
- package/dist/auth-email-password/web/token-confirm-screen.js +4 -5
- package/dist/auth-mfa/web/mfa-code-or-recovery-field.d.ts +6 -1
- package/dist/auth-mfa/web/mfa-code-or-recovery-field.js +4 -2
- package/dist/auth-mfa/web/mfa-disable-dialog.js +1 -1
- package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.js +1 -1
- package/dist/auth-mfa/web/mfa-setup-preauth-screen.js +1 -1
- package/dist/auth-mfa/web/mfa-verify-screen.js +7 -11
- package/dist/auth-mfa-user-data/index.js +5 -6
- package/dist/billing-foundation/aggregate-id.js +0 -4
- package/dist/billing-foundation/checkout-core.js +8 -1
- package/dist/billing-foundation/checkout-ledger.d.ts +15 -0
- package/dist/billing-foundation/checkout-ledger.js +32 -0
- package/dist/billing-foundation/consumer-protection/consent-gate.d.ts +1 -1
- package/dist/billing-foundation/consumer-protection/consent-gate.js +2 -2
- package/dist/billing-foundation/consumer-protection/consent-text.d.ts +6 -2
- package/dist/billing-foundation/consumer-protection/consent-text.js +29 -3
- package/dist/billing-foundation/consumer-protection/termination-open-cancels.d.ts +2 -1
- package/dist/billing-foundation/consumer-protection/termination-open-cancels.js +5 -1
- package/dist/billing-foundation/consumer-protection/termination-provider-timeout.d.ts +2 -0
- package/dist/billing-foundation/consumer-protection/termination-provider-timeout.js +17 -0
- package/dist/billing-foundation/consumer-protection/termination-record.js +5 -4
- package/dist/billing-foundation/consumer-protection/termination-revoke.js +1 -1
- package/dist/billing-foundation/events.d.ts +22 -0
- package/dist/billing-foundation/events.js +38 -10
- package/dist/billing-foundation/feature.js +12 -1
- package/dist/billing-foundation/handlers/billing-plans.query.js +25 -15
- package/dist/billing-foundation/handlers/create-checkout-session.write.js +1 -1
- package/dist/billing-foundation/handlers/process-event.write.d.ts +2 -2
- package/dist/billing-foundation/handlers/process-event.write.js +94 -12
- package/dist/billing-foundation/handlers/process-payment-event.write.d.ts +1 -2
- package/dist/billing-foundation/handlers/process-payment-event.write.js +29 -9
- package/dist/billing-foundation/handlers/record-checkout-opened.write.d.ts +2 -0
- package/dist/billing-foundation/handlers/record-checkout-opened.write.js +22 -0
- package/dist/billing-foundation/handlers/start-plan-checkout.write.js +1 -1
- package/dist/billing-foundation/handlers/switch-plan.write.js +10 -4
- package/dist/billing-foundation/i18n.js +3 -0
- package/dist/billing-foundation/pending-plan-switch.d.ts +12 -0
- package/dist/billing-foundation/pending-plan-switch.js +57 -0
- package/dist/billing-foundation/scrub-raw-payload-headers.d.ts +4 -0
- package/dist/billing-foundation/scrub-raw-payload-headers.js +33 -0
- package/dist/billing-foundation/types.d.ts +40 -24
- package/dist/billing-foundation/validate-options.js +14 -0
- package/dist/billing-foundation/web/billing-plans-panel.js +8 -3
- package/dist/billing-foundation/web/cancel-contract-dialog.js +1 -1
- package/dist/billing-foundation/web/checkout-consent-dialog.js +1 -1
- package/dist/billing-foundation/web/constants.d.ts +3 -0
- package/dist/billing-foundation/web/constants.js +5 -2
- package/dist/billing-foundation/web/plan-switch-confirm-dialog.js +1 -1
- package/dist/billing-foundation/webhook-handler.js +53 -11
- package/dist/cap-counter/aggregate-id.js +0 -2
- package/dist/cap-counter/stock-cap-guard.d.ts +1 -0
- package/dist/cap-counter/stock-cap-guard.js +18 -4
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +18 -4
- package/dist/cap-overview/i18n.js +1 -0
- package/dist/cap-overview/index.d.ts +1 -1
- package/dist/cap-overview/types.d.ts +4 -0
- package/dist/cap-overview/web/cap-cards-panel.js +6 -2
- package/dist/cap-overview/web/cap-usage-bar.js +6 -1
- package/dist/cap-overview/web/usage-math.d.ts +1 -0
- package/dist/cap-overview/web/usage-math.js +4 -0
- package/dist/channel-in-app/handlers/read-state-by-keys.query.js +2 -2
- package/dist/channel-whatsapp/aggregate-id.d.ts +8 -0
- package/dist/channel-whatsapp/aggregate-id.js +18 -0
- package/dist/channel-whatsapp/constants.d.ts +25 -0
- package/dist/channel-whatsapp/constants.js +36 -0
- package/dist/channel-whatsapp/events.d.ts +87 -0
- package/dist/channel-whatsapp/events.js +70 -0
- package/dist/channel-whatsapp/feature.d.ts +3 -0
- package/dist/channel-whatsapp/feature.js +56 -0
- package/dist/channel-whatsapp/graph-client.d.ts +85 -0
- package/dist/channel-whatsapp/graph-client.js +272 -0
- package/dist/channel-whatsapp/in-memory-meta.d.ts +83 -0
- package/dist/channel-whatsapp/in-memory-meta.js +181 -0
- package/dist/channel-whatsapp/inbound-handlers.d.ts +39 -0
- package/dist/channel-whatsapp/inbound-handlers.js +127 -0
- package/dist/channel-whatsapp/index.d.ts +10 -0
- package/dist/channel-whatsapp/index.js +10 -0
- package/dist/channel-whatsapp/meta-signature.d.ts +5 -0
- package/dist/channel-whatsapp/meta-signature.js +19 -0
- package/dist/channel-whatsapp/options.d.ts +32 -0
- package/dist/channel-whatsapp/options.js +83 -0
- package/dist/channel-whatsapp/pii.d.ts +32 -0
- package/dist/channel-whatsapp/pii.js +61 -0
- package/dist/channel-whatsapp/webhook-normalize.d.ts +7 -0
- package/dist/channel-whatsapp/webhook-normalize.js +185 -0
- package/dist/channel-whatsapp/webhook-routes.d.ts +10 -0
- package/dist/channel-whatsapp/webhook-routes.js +118 -0
- package/dist/compliance-profiles/handlers/sub-processors.query.js +1 -1
- package/dist/config/handlers/set.write.js +7 -0
- package/dist/config/handlers/values.query.js +8 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/read-redaction.d.ts +1 -0
- package/dist/config/read-redaction.js +5 -2
- package/dist/config/table.js +1 -0
- package/dist/config/write-helpers.js +3 -2
- package/dist/crypto-shredding/constants.d.ts +1 -0
- package/dist/crypto-shredding/constants.js +1 -0
- package/dist/crypto-shredding/handlers/forget-subject.write.js +34 -13
- package/dist/crypto-shredding/index.d.ts +1 -0
- package/dist/crypto-shredding/index.js +1 -0
- package/dist/crypto-shredding/subject-forget-after-delete-hook.d.ts +12 -0
- package/dist/crypto-shredding/subject-forget-after-delete-hook.js +38 -0
- package/dist/custom-fields/aggregate-id.js +0 -1
- package/dist/custom-fields/entity.js +1 -0
- package/dist/custom-fields/wire-for-entity.js +0 -1
- package/dist/data-retention/erase-notes-of-deleted-row.d.ts +9 -0
- package/dist/data-retention/erase-notes-of-deleted-row.js +15 -0
- package/dist/data-retention/feature.js +1 -5
- package/dist/data-retention/run-retention-cleanup.d.ts +1 -0
- package/dist/data-retention/run-retention-cleanup.js +39 -19
- package/dist/data-retention/tenant-destruction-hold.js +7 -0
- package/dist/delivery/attempt-log-factory.d.ts +3 -0
- package/dist/delivery/attempt-log-factory.js +5 -0
- package/dist/delivery/attempt-log.d.ts +2 -2
- package/dist/delivery/channel-context.d.ts +1 -1
- package/dist/delivery/channel-context.js +5 -2
- package/dist/delivery/db/queries/preferences.js +0 -1
- package/dist/delivery/delivery-service.js +3 -0
- package/dist/delivery/feature.d.ts +1 -4
- package/dist/delivery/feature.js +3 -1
- package/dist/delivery/handlers/attempts-by-keys.query.d.ts +1 -1
- package/dist/delivery/handlers/opted-in-user-ids.query.d.ts +7 -0
- package/dist/delivery/handlers/opted-in-user-ids.query.js +41 -0
- package/dist/delivery/handlers/preferences.query.js +2 -20
- package/dist/delivery/handlers/resubscribe-user.write.d.ts +2 -2
- package/dist/delivery/handlers/resubscribe-user.write.js +2 -24
- package/dist/delivery/handlers/unsubscribe-page-chrome.query.js +2 -0
- package/dist/delivery/handlers/unsubscribe-user.write.d.ts +2 -2
- package/dist/delivery/handlers/unsubscribe-user.write.js +2 -26
- package/dist/delivery/index.d.ts +3 -1
- package/dist/delivery/index.js +1 -0
- package/dist/delivery/options.d.ts +4 -0
- package/dist/delivery/options.js +1 -0
- package/dist/delivery/preference-rows.d.ts +9 -0
- package/dist/delivery/preference-rows.js +22 -0
- package/dist/delivery/set-preference-enabled.d.ts +17 -0
- package/dist/delivery/set-preference-enabled.js +26 -0
- package/dist/delivery/tables.d.ts +2 -2
- package/dist/delivery/testing.d.ts +1 -1
- package/dist/delivery/testing.js +3 -1
- package/dist/delivery/types.d.ts +1 -0
- package/dist/delivery/unsubscribe-page.js +5 -1
- package/dist/delivery/upsert-preference.js +0 -1
- package/dist/delivery/web/public-names.d.ts +1 -0
- package/dist/delivery/web/public-names.js +1 -0
- package/dist/derivatives-sharp/render.js +9 -9
- package/dist/document-ingest-foundation/aggregate-id.js +0 -1
- package/dist/document-ingest-foundation/append-missing-extract-event.d.ts +0 -1
- package/dist/document-ingest-foundation/append-missing-extract-event.js +32 -21
- package/dist/document-ingest-foundation/report-ingest-progress.d.ts +1 -1
- package/dist/document-ingest-foundation/report-ingest-progress.js +29 -13
- package/dist/documents/aggregate-id.js +0 -2
- package/dist/documents/constants.d.ts +6 -0
- package/dist/documents/constants.js +8 -2
- package/dist/documents/ensure-link.d.ts +5 -8
- package/dist/documents/ensure-link.js +4 -2
- package/dist/documents/feature.d.ts +3 -1
- package/dist/documents/feature.js +24 -5
- package/dist/documents/handlers/import.write.js +2 -2
- package/dist/documents/queries/expiry-overview.query.js +2 -1
- package/dist/documents/queries/for-record.query.js +3 -4
- package/dist/documents/queries/list-page.js +11 -3
- package/dist/documents/queries/overview.query.js +2 -2
- package/dist/documents/screens.js +3 -3
- package/dist/documents/tab.js +1 -1
- package/dist/feature-toggles/toggle-sync-signal.d.ts +2 -2
- package/dist/feature-toggles/toggle-sync-signal.js +3 -2
- 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/probe.js +9 -3
- package/dist/file-foundation/read-file-ref-content.js +23 -11
- package/dist/file-provider-inmemory/feature.js +1 -1
- package/dist/file-provider-s3/env-feature.js +1 -1
- package/dist/file-provider-s3/env-named-feature.js +1 -1
- package/dist/file-provider-s3/env-schema.d.ts +10 -1
- package/dist/file-provider-s3/env-schema.js +20 -7
- package/dist/file-provider-s3/feature.js +1 -1
- 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/env-helper.d.ts +3 -2
- package/dist/file-provider-s3/lib/env-helper.js +13 -12
- package/dist/file-provider-s3/lib/s3-provider.js +10 -2
- package/dist/folders/aggregate-id.js +0 -1
- package/dist/folders/web/folder-manager.js +1 -1
- package/dist/folders-user-data/index.js +12 -14
- package/dist/helpdesk/entity.js +4 -1
- package/dist/helpdesk/feature.js +36 -0
- package/dist/helpdesk/handlers/access.d.ts +0 -1
- package/dist/helpdesk/handlers/access.js +0 -3
- package/dist/helpdesk/handlers/attempts.js +7 -13
- package/dist/helpdesk/handlers/challenge.query.js +1 -2
- package/dist/helpdesk/handlers/reply.write.js +4 -5
- package/dist/helpdesk/handlers/report.write.js +3 -7
- package/dist/helpdesk/handlers/submit.write.js +4 -9
- package/dist/helpdesk/index.d.ts +1 -1
- package/dist/helpdesk/index.js +1 -1
- package/dist/helpdesk/legacy-contact-config.d.ts +3 -0
- package/dist/helpdesk/legacy-contact-config.js +57 -0
- package/dist/helpdesk/legacy-contact-erasure.d.ts +9 -0
- package/dist/helpdesk/legacy-contact-erasure.js +19 -0
- package/dist/helpdesk/legacy-contact-retention.d.ts +2 -0
- package/dist/helpdesk/legacy-contact-retention.js +53 -0
- package/dist/helpdesk/legacy-contact-streams.d.ts +20 -0
- package/dist/helpdesk/legacy-contact-streams.js +121 -0
- package/dist/helpdesk/legacy-contact-user-data.d.ts +5 -0
- package/dist/helpdesk/legacy-contact-user-data.js +62 -0
- package/dist/helpdesk/lib.d.ts +7 -1
- package/dist/helpdesk/lib.js +29 -29
- package/dist/helpdesk/user-data-hooks.d.ts +10 -1
- package/dist/helpdesk/user-data-hooks.js +47 -36
- package/dist/helpdesk/web/constants.d.ts +0 -1
- package/dist/helpdesk/web/constants.js +0 -1
- package/dist/inbound-mail-foundation/account-health.js +1 -1
- package/dist/inbound-mail-foundation/account-poll.js +1 -1
- package/dist/inbound-mail-foundation/aggregate-id.js +0 -2
- package/dist/inbound-mail-foundation/constants.d.ts +6 -0
- package/dist/inbound-mail-foundation/constants.js +6 -0
- package/dist/inbound-mail-foundation/content-refetch.d.ts +1 -0
- package/dist/inbound-mail-foundation/content-refetch.js +15 -1
- package/dist/inbound-mail-foundation/entities.js +57 -15
- package/dist/inbound-mail-foundation/events.js +15 -16
- package/dist/inbound-mail-foundation/feature.js +3 -1
- package/dist/inbound-mail-foundation/handlers/account-address.d.ts +2 -2
- package/dist/inbound-mail-foundation/handlers/account-address.js +10 -2
- package/dist/inbound-mail-foundation/handlers/attach-message-content.write.js +8 -3
- package/dist/inbound-mail-foundation/handlers/connect-account.write.js +12 -7
- package/dist/inbound-mail-foundation/handlers/forget-message.write.d.ts +7 -0
- package/dist/inbound-mail-foundation/handlers/forget-message.write.js +54 -0
- package/dist/inbound-mail-foundation/i18n.js +3 -0
- package/dist/inbound-mail-foundation/index.d.ts +1 -0
- package/dist/inbound-mail-foundation/index.js +1 -0
- package/dist/inbound-mail-foundation/oauth-access-token.js +1 -1
- package/dist/inbound-mail-foundation/outbound-mail.d.ts +2 -0
- package/dist/inbound-mail-foundation/personal-address.d.ts +1 -0
- package/dist/inbound-mail-foundation/personal-address.js +16 -0
- package/dist/inbound-mail-foundation/purge-messages.d.ts +20 -0
- package/dist/inbound-mail-foundation/purge-messages.js +33 -0
- package/dist/inbound-mail-foundation/quarantine.d.ts +3 -2
- package/dist/inbound-mail-foundation/quarantine.js +9 -5
- package/dist/inbound-mail-foundation/retention-job.js +1 -5
- package/dist/inbound-mail-foundation/retention-sweep.js +17 -28
- package/dist/inbound-mail-foundation/send-from-account.js +9 -1
- package/dist/inbound-mail-foundation/supervisor-ingest.js +4 -1
- package/dist/inbound-mail-foundation/sync-account-now.js +1 -1
- package/dist/inbound-mail-foundation/tenant-destroy-hook.js +3 -6
- package/dist/inbound-mail-foundation/watch-supervisor.js +1 -1
- package/dist/inbound-provider-imap/byte-budget.d.ts +14 -0
- package/dist/inbound-provider-imap/byte-budget.js +53 -0
- package/dist/inbound-provider-imap/connect-mailbox.d.ts +2 -4
- package/dist/inbound-provider-imap/connect-mailbox.js +8 -3
- package/dist/inbound-provider-imap/connect-my-mailbox.d.ts +1 -1
- package/dist/inbound-provider-imap/connect-my-mailbox.js +15 -4
- package/dist/inbound-provider-imap/connect-target-rate-limit.d.ts +3 -0
- package/dist/inbound-provider-imap/connect-target-rate-limit.js +37 -0
- package/dist/inbound-provider-imap/download-batch.d.ts +10 -0
- package/dist/inbound-provider-imap/download-batch.js +21 -6
- package/dist/inbound-provider-imap/feature.js +7 -4
- package/dist/inbound-provider-imap/fetch-content.js +35 -30
- package/dist/inbound-provider-imap/i18n.js +2 -2
- package/dist/inbound-provider-imap/parse-message.d.ts +7 -0
- package/dist/inbound-provider-imap/parse-message.js +8 -0
- package/dist/inbound-provider-imap/reconnect-mailbox.js +5 -4
- package/dist/inbound-provider-imap/send-mail.d.ts +2 -0
- package/dist/inbound-provider-imap/send-mail.js +32 -6
- package/dist/inbound-provider-imap/smtp-client.d.ts +9 -2
- package/dist/inbound-provider-imap/smtp-client.js +15 -3
- package/dist/inbound-provider-imap/watch-mailbox.js +3 -24
- package/dist/inbound-provider-inmemory/feature.js +1 -1
- package/dist/jobs/events.d.ts +13 -0
- package/dist/jobs/events.js +8 -0
- package/dist/jobs/feature.js +2 -0
- package/dist/jobs/handlers/consumer.write.js +31 -20
- package/dist/jobs/web/constants.d.ts +3 -0
- package/dist/jobs/web/constants.js +3 -0
- package/dist/mail-transport-inmemory/feature.js +1 -1
- package/dist/mail-transport-smtp/feature.js +3 -2
- package/dist/managed-pages/handlers/branding.query.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 -1
- package/dist/managed-pages/render-page-body.d.ts +2 -0
- package/dist/managed-pages/render-page-body.js +12 -8
- package/dist/managed-pages/screens/page-screens.d.ts +3 -2
- package/dist/managed-pages/screens/page-screens.js +14 -33
- package/dist/managed-pages/table.js +1 -0
- package/dist/managed-pages/web/client-plugin.js +8 -6
- package/dist/managed-pages/web/constants.d.ts +5 -1
- package/dist/managed-pages/web/constants.js +6 -1
- package/dist/managed-pages/web/i18n.js +11 -3
- package/dist/managed-pages/web/markdown-to-document.js +1 -1
- package/dist/managed-pages/web/page-edit-draft.d.ts +32 -0
- package/dist/managed-pages/web/page-edit-draft.js +76 -0
- package/dist/managed-pages/web/page-edit-screen.d.ts +2 -0
- package/dist/managed-pages/web/page-edit-screen.js +106 -0
- package/dist/managed-pages/web/page-settings-rail.d.ts +11 -0
- package/dist/managed-pages/web/page-settings-rail.js +14 -0
- package/dist/notes-history-user-data/index.js +8 -14
- package/dist/personal-access-tokens/boot-rules.d.ts +5 -0
- package/dist/personal-access-tokens/boot-rules.js +5 -0
- package/dist/personal-access-tokens/handlers/create.write.js +0 -1
- package/dist/personal-access-tokens/scope-events-check.js +26 -6
- package/dist/presence/handlers/list.query.js +18 -8
- package/dist/presence/room.d.ts +2 -0
- package/dist/presence/room.js +8 -5
- package/dist/presence/store.d.ts +2 -0
- package/dist/presence/store.js +62 -26
- package/dist/readiness/handlers/latest-summary.query.js +10 -6
- package/dist/readiness/handlers/run-probes.write.js +24 -4
- package/dist/readiness/handlers/run-tone.js +3 -2
- package/dist/readiness/handlers/status.query.js +11 -3
- package/dist/readiness/probe-context.js +7 -10
- package/dist/readiness/screens.js +4 -4
- package/dist/readiness/visible-results.d.ts +1 -1
- package/dist/readiness/visible-results.js +5 -2
- package/dist/renderer-foundation/api.js +6 -12
- package/dist/renderer-foundation/types.d.ts +2 -2
- package/dist/secrets/db/queries/read.d.ts +2 -1
- package/dist/secrets/db/queries/read.js +10 -1
- package/dist/secrets/handlers/list.query.js +4 -2
- package/dist/secrets/secret-scope.d.ts +0 -1
- package/dist/secrets/secret-scope.js +2 -2
- package/dist/secrets/secrets-context.js +4 -4
- package/dist/secrets/table.d.ts +1 -1
- package/dist/secrets/write-gate.js +4 -2
- package/dist/seo/handlers/seo-config.query.js +1 -1
- package/dist/shared/acknowledged-system-db.d.ts +5 -0
- package/dist/shared/acknowledged-system-db.js +9 -0
- package/dist/shared/assert-billing-live.d.ts +1 -0
- package/dist/shared/assert-billing-live.js +5 -2
- package/dist/shared/index.d.ts +6 -2
- package/dist/shared/index.js +6 -2
- package/dist/shared/parent-visibility.d.ts +1 -0
- package/dist/shared/parent-visibility.js +16 -1
- package/dist/shared/password-hashing.js +0 -1
- package/dist/shared/price-env-shape.js +1 -1
- package/dist/shared/register-user-data-hooks.d.ts +11 -0
- package/dist/shared/register-user-data-hooks.js +11 -0
- package/dist/shared/require-bootstrap-extension.d.ts +9 -0
- package/dist/shared/require-bootstrap-extension.js +16 -0
- package/dist/shared/send-best-effort.d.ts +2 -0
- package/dist/shared/send-best-effort.js +14 -0
- package/dist/shared/stream-tenant-backfill.d.ts +1 -0
- package/dist/shared/stream-tenant-backfill.js +17 -1
- package/dist/shared/stream-tenant-derived-state.d.ts +5 -1
- package/dist/shared/stream-tenant-derived-state.js +19 -2
- package/dist/step-dispatcher/constants.d.ts +4 -0
- package/dist/step-dispatcher/constants.js +11 -0
- package/dist/step-dispatcher/deliver-dispatch-request.d.ts +1 -0
- package/dist/step-dispatcher/deliver-dispatch-request.js +38 -2
- package/dist/step-dispatcher/feature.js +20 -2
- package/dist/step-dispatcher/mail-runner.js +0 -1
- package/dist/step-dispatcher/sweep-abandoned.d.ts +10 -0
- package/dist/step-dispatcher/sweep-abandoned.js +43 -0
- package/dist/subscription-mollie/plugin-methods.d.ts +1 -0
- package/dist/subscription-mollie/plugin-methods.js +1 -2
- package/dist/subscription-mollie/verify-webhook.js +5 -5
- package/dist/subscription-paddle/backfill-checkout-ledger.d.ts +9 -0
- package/dist/subscription-paddle/backfill-checkout-ledger.js +110 -0
- package/dist/subscription-paddle/checkout-config.query.js +1 -1
- package/dist/subscription-paddle/checkout-methods.js +2 -8
- package/dist/subscription-paddle/constants.d.ts +0 -1
- package/dist/subscription-paddle/constants.js +1 -2
- package/dist/subscription-paddle/feature.d.ts +0 -4
- package/dist/subscription-paddle/feature.js +21 -20
- package/dist/subscription-paddle/ledger-backfill-marker.d.ts +17 -0
- package/dist/subscription-paddle/ledger-backfill-marker.js +53 -0
- package/dist/subscription-paddle/plan-switch-methods.js +2 -8
- package/dist/subscription-paddle/redeliver-legacy-checkout.d.ts +11 -0
- package/dist/subscription-paddle/redeliver-legacy-checkout.js +26 -0
- package/dist/subscription-paddle/runtime.d.ts +3 -5
- package/dist/subscription-paddle/runtime.js +4 -7
- package/dist/subscription-paddle/subscription-state.d.ts +1 -0
- package/dist/subscription-paddle/subscription-state.js +1 -0
- package/dist/subscription-paddle/webhook-events.d.ts +4 -0
- package/dist/subscription-paddle/webhook-events.js +40 -22
- package/dist/subscription-stripe/feature.d.ts +4 -0
- package/dist/subscription-stripe/feature.js +1 -0
- package/dist/subscription-stripe/plugin-methods.d.ts +1 -0
- package/dist/subscription-stripe/plugin-methods.js +2 -5
- package/dist/subscription-stripe/runtime.d.ts +2 -1
- package/dist/subscription-stripe/runtime.js +5 -7
- package/dist/subscription-stripe/verify-webhook.js +21 -6
- package/dist/tags/aggregate-id.js +0 -1
- package/dist/tags/web/tag-chip.js +0 -1
- package/dist/tags/web/tag-manager.js +3 -1
- package/dist/template-resolver/api.js +6 -12
- package/dist/template-resolver/document-sanitizer.d.ts +1 -1
- package/dist/template-resolver/document-sanitizer.js +18 -0
- package/dist/template-resolver/feature.d.ts +1 -0
- package/dist/template-resolver/feature.js +2 -0
- package/dist/template-resolver/handlers/body-preview.query.d.ts +11 -0
- package/dist/template-resolver/handlers/body-preview.query.js +41 -0
- package/dist/template-resolver/handlers/by-slug.query.js +1 -1
- package/dist/template-resolver/handlers/by-tenant.query.js +1 -1
- package/dist/template-resolver/handlers/collection-shared.js +5 -8
- package/dist/template-resolver/handlers/overview.query.d.ts +1 -0
- package/dist/template-resolver/handlers/overview.query.js +2 -1
- package/dist/template-resolver/handlers/send-test.write.js +27 -8
- package/dist/template-resolver/linked-resources.js +2 -6
- package/dist/template-resolver/seeding.js +67 -1
- package/dist/template-resolver/table.js +1 -0
- package/dist/template-resolver/template-draft.js +2 -1
- package/dist/template-resolver/template-preview.js +12 -3
- package/dist/template-resolver/testing.js +0 -2
- package/dist/template-resolver/web/client-plugin.js +3 -0
- package/dist/template-resolver/web/collection-entry-create-form.js +19 -9
- package/dist/template-resolver/web/constants.d.ts +2 -0
- package/dist/template-resolver/web/constants.js +2 -0
- package/dist/template-resolver/web/content-tree-provider.js +0 -1
- package/dist/template-resolver/web/content-workbench.d.ts +22 -0
- package/dist/template-resolver/web/content-workbench.js +32 -0
- package/dist/template-resolver/web/document-insert-model.d.ts +2 -4
- package/dist/template-resolver/web/document-insert-model.js +1 -2
- package/dist/template-resolver/web/document-link-policy.d.ts +3 -0
- package/dist/template-resolver/web/document-link-policy.js +53 -0
- package/dist/template-resolver/web/document-schema.d.ts +2 -4
- package/dist/template-resolver/web/document-schema.js +2 -53
- package/dist/template-resolver/web/document-tiptap-context.d.ts +2 -5
- package/dist/template-resolver/web/document-tiptap-context.js +2 -2
- package/dist/template-resolver/web/document-tiptap-editor.js +2 -2
- package/dist/template-resolver/web/document-tiptap-helpers.d.ts +7 -4
- package/dist/template-resolver/web/document-tiptap-toolbar-groups.js +3 -3
- package/dist/template-resolver/web/editor-handle.js +1 -0
- package/dist/template-resolver/web/fill-document-variables.d.ts +1 -0
- package/dist/template-resolver/web/fill-document-variables.js +22 -0
- package/dist/template-resolver/web/i18n.js +10 -0
- package/dist/template-resolver/web/index.d.ts +3 -0
- package/dist/template-resolver/web/index.js +2 -0
- package/dist/template-resolver/web/preview-targets.d.ts +5 -0
- package/dist/template-resolver/web/preview-targets.js +21 -0
- package/dist/template-resolver/web/qualified-names.d.ts +1 -0
- package/dist/template-resolver/web/qualified-names.js +1 -0
- package/dist/template-resolver/web/snippet-preview-renderer.d.ts +2 -0
- package/dist/template-resolver/web/snippet-preview-renderer.js +15 -0
- package/dist/template-resolver/web/string-values.d.ts +1 -0
- package/dist/template-resolver/web/string-values.js +8 -0
- package/dist/template-resolver/web/text-block-editor.js +18 -11
- package/dist/template-resolver/web/use-collection-entry-create.d.ts +1 -0
- package/dist/template-resolver/web/use-collection-entry-create.js +6 -0
- package/dist/template-resolver/web/use-document-tiptap-model.d.ts +2 -6
- package/dist/template-resolver/web/use-text-block-editor.d.ts +3 -0
- package/dist/template-resolver/web/use-text-block-editor.js +26 -5
- package/dist/template-resolver/web/web-preview-renderer.d.ts +12 -0
- package/dist/template-resolver/web/web-preview-renderer.js +41 -0
- package/dist/template-resolver-user-data/index.js +11 -10
- package/dist/tenant/handlers/create.write.js +3 -7
- package/dist/tenant/handlers/list.query.js +3 -8
- package/dist/tenant/handlers/member-directory.query.js +10 -5
- package/dist/tenant/handlers/toggle-enabled.write.js +1 -1
- package/dist/tenant/invited-membership.js +9 -1
- package/dist/tenant/seeding.d.ts +3 -0
- package/dist/tenant/seeding.js +3 -1
- package/dist/tenant/stream-tenant-backfill.js +5 -1
- package/dist/tenant/testing.js +1 -1
- package/dist/tenant-inactivity/check-inactive-tenants.js +5 -5
- package/dist/tenant-inactivity/constants.js +1 -2
- package/dist/tenant-inactivity/handlers/keep-account.write.js +1 -2
- package/dist/tenant-inactivity/state-store.d.ts +1 -0
- package/dist/tenant-inactivity/state-store.js +9 -1
- package/dist/tenant-lifecycle/constants.d.ts +1 -0
- package/dist/tenant-lifecycle/constants.js +3 -0
- package/dist/tenant-lifecycle/run-tenant-destroy.js +38 -5
- package/dist/tenant-lifecycle/stages.js +14 -2
- package/dist/tier-engine/aggregate-id.js +0 -1
- package/dist/tier-engine/feature.js +9 -2
- package/dist/user/db/queries/stream-tenant-backfill.js +2 -1
- package/dist/user/handlers/me.query.js +4 -1
- package/dist/user/index.d.ts +1 -0
- package/dist/user/index.js +1 -0
- package/dist/user/resolve-verified-user-email.d.ts +2 -0
- package/dist/user/resolve-verified-user-email.js +14 -0
- package/dist/user-data-rights/db/queries/export-jobs.js +0 -1
- package/dist/user-data-rights/handlers/confirm-deletion-by-token.write.js +1 -1
- package/dist/user-data-rights/handlers/download-by-token.query.js +1 -1
- package/dist/user-data-rights/handlers/request-deletion-by-email.write.js +1 -1
- package/dist/user-data-rights/run-export-jobs.js +0 -2
- package/dist/user-data-rights/run-forget-cleanup.js +2 -2
- package/dist/user-data-rights/schema/download-attempt.js +3 -2
- package/dist/user-data-rights/web/confirm-deletion-screen.js +2 -2
- package/dist/user-data-rights/web/privacy-center-screen.js +1 -1
- package/dist/user-data-rights/web/request-deletion-screen.js +2 -2
- package/dist/user-data-rights-defaults/hooks/api-token.userdata-hook.js +5 -6
- package/dist/user-data-rights-defaults/hooks/hard-delete-own-rows-hook.d.ts +7 -0
- package/dist/user-data-rights-defaults/hooks/hard-delete-own-rows-hook.js +11 -0
- package/dist/user-data-rights-defaults/hooks/in-app-message.userdata-hook.js +5 -6
- package/dist/user-data-rights-defaults/hooks/job-run.userdata-hook.js +2 -1
- package/dist/user-data-rights-defaults/hooks/user-session.userdata-hook.js +5 -6
- package/dist/user-profile/handlers/change-email.write.js +0 -1
- package/dist/waitlist/handlers/submit.write.js +5 -18
- package/dist/waitlist/lib.js +2 -7
- package/dist/waitlist/user-data-hooks.js +6 -20
- package/dist/workflow-runner/aggregate-id.js +0 -1
- package/dist/workflow-runner/event-trigger.js +6 -2
- package/dist/workflow-runner/feature.js +1 -5
- package/dist/workflow-runner/handlers/resume-run.write.js +4 -3
- package/dist/workflow-runner/runner.d.ts +1 -0
- package/package.json +35 -11
- package/src/admin-shell/changes.json +6 -0
- package/src/agent-tools/changes.json +12 -0
- package/src/auth-email-password/changes.json +18 -0
- package/src/billing-foundation/changes.json +37 -0
- package/src/cap-counter/changes.json +6 -0
- package/src/cap-overview/changes.json +6 -0
- package/src/channel-in-app/changes.json +6 -0
- package/src/channel-whatsapp/changes.json +8 -0
- package/src/config/changes.json +12 -0
- package/src/crypto-shredding/changes.json +18 -0
- package/src/data-retention/changes.json +12 -0
- package/src/delivery/changes.json +6 -0
- package/src/documents/changes.json +18 -0
- package/src/file-provider-s3/changes.json +14 -0
- package/src/files/changes.json +7 -0
- package/src/helpdesk/changes.json +50 -0
- package/src/inbound-mail-foundation/changes.json +48 -0
- package/src/inbound-provider-imap/changes.json +13 -0
- package/src/mail-foundation/changes.json +6 -0
- package/src/managed-pages/changes.json +12 -0
- package/src/presence/changes.json +6 -0
- package/src/readiness/changes.json +25 -0
- package/src/secrets/changes.json +7 -0
- package/src/shared/changes.json +6 -0
- package/src/step-dispatcher/changes.json +12 -0
- package/src/subscription-mollie/changes.json +7 -0
- package/src/subscription-paddle/changes.json +13 -0
- package/src/subscription-stripe/changes.json +7 -0
- package/src/template-resolver/changes.json +36 -0
- package/src/tenant/changes.json +6 -0
- package/src/tenant-lifecycle/changes.json +18 -0
- package/src/tier-engine/changes.json +6 -0
- package/src/user/changes.json +6 -0
- package/src/waitlist/changes.json +6 -0
- package/dist/managed-pages/web/page-body-section.d.ts +0 -3
- package/dist/managed-pages/web/page-body-section.js +0 -40
- package/dist/subscription-paddle/tenant-binding.d.ts +0 -8
- package/dist/subscription-paddle/tenant-binding.js +0 -26
- package/dist/template-resolver/web/content-field.d.ts +0 -9
- package/dist/template-resolver/web/content-field.js +0 -14
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { jsx as _jsx, jsxs as _jsxs } from "react/jsx-runtime";
|
|
2
|
+
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
3
|
+
import { RailField, RailRow, RailSection } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
|
+
export function PageSettingsFields({ draft, onPatch: patch, testId, }) {
|
|
5
|
+
const t = useTranslation();
|
|
6
|
+
const { Field, Input } = usePrimitives();
|
|
7
|
+
return (_jsx(RailSection, { title: t("managed-pages:editor.railPage"), testId: testId, children: _jsxs(RailField, { children: [_jsx(Field, { id: "page-slug", label: t("managed-pages:entity:page:field:slug"), required: true, children: _jsx(Input, { kind: "text", id: "page-slug", name: "slug", value: draft.slug, onChange: (slug) => patch({ slug }), required: true }) }), _jsx(Field, { id: "page-lang", label: t("managed-pages:entity:page:field:lang"), required: true, children: _jsx(Input, { kind: "text", id: "page-lang", name: "lang", value: draft.lang, onChange: (lang) => patch({ lang }), required: true }) }), _jsx(Field, { id: "page-title", label: t("managed-pages:entity:page:field:title"), required: true, children: _jsx(Input, { kind: "text", id: "page-title", name: "title", value: draft.title, onChange: (next) => patch({ title: next }), required: true }) }), _jsx(Field, { id: "page-description", label: t("managed-pages:entity:page:field:description"), children: _jsx(Input, { kind: "textarea", id: "page-description", name: "description", rows: 3, value: draft.description, onChange: (description) => patch({ description }) }) }), _jsx(Field, { id: "page-og-image", label: t("managed-pages:entity:page:field:ogImage"), children: _jsx(Input, { kind: "text", id: "page-og-image", name: "ogImage", value: draft.ogImage, onChange: (ogImage) => patch({ ogImage }) }) }), _jsx(Field, { id: "page-published", label: t("managed-pages:entity:page:field:published"), children: _jsx(Input, { kind: "boolean", id: "page-published", name: "published", value: draft.published, onChange: (published) => patch({ published }) }) })] }) }));
|
|
8
|
+
}
|
|
9
|
+
export function PageSettingsSummary({ draft, testId, }) {
|
|
10
|
+
const t = useTranslation();
|
|
11
|
+
const missing = t("managed-pages:editor.noValue");
|
|
12
|
+
const publishedLabel = t(`managed-pages:entity:page:field:published:option:${draft.published ? "true" : "false"}`);
|
|
13
|
+
return (_jsxs(RailSection, { title: t("managed-pages:editor.railPage"), testId: testId, children: [_jsx(RailRow, { label: t("managed-pages:entity:page:field:slug"), trailing: draft.slug === "" ? missing : `/${draft.slug}` }), _jsx(RailRow, { label: t("managed-pages:entity:page:field:lang"), trailing: draft.lang }), _jsx(RailRow, { label: t("managed-pages:entity:page:field:title"), trailing: draft.title === "" ? missing : draft.title }), _jsx(RailRow, { label: t("managed-pages:entity:page:field:description"), trailing: draft.description === "" ? missing : draft.description }), _jsx(RailRow, { label: t("managed-pages:entity:page:field:ogImage"), trailing: draft.ogImage === "" ? missing : draft.ogImage }), _jsx(RailRow, { label: t("managed-pages:entity:page:field:published"), trailing: publishedLabel })] }));
|
|
14
|
+
}
|
|
@@ -4,25 +4,19 @@
|
|
|
4
4
|
// GDPR export/forget pipeline. Kept separate from notes-history (which only
|
|
5
5
|
// requires nothing) so notes-history stays usable without the
|
|
6
6
|
// user-data-rights stack. Mirrors folders-user-data.
|
|
7
|
-
import { defineFeature
|
|
7
|
+
import { defineFeature } from "@cosmicdrift/kumiko-framework/engine";
|
|
8
|
+
import { registerUserDataHooks } from "../shared/index.js";
|
|
8
9
|
import { noteEntryDeleteHook, noteEntryExportHook, noteMentionDeleteHook, noteMentionExportHook, } from "./hooks.js";
|
|
9
10
|
export { eraseNoteBodiesReachingSubject } from "./hooks.js";
|
|
10
11
|
export function createNotesHistoryUserDataFeature() {
|
|
11
12
|
return defineFeature("notes-history-user-data", (r) => {
|
|
12
13
|
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
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
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,
|
|
14
|
+
registerUserDataHooks(r, {
|
|
15
|
+
sourceFeature: "notes-history",
|
|
16
|
+
entities: [
|
|
17
|
+
{ entity: "note-entry", export: noteEntryExportHook, delete: noteEntryDeleteHook },
|
|
18
|
+
{ entity: "note-mention", export: noteMentionExportHook, delete: noteMentionDeleteHook },
|
|
19
|
+
],
|
|
26
20
|
});
|
|
27
21
|
}, { dedupeOptions: {} });
|
|
28
22
|
}
|
|
@@ -4,4 +4,9 @@ export declare const PERSONAL_ACCESS_TOKENS_BOOT_RULES: {
|
|
|
4
4
|
readonly summary: "Events listed in PAT scopes have a public webhook contract.";
|
|
5
5
|
readonly fix: "Declare the event with r.defineWebhookEvent or opt the entity into webhookEvents.";
|
|
6
6
|
};
|
|
7
|
+
readonly releasedWireNameCollision: {
|
|
8
|
+
readonly id: "personal-access-tokens/released-wire-name-collision";
|
|
9
|
+
readonly summary: "Webhook events released through PAT scopes have unique wire names.";
|
|
10
|
+
readonly fix: "Give one of the colliding events another wireName in r.defineWebhookEvent.";
|
|
11
|
+
};
|
|
7
12
|
};
|
|
@@ -4,4 +4,9 @@ export const PERSONAL_ACCESS_TOKENS_BOOT_RULES = {
|
|
|
4
4
|
summary: "Events listed in PAT scopes have a public webhook contract.",
|
|
5
5
|
fix: "Declare the event with r.defineWebhookEvent or opt the entity into webhookEvents.",
|
|
6
6
|
},
|
|
7
|
+
releasedWireNameCollision: {
|
|
8
|
+
id: "personal-access-tokens/released-wire-name-collision",
|
|
9
|
+
summary: "Webhook events released through PAT scopes have unique wire names.",
|
|
10
|
+
fix: "Give one of the colliding events another wireName in r.defineWebhookEvent.",
|
|
11
|
+
},
|
|
7
12
|
};
|
|
@@ -8,7 +8,6 @@ import { UserQueries } from "../../user/index.js";
|
|
|
8
8
|
import { mintPatToken } from "../hash.js";
|
|
9
9
|
import { apiTokenEntity, apiTokenTable } from "../schema/api-token.js";
|
|
10
10
|
import { API_TOKEN_ENTITY_NAME, PAT_DEFAULT_EXPIRES_IN_DAYS, PAT_MAX_EXPIRES_IN_DAYS, PatErrors, } from "../web/constants.js";
|
|
11
|
-
// @wrapper-known error-helper
|
|
12
11
|
function reauthFailed() {
|
|
13
12
|
return unprocessable(PatErrors.reauthRequired, "errors.reauthRequired");
|
|
14
13
|
}
|
|
@@ -1,20 +1,40 @@
|
|
|
1
|
-
import { bootRuleError, createWebhookContractResolver, } from "@cosmicdrift/kumiko-framework/engine";
|
|
1
|
+
import { bootRuleError, createWebhookContractResolver, findEntity, WEBHOOK_ENTITY_VERBS, } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import { PERSONAL_ACCESS_TOKENS_BOOT_RULES } from "./boot-rules.js";
|
|
3
3
|
import { PAT_FEATURE } from "./web/constants.js";
|
|
4
|
-
|
|
4
|
+
// Why an event without a contract is not released: only an `<entity>.<verb>` name can be fixed by
|
|
5
|
+
// an entity opt-in, so every other shape gets no entity hint.
|
|
6
|
+
function missingContractHint(qualifiedName, featureMap) {
|
|
5
7
|
const dot = qualifiedName.lastIndexOf(".");
|
|
6
|
-
|
|
8
|
+
const verb = qualifiedName.slice(dot + 1);
|
|
9
|
+
if (dot <= 0 || !WEBHOOK_ENTITY_VERBS.some((candidate) => candidate === verb)) {
|
|
10
|
+
return "internal r.defineEvent events are never released.";
|
|
11
|
+
}
|
|
12
|
+
const entityName = qualifiedName.slice(0, dot);
|
|
13
|
+
return findEntity(featureMap, entityName) === undefined
|
|
14
|
+
? `there is no entity "${entityName}".`
|
|
15
|
+
: `entity "${entityName}" has no such opt-in.`;
|
|
7
16
|
}
|
|
8
17
|
export function validateScopeEventContracts(scopes, features) {
|
|
9
18
|
const resolver = createWebhookContractResolver(features);
|
|
19
|
+
const featureMap = new Map(features.map((feature) => [feature.name, feature]));
|
|
20
|
+
const qnByWireName = new Map();
|
|
10
21
|
for (const [domain, def] of Object.entries(scopes)) {
|
|
11
22
|
for (const qn of def.events ?? []) {
|
|
12
|
-
|
|
23
|
+
const contract = resolver.get(qn);
|
|
24
|
+
if (contract) {
|
|
25
|
+
const existing = qnByWireName.get(contract.wireName);
|
|
26
|
+
if (existing !== undefined && existing !== contract.qn) {
|
|
27
|
+
throw bootRuleError(PERSONAL_ACCESS_TOKENS_BOOT_RULES.releasedWireNameCollision, {
|
|
28
|
+
message: `[${PAT_FEATURE}] released webhook wire name "${contract.wireName}" is used by both "${existing}" and "${contract.qn}"; receivers tell events apart by wire name, give one of them another wireName.`,
|
|
29
|
+
});
|
|
30
|
+
}
|
|
31
|
+
qnByWireName.set(contract.wireName, contract.qn);
|
|
13
32
|
continue;
|
|
33
|
+
}
|
|
14
34
|
throw bootRuleError(PERSONAL_ACCESS_TOKENS_BOOT_RULES.scopeEventWithoutContract, {
|
|
15
35
|
message: `[${PAT_FEATURE}] scope "${domain}" lists event "${qn}" without a public contract. ` +
|
|
16
|
-
"Declare it with r.defineWebhookEvent(...), or set webhookEvents: true on the entity to release its <entity>.created/.updated/.deleted events " +
|
|
17
|
-
|
|
36
|
+
"Declare it with r.defineWebhookEvent(...), or set webhookEvents: true on the entity to release its <entity>.created/.updated/.deleted events; " +
|
|
37
|
+
missingContractHint(qn, featureMap),
|
|
18
38
|
});
|
|
19
39
|
}
|
|
20
40
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import { visibleParentRowIds } from "../../shared/index.js";
|
|
2
3
|
import { ListSchema } from "../payloads.js";
|
|
3
|
-
import {
|
|
4
|
+
import { displayNamesOf, entriesWithNames, othersOf, roomKey, storeFor, } from "../room.js";
|
|
4
5
|
export function createListQuery(runtime, access) {
|
|
5
6
|
return defineQueryHandler({
|
|
6
7
|
name: "list",
|
|
@@ -14,14 +15,23 @@ export function createListQuery(runtime, access) {
|
|
|
14
15
|
return { byId: {} };
|
|
15
16
|
const store = storeFor(runtime, ctx);
|
|
16
17
|
const nowMs = ctx.tz.now().epochMilliseconds;
|
|
18
|
+
const uniqueIds = [...new Set(ids)];
|
|
19
|
+
const rooms = await store.listMany(uniqueIds.map((id) => roomKey(ctx, entity, id)), nowMs, runtime.settings.ttlMs);
|
|
20
|
+
const othersById = new Map();
|
|
21
|
+
uniqueIds.forEach((id, index) => {
|
|
22
|
+
const others = othersOf(rooms[index] ?? [], event.user.id);
|
|
23
|
+
if (others.length > 0)
|
|
24
|
+
othersById.set(id, others);
|
|
25
|
+
});
|
|
26
|
+
// Visibility is checked only where someone is present, so an empty row costs no lookup.
|
|
27
|
+
const visibleIds = await visibleParentRowIds(ctx.registry, entity, [...othersById.keys()], event.user, ctx.db);
|
|
28
|
+
const visibleOthers = [...othersById].filter(([id]) => visibleIds.has(id));
|
|
29
|
+
const names = await displayNamesOf(ctx, [
|
|
30
|
+
...new Set(visibleOthers.flatMap(([, others]) => others.map((other) => other.userId))),
|
|
31
|
+
]);
|
|
17
32
|
const byId = {};
|
|
18
|
-
for (const id of
|
|
19
|
-
|
|
20
|
-
// Visibility is checked only where someone is present, so an empty row costs no lookup.
|
|
21
|
-
if (others.length === 0 || !(await canUseRoom(runtime, ctx, entity, id)))
|
|
22
|
-
continue;
|
|
23
|
-
byId[id] = await toEntries(ctx, others);
|
|
24
|
-
}
|
|
33
|
+
for (const [id, others] of visibleOthers)
|
|
34
|
+
byId[id] = entriesWithNames(others, names);
|
|
25
35
|
return { byId };
|
|
26
36
|
},
|
|
27
37
|
});
|
package/dist/presence/room.d.ts
CHANGED
|
@@ -10,4 +10,6 @@ export declare function storeFor(runtime: PresenceRuntime, ctx: HandlerContext):
|
|
|
10
10
|
export declare function roomKey(ctx: HandlerContext, entity: string, id: string): string;
|
|
11
11
|
export declare function canUseRoom(runtime: PresenceRuntime, ctx: HandlerContext, entity: string, id: string): Promise<boolean>;
|
|
12
12
|
export declare function othersOf(records: readonly PresenceRecord[], userId: string): readonly PresenceRecord[];
|
|
13
|
+
export declare function displayNamesOf(ctx: HandlerContext, userIds: readonly string[]): Promise<ReadonlyMap<string, string>>;
|
|
13
14
|
export declare function toEntries(ctx: HandlerContext, records: readonly PresenceRecord[]): Promise<readonly PresenceEntry[]>;
|
|
15
|
+
export declare function entriesWithNames(records: readonly PresenceRecord[], names: ReadonlyMap<string, string>): readonly PresenceEntry[];
|
package/dist/presence/room.js
CHANGED
|
@@ -19,12 +19,15 @@ export function othersOf(records, userId) {
|
|
|
19
19
|
return records.filter((record) => record.userId !== userId);
|
|
20
20
|
}
|
|
21
21
|
// Names are looked up per response and never stored, so an erased user leaves no name behind.
|
|
22
|
+
export async function displayNamesOf(ctx, userIds) {
|
|
23
|
+
if (userIds.length === 0 || !ctx.registry.getFeature(USER_FEATURE))
|
|
24
|
+
return new Map();
|
|
25
|
+
return resolveUserDisplayNames(ctx.db, userIds);
|
|
26
|
+
}
|
|
22
27
|
export async function toEntries(ctx, records) {
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
|
|
26
|
-
? await resolveUserDisplayNames(ctx.db, records.map((record) => record.userId))
|
|
27
|
-
: new Map();
|
|
28
|
+
return entriesWithNames(records, await displayNamesOf(ctx, records.map((record) => record.userId)));
|
|
29
|
+
}
|
|
30
|
+
export function entriesWithNames(records, names) {
|
|
28
31
|
return records.map((record) => ({
|
|
29
32
|
userId: record.userId,
|
|
30
33
|
displayName: names.get(record.userId) ?? record.userId,
|
package/dist/presence/store.d.ts
CHANGED
|
@@ -22,6 +22,8 @@ export type PresenceStore = {
|
|
|
22
22
|
}>;
|
|
23
23
|
/** Live entries only; expired ones are dropped on read. */
|
|
24
24
|
list(key: string, nowMs: number, ttlMs: number): Promise<readonly PresenceRecord[]>;
|
|
25
|
+
/** `list` for many rooms in one round trip; result order follows `keys`. */
|
|
26
|
+
listMany(keys: readonly string[], nowMs: number, ttlMs: number): Promise<readonly (readonly PresenceRecord[])[]>;
|
|
25
27
|
};
|
|
26
28
|
export declare function presenceKey(tenantId: string, entity: string, id: string): string;
|
|
27
29
|
export type MemoryPresenceStore = PresenceStore & {
|
package/dist/presence/store.js
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
1
2
|
import * as z from "zod";
|
|
2
3
|
export function presenceKey(tenantId, entity, id) {
|
|
3
4
|
return `presence:${tenantId}:${entity}:${id}`;
|
|
@@ -37,8 +38,22 @@ export function createMemoryPresenceStore() {
|
|
|
37
38
|
rooms.delete(key);
|
|
38
39
|
}
|
|
39
40
|
}
|
|
41
|
+
async function list(key, nowMs, ttlMs) {
|
|
42
|
+
const room = rooms.get(key);
|
|
43
|
+
if (!room)
|
|
44
|
+
return [];
|
|
45
|
+
for (const [userId, record] of room) {
|
|
46
|
+
if (isExpired(record, nowMs, ttlMs))
|
|
47
|
+
room.delete(userId);
|
|
48
|
+
}
|
|
49
|
+
if (room.size === 0)
|
|
50
|
+
rooms.delete(key);
|
|
51
|
+
return [...room.values()];
|
|
52
|
+
}
|
|
40
53
|
return {
|
|
41
54
|
roomCount: () => rooms.size,
|
|
55
|
+
list,
|
|
56
|
+
listMany: (keys, nowMs, ttlMs) => Promise.all(keys.map((key) => list(key, nowMs, ttlMs))),
|
|
42
57
|
async touch(key, userId, state, nowMs, ttlMs) {
|
|
43
58
|
sweepExpired(nowMs, ttlMs);
|
|
44
59
|
const room = rooms.get(key) ?? new Map();
|
|
@@ -55,18 +70,6 @@ export function createMemoryPresenceStore() {
|
|
|
55
70
|
rooms.delete(key);
|
|
56
71
|
return { existed };
|
|
57
72
|
},
|
|
58
|
-
async list(key, nowMs, ttlMs) {
|
|
59
|
-
const room = rooms.get(key);
|
|
60
|
-
if (!room)
|
|
61
|
-
return [];
|
|
62
|
-
for (const [userId, record] of room) {
|
|
63
|
-
if (isExpired(record, nowMs, ttlMs))
|
|
64
|
-
room.delete(userId);
|
|
65
|
-
}
|
|
66
|
-
if (room.size === 0)
|
|
67
|
-
rooms.delete(key);
|
|
68
|
-
return [...room.values()];
|
|
69
|
-
},
|
|
70
73
|
};
|
|
71
74
|
}
|
|
72
75
|
const KEY_TTL_FACTOR = 2;
|
|
@@ -121,20 +124,53 @@ export function createRedisPresenceStore(redis, log) {
|
|
|
121
124
|
return { changed: previous === undefined || !sameState(previous, state) };
|
|
122
125
|
}),
|
|
123
126
|
remove: (key, userId) => guarded({ existed: false }, async () => ({ existed: (await redis.hdel(key, userId)) > 0 })),
|
|
124
|
-
list: (key, nowMs, ttlMs) => guarded([], async () =>
|
|
125
|
-
|
|
126
|
-
|
|
127
|
-
|
|
128
|
-
|
|
129
|
-
|
|
130
|
-
|
|
131
|
-
|
|
132
|
-
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
|
|
136
|
-
|
|
137
|
-
|
|
127
|
+
list: (key, nowMs, ttlMs) => guarded([], async () => liveRecordsOf(key, await redis.hgetall(key), nowMs, ttlMs)),
|
|
128
|
+
listMany: (keys, nowMs, ttlMs) => guarded(keys.map(() => []), async () => {
|
|
129
|
+
if (keys.length === 0)
|
|
130
|
+
return [];
|
|
131
|
+
const pipeline = redis.pipeline();
|
|
132
|
+
for (const key of keys)
|
|
133
|
+
pipeline.hgetall(key);
|
|
134
|
+
const replies = (await pipeline.exec()) ?? [];
|
|
135
|
+
return Promise.all(keys.map(async (key, index) => {
|
|
136
|
+
const [error, all] = replies[index] ?? [new Error("missing pipeline reply"), null];
|
|
137
|
+
if (error)
|
|
138
|
+
throw error;
|
|
139
|
+
return liveRecordsOf(key, hashOf(all), nowMs, ttlMs);
|
|
140
|
+
}));
|
|
138
141
|
}),
|
|
139
142
|
};
|
|
143
|
+
// Expired fields are removed only while they still hold the value that was read: a touch landing
|
|
144
|
+
// between the read and the removal must survive.
|
|
145
|
+
async function liveRecordsOf(key, all, nowMs, ttlMs) {
|
|
146
|
+
const live = [];
|
|
147
|
+
const staleArgs = [];
|
|
148
|
+
for (const [userId, raw] of Object.entries(all)) {
|
|
149
|
+
const record = parseRecord(userId, raw);
|
|
150
|
+
if (record && !isExpired(record, nowMs, ttlMs))
|
|
151
|
+
live.push(record);
|
|
152
|
+
else
|
|
153
|
+
staleArgs.push(userId, raw);
|
|
154
|
+
}
|
|
155
|
+
if (staleArgs.length > 0)
|
|
156
|
+
await redis.eval(DROP_FIELDS_IF_UNCHANGED, 1, key, ...staleArgs);
|
|
157
|
+
return live;
|
|
158
|
+
}
|
|
159
|
+
}
|
|
160
|
+
const DROP_FIELDS_IF_UNCHANGED = `
|
|
161
|
+
for i = 1, #ARGV, 2 do
|
|
162
|
+
if redis.call('HGET', KEYS[1], ARGV[i]) == ARGV[i + 1] then
|
|
163
|
+
redis.call('HDEL', KEYS[1], ARGV[i])
|
|
164
|
+
end
|
|
165
|
+
end
|
|
166
|
+
return 0`;
|
|
167
|
+
function hashOf(value) {
|
|
168
|
+
const hash = {};
|
|
169
|
+
if (!isPlainObject(value))
|
|
170
|
+
return hash;
|
|
171
|
+
for (const [field, raw] of Object.entries(value)) {
|
|
172
|
+
if (typeof raw === "string")
|
|
173
|
+
hash[field] = raw;
|
|
174
|
+
}
|
|
175
|
+
return hash;
|
|
140
176
|
}
|
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
3
|
import { hasPaidProbes } from "../collect-probes.js";
|
|
4
|
+
import { RUN_OUTCOME } from "../constants.js";
|
|
4
5
|
import { fetchLatestRun, viewRun } from "../run-view.js";
|
|
5
6
|
import { countResults } from "../visible-results.js";
|
|
6
7
|
import { toneOf } from "./run-tone.js";
|
|
@@ -11,12 +12,15 @@ export const latestSummaryQuery = defineQueryHandler({
|
|
|
11
12
|
name: "probe-run:latest-summary",
|
|
12
13
|
schema: z.object({}),
|
|
13
14
|
access: { roles: ["TenantAdmin", "SystemAdmin"] },
|
|
14
|
-
description: "Returns the one-line summary of the tenant's latest system-check run (when it started, how many of the checks the caller may see passed, a tone and a ready-made translatable text) and whether the caller
|
|
15
|
+
description: "Returns the one-line summary of the tenant's latest system-check run (when it started, how many of the checks the caller may see passed, a tone and a ready-made translatable text) and whether the caller may start a run with paid probes (SystemAdmins only). Zero counts and runId null when no run exists yet.",
|
|
15
16
|
handler: async (query, ctx) => {
|
|
16
|
-
const
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
17
|
+
const isSystemAdmin = query.user.roles.includes("SystemAdmin");
|
|
18
|
+
// Only a SystemAdmin may start a paid run, so only they are offered the button.
|
|
19
|
+
const paid = isSystemAdmin &&
|
|
20
|
+
hasPaidProbes(ctx.registry, {
|
|
21
|
+
includeSystemProbes: true,
|
|
22
|
+
enabledFeatures: ctx.services.effectiveFeatures?.(query.user.tenantId),
|
|
23
|
+
});
|
|
20
24
|
const latest = await fetchLatestRun(ctx.db);
|
|
21
25
|
if (!latest) {
|
|
22
26
|
return {
|
|
@@ -38,7 +42,7 @@ export const latestSummaryQuery = defineQueryHandler({
|
|
|
38
42
|
...counts,
|
|
39
43
|
outcome,
|
|
40
44
|
tone: toneOf(outcome),
|
|
41
|
-
text: outcome ===
|
|
45
|
+
text: outcome === RUN_OUTCOME.running
|
|
42
46
|
? { i18nKey: SUMMARY_RUNNING_TEXT_KEY }
|
|
43
47
|
: {
|
|
44
48
|
i18nKey: SUMMARY_TEXT_KEY,
|
|
@@ -4,15 +4,23 @@
|
|
|
4
4
|
// (ACTIVE_PROBE_RUN_CONSTRAINT) catches a click that slips in between check and create (23505).
|
|
5
5
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
6
6
|
import { defineWriteHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import { InternalError } from "@cosmicdrift/kumiko-framework/errors";
|
|
7
|
+
import { AccessDeniedError, FrameworkReasons, InternalError, } from "@cosmicdrift/kumiko-framework/errors";
|
|
8
8
|
import { propertyOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
9
9
|
import * as z from "zod";
|
|
10
10
|
import { staleRunAfterMs } from "../collect-probes.js";
|
|
11
|
+
import { ReadinessWrites } from "../constants.js";
|
|
11
12
|
import { ACTIVE_PROBE_RUN_CONSTRAINT, PROBE_RUN_STATUS, probeRunEntity, probeRunsTable, } from "../schema/probe-run.js";
|
|
12
13
|
const crud = createEventStoreExecutor(probeRunsTable, probeRunEntity, {
|
|
13
14
|
entityName: "probe-run",
|
|
14
15
|
});
|
|
16
|
+
// The single-active-run lock only bounds concurrency; each run sends a real mail and logs in to every mailbox.
|
|
17
|
+
const RUN_PROBES_RATE_LIMIT = { per: "user+handler", limit: 10, windowSeconds: 3600 };
|
|
15
18
|
const ACTIVE_STATUSES = [PROBE_RUN_STATUS.Pending, PROBE_RUN_STATUS.Running];
|
|
19
|
+
// A queued run may wait on the worker lane for long; only a running one is judged by when it started.
|
|
20
|
+
function lastLifeSignMs(run) {
|
|
21
|
+
const anchor = run.status === PROBE_RUN_STATUS.Running ? (run.startedAt ?? run.requestedAt) : run.requestedAt;
|
|
22
|
+
return anchor.epochMilliseconds;
|
|
23
|
+
}
|
|
16
24
|
function isActiveRunConflict(failure) {
|
|
17
25
|
return (failure.error.code === "unique_violation" &&
|
|
18
26
|
propertyOf(failure.error.details, "constraintName") === ACTIVE_PROBE_RUN_CONSTRAINT);
|
|
@@ -21,18 +29,30 @@ export const runProbesWrite = defineWriteHandler({
|
|
|
21
29
|
name: "run-probes",
|
|
22
30
|
schema: z.object({ includePaid: z.boolean().default(false) }),
|
|
23
31
|
access: { roles: ["TenantAdmin", "SystemAdmin"] },
|
|
24
|
-
|
|
32
|
+
rateLimit: RUN_PROBES_RATE_LIMIT,
|
|
33
|
+
description: "Starts the system check: real calls against mail, storage, search, inbound mailboxes and PDF that show what works in this environment. Returns the run id (isExisting true while a run is still active); the worker fills the run, read the outcome via readiness:query:probe-run:latest-results. Paid probes only run with includePaid true, which only a SystemAdmin can set; includePaid true from a TenantAdmin is rejected with access_denied.",
|
|
25
34
|
handler: async (event, ctx) => {
|
|
26
35
|
if (!ctx.services.jobRunner) {
|
|
27
36
|
throw new InternalError({
|
|
28
37
|
message: "readiness:run-probes needs a job runner; mount the jobs infrastructure",
|
|
29
38
|
});
|
|
30
39
|
}
|
|
40
|
+
const isSystemAdmin = event.user.roles.includes("SystemAdmin");
|
|
41
|
+
if (event.payload.includePaid && !isSystemAdmin) {
|
|
42
|
+
throw new AccessDeniedError({
|
|
43
|
+
message: "readiness:run-probes: includePaid is reserved for SystemAdmins",
|
|
44
|
+
details: {
|
|
45
|
+
reason: FrameworkReasons.fieldAccessDenied,
|
|
46
|
+
handler: ReadinessWrites.runProbes,
|
|
47
|
+
field: "includePaid",
|
|
48
|
+
},
|
|
49
|
+
});
|
|
50
|
+
}
|
|
31
51
|
const findActive = () => ctx.db.fetchOne(probeRunsTable, { status: ACTIVE_STATUSES });
|
|
32
52
|
const nowMs = ctx.tz.now().epochMilliseconds;
|
|
33
53
|
const active = await findActive();
|
|
34
54
|
if (active) {
|
|
35
|
-
if (nowMs - active
|
|
55
|
+
if (nowMs - lastLifeSignMs(active) <= staleRunAfterMs(ctx.registry)) {
|
|
36
56
|
return { isSuccess: true, data: { runId: active.id, isExisting: true } };
|
|
37
57
|
}
|
|
38
58
|
const abandoned = await crud.update({
|
|
@@ -46,7 +66,7 @@ export const runProbesWrite = defineWriteHandler({
|
|
|
46
66
|
const created = await crud.create({
|
|
47
67
|
status: PROBE_RUN_STATUS.Pending,
|
|
48
68
|
includePaid: event.payload.includePaid,
|
|
49
|
-
includeSystemProbes:
|
|
69
|
+
includeSystemProbes: isSystemAdmin,
|
|
50
70
|
triggeredByUserId: event.user.id,
|
|
51
71
|
requestedAt: ctx.tz.now(),
|
|
52
72
|
results: { rows: [] },
|
|
@@ -1,5 +1,6 @@
|
|
|
1
|
+
import { RUN_OUTCOME } from "../constants.js";
|
|
1
2
|
export function toneOf(outcome) {
|
|
2
|
-
if (outcome ===
|
|
3
|
+
if (outcome === RUN_OUTCOME.running)
|
|
3
4
|
return "default";
|
|
4
|
-
return outcome ===
|
|
5
|
+
return outcome === RUN_OUTCOME.ok ? "positive" : "negative";
|
|
5
6
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { buildProviderSelectionGate, collectMissingRequiredConfig, } from "@cosmicdrift/kumiko-bundled-features/config";
|
|
1
|
+
import { buildProviderSelectionGate, collectMissingRequiredConfig, requireConfigResolver, } from "@cosmicdrift/kumiko-bundled-features/config";
|
|
2
2
|
import { requireSecretsContext } from "@cosmicdrift/kumiko-bundled-features/secrets";
|
|
3
3
|
import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
4
|
import * as z from "zod";
|
|
@@ -23,11 +23,19 @@ export const statusQuery = defineQueryHandler({
|
|
|
23
23
|
// readiness probe must not pollute the credential-read trail.
|
|
24
24
|
const secrets = requireSecretsContext({ secrets: ctx.services.secrets, user: ctx.user }, ReadinessQueries.status);
|
|
25
25
|
const missingSecrets = [];
|
|
26
|
+
const resolver = requireConfigResolver(ctx, ReadinessQueries.status);
|
|
26
27
|
for (const [qualifiedName, keyDef] of ctx.registry.getAllSecretKeys()) {
|
|
27
|
-
if (keyDef.required !== true)
|
|
28
|
-
continue;
|
|
29
28
|
if (!gate(qualifiedName))
|
|
30
29
|
continue;
|
|
30
|
+
if (keyDef.required !== true) {
|
|
31
|
+
const conditionKey = keyDef.requiredWhenConfigSet;
|
|
32
|
+
const conditionDef = conditionKey && ctx.registry.getConfigKey(conditionKey);
|
|
33
|
+
if (!conditionKey || !conditionDef)
|
|
34
|
+
continue;
|
|
35
|
+
const conditionValue = await resolver.get(conditionKey, conditionDef, query.user.tenantId, query.user.id, ctx.db);
|
|
36
|
+
if (typeof conditionValue !== "string" || conditionValue.trim() === "")
|
|
37
|
+
continue;
|
|
38
|
+
}
|
|
31
39
|
if (!(await secrets.has(query.user.tenantId, qualifiedName))) {
|
|
32
40
|
missingSecrets.push({ key: qualifiedName });
|
|
33
41
|
}
|
|
@@ -9,24 +9,21 @@ const triggeringUserRowSchema = z.object({
|
|
|
9
9
|
async function resolveTriggeredByEmail(ctx, tenantId, userId) {
|
|
10
10
|
if (!ctx.registry.features.has("user"))
|
|
11
11
|
return undefined;
|
|
12
|
-
|
|
12
|
+
// Probes that need the address skip themselves; neither lookup nor decrypt may take the whole run down.
|
|
13
13
|
try {
|
|
14
|
-
found = await ctx.dispatch.queryAs(createSystemUser(tenantId), UserQueries.findForAuth, {
|
|
15
|
-
|
|
16
|
-
|
|
14
|
+
const found = await ctx.dispatch.queryAs(createSystemUser(tenantId), UserQueries.findForAuth, { id: userId });
|
|
15
|
+
const row = triggeringUserRowSchema.safeParse(found);
|
|
16
|
+
if (!row.success || row.data.email === undefined || row.data.isDeleted === true) {
|
|
17
|
+
return undefined;
|
|
18
|
+
}
|
|
19
|
+
return (await decryptStoredUserEmail(row.data.email, "readiness:run-probes")) ?? undefined;
|
|
17
20
|
}
|
|
18
21
|
catch (error) {
|
|
19
|
-
// Probes that need the address skip themselves; the lookup must not take the whole run down.
|
|
20
22
|
ctx.obs.log.warn("readiness could not look up the run starter", {
|
|
21
23
|
error: error instanceof Error ? error.name : "unknown",
|
|
22
24
|
});
|
|
23
25
|
return undefined;
|
|
24
26
|
}
|
|
25
|
-
const row = triggeringUserRowSchema.safeParse(found);
|
|
26
|
-
if (!row.success || row.data.email === undefined || row.data.isDeleted === true) {
|
|
27
|
-
return undefined;
|
|
28
|
-
}
|
|
29
|
-
return (await decryptStoredUserEmail(row.data.email, "readiness:run-probes")) ?? undefined;
|
|
30
27
|
}
|
|
31
28
|
export async function buildProbeContext(ctx, run, tenantId) {
|
|
32
29
|
return {
|
|
@@ -68,6 +68,10 @@ function resultsSection(query, title, extra) {
|
|
|
68
68
|
title: ScreenTextKeys.latestEmpty,
|
|
69
69
|
// A finished run without rows had nothing the caller may see, not "no run yet".
|
|
70
70
|
variants: [
|
|
71
|
+
{
|
|
72
|
+
when: { field: "status", eq: PROBE_RUN_STATUS.Abandoned },
|
|
73
|
+
title: ScreenTextKeys.latestAbandoned,
|
|
74
|
+
},
|
|
71
75
|
{
|
|
72
76
|
when: { field: "outcome", eq: RUN_OUTCOME.running },
|
|
73
77
|
title: ScreenTextKeys.latestRunning,
|
|
@@ -76,10 +80,6 @@ function resultsSection(query, title, extra) {
|
|
|
76
80
|
when: { field: "outcome", eq: RUN_OUTCOME.ok },
|
|
77
81
|
title: ScreenTextKeys.latestNothingToCheck,
|
|
78
82
|
},
|
|
79
|
-
{
|
|
80
|
-
when: { field: "status", eq: PROBE_RUN_STATUS.Abandoned },
|
|
81
|
-
title: ScreenTextKeys.latestAbandoned,
|
|
82
|
-
},
|
|
83
83
|
],
|
|
84
84
|
},
|
|
85
85
|
...extra,
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
2
|
import * as z from "zod";
|
|
3
|
-
import
|
|
3
|
+
import { RUN_OUTCOME } from "./constants.ts";
|
|
4
4
|
declare const probeResultRowSchema: z.ZodObject<{
|
|
5
5
|
probe: z.ZodString;
|
|
6
6
|
scope: z.ZodEnum<{
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import * as z from "zod";
|
|
2
|
+
import { RUN_OUTCOME } from "./constants.js";
|
|
2
3
|
import { PROBE_RUN_STATUS } from "./schema/probe-run.js";
|
|
3
4
|
const probeTextSchema = z.object({
|
|
4
5
|
key: z.string(),
|
|
@@ -64,6 +65,8 @@ export function isRunActive(status) {
|
|
|
64
65
|
}
|
|
65
66
|
export function outcomeOf(status, counts) {
|
|
66
67
|
if (isRunActive(status))
|
|
67
|
-
return
|
|
68
|
-
return status === PROBE_RUN_STATUS.Done && counts.failedCount === 0
|
|
68
|
+
return RUN_OUTCOME.running;
|
|
69
|
+
return status === PROBE_RUN_STATUS.Done && counts.failedCount === 0
|
|
70
|
+
? RUN_OUTCOME.ok
|
|
71
|
+
: RUN_OUTCOME.failed;
|
|
69
72
|
}
|
|
@@ -2,7 +2,7 @@
|
|
|
2
2
|
// (delivery, mail sender, Solon NKA PDF generator) retrieve the appropriate
|
|
3
3
|
// plugin for each render call via `createRendererForTenant`.
|
|
4
4
|
// The pattern mirrors ai-foundation's `createLLMProviderForTenant`.
|
|
5
|
-
import {
|
|
5
|
+
import { requireBootstrapExtension } from "../shared/index.js";
|
|
6
6
|
import { DEFAULT_PLUGIN_BY_KIND } from "./constants.js";
|
|
7
7
|
import { RendererError } from "./types.js";
|
|
8
8
|
// The plugin pool is built at boot time from extension usages.
|
|
@@ -51,15 +51,9 @@ function indexByKind(plugins) {
|
|
|
51
51
|
// Single source of truth for handlers that require renderer-foundation.
|
|
52
52
|
// The pattern mirrors requireTemplateResolver + requireTextContent.
|
|
53
53
|
export function requireRendererFoundation(ctx, callerName) {
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
|
|
57
|
-
|
|
58
|
-
|
|
59
|
-
message: `[${callerName}] ctx.rendererFoundation missing — App-Bootstrap muss ` +
|
|
60
|
-
`extraContext: { rendererFoundation: createRendererFoundationApi(plugins) } setzen ` +
|
|
61
|
-
`(siehe renderer-foundation/README.md).`,
|
|
62
|
-
});
|
|
63
|
-
}
|
|
64
|
-
return api;
|
|
54
|
+
return requireBootstrapExtension(ctx, callerName, {
|
|
55
|
+
key: "rendererFoundation",
|
|
56
|
+
bootstrapExample: "rendererFoundation: createRendererFoundationApi(plugins)",
|
|
57
|
+
readme: "renderer-foundation/README.md",
|
|
58
|
+
});
|
|
65
59
|
}
|
|
@@ -147,8 +147,8 @@ export type MailChromeLink = {
|
|
|
147
147
|
readonly url: string;
|
|
148
148
|
};
|
|
149
149
|
/** The tenant's mail look with every text resolved for one locale, for pages a
|
|
150
|
-
* recipient reaches from a mail link. URLs are http(s) only, the logo https
|
|
151
|
-
* the accent color a #rrggbb hex. */
|
|
150
|
+
* recipient reaches from a mail link. URLs are http(s) only, the logo an https URL or a
|
|
151
|
+
* base64 raster data URI, the accent color a #rrggbb hex. */
|
|
152
152
|
export type MailChrome = {
|
|
153
153
|
readonly tenantName: string;
|
|
154
154
|
readonly brandSuffix: string;
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { DbRunner } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
-
import type
|
|
2
|
+
import { type TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
3
|
import type { StoredEnvelope } from "../../table.ts";
|
|
4
|
+
export declare function readingSecretsOf<T>(tenantId: string, read: () => Promise<T>): Promise<T>;
|
|
4
5
|
export declare function selectTenantSecretEnvelope(db: DbRunner, tenantId: TenantId, key: string): Promise<StoredEnvelope | undefined>;
|
|
@@ -1,5 +1,14 @@
|
|
|
1
1
|
import { asRawClient } from "@cosmicdrift/kumiko-framework/db";
|
|
2
|
+
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-framework/engine";
|
|
3
|
+
import { runInRowLevelSecurityScope, tenantRowLevelSecurityScope, } from "@cosmicdrift/kumiko-framework/internal/row-level-security";
|
|
4
|
+
// Platform-wide secrets are system tenant rows, which another tenant's scope does not read. The
|
|
5
|
+
// read runs in the system tenant's own scope, so RLS passes only its rows and never a third tenant's.
|
|
6
|
+
export function readingSecretsOf(tenantId, read) {
|
|
7
|
+
return tenantId === SYSTEM_TENANT_ID
|
|
8
|
+
? runInRowLevelSecurityScope(tenantRowLevelSecurityScope(SYSTEM_TENANT_ID), read)
|
|
9
|
+
: read();
|
|
10
|
+
}
|
|
2
11
|
export async function selectTenantSecretEnvelope(db, tenantId, key) {
|
|
3
|
-
const rows = await asRawClient(db).unsafe(`SELECT envelope FROM read_tenant_secrets WHERE tenant_id = $1 AND key = $2 LIMIT 1`, [tenantId, key]);
|
|
12
|
+
const rows = await readingSecretsOf(tenantId, () => asRawClient(db).unsafe(`SELECT envelope FROM read_tenant_secrets WHERE tenant_id = $1 AND key = $2 LIMIT 1`, [tenantId, key]));
|
|
4
13
|
return rows[0]?.envelope;
|
|
5
14
|
}
|