@zitadel/testing 0.1.0-alpha.19 → 1.0.0-alpha.20
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.
- package/README.md +39 -1
- package/dist/{app-env-Btmfcflb.d.mts → app-env-DlrV_ePR.d.mts} +56 -4
- package/dist/app-env-DlrV_ePR.d.mts.map +1 -0
- package/dist/app-runner.cjs +1 -1
- package/dist/app-runner.mjs +1 -1
- package/dist/{handshake-CRKcgkfN.cjs → handshake-BOsVBPtn.cjs} +14 -1
- package/dist/handshake-BOsVBPtn.cjs.map +1 -0
- package/dist/{handshake-ClzWvG8z.mjs → handshake-BnAPXC6s.mjs} +14 -1
- package/dist/handshake-BnAPXC6s.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/playwright.cjs +2 -2
- package/dist/playwright.d.mts +1 -1
- package/dist/playwright.mjs +2 -2
- package/dist/{src-9dFjTIAw.mjs → src-Dkt0HHu8.mjs} +2 -2
- package/dist/{src-9dFjTIAw.mjs.map → src-Dkt0HHu8.mjs.map} +1 -1
- package/dist/{src-I0KAh1zU.cjs → src-DtCJTEId.cjs} +301 -17
- package/dist/src-DtCJTEId.cjs.map +1 -0
- package/dist/supervisor.cjs +2 -2
- package/dist/supervisor.mjs +2 -2
- package/package.json +4 -4
- package/dist/app-env-Btmfcflb.d.mts.map +0 -1
- package/dist/handshake-CRKcgkfN.cjs.map +0 -1
- package/dist/handshake-ClzWvG8z.mjs.map +0 -1
- package/dist/src-I0KAh1zU.cjs.map +0 -1
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"src-I0KAh1zU.cjs","names":["applyAppEnvTemplate","nextAppEnv"],"sources":["../../api/dist/runtime/base-url.mjs","../../api/dist/runtime/auth.mjs","../../api/dist/chunk-CfYAbeIz.mjs","../../api/dist/runtime/fetch.mjs","../../api/dist/generated/endpoints/zitadelNextGen.mjs","../../api/dist/runtime/api-factory.mjs","../../config/dist/defaults-eiGHyI5Y.mjs","../src/bootstrap.ts","../src/cli.ts","../src/envelope.ts","../src/ports.ts","../src/lifecycle.ts","../src/seed.ts","../src/session.ts","../src/index.ts"],"sourcesContent":["//#region src/runtime/base-url.ts\nlet proxyPath = \"\";\nfunction getProxyPath() {\n\treturn proxyPath;\n}\nfunction setProxyPath(path) {\n\tproxyPath = path;\n}\n//#endregion\nexport { getProxyPath, setProxyPath };\n\n//# sourceMappingURL=base-url.mjs.map","//#region src/runtime/auth.ts\n/**\n* Module-global bearer token used by the orval-generated client's\n* custom fetch. Set once at command boot (the same lifecycle pattern\n* as `base-url.ts`); every generated request reads from here.\n*\n* Keeping the token here means the CLI doesn't have to thread an\n* `Authorization` header through every generated call site; orval's\n* `mutator` wires `runtime/fetch.ts` in, and that file pulls the token\n* from this module.\n*/\nlet apiAuthToken;\nfunction getApiAuthToken() {\n\treturn apiAuthToken;\n}\nfunction setApiAuthToken(token) {\n\tapiAuthToken = token;\n}\n//#endregion\nexport { getApiAuthToken, setApiAuthToken };\n\n//# sourceMappingURL=auth.mjs.map","//#region \\0rolldown/runtime.js\nvar __defProp = Object.defineProperty;\nvar __exportAll = (all, no_symbols) => {\n\tlet target = {};\n\tfor (var name in all) __defProp(target, name, {\n\t\tget: all[name],\n\t\tenumerable: true\n\t});\n\tif (!no_symbols) __defProp(target, Symbol.toStringTag, { value: \"Module\" });\n\treturn target;\n};\n//#endregion\nexport { __exportAll as t };\n","import { getApiAuthToken } from \"./auth.mjs\";\n//#region src/runtime/fetch.ts\n/**\n* Framework-neutral failure type the orval-generated client throws on\n* any non-2xx response. Carries the HTTP status, the parsed error body\n* (the spec's `{code, message, details?}` envelope when the server\n* returned one), and the request URL — enough for callers to map to\n* their own error taxonomy without re-implementing the fetch layer.\n*\n* Callers that don't care about the distinction can catch `ApiError`\n* generically; callers that do (the CLI's `toZitadelError`) read\n* `status` and decide.\n*/\nvar ApiError = class extends Error {\n\tstatus;\n\turl;\n\tbody;\n\tconstructor(status, url, body, message) {\n\t\tsuper(message);\n\t\tthis.name = \"ApiError\";\n\t\tthis.status = status;\n\t\tthis.url = url;\n\t\tthis.body = body;\n\t}\n};\n/**\n* The orval `mutator` for the fetch client. Every generated operation\n* routes its request through this function instead of the global\n* `fetch`. We pin three concerns here so generated call sites stay\n* focused on the shape of one HTTP call:\n*\n* - bearer auth — read from `runtime/auth.ts` and attached automatically;\n* - non-2xx → throw — orval's stock client parses the body regardless\n* of status, so callers would have to inspect every response. Throw\n* `ApiError` on `!res.ok` so failures interrupt control flow;\n* - body parsing — return the parsed JSON typed as `T` (the operation's\n* return type, threaded through by orval), or `undefined` for the\n* spec's `204`/`205`/`304` no-body responses.\n*/\nasync function customFetch(url, options) {\n\tconst token = getApiAuthToken();\n\tconst headers = new Headers(options.headers);\n\tif (token && !headers.has(\"authorization\")) headers.set(\"authorization\", `Bearer ${token}`);\n\tconst res = await fetch(url, {\n\t\t...options,\n\t\theaders\n\t});\n\tconst rawBody = [\n\t\t204,\n\t\t205,\n\t\t304\n\t].includes(res.status) ? \"\" : await res.text();\n\tconst parsed = rawBody ? safeJsonParse(rawBody) : void 0;\n\tif (!res.ok) {\n\t\tconst message = `${options.method ?? \"GET\"} ${url} returned ${res.status}`;\n\t\tthrow new ApiError(res.status, url, parsed, message);\n\t}\n\treturn parsed;\n}\n/**\n* `JSON.parse` wrapped so a non-JSON body (e.g. an HTML 502 from a\n* proxy) becomes `{ raw: \"<text>\" }` instead of throwing inside\n* `customFetch`. The thrown `ApiError` then carries something useful\n* for the user to see.\n*/\nfunction safeJsonParse(text) {\n\ttry {\n\t\treturn JSON.parse(text);\n\t} catch {\n\t\treturn { raw: text };\n\t}\n}\n/**\n* Extracts the server's `{code, message, details}` envelope from an\n* {@link ApiError} into a display string. Falls back to the fetch layer's\n* `\"METHOD url returned N\"` when the body isn't shaped like an envelope, so\n* transport-level failures (HTML from a proxy, empty 5xx) still say\n* something.\n*/\nfunction apiErrorMessage(error) {\n\tconst body = error.body;\n\tif (!isRecord(body)) return error.message;\n\tconst serverMessage = typeof body.message === \"string\" ? body.message : void 0;\n\tconst detail = pickDetailString(body.details);\n\tif (!serverMessage) return error.message;\n\treturn detail ? `${serverMessage}: ${detail}` : serverMessage;\n}\n/**\n* Reads the innermost human-readable string out of the spec's error\n* `details` field. Handles both `details: \"...\"` and the nested\n* `details: { details: \"...\" }` shape the platform emits for validation\n* failures.\n*/\nfunction pickDetailString(details) {\n\tif (typeof details === \"string\") return details;\n\tif (isRecord(details)) {\n\t\tif (typeof details.details === \"string\") return details.details;\n\t\tif (typeof details.message === \"string\") return details.message;\n\t}\n}\nfunction isRecord(value) {\n\treturn typeof value === \"object\" && value !== null && !Array.isArray(value);\n}\n//#endregion\nexport { ApiError, apiErrorMessage, customFetch };\n\n//# sourceMappingURL=fetch.mjs.map","import { t as __exportAll } from \"../../chunk-CfYAbeIz.mjs\";\nimport { getProxyPath } from \"../../runtime/base-url.mjs\";\nimport { customFetch } from \"../../runtime/fetch.mjs\";\n//#region src/generated/endpoints/zitadelNextGen.ts\n/**\n* Generated by orval v8.10.0 🍺\n* Do not edit manually.\n* Zitadel NextGen\n* This is the next generation of the Zitadel identity platform.\n* OpenAPI spec version: 0.0.1\n*/\nvar zitadelNextGen_exports = /* @__PURE__ */ __exportAll({\n\tcompleteClaim: () => completeClaim,\n\tcreateAuthAttempt: () => createAuthAttempt,\n\tcreateBranding: () => createBranding,\n\tcreateFlow: () => createFlow,\n\tcreateFlowDefinition: () => createFlowDefinition,\n\tcreateHandoff: () => createHandoff,\n\tcreateProject: () => createProject,\n\tcreateSchema: () => createSchema,\n\tcreateSession: () => createSession,\n\tcreateTeam: () => createTeam,\n\tcreateUser: () => createUser,\n\tdeleteFlowDefinition: () => deleteFlowDefinition,\n\tdeleteTeam: () => deleteTeam,\n\tdeleteUserByID: () => deleteUserByID,\n\texchangeHandoff: () => exchangeHandoff,\n\tgetAuthAttempt: () => getAuthAttempt,\n\tgetBrandingById: () => getBrandingById,\n\tgetClaimStatus: () => getClaimStatus,\n\tgetCompleteClaimUrl: () => getCompleteClaimUrl,\n\tgetCreateAuthAttemptUrl: () => getCreateAuthAttemptUrl,\n\tgetCreateBrandingUrl: () => getCreateBrandingUrl,\n\tgetCreateFlowDefinitionUrl: () => getCreateFlowDefinitionUrl,\n\tgetCreateFlowUrl: () => getCreateFlowUrl,\n\tgetCreateHandoffUrl: () => getCreateHandoffUrl,\n\tgetCreateProjectUrl: () => getCreateProjectUrl,\n\tgetCreateSchemaUrl: () => getCreateSchemaUrl,\n\tgetCreateSessionUrl: () => getCreateSessionUrl,\n\tgetCreateTeamUrl: () => getCreateTeamUrl,\n\tgetCreateUserUrl: () => getCreateUserUrl,\n\tgetDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,\n\tgetDeleteTeamUrl: () => getDeleteTeamUrl,\n\tgetDeleteUserByIDUrl: () => getDeleteUserByIDUrl,\n\tgetEvent: () => getEvent,\n\tgetExchangeHandoffUrl: () => getExchangeHandoffUrl,\n\tgetFlowDefinition: () => getFlowDefinition,\n\tgetFlowStep: () => getFlowStep,\n\tgetGetAuthAttemptUrl: () => getGetAuthAttemptUrl,\n\tgetGetBrandingByIdUrl: () => getGetBrandingByIdUrl,\n\tgetGetClaimStatusUrl: () => getGetClaimStatusUrl,\n\tgetGetEventUrl: () => getGetEventUrl,\n\tgetGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,\n\tgetGetFlowStepUrl: () => getGetFlowStepUrl,\n\tgetGetHealthUrl: () => getGetHealthUrl,\n\tgetGetLiveUrl: () => getGetLiveUrl,\n\tgetGetMySessionUrl: () => getGetMySessionUrl,\n\tgetGetMyUserUrl: () => getGetMyUserUrl,\n\tgetGetProjectUrl: () => getGetProjectUrl,\n\tgetGetReadyUrl: () => getGetReadyUrl,\n\tgetGetSchemaByIdUrl: () => getGetSchemaByIdUrl,\n\tgetGetSessionUrl: () => getGetSessionUrl,\n\tgetGetTeamUrl: () => getGetTeamUrl,\n\tgetGetUserByIDUrl: () => getGetUserByIDUrl,\n\tgetHealth: () => getHealth,\n\tgetInitClaimUrl: () => getInitClaimUrl,\n\tgetIssueChallengeUrl: () => getIssueChallengeUrl,\n\tgetListBrandingUrl: () => getListBrandingUrl,\n\tgetListEventsUrl: () => getListEventsUrl,\n\tgetListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,\n\tgetListSchemasUrl: () => getListSchemasUrl,\n\tgetListUserPasskeysUrl: () => getListUserPasskeysUrl,\n\tgetListUserTeamsUrl: () => getListUserTeamsUrl,\n\tgetListUsersUrl: () => getListUsersUrl,\n\tgetLive: () => getLive,\n\tgetMySession: () => getMySession,\n\tgetMyUser: () => getMyUser,\n\tgetPatchProjectUrl: () => getPatchProjectUrl,\n\tgetProject: () => getProject,\n\tgetQueryProjectsUrl: () => getQueryProjectsUrl,\n\tgetQuerySessionsUrl: () => getQuerySessionsUrl,\n\tgetQueryTeamsUrl: () => getQueryTeamsUrl,\n\tgetReady: () => getReady,\n\tgetRevokeMySessionUrl: () => getRevokeMySessionUrl,\n\tgetRevokeSessionUrl: () => getRevokeSessionUrl,\n\tgetSchemaById: () => getSchemaById,\n\tgetSession: () => getSession,\n\tgetSetUserPasswordUrl: () => getSetUserPasswordUrl,\n\tgetSubmitFlowStepUrl: () => getSubmitFlowStepUrl,\n\tgetTeam: () => getTeam,\n\tgetUpdateFlowDefinitionUrl: () => getUpdateFlowDefinitionUrl,\n\tgetUpdateTeamUrl: () => getUpdateTeamUrl,\n\tgetUserByID: () => getUserByID,\n\tgetVerifyChallengeProofUrl: () => getVerifyChallengeProofUrl,\n\tinitClaim: () => initClaim,\n\tissueChallenge: () => issueChallenge,\n\tlistBranding: () => listBranding,\n\tlistEvents: () => listEvents,\n\tlistFlowDefinitions: () => listFlowDefinitions,\n\tlistSchemas: () => listSchemas,\n\tlistUserPasskeys: () => listUserPasskeys,\n\tlistUserTeams: () => listUserTeams,\n\tlistUsers: () => listUsers,\n\tpatchProject: () => patchProject,\n\tqueryProjects: () => queryProjects,\n\tquerySessions: () => querySessions,\n\tqueryTeams: () => queryTeams,\n\trevokeMySession: () => revokeMySession,\n\trevokeSession: () => revokeSession,\n\tsetUserPassword: () => setUserPassword,\n\tsubmitFlowStep: () => submitFlowStep,\n\tupdateFlowDefinition: () => updateFlowDefinition,\n\tupdateTeam: () => updateTeam,\n\tverifyChallengeProof: () => verifyChallengeProof\n});\nconst getGetHealthUrl = () => {\n\treturn `${getProxyPath()}/healthz`;\n};\n/**\n* Check whether the server is healthy\n* @summary Check server health\n*/\nconst getHealth = async (options) => {\n\treturn customFetch(getGetHealthUrl(), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetLiveUrl = () => {\n\treturn `${getProxyPath()}/livez`;\n};\n/**\n* Check whether the server is started\n* @summary Check server liveness\n*/\nconst getLive = async (options) => {\n\treturn customFetch(getGetLiveUrl(), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetReadyUrl = () => {\n\treturn `${getProxyPath()}/readyz`;\n};\n/**\n* Check whether the server is ready to accept requests\n* @summary Check server readiness\n*/\nconst getReady = async (options) => {\n\treturn customFetch(getGetReadyUrl(), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getCreateUserUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/users?${stringifiedParams}` : `${getProxyPath()}/users`;\n};\n/**\n* @summary Create user\n*/\nconst createUser = async (createUserBody, params, options) => {\n\treturn customFetch(getCreateUserUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createUserBody)\n\t});\n};\nconst getListUsersUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/users?${stringifiedParams}` : `${getProxyPath()}/users`;\n};\n/**\n* @summary List users\n*/\nconst listUsers = async (params, options) => {\n\treturn customFetch(getListUsersUrl(params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetUserByIDUrl = (userId, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;\n};\n/**\n* @summary Get user by ID\n*/\nconst getUserByID = async (userId, params, options) => {\n\treturn customFetch(getGetUserByIDUrl(userId, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getDeleteUserByIDUrl = (userId) => {\n\treturn `${getProxyPath()}/users/${userId}`;\n};\n/**\n* @summary Delete user by ID\n*/\nconst deleteUserByID = async (userId, options) => {\n\treturn customFetch(getDeleteUserByIDUrl(userId), {\n\t\t...options,\n\t\tmethod: \"DELETE\"\n\t});\n};\nconst getListUserPasskeysUrl = (userId, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/passkeys?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/passkeys`;\n};\n/**\n* @summary List user passkeys\n*/\nconst listUserPasskeys = async (userId, params, options) => {\n\treturn customFetch(getListUserPasskeysUrl(userId, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getSetUserPasswordUrl = (userId) => {\n\treturn `${getProxyPath()}/users/${userId}/password`;\n};\n/**\n* @summary Set user password\n*/\nconst setUserPassword = async (userId, setUserPasswordBody, options) => {\n\treturn customFetch(getSetUserPasswordUrl(userId), {\n\t\t...options,\n\t\tmethod: \"PUT\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(setUserPasswordBody)\n\t});\n};\nconst getListUserTeamsUrl = (userId, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/teams?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/teams`;\n};\n/**\n* The user's team roster, ordered by team name. Each entry carries the\nteam's name, so a client renders a page without resolving ids one by one.\n\nThis is the N:N roster and it is not lifecycle ownership: the single team\nthat owns the user's lifecycle is reported as `metadata.lifecycle_owner_team_id`\non the user read endpoints. Memberships the user was removed from are not\nreturned.\n\n* @summary List the teams a user belongs to\n*/\nconst listUserTeams = async (userId, params, options) => {\n\treturn customFetch(getListUserTeamsUrl(userId, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetMyUserUrl = () => {\n\treturn `${getProxyPath()}/users/me`;\n};\n/**\n* @summary Get my user information\n*/\nconst getMyUser = async (options) => {\n\treturn customFetch(getGetMyUserUrl(), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getCreateFlowUrl = () => {\n\treturn `${getProxyPath()}/flow`;\n};\n/**\n* Resolves a flow definition based on purpose + audience context and returns\nthe first capability step. Creates a new session implicitly unless\n`session_id` is provided (for step-up / reauth on an existing session).\n\nThe response contains an `id` field — the flow handle. Use it as the path\nparameter for all subsequent `/flow/{id}/submit` calls.\n\nThe response also sets an encrypted `HttpOnly` cookie (`_zflow`) containing\nthe flow's orchestration state (current step, collected data, history).\nThe server is stateless between requests — all flow state lives in this\ncookie. The browser sends it automatically on subsequent requests.\n\n* @summary Start a new flow\n*/\nconst createFlow = async (createFlowBody, options) => {\n\treturn customFetch(getCreateFlowUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createFlowBody)\n\t});\n};\nconst getGetFlowStepUrl = (id) => {\n\treturn `${getProxyPath()}/flow/${id}`;\n};\n/**\n* Returns the current capability step without advancing the state machine.\nUseful for page reloads or re-rendering after a network error.\n\n* @summary Get current step (re-render)\n*/\nconst getFlowStep = async (id, options) => {\n\treturn customFetch(getGetFlowStepUrl(id), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getSubmitFlowStepUrl = (id) => {\n\treturn `${getProxyPath()}/flow/${id}/submit`;\n};\n/**\n* Submits user input for the current step. The server validates,\nprocesses (e.g., verifies a credential), advances the state machine\nthrough any invisible steps, and returns the next visible step.\n\nThe response sets an updated encrypted `HttpOnly` cookie (`_zflow`)\nwith the new flow state. The server is stateless — all orchestration\nstate is carried in this cookie between requests.\n\n**Important:** The `id` in the response may differ from the `id` used in\nthe request. This happens when a flow pivots (pushes a new flow onto the\nstack) or when a stacked flow completes (auto-pops to the parent flow).\nAlways use the `id` from the latest response for the next request.\n\n## Flow completion\n\nWhen `step.type` is `complete`, the flow is terminal. The `step.behavior`\nfield tells the frontend what to do:\n\n| `behavior` | Action |\n|------------- |------------------------------------------------------------|\n| `redirect` | Navigate to `redirect_uri` (OIDC/SAML auth request done). |\n| `show` | Render the step as a success screen (e.g., registration). |\n\nA `complete` step is only returned when the **entire flow stack** is done.\nIf a stacked flow (e.g., recovery pivoted from login) finishes, the server\nauto-pops to the parent flow and returns the parent's next step — the\nfrontend never sees a `complete` for intermediate flows.\n\n* @summary Submit step data and advance\n*/\nconst submitFlowStep = async (id, submitFlowStepBody, options) => {\n\treturn customFetch(getSubmitFlowStepUrl(id), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(submitFlowStepBody)\n\t});\n};\nconst getCreateAuthAttemptUrl = () => {\n\treturn `${getProxyPath()}/auth_attempts`;\n};\n/**\n* Starts a new authentication attempt. This is the entry point for the auth_attempts state machine.\n\nAn attempt is an ephemeral (15-minute TTL) state machine that drives a single authentication round.\nIt accepts factor challenges, verifies proofs, and completes into a session or handoff token.\n\nAccepts a project_id and challenge_nonce (from POST /bootstrap/challenge). For step-up re-auth,\nalso include session_id to add factors to an existing session.\n\n* @summary Create a new authentication attempt\n*/\nconst createAuthAttempt = async (createAuthAttemptBody, options) => {\n\treturn customFetch(getCreateAuthAttemptUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createAuthAttemptBody)\n\t});\n};\nconst getGetAuthAttemptUrl = (attemptId) => {\n\treturn `${getProxyPath()}/auth_attempts/${attemptId}`;\n};\n/**\n* Polls the current state of an authentication attempt.\n\nReturns the attempt's state, available factors for the next challenge,\nchallenges issued so far, and any errors preventing progress.\n\nUse this for polling during long-running factor verifications (e.g., waiting for\na federated IdP callback or a device flow).\n\n* @summary Get authentication attempt state\n*/\nconst getAuthAttempt = async (attemptId, options) => {\n\treturn customFetch(getGetAuthAttemptUrl(attemptId), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getIssueChallengeUrl = (attemptId) => {\n\treturn `${getProxyPath()}/auth_attempts/${attemptId}/challenges`;\n};\n/**\n* Issues a single-factor verification challenge within an auth attempt.\n\nThis advances the authentication state machine by requesting a specific factor method\n(password, passkey, TOTP, OTP via SMS, etc.). The server responds with challenge details\nincluding method, metadata, and any UI hints. The client then verifies the proof\nby calling POST /auth_attempts/{attempt_id}/challenges/{challenge_id}/verify.\n\n* @summary Issue a factor challenge\n*/\nconst issueChallenge = async (attemptId, issueChallengeBody, options) => {\n\treturn customFetch(getIssueChallengeUrl(attemptId), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(issueChallengeBody)\n\t});\n};\nconst getVerifyChallengeProofUrl = (attemptId, challengeId) => {\n\treturn `${getProxyPath()}/auth_attempts/${attemptId}/challenges/${challengeId}/verify`;\n};\n/**\n* Submits a proof (credential, code, assertion) to verify a factor challenge.\n\nThe proof format depends on the challenge method. For example:\n- `password` method: { password: \"…\" }\n- `totp` method: { totp: { code: \"123456\" } }\n- `passkey` method: { passkey: { assertion: \"…\" } }\n- `recovery_code` method: { recovery_code: \"…\" }\n\nOn successful verification, the factor is written to the auth attempt.\nThe attempt moves to the next pending challenge or completes if all required factors are verified.\n\n* @summary Verify a factor proof\n*/\nconst verifyChallengeProof = async (attemptId, challengeId, verifyChallengeProofBody, options) => {\n\treturn customFetch(getVerifyChallengeProofUrl(attemptId, challengeId), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(verifyChallengeProofBody)\n\t});\n};\nconst getCreateHandoffUrl = (attemptId) => {\n\treturn `${getProxyPath()}/auth_attempts/${attemptId}/handoff`;\n};\n/**\n* Completes the authentication attempt and mints a `handoff_token`.\n\nCall this after all required factors have been verified and the attempt is in `completed` state.\nThe handoff token is short-lived (≤60 seconds) and must be exchanged at\nPOST /sessions/exchange to receive the final session and session_token.\n\nThe handoff token is:\n- Single-use (atomic exchange, no retry)\n- Audience-bound (requires matching project key for exchange)\n- Idempotency-safe within a 5-minute window (see conventions)\n\n* @summary Complete authentication and create handoff token\n*/\nconst createHandoff = async (attemptId, options) => {\n\treturn customFetch(getCreateHandoffUrl(attemptId), {\n\t\t...options,\n\t\tmethod: \"POST\"\n\t});\n};\nconst getCreateProjectUrl = () => {\n\treturn `${getProxyPath()}/projects`;\n};\n/**\n* @summary Create project\n*/\nconst createProject = async (createProjectBody, options) => {\n\treturn customFetch(getCreateProjectUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createProjectBody)\n\t});\n};\nconst getQueryProjectsUrl = () => {\n\treturn `${getProxyPath()}/projects/query`;\n};\n/**\n* @summary Query projects\n*/\nconst queryProjects = async (queryProjectsBody, options) => {\n\treturn customFetch(getQueryProjectsUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(queryProjectsBody)\n\t});\n};\nconst getGetProjectUrl = (projectId) => {\n\treturn `${getProxyPath()}/projects/${projectId}`;\n};\n/**\n* Returns the current state of a project.\n\n* @summary Get project\n*/\nconst getProject = async (projectId, options) => {\n\treturn customFetch(getGetProjectUrl(projectId), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getPatchProjectUrl = (projectId) => {\n\treturn `${getProxyPath()}/projects/${projectId}`;\n};\n/**\n* Updates the state of a project.\n\n* @summary Update project\n*/\nconst patchProject = async (projectId, patchProjectBody, options) => {\n\treturn customFetch(getPatchProjectUrl(projectId), {\n\t\t...options,\n\t\tmethod: \"PATCH\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(patchProjectBody)\n\t});\n};\nconst getInitClaimUrl = (projectId) => {\n\treturn `${getProxyPath()}/projects/${projectId}/claim/init`;\n};\n/**\n* Starts a claim challenge for an unclaimed project. Authenticated by the\nproject secret, this mints a single-use, short-lived challenge and returns\nthe `claim_url` the developer opens in a browser to complete the claim,\ntogether with the `challenge_id` the CLI polls with. The exact expiry is\ncarried by `expires_at` on the response.\n\n* @summary Initialize a project claim\n*/\nconst initClaim = async (projectId, options) => {\n\treturn customFetch(getInitClaimUrl(projectId), {\n\t\t...options,\n\t\tmethod: \"POST\"\n\t});\n};\nconst getGetClaimStatusUrl = (projectId, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${projectId}/claim/status?${stringifiedParams}` : `${getProxyPath()}/projects/${projectId}/claim/status`;\n};\n/**\n* Polled by the CLI while a browser completes the claim. Authorized by the\nproject secret that initiated the challenge. Returns `pending`, or\n`completed` with the owning team, the claim timestamp, and the dashboard\nURL once the browser leg has finished.\n\n* @summary Get claim status\n*/\nconst getClaimStatus = async (projectId, params, options) => {\n\treturn customFetch(getGetClaimStatusUrl(projectId, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getCompleteClaimUrl = (projectId) => {\n\treturn `${getProxyPath()}/projects/${projectId}/claim/complete`;\n};\n/**\n* Called by the browser after the developer authenticates on the claim page.\nAuthenticated by the `__nextgen_session` cookie, it attaches the project to\nthe developer's personal team using the `challenge_id` from the claim URL as\nits single-use, browser-safe authorization.\n\n* @summary Complete a project claim\n*/\nconst completeClaim = async (projectId, completeClaimBody, options) => {\n\treturn customFetch(getCompleteClaimUrl(projectId), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(completeClaimBody)\n\t});\n};\nconst getCreateSessionUrl = () => {\n\treturn `${getProxyPath()}/sessions`;\n};\n/**\n* Creates an anonymous session shell with no user and no factors (`state: building`).\n\nThis is optional — an `auth_attempt` will create a session implicitly if none is provided.\nUse this explicitly when you want to:\n- Pre-allocate a `session_id` before the user is known, so device/telemetry signals\ncan be correlated with the eventual authenticated session from the start.\n- Track anonymous state (bot detection, device fingerprint) that survives until authentication.\n\nCreating a session is an app-plane operation on the project credential\n(`session.write`). The returned `session_token` is a session credential for the\nend-user client, not a management scope: it is delivered as the\n`__nextgen_session` cookie and authorises the self-service operations\n`GET /sessions/me` and `DELETE /sessions/me` (`nextgenSession` scheme). The\nby-id operations `GET /sessions/{session_id}` and `DELETE /sessions/{session_id}`\nare operator endpoints and require `session.read` / `session.delete` instead.\n\nThe `session_token` is superseded when a handoff exchange completes — clients must\nreplace it at that point.\n\nAnonymous sessions expire aggressively (10-minute TTL). The TTL resets to the configured\nfull session TTL when the first authentication factor is written via a completing `auth_attempt`.\n\n* @summary Create an anonymous session shell\n*/\nconst createSession = async (createSessionBody, options) => {\n\treturn customFetch(getCreateSessionUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createSessionBody)\n\t});\n};\nconst getQuerySessionsUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/query?${stringifiedParams}` : `${getProxyPath()}/sessions/query`;\n};\n/**\n* Returns the sessions of a project, paginated with a cursor.\nSessions of every lifecycle state are returned; each carries its `state`.\nRequires `session.read` permission.\n\n* @summary Query sessions\n*/\nconst querySessions = async (querySessionsBody, params, options) => {\n\treturn customFetch(getQuerySessionsUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(querySessionsBody)\n\t});\n};\nconst getExchangeHandoffUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/exchange?${stringifiedParams}` : `${getProxyPath()}/sessions/exchange`;\n};\n/**\n* Consumes a one-time `handoff_token` minted by `POST /auth_attempts/{id}/handoff`\nand returns the resulting session and a `session_token`.\n\nThe server resolves the originating `auth_attempt` from the token and then:\n\n| Originating auth_attempt | Outcome |\n|---|---|\n| No `session_id` | A new authenticated session is **created**. |\n| `session_id` points to an anonymous shell | Existing session is **upgraded** — user and factors written in, TTL reset to full session TTL. |\n| `session_id` points to an active session (step-up) | Existing session is **upgraded** — new factors merged, `assurance_levels[]` expanded. |\n\nThe response shape is identical in all three cases.\n\nThe `session_token` supersedes any previously issued `session_token` for the same session.\nClients must replace their stored token at this point.\n\nRequires a project service key (OAuth2 client credentials).\n\n* @summary Exchange handoff token for a session\n*/\nconst exchangeHandoff = async (exchangeHandoffBody, params, options) => {\n\treturn customFetch(getExchangeHandoffUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(exchangeHandoffBody)\n\t});\n};\nconst getGetSessionUrl = (sessionId) => {\n\treturn `${getProxyPath()}/sessions/${sessionId}`;\n};\n/**\n* Returns the current state of a session including its factors and all currently\nsatisfied assurance levels.\n\n`assurance_levels[]` may shrink over time as factor freshness windows expire,\nwithout the session itself expiring. Use step-up authentication (a new `auth_attempt`\nagainst the same `session_id`) to restore a dropped assurance level.\n\n* @summary Get session state\n*/\nconst getSession = async (sessionId, options) => {\n\treturn customFetch(getGetSessionUrl(sessionId), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getRevokeSessionUrl = (sessionId) => {\n\treturn `${getProxyPath()}/sessions/${sessionId}`;\n};\n/**\n* Permanently deletes the session, terminating it immediately.\n\nThis is the operator revoke path and requires the `session.delete` scope on a\nproject-bound credential. End-user logout with the `__nextgen_session` cookie is\n`DELETE /sessions/me` (`nextgenSession` scheme).\n\nIdempotent: deleting a session that does not exist (or was already deleted)\nstill returns 204. After deletion, any tokens derived from the session are\ninvalidated.\n\n* @summary Revoke session\n*/\nconst revokeSession = async (sessionId, options) => {\n\treturn customFetch(getRevokeSessionUrl(sessionId), {\n\t\t...options,\n\t\tmethod: \"DELETE\"\n\t});\n};\nconst getGetMySessionUrl = () => {\n\treturn `${getProxyPath()}/sessions/me`;\n};\n/**\n* Returns the current state of the current session including its factors and all currently\nsatisfied assurance levels.\n\n`assurance_levels[]` may shrink over time as factor freshness windows expire,\nwithout the session itself expiring. Use step-up authentication (a new `auth_attempt`\nagainst the same `session_id`) to restore a dropped assurance level.\n\n* @summary Get my session state\n*/\nconst getMySession = async (options) => {\n\treturn customFetch(getGetMySessionUrl(), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getRevokeMySessionUrl = () => {\n\treturn `${getProxyPath()}/sessions/me`;\n};\n/**\n* Logs out by permanently deleting the session.\n\nThe `__nextgen_session` cookie issued at creation (or superseded by a handoff\nexchange) is required. Idempotent: if the session is already gone this still\nreturns 204. Any tokens derived from the session are invalidated, and the\ncookie itself is cleared in the response.\n\n* @summary Revoke my session\n*/\nconst revokeMySession = async (options) => {\n\treturn customFetch(getRevokeMySessionUrl(), {\n\t\t...options,\n\t\tmethod: \"DELETE\"\n\t});\n};\nconst getCreateSchemaUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;\n};\n/**\n* Create a new schema. The optional `$id` field is the JSON Schema document\nURI used to identify the schema in future requests (GitOps-stable identity,\nnot a free-form resource primary key). When `$id` is omitted, the server\ngenerates a `sch_*` URL. When provided, `$id` must be unique within the\nproject and should ideally be a valid URI pointing at where the schema can\nbe accessed.\n\nThe schema can either be a concrete schema, e.g. a user schema, or a\nschema-url which will be resolved by the server.\n\n* @summary Create new schema\n*/\nconst createSchema = async (createSchemaBody, params, options) => {\n\treturn customFetch(getCreateSchemaUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createSchemaBody)\n\t});\n};\nconst getListSchemasUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;\n};\n/**\n* Retrieve a list of all schemas available in the system. This endpoint\nsupports pagination and filtering based on schema attributes.\n\n* @summary List all schemas\n*/\nconst listSchemas = async (params, options) => {\n\treturn customFetch(getListSchemasUrl(params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetSchemaByIdUrl = (id, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/schemas/${id}?${stringifiedParams}` : `${getProxyPath()}/schemas/${id}`;\n};\n/**\n* Get a schema by its ID. This will return the default revision of the schema.\n* @summary Get schema by ID\n*/\nconst getSchemaById = async (id, params, options) => {\n\treturn customFetch(getGetSchemaByIdUrl(id, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getCreateFlowDefinitionUrl = () => {\n\treturn `${getProxyPath()}/flow_definitions`;\n};\n/**\n* Creates a new flow definition.\nFlow definitions are templates that define the sequence of steps (capabilities)\nfor a particular user journey (e.g., registration, login, password reset).\n\nFlow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.\n\n* @summary Create a new flow definition\n*/\nconst createFlowDefinition = async (createFlowDefinitionBody, options) => {\n\treturn customFetch(getCreateFlowDefinitionUrl(), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createFlowDefinitionBody)\n\t});\n};\nconst getListFlowDefinitionsUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions?${stringifiedParams}` : `${getProxyPath()}/flow_definitions`;\n};\n/**\n* Retrieves a list of all flow definitions.\nThis endpoint can be used to view existing flow definitions and their configurations.\n\n* @summary List flow definitions\n*/\nconst listFlowDefinitions = async (params, options) => {\n\treturn customFetch(getListFlowDefinitionsUrl(params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetFlowDefinitionUrl = (id) => {\n\treturn `${getProxyPath()}/flow_definitions/${id}`;\n};\n/**\n* Get a flow definition by id\n* @summary Get a flow definition by id\n*/\nconst getFlowDefinition = async (id, options) => {\n\treturn customFetch(getGetFlowDefinitionUrl(id), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getUpdateFlowDefinitionUrl = (id) => {\n\treturn `${getProxyPath()}/flow_definitions/${id}`;\n};\n/**\n* Update a flow definition by id. This endpoint replaces the existing flow definition.\nIf `flow_definition.status` is omitted, the current status is preserved\n\n* @summary Update a flow definition by id\n*/\nconst updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {\n\treturn customFetch(getUpdateFlowDefinitionUrl(id), {\n\t\t...options,\n\t\tmethod: \"PUT\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(updateFlowDefinitionBody)\n\t});\n};\nconst getDeleteFlowDefinitionUrl = (id) => {\n\treturn `${getProxyPath()}/flow_definitions/${id}`;\n};\n/**\n* Delete a flow definition by id.\nIf the flow definition is currently being used by a flow, the deletion will fail.\nIf 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.\n\n* @summary Delete a flow definition by id\n*/\nconst deleteFlowDefinition = async (id, options) => {\n\treturn customFetch(getDeleteFlowDefinitionUrl(id), {\n\t\t...options,\n\t\tmethod: \"DELETE\"\n\t});\n};\nconst getCreateTeamUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;\n};\n/**\n* @summary Create team\n*/\nconst createTeam = async (createTeamBody, params, options) => {\n\treturn customFetch(getCreateTeamUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createTeamBody)\n\t});\n};\nconst getQueryTeamsUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/teams/query?${stringifiedParams}` : `${getProxyPath()}/teams/query`;\n};\n/**\n* Returns the teams of a project, paginated with a cursor.\n\n* @summary Query teams\n*/\nconst queryTeams = async (queryTeamsBody, params, options) => {\n\treturn customFetch(getQueryTeamsUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(queryTeamsBody)\n\t});\n};\nconst getGetTeamUrl = (teamId) => {\n\treturn `${getProxyPath()}/teams/${teamId}`;\n};\n/**\n* Returns a Team by its id.\n\n* @summary Get team\n*/\nconst getTeam = async (teamId, options) => {\n\treturn customFetch(getGetTeamUrl(teamId), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getDeleteTeamUrl = (teamId) => {\n\treturn `${getProxyPath()}/teams/${teamId}`;\n};\n/**\n* Deactivates the team.\n\nThe team is tombstoned rather than erased: it stays readable through\ngetTeam with status `deactivated`. Its memberships are removed and the\nusers whose lifecycle it owns are deactivated with it.\n\nThe request is idempotent. Deleting a team that is already deactivated\nor doesn't exist succeeds without changing anything.\n\n* @summary Delete team\n*/\nconst deleteTeam = async (teamId, options) => {\n\treturn customFetch(getDeleteTeamUrl(teamId), {\n\t\t...options,\n\t\tmethod: \"DELETE\"\n\t});\n};\nconst getUpdateTeamUrl = (teamId) => {\n\treturn `${getProxyPath()}/teams/${teamId}`;\n};\n/**\n* Update team. Only active teams can be updated.\n\n* @summary Update team\n*/\nconst updateTeam = async (teamId, updateTeamBody, options) => {\n\treturn customFetch(getUpdateTeamUrl(teamId), {\n\t\t...options,\n\t\tmethod: \"PATCH\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(updateTeamBody)\n\t});\n};\nconst getCreateBrandingUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/branding?${stringifiedParams}` : `${getProxyPath()}/branding`;\n};\n/**\n* Publishes a new immutable branding revision for the project. Branding\nrevisions cannot be updated or deleted; every edit publishes a new\nrevision, and flow responses resolve the latest revision per project\n(see ADR 040).\n\nThe `liquid_template` is validated lexically on save (size, encoding,\nbanned patterns such as `<script>` tags, inline event handlers, and the\n`| raw` filter). Authoritative LiquidJS validation runs at authoring\ntime via `zitadel plan` / `zitadel apply`.\n\n* @summary Publish a new branding revision\n*/\nconst createBranding = async (createBrandingBody, params, options) => {\n\treturn customFetch(getCreateBrandingUrl(params), {\n\t\t...options,\n\t\tmethod: \"POST\",\n\t\theaders: {\n\t\t\t\"Content-Type\": \"application/json\",\n\t\t\t...options?.headers\n\t\t},\n\t\tbody: JSON.stringify(createBrandingBody)\n\t});\n};\nconst getListBrandingUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/branding?${stringifiedParams}` : `${getProxyPath()}/branding`;\n};\n/**\n* Lists branding revisions for the project, newest first, capped at the\n100 most recent. The first entry is the revision flow responses\ncurrently resolve. Deliberately unpaginated in v1 — list endpoints\ngain a real query mechanism together (ADR 031); advertising pagination\nparameters the server ignores would be worse than none.\n\n* @summary List branding revisions\n*/\nconst listBranding = async (params, options) => {\n\treturn customFetch(getListBrandingUrl(params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetBrandingByIdUrl = (id) => {\n\treturn `${getProxyPath()}/branding/${id}`;\n};\n/**\n* Retrieves a single branding revision, including its stored configuration.\n* @summary Get a branding revision by ID\n*/\nconst getBrandingById = async (id, options) => {\n\treturn customFetch(getGetBrandingByIdUrl(id), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getListEventsUrl = (params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (Array.isArray(value) && [\"category\", \"event_type\"].includes(key)) {\n\t\t\tvalue.forEach((v) => {\n\t\t\t\tnormalizedParams.append(key, v === null ? \"null\" : v.toString());\n\t\t\t});\n\t\t\treturn;\n\t\t}\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/events?${stringifiedParams}` : `${getProxyPath()}/events`;\n};\n/**\n* Returns project-scoped audit events, newest-first by keyset on\n`(created_at, id)` (ADR 027 / ADR 049). Pass `order=asc` for oldest-first.\nRequires `events.read`.\n\nPre-claim projects return an empty list (events are stored but not\nvisible until claim succeeds). Team-scoped credentials see only events\nwhose emit-time `team_id` matches the credential team (enforced when\nteam-scoped tokens exist).\n\nClients discriminate each item via `event_type` (OpenAPI Event oneOf) —\nsee docs/design/api/events-catalog.md.\n\n* @summary List events\n*/\nconst listEvents = async (params, options) => {\n\treturn customFetch(getListEventsUrl(params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\nconst getGetEventUrl = (id, params) => {\n\tconst normalizedParams = new URLSearchParams();\n\tObject.entries(params || {}).forEach(([key, value]) => {\n\t\tif (value !== void 0) normalizedParams.append(key, value === null ? \"null\" : value.toString());\n\t});\n\tconst stringifiedParams = normalizedParams.toString();\n\treturn stringifiedParams.length > 0 ? `${getProxyPath()}/events/${id}?${stringifiedParams}` : `${getProxyPath()}/events/${id}`;\n};\n/**\n* Loads a single event by `(project_id, id)`. Requires `events.read`.\nEvents are not registered in `resource_scope_index`; project scope is\nrequired on the query (ADR 049). Misses and cross-project ids return 404.\n\nPre-claim projects return 404 (stored events stay invisible until claim).\n\n* @summary Get event by ID\n*/\nconst getEvent = async (id, params, options) => {\n\treturn customFetch(getGetEventUrl(id, params), {\n\t\t...options,\n\t\tmethod: \"GET\"\n\t});\n};\n//#endregion\nexport { completeClaim, createAuthAttempt, createBranding, createFlow, createFlowDefinition, createHandoff, createProject, createSchema, createSession, createTeam, createUser, deleteFlowDefinition, deleteTeam, deleteUserByID, exchangeHandoff, getAuthAttempt, getBrandingById, getClaimStatus, getCompleteClaimUrl, getCreateAuthAttemptUrl, getCreateBrandingUrl, getCreateFlowDefinitionUrl, getCreateFlowUrl, getCreateHandoffUrl, getCreateProjectUrl, getCreateSchemaUrl, getCreateSessionUrl, getCreateTeamUrl, getCreateUserUrl, getDeleteFlowDefinitionUrl, getDeleteTeamUrl, getDeleteUserByIDUrl, getEvent, getExchangeHandoffUrl, getFlowDefinition, getFlowStep, getGetAuthAttemptUrl, getGetBrandingByIdUrl, getGetClaimStatusUrl, getGetEventUrl, getGetFlowDefinitionUrl, getGetFlowStepUrl, getGetHealthUrl, getGetLiveUrl, getGetMySessionUrl, getGetMyUserUrl, getGetProjectUrl, getGetReadyUrl, getGetSchemaByIdUrl, getGetSessionUrl, getGetTeamUrl, getGetUserByIDUrl, getHealth, getInitClaimUrl, getIssueChallengeUrl, getListBrandingUrl, getListEventsUrl, getListFlowDefinitionsUrl, getListSchemasUrl, getListUserPasskeysUrl, getListUserTeamsUrl, getListUsersUrl, getLive, getMySession, getMyUser, getPatchProjectUrl, getProject, getQueryProjectsUrl, getQuerySessionsUrl, getQueryTeamsUrl, getReady, getRevokeMySessionUrl, getRevokeSessionUrl, getSchemaById, getSession, getSetUserPasswordUrl, getSubmitFlowStepUrl, getTeam, getUpdateFlowDefinitionUrl, getUpdateTeamUrl, getUserByID, getVerifyChallengeProofUrl, initClaim, issueChallenge, listBranding, listEvents, listFlowDefinitions, listSchemas, listUserPasskeys, listUserTeams, listUsers, patchProject, queryProjects, querySessions, queryTeams, revokeMySession, revokeSession, setUserPassword, submitFlowStep, zitadelNextGen_exports as t, updateFlowDefinition, updateTeam, verifyChallengeProof };\n\n//# sourceMappingURL=zitadelNextGen.mjs.map","import { setProxyPath } from \"./base-url.mjs\";\nimport { setApiAuthToken } from \"./auth.mjs\";\nimport { t as zitadelNextGen_exports } from \"../generated/endpoints/zitadelNextGen.mjs\";\n//#region src/runtime/api-factory.ts\n/**\n* Factory for the typed Zitadel client every consumer reaches for.\n*\n* Wraps the orval-generated endpoints in a {@link Proxy} so each\n* generated function sees the right base URL and (optionally) the\n* right bearer token at call time — without the caller having to\n* thread either through every operation, and without exposing the\n* module-globals (`setProxyPath` / `setApiAuthToken`) as part of the\n* public API.\n*\n* Per-instance isolation: multiple clients can coexist in one process\n* (different servers, different tokens). Their Proxy `get` traps set\n* the globals synchronously before invoking the underlying generated\n* function, which reads them at the top of `customFetch` before any\n* `await`. Two clients running interleaved within a single JS turn\n* are safe; two clients running in parallel across awaits could\n* clobber each other — not a pattern any current consumer uses.\n*/\n/**\n* Build a typed Zitadel client pre-bound to a base URL and (optionally)\n* a bearer token. Every method on the returned object mirrors a\n* generated orval function:\n*\n* const client = createZitadelClient({ baseUrl, token });\n* await client.createProject({ preview_origins: [] });\n* await client.createSchema(body, { project_id });\n*/\nfunction createZitadelClient(opts) {\n\tlet baseUrl = opts.baseUrl;\n\twhile (baseUrl.endsWith(\"/\")) baseUrl = baseUrl.slice(0, -1);\n\treturn new Proxy(zitadelNextGen_exports, { get(target, prop, receiver) {\n\t\tconst value = Reflect.get(target, prop, receiver);\n\t\tif (typeof value !== \"function\") return value;\n\t\treturn (...args) => {\n\t\t\tsetProxyPath(baseUrl);\n\t\t\tsetApiAuthToken(opts.token);\n\t\t\treturn value(...args);\n\t\t};\n\t} });\n}\n/**\n* Legacy entry point: builds a client with only the base URL set, no\n* token. Components and SDKs that don't carry an auth token (browser\n* flows authenticated by platform cookies) still consume this name.\n* Equivalent to `createZitadelClient({ baseUrl: apiBase })`.\n*/\nfunction createApi(apiBase) {\n\treturn createZitadelClient({ baseUrl: apiBase });\n}\n//#endregion\nexport { createApi, createZitadelClient };\n\n//# sourceMappingURL=api-factory.mjs.map","import { readFileSync } from \"node:fs\";\nimport { fileURLToPath } from \"node:url\";\n//#region defaults/default-human-user.json\nvar default_human_user_default = {\n\ttitle: \"DefaultHumanUserSchema\",\n\t$schema: \"https://json-schema.org/draft/2020-12/schema\",\n\tmetaSchema: \"${SERVER_URL}/user-schema.json\",\n\t$id: \"${USER_SCHEMA_URL}\",\n\tobjectType: \"human-user\",\n\tkind: \"user-schema\",\n\ttype: \"object\",\n\tdescription: \"The default editable schema for human users.\",\n\t\"x-auth-methods\": {\n\t\t\"password\": { \"enabled\": true },\n\t\t\"passkey\": { \"enabled\": true }\n\t},\n\trequired: [\"email\"],\n\tproperties: { \"email\": {\n\t\t\"type\": \"string\",\n\t\t\"format\": \"email\",\n\t\t\"x-unique\": \"project\",\n\t\t\"description\": \"The user's email address.\"\n\t} }\n};\n//#endregion\n//#region defaults/default-login.json\nvar default_login_default = {\n\t$schema: \"../meta/flow-definition.json\",\n\tname: \"default-login\",\n\tstatus: \"active\",\n\tuser_schema: \"${USER_SCHEMA_URL}\",\n\tpurposes: {\n\t\t\"login\": \"identifier\",\n\t\t\"register\": \"register\"\n\t},\n\tsteps: [\n\t\t{\n\t\t\t\"name\": \"identifier\",\n\t\t\t\"fields\": [\"email\"],\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\t\"primary\": true,\n\t\t\t\t\t\"text_key\": \"identifier.action.continue\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"passkey\",\n\t\t\t\t\t\"kind\": \"passkey\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"identifier.action.passkey\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"register\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"identifier.action.register.link\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"password\" },\n\t\t\t\t\"passkey\": { \"target\": \"done\" },\n\t\t\t\t\"user_not_found\": { \"target\": \"register\" },\n\t\t\t\t\"register\": {\n\t\t\t\t\t\"target\": \"register\",\n\t\t\t\t\t\"purpose\": \"register\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"password\",\n\t\t\t\"fields\": [\"x-auth-methods#password\"],\n\t\t\t\"actions\": [{\n\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"text_key\": \"password.action.signin\"\n\t\t\t}, {\n\t\t\t\t\"name\": \"passkey\",\n\t\t\t\t\"kind\": \"passkey\",\n\t\t\t\t\"primary\": false,\n\t\t\t\t\"text_key\": \"password.action.passkey\"\n\t\t\t}],\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"done\" },\n\t\t\t\t\"passkey\": { \"target\": \"done\" }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"register\",\n\t\t\t\"fields\": [\"email\"],\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\t\"primary\": true,\n\t\t\t\t\t\"text_key\": \"register.action.password\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"passkey_register\",\n\t\t\t\t\t\"kind\": \"passkey_register\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"register.action.passkey\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sign_in\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"register.action.sign_in.link\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"register-password\" },\n\t\t\t\t\"passkey_register\": { \"target\": \"done\" },\n\t\t\t\t\"user_already_exists\": { \"target\": \"password\" },\n\t\t\t\t\"sign_in\": {\n\t\t\t\t\t\"target\": \"identifier\",\n\t\t\t\t\t\"purpose\": \"login\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"register-password\",\n\t\t\t\"fields\": [\"x-auth-methods#password\"],\n\t\t\t\"actions\": [{\n\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"text_key\": \"register-password.action.submit\"\n\t\t\t}],\n\t\t\t\"on_success\": \"create_user\",\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"done\" },\n\t\t\t\t\"user_already_exists\": { \"target\": \"password\" }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"done\",\n\t\t\t\"complete\": \"show\"\n\t\t}\n\t]\n};\n//#endregion\n//#region defaults/presets/passkey-first/human-user.json\nvar human_user_default = {\n\ttitle: \"DefaultHumanUserSchema\",\n\t$schema: \"https://json-schema.org/draft/2020-12/schema\",\n\tmetaSchema: \"${SERVER_URL}/user-schema.json\",\n\t$id: \"${USER_SCHEMA_URL}\",\n\tobjectType: \"human-user\",\n\tkind: \"user-schema\",\n\ttype: \"object\",\n\tdescription: \"The default editable schema for human users (passkey-first sign-in).\",\n\t\"x-auth-methods\": {\n\t\t\"passkey\": { \"enabled\": true },\n\t\t\"password\": { \"enabled\": true }\n\t},\n\trequired: [\"email\"],\n\tproperties: { \"email\": {\n\t\t\"type\": \"string\",\n\t\t\"format\": \"email\",\n\t\t\"x-unique\": \"project\",\n\t\t\"description\": \"The user's email address.\"\n\t} }\n};\n//#endregion\n//#region defaults/presets/passkey-first/login.json\nvar login_default = {\n\t$schema: \"../meta/flow-definition.json\",\n\tname: \"default-login\",\n\tstatus: \"active\",\n\tuser_schema: \"${USER_SCHEMA_URL}\",\n\tpurposes: {\n\t\t\"login\": \"passkey-first\",\n\t\t\"register\": \"register\"\n\t},\n\tsteps: [\n\t\t{\n\t\t\t\"name\": \"passkey-first\",\n\t\t\t\"fields\": [],\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"passkey\",\n\t\t\t\t\t\"kind\": \"passkey\",\n\t\t\t\t\t\"primary\": true,\n\t\t\t\t\t\"text_key\": \"passkey-first.action.passkey\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"email_fallback\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"passkey-first.action.email_fallback\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"register\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"identifier.action.register.link\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"transitions\": {\n\t\t\t\t\"passkey\": { \"target\": \"done\" },\n\t\t\t\t\"email_fallback\": { \"target\": \"identifier\" },\n\t\t\t\t\"user_not_found\": { \"target\": \"register\" },\n\t\t\t\t\"register\": {\n\t\t\t\t\t\"target\": \"register\",\n\t\t\t\t\t\"purpose\": \"register\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"identifier\",\n\t\t\t\"fields\": [\"email\"],\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\t\"primary\": true,\n\t\t\t\t\t\"text_key\": \"identifier.action.continue\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"passkey\",\n\t\t\t\t\t\"kind\": \"passkey\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"identifier.action.passkey\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"register\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"identifier.action.register.link\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"password\" },\n\t\t\t\t\"passkey\": { \"target\": \"done\" },\n\t\t\t\t\"user_not_found\": { \"target\": \"register\" },\n\t\t\t\t\"register\": {\n\t\t\t\t\t\"target\": \"register\",\n\t\t\t\t\t\"purpose\": \"register\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"password\",\n\t\t\t\"fields\": [\"x-auth-methods#password\"],\n\t\t\t\"actions\": [{\n\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"text_key\": \"password.action.signin\"\n\t\t\t}, {\n\t\t\t\t\"name\": \"passkey\",\n\t\t\t\t\"kind\": \"passkey\",\n\t\t\t\t\"primary\": false,\n\t\t\t\t\"text_key\": \"password.action.passkey\"\n\t\t\t}],\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"done\" },\n\t\t\t\t\"passkey\": { \"target\": \"done\" }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"register\",\n\t\t\t\"fields\": [\"email\"],\n\t\t\t\"actions\": [\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"passkey_register\",\n\t\t\t\t\t\"kind\": \"passkey_register\",\n\t\t\t\t\t\"primary\": true,\n\t\t\t\t\t\"text_key\": \"register.action.passkey\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"register.action.password\"\n\t\t\t\t},\n\t\t\t\t{\n\t\t\t\t\t\"name\": \"sign_in\",\n\t\t\t\t\t\"kind\": \"navigate\",\n\t\t\t\t\t\"primary\": false,\n\t\t\t\t\t\"text_key\": \"register.action.sign_in.link\"\n\t\t\t\t}\n\t\t\t],\n\t\t\t\"transitions\": {\n\t\t\t\t\"passkey_register\": { \"target\": \"done\" },\n\t\t\t\t\"submit\": { \"target\": \"register-password\" },\n\t\t\t\t\"user_already_exists\": { \"target\": \"password\" },\n\t\t\t\t\"sign_in\": {\n\t\t\t\t\t\"target\": \"passkey-first\",\n\t\t\t\t\t\"purpose\": \"login\"\n\t\t\t\t}\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"register-password\",\n\t\t\t\"fields\": [\"x-auth-methods#password\"],\n\t\t\t\"actions\": [{\n\t\t\t\t\"name\": \"submit\",\n\t\t\t\t\"kind\": \"submit\",\n\t\t\t\t\"primary\": true,\n\t\t\t\t\"text_key\": \"register-password.action.submit\"\n\t\t\t}],\n\t\t\t\"on_success\": \"create_user\",\n\t\t\t\"transitions\": {\n\t\t\t\t\"submit\": { \"target\": \"done\" },\n\t\t\t\t\"user_already_exists\": { \"target\": \"password\" }\n\t\t\t}\n\t\t},\n\t\t{\n\t\t\t\"name\": \"done\",\n\t\t\t\"complete\": \"show\"\n\t\t}\n\t]\n};\n//#endregion\n//#region src/readmes.ts\n/**\n* README content the CLI copies to `.zitadel/schemas/README.md` during setup.\n* Source of truth is `packages/config/defaults/README-schemas.md`; the Go\n* server-side embed reads the same file (see `defaults.go`).\n*/\nfunction schemasReadmeContent() {\n\treturn readFileSync(readmeUrl(\"README-schemas.md\"), \"utf8\");\n}\n/**\n* README content the CLI copies to `.zitadel/flows/README.md` during setup.\n* Source of truth is `packages/config/defaults/README-flows.md`.\n*/\nfunction flowsReadmeContent() {\n\treturn readFileSync(readmeUrl(\"README-flows.md\"), \"utf8\");\n}\n/**\n* README content the CLI copies to `.zitadel/branding/README.md` when a\n* branding design is ejected. Source of truth is\n* `packages/config/defaults/README-branding.md`.\n*/\nfunction brandingReadmeContent() {\n\treturn readFileSync(readmeUrl(\"README-branding.md\"), \"utf8\");\n}\nfunction readmeUrl(filename) {\n\treturn fileURLToPath(new URL(`../defaults/${filename}`, import.meta.url));\n}\n//#endregion\n//#region src/defaults.ts\nconst DEFAULT_BUILTIN_SCHEMA_BASE = \"https://nextgen.com/api/schemas\";\nconst DEFAULT_FLOW_SCHEMA_URI = \"https://nextgen.com/flow-definition.json\";\nconst DEFAULT_SCHEMA_CONFIG_PATH = \".zitadel/schemas/default-human-user.json\";\nconst DEFAULT_FLOW_CONFIG_PATH = \".zitadel/flows/default-login.json\";\nconst DEFAULT_BRANDING_CONFIG_PATH = \".zitadel/branding/branding.json\";\nconst DEFAULT_BRANDING_TEMPLATE_PATH = \".zitadel/branding/login.liquid\";\n/**\n* Named schema+flow bundles `zitadel setup` can scaffold (#448: the prompt\n* fires before any `.zitadel/` file is written; each preset maps to a\n* pre-defined bundle the CLI copies on first setup). `password-first` is\n* today's default; `passkey-first` puts a passkey ceremony on the login\n* entry step with an email→password fallback path.\n*/\nconst SETUP_PRESETS = [\"password-first\", \"passkey-first\"];\nconst DEFAULT_SETUP_PRESET = \"password-first\";\nconst PRESET_TEMPLATES = {\n\t\"password-first\": {\n\t\tschema: default_human_user_default,\n\t\tflow: default_login_default\n\t},\n\t\"passkey-first\": {\n\t\tschema: human_user_default,\n\t\tflow: login_default\n\t}\n};\nfunction presetTemplates(preset) {\n\tif (!Object.hasOwn(PRESET_TEMPLATES, preset)) throw new Error(`unknown setup preset ${JSON.stringify(preset)} (known presets: ${SETUP_PRESETS.join(\", \")})`);\n\treturn PRESET_TEMPLATES[preset];\n}\n/**\n* Login-design starting points `zitadel branding eject --design <name>` (and\n* `zitadel setup --design <name>`) scaffold into `.zitadel/branding/`. A\n* design is a full Liquid template plus the descriptor `layout` it degrades\n* to — the wire `layout` enum stays `centered | split`, richer designs are\n* delivered as templates (ADR 040).\n*/\nconst BRANDING_DESIGNS = [\n\t\"centered\",\n\t\"split\",\n\t\"split-right\",\n\t\"hero\",\n\t\"minimal\"\n];\nconst DEFAULT_BRANDING_DESIGN = \"centered\";\n/** Descriptor `layout` each design degrades to when its template is rejected. */\nconst DESIGN_LAYOUTS = {\n\tcentered: \"centered\",\n\tsplit: \"split\",\n\t\"split-right\": \"split\",\n\thero: \"split\",\n\tminimal: \"centered\"\n};\n/**\n* Renders the scaffold files for a branding design. The `centered` template\n* is a drift-tested copy of the bundled default in `@zitadel/components`;\n* the other designs are authored variants of it.\n*/\nfunction getDefaultBrandingConfig(design = DEFAULT_BRANDING_DESIGN) {\n\tif (!Object.hasOwn(DESIGN_LAYOUTS, design)) throw new Error(`unknown branding design ${JSON.stringify(design)} (known designs: ${BRANDING_DESIGNS.join(\", \")})`);\n\tconst known = design;\n\treturn {\n\t\tbranding: {\n\t\t\tlayout: DESIGN_LAYOUTS[known],\n\t\t\tliquid_template_file: \"./login.liquid\"\n\t\t},\n\t\ttemplate: readFileSync(packageFilePath(`../defaults/branding/${known}/login.liquid`), \"utf8\")\n\t};\n}\n/**\n* Resolves a package-relative file to a real filesystem path. Vite-driven\n* runtimes (vitest in dependent packages) rewrite `import.meta.url` to a\n* `/@fs/...` URL, which `fileURLToPath` passes through verbatim — strip the\n* prefix so `readFileSync` gets an actual path.\n*/\nfunction packageFilePath(relative) {\n\tconst path = fileURLToPath(new URL(relative, import.meta.url));\n\treturn path.startsWith(\"/@fs/\") ? path.slice(4) : path;\n}\n/**\n* The second setup axis (#448): *who* signs in, orthogonal to the sign-in\n* preset (*how* they sign in). The sign-in preset owns the flow shape and\n* auth methods; the use case owns which profile fields the schema collects.\n* Composing the two keeps us at one field catalog + one flow-per-preset\n* instead of a bundle per (use case × preset) pair. `minimal` is the\n* default and never blocks non-interactive runs.\n*/\nconst SETUP_USE_CASES = [\n\t\"minimal\",\n\t\"consumer\",\n\t\"business\"\n];\nconst DEFAULT_SETUP_USE_CASE = \"minimal\";\n/**\n* Fields each use case collects, in register/display order. `email` is\n* always first and stays the only required property; the rest are optional\n* profile attributes gathered on the flow's register step. `givenName`/\n* `familyName` are the attributes the backend reads for a user's identity\n* (`internal/domain/user.go`); `companyName` is stored as a plain user\n* attribute today — there is no org/team model behind it yet.\n*/\nconst USE_CASE_FIELDS = {\n\tminimal: [\"email\"],\n\tconsumer: [\n\t\t\"email\",\n\t\t\"givenName\",\n\t\t\"familyName\"\n\t],\n\tbusiness: [\n\t\t\"email\",\n\t\t\"givenName\",\n\t\t\"familyName\",\n\t\t\"companyName\"\n\t]\n};\n/**\n* JSON-Schema bodies for the optional profile fields the CLI composes in per\n* use case. The shipped templates are an email-only baseline (shared verbatim\n* with the Go server fallback), so this catalog owns every field beyond\n* `email`. Authored in the templates' style — no `x-claim`, since the backend\n* maps identity by attribute name and the user-property meta-schema defines no\n* claim keyword. `givenName`/`familyName` are the attributes the backend reads\n* for a user's identity (`internal/domain/user.go`).\n*/\nconst EXTRA_FIELD_BODIES = {\n\tgivenName: {\n\t\ttype: \"string\",\n\t\tmaxLength: 50,\n\t\tdescription: \"The user's given (first) name.\"\n\t},\n\tfamilyName: {\n\t\ttype: \"string\",\n\t\tmaxLength: 50,\n\t\tdescription: \"The user's family (last) name.\"\n\t},\n\tcompanyName: {\n\t\ttype: \"string\",\n\t\tmaxLength: 200,\n\t\tdescription: \"The user's company name.\"\n\t}\n};\nfunction useCaseFields(useCase) {\n\tif (!Object.hasOwn(USE_CASE_FIELDS, useCase)) throw new Error(`unknown setup use case ${JSON.stringify(useCase)} (known use cases: ${SETUP_USE_CASES.join(\", \")})`);\n\treturn USE_CASE_FIELDS[useCase];\n}\n/**\n* The body for one use-case field: reuse the template's authored body when it\n* has one (so composed schemas match the shipped defaults for shared fields),\n* else the extra catalog, else a generic editable string so composition stays\n* total for any field a future use case introduces.\n*/\nfunction fieldBody(field, templateProps) {\n\tif (Object.hasOwn(templateProps, field)) return { ...templateProps[field] };\n\tif (Object.hasOwn(EXTRA_FIELD_BODIES, field)) return { ...EXTRA_FIELD_BODIES[field] };\n\treturn {\n\t\ttype: \"string\",\n\t\tdescription: `The user's ${field}.`\n\t};\n}\n/**\n* Narrow a rendered schema to the chosen use case: keep the preset-owned\n* header and `x-auth-methods`, but replace `properties`/`required` with the\n* use case's field set. `email` is the sole required property.\n*/\nfunction applyUseCaseToSchema(schema, useCase) {\n\tconst templateProps = schema.properties ?? {};\n\tconst properties = {};\n\tfor (const field of useCaseFields(useCase)) properties[field] = fieldBody(field, templateProps);\n\treturn {\n\t\t...schema,\n\t\trequired: [\"email\"],\n\t\tproperties\n\t};\n}\n/**\n* Derive the flow's register-step fields from the use case rather than\n* copying a hard-coded list into every bundle (#448): the register step\n* collects exactly what the schema defines. Other steps are untouched.\n*/\nfunction applyUseCaseToFlow(flow, useCase) {\n\tconst fields = [...useCaseFields(useCase)];\n\tconst steps = flow.steps.map((step) => step.name === \"register\" ? {\n\t\t...step,\n\t\tfields\n\t} : step);\n\treturn {\n\t\t...flow,\n\t\tsteps\n\t};\n}\nfunction defaultHumanUserSchemaUrl(builtinSchemaBase = DEFAULT_BUILTIN_SCHEMA_BASE) {\n\treturn `${trimTrailingSlash(builtinSchemaBase)}/default-human-user.json`;\n}\nfunction getDefaultHumanUserSchema(options = {}) {\n\tconst builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? \"https://nextgen.com/api/schemas\");\n\treturn applyUseCaseToSchema(renderTemplate(presetTemplates(options.preset ?? \"password-first\").schema, {\n\t\tSERVER_URL: builtinSchemaBase,\n\t\tUSER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)\n\t}), options.useCase ?? \"minimal\");\n}\nfunction getDefaultLoginFlow(options = {}) {\n\tconst builtinSchemaBase = trimTrailingSlash(options.builtinSchemaBase ?? \"https://nextgen.com/api/schemas\");\n\treturn applyUseCaseToFlow(renderTemplate(presetTemplates(options.preset ?? \"password-first\").flow, {\n\t\tSERVER_URL: builtinSchemaBase,\n\t\tUSER_SCHEMA_URL: options.userSchemaUrl ?? defaultHumanUserSchemaUrl(builtinSchemaBase)\n\t}), options.useCase ?? \"minimal\");\n}\nfunction renderTemplate(value, replacements) {\n\tif (Array.isArray(value)) return value.map((item) => renderTemplate(item, replacements));\n\tif (value !== null && typeof value === \"object\") return Object.fromEntries(Object.entries(value).map(([key, item]) => [key, renderTemplate(item, replacements)]));\n\tif (typeof value === \"string\") return value.replaceAll(/\\$\\{([A-Z_]+)\\}/g, (match, name) => {\n\t\treturn replacements[name] ?? match;\n\t});\n\treturn value;\n}\nfunction trimTrailingSlash(value) {\n\tlet trimmed = value;\n\twhile (trimmed.endsWith(\"/\")) trimmed = trimmed.slice(0, -1);\n\treturn trimmed;\n}\n//#endregion\nexport { brandingReadmeContent as _, DEFAULT_BUILTIN_SCHEMA_BASE as a, DEFAULT_SCHEMA_CONFIG_PATH as c, SETUP_PRESETS as d, SETUP_USE_CASES as f, getDefaultLoginFlow as g, getDefaultHumanUserSchema as h, DEFAULT_BRANDING_TEMPLATE_PATH as i, DEFAULT_SETUP_PRESET as l, getDefaultBrandingConfig as m, DEFAULT_BRANDING_CONFIG_PATH as n, DEFAULT_FLOW_CONFIG_PATH as o, defaultHumanUserSchemaUrl as p, DEFAULT_BRANDING_DESIGN as r, DEFAULT_FLOW_SCHEMA_URI as s, BRANDING_DESIGNS as t, DEFAULT_SETUP_USE_CASE as u, flowsReadmeContent as v, schemasReadmeContent as y };\n\n//# sourceMappingURL=defaults-eiGHyI5Y.mjs.map","import { createZitadelClient, type ZitadelClient } from \"@zitadel/api/client\";\nimport {\n DEFAULT_FLOW_SCHEMA_URI,\n getDefaultHumanUserSchema,\n getDefaultLoginFlow,\n type SetupPreset,\n type SetupUseCase,\n} from \"@zitadel/config/defaults\";\n\nexport interface BootstrapProjectOptions {\n baseUrl: string;\n projectName?: string;\n /**\n * Origins of the apps that will proxy to this instance. The backend's\n * origin check rejects forwarded requests from unregistered origins.\n */\n appOrigins?: string[];\n preset?: SetupPreset;\n useCase?: SetupUseCase;\n}\n\nexport interface BootstrappedProject {\n projectId: string;\n projectSecret: string;\n previewSecret?: string;\n schemaId: string;\n flowId: string;\n}\n\nconst DEFAULT_PROJECT_NAME = \"zitadel-testing\";\n\n/**\n * Server-side half of `zitadel setup`, without any file scaffolding:\n * `POST /projects` is unauthenticated and mints the projectSecret used as the\n * bearer for everything else; the schema is uploaded without `$id` so the\n * server assigns an opaque id, which the flow must then reference.\n */\nexport async function bootstrapProject(\n options: BootstrapProjectOptions,\n): Promise<BootstrappedProject> {\n const { baseUrl } = options;\n const unauthenticated = createZitadelClient({ baseUrl });\n const project = (await unauthenticated.createProject({\n name: options.projectName ?? DEFAULT_PROJECT_NAME,\n preview_origins: options.appOrigins ?? [],\n seed_defaults: false,\n } as Parameters<ZitadelClient[\"createProject\"]>[0])) as Record<string, unknown>;\n const projectId = requireString(project.id, \"project id\");\n const projectSecret = requireString(project.project_secret, \"project secret\");\n const previewSecret =\n typeof project.preview_secret === \"string\" ? project.preview_secret : undefined;\n\n const client = createZitadelClient({ baseUrl, token: projectSecret });\n\n const { $id: _templateId, ...schemaBody } = getDefaultHumanUserSchema({\n preset: options.preset,\n useCase: options.useCase,\n }) as { $id?: string } & Record<string, unknown>;\n void _templateId;\n const schema = (await client.createSchema(\n schemaBody as Parameters<ZitadelClient[\"createSchema\"]>[0],\n { project_id: projectId },\n )) as Record<string, unknown>;\n const schemaId = requireString(schema.id, \"schema id\");\n\n const flowBody = getDefaultLoginFlow({\n userSchemaUrl: schemaId,\n preset: options.preset,\n useCase: options.useCase,\n });\n const flow = (await client.createFlowDefinition({\n project_id: projectId,\n schema_uri: DEFAULT_FLOW_SCHEMA_URI,\n flow_definition: flowBody,\n } as Parameters<ZitadelClient[\"createFlowDefinition\"]>[0])) as Record<string, unknown>;\n const flowId = requireString(flow.id, \"flow definition id\");\n\n return { projectId, projectSecret, previewSecret, schemaId, flowId };\n}\n\nexport function requireString(value: unknown, label: string): string {\n if (typeof value === \"string\" && value.length > 0) {\n return value;\n }\n throw new Error(`Missing ${label} in server response.`);\n}\n","import { spawn } from \"node:child_process\";\nimport { createRequire } from \"node:module\";\nimport { dirname, join } from \"node:path\";\n\nexport interface RunCliOptions {\n args: string[];\n env?: NodeJS.ProcessEnv;\n /** Test seam / escape hatch: alternative CLI entry script. */\n bin?: string;\n timeoutMs?: number;\n}\n\nexport interface RunCliResult {\n exitCode: number;\n stdout: string;\n stderr: string;\n}\n\nconst DEFAULT_TIMEOUT_MS = 120_000;\n\nexport function resolveCliBin(): string {\n const require = createRequire(import.meta.url);\n const pkgPath = require.resolve(\"@zitadel/cli/package.json\");\n const pkg = require(pkgPath) as { bin?: Record<string, string> };\n const rel = pkg.bin?.zitadel;\n if (!rel) {\n throw new Error(\"@zitadel/cli does not declare a `zitadel` bin entry\");\n }\n return join(dirname(pkgPath), rel);\n}\n\nexport function runCli(options: RunCliOptions): Promise<RunCliResult> {\n const bin = options.bin ?? resolveCliBin();\n const timeoutMs = options.timeoutMs ?? DEFAULT_TIMEOUT_MS;\n return new Promise((resolve, reject) => {\n const child = spawn(process.execPath, [bin, ...options.args], {\n env: { ...process.env, ...options.env },\n stdio: [\"ignore\", \"pipe\", \"pipe\"],\n });\n let stdout = \"\";\n let stderr = \"\";\n child.stdout.setEncoding(\"utf8\");\n child.stdout.on(\"data\", (chunk: string) => {\n stdout += chunk;\n });\n child.stderr.setEncoding(\"utf8\");\n child.stderr.on(\"data\", (chunk: string) => {\n stderr += chunk;\n });\n const timer = setTimeout(() => {\n child.kill(\"SIGKILL\");\n reject(\n new Error(\n `zitadel ${options.args[0] ?? \"\"} timed out after ${timeoutMs}ms\\n${tail(stderr)}`,\n ),\n );\n }, timeoutMs);\n timer.unref();\n child.on(\"error\", (error) => {\n clearTimeout(timer);\n reject(error);\n });\n child.on(\"close\", (code) => {\n clearTimeout(timer);\n resolve({ exitCode: code ?? -1, stdout, stderr });\n });\n });\n}\n\nexport function tail(text: string, lines = 20): string {\n return text.split(\"\\n\").slice(-lines).join(\"\\n\").trim();\n}\n","export interface CliEnvelope<TData> {\n cli_version?: string;\n command?: string;\n source?: string;\n status: string;\n data: TData;\n warnings?: string[];\n /** Error envelopes (`status: \"error\"`) carry remediation guidance. */\n code?: string;\n message?: string;\n hint?: string;\n next_commands?: string[];\n}\n\n/**\n * Render an error envelope's remediation fields for humans — the CLI's\n * `hint`/`next_commands` are the actionable part of a failure (e.g. \"Reinstall\n * @zitadel/cli so npm can install @zitadel/server\"), so surface them instead\n * of a raw stdout dump. Returns undefined when the envelope has no message.\n */\nexport function describeEnvelopeError(envelope: CliEnvelope<unknown>): string | undefined {\n if (typeof envelope.message !== \"string\" || envelope.message.length === 0) {\n return undefined;\n }\n const lines = [envelope.code ? `${envelope.code}: ${envelope.message}` : envelope.message];\n if (envelope.hint) {\n lines.push(`hint: ${envelope.hint}`);\n }\n if (envelope.next_commands && envelope.next_commands.length > 0) {\n lines.push(`next: ${envelope.next_commands.join(\" | \")}`);\n }\n return lines.join(\"\\n\");\n}\n\nexport interface StartEnvelopeData {\n runtime: {\n backend: string;\n pid: number;\n port: number;\n data_dir: string;\n log_path: string;\n };\n urls: {\n api: string;\n console: string;\n login: string;\n };\n}\n\nexport function parseCliEnvelope<TData>(stdout: string, context: string): CliEnvelope<TData> {\n const start = stdout.indexOf(\"{\");\n const end = stdout.lastIndexOf(\"}\");\n if (start === -1 || end <= start) {\n throw new Error(\n `${context}: expected a JSON envelope on stdout, got:\\n${stdout.trim() || \"(empty)\"}`,\n );\n }\n let parsed: unknown;\n try {\n parsed = JSON.parse(stdout.slice(start, end + 1));\n } catch (error) {\n throw new Error(\n `${context}: failed to parse JSON envelope: ${(error as Error).message}\\n${stdout.trim()}`,\n { cause: error },\n );\n }\n if (\n typeof parsed !== \"object\" ||\n parsed === null ||\n typeof (parsed as { status?: unknown }).status !== \"string\"\n ) {\n throw new Error(`${context}: stdout JSON is not a CLI envelope:\\n${stdout.trim()}`);\n }\n return parsed as CliEnvelope<TData>;\n}\n","import { createServer } from \"node:net\";\n\n/**\n * Ask the OS for a free TCP port. The port is released before returning, so a\n * racing process could grab it; the CLI's own preflight surfaces that as\n * E_PORT_IN_USE, which is loud rather than corrupting.\n */\nexport function getFreePort(): Promise<number> {\n return new Promise((resolve, reject) => {\n const server = createServer();\n server.unref();\n server.on(\"error\", reject);\n server.listen(0, \"127.0.0.1\", () => {\n const address = server.address();\n if (address === null || typeof address === \"string\") {\n server.close();\n reject(new Error(\"could not determine a free port\"));\n return;\n }\n const { port } = address;\n server.close((err) => {\n if (err) {\n reject(err);\n return;\n }\n resolve(port);\n });\n });\n });\n}\n","import { mkdtemp, rm } from \"node:fs/promises\";\nimport { tmpdir } from \"node:os\";\nimport { join } from \"node:path\";\n\nimport { runCli, tail, type RunCliResult } from \"./cli\";\nimport {\n describeEnvelopeError,\n parseCliEnvelope,\n type CliEnvelope,\n type StartEnvelopeData,\n} from \"./envelope\";\nimport { getFreePort } from \"./ports\";\nimport type { LocalZitadelRuntime } from \"./types\";\n\nexport interface BootServerOptions {\n /** TCP port for the instance; defaults to an OS-assigned free port. */\n port?: number;\n /**\n * State directory. Defaults to a fresh temp dir that is removed on stop;\n * a caller-provided dir is never removed.\n */\n dir?: string;\n /** Forwarded as ZITADEL_SERVER_BINARY (in-repo runs use dist/server/nextgen). */\n serverBinary?: string;\n /** Keep the owned temp dir after stop (debugging). */\n keep?: boolean;\n /** Test seam: alternative CLI entry script. */\n cliBin?: string;\n timeoutMs?: number;\n}\n\nexport interface BootedServer {\n baseUrl: string;\n runtime: LocalZitadelRuntime;\n stop(): Promise<void>;\n}\n\n/**\n * Boot an ephemeral local server by shelling out to `zitadel start` and parse\n * its JSON envelope. The CLI owns the subtle parts (port preflight, health\n * wait, process-group stop), so this module stays a thin adapter; swapping it\n * for direct library calls later must not change the shape returned here.\n */\nexport async function bootLocalServer(options: BootServerOptions = {}): Promise<BootedServer> {\n const ownsDir = options.dir === undefined;\n const dir = options.dir ?? (await mkdtemp(join(tmpdir(), \"zitadel-testing-\")));\n const port = options.port ?? (await getFreePort());\n const env: NodeJS.ProcessEnv = {};\n if (options.serverBinary) {\n env.ZITADEL_SERVER_BINARY = options.serverBinary;\n }\n\n const result = await runCli({\n args: [\"start\", \"--port\", String(port), \"--non-interactive\", \"--json\", \"-c\", dir],\n bin: options.cliBin,\n env,\n timeoutMs: options.timeoutMs,\n });\n if (result.exitCode !== 0) {\n // Keep the dir on failure: server.log inside it is the diagnostic.\n throw new Error(\n `zitadel start exited with code ${result.exitCode}.\\n` +\n `${failureDetail(result)}\\n` +\n `state dir kept for inspection: ${dir}`,\n );\n }\n const stopViaCli = async (): Promise<void> => {\n const stopResult = await runCli({\n args: [\"stop\", \"--non-interactive\", \"--json\", \"-c\", dir],\n bin: options.cliBin,\n env,\n timeoutMs: options.timeoutMs,\n });\n if (stopResult.exitCode !== 0) {\n throw new Error(\n `zitadel stop exited with code ${stopResult.exitCode}.\\n` +\n `${failureDetail(stopResult)}\\n` +\n `state dir kept for inspection: ${dir}`,\n );\n }\n };\n\n let envelope: CliEnvelope<StartEnvelopeData>;\n try {\n envelope = parseCliEnvelope<StartEnvelopeData>(result.stdout, \"zitadel start\");\n if (envelope.status !== \"ok\") {\n throw new Error(\n `zitadel start reported status \"${envelope.status}\":\\n` +\n `${describeEnvelopeError(envelope) ?? tail(result.stdout)}`,\n );\n }\n } catch (error) {\n const startError = new Error(\n `zitadel start produced unusable output.\\n` +\n `reason: ${error instanceof Error ? error.message : String(error)}\\n` +\n `stdout: ${tail(result.stdout) || \"(empty)\"}\\n` +\n `stderr: ${tail(result.stderr) || \"(empty)\"}\\n` +\n `state dir kept for inspection: ${dir}`,\n { cause: error },\n );\n // start exited 0, so a server may well be running despite the unusable\n // output — stop it instead of orphaning it.\n try {\n await stopViaCli();\n } catch (stopError) {\n // Both errors are preserved in AggregateError.errors, which the rule\n // below cannot model.\n // oxlint-disable-next-line preserve-caught-error\n throw new AggregateError(\n [startError, stopError],\n `${startError.message}\\nStopping the possibly-running instance also failed: ${\n stopError instanceof Error ? stopError.message : String(stopError)\n }`,\n );\n }\n throw startError;\n }\n\n const { runtime, urls } = envelope.data;\n const runStop = async (): Promise<void> => {\n await stopViaCli();\n if (ownsDir && !options.keep) {\n await rm(dir, { recursive: true, force: true });\n }\n };\n // Memoize the in-flight stop so concurrent callers await the same cleanup,\n // and reset on failure so a failed stop can be retried instead of silently\n // leaving the server behind.\n let stopPromise: Promise<void> | undefined;\n const stop = (): Promise<void> => {\n stopPromise ??= runStop().catch((error: unknown) => {\n stopPromise = undefined;\n throw error;\n });\n return stopPromise;\n };\n\n return {\n baseUrl: urls.api,\n runtime: {\n port: runtime.port,\n pid: runtime.pid,\n dir,\n logPath: runtime.log_path,\n },\n stop,\n };\n}\n\n/**\n * A failed CLI run usually still prints an error envelope; its\n * message/hint/next_commands beat raw output tails (e.g. a fresh install\n * missing @zitadel/server gets \"Reinstall @zitadel/cli\" instead of a stack).\n */\nfunction failureDetail(result: RunCliResult): string {\n try {\n const described = describeEnvelopeError(parseCliEnvelope<unknown>(result.stdout, \"zitadel\"));\n if (described) {\n return described;\n }\n } catch {\n // stdout carried no envelope; fall back to the raw tails.\n }\n return `stdout: ${tail(result.stdout) || \"(empty)\"}\\nstderr: ${tail(result.stderr) || \"(empty)\"}`;\n}\n","import { randomUUID } from \"node:crypto\";\n\nimport type { ZitadelClient } from \"@zitadel/api/client\";\n\nimport { requireString } from \"./bootstrap\";\nimport type { Identity, SeededUser, SeedUserInput, SeedUsersTemplate } from \"./types\";\n\nexport interface SeedContext {\n projectId: string;\n schemaId: string;\n}\n\n/**\n * A unique unused email + password. Nothing is created on the instance —\n * this is the input for registration-flow specs, which must prove the flow\n * creates the user.\n */\nexport function identity(): Identity {\n return {\n email: `e2e-${randomUUID().slice(0, 8)}@example.com`,\n password: `Pw!${randomUUID()}`,\n };\n}\n\n/**\n * Create a user that can immediately complete the password login flow:\n * `POST /users` (the body carries `schema: <schema id>` and the schema-defined\n * content under `attributes`) followed by `PUT /users/{id}/password` with\n * `is_change_required: false`.\n *\n * Defaults mint a unique email per call (email is x-unique per project), which\n * is what makes per-test seeding parallel-safe on a shared instance.\n */\nexport async function seedUser(\n client: ZitadelClient,\n context: SeedContext,\n input: SeedUserInput = {},\n): Promise<SeededUser> {\n const fresh = identity();\n const email = input.email ?? fresh.email;\n const password = input.password ?? fresh.password;\n // `email` wins over the templated attributes: the returned SeededUser must\n // never disagree with what was actually created, since a silently overridden\n // email would yield credentials that cannot log in.\n const user = (await client.createUser(\n {\n schema: context.schemaId,\n attributes: { ...input.attributes, email },\n },\n { project_id: context.projectId },\n )) as Record<string, unknown>;\n const id = requireString(user.id, \"user id\");\n await client.setUserPassword(id, { password, is_change_required: false });\n return { id, email, password };\n}\n\n/**\n * Seed `count` users sequentially. The template makes fixture data\n * deterministic per index (stable emails/names keep screenshot diffs about\n * code, not reshuffled data — the `console:dev-real` pattern); untemplated\n * fields fall back to the unique defaults. Name-like attributes need a\n * schema that declares them (`useCase: \"consumer\"` or wider).\n */\nexport async function seedUsers(\n client: ZitadelClient,\n context: SeedContext,\n count: number,\n template: SeedUsersTemplate = {},\n): Promise<SeededUser[]> {\n const users: SeededUser[] = [];\n for (let index = 0; index < count; index += 1) {\n users.push(\n await seedUser(client, context, {\n email: template.email?.(index),\n password: template.password?.(index),\n attributes: template.attributes?.(index),\n }),\n );\n }\n return users;\n}\n","import type { ZitadelClient } from \"@zitadel/api/client\";\nimport type { CreateFlow201, CreateFlow201StepFieldsItem } from \"@zitadel/api/generated/model\";\n\nimport type { SeedContext } from \"./seed\";\nimport type { InstanceHandle, MintedSession, SeededUser } from \"./types\";\n\n/** Mirrors the server's session cookie (internal/api/session.go). */\nexport const SESSION_COOKIE_NAME = \"__nextgen_session\";\n\nconst MAX_FLOW_STEPS = 6;\n\nexport interface MintSessionOptions {\n /** Forwarded to `POST /flow`; the project's default flow when omitted. */\n flowDefinitionName?: string;\n /** Origin header for flow calls (the project's origin check enforces it). */\n origin?: string;\n}\n\n/**\n * Drive the real login flow headlessly for a seeded password user and\n * exchange the terminal handoff for a session: exactly what `<zitadel-login>`\n * does, minus the rendering. Supports flows whose steps only ask for the\n * user's email and password (the shipped `password-first` presets); any step\n * demanding more — a challenge, an unknown field — fails loudly by design.\n *\n * Flow calls use raw fetch instead of the typed client because the flow is\n * stateless through the sealed `_zflow` cookie (internal/api/flow.go): every\n * response re-seals the flow state into Set-Cookie, and submits are rejected\n * without it. Browsers round-trip it implicitly; here a one-cookie jar does.\n */\nexport async function mintSession(\n client: ZitadelClient,\n handle: Pick<InstanceHandle, \"baseUrl\" | \"projectSecret\">,\n context: SeedContext,\n user: SeededUser,\n options: MintSessionOptions = {},\n): Promise<MintedSession> {\n const values: Record<string, string> = { email: user.email, password: user.password };\n const jar = new FlowCookieJar();\n const origin = options.origin;\n\n let response = await flowFetch(handle, jar, origin, \"/flow\", {\n project_id: context.projectId,\n purpose: \"login\",\n ...(options.flowDefinitionName ? { flow_definition_name: options.flowDefinitionName } : {}),\n });\n\n for (let hop = 0; hop < MAX_FLOW_STEPS; hop += 1) {\n if (response.handoff_token) {\n const exchanged = await client.exchangeHandoff(\n { handoff_token: response.handoff_token },\n { project_id: context.projectId },\n );\n return {\n user,\n sessionToken: exchanged.session_token,\n expiresAt: exchanged.session.expires_at,\n cookie: {\n name: SESSION_COOKIE_NAME,\n value: exchanged.session_token,\n httpOnly: true,\n secure: true,\n sameSite: \"Lax\",\n path: \"/\",\n },\n };\n }\n response = await flowFetch(handle, jar, origin, `/flow/${encodeURIComponent(response.id)}/submit`, {\n session_token: response.session_token,\n action: \"submit\",\n fields: collectFields(response, values),\n });\n }\n\n throw new Error(\n `seed.session: flow did not complete within ${MAX_FLOW_STEPS} steps ` +\n `(last step: ${describeStep(response)}).`,\n );\n}\n\n/** One-cookie jar for the sealed `_zflow` flow-state cookie. */\nclass FlowCookieJar {\n private cookie: string | undefined;\n\n absorb(response: Response): void {\n for (const raw of response.headers.getSetCookie()) {\n const [pair] = raw.split(\";\", 1);\n if (pair?.startsWith(\"_zflow=\")) {\n this.cookie = pair;\n }\n }\n }\n\n header(): Record<string, string> {\n return this.cookie ? { cookie: this.cookie } : {};\n }\n}\n\nasync function flowFetch(\n handle: Pick<InstanceHandle, \"baseUrl\" | \"projectSecret\">,\n jar: FlowCookieJar,\n origin: string | undefined,\n path: string,\n body: Record<string, unknown>,\n): Promise<CreateFlow201> {\n const response = await fetch(`${handle.baseUrl}${path}`, {\n method: \"POST\",\n headers: {\n \"content-type\": \"application/json\",\n authorization: `Bearer ${handle.projectSecret}`,\n // The project's origin allowlist applies to flow calls; send the app\n // origin the way a browser request through the app would carry it.\n ...(origin ? { origin } : {}),\n ...jar.header(),\n },\n body: JSON.stringify(body),\n });\n jar.absorb(response);\n const parsed = (await response.json().catch(() => undefined)) as CreateFlow201 | undefined;\n if (!response.ok || !parsed) {\n const detail =\n parsed && typeof parsed === \"object\" ? ` — ${JSON.stringify(parsed)}` : \"\";\n // An origin-allowlist rejection without an Origin header is a\n // configuration gap, not a flow problem — say how to close it. (No eager\n // check: a project with an empty allowlist may accept originless calls.)\n const hint =\n !origin && /origin/i.test(detail)\n ? \"\\nNo Origin header was sent: pass `origin` to seedSession() (the Playwright \" +\n \"fixtures pass the suite's baseURL) or `appOrigins` to startLocalZitadel().\"\n : \"\";\n throw new Error(`seed.session: POST ${path} returned ${response.status}${detail}${hint}`);\n }\n return parsed;\n}\n\n/**\n * Fill exactly the fields the current step declares — the orchestrator's\n * convention — from the known email/password values. An unknown required\n * field means this flow needs more than a password login can provide.\n */\nfunction collectFields(response: CreateFlow201, values: Record<string, string>): Record<string, string> {\n const fields: Record<string, string> = {};\n for (const field of response.step.fields ?? []) {\n const value = values[fieldKey(field)];\n if (value === undefined) {\n throw new Error(\n `seed.session supports password flows only; step ${describeStep(response)} ` +\n `declares field \"${field.name}\", which the kit cannot fill. ` +\n `Log in through the UI for flows with additional factors.`,\n );\n }\n fields[field.name] = value;\n }\n return fields;\n}\n\n/**\n * Steps name credential fields with schema pointers (e.g.\n * `x-auth-methods#password`); match on the trailing segment so the value map\n * stays the plain `{ email, password }` a caller thinks in.\n */\nfunction fieldKey(field: CreateFlow201StepFieldsItem): string {\n const name = field.name;\n const tail = name.split(/[#/.]/).at(-1) ?? name;\n return tail.toLowerCase();\n}\n\nfunction describeStep(response: CreateFlow201): string {\n const name = response.step.name ?? \"(unnamed)\";\n const declared = (response.step.fields ?? []).map((field) => field.name).join(\", \");\n return `\"${name}\"${declared ? ` [fields: ${declared}]` : \"\"}`;\n}\n","import { createZitadelClient } from \"@zitadel/api/client\";\n\nimport { applyAppEnvTemplate, nextAppEnv } from \"./app-env\";\nimport { bootstrapProject, type BootstrapProjectOptions } from \"./bootstrap\";\nimport { bootLocalServer, type BootServerOptions } from \"./lifecycle\";\nimport { identity, seedUser, seedUsers } from \"./seed\";\nimport { mintSession } from \"./session\";\nimport type { ConnectedZitadel, InstanceHandle, LocalZitadel } from \"./types\";\n\nexport type StartLocalZitadelOptions = BootServerOptions &\n Omit<BootstrapProjectOptions, \"baseUrl\">;\n\n/**\n * Attach to an already-bootstrapped instance/project. Lifecycle-free on\n * purpose: this is the entry point for Playwright workers (via the handshake\n * file) and, later, for seeding remote instances.\n */\nexport function connectZitadel(handle: InstanceHandle): ConnectedZitadel {\n const api = createZitadelClient({ baseUrl: handle.baseUrl, token: handle.projectSecret });\n const context = { projectId: handle.projectId, schemaId: handle.schemaId };\n const connected: ConnectedZitadel = {\n handle,\n api,\n // The Next-shaped convenience view; other frameworks apply their own\n // template to `handle` (see AppEnvTemplate).\n appEnv: applyAppEnvTemplate(nextAppEnv, handle),\n seedUser: (input) => seedUser(api, context, input),\n seedUsers: (count, template) => seedUsers(api, context, count, template),\n identity,\n seedSession: async (input = {}) => {\n const { user: existing, flowDefinitionName, origin, ...userInput } = input;\n const user = existing ?? (await seedUser(api, context, userInput));\n return mintSession(api, handle, context, user, {\n flowDefinitionName,\n origin: origin ?? handle.appOrigin,\n });\n },\n };\n return connected;\n}\n\n/**\n * Boot an ephemeral local instance (binary runtime + SQLite by default, no\n * Docker) and bootstrap a project + default schema + login flow on it. The\n * result can seed loginable password users immediately.\n */\nexport async function startLocalZitadel(\n options: StartLocalZitadelOptions = {},\n): Promise<LocalZitadel> {\n const server = await bootLocalServer(options);\n let bootstrapped;\n try {\n bootstrapped = await bootstrapProject({\n baseUrl: server.baseUrl,\n projectName: options.projectName,\n appOrigins: options.appOrigins,\n preset: options.preset,\n useCase: options.useCase,\n });\n } catch (error) {\n try {\n await server.stop();\n } catch (stopError) {\n // Both errors are preserved in AggregateError.errors, which the rule\n // below cannot model.\n // oxlint-disable-next-line preserve-caught-error\n throw new AggregateError(\n [error, stopError],\n \"bootstrap failed, and stopping the booted instance also failed\",\n );\n }\n throw error;\n }\n const handle: InstanceHandle = {\n baseUrl: server.baseUrl,\n projectId: bootstrapped.projectId,\n projectSecret: bootstrapped.projectSecret,\n schemaId: bootstrapped.schemaId,\n previewSecret: bootstrapped.previewSecret,\n appOrigin: options.appOrigins?.[0],\n };\n return {\n ...connectZitadel(handle),\n runtime: server.runtime,\n stop: server.stop,\n [Symbol.asyncDispose]: server.stop,\n };\n}\n\nexport { applyAppEnvTemplate, nextAppEnv } from \"./app-env\";\nexport type { AppEnvTemplate } from \"./app-env\";\nexport { bootstrapProject } from \"./bootstrap\";\nexport type { BootstrapProjectOptions, BootstrappedProject } from \"./bootstrap\";\nexport { readHandshakeSync, waitForHandshake, writeHandshake } from \"./handshake\";\nexport { bootLocalServer } from \"./lifecycle\";\nexport type { BootedServer, BootServerOptions } from \"./lifecycle\";\nexport { SESSION_COOKIE_NAME } from \"./session\";\nexport type {\n ConnectedZitadel,\n Identity,\n InstanceHandle,\n LocalZitadel,\n LocalZitadelRuntime,\n MintedSession,\n SeededUser,\n SeedSessionInput,\n SeedUserInput,\n SeedUsersTemplate,\n SessionCookie,\n} from \"./types\";\n"],"mappings":";;;;;;;;;;;AACA,IAAI,YAAY;AAChB,SAAS,eAAe;AACvB,QAAO;;AAER,SAAS,aAAa,MAAM;AAC3B,aAAY;;;;;;;;;;;;;;ACKb,IAAI;AACJ,SAAS,kBAAkB;AAC1B,QAAO;;AAER,SAAS,gBAAgB,OAAO;AAC/B,gBAAe;;;;ACfhB,IAAI,YAAY,OAAO;AACvB,IAAI,eAAe,KAAK,eAAe;CACtC,IAAI,SAAS,EAAE;AACf,MAAK,IAAI,QAAQ,IAAK,WAAU,QAAQ,MAAM;EAC7C,KAAK,IAAI;EACT,YAAY;EACZ,CAAC;AACF,KAAI,CAAC,WAAY,WAAU,QAAQ,OAAO,aAAa,EAAE,OAAO,UAAU,CAAC;AAC3E,QAAO;;;;;;;;;;;;;;;ACIR,IAAI,WAAW,cAAc,MAAM;CAClC;CACA;CACA;CACA,YAAY,QAAQ,KAAK,MAAM,SAAS;AACvC,QAAM,QAAQ;AACd,OAAK,OAAO;AACZ,OAAK,SAAS;AACd,OAAK,MAAM;AACX,OAAK,OAAO;;;;;;;;;;;;;;;;;AAiBd,eAAe,YAAY,KAAK,SAAS;CACxC,MAAM,QAAQ,iBAAiB;CAC/B,MAAM,UAAU,IAAI,QAAQ,QAAQ,QAAQ;AAC5C,KAAI,SAAS,CAAC,QAAQ,IAAI,gBAAgB,CAAE,SAAQ,IAAI,iBAAiB,UAAU,QAAQ;CAC3F,MAAM,MAAM,MAAM,MAAM,KAAK;EAC5B,GAAG;EACH;EACA,CAAC;CACF,MAAM,UAAU;EACf;EACA;EACA;EACA,CAAC,SAAS,IAAI,OAAO,GAAG,KAAK,MAAM,IAAI,M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