@cosmicdrift/kumiko-bundled-features 0.343.0 → 0.345.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.
Files changed (53) hide show
  1. package/dist/audit/run-escape-hatch-retention.js +25 -12
  2. package/dist/auth-email-password/constants.d.ts +1 -0
  3. package/dist/auth-email-password/constants.js +1 -0
  4. package/dist/auth-email-password/feature.js +6 -2
  5. package/dist/auth-email-password/handlers/invite-signup-complete.write.d.ts +6 -2
  6. package/dist/auth-email-password/handlers/invite-signup-complete.write.js +14 -4
  7. package/dist/auth-email-password/handlers/signup-confirm.write.d.ts +6 -2
  8. package/dist/auth-email-password/handlers/signup-confirm.write.js +8 -1
  9. package/dist/auth-email-password/handlers/switch-tenant-mfa-gate.write.d.ts +9 -0
  10. package/dist/auth-email-password/handlers/switch-tenant-mfa-gate.write.js +39 -0
  11. package/dist/auth-email-password/handlers/token-request-handler.js +7 -1
  12. package/dist/auth-email-password/i18n.js +1 -0
  13. package/dist/auth-email-password/web/auth-client.d.ts +6 -1
  14. package/dist/auth-email-password/web/auth-client.js +6 -2
  15. package/dist/auth-email-password/web/signup-complete-screen.js +9 -1
  16. package/dist/billing-foundation/checkout-core.d.ts +15 -4
  17. package/dist/billing-foundation/checkout-core.js +18 -6
  18. package/dist/billing-foundation/consumer-protection/confirmation-mail.d.ts +13 -3
  19. package/dist/billing-foundation/consumer-protection/confirmation-mail.js +23 -20
  20. package/dist/billing-foundation/consumer-protection/consent-gate.d.ts +6 -1
  21. package/dist/billing-foundation/consumer-protection/consent-gate.js +6 -1
  22. package/dist/billing-foundation/consumer-protection/consent-locale.js +1 -1
  23. package/dist/billing-foundation/consumer-protection/issue-confirmation.js +24 -2
  24. package/dist/billing-foundation/events.d.ts +2 -0
  25. package/dist/billing-foundation/events.js +2 -0
  26. package/dist/billing-foundation/handlers/billing-plans.query.d.ts +1 -1
  27. package/dist/billing-foundation/handlers/billing-plans.query.js +5 -1
  28. package/dist/billing-foundation/handlers/create-checkout-session.write.js +46 -24
  29. package/dist/billing-foundation/index.d.ts +3 -1
  30. package/dist/billing-foundation/index.js +2 -0
  31. package/dist/billing-foundation/types.d.ts +16 -7
  32. package/dist/billing-foundation/types.js +3 -0
  33. package/dist/billing-foundation/validate-options.d.ts +1 -1
  34. package/dist/billing-foundation/validate-options.js +24 -2
  35. package/dist/billing-foundation/web/billing-plans-panel.js +1 -1
  36. package/dist/billing-foundation/web/cancel-contract-dialog.js +2 -2
  37. package/dist/billing-foundation/web/checkout-consent-dialog.d.ts +1 -1
  38. package/dist/billing-foundation/web/checkout-consent-dialog.js +4 -4
  39. package/dist/billing-foundation/web/index.d.ts +3 -1
  40. package/dist/billing-foundation/web/index.js +2 -0
  41. package/dist/legal-pages/constants.d.ts +2 -0
  42. package/dist/legal-pages/feature.js +7 -2
  43. package/dist/renderer-simple/simple-renderer.js +8 -0
  44. package/dist/step-dispatcher/feature.js +2 -1
  45. package/dist/step-dispatcher/webhook-runner.d.ts +2 -0
  46. package/dist/step-dispatcher/webhook-runner.js +7 -0
  47. package/package.json +9 -9
  48. package/src/audit/changes.json +6 -0
  49. package/src/auth-email-password/changes.json +24 -0
  50. package/src/billing-foundation/changes.json +7 -0
  51. package/src/legal-pages/changes.json +6 -0
  52. package/src/renderer-simple/changes.json +6 -0
  53. package/src/step-dispatcher/changes.json +6 -0
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.345.0",
4
+ "type": "fix",
5
+ "title": "Escape-hatch retention loads only expirable rows",
6
+ "detail": "Escape-hatch audit retention loads only rows that can expire\nThe retention job used to load every escapeHatchUse event to decide which ones to prune. It now reads the storing tenants with one grouped query and loads only events older than each storing tenant's cutoff. The same rows are pruned as before."
7
+ },
2
8
  {
3
9
  "version": "0.343.0",
4
10
  "type": "improvement",
@@ -1,4 +1,28 @@
1
1
  [
2
+ {
3
+ "version": "0.345.0",
4
+ "type": "fix",
5
+ "title": "invite-signup-complete enforces the MFA gate before issuing a session",
6
+ "detail": "`invite-signup-complete` now applies the same MFA gate as `invite-accept-with-login`. The account is still created and the invitation accepted, but an invitee whose role requires MFA (for example an admin invitation under the `admins` policy) receives the MFA step instead of a session. Member invitations keep receiving a session directly."
7
+ },
8
+ {
9
+ "version": "0.345.0",
10
+ "type": "fix",
11
+ "title": "signup-confirm enforces the MFA gate before issuing a session",
12
+ "detail": "`POST /auth/signup-confirm` now runs the login's MFA gate before it issues the first session. Self-signup makes the new user TenantAdmin of a fresh tenant, so under an MFA policy that covers admins the route used to hand out an admin session without a second factor. The account, the tenant and a bound handover claim are still created, but when the gate applies the route answers with the login contract (`mfaSetupRequired` plus `preauthSetupToken`, or `mfaRequired` plus `challengeToken`) and sets no cookies. `SignupCompleteScreen` then tells the user the account is active and sends them to sign in, where they set up the second factor. Without `mfaStatusChecker` nothing changes. Two exported types change shape: `SignupConfirmData` gains the two MFA variants, and `confirmSignup` now resolves to `SignupConfirmResult` with `kind: \"signed-in\"` (the previous `SignupConfirmSuccess` fields) or `kind: \"mfa-pending\"`. The handler and `invite-signup-complete` also run the gate before they delete the token, so an error in the MFA check leaves the link usable for a retry."
13
+ },
14
+ {
15
+ "version": "0.345.0",
16
+ "type": "fix",
17
+ "title": "switch-tenant enforces the MFA gate before issuing a session",
18
+ "detail": "`POST /auth/switch-tenant` now runs the same MFA gate as login before it issues the new session. A user who is a plain member in one tenant and an admin in another can no longer reach an admin session without a second factor by switching. When the target tenant requires MFA the route answers with the login contract (`mfaRequired` plus `challengeToken`, or `mfaSetupRequired` plus `preauthSetupToken`) and sets no cookies. The gate runs in a new system-only handler, `auth-email-password:write:switch-tenant-mfa-gate`, which resolves the membership and roles itself; `runDevApp` and `runProdApp` wire it as `switchTenantMfaGateHandler` whenever auth-mfa is mounted."
19
+ },
20
+ {
21
+ "version": "0.345.0",
22
+ "type": "fix",
23
+ "title": "Token mail expiry uses the recipient's profile time zone",
24
+ "detail": "Token mails show the expiry in the recipient's own time zone\nPassword reset, email verification and account unlock are requested anonymously, so `ctx.tz.user` only held the tenant default or UTC. These mails now use the recipient's profile time zone when it is a valid IANA zone and fall back to the previous value otherwise. Signup and invite mails keep the fallback because the recipient has no profile yet."
25
+ },
2
26
  {
3
27
  "version": "0.343.0",
4
28
  "type": "improvement",
@@ -1,4 +1,11 @@
1
1
  [
2
+ {
3
+ "version": "0.344.0",
4
+ "type": "breaking",
5
+ "title": "Consumer-protection gaps - per-locale legal links, gate order, confirmation mail, exports",
6
+ "detail": "All changes below apply only when `createBillingFoundationFeature` gets `consumerProtection`. Apps without it behave as before.\n`ConsumerProtectionOptions.legalLinks` takes either one `LegalLinkSet` or one set per consent locale (`{ de, en }`, both required). `BillingPlansResult.consumerProtection.legalLinks` is now always `Record<\"de\" | \"en\", LegalLinkSet>`; a single set is returned for both locales. Code that reads `legalLinks.terms` from the billing-plans result must read `legalLinks[locale].terms`. `CheckoutConsentDialog` picks the set for the consent locale.\n`FALLBACK_CONSENT_LOCALE` is now `\"en\"` (was `\"de\"`). A locale other than de/en, or none, resolves to English in `resolveConsentLocale`, the consent gate, the confirmation mail's VAT note and the termination record.\n`create-checkout-session` with consumer protection now checks in this order: provider, billing enabled, redirect origins, price and subscription gates, then the live price (new `UnprocessableError` `price_unavailable` when the provider cannot return it), then the consent, then the provider call. A missing consent no longer hides a disabled provider, an existing subscription or an unknown price. Its payload schema is strict, so unknown fields are rejected. `assertCheckoutAllowed` and `startProviderCheckout` split `openCheckout` in checkout-core.\nNew option `ConsumerProtectionOptions.oneOffItemLabel(ctx, priceId)`: the server resolves the label of a one-off item (for example a credit pack). It is stored on the consent event as `itemLabelKey` / `itemLabelParams` and shown in the confirmation mail as \"Leistung\" / \"Item\". The client cannot set it.\nThe terms text block is read from the system tenant, not from the buyer's tenant, in the consent gate and the confirmation mail. A tenant-owned block with the same slug no longer changes `termsHash` or the mailed text.\nThe confirmation mail shows dates in the recipient's time zone (user zone, else tenant zone, else UTC) with the zone name, renders the terms as Markdown with real headings and shows the translated plan name (`catalog.tierLabelKey`, looked up through the registry i18n, so the key must be qualified with the registering feature; untranslated keys fall back to the raw tier). Its opening sentence starts with a capital letter.\nNew exports: `consentPayloadSchema`, `ConsentPayload`, `OrderItem`, `CONSENT_LOCALES`, `ConsentLocale`, `resolveConsentLocale`, `LegalLinkSet`. The `/web` entry adds `CheckoutConsentDialog`, `CheckoutConsentDialogProps`, `CheckoutConsentPayload`, `CONSENT_TEXT_OUTDATED_CODE`, `resolveConsentLocale`, `ConsentLocale` and `LegalLinkSet`. `CheckoutConsentDialog` `price.count` is optional, and the \"cancel at any time\" note only shows for a recurring price (`price.renewalKey` set).\nThe checkout and cancel dialogs no longer repeat the modal title as a heading, and the cancel-contract button is hidden once a cancellation is scheduled.",
7
+ "migration": "Only apps that pass consumerProtection are affected. BillingPlansResult.consumerProtection.legalLinks is now keyed by locale (legalLinks.de / legalLinks.en). FALLBACK_CONSENT_LOCALE changed from de to en. create-checkout-session rejects unknown payload fields when consumer protection is on."
8
+ },
2
9
  {
3
10
  "version": "0.341.0",
4
11
  "type": "improvement",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.344.0",
4
+ "type": "improvement",
5
+ "title": "Optional title heading on legal pages",
6
+ "detail": "`LegalPageRoute` has an optional `titleHeading` flag. When `true`, the page body starts with an `<h1>` holding the escaped page title. The default (`false`) leaves the body unchanged."
7
+ },
2
8
  {
3
9
  "version": "0.335.0",
4
10
  "type": "fix",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.344.0",
4
+ "type": "improvement",
5
+ "title": "Heading and Markdown sections in the simple mail renderer",
6
+ "detail": "`createSimpleRenderer` accepts two more section kinds: `{ heading: string }` (rendered as an escaped `<h2>`) and `{ markdown: string }` (rendered with the hardened Markdown renderer; raw HTML is escaped and unsafe link targets are replaced by `#`). Existing section kinds render as before."
7
+ },
2
8
  {
3
9
  "version": "0.341.0",
4
10
  "type": "improvement",
@@ -1,4 +1,10 @@
1
1
  [
2
+ {
3
+ "version": "0.345.0",
4
+ "type": "improvement",
5
+ "title": "Webhook sends carry an Idempotency-Key header that is stable across redeliveries",
6
+ "detail": "Webhook sends carry an Idempotency-Key header\nEvery `r.step.webhook.send` request now has `Idempotency-Key: <dispatch stream id>`. The value stays the same when the same dispatch request is delivered again, so receivers can deduplicate. An explicit `Idempotency-Key` in `headers` (any casing) takes precedence."
7
+ },
2
8
  {
3
9
  "version": "0.335.0",
4
10
  "type": "fix",