@zitadel/api 1.0.0-alpha.20 → 1.0.0-alpha.22

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 (94) hide show
  1. package/dist/generated/endpoints/zitadelNextGen.d.mts +2 -2
  2. package/dist/generated/endpoints/zitadelNextGen.mjs +75 -4
  3. package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
  4. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +6 -2
  5. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
  6. package/dist/generated/endpoints/zitadelNextGen.msw.mjs +745 -41
  7. package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
  8. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +432 -47
  9. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
  10. package/dist/generated/endpoints/zitadelNextGen.zod.mjs +403 -43
  11. package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
  12. package/dist/generated/model/index.d.mts +2 -2
  13. package/dist/generated/model/index.mjs +54 -1
  14. package/dist/generated/model/index.mjs.map +1 -1
  15. package/dist/{index-BpCgp2NY.d.mts → index-DtExHu2p.d.mts} +1818 -299
  16. package/dist/index-DtExHu2p.d.mts.map +1 -0
  17. package/dist/runtime/api-factory.d.mts +1 -1
  18. package/dist/{zitadelNextGen-C4IZjGCT.d.mts → zitadelNextGen-C79YSuEo.d.mts} +45 -7
  19. package/dist/zitadelNextGen-C79YSuEo.d.mts.map +1 -0
  20. package/package.json +1 -1
  21. package/src/generated/endpoints/zitadelNextGen.msw.ts +887 -85
  22. package/src/generated/endpoints/zitadelNextGen.ts +98 -3
  23. package/src/generated/endpoints/zitadelNextGen.zod.ts +1314 -421
  24. package/src/generated/model/completeClaim410.ts +21 -16
  25. package/src/generated/model/createFlowDefinition201FlowDefinition.ts +5 -3
  26. package/src/generated/model/createFlowDefinitionBodyFlowDefinition.ts +5 -3
  27. package/src/generated/model/createFlowDefinitionDefault.ts +0 -10
  28. package/src/generated/model/createGrant201.ts +32 -0
  29. package/src/generated/model/createGrant201Principal.ts +147 -0
  30. package/src/generated/model/createGrant201Team.ts +22 -0
  31. package/src/generated/model/createGrant201User.ts +38 -0
  32. package/src/generated/model/createSession201Session.ts +8 -16
  33. package/src/generated/model/createSession201SessionUser.ts +38 -0
  34. package/src/generated/model/createUser201.ts +18 -0
  35. package/src/generated/model/exchangeHandoff200Session.ts +8 -16
  36. package/src/generated/model/exchangeHandoff200SessionUser.ts +38 -0
  37. package/src/generated/model/getClaimStatus410.ts +21 -16
  38. package/src/generated/model/getClaimWindow200.ts +23 -0
  39. package/src/generated/model/{createFlowDefinition409.ts → getClaimWindow404.ts} +3 -3
  40. package/src/generated/model/{createFlowDefinition409Details.ts → getClaimWindow404Details.ts} +1 -1
  41. package/src/generated/model/getClaimWindow429.ts +20 -0
  42. package/src/generated/model/getClaimWindow429Details.ts +12 -0
  43. package/src/generated/model/getClaimWindowDefault.ts +20 -0
  44. package/src/generated/model/getClaimWindowDefaultDetails.ts +12 -0
  45. package/src/generated/model/getClaimWindowParams.ts +15 -0
  46. package/src/generated/model/getEvent200.ts +75 -0
  47. package/src/generated/model/getFlowDefinition200FlowDefinition.ts +5 -3
  48. package/src/generated/model/getGrant200.ts +32 -0
  49. package/src/generated/model/getGrant200Principal.ts +147 -0
  50. package/src/generated/model/getGrant200Team.ts +22 -0
  51. package/src/generated/model/getGrant200User.ts +38 -0
  52. package/src/generated/model/getMySession200.ts +8 -16
  53. package/src/generated/model/getMySession200User.ts +38 -0
  54. package/src/generated/model/getMyUser200.ts +18 -0
  55. package/src/generated/model/getSession200.ts +8 -16
  56. package/src/generated/model/getSession200User.ts +38 -0
  57. package/src/generated/model/getUserByID200.ts +18 -0
  58. package/src/generated/model/index.ts +44 -2
  59. package/src/generated/model/initClaim410.ts +24 -0
  60. package/src/generated/model/listEvents200DataItem.ts +75 -0
  61. package/src/generated/model/listFlowDefinitions200.ts +3 -0
  62. package/src/generated/model/listFlowDefinitions200FlowDefinitionsItemFlowDefinition.ts +5 -3
  63. package/src/generated/model/listFlowDefinitionsParams.ts +8 -0
  64. package/src/generated/model/queryGrants200.ts +20 -0
  65. package/src/generated/model/queryGrants200GrantsItem.ts +66 -0
  66. package/src/generated/model/queryGrants200GrantsItemObjectType.ts +17 -0
  67. package/src/generated/model/queryGrants200GrantsItemPrincipal.ts +147 -0
  68. package/src/generated/model/queryGrants200GrantsItemPrincipalType.ts +18 -0
  69. package/src/generated/model/queryGrants200GrantsItemRelation.ts +19 -0
  70. package/src/generated/model/queryGrants200GrantsItemTeam.ts +22 -0
  71. package/src/generated/model/queryGrants200GrantsItemUser.ts +38 -0
  72. package/src/generated/model/queryGrants400.ts +20 -0
  73. package/src/generated/model/queryGrants400Details.ts +12 -0
  74. package/src/generated/model/queryGrants401.ts +20 -0
  75. package/src/generated/model/queryGrants401Details.ts +12 -0
  76. package/src/generated/model/queryGrants403.ts +20 -0
  77. package/src/generated/model/queryGrants403Details.ts +12 -0
  78. package/src/generated/model/queryGrantsBody.ts +33 -0
  79. package/src/generated/model/queryGrantsBodyExpandItem.ts +30 -0
  80. package/src/generated/model/queryGrantsBodyFilterItem.ts +33 -0
  81. package/src/generated/model/queryGrantsBodyFilterItemField.ts +27 -0
  82. package/src/generated/model/queryGrantsBodyFilterItemOperation.ts +30 -0
  83. package/src/generated/model/queryGrantsBodySorting.ts +17 -0
  84. package/src/generated/model/queryGrantsBodySortingDirection.ts +15 -0
  85. package/src/generated/model/queryGrantsBodySortingField.ts +21 -0
  86. package/src/generated/model/queryGrantsDefault.ts +99 -0
  87. package/src/generated/model/queryGrantsParams.ts +15 -0
  88. package/src/generated/model/querySessions200SessionsItem.ts +8 -16
  89. package/src/generated/model/querySessions200SessionsItemUser.ts +38 -0
  90. package/src/generated/model/queryUsers200UsersItem.ts +18 -0
  91. package/src/generated/model/updateFlowDefinition200FlowDefinition.ts +5 -3
  92. package/src/generated/model/updateFlowDefinitionBodyFlowDefinition.ts +5 -3
  93. package/dist/index-BpCgp2NY.d.mts.map +0 -1
  94. package/dist/zitadelNextGen-C4IZjGCT.d.mts.map +0 -1
@@ -183,6 +183,24 @@ export const QueryUsersResponse = zod
183
183
  'The team named by `lifecycle_owner_team_id`, present only when the\nrequest asked for it with `expand: [\"lifecycle_owner_team\"]` (ADR 059).\nAbsent means it was not requested; `null` means the user is self-owned\nand there is no owner to resolve.\n\nRequesting it does not guarantee it is present on every user. Today\n`team.read` is checked once for the whole request, so it is; once that\ncheck is per team, a page may contain a user whose owner the caller may\nnot read, and such a row answers with neither the team nor `null` —\n`null` already means self-owned. What it answers with instead is decided\nwith the granular scopes (#420); do not read the two cases above as the\ncomplete set.\n\nThis is the same representation `GET \/teams\/{team_id}` serves. It is a\nsingle team, not a collection, so it carries no cap and no truncation\nflag.\n',
184
184
  ),
185
185
  }),
186
+ identifier: zod
187
+ .string()
188
+ .optional()
189
+ .describe(
190
+ "The current value of the user schema's designated identifier\n(`x-identifier`), resolved live at read time. Absent when the schema\ndesignates no identifier or the user carries no value for it.\n",
191
+ ),
192
+ identifier_property: zod
193
+ .string()
194
+ .optional()
195
+ .describe(
196
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
197
+ ),
198
+ display: zod
199
+ .string()
200
+ .optional()
201
+ .describe(
202
+ "The `x-display` rendering — the designated properties' values joined\nin list order, resolved live at read time. Purely presentational.\nAbsent when the schema designates no display properties or the user\ncarries no values for them. Clients render `display`, falling back\nto `identifier`, then `id`.\n",
203
+ ),
186
204
  teams: zod
187
205
  .array(
188
206
  zod
@@ -307,6 +325,24 @@ export const GetUserByIDResponse = zod
307
325
  'The team named by `lifecycle_owner_team_id`, present only when the\nrequest asked for it with `expand: [\"lifecycle_owner_team\"]` (ADR 059).\nAbsent means it was not requested; `null` means the user is self-owned\nand there is no owner to resolve.\n\nRequesting it does not guarantee it is present on every user. Today\n`team.read` is checked once for the whole request, so it is; once that\ncheck is per team, a page may contain a user whose owner the caller may\nnot read, and such a row answers with neither the team nor `null` —\n`null` already means self-owned. What it answers with instead is decided\nwith the granular scopes (#420); do not read the two cases above as the\ncomplete set.\n\nThis is the same representation `GET \/teams\/{team_id}` serves. It is a\nsingle team, not a collection, so it carries no cap and no truncation\nflag.\n',
308
326
  ),
309
327
  }),
328
+ identifier: zod
329
+ .string()
330
+ .optional()
331
+ .describe(
332
+ "The current value of the user schema's designated identifier\n(`x-identifier`), resolved live at read time. Absent when the schema\ndesignates no identifier or the user carries no value for it.\n",
333
+ ),
334
+ identifier_property: zod
335
+ .string()
336
+ .optional()
337
+ .describe(
338
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
339
+ ),
340
+ display: zod
341
+ .string()
342
+ .optional()
343
+ .describe(
344
+ "The `x-display` rendering — the designated properties' values joined\nin list order, resolved live at read time. Purely presentational.\nAbsent when the schema designates no display properties or the user\ncarries no values for them. Clients render `display`, falling back\nto `identifier`, then `id`.\n",
345
+ ),
310
346
  teams: zod
311
347
  .array(
312
348
  zod
@@ -616,6 +652,24 @@ export const GetMyUserResponse = zod
616
652
  'The team named by `lifecycle_owner_team_id`, present only when the\nrequest asked for it with `expand: [\"lifecycle_owner_team\"]` (ADR 059).\nAbsent means it was not requested; `null` means the user is self-owned\nand there is no owner to resolve.\n\nRequesting it does not guarantee it is present on every user. Today\n`team.read` is checked once for the whole request, so it is; once that\ncheck is per team, a page may contain a user whose owner the caller may\nnot read, and such a row answers with neither the team nor `null` —\n`null` already means self-owned. What it answers with instead is decided\nwith the granular scopes (#420); do not read the two cases above as the\ncomplete set.\n\nThis is the same representation `GET \/teams\/{team_id}` serves. It is a\nsingle team, not a collection, so it carries no cap and no truncation\nflag.\n',
617
653
  ),
618
654
  }),
655
+ identifier: zod
656
+ .string()
657
+ .optional()
658
+ .describe(
659
+ "The current value of the user schema's designated identifier\n(`x-identifier`), resolved live at read time. Absent when the schema\ndesignates no identifier or the user carries no value for it.\n",
660
+ ),
661
+ identifier_property: zod
662
+ .string()
663
+ .optional()
664
+ .describe(
665
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
666
+ ),
667
+ display: zod
668
+ .string()
669
+ .optional()
670
+ .describe(
671
+ "The `x-display` rendering — the designated properties' values joined\nin list order, resolved live at read time. Purely presentational.\nAbsent when the schema designates no display properties or the user\ncarries no values for them. Clients render `display`, falling back\nto `identifier`, then `id`.\n",
672
+ ),
619
673
  teams: zod
