@zitadel/testing 0.1.0-alpha.18 → 0.1.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (43) hide show
  1. package/README.md +105 -30
  2. package/dist/app-runner.cjs +4 -3
  3. package/dist/app-runner.cjs.map +1 -1
  4. package/dist/app-runner.d.mts +1 -1
  5. package/dist/app-runner.mjs +4 -3
  6. package/dist/app-runner.mjs.map +1 -1
  7. package/dist/{handshake-ClzWvG8z.mjs → handshake-CwlxMjW0.mjs} +20 -4
  8. package/dist/handshake-CwlxMjW0.mjs.map +1 -0
  9. package/dist/{handshake-CRKcgkfN.cjs → handshake-D6MXSUcd.cjs} +20 -4
  10. package/dist/handshake-D6MXSUcd.cjs.map +1 -0
  11. package/dist/index.cjs +4 -2
  12. package/dist/index.d.mts +10 -16
  13. package/dist/index.d.mts.map +1 -1
  14. package/dist/index.mjs +3 -3
  15. package/dist/{orchestration-C640_1Lg.mjs → orchestration-Clldecyr.mjs} +1 -1
  16. package/dist/{orchestration-C640_1Lg.mjs.map → orchestration-Clldecyr.mjs.map} +1 -1
  17. package/dist/{orchestration-D7QBgQ0l.cjs → orchestration-gIDANMcF.cjs} +1 -1
  18. package/dist/{orchestration-D7QBgQ0l.cjs.map → orchestration-gIDANMcF.cjs.map} +1 -1
  19. package/dist/playwright.cjs +42 -17
  20. package/dist/playwright.cjs.map +1 -1
  21. package/dist/playwright.d.mts +60 -43
  22. package/dist/playwright.d.mts.map +1 -1
  23. package/dist/playwright.mjs +40 -18
  24. package/dist/playwright.mjs.map +1 -1
  25. package/dist/session-BrSkzPpy.d.mts +204 -0
  26. package/dist/session-BrSkzPpy.d.mts.map +1 -0
  27. package/dist/src-CUvV1OWp.cjs +4187 -0
  28. package/dist/src-CUvV1OWp.cjs.map +1 -0
  29. package/dist/{src-eTcdx-ZS.mjs → src-DKJ1hMV8.mjs} +43 -17
  30. package/dist/src-DKJ1hMV8.mjs.map +1 -0
  31. package/dist/supervisor.cjs +3 -3
  32. package/dist/supervisor.cjs.map +1 -1
  33. package/dist/supervisor.d.mts +1 -1
  34. package/dist/supervisor.mjs +3 -3
  35. package/dist/supervisor.mjs.map +1 -1
  36. package/package.json +13 -9
  37. package/dist/app-env-D3W0GYhA.d.mts +0 -122
  38. package/dist/app-env-D3W0GYhA.d.mts.map +0 -1
  39. package/dist/handshake-CRKcgkfN.cjs.map +0 -1
  40. package/dist/handshake-ClzWvG8z.mjs.map +0 -1
  41. package/dist/src-DirKLqi4.cjs +0 -2312
  42. package/dist/src-DirKLqi4.cjs.map +0 -1
  43. package/dist/src-eTcdx-ZS.mjs.map +0 -1
