@cosmicdrift/kumiko-samples 0.383.1 → 0.385.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 (83) hide show
  1. package/package.json +1 -1
  2. package/packages/bundled-features/package.json +6 -1
  3. package/packages/bundled-features/src/audit/changes.json +6 -0
  4. package/packages/bundled-features/src/audit/event-classification.ts +83 -0
  5. package/packages/bundled-features/src/audit/feature.ts +3 -2
  6. package/packages/bundled-features/src/audit/handlers/audit-events.ts +63 -5
  7. package/packages/bundled-features/src/audit/handlers/details-all-tenants.query.ts +6 -5
  8. package/packages/bundled-features/src/audit/handlers/details.query.ts +12 -6
  9. package/packages/bundled-features/src/audit/handlers/list-all-tenants.query.ts +20 -12
  10. package/packages/bundled-features/src/audit/handlers/list.query.ts +14 -3
  11. package/packages/bundled-features/src/audit/screens.ts +32 -4
  12. package/packages/bundled-features/src/audit/web/audit-event-cell.tsx +22 -0
  13. package/packages/bundled-features/src/audit/web/audit-event-labels.ts +30 -0
  14. package/packages/bundled-features/src/audit/web/client-plugin.tsx +10 -1
  15. package/packages/bundled-features/src/audit/web/constants.ts +11 -0
  16. package/packages/bundled-features/src/audit/web/i18n.ts +48 -1
  17. package/packages/bundled-features/src/auth-email-password/changes.json +12 -0
  18. package/packages/bundled-features/src/auth-email-password/feature.ts +3 -2
  19. package/packages/bundled-features/src/auth-email-password/handlers/login-options.query.ts +19 -0
  20. package/packages/bundled-features/src/auth-email-password/index.ts +7 -1
  21. package/packages/bundled-features/src/auth-email-password/password-policy.ts +196 -2087
  22. package/packages/bundled-features/src/auth-email-password/web/auth-form-primitives.tsx +9 -12
  23. package/packages/bundled-features/src/auth-email-password/{auth-paths.ts → web/auth-paths.ts} +7 -4
  24. package/packages/bundled-features/src/auth-email-password/web/client-plugin.ts +7 -0
  25. package/packages/bundled-features/src/auth-email-password/web/constants.ts +1 -0
  26. package/packages/bundled-features/src/auth-email-password/web/default-auth-pages-gate.tsx +31 -0
  27. package/packages/bundled-features/src/auth-email-password/web/login-screen.tsx +68 -42
  28. package/packages/bundled-features/src/channel-in-app/handlers/unread-count.query.ts +1 -1
  29. package/packages/bundled-features/src/custom-fields/db/queries/projection.ts +1 -1
  30. package/packages/bundled-features/src/file-derivatives/feature.ts +1 -1
  31. package/packages/bundled-features/src/jobs/changes.json +6 -0
  32. package/packages/bundled-features/src/jobs/feature.ts +34 -127
  33. package/packages/bundled-features/src/jobs/handlers/consumer.write.ts +98 -0
  34. package/packages/bundled-features/src/jobs/handlers/consumers.query.ts +137 -0
  35. package/packages/bundled-features/src/jobs/screens.ts +262 -0
  36. package/packages/bundled-features/src/jobs/web/constants.ts +29 -0
  37. package/packages/bundled-features/src/jobs/web/i18n.ts +41 -0
  38. package/packages/bundled-features/src/ledger/web/index.ts +1 -1
  39. package/packages/bundled-features/src/notes-history/handlers/add-note.write.ts +1 -1
  40. package/packages/bundled-features/src/personal-access-tokens/changes.json +7 -0
  41. package/packages/bundled-features/src/personal-access-tokens/i18n.ts +4 -0
  42. package/packages/bundled-features/src/personal-access-tokens/index.ts +1 -0
  43. package/packages/bundled-features/src/secrets/i18n.ts +0 -3
  44. package/packages/bundled-features/src/sessions/changes.json +6 -0
  45. package/packages/bundled-features/src/sessions/constants.ts +3 -1
  46. package/packages/bundled-features/src/sessions/handlers/detail.query.ts +7 -3
  47. package/packages/bundled-features/src/sessions/handlers/list.query.ts +16 -10
  48. package/packages/bundled-features/src/sessions/handlers/mine.query.ts +15 -9
  49. package/packages/bundled-features/src/sessions/screens.ts +23 -8
  50. package/packages/bundled-features/src/sessions/web/client-plugin.tsx +17 -0
  51. package/packages/bundled-features/src/sessions/web/constants.ts +3 -0
  52. package/packages/bundled-features/src/sessions/web/default-translations.ts +8 -0
  53. package/packages/bundled-features/src/sessions/web/i18n.ts +5 -1
  54. package/packages/bundled-features/src/sessions/web/index.ts +1 -0
  55. package/packages/bundled-features/src/sessions/web/session-device-cell.tsx +19 -0
  56. package/packages/bundled-features/src/sessions/web/user-agent.ts +74 -0
  57. package/packages/bundled-features/src/shared/run-in-sub-transaction.ts +1 -1
  58. package/packages/bundled-features/src/template-resolver/changes.json +6 -0
  59. package/packages/bundled-features/src/template-resolver/feature.ts +2 -0
  60. package/packages/bundled-features/src/template-resolver/handlers/overview.query.ts +34 -1
  61. package/packages/bundled-features/src/template-resolver/handlers/tenant-override-counts.query.ts +53 -0
  62. package/packages/bundled-features/src/template-resolver/handlers/tenant-override-selection.ts +51 -0
  63. package/packages/bundled-features/src/template-resolver/handlers/tenant-overrides.query.ts +7 -38
  64. package/packages/bundled-features/src/template-resolver/web/qualified-names.ts +1 -0
  65. package/packages/bundled-features/src/user-data-rights/changes.json +18 -0
  66. package/packages/bundled-features/src/user-data-rights/feature.ts +33 -33
  67. package/packages/bundled-features/src/user-data-rights/web/i18n.ts +4 -1
  68. package/samples/apps/showcase/src/features/items/schema/item.ts +8 -2
  69. package/samples/apps/ui-walkthrough/src/features/tasks/schema/task.ts +2 -2
  70. package/samples/apps/use-all-bundled/bin/main.ts +7 -1
  71. package/samples/apps/use-all-bundled/feature-manifest.json +19 -1
  72. package/samples/apps/use-all-bundled/kumiko/schema.ts +3 -1
  73. package/samples/apps/use-all-bundled/src/app/client.tsx +2 -0
  74. package/samples/apps/use-all-bundled/src/app/dev-app-options.ts +4 -2
  75. package/samples/apps/use-all-bundled/src/app/invoice-reports-feature.ts +30 -0
  76. package/samples/apps/use-all-bundled/src/app/pat-scope-labels-feature.ts +21 -0
  77. package/samples/apps/use-all-bundled/src/app/seed.ts +51 -0
  78. package/samples/apps/use-all-bundled/src/run-config.ts +5 -0
  79. package/samples/apps/workspaces/src/features/demo/schema/order.ts +2 -2
  80. package/samples/recipes/custom-fields-basic/src/feature.ts +13 -3
  81. package/samples/recipes/designer-demo/src/feature.ts +6 -2
  82. package/samples/recipes/i18n/README.md +15 -0
  83. package/samples/recipes/i18n/src/feature.ts +4 -0