620
674
  .array(
621
675
  zod
@@ -2191,7 +2245,11 @@ export const InitClaimParams = zod.object({
2191
2245
  * Polled by the CLI while a browser completes the claim. Authorized by the
2192
2246
  project secret that initiated the challenge. Returns `pending`, or
2193
2247
  `completed` with the owning team, the claim timestamp, and the dashboard
2194
- URL once the browser leg has finished.
2248
+ URL once the project is claimed. The claim grant, not the polled
2249
+ challenge, is the source of truth: a project claimed through another
2250
+ concurrent challenge also reports `completed`, and a completed claim
2251
+ keeps reporting `completed` past this challenge's expiry and past the
2252
+ project's claim window.
2195
2253
 
2196
2254
  * @summary Get claim status
2197
2255
  */
@@ -2274,6 +2332,46 @@ export const CompleteClaimResponse = zod
2274
2332
  })
2275
2333
  .describe("The result of a completed project claim.");
2276
2334
 
2335
+ /**
2336
+ * Read by the claim page in the browser to show how long is left to claim the
2337
+ project. Unauthenticated by design: the claim page runs this before the
2338
+ developer has signed in, and holding the `challenge_id` from the claim URL
2339
+ is the authorization — the same capability `claim/complete` accepts. It
2340
+ reveals only the window, never the project itself, and unlike
2341
+ `claim/complete` it spends nothing, so a reload is free.
2342
+
2343
+ * @summary Get the claim window for a project
2344
+ */
2345
+ export const getClaimWindowPathProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2346
+
2347
+ export const GetClaimWindowParams = zod.object({
2348
+ project_id: zod.string().regex(getClaimWindowPathProjectIdRegExp),
2349
+ });
2350
+
2351
+ export const getClaimWindowQueryChallengeIdRegExp = new RegExp("^ch_[a-zA-Z0-9_-]+$");
2352
+
2353
+ export const GetClaimWindowQueryParams = zod.strictObject({
2354
+ challenge_id: zod
2355
+ .string()
2356
+ .regex(getClaimWindowQueryChallengeIdRegExp)
2357
+ .describe("The challenge from the claim URL."),
2358
+ });
2359
+
2360
+ export const GetClaimWindowResponse = zod
2361
+ .object({
2362
+ expires_at: zod.iso
2363
+ .datetime({ offset: true })
2364
+ .describe("The time when the project's claim window closes."),
2365
+ expired: zod
2366
+ .boolean()
2367
+ .describe(
2368
+ "Whether the window has already closed. Reported alongside `expires_at`\nrather than left to the client so a skewed browser clock cannot show a\nclaimable project as expired, or the reverse.\n",
2369
+ ),
2370
+ })
2371
+ .describe(
2372
+ "How long the project can still be claimed. Derived from the project's\ncreation time and the fixed 14-day claim window (ADR 046); it does not\ndepend on the challenge, which has its own much shorter expiry.\n",
2373
+ );
2374
+
2277
2375
  /**
2278
2376
  * Creates an anonymous session shell with no user and no factors (`state: building`).
2279
2377
 
@@ -2394,6 +2492,9 @@ export const QuerySessionsBody = zod
2394
2492
  export const querySessionsResponseSessionsItemSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2395
2493
  export const querySessionsResponseSessionsItemProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2396
2494
  export const querySessionsResponseSessionsItemUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2495
+ export const querySessionsResponseSessionsItemUserUserIdRegExp = new RegExp(
2496
+ "^user_[a-zA-Z0-9_-]+$",
2497
+ );
2397
2498
  export const querySessionsResponseSessionsItemFactorsItemPayloadOneUserIdRegExp = new RegExp(
2398
2499
  "^user_[a-zA-Z0-9_-]+$",
2399
2500
  );
@@ -2424,17 +2525,31 @@ export const QuerySessionsResponse = zod
2424
2525
  .describe(
2425
2526
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2426
2527
  ),
2427
- name: zod
2428
- .string()
2429
- .optional()
2430
- .describe(
2431
- "Human-readable name of the authenticated user, resolved from the\nconventional user-schema properties: `name` when defined, otherwise\nthe given and family name parts joined — `givenName`\/`familyName`\n(the shipped presets' spelling) or `given_name`\/`family_name`. Only\npresent on reads that hydrate the user's identity\n(`GET \/sessions\/me`) and only when the session has an authenticated\nuser whose schema carries those properties; clients fall back to\n`email`, then `user_id`.\n",
2432
- ),
2433
- email: zod
2434
- .string()
2528
+ user: zod
2529
+ .object({
2530
+ user_id: zod.string().regex(querySessionsResponseSessionsItemUserUserIdRegExp),
2531
+ identifier: zod
2532
+ .string()
2533
+ .optional()
2534
+ .describe(
2535
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
2536
+ ),
2537
+ identifier_property: zod
2538
+ .string()
2539
+ .optional()
2540
+ .describe(
2541
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
2542
+ ),
2543
+ display: zod
2544
+ .string()
2545
+ .optional()
2546
+ .describe(
2547
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
2548
+ ),
2549
+ })
2435
2550
  .optional()
2436
2551
  .describe(
2437
- "Email address of the authenticated user, resolved from the\nconventional `email` user-schema property. Only present on reads\nthat hydrate the user's identity (`GET \/sessions\/me`) and only when\nthe session has an authenticated user whose schema carries that\nproperty.\n",
2552
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
2438
2553
  ),
2439
2554
  factors: zod
2440
2555
  .array(
@@ -2601,6 +2716,7 @@ export const ExchangeHandoffBody = zod
2601
2716
  export const exchangeHandoffResponseSessionSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2602
2717
  export const exchangeHandoffResponseSessionProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2603
2718
  export const exchangeHandoffResponseSessionUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2719
+ export const exchangeHandoffResponseSessionUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2604
2720
  export const exchangeHandoffResponseSessionFactorsItemPayloadOneUserIdRegExp = new RegExp(
2605
2721
  "^user_[a-zA-Z0-9_-]+$",
2606
2722
  );
@@ -2625,17 +2741,31 @@ export const ExchangeHandoffResponse = zod
2625
2741
  .describe(
2626
2742
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2627
2743
  ),
2628
- name: zod
2629
- .string()
2630
- .optional()
2631
- .describe(
2632
- "Human-readable name of the authenticated user, resolved from the\nconventional user-schema properties: `name` when defined, otherwise\nthe given and family name parts joined — `givenName`\/`familyName`\n(the shipped presets' spelling) or `given_name`\/`family_name`. Only\npresent on reads that hydrate the user's identity\n(`GET \/sessions\/me`) and only when the session has an authenticated\nuser whose schema carries those properties; clients fall back to\n`email`, then `user_id`.\n",
2633
- ),
2634
- email: zod
2635
- .string()
2744
+ user: zod
2745
+ .object({
2746
+ user_id: zod.string().regex(exchangeHandoffResponseSessionUserUserIdRegExp),
2747
+ identifier: zod
2748
+ .string()
2749
+ .optional()
2750
+ .describe(
2751
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
2752
+ ),
2753
+ identifier_property: zod
2754
+ .string()
2755
+ .optional()
2756
+ .describe(
2757
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
2758
+ ),
2759
+ display: zod
2760
+ .string()
2761
+ .optional()
2762
+ .describe(
2763
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
2764
+ ),
2765
+ })
2636
2766
  .optional()
2637
2767
  .describe(
2638
- "Email address of the authenticated user, resolved from the\nconventional `email` user-schema property. Only present on reads\nthat hydrate the user's identity (`GET \/sessions\/me`) and only when\nthe session has an authenticated user whose schema carries that\nproperty.\n",
2768
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
2639
2769
  ),
2640
2770
  factors: zod
2641
2771
  .array(
@@ -2758,6 +2888,7 @@ export const GetSessionParams = zod.object({
2758
2888
  export const getSessionResponseSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2759
2889
  export const getSessionResponseProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2760
2890
  export const getSessionResponseUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2891
+ export const getSessionResponseUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2761
2892
  export const getSessionResponseFactorsItemPayloadOneUserIdRegExp = new RegExp(
2762
2893
  "^user_[a-zA-Z0-9_-]+$",
2763
2894
  );
@@ -2780,17 +2911,31 @@ export const GetSessionResponse = zod
2780
2911
  .describe(
2781
2912
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2782
2913
  ),
2783
- name: zod
2784
- .string()
2785
- .optional()
2786
- .describe(
2787
- "Human-readable name of the authenticated user, resolved from the\nconventional user-schema properties: `name` when defined, otherwise\nthe given and family name parts joined — `givenName`\/`familyName`\n(the shipped presets' spelling) or `given_name`\/`family_name`. Only\npresent on reads that hydrate the user's identity\n(`GET \/sessions\/me`) and only when the session has an authenticated\nuser whose schema carries those properties; clients fall back to\n`email`, then `user_id`.\n",
2788
- ),
2789
- email: zod
2790
- .string()
2914
+ user: zod
2915
+ .object({
2916
+ user_id: zod.string().regex(getSessionResponseUserUserIdRegExp),
2917
+ identifier: zod
2918
+ .string()
2919
+ .optional()
2920
+ .describe(
2921
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
2922
+ ),
2923
+ identifier_property: zod
2924
+ .string()
2925
+ .optional()
2926
+ .describe(
2927
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
2928
+ ),
2929
+ display: zod
2930
+ .string()
2931
+ .optional()
2932
+ .describe(
2933
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
2934
+ ),
2935
+ })
2791
2936
  .optional()
2792
2937
  .describe(
2793
- "Email address of the authenticated user, resolved from the\nconventional `email` user-schema property. Only present on reads\nthat hydrate the user's identity (`GET \/sessions\/me`) and only when\nthe session has an authenticated user whose schema carries that\nproperty.\n",
2938
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
2794
2939
  ),
2795
2940
  factors: zod
2796
2941
  .array(
@@ -2917,6 +3062,7 @@ against the same `session_id`) to restore a dropped assurance level.
2917
3062
  export const getMySessionResponseSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2918
3063
  export const getMySessionResponseProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2919
3064
  export const getMySessionResponseUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
3065
+ export const getMySessionResponseUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2920
3066
  export const getMySessionResponseFactorsItemPayloadOneUserIdRegExp = new RegExp(
2921
3067
  "^user_[a-zA-Z0-9_-]+$",
2922
3068
  );
@@ -2939,17 +3085,31 @@ export const GetMySessionResponse = zod
2939
3085
  .describe(
2940
3086
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2941
3087
  ),
2942
- name: zod
2943
- .string()
2944
- .optional()
2945
- .describe(
2946
- "Human-readable name of the authenticated user, resolved from the\nconventional user-schema properties: `name` when defined, otherwise\nthe given and family name parts joined — `givenName`\/`familyName`\n(the shipped presets' spelling) or `given_name`\/`family_name`. Only\npresent on reads that hydrate the user's identity\n(`GET \/sessions\/me`) and only when the session has an authenticated\nuser whose schema carries those properties; clients fall back to\n`email`, then `user_id`.\n",
2947
- ),
2948
- email: zod
2949
- .string()
3088
+ user: zod
3089
+ .object({
3090
+ user_id: zod.string().regex(getMySessionResponseUserUserIdRegExp),
3091
+ identifier: zod
3092
+ .string()
3093
+ .optional()
3094
+ .describe(
3095
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
3096
+ ),
3097
+ identifier_property: zod
3098
+ .string()
3099
+ .optional()
3100
+ .describe(
3101
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
3102
+ ),
3103
+ display: zod
3104
+ .string()
3105
+ .optional()
3106
+ .describe(
3107
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
3108
+ ),
3109
+ })
2950
3110
  .optional()
2951
3111
  .describe(
2952
- "Email address of the authenticated user, resolved from the\nconventional `email` user-schema property. Only present on reads\nthat hydrate the user's identity (`GET \/sessions\/me`) and only when\nthe session has an authenticated user whose schema carries that\nproperty.\n",
3112
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
2953
3113
  ),
2954
3114
  factors: zod
2955
3115
  .array(
@@ -3522,12 +3682,17 @@ export const GetSchemaByIdResponse = zod
3522
3682
  );
3523
3683
 
3524
3684
  /**
3525
- * Creates a new flow definition.
3685
+ * Publishes a new flow definition revision.
3526
3686
  Flow definitions are templates that define the sequence of steps (capabilities)
3527
3687
  for a particular user journey (e.g., registration, login, password reset).
3528
3688
 
3529
3689
  Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
3530
3690
 
3691
+ Every call allocates a new opaque id. Revisions of one flow share its
3692
+ `name`; posting a definition under an existing `name` publishes a new
3693
+ revision of that flow, it is not a conflict. List with `name` to see a
3694
+ flow's revisions, newest by creation time first.
3695
+
3531
3696
  * @summary Create a new flow definition
3532
3697
  */
3533
3698
  export const createFlowDefinitionBodyProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
@@ -3553,7 +3718,7 @@ export const CreateFlowDefinitionBody = zod
3553
3718
  .string()
3554
3719
  .regex(createFlowDefinitionBodyFlowDefinitionNameRegExp)
3555
3720
  .describe(
3556
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3721
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Every revision of a flow shares its\n`name`; publishing a definition under an existing `name` adds a\nrevision to that flow. Renaming is not supported — the `name` is part\nof the public contract another definition may reference. Acts as the\nhuman display label as well; no separate slug.\n",
3557
3722
  ),
3558
3723
  status: zod
3559
3724
  .enum(["active", "draft"])
@@ -3751,8 +3916,9 @@ export const CreateFlowDefinitionBody = zod
3751
3916
  );
3752
3917
 
3753
3918
  /**
3754
- * Retrieves a list of all flow definitions.
3919
+ * Retrieves a list of all flow definitions, newest by creation time first.
3755
3920
  This endpoint can be used to view existing flow definitions and their configurations.
3921
+ Filter by `name` to list the revisions of one flow.
3756
3922
 
3757
3923
  * @summary List flow definitions
3758
3924
  */
@@ -3760,6 +3926,7 @@ export const listFlowDefinitionsQueryLimitDefault = 20;
3760
3926
  export const listFlowDefinitionsQueryLimitMax = 100;
3761
3927
 
3762
3928
  export const listFlowDefinitionsQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
3929
+ export const listFlowDefinitionsQueryNameRegExp = new RegExp("^[a-z][a-z0-9-]\*$");
3763
3930
 
