@zitadel/testing 0.0.0 → 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.
@@ -1,4 +1,4 @@
1
- const require_handshake = require("./handshake-CggSIoxF.cjs");
1
+ const require_handshake = require("./handshake-CRKcgkfN.cjs");
2
2
  require("node:fs");
3
3
  require("node:url");
4
4
  let node_fs_promises = require("node:fs/promises");
@@ -129,9 +129,7 @@ function safeJsonParse(text) {
129
129
  * OpenAPI spec version: 0.0.1
130
130
  */
131
131
  var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
132
- activateFlowDefinition: () => activateFlowDefinition,
133
- authorizeDevice: () => authorizeDevice,
134
- authorizeGet: () => authorizeGet,
132
+ completeClaim: () => completeClaim,
135
133
  createAuthAttempt: () => createAuthAttempt,
136
134
  createBranding: () => createBranding,
137
135
  createFlow: () => createFlow,
@@ -142,16 +140,14 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
142
140
  createSession: () => createSession,
143
141
  createTeam: () => createTeam,
144
142
  createUser: () => createUser,
145
- deactivateFlowDefinition: () => deactivateFlowDefinition,
146
143
  deleteFlowDefinition: () => deleteFlowDefinition,
144
+ deleteTeam: () => deleteTeam,
147
145
  deleteUserByID: () => deleteUserByID,
148
- endSession: () => endSession,
149
146
  exchangeHandoff: () => exchangeHandoff,
150
- getActivateFlowDefinitionUrl: () => getActivateFlowDefinitionUrl,
151
147
  getAuthAttempt: () => getAuthAttempt,
152
- getAuthorizeDeviceUrl: () => getAuthorizeDeviceUrl,
153
- getAuthorizeGetUrl: () => getAuthorizeGetUrl,
154
148
  getBrandingById: () => getBrandingById,
149
+ getClaimStatus: () => getClaimStatus,
150
+ getCompleteClaimUrl: () => getCompleteClaimUrl,
155
151
  getCreateAuthAttemptUrl: () => getCreateAuthAttemptUrl,
156
152
  getCreateBrandingUrl: () => getCreateBrandingUrl,
157
153
  getCreateFlowDefinitionUrl: () => getCreateFlowDefinitionUrl,
@@ -162,236 +158,80 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
162
158
  getCreateSessionUrl: () => getCreateSessionUrl,
163
159
  getCreateTeamUrl: () => getCreateTeamUrl,
164
160
  getCreateUserUrl: () => getCreateUserUrl,
165
- getDeactivateFlowDefinitionUrl: () => getDeactivateFlowDefinitionUrl,
166
161
  getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
162
+ getDeleteTeamUrl: () => getDeleteTeamUrl,
167
163
  getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
168
- getEndSessionUrl: () => getEndSessionUrl,
164
+ getEvent: () => getEvent,
169
165
  getExchangeHandoffUrl: () => getExchangeHandoffUrl,
170
166
  getFlowDefinition: () => getFlowDefinition,
171
167
  getFlowStep: () => getFlowStep,
172
168
  getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
173
169
  getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
170
+ getGetClaimStatusUrl: () => getGetClaimStatusUrl,
171
+ getGetEventUrl: () => getGetEventUrl,
174
172
  getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
175
173
  getGetFlowStepUrl: () => getGetFlowStepUrl,
176
174
  getGetHealthUrl: () => getGetHealthUrl,
177
- getGetKeysUrl: () => getGetKeysUrl,
178
175
  getGetLiveUrl: () => getGetLiveUrl,
179
176
  getGetMySessionUrl: () => getGetMySessionUrl,
180
177
  getGetMyUserUrl: () => getGetMyUserUrl,
181
- getGetOpenIDConfigurationUrl: () => getGetOpenIDConfigurationUrl,
182
178
  getGetProjectUrl: () => getGetProjectUrl,
183
179
  getGetReadyUrl: () => getGetReadyUrl,
184
180
  getGetSchemaByIdUrl: () => getGetSchemaByIdUrl,
185
181
  getGetSessionUrl: () => getGetSessionUrl,
186
182
  getGetTeamUrl: () => getGetTeamUrl,
187
- getGetTokenUrl: () => getGetTokenUrl,
188
183
  getGetUserByIDUrl: () => getGetUserByIDUrl,
189
- getGetUserInfoUrl: () => getGetUserInfoUrl,
190
184
  getHealth: () => getHealth,
191
- getIntrospectUrl: () => getIntrospectUrl,
185
+ getInitClaimUrl: () => getInitClaimUrl,
192
186
  getIssueChallengeUrl: () => getIssueChallengeUrl,
193
- getKeys: () => getKeys,
194
187
  getListBrandingUrl: () => getListBrandingUrl,
188
+ getListEventsUrl: () => getListEventsUrl,
195
189
  getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
196
190
  getListSchemasUrl: () => getListSchemasUrl,
197
- getListSessionsUrl: () => getListSessionsUrl,
198
191
  getListUserPasskeysUrl: () => getListUserPasskeysUrl,
192
+ getListUserTeamsUrl: () => getListUserTeamsUrl,
199
193
  getListUsersUrl: () => getListUsersUrl,
200
194
  getLive: () => getLive,
201
195
  getMySession: () => getMySession,
202
196
  getMyUser: () => getMyUser,
203
- getOpenIDConfiguration: () => getOpenIDConfiguration,
204
197
  getPatchProjectUrl: () => getPatchProjectUrl,
205
198
  getProject: () => getProject,
206
199
  getQueryProjectsUrl: () => getQueryProjectsUrl,
200
+ getQuerySessionsUrl: () => getQuerySessionsUrl,
201
+ getQueryTeamsUrl: () => getQueryTeamsUrl,
207
202
  getReady: () => getReady,
208
203
  getRevokeMySessionUrl: () => getRevokeMySessionUrl,
209
204
  getRevokeSessionUrl: () => getRevokeSessionUrl,
210
- getRevokeTokenUrl: () => getRevokeTokenUrl,
211
205
  getSchemaById: () => getSchemaById,
212
206
  getSession: () => getSession,
213
207
  getSetUserPasswordUrl: () => getSetUserPasswordUrl,
214
- getSubmitFlowEventUrl: () => getSubmitFlowEventUrl,
215
208
  getSubmitFlowStepUrl: () => getSubmitFlowStepUrl,
216
209
  getTeam: () => getTeam,
217
- getToken: () => getToken,
218
210
  getUpdateFlowDefinitionUrl: () => getUpdateFlowDefinitionUrl,
211
+ getUpdateTeamUrl: () => getUpdateTeamUrl,
219
212
  getUserByID: () => getUserByID,
220
- getUserInfo: () => getUserInfo,
221
213
  getVerifyChallengeProofUrl: () => getVerifyChallengeProofUrl,
222
- introspect: () => introspect,
214
+ initClaim: () => initClaim,
223
215
  issueChallenge: () => issueChallenge,
224
216
  listBranding: () => listBranding,
217
+ listEvents: () => listEvents,
225
218
  listFlowDefinitions: () => listFlowDefinitions,
226
219
  listSchemas: () => listSchemas,
227
- listSessions: () => listSessions,
228
220
  listUserPasskeys: () => listUserPasskeys,
221
+ listUserTeams: () => listUserTeams,
229
222
  listUsers: () => listUsers,
230
223
  patchProject: () => patchProject,
231
224
  queryProjects: () => queryProjects,
225
+ querySessions: () => querySessions,
226
+ queryTeams: () => queryTeams,
232
227
  revokeMySession: () => revokeMySession,
233
228
  revokeSession: () => revokeSession,
234
- revokeToken: () => revokeToken,
235
229
  setUserPassword: () => setUserPassword,
236
- submitFlowEvent: () => submitFlowEvent,
237
230
  submitFlowStep: () => submitFlowStep,
238
231
  updateFlowDefinition: () => updateFlowDefinition,
232
+ updateTeam: () => updateTeam,
239
233
  verifyChallengeProof: () => verifyChallengeProof
240
234
  });
