@cosmicdrift/kumiko-bundled-features 0.378.0 → 0.379.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/account-security/feature.js +2 -2
- package/dist/account-security/index.d.ts +2 -2
- package/dist/account-security/index.js +2 -2
- package/dist/account-security/{constants.js → web/constants.js} +0 -1
- package/dist/account-security/{i18n.js → web/i18n.js} +0 -1
- package/dist/admin-shell/feature.js +4 -3
- package/dist/admin-shell/index.d.ts +2 -2
- package/dist/admin-shell/index.js +2 -2
- package/dist/admin-shell/web/client-plugin.js +2 -3
- package/dist/admin-shell/{constants.js → web/constants.js} +0 -1
- package/dist/admin-shell/web/default-translations.d.ts +2 -0
- package/dist/admin-shell/web/default-translations.js +4 -0
- package/dist/admin-shell/web/i18n.d.ts +5 -2
- package/dist/admin-shell/web/i18n.js +50 -5
- package/dist/admin-shell/web/index.js +0 -1
- package/dist/audit/feature.js +58 -59
- package/dist/audit/handlers/audit-events.d.ts +102 -0
- package/dist/audit/handlers/audit-events.js +112 -0
- package/dist/audit/handlers/audit-system-db.d.ts +1 -0
- package/dist/audit/handlers/audit-system-db.js +9 -0
- package/dist/audit/handlers/details-all-tenants.query.d.ts +15 -0
- package/dist/audit/handlers/details-all-tenants.query.js +20 -0
- package/dist/audit/handlers/details.query.d.ts +2 -1
- package/dist/audit/handlers/details.query.js +8 -24
- package/dist/audit/handlers/list-all-tenants.query.d.ts +41 -0
- package/dist/audit/handlers/list-all-tenants.query.js +32 -0
- package/dist/audit/handlers/list.query.d.ts +2 -1
- package/dist/audit/handlers/list.query.js +9 -99
- package/dist/audit/handlers/resolve-audit-tenant.d.ts +3 -1
- package/dist/audit/handlers/resolve-audit-tenant.js +21 -7
- package/dist/audit/index.d.ts +1 -1
- package/dist/audit/index.js +1 -1
- package/dist/audit/run-escape-hatch-retention.js +1 -1
- package/dist/audit/screens.d.ts +65 -0
- package/dist/audit/screens.js +73 -0
- package/dist/audit/web/client-plugin.js +2 -3
- package/dist/audit/{constants.d.ts → web/constants.d.ts} +8 -0
- package/dist/audit/{constants.js → web/constants.js} +8 -1
- package/dist/audit/web/default-translations.d.ts +2 -0
- package/dist/audit/web/default-translations.js +3 -0
- package/dist/audit/web/i18n.d.ts +5 -2
- package/dist/audit/web/i18n.js +31 -4
- package/dist/audit/web/index.js +0 -1
- package/dist/auth-email-password/bootstrap.d.ts +1 -1
- package/dist/auth-email-password/bootstrap.js +4 -4
- package/dist/auth-email-password/errors.js +1 -1
- package/dist/auth-email-password/feature.js +2 -2
- package/dist/auth-email-password/handlers/confirm-account-unlock.write.js +1 -1
- package/dist/auth-email-password/handlers/invite-accept-with-login.write.js +1 -1
- package/dist/auth-email-password/handlers/invite-create.write.d.ts +1 -1
- package/dist/auth-email-password/handlers/invite-create.write.js +3 -3
- package/dist/auth-email-password/handlers/invite-info.query.js +1 -1
- package/dist/auth-email-password/handlers/login.write.d.ts +1 -0
- package/dist/auth-email-password/handlers/login.write.js +26 -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 +1 -1
- package/dist/auth-email-password/handlers/request-password-reset.write.js +1 -1
- package/dist/auth-email-password/handlers/reset-password.write.js +1 -1
- package/dist/auth-email-password/handlers/verify-email.write.js +1 -1
- package/dist/auth-email-password/index.d.ts +1 -1
- package/dist/auth-email-password/index.js +1 -1
- package/dist/auth-email-password/mail-notifications.js +1 -1
- package/dist/auth-email-password/signup-activation.js +1 -1
- package/dist/auth-email-password/web/auth-client.js +0 -1
- package/dist/auth-email-password/web/auth-form-logic.js +0 -1
- package/dist/auth-email-password/web/auth-form-primitives.js +0 -1
- package/dist/auth-email-password/web/auth-gate.js +0 -1
- package/dist/auth-email-password/web/auth-redirect.js +0 -1
- package/dist/auth-email-password/web/client-actions.js +0 -1
- package/dist/auth-email-password/web/client-plugin.js +1 -2
- package/dist/auth-email-password/web/confirm-account-unlock-screen.js +0 -1
- package/dist/auth-email-password/{constants.js → web/constants.js} +3 -6
- package/dist/auth-email-password/web/default-topbar-actions.js +0 -1
- package/dist/auth-email-password/web/forgot-password-screen.js +0 -1
- package/dist/auth-email-password/{i18n.js → web/i18n.js} +3 -4
- package/dist/auth-email-password/web/index.d.ts +1 -1
- package/dist/auth-email-password/web/index.js +1 -2
- package/dist/auth-email-password/web/invite-accept-screen.d.ts +2 -2
- package/dist/auth-email-password/web/invite-accept-screen.js +0 -1
- package/dist/auth-email-password/web/login-screen.js +0 -1
- package/dist/auth-email-password/{mail-i18n.js → web/mail-i18n.js} +0 -1
- package/dist/auth-email-password/web/request-account-unlock-screen.js +0 -1
- package/dist/auth-email-password/web/reset-password-screen.js +0 -1
- package/dist/auth-email-password/web/session-bootstrap-error.js +0 -1
- package/dist/auth-email-password/web/session.js +0 -1
- package/dist/auth-email-password/web/signup-complete-screen.d.ts +2 -2
- package/dist/auth-email-password/web/signup-complete-screen.js +0 -1
- package/dist/auth-email-password/web/signup-screen.js +0 -1
- package/dist/auth-email-password/web/tenant-menu-items.js +0 -1
- package/dist/auth-email-password/web/tenant-switcher.js +0 -1
- package/dist/auth-email-password/web/use-shell-user.js +0 -1
- package/dist/auth-email-password/web/user-menu.js +0 -1
- package/dist/auth-email-password/web/verify-email-screen.js +0 -1
- package/dist/auth-mfa/errors.d.ts +1 -1
- package/dist/auth-mfa/errors.js +2 -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/enable-start.write.js +1 -1
- package/dist/auth-mfa/handlers/verify.write.js +1 -1
- package/dist/auth-mfa/index.d.ts +1 -1
- package/dist/auth-mfa/index.js +1 -1
- package/dist/auth-mfa/mfa-status-checker.js +1 -1
- package/dist/auth-mfa/screens.js +1 -1
- package/dist/auth-mfa/web/client-plugin.js +0 -1
- package/dist/auth-mfa/{constants.js → web/constants.js} +0 -1
- package/dist/auth-mfa/web/i18n.js +0 -1
- package/dist/auth-mfa/web/index.js +0 -1
- package/dist/auth-mfa/web/mfa-client.js +0 -1
- package/dist/auth-mfa/web/mfa-disable-dialog.js +1 -2
- package/dist/auth-mfa/web/mfa-recovery-codes-reveal.js +0 -1
- package/dist/auth-mfa/web/mfa-regenerate-recovery-dialog.js +1 -2
- package/dist/auth-mfa/web/mfa-setup-preauth-screen.js +11 -18
- package/dist/auth-mfa/web/mfa-verify-screen.js +0 -1
- package/dist/billing-foundation/checkout-core.js +1 -1
- package/dist/billing-foundation/consumer-protection/consent-text.d.ts +2 -2
- package/dist/billing-foundation/consumer-protection/consent-text.js +1 -1
- package/dist/billing-foundation/consumer-protection/issue-confirmation.js +7 -3
- package/dist/billing-foundation/consumer-protection/mail-notifications.js +3 -1
- package/dist/billing-foundation/consumer-protection/register-consent.js +1 -1
- package/dist/billing-foundation/consumer-protection/register-termination.js +8 -2
- package/dist/billing-foundation/consumer-protection/stored-user-email.d.ts +1 -0
- package/dist/billing-foundation/consumer-protection/stored-user-email.js +8 -0
- package/dist/billing-foundation/consumer-protection/termination-mail.d.ts +5 -1
- package/dist/billing-foundation/consumer-protection/termination-mail.js +3 -1
- package/dist/billing-foundation/consumer-protection/termination-notify.js +1 -1
- package/dist/billing-foundation/consumer-protection/termination-pages.js +109 -15
- package/dist/billing-foundation/consumer-protection/termination-record.d.ts +8 -1
- package/dist/billing-foundation/consumer-protection/termination-record.js +76 -3
- package/dist/billing-foundation/consumer-protection/termination-request.js +33 -6
- package/dist/billing-foundation/consumer-protection/termination-revoke.d.ts +28 -0
- package/dist/billing-foundation/consumer-protection/termination-revoke.js +149 -0
- package/dist/billing-foundation/consumer-protection/termination-texts.d.ts +17 -1
- package/dist/billing-foundation/consumer-protection/termination-texts.js +39 -0
- package/dist/billing-foundation/events.d.ts +9 -0
- package/dist/billing-foundation/events.js +14 -2
- package/dist/billing-foundation/feature.js +1 -1
- package/dist/billing-foundation/handlers/process-event.write.d.ts +5 -1
- package/dist/billing-foundation/handlers/process-event.write.js +57 -3
- package/dist/billing-foundation/handlers/switch-plan.write.js +1 -1
- package/dist/billing-foundation/handlers/sync-subscription.write.js +1 -1
- package/dist/billing-foundation/index.d.ts +2 -2
- package/dist/billing-foundation/index.js +2 -2
- package/dist/billing-foundation/plan-catalog.js +1 -1
- package/dist/billing-foundation/screens.js +1 -1
- package/dist/billing-foundation/subscription-tier-sync.js +1 -1
- package/dist/billing-foundation/types.d.ts +14 -2
- package/dist/billing-foundation/types.js +1 -1
- package/dist/billing-foundation/validate-options.js +3 -3
- package/dist/billing-foundation/web/billing-contact-plan.js +1 -2
- package/dist/billing-foundation/web/billing-plans-panel.js +1 -2
- package/dist/billing-foundation/web/cancel-contract-dialog.js +1 -2
- package/dist/billing-foundation/web/checkout-consent-dialog.js +1 -2
- package/dist/billing-foundation/web/client-plugin.js +1 -1
- package/dist/billing-foundation/{constants.d.ts → web/constants.d.ts} +21 -14
- package/dist/billing-foundation/{constants.js → web/constants.js} +35 -31
- package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.js +0 -1
- package/dist/billing-foundation/{contact-card.js → web/contact-card.js} +0 -1
- package/dist/billing-foundation/web/index.d.ts +2 -2
- package/dist/billing-foundation/web/index.js +2 -3
- package/dist/billing-foundation/web/localized-params.js +0 -1
- package/dist/billing-foundation/webhook-handler.js +4 -1
- package/dist/cap-overview/feature.js +1 -1
- package/dist/cap-overview/handlers/caps-usage.query.js +1 -1
- package/dist/cap-overview/handlers/tenant-caps-list.query.js +2 -2
- package/dist/cap-overview/index.d.ts +2 -2
- package/dist/cap-overview/index.js +2 -2
- package/dist/cap-overview/screens.js +1 -1
- package/dist/cap-overview/web/cap-cards-panel.js +1 -1
- package/dist/cap-overview/web/cap-usage-bar.js +1 -2
- package/dist/cap-overview/web/client-plugin.js +1 -1
- package/dist/cap-overview/{constants.js → web/constants.js} +0 -1
- package/dist/cap-overview/web/index.js +0 -1
- package/dist/cap-overview/{usage-math.d.ts → web/usage-math.d.ts} +1 -1
- package/dist/compliance-profiles/feature.js +1 -1
- package/dist/compliance-profiles/index.d.ts +1 -1
- package/dist/compliance-profiles/index.js +1 -1
- package/dist/compliance-profiles/web/client-plugin.js +1 -2
- package/dist/compliance-profiles/web/compliance-profile-catalog.js +1 -2
- package/dist/compliance-profiles/{constants.js → web/constants.js} +0 -1
- package/dist/compliance-profiles/web/index.js +0 -1
- package/dist/config/index.d.ts +1 -1
- package/dist/config/index.js +1 -1
- package/dist/config/web/client-plugin.d.ts +1 -1
- package/dist/config/web/client-plugin.js +1 -2
- package/dist/config/{constants.js → web/constants.js} +0 -1
- package/dist/config/web/i18n.js +0 -1
- package/dist/config/web/index.d.ts +1 -1
- package/dist/config/web/index.js +1 -2
- package/dist/config/write-helpers.js +1 -1
- package/dist/custom-fields/feature.js +1 -1
- package/dist/custom-fields/handlers/clear-custom-field.write.js +1 -1
- package/dist/custom-fields/handlers/define-tenant-field.write.js +1 -1
- package/dist/custom-fields/handlers/delete-system-field.write.js +1 -1
- package/dist/custom-fields/handlers/delete-tenant-field.write.js +1 -1
- package/dist/custom-fields/handlers/set-custom-field.write.js +1 -1
- package/dist/custom-fields/handlers/update-tenant-field.write.js +1 -1
- package/dist/custom-fields/index.d.ts +1 -1
- package/dist/custom-fields/index.js +1 -1
- package/dist/custom-fields/lib/value-schema.js +1 -1
- package/dist/custom-fields/schemas.js +1 -1
- package/dist/custom-fields/web/client-plugin.js +1 -2
- package/dist/custom-fields/{constants.js → web/constants.js} +18 -19
- package/dist/custom-fields/web/custom-fields-form-section.js +1 -2
- package/dist/custom-fields/web/i18n.js +0 -1
- package/dist/custom-fields/web/index.d.ts +1 -1
- package/dist/custom-fields/web/index.js +1 -2
- package/dist/custom-fields/wire-for-entity.js +1 -1
- package/dist/delivery/address-opt-out.js +1 -1
- package/dist/delivery/attempt-log-retention.js +21 -3
- package/dist/delivery/constants.d.ts +1 -1
- package/dist/delivery/constants.js +2 -2
- package/dist/delivery/i18n.js +1 -1
- package/dist/delivery/unsubscribe-page.js +1 -1
- package/dist/delivery/web/client-plugin.js +1 -1
- package/dist/delivery/web/delivery-channel-cell.js +0 -1
- package/dist/delivery/web/delivery-error-cell.js +0 -1
- package/dist/delivery/web/delivery-status-cell.js +1 -2
- package/dist/delivery/web/delivery-time-cell.js +0 -1
- package/dist/delivery/web/delivery-type-cell.js +0 -1
- package/dist/delivery/web/index.js +0 -1
- package/dist/delivery/{public-names.js → web/public-names.js} +0 -1
- package/dist/document-ingest-foundation/events.d.ts +1 -0
- package/dist/document-ingest-foundation/events.js +3 -0
- package/dist/document-ingest-foundation/executor.js +2 -1
- package/dist/document-ingest-foundation/feature.js +16 -5
- package/dist/document-ingest-foundation/index.d.ts +1 -1
- package/dist/document-ingest-foundation/index.js +1 -1
- package/dist/feature-toggles/feature.d.ts +1 -1
- package/dist/feature-toggles/feature.js +2 -2
- package/dist/feature-toggles/handlers/list.query.js +1 -1
- package/dist/feature-toggles/handlers/registered.query.js +1 -1
- package/dist/feature-toggles/handlers/set.write.js +1 -1
- package/dist/feature-toggles/index.d.ts +1 -1
- package/dist/feature-toggles/index.js +1 -1
- package/dist/feature-toggles/web/client-plugin.js +1 -2
- package/dist/feature-toggles/{constants.js → web/constants.js} +0 -1
- package/dist/feature-toggles/web/index.js +0 -1
- package/dist/folders/feature.js +1 -1
- package/dist/folders/handlers/clear-folder.write.js +1 -1
- package/dist/folders/handlers/delete-folder.write.js +1 -1
- package/dist/folders/handlers/set-folder.write.js +1 -1
- package/dist/folders/index.d.ts +1 -1
- package/dist/folders/index.js +1 -1
- package/dist/folders/web/client-plugin.js +1 -2
- package/dist/folders/{constants.js → web/constants.js} +0 -1
- package/dist/folders/web/folder-manager.js +1 -2
- package/dist/folders/web/folder-section.js +1 -2
- package/dist/folders/web/i18n.js +0 -1
- package/dist/folders/web/index.d.ts +1 -1
- package/dist/folders/web/index.js +1 -2
- package/dist/folders/web/tree.js +0 -1
- package/dist/form-draft/db/queries/cleanup.d.ts +3 -2
- package/dist/form-draft/db/queries/cleanup.js +18 -9
- package/dist/form-draft/decrypt-draft.d.ts +2 -0
- package/dist/form-draft/decrypt-draft.js +19 -0
- package/dist/form-draft/entity.js +6 -9
- package/dist/form-draft/feature.js +1 -1
- package/dist/form-draft/handlers/cleanup.job.d.ts +1 -0
- package/dist/form-draft/handlers/cleanup.job.js +17 -4
- package/dist/form-draft/handlers/discard.write.js +1 -1
- package/dist/form-draft/handlers/get.query.js +6 -7
- package/dist/form-draft/handlers/list.query.js +11 -7
- package/dist/form-draft/handlers/save.write.js +1 -1
- package/dist/form-draft/index.d.ts +1 -1
- package/dist/form-draft/index.js +1 -1
- package/dist/form-draft/lookup.d.ts +2 -2
- package/dist/form-draft/lookup.js +7 -2
- package/dist/form-draft/schemas.js +1 -1
- package/dist/form-draft/{constants.js → web/constants.js} +0 -1
- package/dist/form-draft-user-data/hooks.js +2 -2
- package/dist/inbound-mail-foundation/retention-sweep.js +7 -5
- package/dist/jobs/feature.js +2 -2
- package/dist/jobs/handlers/retry.write.js +1 -1
- package/dist/jobs/handlers/trigger.write.js +1 -1
- package/dist/jobs/index.d.ts +1 -1
- package/dist/jobs/index.js +1 -1
- package/dist/jobs/web/client-plugin.js +2 -3
- package/dist/jobs/{constants.js → web/constants.js} +0 -1
- package/dist/jobs/web/default-translations.d.ts +2 -0
- package/dist/jobs/web/default-translations.js +3 -0
- package/dist/jobs/web/i18n.d.ts +5 -2
- package/dist/jobs/web/i18n.js +51 -4
- package/dist/jobs/web/index.js +0 -1
- package/dist/ledger/entity.d.ts +1 -1
- package/dist/ledger/entity.js +1 -1
- package/dist/ledger/feature.js +1 -1
- package/dist/ledger/handlers/confirm-schedule-period.write.js +2 -5
- package/dist/ledger/handlers/create-transaction.write.js +1 -1
- package/dist/ledger/handlers/reports.query.js +1 -1
- package/dist/ledger/handlers/reverse-transaction.write.js +1 -1
- package/dist/ledger/index.d.ts +1 -1
- package/dist/ledger/index.js +1 -1
- package/dist/ledger/recurring.d.ts +1 -1
- package/dist/ledger/reports.d.ts +1 -1
- package/dist/ledger/schemas.js +1 -1
- package/dist/ledger/{constants.js → web/constants.js} +0 -1
- package/dist/ledger/web/index.d.ts +1 -1
- package/dist/ledger/web/index.js +1 -2
- package/dist/legal-pages/feature.d.ts +1 -1
- package/dist/legal-pages/feature.js +1 -1
- package/dist/legal-pages/index.d.ts +1 -1
- package/dist/legal-pages/index.js +1 -1
- package/dist/legal-pages/lib/boot-check.d.ts +1 -1
- package/dist/legal-pages/lib/boot-check.js +1 -1
- package/dist/legal-pages/lib/validate-routes.d.ts +1 -1
- package/dist/legal-pages/web/client-plugin.js +1 -2
- package/dist/legal-pages/{constants.js → web/constants.js} +6 -8
- package/dist/legal-pages/web/index.js +0 -1
- package/dist/managed-pages/feature.js +1 -1
- package/dist/managed-pages/web/client-plugin.js +1 -2
- package/dist/managed-pages/web/default-translations.d.ts +2 -0
- package/dist/managed-pages/web/default-translations.js +11 -0
- package/dist/managed-pages/web/i18n.d.ts +5 -2
- package/dist/managed-pages/web/i18n.js +53 -12
- package/dist/managed-pages/web/index.d.ts +1 -1
- package/dist/managed-pages/web/index.js +1 -2
- package/dist/metrics/compute.d.ts +1 -1
- package/dist/metrics/compute.js +1 -1
- package/dist/metrics/feature.js +1 -1
- package/dist/metrics/index.d.ts +1 -1
- package/dist/metrics/index.js +1 -1
- package/dist/metrics/types.d.ts +1 -1
- package/dist/metrics/validate.js +1 -1
- package/dist/metrics/{constants.js → web/constants.js} +0 -1
- package/dist/metrics/window.d.ts +1 -1
- package/dist/notes-history/feature.js +1 -1
- package/dist/notes-history/handlers/add-note.write.js +1 -1
- package/dist/notes-history/index.d.ts +1 -1
- package/dist/notes-history/index.js +1 -1
- package/dist/notes-history/web/client-plugin.js +1 -2
- package/dist/notes-history/{constants.js → web/constants.js} +0 -1
- package/dist/notes-history/web/i18n.js +0 -1
- package/dist/notes-history/web/index.d.ts +1 -1
- package/dist/notes-history/web/index.js +1 -2
- package/dist/notes-history/web/notes-section.js +2 -3
- package/dist/personal-access-tokens/feature.d.ts +2 -2
- package/dist/personal-access-tokens/feature.js +6 -4
- package/dist/personal-access-tokens/handlers/available-scopes.query.d.ts +1 -1
- package/dist/personal-access-tokens/handlers/create.write.js +1 -1
- package/dist/personal-access-tokens/handlers/revoke.write.js +1 -1
- package/dist/personal-access-tokens/hash.js +1 -1
- package/dist/personal-access-tokens/i18n.d.ts +1 -1
- package/dist/personal-access-tokens/i18n.js +1 -1
- package/dist/personal-access-tokens/index.d.ts +5 -5
- package/dist/personal-access-tokens/index.js +3 -3
- package/dist/personal-access-tokens/resolver.d.ts +1 -1
- package/dist/personal-access-tokens/resolver.js +1 -1
- package/dist/personal-access-tokens/schema/api-token.js +1 -1
- package/dist/personal-access-tokens/screens.d.ts +1 -1
- package/dist/personal-access-tokens/screens.js +1 -1
- package/dist/personal-access-tokens/{constants.js → web/constants.js} +0 -1
- package/dist/presets/index.d.ts +0 -1
- package/dist/presets/index.js +0 -1
- package/dist/presets/security-baseline.d.ts +1 -1
- package/dist/presets/security-baseline.js +1 -1
- package/dist/secrets/feature.js +1 -1
- package/dist/secrets/handlers/delete.write.js +1 -1
- package/dist/secrets/handlers/list.query.js +1 -1
- package/dist/secrets/handlers/set.write.js +1 -1
- package/dist/secrets/i18n.js +1 -1
- package/dist/secrets/index.d.ts +1 -1
- package/dist/secrets/index.js +1 -1
- package/dist/secrets/{constants.js → web/constants.js} +0 -1
- package/dist/secrets/write-gate.js +1 -1
- package/dist/sessions/feature.js +7 -4
- package/dist/sessions/{i18n.js → web/i18n.js} +0 -1
- package/dist/shared/index.d.ts +1 -1
- package/dist/shared/index.js +1 -1
- package/dist/shared/purge-files-reaching-subject.js +7 -3
- package/dist/subscription-stripe/feature.js +2 -1
- package/dist/subscription-stripe/plugin-methods.d.ts +3 -0
- package/dist/subscription-stripe/plugin-methods.js +14 -0
- package/dist/subscription-stripe/verify-webhook.js +1 -0
- package/dist/tags/feature.js +1 -1
- package/dist/tags/handlers/assign-tag.write.js +11 -7
- package/dist/tags/handlers/create-tag.write.js +1 -1
- package/dist/tags/handlers/delete-tag.write.js +4 -1
- package/dist/tags/handlers/remove-tag.write.js +1 -1
- package/dist/tags/handlers/update-tag.write.js +1 -1
- package/dist/tags/index.d.ts +1 -1
- package/dist/tags/index.js +1 -1
- package/dist/tags/screens.js +1 -1
- package/dist/tags/web/client-plugin.js +1 -2
- package/dist/tags/{constants.d.ts → web/constants.d.ts} +1 -0
- package/dist/tags/{constants.js → web/constants.js} +3 -1
- package/dist/tags/web/entity-tags.js +1 -2
- package/dist/tags/web/i18n.js +2 -2
- package/dist/tags/web/index.d.ts +1 -1
- package/dist/tags/web/index.js +1 -2
- package/dist/tags/web/tag-filter.js +1 -2
- package/dist/tags/web/tag-manager.js +5 -4
- package/dist/tags/web/tag-picker.js +0 -1
- package/dist/tags/web/tag-section.js +1 -2
- package/dist/tags/web/tags-cell.js +1 -2
- package/dist/template-resolver/api.d.ts +21 -23
- package/dist/template-resolver/api.js +34 -6
- package/dist/template-resolver/compile-document-body.js +1 -1
- package/dist/template-resolver/compile-steps-block.js +2 -2
- package/dist/template-resolver/document-ops.d.ts +1 -1
- package/dist/template-resolver/document-ops.js +3 -3
- package/dist/template-resolver/document-sanitizer.d.ts +1 -1
- package/dist/template-resolver/document-sanitizer.js +3 -3
- package/dist/template-resolver/feature.d.ts +2 -0
- package/dist/template-resolver/feature.js +12 -4
- package/dist/template-resolver/handlers/by-slug.query.js +6 -1
- package/dist/template-resolver/handlers/by-tenant.query.js +6 -2
- package/dist/template-resolver/handlers/collection-item.query.js +1 -1
- package/dist/template-resolver/handlers/collection-list.query.js +1 -1
- package/dist/template-resolver/handlers/collection-set.write.d.ts +2 -1
- package/dist/template-resolver/handlers/collection-set.write.js +14 -2
- package/dist/template-resolver/handlers/copy-locale.write.js +2 -2
- package/dist/template-resolver/handlers/diff-to-system.query.js +5 -1
- package/dist/template-resolver/handlers/discard-draft.write.js +1 -1
- package/dist/template-resolver/handlers/document-base.d.ts +1 -1
- package/dist/template-resolver/handlers/document-base.js +6 -1
- package/dist/template-resolver/handlers/document-blocks.query.d.ts +1 -1
- package/dist/template-resolver/handlers/document-blocks.query.js +2 -2
- package/dist/template-resolver/handlers/export-bundle.query.js +5 -2
- package/dist/template-resolver/handlers/find-by-id.query.js +4 -2
- package/dist/template-resolver/handlers/layout-source.query.js +5 -5
- package/dist/template-resolver/handlers/list.query.js +5 -2
- package/dist/template-resolver/handlers/overview.query.d.ts +10 -2
- package/dist/template-resolver/handlers/overview.query.js +44 -12
- package/dist/template-resolver/handlers/patch-draft.write.js +1 -1
- package/dist/template-resolver/handlers/resource-shared.js +1 -1
- package/dist/template-resolver/handlers/resource-upload.write.js +1 -1
- package/dist/template-resolver/handlers/send-test.write.js +2 -2
- package/dist/template-resolver/handlers/set.write.js +1 -1
- package/dist/template-resolver/handlers/shared.js +1 -1
- package/dist/template-resolver/handlers/template-gates.d.ts +1 -1
- package/dist/template-resolver/handlers/template-gates.js +1 -1
- package/dist/template-resolver/handlers/template-write.d.ts +1 -1
- package/dist/template-resolver/handlers/template-write.js +1 -1
- package/dist/template-resolver/handlers/usage.query.js +3 -2
- package/dist/template-resolver/handlers/validate.query.d.ts +1 -1
- package/dist/template-resolver/handlers/validate.query.js +3 -1
- package/dist/template-resolver/i18n.d.ts +3 -0
- package/dist/template-resolver/i18n.js +24 -0
- package/dist/template-resolver/index.d.ts +4 -3
- package/dist/template-resolver/index.js +3 -3
- package/dist/template-resolver/layout-appearance.js +1 -1
- package/dist/template-resolver/layout-regions.d.ts +1 -1
- package/dist/template-resolver/seeding.d.ts +4 -1
- package/dist/template-resolver/seeding.js +13 -7
- package/dist/template-resolver/store-template-resource.js +2 -2
- package/dist/template-resolver/table.js +1 -1
- package/dist/template-resolver/template-bundle.js +2 -2
- package/dist/template-resolver/template-delivery-policy.d.ts +22 -0
- package/dist/template-resolver/template-delivery-policy.js +40 -0
- package/dist/template-resolver/template-draft.d.ts +1 -1
- package/dist/template-resolver/template-draft.js +1 -1
- package/dist/template-resolver/template-edit-policy.d.ts +1 -1
- package/dist/template-resolver/template-edit-policy.js +1 -1
- package/dist/template-resolver/template-meta.d.ts +2 -2
- package/dist/template-resolver/template-meta.js +2 -2
- package/dist/template-resolver/template-preview.d.ts +1 -1
- package/dist/template-resolver/template-preview.js +8 -4
- package/dist/template-resolver/template-usage.d.ts +1 -1
- package/dist/template-resolver/template-usage.js +1 -1
- package/dist/template-resolver/template-validation.js +1 -1
- package/dist/template-resolver/testing.js +1 -1
- package/dist/template-resolver/user-content-table.js +1 -1
- package/dist/template-resolver/web/client-plugin.js +1 -2
- package/dist/template-resolver/{constants.d.ts → web/constants.d.ts} +1 -1
- package/dist/template-resolver/{constants.js → web/constants.js} +7 -10
- package/dist/template-resolver/web/document-editor-extensions.js +2 -2
- package/dist/template-resolver/web/document-editor.js +0 -1
- package/dist/template-resolver/{document-images.js → web/document-images.js} +0 -1
- package/dist/template-resolver/{document-schema.js → web/document-schema.js} +0 -1
- package/dist/template-resolver/{document-steps.js → web/document-steps.js} +0 -1
- package/dist/template-resolver/web/document-tiptap-editor.js +2 -3
- package/dist/template-resolver/web/document-toolbar-blocks.d.ts +2 -2
- package/dist/template-resolver/web/document-toolbar-blocks.js +1 -1
- package/dist/template-resolver/web/editor-handle.js +1 -1
- package/dist/template-resolver/web/i18n.js +1 -1
- package/dist/template-resolver/web/index.d.ts +3 -3
- package/dist/template-resolver/web/index.js +3 -4
- package/dist/template-resolver/{mail-constants.js → web/mail-constants.js} +0 -1
- package/dist/template-resolver/{pdf-constants.js → web/pdf-constants.js} +0 -1
- package/dist/template-resolver/web/placeholder-line-editor-lazy.js +0 -1
- package/dist/template-resolver/web/placeholder-line-editor.js +6 -4
- package/dist/template-resolver/{qualified-names.js → web/qualified-names.js} +0 -1
- package/dist/template-resolver/web/use-stable-by-key.js +0 -1
- package/dist/tenant/handlers/add-member.write.js +1 -1
- package/dist/tenant/index.d.ts +1 -1
- package/dist/tenant/index.js +1 -1
- package/dist/tenant/invitation-table.js +1 -1
- package/dist/tenant/invited-membership.js +1 -1
- package/dist/tenant/last-tenant-admin.js +1 -1
- package/dist/tenant/member-role-options.js +1 -1
- package/dist/tenant/screens.js +1 -1
- package/dist/tenant/web/client-plugin.js +1 -2
- package/dist/tenant/{constants.js → web/constants.js} +3 -6
- package/dist/tenant/web/index.js +0 -1
- package/dist/tenant/web/member-roles-cell.js +0 -1
- package/dist/tenant/web/member-status-cell.js +0 -1
- package/dist/tenant-lifecycle/stages.js +2 -3
- package/dist/tier-engine/entity.d.ts +1 -1
- package/dist/tier-engine/entity.js +1 -1
- package/dist/tier-engine/feature.js +2 -2
- package/dist/tier-engine/handlers/set-tenant-tier.write.js +1 -1
- package/dist/tier-engine/index.d.ts +1 -1
- package/dist/tier-engine/index.js +1 -1
- package/dist/tier-engine/web/client-plugin.js +2 -3
- package/dist/tier-engine/{constants.js → web/constants.js} +2 -3
- package/dist/tier-engine/{i18n.js → web/i18n.js} +0 -1
- package/dist/tier-engine/web/index.js +0 -1
- package/dist/user/handlers/create.write.js +1 -1
- package/dist/user/handlers/update-roles.js +1 -1
- package/dist/user/handlers/update.write.js +1 -1
- package/dist/user/index.d.ts +1 -1
- package/dist/user/index.js +1 -1
- package/dist/user/invited-global-roles.d.ts +1 -1
- package/dist/user/invited-global-roles.js +1 -1
- package/dist/user/schema/user.js +1 -1
- package/dist/user/{constants.js → web/constants.js} +0 -1
- package/dist/user-data-rights/env.js +1 -1
- package/dist/user-data-rights/feature.js +3 -3
- package/dist/user-data-rights/index.d.ts +1 -1
- package/dist/user-data-rights/index.js +1 -1
- package/dist/user-data-rights/lib/resolve-tenant-model.js +1 -1
- package/dist/user-data-rights/mail-notifications.js +1 -1
- package/dist/user-data-rights/web/client-plugin.js +2 -3
- package/dist/user-data-rights/web/confirm-deletion-screen.js +0 -1
- package/dist/user-data-rights/{constants.js → web/constants.js} +11 -12
- package/dist/user-data-rights/web/default-translations.d.ts +2 -0
- package/dist/user-data-rights/web/default-translations.js +59 -0
- package/dist/user-data-rights/web/i18n.d.ts +5 -2
- package/dist/user-data-rights/web/i18n.js +37 -59
- package/dist/user-data-rights/web/index.d.ts +1 -1
- package/dist/user-data-rights/web/index.js +1 -2
- package/dist/user-data-rights/web/privacy-center-screen.js +1 -2
- package/dist/user-data-rights/web/request-deletion-screen.js +0 -1
- package/dist/user-data-rights-defaults/hooks/file-ref.userdata-hook.js +6 -1
- package/dist/user-profile/feature.js +1 -1
- package/dist/user-profile/handlers/change-email.write.js +1 -1
- package/dist/user-profile/index.d.ts +1 -1
- package/dist/user-profile/index.js +1 -1
- package/dist/user-profile/web/client-plugin.js +2 -3
- package/dist/user-profile/{constants.js → web/constants.js} +0 -1
- package/dist/user-profile/{i18n.js → web/i18n.js} +0 -1
- package/dist/user-profile/web/profile-screen.js +2 -3
- package/dist/waitlist/entity.js +1 -1
- package/dist/waitlist/feature.js +1 -1
- package/dist/waitlist/handlers/export-purge.write.js +1 -1
- package/dist/waitlist/handlers/invite.write.js +1 -1
- package/dist/waitlist/handlers/reject.write.js +1 -1
- package/dist/waitlist/handlers/submit.write.js +4 -3
- package/dist/waitlist/import.d.ts +1 -1
- package/dist/waitlist/index.d.ts +1 -1
- package/dist/waitlist/index.js +1 -1
- package/dist/waitlist/legacy-migrate.js +1 -1
- package/dist/waitlist/link-on-signup.js +1 -1
- package/dist/waitlist/mail.d.ts +0 -1
- package/dist/waitlist/mail.js +6 -4
- package/dist/waitlist/payloads.js +1 -1
- package/dist/waitlist/screens.js +1 -1
- package/dist/waitlist/{constants.js → web/constants.js} +0 -1
- package/kumiko-es-tables.json +102 -0
- package/package.json +30 -29
- package/src/audit/changes.json +7 -0
- package/src/auth-email-password/changes.json +6 -0
- package/src/auth-mfa/changes.json +6 -0
- package/src/billing-foundation/changes.json +18 -0
- package/src/delivery/changes.json +6 -0
- package/src/document-ingest-foundation/changes.json +6 -0
- package/src/files/changes.json +7 -0
- package/src/form-draft/changes.json +7 -0
- package/src/ledger/changes.json +7 -0
- package/src/presets/changes.json +7 -0
- package/src/tags/changes.json +6 -0
- package/src/template-resolver/changes.json +43 -0
- package/src/user-data-rights/changes.json +14 -0
- package/src/waitlist/changes.json +6 -0
- package/dist/admin-shell/i18n.d.ts +0 -5
- package/dist/admin-shell/i18n.js +0 -51
- package/dist/audit/i18n.d.ts +0 -5
- package/dist/audit/i18n.js +0 -22
- package/dist/jobs/i18n.d.ts +0 -5
- package/dist/jobs/i18n.js +0 -52
- package/dist/managed-pages/i18n.d.ts +0 -5
- package/dist/managed-pages/i18n.js +0 -55
- package/dist/presets/dsgvo-self-service.d.ts +0 -10
- package/dist/presets/dsgvo-self-service.js +0 -24
- package/dist/user-data-rights/i18n.d.ts +0 -5
- package/dist/user-data-rights/i18n.js +0 -39
- /package/dist/account-security/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/account-security/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/admin-shell/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/auth-email-password/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/auth-email-password/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/auth-email-password/{mail-i18n.d.ts → web/mail-i18n.d.ts} +0 -0
- /package/dist/auth-mfa/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.d.ts +0 -0
- /package/dist/billing-foundation/{contact-card.d.ts → web/contact-card.d.ts} +0 -0
- /package/dist/cap-overview/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/cap-overview/{usage-math.js → web/usage-math.js} +0 -0
- /package/dist/compliance-profiles/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/config/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/custom-fields/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/delivery/{public-names.d.ts → web/public-names.d.ts} +0 -0
- /package/dist/feature-toggles/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/folders/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/form-draft/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/jobs/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/ledger/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/legal-pages/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/metrics/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/notes-history/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/personal-access-tokens/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/personal-access-tokens/{scopes.d.ts → web/scopes.d.ts} +0 -0
- /package/dist/personal-access-tokens/{scopes.js → web/scopes.js} +0 -0
- /package/dist/secrets/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/sessions/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/template-resolver/{document-blocks.d.ts → web/document-blocks.d.ts} +0 -0
- /package/dist/template-resolver/{document-blocks.js → web/document-blocks.js} +0 -0
- /package/dist/template-resolver/{document-images.d.ts → web/document-images.d.ts} +0 -0
- /package/dist/template-resolver/{document-schema.d.ts → web/document-schema.d.ts} +0 -0
- /package/dist/template-resolver/{document-steps.d.ts → web/document-steps.d.ts} +0 -0
- /package/dist/template-resolver/{mail-constants.d.ts → web/mail-constants.d.ts} +0 -0
- /package/dist/template-resolver/{pdf-constants.d.ts → web/pdf-constants.d.ts} +0 -0
- /package/dist/template-resolver/{placeholder-text.d.ts → web/placeholder-text.d.ts} +0 -0
- /package/dist/template-resolver/{placeholder-text.js → web/placeholder-text.js} +0 -0
- /package/dist/template-resolver/{qualified-names.d.ts → web/qualified-names.d.ts} +0 -0
- /package/dist/tenant/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/tier-engine/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/tier-engine/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/user/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-data-rights/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-profile/{constants.d.ts → web/constants.d.ts} +0 -0
- /package/dist/user-profile/{i18n.d.ts → web/i18n.d.ts} +0 -0
- /package/dist/waitlist/{constants.d.ts → web/constants.d.ts} +0 -0
|
@@ -2,43 +2,27 @@
|
|
|
2
2
|
// screen. Tenant-isolated at the WHERE level like list.query, so a caller
|
|
3
3
|
// can only read events in their own tenant; a SystemAdmin can pass scope
|
|
4
4
|
// "system" to read app-instance system events (e.g. app.started).
|
|
5
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
6
5
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
8
6
|
import * as z from "zod";
|
|
9
|
-
import {
|
|
10
|
-
import {
|
|
7
|
+
import { AUDIT_SCOPE_VALUES } from "../web/constants.js";
|
|
8
|
+
import { auditEventIdSchema, loadAuditEvent } from "./audit-events.js";
|
|
9
|
+
import { requireAuditSystemDb } from "./audit-system-db.js";
|
|
11
10
|
import { resolveAuditScopeFilter } from "./resolve-audit-tenant.js";
|
|
12
11
|
export const detailsQuery = defineQueryHandler({
|
|
13
12
|
name: "details",
|
|
14
13
|
description: 'Returns one audit-trail event of the caller\'s tenant by its event-store id, with full payload and metadata; use it to inspect the exact change behind a row of the audit log list. A SystemAdmin can set scope "system" to read an app-instance system event (e.g. app.started).',
|
|
15
14
|
schema: z.object({
|
|
16
|
-
id:
|
|
15
|
+
id: auditEventIdSchema,
|
|
17
16
|
scope: z.enum(AUDIT_SCOPE_VALUES).optional(),
|
|
18
17
|
}),
|
|
19
18
|
access: { roles: access.admin },
|
|
20
19
|
handler: async (query, ctx) => {
|
|
21
20
|
const scopeFilter = resolveAuditScopeFilter(query.user, query.payload.scope);
|
|
22
|
-
const
|
|
21
|
+
const db = requireAuditSystemDb(ctx.systemDb, "audit:query:details").assertTenantMatch(query.user.tenantId);
|
|
22
|
+
return loadAuditEvent(db, {
|
|
23
23
|
tenantId: scopeFilter.tenantId,
|
|
24
|
-
...(scopeFilter.aggregateType !== undefined && {
|
|
25
|
-
aggregateType: scopeFilter.aggregateType,
|
|
26
|
-
}),
|
|
24
|
+
...(scopeFilter.aggregateType !== undefined && { aggregateType: scopeFilter.aggregateType }),
|
|
27
25
|
id: BigInt(query.payload.id),
|
|
28
|
-
}
|
|
29
|
-
const row = rows[0];
|
|
30
|
-
if (row === undefined)
|
|
31
|
-
return null;
|
|
32
|
-
return {
|
|
33
|
-
id: String(row.id),
|
|
34
|
-
aggregateId: row.aggregateId,
|
|
35
|
-
aggregateType: row.aggregateType,
|
|
36
|
-
version: row.version,
|
|
37
|
-
type: row.type,
|
|
38
|
-
payload: redactPiiCiphertext(row.payload),
|
|
39
|
-
metadata: row.metadata,
|
|
40
|
-
createdAt: row.createdAt,
|
|
41
|
-
createdBy: row.createdBy,
|
|
42
|
-
};
|
|
26
|
+
});
|
|
43
27
|
},
|
|
44
28
|
});
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
import * as z from "zod";
|
|
2
|
+
export declare const listAllTenantsQuery: import("@cosmicdrift/kumiko-types/define-handler").QueryHandlerDefinition<"list-all-tenants", z.ZodObject<{
|
|
3
|
+
cursor: z.ZodOptional<z.ZodString>;
|
|
4
|
+
before: z.ZodOptional<z.ZodString>;
|
|
5
|
+
search: z.ZodOptional<z.ZodString>;
|
|
6
|
+
limit: z.ZodDefault<z.ZodNumber>;
|
|
7
|
+
aggregateType: z.ZodOptional<z.ZodString>;
|
|
8
|
+
aggregateId: z.ZodOptional<z.ZodUUID>;
|
|
9
|
+
eventType: z.ZodOptional<z.ZodString>;
|
|
10
|
+
userId: z.ZodOptional<z.ZodString>;
|
|
11
|
+
sort: z.ZodOptional<z.ZodEnum<{
|
|
12
|
+
createdAt: "createdAt";
|
|
13
|
+
type: "type";
|
|
14
|
+
}>>;
|
|
15
|
+
sortDirection: z.ZodOptional<z.ZodEnum<{
|
|
16
|
+
asc: "asc";
|
|
17
|
+
desc: "desc";
|
|
18
|
+
}>>;
|
|
19
|
+
from: z.ZodOptional<z.ZodISODateTime>;
|
|
20
|
+
to: z.ZodOptional<z.ZodISODateTime>;
|
|
21
|
+
filters: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
22
|
+
field: z.ZodLiteral<"tenantId">;
|
|
23
|
+
op: z.ZodLiteral<"in">;
|
|
24
|
+
value: z.ZodArray<z.ZodUUID>;
|
|
25
|
+
}, z.core.$strict>>>;
|
|
26
|
+
}, z.core.$strip>, {
|
|
27
|
+
rows: {
|
|
28
|
+
id: string;
|
|
29
|
+
tenantId: string;
|
|
30
|
+
aggregateId: string;
|
|
31
|
+
aggregateType: string;
|
|
32
|
+
version: number;
|
|
33
|
+
type: string;
|
|
34
|
+
payload: unknown;
|
|
35
|
+
metadata: unknown;
|
|
36
|
+
createdAt: unknown;
|
|
37
|
+
createdBy: string;
|
|
38
|
+
}[];
|
|
39
|
+
nextCursor: string | null;
|
|
40
|
+
nextBefore: string | null;
|
|
41
|
+
}, import("@cosmicdrift/kumiko-types/event-type-map").KumikoEventTypeMap>;
|
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
// SystemAdmin view of the audit trail across every tenant (the system tenant excluded, see
|
|
2
|
+
// allTenantsCondition). Rows carry their tenantId so the screen can label the tenant.
|
|
3
|
+
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
+
import * as z from "zod";
|
|
5
|
+
import { AUDIT_DATE_RANGE_CHECK, auditListPayloadShape, buildAuditWhere, listAuditEvents, } from "./audit-events.js";
|
|
6
|
+
import { requireAuditSystemDb } from "./audit-system-db.js";
|
|
7
|
+
import { allTenantsCondition, assertMayReadAllTenants } from "./resolve-audit-tenant.js";
|
|
8
|
+
const MAX_TENANT_FILTER_IDS = 100;
|
|
9
|
+
// The reference facet on the tenant column sends exactly this shape.
|
|
10
|
+
const tenantIdFiltersSchema = z
|
|
11
|
+
.array(z.strictObject({
|
|
12
|
+
field: z.literal("tenantId"),
|
|
13
|
+
op: z.literal("in"),
|
|
14
|
+
value: z.array(z.uuid()).max(MAX_TENANT_FILTER_IDS),
|
|
15
|
+
}))
|
|
16
|
+
.max(1);
|
|
17
|
+
export const listAllTenantsQuery = defineQueryHandler({
|
|
18
|
+
name: "list-all-tenants",
|
|
19
|
+
description: "Lists audit-trail events of every tenant newest-first with cursor paging, each row carrying its tenantId; filterable by tenant, aggregate type, aggregate id, event type, actor and time range. SystemAdmin only; events of the system tenant are not included.",
|
|
20
|
+
schema: z
|
|
21
|
+
.object({ ...auditListPayloadShape, filters: tenantIdFiltersSchema.optional() })
|
|
22
|
+
.refine(AUDIT_DATE_RANGE_CHECK.isValid, AUDIT_DATE_RANGE_CHECK.params),
|
|
23
|
+
access: { roles: access.systemAdmin },
|
|
24
|
+
handler: async (query, ctx) => {
|
|
25
|
+
assertMayReadAllTenants(query.user);
|
|
26
|
+
const p = query.payload;
|
|
27
|
+
const direction = p.sortDirection ?? "desc";
|
|
28
|
+
const where = buildAuditWhere(allTenantsCondition(p.filters?.[0]?.value), p, direction);
|
|
29
|
+
const db = requireAuditSystemDb(ctx.systemDb, "audit:query:list-all-tenants").acknowledgeCrossTenant("SystemAdmin reads the audit trail of every tenant");
|
|
30
|
+
return listAuditEvents(db, where, p, direction);
|
|
31
|
+
},
|
|
32
|
+
});
|
|
@@ -25,12 +25,13 @@ export declare const listQuery: import("@cosmicdrift/kumiko-types/define-handler
|
|
|
25
25
|
}, z.core.$strip>, {
|
|
26
26
|
rows: {
|
|
27
27
|
id: string;
|
|
28
|
+
tenantId: string;
|
|
28
29
|
aggregateId: string;
|
|
29
30
|
aggregateType: string;
|
|
30
31
|
version: number;
|
|
31
32
|
type: string;
|
|
32
33
|
payload: unknown;
|
|
33
|
-
metadata:
|
|
34
|
+
metadata: unknown;
|
|
34
35
|
createdAt: unknown;
|
|
35
36
|
createdBy: string;
|
|
36
37
|
}[];
|
|
@@ -7,116 +7,26 @@
|
|
|
7
7
|
// surface any audit UI needs; tenant-isolated at the WHERE level so cross-
|
|
8
8
|
// tenant peeking is structurally impossible for non-SystemAdmin callers.
|
|
9
9
|
// A SystemAdmin can pass scope "system" to read the app-instance system events
|
|
10
|
-
// (e.g. app.started);
|
|
11
|
-
//
|
|
12
|
-
// Event payloads hold PII as subject-KMS ciphertext; it is replaced by
|
|
13
|
-
// REDACTED_PII_PLACEHOLDER before returning, since the API leak guard refuses ciphertext.
|
|
14
|
-
import { selectMany } from "@cosmicdrift/kumiko-framework/db";
|
|
10
|
+
// (e.g. app.started); list-all-tenants is the one other cross-tenant read.
|
|
15
11
|
import { access, defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
16
|
-
import { eventsTable } from "@cosmicdrift/kumiko-framework/event-store";
|
|
17
|
-
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
18
12
|
import * as z from "zod";
|
|
19
|
-
import {
|
|
20
|
-
import {
|
|
13
|
+
import { AUDIT_SCOPE_VALUES } from "../web/constants.js";
|
|
14
|
+
import { AUDIT_DATE_RANGE_CHECK, auditListPayloadShape, buildAuditWhere, listAuditEvents, } from "./audit-events.js";
|
|
15
|
+
import { requireAuditSystemDb } from "./audit-system-db.js";
|
|
21
16
|
import { resolveAuditScopeFilter } from "./resolve-audit-tenant.js";
|
|
22
|
-
const MAX_LIMIT = 100;
|
|
23
|
-
function buildDateRange(from, to) {
|
|
24
|
-
if (!from && !to)
|
|
25
|
-
return null;
|
|
26
|
-
const range = {};
|
|
27
|
-
if (from)
|
|
28
|
-
range.gte = Temporal.Instant.from(from);
|
|
29
|
-
if (to)
|
|
30
|
-
range.lte = Temporal.Instant.from(to);
|
|
31
|
-
return range;
|
|
32
|
-
}
|
|
33
|
-
function escapeLikePattern(value) {
|
|
34
|
-
return value.replace(/[\\%_]/g, (m) => `\\${m}`);
|
|
35
|
-
}
|
|
36
|
-
function buildAuditWhere(tenantId, p, direction) {
|
|
37
|
-
const where = { tenantId };
|
|
38
|
-
if (p.aggregateType)
|
|
39
|
-
where["aggregateType"] = p.aggregateType;
|
|
40
|
-
if (p.aggregateId)
|
|
41
|
-
where["aggregateId"] = p.aggregateId;
|
|
42
|
-
if (p.eventType)
|
|
43
|
-
where["type"] = p.eventType;
|
|
44
|
-
else if (p.search)
|
|
45
|
-
where["type"] = { like: `%${escapeLikePattern(p.search)}%` };
|
|
46
|
-
if (p.userId)
|
|
47
|
-
where["createdBy"] = p.userId;
|
|
48
|
-
const range = buildDateRange(p.from, p.to);
|
|
49
|
-
if (range)
|
|
50
|
-
where["createdAt"] = range;
|
|
51
|
-
const cursor = p.cursor ?? p.before;
|
|
52
|
-
// The cursor is an event id, so it only walks pages in id order: ascending
|
|
53
|
-
// pages continue past it, descending pages stop before it.
|
|
54
|
-
if (cursor)
|
|
55
|
-
where["id"] = direction === "asc" ? { gt: BigInt(cursor) } : { lt: BigInt(cursor) };
|
|
56
|
-
return where;
|
|
57
|
-
}
|
|
58
17
|
export const listQuery = defineQueryHandler({
|
|
59
18
|
name: "list",
|
|
60
19
|
description: 'Lists the tenant\'s audit-trail events newest-first with cursor paging, filterable by aggregate type, aggregate id, event type, actor and time range; use it to answer who changed what and when. A SystemAdmin can set scope "system" to read the app-instance system events (e.g. app.started) instead of the own tenant.',
|
|
61
20
|
schema: z
|
|
62
|
-
.object({
|
|
63
|
-
|
|
64
|
-
before: z.string().regex(/^\d+$/, "cursor must be a positive integer").optional(),
|
|
65
|
-
search: z.string().trim().optional(),
|
|
66
|
-
limit: z.number().int().min(1).max(MAX_LIMIT).default(50),
|
|
67
|
-
aggregateType: z.string().optional(),
|
|
68
|
-
aggregateId: z.uuid().optional(),
|
|
69
|
-
eventType: z.string().optional(),
|
|
70
|
-
userId: z.string().optional(),
|
|
71
|
-
sort: z.enum(["createdAt", "type"]).optional(),
|
|
72
|
-
sortDirection: z.enum(["asc", "desc"]).optional(),
|
|
73
|
-
from: z.iso.datetime().optional(),
|
|
74
|
-
to: z.iso.datetime().optional(),
|
|
75
|
-
scope: z.enum(AUDIT_SCOPE_VALUES).optional(),
|
|
76
|
-
})
|
|
77
|
-
.refine((v) => !v.from || !v.to || v.from <= v.to, {
|
|
78
|
-
message: "`from` must be less than or equal to `to`",
|
|
79
|
-
path: ["from"],
|
|
80
|
-
}),
|
|
21
|
+
.object({ ...auditListPayloadShape, scope: z.enum(AUDIT_SCOPE_VALUES).optional() })
|
|
22
|
+
.refine(AUDIT_DATE_RANGE_CHECK.isValid, AUDIT_DATE_RANGE_CHECK.params),
|
|
81
23
|
access: { roles: access.admin },
|
|
82
24
|
handler: async (query, ctx) => {
|
|
83
25
|
const p = query.payload;
|
|
84
26
|
const scopeFilter = resolveAuditScopeFilter(query.user, p.scope);
|
|
85
27
|
const direction = p.sortDirection ?? "desc";
|
|
86
|
-
const where = buildAuditWhere(scopeFilter.tenantId, {
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
}, direction);
|
|
90
|
-
const rows = await selectMany(ctx.db, eventsTable, where, {
|
|
91
|
-
// The id cursor only resumes an id-ordered listing. created_at comes from the
|
|
92
|
-
// transaction start and can run against insert order, so ordering by it would let
|
|
93
|
-
// a page boundary skip rows; only the type sort leaves id order (and is one page).
|
|
94
|
-
orderBy: p.sort === "type"
|
|
95
|
-
? [
|
|
96
|
-
{ col: "type", direction },
|
|
97
|
-
{ col: "id", direction },
|
|
98
|
-
]
|
|
99
|
-
: [{ col: "id", direction }],
|
|
100
|
-
limit: p.limit,
|
|
101
|
-
});
|
|
102
|
-
const serialised = rows.map((r) => ({
|
|
103
|
-
id: String(r.id),
|
|
104
|
-
aggregateId: r.aggregateId,
|
|
105
|
-
aggregateType: r.aggregateType,
|
|
106
|
-
version: r.version,
|
|
107
|
-
type: r.type,
|
|
108
|
-
payload: redactPiiCiphertext(r.payload),
|
|
109
|
-
metadata: r.metadata,
|
|
110
|
-
createdAt: r.createdAt,
|
|
111
|
-
createdBy: r.createdBy,
|
|
112
|
-
}));
|
|
113
|
-
const last = serialised[serialised.length - 1];
|
|
114
|
-
// An id cursor cannot resume a type-ordered listing, so that sort is one page.
|
|
115
|
-
const nextId = serialised.length === p.limit && last && p.sort !== "type" ? last.id : null;
|
|
116
|
-
return {
|
|
117
|
-
rows: serialised,
|
|
118
|
-
nextCursor: nextId,
|
|
119
|
-
nextBefore: nextId,
|
|
120
|
-
};
|
|
28
|
+
const where = buildAuditWhere(scopeFilter.tenantId, { ...p, aggregateType: scopeFilter.aggregateType ?? p.aggregateType }, direction);
|
|
29
|
+
const db = requireAuditSystemDb(ctx.systemDb, "audit:query:list").assertTenantMatch(query.user.tenantId);
|
|
30
|
+
return listAuditEvents(db, where, p, direction);
|
|
121
31
|
},
|
|
122
32
|
});
|
|
@@ -1,7 +1,9 @@
|
|
|
1
1
|
import { type SessionUser } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { type AuditScope } from "../constants.ts";
|
|
2
|
+
import { type AuditScope } from "../web/constants.ts";
|
|
3
3
|
export type AuditScopeFilter = {
|
|
4
4
|
readonly tenantId: string;
|
|
5
5
|
readonly aggregateType?: string;
|
|
6
6
|
};
|
|
7
7
|
export declare function resolveAuditScopeFilter(user: SessionUser, scope: AuditScope | undefined): AuditScopeFilter;
|
|
8
|
+
export declare function assertMayReadAllTenants(user: SessionUser): void;
|
|
9
|
+
export declare function allTenantsCondition(requestedTenantIds: readonly string[] | undefined): unknown;
|
|
@@ -2,17 +2,31 @@ import { mayOverrideTenant } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
2
2
|
import { AccessDeniedError, FrameworkReasons } from "@cosmicdrift/kumiko-framework/errors";
|
|
3
3
|
import { APP_INSTANCE_STREAM_TYPE } from "@cosmicdrift/kumiko-framework/event-store";
|
|
4
4
|
import { SYSTEM_TENANT_ID } from "@cosmicdrift/kumiko-types/identifiers";
|
|
5
|
-
import { AuditScopes } from "../constants.js";
|
|
5
|
+
import { AuditScopes } from "../web/constants.js";
|
|
6
|
+
function denySystemAdminOnlyRead() {
|
|
7
|
+
throw new AccessDeniedError({
|
|
8
|
+
i18nKey: "audit.errors.systemScopeRequiresSystemAdmin",
|
|
9
|
+
details: { reason: FrameworkReasons.tenantOverrideRequiresSystemAdmin },
|
|
10
|
+
});
|
|
11
|
+
}
|
|
6
12
|
// The system tenant also holds personal streams of other features (session
|
|
7
13
|
// revocations, exports, ...); only app-instance streams are released.
|
|
8
14
|
export function resolveAuditScopeFilter(user, scope) {
|
|
9
15
|
if (scope !== AuditScopes.system)
|
|
10
16
|
return { tenantId: user.tenantId };
|
|
11
|
-
if (!mayOverrideTenant(user))
|
|
12
|
-
|
|
13
|
-
i18nKey: "audit.errors.systemScopeRequiresSystemAdmin",
|
|
14
|
-
details: { reason: FrameworkReasons.tenantOverrideRequiresSystemAdmin },
|
|
15
|
-
});
|
|
16
|
-
}
|
|
17
|
+
if (!mayOverrideTenant(user))
|
|
18
|
+
denySystemAdminOnlyRead();
|
|
17
19
|
return { tenantId: SYSTEM_TENANT_ID, aggregateType: APP_INSTANCE_STREAM_TYPE };
|
|
18
20
|
}
|
|
21
|
+
export function assertMayReadAllTenants(user) {
|
|
22
|
+
if (!mayOverrideTenant(user))
|
|
23
|
+
denySystemAdminOnlyRead();
|
|
24
|
+
}
|
|
25
|
+
// The where condition for reads across tenants. The system tenant is always excluded: it holds
|
|
26
|
+
// personal streams of other features, and a where object cannot express "only app-instance
|
|
27
|
+
// streams of that one tenant" next to "every other tenant".
|
|
28
|
+
export function allTenantsCondition(requestedTenantIds) {
|
|
29
|
+
if (requestedTenantIds === undefined)
|
|
30
|
+
return { ne: SYSTEM_TENANT_ID };
|
|
31
|
+
return { in: requestedTenantIds.filter((id) => id !== SYSTEM_TENANT_ID) };
|
|
32
|
+
}
|
package/dist/audit/index.d.ts
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AUDIT_FEATURE, AuditQueries } from "./constants.ts";
|
|
2
1
|
export { createEscapeHatchAuditSink, ESCAPE_HATCH_USED_EVENT } from "./escape-hatch-audit-sink.ts";
|
|
3
2
|
export { createAuditFeature } from "./feature.ts";
|
|
3
|
+
export { AUDIT_FEATURE, AuditQueries } from "./web/constants.ts";
|
package/dist/audit/index.js
CHANGED
|
@@ -1,3 +1,3 @@
|
|
|
1
|
-
export { AUDIT_FEATURE, AuditQueries } from "./constants.js";
|
|
2
1
|
export { createEscapeHatchAuditSink, ESCAPE_HATCH_USED_EVENT } from "./escape-hatch-audit-sink.js";
|
|
3
2
|
export { createAuditFeature } from "./feature.js";
|
|
3
|
+
export { AUDIT_FEATURE, AuditQueries } from "./web/constants.js";
|
|
@@ -6,8 +6,8 @@ import { pruneEvents } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
|
6
6
|
import { getTemporal } from "@cosmicdrift/kumiko-framework/time";
|
|
7
7
|
import { resolveProfileForTenant } from "../compliance-profiles/index.js";
|
|
8
8
|
import { createConfigAccessor } from "../config/index.js";
|
|
9
|
-
import { DEFAULT_ESCAPE_HATCH_RETENTION_DAYS, ESCAPE_HATCH_RETENTION_DAYS_KEY, } from "./constants.js";
|
|
10
9
|
import { ESCAPE_HATCH_USE_AGGREGATE_TYPE, escapeHatchUsedSchema, } from "./escape-hatch-audit-sink.js";
|
|
10
|
+
import { DEFAULT_ESCAPE_HATCH_RETENTION_DAYS, ESCAPE_HATCH_RETENTION_DAYS_KEY, } from "./web/constants.js";
|
|
11
11
|
// pruneEvents opens its own transaction, so a runner that cannot begin one (a tx handle) is rejected instead of nested.
|
|
12
12
|
export function isDbConnection(runner) {
|
|
13
13
|
return runnerCanBeginTransaction(runner);
|
|
@@ -0,0 +1,65 @@
|
|
|
1
|
+
import type { EditLayout } from "@cosmicdrift/kumiko-framework/ui-types";
|
|
2
|
+
export declare const AUDIT_LOG_COLUMNS: readonly [{
|
|
3
|
+
readonly field: "createdAt";
|
|
4
|
+
readonly label: string;
|
|
5
|
+
readonly renderer: {
|
|
6
|
+
readonly format: "timestamp";
|
|
7
|
+
};
|
|
8
|
+
}, {
|
|
9
|
+
readonly field: "type";
|
|
10
|
+
readonly label: string;
|
|
11
|
+
}, {
|
|
12
|
+
readonly refEntity: "user:user";
|
|
13
|
+
readonly refLabelField: "displayName";
|
|
14
|
+
readonly field: "createdBy";
|
|
15
|
+
readonly label: string;
|
|
16
|
+
}];
|
|
17
|
+
export declare const AUDIT_LOG_ALL_TENANTS_COLUMNS: readonly [{
|
|
18
|
+
readonly field: "createdAt";
|
|
19
|
+
readonly label: string;
|
|
20
|
+
readonly renderer: {
|
|
21
|
+
readonly format: "timestamp";
|
|
22
|
+
};
|
|
23
|
+
}, {
|
|
24
|
+
readonly refEntity: "tenant:tenant";
|
|
25
|
+
readonly refLabelField: "name";
|
|
26
|
+
readonly field: "tenantId";
|
|
27
|
+
readonly label: string;
|
|
28
|
+
}, {
|
|
29
|
+
readonly field: "type";
|
|
30
|
+
readonly label: string;
|
|
31
|
+
}, {
|
|
32
|
+
readonly refEntity: "user:user";
|
|
33
|
+
readonly refLabelField: "displayName";
|
|
34
|
+
readonly field: "createdBy";
|
|
35
|
+
readonly label: string;
|
|
36
|
+
}];
|
|
37
|
+
export declare const AUDIT_LOG_DATE_RANGE_FACET: {
|
|
38
|
+
readonly type: "dateRange";
|
|
39
|
+
readonly field: "createdAt";
|
|
40
|
+
readonly label: string;
|
|
41
|
+
readonly params: {
|
|
42
|
+
readonly from: "from";
|
|
43
|
+
readonly to: "to";
|
|
44
|
+
};
|
|
45
|
+
};
|
|
46
|
+
export declare const AUDIT_LOG_TENANT_FACET: {
|
|
47
|
+
readonly type: "reference";
|
|
48
|
+
readonly field: "tenantId";
|
|
49
|
+
readonly label: string;
|
|
50
|
+
readonly entity: "tenant:tenant";
|
|
51
|
+
readonly labelField: "name";
|
|
52
|
+
};
|
|
53
|
+
export declare const AUDIT_LOG_DETAIL_FIELD_LABELS: {
|
|
54
|
+
readonly type: string;
|
|
55
|
+
readonly createdAt: string;
|
|
56
|
+
readonly aggregateType: string;
|
|
57
|
+
readonly aggregateId: string;
|
|
58
|
+
readonly createdBy: string;
|
|
59
|
+
readonly id: string;
|
|
60
|
+
readonly payload: string;
|
|
61
|
+
readonly metadata: string;
|
|
62
|
+
};
|
|
63
|
+
export declare function auditLogDetailLayout(options: {
|
|
64
|
+
readonly withTenant: boolean;
|
|
65
|
+
}): EditLayout;
|
|
@@ -0,0 +1,73 @@
|
|
|
1
|
+
// Columns, labels and layout shared by the tenant audit log and its all-tenants variant, so the
|
|
2
|
+
// two screen pairs cannot drift apart. The all-tenants variant only adds the tenant.
|
|
3
|
+
import { i18nKey } from "@cosmicdrift/kumiko-framework/engine";
|
|
4
|
+
const TENANT_REFERENCE = { refEntity: "tenant:tenant", refLabelField: "name" };
|
|
5
|
+
const ACTOR_REFERENCE = { refEntity: "user:user", refLabelField: "displayName" };
|
|
6
|
+
const WHEN_COLUMN = {
|
|
7
|
+
field: "createdAt",
|
|
8
|
+
label: i18nKey("audit.log.col.when"),
|
|
9
|
+
renderer: { format: "timestamp" },
|
|
10
|
+
};
|
|
11
|
+
const TENANT_COLUMN = {
|
|
12
|
+
field: "tenantId",
|
|
13
|
+
label: i18nKey("audit.log.col.tenant"),
|
|
14
|
+
...TENANT_REFERENCE,
|
|
15
|
+
};
|
|
16
|
+
const TYPE_COLUMN = { field: "type", label: i18nKey("audit.log.col.type") };
|
|
17
|
+
const ACTOR_COLUMN = {
|
|
18
|
+
field: "createdBy",
|
|
19
|
+
label: i18nKey("audit.log.col.actor"),
|
|
20
|
+
...ACTOR_REFERENCE,
|
|
21
|
+
};
|
|
22
|
+
export const AUDIT_LOG_COLUMNS = [WHEN_COLUMN, TYPE_COLUMN, ACTOR_COLUMN];
|
|
23
|
+
export const AUDIT_LOG_ALL_TENANTS_COLUMNS = [
|
|
24
|
+
WHEN_COLUMN,
|
|
25
|
+
TENANT_COLUMN,
|
|
26
|
+
TYPE_COLUMN,
|
|
27
|
+
ACTOR_COLUMN,
|
|
28
|
+
];
|
|
29
|
+
export const AUDIT_LOG_DATE_RANGE_FACET = {
|
|
30
|
+
type: "dateRange",
|
|
31
|
+
field: "createdAt",
|
|
32
|
+
label: i18nKey("audit.log.col.when"),
|
|
33
|
+
params: { from: "from", to: "to" },
|
|
34
|
+
};
|
|
35
|
+
export const AUDIT_LOG_TENANT_FACET = {
|
|
36
|
+
type: "reference",
|
|
37
|
+
field: "tenantId",
|
|
38
|
+
label: i18nKey("audit.log.col.tenant"),
|
|
39
|
+
entity: TENANT_REFERENCE.refEntity,
|
|
40
|
+
labelField: TENANT_REFERENCE.refLabelField,
|
|
41
|
+
};
|
|
42
|
+
export const AUDIT_LOG_DETAIL_FIELD_LABELS = {
|
|
43
|
+
type: i18nKey("audit.log.col.type"),
|
|
44
|
+
createdAt: i18nKey("audit.log.col.when"),
|
|
45
|
+
aggregateType: i18nKey("audit.log.col.aggregateType"),
|
|
46
|
+
aggregateId: i18nKey("audit.log.col.aggregateId"),
|
|
47
|
+
createdBy: i18nKey("audit.log.col.actor"),
|
|
48
|
+
id: i18nKey("audit.log.detail.field.id"),
|
|
49
|
+
payload: i18nKey("audit.log.detail.payload"),
|
|
50
|
+
metadata: i18nKey("audit.log.detail.metadata"),
|
|
51
|
+
};
|
|
52
|
+
export function auditLogDetailLayout(options) {
|
|
53
|
+
return {
|
|
54
|
+
sections: [
|
|
55
|
+
{
|
|
56
|
+
fields: [
|
|
57
|
+
"type",
|
|
58
|
+
{ field: "createdAt", renderer: { format: "timestamp" } },
|
|
59
|
+
...(options.withTenant ? [{ field: "tenantId", ...TENANT_REFERENCE }] : []),
|
|
60
|
+
"aggregateType",
|
|
61
|
+
"aggregateId",
|
|
62
|
+
{ field: "createdBy", ...ACTOR_REFERENCE },
|
|
63
|
+
"id",
|
|
64
|
+
],
|
|
65
|
+
},
|
|
66
|
+
// No section `title` here (fw#2312 label-dedup fix): each section
|
|
67
|
+
// holds exactly one field, so a title would repeat the field's own
|
|
68
|
+
// label (rendered by RenderField as the Field's heading) verbatim.
|
|
69
|
+
{ fields: [{ field: "payload", renderer: { format: "json" } }] },
|
|
70
|
+
{ fields: [{ field: "metadata", renderer: { format: "json" } }] },
|
|
71
|
+
],
|
|
72
|
+
};
|
|
73
|
+
}
|
|
@@ -1,7 +1,6 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import { mergeTranslations } from "@cosmicdrift/kumiko-renderer";
|
|
3
|
-
import { AUDIT_FEATURE } from "
|
|
4
|
-
import { defaultTranslations } from "./
|
|
2
|
+
import { AUDIT_FEATURE } from "./constants.js";
|
|
3
|
+
import { defaultTranslations } from "./default-translations.js";
|
|
5
4
|
export function auditClient(options) {
|
|
6
5
|
return {
|
|
7
6
|
name: AUDIT_FEATURE,
|
|
@@ -8,6 +8,8 @@ export declare const SYSTEM_ACTOR_IDS: ReadonlySet<string>;
|
|
|
8
8
|
export declare const AuditQueries: {
|
|
9
9
|
readonly list: "audit:query:list";
|
|
10
10
|
readonly details: "audit:query:details";
|
|
11
|
+
readonly listAllTenants: "audit:query:list-all-tenants";
|
|
12
|
+
readonly detailsAllTenants: "audit:query:details-all-tenants";
|
|
11
13
|
};
|
|
12
14
|
/** Read scope of the audit queries: the caller's own tenant (default) or the system tenant (SystemAdmin only). */
|
|
13
15
|
export declare const AuditScopes: {
|
|
@@ -20,6 +22,12 @@ export declare const AUDIT_SCOPE_VALUES: readonly ["tenant", "system"];
|
|
|
20
22
|
export declare const AUDIT_LOG_SCREEN_ID: "audit-log";
|
|
21
23
|
/** Single-event detail screen, breadcrumb-linked to the audit-log list. */
|
|
22
24
|
export declare const AUDIT_LOG_DETAIL_SCREEN_ID: "audit-log-detail";
|
|
25
|
+
/** SystemAdmin audit log across every tenant. Nav: `audit:nav:audit-log-all-tenants`. */
|
|
26
|
+
export declare const AUDIT_LOG_ALL_TENANTS_SCREEN_ID: "audit-log-all-tenants";
|
|
27
|
+
/** Single-event detail screen of the all-tenants log. */
|
|
28
|
+
export declare const AUDIT_LOG_ALL_TENANTS_DETAIL_SCREEN_ID: "audit-log-all-tenants-detail";
|
|
29
|
+
/** Nav entry of the all-tenants log (short id; QN `audit:nav:audit-log-all-tenants`). */
|
|
30
|
+
export declare const AUDIT_LOG_ALL_TENANTS_NAV_ID: "audit-log-all-tenants";
|
|
23
31
|
/**
|
|
24
32
|
* Config key (system scope) for how long `escapeHatchUse` audit events are kept. Only a fallback
|
|
25
33
|
* for apps without compliance-profiles; with it mounted, the tenant profile's `auditLog.retention`
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Qualified handler names + screen ids — shared by server feature and web client.
|
|
3
2
|
export const AUDIT_FEATURE = "audit";
|
|
4
3
|
/** Literal `createdBy` written by hand-built system actors (secrets/jobs/…). */
|
|
@@ -13,6 +12,8 @@ export const SYSTEM_ACTOR_IDS = new Set([
|
|
|
13
12
|
export const AuditQueries = {
|
|
14
13
|
list: "audit:query:list",
|
|
15
14
|
details: "audit:query:details",
|
|
15
|
+
listAllTenants: "audit:query:list-all-tenants",
|
|
16
|
+
detailsAllTenants: "audit:query:details-all-tenants",
|
|
16
17
|
};
|
|
17
18
|
/** Read scope of the audit queries: the caller's own tenant (default) or the system tenant (SystemAdmin only). */
|
|
18
19
|
export const AuditScopes = { tenant: "tenant", system: "system" };
|
|
@@ -21,6 +22,12 @@ export const AUDIT_SCOPE_VALUES = [AuditScopes.tenant, AuditScopes.system];
|
|
|
21
22
|
export const AUDIT_LOG_SCREEN_ID = "audit-log";
|
|
22
23
|
/** Single-event detail screen, breadcrumb-linked to the audit-log list. */
|
|
23
24
|
export const AUDIT_LOG_DETAIL_SCREEN_ID = "audit-log-detail";
|
|
25
|
+
/** SystemAdmin audit log across every tenant. Nav: `audit:nav:audit-log-all-tenants`. */
|
|
26
|
+
export const AUDIT_LOG_ALL_TENANTS_SCREEN_ID = "audit-log-all-tenants";
|
|
27
|
+
/** Single-event detail screen of the all-tenants log. */
|
|
28
|
+
export const AUDIT_LOG_ALL_TENANTS_DETAIL_SCREEN_ID = "audit-log-all-tenants-detail";
|
|
29
|
+
/** Nav entry of the all-tenants log (short id; QN `audit:nav:audit-log-all-tenants`). */
|
|
30
|
+
export const AUDIT_LOG_ALL_TENANTS_NAV_ID = "audit-log-all-tenants";
|
|
24
31
|
/**
|
|
25
32
|
* Config key (system scope) for how long `escapeHatchUse` audit events are kept. Only a fallback
|
|
26
33
|
* for apps without compliance-profiles; with it mounted, the tenant profile's `auditLog.retention`
|
package/dist/audit/web/i18n.d.ts
CHANGED
|
@@ -1,2 +1,5 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
1
|
+
type LocalizedString = {
|
|
2
|
+
readonly en: string;
|
|
3
|
+
};
|
|
4
|
+
export declare const AUDIT_I18N: Readonly<Record<string, LocalizedString>>;
|
|
5
|
+
export {};
|
package/dist/audit/web/i18n.js
CHANGED
|
@@ -1,4 +1,31 @@
|
|
|
1
|
-
//
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
1
|
+
// Server + client i18n for audit (nav labels + audit-log/-detail screens).
|
|
2
|
+
export const AUDIT_I18N = {
|
|
3
|
+
"screen:audit-log.title": { en: "Audit log" },
|
|
4
|
+
"screen:audit-log-detail.title": { en: "Event" },
|
|
5
|
+
"audit.log.description": {
|
|
6
|
+
en: "All events of this tenant. A row opens the details.",
|
|
7
|
+
},
|
|
8
|
+
"audit.log.allTenants.description": {
|
|
9
|
+
en: "All events of all tenants. A row opens the details.",
|
|
10
|
+
},
|
|
11
|
+
"audit.log.detail.subtitle": {
|
|
12
|
+
en: "One event with its actor, time and stored data.",
|
|
13
|
+
},
|
|
14
|
+
"audit.errors.systemScopeRequiresSystemAdmin": {
|
|
15
|
+
en: "Only SystemAdmin may read system events.",
|
|
16
|
+
},
|
|
17
|
+
"screen:audit-log-all-tenants.title": { en: "Audit log (all tenants)" },
|
|
18
|
+
"screen:audit-log-all-tenants-detail.title": { en: "Event" },
|
|
19
|
+
"audit:nav.auditLog": { en: "Audit" },
|
|
20
|
+
"audit:nav.auditLogAllTenants": { en: "Audit log (all tenants)" },
|
|
21
|
+
"audit.log.col.tenant": { en: "Tenant" },
|
|
22
|
+
"audit.log.col.when": { en: "When" },
|
|
23
|
+
"audit.log.col.type": { en: "Event" },
|
|
24
|
+
"audit.log.col.aggregateType": { en: "Aggregate type" },
|
|
25
|
+
"audit.log.col.aggregateId": { en: "Aggregate ID" },
|
|
26
|
+
"audit.log.col.actor": { en: "Actor" },
|
|
27
|
+
"audit.log.details": { en: "Details" },
|
|
28
|
+
"audit.log.detail.payload": { en: "Event payload" },
|
|
29
|
+
"audit.log.detail.metadata": { en: "Metadata" },
|
|
30
|
+
"audit.log.detail.field.id": { en: "Event ID" },
|
|
31
|
+
};
|
package/dist/audit/web/index.js
CHANGED
|
@@ -4,7 +4,7 @@ import { type Registry, type TenantId, type WriteResult } from "@cosmicdrift/kum
|
|
|
4
4
|
import type { Dispatcher } from "@cosmicdrift/kumiko-framework/pipeline";
|
|
5
5
|
import type { EnvelopeCipher } from "@cosmicdrift/kumiko-framework/secrets";
|
|
6
6
|
import type { Redis } from "ioredis";
|
|
7
|
-
import type { GlobalRole } from "../user/constants.ts";
|
|
7
|
+
import type { GlobalRole } from "../user/web/constants.ts";
|
|
8
8
|
export type BootstrapInvite = {
|
|
9
9
|
readonly email: string;
|
|
10
10
|
/** Membership role in the tenant, validated like a tenant-admin invite
|
|
@@ -9,21 +9,21 @@ import { fetchOne } from "@cosmicdrift/kumiko-framework/db";
|
|
|
9
9
|
import { ConfigScopes, createSystemUser, } from "@cosmicdrift/kumiko-framework/engine";
|
|
10
10
|
import { parseRoles } from "@cosmicdrift/kumiko-framework/utils";
|
|
11
11
|
// kumiko-lint-ignore cross-feature-import bootstrap sets per-tenant config through the config feature's write handler
|
|
12
|
-
import { ConfigHandlers } from "../config/constants.js";
|
|
12
|
+
import { ConfigHandlers } from "../config/web/constants.js";
|
|
13
13
|
// kumiko-lint-ignore cross-feature-import bootstrap compares against the stored config row to stay idempotent
|
|
14
14
|
import { configRowHoldsValue, findConfigRow } from "../config/write-helpers.js";
|
|
15
15
|
// kumiko-lint-ignore cross-feature-import bootstrap provisions tenant + invitation rows owned by the tenant feature
|
|
16
|
-
import { TenantHandlers } from "../tenant/constants.js";
|
|
17
|
-
// kumiko-lint-ignore cross-feature-import bootstrap provisions tenant + invitation rows owned by the tenant feature
|
|
18
16
|
import { INVITATION_STATUS, tenantInvitationsTable } from "../tenant/invitation-table.js";
|
|
19
17
|
// kumiko-lint-ignore cross-feature-import bootstrap checks existing memberships
|
|
20
18
|
import { tenantMembershipsTable } from "../tenant/membership-table.js";
|
|
21
19
|
// kumiko-lint-ignore cross-feature-import bootstrap checks for an existing tenant
|
|
22
20
|
import { tenantTable } from "../tenant/schema/tenant.js";
|
|
21
|
+
// kumiko-lint-ignore cross-feature-import bootstrap provisions tenant + invitation rows owned by the tenant feature
|
|
22
|
+
import { TenantHandlers } from "../tenant/web/constants.js";
|
|
23
23
|
// kumiko-lint-ignore cross-feature-import bootstrap skips already activated users
|
|
24
24
|
import { userTable } from "../user/schema/user.js";
|
|
25
|
-
import { AuthHandlers } from "./constants.js";
|
|
26
25
|
import { hasLiveInviteToken } from "./invite-token-store.js";
|
|
26
|
+
import { AuthHandlers } from "./web/constants.js";
|
|
27
27
|
export class BootstrapPlanError extends Error {
|
|
28
28
|
}
|
|
29
29
|
export class BootstrapWriteError extends Error {
|