@cosmicdrift/kumiko-samples 0.377.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/package.json +1 -1
- package/packages/bundled-features/package.json +18 -17
- package/packages/bundled-features/src/account-security/feature.ts +2 -2
- package/packages/bundled-features/src/account-security/index.ts +8 -8
- package/packages/bundled-features/src/account-security/{constants.ts → web/constants.ts} +0 -2
- package/packages/bundled-features/src/account-security/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/feature.ts +10 -9
- package/packages/bundled-features/src/admin-shell/index.ts +8 -8
- package/packages/bundled-features/src/admin-shell/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/admin-shell/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/admin-shell/web/default-translations.ts +10 -0
- package/packages/bundled-features/src/admin-shell/web/i18n.ts +51 -9
- package/packages/bundled-features/src/admin-shell/web/index.ts +0 -1
- package/packages/bundled-features/src/audit/changes.json +7 -0
- package/packages/bundled-features/src/audit/feature.ts +72 -64
- package/packages/bundled-features/src/audit/handlers/audit-events.ts +153 -0
- package/packages/bundled-features/src/audit/handlers/audit-system-db.ts +13 -0
- package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +26 -0
- package/packages/bundled-features/src/audit/handlers/details.query.ts +11 -39
- package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +47 -0
- package/packages/bundled-features/src/audit/handlers/list.query.ts +16 -123
- package/packages/bundled-features/src/audit/handlers/resolve-audit-tenant.ts +21 -7
- package/packages/bundled-features/src/audit/index.ts +1 -1
- package/packages/bundled-features/src/audit/run-escape-hatch-retention.ts +4 -4
- package/packages/bundled-features/src/audit/screens.ts +82 -0
- package/packages/bundled-features/src/audit/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/audit/{constants.ts → web/constants.ts} +11 -1
- package/packages/bundled-features/src/audit/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/audit/web/i18n.ts +33 -7
- package/packages/bundled-features/src/audit/web/index.ts +0 -2
- package/packages/bundled-features/src/auth-email-password/bootstrap.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/changes.json +6 -0
- package/packages/bundled-features/src/auth-email-password/errors.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/feature.ts +2 -2
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +4 -4
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +38 -4
- package/packages/bundled-features/src/auth-email-password/handlers/request-account-unlock.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-email-verification.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/request-password-reset.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/reset-password.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/verify-email.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/index.ts +6 -1
- package/packages/bundled-features/src/auth-email-password/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/signup-activation.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-logic.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/auth-redirect.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-actions.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{i18n.ts → web/i18n.ts} +3 -4
- package/packages/bundled-features/src/auth-email-password/web/index.ts +1 -2
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/{mail-i18n.ts → web/mail-i18n.ts} +0 -1
- package/packages/bundled-features/src/auth-email-password/web/request-account-unlock-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session-bootstrap-error.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +2 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-menu-items.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +0 -1
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +0 -1
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/changes.json +6 -0
- package/packages/bundled-features/src/auth-mfa/errors.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/index.ts +8 -8
- package/packages/bundled-features/src/auth-mfa/mfa-status-checker.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/screens.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/index.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-disable-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-recovery-codes-reveal.tsx +0 -1
- package/packages/bundled-features/src/auth-mfa/web/mfa-regenerate-recovery-dialog.tsx +1 -2
- package/packages/bundled-features/src/auth-mfa/web/mfa-setup-preauth-screen.tsx +21 -23
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +0 -1
- package/packages/bundled-features/src/billing-foundation/changes.json +18 -0
- package/packages/bundled-features/src/billing-foundation/checkout-core.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/consent-text.ts +2 -2
- package/packages/bundled-features/src/billing-foundation/consumer-protection/issue-confirmation.ts +11 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/mail-notifications.ts +11 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-consent.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/register-termination.ts +12 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/stored-user-email.ts +12 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-mail.ts +6 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-notify.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-pages.ts +167 -28
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-record.ts +102 -3
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-request.ts +43 -12
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-revoke.ts +202 -0
- package/packages/bundled-features/src/billing-foundation/consumer-protection/termination-texts.ts +70 -0
- package/packages/bundled-features/src/billing-foundation/events.ts +20 -2
- package/packages/bundled-features/src/billing-foundation/feature.ts +5 -5
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +82 -9
- package/packages/bundled-features/src/billing-foundation/handlers/switch-plan.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/handlers/sync-subscription.write.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/index.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/plan-catalog.ts +7 -7
- package/packages/bundled-features/src/billing-foundation/screens.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +1 -1
- package/packages/bundled-features/src/billing-foundation/types.ts +17 -3
- package/packages/bundled-features/src/billing-foundation/validate-options.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-contact-plan.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +5 -7
- package/packages/bundled-features/src/billing-foundation/web/cancel-contract-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/checkout-consent-dialog.tsx +1 -3
- package/packages/bundled-features/src/billing-foundation/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/billing-foundation/{constants.ts → web/constants.ts} +37 -31
- package/packages/bundled-features/src/billing-foundation/{consumer-protection → web/consumer-protection}/consent-locale.ts +0 -1
- package/packages/bundled-features/src/billing-foundation/{contact-card.ts → web/contact-card.ts} +0 -2
- package/packages/bundled-features/src/billing-foundation/web/index.ts +14 -15
- package/packages/bundled-features/src/billing-foundation/web/localized-params.ts +0 -2
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +5 -2
- package/packages/bundled-features/src/cap-counter/changes.json +12 -0
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +9 -0
- package/packages/bundled-features/src/cap-overview/feature.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -1
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +2 -2
- package/packages/bundled-features/src/cap-overview/index.ts +9 -9
- package/packages/bundled-features/src/cap-overview/screens.ts +2 -2
- package/packages/bundled-features/src/cap-overview/web/cap-cards-panel.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-bar.tsx +1 -2
- package/packages/bundled-features/src/cap-overview/web/cap-usage-cell.tsx +0 -2
- package/packages/bundled-features/src/cap-overview/web/client-plugin.tsx +3 -4
- package/packages/bundled-features/src/cap-overview/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/cap-overview/web/index.ts +0 -1
- package/packages/bundled-features/src/cap-overview/{usage-math.ts → web/usage-math.ts} +1 -2
- package/packages/bundled-features/src/compliance-profiles/feature.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/index.ts +6 -6
- package/packages/bundled-features/src/compliance-profiles/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/compliance-profiles/web/compliance-profile-catalog.tsx +1 -2
- package/packages/bundled-features/src/compliance-profiles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/compliance-profiles/web/index.ts +0 -1
- package/packages/bundled-features/src/config/index.ts +6 -6
- package/packages/bundled-features/src/config/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/config/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/config/web/i18n.ts +1 -1
- package/packages/bundled-features/src/config/web/index.ts +1 -3
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/custom-fields/feature.ts +8 -8
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +4 -4
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +1 -1
- package/packages/bundled-features/src/custom-fields/index.ts +8 -8
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +1 -1
- package/packages/bundled-features/src/custom-fields/schemas.ts +1 -1
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/{constants.ts → web/constants.ts} +18 -19
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +1 -2
- package/packages/bundled-features/src/custom-fields/web/i18n.ts +0 -1
- package/packages/bundled-features/src/custom-fields/web/index.ts +2 -3
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +1 -2
- package/packages/bundled-features/src/delivery/address-opt-out.ts +1 -1
- package/packages/bundled-features/src/delivery/attempt-log-retention.ts +24 -8
- package/packages/bundled-features/src/delivery/changes.json +6 -0
- package/packages/bundled-features/src/delivery/constants.ts +2 -2
- package/packages/bundled-features/src/delivery/i18n.ts +1 -1
- package/packages/bundled-features/src/delivery/unsubscribe-page.ts +1 -1
- package/packages/bundled-features/src/delivery/web/client-plugin.tsx +6 -7
- package/packages/bundled-features/src/delivery/web/delivery-channel-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-error-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-status-cell.tsx +1 -2
- package/packages/bundled-features/src/delivery/web/delivery-time-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/delivery-type-cell.tsx +0 -1
- package/packages/bundled-features/src/delivery/web/index.ts +0 -1
- package/packages/bundled-features/src/delivery/{public-names.ts → web/public-names.ts} +0 -1
- package/packages/bundled-features/src/document-ingest-foundation/changes.json +6 -0
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +4 -0
- package/packages/bundled-features/src/document-ingest-foundation/executor.ts +2 -1
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +18 -4
- package/packages/bundled-features/src/document-ingest-foundation/index.ts +1 -0
- package/packages/bundled-features/src/feature-toggles/feature.ts +7 -7
- package/packages/bundled-features/src/feature-toggles/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/set.write.ts +3 -3
- package/packages/bundled-features/src/feature-toggles/index.ts +6 -6
- package/packages/bundled-features/src/feature-toggles/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/feature-toggles/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/feature-toggles/web/i18n.ts +0 -1
- package/packages/bundled-features/src/feature-toggles/web/index.ts +0 -1
- package/packages/bundled-features/src/files/changes.json +7 -0
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/clear-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/delete-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/handlers/set-folder.write.ts +1 -1
- package/packages/bundled-features/src/folders/index.ts +8 -8
- package/packages/bundled-features/src/folders/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/folders/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +1 -2
- package/packages/bundled-features/src/folders/web/folder-section.tsx +1 -2
- package/packages/bundled-features/src/folders/web/i18n.ts +0 -1
- package/packages/bundled-features/src/folders/web/index.ts +1 -2
- package/packages/bundled-features/src/folders/web/tree.ts +0 -1
- package/packages/bundled-features/src/form-draft/changes.json +7 -0
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +25 -11
- package/packages/bundled-features/src/form-draft/decrypt-draft.ts +24 -0
- package/packages/bundled-features/src/form-draft/entity.ts +6 -9
- package/packages/bundled-features/src/form-draft/feature.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/cleanup.job.ts +26 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/handlers/get.query.ts +6 -7
- package/packages/bundled-features/src/form-draft/handlers/list.query.ts +13 -7
- package/packages/bundled-features/src/form-draft/handlers/save.write.ts +5 -5
- package/packages/bundled-features/src/form-draft/index.ts +8 -8
- package/packages/bundled-features/src/form-draft/lookup.ts +10 -4
- package/packages/bundled-features/src/form-draft/schemas.ts +1 -1
- package/packages/bundled-features/src/form-draft/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/form-draft-user-data/hooks.ts +2 -2
- package/packages/bundled-features/src/inbound-mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +11 -4
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +10 -10
- package/packages/bundled-features/src/jobs/feature.ts +7 -7
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/trigger.write.ts +1 -1
- package/packages/bundled-features/src/jobs/index.ts +1 -1
- package/packages/bundled-features/src/jobs/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/jobs/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/jobs/web/default-translations.ts +7 -0
- package/packages/bundled-features/src/jobs/web/i18n.ts +53 -7
- package/packages/bundled-features/src/jobs/web/index.ts +0 -1
- package/packages/bundled-features/src/ledger/changes.json +7 -0
- package/packages/bundled-features/src/ledger/entity.ts +1 -1
- package/packages/bundled-features/src/ledger/feature.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +2 -10
- package/packages/bundled-features/src/ledger/handlers/create-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reports.query.ts +1 -1
- package/packages/bundled-features/src/ledger/handlers/reverse-transaction.write.ts +1 -1
- package/packages/bundled-features/src/ledger/index.ts +13 -13
- package/packages/bundled-features/src/ledger/recurring.ts +1 -1
- package/packages/bundled-features/src/ledger/reports.ts +1 -1
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/ledger/web/index.ts +11 -12
- package/packages/bundled-features/src/legal-pages/README.md +1 -1
- package/packages/bundled-features/src/legal-pages/feature.ts +5 -5
- package/packages/bundled-features/src/legal-pages/index.ts +11 -11
- package/packages/bundled-features/src/legal-pages/lib/boot-check.ts +1 -1
- package/packages/bundled-features/src/legal-pages/lib/validate-routes.ts +1 -1
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +1 -2
- package/packages/bundled-features/src/legal-pages/{constants.ts → web/constants.ts} +6 -8
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -1
- package/packages/bundled-features/src/mail-foundation/changes.json +6 -0
- package/packages/bundled-features/src/mail-foundation/i18n.ts +3 -2
- package/packages/bundled-features/src/mail-transport-smtp/i18n.ts +1 -1
- package/packages/bundled-features/src/managed-pages/feature.ts +1 -1
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/managed-pages/web/default-translations.ts +17 -0
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +59 -16
- package/packages/bundled-features/src/managed-pages/web/index.ts +1 -2
- package/packages/bundled-features/src/metrics/compute.ts +1 -1
- package/packages/bundled-features/src/metrics/feature.ts +6 -6
- package/packages/bundled-features/src/metrics/index.ts +8 -8
- package/packages/bundled-features/src/metrics/types.ts +1 -1
- package/packages/bundled-features/src/metrics/validate.ts +1 -1
- package/packages/bundled-features/src/metrics/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/metrics/window.ts +1 -1
- package/packages/bundled-features/src/notes-history/feature.ts +1 -1
- package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
- package/packages/bundled-features/src/notes-history/index.ts +8 -8
- package/packages/bundled-features/src/notes-history/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/notes-history/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/notes-history/web/i18n.ts +0 -1
- package/packages/bundled-features/src/notes-history/web/index.ts +2 -3
- package/packages/bundled-features/src/notes-history/web/notes-section.tsx +2 -3
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +12 -10
- package/packages/bundled-features/src/personal-access-tokens/handlers/available-scopes.query.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/hash.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/i18n.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/index.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/resolver.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/schema/api-token.ts +1 -1
- package/packages/bundled-features/src/personal-access-tokens/screens.ts +2 -2
- package/packages/bundled-features/src/personal-access-tokens/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/personal-access-tokens/{scopes.ts → web/scopes.ts} +0 -1
- package/packages/bundled-features/src/presets/changes.json +7 -0
- package/packages/bundled-features/src/presets/index.ts +0 -1
- package/packages/bundled-features/src/presets/security-baseline.ts +1 -1
- package/packages/bundled-features/src/renderer-foundation/types.ts +1 -1
- package/packages/bundled-features/src/secrets/feature.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/delete.write.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/secrets/handlers/set.write.ts +1 -1
- package/packages/bundled-features/src/secrets/i18n.ts +1 -1
- package/packages/bundled-features/src/secrets/index.ts +8 -8
- package/packages/bundled-features/src/secrets/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/secrets/write-gate.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +7 -4
- package/packages/bundled-features/src/sessions/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/shared/index.ts +6 -1
- package/packages/bundled-features/src/shared/purge-files-reaching-subject.ts +10 -2
- package/packages/bundled-features/src/shared/web/translate-or-raw.ts +0 -1
- package/packages/bundled-features/src/subscription-stripe/feature.ts +2 -0
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +19 -0
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +1 -0
- package/packages/bundled-features/src/tags/changes.json +6 -0
- package/packages/bundled-features/src/tags/feature.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/assign-tag.write.ts +11 -7
- package/packages/bundled-features/src/tags/handlers/create-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/delete-tag.write.ts +4 -1
- package/packages/bundled-features/src/tags/handlers/remove-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/handlers/update-tag.write.ts +1 -1
- package/packages/bundled-features/src/tags/index.ts +12 -12
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/tags/web/client-plugin.tsx +1 -3
- package/packages/bundled-features/src/tags/{constants.ts → web/constants.ts} +4 -1
- package/packages/bundled-features/src/tags/web/entity-tags.tsx +1 -2
- package/packages/bundled-features/src/tags/web/i18n.ts +2 -2
- package/packages/bundled-features/src/tags/web/index.ts +2 -3
- package/packages/bundled-features/src/tags/web/tag-chip.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-filter.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tag-manager.tsx +5 -4
- package/packages/bundled-features/src/tags/web/tag-picker.tsx +0 -1
- package/packages/bundled-features/src/tags/web/tag-section.tsx +1 -2
- package/packages/bundled-features/src/tags/web/tags-cell.tsx +1 -2
- package/packages/bundled-features/src/template-resolver/README.md +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +75 -28
- package/packages/bundled-features/src/template-resolver/changes.json +63 -0
- package/packages/bundled-features/src/template-resolver/compile-document-body.ts +62 -4
- package/packages/bundled-features/src/template-resolver/compile-steps-block.ts +2 -2
- package/packages/bundled-features/src/template-resolver/document-ops.ts +5 -5
- package/packages/bundled-features/src/template-resolver/document-sanitizer.ts +39 -4
- package/packages/bundled-features/src/template-resolver/feature.ts +88 -38
- package/packages/bundled-features/src/template-resolver/handlers/by-slug.query.ts +6 -1
- package/packages/bundled-features/src/template-resolver/handlers/by-tenant.query.ts +6 -2
- package/packages/bundled-features/src/template-resolver/handlers/collection-item.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/collection-set.write.ts +20 -7
- package/packages/bundled-features/src/template-resolver/handlers/collection-shared.ts +0 -6
- package/packages/bundled-features/src/template-resolver/handlers/copy-locale.write.ts +69 -60
- package/packages/bundled-features/src/template-resolver/handlers/diff-to-system.query.ts +7 -1
- package/packages/bundled-features/src/template-resolver/handlers/discard-draft.write.ts +37 -14
- package/packages/bundled-features/src/template-resolver/handlers/document-base.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/document-blocks.query.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/export-bundle.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/handlers/import-bundle.write.ts +37 -28
- package/packages/bundled-features/src/template-resolver/handlers/layout-source.query.ts +10 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +5 -2
- package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +132 -70
- package/packages/bundled-features/src/template-resolver/handlers/patch-draft.write.ts +106 -97
- package/packages/bundled-features/src/template-resolver/handlers/reset-to-system.write.ts +62 -49
- package/packages/bundled-features/src/template-resolver/handlers/resource-link-pdf.write.ts +44 -29
- package/packages/bundled-features/src/template-resolver/handlers/resource-remove.write.ts +52 -36
- package/packages/bundled-features/src/template-resolver/handlers/resource-shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/resource-upload.write.ts +127 -107
- package/packages/bundled-features/src/template-resolver/handlers/send-test-shared.ts +38 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test-status.query.ts +31 -0
- package/packages/bundled-features/src/template-resolver/handlers/send-test.write.ts +106 -112
- package/packages/bundled-features/src/template-resolver/handlers/set.write.ts +111 -104
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/template-gates.ts +6 -6
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/toggle-status.write.ts +56 -28
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +38 -29
- package/packages/bundled-features/src/template-resolver/handlers/usage.query.ts +8 -2
- package/packages/bundled-features/src/template-resolver/handlers/validate.query.ts +4 -2
- package/packages/bundled-features/src/template-resolver/i18n.ts +25 -0
- package/packages/bundled-features/src/template-resolver/index.ts +68 -60
- package/packages/bundled-features/src/template-resolver/layout-appearance.ts +1 -1
- package/packages/bundled-features/src/template-resolver/layout-regions.ts +1 -1
- package/packages/bundled-features/src/template-resolver/seeding.ts +16 -7
- package/packages/bundled-features/src/template-resolver/store-template-resource.ts +2 -2
- package/packages/bundled-features/src/template-resolver/table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-bundle.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-delivery-policy.ts +82 -0
- package/packages/bundled-features/src/template-resolver/template-draft.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-edit-policy.ts +91 -0
- package/packages/bundled-features/src/template-resolver/template-meta.ts +2 -2
- package/packages/bundled-features/src/template-resolver/template-preview.ts +22 -12
- package/packages/bundled-features/src/template-resolver/template-usage.ts +1 -1
- package/packages/bundled-features/src/template-resolver/template-validation.ts +33 -12
- package/packages/bundled-features/src/template-resolver/testing.ts +2 -2
- package/packages/bundled-features/src/template-resolver/user-content-table.ts +1 -1
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +4 -5
- package/packages/bundled-features/src/template-resolver/{constants.ts → web/constants.ts} +10 -10
- package/packages/bundled-features/src/template-resolver/{document-blocks.ts → web/document-blocks.ts} +3 -2
- package/packages/bundled-features/src/template-resolver/web/document-editor-extensions.ts +31 -3
- package/packages/bundled-features/src/template-resolver/web/document-editor.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-images.ts +28 -0
- package/packages/bundled-features/src/template-resolver/{document-schema.ts → web/document-schema.ts} +5 -1
- package/packages/bundled-features/src/template-resolver/{document-steps.ts → web/document-steps.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/document-tiptap-editor.tsx +48 -11
- package/packages/bundled-features/src/template-resolver/web/document-toolbar-blocks.ts +4 -3
- package/packages/bundled-features/src/template-resolver/web/editor-handle.ts +1 -2
- package/packages/bundled-features/src/template-resolver/web/i18n.ts +8 -1
- package/packages/bundled-features/src/template-resolver/web/index.ts +13 -14
- package/packages/bundled-features/src/template-resolver/{mail-constants.ts → web/mail-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{pdf-constants.ts → web/pdf-constants.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor-lazy.tsx +0 -1
- package/packages/bundled-features/src/template-resolver/web/placeholder-line-editor.tsx +5 -4
- package/packages/bundled-features/src/template-resolver/{placeholder-text.ts → web/placeholder-text.ts} +0 -1
- package/packages/bundled-features/src/template-resolver/{qualified-names.ts → web/qualified-names.ts} +2 -1
- package/packages/bundled-features/src/template-resolver/web/use-stable-by-key.ts +0 -1
- package/packages/bundled-features/src/tenant/handlers/add-member.write.ts +1 -1
- package/packages/bundled-features/src/tenant/index.ts +7 -7
- package/packages/bundled-features/src/tenant/invitation-table.ts +1 -1
- package/packages/bundled-features/src/tenant/invited-membership.ts +1 -1
- package/packages/bundled-features/src/tenant/last-tenant-admin.ts +1 -1
- package/packages/bundled-features/src/tenant/member-role-options.ts +1 -1
- package/packages/bundled-features/src/tenant/screens.ts +2 -2
- package/packages/bundled-features/src/tenant/web/client-plugin.tsx +1 -2
- package/packages/bundled-features/src/tenant/{constants.ts → web/constants.ts} +3 -6
- package/packages/bundled-features/src/tenant/web/index.ts +0 -1
- package/packages/bundled-features/src/tenant/web/member-roles-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant/web/member-status-cell.tsx +0 -1
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +2 -2
- package/packages/bundled-features/src/tier-engine/entity.ts +1 -1
- package/packages/bundled-features/src/tier-engine/feature.ts +7 -7
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +1 -1
- package/packages/bundled-features/src/tier-engine/index.ts +8 -8
- package/packages/bundled-features/src/tier-engine/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/tier-engine/{constants.ts → web/constants.ts} +2 -3
- package/packages/bundled-features/src/tier-engine/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/tier-engine/web/index.ts +0 -1
- package/packages/bundled-features/src/user/handlers/create.write.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update-roles.ts +1 -1
- package/packages/bundled-features/src/user/handlers/update.write.ts +1 -1
- package/packages/bundled-features/src/user/index.ts +1 -1
- package/packages/bundled-features/src/user/invited-global-roles.ts +1 -1
- package/packages/bundled-features/src/user/schema/user.ts +1 -1
- package/packages/bundled-features/src/user/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-data-rights/changes.json +14 -0
- package/packages/bundled-features/src/user-data-rights/env.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/index.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/lib/resolve-tenant-model.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/mail-notifications.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +2 -3
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/{constants.ts → web/constants.ts} +11 -12
- package/packages/bundled-features/src/user-data-rights/web/default-translations.ts +91 -0
- package/packages/bundled-features/src/user-data-rights/web/i18n.ts +41 -91
- package/packages/bundled-features/src/user-data-rights/web/index.ts +1 -2
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +1 -2
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +0 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +10 -1
- package/packages/bundled-features/src/user-profile/feature.ts +2 -2
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +1 -1
- package/packages/bundled-features/src/user-profile/index.ts +3 -2
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +2 -3
- package/packages/bundled-features/src/user-profile/{constants.ts → web/constants.ts} +0 -1
- package/packages/bundled-features/src/user-profile/{i18n.ts → web/i18n.ts} +0 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +2 -3
- package/packages/bundled-features/src/waitlist/changes.json +6 -0
- package/packages/bundled-features/src/waitlist/entity.ts +1 -1
- package/packages/bundled-features/src/waitlist/feature.ts +5 -5
- package/packages/bundled-features/src/waitlist/handlers/export-purge.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/handlers/invite.write.ts +5 -1
- package/packages/bundled-features/src/waitlist/handlers/reject.write.ts +1 -1
- package/packages/bundled-features/src/waitlist/handlers/submit.write.ts +3 -3
- package/packages/bundled-features/src/waitlist/import.ts +1 -1
- package/packages/bundled-features/src/waitlist/index.ts +11 -11
- package/packages/bundled-features/src/waitlist/legacy-migrate.ts +1 -1
- package/packages/bundled-features/src/waitlist/link-on-signup.ts +1 -1
- package/packages/bundled-features/src/waitlist/mail.ts +7 -6
- package/packages/bundled-features/src/waitlist/payloads.ts +1 -1
- package/packages/bundled-features/src/waitlist/screens.ts +1 -1
- package/packages/bundled-features/src/waitlist/{constants.ts → web/constants.ts} +0 -1
- package/samples/apps/styleguide/src/features/content/web.tsx +0 -1
- package/samples/apps/ui-walkthrough/src/app/client.tsx +2 -0
- package/samples/apps/ui-walkthrough/src/app/help-action.tsx +37 -0
- package/samples/apps/ui-walkthrough/src/app/seed-rental.ts +17 -1
- package/samples/apps/ui-walkthrough/src/app/seed-templates.ts +13 -0
- package/samples/apps/ui-walkthrough/src/app/server.ts +2 -1
- package/samples/apps/ui-walkthrough/src/app/shell.tsx +6 -0
- package/samples/apps/ui-walkthrough/src/app/template-seed-data.ts +20 -0
- package/samples/apps/ui-walkthrough/src/features/billing/feature.ts +35 -7
- package/samples/apps/ui-walkthrough/src/features/billing/i18n.ts +6 -0
- package/samples/apps/ui-walkthrough/src/features/rental/entities.ts +27 -0
- package/samples/apps/ui-walkthrough/src/features/rental/feature.ts +120 -2
- package/samples/apps/ui-walkthrough/src/features/rental/i18n.ts +94 -0
- package/samples/apps/ui-walkthrough/src/features/rental/invoice-receive.ts +19 -0
- package/samples/apps/ui-walkthrough/src/features/rental/lease-support.ts +32 -1
- package/samples/apps/ui-walkthrough/src/features/rental/qualified-names.ts +5 -0
- package/samples/apps/ui-walkthrough/src/features/rental/receipts-upload.ts +70 -0
- package/samples/apps/ui-walkthrough/src/features/rental/screens.ts +156 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/feature.ts +103 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/i18n.ts +36 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/index.ts +2 -0
- package/samples/apps/ui-walkthrough/src/features/subscription-plans/seed.ts +21 -0
- package/samples/apps/ui-walkthrough/src/features/tasks/i18n.ts +8 -0
- package/samples/apps/ui-walkthrough/src/run-config.ts +43 -3
- package/samples/apps/use-all-bundled/e2e-billing-gallery/server.ts +1 -1
- package/samples/apps/use-all-bundled/feature-manifest.json +5 -5
- package/samples/apps/use-all-bundled/scripts/check-coverage.ts +1 -1
- package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +3 -1
- package/samples/recipes/compose-stacks/README.md +1 -2
- package/samples/recipes/delivery-notifications/README.md +1 -1
- package/samples/recipes/embedded/README.md +8 -0
- package/samples/recipes/embedded/src/feature.ts +8 -0
- package/samples/recipes/embedded/src/handlers/invoice-receive.write.ts +37 -0
- package/samples/recipes/embedded/src/screens/invoice-receive.screen.ts +56 -0
- package/samples/recipes/legal-pages/README.md +2 -2
- package/samples/recipes/legal-pages/src/feature.ts +1 -1
- package/samples/recipes/reference-data/src/feature.ts +3 -7
- package/packages/bundled-features/src/admin-shell/i18n.ts +0 -54
- package/packages/bundled-features/src/audit/i18n.ts +0 -25
- package/packages/bundled-features/src/auth-mfa/web/qrcode-browser.d.ts +0 -11
- package/packages/bundled-features/src/jobs/i18n.ts +0 -55
- package/packages/bundled-features/src/managed-pages/i18n.ts +0 -63
- package/packages/bundled-features/src/presets/dsgvo-self-service.ts +0 -35
- package/packages/bundled-features/src/user-data-rights/i18n.ts +0 -44
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import type { DashboardCustomPanel, ScreenDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
-
import { BILLING_PLANS_PANEL_COMPONENT, BILLING_PLANS_SCREEN_ID } from "./constants.ts";
|
|
2
|
+
import { BILLING_PLANS_PANEL_COMPONENT, BILLING_PLANS_SCREEN_ID } from "./web/constants.ts";
|
|
3
3
|
|
|
4
4
|
/** The billing-plans panel, meant to be dropped into an app's own dashboard
|
|
5
5
|
* screen alongside its own panels — not just the dormant single-panel
|
|
@@ -18,8 +18,8 @@ import type {
|
|
|
18
18
|
import type { TenantId, WriteResult } from "@cosmicdrift/kumiko-framework/engine";
|
|
19
19
|
import { isPlainObject } from "@cosmicdrift/kumiko-types/type-guards";
|
|
20
20
|
import { subscriptionAggregateId } from "./aggregate-id.ts";
|
|
21
|
-
import { SubscriptionFoundationQueries, SubscriptionStatuses } from "./constants.ts";
|
|
22
21
|
import type { PaymentEvent, SubscriptionEvent } from "./types.ts";
|
|
22
|
+
import { SubscriptionFoundationQueries, SubscriptionStatuses } from "./web/constants.ts";
|
|
23
23
|
import { createSubscriptionWebhookRoute } from "./webhook-handler.ts";
|
|
24
24
|
|
|
25
25
|
// Outside /api — signature routes carry their own auth (verify()) and are
|
|
@@ -28,6 +28,7 @@
|
|
|
28
28
|
import type { TenantDb } from "@cosmicdrift/kumiko-framework/db";
|
|
29
29
|
import type { HandlerContext, TenantId } from "@cosmicdrift/kumiko-framework/engine";
|
|
30
30
|
import type { SecretsContext } from "@cosmicdrift/kumiko-framework/secrets";
|
|
31
|
+
import type { OrderItem } from "./consumer-protection/consent-gate.ts";
|
|
31
32
|
import {
|
|
32
33
|
type BillingEventKinds,
|
|
33
34
|
type BillingPlanAction,
|
|
@@ -36,9 +37,8 @@ import {
|
|
|
36
37
|
type SubscriptionEventType,
|
|
37
38
|
type SubscriptionStatus,
|
|
38
39
|
type TerminationScope,
|
|
39
|
-
} from "./constants.ts";
|
|
40
|
-
import type {
|
|
41
|
-
import type { ConsentLocale } from "./consumer-protection/consent-locale.ts";
|
|
40
|
+
} from "./web/constants.ts";
|
|
41
|
+
import type { ConsentLocale } from "./web/consumer-protection/consent-locale.ts";
|
|
42
42
|
|
|
43
43
|
// =============================================================================
|
|
44
44
|
// Normalisierter Webhook-Event
|
|
@@ -89,6 +89,10 @@ export type SubscriptionEvent = {
|
|
|
89
89
|
* Mollie), so projection.ts leaves the column unchanged instead of
|
|
90
90
|
* nulling it. */
|
|
91
91
|
readonly cancelAt?: string | null;
|
|
92
|
+
/** ISO instant the provider emitted this event. process-event drops a
|
|
93
|
+
* state event older than the newest one already stored, since providers
|
|
94
|
+
* do not guarantee delivery order. Omitted by providers that report none. */
|
|
95
|
+
readonly providerEventAt?: string;
|
|
92
96
|
};
|
|
93
97
|
|
|
94
98
|
// =============================================================================
|
|
@@ -245,6 +249,16 @@ export type SubscriptionProviderPlugin = {
|
|
|
245
249
|
},
|
|
246
250
|
) => Promise<void>;
|
|
247
251
|
|
|
252
|
+
/**
|
|
253
|
+
* Optional: takes back a `period-end` cancellation that has not taken effect
|
|
254
|
+
* yet. Without it, a revoked public termination is reported to the operator
|
|
255
|
+
* to undo by hand.
|
|
256
|
+
*/
|
|
257
|
+
readonly resumeSubscription?: (
|
|
258
|
+
ctx: HandlerContext,
|
|
259
|
+
options: { readonly providerSubscriptionId: string },
|
|
260
|
+
) => Promise<void>;
|
|
261
|
+
|
|
248
262
|
/**
|
|
249
263
|
* The provider's own price/plan-id → app-tier-name mapping. This is the
|
|
250
264
|
* one source `checkout-core`/`plan-catalog` derive both hardening
|
|
@@ -4,9 +4,6 @@
|
|
|
4
4
|
// re-exported from index.ts.
|
|
5
5
|
|
|
6
6
|
import * as z from "zod";
|
|
7
|
-
import { isTerminationScope, TERMINATION_SCOPES } from "./constants.ts";
|
|
8
|
-
import { CONSENT_LOCALES, type ConsentLocale } from "./consumer-protection/consent-locale.ts";
|
|
9
|
-
import { isContactCardHref } from "./contact-card.ts";
|
|
10
7
|
import {
|
|
11
8
|
type BillingFoundationOptions,
|
|
12
9
|
type BillingPlanContactCard,
|
|
@@ -14,6 +11,9 @@ import {
|
|
|
14
11
|
isLegalLinkSet,
|
|
15
12
|
type LegalLinkSet,
|
|
16
13
|
} from "./types.ts";
|
|
14
|
+
import { isTerminationScope, TERMINATION_SCOPES } from "./web/constants.ts";
|
|
15
|
+
import { CONSENT_LOCALES, type ConsentLocale } from "./web/consumer-protection/consent-locale.ts";
|
|
16
|
+
import { isContactCardHref } from "./web/contact-card.ts";
|
|
17
17
|
|
|
18
18
|
function isRootRelativePath(path: string): boolean {
|
|
19
19
|
return path.startsWith("/") && !path.startsWith("//");
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import { useLocale, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
2
|
import { PlanCard } from "@cosmicdrift/kumiko-renderer/web";
|
|
5
3
|
import type { ReactNode } from "react";
|
|
6
|
-
import { isContactCardHref } from "../contact-card.ts";
|
|
7
4
|
import type { BillingPlanContactCard } from "../types.ts";
|
|
5
|
+
import { isContactCardHref } from "./contact-card.ts";
|
|
8
6
|
import { localizedParams } from "./localized-params.ts";
|
|
9
7
|
|
|
10
8
|
export function BillingContactPlan({
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
type ExtensionSectionProps,
|
|
5
3
|
useLocale,
|
|
@@ -16,16 +14,16 @@ import {
|
|
|
16
14
|
PlanGrid,
|
|
17
15
|
} from "@cosmicdrift/kumiko-renderer/web";
|
|
18
16
|
import { type ReactNode, useState } from "react";
|
|
17
|
+
import type { BillingPlansResult, BillingPlanView } from "../types.ts";
|
|
18
|
+
import { BillingContactPlan } from "./billing-contact-plan.tsx";
|
|
19
|
+
import { CancelContractDialog } from "./cancel-contract-dialog.tsx";
|
|
20
|
+
import { CheckoutConsentDialog, type CheckoutConsentPayload } from "./checkout-consent-dialog.tsx";
|
|
19
21
|
import {
|
|
20
22
|
BillingPlanActions,
|
|
21
23
|
SubscriptionFoundationHandlers,
|
|
22
24
|
SubscriptionFoundationQueries,
|
|
23
25
|
SubscriptionStatuses,
|
|
24
|
-
} from "
|
|
25
|
-
import type { BillingPlansResult, BillingPlanView } from "../types.ts";
|
|
26
|
-
import { BillingContactPlan } from "./billing-contact-plan.tsx";
|
|
27
|
-
import { CancelContractDialog } from "./cancel-contract-dialog.tsx";
|
|
28
|
-
import { CheckoutConsentDialog, type CheckoutConsentPayload } from "./checkout-consent-dialog.tsx";
|
|
26
|
+
} from "./constants.ts";
|
|
29
27
|
import { localizedParams } from "./localized-params.ts";
|
|
30
28
|
|
|
31
29
|
type UseTranslation = ReturnType<typeof useTranslation>;
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import {
|
|
4
2
|
useLocale,
|
|
5
3
|
useMutation,
|
|
@@ -9,8 +7,8 @@ import {
|
|
|
9
7
|
import { toInstant } from "@cosmicdrift/kumiko-renderer/headless";
|
|
10
8
|
import { ModeSwitch } from "@cosmicdrift/kumiko-renderer/web";
|
|
11
9
|
import { type ReactNode, useState } from "react";
|
|
12
|
-
import { SubscriptionFoundationHandlers } from "../constants.ts";
|
|
13
10
|
import type { ContractTerminationDeclarationType, ContractTerminationKind } from "../events.ts";
|
|
11
|
+
import { SubscriptionFoundationHandlers } from "./constants.ts";
|
|
14
12
|
|
|
15
13
|
type TerminateContractReceipt = {
|
|
16
14
|
readonly requestId: string;
|
|
@@ -1,10 +1,8 @@
|
|
|
1
|
-
// @runtime client
|
|
2
|
-
|
|
3
1
|
import { useLocale, usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
2
|
import type { WriteResult } from "@cosmicdrift/kumiko-renderer/headless";
|
|
5
3
|
import { type ReactNode, useState } from "react";
|
|
6
|
-
import { resolveConsentLocale } from "../consumer-protection/consent-locale.ts";
|
|
7
4
|
import type { BillingPlansResult } from "../types.ts";
|
|
5
|
+
import { resolveConsentLocale } from "./consumer-protection/consent-locale.ts";
|
|
8
6
|
|
|
9
7
|
export const CONSENT_TEXT_OUTDATED_CODE = "consent_text_outdated";
|
|
10
8
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
4
|
-
import { BILLING_FOUNDATION_FEATURE, BILLING_PLANS_PANEL_COMPONENT } from "../constants.ts";
|
|
5
3
|
import { BillingPlansPanel } from "./billing-plans-panel.tsx";
|
|
4
|
+
import { BILLING_FOUNDATION_FEATURE, BILLING_PLANS_PANEL_COMPONENT } from "./constants.ts";
|
|
6
5
|
|
|
7
6
|
export type BillingFoundationClientOptions = {
|
|
8
7
|
readonly translations?: TranslationsByLocale;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
/// <reference types="temporal-polyfill/global" preserve="true" />
|
|
2
|
-
// @runtime client
|
|
3
2
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
4
3
|
import { isOneOf } from "@cosmicdrift/kumiko-types/type-guards";
|
|
5
4
|
|
|
6
5
|
// Feature name
|
|
7
6
|
export const BILLING_FOUNDATION_FEATURE = "billing-foundation" as const;
|
|
8
7
|
|
|
9
|
-
// Extension-point name
|
|
8
|
+
// Extension-point name for provider plugins (subscription-stripe,
|
|
10
9
|
// subscription-mollie, ...).
|
|
11
10
|
export const SUBSCRIPTION_PROVIDER_EXTENSION = "subscriptionProvider" as const;
|
|
12
11
|
|
|
@@ -23,19 +22,18 @@ export const CONTRACT_TERMINATION_OPERATOR_NOTIFICATION_TYPE =
|
|
|
23
22
|
|
|
24
23
|
// Qualified write handler names (QN format: scope:type:name).
|
|
25
24
|
export const SubscriptionFoundationHandlers = {
|
|
26
|
-
/** Programmatic entry
|
|
27
|
-
* parsed SubscriptionEvent (
|
|
28
|
-
* insert-event + upsert-subscription + tier-sync
|
|
25
|
+
/** Programmatic entry point for the webhook handler. Receives the
|
|
26
|
+
* parsed SubscriptionEvent (already verified by the plugin) and does
|
|
27
|
+
* insert-event + upsert-subscription + tier-sync atomically. */
|
|
29
28
|
processEvent: "billing-foundation:write:process-event",
|
|
30
|
-
/** Tenant
|
|
31
|
-
*
|
|
32
|
-
*
|
|
33
|
-
*
|
|
34
|
-
* subscription. */
|
|
29
|
+
/** Tenant admin clicks "Upgrade to Pro": the handler finds the chosen
|
|
30
|
+
* provider plugin, calls its createCheckoutSession and returns the
|
|
31
|
+
* hosted-page URL. The admin is redirected there; the subsequent
|
|
32
|
+
* provider webhook creates the subscription. */
|
|
35
33
|
createCheckoutSession: "billing-foundation:write:create-checkout-session",
|
|
36
|
-
/** Tenant
|
|
37
|
-
* current subscription,
|
|
38
|
-
* hosted-portal
|
|
34
|
+
/** Tenant admin clicks "Manage Subscription": the handler finds the
|
|
35
|
+
* current subscription, calls plugin.createPortalSession and returns the
|
|
36
|
+
* hosted-portal URL. */
|
|
39
37
|
createPortalSession: "billing-foundation:write:create-portal-session",
|
|
40
38
|
/** Programmatic entry-point for the webhook-handler on a one-off-payment
|
|
41
39
|
* (checkout mode "payment"). Its own per-tenant aggregate-stream
|
|
@@ -60,6 +58,13 @@ export const SubscriptionFoundationHandlers = {
|
|
|
60
58
|
/** Anonymous § 312k cancellation/withdrawal declaration (consumerProtection
|
|
61
59
|
* only). */
|
|
62
60
|
requestContractTermination: "billing-foundation:write:request-contract-termination",
|
|
61
|
+
/** Anonymous "this was not me" revocation of a public declaration, by the
|
|
62
|
+
* link of the receipt mail (consumerProtection only). */
|
|
63
|
+
revokeContractTermination: "billing-foundation:write:revoke-contract-termination",
|
|
64
|
+
/** System-only: checks the revocation token against the tenant's declaration
|
|
65
|
+
* and takes the cancellation back (consumerProtection only). */
|
|
66
|
+
recordContractTerminationRevocation:
|
|
67
|
+
"billing-foundation:write:record-contract-termination-revocation",
|
|
63
68
|
/** Tenant-Admin terminates or withdraws from the contract of their own
|
|
64
69
|
* tenant (consumerProtection only). */
|
|
65
70
|
terminateContract: "billing-foundation:write:terminate-contract",
|
|
@@ -82,9 +87,9 @@ export const SubscriptionFoundationHandlers = {
|
|
|
82
87
|
|
|
83
88
|
// Qualified query handler names.
|
|
84
89
|
export const SubscriptionFoundationQueries = {
|
|
85
|
-
/** Sysadmin
|
|
86
|
-
* read_subscriptions
|
|
87
|
-
*
|
|
90
|
+
/** Sysadmin cross-tenant and tenant-scoped self-list on the
|
|
91
|
+
* read_subscriptions projection. A tenant admin only sees their own row
|
|
92
|
+
* because ctx.db is tenant-scoped. */
|
|
88
93
|
listSubscriptions: "billing-foundation:query:subscription:list",
|
|
89
94
|
/** Lists the catalog's plans with live price, benefits, the caller's
|
|
90
95
|
* current tier and per-plan action. Only registered when a `catalog` is
|
|
@@ -96,9 +101,9 @@ export const SubscriptionFoundationQueries = {
|
|
|
96
101
|
} as const;
|
|
97
102
|
|
|
98
103
|
// Normalized subscription-event types — provider-agnostic.
|
|
99
|
-
//
|
|
100
|
-
//
|
|
101
|
-
//
|
|
104
|
+
// All provider plugins normalize their own event types onto one of these.
|
|
105
|
+
// Whitelist of what the foundation knows; anything else must be filtered by
|
|
106
|
+
// the plugin, which returns null from verifyAndParseWebhook.
|
|
102
107
|
export const SubscriptionEventTypes = {
|
|
103
108
|
created: "subscription.created",
|
|
104
109
|
updated: "subscription.updated",
|
|
@@ -110,8 +115,8 @@ export type SubscriptionEventType =
|
|
|
110
115
|
(typeof SubscriptionEventTypes)[keyof typeof SubscriptionEventTypes];
|
|
111
116
|
|
|
112
117
|
// Normalized subscription-status values — provider-agnostic.
|
|
113
|
-
// Stripe
|
|
114
|
-
//
|
|
118
|
+
// Stripe and Mollie have different status sets; the plugin maps onto this
|
|
119
|
+
// common subset.
|
|
115
120
|
export const SubscriptionStatuses = {
|
|
116
121
|
active: "active",
|
|
117
122
|
trialing: "trialing",
|
|
@@ -215,17 +220,15 @@ export function isSwitchableSubscriptionStatus(status: string): boolean {
|
|
|
215
220
|
// TenantAdmin/SystemAdmin-only access.
|
|
216
221
|
export const DEFAULT_PURCHASE_ROLES = ["TenantAdmin", "SystemAdmin"] as const;
|
|
217
222
|
|
|
218
|
-
// **Multi-
|
|
219
|
-
//
|
|
220
|
-
//
|
|
221
|
-
//
|
|
222
|
-
//
|
|
223
|
-
// subscription.providerName, kommt aus dem checkout-flow.
|
|
223
|
+
// **Multi-provider from day one:** subscription-foundation has NO `provider`
|
|
224
|
+
// config key. All mounted plugins are active in parallel; the end customer
|
|
225
|
+
// picks between card/PayPal/Apple Pay/Klarna/SEPA at subscribe time
|
|
226
|
+
// (Disney+ pattern). Which provider currently holds the tenant's
|
|
227
|
+
// subscription is stored in subscription.providerName, set by the checkout flow.
|
|
224
228
|
//
|
|
225
|
-
// price-to-tier
|
|
226
|
-
// Stripe
|
|
227
|
-
//
|
|
228
|
-
// `<plugin-name>:config:price-to-tier`-Key.
|
|
229
|
+
// The price-to-tier map is NOT foundation config: it is per plugin, because
|
|
230
|
+
// Stripe priceIds, PayPal plan ids and Apple product ids are different IDs.
|
|
231
|
+
// Each plugin defines its own `<plugin-name>:config:price-to-tier` key.
|
|
229
232
|
|
|
230
233
|
export const TERMINATION_SCOPES = ["tenant-host", "platform"] as const;
|
|
231
234
|
export type TerminationScope = (typeof TERMINATION_SCOPES)[number];
|
|
@@ -233,3 +236,6 @@ export type TerminationScope = (typeof TERMINATION_SCOPES)[number];
|
|
|
233
236
|
export function isTerminationScope(value: unknown): value is TerminationScope {
|
|
234
237
|
return isOneOf(TERMINATION_SCOPES, value);
|
|
235
238
|
}
|
|
239
|
+
|
|
240
|
+
/** Advisory-lock namespace serialising appends onto one tenant's subscription stream. */
|
|
241
|
+
export const BILLING_SUBSCRIPTION_LOCK_NAMESPACE = 0x62_69_6c_6c; // 'bill'
|
|
@@ -1,23 +1,8 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Public exports for the browser side of the billing-foundation feature.
|
|
3
2
|
// Consumed via `@cosmicdrift/kumiko-bundled-features/billing-foundation/web` —
|
|
4
3
|
// the server side (createBillingFoundationFeature) lives under
|
|
5
4
|
// `@cosmicdrift/kumiko-bundled-features/billing-foundation` and has no React deps.
|
|
6
5
|
|
|
7
|
-
export {
|
|
8
|
-
BILLING_PLANS_SCREEN_ID,
|
|
9
|
-
type BillingPlanAction,
|
|
10
|
-
BillingPlanActions,
|
|
11
|
-
SubscriptionFoundationHandlers,
|
|
12
|
-
SubscriptionFoundationQueries,
|
|
13
|
-
type SubscriptionStatus,
|
|
14
|
-
SubscriptionStatuses,
|
|
15
|
-
} from "../constants.ts";
|
|
16
|
-
export {
|
|
17
|
-
CONSENT_LOCALES,
|
|
18
|
-
type ConsentLocale,
|
|
19
|
-
resolveConsentLocale,
|
|
20
|
-
} from "../consumer-protection/consent-locale.ts";
|
|
21
6
|
export type {
|
|
22
7
|
BillingPlanBenefit,
|
|
23
8
|
BillingPlanCatalog,
|
|
@@ -33,3 +18,17 @@ export {
|
|
|
33
18
|
CONSENT_TEXT_OUTDATED_CODE,
|
|
34
19
|
} from "./checkout-consent-dialog.tsx";
|
|
35
20
|
export { type BillingFoundationClientOptions, billingFoundationClient } from "./client-plugin.tsx";
|
|
21
|
+
export {
|
|
22
|
+
BILLING_PLANS_SCREEN_ID,
|
|
23
|
+
type BillingPlanAction,
|
|
24
|
+
BillingPlanActions,
|
|
25
|
+
SubscriptionFoundationHandlers,
|
|
26
|
+
SubscriptionFoundationQueries,
|
|
27
|
+
type SubscriptionStatus,
|
|
28
|
+
SubscriptionStatuses,
|
|
29
|
+
} from "./constants.ts";
|
|
30
|
+
export {
|
|
31
|
+
CONSENT_LOCALES,
|
|
32
|
+
type ConsentLocale,
|
|
33
|
+
resolveConsentLocale,
|
|
34
|
+
} from "./consumer-protection/consent-locale.ts";
|
|
@@ -6,13 +6,13 @@
|
|
|
6
6
|
|
|
7
7
|
import { ExtraRouteRejection, signatureRoute } from "@cosmicdrift/kumiko-framework/api";
|
|
8
8
|
import type { Context } from "hono";
|
|
9
|
+
import type { PaymentEvent, SubscriptionEvent, SubscriptionProviderPlugin } from "./types.ts";
|
|
9
10
|
import {
|
|
10
11
|
BILLING_FOUNDATION_FEATURE,
|
|
11
12
|
BillingEventKinds,
|
|
12
13
|
SUBSCRIPTION_PROVIDER_EXTENSION,
|
|
13
14
|
SubscriptionFoundationHandlers,
|
|
14
|
-
} from "./constants.ts";
|
|
15
|
-
import type { PaymentEvent, SubscriptionEvent, SubscriptionProviderPlugin } from "./types.ts";
|
|
15
|
+
} from "./web/constants.ts";
|
|
16
16
|
|
|
17
17
|
export type SubscriptionWebhookRouteOptions = {
|
|
18
18
|
/** Route path — MUST carry the `:providerName` path-param. Default
|
|
@@ -133,6 +133,9 @@ export function createSubscriptionWebhookRoute(options: SubscriptionWebhookRoute
|
|
|
133
133
|
tier: parsed.tier,
|
|
134
134
|
currentPeriodEndIso: parsed.currentPeriodEnd,
|
|
135
135
|
...(parsed.cancelAt !== undefined && { cancelAtIso: parsed.cancelAt }),
|
|
136
|
+
...(parsed.providerEventAt !== undefined && {
|
|
137
|
+
providerEventAtIso: parsed.providerEventAt,
|
|
138
|
+
}),
|
|
136
139
|
...(parsed.consentId !== undefined && { consentId: parsed.consentId }),
|
|
137
140
|
},
|
|
138
141
|
});
|
|
@@ -1,4 +1,16 @@
|
|
|
1
1
|
[
|
|
2
|
+
{
|
|
3
|
+
"version": "0.378.0",
|
|
4
|
+
"type": "fix",
|
|
5
|
+
"title": "Stock caps are atomic under parallel writes",
|
|
6
|
+
"detail": "withStockCap now takes a transaction-scoped advisory lock per tenant and cap, so concurrent creates cannot both pass the check and exceed the cap."
|
|
7
|
+
},
|
|
8
|
+
{
|
|
9
|
+
"version": "0.378.0",
|
|
10
|
+
"type": "improvement",
|
|
11
|
+
"title": "withStockCap no longer widens the handler's grants",
|
|
12
|
+
"detail": "withStockCap serialises through TenantDb.advisoryXactLock instead of ctx.db.unsafeRaw(), so wrapped handlers no longer receive an implicit unsafeRaw grant."
|
|
13
|
+
},
|
|
2
14
|
{
|
|
3
15
|
"version": "0.370.0",
|
|
4
16
|
"type": "breaking",
|
|
@@ -24,6 +24,10 @@ export type CapLimitContext = {
|
|
|
24
24
|
readonly config?: ConfigAccessor;
|
|
25
25
|
};
|
|
26
26
|
|
|
27
|
+
// pg_advisory_xact_lock namespace (int4): 'scap' as ASCII, disjoint from the
|
|
28
|
+
// framework's other fixed advisory-lock keys.
|
|
29
|
+
const STOCK_CAP_LOCK_NAMESPACE = 0x73636170;
|
|
30
|
+
|
|
27
31
|
// What the cap guards need from a write handler's ctx.
|
|
28
32
|
export type CapGuardContext = CapLimitContext & { readonly db: TenantDb };
|
|
29
33
|
|
|
@@ -53,6 +57,7 @@ export function createStockCapGuard<TCaps>(
|
|
|
53
57
|
spec: StockCapSpec<TCaps>,
|
|
54
58
|
context: CapLimitContext = {},
|
|
55
59
|
): Promise<WriteFailure | null> {
|
|
60
|
+
// Lock-free on its own: a direct call outside withStockCap is not atomic.
|
|
56
61
|
const caps = await resolveTierCaps(db, context);
|
|
57
62
|
const current = await db.count(spec.table, { ...spec.where, tenantId: db.tenantId });
|
|
58
63
|
const { state, limit } = enforceStockCap({
|
|
@@ -73,6 +78,10 @@ export function createStockCapGuard<TCaps>(
|
|
|
73
78
|
return {
|
|
74
79
|
...handler,
|
|
75
80
|
handler: async (event, ctx) => {
|
|
81
|
+
// ctx.db is the handler's transaction, so the xact lock releases with its commit or
|
|
82
|
+
// rollback. A handler wrapped in several caps must list them in the same order
|
|
83
|
+
// everywhere; Postgres aborts one side of an inverse order with a deadlock error.
|
|
84
|
+
await ctx.db.advisoryXactLock(STOCK_CAP_LOCK_NAMESPACE, spec.code);
|
|
76
85
|
const failure = await checkStockCap(ctx.db, spec, { config: ctx.config });
|
|
77
86
|
return failure ?? handler.handler(event, ctx);
|
|
78
87
|
},
|
|
@@ -17,7 +17,6 @@
|
|
|
17
17
|
// **Boot-Dependencies:** tenant, tier-engine, billing-foundation.
|
|
18
18
|
import { defineFeature, type FeatureDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
19
19
|
import { resolveCapUsageRoles } from "./access.ts";
|
|
20
|
-
import { CAP_OVERVIEW_FEATURE } from "./constants.ts";
|
|
21
20
|
import { createCapsUsageQuery } from "./handlers/caps-usage.query.ts";
|
|
22
21
|
import { createTenantCapsListQuery } from "./handlers/tenant-caps-list.query.ts";
|
|
23
22
|
import { tenantOptionsQuery } from "./handlers/tenant-options.query.ts";
|
|
@@ -28,6 +27,7 @@ import {
|
|
|
28
27
|
platformTenantCapsScreen,
|
|
29
28
|
} from "./screens.ts";
|
|
30
29
|
import type { CapSpec } from "./types.ts";
|
|
30
|
+
import { CAP_OVERVIEW_FEATURE } from "./web/constants.ts";
|
|
31
31
|
|
|
32
32
|
export type CreateCapOverviewOptions = {
|
|
33
33
|
readonly caps: readonly CapSpec[];
|
|
@@ -13,7 +13,7 @@ import {
|
|
|
13
13
|
import * as z from "zod";
|
|
14
14
|
import { tierAssignmentEntity } from "../../tier-engine/index.ts";
|
|
15
15
|
import type { CapSpec, CapUsageWithMeta } from "../types.ts";
|
|
16
|
-
import { computeFraction, computeTone, computeUnclampedFraction } from "../usage-math.ts";
|
|
16
|
+
import { computeFraction, computeTone, computeUnclampedFraction } from "../web/usage-math.ts";
|
|
17
17
|
|
|
18
18
|
type TierAssignmentRow = { readonly tenantId: string; readonly tier: string };
|
|
19
19
|
|
|
@@ -12,9 +12,9 @@ import { subscriptionsProjectionTable } from "../../billing-foundation/index.ts"
|
|
|
12
12
|
import type { CapLimitContext } from "../../cap-counter/index.ts";
|
|
13
13
|
import { decryptTenantNames, tenantTable } from "../../tenant/index.ts";
|
|
14
14
|
import { tierAssignmentEntity } from "../../tier-engine/index.ts";
|
|
15
|
-
import { capFieldName } from "../constants.ts";
|
|
16
15
|
import type { CapSpec, CapUsage } from "../types.ts";
|
|
17
|
-
import {
|
|
16
|
+
import { capFieldName } from "../web/constants.ts";
|
|
17
|
+
import { computeFraction } from "../web/usage-math.ts";
|
|
18
18
|
|
|
19
19
|
type TenantRow = { readonly id: string; readonly name: string };
|
|
20
20
|
type TierAssignmentRow = {
|
|
@@ -1,6 +1,13 @@
|
|
|
1
1
|
// Public API of the cap-overview bundled-feature.
|
|
2
2
|
|
|
3
3
|
export { DEFAULT_CAP_USAGE_ROLES } from "./access.ts";
|
|
4
|
+
export { type CreateCapOverviewOptions, createCapOverviewFeature } from "./feature.ts";
|
|
5
|
+
export {
|
|
6
|
+
createMyCapsScreen,
|
|
7
|
+
createTenantCapListScreen,
|
|
8
|
+
platformTenantCapsScreen,
|
|
9
|
+
} from "./screens.ts";
|
|
10
|
+
export type { CapSpec, CapUsage, CapUsageTone, CapUsageWithMeta } from "./types.ts";
|
|
4
11
|
export {
|
|
5
12
|
CAP_CARDS_PANEL_COMPONENT,
|
|
6
13
|
CAP_OVERVIEW_FEATURE,
|
|
@@ -10,12 +17,5 @@ export {
|
|
|
10
17
|
MY_CAPS_SCREEN_ID,
|
|
11
18
|
PLATFORM_TENANT_CAPS_SCREEN_ID,
|
|
12
19
|
TENANT_CAP_LIST_SCREEN_ID,
|
|
13
|
-
} from "./constants.ts";
|
|
14
|
-
export {
|
|
15
|
-
export {
|
|
16
|
-
createMyCapsScreen,
|
|
17
|
-
createTenantCapListScreen,
|
|
18
|
-
platformTenantCapsScreen,
|
|
19
|
-
} from "./screens.ts";
|
|
20
|
-
export type { CapSpec, CapUsage, CapUsageTone, CapUsageWithMeta } from "./types.ts";
|
|
21
|
-
export { computeFraction, computeTone } from "./usage-math.ts";
|
|
20
|
+
} from "./web/constants.ts";
|
|
21
|
+
export { computeFraction, computeTone } from "./web/usage-math.ts";
|
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import type { ScreenDefinition } from "@cosmicdrift/kumiko-framework/engine";
|
|
2
|
+
import type { CapSpec } from "./types.ts";
|
|
2
3
|
import {
|
|
3
4
|
CAP_CARDS_PANEL_COMPONENT,
|
|
4
5
|
CAP_USAGE_CELL_COMPONENT,
|
|
@@ -7,8 +8,7 @@ import {
|
|
|
7
8
|
MY_CAPS_SCREEN_ID,
|
|
8
9
|
PLATFORM_TENANT_CAPS_SCREEN_ID,
|
|
9
10
|
TENANT_CAP_LIST_SCREEN_ID,
|
|
10
|
-
} from "./constants.ts";
|
|
11
|
-
import type { CapSpec } from "./types.ts";
|
|
11
|
+
} from "./web/constants.ts";
|
|
12
12
|
|
|
13
13
|
// `tiers` has no room for a separate per-tier display label (it's just
|
|
14
14
|
// `readonly string[]`) — tier-engine itself has no enumerated tier list to
|
|
@@ -1,4 +1,3 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { ExtensionSectionProps } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import { usePrimitives, useQuery, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
4
3
|
import { EMPTY_VALUE_PLACEHOLDER } from "@cosmicdrift/kumiko-renderer/headless";
|
|
@@ -10,9 +9,9 @@ import {
|
|
|
10
9
|
} from "@cosmicdrift/kumiko-renderer/web";
|
|
11
10
|
import { Database, FileText, Gauge, Hash, Mail, Users } from "lucide-react";
|
|
12
11
|
import type { ComponentType, ReactNode } from "react";
|
|
13
|
-
import { CapOverviewQueries } from "../constants.ts";
|
|
14
12
|
import type { CapIconKey, CapUsageTone, CapUsageWithMeta } from "../types.ts";
|
|
15
13
|
import { CapUsageBar } from "./cap-usage-bar.tsx";
|
|
14
|
+
import { CapOverviewQueries } from "./constants.ts";
|
|
16
15
|
|
|
17
16
|
type CapsUsageResponse = { readonly rows: readonly CapUsageWithMeta[] };
|
|
18
17
|
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import { usePrimitives, useTranslation } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import type { ReactNode } from "react";
|
|
4
3
|
import type { CapUsage } from "../types.ts";
|
|
5
|
-
import { computeTone } from "
|
|
4
|
+
import { computeTone } from "./usage-math.ts";
|
|
6
5
|
|
|
7
6
|
export function CapUsageBar({
|
|
8
7
|
usage,
|
|
@@ -1,13 +1,12 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
import type { TranslationsByLocale } from "@cosmicdrift/kumiko-renderer";
|
|
3
2
|
import type { ClientFeatureDefinition } from "@cosmicdrift/kumiko-renderer/web";
|
|
3
|
+
import { CapCardsPanel } from "./cap-cards-panel.tsx";
|
|
4
|
+
import { CapUsageCell } from "./cap-usage-cell.tsx";
|
|
4
5
|
import {
|
|
5
6
|
CAP_CARDS_PANEL_COMPONENT,
|
|
6
7
|
CAP_OVERVIEW_FEATURE,
|
|
7
8
|
CAP_USAGE_CELL_COMPONENT,
|
|
8
|
-
} from "
|
|
9
|
-
import { CapCardsPanel } from "./cap-cards-panel.tsx";
|
|
10
|
-
import { CapUsageCell } from "./cap-usage-cell.tsx";
|
|
9
|
+
} from "./constants.ts";
|
|
11
10
|
|
|
12
11
|
export type CapOverviewClientOptions = {
|
|
13
12
|
readonly translations?: TranslationsByLocale;
|
|
@@ -1,8 +1,7 @@
|
|
|
1
|
-
// @runtime client
|
|
2
1
|
// Pure math with no runtime deps — both the query handlers (runtime → client
|
|
3
2
|
// is allowed by the compat matrix) and cap-usage-bar.tsx (client → client)
|
|
4
3
|
// import it.
|
|
5
|
-
import type { CapUsageTone } from "
|
|
4
|
+
import type { CapUsageTone } from "../types.ts";
|
|
6
5
|
|
|
7
6
|
const WARN_THRESHOLD = 0.8;
|
|
8
7
|
const DANGER_THRESHOLD = 1;
|
|
@@ -4,11 +4,6 @@ import {
|
|
|
4
4
|
defineFeature,
|
|
5
5
|
type FeatureDefinition,
|
|
6
6
|
} from "@cosmicdrift/kumiko-framework/engine";
|
|
7
|
-
import {
|
|
8
|
-
COMPLIANCE_PROFILE_CATALOG_EXTENSION_NAME,
|
|
9
|
-
COMPLIANCE_PROFILE_SCREEN_ID,
|
|
10
|
-
ComplianceProfileHandlers,
|
|
11
|
-
} from "./constants.ts";
|
|
12
7
|
import { forTenantQuery } from "./handlers/for-tenant.query.ts";
|
|
13
8
|
import { listProfilesQuery } from "./handlers/list-profiles.query.ts";
|
|
14
9
|
import { createNeedsProfileQuery } from "./handlers/needs-profile.query.ts";
|
|
@@ -16,6 +11,11 @@ import { setProfileWrite } from "./handlers/set-profile.write.ts";
|
|
|
16
11
|
import { subProcessorsQuery } from "./handlers/sub-processors.query.ts";
|
|
17
12
|
import { COMPLIANCE_PROFILES_I18N } from "./i18n.ts";
|
|
18
13
|
import { tenantComplianceProfileEntity } from "./schema/profile-selection.ts";
|
|
14
|
+
import {
|
|
15
|
+
COMPLIANCE_PROFILE_CATALOG_EXTENSION_NAME,
|
|
16
|
+
COMPLIANCE_PROFILE_SCREEN_ID,
|
|
17
|
+
ComplianceProfileHandlers,
|
|
18
|
+
} from "./web/constants.ts";
|
|
19
19
|
|
|
20
20
|
export {
|
|
21
21
|
tenantComplianceProfileEntity,
|