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

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 (34) hide show
  1. package/dist/generated/endpoints/zitadelNextGen.d.mts +1 -1
  2. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +1 -1
  3. package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
  4. package/dist/generated/endpoints/zitadelNextGen.msw.mjs +123 -40
  5. package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
  6. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +53 -24
  7. package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
  8. package/dist/generated/endpoints/zitadelNextGen.zod.mjs +38 -9
  9. package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
  10. package/dist/generated/model/index.d.mts +2 -2
  11. package/dist/{index-BpCgp2NY.d.mts → index-BK4Q468Q.d.mts} +289 -82
  12. package/dist/index-BK4Q468Q.d.mts.map +1 -0
  13. package/dist/runtime/api-factory.d.mts +1 -1
  14. package/dist/{zitadelNextGen-C4IZjGCT.d.mts → zitadelNextGen-C8m49W5h.d.mts} +2 -2
  15. package/dist/{zitadelNextGen-C4IZjGCT.d.mts.map → zitadelNextGen-C8m49W5h.d.mts.map} +1 -1
  16. package/package.json +1 -1
  17. package/src/generated/endpoints/zitadelNextGen.msw.ts +128 -30
  18. package/src/generated/endpoints/zitadelNextGen.zod.ts +152 -36
  19. package/src/generated/model/createSession201Session.ts +7 -16
  20. package/src/generated/model/createSession201SessionUser.ts +37 -0
  21. package/src/generated/model/createUser201.ts +18 -0
  22. package/src/generated/model/exchangeHandoff200Session.ts +7 -16
  23. package/src/generated/model/exchangeHandoff200SessionUser.ts +37 -0
  24. package/src/generated/model/getMySession200.ts +7 -16
  25. package/src/generated/model/getMySession200User.ts +37 -0
  26. package/src/generated/model/getMyUser200.ts +18 -0
  27. package/src/generated/model/getSession200.ts +7 -16
  28. package/src/generated/model/getSession200User.ts +37 -0
  29. package/src/generated/model/getUserByID200.ts +18 -0
  30. package/src/generated/model/index.ts +5 -0
  31. package/src/generated/model/querySessions200SessionsItem.ts +7 -16
  32. package/src/generated/model/querySessions200SessionsItemUser.ts +37 -0
  33. package/src/generated/model/queryUsers200UsersItem.ts +18 -0
  34. package/dist/index-BpCgp2NY.d.mts.map +0 -1
@@ -100,6 +100,18 @@ export const getCreateUserResponseMock = (
100
100
  undefined,
101
101
  ]),
102
102
  },
103
+ identifier: faker.helpers.arrayElement([
104
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
105
+ undefined,
106
+ ]),
107
+ identifier_property: faker.helpers.arrayElement([
108
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
109
+ undefined,
110
+ ]),
111
+ display: faker.helpers.arrayElement([
112
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
113
+ undefined,
114
+ ]),
103
115
  teams: faker.helpers.arrayElement([
104
116
  Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
105
117
  id: faker.string.alpha({ length: { min: 10, max: 20 } }),
@@ -148,6 +160,18 @@ export const getQueryUsersResponseMock = (
148
160
  undefined,
149
161
  ]),
150
162
  },
163
+ identifier: faker.helpers.arrayElement([
164
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
165
+ undefined,
166
+ ]),
167
+ identifier_property: faker.helpers.arrayElement([
168
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
169
+ undefined,
170
+ ]),
171
+ display: faker.helpers.arrayElement([
172
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
173
+ undefined,
174
+ ]),
151
175
  teams: faker.helpers.arrayElement([
152
176
  Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
153
177
  id: faker.string.alpha({ length: { min: 10, max: 20 } }),
@@ -200,6 +224,18 @@ export const getGetUserByIDResponseMock = (
200
224
  undefined,
201
225
  ]),
202
226
  },