@@ -24,8 +24,55 @@ export const AUDIT_I18N: Readonly<Record<string, LocalizedString>> = {
24
24
  "audit.log.col.tenant": { en: "Tenant" },
25
25
  "audit.log.col.when": { en: "When" },
26
26
  "audit.log.col.type": { en: "Event" },
27
- "audit.log.col.aggregateType": { en: "Aggregate type" },
28
27
  "audit.log.col.aggregateId": { en: "Aggregate ID" },
28
+ "audit.log.col.aggregateType": { en: "Object" },
29
+ "audit.log.event": { en: "{entity} {action}" },
30
+ "audit.log.action.created": { en: "created" },
31
+ "audit.log.action.updated": { en: "updated" },
32
+ "audit.log.action.deleted": { en: "deleted" },
33
+ "audit.log.action.restored": { en: "restored" },
34
+ "audit.log.facet.technical": { en: "Technical entries" },
35
+ "audit.log.facet.technical.include": { en: "Show technical entries" },
36
+ "audit.log.event.custom-field-set": { en: "Custom field value set" },
37
+ "audit.log.event.custom-field-cleared": { en: "Custom field value cleared" },
38
+ "audit.log.event.field-definition-deleted": { en: "Custom field deleted" },
39
+ "audit.log.event.secret-read": { en: "Secret read" },
40
+ "audit.log.event.session-revoked": { en: "Session ended" },
41
+ "audit.log.event.subject-forgotten": { en: "Person forgotten (data erased)" },
42
+ "audit.log.event.forget-denied": { en: "Erasure request denied" },
43
+ "audit.log.event.pat-revoked": { en: "Access token revoked" },
44
+ "audit.log.event.mail-account-connected": { en: "Mail account connected" },
45
+ "audit.log.event.mail-account-updated": { en: "Mail account updated" },
46
+ "audit.log.event.mail-account-disconnected": { en: "Mail account disconnected" },
47
+ "audit.log.event.subscription-created": { en: "Subscription created" },
48
+ "audit.log.event.subscription-updated": { en: "Subscription updated" },
49
+ "audit.log.event.subscription-canceled": { en: "Subscription canceled" },
50
+ "audit.log.event.invoice-paid": { en: "Invoice paid" },
51
+ "audit.log.event.invoice-payment-failed": { en: "Invoice payment failed" },
52
+ "audit.log.event.payment-received": { en: "Payment received" },
53
+ "audit.log.event.checkout-consent-recorded": { en: "Checkout consent recorded" },
54
+ "audit.log.event.contract-confirmation-issued": { en: "Contract confirmation issued" },
55
+ "audit.log.event.contract-termination-revoked": { en: "Contract termination revoked" },
56
+ "audit.log.event.destruction-requested": { en: "Tenant deletion requested" },
57
+ "audit.log.event.destruction-cancelled": { en: "Tenant deletion cancelled" },
58
+ "audit.log.event.tenant-destruction-started": { en: "Tenant deletion started" },
59
+ "audit.log.event.tenant-destruction-completed": { en: "Tenant deletion completed" },
60
+ "audit.log.event.tenant-destruction-failed": { en: "Tenant deletion failed" },
61
+ "audit.log.event.tenant-handover-claimed": { en: "Tenant handover claimed" },
62
+ "audit.log.event.waitlist-exported": { en: "Waitlist exported" },
63
+ "audit.log.event.waitlist-purged": { en: "Waitlist purged" },
64
+ "audit.log.event.feature-toggle-set": { en: "Feature toggle changed" },
65
+ "audit.log.event.contract-termination-requested": { en: "Contract termination requested" },
66
+ "audit.log.event.contract-termination-declared": { en: "Contract termination declared" },
67
+ "audit.log.event.contract-termination-unmatched": { en: "Contract termination not matched" },
68
+ "audit.log.entity.tenant": { en: "Tenant" },
69
+ "audit.log.entity.tenant-membership": { en: "Membership" },
70
+ "audit.log.entity.tenant-invitation": { en: "Invitation" },
71
+ "audit.log.entity.user": { en: "User" },
72
+ "audit.log.entity.folder": { en: "Folder" },
73
+ "audit.log.entity.folder-assignment": { en: "Folder assignment" },
74
+ "audit.log.entity.field-definition": { en: "Custom field" },
75
+ "audit.log.entity.template-resource": { en: "Template" },
29
76
  "audit.log.col.actor": { en: "Actor" },
30
77
  "audit.log.details": { en: "Details" },
31
78
  "audit.log.detail.payload": { en: "Event payload" },
@@ -1,4 +1,16 @@
1
1
  [
2
+ {
3
+ "version": "0.385.0",
4
+ "type": "improvement",
5
+ "title": "Denser common-password list, comments name postgres-js as the only driver",
6
+ "detail": "The common-password list is wrapped densely and split on whitespace; a test pins its 2086 entries. Comments across the bundled features that referred to the removed Bun.SQL driver now name postgres-js. No behavior change."
7
+ },
8
+ {
9
+ "version": "0.384.0",
10
+ "type": "improvement",
11
+ "title": "Forgot-password and account-unlock work without app wiring",
12
+ "detail": "With auth.mail and SMTP configured, runProdApp and runDevApp now also wire the account-unlock flow (POST /api/auth/request-account-unlock and /api/auth/confirm-account-unlock, mail link to /unlock-account) because the login lockout is always on. emailPasswordClient serves ForgotPasswordScreen, ResetPasswordScreen (with token) and the unlock screens at /forgot-password, /reset-password and /unlock-account; gates registered earlier by the app win, and defaultAuthPages: false turns it off. LoginScreen reads the new anonymous login-options query and shows the forgot and unlock links when the flows exist; explicit forgotPasswordHref and unlockAccountHref still win and null hides a link. The query needs anonymousAccess on the app, otherwise no link appears."
13
+ },
2
14
  {
3
15
  "version": "0.383.0",
4
16
  "type": "improvement",
@@ -14,6 +14,7 @@ import {
14
14
  import { inviteInfoQuery } from "./handlers/invite-info.query.ts";
15
15
  import { createInviteSignupCompleteHandler } from "./handlers/invite-signup-complete.write.ts";
16
16
  import { createLoginHandler, type LoginHandlerOptions } from "./handlers/login.write.ts";
17
+ import { loginOptionsQuery } from "./handlers/login-options.query.ts";
17
18
  import { logoutWrite } from "./handlers/logout.write.ts";
18
19
  import {
19
20
  createRequestAccountUnlockHandler,
@@ -197,8 +198,7 @@ export function createAuthEmailPasswordFeature(
197
198
  { key: "accountUnlock", label: "Account-Unlock-Flow", type: "boolean", default: false },
198
199
  ],
199
200
  });
200
- r.requires({ features: ["user"] });
201
- r.requires({ features: ["tenant"] });
201
+ r.requires({ features: ["user", "tenant"] });
202
202
  // All five magic-link flows (reset/verify/signup/invite/unlock) dispatch
203
203
  // via ctx.notify → delivery must be mounted. Fail closed at boot instead
204
204
  // of silently dropping the mail.
@@ -256,6 +256,7 @@ export function createAuthEmailPasswordFeature(
256
256
  }
257
257
 
258
258
  const queries = {
259
+ loginOptions: r.queryHandler(loginOptionsQuery),
259
260
  ...(opts.signup && {
260
261
  signupRegistrationStatus: r.queryHandler(selfRegistrationStatusQuery),
261
262
  }),
@@ -0,0 +1,19 @@
1
+ import { defineQueryHandler } from "@cosmicdrift/kumiko-framework/engine";
2
+ import * as z from "zod";
3
+ import { AuthHandlers } from "../web/constants.ts";
4
+
5
+ // Anonymous-readable so the (unauthenticated) login screen can show the
6
+ // forgot-password and unlock links only when the matching mail flows are
7
+ // actually mounted, without every app having to pass hrefs by hand.
8
+ export const loginOptionsQuery = defineQueryHandler({
9
+ name: "login-options",
10
+ schema: z.object({}),
11
+ access: { roles: ["anonymous", "User", "TenantAdmin", "SystemAdmin"] },
12
+ rateLimit: { per: "ip+handler", limit: 30, windowSeconds: 60 },
13
+ description:
14
+ "Reports which optional login-page flows (password reset, account unlock) are available, readable without signing in, so the login screen links only to flows that exist.",
15
+ handler: async (_query, ctx) => ({
16
+ passwordReset: ctx.registry.getWriteHandler(AuthHandlers.requestPasswordReset) !== undefined,
17
+ accountUnlock: ctx.registry.getWriteHandler(AuthHandlers.requestAccountUnlock) !== undefined,
18
+ }),
19
+ });
@@ -6,7 +6,6 @@
6
6
  // hashPassword/verifyPassword; removing it is a breaking change that needs
7
7
  // its own changeset + deliberate deprecation window, not a silent drop.
8
8
  export { hashPassword, verifyPassword } from "../shared/password-hashing.ts";
9
- export { type AuthPath, type AuthPaths, DEFAULT_AUTH_PATHS, makeAuthPaths } from "./auth-paths.ts";
10
9
  export type {
11
10
  BootstrapConfigValue,
12
11
  BootstrapDeps,
@@ -54,6 +53,13 @@ export {
54
53
  SIGNUP_TOKEN_KEY_PREFIXES,
55
54
  storeSignupToken,
56
55
  } from "./signup-token-store.ts";
56
+ export {
57
+ type AuthPath,
58
+ type AuthPaths,
59
+ DEFAULT_AUTH_PATHS,
60
+ DEFAULT_FORGOT_PASSWORD_PATH,
61
+ makeAuthPaths,
62
+ } from "./web/auth-paths.ts";
57
63
  export {
58
64
  AUTH_EMAIL_PASSWORD_FEATURE,
59
65
  AuthErrors,