3764
3931
  export const ListFlowDefinitionsQueryParams = zod.strictObject({
3765
3932
  limit: zod
@@ -3782,6 +3949,13 @@ export const ListFlowDefinitionsQueryParams = zod.strictObject({
3782
3949
  .enum(["login", "register", "recovery", "profiling", "reauth", "link_account"])
3783
3950
  .optional()
3784
3951
  .describe("Filter flow definitions by purpose (e.g., registration, login)."),
3952
+ name: zod
3953
+ .string()
3954
+ .regex(listFlowDefinitionsQueryNameRegExp)
3955
+ .optional()
3956
+ .describe(
3957
+ "The flow name to filter by. Every revision of a flow shares its\n`name`, so the result is that flow's revisions, newest by creation\ntime first.\n",
3958
+ ),
3785
3959
  expand: zod
3786
3960
  .array(
3787
3961
  zod
@@ -3810,363 +3984,367 @@ export const listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOn
3810
3984
 
3811
3985
  export const listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOnePropertiesXAuditDefault = false;
3812
3986
 
3813
- export const ListFlowDefinitionsResponse = zod.object({
3814
- flow_definitions: zod.array(
3815
- zod.object({
3816
- id: zod.string().describe("Unique identifier for the flow definition."),
3817
- project_id: zod
3818
- .string()
3819
- .describe("Identifier of the project this flow definition belongs to."),
3820
- flow_definition: zod
3821
- .object({
3822
- name: zod
3823
- .string()
3824
- .regex(listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionNameRegExp)
3825
- .describe(
3826
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
3827
- ),
3828
- status: zod
3829
- .enum(["active", "draft"])
3830
- .describe(
3831
- "The lifecycle state of this flow definition. \n\nactive: The flow definition is ready to be used. The flow engine can select it for new flows.\ndraft: The engine will not select it for new flows, and existing flows must handle it gracefully if they reference this definition.\n\nAllowed transitions:\n- draft -> active: To activate the flow definition.\n- active -> draft: To remove the flow definition from active use immediately.\n",
3832
- ),
3833
- user_schema: zod
3834
- .string()
3835
- .describe(
3836
- "Server-assigned identifier of the user schema this flow operates on,\nas returned by `POST \/schemas`. Opaque to the client — the shape is a\nserver implementation detail. Step `fields` reference properties\ndefined in the resolved schema; the engine resolves field types, validation, and\nimplicit outcomes from schema annotations at runtime.\n",
3837
- ),
3838
- purposes: zod
3839
- .record(zod.string(), zod.string())
3840
- .describe(
3841
- "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
3842
- ),
3843
- audience: zod
3844
- .object({
3845
- team_ids: zod
3846
- .array(zod.string())
3847
- .optional()
3848
- .describe(
3849
- "Restrict to specific teams (organizations). Empty means no team restriction.",
3850
- ),
3851
- app_ids: zod
3852
- .array(zod.string())
3853
- .optional()
3854
- .describe("Restrict to specific applications. Empty means no app restriction."),
3855
- })
3856
- .optional()
3857
- .describe(
3858
- 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
3859
- ),
3860
- steps: zod
3861
- .array(
3862
- zod
3863
- .object({
3864
- name: zod
3865
- .string()
3866
- .describe(
3867
- "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
3868
- ),
3869
- fields: zod
3870
- .array(zod.string())
3871
- .default(
3872
- listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemFieldsDefault,
3873
- )
3874
- .describe(
3875
- "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
3876
- ),
3877
- actions: zod
3878
- .array(
3879
- zod
3880
- .object({
3881
- name: zod
3987
+ export const ListFlowDefinitionsResponse = zod
3988
+ .object({
3989
+ flow_definitions: zod.array(
3990
+ zod.object({
3991
+ id: zod.string().describe("Unique identifier for the flow definition."),
3992
+ project_id: zod
3993
+ .string()
3994
+ .describe("Identifier of the project this flow definition belongs to."),
3995
+ flow_definition: zod
3996
+ .object({
3997
+ name: zod
3998
+ .string()
3999
+ .regex(listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionNameRegExp)
4000
+ .describe(
4001
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Every revision of a flow shares its\n`name`; publishing a definition under an existing `name` adds a\nrevision to that flow. Renaming is not supported — the `name` is part\nof the public contract another definition may reference. Acts as the\nhuman display label as well; no separate slug.\n",
4002
+ ),
4003
+ status: zod
4004
+ .enum(["active", "draft"])
4005
+ .describe(
4006
+ "The lifecycle state of this flow definition. \n\nactive: The flow definition is ready to be used. The flow engine can select it for new flows.\ndraft: The engine will not select it for new flows, and existing flows must handle it gracefully if they reference this definition.\n\nAllowed transitions:\n- draft -> active: To activate the flow definition.\n- active -> draft: To remove the flow definition from active use immediately.\n",
4007
+ ),
4008
+ user_schema: zod
4009
+ .string()
4010
+ .describe(
4011
+ "Server-assigned identifier of the user schema this flow operates on,\nas returned by `POST \/schemas`. Opaque to the client — the shape is a\nserver implementation detail. Step `fields` reference properties\ndefined in the resolved schema; the engine resolves field types, validation, and\nimplicit outcomes from schema annotations at runtime.\n",
4012
+ ),
4013
+ purposes: zod
4014
+ .record(zod.string(), zod.string())
4015
+ .describe(
4016
+ "Maps each purpose this definition handles to its entry-point step.\nKeys are purpose names; values must match a `name` in `steps`. A\ndefinition can serve multiple purposes (e.g. a combined login\/register\nflow) by listing one entry per purpose.\n",
4017
+ ),
4018
+ audience: zod
4019
+ .object({
4020
+ team_ids: zod
4021
+ .array(zod.string())
4022
+ .optional()
4023
+ .describe(
4024
+ "Restrict to specific teams (organizations). Empty means no team restriction.",
4025
+ ),
4026
+ app_ids: zod
4027
+ .array(zod.string())
4028
+ .optional()
4029
+ .describe("Restrict to specific applications. Empty means no app restriction."),
4030
+ })
4031
+ .optional()
4032
+ .describe(
4033
+ 'Scopes which teams or apps this flow definition applies to. Empty or\nomitted fields mean \"no restriction\"; when both are empty the definition\nmatches every request in the project. The engine picks the most specific\nmatching definition: app > team > project-wide.\n',
4034
+ ),
4035
+ steps: zod
4036
+ .array(
4037
+ zod
4038
+ .object({
4039
+ name: zod
4040
+ .string()
4041
+ .describe(
4042
+ "Unique step identifier within this flow. Used as transition targets\nand returned in the API response as `step.name`.\n",
4043
+ ),
4044
+ fields: zod
4045
+ .array(zod.string())
4046
+ .default(
4047
+ listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemFieldsDefault,
4048
+ )
4049
+ .describe(
4050
+ "Schema property names to collect from the user. Each entry references\na property in the flow's user schema. The engine resolves field type,\nvalidation rules, and implicit outcomes from schema annotations\n(e.g. a property with `x-unique` set implies a `user_not_found`\ntransition outcome).\n",
4051
+ ),
4052
+ actions: zod
4053
+ .array(
4054
+ zod
4055
+ .object({
4056
+ name: zod
4057
+ .string()
4058
+ .describe(
4059
+ "Action identifier. Sent back in the submit request as `action`.",
4060
+ ),
4061
+ kind: zod
4062
+ .enum(["submit", "passkey", "passkey_register", "navigate", "back"])
4063
+ .describe(
4064
+ "Classifies how the engine handles this action:\n- `submit`: collect the step's fields and run validate\/dispatch\/on_success.\n- `passkey`: issue a WebAuthn assertion challenge; the matching transition\n fires once the returned assertion verifies.\n- `passkey_register`: issue a WebAuthn registration challenge; the matching\n transition fires once the returned attestation verifies.\n- `navigate`: route through the transition without running the input\n pipeline. Used for pure-routing actions declared in the flow definition.\n- `back`: return the user to the previous step. Surfaced by the engine\n when going back is available.\n",
4065
+ ),
4066
+ primary: zod
4067
+ .boolean()
4068
+ .default(
4069
+ listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemActionsItemPrimaryDefault,
4070
+ )
4071
+ .describe(
4072
+ "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
4073
+ ),
4074
+ text_key: zod
4075
+ .string()
4076
+ .optional()
4077
+ .describe(
4078
+ "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
4079
+ ),
4080
+ })
4081
+ .describe(
4082
+ "Configuration for a user-invokable action on a step. The `name` is sent\nback in the submit request as `action`; the engine resolves the action's\ndeclared `kind` to decide how to handle the submission.\n",
4083
+ ),
4084
+ )
4085
+ .default(
4086
+ listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemActionsDefault,
4087
+ )
4088
+ .describe(
4089
+ "Ordered list of actions the user can take. The action name is what the\nfrontend sends back in the submit request. If omitted, the engine\nprovides a default `submit` action.\n",
4090
+ ),
4091
+ gates: zod
4092
+ .record(
4093
+ zod.string(),
4094
+ zod
4095
+ .object({
4096
+ kind: zod
4097
+ .enum(["captcha"])
4098
+ .describe(
4099
+ "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
4100
+ ),
4101
+ provider: zod
4102
+ .string()
4103
+ .describe(
4104
+ "Provider identifier within the gate kind — e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
4105
+ ),
4106
+ config: zod
4107
+ .record(zod.string(), zod.unknown())
4108
+ .optional()
4109
+ .describe(
4110
+ "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
4111
+ ),
4112
+ })
4113
+ .describe(
4114
+ "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
4115
+ ),
4116
+ )
4117
+ .default(
4118
+ listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemGatesDefault,
4119
+ )
4120
+ .describe(
4121
+ 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
4122
+ ),
4123
+ sso_providers: zod
4124
+ .array(
4125
+ zod
4126
+ .object({
4127
+ id: zod.string().describe("Provider instance identifier."),
4128
+ name: zod.string().describe("Display name for the provider."),
4129
+ template: zod
4130
+ .string()
4131
+ .describe("Template hint for rendering (logo, colors)."),
4132
+ })
4133
+ .describe("An available SSO identity provider."),
4134
+ )
4135
+ .default(
4136
+ listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemSsoProvidersDefault,
4137
+ )
4138
+ .describe("Available SSO identity providers for this step."),
4139
+ on_success: zod
4140
+ .enum(["create_user"])
4141
+ .optional()
4142
+ .describe(
4143
+ "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
4144
+ ),
4145
+ complete: zod
4146
+ .enum(["redirect", "show"])
4147
+ .optional()
4148
+ .describe(
4149
+ "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
4150
+ ),
4151
+ transitions: zod
4152
+ .record(
4153
+ zod.string(),
4154
+ zod.object({
4155
+ target: zod
3882
4156
  .string()
3883
4157
  .describe(
3884
- "Action identifier. Sent back in the submit request as `action`.",
3885
- ),
3886
- kind: zod
3887
- .enum(["submit", "passkey", "passkey_register", "navigate", "back"])
3888
- .describe(
3889
- "Classifies how the engine handles this action:\n- `submit`: collect the step's fields and run validate\/dispatch\/on_success.\n- `passkey`: issue a WebAuthn assertion challenge; the matching transition\n fires once the returned assertion verifies.\n- `passkey_register`: issue a WebAuthn registration challenge; the matching\n transition fires once the returned attestation verifies.\n- `navigate`: route through the transition without running the input\n pipeline. Used for pure-routing actions declared in the flow definition.\n- `back`: return the user to the previous step. Surfaced by the engine\n when going back is available.\n",
4158
+ "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3890
4159
  ),
3891
- primary: zod
3892
- .boolean()
3893
- .default(
3894
- listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemActionsItemPrimaryDefault,
3895
- )
3896
- .describe(
3897
- "Marks this as the default\/primary action. The runtime template uses\nthis hint to choose visual emphasis. At most one action per step\nshould be primary; this is not enforced here.\n",
3898
- ),
3899
- text_key: zod
3900
- .string()
4160
+ action: zod
4161
+ .union([zod.enum(["switch", "pivot"]), zod.null()])
3901
4162
  .optional()
3902
4163
  .describe(
3903
- "Optional localization key override for the action's label. When\nomitted, the engine derives a key from the step and action names.\nDisplay text is resolved client-side from a locale dictionary, never\nby the engine.\n",
3904
- ),
3905
- })
3906
- .describe(
3907
- "Configuration for a user-invokable action on a step. The `name` is sent\nback in the submit request as `action`; the engine resolves the action's\ndeclared `kind` to decide how to handle the submission.\n",
3908
- ),
3909
- )
3910
- .default(
3911
- listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemActionsDefault,
3912
- )
3913
- .describe(
3914
- "Ordered list of actions the user can take. The action name is what the\nfrontend sends back in the submit request. If omitted, the engine\nprovides a default `submit` action.\n",
3915
- ),
3916
- gates: zod
3917
- .record(
3918
- zod.string(),
3919
- zod
3920
- .object({
3921
- kind: zod
3922
- .enum(["captcha"])
3923
- .describe(
3924
- "The gate category. Only `captcha` is currently defined. Authenticator\nceremonies (e.g. passkey) are modelled as credential auth_attempts via\n`x-credential` on a field, not as gates.\n",
3925
- ),
3926
- provider: zod
3927
- .string()
3928
- .describe(
3929
- "Provider identifier within the gate kind — e.g. `altcha`, `turnstile`,\n`hcaptcha`. The engine looks up an implementation in its provider\nregistry.\n",
4164
+ "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3930
4165
  ),
3931
- config: zod
3932
- .record(zod.string(), zod.unknown())
4166
+ purpose: zod
4167
+ .union([
4168
+ zod.enum([
4169
+ "login",
4170
+ "register",
4171
+ "recovery",
4172
+ "profiling",
4173
+ "reauth",
4174
+ "link_account",
4175
+ ]),
4176
+ zod.null(),
4177
+ ])
3933
4178
  .optional()
3934
4179
  .describe(
3935
- "Provider-specific configuration consumed by the implementation when\nissuing the per-render challenge. Opaque to the engine.\n",
4180
+ "Local re-purposing. When set, taking this transition changes the\nflow's current purpose to this value — the dispatch mode a step's\nchallenges run under — while the flow's original purpose stays\npinned. Must be a purpose this definition serves, and `target`\nmust be that purpose's entry step. Mutually exclusive with\n`action`: a transition either re-purposes within this flow or\ntargets another flow, never both.\nExample: a \"Sign up\" navigation on the login identifier step\n(`{ target: register, purpose: register }`).\n",
3936
4181
  ),
3937
- })
3938
- .describe(
3939
- "A security challenge that must be satisfied before this step's submission\nis accepted. The engine may also inject gates at runtime based on policy\nor risk evaluation.\n",
3940
- ),
3941
- )
3942
- .default(
3943
- listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemGatesDefault,
3944
- )
3945
- .describe(
3946
- 'Security gates that must be satisfied before submission. Keyed by gate\nname. Each gate selects a kind (e.g. \"captcha\") and provider-specific\nconfiguration. The engine may also inject gates dynamically based on\npolicy.\n',
3947
- ),
3948
- sso_providers: zod
3949
- .array(
3950
- zod
3951
- .object({
3952
- id: zod.string().describe("Provider instance identifier."),
3953
- name: zod.string().describe("Display name for the provider."),
3954
- template: zod
3955
- .string()
3956
- .describe("Template hint for rendering (logo, colors)."),
3957
- })
3958
- .describe("An available SSO identity provider."),
3959
- )
3960
- .default(
3961
- listFlowDefinitionsResponseFlowDefinitionsItemFlowDefinitionStepsItemSsoProvidersDefault,
3962
- )
3963
- .describe("Available SSO identity providers for this step."),
3964
- on_success: zod
3965
- .enum(["create_user"])
3966
- .optional()
3967
- .describe(
3968
- "Server-side mutation to execute when this step completes successfully.\nRuns after field validation passes, before the transition fires.\n\n- create_user: creates the user record (registration flows)\n",
3969
- ),
3970
- complete: zod
3971
- .enum(["redirect", "show"])
3972
- .optional()
3973
- .describe(
3974
- "Marks this as a terminal step. Tells the frontend what to do:\n- redirect: navigate to redirect_uri (OIDC\/SAML callback done)\n- show: render as a success\/info screen\n",
3975
- ),
3976
- transitions: zod
3977
- .record(
3978
- zod.string(),
3979
- zod.object({
3980
- target: zod
3981
- .string()
3982
- .describe(
3983
- "Step name within this flow (when `action` is null), or the name\nof another flow (when `action` is `switch` or `pivot`).\n",
3984
- ),
3985
- action: zod
3986
- .union([zod.enum(["switch", "pivot"]), zod.null()])
3987
- .optional()
3988
- .describe(
3989
- "How to interpret `target`:\n- null (omitted): transition to a step in the current flow.\n- switch: replace the current flow with the target flow.\n No return — the current flow is discarded.\n Example: login ↔ register.\n- pivot: push the target flow onto the stack. The current flow\n is paused and resumes when the target flow completes (auto-pop).\n Example: login → recovery → back to login.\n",
3990
- ),
3991
- purpose: zod
3992
- .union([
3993
- zod.enum([
3994
- "login",
3995
- "register",
3996
- "recovery",
3997
- "profiling",
3998
- "reauth",
3999
- "link_account",
4000
- ]),
4001
- zod.null(),
4002
- ])
4003
- .optional()
4182
+ }),
4183
+ )
4184
+ .optional()
4185
+ .describe(
4186
+ "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` array. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
4187
+ ),
4188
+ })
4189
+ .describe(
4190
+ "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
4191
+ ),
4192
+ )
4193
+ .min(1)
4194
+ .describe(
4195
+ "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
4196
+ ),
4197
+ })
4198
+ .describe(
4199
+ "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend — the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
4200
+ ),
4201
+ user_schema: zod
4202
+ .union([
4203
+ zod
4204
+ .object({
4205
+ id: zod
4206
+ .string()
4207
+ .describe(
4208
+ "The resource id: the server-minted `sch_\*` identifier, or the\ncustomer-supplied `$id` URI when the document declared one at creation.\n",
4209
+ ),
4210
+ schema: zod
4211
+ .object({
4212
+ objectType: zod
4213
+ .string()
4214
+ .max(
4215
+ listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOneObjectTypeMax,
4216
+ )
4217
+ .optional()
4218
+ .describe(
4219
+ "The type of user this schema describes. This is a customer chosen name.\n",
4220
+ ),
4221
+ kind: zod
4222
+ .literal("user-schema")
4223
+ .describe("Discriminator value for a user schema create request."),
4224
+ metaSchema: zod.url().describe("The user Schema version used for this schema."),
4225
+ "x-auth-methods": zod
4226
+ .object({
4227
+ password: zod
4228
+ .object({
4229
+ enabled: zod
4230
+ .boolean()
4231
+ .describe("Whether the authentication method is enabled or not"),
4232
+ })
4233
+ .optional(),
4234
+ passkey: zod
4235
+ .object({
4236
+ enabled: zod
4237
+ .boolean()
4238
+ .describe("Whether the authentication method is enabled or not"),
4239
+ })
4240
+ .optional(),
4241
+ magic_link: zod
4242
+ .object({
4243
+ enabled: zod
4244
+ .boolean()
4245
+ .describe("Whether the authentication method is enabled or not"),
4246
+ })
4247
+ .optional(),
4248
+ sso: zod
4249
+ .object({
4250
+ enabled: zod
4251
+ .boolean()
4252
+ .describe("Whether the authentication method is enabled or not"),
4253
+ })
4254
+ .optional(),
4255
+ otp: zod
4256
+ .object({
4257
+ enabled: zod
4258
+ .boolean()
4259
+ .describe("Whether the authentication method is enabled or not"),
4260
+ })
4261
+ .optional(),
4262
+ })
4263
+ .describe(
4264
+ "A list of authentication methods supported by the user definition.",
4265
+ ),
4266
+ "x-identifier": zod
4267
+ .string()
4268
+ .min(1)
4269
+ .optional()
4270
+ .describe(
4271
+ 'Path of the leaf property whose value identifies a user (nested leaves\nare addressed by their dot-joined attribute path). The property must\ncarry `x-unique` \"project\". Required when an auth method needing\nidentifier-first dispatch (password) is enabled. Passkey is exempt:\ndiscoverable credentials identify the user through the assertion\nitself, so passkey-only and API-managed schemas may designate nothing;\nflows using identifier-first passkey are validated at the flow level\ninstead.\n',
4272
+ ),
4273
+ "x-display": zod
4274
+ .array(zod.string().min(1))
4275
+ .min(1)
4276
+ .optional()
4277
+ .describe(
4278
+ "Ordered leaf property paths whose values, joined with a space, render\nthe user's display name.\n",
4279
+ ),
4280
+ properties: zod
4281
+ .record(
4282
+ zod.string(),
4283
+ zod
4284
+ .object({
4285
+ "x-unique": zod
4286
+ .union([zod.enum(["unspecified", "project", "team"]), zod.null()])
4287
+ .optional()
4288
+ .describe("The level of uniqueness for this property, if applicable"),
4289
+ "x-claim": zod
4290
+ .union([zod.string(), zod.null()])
4291
+ .optional()
4292
+ .describe("The claim name for this property, if applicable"),
4293
+ "x-audit": zod
4294
+ .boolean()
4295
+ .default(
4296
+ listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOnePropertiesXAuditDefault,
4297
+ )
4298
+ .describe(
4299
+ "Whether this property's value may appear in audit event payloads. Audit\npayloads are deny-by-default: a property without this annotation\ncontributes its key but never its value.\n",
4300
+ ),
4301
+ properties: zod
4302
+ .record(zod.string(), zod.unknown())
4303
+ .optional()
4304
+ .describe(
4305
+ "A map of additional properties for the user definition, where the key is\nthe property name and the value is the property schema.\n",
4306
+ ),
4307
+ })
4004
4308
  .describe(
4005
- "Local re-purposing. When set, taking this transition changes the\nflow's current purpose to this value the dispatch mode a step's\nchallenges run under while the flow's original purpose stays\npinned. Must be a purpose this definition serves, and `target`\nmust be that purpose's entry step. Mutually exclusive with\n`action`: a transition either re-purposes within this flow or\ntargets another flow, never both.\nExample: a \"Sign up\" navigation on the login identifier step\n(`{ target: register, purpose: register }`).\n",
4309
+ 'This schema is missing `\"allOf\": [{\"$ref\": \"https:\/\/json-schema.org\/draft\/2020-12\/schema\"}],`.\nThis is done because a lot of code generators cannot handle that.\n\nNative JSON Schema keywords such as `type`, `format`, `title` and `writeOnly`\nare accepted without being listed below. `writeOnly: true` is reserved for a\nvalue that may be written but is never returned by the read API; nothing\nenforces it today, so responses still include write-only properties.\n',
4006
4310
  ),
4007
- }),
4008
- )
4009
- .optional()
4010
- .describe(
4011
- "Maps action\/outcome names to their transition descriptor.\n\nKeys match action names from the `actions` array. Additional keys\ncome from implicit outcomes based on schema annotations\n(e.g. `user_not_found` from `x-unique` fields) and engine\nevents (e.g. `sso`, `callback`).\n",
4012
- ),
4013
- })
4014
- .describe(
4015
- "A step in a flow definition. This is the admin-authored configuration,\nnot the runtime payload sent to the frontend.\n\nSteps are schema-driven: `fields` references properties from the flow's\nuser schema, and the engine resolves field metadata (type, validation,\nimplicit outcomes) from schema annotations at runtime.\n\nA step with only `complete` set is a terminal step. All other steps are\nrendered to the frontend as capability payloads.\n",
4016
- ),
4017
- )
4018
- .min(1)
4019
- .describe(
4020
- "Ordered list of steps in this flow. The order is for human readability —\nactual step sequencing is determined by transitions.\n",
4021
- ),
4022
- })
4023
- .describe(
4024
- "A flow definition is the server-side configuration that describes a complete\nauthentication or identity flow. It is NOT sent to the frontend the flow\nengine evaluates it and produces FlowResponse payloads (steps with capability\ndictionaries) for the client.\n\nFlow definitions are created by administrators and stored in the project\/team\nconfiguration hierarchy. The engine selects the matching definition based on\nthe purpose + audience when a flow is created via POST \/flow.\n",
4025
- ),
4026
- user_schema: zod
4027
- .union([
4028
- zod
4029
- .object({
4030
- id: zod
4031
- .string()
4032
- .describe(
4033
- "The resource id: the server-minted `sch_\*` identifier, or the\ncustomer-supplied `$id` URI when the document declared one at creation.\n",
4034
- ),
4035
- schema: zod
4036
- .object({
4037
- objectType: zod
4038
- .string()
4039
- .max(
4040
- listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOneObjectTypeMax,
4041
- )
4042
- .optional()
4043
- .describe(
4044
- "The type of user this schema describes. This is a customer chosen name.\n",
4045
- ),
4046
- kind: zod
4047
- .literal("user-schema")
4048
- .describe("Discriminator value for a user schema create request."),
4049
- metaSchema: zod.url().describe("The user Schema version used for this schema."),
4050
- "x-auth-methods": zod
4051
- .object({
4052
- password: zod
4053
- .object({
4054
- enabled: zod
4055
- .boolean()
4056
- .describe("Whether the authentication method is enabled or not"),
4057
- })
4058
- .optional(),
4059
- passkey: zod
4060
- .object({
4061
- enabled: zod
4062
- .boolean()
4063
- .describe("Whether the authentication method is enabled or not"),
4064
- })
4065
- .optional(),
4066
- magic_link: zod
4067
- .object({
4068
- enabled: zod
4069
- .boolean()
4070
- .describe("Whether the authentication method is enabled or not"),
4071
- })
4072
- .optional(),
4073
- sso: zod
4074
- .object({
4075
- enabled: zod
4076
- .boolean()
4077
- .describe("Whether the authentication method is enabled or not"),
4078
- })
4079
- .optional(),
4080
- otp: zod
4081
- .object({
4082
- enabled: zod
4083
- .boolean()
4084
- .describe("Whether the authentication method is enabled or not"),
4085
- })
4086
- .optional(),
4087
- })
4088
- .describe("A list of authentication methods supported by the user definition."),
4089
- "x-identifier": zod
4090
- .string()
4091
- .min(1)
4092
- .optional()
4093
- .describe(
4094
- 'Path of the leaf property whose value identifies a user (nested leaves\nare addressed by their dot-joined attribute path). The property must\ncarry `x-unique` \"project\". Required when an auth method needing\nidentifier-first dispatch (password) is enabled. Passkey is exempt:\ndiscoverable credentials identify the user through the assertion\nitself, so passkey-only and API-managed schemas may designate nothing;\nflows using identifier-first passkey are validated at the flow level\ninstead.\n',
4095
- ),
4096
- "x-display": zod
4097
- .array(zod.string().min(1))
4098
- .min(1)
4099
- .optional()
4100
- .describe(
4101
- "Ordered leaf property paths whose values, joined with a space, render\nthe user's display name.\n",
4102
- ),
4103
- properties: zod
4104
- .record(
4105
- zod.string(),
4106
- zod
4107
- .object({
4108
- "x-unique": zod
4109
- .union([zod.enum(["unspecified", "project", "team"]), zod.null()])
4110
- .optional()
4111
- .describe("The level of uniqueness for this property, if applicable"),
4112
- "x-claim": zod
4113
- .union([zod.string(), zod.null()])
4114
- .optional()
4115
- .describe("The claim name for this property, if applicable"),
4116
- "x-audit": zod
4117
- .boolean()
4118
- .default(
4119
- listFlowDefinitionsResponseFlowDefinitionsItemUserSchemaOneSchemaOnePropertiesXAuditDefault,
4120
- )
4121
- .describe(
4122
- "Whether this property's value may appear in audit event payloads. Audit\npayloads are deny-by-default: a property without this annotation\ncontributes its key but never its value.\n",
4123
- ),
4124
- properties: zod
4125
- .record(zod.string(), zod.unknown())
4126
- .optional()
4127
- .describe(
4128
- "A map of additional properties for the user definition, where the key is\nthe property name and the value is the property schema.\n",
4129
- ),
4130
- })
4131
- .describe(
4132
- 'This schema is missing `\"allOf\": [{\"$ref\": \"https:\/\/json-schema.org\/draft\/2020-12\/schema\"}],`.\nThis is done because a lot of code generators cannot handle that.\n\nNative JSON Schema keywords such as `type`, `format`, `title` and `writeOnly`\nare accepted without being listed below. `writeOnly: true` is reserved for a\nvalue that may be written but is never returned by the read API; nothing\nenforces it today, so responses still include write-only properties.\n',
4133
- ),
4134
- )
4135
- .optional()
4136
- .describe(
4137
- "A map of additional properties for the user definition, where the\nkey is the property name and the value is the property schema\n",
4138
- ),
4139
- })
4140
- .describe(
4141
- 'This schema is missing `\"allOf\": [{\"$ref\": \"https:\/\/json-schema.org\/draft\/2020-12\/schema\"}],`. \nThis is done because a lot of code generators cannot handle that.\n',
4142
- )
4143
- .describe("The customer-authored JSON Schema document, served verbatim."),
4144
- metadata: zod.object({
4145
- created_at: zod.iso
4146
- .datetime({ offset: true })
4147
- .describe("The time when the schema was created."),
4148
- }),
4149
- })
4150
- .describe(
4151
- "A schema resource: the server-owned envelope around a customer-authored\nJSON Schema document.\n\n`schema` is the customer-authored document, served verbatim: its keys and\ncontents are defined entirely by its author. The rest of the object — `id`,\n`metadata` — is the server-owned envelope. Keeping the two apart means the\ndocument may declare any property (including `id` or `metadata`) without\ncolliding with the envelope, and the resource `id` stays distinguishable\nfrom the document's own `$id`.\n",
4152
- ),
4153
- zod.null(),
4154
- ])
4155
- .optional()
4156
- .describe(
4157
- "The user schema this flow operates on: the same object\n`GET \/schemas\/{id}` returns. Present only when the request asked for it\nwith `expand=user_schema`; `null` when it was requested but the\nreferenced schema no longer resolves or the caller may not read it.\n",
4158
- ),
4159
- created_at: zod.iso.datetime({ offset: true }),
4160
- updated_at: zod.iso.datetime({ offset: true }),
4161
- }),
4162
- ),
4163
- next_page_token: zod
4164
- .union([zod.string(), zod.null()])
4165
- .optional()
4166
- .describe(
4167
- "The token to retrieve the next page of results. Absent if there are no more results.",
4311
+ )
4312
+ .optional()
4313
+ .describe(
4314
+ "A map of additional properties for the user definition, where the\nkey is the property name and the value is the property schema\n",
4315
+ ),
4316
+ })
4317
+ .describe(
4318
+ 'This schema is missing `\"allOf\": [{\"$ref\": \"https:\/\/json-schema.org\/draft\/2020-12\/schema\"}],`. \nThis is done because a lot of code generators cannot handle that.\n',
4319
+ )
4320
+ .describe("The customer-authored JSON Schema document, served verbatim."),
4321
+ metadata: zod.object({
4322
+ created_at: zod.iso
4323
+ .datetime({ offset: true })
4324
+ .describe("The time when the schema was created."),
4325
+ }),
4326
+ })
4327
+ .describe(
4328
+ "A schema resource: the server-owned envelope around a customer-authored\nJSON Schema document.\n\n`schema` is the customer-authored document, served verbatim: its keys and\ncontents are defined entirely by its author. The rest of the object — `id`,\n`metadata` is the server-owned envelope. Keeping the two apart means the\ndocument may declare any property (including `id` or `metadata`) without\ncolliding with the envelope, and the resource `id` stays distinguishable\nfrom the document's own `$id`.\n",
4329
+ ),
4330
+ zod.null(),
4331
+ ])
4332
+ .optional()
4333
+ .describe(
4334
+ "The user schema this flow operates on: the same object\n`GET \/schemas\/{id}` returns. Present only when the request asked for it\nwith `expand=user_schema`; `null` when it was requested but the\nreferenced schema no longer resolves or the caller may not read it.\n",
4335
+ ),
4336
+ created_at: zod.iso.datetime({ offset: true }),
4337
+ updated_at: zod.iso.datetime({ offset: true }),
4338
+ }),
4168
4339
  ),
4169
- });
4340
+ next_page_token: zod
4341
+ .union([zod.string(), zod.null()])
4342
+ .optional()
4343
+ .describe(
4344
+ "The token to retrieve the next page of results. Absent if there are no more results.",
4345
+ ),
4346
+ })
4347
+ .describe("List of flow definitions, newest by creation time first.");
4170
4348
 
4171
4349
  /**
4172
4350
  * Get a flow definition by id
@@ -4195,7 +4373,7 @@ export const GetFlowDefinitionResponse = zod.object({
4195
4373
  .string()
4196
4374
  .regex(getFlowDefinitionResponseFlowDefinitionNameRegExp)
4197
4375
  .describe(
4198
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
4376
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Every revision of a flow shares its\n`name`; publishing a definition under an existing `name` adds a\nrevision to that flow. Renaming is not supported — the `name` is part\nof the public contract another definition may reference. Acts as the\nhuman display label as well; no separate slug.\n",
4199
4377
  ),
4200
4378
  status: zod
4201
4379
  .enum(["active", "draft"])
@@ -4553,7 +4731,7 @@ export const UpdateFlowDefinitionBody = zod
4553
4731
  .string()
4554
4732
  .regex(updateFlowDefinitionBodyFlowDefinitionNameRegExp)
4555
4733
  .describe(
4556
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
4734
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Every revision of a flow shares its\n`name`; publishing a definition under an existing `name` adds a\nrevision to that flow. Renaming is not supported — the `name` is part\nof the public contract another definition may reference. Acts as the\nhuman display label as well; no separate slug.\n",
4557
4735
  ),
4558
4736
  status: zod
4559
4737
  .enum(["active", "draft"])
@@ -4769,7 +4947,7 @@ export const UpdateFlowDefinitionResponse = zod.object({
4769
4947
  .string()
4770
4948
  .regex(updateFlowDefinitionResponseFlowDefinitionNameRegExp)
4771
4949
  .describe(
4772
- "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Renaming is not supported — the\n`name` is part of the public contract another definition may\nreference. Acts as the human display label as well; no separate slug.\n",
4950
+ "Stable identifier for this flow, used as the target of cross-flow\n`switch` and `pivot` transitions. Every revision of a flow shares its\n`name`; publishing a definition under an existing `name` adds a\nrevision to that flow. Renaming is not supported — the `name` is part\nof the public contract another definition may reference. Acts as the\nhuman display label as well; no separate slug.\n",
4773
4951
  ),
4774
4952
  status: zod
4775
4953
  .enum(["active", "draft"])
@@ -6005,6 +6183,321 @@ export const CreateGrantBody = zod.object({
6005
6183
  ),
6006
6184
  });
6007
6185
 
6186
+ /**
6187
+ * Returns the collaboration grants of a project, paginated with a cursor.
6188
+ Only unrevoked grants this API manages are listed (user or team bound to
6189
+ viewer, editor, or admin), including expired grants so a client can
6190
+ DELETE before re-granting. Project-secret setup (`sk_proj`) and
6191
+ owning-team (`relation=team`) rows are not returned. Grants are not in
6192
+ `resource_scope_index`; project scope is required on the query (same as
6193
+ get). Requires `project.read`. `expand: ["principal"]` additionally
6194
+ requires `user.read` and `team.read` (documented on the expand enum;
6195
+ those scopes cannot be ANDed onto this security block because they are
6196
+ body-conditional).
6197
+
6198
+ * @summary Query grants
6199
+ */
6200
+ export const queryGrantsQueryProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6201
+
6202
+ export const QueryGrantsQueryParams = zod.strictObject({
6203
+ project_id: zod
6204
+ .string()
6205
+ .regex(queryGrantsQueryProjectIdRegExp)
6206
+ .describe("The unique identifier of the project"),
6207
+ });
6208
+
6209
+ export const queryGrantsBodyLimitDefault = 20;
6210
+ export const queryGrantsBodyLimitMax = 100;
6211
+
6212
+ export const QueryGrantsBody = zod
6213
+ .object({
6214
+ limit: zod.number().min(1).max(queryGrantsBodyLimitMax).default(queryGrantsBodyLimitDefault),
6215
+ page_token: zod
6216
+ .union([zod.string(), zod.null()])
6217
+ .optional()
6218
+ .describe(
6219
+ "Token to retrieve the next page of results. Must be sent with the same\n`sorting` as the request that issued the token. Omitting `sorting` reuses\nthe default sort and only succeeds when that default matches the token.\n",
6220
+ ),
6221
+ expand: zod
6222
+ .array(
6223
+ zod
6224
+ .enum(["principal"])
6225
+ .describe(
6226
+ "A related object to embed on each returned grant (ADR 059).\n\n- `principal`: the principal named by `principal_id`, as `principal` on\n each grant. The property is omitted entirely when not requested. When\n requested, it is the same body `GET \/users\/{id}` serves for\n `principal_type=user`, or `GET \/teams\/{id}` for `principal_type=team`,\n and `null` when that principal cannot be loaded. Discriminate with the\n grant's existing `principal_type`.\n\n Requires `user.read` and `team.read` in addition to `project.read`.\n Both are checked on the whole request before the list, because a mixed\n page is the common case. A caller who may not read either resource\n receives 403 rather than a silently missing `principal`.\n",
6227
+ ),
6228
+ )
6229
+ .optional()
6230
+ .describe(
6231
+ "Related objects to embed on each grant (ADR 059). Omit it and no\nembedded object is returned. An unrecognised value is rejected.\n",
6232
+ ),
6233
+ sorting: zod
6234
+ .object({
6235
+ field: zod
6236
+ .enum(["created_at", "expires_at", "id"])
6237
+ .describe(
6238
+ "Field to sort grants by. Default is `created_at` ascending with `id` as\nthe tiebreaker.\n",
6239
+ ),
6240
+ direction: zod.enum(["asc", "desc"]),
6241
+ })
6242
+ .optional(),
6243
+ filter: zod
6244
+ .array(
6245
+ zod.object({
6246
+ field: zod
6247
+ .enum(["created_at", "principal_type", "principal_id", "relation", "expires_at"])
6248
+ .describe(
6249
+ "Field to filter grants by:\n- `created_at`: RFC3339 timestamp\n- `principal_type`: `user` or `team`\n- `principal_id`: principal id (`user_<opaque>` or `team_<opaque>`)\n- `relation`: `viewer`, `editor`, or `admin`\n- `expires_at`: RFC3339 timestamp (null when the grant does not expire)\n",
6250
+ ),
6251
+ value: zod
6252
+ .union([zod.string(), zod.number(), zod.boolean(), zod.null()])
6253
+ .optional()
6254
+ .describe(
6255
+ "Filter-value specifies which values can be filtered by a query endpoint. This\nis a union of types. When a value is specified which is not assignable to the\nfield which is being filtered, a 400 error will be returned.\n",
6256
+ ),
6257
+ operation: zod
6258
+ .enum([
6259
+ "equals",
6260
+ "not_equals",
6261
+ "contains",
6262
+ "not_contains",
6263
+ "less_than",
6264
+ "less_than_or_equal",
6265
+ "greater_than",
6266
+ "greater_than_or_equal",
6267
+ ])
6268
+ .describe(
6269
+ "Filter operation defines the operations which can be used when filtering on a\nquery endpoint.\n\nOn text fields, `contains` is a case-insensitive substring match. `equals`\ncompares the whole value and is case-sensitive unless the field documents\notherwise.\n",
6270
+ ),
6271
+ }),
6272
+ )
6273
+ .optional()
6274
+ .describe("Filter criteria for querying grants. Combined with AND."),
6275
+ })
6276
+ .describe("Request to query the grants of a project.");
6277
+
6278
+ export const queryGrantsResponseGrantsItemUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
6279
+ export const queryGrantsResponseGrantsItemPrincipalOneOneOneIdRegExp = new RegExp(
6280
+ "^user_[a-zA-Z0-9_-]+$",
6281
+ );
6282
+
6283
+ export const QueryGrantsResponse = zod
6284
+ .object({
6285
+ grants: zod.array(
6286
+ zod
6287
+ .object({
6288
+ id: zod.string().describe("Managed assignment id (`asgn_<opaque>`)."),
6289
+ project_id: zod.string().describe("Project this grant is scoped to."),
6290
+ principal_type: zod
6291
+ .enum(["user", "team"])
6292
+ .describe("Kind of principal bound by this grant."),
6293
+ principal_id: zod.string().describe("Principal id (`user_<opaque>` or `team_<opaque>`)."),
6294
+ object_type: zod
6295
+ .enum(["project"])
6296
+ .describe("Catalog object type. Always `project` for this API."),
6297
+ relation: zod
6298
+ .enum(["viewer", "editor", "admin"])
6299
+ .describe("Catalog relation on the project."),
6300
+ created_at: zod.iso.datetime({ offset: true }).describe("When the grant was created."),
6301
+ expires_at: zod
6302
+ .union([zod.iso.datetime({ offset: true }), zod.null()])
6303
+ .optional()
6304
+ .describe(
6305
+ "When the grant expires. Null when it does not expire. GET still\nreturns expired unrevoked grants; authorization ignores them.\n",
6306
+ ),
6307
+ user: zod
6308
+ .object({
6309
+ user_id: zod.string().regex(queryGrantsResponseGrantsItemUserUserIdRegExp),
6310
+ identifier: zod
6311
+ .string()
6312
+ .optional()
6313
+ .describe(
6314
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
6315
+ ),
6316
+ identifier_property: zod
6317
+ .string()
6318
+ .optional()
6319
+ .describe(
6320
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
6321
+ ),
6322
+ display: zod
6323
+ .string()
6324
+ .optional()
6325
+ .describe(
6326
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
6327
+ ),
6328
+ })
6329
+ .optional()
6330
+ .describe(
6331
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
6332
+ ),
6333
+ team: zod
6334
+ .object({
6335
+ team_id: zod
6336
+ .string()
6337
+ .describe("The referenced team's id (`team_<opaque>`). Always present."),
6338
+ name: zod
6339
+ .string()
6340
+ .optional()
6341
+ .describe("The team's name. Absent when the team can no longer be loaded."),
6342
+ })
6343
+ .optional()
6344
+ .describe(
6345
+ "A resolved reference to a team. Carries the team's id and name so a grant\nlist is readable without embedding the full Team body. Id and display ride\n`project.read` (ADR 059 rule 8): a reference field carrying only the\ntarget's id and display strings needs no gate of its own. Missing or\ndeleted teams degrade to `team_id` only.\n",
6346
+ ),
6347
+ principal: zod
6348
+ .union([
6349
+ zod
6350
+ .union([
6351
+ zod
6352
+ .object({
6353
+ id: zod
6354
+ .string()
6355
+ .regex(queryGrantsResponseGrantsItemPrincipalOneOneOneIdRegExp),
6356
+ schema: zod
6357
+ .string()
6358
+ .describe(
6359
+ "The schema that defines the content of `attributes`. These schemas can be\ncreated using the `\/schemas` endpoint. A default schema is provided.\nThis schema can be retrieved using the same endpoint.\n",
6360
+ ),
6361
+ attributes: zod
6362
+ .record(zod.string(), zod.unknown())
6363
+ .describe(
6364
+ "The user's content, satisfying the schema named by `schema`. Property\nnames and types are determined entirely by that schema.\n",
6365
+ ),
6366
+ metadata: zod.object({
6367
+ created_at: zod.iso
6368
+ .datetime({ offset: true })
6369
+ .describe("The time when the user was created."),
6370
+ updated_at: zod.iso
6371
+ .datetime({ offset: true })
6372
+ .describe("The time when the user was last updated."),
6373
+ status: zod
6374
+ .enum(["active", "suspended", "deactivated", "pending_purge"])
6375
+ .describe("The status of the user."),
6376
+ lifecycle_owner_team_id: zod
6377
+ .union([zod.string(), zod.null()])
6378
+ .optional()
6379
+ .describe(
6380
+ "The team that owns this user's identity lifecycle, or `null` when the\nuser is self-owned. This is a single team and a different concept from\nthe user's team memberships: it decides who may deprovision the user, not\nwhich teams the user collaborates in. Memberships are their own paginated\nresource — `GET \/users\/{user_id}\/teams`.\n",
6381
+ ),
6382
+ lifecycle_owner_team: zod
6383
+ .union([
6384
+ zod
6385
+ .object({
6386
+ id: zod.string().describe("The unique identifier of the team."),
6387
+ name: zod.string().describe("The name of the team."),
6388
+ status: zod
6389
+ .enum(["active", "deactivated"])
6390
+ .describe(
6391
+ "The lifecycle state of a team.\n\nactive: The team is available for use.\ndeactivated: The team is no longer active but is retained for historical and audit purposes.\n",
6392
+ ),
6393
+ created_at: zod.iso
6394
+ .datetime({ offset: true })
6395
+ .describe("The time when the team was created."),
6396
+ updated_at: zod.iso
6397
+ .datetime({ offset: true })
6398
+ .describe("The time when the team was last updated."),
6399
+ })
6400
+ .describe("Details of a team."),
6401
+ zod.null(),
6402
+ ])
6403
+ .optional()
6404
+ .describe(
6405
+ 'The team named by `lifecycle_owner_team_id`, present only when the\nrequest asked for it with `expand: [\"lifecycle_owner_team\"]` (ADR 059).\nAbsent means it was not requested; `null` means the user is self-owned\nand there is no owner to resolve.\n\nRequesting it does not guarantee it is present on every user. Today\n`team.read` is checked once for the whole request, so it is; once that\ncheck is per team, a page may contain a user whose owner the caller may\nnot read, and such a row answers with neither the team nor `null` —\n`null` already means self-owned. What it answers with instead is decided\nwith the granular scopes (#420); do not read the two cases above as the\ncomplete set.\n\nThis is the same representation `GET \/teams\/{team_id}` serves. It is a\nsingle team, not a collection, so it carries no cap and no truncation\nflag.\n',
6406
+ ),
6407
+ }),
6408
+ identifier: zod
6409
+ .string()
6410
+ .optional()
6411
+ .describe(
6412
+ "The current value of the user schema's designated identifier\n(`x-identifier`), resolved live at read time. Absent when the schema\ndesignates no identifier or the user carries no value for it.\n",
6413
+ ),
6414
+ identifier_property: zod
6415
+ .string()
6416
+ .optional()
6417
+ .describe(
6418
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
6419
+ ),
6420
+ display: zod
6421
+ .string()
6422
+ .optional()
6423
+ .describe(
6424
+ "The `x-display` rendering — the designated properties' values joined\nin list order, resolved live at read time. Purely presentational.\nAbsent when the schema designates no display properties or the user\ncarries no values for them. Clients render `display`, falling back\nto `identifier`, then `id`.\n",
6425
+ ),
6426
+ teams: zod
6427
+ .array(
6428
+ zod
6429
+ .object({
6430
+ id: zod.string().describe("The unique identifier of the team."),
6431
+ name: zod.string().describe("The name of the team."),
6432
+ membership_status: zod
6433
+ .enum(["pending", "active", "inactive"])
6434
+ .describe(
6435
+ "The user's participation state on this team. Memberships the user was\nremoved from are not returned.\n",
6436
+ ),
6437
+ created_at: zod.iso
6438
+ .datetime({ offset: true })
6439
+ .describe("The time when the user joined this team."),
6440
+ updated_at: zod.iso
6441
+ .datetime({ offset: true })
6442
+ .describe("The time when this membership was last changed."),
6443
+ })
6444
+ .describe(
6445
+ "One entry of a user's team roster: a team the user belongs to, with the\nmembership's participation state. The team's `name` travels with the entry, so\na page renders without a follow-up `POST \/teams\/query` per row.\n\nRoster membership is not lifecycle ownership. A user can belong to many teams\nwhile still owning their own lifecycle — that single owning team is reported\nas `metadata.lifecycle_owner_team_id` on the user itself.\n",
6446
+ ),
6447
+ )
6448
+ .optional()
6449
+ .describe(
6450
+ 'The user\'s team memberships, present only when the request asked for them with\n`expand: [\"teams\"]` (ADR 059). Absent means it was not requested; `[]`\nmeans the user has none.\n\nDeliberately outside `metadata`: memberships are a related collection, not\npart of the server-owned envelope, and it is a different concept from\n`metadata.lifecycle_owner_team_id` (ADR 024).\n',
6451
+ ),
6452
+ teams_truncated: zod
6453
+ .boolean()
6454
+ .optional()
6455
+ .describe(
6456
+ "True when the user is on more teams than the embedded list carries. The\nembedded list is capped and cannot be paged; read them all at\n`GET \/users\/{user_id}\/teams`. Present only alongside `teams`.\n",
6457
+ ),
6458
+ })
6459
+ .describe(
6460
+ "A user represents an individual identity in the system. It can be used to\nrepresent a human user, but also a service account or any other type of\nidentity.\n\n`attributes` is the document that satisfies the user schema named by\n`schema`: its property names and types are defined entirely by that schema,\nand it is what the schema validates. The rest of the object — `id`,\n`schema`, `metadata` — is the server-owned envelope. Keeping the two apart\nmeans a schema may name a property `id` or `metadata` without colliding with\nthe envelope, and closed-world keywords (`additionalProperties: false`,\n`propertyNames`, `unevaluatedProperties`) behave as their author expects.\n",
6461
+ ),
6462
+ zod
6463
+ .object({
6464
+ id: zod.string().describe("The unique identifier of the team."),
6465
+ name: zod.string().describe("The name of the team."),
6466
+ status: zod
6467
+ .enum(["active", "deactivated"])
6468
+ .describe(
6469
+ "The lifecycle state of a team.\n\nactive: The team is available for use.\ndeactivated: The team is no longer active but is retained for historical and audit purposes.\n",
6470
+ ),
6471
+ created_at: zod.iso
6472
+ .datetime({ offset: true })
6473
+ .describe("The time when the team was created."),
6474
+ updated_at: zod.iso
6475
+ .datetime({ offset: true })
6476
+ .describe("The time when the team was last updated."),
6477
+ })
6478
+ .describe("Details of a team."),
6479
+ ])
6480
+ .describe(
6481
+ "The principal bound by a grant: the User body when `principal_type` is\n`user`, or the Team body when `principal_type` is `team`. Same\nrepresentation as `GET \/users\/{id}` and `GET \/teams\/{id}` respectively.\nClients discriminate with the grant's existing `principal_type`.\n",
6482
+ ),
6483
+ zod.null(),
6484
+ ])
6485
+ .optional()
6486
+ .describe(
6487
+ 'The principal named by `principal_id`, present only when the request\nasked for it with `expand: [\"principal\"]` (ADR 059). Absent means it\nwas not requested; `null` means the principal cannot be loaded\n(deleted or missing). GET and create never set this field.\n\nWhen present, the body is the same representation `GET \/users\/{id}`\nserves for `principal_type=user`, or `GET \/teams\/{id}` for\n`principal_type=team`. Discriminate with the grant\'s existing\n`principal_type`.\n\nRequires `user.read` and `team.read` in addition to `project.read`.\nBoth are checked on the whole request before the list.\n',
6488
+ ),
6489
+ })
6490
+ .describe("A collaboration grant binding a principal to a project relation."),
6491
+ ),
6492
+ next_page_token: zod
6493
+ .union([zod.string(), zod.null()])
6494
+ .optional()
6495
+ .describe(
6496
+ "Token to pass as `page_token` in the next request to fetch the following page.\nAbsent when there are no more results. The follow-up request must repeat the\nsame `sorting` that produced this token (omit only when both pages use the default).\n",
6497
+ ),
6498
+ })
6499
+ .describe("Paginated list of grants.");
6500
+
6008
6501
  /**
6009
6502
  * Loads a grant by `(project_id, id)` that this API manages (user or team
6010
6503
  bound to viewer, editor, or admin) and that has not been revoked.
@@ -6030,6 +6523,9 @@ export const GetGrantQueryParams = zod.strictObject({
6030
6523
  .describe("The unique identifier of the project"),
6031
6524
  });
6032
6525
 
6526
+ export const getGrantResponseUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
6527
+ export const getGrantResponsePrincipalOneOneOneIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
6528
+
6033
6529
  export const GetGrantResponse = zod
6034
6530
  .object({
6035
6531
  id: zod.string().describe("Managed assignment id (`asgn_<opaque>`)."),
@@ -6045,7 +6541,187 @@ export const GetGrantResponse = zod
6045
6541
  .union([zod.iso.datetime({ offset: true }), zod.null()])
6046
6542
  .optional()
6047
6543
  .describe(
6048
- "When the grant expires. Null when it does not expire. GET still\nreturns expired unrevoked grants; authorization ignores them.\n",
6544
+ "When the grant expires. Null when it does not expire. GET still\nreturns expired unrevoked grants; authorization ignores them.\n",
6545
+ ),
6546
+ user: zod
6547
+ .object({
6548
+ user_id: zod.string().regex(getGrantResponseUserUserIdRegExp),
6549
+ identifier: zod
6550
+ .string()
6551
+ .optional()
6552
+ .describe(
6553
+ "The current value of the schema's designated identifier\n(`x-identifier`). Absent when the schema designates no identifier or\nthe user carries no value for it.\n",
6554
+ ),
6555
+ identifier_property: zod
6556
+ .string()
6557
+ .optional()
6558
+ .describe(
6559
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
6560
+ ),
6561
+ display: zod
6562
+ .string()
6563
+ .optional()
6564
+ .describe(
6565
+ "The `x-display` rendering — the designated properties' values joined\nin list order. Purely presentational, with no source attribution.\nAbsent when the schema designates no display properties or the user\ncarries no values for them.\n",
6566
+ ),
6567
+ })
6568
+ .optional()
6569
+ .describe(
6570
+ "A resolved reference to a user (ADR 058 §3). Fields are role-named, not\nproperty-named, so responses can mix users from different schemas.\n`identifier` and `display` are resolved independently from the user\nschema's `x-identifier` and `x-display` designations, live at read time.\nClients render `display`, falling back to `identifier`, then `user_id`.\nMissing or deleted users degrade to `user_id` only.\n",
6571
+ ),
6572
+ team: zod
6573
+ .object({
6574
+ team_id: zod
6575
+ .string()
6576
+ .describe("The referenced team's id (`team_<opaque>`). Always present."),
6577
+ name: zod
6578
+ .string()
6579
+ .optional()
6580
+ .describe("The team's name. Absent when the team can no longer be loaded."),
6581
+ })
6582
+ .optional()
6583
+ .describe(
6584
+ "A resolved reference to a team. Carries the team's id and name so a grant\nlist is readable without embedding the full Team body. Id and display ride\n`project.read` (ADR 059 rule 8): a reference field carrying only the\ntarget's id and display strings needs no gate of its own. Missing or\ndeleted teams degrade to `team_id` only.\n",
6585
+ ),
6586
+ principal: zod
6587
+ .union([
6588
+ zod
6589
+ .union([
6590
+ zod
6591
+ .object({
6592
+ id: zod.string().regex(getGrantResponsePrincipalOneOneOneIdRegExp),
6593
+ schema: zod
6594
+ .string()
6595
+ .describe(
6596
+ "The schema that defines the content of `attributes`. These schemas can be\ncreated using the `\/schemas` endpoint. A default schema is provided.\nThis schema can be retrieved using the same endpoint.\n",
6597
+ ),
6598
+ attributes: zod
6599
+ .record(zod.string(), zod.unknown())
6600
+ .describe(
6601
+ "The user's content, satisfying the schema named by `schema`. Property\nnames and types are determined entirely by that schema.\n",
6602
+ ),
6603
+ metadata: zod.object({
6604
+ created_at: zod.iso
6605
+ .datetime({ offset: true })
6606
+ .describe("The time when the user was created."),
6607
+ updated_at: zod.iso
6608
+ .datetime({ offset: true })
6609
+ .describe("The time when the user was last updated."),
6610
+ status: zod
6611
+ .enum(["active", "suspended", "deactivated", "pending_purge"])
6612
+ .describe("The status of the user."),
6613
+ lifecycle_owner_team_id: zod
6614
+ .union([zod.string(), zod.null()])
6615
+ .optional()
6616
+ .describe(
6617
+ "The team that owns this user's identity lifecycle, or `null` when the\nuser is self-owned. This is a single team and a different concept from\nthe user's team memberships: it decides who may deprovision the user, not\nwhich teams the user collaborates in. Memberships are their own paginated\nresource — `GET \/users\/{user_id}\/teams`.\n",
6618
+ ),
6619
+ lifecycle_owner_team: zod
6620
+ .union([
6621
+ zod
6622
+ .object({
6623
+ id: zod.string().describe("The unique identifier of the team."),
6624
+ name: zod.string().describe("The name of the team."),
6625
+ status: zod
6626
+ .enum(["active", "deactivated"])
6627
+ .describe(
6628
+ "The lifecycle state of a team.\n\nactive: The team is available for use.\ndeactivated: The team is no longer active but is retained for historical and audit purposes.\n",
6629
+ ),
6630
+ created_at: zod.iso
6631
+ .datetime({ offset: true })
6632
+ .describe("The time when the team was created."),
6633
+ updated_at: zod.iso
6634
+ .datetime({ offset: true })
6635
+ .describe("The time when the team was last updated."),
6636
+ })
6637
+ .describe("Details of a team."),
6638
+ zod.null(),
6639
+ ])
6640
+ .optional()
6641
+ .describe(
6642
+ 'The team named by `lifecycle_owner_team_id`, present only when the\nrequest asked for it with `expand: [\"lifecycle_owner_team\"]` (ADR 059).\nAbsent means it was not requested; `null` means the user is self-owned\nand there is no owner to resolve.\n\nRequesting it does not guarantee it is present on every user. Today\n`team.read` is checked once for the whole request, so it is; once that\ncheck is per team, a page may contain a user whose owner the caller may\nnot read, and such a row answers with neither the team nor `null` —\n`null` already means self-owned. What it answers with instead is decided\nwith the granular scopes (#420); do not read the two cases above as the\ncomplete set.\n\nThis is the same representation `GET \/teams\/{team_id}` serves. It is a\nsingle team, not a collection, so it carries no cap and no truncation\nflag.\n',
6643
+ ),
6644
+ }),
6645
+ identifier: zod
6646
+ .string()
6647
+ .optional()
6648
+ .describe(
6649
+ "The current value of the user schema's designated identifier\n(`x-identifier`), resolved live at read time. Absent when the schema\ndesignates no identifier or the user carries no value for it.\n",
6650
+ ),
6651
+ identifier_property: zod
6652
+ .string()
6653
+ .optional()
6654
+ .describe(
6655
+ "The schema property `identifier` came from, so clients can reach the\nproperty's schema for semantics (a mailto link, a field label)\ninstead of guessing from the value. Present exactly when\n`identifier` is.\n",
6656
+ ),
6657
+ display: zod
6658
+ .string()
6659
+ .optional()
6660
+ .describe(
6661
+ "The `x-display` rendering — the designated properties' values joined\nin list order, resolved live at read time. Purely presentational.\nAbsent when the schema designates no display properties or the user\ncarries no values for them. Clients render `display`, falling back\nto `identifier`, then `id`.\n",
6662
+ ),
6663
+ teams: zod
6664
+ .array(
6665
+ zod
6666
+ .object({
6667
+ id: zod.string().describe("The unique identifier of the team."),
6668
+ name: zod.string().describe("The name of the team."),
6669
+ membership_status: zod
6670
+ .enum(["pending", "active", "inactive"])
6671
+ .describe(
6672
+ "The user's participation state on this team. Memberships the user was\nremoved from are not returned.\n",
6673
+ ),
6674
+ created_at: zod.iso
6675
+ .datetime({ offset: true })
6676
+ .describe("The time when the user joined this team."),
6677
+ updated_at: zod.iso
6678
+ .datetime({ offset: true })
6679
+ .describe("The time when this membership was last changed."),
6680
+ })
6681
+ .describe(
6682
+ "One entry of a user's team roster: a team the user belongs to, with the\nmembership's participation state. The team's `name` travels with the entry, so\na page renders without a follow-up `POST \/teams\/query` per row.\n\nRoster membership is not lifecycle ownership. A user can belong to many teams\nwhile still owning their own lifecycle — that single owning team is reported\nas `metadata.lifecycle_owner_team_id` on the user itself.\n",
6683
+ ),
6684
+ )
6685
+ .optional()
6686
+ .describe(
6687
+ 'The user\'s team memberships, present only when the request asked for them with\n`expand: [\"teams\"]` (ADR 059). Absent means it was not requested; `[]`\nmeans the user has none.\n\nDeliberately outside `metadata`: memberships are a related collection, not\npart of the server-owned envelope, and it is a different concept from\n`metadata.lifecycle_owner_team_id` (ADR 024).\n',
6688
+ ),
6689
+ teams_truncated: zod
6690
+ .boolean()
6691
+ .optional()
6692
+ .describe(
6693
+ "True when the user is on more teams than the embedded list carries. The\nembedded list is capped and cannot be paged; read them all at\n`GET \/users\/{user_id}\/teams`. Present only alongside `teams`.\n",
6694
+ ),
6695
+ })
6696
+ .describe(
6697
+ "A user represents an individual identity in the system. It can be used to\nrepresent a human user, but also a service account or any other type of\nidentity.\n\n`attributes` is the document that satisfies the user schema named by\n`schema`: its property names and types are defined entirely by that schema,\nand it is what the schema validates. The rest of the object — `id`,\n`schema`, `metadata` — is the server-owned envelope. Keeping the two apart\nmeans a schema may name a property `id` or `metadata` without colliding with\nthe envelope, and closed-world keywords (`additionalProperties: false`,\n`propertyNames`, `unevaluatedProperties`) behave as their author expects.\n",
6698
+ ),
6699
+ zod
6700
+ .object({
6701
+ id: zod.string().describe("The unique identifier of the team."),
6702
+ name: zod.string().describe("The name of the team."),
6703
+ status: zod
6704
+ .enum(["active", "deactivated"])
6705
+ .describe(
6706
+ "The lifecycle state of a team.\n\nactive: The team is available for use.\ndeactivated: The team is no longer active but is retained for historical and audit purposes.\n",
6707
+ ),
6708
+ created_at: zod.iso
6709
+ .datetime({ offset: true })
6710
+ .describe("The time when the team was created."),
6711
+ updated_at: zod.iso
6712
+ .datetime({ offset: true })
6713
+ .describe("The time when the team was last updated."),
6714
+ })
6715
+ .describe("Details of a team."),
6716
+ ])
6717
+ .describe(
6718
+ "The principal bound by a grant: the User body when `principal_type` is\n`user`, or the Team body when `principal_type` is `team`. Same\nrepresentation as `GET \/users\/{id}` and `GET \/teams\/{id}` respectively.\nClients discriminate with the grant's existing `principal_type`.\n",
6719
+ ),
6720
+ zod.null(),
6721
+ ])
6722
+ .optional()
6723
+ .describe(
6724
+ 'The principal named by `principal_id`, present only when the request\nasked for it with `expand: [\"principal\"]` (ADR 059). Absent means it\nwas not requested; `null` means the principal cannot be loaded\n(deleted or missing). GET and create never set this field.\n\nWhen present, the body is the same representation `GET \/users\/{id}`\nserves for `principal_type=user`, or `GET \/teams\/{id}` for\n`principal_type=team`. Discriminate with the grant\'s existing\n`principal_type`.\n\nRequires `user.read` and `team.read` in addition to `project.read`.\nBoth are checked on the whole request before the list.\n',
6049
6725
  ),
6050
6726
  })
6051
6727
  .describe("A collaboration grant binding a principal to a project relation.");
@@ -6160,12 +6836,12 @@ export const listEventsResponseDataItemOnesixOneProjectIdRegExp = new RegExp("^[
6160
6836
  export const listEventsResponseDataItemOnesevenOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6161
6837
  export const listEventsResponseDataItemOneeightOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6162
6838
  export const listEventsResponseDataItemOnenineOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6163
- export const listEventsResponseDataItemOnenineTwoPayloadStatusMin = 100;
6164
- export const listEventsResponseDataItemOnenineTwoPayloadStatusMax = 599;
6839
+ export const listEventsResponseDataItemTwozeroOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6840
+ export const listEventsResponseDataItemTwozeroTwoPayloadStatusMin = 100;
6841
+ export const listEventsResponseDataItemTwozeroTwoPayloadStatusMax = 599;
6165
6842
 
6166
- export const listEventsResponseDataItemOnenineTwoPayloadDurationMsMin = 0;
6843
+ export const listEventsResponseDataItemTwozeroTwoPayloadDurationMsMin = 0;
6167
6844
 
6168
- export const listEventsResponseDataItemTwozeroOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6169
6845
  export const listEventsResponseDataItemTwooneOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6170
6846
  export const listEventsResponseDataItemTwotwoOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6171
6847
  export const listEventsResponseDataItemTwothreeOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
@@ -6174,6 +6850,7 @@ export const listEventsResponseDataItemTwofiveOneProjectIdRegExp = new RegExp("^
6174
6850
  export const listEventsResponseDataItemTwosixOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6175
6851
  export const listEventsResponseDataItemTwosevenOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6176
6852
  export const listEventsResponseDataItemTwoeightOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6853
+ export const listEventsResponseDataItemTwonineOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
6177
6854
 
6178
6855
  export const ListEventsResponse = zod
6179
6856
  .object({
@@ -8023,6 +8700,115 @@ export const ListEventsResponse = zod
8023
8700
  .describe(
8024
8701
  "Shared wide-event envelope (ADR 048 \/ ADR 049). Concrete events are\n`allOf` this schema plus a `const` `event_type` and a typed `payload`.\n",
8025
8702
  )
8703
+ .and(
8704
+ zod.object({
8705
+ event_type: zod.literal("release.created"),
8706
+ payload: zod
8707
+ .object({
8708
+ content_hash: zod.string().optional(),
8709
+ message: zod.string().optional(),
8710
+ git_sha: zod.string().optional(),
8711
+ git_dirty: zod.boolean().optional(),
8712
+ pointers: zod
8713
+ .array(
8714
+ zod.object({
8715
+ kind: zod.string().optional(),
8716
+ handle: zod.string().optional(),
8717
+ revision_id: zod.string().optional(),
8718
+ }),
8719
+ )
8720
+ .optional(),
8721
+ })
8722
+ .describe(
8723
+ "Allowlisted fields for `release.created`. The release id is already the\nevent's `entity_id`; the pinned set is repeated here so the audit stream\nanswers what a release contained without reading the release itself.\n",
8724
+ ),
8725
+ }),
8726
+ )
8727
+ .describe("Wide event with event_type=release.created.\n"),
8728
+ zod
8729
+ .object({
8730
+ id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8731
+ project_id: zod.string().regex(listEventsResponseDataItemTwozeroOneProjectIdRegExp),
8732
+ team_id: zod
8733
+ .union([zod.string(), zod.null()])
8734
+ .optional()
8735
+ .describe("Emit-time team scope, when the actor operated under a team."),
8736
+ event_type: zod
8737
+ .string()
8738
+ .describe(
8739
+ "Semantic event name (dot-separated). Discriminator for the Event union —\nsee docs\/design\/api\/events-catalog.md.\n",
8740
+ ),
8741
+ category: zod
8742
+ .enum(["request", "auth", "session", "admin", "entity", "signal"])
8743
+ .describe("Wide-event category."),
8744
+ occurred_at: zod.iso
8745
+ .datetime({ offset: true })
8746
+ .describe("When the action happened (server\/storage clock, dialect-owned)."),
8747
+ created_at: zod.iso
8748
+ .datetime({ offset: true })
8749
+ .describe("When the row was inserted (server\/storage clock, dialect-owned)."),
8750
+ actor_id: zod
8751
+ .union([zod.string(), zod.null()])
8752
+ .optional()
8753
+ .describe("Who triggered the event."),
8754
+ actor_type: zod
8755
+ .union([zod.enum(["human", "service", "system", "agent"]), zod.null()])
8756
+ .optional()
8757
+ .describe("Actor kind."),
8758
+ entity_type: zod
8759
+ .union([zod.string(), zod.null()])
8760
+ .optional()
8761
+ .describe("Resource type affected."),
8762
+ entity_id: zod
8763
+ .union([zod.string(), zod.null()])
8764
+ .optional()
8765
+ .describe("Resource id affected."),
8766
+ client_id: zod.string().describe("Application or agent that produced the event."),
8767
+ token_id: zod
8768
+ .string()
8769
+ .optional()
8770
+ .describe("Token id present at emit time, when any."),
8771
+ delegation_type: zod
8772
+ .enum(["direct", "delegated", "pat_shared", "exchanged"])
8773
+ .optional()
8774
+ .describe("Delegation kind (omit when unset)."),
8775
+ delegation_id: zod.string().optional(),
8776
+ grantor: zod.string().optional(),
8777
+ fingerprint: zod.string().optional().describe("Device fingerprint correlation id."),
8778
+ request_id: zod
8779
+ .union([zod.string(), zod.null()])
8780
+ .optional()
8781
+ .describe("HTTP request correlation id."),
8782
+ session_id: zod
8783
+ .union([zod.string(), zod.null()])
8784
+ .optional()
8785
+ .describe("Session correlation id."),
8786
+ flow_id: zod
8787
+ .union([zod.string(), zod.null()])
8788
+ .optional()
8789
+ .describe("Login flow correlation id."),
8790
+ metadata: zod
8791
+ .object({
8792
+ client: zod
8793
+ .object({
8794
+ ip: zod
8795
+ .string()
8796
+ .optional()
8797
+ .describe("Client IP from the first X-Forwarded-For hop or RemoteAddr."),
8798
+ user_agent: zod.string().optional().describe("Observed User-Agent header."),
8799
+ origin: zod.string().optional().describe("Origin header when present."),
8800
+ })
8801
+ .optional()
8802
+ .describe("Observed HTTP requestor context on Path A request.api only."),
8803
+ })
8804
+ .optional()
8805
+ .describe(
8806
+ "Emit-time metadata, already redacted at write. Path A request.api may\nset client (ip, user_agent, origin) for SIEM join on request_id. Not a\nlive risk-evaluator input.\n",
8807
+ ),
8808
+ })
8809
+ .describe(
8810
+ "Shared wide-event envelope (ADR 048 \/ ADR 049). Concrete events are\n`allOf` this schema plus a `const` `event_type` and a typed `payload`.\n",
8811
+ )
8026
8812
  .and(
8027
8813
  zod.object({
8028
8814
  event_type: zod.literal("request.api"),
@@ -8035,11 +8821,11 @@ export const ListEventsResponse = zod
8035
8821
  route_template: zod.string(),
8036
8822
  status: zod
8037
8823
  .number()
8038
- .min(listEventsResponseDataItemOnenineTwoPayloadStatusMin)
8039
- .max(listEventsResponseDataItemOnenineTwoPayloadStatusMax),
8824
+ .min(listEventsResponseDataItemTwozeroTwoPayloadStatusMin)
8825
+ .max(listEventsResponseDataItemTwozeroTwoPayloadStatusMax),
8040
8826
  duration_ms: zod
8041
8827
  .number()
8042
- .min(listEventsResponseDataItemOnenineTwoPayloadDurationMsMin),
8828
+ .min(listEventsResponseDataItemTwozeroTwoPayloadDurationMsMin),
8043
8829
  })
8044
8830
  .describe("Payload for `request.api` events."),
8045
8831
  }),
@@ -8048,7 +8834,7 @@ export const ListEventsResponse = zod
8048
8834
  zod
8049
8835
  .object({
8050
8836
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8051
- project_id: zod.string().regex(listEventsResponseDataItemTwozeroOneProjectIdRegExp),
8837
+ project_id: zod.string().regex(listEventsResponseDataItemTwooneOneProjectIdRegExp),
8052
8838
  team_id: zod
8053
8839
  .union([zod.string(), zod.null()])
8054
8840
  .optional()
@@ -8156,7 +8942,7 @@ export const ListEventsResponse = zod
8156
8942
  zod
8157
8943
  .object({
8158
8944
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8159
- project_id: zod.string().regex(listEventsResponseDataItemTwooneOneProjectIdRegExp),
8945
+ project_id: zod.string().regex(listEventsResponseDataItemTwotwoOneProjectIdRegExp),
8160
8946
  team_id: zod
8161
8947
  .union([zod.string(), zod.null()])
8162
8948
  .optional()
@@ -8251,7 +9037,7 @@ export const ListEventsResponse = zod
8251
9037
  zod
8252
9038
  .object({
8253
9039
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8254
- project_id: zod.string().regex(listEventsResponseDataItemTwotwoOneProjectIdRegExp),
9040
+ project_id: zod.string().regex(listEventsResponseDataItemTwothreeOneProjectIdRegExp),
8255
9041
  team_id: zod
8256
9042
  .union([zod.string(), zod.null()])
8257
9043
  .optional()
@@ -8346,7 +9132,7 @@ export const ListEventsResponse = zod
8346
9132
  zod
8347
9133
  .object({
8348
9134
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8349
- project_id: zod.string().regex(listEventsResponseDataItemTwothreeOneProjectIdRegExp),
9135
+ project_id: zod.string().regex(listEventsResponseDataItemTwofourOneProjectIdRegExp),
8350
9136
  team_id: zod
8351
9137
  .union([zod.string(), zod.null()])
8352
9138
  .optional()
@@ -8443,7 +9229,7 @@ export const ListEventsResponse = zod
8443
9229
  zod
8444
9230
  .object({
8445
9231
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8446
- project_id: zod.string().regex(listEventsResponseDataItemTwofourOneProjectIdRegExp),
9232
+ project_id: zod.string().regex(listEventsResponseDataItemTwofiveOneProjectIdRegExp),
8447
9233
  team_id: zod
8448
9234
  .union([zod.string(), zod.null()])
8449
9235
  .optional()
@@ -8538,7 +9324,7 @@ export const ListEventsResponse = zod
8538
9324
  zod
8539
9325
  .object({
8540
9326
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8541
- project_id: zod.string().regex(listEventsResponseDataItemTwofiveOneProjectIdRegExp),
9327
+ project_id: zod.string().regex(listEventsResponseDataItemTwosixOneProjectIdRegExp),
8542
9328
  team_id: zod
8543
9329
  .union([zod.string(), zod.null()])
8544
9330
  .optional()
@@ -8635,7 +9421,7 @@ export const ListEventsResponse = zod
8635
9421
  zod
8636
9422
  .object({
8637
9423
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8638
- project_id: zod.string().regex(listEventsResponseDataItemTwosixOneProjectIdRegExp),
9424
+ project_id: zod.string().regex(listEventsResponseDataItemTwosevenOneProjectIdRegExp),
8639
9425
  team_id: zod
8640
9426
  .union([zod.string(), zod.null()])
8641
9427
  .optional()
@@ -8730,7 +9516,7 @@ export const ListEventsResponse = zod
8730
9516
  zod
8731
9517
  .object({
8732
9518
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8733
- project_id: zod.string().regex(listEventsResponseDataItemTwosevenOneProjectIdRegExp),
9519
+ project_id: zod.string().regex(listEventsResponseDataItemTwoeightOneProjectIdRegExp),
8734
9520
  team_id: zod
8735
9521
  .union([zod.string(), zod.null()])
8736
9522
  .optional()
@@ -8829,7 +9615,7 @@ export const ListEventsResponse = zod
8829
9615
  zod
8830
9616
  .object({
8831
9617
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
8832
- project_id: zod.string().regex(listEventsResponseDataItemTwoeightOneProjectIdRegExp),
9618
+ project_id: zod.string().regex(listEventsResponseDataItemTwonineOneProjectIdRegExp),
8833
9619
  team_id: zod
8834
9620
  .union([zod.string(), zod.null()])
8835
9621
  .optional()
@@ -8976,12 +9762,12 @@ export const getEventResponseOnesixOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_
8976
9762
  export const getEventResponseOnesevenOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8977
9763
  export const getEventResponseOneeightOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8978
9764
  export const getEventResponseOnenineOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8979
- export const getEventResponseOnenineTwoPayloadStatusMin = 100;
8980
- export const getEventResponseOnenineTwoPayloadStatusMax = 599;
9765
+ export const getEventResponseTwozeroOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
9766
+ export const getEventResponseTwozeroTwoPayloadStatusMin = 100;
9767
+ export const getEventResponseTwozeroTwoPayloadStatusMax = 599;
8981
9768
 
8982
- export const getEventResponseOnenineTwoPayloadDurationMsMin = 0;
9769
+ export const getEventResponseTwozeroTwoPayloadDurationMsMin = 0;
8983
9770
 
8984
- export const getEventResponseTwozeroOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8985
9771
  export const getEventResponseTwooneOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8986
9772
  export const getEventResponseTwotwoOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8987
9773
  export const getEventResponseTwothreeOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
@@ -8990,6 +9776,7 @@ export const getEventResponseTwofiveOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9
8990
9776
  export const getEventResponseTwosixOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8991
9777
  export const getEventResponseTwosevenOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8992
9778
  export const getEventResponseTwoeightOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
9779
+ export const getEventResponseTwonineOneProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
8993
9780
 
8994
9781
  export const GetEventResponse = zod
8995
9782
  .union([
@@ -10777,6 +11564,112 @@ export const GetEventResponse = zod
10777
11564
  .describe(
10778
11565
  "Shared wide-event envelope (ADR 048 \/ ADR 049). Concrete events are\n`allOf` this schema plus a `const` `event_type` and a typed `payload`.\n",
10779
11566
  )
11567
+ .and(
11568
+ zod.object({
11569
+ event_type: zod.literal("release.created"),
11570
+ payload: zod
11571
+ .object({
11572
+ content_hash: zod.string().optional(),
11573
+ message: zod.string().optional(),
11574
+ git_sha: zod.string().optional(),
11575
+ git_dirty: zod.boolean().optional(),
11576
+ pointers: zod
11577
+ .array(
11578
+ zod.object({
11579
+ kind: zod.string().optional(),
11580
+ handle: zod.string().optional(),
11581
+ revision_id: zod.string().optional(),
11582
+ }),
11583
+ )
11584
+ .optional(),
11585
+ })
11586
+ .describe(
11587
+ "Allowlisted fields for `release.created`. The release id is already the\nevent's `entity_id`; the pinned set is repeated here so the audit stream\nanswers what a release contained without reading the release itself.\n",
11588
+ ),
11589
+ }),
11590
+ )
11591
+ .describe("Wide event with event_type=release.created.\n"),
11592
+ zod
11593
+ .object({
11594
+ id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11595
+ project_id: zod.string().regex(getEventResponseTwozeroOneProjectIdRegExp),
11596
+ team_id: zod
11597
+ .union([zod.string(), zod.null()])
11598
+ .optional()
11599
+ .describe("Emit-time team scope, when the actor operated under a team."),
11600
+ event_type: zod
11601
+ .string()
11602
+ .describe(
11603
+ "Semantic event name (dot-separated). Discriminator for the Event union —\nsee docs\/design\/api\/events-catalog.md.\n",
11604
+ ),
11605
+ category: zod
11606
+ .enum(["request", "auth", "session", "admin", "entity", "signal"])
11607
+ .describe("Wide-event category."),
11608
+ occurred_at: zod.iso
11609
+ .datetime({ offset: true })
11610
+ .describe("When the action happened (server\/storage clock, dialect-owned)."),
11611
+ created_at: zod.iso
11612
+ .datetime({ offset: true })
11613
+ .describe("When the row was inserted (server\/storage clock, dialect-owned)."),
11614
+ actor_id: zod
11615
+ .union([zod.string(), zod.null()])
11616
+ .optional()
11617
+ .describe("Who triggered the event."),
11618
+ actor_type: zod
11619
+ .union([zod.enum(["human", "service", "system", "agent"]), zod.null()])
11620
+ .optional()
11621
+ .describe("Actor kind."),
11622
+ entity_type: zod
11623
+ .union([zod.string(), zod.null()])
11624
+ .optional()
11625
+ .describe("Resource type affected."),
11626
+ entity_id: zod
11627
+ .union([zod.string(), zod.null()])
11628
+ .optional()
11629
+ .describe("Resource id affected."),
11630
+ client_id: zod.string().describe("Application or agent that produced the event."),
11631
+ token_id: zod.string().optional().describe("Token id present at emit time, when any."),
11632
+ delegation_type: zod
11633
+ .enum(["direct", "delegated", "pat_shared", "exchanged"])
11634
+ .optional()
11635
+ .describe("Delegation kind (omit when unset)."),
11636
+ delegation_id: zod.string().optional(),
11637
+ grantor: zod.string().optional(),
11638
+ fingerprint: zod.string().optional().describe("Device fingerprint correlation id."),
11639
+ request_id: zod
11640
+ .union([zod.string(), zod.null()])
11641
+ .optional()
11642
+ .describe("HTTP request correlation id."),
11643
+ session_id: zod
11644
+ .union([zod.string(), zod.null()])
11645
+ .optional()
11646
+ .describe("Session correlation id."),
11647
+ flow_id: zod
11648
+ .union([zod.string(), zod.null()])
11649
+ .optional()
11650
+ .describe("Login flow correlation id."),
11651
+ metadata: zod
11652
+ .object({
11653
+ client: zod
11654
+ .object({
11655
+ ip: zod
11656
+ .string()
11657
+ .optional()
11658
+ .describe("Client IP from the first X-Forwarded-For hop or RemoteAddr."),
11659
+ user_agent: zod.string().optional().describe("Observed User-Agent header."),
11660
+ origin: zod.string().optional().describe("Origin header when present."),
11661
+ })
11662
+ .optional()
11663
+ .describe("Observed HTTP requestor context on Path A request.api only."),
11664
+ })
11665
+ .optional()
11666
+ .describe(
11667
+ "Emit-time metadata, already redacted at write. Path A request.api may\nset client (ip, user_agent, origin) for SIEM join on request_id. Not a\nlive risk-evaluator input.\n",
11668
+ ),
11669
+ })
11670
+ .describe(
11671
+ "Shared wide-event envelope (ADR 048 \/ ADR 049). Concrete events are\n`allOf` this schema plus a `const` `event_type` and a typed `payload`.\n",
11672
+ )
10780
11673
  .and(
10781
11674
  zod.object({
10782
11675
  event_type: zod.literal("request.api"),
@@ -10789,9 +11682,9 @@ export const GetEventResponse = zod
10789
11682
  route_template: zod.string(),
10790
11683
  status: zod
10791
11684
  .number()
10792
- .min(getEventResponseOnenineTwoPayloadStatusMin)
10793
- .max(getEventResponseOnenineTwoPayloadStatusMax),
10794
- duration_ms: zod.number().min(getEventResponseOnenineTwoPayloadDurationMsMin),
11685
+ .min(getEventResponseTwozeroTwoPayloadStatusMin)
11686
+ .max(getEventResponseTwozeroTwoPayloadStatusMax),
11687
+ duration_ms: zod.number().min(getEventResponseTwozeroTwoPayloadDurationMsMin),
10795
11688
  })
10796
11689
  .describe("Payload for `request.api` events."),
10797
11690
  }),
@@ -10800,7 +11693,7 @@ export const GetEventResponse = zod
10800
11693
  zod
10801
11694
  .object({
10802
11695
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
10803
- project_id: zod.string().regex(getEventResponseTwozeroOneProjectIdRegExp),
11696
+ project_id: zod.string().regex(getEventResponseTwooneOneProjectIdRegExp),
10804
11697
  team_id: zod
10805
11698
  .union([zod.string(), zod.null()])
10806
11699
  .optional()
@@ -10905,7 +11798,7 @@ export const GetEventResponse = zod
10905
11798
  zod
10906
11799
  .object({
10907
11800
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
10908
- project_id: zod.string().regex(getEventResponseTwooneOneProjectIdRegExp),
11801
+ project_id: zod.string().regex(getEventResponseTwotwoOneProjectIdRegExp),
10909
11802
  team_id: zod
10910
11803
  .union([zod.string(), zod.null()])
10911
11804
  .optional()
@@ -10997,7 +11890,7 @@ export const GetEventResponse = zod
10997
11890
  zod
10998
11891
  .object({
10999
11892
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11000
- project_id: zod.string().regex(getEventResponseTwotwoOneProjectIdRegExp),
11893
+ project_id: zod.string().regex(getEventResponseTwothreeOneProjectIdRegExp),
11001
11894
  team_id: zod
11002
11895
  .union([zod.string(), zod.null()])
11003
11896
  .optional()
@@ -11089,7 +11982,7 @@ export const GetEventResponse = zod
11089
11982
  zod
11090
11983
  .object({
11091
11984
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11092
- project_id: zod.string().regex(getEventResponseTwothreeOneProjectIdRegExp),
11985
+ project_id: zod.string().regex(getEventResponseTwofourOneProjectIdRegExp),
11093
11986
  team_id: zod
11094
11987
  .union([zod.string(), zod.null()])
11095
11988
  .optional()
@@ -11183,7 +12076,7 @@ export const GetEventResponse = zod
11183
12076
  zod
11184
12077
  .object({
11185
12078
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11186
- project_id: zod.string().regex(getEventResponseTwofourOneProjectIdRegExp),
12079
+ project_id: zod.string().regex(getEventResponseTwofiveOneProjectIdRegExp),
11187
12080
  team_id: zod
11188
12081
  .union([zod.string(), zod.null()])
11189
12082
  .optional()
@@ -11275,7 +12168,7 @@ export const GetEventResponse = zod
11275
12168
  zod
11276
12169
  .object({
11277
12170
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11278
- project_id: zod.string().regex(getEventResponseTwofiveOneProjectIdRegExp),
12171
+ project_id: zod.string().regex(getEventResponseTwosixOneProjectIdRegExp),
11279
12172
  team_id: zod
11280
12173
  .union([zod.string(), zod.null()])
11281
12174
  .optional()
@@ -11369,7 +12262,7 @@ export const GetEventResponse = zod
11369
12262
  zod
11370
12263
  .object({
11371
12264
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11372
- project_id: zod.string().regex(getEventResponseTwosixOneProjectIdRegExp),
12265
+ project_id: zod.string().regex(getEventResponseTwosevenOneProjectIdRegExp),
11373
12266
  team_id: zod
11374
12267
  .union([zod.string(), zod.null()])
11375
12268
  .optional()
@@ -11461,7 +12354,7 @@ export const GetEventResponse = zod
11461
12354
  zod
11462
12355
  .object({
11463
12356
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11464
- project_id: zod.string().regex(getEventResponseTwosevenOneProjectIdRegExp),
12357
+ project_id: zod.string().regex(getEventResponseTwoeightOneProjectIdRegExp),
11465
12358
  team_id: zod
11466
12359
  .union([zod.string(), zod.null()])
11467
12360
  .optional()
@@ -11557,7 +12450,7 @@ export const GetEventResponse = zod
11557
12450
  zod
11558
12451
  .object({
11559
12452
  id: zod.string().describe("Managed event id (`evt_<opaque>`)."),
11560
- project_id: zod.string().regex(getEventResponseTwoeightOneProjectIdRegExp),
12453
+ project_id: zod.string().regex(getEventResponseTwonineOneProjectIdRegExp),
11561
12454
  team_id: zod
11562
12455
  .union([zod.string(), zod.null()])
11563
12456
  .optional()