@zitadel/testing 0.1.0-alpha.18 → 0.1.0-alpha.19

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.
@@ -161,12 +161,14 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
161
161
  getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
162
162
  getDeleteTeamUrl: () => getDeleteTeamUrl,
163
163
  getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
164
+ getEvent: () => getEvent,
164
165
  getExchangeHandoffUrl: () => getExchangeHandoffUrl,
165
166
  getFlowDefinition: () => getFlowDefinition,
166
167
  getFlowStep: () => getFlowStep,
167
168
  getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
168
169
  getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
169
170
  getGetClaimStatusUrl: () => getGetClaimStatusUrl,
171
+ getGetEventUrl: () => getGetEventUrl,
170
172
  getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
171
173
  getGetFlowStepUrl: () => getGetFlowStepUrl,
172
174
  getGetHealthUrl: () => getGetHealthUrl,
@@ -183,6 +185,7 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
183
185
  getInitClaimUrl: () => getInitClaimUrl,
184
186
  getIssueChallengeUrl: () => getIssueChallengeUrl,
185
187
  getListBrandingUrl: () => getListBrandingUrl,
188
+ getListEventsUrl: () => getListEventsUrl,
186
189
  getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
187
190
  getListSchemasUrl: () => getListSchemasUrl,
188
191
  getListUserPasskeysUrl: () => getListUserPasskeysUrl,
@@ -211,6 +214,7 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
211
214
  initClaim: () => initClaim,
212
215
  issueChallenge: () => issueChallenge,
213
216
  listBranding: () => listBranding,
217
+ listEvents: () => listEvents,
214
218
  listFlowDefinitions: () => listFlowDefinitions,
215
219
  listSchemas: () => listSchemas,
216
220
  listUserPasskeys: () => listUserPasskeys,
@@ -323,19 +327,14 @@ const getUserByID = async (userId, params, options) => {
323
327
  method: "GET"
324
328
  });
325
329
  };
