@cosmicdrift/kumiko-samples 0.385.0 → 0.387.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/LICENSE +21 -57
- package/README.md +1 -1
- package/package.json +2 -2
- package/packages/bundled-features/package.json +2 -2
- package/packages/bundled-features/src/agent-tools/tool-catalog.ts +1 -1
- package/packages/bundled-features/src/agent-tools/tool-dispatch.ts +0 -2
- package/packages/bundled-features/src/audit/screens.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/auth-user-row.ts +10 -10
- package/packages/bundled-features/src/auth-email-password/feature.ts +6 -6
- package/packages/bundled-features/src/auth-email-password/handlers/change-password.write.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/handlers/confirm-token-flow.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-accept.write.ts +18 -18
- package/packages/bundled-features/src/auth-email-password/handlers/invite-create.write.ts +12 -12
- package/packages/bundled-features/src/auth-email-password/handlers/invite-info.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts +24 -26
- package/packages/bundled-features/src/auth-email-password/handlers/login.write.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/handlers/signup-confirm.write.ts +34 -37
- package/packages/bundled-features/src/auth-email-password/handlers/signup-request.write.ts +6 -7
- package/packages/bundled-features/src/auth-email-password/handlers/switch-tenant-mfa-gate.write.ts +1 -5
- package/packages/bundled-features/src/auth-email-password/index.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/lockout-store.ts +1 -1
- package/packages/bundled-features/src/auth-email-password/seeding.ts +63 -66
- package/packages/bundled-features/src/auth-email-password/signup-token-store.ts +8 -8
- package/packages/bundled-features/src/auth-email-password/testing.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/web/auth-client.ts +57 -57
- package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +14 -14
- package/packages/bundled-features/src/auth-email-password/web/auth-gate.tsx +15 -16
- package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +11 -12
- package/packages/bundled-features/src/auth-email-password/web/confirm-account-unlock-screen.tsx +1 -1
- package/packages/bundled-features/src/auth-email-password/web/constants.ts +3 -3
- package/packages/bundled-features/src/auth-email-password/web/default-topbar-actions.tsx +14 -14
- package/packages/bundled-features/src/auth-email-password/web/forgot-password-screen.tsx +11 -11
- package/packages/bundled-features/src/auth-email-password/web/index.ts +5 -5
- package/packages/bundled-features/src/auth-email-password/web/invite-accept-screen.tsx +17 -17
- package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +3 -4
- package/packages/bundled-features/src/auth-email-password/web/reset-password-screen.tsx +16 -17
- package/packages/bundled-features/src/auth-email-password/web/session.tsx +34 -34
- package/packages/bundled-features/src/auth-email-password/web/signup-complete-screen.tsx +3 -3
- package/packages/bundled-features/src/auth-email-password/web/signup-screen.tsx +14 -14
- package/packages/bundled-features/src/auth-email-password/web/tenant-switcher.tsx +26 -27
- package/packages/bundled-features/src/auth-email-password/web/use-shell-user.ts +12 -13
- package/packages/bundled-features/src/auth-email-password/web/user-menu.tsx +17 -18
- package/packages/bundled-features/src/auth-email-password/web/verify-email-screen.tsx +11 -12
- package/packages/bundled-features/src/auth-foundation/boot-checks.ts +4 -4
- package/packages/bundled-features/src/auth-foundation/resolve-anonymous-access.ts +4 -4
- package/packages/bundled-features/src/auth-foundation/types.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/disable.write.ts +3 -3
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm-preauth.write.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/handlers/enable-confirm.write.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/handlers/enable-start-preauth.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/reencrypt.job.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/handlers/regenerate-recovery.write.ts +5 -5
- package/packages/bundled-features/src/auth-mfa/handlers/verify.write.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/token-secrets.ts +1 -1
- package/packages/bundled-features/src/auth-mfa/web/client-plugin.ts +2 -2
- package/packages/bundled-features/src/auth-mfa/web/i18n.ts +3 -3
- package/packages/bundled-features/src/auth-mfa/web/index.ts +4 -4
- package/packages/bundled-features/src/auth-mfa/web/mfa-client.ts +17 -16
- package/packages/bundled-features/src/auth-mfa/web/mfa-verify-screen.tsx +6 -6
- package/packages/bundled-features/src/billing-foundation/aggregate-id.ts +10 -11
- package/packages/bundled-features/src/billing-foundation/entities.ts +27 -27
- package/packages/bundled-features/src/billing-foundation/events.ts +22 -21
- package/packages/bundled-features/src/billing-foundation/feature.ts +42 -43
- package/packages/bundled-features/src/billing-foundation/get-subscription-for-tenant.ts +3 -5
- package/packages/bundled-features/src/billing-foundation/handlers/create-checkout-session.write.ts +18 -17
- package/packages/bundled-features/src/billing-foundation/handlers/create-portal-session.write.ts +11 -12
- package/packages/bundled-features/src/billing-foundation/handlers/list-subscriptions.query.ts +4 -4
- package/packages/bundled-features/src/billing-foundation/handlers/process-event.write.ts +20 -20
- package/packages/bundled-features/src/billing-foundation/projection.ts +38 -37
- package/packages/bundled-features/src/billing-foundation/subscription-tier-sync.ts +3 -3
- package/packages/bundled-features/src/billing-foundation/tenant-destroy-hook.ts +7 -8
- package/packages/bundled-features/src/billing-foundation/types.ts +64 -65
- package/packages/bundled-features/src/billing-foundation/web/billing-plans-panel.tsx +4 -4
- package/packages/bundled-features/src/billing-foundation/webhook-handler.ts +1 -1
- package/packages/bundled-features/src/cap-counter/aggregate-id.ts +8 -9
- package/packages/bundled-features/src/cap-counter/constants.ts +11 -12
- package/packages/bundled-features/src/cap-counter/enforce-cap.ts +64 -67
- package/packages/bundled-features/src/cap-counter/entity.ts +29 -29
- package/packages/bundled-features/src/cap-counter/feature.ts +34 -35
- package/packages/bundled-features/src/cap-counter/handlers/increment-rolling.write.ts +31 -31
- package/packages/bundled-features/src/cap-counter/handlers/mark-soft-warned.write.ts +4 -5
- package/packages/bundled-features/src/cap-counter/stock-cap-guard.ts +1 -1
- package/packages/bundled-features/src/cap-counter/with-cap-enforcement.ts +3 -5
- package/packages/bundled-features/src/cap-overview/handlers/caps-usage.query.ts +1 -3
- package/packages/bundled-features/src/cap-overview/handlers/tenant-caps-list.query.ts +1 -1
- package/packages/bundled-features/src/channel-email/smtp-transport.ts +34 -31
- package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +3 -4
- package/packages/bundled-features/src/compliance-profiles/feature.ts +15 -16
- package/packages/bundled-features/src/compliance-profiles/handlers/for-tenant.query.ts +3 -6
- package/packages/bundled-features/src/compliance-profiles/handlers/list-profiles.query.ts +5 -5
- package/packages/bundled-features/src/compliance-profiles/handlers/needs-profile.query.ts +4 -4
- package/packages/bundled-features/src/compliance-profiles/handlers/set-profile.write.ts +13 -14
- package/packages/bundled-features/src/compliance-profiles/handlers/sub-processors.query.ts +9 -11
- package/packages/bundled-features/src/compliance-profiles/resolve-for-tenant.ts +7 -7
- package/packages/bundled-features/src/compliance-profiles/schema/profile-selection.ts +18 -23
- package/packages/bundled-features/src/compliance-profiles/seeding.ts +14 -15
- package/packages/bundled-features/src/compliance-profiles-ops/handlers/tenants-missing-profile.query.ts +3 -3
- package/packages/bundled-features/src/compliance-profiles-ops/index.ts +2 -2
- package/packages/bundled-features/src/config/handlers/readiness.query.ts +7 -7
- package/packages/bundled-features/src/config/handlers/reencrypt.job.ts +4 -5
- package/packages/bundled-features/src/config/handlers/set.write.ts +4 -4
- package/packages/bundled-features/src/config/resolver.ts +4 -4
- package/packages/bundled-features/src/config/table.ts +10 -10
- package/packages/bundled-features/src/config/write-helpers.ts +1 -1
- package/packages/bundled-features/src/crypto-shredding/handlers/forget-subject.write.ts +13 -12
- package/packages/bundled-features/src/custom-fields/aggregate-id.ts +16 -17
- package/packages/bundled-features/src/custom-fields/entity.ts +49 -47
- package/packages/bundled-features/src/custom-fields/events.ts +7 -8
- package/packages/bundled-features/src/custom-fields/feature.ts +70 -72
- package/packages/bundled-features/src/custom-fields/handlers/clear-custom-field.write.ts +9 -8
- package/packages/bundled-features/src/custom-fields/handlers/define-tenant-field.write.ts +28 -26
- package/packages/bundled-features/src/custom-fields/handlers/delete-system-field.write.ts +6 -7
- package/packages/bundled-features/src/custom-fields/handlers/delete-tenant-field.write.ts +12 -13
- package/packages/bundled-features/src/custom-fields/handlers/set-custom-field.write.ts +25 -28
- package/packages/bundled-features/src/custom-fields/handlers/update-tenant-field.write.ts +6 -6
- package/packages/bundled-features/src/custom-fields/lib/field-access.ts +2 -2
- package/packages/bundled-features/src/custom-fields/lib/parse-serialized-field.ts +1 -1
- package/packages/bundled-features/src/custom-fields/lib/quota.ts +1 -1
- package/packages/bundled-features/src/custom-fields/lib/value-schema.ts +10 -12
- package/packages/bundled-features/src/custom-fields/run-retention.ts +3 -3
- package/packages/bundled-features/src/custom-fields/schemas.ts +14 -14
- package/packages/bundled-features/src/custom-fields/web/client-plugin.tsx +2 -5
- package/packages/bundled-features/src/custom-fields/web/constants.ts +2 -2
- package/packages/bundled-features/src/custom-fields/web/custom-fields-form-section.tsx +26 -26
- package/packages/bundled-features/src/custom-fields/wire-for-entity.ts +65 -67
- package/packages/bundled-features/src/custom-fields/wire-user-data-rights.ts +3 -3
- package/packages/bundled-features/src/data-retention/_internal/parse-override.ts +2 -3
- package/packages/bundled-features/src/data-retention/feature.ts +11 -18
- package/packages/bundled-features/src/data-retention/handlers/policy-for.query.ts +6 -6
- package/packages/bundled-features/src/data-retention/keep-for.ts +17 -17
- package/packages/bundled-features/src/data-retention/override-schema.ts +13 -15
- package/packages/bundled-features/src/data-retention/presets.ts +18 -23
- package/packages/bundled-features/src/data-retention/resolve-for-tenant.ts +1 -1
- package/packages/bundled-features/src/data-retention/resolve-tenant-preset.ts +17 -16
- package/packages/bundled-features/src/data-retention/resolver.ts +33 -32
- package/packages/bundled-features/src/data-retention/run-retention-cleanup.ts +71 -58
- package/packages/bundled-features/src/data-retention/schema/tenant-retention-override.ts +13 -11
- package/packages/bundled-features/src/delivery/feature.ts +3 -3
- package/packages/bundled-features/src/delivery/handlers/log.query.ts +1 -1
- package/packages/bundled-features/src/delivery/tables.ts +9 -8
- package/packages/bundled-features/src/delivery/unsubscribe.ts +4 -4
- package/packages/bundled-features/src/delivery/upsert-preference.ts +3 -4
- package/packages/bundled-features/src/document-ingest-foundation/entity.ts +5 -5
- package/packages/bundled-features/src/document-ingest-foundation/events.ts +2 -2
- package/packages/bundled-features/src/document-ingest-foundation/feature.ts +2 -2
- package/packages/bundled-features/src/document-ingest-foundation/pages.ts +1 -1
- package/packages/bundled-features/src/document-ingest-foundation/tenant-destroy-hook.ts +4 -4
- package/packages/bundled-features/src/feature-toggles/compose-tier-resolver.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/feature.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/global-feature-state-table.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/handlers/registered.query.ts +5 -5
- package/packages/bundled-features/src/feature-toggles/toggle-runtime.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/toggle-sync-signal.ts +1 -1
- package/packages/bundled-features/src/feature-toggles/web/constants.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/feature.ts +2 -2
- package/packages/bundled-features/src/file-derivatives/handlers/public-variant.query.ts +1 -1
- package/packages/bundled-features/src/file-derivatives/presets.ts +1 -1
- package/packages/bundled-features/src/file-foundation/feature.ts +6 -6
- package/packages/bundled-features/src/file-provider-inmemory/feature.ts +16 -16
- package/packages/bundled-features/src/file-provider-s3/feature.ts +16 -16
- package/packages/bundled-features/src/file-provider-s3/lib/s3-provider.ts +6 -6
- package/packages/bundled-features/src/files/feature.ts +6 -6
- package/packages/bundled-features/src/files-tenant-data/handlers/sweep-orphaned-derivatives.job.ts +5 -5
- package/packages/bundled-features/src/files-tenant-data/hooks.ts +24 -26
- package/packages/bundled-features/src/files-tenant-data/index.ts +1 -1
- package/packages/bundled-features/src/folders/feature.ts +1 -1
- package/packages/bundled-features/src/folders/web/folder-manager.tsx +2 -2
- package/packages/bundled-features/src/folders/web/tree.ts +5 -5
- package/packages/bundled-features/src/form-draft/db/queries/cleanup.ts +1 -1
- package/packages/bundled-features/src/form-draft/db/queries/owned-file-refs.ts +1 -1
- package/packages/bundled-features/src/form-draft/entity.ts +3 -3
- package/packages/bundled-features/src/form-draft/feature.ts +4 -5
- package/packages/bundled-features/src/form-draft/handlers/discard.write.ts +1 -1
- package/packages/bundled-features/src/form-draft/release-file-refs.ts +6 -6
- package/packages/bundled-features/src/form-draft/schemas.ts +3 -3
- package/packages/bundled-features/src/form-draft/web/constants.ts +0 -2
- package/packages/bundled-features/src/inbound-mail-foundation/aggregate-id.ts +19 -19
- package/packages/bundled-features/src/inbound-mail-foundation/connect-routes.ts +4 -3
- package/packages/bundled-features/src/inbound-mail-foundation/constants.ts +30 -33
- package/packages/bundled-features/src/inbound-mail-foundation/entities.ts +47 -48
- package/packages/bundled-features/src/inbound-mail-foundation/events.ts +54 -50
- package/packages/bundled-features/src/inbound-mail-foundation/feature.ts +39 -39
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/account-state.ts +8 -8
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/connect-account.write.ts +25 -26
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/disconnect-account.write.ts +7 -7
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/ingest-message.write.ts +50 -51
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-accounts.query.ts +8 -8
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/list-messages.query.ts +10 -10
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/scope-visibility.ts +3 -4
- package/packages/bundled-features/src/inbound-mail-foundation/handlers/update-account.write.ts +11 -11
- package/packages/bundled-features/src/inbound-mail-foundation/oauth-state.ts +16 -15
- package/packages/bundled-features/src/inbound-mail-foundation/projection.ts +31 -29
- package/packages/bundled-features/src/inbound-mail-foundation/provider-factory.ts +9 -9
- package/packages/bundled-features/src/inbound-mail-foundation/retention-sweep.ts +45 -41
- package/packages/bundled-features/src/inbound-mail-foundation/tenant-destroy-hook.ts +14 -16
- package/packages/bundled-features/src/inbound-mail-foundation/types.ts +66 -67
- package/packages/bundled-features/src/inbound-mail-foundation/watch-supervisor.ts +69 -68
- package/packages/bundled-features/src/inbound-provider-imap/credential-document.ts +13 -13
- package/packages/bundled-features/src/inbound-provider-imap/feature.ts +42 -40
- package/packages/bundled-features/src/inbound-provider-imap/imap-client.ts +20 -19
- package/packages/bundled-features/src/inbound-provider-inmemory/feature.ts +21 -21
- package/packages/bundled-features/src/jobs/db/queries/retention.ts +2 -2
- package/packages/bundled-features/src/jobs/db/queries/stale-run-sweep.ts +3 -3
- package/packages/bundled-features/src/jobs/events.ts +1 -1
- package/packages/bundled-features/src/jobs/feature.ts +6 -7
- package/packages/bundled-features/src/jobs/handlers/detail.query.ts +4 -4
- package/packages/bundled-features/src/jobs/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/projection-rebuild.job.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/reindex-entity.job.ts +1 -1
- package/packages/bundled-features/src/jobs/handlers/retry.write.ts +1 -1
- package/packages/bundled-features/src/jobs/job-instant.ts +1 -1
- package/packages/bundled-features/src/jobs/job-run-logger.ts +14 -15
- package/packages/bundled-features/src/jobs/job-run-table.ts +3 -3
- package/packages/bundled-features/src/jobs/screens.ts +1 -1
- package/packages/bundled-features/src/jobs/tenant-job-failure-table.ts +1 -1
- package/packages/bundled-features/src/jobs/tenant-job-run-table.ts +1 -1
- package/packages/bundled-features/src/ledger/entity.ts +5 -5
- package/packages/bundled-features/src/ledger/feature.ts +3 -3
- package/packages/bundled-features/src/ledger/handlers/confirm-schedule-period.write.ts +3 -3
- package/packages/bundled-features/src/ledger/recurring.ts +12 -12
- package/packages/bundled-features/src/ledger/schemas.ts +1 -1
- package/packages/bundled-features/src/ledger/web/constants.ts +2 -2
- package/packages/bundled-features/src/ledger/web/index.ts +7 -7
- package/packages/bundled-features/src/legal-pages/feature.ts +40 -41
- package/packages/bundled-features/src/legal-pages/markdown.ts +3 -3
- package/packages/bundled-features/src/legal-pages/web/client-plugin.ts +23 -24
- package/packages/bundled-features/src/legal-pages/web/index.ts +0 -2
- package/packages/bundled-features/src/mail-foundation/feature.ts +26 -27
- package/packages/bundled-features/src/mail-transport-inmemory/feature.ts +27 -28
- package/packages/bundled-features/src/mail-transport-smtp/feature.ts +20 -20
- package/packages/bundled-features/src/managed-pages/branding.ts +6 -6
- package/packages/bundled-features/src/managed-pages/feature.ts +62 -62
- package/packages/bundled-features/src/managed-pages/handlers/by-slug.query.ts +5 -6
- package/packages/bundled-features/src/managed-pages/handlers/by-tenant-published.query.ts +8 -8
- package/packages/bundled-features/src/managed-pages/handlers/set.write.ts +5 -7
- package/packages/bundled-features/src/managed-pages/screens/page-screens.ts +11 -11
- package/packages/bundled-features/src/managed-pages/seeding.ts +8 -8
- package/packages/bundled-features/src/managed-pages/table.ts +16 -15
- package/packages/bundled-features/src/managed-pages/web/client-plugin.tsx +6 -6
- package/packages/bundled-features/src/managed-pages/web/i18n.ts +1 -1
- package/packages/bundled-features/src/notes-history/entity.ts +4 -4
- package/packages/bundled-features/src/notes-history/feature.ts +2 -2
- package/packages/bundled-features/src/notes-history-user-data/hooks.ts +1 -1
- package/packages/bundled-features/src/page-render/layout.ts +9 -9
- package/packages/bundled-features/src/page-render/markdown.ts +11 -11
- package/packages/bundled-features/src/page-render/security-headers.ts +7 -6
- package/packages/bundled-features/src/personal-access-tokens/feature.ts +5 -5
- package/packages/bundled-features/src/personal-access-tokens/roles.ts +2 -2
- package/packages/bundled-features/src/readiness/handlers/status.query.ts +3 -3
- package/packages/bundled-features/src/renderer-foundation/api.ts +12 -13
- package/packages/bundled-features/src/renderer-foundation/constants.ts +2 -2
- package/packages/bundled-features/src/renderer-foundation/feature.ts +7 -7
- package/packages/bundled-features/src/renderer-foundation/types.ts +11 -12
- package/packages/bundled-features/src/secrets/feature.ts +9 -9
- package/packages/bundled-features/src/secrets/web/constants.ts +2 -2
- package/packages/bundled-features/src/seo/feature.ts +3 -3
- package/packages/bundled-features/src/sessions/constants.ts +1 -1
- package/packages/bundled-features/src/sessions/feature.ts +9 -9
- package/packages/bundled-features/src/sessions/handlers/revoke-all-for-user.write.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/revoke-all-others.write.ts +2 -2
- package/packages/bundled-features/src/sessions/handlers/revoke.write.ts +1 -1
- package/packages/bundled-features/src/sessions/schema/user-session.ts +4 -4
- package/packages/bundled-features/src/sessions/screens.ts +2 -2
- package/packages/bundled-features/src/sessions/session-callbacks.ts +2 -2
- package/packages/bundled-features/src/sessions/session-revoked-event.ts +2 -2
- package/packages/bundled-features/src/shared/assert-no-where-rule-in-ownership-write.ts +1 -1
- package/packages/bundled-features/src/shared/decrypt-stored-pii.ts +1 -1
- package/packages/bundled-features/src/shared/encrypt-for-direct-write.ts +1 -1
- package/packages/bundled-features/src/shared/map-with-concurrency.ts +5 -4
- package/packages/bundled-features/src/shared/parent-visibility.ts +2 -2
- package/packages/bundled-features/src/shared/password-hashing.ts +1 -1
- package/packages/bundled-features/src/shared/signup-handover.ts +1 -2
- package/packages/bundled-features/src/shared/single-use-token-store.ts +1 -1
- package/packages/bundled-features/src/subscription-mollie/constants.ts +15 -17
- package/packages/bundled-features/src/subscription-mollie/feature.ts +41 -42
- package/packages/bundled-features/src/subscription-mollie/index.ts +3 -3
- package/packages/bundled-features/src/subscription-mollie/plugin-methods.ts +17 -16
- package/packages/bundled-features/src/subscription-mollie/verify-webhook.ts +34 -34
- package/packages/bundled-features/src/subscription-stripe/constants.ts +4 -6
- package/packages/bundled-features/src/subscription-stripe/feature.ts +44 -43
- package/packages/bundled-features/src/subscription-stripe/index.ts +6 -6
- package/packages/bundled-features/src/subscription-stripe/plugin-methods.ts +22 -27
- package/packages/bundled-features/src/subscription-stripe/runtime.ts +2 -2
- package/packages/bundled-features/src/subscription-stripe/verify-webhook.ts +62 -64
- package/packages/bundled-features/src/tags/feature.ts +3 -3
- package/packages/bundled-features/src/tags/screens.ts +1 -1
- package/packages/bundled-features/src/template-resolver/api.ts +10 -10
- package/packages/bundled-features/src/template-resolver/handlers/find-by-id.query.ts +5 -5
- package/packages/bundled-features/src/template-resolver/handlers/list.query.ts +1 -1
- package/packages/bundled-features/src/template-resolver/handlers/shared.ts +2 -2
- package/packages/bundled-features/src/template-resolver/handlers/template-write.ts +3 -3
- package/packages/bundled-features/src/template-resolver/handlers/upsert-system.write.ts +3 -4
- package/packages/bundled-features/src/template-resolver/handlers/upsert-tenant.write.ts +4 -5
- package/packages/bundled-features/src/template-resolver/seeding.ts +4 -4
- package/packages/bundled-features/src/template-resolver/table.ts +13 -14
- package/packages/bundled-features/src/template-resolver/web/client-plugin.tsx +2 -2
- package/packages/bundled-features/src/tenant/feature.ts +7 -7
- package/packages/bundled-features/src/tenant/handlers/member-directory.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/members.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/memberships.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/team-list.query.ts +1 -1
- package/packages/bundled-features/src/tenant/handlers/tenant-directory.query.ts +1 -1
- package/packages/bundled-features/src/tenant/invitation-table.ts +37 -40
- package/packages/bundled-features/src/tenant/membership-table.ts +3 -3
- package/packages/bundled-features/src/tenant/schema/tenant.ts +7 -9
- package/packages/bundled-features/src/tenant/screens.ts +1 -1
- package/packages/bundled-features/src/tenant/seeding.ts +19 -18
- package/packages/bundled-features/src/tenant/testing.ts +5 -6
- package/packages/bundled-features/src/tenant/web/constants.ts +2 -2
- package/packages/bundled-features/src/tenant-handover/events.ts +5 -7
- package/packages/bundled-features/src/tenant-handover/feature.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/grant.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/handlers/claim.write.ts +1 -1
- package/packages/bundled-features/src/tenant-handover/move-entity-graph.ts +8 -9
- package/packages/bundled-features/src/tenant-handover/signup-handover-provider.ts +1 -2
- package/packages/bundled-features/src/tenant-handover/transfer-graph.ts +4 -5
- package/packages/bundled-features/src/tenant-lifecycle/boot-checks.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/feature.ts +1 -1
- package/packages/bundled-features/src/tenant-lifecycle/run-tenant-destroy.ts +2 -2
- package/packages/bundled-features/src/tenant-lifecycle/stages.ts +1 -1
- package/packages/bundled-features/src/tenant-settings/constants.ts +1 -1
- package/packages/bundled-features/src/tenant-settings/tenant-defaults.ts +12 -5
- package/packages/bundled-features/src/tier-engine/aggregate-id.ts +15 -16
- package/packages/bundled-features/src/tier-engine/compose-app.ts +14 -14
- package/packages/bundled-features/src/tier-engine/entity.ts +18 -19
- package/packages/bundled-features/src/tier-engine/feature.ts +88 -87
- package/packages/bundled-features/src/tier-engine/handlers/active-tier.query.ts +6 -7
- package/packages/bundled-features/src/tier-engine/handlers/get-tenant-tier.query.ts +4 -4
- package/packages/bundled-features/src/tier-engine/handlers/set-tenant-tier.write.ts +8 -8
- package/packages/bundled-features/src/tier-engine/tier-resolver.ts +2 -2
- package/packages/bundled-features/src/tier-engine/trial.ts +13 -13
- package/packages/bundled-features/src/tier-engine/web/index.ts +4 -4
- package/packages/bundled-features/src/user/db/queries/stream-tenant-backfill.ts +8 -8
- package/packages/bundled-features/src/user/handlers/create.write.ts +4 -4
- package/packages/bundled-features/src/user/schema/user.ts +45 -44
- package/packages/bundled-features/src/user/seeding.ts +40 -40
- package/packages/bundled-features/src/user/testing.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/audit-download.ts +27 -28
- package/packages/bundled-features/src/user-data-rights/boot-checks.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/deletion-token.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/feature.ts +112 -113
- package/packages/bundled-features/src/user-data-rights/handlers/cancel-deletion.write.ts +9 -9
- package/packages/bundled-features/src/user-data-rights/handlers/confirm-deletion-by-token.write.ts +8 -8
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-job.query.ts +29 -30
- package/packages/bundled-features/src/user-data-rights/handlers/download-by-token.query.ts +40 -42
- package/packages/bundled-features/src/user-data-rights/handlers/export-status.query.ts +8 -9
- package/packages/bundled-features/src/user-data-rights/handlers/lift-restriction.write.ts +7 -8
- package/packages/bundled-features/src/user-data-rights/handlers/list-download-attempts.query.ts +2 -2
- package/packages/bundled-features/src/user-data-rights/handlers/my-audit-log.query.ts +4 -4
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion-by-email.write.ts +30 -29
- package/packages/bundled-features/src/user-data-rights/handlers/request-deletion.write.ts +15 -18
- package/packages/bundled-features/src/user-data-rights/handlers/request-export.write.ts +42 -41
- package/packages/bundled-features/src/user-data-rights/handlers/restrict-account.write.ts +22 -19
- package/packages/bundled-features/src/user-data-rights/handlers/run-forget-cleanup.write.ts +8 -8
- package/packages/bundled-features/src/user-data-rights/index.ts +8 -10
- package/packages/bundled-features/src/user-data-rights/lib/default-mailers.ts +3 -3
- package/packages/bundled-features/src/user-data-rights/lib/update-user-lifecycle.ts +24 -27
- package/packages/bundled-features/src/user-data-rights/run-export-jobs.ts +166 -276
- package/packages/bundled-features/src/user-data-rights/run-forget-cleanup.ts +85 -107
- package/packages/bundled-features/src/user-data-rights/run-user-export.ts +67 -69
- package/packages/bundled-features/src/user-data-rights/schema/download-attempt.ts +11 -11
- package/packages/bundled-features/src/user-data-rights/schema/download-token.ts +37 -41
- package/packages/bundled-features/src/user-data-rights/schema/export-job.ts +65 -67
- package/packages/bundled-features/src/user-data-rights/token-helpers.ts +21 -25
- package/packages/bundled-features/src/user-data-rights/web/client-plugin.tsx +6 -6
- package/packages/bundled-features/src/user-data-rights/web/confirm-deletion-screen.tsx +6 -5
- package/packages/bundled-features/src/user-data-rights/web/constants.ts +1 -1
- package/packages/bundled-features/src/user-data-rights/web/index.ts +5 -5
- package/packages/bundled-features/src/user-data-rights/web/privacy-center-screen.tsx +14 -13
- package/packages/bundled-features/src/user-data-rights/web/public-deletion-gate.tsx +13 -12
- package/packages/bundled-features/src/user-data-rights/web/request-deletion-screen.tsx +6 -6
- package/packages/bundled-features/src/user-data-rights/zip-path.ts +41 -40
- package/packages/bundled-features/src/user-data-rights-defaults/feature.ts +15 -15
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/delivery-attempt.userdata-hook.ts +3 -5
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/file-ref.userdata-hook.ts +45 -51
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/job-run.userdata-hook.ts +2 -2
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/notification-preference.userdata-hook.ts +1 -1
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user-session.userdata-hook.ts +3 -3
- package/packages/bundled-features/src/user-data-rights-defaults/hooks/user.userdata-hook.ts +32 -31
- package/packages/bundled-features/src/user-profile/handlers/change-email.write.ts +13 -13
- package/packages/bundled-features/src/user-profile/index.ts +3 -3
- package/packages/bundled-features/src/user-profile/web/client-plugin.ts +1 -1
- package/packages/bundled-features/src/user-profile/web/constants.ts +1 -1
- package/packages/bundled-features/src/user-profile/web/profile-screen.tsx +1 -1
- package/packages/bundled-features/src/workflow-runner/aggregate-id.ts +1 -1
- package/packages/bundled-features/src/workflow-runner/event-subscriber.ts +4 -5
- package/packages/bundled-features/src/workflow-runner/event-trigger.ts +4 -15
- package/packages/bundled-features/src/workflow-runner/feature.ts +2 -2
- package/packages/bundled-features/src/workflow-runner/handlers/resume-run.write.ts +4 -4
- package/packages/bundled-features/src/workflow-runner/pending-projection.ts +6 -7
- package/packages/bundled-features/src/workflow-runner/runner.ts +6 -6
- package/packages/bundled-features/src/workflow-runner/tables.ts +6 -6
- package/packages/bundled-features/src/workflow-runner/workflow-registry.ts +1 -1
package/LICENSE
CHANGED
|
@@ -1,57 +1,21 @@
|
|
|
1
|
-
|
|
2
|
-
|
|
3
|
-
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
controlling, or under common control with the Licensor ("Affiliates"), or
|
|
23
|
-
contractors acting on their behalf. The Licensor remains free to use the
|
|
24
|
-
Licensed Work for any purpose, including for the operation of kumiko.rocks.
|
|
25
|
-
|
|
26
|
-
Change Date: 2030-05-05
|
|
27
|
-
Change License: Apache License, Version 2.0
|
|
28
|
-
|
|
29
|
-
|
|
30
|
-
Terms
|
|
31
|
-
|
|
32
|
-
The Licensor hereby grants you the right to copy, modify, create derivative works,
|
|
33
|
-
redistribute, and make non-production use of the Licensed Work. The Licensor may
|
|
34
|
-
make an Additional Use Grant, above, permitting limited production use.
|
|
35
|
-
|
|
36
|
-
Effective on the Change Date, or the fourth anniversary of the first publicly
|
|
37
|
-
available distribution of the Licensed Work under this License, whichever comes
|
|
38
|
-
first, this License will convert to the Change License.
|
|
39
|
-
|
|
40
|
-
This Business Source License governs use of the Licensed Work in all cases, except
|
|
41
|
-
as to any use that is explicitly granted in the Additional Use Grant above or
|
|
42
|
-
under the Change License after the Change Date.
|
|
43
|
-
|
|
44
|
-
If your use of the Licensed Work does not comply with the requirements of this
|
|
45
|
-
License, you must cease use of the Licensed Work immediately.
|
|
46
|
-
|
|
47
|
-
All copies of the Licensed Work, and all derivative works thereof, must include
|
|
48
|
-
this License.
|
|
49
|
-
|
|
50
|
-
This License does not grant you any right, title, or interest in any trademark,
|
|
51
|
-
logo, or branding of the Licensor, except as required to comply with this License.
|
|
52
|
-
|
|
53
|
-
TO THE EXTENT PERMITTED BY APPLICABLE LAW, THE LICENSED WORK IS PROVIDED ON AN
|
|
54
|
-
“AS IS” BASIS. LICENSOR DISCLAIMS ALL WARRANTIES, EXPRESS OR IMPLIED, INCLUDING
|
|
55
|
-
WITHOUT LIMITATION WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE,
|
|
56
|
-
TITLE, AND NON-INFRINGEMENT. IN NO EVENT WILL LICENSOR BE LIABLE FOR ANY DAMAGES
|
|
57
|
-
ARISING OUT OF OR RELATED TO THIS LICENSE OR THE USE OF THE LICENSED WORK.
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Marc Frost
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
CHANGED
|
@@ -11,4 +11,4 @@ packages/bundled-features/src/**
|
|
|
11
11
|
|
|
12
12
|
This package contains plain sources only. It has no runtime API and no entry point; tests, build output and dotfiles are left out. Point tooling at the installed package directory (resolve `@cosmicdrift/kumiko-samples/package.json`), for example `buildFewShotCorpus({ repoRoot })` from `@cosmicdrift/kumiko-dev-server`, to get the same entry ids and source paths as in the monorepo.
|
|
13
13
|
|
|
14
|
-
License:
|
|
14
|
+
License: MIT
|
package/package.json
CHANGED
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-samples",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.387.0",
|
|
4
4
|
"description": "Source trees of the Kumiko sample recipes, sample apps and bundled features in repo layout, for tooling such as few-shot corpus builds.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cosmicdrift/kumiko-bundled-features",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.387.0",
|
|
4
4
|
"description": "Built-in features — tenant, user, auth, delivery. The stuff you'd rewrite anyway, already typed.",
|
|
5
|
-
"license": "
|
|
5
|
+
"license": "MIT",
|
|
6
6
|
"author": "Marc Frost <marc@cosmicdriftgamestudio.com>",
|
|
7
7
|
"repository": {
|
|
8
8
|
"type": "git",
|
|
@@ -100,7 +100,7 @@ function isDetailHandlerQn(qn: string, entityName: string): boolean {
|
|
|
100
100
|
return qn.endsWith(`:${entityName}:detail`);
|
|
101
101
|
}
|
|
102
102
|
|
|
103
|
-
/**
|
|
103
|
+
/** The entity CRUD tools are enumerated off the registry, not off the manifest, so
|
|
104
104
|
* `resolveAgentExposure` never runs for them. Only an EXPLICIT opt-out may hide one here —
|
|
105
105
|
* the resolver's own default is fail-closed on a missing `description`, and CRUD-generated
|
|
106
106
|
* handlers never carry one, so reusing it would delete every entity tool in every app. */
|
|
@@ -427,8 +427,6 @@ export async function dispatchToolCall(request: ToolCallRequest): Promise<ToolCa
|
|
|
427
427
|
}
|
|
428
428
|
|
|
429
429
|
try {
|
|
430
|
-
// The invoked tool, not the surrounding turn/approve write handler, must
|
|
431
|
-
// be what the irreversible-operation gate sees as the entry handler.
|
|
432
430
|
return await runAsDirectCallEntry(async () => {
|
|
433
431
|
switch (descriptor.kind) {
|
|
434
432
|
case "search":
|
|
@@ -100,7 +100,7 @@ export function auditLogDetailLayout(options: { readonly withTenant: boolean }):
|
|
|
100
100
|
"id",
|
|
101
101
|
],
|
|
102
102
|
},
|
|
103
|
-
// No section `title` here (
|
|
103
|
+
// No section `title` here (label-dedup fix): each section
|
|
104
104
|
// holds exactly one field, so a title would repeat the field's own
|
|
105
105
|
// label (rendered by RenderField as the Field's heading) verbatim.
|
|
106
106
|
{ fields: [{ field: "payload", renderer: { format: "json" } }] },
|
|
@@ -17,19 +17,19 @@ export type AuthUserRow = {
|
|
|
17
17
|
readonly isDeleted?: boolean | null;
|
|
18
18
|
readonly emailVerified?: boolean | null;
|
|
19
19
|
readonly lastActiveTenantId?: TenantId | string | null;
|
|
20
|
-
// IANA zone — threaded into SessionUser.timezone at login
|
|
20
|
+
// IANA zone — threaded into SessionUser.timezone at login.
|
|
21
21
|
readonly timezone?: string | null;
|
|
22
|
-
// BCP-47 tag — threaded into SessionUser.locale at login
|
|
22
|
+
// BCP-47 tag — threaded into SessionUser.locale at login.
|
|
23
23
|
readonly locale?: string | null;
|
|
24
|
-
// JSON-encoded string[] —
|
|
25
|
-
// roles
|
|
26
|
-
// parseRoles()
|
|
24
|
+
// JSON-encoded string[] — global roles that apply alongside tenant-membership-
|
|
25
|
+
// roles (for example, SystemAdmin and BillingAdmin). The caller deserializes
|
|
26
|
+
// them with parseRoles() before merging them into the session.
|
|
27
27
|
readonly roles?: string | null;
|
|
28
|
-
// user.status
|
|
29
|
-
// "deleted". Login.write.ts
|
|
30
|
-
// DeletionRequested
|
|
31
|
-
// user
|
|
32
|
-
//
|
|
28
|
+
// user.status — "active" | "restricted" | "deletion_requested" |
|
|
29
|
+
// "deleted". Login.write.ts blocks Restricted (DSGVO Art. 18),
|
|
30
|
+
// DeletionRequested, and Deleted. It remains an untyped string because the
|
|
31
|
+
// source enum is internal to the user feature; auth imports the constants at
|
|
32
|
+
// the point of use.
|
|
33
33
|
readonly status?: string | null;
|
|
34
34
|
};
|
|
35
35
|
|
|
@@ -120,13 +120,13 @@ export type AccountLockoutOptions = {
|
|
|
120
120
|
// (256 bit) and Redis is the source of truth, so tokenTtlMinutes is the only knob.
|
|
121
121
|
export type SignupOptions = SignupRequestOptions;
|
|
122
122
|
|
|
123
|
-
// Tenant-
|
|
124
|
-
// invite-create
|
|
125
|
-
//
|
|
126
|
-
// 7
|
|
123
|
+
// Tenant-invite magic link. When set, the feature registers the
|
|
124
|
+
// invite-create and invite-accept handlers. Branches 2 and 3 (anonymous
|
|
125
|
+
// flows) will be added as separate handlers later. The default
|
|
126
|
+
// tokenTtlMinutes is 7 days (industry standard).
|
|
127
127
|
export type InviteOptions = InviteCreateOptions;
|
|
128
128
|
|
|
129
|
-
// Account-Unlock Magic-Link
|
|
129
|
+
// Account-Unlock Magic-Link. When set, registers the
|
|
130
130
|
// request-account-unlock + confirm-account-unlock handlers — the
|
|
131
131
|
// self-service escape hatch for the monotonic lockout counter (see
|
|
132
132
|
// lockout-store.ts). Only meaningful paired with `accountLockout`, but
|
|
@@ -180,7 +180,7 @@ export function createAuthEmailPasswordFeature(
|
|
|
180
180
|
r.describe(
|
|
181
181
|
"Provides email+password authentication: the always-on handlers are `login`, `changePassword`, and `logout`; optional flows — password reset, email verification, magic-link self-signup, tenant invite, and account-unlock — are registered only when you pass their respective option objects (`passwordReset`, `emailVerification`, `signup`, `invite`, `accountUnlock`) to `createAuthEmailPasswordFeature(opts)`. All five magic-link flows dispatch their mail through the `delivery` feature via `ctx.notify`, so mounting any of them additionally requires `delivery`. Tokens are HMAC-signed (reset/verify/unlock) or opaque-random in Redis (signup/invite). `accountUnlock` is the self-service escape hatch for `accountLockout`'s monotonic failure-counter (#1266): confirming the mailed token clears the Redis lockout state without touching the user entity. Requires the `user` and `tenant` features, and declares `JWT_SECRET` (≥ 32 chars) in `authEmailPasswordEnvSchema` so a missing secret surfaces at boot validation rather than on the first login attempt.",
|
|
182
182
|
);
|
|
183
|
-
// kumiko-lint-ignore i18n-ui-strings uiHints labels are feature-registry metadata for the admin feature catalog, not yet wired to the i18n system
|
|
183
|
+
// kumiko-lint-ignore i18n-ui-strings uiHints labels are feature-registry metadata for the admin feature catalog, not yet wired to the i18n system
|
|
184
184
|
r.uiHints({
|
|
185
185
|
displayLabel: "Auth \u00b7 Email + Password",
|
|
186
186
|
category: "identity",
|
|
@@ -55,9 +55,9 @@ export const changePasswordWrite = defineWriteHandler({
|
|
|
55
55
|
|
|
56
56
|
const newHash = await hashPassword(event.payload.newPassword);
|
|
57
57
|
|
|
58
|
-
// The user aggregate is systemStream
|
|
59
|
-
// SYSTEM_TENANT_ID deterministically.
|
|
60
|
-
// one-time backfillUserStreamTenants migration
|
|
58
|
+
// The user aggregate is systemStream: its event stream lives on
|
|
59
|
+
// SYSTEM_TENANT_ID deterministically. Previously scattered streams need the
|
|
60
|
+
// one-time backfillUserStreamTenants migration.
|
|
61
61
|
const writer = createSystemUser(SYSTEM_TENANT_ID);
|
|
62
62
|
|
|
63
63
|
// Apply via user feature's update handler — writeAs(system) satisfies
|
|
@@ -15,11 +15,11 @@
|
|
|
15
15
|
// else — including future branches a maintainer adds — releases
|
|
16
16
|
// automatically.
|
|
17
17
|
//
|
|
18
|
-
// The user aggregate
|
|
18
|
+
// The user aggregate uses systemStream: its event stream lives on
|
|
19
19
|
// SYSTEM_TENANT_ID deterministically, so the write targets exactly one
|
|
20
20
|
// stream. The former membership-probing (`tryWriteAcrossTenants`) existed
|
|
21
|
-
// for
|
|
22
|
-
// backfillUserStreamTenants migration
|
|
21
|
+
// for scattered streams; those need the one-time
|
|
22
|
+
// backfillUserStreamTenants migration — probing them stopped working
|
|
23
23
|
// the moment the executor's stream choke-point landed anyway.
|
|
24
24
|
|
|
25
25
|
import {
|
|
@@ -108,8 +108,8 @@ export async function runConfirmTokenFlow<TSuccessData>(
|
|
|
108
108
|
committed = true;
|
|
109
109
|
return { isSuccess: true, data: spec.successData };
|
|
110
110
|
}
|
|
111
|
-
// version_conflict = concurrent modification (or an un-migrated
|
|
112
|
-
// stream
|
|
111
|
+
// version_conflict = concurrent modification (or an un-migrated
|
|
112
|
+
// stream) → token-level failure. Anything else (DB down,
|
|
113
113
|
// access denied) bubbles unchanged so ops sees the real failure class.
|
|
114
114
|
if (writeRes.error.code === "version_conflict") return spec.invalidToken();
|
|
115
115
|
return writeRes;
|
package/packages/bundled-features/src/auth-email-password/handlers/invite-accept-with-login.write.ts
CHANGED
|
@@ -191,7 +191,7 @@ export function createInviteAcceptWithLoginHandler(opts: InviteAcceptWithLoginOp
|
|
|
191
191
|
|
|
192
192
|
// Password check against userTable, through the same gates
|
|
193
193
|
// login.write.ts runs (see login-gates.test.ts for the gate contracts).
|
|
194
|
-
// Email uniqueness is partial on live rows
|
|
194
|
+
// Email uniqueness is partial on live rows — without
|
|
195
195
|
// this filter the lookup can resolve a soft-deleted row.
|
|
196
196
|
const userRow = await ctx.db.global(userTable).fetchOne<UserAuthRow>({
|
|
197
197
|
email: invitationEmail,
|
|
@@ -1,19 +1,19 @@
|
|
|
1
|
-
// Tenant
|
|
1
|
+
// Tenant invitation — logged-in user accepts.
|
|
2
2
|
//
|
|
3
|
-
//
|
|
3
|
+
// The user is signed in to some tenant and clicks the Accept link.
|
|
4
4
|
// Server:
|
|
5
5
|
// 1. Token → invitationId (Redis)
|
|
6
6
|
// 2. Burn (single-use)
|
|
7
|
-
// 3.
|
|
8
|
-
// 4. Email
|
|
7
|
+
// 3. Load the invitation row from the database
|
|
8
|
+
// 4. Email match: invitation.email === user.email (otherwise inviteEmailMismatch)
|
|
9
9
|
// 5+6. grantInvitedMembershipRole: create the membership, or add the
|
|
10
10
|
// invited role to an existing one (add-only)
|
|
11
|
-
// 7. Invitation
|
|
12
|
-
// 8. Redis
|
|
11
|
+
// 7. Invitation row → status=accepted
|
|
12
|
+
// 8. Delete Redis keys (the burn key remains for replay protection)
|
|
13
13
|
//
|
|
14
|
-
//
|
|
15
|
-
//
|
|
16
|
-
//
|
|
14
|
+
// This is the classic "shared workspace with a logged-in session" flow.
|
|
15
|
+
// Branch 2 (anonymous + existing email) and Branch 3 (anonymous + new
|
|
16
|
+
// email) are handled separately.
|
|
17
17
|
|
|
18
18
|
import {
|
|
19
19
|
createEventStoreExecutor,
|
|
@@ -29,7 +29,7 @@ import { InternalError, writeFailure } from "@cosmicdrift/kumiko-framework/error
|
|
|
29
29
|
import type { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
30
30
|
import * as z from "zod";
|
|
31
31
|
import { decryptStoredPii } from "../../shared/index.ts";
|
|
32
|
-
// kumiko-lint-ignore cross-feature-import invite
|
|
32
|
+
// kumiko-lint-ignore cross-feature-import the invite flow lives in auth-email-password (Magic-Link), while the DB-row owner is a tenant feature
|
|
33
33
|
import {
|
|
34
34
|
INVITATION_STATUS,
|
|
35
35
|
tenantInvitationEntity,
|
|
@@ -42,7 +42,7 @@ import {
|
|
|
42
42
|
grantInvitedGlobalRoles,
|
|
43
43
|
parseInvitedGlobalRoles,
|
|
44
44
|
} from "../../user/invited-global-roles.ts";
|
|
45
|
-
// kumiko-lint-ignore cross-feature-import auth handler reads user
|
|
45
|
+
// kumiko-lint-ignore cross-feature-import the auth handler reads the user row for the email match
|
|
46
46
|
import { userTable } from "../../user/schema/user.ts";
|
|
47
47
|
import { invalidInviteToken, inviteEmailMismatch } from "../errors.ts";
|
|
48
48
|
import {
|
|
@@ -138,9 +138,9 @@ export function createInviteAcceptHandler() {
|
|
|
138
138
|
const invitationRole = invitation.role;
|
|
139
139
|
const invitationVersion = invitation.version;
|
|
140
140
|
|
|
141
|
-
// Email
|
|
142
|
-
//
|
|
143
|
-
//
|
|
141
|
+
// Email match: the user must match the invited email.
|
|
142
|
+
// Otherwise, anyone with access to the invitee's email could add
|
|
143
|
+
// their own account to the tenant.
|
|
144
144
|
const userRow = await ctx.db.global(userTable).fetchOne<UserEmailRow>({
|
|
145
145
|
id: event.user.id,
|
|
146
146
|
});
|
|
@@ -169,10 +169,10 @@ export function createInviteAcceptHandler() {
|
|
|
169
169
|
});
|
|
170
170
|
if (!globalGrant.isSuccess) return globalGrant;
|
|
171
171
|
|
|
172
|
-
// Invitation
|
|
173
|
-
// Tenant
|
|
174
|
-
// (
|
|
175
|
-
// invitation
|
|
172
|
+
// Invitation status → accepted via event-store-executor.
|
|
173
|
+
// Tenant scoping: ctx.db is scoped to event.user.tenantId
|
|
174
|
+
// (not the invitation tenant). Build a TenantDb for the
|
|
175
|
+
// invitation tenant so the executor can find the row.
|
|
176
176
|
const invitationTdb = createTenantDb({
|
|
177
177
|
db: dbConn,
|
|
178
178
|
tenantId: invitationTenantId,
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
// Tenant-Invite Step 1 (create).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
5
|
-
//
|
|
6
|
-
//
|
|
7
|
-
//
|
|
3
|
+
// An admin invites an email address → a DB row is created via
|
|
4
|
+
// event-store-executor (or reused for a re-invite), a random token is stored
|
|
5
|
+
// bidirectionally in Redis, and the handler sends the invite email to the
|
|
6
|
+
// invitee via delivery (ctx.notify), as with reset/verify/signup. The token
|
|
7
|
+
// is NOT returned to the admin, so the admin cannot impersonate acceptance.
|
|
8
8
|
//
|
|
9
9
|
// Re-invite for the same (tenantId, email): the existing row is reused
|
|
10
10
|
// regardless of its prior status (pending/cancelled/accepted), reset to
|
|
@@ -12,10 +12,10 @@
|
|
|
12
12
|
// still live for that invitation is invalidated first, so the previous
|
|
13
13
|
// mail's link stops working (see invite-token-store.ts).
|
|
14
14
|
//
|
|
15
|
-
// Always-200
|
|
16
|
-
//
|
|
17
|
-
//
|
|
18
|
-
//
|
|
15
|
+
// Always-200 for an unknown user: an invite is created even when the
|
|
16
|
+
// invitee's email does not exist in users — the Branch-3-Accept-Flow
|
|
17
|
+
// permits new-user-signup with the token. invite-create does not enable
|
|
18
|
+
// enumeration.
|
|
19
19
|
|
|
20
20
|
import { generateToken } from "@cosmicdrift/kumiko-framework/api";
|
|
21
21
|
import { createEventStoreExecutor } from "@cosmicdrift/kumiko-framework/db";
|
|
@@ -35,7 +35,7 @@ import {
|
|
|
35
35
|
import { isValidLocaleTag } from "@cosmicdrift/kumiko-framework/i18n";
|
|
36
36
|
import { Temporal } from "@cosmicdrift/kumiko-types/temporal";
|
|
37
37
|
import * as z from "zod";
|
|
38
|
-
// kumiko-lint-ignore cross-feature-import invite
|
|
38
|
+
// kumiko-lint-ignore cross-feature-import invite flow lives in auth-email-password (Magic-Link-Pattern); DB-row owner is the tenant feature
|
|
39
39
|
import {
|
|
40
40
|
INVITATION_STATUS,
|
|
41
41
|
tenantInvitationEntity,
|
|
@@ -77,7 +77,7 @@ export type InviteCreateData = {
|
|
|
77
77
|
};
|
|
78
78
|
|
|
79
79
|
export type InviteCreateOptions = {
|
|
80
|
-
/** TTL
|
|
80
|
+
/** TTL for the activation token. Default: 7 days. */
|
|
81
81
|
readonly tokenTtlMinutes?: number;
|
|
82
82
|
/** App page that receives the magic-link; the handler appends `?token=…`
|
|
83
83
|
* and dispatches the invite mail via delivery (ctx.notify). Apps with
|
|
@@ -95,7 +95,7 @@ export type InviteCreateOptions = {
|
|
|
95
95
|
// further restrict assignable ranked roles.
|
|
96
96
|
readonly canAssignRole?: (inviterRoles: readonly string[], targetRole: string) => boolean;
|
|
97
97
|
/** Opt-in allow-list for app-defined (unranked) roles the elevation guard
|
|
98
|
-
* would otherwise reject with unassignable_membership_role
|
|
98
|
+
* would otherwise reject with unassignable_membership_role.
|
|
99
99
|
* Rank-aware alternative: declare roles via EXT_ASSIGNABLE_ROLE. */
|
|
100
100
|
readonly additionalAssignableRoles?: readonly string[];
|
|
101
101
|
};
|
|
@@ -10,7 +10,7 @@ import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
|
|
|
10
10
|
import { UnprocessableError } from "@cosmicdrift/kumiko-framework/errors";
|
|
11
11
|
import * as z from "zod";
|
|
12
12
|
import { decryptStoredPii } from "../../shared/index.ts";
|
|
13
|
-
// kumiko-lint-ignore cross-feature-import invite-flow
|
|
13
|
+
// kumiko-lint-ignore cross-feature-import invite-flow lives in auth-email-password (Magic-Link), DB-row-owner belongs to the tenant feature
|
|
14
14
|
import { INVITATION_STATUS, tenantInvitationsTable } from "../../tenant/invitation-table.ts";
|
|
15
15
|
// kumiko-lint-ignore cross-feature-import login-style account lookup, same as invite-accept-with-login
|
|
16
16
|
import { userTable } from "../../user/schema/user.ts";
|
package/packages/bundled-features/src/auth-email-password/handlers/invite-signup-complete.write.ts
CHANGED
|
@@ -1,21 +1,21 @@
|
|
|
1
|
-
// Tenant-Invite Step 2 — Branch 3 (
|
|
1
|
+
// Tenant-Invite Step 2 — Branch 3 (anonymous user, email NOT registered).
|
|
2
2
|
//
|
|
3
|
-
//
|
|
4
|
-
//
|
|
3
|
+
// Unlike signup-confirm, no new tenant is created. The tenant already
|
|
4
|
+
// exists in the invitation row; only the user and membership are created.
|
|
5
5
|
//
|
|
6
6
|
// Flow:
|
|
7
|
-
// 1. User
|
|
8
|
-
// 2.
|
|
9
|
-
//
|
|
10
|
-
// 3. User
|
|
7
|
+
// 1. User clicks the invite link → /invite/signup?token=...
|
|
8
|
+
// 2. The frontend shows the password form (the email comes from the
|
|
9
|
+
// invitation, not user input, so an email mismatch is impossible)
|
|
10
|
+
// 3. User submits the password and token
|
|
11
11
|
// 4. Server:
|
|
12
12
|
// a. Token → invitationId → invitation row
|
|
13
|
-
// b. User-
|
|
14
|
-
//
|
|
15
|
-
// c. Create user (emailVerified=true
|
|
16
|
-
// d. Add membership
|
|
17
|
-
// e.
|
|
18
|
-
// 5. Response: SessionUser + tenantId
|
|
13
|
+
// b. User-existence check: invitation.email must NOT exist in userTable
|
|
14
|
+
// (otherwise Branch 2 or Branch 1 must be used)
|
|
15
|
+
// c. Create the user (emailVerified=true because of the magic link)
|
|
16
|
+
// d. Add membership to the invited tenant
|
|
17
|
+
// e. Mark the invitation accepted and delete the token
|
|
18
|
+
// 5. Response: SessionUser + tenantId for automatic login
|
|
19
19
|
|
|
20
20
|
import {
|
|
21
21
|
createEventStoreExecutor,
|
|
@@ -44,7 +44,7 @@ import {
|
|
|
44
44
|
findForbiddenMembershipRole,
|
|
45
45
|
reservedMembershipRoleError,
|
|
46
46
|
} from "../../tenant/membership-roles.ts";
|
|
47
|
-
// kumiko-lint-ignore cross-feature-import membership-seed-helper
|
|
47
|
+
// kumiko-lint-ignore cross-feature-import membership-seed-helper for privileged cross-tenant addition
|
|
48
48
|
import { seedTenantMembership } from "../../tenant/seeding.ts";
|
|
49
49
|
// kumiko-lint-ignore cross-feature-import global roles granted on invite accept live on the user row
|
|
50
50
|
import { parseInvitedGlobalRoles } from "../../user/invited-global-roles.ts";
|
|
@@ -144,20 +144,19 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
|
|
|
144
144
|
const invitationGlobalRoles = parseInvitedGlobalRoles(invitation.globalRoles);
|
|
145
145
|
const invitationVersion = invitation.version;
|
|
146
146
|
|
|
147
|
-
//
|
|
148
|
-
//
|
|
149
|
-
//
|
|
150
|
-
//
|
|
151
|
-
//
|
|
152
|
-
// this filter the lookup can resolve a soft-deleted row.
|
|
147
|
+
// If the email is already registered, the user must use Branch 2
|
|
148
|
+
// (acceptWithLogin). This flow explicitly requires a new email;
|
|
149
|
+
// otherwise there would be two ways to set a password for the same user.
|
|
150
|
+
// Email uniqueness is partial on live rows — without this filter,
|
|
151
|
+
// the lookup can resolve a soft-deleted row.
|
|
153
152
|
const existingUser = await ctx.db.global(userTable).fetchOne({
|
|
154
153
|
email: invitationEmail,
|
|
155
154
|
isDeleted: false,
|
|
156
155
|
});
|
|
157
156
|
if (existingUser) return invalidInviteToken();
|
|
158
157
|
|
|
159
|
-
//
|
|
160
|
-
//
|
|
158
|
+
// Create the user through seedUserWithPassword so the magic-link flow
|
|
159
|
+
// records emailVerified=true.
|
|
161
160
|
// @cast-boundary db-runner — helpers use only the query API that
|
|
162
161
|
// DbConnection and DbTx share.
|
|
163
162
|
const dbConn = ctx.db.unsafeRaw() as DbConnection;
|
|
@@ -171,9 +170,8 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
|
|
|
171
170
|
...(invitationGlobalRoles.length > 0 && { roles: invitationGlobalRoles }),
|
|
172
171
|
});
|
|
173
172
|
|
|
174
|
-
//
|
|
175
|
-
//
|
|
176
|
-
// weil createSystemUser nicht ["SystemAdmin"] matcht).
|
|
173
|
+
// The seed helper bypasses addMember's access check because
|
|
174
|
+
// createSystemUser does not match ["SystemAdmin"].
|
|
177
175
|
const forbiddenInviteRole = findForbiddenMembershipRole([invitationRole]);
|
|
178
176
|
if (forbiddenInviteRole !== undefined) {
|
|
179
177
|
return writeFailure(reservedMembershipRoleError(forbiddenInviteRole));
|
|
@@ -184,7 +182,7 @@ export function createInviteSignupCompleteHandler(opts: InviteSignupCompleteOpti
|
|
|
184
182
|
roles: [invitationRole],
|
|
185
183
|
});
|
|
186
184
|
|
|
187
|
-
//
|
|
185
|
+
// Update the invitation in the invited tenant's database context.
|
|
188
186
|
const invitationTdb = createTenantDb({
|
|
189
187
|
db: dbConn,
|
|
190
188
|
tenantId: invitationTenantId,
|
|
@@ -93,7 +93,7 @@ function ok<T>(value: T): GateOk<T> {
|
|
|
93
93
|
|
|
94
94
|
type AuthenticatableUserRow = AuthUserRow & { readonly passwordHash: string };
|
|
95
95
|
|
|
96
|
-
/** Uniform response on any credential miss — burns argon2 cost
|
|
96
|
+
/** Uniform response on any credential miss — burns argon2 cost. */
|
|
97
97
|
export async function gateResolveAuthUser(
|
|
98
98
|
found: AuthUserRow | null,
|
|
99
99
|
password: string,
|
package/packages/bundled-features/src/auth-email-password/handlers/self-registration-status.query.ts
CHANGED
|
@@ -18,7 +18,7 @@ export const selfRegistrationStatusQuery = defineQueryHandler({
|
|
|
18
18
|
description:
|
|
19
19
|
"Reports whether self-registration is currently switched on, readable without signing in, so a signup page can hide its own form instead of collecting an address that would be silently ignored.",
|
|
20
20
|
handler: async (_query, ctx) => {
|
|
21
|
-
// Same fail-open reasoning as signup-request.write.ts
|
|
21
|
+
// Same fail-open reasoning as signup-request.write.ts: only
|
|
22
22
|
// report disabled when the toggle feature is actually composed.
|
|
23
23
|
const gated = ctx.registry.getFeature(AUTH_SELF_REGISTRATION_FEATURE) !== undefined;
|
|
24
24
|
return { enabled: gated ? await ctx.hasFeature(AUTH_SELF_REGISTRATION_FEATURE) : true };
|