241
- const getGetOpenIDConfigurationUrl = () => {
242
- return `${getProxyPath()}/.well-known/openid-configuration`;
243
- };
244
- /**
245
- * Retrieve the OpenID Connect configuration
246
- * @summary Get OpenID Connect configuration
247
- */
248
- const getOpenIDConfiguration = async (options) => {
249
- return customFetch(getGetOpenIDConfigurationUrl(), {
250
- ...options,
251
- method: "GET"
252
- });
253
- };
254
- const getAuthorizeGetUrl = (params) => {
255
- const normalizedParams = new URLSearchParams();
256
- Object.entries(params || {}).forEach(([key, value]) => {
257
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
258
- });
259
- const stringifiedParams = normalizedParams.toString();
260
- return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/authorize?${stringifiedParams}` : `${getProxyPath()}/auth/authorize`;
261
- };
262
- /**
263
- * @summary Authorize a user
264
- */
265
- const authorizeGet = async (params, options) => {
266
- return customFetch(getAuthorizeGetUrl(params), {
267
- ...options,
268
- method: "GET"
269
- });
270
- };
271
- const getAuthorizeDeviceUrl = (params) => {
272
- const normalizedParams = new URLSearchParams();
273
- Object.entries(params || {}).forEach(([key, value]) => {
274
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
275
- });
276
- const stringifiedParams = normalizedParams.toString();
277
- return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/device-authorization?${stringifiedParams}` : `${getProxyPath()}/auth/device-authorization`;
278
- };
279
- /**
280
- * @summary Authorize a device
281
- */
282
- const authorizeDevice = async (params, options) => {
283
- return customFetch(getAuthorizeDeviceUrl(params), {
284
- ...options,
285
- method: "GET"
286
- });
287
- };
288
- const getEndSessionUrl = (params) => {
289
- const normalizedParams = new URLSearchParams();
290
- Object.entries(params || {}).forEach(([key, value]) => {
291
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
292
- });
293
- const stringifiedParams = normalizedParams.toString();
294
- return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/end-session?${stringifiedParams}` : `${getProxyPath()}/auth/end-session`;
295
- };
296
- /**
297
- * @summary End a session
298
- */
299
- const endSession = async (params, options) => {
300
- return customFetch(getEndSessionUrl(params), {
301
- ...options,
302
- method: "GET"
303
- });
304
- };
305
- const getIntrospectUrl = () => {
306
- return `${getProxyPath()}/auth/introspect`;
307
- };
308
- /**
309
- * @summary Introspect a token
310
- */
311
- const introspect = async (introspectBody, options) => {
312
- const formUrlEncoded = new URLSearchParams();
313
- formUrlEncoded.append(`token`, introspectBody.token);
314
- if (introspectBody.token_type_hint !== void 0) formUrlEncoded.append(`token_type_hint`, introspectBody.token_type_hint);
315
- return customFetch(getIntrospectUrl(), {
316
- ...options,
317
- method: "POST",
318
- headers: {
319
- "Content-Type": "application/x-www-form-urlencoded",
320
- ...options?.headers
321
- },
322
- body: formUrlEncoded
323
- });
324
- };
325
- const getGetKeysUrl = () => {
326
- return `${getProxyPath()}/auth/keys`;
327
- };
328
- /**
329
- * @summary Get public keys
330
- */
331
- const getKeys = async (options) => {
332
- return customFetch(getGetKeysUrl(), {
333
- ...options,
334
- method: "GET"
335
- });
336
- };
337
- const getRevokeTokenUrl = () => {
338
- return `${getProxyPath()}/auth/revoke`;
339
- };
340
- /**
341
- * @summary Revoke an access token or refresh token
342
- */
343
- const revokeToken = async (revokeTokenBody, options) => {
344
- const formUrlEncoded = new URLSearchParams();
345
- if (revokeTokenBody.token !== void 0) formUrlEncoded.append(`token`, revokeTokenBody.token);
346
- if (revokeTokenBody.token_type_hint !== void 0) formUrlEncoded.append(`token_type_hint`, revokeTokenBody.token_type_hint);
347
- return customFetch(getRevokeTokenUrl(), {
348
- ...options,
349
- method: "POST",
350
- headers: {
351
- "Content-Type": "application/x-www-form-urlencoded",
352
- ...options?.headers
353
- },
354
- body: formUrlEncoded
355
- });
356
- };
357
- const getGetTokenUrl = () => {
358
- return `${getProxyPath()}/auth/token`;
359
- };
360
- /**
361
- * @summary Get access token
362
- */
363
- const getToken = async (getTokenBody, options) => {
364
- const formUrlEncoded = new URLSearchParams();
365
- if (getTokenBody.code !== void 0) formUrlEncoded.append(`code`, getTokenBody.code);
366
- if (getTokenBody.client_assertion !== void 0) formUrlEncoded.append(`client_assertion`, getTokenBody.client_assertion);
367
- if (getTokenBody.client_assertion_type !== void 0) formUrlEncoded.append(`client_assertion_type`, getTokenBody.client_assertion_type);
368
- if (getTokenBody.client_id !== void 0) formUrlEncoded.append(`client_id`, getTokenBody.client_id);
369
- if (getTokenBody.client_secret !== void 0) formUrlEncoded.append(`client_secret`, getTokenBody.client_secret);
370
- if (getTokenBody.code_verifier !== void 0) formUrlEncoded.append(`code_verifier`, getTokenBody.code_verifier);
371
- if (getTokenBody.grant_type !== void 0) formUrlEncoded.append(`grant_type`, getTokenBody.grant_type);
372
- if (getTokenBody.redirect_uri !== void 0) formUrlEncoded.append(`redirect_uri`, getTokenBody.redirect_uri);
373
- return customFetch(getGetTokenUrl(), {
374
- ...options,
375
- method: "POST",
376
- headers: {
377
- "Content-Type": "application/x-www-form-urlencoded",
378
- ...options?.headers
379
- },
380
- body: formUrlEncoded
381
- });
382
- };
383
- const getGetUserInfoUrl = () => {
384
- return `${getProxyPath()}/auth/userinfo`;
385
- };
386
- /**
387
- * @summary Get user info
388
- */
389
- const getUserInfo = async (options) => {
390
- return customFetch(getGetUserInfoUrl(), {
391
- ...options,
392
- method: "GET"
393
- });
394
- };
395
235
  const getGetHealthUrl = () => {
396
236
  return `${getProxyPath()}/healthz`;
397
237
  };
@@ -487,19 +327,14 @@ const getUserByID = async (userId, params, options) => {
487
327
  method: "GET"
488
328
  });
489
329
  };
490
- const getDeleteUserByIDUrl = (userId, params) => {
491
- const normalizedParams = new URLSearchParams();
492
- Object.entries(params || {}).forEach(([key, value]) => {
493
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
494
- });
495
- const stringifiedParams = normalizedParams.toString();
496
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;
330
+ const getDeleteUserByIDUrl = (userId) => {
331
+ return `${getProxyPath()}/users/${userId}`;
497
332
  };
498
333
  /**
499
334
  * @summary Delete user by ID
500
335
  */
501
- const deleteUserByID = async (userId, params, options) => {
502
- return customFetch(getDeleteUserByIDUrl(userId, params), {
336
+ const deleteUserByID = async (userId, options) => {
337
+ return customFetch(getDeleteUserByIDUrl(userId), {
503
338
  ...options,
504
339
  method: "DELETE"
505
340
  });
@@ -521,19 +356,14 @@ const listUserPasskeys = async (userId, params, options) => {
521
356
  method: "GET"
522
357
  });
523
358
  };
524
- const getSetUserPasswordUrl = (userId, params) => {
525
- const normalizedParams = new URLSearchParams();
526
- Object.entries(params || {}).forEach(([key, value]) => {
527
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
528
- });
529
- const stringifiedParams = normalizedParams.toString();
530
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/password?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/password`;
359
+ const getSetUserPasswordUrl = (userId) => {
360
+ return `${getProxyPath()}/users/${userId}/password`;
531
361
  };
532
362
  /**
533
363
  * @summary Set user password
534
364
  */
535
- const setUserPassword = async (userId, setUserPasswordBody, params, options) => {
536
- return customFetch(getSetUserPasswordUrl(userId, params), {
365
+ const setUserPassword = async (userId, setUserPasswordBody, options) => {
366
+ return customFetch(getSetUserPasswordUrl(userId), {
537
367
  ...options,
538
368
  method: "PUT",
539
369
  headers: {
@@ -543,6 +373,31 @@ const setUserPassword = async (userId, setUserPasswordBody, params, options) =>
543
373
  body: JSON.stringify(setUserPasswordBody)
544
374
  });
545
375
  };
376
+ const getListUserTeamsUrl = (userId, params) => {
377
+ const normalizedParams = new URLSearchParams();
378
+ Object.entries(params || {}).forEach(([key, value]) => {
379
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
380
+ });
381
+ const stringifiedParams = normalizedParams.toString();
382
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/teams?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/teams`;
383
+ };
384
+ /**
385
+ * The user's team roster, ordered by team name. Each entry carries the
386
+ team's name, so a client renders a page without resolving ids one by one.
387
+
388
+ This is the N:N roster and it is not lifecycle ownership: the single team
389
+ that owns the user's lifecycle is reported as `metadata.lifecycle_owner_team_id`
390
+ on the user read endpoints. Memberships the user was removed from are not
391
+ returned.
392
+
393
+ * @summary List the teams a user belongs to
394
+ */
395
+ const listUserTeams = async (userId, params, options) => {
396
+ return customFetch(getListUserTeamsUrl(userId, params), {
397
+ ...options,
398
+ method: "GET"
399
+ });
400
+ };
546
401
  const getGetMyUserUrl = () => {
547
402
  return `${getProxyPath()}/users/me`;
548
403
  };
@@ -564,7 +419,7 @@ the first capability step. Creates a new session implicitly unless
564
419
  `session_id` is provided (for step-up / reauth on an existing session).
565
420
 
566
421
  The response contains an `id` field — the flow handle. Use it as the path
567
- parameter for all subsequent `/flow/{id}/submit` and `/flow/{id}/event` calls.
422
+ parameter for all subsequent `/flow/{id}/submit` calls.
568
423
 
569
424
  The response also sets an encrypted `HttpOnly` cookie (`_zflow`) containing
570
425
  the flow's orchestration state (current step, collected data, history).
@@ -644,26 +499,6 @@ const submitFlowStep = async (id, submitFlowStepBody, options) => {
644
499
  body: JSON.stringify(submitFlowStepBody)
645
500
  });
646
501
  };
647
- const getSubmitFlowEventUrl = (id) => {
648
- return `${getProxyPath()}/flow/${id}/event`;
649
- };
650
- /**
651
- * Submits telemetry or fingerprint data from the frontend.
652
- Does not advance the state machine. Used for risk evaluation.
653
-
654
- * @summary Submit client-side event
655
- */
656
- const submitFlowEvent = async (id, submitFlowEventBody, options) => {
657
- return customFetch(getSubmitFlowEventUrl(id), {
658
- ...options,
659
- method: "POST",
660
- headers: {
661
- "Content-Type": "application/json",
662
- ...options?.headers
663
- },
664
- body: JSON.stringify(submitFlowEventBody)
665
- });
666
- };
667
502
  const getCreateAuthAttemptUrl = () => {
668
503
  return `${getProxyPath()}/auth_attempts`;
669
504
  };
@@ -851,6 +686,68 @@ const patchProject = async (projectId, patchProjectBody, options) => {
851
686
  body: JSON.stringify(patchProjectBody)
852
687
  });
853
688
  };
689
+ const getInitClaimUrl = (projectId) => {
690
+ return `${getProxyPath()}/projects/${projectId}/claim/init`;
691
+ };
692
+ /**
693
+ * Starts a claim challenge for an unclaimed project. Authenticated by the
694
+ project secret, this mints a single-use, short-lived challenge and returns
695
+ the `claim_url` the developer opens in a browser to complete the claim,
696
+ together with the `challenge_id` the CLI polls with. The exact expiry is
697
+ carried by `expires_at` on the response.
698
+
699
+ * @summary Initialize a project claim
700
+ */
701
+ const initClaim = async (projectId, options) => {
702
+ return customFetch(getInitClaimUrl(projectId), {
703
+ ...options,
704
+ method: "POST"
705
+ });
706
+ };
707
+ const getGetClaimStatusUrl = (projectId, params) => {
708
+ const normalizedParams = new URLSearchParams();
709
+ Object.entries(params || {}).forEach(([key, value]) => {
710
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
711
+ });
712
+ const stringifiedParams = normalizedParams.toString();
713
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${projectId}/claim/status?${stringifiedParams}` : `${getProxyPath()}/projects/${projectId}/claim/status`;
714
+ };
715
+ /**
716
+ * Polled by the CLI while a browser completes the claim. Authorized by the
717
+ project secret that initiated the challenge. Returns `pending`, or
718
+ `completed` with the owning team, the claim timestamp, and the dashboard
719
+ URL once the browser leg has finished.
720
+
721
+ * @summary Get claim status
722
+ */
723
+ const getClaimStatus = async (projectId, params, options) => {
724
+ return customFetch(getGetClaimStatusUrl(projectId, params), {
725
+ ...options,
726
+ method: "GET"
727
+ });
728
+ };
729
+ const getCompleteClaimUrl = (projectId) => {
730
+ return `${getProxyPath()}/projects/${projectId}/claim/complete`;
731
+ };
732
+ /**
733
+ * Called by the browser after the developer authenticates on the claim page.
734
+ Authenticated by the `__nextgen_session` cookie, it attaches the project to
735
+ the developer's personal team using the `challenge_id` from the claim URL as
736
+ its single-use, browser-safe authorization.
737
+
738
+ * @summary Complete a project claim
739
+ */
740
+ const completeClaim = async (projectId, completeClaimBody, options) => {
741
+ return customFetch(getCompleteClaimUrl(projectId), {
742
+ ...options,
743
+ method: "POST",
744
+ headers: {
745
+ "Content-Type": "application/json",
746
+ ...options?.headers
747
+ },
748
+ body: JSON.stringify(completeClaimBody)
749
+ });
750
+ };
854
751
  const getCreateSessionUrl = () => {
855
752
  return `${getProxyPath()}/sessions`;
856
753
  };
@@ -863,8 +760,16 @@ Use this explicitly when you want to:
863
760
  can be correlated with the eventual authenticated session from the start.
864
761
  - Track anonymous state (bot detection, device fingerprint) that survives until authentication.
865
762
 
866
- The returned `session_token` authorises GET and DELETE on this session.
867
- It is superseded when a handoff exchange completes — clients must replace it at that point.
763
+ Creating a session is an app-plane operation on the project credential
764
+ (`session.write`). The returned `session_token` is a session credential for the
765
+ end-user client, not a management scope: it is delivered as the
766
+ `__nextgen_session` cookie and authorises the self-service operations
767
+ `GET /sessions/me` and `DELETE /sessions/me` (`nextgenSession` scheme). The
768
+ by-id operations `GET /sessions/{session_id}` and `DELETE /sessions/{session_id}`
769
+ are operator endpoints and require `session.read` / `session.delete` instead.
770
+
771
+ The `session_token` is superseded when a handoff exchange completes — clients must
772
+ replace it at that point.
868
773
 
869
774
  Anonymous sessions expire aggressively (10-minute TTL). The TTL resets to the configured
870
775
  full session TTL when the first authentication factor is written via a completing `auth_attempt`.
@@ -882,24 +787,30 @@ const createSession = async (createSessionBody, options) => {
882
787
  body: JSON.stringify(createSessionBody)
883
788
  });
884
789
  };
885
- const getListSessionsUrl = (params) => {
790
+ const getQuerySessionsUrl = (params) => {
886
791
  const normalizedParams = new URLSearchParams();
887
792
  Object.entries(params || {}).forEach(([key, value]) => {
888
793
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
889
794
  });
890
795
  const stringifiedParams = normalizedParams.toString();
891
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions?${stringifiedParams}` : `${getProxyPath()}/sessions`;
796
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/query?${stringifiedParams}` : `${getProxyPath()}/sessions/query`;
892
797
  };
893
798
  /**
894
- * Returns a paginated list of sessions for a project.
895
- Requires a project service key (OAuth2 client credentials).
799
+ * Returns the sessions of a project, paginated with a cursor.
800
+ Sessions of every lifecycle state are returned; each carries its `state`.
801
+ Requires `session.read` permission.
896
802
 
897
- * @summary List sessions
803
+ * @summary Query sessions
898
804
  */
899
- const listSessions = async (params, options) => {
900
- return customFetch(getListSessionsUrl(params), {
805
+ const querySessions = async (querySessionsBody, params, options) => {
806
+ return customFetch(getQuerySessionsUrl(params), {
901
807
  ...options,
902
- method: "GET"
808
+ method: "POST",
809
+ headers: {
810
+ "Content-Type": "application/json",
811
+ ...options?.headers
812
+ },
813
+ body: JSON.stringify(querySessionsBody)
903
814
  });
904
815
  };
905
816
  const getExchangeHandoffUrl = (params) => {
@@ -942,13 +853,8 @@ const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
942
853
  body: JSON.stringify(exchangeHandoffBody)
943
854
  });
944
855
  };
945
- const getGetSessionUrl = (sessionId, params) => {
946
- const normalizedParams = new URLSearchParams();
947
- Object.entries(params || {}).forEach(([key, value]) => {
948
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
949
- });
950
- const stringifiedParams = normalizedParams.toString();
951
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
856
+ const getGetSessionUrl = (sessionId) => {
857
+ return `${getProxyPath()}/sessions/${sessionId}`;
952
858
  };
953
859
  /**
954
860
  * Returns the current state of a session including its factors and all currently
@@ -960,33 +866,30 @@ against the same `session_id`) to restore a dropped assurance level.
960
866
 
961
867
  * @summary Get session state
962
868
  */
963
- const getSession = async (sessionId, params, options) => {
964
- return customFetch(getGetSessionUrl(sessionId, params), {
869
+ const getSession = async (sessionId, options) => {
870
+ return customFetch(getGetSessionUrl(sessionId), {
965
871
  ...options,
966
872
  method: "GET"
967
873
  });
968
874
  };
969
- const getRevokeSessionUrl = (sessionId, params) => {
970
- const normalizedParams = new URLSearchParams();
971
- Object.entries(params || {}).forEach(([key, value]) => {
972
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
973
- });
974
- const stringifiedParams = normalizedParams.toString();
975
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
875
+ const getRevokeSessionUrl = (sessionId) => {
876
+ return `${getProxyPath()}/sessions/${sessionId}`;
976
877
  };
977
878
  /**
978
- * Revokes the session immediately (`state: revoked`).
879
+ * Permanently deletes the session, terminating it immediately.
979
880
 
980
881
  This is the operator revoke path and requires the `session.delete` scope on a
981
882
  project-bound credential. End-user logout with the `__nextgen_session` cookie is
982
883
  `DELETE /sessions/me` (`nextgenSession` scheme).
983
884
 
984
- After revocation, any tokens derived from this session are invalidated.
885
+ Idempotent: deleting a session that does not exist (or was already deleted)
886
+ still returns 204. After deletion, any tokens derived from the session are
887
+ invalidated.
985
888
 
986
889
  * @summary Revoke session
987
890
  */
988
- const revokeSession = async (sessionId, params, options) => {
989
- return customFetch(getRevokeSessionUrl(sessionId, params), {
891
+ const revokeSession = async (sessionId, options) => {
892
+ return customFetch(getRevokeSessionUrl(sessionId), {
990
893
  ...options,
991
894
  method: "DELETE"
992
895
  });
@@ -1014,10 +917,12 @@ const getRevokeMySessionUrl = () => {
1014
917
  return `${getProxyPath()}/sessions/me`;
1015
918
  };
1016
919
  /**
1017
- * Revokes the session immediately (`state: revoked`). This is the logout operation.
920
+ * Logs out by permanently deleting the session.
1018
921
 
1019
- The __nextgen_session cookie issued at creation (or superseded by a handoff exchange) is required.
1020
- After revocation, any tokens derived from this session are invalidated including the cookie itself, which is cleared in the response.
922
+ The `__nextgen_session` cookie issued at creation (or superseded by a handoff
923
+ exchange) is required. Idempotent: if the session is already gone this still
924
+ returns 204. Any tokens derived from the session are invalidated, and the
925
+ cookie itself is cleared in the response.
1021
926
 
1022
927
  * @summary Revoke my session
1023
928
  */
@@ -1036,10 +941,12 @@ const getCreateSchemaUrl = (params) => {
1036
941
  return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;
1037
942
  };
1038
943
  /**
1039
- * Create a new schema. The schema definition must include a unique $id field,
1040
- which will be used to identify the schema in future requests. The $id must
1041
- be a valid URI and should ideally point to the location where the schema
1042
- can be accessed.
944
+ * Create a new schema. The optional `$id` field is the JSON Schema document
945
+ URI used to identify the schema in future requests (GitOps-stable identity,
946
+ not a free-form resource primary key). When `$id` is omitted, the server
947
+ generates a `sch_*` URL. When provided, `$id` must be unique within the
948
+ project and should ideally be a valid URI pointing at where the schema can
949
+ be accessed.
1043
950
 
1044
951
  The schema can either be a concrete schema, e.g. a user schema, or a
1045
952
  schema-url which will be resolved by the server.
@@ -1138,31 +1045,21 @@ const listFlowDefinitions = async (params, options) => {
1138
1045
  method: "GET"
1139
1046
  });
1140
1047
  };
1141
- const getGetFlowDefinitionUrl = (id, params) => {
1142
- const normalizedParams = new URLSearchParams();
1143
- Object.entries(params || {}).forEach(([key, value]) => {
1144
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1145
- });
1146
- const stringifiedParams = normalizedParams.toString();
1147
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1048
+ const getGetFlowDefinitionUrl = (id) => {
1049
+ return `${getProxyPath()}/flow_definitions/${id}`;
1148
1050
  };
1149
1051
  /**
1150
1052
  * Get a flow definition by id
1151
1053
  * @summary Get a flow definition by id
1152
1054
  */
1153
- const getFlowDefinition = async (id, params, options) => {
1154
- return customFetch(getGetFlowDefinitionUrl(id, params), {
1055
+ const getFlowDefinition = async (id, options) => {
1056
+ return customFetch(getGetFlowDefinitionUrl(id), {
1155
1057
  ...options,
1156
1058
  method: "GET"
1157
1059
  });
1158
1060
  };
1159
- const getUpdateFlowDefinitionUrl = (id, params) => {
1160
- const normalizedParams = new URLSearchParams();
1161
- Object.entries(params || {}).forEach(([key, value]) => {
1162
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1163
- });
1164
- const stringifiedParams = normalizedParams.toString();
1165
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1061
+ const getUpdateFlowDefinitionUrl = (id) => {
1062
+ return `${getProxyPath()}/flow_definitions/${id}`;
1166
1063
  };
1167
1064
  /**
1168
1065
  * Update a flow definition by id. This endpoint replaces the existing flow definition.
@@ -1170,8 +1067,8 @@ If `flow_definition.status` is omitted, the current status is preserved
1170
1067
 
1171
1068
  * @summary Update a flow definition by id
1172
1069
  */
1173
- const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, options) => {
1174
- return customFetch(getUpdateFlowDefinitionUrl(id, params), {
1070
+ const updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {
1071
+ return customFetch(getUpdateFlowDefinitionUrl(id), {
1175
1072
  ...options,
1176
1073
  method: "PUT",
1177
1074
  headers: {
@@ -1181,13 +1078,8 @@ const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, option
1181
1078
  body: JSON.stringify(updateFlowDefinitionBody)
1182
1079
  });
1183
1080
  };
1184
- const getDeleteFlowDefinitionUrl = (id, params) => {
1185
- const normalizedParams = new URLSearchParams();
1186
- Object.entries(params || {}).forEach(([key, value]) => {
1187
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1188
- });
1189
- const stringifiedParams = normalizedParams.toString();
1190
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
1081
+ const getDeleteFlowDefinitionUrl = (id) => {
1082
+ return `${getProxyPath()}/flow_definitions/${id}`;
1191
1083
  };
1192
1084
  /**
1193
1085
  * Delete a flow definition by id.
@@ -1196,94 +1088,112 @@ If the flow definition is the last active flow definition for a given purpose, t
1196
1088
 
1197
1089
  * @summary Delete a flow definition by id
1198
1090
  */
1199
- const deleteFlowDefinition = async (id, params, options) => {
1200
- return customFetch(getDeleteFlowDefinitionUrl(id, params), {
1091
+ const deleteFlowDefinition = async (id, options) => {
1092
+ return customFetch(getDeleteFlowDefinitionUrl(id), {
1201
1093
  ...options,
1202
1094
  method: "DELETE"
1203
1095
  });
1204
1096
  };
1205
- const getActivateFlowDefinitionUrl = (id, params) => {
1097
+ const getCreateTeamUrl = (params) => {
1206
1098
  const normalizedParams = new URLSearchParams();
1207
1099
  Object.entries(params || {}).forEach(([key, value]) => {
1208
1100
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1209
1101
  });
1210
1102
  const stringifiedParams = normalizedParams.toString();
1211
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}/activate?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}/activate`;
1103
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;
1212
1104
  };
1213
1105
  /**
1214
- * Activate a flow definition by transitioning it from a `draft` state to an `active` state.
1215
- Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
1216
-
1217
- * @summary Activate a flow definition by ID.
1106
+ * @summary Create team
1218
1107
  */
1219
- const activateFlowDefinition = async (id, params, options) => {
1220
- return customFetch(getActivateFlowDefinitionUrl(id, params), {
1108
+ const createTeam = async (createTeamBody, params, options) => {
1109
+ return customFetch(getCreateTeamUrl(params), {
1221
1110
  ...options,
1222
- method: "POST"
1111
+ method: "POST",
1112
+ headers: {
1113
+ "Content-Type": "application/json",
1114
+ ...options?.headers
1115
+ },
1116
+ body: JSON.stringify(createTeamBody)
1223
1117
  });
1224
1118
  };
1225
- const getDeactivateFlowDefinitionUrl = (id, params) => {
1119
+ const getQueryTeamsUrl = (params) => {
1226
1120
  const normalizedParams = new URLSearchParams();
1227
1121
  Object.entries(params || {}).forEach(([key, value]) => {
1228
1122
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1229
1123
  });
1230
1124
  const stringifiedParams = normalizedParams.toString();
1231
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}/deactivate?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}/deactivate`;
1125
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/query?${stringifiedParams}` : `${getProxyPath()}/teams/query`;
1232
1126
  };
1233
1127
  /**
1234
- * Deactivates a flow definition in the `active` state by transitioning it to the `draft` state.
1235
- Flow definitions in `draft` state cannot be used to start new flows. Existing flows that use the deactivated flow definition must gracefully handle this.
1236
- Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
1128
+ * Returns the teams of a project, paginated with a cursor.
1237
1129
 
1238
- * @summary Deactivate a flow definition by ID.
1130
+ * @summary Query teams
1239
1131
  */
1240
- const deactivateFlowDefinition = async (id, params, options) => {
1241
- return customFetch(getDeactivateFlowDefinitionUrl(id, params), {
1242
- ...options,
1243
- method: "POST"
1244
- });
1245
- };
1246
- const getCreateTeamUrl = (params) => {
1247
- const normalizedParams = new URLSearchParams();
1248
- Object.entries(params || {}).forEach(([key, value]) => {
1249
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1250
- });
1251
- const stringifiedParams = normalizedParams.toString();
1252
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;
1253
- };
1254
- /**
1255
- * @summary Create team
1256
- */
1257
- const createTeam = async (createTeamBody, params, options) => {
1258
- return customFetch(getCreateTeamUrl(params), {
1132
+ const queryTeams = async (queryTeamsBody, params, options) => {
1133
+ return customFetch(getQueryTeamsUrl(params), {
1259
1134
  ...options,
1260
1135
  method: "POST",
1261
1136
  headers: {
1262
1137
  "Content-Type": "application/json",
1263
1138
  ...options?.headers
1264
1139
  },
1265
- body: JSON.stringify(createTeamBody)
1140
+ body: JSON.stringify(queryTeamsBody)
1266
1141
  });
1267
1142
  };
1268
- const getGetTeamUrl = (teamId, params) => {
1269
- const normalizedParams = new URLSearchParams();
1270
- Object.entries(params || {}).forEach(([key, value]) => {
1271
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1272
- });
1273
- const stringifiedParams = normalizedParams.toString();
1274
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
1143
+ const getGetTeamUrl = (teamId) => {
1144
+ return `${getProxyPath()}/teams/${teamId}`;
1275
1145
  };
1276
1146
  /**
1277
- * Returns the current state of a team.
1147
+ * Returns a Team by its id.
1278
1148
 
1279
1149
  * @summary Get team
1280
1150
  */
1281
- const getTeam = async (teamId, params, options) => {
1282
- return customFetch(getGetTeamUrl(teamId, params), {
1151
+ const getTeam = async (teamId, options) => {
1152
+ return customFetch(getGetTeamUrl(teamId), {
1283
1153
  ...options,
1284
1154
  method: "GET"
1285
1155
  });
1286
1156
  };
1157
+ const getDeleteTeamUrl = (teamId) => {
1158
+ return `${getProxyPath()}/teams/${teamId}`;
1159
+ };
1160
+ /**
1161
+ * Deactivates the team.
1162
+
1163
+ The team is tombstoned rather than erased: it stays readable through
1164
+ getTeam with status `deactivated`. Its memberships are removed and the
1165
+ users whose lifecycle it owns are deactivated with it.
1166
+
1167
+ The request is idempotent. Deleting a team that is already deactivated
1168
+ or doesn't exist succeeds without changing anything.
1169
+
1170
+ * @summary Delete team
1171
+ */
1172
+ const deleteTeam = async (teamId, options) => {
1173
+ return customFetch(getDeleteTeamUrl(teamId), {
1174
+ ...options,
1175
+ method: "DELETE"
1176
+ });
1177
+ };
1178
+ const getUpdateTeamUrl = (teamId) => {
1179
+ return `${getProxyPath()}/teams/${teamId}`;
1180
+ };
1181
+ /**
1182
+ * Update team. Only active teams can be updated.
1183
+
1184
+ * @summary Update team
1185
+ */
1186
+ const updateTeam = async (teamId, updateTeamBody, options) => {
1187
+ return customFetch(getUpdateTeamUrl(teamId), {
1188
+ ...options,
1189
+ method: "PATCH",
1190
+ headers: {
1191
+ "Content-Type": "application/json",
1192
+ ...options?.headers
1193
+ },
1194
+ body: JSON.stringify(updateTeamBody)
1195
+ });
1196
+ };
1287
1197
  const getCreateBrandingUrl = (params) => {
1288
1198
  const normalizedParams = new URLSearchParams();
1289
1199
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1339,20 +1249,73 @@ const listBranding = async (params, options) => {
1339
1249
  method: "GET"
1340
1250
  });
1341
1251
  };
1342
- 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) => {
1343
1266
  const normalizedParams = new URLSearchParams();
1344
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
+ }
1345
1274
  if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1346
1275
  });
1347
1276
  const stringifiedParams = normalizedParams.toString();
1348
- return stringifiedParams.length > 0 ? `${getProxyPath()}/branding/${id}?${stringifiedParams}` : `${getProxyPath()}/branding/${id}`;
1277
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/events?${stringifiedParams}` : `${getProxyPath()}/events`;
1349
1278
  };
1350
1279
  /**
1351
- * Retrieves a single branding revision, including its stored configuration.
1352
- * @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
1353
1293
  */
1354
- const getBrandingById = async (id, params, options) => {
1355
- 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), {
1356
1319
  ...options,
1357
1320
  method: "GET"
1358
1321
  });
@@ -1383,7 +1346,7 @@ const getBrandingById = async (id, params, options) => {
1383
1346
  * generated orval function:
1384
1347
  *
1385
1348
  * const client = createZitadelClient({ baseUrl, token });
1386
- * await client.createProject({ previewOrigins: [] });
1349
+ * await client.createProject({ preview_origins: [] });
1387
1350
  * await client.createSchema(body, { project_id });
1388
1351
  */
1389
1352
  function createZitadelClient(opts) {
@@ -1400,7 +1363,7 @@ function createZitadelClient(opts) {
1400
1363
  } });
1401
1364
  }
1402
1365
  //#endregion
1403
- //#region ../config/dist/defaults-CXTnFMHj.mjs
1366
+ //#region ../config/dist/defaults-eiGHyI5Y.mjs
1404
1367
  var default_human_user_default = {
1405
1368
  title: "DefaultHumanUserSchema",
1406
1369
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -1411,14 +1374,8 @@ var default_human_user_default = {
1411
1374
  type: "object",
1412
1375
  description: "The default editable schema for human users.",
1413
1376
  "x-auth-methods": {
1414
- "password": {
1415
- "enabled": true,
1416
- "position": 1
1417
- },
1418
- "passkey": {
1419
- "enabled": true,
1420
- "position": 2
1421
- }
1377
+ "password": { "enabled": true },
1378
+ "passkey": { "enabled": true }
1422
1379
  },
1423
1380
  required: ["email"],
1424
1381
  properties: { "email": {
@@ -1441,21 +1398,34 @@ var default_login_default = {
1441
1398
  {
1442
1399
  "name": "identifier",
1443
1400
  "fields": ["email"],
1444
- "actions": [{
1445
- "name": "submit",
1446
- "kind": "submit",
1447
- "primary": true,
1448
- "text_key": "identifier.action.continue"
1449
- }, {
1450
- "name": "passkey",
1451
- "kind": "passkey",
1452
- "primary": false,
1453
- "text_key": "identifier.action.passkey"
1454
- }],
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
+ ],
1455
1421
  "transitions": {
1456
1422
  "submit": { "target": "password" },
1457
1423
  "passkey": { "target": "done" },
1458
- "user_not_found": { "target": "register" }
1424
+ "user_not_found": { "target": "register" },
1425
+ "register": {
1426
+ "target": "register",
1427
+ "purpose": "register"
1428
+ }
1459
1429
  }
1460
1430
  },
1461
1431
  {
@@ -1480,21 +1450,34 @@ var default_login_default = {
1480
1450
  {
1481
1451
  "name": "register",
1482
1452
  "fields": ["email"],
1483
- "actions": [{
1484
- "name": "submit",
1485
- "kind": "submit",
1486
- "primary": true,
1487
- "text_key": "register.action.password"
1488
- }, {
1489
- "name": "passkey_register",
1490
- "kind": "passkey_register",
1491
- "primary": false,
1492
- "text_key": "register.action.passkey"
1493
- }],
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
+ ],
1494
1473
  "transitions": {
1495
1474
  "submit": { "target": "register-password" },
1496
1475
  "passkey_register": { "target": "done" },
1497
- "user_already_exists": { "target": "password" }
1476
+ "user_already_exists": { "target": "password" },
1477
+ "sign_in": {
1478
+ "target": "identifier",
1479
+ "purpose": "login"
1480
+ }
1498
1481
  }
1499
1482
  },
1500
1483
  {
@@ -1528,14 +1511,8 @@ var human_user_default = {
1528
1511
  type: "object",
1529
1512
  description: "The default editable schema for human users (passkey-first sign-in).",
1530
1513
  "x-auth-methods": {
1531
- "passkey": {
1532
- "enabled": true,
1533
- "position": 1
1534
- },
1535
- "password": {
1536
- "enabled": true,
1537
- "position": 2
1538
- }
1514
+ "passkey": { "enabled": true },
1515
+ "password": { "enabled": true }
1539
1516
  },
1540
1517
  required: ["email"],
1541
1518
  properties: { "email": {
@@ -1558,41 +1535,67 @@ var login_default = {
1558
1535
  {
1559
1536
  "name": "passkey-first",
1560
1537
  "fields": [],
1561
- "actions": [{
1562
- "name": "passkey",
1563
- "kind": "passkey",
1564
- "primary": true,
1565
- "text_key": "passkey-first.action.passkey"
1566
- }, {
1567
- "name": "email_fallback",
1568
- "kind": "navigate",
1569
- "primary": false,
1570
- "text_key": "passkey-first.action.email_fallback"
1571
- }],
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
+ ],
1572
1558
  "transitions": {
1573
1559
  "passkey": { "target": "done" },
1574
1560
  "email_fallback": { "target": "identifier" },
1575
- "user_not_found": { "target": "register" }
1561
+ "user_not_found": { "target": "register" },
1562
+ "register": {
1563
+ "target": "register",
1564
+ "purpose": "register"
1565
+ }
1576
1566
  }
1577
1567
  },
1578
1568
  {
1579
1569
  "name": "identifier",
1580
1570
  "fields": ["email"],
1581
- "actions": [{
1582
- "name": "submit",
1583
- "kind": "submit",
1584
- "primary": true,
1585
- "text_key": "identifier.action.continue"
1586
- }, {
1587
- "name": "passkey",
1588
- "kind": "passkey",
1589
- "primary": false,
1590
- "text_key": "identifier.action.passkey"
1591
- }],
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
+ ],
1592
1591
  "transitions": {
1593
1592
  "submit": { "target": "password" },
1594
1593
  "passkey": { "target": "done" },
1595
- "user_not_found": { "target": "register" }
1594
+ "user_not_found": { "target": "register" },
1595
+ "register": {
1596
+ "target": "register",
1597
+ "purpose": "register"
1598
+ }
1596
1599
  }
1597
1600
  },
1598
1601
  {
@@ -1617,21 +1620,34 @@ var login_default = {
1617
1620
  {
1618
1621
  "name": "register",
1619
1622
  "fields": ["email"],
1620
- "actions": [{
1621
- "name": "passkey_register",
1622
- "kind": "passkey_register",
1623
- "primary": true,
1624
- "text_key": "register.action.passkey"
1625
- }, {
1626
- "name": "submit",
1627
- "kind": "submit",
1628
- "primary": false,
1629
- "text_key": "register.action.password"
1630
- }],
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
+ ],
1631
1643
  "transitions": {
1632
1644
  "passkey_register": { "target": "done" },
1633
1645
  "submit": { "target": "register-password" },
1634
- "user_already_exists": { "target": "password" }
1646
+ "user_already_exists": { "target": "password" },
1647
+ "sign_in": {
1648
+ "target": "passkey-first",
1649
+ "purpose": "login"
1650
+ }
1635
1651
  }
1636
1652
  },
1637
1653
  {
@@ -1832,12 +1848,12 @@ async function bootstrapProject(options) {
1832
1848
  const { baseUrl } = options;
1833
1849
  const project = await createZitadelClient({ baseUrl }).createProject({
1834
1850
  name: options.projectName ?? DEFAULT_PROJECT_NAME,
1835
- previewOrigins: options.appOrigins ?? [],
1836
- seedDefaults: false
1851
+ preview_origins: options.appOrigins ?? [],
1852
+ seed_defaults: false
1837
1853
  });
1838
1854
  const projectId = requireString(project.id, "project id");
1839
- const projectSecret = requireString(project.projectSecret, "project secret");
1840
- const previewSecret = typeof project.previewSecret === "string" ? project.previewSecret : void 0;
1855
+ const projectSecret = requireString(project.project_secret, "project secret");
1856
+ const previewSecret = typeof project.preview_secret === "string" ? project.preview_secret : void 0;
1841
1857
  const client = createZitadelClient({
1842
1858
  baseUrl,
1843
1859
  token: projectSecret
@@ -1988,9 +2004,8 @@ function getFreePort() {
1988
2004
  /**
1989
2005
  * Boot an ephemeral local server by shelling out to `zitadel start` and parse
1990
2006
  * its JSON envelope. The CLI owns the subtle parts (port preflight, health
1991
- * wait, process-group stop, embedded-Postgres reaping), so this module stays a
1992
- * thin adapter; swapping it for direct library calls later must not change the
1993
- * shape returned here.
2007
+ * wait, process-group stop), so this module stays a thin adapter; swapping it
2008
+ * for direct library calls later must not change the shape returned here.
1994
2009
  */
1995
2010
  async function bootLocalServer(options = {}) {
1996
2011
  const ownsDir = options.dir === void 0;
@@ -2095,8 +2110,9 @@ function identity() {
2095
2110
  }
2096
2111
  /**
2097
2112
  * Create a user that can immediately complete the password login flow:
2098
- * `POST /users` (the body must carry `$schema: <schema id>`) followed by
2099
- * `PUT /users/{id}/password` with `isChangeRequired: 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`.
2100
2116
  *
2101
2117
  * Defaults mint a unique email per call (email is x-unique per project), which
2102
2118
  * is what makes per-test seeding parallel-safe on a shared instance.
@@ -2106,14 +2122,16 @@ async function seedUser(client, context, input = {}) {
2106
2122
  const email = input.email ?? fresh.email;
2107
2123
  const password = input.password ?? fresh.password;
2108
2124
  const id = requireString((await client.createUser({
2109
- ...input.attributes,
2110
- $schema: context.schemaId,
2111
- email
2125
+ schema: context.schemaId,
2126
+ attributes: {
2127
+ ...input.attributes,
2128
+ email
2129
+ }
2112
2130
  }, { project_id: context.projectId })).id, "user id");
2113
2131
  await client.setUserPassword(id, {
2114
2132
  password,
2115
- isChangeRequired: false
2116
- }, { project_id: context.projectId });
2133
+ is_change_required: false
2134
+ });
2117
2135
  return {
2118
2136
  id,
2119
2137
  email,
@@ -2284,7 +2302,7 @@ function connectZitadel(handle) {
2284
2302
  };
2285
2303
  }
2286
2304
  /**
2287
- * Boot an ephemeral local instance (binary runtime + embedded Postgres, no
2305
+ * Boot an ephemeral local instance (binary runtime + SQLite by default, no
2288
2306
  * Docker) and bootstrap a project + default schema + login flow on it. The
2289
2307
  * result can seed loginable password users immediately.
2290
2308
  */
@@ -2353,4 +2371,4 @@ Object.defineProperty(exports, "startLocalZitadel", {
2353
2371
  }
2354
2372
  });
2355
2373
 
2356
- //# sourceMappingURL=src-BIL0PdSd.cjs.map
2374
+ //# sourceMappingURL=src-I0KAh1zU.cjs.map