326
- const getDeleteUserByIDUrl = (userId, params) => {
327
- const normalizedParams = new URLSearchParams();
328
- Object.entries(params || {}).forEach(([key, value]) => {
329
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
330
- });
331
- const stringifiedParams = normalizedParams.toString();
332
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;
330
+ const getDeleteUserByIDUrl = (userId) => {
331
+ return `${getProxyPath()}/users/${userId}`;
333
332
  };
334
333
  /**
335
334
  * @summary Delete user by ID
336
335
  */
337
- const deleteUserByID = async (userId, params, options) => {
338
- return customFetch(getDeleteUserByIDUrl(userId, params), {
336
+ const deleteUserByID = async (userId, options) => {
337
+ return customFetch(getDeleteUserByIDUrl(userId), {
339
338
  ...options,
340
339
  method: "DELETE"
341
340
  });
@@ -357,19 +356,14 @@ const listUserPasskeys = async (userId, params, options) => {
357
356
  method: "GET"
358
357
  });
359
358
  };
360
- const getSetUserPasswordUrl = (userId, params) => {
361
- const normalizedParams = new URLSearchParams();
362
- Object.entries(params || {}).forEach(([key, value]) => {
363
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
364
- });
365
- const stringifiedParams = normalizedParams.toString();
366
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/password?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/password`;
359
+ const getSetUserPasswordUrl = (userId) => {
360
+ return `${getProxyPath()}/users/${userId}/password`;
367
361
  };
368
362
  /**
369
363
  * @summary Set user password
370
364
  */
371
- const setUserPassword = async (userId, setUserPasswordBody, params, options) => {
372
- return customFetch(getSetUserPasswordUrl(userId, params), {
365
+ const setUserPassword = async (userId, setUserPasswordBody, options) => {
366
+ return customFetch(getSetUserPasswordUrl(userId), {
373
367
  ...options,
374
368
  method: "PUT",
375
369
  headers: {
@@ -859,13 +853,8 @@ const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
859
853
  body: JSON.stringify(exchangeHandoffBody)
860
854
  });
861
855
  };
862
- const getGetSessionUrl = (sessionId, params) => {
863
- const normalizedParams = new URLSearchParams();
864
- Object.entries(params || {}).forEach(([key, value]) => {
865
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
866
- });
867
- const stringifiedParams = normalizedParams.toString();
868
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
856
+ const getGetSessionUrl = (sessionId) => {
857
+ return `${getProxyPath()}/sessions/${sessionId}`;
869
858
  };
870
859
  /**
871
860
  * Returns the current state of a session including its factors and all currently
@@ -877,19 +866,14 @@ against the same `session_id`) to restore a dropped assurance level.
877
866
 
878
867
  * @summary Get session state
879
868
  */
880
- const getSession = async (sessionId, params, options) => {
881
- return customFetch(getGetSessionUrl(sessionId, params), {
869
+ const getSession = async (sessionId, options) => {
870
+ return customFetch(getGetSessionUrl(sessionId), {
882
871
  ...options,
883
872
  method: "GET"
884
873
  });
885
874
  };
886
- const getRevokeSessionUrl = (sessionId, params) => {
887
- const normalizedParams = new URLSearchParams();
888
- Object.entries(params || {}).forEach(([key, value]) => {
889
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
890
- });
891
- const stringifiedParams = normalizedParams.toString();
892
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
875
+ const getRevokeSessionUrl = (sessionId) => {
876
+ return `${getProxyPath()}/sessions/${sessionId}`;
893
877
  };
894
878
  /**
895
879
  * Permanently deletes the session, terminating it immediately.
@@ -904,8 +888,8 @@ invalidated.
904
888
 
905
889
  * @summary Revoke session
906
890
  */
907
- const revokeSession = async (sessionId, params, options) => {
908
- return customFetch(getRevokeSessionUrl(sessionId, params), {
891
+ const revokeSession = async (sessionId, options) => {
892
+ return customFetch(getRevokeSessionUrl(sessionId), {
909
893
  ...options,
910
894
  method: "DELETE"
911
895
  });
@@ -1061,31 +1045,21 @@ const listFlowDefinitions = async (params, options) => {
1061
1045
  method: "GET"
1062
1046
  });
1063
1047
  };
1064
- const getGetFlowDefinitionUrl = (id, params) => {
1065
- const normalizedParams = new URLSearchParams();
1066
- Object.entries(params || {}).forEach(([key, value]) => {
1067
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1068
- });
1069
- const stringifiedParams = normalizedParams.toString();
1070
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1048
+ const getGetFlowDefinitionUrl = (id) => {
1049
+ return `${getProxyPath()}/flow_definitions/${id}`;
1071
1050
  };
1072
1051
  /**
1073
1052
  * Get a flow definition by id
1074
1053
  * @summary Get a flow definition by id
1075
1054
  */
1076
- const getFlowDefinition = async (id, params, options) => {
1077
- return customFetch(getGetFlowDefinitionUrl(id, params), {
1055
+ const getFlowDefinition = async (id, options) => {
1056
+ return customFetch(getGetFlowDefinitionUrl(id), {
1078
1057
  ...options,
1079
1058
  method: "GET"
1080
1059
  });
1081
1060
  };
1082
- const getUpdateFlowDefinitionUrl = (id, params) => {
1083
- const normalizedParams = new URLSearchParams();
1084
- Object.entries(params || {}).forEach(([key, value]) => {
1085
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1086
- });
1087
- const stringifiedParams = normalizedParams.toString();
1088
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1061
+ const getUpdateFlowDefinitionUrl = (id) => {
1062
+ return `${getProxyPath()}/flow_definitions/${id}`;
1089
1063
  };
1090
1064
  /**
1091
1065
  * Update a flow definition by id. This endpoint replaces the existing flow definition.
@@ -1093,8 +1067,8 @@ If `flow_definition.status` is omitted, the current status is preserved
1093
1067
 
1094
1068
  * @summary Update a flow definition by id
1095
1069
  */
1096
- const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, options) => {
1097
- return customFetch(getUpdateFlowDefinitionUrl(id, params), {
1070
+ const updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {
1071
+ return customFetch(getUpdateFlowDefinitionUrl(id), {
1098
1072
  ...options,
1099
1073
  method: "PUT",
1100
1074
  headers: {
@@ -1104,13 +1078,8 @@ const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, option
1104
1078
  body: JSON.stringify(updateFlowDefinitionBody)
1105
1079
  });
1106
1080
  };
1107
- const getDeleteFlowDefinitionUrl = (id, params) => {
1108
- const normalizedParams = new URLSearchParams();
1109
- Object.entries(params || {}).forEach(([key, value]) => {
1110
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1111
- });
1112
- const stringifiedParams = normalizedParams.toString();
1113
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1081
+ const getDeleteFlowDefinitionUrl = (id) => {
1082
+ return `${getProxyPath()}/flow_definitions/${id}`;
1114
1083
  };
1115
1084
  /**
1116
1085
  * Delete a flow definition by id.
@@ -1119,8 +1088,8 @@ If the flow definition is the last active flow definition for a given purpose, t
1119
1088
 
1120
1089
  * @summary Delete a flow definition by id
1121
1090
  */
1122
- const deleteFlowDefinition = async (id, params, options) => {
1123
- return customFetch(getDeleteFlowDefinitionUrl(id, params), {
1091
+ const deleteFlowDefinition = async (id, options) => {
1092
+ return customFetch(getDeleteFlowDefinitionUrl(id), {
1124
1093
  ...options,
1125
1094
  method: "DELETE"
1126
1095
  });
@@ -1157,7 +1126,6 @@ const getQueryTeamsUrl = (params) => {
1157
1126
  };
1158
1127
  /**
1159
1128
  * Returns the teams of a project, paginated with a cursor.
1160
- Teams of every lifecycle status are returned; each carries its `status`.
1161
1129
 
1162
1130
  * @summary Query teams
1163
1131
  */
@@ -1172,32 +1140,22 @@ const queryTeams = async (queryTeamsBody, params, options) => {
1172
1140
  body: JSON.stringify(queryTeamsBody)
1173
1141
  });
1174
1142
  };
1175
- const getGetTeamUrl = (teamId, params) => {
1176
- const normalizedParams = new URLSearchParams();
1177
- Object.entries(params || {}).forEach(([key, value]) => {
1178
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1179
- });
1180
- const stringifiedParams = normalizedParams.toString();
1181
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
1143
+ const getGetTeamUrl = (teamId) => {
1144
+ return `${getProxyPath()}/teams/${teamId}`;
1182
1145
  };
1183
1146
  /**
1184
1147
  * Returns a Team by its id.
1185
1148
 
1186
1149
  * @summary Get team
1187
1150
  */
1188
- const getTeam = async (teamId, params, options) => {
1189
- return customFetch(getGetTeamUrl(teamId, params), {
1151
+ const getTeam = async (teamId, options) => {
1152
+ return customFetch(getGetTeamUrl(teamId), {
1190
1153
  ...options,
1191
1154
  method: "GET"
1192
1155
  });
1193
1156
  };
1194
- const getDeleteTeamUrl = (teamId, params) => {
1195
- const normalizedParams = new URLSearchParams();
1196
- Object.entries(params || {}).forEach(([key, value]) => {
1197
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1198
- });
1199
- const stringifiedParams = normalizedParams.toString();
1200
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
1157
+ const getDeleteTeamUrl = (teamId) => {
1158
+ return `${getProxyPath()}/teams/${teamId}`;
1201
1159
  };
1202
1160
  /**
1203
1161
  * Deactivates the team.
@@ -1211,27 +1169,22 @@ or doesn't exist succeeds without changing anything.
1211
1169
 
1212
1170
  * @summary Delete team
1213
1171
  */
1214
- const deleteTeam = async (teamId, params, options) => {
1215
- return customFetch(getDeleteTeamUrl(teamId, params), {
1172
+ const deleteTeam = async (teamId, options) => {
1173
+ return customFetch(getDeleteTeamUrl(teamId), {
1216
1174
  ...options,
1217
1175
  method: "DELETE"
1218
1176
  });
1219
1177
  };
1220
- const getUpdateTeamUrl = (teamId, params) => {
1221
- const normalizedParams = new URLSearchParams();
1222
- Object.entries(params || {}).forEach(([key, value]) => {
1223
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1224
- });
1225
- const stringifiedParams = normalizedParams.toString();
1226
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
1178
+ const getUpdateTeamUrl = (teamId) => {
1179
+ return `${getProxyPath()}/teams/${teamId}`;
1227
1180
  };
1228
1181
  /**
1229
1182
  * Update team. Only active teams can be updated.
1230
1183
 
1231
1184
  * @summary Update team
1232
1185
  */
1233
- const updateTeam = async (teamId, updateTeamBody, params, options) => {
1234
- return customFetch(getUpdateTeamUrl(teamId, params), {
1186
+ const updateTeam = async (teamId, updateTeamBody, options) => {
1187
+ return customFetch(getUpdateTeamUrl(teamId), {
1235
1188
  ...options,
1236
1189
  method: "PATCH",
1237
1190
  headers: {
@@ -1296,20 +1249,73 @@ const listBranding = async (params, options) => {
1296
1249
  method: "GET"
1297
1250
  });
1298
1251
  };
1299
- const getGetBrandingByIdUrl = (id, params) => {
1252
+ const getGetBrandingByIdUrl = (id) => {
1253
+ return `${getProxyPath()}/branding/${id}`;
1254
+ };
1255
+ /**
1256
+ * Retrieves a single branding revision, including its stored configuration.
1257
+ * @summary Get a branding revision by ID
1258
+ */
1259
+ const getBrandingById = async (id, options) => {
1260
+ return customFetch(getGetBrandingByIdUrl(id), {
1261
+ ...options,
1262
+ method: "GET"
1263
+ });
1264
+ };
1265
+ const getListEventsUrl = (params) => {
1300
1266
  const normalizedParams = new URLSearchParams();
1301
1267
  Object.entries(params || {}).forEach(([key, value]) => {
1268
+ if (Array.isArray(value) && ["category", "event_type"].includes(key)) {
1269
+ value.forEach((v) => {
1270
+ normalizedParams.append(key, v === null ? "null" : v.toString());
1271
+ });
1272
+ return;
1273
+ }
1302
1274
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1303
1275
  });
1304
1276
  const stringifiedParams = normalizedParams.toString();
1305
- return stringifiedParams.length > 0 ? `${getProxyPath()}/branding/${id}?${stringifiedParams}` : `${getProxyPath()}/branding/${id}`;
1277
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/events?${stringifiedParams}` : `${getProxyPath()}/events`;
1306
1278
  };
1307
1279
  /**
1308
- * Retrieves a single branding revision, including its stored configuration.
1309
- * @summary Get a branding revision by ID
1280
+ * Returns project-scoped audit events, newest-first by keyset on
1281
+ `(created_at, id)` (ADR 027 / ADR 049). Pass `order=asc` for oldest-first.
1282
+ Requires `events.read`.
1283
+
1284
+ Pre-claim projects return an empty list (events are stored but not
1285
+ visible until claim succeeds). Team-scoped credentials see only events
1286
+ whose emit-time `team_id` matches the credential team (enforced when
1287
+ team-scoped tokens exist).
1288
+
1289
+ Clients discriminate each item via `event_type` (OpenAPI Event oneOf) —
1290
+ see docs/design/api/events-catalog.md.
1291
+
1292
+ * @summary List events
1310
1293
  */
1311
- const getBrandingById = async (id, params, options) => {
1312
- return customFetch(getGetBrandingByIdUrl(id, params), {
1294
+ const listEvents = async (params, options) => {
1295
+ return customFetch(getListEventsUrl(params), {
1296
+ ...options,
1297
+ method: "GET"
1298
+ });
1299
+ };
1300
+ const getGetEventUrl = (id, params) => {
1301
+ const normalizedParams = new URLSearchParams();
1302
+ Object.entries(params || {}).forEach(([key, value]) => {
1303
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1304
+ });
1305
+ const stringifiedParams = normalizedParams.toString();
1306
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/events/${id}?${stringifiedParams}` : `${getProxyPath()}/events/${id}`;
1307
+ };
1308
+ /**
1309
+ * Loads a single event by `(project_id, id)`. Requires `events.read`.
1310
+ Events are not registered in `resource_scope_index`; project scope is
1311
+ required on the query (ADR 049). Misses and cross-project ids return 404.
1312
+
1313
+ Pre-claim projects return 404 (stored events stay invisible until claim).
1314
+
1315
+ * @summary Get event by ID
1316
+ */
1317
+ const getEvent = async (id, params, options) => {
1318
+ return customFetch(getGetEventUrl(id, params), {
1313
1319
  ...options,
1314
1320
  method: "GET"
1315
1321
  });
@@ -1357,7 +1363,7 @@ function createZitadelClient(opts) {
1357
1363
  } });
1358
1364
  }
1359
1365
  //#endregion
1360
- //#region ../config/dist/defaults-CXTnFMHj.mjs
1366
+ //#region ../config/dist/defaults-eiGHyI5Y.mjs
1361
1367
  var default_human_user_default = {
1362
1368
  title: "DefaultHumanUserSchema",
1363
1369
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -1368,14 +1374,8 @@ var default_human_user_default = {
1368
1374
  type: "object",
1369
1375
  description: "The default editable schema for human users.",
1370
1376
  "x-auth-methods": {
1371
- "password": {
1372
- "enabled": true,
1373
- "position": 1
1374
- },
1375
- "passkey": {
1376
- "enabled": true,
1377
- "position": 2
1378
- }
1377
+ "password": { "enabled": true },
1378
+ "passkey": { "enabled": true }
1379
1379
  },
1380
1380
  required: ["email"],
1381
1381
  properties: { "email": {
@@ -1398,21 +1398,34 @@ var default_login_default = {
1398
1398
  {
1399
1399
  "name": "identifier",
1400
1400
  "fields": ["email"],
1401
- "actions": [{
1402
- "name": "submit",
1403
- "kind": "submit",
1404
- "primary": true,
1405
- "text_key": "identifier.action.continue"
1406
- }, {
1407
- "name": "passkey",
1408
- "kind": "passkey",
1409
- "primary": false,
1410
- "text_key": "identifier.action.passkey"
1411
- }],
1401
+ "actions": [
1402
+ {
1403
+ "name": "submit",
1404
+ "kind": "submit",
1405
+ "primary": true,
1406
+ "text_key": "identifier.action.continue"
1407
+ },
1408
+ {
1409
+ "name": "passkey",
1410
+ "kind": "passkey",
1411
+ "primary": false,
1412
+ "text_key": "identifier.action.passkey"
1413
+ },
1414
+ {
1415
+ "name": "register",
1416
+ "kind": "navigate",
1417
+ "primary": false,
1418
+ "text_key": "identifier.action.register.link"
1419
+ }
1420
+ ],
1412
1421
  "transitions": {
1413
1422
  "submit": { "target": "password" },
1414
1423
  "passkey": { "target": "done" },
1415
- "user_not_found": { "target": "register" }
1424
+ "user_not_found": { "target": "register" },
1425
+ "register": {
1426
+ "target": "register",
1427
+ "purpose": "register"
1428
+ }
1416
1429
  }
1417
1430
  },
1418
1431
  {
@@ -1437,21 +1450,34 @@ var default_login_default = {
1437
1450
  {
1438
1451
  "name": "register",
1439
1452
  "fields": ["email"],
1440
- "actions": [{
1441
- "name": "submit",
1442
- "kind": "submit",
1443
- "primary": true,
1444
- "text_key": "register.action.password"
1445
- }, {
1446
- "name": "passkey_register",
1447
- "kind": "passkey_register",
1448
- "primary": false,
1449
- "text_key": "register.action.passkey"
1450
- }],
1453
+ "actions": [
1454
+ {
1455
+ "name": "submit",
1456
+ "kind": "submit",
1457
+ "primary": true,
1458
+ "text_key": "register.action.password"
1459
+ },
1460
+ {
1461
+ "name": "passkey_register",
1462
+ "kind": "passkey_register",
1463
+ "primary": false,
1464
+ "text_key": "register.action.passkey"
1465
+ },
1466
+ {
1467
+ "name": "sign_in",
1468
+ "kind": "navigate",
1469
+ "primary": false,
1470
+ "text_key": "register.action.sign_in.link"
1471
+ }
1472
+ ],
1451
1473
  "transitions": {
1452
1474
  "submit": { "target": "register-password" },
1453
1475
  "passkey_register": { "target": "done" },
1454
- "user_already_exists": { "target": "password" }
1476
+ "user_already_exists": { "target": "password" },
1477
+ "sign_in": {
1478
+ "target": "identifier",
1479
+ "purpose": "login"
1480
+ }
1455
1481
  }
1456
1482
  },
1457
1483
  {
@@ -1485,14 +1511,8 @@ var human_user_default = {
1485
1511
  type: "object",
1486
1512
  description: "The default editable schema for human users (passkey-first sign-in).",
1487
1513
  "x-auth-methods": {
1488
- "passkey": {
1489
- "enabled": true,
1490
- "position": 1
1491
- },
1492
- "password": {
1493
- "enabled": true,
1494
- "position": 2
1495
- }
1514
+ "passkey": { "enabled": true },
1515
+ "password": { "enabled": true }
1496
1516
  },
1497
1517
  required: ["email"],
1498
1518
  properties: { "email": {
@@ -1515,41 +1535,67 @@ var login_default = {
1515
1535
  {
1516
1536
  "name": "passkey-first",
1517
1537
  "fields": [],
1518
- "actions": [{
1519
- "name": "passkey",
1520
- "kind": "passkey",
1521
- "primary": true,
1522
- "text_key": "passkey-first.action.passkey"
1523
- }, {
1524
- "name": "email_fallback",
1525
- "kind": "navigate",
1526
- "primary": false,
1527
- "text_key": "passkey-first.action.email_fallback"
1528
- }],
1538
+ "actions": [
1539
+ {
1540
+ "name": "passkey",
1541
+ "kind": "passkey",
1542
+ "primary": true,
1543
+ "text_key": "passkey-first.action.passkey"
1544
+ },
1545
+ {
1546
+ "name": "email_fallback",
1547
+ "kind": "navigate",
1548
+ "primary": false,
1549
+ "text_key": "passkey-first.action.email_fallback"
1550
+ },
1551
+ {
1552
+ "name": "register",
1553
+ "kind": "navigate",
1554
+ "primary": false,
1555
+ "text_key": "identifier.action.register.link"
1556
+ }
1557
+ ],
1529
1558
  "transitions": {
1530
1559
  "passkey": { "target": "done" },
1531
1560
  "email_fallback": { "target": "identifier" },
1532
- "user_not_found": { "target": "register" }
1561
+ "user_not_found": { "target": "register" },
1562
+ "register": {
1563
+ "target": "register",
1564
+ "purpose": "register"
1565
+ }
1533
1566
  }
1534
1567
  },
1535
1568
  {
1536
1569
  "name": "identifier",
1537
1570
  "fields": ["email"],
1538
- "actions": [{
1539
- "name": "submit",
1540
- "kind": "submit",
1541
- "primary": true,
1542
- "text_key": "identifier.action.continue"
1543
- }, {
1544
- "name": "passkey",
1545
- "kind": "passkey",
1546
- "primary": false,
1547
- "text_key": "identifier.action.passkey"
1548
- }],
1571
+ "actions": [
1572
+ {
1573
+ "name": "submit",
1574
+ "kind": "submit",
1575
+ "primary": true,
1576
+ "text_key": "identifier.action.continue"
1577
+ },
1578
+ {
1579
+ "name": "passkey",
1580
+ "kind": "passkey",
1581
+ "primary": false,
1582
+ "text_key": "identifier.action.passkey"
1583
+ },
1584
+ {
1585
+ "name": "register",
1586
+ "kind": "navigate",
1587
+ "primary": false,
1588
+ "text_key": "identifier.action.register.link"
1589
+ }
1590
+ ],
1549
1591
  "transitions": {
1550
1592
  "submit": { "target": "password" },
1551
1593
  "passkey": { "target": "done" },
1552
- "user_not_found": { "target": "register" }
1594
+ "user_not_found": { "target": "register" },
1595
+ "register": {
1596
+ "target": "register",
1597
+ "purpose": "register"
1598
+ }
1553
1599
  }
1554
1600
  },
1555
1601
  {
@@ -1574,21 +1620,34 @@ var login_default = {
1574
1620
  {
1575
1621
  "name": "register",
1576
1622
  "fields": ["email"],
1577
- "actions": [{
1578
- "name": "passkey_register",
1579
- "kind": "passkey_register",
1580
- "primary": true,
1581
- "text_key": "register.action.passkey"
1582
- }, {
1583
- "name": "submit",
1584
- "kind": "submit",
1585
- "primary": false,
1586
- "text_key": "register.action.password"
1587
- }],
1623
+ "actions": [
1624
+ {
1625
+ "name": "passkey_register",
1626
+ "kind": "passkey_register",
1627
+ "primary": true,
1628
+ "text_key": "register.action.passkey"
1629
+ },
1630
+ {
1631
+ "name": "submit",
1632
+ "kind": "submit",
1633
+ "primary": false,
1634
+ "text_key": "register.action.password"
1635
+ },
1636
+ {
1637
+ "name": "sign_in",
1638
+ "kind": "navigate",
1639
+ "primary": false,
1640
+ "text_key": "register.action.sign_in.link"
1641
+ }
1642
+ ],
1588
1643
  "transitions": {
1589
1644
  "passkey_register": { "target": "done" },
1590
1645
  "submit": { "target": "register-password" },
1591
- "user_already_exists": { "target": "password" }
1646
+ "user_already_exists": { "target": "password" },
1647
+ "sign_in": {
1648
+ "target": "passkey-first",
1649
+ "purpose": "login"
1650
+ }
1592
1651
  }
1593
1652
  },
1594
1653
  {
@@ -2051,8 +2110,9 @@ function identity() {
2051
2110
  }
2052
2111
  /**
2053
2112
  * Create a user that can immediately complete the password login flow:
2054
- * `POST /users` (the body must carry `$schema: <schema id>`) followed by
2055
- * `PUT /users/{id}/password` with `is_change_required: false`.
2113
+ * `POST /users` (the body carries `schema: <schema id>` and the schema-defined
2114
+ * content under `attributes`) followed by `PUT /users/{id}/password` with
2115
+ * `is_change_required: false`.
2056
2116
  *
2057
2117
  * Defaults mint a unique email per call (email is x-unique per project), which
2058
2118
  * is what makes per-test seeding parallel-safe on a shared instance.
@@ -2062,14 +2122,16 @@ async function seedUser(client, context, input = {}) {
2062
2122
  const email = input.email ?? fresh.email;
2063
2123
  const password = input.password ?? fresh.password;
2064
2124
  const id = requireString((await client.createUser({
2065
- ...input.attributes,
2066
- $schema: context.schemaId,
2067
- email
2125
+ schema: context.schemaId,
2126
+ attributes: {
2127
+ ...input.attributes,
2128
+ email
2129
+ }
2068
2130
  }, { project_id: context.projectId })).id, "user id");
2069
2131
  await client.setUserPassword(id, {
2070
2132
  password,
2071
2133
  is_change_required: false
2072
- }, { project_id: context.projectId });
2134
+ });
2073
2135
  return {
2074
2136
  id,
2075
2137
  email,
@@ -2309,4 +2371,4 @@ Object.defineProperty(exports, "startLocalZitadel", {
2309
2371
  }
2310
2372
  });
2311
2373
 
2312
- //# sourceMappingURL=src-DirKLqi4.cjs.map
2374
+ //# sourceMappingURL=src-I0KAh1zU.cjs.map