227
+ identifier: faker.helpers.arrayElement([
228
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
229
+ undefined,
230
+ ]),
231
+ identifier_property: faker.helpers.arrayElement([
232
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
233
+ undefined,
234
+ ]),
235
+ display: faker.helpers.arrayElement([
236
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
237
+ undefined,
238
+ ]),
203
239
  teams: faker.helpers.arrayElement([
204
240
  Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
205
241
  id: faker.string.alpha({ length: { min: 10, max: 20 } }),
@@ -298,6 +334,18 @@ export const getGetMyUserResponseMock = (
298
334
  undefined,
299
335
  ]),
300
336
  },
337
+ identifier: faker.helpers.arrayElement([
338
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
339
+ undefined,
340
+ ]),
341
+ identifier_property: faker.helpers.arrayElement([
342
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
343
+ undefined,
344
+ ]),
345
+ display: faker.helpers.arrayElement([
346
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
347
+ undefined,
348
+ ]),
301
349
  teams: faker.helpers.arrayElement([
302
350
  Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(() => ({
303
351
  id: faker.string.alpha({ length: { min: 10, max: 20 } }),
@@ -1165,12 +1213,22 @@ export const getCreateSessionResponseMock = (
1165
1213
  faker.helpers.arrayElement([faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"), null]),
1166
1214
  undefined,
1167
1215
  ]),
1168
- name: faker.helpers.arrayElement([
1169
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1170
- undefined,
1171
- ]),
1172
- email: faker.helpers.arrayElement([
1173
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1216
+ user: faker.helpers.arrayElement([
1217
+ {
1218
+ user_id: faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"),
1219
+ identifier: faker.helpers.arrayElement([
1220
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1221
+ undefined,
1222
+ ]),
1223
+ identifier_property: faker.helpers.arrayElement([
1224
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1225
+ undefined,
1226
+ ]),
1227
+ display: faker.helpers.arrayElement([
1228
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1229
+ undefined,
1230
+ ]),
1231
+ },
1174
1232
  undefined,
1175
1233
  ]),
1176
1234
  factors: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
@@ -1237,12 +1295,22 @@ export const getQuerySessionsResponseMock = (
1237
1295
  faker.helpers.arrayElement([faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"), null]),
1238
1296
  undefined,
1239
1297
  ]),
1240
- name: faker.helpers.arrayElement([
1241
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1242
- undefined,
1243
- ]),
1244
- email: faker.helpers.arrayElement([
1245
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1298
+ user: faker.helpers.arrayElement([
1299
+ {
1300
+ user_id: faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"),
1301
+ identifier: faker.helpers.arrayElement([
1302
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1303
+ undefined,
1304
+ ]),
1305
+ identifier_property: faker.helpers.arrayElement([
1306
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1307
+ undefined,
1308
+ ]),
1309
+ display: faker.helpers.arrayElement([
1310
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1311
+ undefined,
1312
+ ]),
1313
+ },
1246
1314
  undefined,
1247
1315
  ]),
1248
1316
  factors: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
@@ -1312,12 +1380,22 @@ export const getExchangeHandoffResponseMock = (
1312
1380
  faker.helpers.arrayElement([faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"), null]),
1313
1381
  undefined,
1314
1382
  ]),
1315
- name: faker.helpers.arrayElement([
1316
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1317
- undefined,
1318
- ]),
1319
- email: faker.helpers.arrayElement([
1320
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1383
+ user: faker.helpers.arrayElement([
1384
+ {
1385
+ user_id: faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"),
1386
+ identifier: faker.helpers.arrayElement([
1387
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1388
+ undefined,
1389
+ ]),
1390
+ identifier_property: faker.helpers.arrayElement([
1391
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1392
+ undefined,
1393
+ ]),
1394
+ display: faker.helpers.arrayElement([
1395
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1396
+ undefined,
1397
+ ]),
1398
+ },
1321
1399
  undefined,
1322
1400
  ]),
1323
1401
  factors: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
@@ -1382,12 +1460,22 @@ export const getGetSessionResponseMock = (
1382
1460
  faker.helpers.arrayElement([faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"), null]),
1383
1461
  undefined,
1384
1462
  ]),
1385
- name: faker.helpers.arrayElement([
1386
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1387
- undefined,
1388
- ]),
1389
- email: faker.helpers.arrayElement([
1390
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1463
+ user: faker.helpers.arrayElement([
1464
+ {
1465
+ user_id: faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"),
1466
+ identifier: faker.helpers.arrayElement([
1467
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1468
+ undefined,
1469
+ ]),
1470
+ identifier_property: faker.helpers.arrayElement([
1471
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1472
+ undefined,
1473
+ ]),
1474
+ display: faker.helpers.arrayElement([
1475
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1476
+ undefined,
1477
+ ]),
1478
+ },
1391
1479
  undefined,
1392
1480
  ]),
1393
1481
  factors: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
@@ -1450,12 +1538,22 @@ export const getGetMySessionResponseMock = (
1450
1538
  faker.helpers.arrayElement([faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"), null]),
1451
1539
  undefined,
1452
1540
  ]),
1453
- name: faker.helpers.arrayElement([
1454
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1455
- undefined,
1456
- ]),
1457
- email: faker.helpers.arrayElement([
1458
- faker.string.alpha({ length: { min: 10, max: 20 } }),
1541
+ user: faker.helpers.arrayElement([
1542
+ {
1543
+ user_id: faker.helpers.fromRegExp("^user_[a-zA-Z0-9_-]+$"),
1544
+ identifier: faker.helpers.arrayElement([
1545
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1546
+ undefined,
1547
+ ]),
1548
+ identifier_property: faker.helpers.arrayElement([
1549
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1550
+ undefined,
1551
+ ]),
1552
+ display: faker.helpers.arrayElement([
1553
+ faker.string.alpha({ length: { min: 10, max: 20 } }),
1554
+ undefined,
1555
+ ]),
1556
+ },
1459
1557
  undefined,
1460
1558
  ]),
1461
1559
  factors: Array.from({ length: faker.number.int({ min: 1, max: 10 }) }, (_, i) => i + 1).map(
@@ -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
@@ -2394,6 +2448,9 @@ export const QuerySessionsBody = zod
2394
2448
  export const querySessionsResponseSessionsItemSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2395
2449
  export const querySessionsResponseSessionsItemProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2396
2450
  export const querySessionsResponseSessionsItemUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2451
+ export const querySessionsResponseSessionsItemUserUserIdRegExp = new RegExp(
2452
+ "^user_[a-zA-Z0-9_-]+$",
2453
+ );
2397
2454
  export const querySessionsResponseSessionsItemFactorsItemPayloadOneUserIdRegExp = new RegExp(
2398
2455
  "^user_[a-zA-Z0-9_-]+$",
2399
2456
  );
@@ -2424,17 +2481,31 @@ export const QuerySessionsResponse = zod
2424
2481
  .describe(
2425
2482
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2426
2483
  ),
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()
2484
+ user: zod
2485
+ .object({
2486
+ user_id: zod.string().regex(querySessionsResponseSessionsItemUserUserIdRegExp),
2487
+ identifier: zod
2488
+ .string()
2489
+ .optional()
2490
+ .describe(
2491
+ "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",
2492
+ ),
2493
+ identifier_property: zod
2494
+ .string()
2495
+ .optional()
2496
+ .describe(
2497
+ "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",
2498
+ ),
2499
+ display: zod
2500
+ .string()
2501
+ .optional()
2502
+ .describe(
2503
+ "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",
2504
+ ),
2505
+ })
2435
2506
  .optional()
2436
2507
  .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",
2508
+ "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`.\n",
2438
2509
  ),
2439
2510
  factors: zod
2440
2511
  .array(
@@ -2601,6 +2672,7 @@ export const ExchangeHandoffBody = zod
2601
2672
  export const exchangeHandoffResponseSessionSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2602
2673
  export const exchangeHandoffResponseSessionProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2603
2674
  export const exchangeHandoffResponseSessionUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2675
+ export const exchangeHandoffResponseSessionUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2604
2676
  export const exchangeHandoffResponseSessionFactorsItemPayloadOneUserIdRegExp = new RegExp(
2605
2677
  "^user_[a-zA-Z0-9_-]+$",
2606
2678
  );
@@ -2625,17 +2697,31 @@ export const ExchangeHandoffResponse = zod
2625
2697
  .describe(
2626
2698
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2627
2699
  ),
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()
2700
+ user: zod
2701
+ .object({
2702
+ user_id: zod.string().regex(exchangeHandoffResponseSessionUserUserIdRegExp),
2703
+ identifier: zod
2704
+ .string()
2705
+ .optional()
2706
+ .describe(
2707
+ "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",
2708
+ ),
2709
+ identifier_property: zod
2710
+ .string()
2711
+ .optional()
2712
+ .describe(
2713
+ "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",
2714
+ ),
2715
+ display: zod
2716
+ .string()
2717
+ .optional()
2718
+ .describe(
2719
+ "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",
2720
+ ),
2721
+ })
2636
2722
  .optional()
2637
2723
  .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",
2724
+ "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`.\n",
2639
2725
  ),
2640
2726
  factors: zod
2641
2727
  .array(
@@ -2758,6 +2844,7 @@ export const GetSessionParams = zod.object({
2758
2844
  export const getSessionResponseSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2759
2845
  export const getSessionResponseProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2760
2846
  export const getSessionResponseUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2847
+ export const getSessionResponseUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2761
2848
  export const getSessionResponseFactorsItemPayloadOneUserIdRegExp = new RegExp(
2762
2849
  "^user_[a-zA-Z0-9_-]+$",
2763
2850
  );
@@ -2780,17 +2867,31 @@ export const GetSessionResponse = zod
2780
2867
  .describe(
2781
2868
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2782
2869
  ),
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()
2870
+ user: zod
2871
+ .object({
2872
+ user_id: zod.string().regex(getSessionResponseUserUserIdRegExp),
2873
+ identifier: zod
2874
+ .string()
2875
+ .optional()
2876
+ .describe(
2877
+ "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",
2878
+ ),
2879
+ identifier_property: zod
2880
+ .string()
2881
+ .optional()
2882
+ .describe(
2883
+ "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",
2884
+ ),
2885
+ display: zod
2886
+ .string()
2887
+ .optional()
2888
+ .describe(
2889
+ "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",
2890
+ ),
2891
+ })
2791
2892
  .optional()
2792
2893
  .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",
2894
+ "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`.\n",
2794
2895
  ),
2795
2896
  factors: zod
2796
2897
  .array(
@@ -2917,6 +3018,7 @@ against the same `session_id`) to restore a dropped assurance level.
2917
3018
  export const getMySessionResponseSessionIdRegExp = new RegExp("^sess_[a-zA-Z0-9_-]+$");
2918
3019
  export const getMySessionResponseProjectIdRegExp = new RegExp("^[a-zA-Z0-9_-]+$");
2919
3020
  export const getMySessionResponseUserIdOneRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
3021
+ export const getMySessionResponseUserUserIdRegExp = new RegExp("^user_[a-zA-Z0-9_-]+$");
2920
3022
  export const getMySessionResponseFactorsItemPayloadOneUserIdRegExp = new RegExp(
2921
3023
  "^user_[a-zA-Z0-9_-]+$",
2922
3024
  );
@@ -2939,17 +3041,31 @@ export const GetMySessionResponse = zod
2939
3041
  .describe(
2940
3042
  "The authenticated user. Null for anonymous sessions and until the `user`\nfactor has been verified through an `auth_attempt`.\n",
2941
3043
  ),
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()
3044
+ user: zod
3045
+ .object({
3046
+ user_id: zod.string().regex(getMySessionResponseUserUserIdRegExp),
3047
+ identifier: zod
3048
+ .string()
3049
+ .optional()
3050
+ .describe(
3051
+ "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",
3052
+ ),
3053
+ identifier_property: zod
3054
+ .string()
3055
+ .optional()
3056
+ .describe(
3057
+ "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",
3058
+ ),
3059
+ display: zod
3060
+ .string()
3061
+ .optional()
3062
+ .describe(
3063
+ "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",
3064
+ ),
3065
+ })
2950
3066
  .optional()
2951
3067
  .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",
3068
+ "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`.\n",
2953
3069
  ),
2954
3070
  factors: zod
2955
3071
  .array(
@@ -8,6 +8,7 @@
8
8
  import type { CreateSession201SessionFactorsItem } from "./createSession201SessionFactorsItem";
9
9
  import type { CreateSession201SessionMetadata } from "./createSession201SessionMetadata";
10
10
  import type { CreateSession201SessionState } from "./createSession201SessionState";
11
+ import type { CreateSession201SessionUser } from "./createSession201SessionUser";
11
12
  import type { CreateSession201SessionUserAgent } from "./createSession201SessionUserAgent";
12
13
 
13
14
  /**
@@ -37,23 +38,13 @@ export type CreateSession201Session = {
37
38
  factor has been verified through an `auth_attempt`.
38
39
  */
39
40
  user_id?: string | null;
40
- /** Human-readable name of the authenticated user, resolved from the
41
- conventional user-schema properties: `name` when defined, otherwise
42
- the given and family name parts joined `givenName`/`familyName`
43
- (the shipped presets' spelling) or `given_name`/`family_name`. Only
44
- present on reads that hydrate the user's identity
45
- (`GET /sessions/me`) and only when the session has an authenticated
46
- user whose schema carries those properties; clients fall back to
47
- `email`, then `user_id`.
41
+ /** A resolved reference to a user (ADR 058 §3). Fields are role-named, not
42
+ property-named, so responses can mix users from different schemas.
43
+ `identifier` and `display` are resolved independently from the user
44
+ schema's `x-identifier` and `x-display` designations, live at read time.
45
+ Clients render `display`, falling back to `identifier`, then `user_id`.
48
46
  */
49
- name?: string;
50
- /** Email address of the authenticated user, resolved from the
51
- conventional `email` user-schema property. Only present on reads
52
- that hydrate the user's identity (`GET /sessions/me`) and only when
53
- the session has an authenticated user whose schema carries that
54
- property.
55
- */
56
- email?: string;
47
+ user?: CreateSession201SessionUser;
57
48
  /** Verified authentication factors accumulated by this session.
58
49
  Each key is a factor type (e.g. `password`, `totp`, `passkey`).
59
50
  Each value is a factor event object with at least `verified_at` and
@@ -0,0 +1,37 @@
1
+ /**
2
+ * Generated by orval v8.10.0 🍺
3
+ * Do not edit manually.
4
+ * Zitadel NextGen
5
+ * This is the next generation of the Zitadel identity platform.
6
+ * OpenAPI spec version: 0.0.1
7
+ */
8
+
9
+ /**
10
+ * A resolved reference to a user (ADR 058 §3). Fields are role-named, not
11
+ property-named, so responses can mix users from different schemas.
12
+ `identifier` and `display` are resolved independently from the user
13
+ schema's `x-identifier` and `x-display` designations, live at read time.
14
+ Clients render `display`, falling back to `identifier`, then `user_id`.
15
+
16
+ */
17
+ export type CreateSession201SessionUser = {
18
+ /** @pattern ^user_[a-zA-Z0-9_-]+$ */
19
+ user_id: string;
20
+ /** The current value of the schema's designated identifier
21
+ (`x-identifier`). Absent when the schema designates no identifier or
22
+ the user carries no value for it.
23
+ */
24
+ identifier?: string;
25
+ /** The schema property `identifier` came from, so clients can reach the
26
+ property's schema for semantics (a mailto link, a field label)
27
+ instead of guessing from the value. Present exactly when
28
+ `identifier` is.
29
+ */
30
+ identifier_property?: string;
31
+ /** The `x-display` rendering — the designated properties' values joined
32
+ in list order. Purely presentational, with no source attribution.
33
+ Absent when the schema designates no display properties or the user
34
+ carries no values for them.
35
+ */
36
+ display?: string;
37
+ };
@@ -36,6 +36,24 @@ export type CreateUser201 = {
36
36
  */
37
37
  attributes: CreateUser201Attributes;
38
38
  metadata: CreateUser201Metadata;
39
+ /** The current value of the user schema's designated identifier
40
+ (`x-identifier`), resolved live at read time. Absent when the schema
41
+ designates no identifier or the user carries no value for it.
42
+ */
43
+ readonly identifier?: string;
44
+ /** The schema property `identifier` came from, so clients can reach the
45
+ property's schema for semantics (a mailto link, a field label)
46
+ instead of guessing from the value. Present exactly when
47
+ `identifier` is.
48
+ */
49
+ readonly identifier_property?: string;
50
+ /** The `x-display` rendering — the designated properties' values joined
51
+ in list order, resolved live at read time. Purely presentational.
52
+ Absent when the schema designates no display properties or the user
53
+ carries no values for them. Clients render `display`, falling back
54
+ to `identifier`, then `id`.
55
+ */
56
+ readonly display?: string;
39
57
  /** The user's team memberships, present only when the request asked for them with
40
58
  `expand: ["teams"]` (ADR 059). Absent means it was not requested; `[]`
41
59
  means the user has none.
@@ -8,6 +8,7 @@
8
8
  import type { ExchangeHandoff200SessionFactorsItem } from "./exchangeHandoff200SessionFactorsItem";
9
9
  import type { ExchangeHandoff200SessionMetadata } from "./exchangeHandoff200SessionMetadata";
10
10
  import type { ExchangeHandoff200SessionState } from "./exchangeHandoff200SessionState";
11
+ import type { ExchangeHandoff200SessionUser } from "./exchangeHandoff200SessionUser";
11
12
  import type { ExchangeHandoff200SessionUserAgent } from "./exchangeHandoff200SessionUserAgent";
12
13
 
13
14
  /**
@@ -37,23 +38,13 @@ export type ExchangeHandoff200Session = {
37
38
  factor has been verified through an `auth_attempt`.
38
39
  */
39
40
  user_id?: string | null;
40
- /** Human-readable name of the authenticated user, resolved from the
41
- conventional user-schema properties: `name` when defined, otherwise
42
- the given and family name parts joined `givenName`/`familyName`
43
- (the shipped presets' spelling) or `given_name`/`family_name`. Only
44
- present on reads that hydrate the user's identity
45
- (`GET /sessions/me`) and only when the session has an authenticated
46
- user whose schema carries those properties; clients fall back to
47
- `email`, then `user_id`.
41
+ /** A resolved reference to a user (ADR 058 §3). Fields are role-named, not
42
+ property-named, so responses can mix users from different schemas.
43
+ `identifier` and `display` are resolved independently from the user
44
+ schema's `x-identifier` and `x-display` designations, live at read time.
45
+ Clients render `display`, falling back to `identifier`, then `user_id`.
48
46
  */
49
- name?: string;
50
- /** Email address of the authenticated user, resolved from the
51
- conventional `email` user-schema property. Only present on reads
52
- that hydrate the user's identity (`GET /sessions/me`) and only when
53
- the session has an authenticated user whose schema carries that
54
- property.
55
- */
56
- email?: string;
47
+ user?: ExchangeHandoff200SessionUser;
57
48
  /** Verified authentication factors accumulated by this session.
58
49
  Each key is a factor type (e.g. `password`, `totp`, `passkey`).
59
50
  Each value is a factor event object with at least `verified_at` and