@@ -1,2312 +0,0 @@
1
- const require_handshake = require("./handshake-CRKcgkfN.cjs");
2
- require("node:fs");
3
- require("node:url");
4
- let node_fs_promises = require("node:fs/promises");
5
- let node_os = require("node:os");
6
- let node_path = require("node:path");
7
- let node_child_process = require("node:child_process");
8
- let node_module = require("node:module");
9
- let node_net = require("node:net");
10
- let node_crypto = require("node:crypto");
11
- //#region ../api/dist/runtime/base-url.mjs
12
- let proxyPath = "";
13
- function getProxyPath() {
14
- return proxyPath;
15
- }
16
- function setProxyPath(path) {
17
- proxyPath = path;
18
- }
19
- //#endregion
20
- //#region ../api/dist/runtime/auth.mjs
21
- /**
22
- * Module-global bearer token used by the orval-generated client's
23
- * custom fetch. Set once at command boot (the same lifecycle pattern
24
- * as `base-url.ts`); every generated request reads from here.
25
- *
26
- * Keeping the token here means the CLI doesn't have to thread an
27
- * `Authorization` header through every generated call site; orval's
28
- * `mutator` wires `runtime/fetch.ts` in, and that file pulls the token
29
- * from this module.
30
- */
31
- let apiAuthToken;
32
- function getApiAuthToken() {
33
- return apiAuthToken;
34
- }
35
- function setApiAuthToken(token) {
36
- apiAuthToken = token;
37
- }
38
- //#endregion
39
- //#region ../api/dist/chunk-CfYAbeIz.mjs
40
- var __defProp = Object.defineProperty;
41
- var __exportAll = (all, no_symbols) => {
42
- let target = {};
43
- for (var name in all) __defProp(target, name, {
44
- get: all[name],
45
- enumerable: true
46
- });
47
- if (!no_symbols) __defProp(target, Symbol.toStringTag, { value: "Module" });
48
- return target;
49
- };
50
- //#endregion
51
- //#region ../api/dist/runtime/fetch.mjs
52
- /**
53
- * Framework-neutral failure type the orval-generated client throws on
54
- * any non-2xx response. Carries the HTTP status, the parsed error body
55
- * (the spec's `{code, message, details?}` envelope when the server
56
- * returned one), and the request URL — enough for callers to map to
57
- * their own error taxonomy without re-implementing the fetch layer.
58
- *
59
- * Callers that don't care about the distinction can catch `ApiError`
60
- * generically; callers that do (the CLI's `toZitadelError`) read
61
- * `status` and decide.
62
- */
63
- var ApiError = class extends Error {
64
- status;
65
- url;
66
- body;
67
- constructor(status, url, body, message) {
68
- super(message);
69
- this.name = "ApiError";
70
- this.status = status;
71
- this.url = url;
72
- this.body = body;
73
- }
74
- };
75
- /**
76
- * The orval `mutator` for the fetch client. Every generated operation
77
- * routes its request through this function instead of the global
78
- * `fetch`. We pin three concerns here so generated call sites stay
79
- * focused on the shape of one HTTP call:
80
- *
81
- * - bearer auth — read from `runtime/auth.ts` and attached automatically;
82
- * - non-2xx → throw — orval's stock client parses the body regardless
83
- * of status, so callers would have to inspect every response. Throw
84
- * `ApiError` on `!res.ok` so failures interrupt control flow;
85
- * - body parsing — return the parsed JSON typed as `T` (the operation's
86
- * return type, threaded through by orval), or `undefined` for the
87
- * spec's `204`/`205`/`304` no-body responses.
88
- */
89
- async function customFetch(url, options) {
90
- const token = getApiAuthToken();
91
- const headers = new Headers(options.headers);
92
- if (token && !headers.has("authorization")) headers.set("authorization", `Bearer ${token}`);
93
- const res = await fetch(url, {
94
- ...options,
95
- headers
96
- });
97
- const rawBody = [
98
- 204,
99
- 205,
100
- 304
101
- ].includes(res.status) ? "" : await res.text();
102
- const parsed = rawBody ? safeJsonParse(rawBody) : void 0;
103
- if (!res.ok) {
104
- const message = `${options.method ?? "GET"} ${url} returned ${res.status}`;
105
- throw new ApiError(res.status, url, parsed, message);
106
- }
107
- return parsed;
108
- }
109
- /**
110
- * `JSON.parse` wrapped so a non-JSON body (e.g. an HTML 502 from a
111
- * proxy) becomes `{ raw: "<text>" }` instead of throwing inside
112
- * `customFetch`. The thrown `ApiError` then carries something useful
113
- * for the user to see.
114
- */
115
- function safeJsonParse(text) {
116
- try {
117
- return JSON.parse(text);
118
- } catch {
119
- return { raw: text };
120
- }
121
- }
122
- //#endregion
123
- //#region ../api/dist/generated/endpoints/zitadelNextGen.mjs
124
- /**
125
- * Generated by orval v8.10.0 🍺
126
- * Do not edit manually.
127
- * Zitadel NextGen
128
- * This is the next generation of the Zitadel identity platform.
129
- * OpenAPI spec version: 0.0.1
130
- */
131
- var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
132
- completeClaim: () => completeClaim,
133
- createAuthAttempt: () => createAuthAttempt,
134
- createBranding: () => createBranding,
135
- createFlow: () => createFlow,
136
- createFlowDefinition: () => createFlowDefinition,
137
- createHandoff: () => createHandoff,
138
- createProject: () => createProject,
139
- createSchema: () => createSchema,
140
- createSession: () => createSession,
141
- createTeam: () => createTeam,
142
- createUser: () => createUser,
143
- deleteFlowDefinition: () => deleteFlowDefinition,
144
- deleteTeam: () => deleteTeam,
145
- deleteUserByID: () => deleteUserByID,
146
- exchangeHandoff: () => exchangeHandoff,
147
- getAuthAttempt: () => getAuthAttempt,
148
- getBrandingById: () => getBrandingById,
149
- getClaimStatus: () => getClaimStatus,
150
- getCompleteClaimUrl: () => getCompleteClaimUrl,
151
- getCreateAuthAttemptUrl: () => getCreateAuthAttemptUrl,
152
- getCreateBrandingUrl: () => getCreateBrandingUrl,
153
- getCreateFlowDefinitionUrl: () => getCreateFlowDefinitionUrl,
154
- getCreateFlowUrl: () => getCreateFlowUrl,
155
- getCreateHandoffUrl: () => getCreateHandoffUrl,
156
- getCreateProjectUrl: () => getCreateProjectUrl,
157
- getCreateSchemaUrl: () => getCreateSchemaUrl,
158
- getCreateSessionUrl: () => getCreateSessionUrl,
159
- getCreateTeamUrl: () => getCreateTeamUrl,
160
- getCreateUserUrl: () => getCreateUserUrl,
161
- getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
162
- getDeleteTeamUrl: () => getDeleteTeamUrl,
163
- getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
164
- getExchangeHandoffUrl: () => getExchangeHandoffUrl,
165
- getFlowDefinition: () => getFlowDefinition,
166
- getFlowStep: () => getFlowStep,
167
- getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
168
- getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
169
- getGetClaimStatusUrl: () => getGetClaimStatusUrl,
170
- getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
171
- getGetFlowStepUrl: () => getGetFlowStepUrl,
172
- getGetHealthUrl: () => getGetHealthUrl,
173
- getGetLiveUrl: () => getGetLiveUrl,
174
- getGetMySessionUrl: () => getGetMySessionUrl,
175
- getGetMyUserUrl: () => getGetMyUserUrl,
176
- getGetProjectUrl: () => getGetProjectUrl,
177
- getGetReadyUrl: () => getGetReadyUrl,
178
- getGetSchemaByIdUrl: () => getGetSchemaByIdUrl,
179
- getGetSessionUrl: () => getGetSessionUrl,
180
- getGetTeamUrl: () => getGetTeamUrl,
181
- getGetUserByIDUrl: () => getGetUserByIDUrl,
182
- getHealth: () => getHealth,
183
- getInitClaimUrl: () => getInitClaimUrl,
184
- getIssueChallengeUrl: () => getIssueChallengeUrl,
185
- getListBrandingUrl: () => getListBrandingUrl,
186
- getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
187
- getListSchemasUrl: () => getListSchemasUrl,
188
- getListUserPasskeysUrl: () => getListUserPasskeysUrl,
189
- getListUserTeamsUrl: () => getListUserTeamsUrl,
190
- getListUsersUrl: () => getListUsersUrl,
191
- getLive: () => getLive,
192
- getMySession: () => getMySession,
193
- getMyUser: () => getMyUser,
194
- getPatchProjectUrl: () => getPatchProjectUrl,
195
- getProject: () => getProject,
196
- getQueryProjectsUrl: () => getQueryProjectsUrl,
197
- getQuerySessionsUrl: () => getQuerySessionsUrl,
198
- getQueryTeamsUrl: () => getQueryTeamsUrl,
199
- getReady: () => getReady,
200
- getRevokeMySessionUrl: () => getRevokeMySessionUrl,
201
- getRevokeSessionUrl: () => getRevokeSessionUrl,
202
- getSchemaById: () => getSchemaById,
203
- getSession: () => getSession,
204
- getSetUserPasswordUrl: () => getSetUserPasswordUrl,
205
- getSubmitFlowStepUrl: () => getSubmitFlowStepUrl,
206
- getTeam: () => getTeam,
207
- getUpdateFlowDefinitionUrl: () => getUpdateFlowDefinitionUrl,
208
- getUpdateTeamUrl: () => getUpdateTeamUrl,
209
- getUserByID: () => getUserByID,
210
- getVerifyChallengeProofUrl: () => getVerifyChallengeProofUrl,
211
- initClaim: () => initClaim,
212
- issueChallenge: () => issueChallenge,
213
- listBranding: () => listBranding,
214
- listFlowDefinitions: () => listFlowDefinitions,
215
- listSchemas: () => listSchemas,
216
- listUserPasskeys: () => listUserPasskeys,
217
- listUserTeams: () => listUserTeams,
218
- listUsers: () => listUsers,
219
- patchProject: () => patchProject,
220
- queryProjects: () => queryProjects,
221
- querySessions: () => querySessions,
222
- queryTeams: () => queryTeams,
223
- revokeMySession: () => revokeMySession,
224
- revokeSession: () => revokeSession,
225
- setUserPassword: () => setUserPassword,
226
- submitFlowStep: () => submitFlowStep,
227
- updateFlowDefinition: () => updateFlowDefinition,
228
- updateTeam: () => updateTeam,
229
- verifyChallengeProof: () => verifyChallengeProof
230
- });
231
- const getGetHealthUrl = () => {
232
- return `${getProxyPath()}/healthz`;
233
- };
234
- /**
235
- * Check whether the server is healthy
236
- * @summary Check server health
237
- */
238
- const getHealth = async (options) => {
239
- return customFetch(getGetHealthUrl(), {
240
- ...options,
241
- method: "GET"
242
- });
243
- };
244
- const getGetLiveUrl = () => {
245
- return `${getProxyPath()}/livez`;
246
- };
247
- /**
248
- * Check whether the server is started
249
- * @summary Check server liveness
250
- */
251
- const getLive = async (options) => {
252
- return customFetch(getGetLiveUrl(), {
253
- ...options,
254
- method: "GET"
255
- });
256
- };
257
- const getGetReadyUrl = () => {
258
- return `${getProxyPath()}/readyz`;
259
- };
260
- /**
261
- * Check whether the server is ready to accept requests
262
- * @summary Check server readiness
263
- */
264
- const getReady = async (options) => {
265
- return customFetch(getGetReadyUrl(), {
266
- ...options,
267
- method: "GET"
268
- });
269
- };
270
- const getCreateUserUrl = (params) => {
271
- const normalizedParams = new URLSearchParams();
272
- Object.entries(params || {}).forEach(([key, value]) => {
273
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
274
- });
275
- const stringifiedParams = normalizedParams.toString();
276
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users?${stringifiedParams}` : `${getProxyPath()}/users`;
277
- };
278
- /**
279
- * @summary Create user
280
- */
281
- const createUser = async (createUserBody, params, options) => {
282
- return customFetch(getCreateUserUrl(params), {
283
- ...options,
284
- method: "POST",
285
- headers: {
286
- "Content-Type": "application/json",
287
- ...options?.headers
288
- },
289
- body: JSON.stringify(createUserBody)
290
- });
291
- };
292
- const getListUsersUrl = (params) => {
293
- const normalizedParams = new URLSearchParams();
294
- Object.entries(params || {}).forEach(([key, value]) => {
295
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
296
- });
297
- const stringifiedParams = normalizedParams.toString();
298
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users?${stringifiedParams}` : `${getProxyPath()}/users`;
299
- };
300
- /**
301
- * @summary List users
302
- */
303
- const listUsers = async (params, options) => {
304
- return customFetch(getListUsersUrl(params), {
305
- ...options,
306
- method: "GET"
307
- });
308
- };
309
- const getGetUserByIDUrl = (userId, params) => {
310
- const normalizedParams = new URLSearchParams();
311
- Object.entries(params || {}).forEach(([key, value]) => {
312
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
313
- });
314
- const stringifiedParams = normalizedParams.toString();
315
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;
316
- };
317
- /**
318
- * @summary Get user by ID
319
- */
320
- const getUserByID = async (userId, params, options) => {
321
- return customFetch(getGetUserByIDUrl(userId, params), {
322
- ...options,
323
- method: "GET"
324
- });
325
- };
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}`;
333
- };
334
- /**
335
- * @summary Delete user by ID
336
- */
337
- const deleteUserByID = async (userId, params, options) => {
338
- return customFetch(getDeleteUserByIDUrl(userId, params), {
339
- ...options,
340
- method: "DELETE"
341
- });
342
- };
343
- const getListUserPasskeysUrl = (userId, params) => {
344
- const normalizedParams = new URLSearchParams();
345
- Object.entries(params || {}).forEach(([key, value]) => {
346
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
347
- });
348
- const stringifiedParams = normalizedParams.toString();
349
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/passkeys?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/passkeys`;
350
- };
351
- /**
352
- * @summary List user passkeys
353
- */
354
- const listUserPasskeys = async (userId, params, options) => {
355
- return customFetch(getListUserPasskeysUrl(userId, params), {
356
- ...options,
357
- method: "GET"
358
- });
359
- };
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`;
367
- };
368
- /**
369
- * @summary Set user password
370
- */
371
- const setUserPassword = async (userId, setUserPasswordBody, params, options) => {
372
- return customFetch(getSetUserPasswordUrl(userId, params), {
373
- ...options,
374
- method: "PUT",
375
- headers: {
376
- "Content-Type": "application/json",
377
- ...options?.headers
378
- },
379
- body: JSON.stringify(setUserPasswordBody)
380
- });
381
- };
382
- const getListUserTeamsUrl = (userId, params) => {
383
- const normalizedParams = new URLSearchParams();
384
- Object.entries(params || {}).forEach(([key, value]) => {
385
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
386
- });
387
- const stringifiedParams = normalizedParams.toString();
388
- return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/teams?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/teams`;
389
- };
390
- /**
391
- * The user's team roster, ordered by team name. Each entry carries the
392
- team's name, so a client renders a page without resolving ids one by one.
393
-
394
- This is the N:N roster and it is not lifecycle ownership: the single team
395
- that owns the user's lifecycle is reported as `metadata.lifecycle_owner_team_id`
396
- on the user read endpoints. Memberships the user was removed from are not
397
- returned.
398
-
399
- * @summary List the teams a user belongs to
400
- */
401
- const listUserTeams = async (userId, params, options) => {
402
- return customFetch(getListUserTeamsUrl(userId, params), {
403
- ...options,
404
- method: "GET"
405
- });
406
- };
407
- const getGetMyUserUrl = () => {
408
- return `${getProxyPath()}/users/me`;
409
- };
410
- /**
411
- * @summary Get my user information
412
- */
413
- const getMyUser = async (options) => {
414
- return customFetch(getGetMyUserUrl(), {
415
- ...options,
416
- method: "GET"
417
- });
418
- };
419
- const getCreateFlowUrl = () => {
420
- return `${getProxyPath()}/flow`;
421
- };
422
- /**
423
- * Resolves a flow definition based on purpose + audience context and returns
424
- the first capability step. Creates a new session implicitly unless
425
- `session_id` is provided (for step-up / reauth on an existing session).
426
-
427
- The response contains an `id` field — the flow handle. Use it as the path
428
- parameter for all subsequent `/flow/{id}/submit` calls.
429
-
430
- The response also sets an encrypted `HttpOnly` cookie (`_zflow`) containing
431
- the flow's orchestration state (current step, collected data, history).
432
- The server is stateless between requests — all flow state lives in this
433
- cookie. The browser sends it automatically on subsequent requests.
434
-
435
- * @summary Start a new flow
436
- */
437
- const createFlow = async (createFlowBody, options) => {
438
- return customFetch(getCreateFlowUrl(), {
439
- ...options,
440
- method: "POST",
441
- headers: {
442
- "Content-Type": "application/json",
443
- ...options?.headers
444
- },
445
- body: JSON.stringify(createFlowBody)
446
- });
447
- };
448
- const getGetFlowStepUrl = (id) => {
449
- return `${getProxyPath()}/flow/${id}`;
450
- };
451
- /**
452
- * Returns the current capability step without advancing the state machine.
453
- Useful for page reloads or re-rendering after a network error.
454
-
455
- * @summary Get current step (re-render)
456
- */
457
- const getFlowStep = async (id, options) => {
458
- return customFetch(getGetFlowStepUrl(id), {
459
- ...options,
460
- method: "GET"
461
- });
462
- };
463
- const getSubmitFlowStepUrl = (id) => {
464
- return `${getProxyPath()}/flow/${id}/submit`;
465
- };
466
- /**
467
- * Submits user input for the current step. The server validates,
468
- processes (e.g., verifies a credential), advances the state machine
469
- through any invisible steps, and returns the next visible step.
470
-
471
- The response sets an updated encrypted `HttpOnly` cookie (`_zflow`)
472
- with the new flow state. The server is stateless — all orchestration
473
- state is carried in this cookie between requests.
474
-
475
- **Important:** The `id` in the response may differ from the `id` used in
476
- the request. This happens when a flow pivots (pushes a new flow onto the
477
- stack) or when a stacked flow completes (auto-pops to the parent flow).
478
- Always use the `id` from the latest response for the next request.
479
-
480
- ## Flow completion
481
-
482
- When `step.type` is `complete`, the flow is terminal. The `step.behavior`
483
- field tells the frontend what to do:
484
-
485
- | `behavior` | Action |
486
- |------------- |------------------------------------------------------------|
487
- | `redirect` | Navigate to `redirect_uri` (OIDC/SAML auth request done). |
488
- | `show` | Render the step as a success screen (e.g., registration). |
489
-
490
- A `complete` step is only returned when the **entire flow stack** is done.
491
- If a stacked flow (e.g., recovery pivoted from login) finishes, the server
492
- auto-pops to the parent flow and returns the parent's next step — the
493
- frontend never sees a `complete` for intermediate flows.
494
-
495
- * @summary Submit step data and advance
496
- */
497
- const submitFlowStep = async (id, submitFlowStepBody, options) => {
498
- return customFetch(getSubmitFlowStepUrl(id), {
499
- ...options,
500
- method: "POST",
501
- headers: {
502
- "Content-Type": "application/json",
503
- ...options?.headers
504
- },
505
- body: JSON.stringify(submitFlowStepBody)
506
- });
507
- };
508
- const getCreateAuthAttemptUrl = () => {
509
- return `${getProxyPath()}/auth_attempts`;
510
- };
511
- /**
512
- * Starts a new authentication attempt. This is the entry point for the auth_attempts state machine.
513
-
514
- An attempt is an ephemeral (15-minute TTL) state machine that drives a single authentication round.
515
- It accepts factor challenges, verifies proofs, and completes into a session or handoff token.
516
-
517
- Accepts a project_id and challenge_nonce (from POST /bootstrap/challenge). For step-up re-auth,
518
- also include session_id to add factors to an existing session.
519
-
520
- * @summary Create a new authentication attempt
521
- */
522
- const createAuthAttempt = async (createAuthAttemptBody, options) => {
523
- return customFetch(getCreateAuthAttemptUrl(), {
524
- ...options,
525
- method: "POST",
526
- headers: {
527
- "Content-Type": "application/json",
528
- ...options?.headers
529
- },
530
- body: JSON.stringify(createAuthAttemptBody)
531
- });
532
- };
533
- const getGetAuthAttemptUrl = (attemptId) => {
534
- return `${getProxyPath()}/auth_attempts/${attemptId}`;
535
- };
536
- /**
537
- * Polls the current state of an authentication attempt.
538
-
539
- Returns the attempt's state, available factors for the next challenge,
540
- challenges issued so far, and any errors preventing progress.
541
-
542
- Use this for polling during long-running factor verifications (e.g., waiting for
543
- a federated IdP callback or a device flow).
544
-
545
- * @summary Get authentication attempt state
546
- */
547
- const getAuthAttempt = async (attemptId, options) => {
548
- return customFetch(getGetAuthAttemptUrl(attemptId), {
549
- ...options,
550
- method: "GET"
551
- });
552
- };
553
- const getIssueChallengeUrl = (attemptId) => {
554
- return `${getProxyPath()}/auth_attempts/${attemptId}/challenges`;
555
- };
556
- /**
557
- * Issues a single-factor verification challenge within an auth attempt.
558
-
559
- This advances the authentication state machine by requesting a specific factor method
560
- (password, passkey, TOTP, OTP via SMS, etc.). The server responds with challenge details
561
- including method, metadata, and any UI hints. The client then verifies the proof
562
- by calling POST /auth_attempts/{attempt_id}/challenges/{challenge_id}/verify.
563
-
564
- * @summary Issue a factor challenge
565
- */
566
- const issueChallenge = async (attemptId, issueChallengeBody, options) => {
567
- return customFetch(getIssueChallengeUrl(attemptId), {
568
- ...options,
569
- method: "POST",
570
- headers: {
571
- "Content-Type": "application/json",
572
- ...options?.headers
573
- },
574
- body: JSON.stringify(issueChallengeBody)
575
- });
576
- };
577
- const getVerifyChallengeProofUrl = (attemptId, challengeId) => {
578
- return `${getProxyPath()}/auth_attempts/${attemptId}/challenges/${challengeId}/verify`;
579
- };
580
- /**
581
- * Submits a proof (credential, code, assertion) to verify a factor challenge.
582
-
583
- The proof format depends on the challenge method. For example:
584
- - `password` method: { password: "…" }
585
- - `totp` method: { totp: { code: "123456" } }
586
- - `passkey` method: { passkey: { assertion: "…" } }
587
- - `recovery_code` method: { recovery_code: "…" }
588
-
589
- On successful verification, the factor is written to the auth attempt.
590
- The attempt moves to the next pending challenge or completes if all required factors are verified.
591
-
592
- * @summary Verify a factor proof
593
- */
594
- const verifyChallengeProof = async (attemptId, challengeId, verifyChallengeProofBody, options) => {
595
- return customFetch(getVerifyChallengeProofUrl(attemptId, challengeId), {
596
- ...options,
597
- method: "POST",
598
- headers: {
599
- "Content-Type": "application/json",
600
- ...options?.headers
601
- },
602
- body: JSON.stringify(verifyChallengeProofBody)
603
- });
604
- };
605
- const getCreateHandoffUrl = (attemptId) => {
606
- return `${getProxyPath()}/auth_attempts/${attemptId}/handoff`;
607
- };
608
- /**
609
- * Completes the authentication attempt and mints a `handoff_token`.
610
-
611
- Call this after all required factors have been verified and the attempt is in `completed` state.
612
- The handoff token is short-lived (≤60 seconds) and must be exchanged at
613
- POST /sessions/exchange to receive the final session and session_token.
614
-
615
- The handoff token is:
616
- - Single-use (atomic exchange, no retry)
617
- - Audience-bound (requires matching project key for exchange)
618
- - Idempotency-safe within a 5-minute window (see conventions)
619
-
620
- * @summary Complete authentication and create handoff token
621
- */
622
- const createHandoff = async (attemptId, options) => {
623
- return customFetch(getCreateHandoffUrl(attemptId), {
624
- ...options,
625
- method: "POST"
626
- });
627
- };
628
- const getCreateProjectUrl = () => {
629
- return `${getProxyPath()}/projects`;
630
- };
631
- /**
632
- * @summary Create project
633
- */
634
- const createProject = async (createProjectBody, options) => {
635
- return customFetch(getCreateProjectUrl(), {
636
- ...options,
637
- method: "POST",
638
- headers: {
639
- "Content-Type": "application/json",
640
- ...options?.headers
641
- },
642
- body: JSON.stringify(createProjectBody)
643
- });
644
- };
645
- const getQueryProjectsUrl = () => {
646
- return `${getProxyPath()}/projects/query`;
647
- };
648
- /**
649
- * @summary Query projects
650
- */
651
- const queryProjects = async (queryProjectsBody, options) => {
652
- return customFetch(getQueryProjectsUrl(), {
653
- ...options,
654
- method: "POST",
655
- headers: {
656
- "Content-Type": "application/json",
657
- ...options?.headers
658
- },
659
- body: JSON.stringify(queryProjectsBody)
660
- });
661
- };
662
- const getGetProjectUrl = (projectId) => {
663
- return `${getProxyPath()}/projects/${projectId}`;
664
- };
665
- /**
666
- * Returns the current state of a project.
667
-
668
- * @summary Get project
669
- */
670
- const getProject = async (projectId, options) => {
671
- return customFetch(getGetProjectUrl(projectId), {
672
- ...options,
673
- method: "GET"
674
- });
675
- };
676
- const getPatchProjectUrl = (projectId) => {
677
- return `${getProxyPath()}/projects/${projectId}`;
678
- };
679
- /**
680
- * Updates the state of a project.
681
-
682
- * @summary Update project
683
- */
684
- const patchProject = async (projectId, patchProjectBody, options) => {
685
- return customFetch(getPatchProjectUrl(projectId), {
686
- ...options,
687
- method: "PATCH",
688
- headers: {
689
- "Content-Type": "application/json",
690
- ...options?.headers
691
- },
692
- body: JSON.stringify(patchProjectBody)
693
- });
694
- };
695
- const getInitClaimUrl = (projectId) => {
696
- return `${getProxyPath()}/projects/${projectId}/claim/init`;
697
- };
698
- /**
699
- * Starts a claim challenge for an unclaimed project. Authenticated by the
700
- project secret, this mints a single-use, short-lived challenge and returns
701
- the `claim_url` the developer opens in a browser to complete the claim,
702
- together with the `challenge_id` the CLI polls with. The exact expiry is
703
- carried by `expires_at` on the response.
704
-
705
- * @summary Initialize a project claim
706
- */
707
- const initClaim = async (projectId, options) => {
708
- return customFetch(getInitClaimUrl(projectId), {
709
- ...options,
710
- method: "POST"
711
- });
712
- };
713
- const getGetClaimStatusUrl = (projectId, params) => {
714
- const normalizedParams = new URLSearchParams();
715
- Object.entries(params || {}).forEach(([key, value]) => {
716
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
717
- });
718
- const stringifiedParams = normalizedParams.toString();
719
- return stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${projectId}/claim/status?${stringifiedParams}` : `${getProxyPath()}/projects/${projectId}/claim/status`;
720
- };
721
- /**
722
- * Polled by the CLI while a browser completes the claim. Authorized by the
723
- project secret that initiated the challenge. Returns `pending`, or
724
- `completed` with the owning team, the claim timestamp, and the dashboard
725
- URL once the browser leg has finished.
726
-
727
- * @summary Get claim status
728
- */
729
- const getClaimStatus = async (projectId, params, options) => {
730
- return customFetch(getGetClaimStatusUrl(projectId, params), {
731
- ...options,
732
- method: "GET"
733
- });
734
- };
735
- const getCompleteClaimUrl = (projectId) => {
736
- return `${getProxyPath()}/projects/${projectId}/claim/complete`;
737
- };
738
- /**
739
- * Called by the browser after the developer authenticates on the claim page.
740
- Authenticated by the `__nextgen_session` cookie, it attaches the project to
741
- the developer's personal team using the `challenge_id` from the claim URL as
742
- its single-use, browser-safe authorization.
743
-
744
- * @summary Complete a project claim
745
- */
746
- const completeClaim = async (projectId, completeClaimBody, options) => {
747
- return customFetch(getCompleteClaimUrl(projectId), {
748
- ...options,
749
- method: "POST",
750
- headers: {
751
- "Content-Type": "application/json",
752
- ...options?.headers
753
- },
754
- body: JSON.stringify(completeClaimBody)
755
- });
756
- };
757
- const getCreateSessionUrl = () => {
758
- return `${getProxyPath()}/sessions`;
759
- };
760
- /**
761
- * Creates an anonymous session shell with no user and no factors (`state: building`).
762
-
763
- This is optional — an `auth_attempt` will create a session implicitly if none is provided.
764
- Use this explicitly when you want to:
765
- - Pre-allocate a `session_id` before the user is known, so device/telemetry signals
766
- can be correlated with the eventual authenticated session from the start.
767
- - Track anonymous state (bot detection, device fingerprint) that survives until authentication.
768
-
769
- Creating a session is an app-plane operation on the project credential
770
- (`session.write`). The returned `session_token` is a session credential for the
771
- end-user client, not a management scope: it is delivered as the
772
- `__nextgen_session` cookie and authorises the self-service operations
773
- `GET /sessions/me` and `DELETE /sessions/me` (`nextgenSession` scheme). The
774
- by-id operations `GET /sessions/{session_id}` and `DELETE /sessions/{session_id}`
775
- are operator endpoints and require `session.read` / `session.delete` instead.
776
-
777
- The `session_token` is superseded when a handoff exchange completes — clients must
778
- replace it at that point.
779
-
780
- Anonymous sessions expire aggressively (10-minute TTL). The TTL resets to the configured
781
- full session TTL when the first authentication factor is written via a completing `auth_attempt`.
782
-
783
- * @summary Create an anonymous session shell
784
- */
785
- const createSession = async (createSessionBody, options) => {
786
- return customFetch(getCreateSessionUrl(), {
787
- ...options,
788
- method: "POST",
789
- headers: {
790
- "Content-Type": "application/json",
791
- ...options?.headers
792
- },
793
- body: JSON.stringify(createSessionBody)
794
- });
795
- };
796
- const getQuerySessionsUrl = (params) => {
797
- const normalizedParams = new URLSearchParams();
798
- Object.entries(params || {}).forEach(([key, value]) => {
799
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
800
- });
801
- const stringifiedParams = normalizedParams.toString();
802
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/query?${stringifiedParams}` : `${getProxyPath()}/sessions/query`;
803
- };
804
- /**
805
- * Returns the sessions of a project, paginated with a cursor.
806
- Sessions of every lifecycle state are returned; each carries its `state`.
807
- Requires `session.read` permission.
808
-
809
- * @summary Query sessions
810
- */
811
- const querySessions = async (querySessionsBody, params, options) => {
812
- return customFetch(getQuerySessionsUrl(params), {
813
- ...options,
814
- method: "POST",
815
- headers: {
816
- "Content-Type": "application/json",
817
- ...options?.headers
818
- },
819
- body: JSON.stringify(querySessionsBody)
820
- });
821
- };
822
- const getExchangeHandoffUrl = (params) => {
823
- const normalizedParams = new URLSearchParams();
824
- Object.entries(params || {}).forEach(([key, value]) => {
825
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
826
- });
827
- const stringifiedParams = normalizedParams.toString();
828
- return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/exchange?${stringifiedParams}` : `${getProxyPath()}/sessions/exchange`;
829
- };
830
- /**
831
- * Consumes a one-time `handoff_token` minted by `POST /auth_attempts/{id}/handoff`
832
- and returns the resulting session and a `session_token`.
833
-
834
- The server resolves the originating `auth_attempt` from the token and then:
835
-
836
- | Originating auth_attempt | Outcome |
837
- |---|---|
838
- | No `session_id` | A new authenticated session is **created**. |
839
- | `session_id` points to an anonymous shell | Existing session is **upgraded** — user and factors written in, TTL reset to full session TTL. |
840
- | `session_id` points to an active session (step-up) | Existing session is **upgraded** — new factors merged, `assurance_levels[]` expanded. |
841
-
842
- The response shape is identical in all three cases.
843
-
844
- The `session_token` supersedes any previously issued `session_token` for the same session.
845
- Clients must replace their stored token at this point.
846
-
847
- Requires a project service key (OAuth2 client credentials).
848
-
849
- * @summary Exchange handoff token for a session
850
- */
851
- const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
852
- return customFetch(getExchangeHandoffUrl(params), {
853
- ...options,
854
- method: "POST",
855
- headers: {
856
- "Content-Type": "application/json",
857
- ...options?.headers
858
- },
859
- body: JSON.stringify(exchangeHandoffBody)
860
- });
861
- };
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}`;
869
- };
870
- /**
871
- * Returns the current state of a session including its factors and all currently
872
- satisfied assurance levels.
873
-
874
- `assurance_levels[]` may shrink over time as factor freshness windows expire,
875
- without the session itself expiring. Use step-up authentication (a new `auth_attempt`
876
- against the same `session_id`) to restore a dropped assurance level.
877
-
878
- * @summary Get session state
879
- */
880
- const getSession = async (sessionId, params, options) => {
881
- return customFetch(getGetSessionUrl(sessionId, params), {
882
- ...options,
883
- method: "GET"
884
- });
885
- };
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}`;
893
- };
894
- /**
895
- * Permanently deletes the session, terminating it immediately.
896
-
897
- This is the operator revoke path and requires the `session.delete` scope on a
898
- project-bound credential. End-user logout with the `__nextgen_session` cookie is
899
- `DELETE /sessions/me` (`nextgenSession` scheme).
900
-
901
- Idempotent: deleting a session that does not exist (or was already deleted)
902
- still returns 204. After deletion, any tokens derived from the session are
903
- invalidated.
904
-
905
- * @summary Revoke session
906
- */
907
- const revokeSession = async (sessionId, params, options) => {
908
- return customFetch(getRevokeSessionUrl(sessionId, params), {
909
- ...options,
910
- method: "DELETE"
911
- });
912
- };
913
- const getGetMySessionUrl = () => {
914
- return `${getProxyPath()}/sessions/me`;
915
- };
916
- /**
917
- * Returns the current state of the current session including its factors and all currently
918
- satisfied assurance levels.
919
-
920
- `assurance_levels[]` may shrink over time as factor freshness windows expire,
921
- without the session itself expiring. Use step-up authentication (a new `auth_attempt`
922
- against the same `session_id`) to restore a dropped assurance level.
923
-
924
- * @summary Get my session state
925
- */
926
- const getMySession = async (options) => {
927
- return customFetch(getGetMySessionUrl(), {
928
- ...options,
929
- method: "GET"
930
- });
931
- };
932
- const getRevokeMySessionUrl = () => {
933
- return `${getProxyPath()}/sessions/me`;
934
- };
935
- /**
936
- * Logs out by permanently deleting the session.
937
-
938
- The `__nextgen_session` cookie issued at creation (or superseded by a handoff
939
- exchange) is required. Idempotent: if the session is already gone this still
940
- returns 204. Any tokens derived from the session are invalidated, and the
941
- cookie itself is cleared in the response.
942
-
943
- * @summary Revoke my session
944
- */
945
- const revokeMySession = async (options) => {
946
- return customFetch(getRevokeMySessionUrl(), {
947
- ...options,
948
- method: "DELETE"
949
- });
950
- };
951
- const getCreateSchemaUrl = (params) => {
952
- const normalizedParams = new URLSearchParams();
953
- Object.entries(params || {}).forEach(([key, value]) => {
954
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
955
- });
956
- const stringifiedParams = normalizedParams.toString();
957
- return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;
958
- };
959
- /**
960
- * Create a new schema. The optional `$id` field is the JSON Schema document
961
- URI used to identify the schema in future requests (GitOps-stable identity,
962
- not a free-form resource primary key). When `$id` is omitted, the server
963
- generates a `sch_*` URL. When provided, `$id` must be unique within the
964
- project and should ideally be a valid URI pointing at where the schema can
965
- be accessed.
966
-
967
- The schema can either be a concrete schema, e.g. a user schema, or a
968
- schema-url which will be resolved by the server.
969
-
970
- * @summary Create new schema
971
- */
972
- const createSchema = async (createSchemaBody, params, options) => {
973
- return customFetch(getCreateSchemaUrl(params), {
974
- ...options,
975
- method: "POST",
976
- headers: {
977
- "Content-Type": "application/json",
978
- ...options?.headers
979
- },
980
- body: JSON.stringify(createSchemaBody)
981
- });
982
- };
983
- const getListSchemasUrl = (params) => {
984
- const normalizedParams = new URLSearchParams();
985
- Object.entries(params || {}).forEach(([key, value]) => {
986
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
987
- });
988
- const stringifiedParams = normalizedParams.toString();
989
- return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;
990
- };
991
- /**
992
- * Retrieve a list of all schemas available in the system. This endpoint
993
- supports pagination and filtering based on schema attributes.
994
-
995
- * @summary List all schemas
996
- */
997
- const listSchemas = async (params, options) => {
998
- return customFetch(getListSchemasUrl(params), {
999
- ...options,
1000
- method: "GET"
1001
- });
1002
- };
1003
- const getGetSchemaByIdUrl = (id, params) => {
1004
- const normalizedParams = new URLSearchParams();
1005
- Object.entries(params || {}).forEach(([key, value]) => {
1006
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1007
- });
1008
- const stringifiedParams = normalizedParams.toString();
1009
- return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas/${id}?${stringifiedParams}` : `${getProxyPath()}/schemas/${id}`;
1010
- };
1011
- /**
1012
- * Get a schema by its ID. This will return the default revision of the schema.
1013
- * @summary Get schema by ID
1014
- */
1015
- const getSchemaById = async (id, params, options) => {
1016
- return customFetch(getGetSchemaByIdUrl(id, params), {
1017
- ...options,
1018
- method: "GET"
1019
- });
1020
- };
1021
- const getCreateFlowDefinitionUrl = () => {
1022
- return `${getProxyPath()}/flow_definitions`;
1023
- };
1024
- /**
1025
- * Creates a new flow definition.
1026
- Flow definitions are templates that define the sequence of steps (capabilities)
1027
- for a particular user journey (e.g., registration, login, password reset).
1028
-
1029
- Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
1030
-
1031
- * @summary Create a new flow definition
1032
- */
1033
- const createFlowDefinition = async (createFlowDefinitionBody, options) => {
1034
- return customFetch(getCreateFlowDefinitionUrl(), {
1035
- ...options,
1036
- method: "POST",
1037
- headers: {
1038
- "Content-Type": "application/json",
1039
- ...options?.headers
1040
- },
1041
- body: JSON.stringify(createFlowDefinitionBody)
1042
- });
1043
- };
1044
- const getListFlowDefinitionsUrl = (params) => {
1045
- const normalizedParams = new URLSearchParams();
1046
- Object.entries(params || {}).forEach(([key, value]) => {
1047
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1048
- });
1049
- const stringifiedParams = normalizedParams.toString();
1050
- return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions?${stringifiedParams}` : `${getProxyPath()}/flow_definitions`;
1051
- };
1052
- /**
1053
- * Retrieves a list of all flow definitions.
1054
- This endpoint can be used to view existing flow definitions and their configurations.
1055
-
1056
- * @summary List flow definitions
1057
- */
1058
- const listFlowDefinitions = async (params, options) => {
1059
- return customFetch(getListFlowDefinitionsUrl(params), {
1060
- ...options,
1061
- method: "GET"
1062
- });
1063
- };
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}`;
1071
- };
1072
- /**
1073
- * Get a flow definition by id
1074
- * @summary Get a flow definition by id
1075
- */
1076
- const getFlowDefinition = async (id, params, options) => {
1077
- return customFetch(getGetFlowDefinitionUrl(id, params), {
1078
- ...options,
1079
- method: "GET"
1080
- });
1081
- };
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}`;
1089
- };
1090
- /**
1091
- * Update a flow definition by id. This endpoint replaces the existing flow definition.
1092
- If `flow_definition.status` is omitted, the current status is preserved
1093
-
1094
- * @summary Update a flow definition by id
1095
- */
1096
- const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, options) => {
1097
- return customFetch(getUpdateFlowDefinitionUrl(id, params), {
1098
- ...options,
1099
- method: "PUT",
1100
- headers: {
1101
- "Content-Type": "application/json",
1102
- ...options?.headers
1103
- },
1104
- body: JSON.stringify(updateFlowDefinitionBody)
1105
- });
1106
- };
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}`;
1114
- };
1115
- /**
1116
- * Delete a flow definition by id.
1117
- If the flow definition is currently being used by a flow, the deletion will fail.
1118
- If the flow definition is the last active flow definition for a given purpose, the deletion will fail to prevent disruption of new flows being started for that purpose.
1119
-
1120
- * @summary Delete a flow definition by id
1121
- */
1122
- const deleteFlowDefinition = async (id, params, options) => {
1123
- return customFetch(getDeleteFlowDefinitionUrl(id, params), {
1124
- ...options,
1125
- method: "DELETE"
1126
- });
1127
- };
1128
- const getCreateTeamUrl = (params) => {
1129
- const normalizedParams = new URLSearchParams();
1130
- Object.entries(params || {}).forEach(([key, value]) => {
1131
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1132
- });
1133
- const stringifiedParams = normalizedParams.toString();
1134
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;
1135
- };
1136
- /**
1137
- * @summary Create team
1138
- */
1139
- const createTeam = async (createTeamBody, params, options) => {
1140
- return customFetch(getCreateTeamUrl(params), {
1141
- ...options,
1142
- method: "POST",
1143
- headers: {
1144
- "Content-Type": "application/json",
1145
- ...options?.headers
1146
- },
1147
- body: JSON.stringify(createTeamBody)
1148
- });
1149
- };
1150
- const getQueryTeamsUrl = (params) => {
1151
- const normalizedParams = new URLSearchParams();
1152
- Object.entries(params || {}).forEach(([key, value]) => {
1153
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1154
- });
1155
- const stringifiedParams = normalizedParams.toString();
1156
- return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/query?${stringifiedParams}` : `${getProxyPath()}/teams/query`;
1157
- };
1158
- /**
1159
- * Returns the teams of a project, paginated with a cursor.
1160
- Teams of every lifecycle status are returned; each carries its `status`.
1161
-
1162
- * @summary Query teams
1163
- */
1164
- const queryTeams = async (queryTeamsBody, params, options) => {
1165
- return customFetch(getQueryTeamsUrl(params), {
1166
- ...options,
1167
- method: "POST",
1168
- headers: {
1169
- "Content-Type": "application/json",
1170
- ...options?.headers
1171
- },
1172
- body: JSON.stringify(queryTeamsBody)
1173
- });
1174
- };
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}`;
1182
- };
1183
- /**
1184
- * Returns a Team by its id.
1185
-
1186
- * @summary Get team
1187
- */
1188
- const getTeam = async (teamId, params, options) => {
1189
- return customFetch(getGetTeamUrl(teamId, params), {
1190
- ...options,
1191
- method: "GET"
1192
- });
1193
- };
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}`;
1201
- };
1202
- /**
1203
- * Deactivates the team.
1204
-
1205
- The team is tombstoned rather than erased: it stays readable through
1206
- getTeam with status `deactivated`. Its memberships are removed and the
1207
- users whose lifecycle it owns are deactivated with it.
1208
-
1209
- The request is idempotent. Deleting a team that is already deactivated
1210
- or doesn't exist succeeds without changing anything.
1211
-
1212
- * @summary Delete team
1213
- */
1214
- const deleteTeam = async (teamId, params, options) => {
1215
- return customFetch(getDeleteTeamUrl(teamId, params), {
1216
- ...options,
1217
- method: "DELETE"
1218
- });
1219
- };
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}`;
1227
- };
1228
- /**
1229
- * Update team. Only active teams can be updated.
1230
-
1231
- * @summary Update team
1232
- */
1233
- const updateTeam = async (teamId, updateTeamBody, params, options) => {
1234
- return customFetch(getUpdateTeamUrl(teamId, params), {
1235
- ...options,
1236
- method: "PATCH",
1237
- headers: {
1238
- "Content-Type": "application/json",
1239
- ...options?.headers
1240
- },
1241
- body: JSON.stringify(updateTeamBody)
1242
- });
1243
- };
1244
- const getCreateBrandingUrl = (params) => {
1245
- const normalizedParams = new URLSearchParams();
1246
- Object.entries(params || {}).forEach(([key, value]) => {
1247
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1248
- });
1249
- const stringifiedParams = normalizedParams.toString();
1250
- return stringifiedParams.length > 0 ? `${getProxyPath()}/branding?${stringifiedParams}` : `${getProxyPath()}/branding`;
1251
- };
1252
- /**
1253
- * Publishes a new immutable branding revision for the project. Branding
1254
- revisions cannot be updated or deleted; every edit publishes a new
1255
- revision, and flow responses resolve the latest revision per project
1256
- (see ADR 040).
1257
-
1258
- The `liquid_template` is validated lexically on save (size, encoding,
1259
- banned patterns such as `<script>` tags, inline event handlers, and the
1260
- `| raw` filter). Authoritative LiquidJS validation runs at authoring
1261
- time via `zitadel plan` / `zitadel apply`.
1262
-
1263
- * @summary Publish a new branding revision
1264
- */
1265
- const createBranding = async (createBrandingBody, params, options) => {
1266
- return customFetch(getCreateBrandingUrl(params), {
1267
- ...options,
1268
- method: "POST",
1269
- headers: {
1270
- "Content-Type": "application/json",
1271
- ...options?.headers
1272
- },
1273
- body: JSON.stringify(createBrandingBody)
1274
- });
1275
- };
1276
- const getListBrandingUrl = (params) => {
1277
- const normalizedParams = new URLSearchParams();
1278
- Object.entries(params || {}).forEach(([key, value]) => {
1279
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1280
- });
1281
- const stringifiedParams = normalizedParams.toString();
1282
- return stringifiedParams.length > 0 ? `${getProxyPath()}/branding?${stringifiedParams}` : `${getProxyPath()}/branding`;
1283
- };
1284
- /**
1285
- * Lists branding revisions for the project, newest first, capped at the
1286
- 100 most recent. The first entry is the revision flow responses
1287
- currently resolve. Deliberately unpaginated in v1 — list endpoints
1288
- gain a real query mechanism together (ADR 031); advertising pagination
1289
- parameters the server ignores would be worse than none.
1290
-
1291
- * @summary List branding revisions
1292
- */
1293
- const listBranding = async (params, options) => {
1294
- return customFetch(getListBrandingUrl(params), {
1295
- ...options,
1296
- method: "GET"
1297
- });
1298
- };
1299
- const getGetBrandingByIdUrl = (id, params) => {
1300
- const normalizedParams = new URLSearchParams();
1301
- Object.entries(params || {}).forEach(([key, value]) => {
1302
- if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1303
- });
1304
- const stringifiedParams = normalizedParams.toString();
1305
- return stringifiedParams.length > 0 ? `${getProxyPath()}/branding/${id}?${stringifiedParams}` : `${getProxyPath()}/branding/${id}`;
1306
- };
1307
- /**
1308
- * Retrieves a single branding revision, including its stored configuration.
1309
- * @summary Get a branding revision by ID
1310
- */
1311
- const getBrandingById = async (id, params, options) => {
1312
- return customFetch(getGetBrandingByIdUrl(id, params), {
1313
- ...options,
1314
- method: "GET"
1315
- });
1316
- };
1317
- //#endregion
1318
- //#region ../api/dist/runtime/api-factory.mjs
1319
- /**
1320
- * Factory for the typed Zitadel client every consumer reaches for.
1321
- *
1322
- * Wraps the orval-generated endpoints in a {@link Proxy} so each
1323
- * generated function sees the right base URL and (optionally) the
1324
- * right bearer token at call time — without the caller having to
1325
- * thread either through every operation, and without exposing the
1326
- * module-globals (`setProxyPath` / `setApiAuthToken`) as part of the
1327
- * public API.
1328
- *
1329
- * Per-instance isolation: multiple clients can coexist in one process
1330
- * (different servers, different tokens). Their Proxy `get` traps set
1331
- * the globals synchronously before invoking the underlying generated
1332
- * function, which reads them at the top of `customFetch` before any
1333
- * `await`. Two clients running interleaved within a single JS turn
1334
- * are safe; two clients running in parallel across awaits could
1335
- * clobber each other — not a pattern any current consumer uses.
1336
- */
1337
- /**
1338
- * Build a typed Zitadel client pre-bound to a base URL and (optionally)
1339
- * a bearer token. Every method on the returned object mirrors a
1340
- * generated orval function:
1341
- *
1342
- * const client = createZitadelClient({ baseUrl, token });
1343
- * await client.createProject({ preview_origins: [] });
1344
- * await client.createSchema(body, { project_id });
1345
- */
1346
- function createZitadelClient(opts) {
1347
- let baseUrl = opts.baseUrl;
1348
- while (baseUrl.endsWith("/")) baseUrl = baseUrl.slice(0, -1);
1349
- return new Proxy(zitadelNextGen_exports, { get(target, prop, receiver) {
1350
- const value = Reflect.get(target, prop, receiver);
1351
- if (typeof value !== "function") return value;
1352
- return (...args) => {
1353
- setProxyPath(baseUrl);
1354
- setApiAuthToken(opts.token);
1355
- return value(...args);
1356
- };
1357
- } });
1358
- }
1359
- //#endregion
1360
- //#region ../config/dist/defaults-CXTnFMHj.mjs
1361
- var default_human_user_default = {
1362
- title: "DefaultHumanUserSchema",
1363
- $schema: "https://json-schema.org/draft/2020-12/schema",
1364
- metaSchema: "${SERVER_URL}/user-schema.json",
1365
- $id: "${USER_SCHEMA_URL}",
1366
- objectType: "human-user",
1367
- kind: "user-schema",
1368
- type: "object",
1369
- description: "The default editable schema for human users.",
1370
- "x-auth-methods": {
1371
- "password": {
1372
- "enabled": true,
1373
- "position": 1
1374
- },
1375
- "passkey": {
1376
- "enabled": true,
1377
- "position": 2
1378
- }
1379
- },
1380
- required: ["email"],
1381
- properties: { "email": {
1382
- "type": "string",
1383
- "format": "email",
1384
- "x-unique": "project",
1385
- "description": "The user's email address."
1386
- } }
1387
- };
1388
- var default_login_default = {
1389
- $schema: "../meta/flow-definition.json",
1390
- name: "default-login",
1391
- status: "active",
1392
- user_schema: "${USER_SCHEMA_URL}",
1393
- purposes: {
1394
- "login": "identifier",
1395
- "register": "register"
1396
- },
1397
- steps: [
1398
- {
1399
- "name": "identifier",
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
- }],
1412
- "transitions": {
1413
- "submit": { "target": "password" },
1414
- "passkey": { "target": "done" },
1415
- "user_not_found": { "target": "register" }
1416
- }
1417
- },
1418
- {
1419
- "name": "password",
1420
- "fields": ["x-auth-methods#password"],
1421
- "actions": [{
1422
- "name": "submit",
1423
- "kind": "submit",
1424
- "primary": true,
1425
- "text_key": "password.action.signin"
1426
- }, {
1427
- "name": "passkey",
1428
- "kind": "passkey",
1429
- "primary": false,
1430
- "text_key": "password.action.passkey"
1431
- }],
1432
- "transitions": {
1433
- "submit": { "target": "done" },
1434
- "passkey": { "target": "done" }
1435
- }
1436
- },
1437
- {
1438
- "name": "register",
1439
- "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
- }],
1451
- "transitions": {
1452
- "submit": { "target": "register-password" },
1453
- "passkey_register": { "target": "done" },
1454
- "user_already_exists": { "target": "password" }
1455
- }
1456
- },
1457
- {
1458
- "name": "register-password",
1459
- "fields": ["x-auth-methods#password"],
1460
- "actions": [{
1461
- "name": "submit",
1462
- "kind": "submit",
1463
- "primary": true,
1464
- "text_key": "register-password.action.submit"
1465
- }],
1466
- "on_success": "create_user",
1467
- "transitions": {
1468
- "submit": { "target": "done" },
1469
- "user_already_exists": { "target": "password" }
1470
- }
1471
- },
1472
- {
1473
- "name": "done",
1474
- "complete": "show"
1475
- }
1476
- ]
1477
- };
1478
- var human_user_default = {
1479
- title: "DefaultHumanUserSchema",
1480
- $schema: "https://json-schema.org/draft/2020-12/schema",
1481
- metaSchema: "${SERVER_URL}/user-schema.json",
1482
- $id: "${USER_SCHEMA_URL}",
1483
- objectType: "human-user",
1484
- kind: "user-schema",
1485
- type: "object",
1486
- description: "The default editable schema for human users (passkey-first sign-in).",
1487
- "x-auth-methods": {
1488
- "passkey": {
1489
- "enabled": true,
1490
- "position": 1
1491
- },
1492
- "password": {
1493
- "enabled": true,
1494
- "position": 2
1495
- }
1496
- },
1497
- required: ["email"],
1498
- properties: { "email": {
1499
- "type": "string",
1500
- "format": "email",
1501
- "x-unique": "project",
1502
- "description": "The user's email address."
1503
- } }
1504
- };
1505
- var login_default = {
1506
- $schema: "../meta/flow-definition.json",
1507
- name: "default-login",
1508
- status: "active",
1509
- user_schema: "${USER_SCHEMA_URL}",
1510
- purposes: {
1511
- "login": "passkey-first",
1512
- "register": "register"
1513
- },
1514
- steps: [
1515
- {
1516
- "name": "passkey-first",
1517
- "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
- }],
1529
- "transitions": {
1530
- "passkey": { "target": "done" },
1531
- "email_fallback": { "target": "identifier" },
1532
- "user_not_found": { "target": "register" }
1533
- }
1534
- },
1535
- {
1536
- "name": "identifier",
1537
- "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
- }],
1549
- "transitions": {
1550
- "submit": { "target": "password" },
1551
- "passkey": { "target": "done" },
1552
- "user_not_found": { "target": "register" }
1553
- }
1554
- },
1555
- {
1556
- "name": "password",
1557
- "fields": ["x-auth-methods#password"],
1558
- "actions": [{
1559
- "name": "submit",
1560
- "kind": "submit",
1561
- "primary": true,
1562
- "text_key": "password.action.signin"
1563
- }, {
1564
- "name": "passkey",
1565
- "kind": "passkey",
1566
- "primary": false,
1567
- "text_key": "password.action.passkey"
1568
- }],
1569
- "transitions": {
1570
- "submit": { "target": "done" },
1571
- "passkey": { "target": "done" }
1572
- }
1573
- },
1574
- {
1575
- "name": "register",
1576
- "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
- }],
1588
- "transitions": {
1589
- "passkey_register": { "target": "done" },
1590
- "submit": { "target": "register-password" },
1591
- "user_already_exists": { "target": "password" }
1592
- }
1593
- },
1594
- {
1595
- "name": "register-password",
1596
- "fields": ["x-auth-methods#password"],
1597
- "actions": [{
1598
- "name": "submit",
1599
- "kind": "submit",
1600
- "primary": true,
1601
- "text_key": "register-password.action.submit"
1602
- }],
1603
- "on_success": "create_user",
1604
- "transitions": {
1605
- "submit": { "target": "done" },
1606
- "user_already_exists": { "target": "password" }
1607
- }
1608
- },
1609
- {
1610
- "name": "done",
1611
- "complete": "show"
1612
- }
1613
- ]
1614
- };
1615
- const DEFAULT_BUILTIN_SCHEMA_BASE = "https://nextgen.com/api/schemas";
1616
- const DEFAULT_FLOW_SCHEMA_URI = "https://nextgen.com/flow-definition.json";
1617
- /**
1618
- * Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt
1619
- * fires before any `.zitadel/` file is written; each preset maps to a
1620
- * pre-defined bundle the CLI copies on first setup). `password-first` is
1621
- * today's default; `passkey-first` puts a passkey ceremony on the login
1622
- * entry step with an email→password fallback path.
1623
- */
1624
- const SETUP_PRESETS = ["password-first", "passkey-first"];
1625
- const PRESET_TEMPLATES = {
1626
- "password-first": {
1627
- schema: default_human_user_default,
1628
- flow: default_login_default
1629
- },
1630
- "passkey-first": {
1631
- schema: human_user_default,
1632
- flow: login_default
1633
- }
1634
- };
1635
- function presetTemplates(preset) {
1636
- if (!Object.hasOwn(PRESET_TEMPLATES, preset)) throw new Error(`unknown setup preset ${JSON.stringify(preset)} (known presets: ${SETUP_PRESETS.join(", ")})`);
1637
- return PRESET_TEMPLATES[preset];
1638
- }
1639
- /**
1640
- * The second setup axis (#448): *who* signs in, orthogonal to the sign-in
1641
- * preset (*how* they sign in). The sign-in preset owns the flow shape and
1642
- * auth methods; the use case owns which profile fields the schema collects.
1643
- * Composing the two keeps us at one field catalog + one flow-per-preset
1644
- * instead of a bundle per (use case × preset) pair. `minimal` is the
1645
- * default and never blocks non-interactive runs.
1646
- */
1647
- const SETUP_USE_CASES = [
1648
- "minimal",
1649
- "consumer",
1650
- "business"
1651
- ];
1652
- /**
1653
- * Fields each use case collects, in register/display order. `email` is
1654
- * always first and stays the only required property; the rest are optional
1655
- * profile attributes gathered on the flow's register step. `givenName`/
1656
- * `familyName` are the attributes the backend reads for a user's identity
1657
- * (`internal/domain/user.go`); `companyName` is stored as a plain user
1658
- * attribute today — there is no org/team model behind it yet.
1659
- */
1660
- const USE_CASE_FIELDS = {
1661
- minimal: ["email"],
1662
- consumer: [
1663
- "email",
1664
- "givenName",
1665
- "familyName"
1666
- ],
1667
- business: [
1668
- "email",
1669
- "givenName",
1670
- "familyName",
1671
- "companyName"
1672
- ]
1673
- };
1674
- /**
1675
- * JSON-Schema bodies for the optional profile fields the CLI composes in per
1676
- * use case. The shipped templates are an email-only baseline (shared verbatim
1677
- * with the Go server fallback), so this catalog owns every field beyond
1678
- * `email`. Authored in the templates' style — no `x-claim`, since the backend
1679
- * maps identity by attribute name and the user-property meta-schema defines no
1680
- * claim keyword. `givenName`/`familyName` are the attributes the backend reads
1681
- * for a user's identity (`internal/domain/user.go`).
1682
- */
1683
- const EXTRA_FIELD_BODIES = {
1684
- givenName: {
1685
- type: "string",
1686
- maxLength: 50,
1687
- description: "The user's given (first) name."
1688
- },
1689
- familyName: {
1690
- type: "string",
1691
- maxLength: 50,
1692
- description: "The user's family (last) name."
1693
- },
1694
- companyName: {
1695
- type: "string",
1696
- maxLength: 200,
1697
- description: "The user's company name."
1698
- }
1699
- };
1700
- function useCaseFields(useCase) {
1701
- if (!Object.hasOwn(USE_CASE_FIELDS, useCase)) throw new Error(`unknown setup use case ${JSON.stringify(useCase)} (known use cases: ${SETUP_USE_CASES.join(", ")})`);
1702
- return USE_CASE_FIELDS[useCase];
1703
- }
1704
- /**
1705
- * The body for one use-case field: reuse the template's authored body when it
1706
- * has one (so composed schemas match the shipped defaults for shared fields),
1707
- * else the extra catalog, else a generic editable string so composition stays
1708
- * total for any field a future use case introduces.
1709
- */
1710
- function fieldBody(field, templateProps) {
1711
- if (Object.hasOwn(templateProps, field)) return { ...templateProps[field] };
1712
- if (Object.hasOwn(EXTRA_FIELD_BODIES, field)) return { ...EXTRA_FIELD_BODIES[field] };
1713
- return {
1714
- type: "string",
1715
- description: `The user's ${field}.`
1716
- };
1717
- }
1718
- /**
1719
- * Narrow a rendered schema to the chosen use case: keep the preset-owned
1720
- * header and `x-auth-methods`, but replace `properties`/`required` with the
1721
- * use case's field set. `email` is the sole required property.
1722
- */
1723
- function applyUseCaseToSchema(schema, useCase) {
1724
- const templateProps = schema.properties ?? {};
1725
- const properties = {};
1726
- for (const field of useCaseFields(useCase)) properties[field] = fieldBody(field, templateProps);
1727
- return {
1728
- ...schema,
1729
- required: ["email"],
1730
- properties
1731
- };
1732
- }
1733
- /**
1734
- * Derive the flow's register-step fields from the use case rather than
1735
- * copying a hard-coded list into every bundle (#448): the register step
1736
- * collects exactly what the schema defines. Other steps are untouched.
1737
- */
1738
- function applyUseCaseToFlow(flow, useCase) {
1739
- const fields = [...useCaseFields(useCase)];
1740
- const steps = flow.steps.map((step) => step.name === "register" ? {
1741
- ...step,
1742
- fields
1743
- } : step);
1744
- return {
1745
- ...flow,
1746
- steps
1747
- };
1748
- }
1749
- function defaultHumanUserSchemaUrl(builtinSchemaBase = DEFAULT_BUILTIN_SCHEMA_BASE) {
1750
- return `${trimTrailingSlash(builtinSchemaBase)}/default-human-user.json`;
1751
- }
1752
- function getDefaultHumanUserSchema(options = {}) {
1753
- const builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? "https://nextgen.com/api/schemas");
1754
- return applyUseCaseToSchema(renderTemplate(presetTemplates(options.preset ?? "password-first").schema, {
1755
- SERVER_URL: builtinSchemaBase,
1756
- USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)
1757
- }), options.useCase ?? "minimal");
1758
- }
1759
- function getDefaultLoginFlow(options = {}) {
1760
- const builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? "https://nextgen.com/api/schemas");
1761
- return applyUseCaseToFlow(renderTemplate(presetTemplates(options.preset ?? "password-first").flow, {
1762
- SERVER_URL: builtinSchemaBase,
1763
- USER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)
1764
- }), options.useCase ?? "minimal");
1765
- }
1766
- function renderTemplate(value, replacements) {
1767
- if (Array.isArray(value)) return value.map((item) => renderTemplate(item, replacements));
1768
- if (value !== null && typeof value === "object") return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, renderTemplate(item, replacements)]));
1769
- if (typeof value === "string") return value.replaceAll(/\$\{([A-Z_]+)\}/g, (match, name) => {
1770
- return replacements[name] ?? match;
1771
- });
1772
- return value;
1773
- }
1774
- function trimTrailingSlash(value) {
1775
- let trimmed = value;
1776
- while (trimmed.endsWith("/")) trimmed = trimmed.slice(0, -1);
1777
- return trimmed;
1778
- }
1779
- //#endregion
1780
- //#region src/bootstrap.ts
1781
- const DEFAULT_PROJECT_NAME = "zitadel-testing";
1782
- /**
1783
- * Server-side half of `zitadel setup`, without any file scaffolding:
1784
- * `POST /projects` is unauthenticated and mints the projectSecret used as the
1785
- * bearer for everything else; the schema is uploaded without `$id` so the
1786
- * server assigns an opaque id, which the flow must then reference.
1787
- */
1788
- async function bootstrapProject(options) {
1789
- const { baseUrl } = options;
1790
- const project = await createZitadelClient({ baseUrl }).createProject({
1791
- name: options.projectName ?? DEFAULT_PROJECT_NAME,
1792
- preview_origins: options.appOrigins ?? [],
1793
- seed_defaults: false
1794
- });
1795
- const projectId = requireString(project.id, "project id");
1796
- const projectSecret = requireString(project.project_secret, "project secret");
1797
- const previewSecret = typeof project.preview_secret === "string" ? project.preview_secret : void 0;
1798
- const client = createZitadelClient({
1799
- baseUrl,
1800
- token: projectSecret
1801
- });
1802
- const { $id: _templateId, ...schemaBody } = getDefaultHumanUserSchema({
1803
- preset: options.preset,
1804
- useCase: options.useCase
1805
- });
1806
- const schemaId = requireString((await client.createSchema(schemaBody, { project_id: projectId })).id, "schema id");
1807
- const flowBody = getDefaultLoginFlow({
1808
- userSchemaUrl: schemaId,
1809
- preset: options.preset,
1810
- useCase: options.useCase
1811
- });
1812
- return {
1813
- projectId,
1814
- projectSecret,
1815
- previewSecret,
1816
- schemaId,
1817
- flowId: requireString((await client.createFlowDefinition({
1818
- project_id: projectId,
1819
- schema_uri: DEFAULT_FLOW_SCHEMA_URI,
1820
- flow_definition: flowBody
1821
- })).id, "flow definition id")
1822
- };
1823
- }
1824
- function requireString(value, label) {
1825
- if (typeof value === "string" && value.length > 0) return value;
1826
- throw new Error(`Missing ${label} in server response.`);
1827
- }
1828
- //#endregion
1829
- //#region src/cli.ts
1830
- const DEFAULT_TIMEOUT_MS = 12e4;
1831
- function resolveCliBin() {
1832
- const require = (0, node_module.createRequire)(require("url").pathToFileURL(__filename).href);
1833
- const pkgPath = require.resolve("@zitadel/cli/package.json");
1834
- const rel = require(pkgPath).bin?.zitadel;
1835
- if (!rel) throw new Error("@zitadel/cli does not declare a `zitadel` bin entry");
1836
- return (0, node_path.join)((0, node_path.dirname)(pkgPath), rel);
1837
- }
1838
- function runCli(options) {
1839
- const bin = options.bin ?? resolveCliBin();
1840
- const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;
1841
- return new Promise((resolve, reject) => {
1842
- const child = (0, node_child_process.spawn)(process.execPath, [bin, ...options.args], {
1843
- env: {
1844
- ...process.env,
1845
- ...options.env
1846
- },
1847
- stdio: [
1848
- "ignore",
1849
- "pipe",
1850
- "pipe"
1851
- ]
1852
- });
1853
- let stdout = "";
1854
- let stderr = "";
1855
- child.stdout.setEncoding("utf8");
1856
- child.stdout.on("data", (chunk) => {
1857
- stdout += chunk;
1858
- });
1859
- child.stderr.setEncoding("utf8");
1860
- child.stderr.on("data", (chunk) => {
1861
- stderr += chunk;
1862
- });
1863
- const timer = setTimeout(() => {
1864
- child.kill("SIGKILL");
1865
- reject(/* @__PURE__ */ new Error(`zitadel ${options.args[0] ?? ""} timed out after ${timeoutMs}ms\n${tail(stderr)}`));
1866
- }, timeoutMs);
1867
- timer.unref();
1868
- child.on("error", (error) => {
1869
- clearTimeout(timer);
1870
- reject(error);
1871
- });
1872
- child.on("close", (code) => {
1873
- clearTimeout(timer);
1874
- resolve({
1875
- exitCode: code ?? -1,
1876
- stdout,
1877
- stderr
1878
- });
1879
- });
1880
- });
1881
- }
1882
- function tail(text, lines = 20) {
1883
- return text.split("\n").slice(-lines).join("\n").trim();
1884
- }
1885
- //#endregion
1886
- //#region src/envelope.ts
1887
- /**
1888
- * Render an error envelope's remediation fields for humans — the CLI's
1889
- * `hint`/`next_commands` are the actionable part of a failure (e.g. "Reinstall
1890
- * @zitadel/cli so npm can install @zitadel/server"), so surface them instead
1891
- * of a raw stdout dump. Returns undefined when the envelope has no message.
1892
- */
1893
- function describeEnvelopeError(envelope) {
1894
- if (typeof envelope.message !== "string" || envelope.message.length === 0) return;
1895
- const lines = [envelope.code ? `${envelope.code}: ${envelope.message}` : envelope.message];
1896
- if (envelope.hint) lines.push(`hint: ${envelope.hint}`);
1897
- if (envelope.next_commands && envelope.next_commands.length > 0) lines.push(`next: ${envelope.next_commands.join(" | ")}`);
1898
- return lines.join("\n");
1899
- }
1900
- function parseCliEnvelope(stdout, context) {
1901
- const start = stdout.indexOf("{");
1902
- const end = stdout.lastIndexOf("}");
1903
- if (start === -1 || end <= start) throw new Error(`${context}: expected a JSON envelope on stdout, got:\n${stdout.trim() || "(empty)"}`);
1904
- let parsed;
1905
- try {
1906
- parsed = JSON.parse(stdout.slice(start, end + 1));
1907
- } catch (error) {
1908
- throw new Error(`${context}: failed to parse JSON envelope: ${error.message}\n${stdout.trim()}`, { cause: error });
1909
- }
1910
- if (typeof parsed !== "object" || parsed === null || typeof parsed.status !== "string") throw new Error(`${context}: stdout JSON is not a CLI envelope:\n${stdout.trim()}`);
1911
- return parsed;
1912
- }
1913
- //#endregion
1914
- //#region src/ports.ts
1915
- /**
1916
- * Ask the OS for a free TCP port. The port is released before returning, so a
1917
- * racing process could grab it; the CLI's own preflight surfaces that as
1918
- * E_PORT_IN_USE, which is loud rather than corrupting.
1919
- */
1920
- function getFreePort() {
1921
- return new Promise((resolve, reject) => {
1922
- const server = (0, node_net.createServer)();
1923
- server.unref();
1924
- server.on("error", reject);
1925
- server.listen(0, "127.0.0.1", () => {
1926
- const address = server.address();
1927
- if (address === null || typeof address === "string") {
1928
- server.close();
1929
- reject(/* @__PURE__ */ new Error("could not determine a free port"));
1930
- return;
1931
- }
1932
- const { port } = address;
1933
- server.close((err) => {
1934
- if (err) {
1935
- reject(err);
1936
- return;
1937
- }
1938
- resolve(port);
1939
- });
1940
- });
1941
- });
1942
- }
1943
- //#endregion
1944
- //#region src/lifecycle.ts
1945
- /**
1946
- * Boot an ephemeral local server by shelling out to `zitadel start` and parse
1947
- * its JSON envelope. The CLI owns the subtle parts (port preflight, health
1948
- * wait, process-group stop), so this module stays a thin adapter; swapping it
1949
- * for direct library calls later must not change the shape returned here.
1950
- */
1951
- async function bootLocalServer(options = {}) {
1952
- const ownsDir = options.dir === void 0;
1953
- const dir = options.dir ?? await (0, node_fs_promises.mkdtemp)((0, node_path.join)((0, node_os.tmpdir)(), "zitadel-testing-"));
1954
- const port = options.port ?? await getFreePort();
1955
- const env = {};
1956
- if (options.serverBinary) env.ZITADEL_SERVER_BINARY = options.serverBinary;
1957
- const result = await runCli({
1958
- args: [
1959
- "start",
1960
- "--port",
1961
- String(port),
1962
- "--non-interactive",
1963
- "--json",
1964
- "-c",
1965
- dir
1966
- ],
1967
- bin: options.cliBin,
1968
- env,
1969
- timeoutMs: options.timeoutMs
1970
- });
1971
- if (result.exitCode !== 0) throw new Error(`zitadel start exited with code ${result.exitCode}.\n${failureDetail(result)}\nstate dir kept for inspection: ${dir}`);
1972
- const stopViaCli = async () => {
1973
- const stopResult = await runCli({
1974
- args: [
1975
- "stop",
1976
- "--non-interactive",
1977
- "--json",
1978
- "-c",
1979
- dir
1980
- ],
1981
- bin: options.cliBin,
1982
- env,
1983
- timeoutMs: options.timeoutMs
1984
- });
1985
- if (stopResult.exitCode !== 0) throw new Error(`zitadel stop exited with code ${stopResult.exitCode}.\n${failureDetail(stopResult)}\nstate dir kept for inspection: ${dir}`);
1986
- };
1987
- let envelope;
1988
- try {
1989
- envelope = parseCliEnvelope(result.stdout, "zitadel start");
1990
- if (envelope.status !== "ok") throw new Error(`zitadel start reported status "${envelope.status}":\n${describeEnvelopeError(envelope) ?? tail(result.stdout)}`);
1991
- } catch (error) {
1992
- const startError = new Error(`zitadel start produced unusable output.\nreason: ${error instanceof Error ? error.message : String(error)}\nstdout: ${tail(result.stdout) || "(empty)"}\nstderr: ${tail(result.stderr) || "(empty)"}\nstate dir kept for inspection: ${dir}`, { cause: error });
1993
- try {
1994
- await stopViaCli();
1995
- } catch (stopError) {
1996
- throw new AggregateError([startError, stopError], `${startError.message}\nStopping the possibly-running instance also failed: ${stopError instanceof Error ? stopError.message : String(stopError)}`);
1997
- }
1998
- throw startError;
1999
- }
2000
- const { runtime, urls } = envelope.data;
2001
- const runStop = async () => {
2002
- await stopViaCli();
2003
- if (ownsDir && !options.keep) await (0, node_fs_promises.rm)(dir, {
2004
- recursive: true,
2005
- force: true
2006
- });
2007
- };
2008
- let stopPromise;
2009
- const stop = () => {
2010
- stopPromise ??= runStop().catch((error) => {
2011
- stopPromise = void 0;
2012
- throw error;
2013
- });
2014
- return stopPromise;
2015
- };
2016
- return {
2017
- baseUrl: urls.api,
2018
- runtime: {
2019
- port: runtime.port,
2020
- pid: runtime.pid,
2021
- dir,
2022
- logPath: runtime.log_path
2023
- },
2024
- stop
2025
- };
2026
- }
2027
- /**
2028
- * A failed CLI run usually still prints an error envelope; its
2029
- * message/hint/next_commands beat raw output tails (e.g. a fresh install
2030
- * missing @zitadel/server gets "Reinstall @zitadel/cli" instead of a stack).
2031
- */
2032
- function failureDetail(result) {
2033
- try {
2034
- const described = describeEnvelopeError(parseCliEnvelope(result.stdout, "zitadel"));
2035
- if (described) return described;
2036
- } catch {}
2037
- return `stdout: ${tail(result.stdout) || "(empty)"}\nstderr: ${tail(result.stderr) || "(empty)"}`;
2038
- }
2039
- //#endregion
2040
- //#region src/seed.ts
2041
- /**
2042
- * A unique unused email + password. Nothing is created on the instance —
2043
- * this is the input for registration-flow specs, which must prove the flow
2044
- * creates the user.
2045
- */
2046
- function identity() {
2047
- return {
2048
- email: `e2e-${(0, node_crypto.randomUUID)().slice(0, 8)}@example.com`,
2049
- password: `Pw!${(0, node_crypto.randomUUID)()}`
2050
- };
2051
- }
2052
- /**
2053
- * 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`.
2056
- *
2057
- * Defaults mint a unique email per call (email is x-unique per project), which
2058
- * is what makes per-test seeding parallel-safe on a shared instance.
2059
- */
2060
- async function seedUser(client, context, input = {}) {
2061
- const fresh = identity();
2062
- const email = input.email ?? fresh.email;
2063
- const password = input.password ?? fresh.password;
2064
- const id = requireString((await client.createUser({
2065
- ...input.attributes,
2066
- $schema: context.schemaId,
2067
- email
2068
- }, { project_id: context.projectId })).id, "user id");
2069
- await client.setUserPassword(id, {
2070
- password,
2071
- is_change_required: false
2072
- }, { project_id: context.projectId });
2073
- return {
2074
- id,
2075
- email,
2076
- password
2077
- };
2078
- }
2079
- /**
2080
- * Seed `count` users sequentially. The template makes fixture data
2081
- * deterministic per index (stable emails/names keep screenshot diffs about
2082
- * code, not reshuffled data — the `console:dev-real` pattern); untemplated
2083
- * fields fall back to the unique defaults. Name-like attributes need a
2084
- * schema that declares them (`useCase: "consumer"` or wider).
2085
- */
2086
- async function seedUsers(client, context, count, template = {}) {
2087
- const users = [];
2088
- for (let index = 0; index < count; index += 1) users.push(await seedUser(client, context, {
2089
- email: template.email?.(index),
2090
- password: template.password?.(index),
2091
- attributes: template.attributes?.(index)
2092
- }));
2093
- return users;
2094
- }
2095
- //#endregion
2096
- //#region src/session.ts
2097
- /** Mirrors the server's session cookie (internal/api/session.go). */
2098
- const SESSION_COOKIE_NAME = "__nextgen_session";
2099
- const MAX_FLOW_STEPS = 6;
2100
- /**
2101
- * Drive the real login flow headlessly for a seeded password user and
2102
- * exchange the terminal handoff for a session: exactly what `<zitadel-login>`
2103
- * does, minus the rendering. Supports flows whose steps only ask for the
2104
- * user's email and password (the shipped `password-first` presets); any step
2105
- * demanding more — a challenge, an unknown field — fails loudly by design.
2106
- *
2107
- * Flow calls use raw fetch instead of the typed client because the flow is
2108
- * stateless through the sealed `_zflow` cookie (internal/api/flow.go): every
2109
- * response re-seals the flow state into Set-Cookie, and submits are rejected
2110
- * without it. Browsers round-trip it implicitly; here a one-cookie jar does.
2111
- */
2112
- async function mintSession(client, handle, context, user, options = {}) {
2113
- const values = {
2114
- email: user.email,
2115
- password: user.password
2116
- };
2117
- const jar = new FlowCookieJar();
2118
- const origin = options.origin;
2119
- let response = await flowFetch(handle, jar, origin, "/flow", {
2120
- project_id: context.projectId,
2121
- purpose: "login",
2122
- ...options.flowDefinitionName ? { flow_definition_name: options.flowDefinitionName } : {}
2123
- });
2124
- for (let hop = 0; hop < MAX_FLOW_STEPS; hop += 1) {
2125
- if (response.handoff_token) {
2126
- const exchanged = await client.exchangeHandoff({ handoff_token: response.handoff_token }, { project_id: context.projectId });
2127
- return {
2128
- user,
2129
- sessionToken: exchanged.session_token,
2130
- expiresAt: exchanged.session.expires_at,
2131
- cookie: {
2132
- name: SESSION_COOKIE_NAME,
2133
- value: exchanged.session_token,
2134
- httpOnly: true,
2135
- secure: true,
2136
- sameSite: "Lax",
2137
- path: "/"
2138
- }
2139
- };
2140
- }
2141
- response = await flowFetch(handle, jar, origin, `/flow/${encodeURIComponent(response.id)}/submit`, {
2142
- session_token: response.session_token,
2143
- action: "submit",
2144
- fields: collectFields(response, values)
2145
- });
2146
- }
2147
- throw new Error(`seed.session: flow did not complete within ${MAX_FLOW_STEPS} steps (last step: ${describeStep(response)}).`);
2148
- }
2149
- /** One-cookie jar for the sealed `_zflow` flow-state cookie. */
2150
- var FlowCookieJar = class {
2151
- cookie;
2152
- absorb(response) {
2153
- for (const raw of response.headers.getSetCookie()) {
2154
- const [pair] = raw.split(";", 1);
2155
- if (pair?.startsWith("_zflow=")) this.cookie = pair;
2156
- }
2157
- }
2158
- header() {
2159
- return this.cookie ? { cookie: this.cookie } : {};
2160
- }
2161
- };
2162
- async function flowFetch(handle, jar, origin, path, body) {
2163
- const response = await fetch(`${handle.baseUrl}${path}`, {
2164
- method: "POST",
2165
- headers: {
2166
- "content-type": "application/json",
2167
- authorization: `Bearer ${handle.projectSecret}`,
2168
- ...origin ? { origin } : {},
2169
- ...jar.header()
2170
- },
2171
- body: JSON.stringify(body)
2172
- });
2173
- jar.absorb(response);
2174
- const parsed = await response.json().catch(() => void 0);
2175
- if (!response.ok || !parsed) {
2176
- const detail = parsed && typeof parsed === "object" ? ` — ${JSON.stringify(parsed)}` : "";
2177
- const hint = !origin && /origin/i.test(detail) ? "\nNo Origin header was sent: pass `origin` to seedSession() (the Playwright fixtures pass the suite's baseURL) or `appOrigins` to startLocalZitadel()." : "";
2178
- throw new Error(`seed.session: POST ${path} returned ${response.status}${detail}${hint}`);
2179
- }
2180
- return parsed;
2181
- }
2182
- /**
2183
- * Fill exactly the fields the current step declares — the orchestrator's
2184
- * convention — from the known email/password values. An unknown required
2185
- * field means this flow needs more than a password login can provide.
2186
- */
2187
- function collectFields(response, values) {
2188
- const fields = {};
2189
- for (const field of response.step.fields ?? []) {
2190
- const value = values[fieldKey(field)];
2191
- if (value === void 0) throw new Error(`seed.session supports password flows only; step ${describeStep(response)} declares field "${field.name}", which the kit cannot fill. Log in through the UI for flows with additional factors.`);
2192
- fields[field.name] = value;
2193
- }
2194
- return fields;
2195
- }
2196
- /**
2197
- * Steps name credential fields with schema pointers (e.g.
2198
- * `x-auth-methods#password`); match on the trailing segment so the value map
2199
- * stays the plain `{ email, password }` a caller thinks in.
2200
- */
2201
- function fieldKey(field) {
2202
- const name = field.name;
2203
- return (name.split(/[#/.]/).at(-1) ?? name).toLowerCase();
2204
- }
2205
- function describeStep(response) {
2206
- const name = response.step.name ?? "(unnamed)";
2207
- const declared = (response.step.fields ?? []).map((field) => field.name).join(", ");
2208
- return `"${name}"${declared ? ` [fields: ${declared}]` : ""}`;
2209
- }
2210
- //#endregion
2211
- //#region src/index.ts
2212
- /**
2213
- * Attach to an already-bootstrapped instance/project. Lifecycle-free on
2214
- * purpose: this is the entry point for Playwright workers (via the handshake
2215
- * file) and, later, for seeding remote instances.
2216
- */
2217
- function connectZitadel(handle) {
2218
- const api = createZitadelClient({
2219
- baseUrl: handle.baseUrl,
2220
- token: handle.projectSecret
2221
- });
2222
- const context = {
2223
- projectId: handle.projectId,
2224
- schemaId: handle.schemaId
2225
- };
2226
- return {
2227
- handle,
2228
- api,
2229
- appEnv: require_handshake.applyAppEnvTemplate(require_handshake.nextAppEnv, handle),
2230
- seedUser: (input) => seedUser(api, context, input),
2231
- seedUsers: (count, template) => seedUsers(api, context, count, template),
2232
- identity,
2233
- seedSession: async (input = {}) => {
2234
- const { user: existing, flowDefinitionName, origin, ...userInput } = input;
2235
- return mintSession(api, handle, context, existing ?? await seedUser(api, context, userInput), {
2236
- flowDefinitionName,
2237
- origin: origin ?? handle.appOrigin
2238
- });
2239
- }
2240
- };
2241
- }
2242
- /**
2243
- * Boot an ephemeral local instance (binary runtime + SQLite by default, no
2244
- * Docker) and bootstrap a project + default schema + login flow on it. The
2245
- * result can seed loginable password users immediately.
2246
- */
2247
- async function startLocalZitadel(options = {}) {
2248
- const server = await bootLocalServer(options);
2249
- let bootstrapped;
2250
- try {
2251
- bootstrapped = await bootstrapProject({
2252
- baseUrl: server.baseUrl,
2253
- projectName: options.projectName,
2254
- appOrigins: options.appOrigins,
2255
- preset: options.preset,
2256
- useCase: options.useCase
2257
- });
2258
- } catch (error) {
2259
- try {
2260
- await server.stop();
2261
- } catch (stopError) {
2262
- throw new AggregateError([error, stopError], "bootstrap failed, and stopping the booted instance also failed");
2263
- }
2264
- throw error;
2265
- }
2266
- return {
2267
- ...connectZitadel({
2268
- baseUrl: server.baseUrl,
2269
- projectId: bootstrapped.projectId,
2270
- projectSecret: bootstrapped.projectSecret,
2271
- schemaId: bootstrapped.schemaId,
2272
- previewSecret: bootstrapped.previewSecret,
2273
- appOrigin: options.appOrigins?.[0]
2274
- }),
2275
- runtime: server.runtime,
2276
- stop: server.stop,
2277
- [Symbol.asyncDispose]: server.stop
2278
- };
2279
- }
2280
- //#endregion
2281
- Object.defineProperty(exports, "SESSION_COOKIE_NAME", {
2282
- enumerable: true,
2283
- get: function() {
2284
- return SESSION_COOKIE_NAME;
2285
- }
2286
- });
2287
- Object.defineProperty(exports, "bootLocalServer", {
2288
- enumerable: true,
2289
- get: function() {
2290
- return bootLocalServer;
2291
- }
2292
- });
2293
- Object.defineProperty(exports, "bootstrapProject", {
2294
- enumerable: true,
2295
- get: function() {
2296
- return bootstrapProject;
2297
- }
2298
- });
2299
- Object.defineProperty(exports, "connectZitadel", {
2300
- enumerable: true,
2301
- get: function() {
2302
- return connectZitadel;
2303
- }
2304
- });
2305
- Object.defineProperty(exports, "startLocalZitadel", {
2306
- enumerable: true,
2307
- get: function() {
2308
- return startLocalZitadel;
2309
- }
2310
- });
2311
-
2312
- //# sourceMappingURL=src-DirKLqi4.cjs.map