@zitadel/testing 1.0.0-alpha.21 → 1.0.0-alpha.23

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.
@@ -137,22 +137,24 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
137
137
  createFlowDefinition: () => createFlowDefinition,
138
138
  createGrant: () => createGrant,
139
139
  createHandoff: () => createHandoff,
140
+ createIdp: () => createIdp,
140
141
  createProject: () => createProject,
141
142
  createRelease: () => createRelease,
142
143
  createSchema: () => createSchema,
143
144
  createSession: () => createSession,
144
145
  createTeam: () => createTeam,
145
146
  createUser: () => createUser,
146
- deleteFlowDefinition: () => deleteFlowDefinition,
147
147
  deleteGrant: () => deleteGrant,
148
148
  deleteTeam: () => deleteTeam,
149
149
  deleteUserByID: () => deleteUserByID,
150
+ deleteVariable: () => deleteVariable,
150
151
  exchangeHandoff: () => exchangeHandoff,
151
152
  finishUserPasskeyRegistration: () => finishUserPasskeyRegistration,
152
153
  getAuthAttempt: () => getAuthAttempt,
153
154
  getBeginUserPasskeyRegistrationUrl: () => getBeginUserPasskeyRegistrationUrl,
154
155
  getBrandingById: () => getBrandingById,
155
156
  getClaimStatus: () => getClaimStatus,
157
+ getClaimWindow: () => getClaimWindow,
156
158
  getCompleteClaimUrl: () => getCompleteClaimUrl,
157
159
  getCreateAuthAttemptUrl: () => getCreateAuthAttemptUrl,
158
160
  getCreateBrandingUrl: () => getCreateBrandingUrl,
@@ -160,16 +162,17 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
160
162
  getCreateFlowUrl: () => getCreateFlowUrl,
161
163
  getCreateGrantUrl: () => getCreateGrantUrl,
162
164
  getCreateHandoffUrl: () => getCreateHandoffUrl,
165
+ getCreateIdpUrl: () => getCreateIdpUrl,
163
166
  getCreateProjectUrl: () => getCreateProjectUrl,
164
167
  getCreateReleaseUrl: () => getCreateReleaseUrl,
165
168
  getCreateSchemaUrl: () => getCreateSchemaUrl,
166
169
  getCreateSessionUrl: () => getCreateSessionUrl,
167
170
  getCreateTeamUrl: () => getCreateTeamUrl,
168
171
  getCreateUserUrl: () => getCreateUserUrl,
169
- getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
170
172
  getDeleteGrantUrl: () => getDeleteGrantUrl,
171
173
  getDeleteTeamUrl: () => getDeleteTeamUrl,
172
174
  getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
175
+ getDeleteVariableUrl: () => getDeleteVariableUrl,
173
176
  getEnvironmentByName: () => getEnvironmentByName,
174
177
  getEvent: () => getEvent,
175
178
  getExchangeHandoffUrl: () => getExchangeHandoffUrl,
@@ -179,12 +182,15 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
179
182
  getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
180
183
  getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
181
184
  getGetClaimStatusUrl: () => getGetClaimStatusUrl,
185
+ getGetClaimWindowUrl: () => getGetClaimWindowUrl,
182
186
  getGetEnvironmentByNameUrl: () => getGetEnvironmentByNameUrl,
183
187
  getGetEventUrl: () => getGetEventUrl,
184
188
  getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
185
189
  getGetFlowStepUrl: () => getGetFlowStepUrl,
186
190
  getGetGrantUrl: () => getGetGrantUrl,
187
191
  getGetHealthUrl: () => getGetHealthUrl,
192
+ getGetIdpByIdUrl: () => getGetIdpByIdUrl,
193
+ getGetIdpRevisionByIdUrl: () => getGetIdpRevisionByIdUrl,
188
194
  getGetLiveUrl: () => getGetLiveUrl,
189
195
  getGetMySessionUrl: () => getGetMySessionUrl,
190
196
  getGetMyUserUrl: () => getGetMyUserUrl,
@@ -195,14 +201,20 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
195
201
  getGetSessionUrl: () => getGetSessionUrl,
196
202
  getGetTeamUrl: () => getGetTeamUrl,
197
203
  getGetUserByIDUrl: () => getGetUserByIDUrl,
204
+ getGetVariableUrl: () => getGetVariableUrl,
205
+ getGetVariablesUrl: () => getGetVariablesUrl,
198
206
  getGrant: () => getGrant,
199
207
  getHealth: () => getHealth,
208
+ getIdpById: () => getIdpById,
209
+ getIdpRevisionById: () => getIdpRevisionById,
200
210
  getInitClaimUrl: () => getInitClaimUrl,
201
211
  getIssueChallengeUrl: () => getIssueChallengeUrl,
202
212
  getListBrandingUrl: () => getListBrandingUrl,
203
213
  getListEnvironmentsUrl: () => getListEnvironmentsUrl,
204
214
  getListEventsUrl: () => getListEventsUrl,
205
215
  getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
216
+ getListIdpRevisionsUrl: () => getListIdpRevisionsUrl,
217
+ getListMyProjectsUrl: () => getListMyProjectsUrl,
206
218
  getListReleasesUrl: () => getListReleasesUrl,
207
219
  getListSchemasUrl: () => getListSchemasUrl,
208
220
  getListUserPasskeysUrl: () => getListUserPasskeysUrl,
@@ -210,8 +222,12 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
210
222
  getLive: () => getLive,
211
223
  getMySession: () => getMySession,
212
224
  getMyUser: () => getMyUser,
225
+ getPatchMyUserUrl: () => getPatchMyUserUrl,
213
226
  getPatchProjectUrl: () => getPatchProjectUrl,
227
+ getPatchUserByIDUrl: () => getPatchUserByIDUrl,
214
228
  getProject: () => getProject,
229
+ getQueryGrantsUrl: () => getQueryGrantsUrl,
230
+ getQueryIdpsUrl: () => getQueryIdpsUrl,
215
231
  getQueryProjectsUrl: () => getQueryProjectsUrl,
216
232
  getQuerySessionsUrl: () => getQuerySessionsUrl,
217
233
  getQueryTeamsUrl: () => getQueryTeamsUrl,
@@ -225,9 +241,11 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
225
241
  getSetUserPasswordUrl: () => getSetUserPasswordUrl,
226
242
  getSubmitFlowStepUrl: () => getSubmitFlowStepUrl,
227
243
  getTeam: () => getTeam,
228
- getUpdateFlowDefinitionUrl: () => getUpdateFlowDefinitionUrl,
229
244
  getUpdateTeamUrl: () => getUpdateTeamUrl,
245
+ getUpdateVariablesUrl: () => getUpdateVariablesUrl,
230
246
  getUserByID: () => getUserByID,
247
+ getVariable: () => getVariable,
248
+ getVariables: () => getVariables,
231
249
  getVerifyChallengeProofUrl: () => getVerifyChallengeProofUrl,
232
250
  initClaim: () => initClaim,
233
251
  issueChallenge: () => issueChallenge,
@@ -235,11 +253,17 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
235
253
  listEnvironments: () => listEnvironments,
236
254
  listEvents: () => listEvents,
237
255
  listFlowDefinitions: () => listFlowDefinitions,
256
+ listIdpRevisions: () => listIdpRevisions,
257
+ listMyProjects: () => listMyProjects,
238
258
  listReleases: () => listReleases,
239
259
  listSchemas: () => listSchemas,
240
260
  listUserPasskeys: () => listUserPasskeys,
241
261
  listUserTeams: () => listUserTeams,
262
+ patchMyUser: () => patchMyUser,
242
263
  patchProject: () => patchProject,
264
+ patchUserByID: () => patchUserByID,
265
+ queryGrants: () => queryGrants,
266
+ queryIdps: () => queryIdps,
243
267
  queryProjects: () => queryProjects,
244
268
  querySessions: () => querySessions,
245
269
  queryTeams: () => queryTeams,
@@ -248,8 +272,8 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
248
272
  revokeSession: () => revokeSession,
249
273
  setUserPassword: () => setUserPassword,
250
274
  submitFlowStep: () => submitFlowStep,
251
- updateFlowDefinition: () => updateFlowDefinition,
252
275
  updateTeam: () => updateTeam,
276
+ updateVariables: () => updateVariables,
253
277
  verifyChallengeProof: () => verifyChallengeProof
254
278
  });
255
279
  const getGetHealthUrl = () => {
@@ -319,9 +343,14 @@ const getQueryUsersUrl = () => {
319
343
  /**
320
344
  * Returns the users of a project, paginated with a cursor.
321
345
 
322
- The project comes from the credential, not from a parameter: the operation
323
- is bound to the token's own project by construction. This is why it takes
324
- no `project_id`, unlike the other query endpoints.
346
+ The project comes from the credential, not from a parameter: the
347
+ operation is bound to the credential's home project by construction
348
+ (oauth2 secret or user-bound session). This is why it takes no
349
+ `project_id`, unlike the other query endpoints.
350
+
351
+ Accepts either a project secret (`oauth2`) or a user-bound Console
352
+ session cookie (`nextgenSession`). CSRF/Origin for cookie mutations
353
+ is a follow-up (#1140).
325
354
 
326
355
  * @summary Query users
327
356
  */
@@ -353,6 +382,28 @@ const getUserByID = async (userId, params, options) => {
353
382
  method: "GET"
354
383
  });
355
384
  };
385
+ const getPatchUserByIDUrl = (userId) => {
386
+ return `${getProxyPath()}/users/${userId}`;
387
+ };
388
+ /**
389
+ * Partially updates a user's schema-defined attributes, and optionally
390
+ moves the user to another registered schema. The merged result is
391
+ validated against the schema before commit. Concurrent writes are
392
+ last-write-wins.
393
+
394
+ * @summary Update user by ID
395
+ */
396
+ const patchUserByID = async (userId, patchUserByIDBody, options) => {
397
+ return customFetch(getPatchUserByIDUrl(userId), {
398
+ ...options,
399
+ method: "PATCH",
400
+ headers: {
401
+ "Content-Type": "application/json",
402
+ ...options?.headers
403
+ },
404
+ body: JSON.stringify(patchUserByIDBody)
405
+ });
406
+ };
356
407
  const getDeleteUserByIDUrl = (userId) => {
357
408
  return `${getProxyPath()}/users/${userId}`;
358
409
  };
@@ -483,6 +534,52 @@ const getMyUser = async (options) => {
483
534
  method: "GET"
484
535
  });
485
536
  };
537
+ const getPatchMyUserUrl = () => {
538
+ return `${getProxyPath()}/users/me`;
539
+ };
540
+ /**
541
+ * Partially updates the caller's own schema-defined attributes. The merged
542
+ result is validated against the user's schema before commit. Concurrent
543
+ writes are last-write-wins.
544
+
545
+ * @summary Update my user information
546
+ */
547
+ const patchMyUser = async (patchMyUserBody, options) => {
548
+ return customFetch(getPatchMyUserUrl(), {
549
+ ...options,
550
+ method: "PATCH",
551
+ headers: {
552
+ "Content-Type": "application/json",
553
+ ...options?.headers
554
+ },
555
+ body: JSON.stringify(patchMyUserBody)
556
+ });
557
+ };
558
+ const getListMyProjectsUrl = (params) => {
559
+ const normalizedParams = new URLSearchParams();
560
+ Object.entries(params || {}).forEach(([key, value]) => {
561
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
562
+ });
563
+ const stringifiedParams = normalizedParams.toString();
564
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/users/me/projects?${stringifiedParams}` : `${getProxyPath()}/users/me/projects`;
565
+ };
566
+ /**
567
+ * The projects the signed-in user holds an active grant on, either directly or
568
+ through a team they are a member of. Ordered by project id and paged with an
569
+ opaque cursor.
570
+
571
+ This is not the same question as `queryProjects`, which answers with the one
572
+ project the calling credential is bound to. Here the session is the caller
573
+ and the grants are the answer, so the list spans projects.
574
+
575
+ * @summary List the projects I can act on
576
+ */
577
+ const listMyProjects = async (params, options) => {
578
+ return customFetch(getListMyProjectsUrl(params), {
579
+ ...options,
580
+ method: "GET"
581
+ });
582
+ };
486
583
  const getCreateFlowUrl = () => {
487
584
  return `${getProxyPath()}/flow`;
488
585
  };
@@ -789,7 +886,11 @@ const getGetClaimStatusUrl = (projectId, params) => {
789
886
  * Polled by the CLI while a browser completes the claim. Authorized by the
790
887
  project secret that initiated the challenge. Returns `pending`, or
791
888
  `completed` with the owning team, the claim timestamp, and the dashboard
792
- URL once the browser leg has finished.
889
+ URL once the project is claimed. The claim grant, not the polled
890
+ challenge, is the source of truth: a project claimed through another
891
+ concurrent challenge also reports `completed`, and a completed claim
892
+ keeps reporting `completed` past this challenge's expiry and past the
893
+ project's claim window.
793
894
 
794
895
  * @summary Get claim status
795
896
  */
@@ -821,6 +922,30 @@ const completeClaim = async (projectId, completeClaimBody, options) => {
821
922
  body: JSON.stringify(completeClaimBody)
822
923
  });
823
924
  };
925
+ const getGetClaimWindowUrl = (projectId, params) => {
926
+ const normalizedParams = new URLSearchParams();
927
+ Object.entries(params || {}).forEach(([key, value]) => {
928
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
929
+ });
930
+ const stringifiedParams = normalizedParams.toString();
931
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${projectId}/claim/window?${stringifiedParams}` : `${getProxyPath()}/projects/${projectId}/claim/window`;
932
+ };
933
+ /**
934
+ * Read by the claim page in the browser to show how long is left to claim the
935
+ project. Unauthenticated by design: the claim page runs this before the
936
+ developer has signed in, and holding the `challenge_id` from the claim URL
937
+ is the authorization — the same capability `claim/complete` accepts. It
938
+ reveals only the window, never the project itself, and unlike
939
+ `claim/complete` it spends nothing, so a reload is free.
940
+
941
+ * @summary Get the claim window for a project
942
+ */
943
+ const getClaimWindow = async (projectId, params, options) => {
944
+ return customFetch(getGetClaimWindowUrl(projectId, params), {
945
+ ...options,
946
+ method: "GET"
947
+ });
948
+ };
824
949
  const getCreateSessionUrl = () => {
825
950
  return `${getProxyPath()}/sessions`;
826
951
  };
@@ -1082,12 +1207,17 @@ const getCreateFlowDefinitionUrl = () => {
1082
1207
  return `${getProxyPath()}/flow_definitions`;
1083
1208
  };
1084
1209
  /**
1085
- * Creates a new flow definition.
1210
+ * Publishes a new flow definition revision.
1086
1211
  Flow definitions are templates that define the sequence of steps (capabilities)
1087
1212
  for a particular user journey (e.g., registration, login, password reset).
1088
1213
 
1089
1214
  Flow definitions are created based on the flow definition schema, which includes the flow's purpose, audience, and the steps involved.
1090
1215
 
1216
+ Every call allocates a new opaque id. Revisions of one flow share its
1217
+ `name`; posting a definition under an existing `name` publishes a new
1218
+ revision of that flow, it is not a conflict. List with `name` to see a
1219
+ flow's revisions, newest by creation time first.
1220
+
1091
1221
  * @summary Create a new flow definition
1092
1222
  */
1093
1223
  const createFlowDefinition = async (createFlowDefinitionBody, options) => {
@@ -1110,8 +1240,9 @@ const getListFlowDefinitionsUrl = (params) => {
1110
1240
  return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions?${stringifiedParams}` : `${getProxyPath()}/flow_definitions`;
1111
1241
  };
1112
1242
  /**
1113
- * Retrieves a list of all flow definitions.
1243
+ * Retrieves a list of all flow definitions, newest by creation time first.
1114
1244
  This endpoint can be used to view existing flow definitions and their configurations.
1245
+ Filter by `name` to list the revisions of one flow.
1115
1246
 
1116
1247
  * @summary List flow definitions
1117
1248
  */
@@ -1134,42 +1265,6 @@ const getFlowDefinition = async (id, options) => {
1134
1265
  method: "GET"
1135
1266
  });
1136
1267
  };
1137
- const getUpdateFlowDefinitionUrl = (id) => {
1138
- return `${getProxyPath()}/flow_definitions/${id}`;
1139
- };
1140
- /**
1141
- * Update a flow definition by id. This endpoint replaces the existing flow definition.
1142
- If `flow_definition.status` is omitted, the current status is preserved
1143
-
1144
- * @summary Update a flow definition by id
1145
- */
1146
- const updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {
1147
- return customFetch(getUpdateFlowDefinitionUrl(id), {
1148
- ...options,
1149
- method: "PUT",
1150
- headers: {
1151
- "Content-Type": "application/json",
1152
- ...options?.headers
1153
- },
1154
- body: JSON.stringify(updateFlowDefinitionBody)
1155
- });
1156
- };
1157
- const getDeleteFlowDefinitionUrl = (id) => {
1158
- return `${getProxyPath()}/flow_definitions/${id}`;
1159
- };
1160
- /**
1161
- * Delete a flow definition by id.
1162
- If the flow definition is currently being used by a flow, the deletion will fail.
1163
- If the flow definition is the last active flow definition for a given purpose, the deletion will fail to prevent disruption of new flows being started for that purpose.
1164
-
1165
- * @summary Delete a flow definition by id
1166
- */
1167
- const deleteFlowDefinition = async (id, options) => {
1168
- return customFetch(getDeleteFlowDefinitionUrl(id), {
1169
- ...options,
1170
- method: "DELETE"
1171
- });
1172
- };
1173
1268
  const getCreateTeamUrl = (params) => {
1174
1269
  const normalizedParams = new URLSearchParams();
1175
1270
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1243,6 +1338,11 @@ users whose lifecycle it owns are deactivated with it.
1243
1338
  The request is idempotent. Deleting a team that is already deactivated
1244
1339
  or doesn't exist succeeds without changing anything.
1245
1340
 
1341
+ A team that still owns a project is refused with `409
1342
+ team.owns_project`: deactivating it would leave the project owned by a
1343
+ dead team and so unmanageable. No endpoint releases that ownership yet,
1344
+ so such a team cannot currently be deactivated through the API.
1345
+
1246
1346
  * @summary Delete team
1247
1347
  */
1248
1348
  const deleteTeam = async (teamId, options) => {
@@ -1322,8 +1422,7 @@ const getCreateBrandingUrl = (params) => {
1322
1422
  /**
1323
1423
  * Publishes a new immutable branding revision for the project. Branding
1324
1424
  revisions cannot be updated or deleted; every edit publishes a new
1325
- revision, and flow responses resolve the latest revision per project
1326
- (see ADR 040).
1425
+ revision, and flow responses resolve the latest revision per project.
1327
1426
 
1328
1427
  The `liquid_template` is validated lexically on save (size, encoding,
1329
1428
  banned patterns such as `<script>` tags, inline event handlers, and the
@@ -1354,9 +1453,9 @@ const getListBrandingUrl = (params) => {
1354
1453
  /**
1355
1454
  * Lists branding revisions for the project, newest first, capped at the
1356
1455
  100 most recent. The first entry is the revision flow responses
1357
- currently resolve. Deliberately unpaginated in v1 — list endpoints
1358
- gain a real query mechanism together (ADR 031); advertising pagination
1359
- parameters the server ignores would be worse than none.
1456
+ currently resolve. Deliberately unpaginated in v1 — list endpoints gain a
1457
+ real query mechanism together; advertising pagination parameters the
1458
+ server ignores would be worse than none.
1360
1459
 
1361
1460
  * @summary List branding revisions
1362
1461
  */
@@ -1379,6 +1478,142 @@ const getBrandingById = async (id, options) => {
1379
1478
  method: "GET"
1380
1479
  });
1381
1480
  };
1481
+ const getCreateIdpUrl = (params) => {
1482
+ const normalizedParams = new URLSearchParams();
1483
+ Object.entries(params || {}).forEach(([key, value]) => {
1484
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1485
+ });
1486
+ const stringifiedParams = normalizedParams.toString();
1487
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/idps?${stringifiedParams}` : `${getProxyPath()}/idps`;
1488
+ };
1489
+ /**
1490
+ * Creates or revises a connection document. If the slug does not already
1491
+ exist, a new connection is created. If a connection with that slug already
1492
+ exists, a revision is created.
1493
+
1494
+ A revision gets a new `revision_id` and does not modify the connection
1495
+ `id`, so identity links that reference the connection keep resolving while
1496
+ releases and auth attempts stay pinned to the revision they captured.
1497
+
1498
+ Identity fields are fixed for the life of the connection and a revision
1499
+ that changes one is rejected: `protocol`, `subject_claim`, and the
1500
+ endpoints that name the authority (`issuer` for OIDC, `token_endpoint`
1501
+ and `userinfo_endpoint` for OAuth 2.0). Their values decide which provider
1502
+ account a stored subject belongs to, so changing one would silently
1503
+ repoint existing identities at a different provider.
1504
+
1505
+ `subject_claim` is optional for OIDC and required for OAuth 2.0. For an
1506
+ OIDC connection, `sub` is used as the default value. If a revision updates
1507
+ `subject_claim` to a different value than the one set during creation, the
1508
+ request is rejected.
1509
+
1510
+ The document is validated against the `idp-connection.json` schema before
1511
+ anything is stored.
1512
+
1513
+ * @summary Create or revise an identity provider connection
1514
+ */
1515
+ const createIdp = async (createIdpBody, params, options) => {
1516
+ return customFetch(getCreateIdpUrl(params), {
1517
+ ...options,
1518
+ method: "POST",
1519
+ headers: {
1520
+ "Content-Type": "application/json",
1521
+ ...options?.headers
1522
+ },
1523
+ body: JSON.stringify(createIdpBody)
1524
+ });
1525
+ };
1526
+ const getQueryIdpsUrl = (params) => {
1527
+ const normalizedParams = new URLSearchParams();
1528
+ Object.entries(params || {}).forEach(([key, value]) => {
1529
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1530
+ });
1531
+ const stringifiedParams = normalizedParams.toString();
1532
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/idps/query?${stringifiedParams}` : `${getProxyPath()}/idps/query`;
1533
+ };
1534
+ /**
1535
+ * Returns the identity provider connections of a project, paginated with a
1536
+ cursor. One row per connection, carrying its newest revision.
1537
+
1538
+ * @summary Query identity provider connections
1539
+ */
1540
+ const queryIdps = async (queryIdpsBody, params, options) => {
1541
+ return customFetch(getQueryIdpsUrl(params), {
1542
+ ...options,
1543
+ method: "POST",
1544
+ headers: {
1545
+ "Content-Type": "application/json",
1546
+ ...options?.headers
1547
+ },
1548
+ body: JSON.stringify(queryIdpsBody)
1549
+ });
1550
+ };
1551
+ const getGetIdpByIdUrl = (id, params) => {
1552
+ const normalizedParams = new URLSearchParams();
1553
+ Object.entries(params || {}).forEach(([key, value]) => {
1554
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1555
+ });
1556
+ const stringifiedParams = normalizedParams.toString();
1557
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/idps/${id}?${stringifiedParams}` : `${getProxyPath()}/idps/${id}`;
1558
+ };
1559
+ /**
1560
+ * Reads a connection by its id, at its newest revision.
1561
+ `GET /idps/{id}/revisions` lists every revision of the connection.
1562
+
1563
+ The lookup is scoped to the project in `project_id`.
1564
+
1565
+ * @summary Get an identity provider connection by id
1566
+ */
1567
+ const getIdpById = async (id, params, options) => {
1568
+ return customFetch(getGetIdpByIdUrl(id, params), {
1569
+ ...options,
1570
+ method: "GET"
1571
+ });
1572
+ };
1573
+ const getListIdpRevisionsUrl = (id, params) => {
1574
+ const normalizedParams = new URLSearchParams();
1575
+ Object.entries(params || {}).forEach(([key, value]) => {
1576
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1577
+ });
1578
+ const stringifiedParams = normalizedParams.toString();
1579
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/idps/${id}/revisions?${stringifiedParams}` : `${getProxyPath()}/idps/${id}/revisions`;
1580
+ };
1581
+ /**
1582
+ * Returns every revision of one connection, newest first, paginated with a
1583
+ cursor. The order is fixed, so there is no `sorting`.
1584
+
1585
+ The lookup is scoped to the project in `project_id`.
1586
+
1587
+ * @summary List the revisions of an identity provider connection
1588
+ */
1589
+ const listIdpRevisions = async (id, params, options) => {
1590
+ return customFetch(getListIdpRevisionsUrl(id, params), {
1591
+ ...options,
1592
+ method: "GET"
1593
+ });
1594
+ };
1595
+ const getGetIdpRevisionByIdUrl = (revisionId, params) => {
1596
+ const normalizedParams = new URLSearchParams();
1597
+ Object.entries(params || {}).forEach(([key, value]) => {
1598
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1599
+ });
1600
+ const stringifiedParams = normalizedParams.toString();
1601
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/idps/revisions/${revisionId}?${stringifiedParams}` : `${getProxyPath()}/idps/revisions/${revisionId}`;
1602
+ };
1603
+ /**
1604
+ * Reads one revision of a connection by its `revision_id`, the value an auth
1605
+ attempt or a release pins.
1606
+
1607
+ The lookup is scoped to the project in `project_id`.
1608
+
1609
+ * @summary Get one revision of an identity provider connection
1610
+ */
1611
+ const getIdpRevisionById = async (revisionId, params, options) => {
1612
+ return customFetch(getGetIdpRevisionByIdUrl(revisionId, params), {
1613
+ ...options,
1614
+ method: "GET"
1615
+ });
1616
+ };
1382
1617
  const getCreateReleaseUrl = (params) => {
1383
1618
  const normalizedParams = new URLSearchParams();
1384
1619
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1478,10 +1713,23 @@ const getCreateGrantUrl = (params) => {
1478
1713
  /**
1479
1714
  * Bind a user or team to `project.viewer`, `project.editor`, or
1480
1715
  `project.admin` on the project identified by the `project-id` header.
1481
- IDs are `asgn_<opaque>`. Owning-team (`project.team`) grants are not
1482
- created here — claim owns that path. An unrevoked grant with the same
1483
- principal and relation occupies the unique key even after `expires_at`;
1484
- DELETE it before re-creating.
1716
+ Name the principal with `user` (`user_id` or `identifier`) or `team`
1717
+ (`team_id` or `name`). IDs are `asgn_<opaque>`. Owning-team
1718
+ (`project.team`) grants are not created here — claim owns that path. An
1719
+ unrevoked grant with the same principal and relation occupies the unique
1720
+ key even after `expires_at`; DELETE it before re-creating.
1721
+ Create does not accept `expand`. The `user_id` and team locators
1722
+ return 201, whose `user` / `team` carry only `user_id` / `team_id`,
1723
+ and still 404 / 409 when the principal is missing or the tuple
1724
+ already exists. Creating by `user.identifier` answers 202 with no
1725
+ body on every outcome. Granting the session caller's own user is
1726
+ `grant.invalid` on either user locator. Read the grant back for
1727
+ identifier and display.
1728
+
1729
+ Accepts either a project secret (`oauth2`) or a user-bound Console
1730
+ session cookie (`nextgenSession`). Session callers are authorized as
1731
+ the human against the target project (home may differ). CSRF/Origin
1732
+ for cookie mutations is a follow-up (#1140).
1485
1733
 
1486
1734
  * @summary Create grant
1487
1735
  */
@@ -1496,6 +1744,45 @@ const createGrant = async (createGrantBody, params, options) => {
1496
1744
  body: JSON.stringify(createGrantBody)
1497
1745
  });
1498
1746
  };
1747
+ const getQueryGrantsUrl = (params) => {
1748
+ const normalizedParams = new URLSearchParams();
1749
+ Object.entries(params || {}).forEach(([key, value]) => {
1750
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1751
+ });
1752
+ const stringifiedParams = normalizedParams.toString();
1753
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/grants/query?${stringifiedParams}` : `${getProxyPath()}/grants/query`;
1754
+ };
1755
+ /**
1756
+ * Returns the collaboration grants of a project, paginated with a cursor.
1757
+ Only unrevoked grants this API manages are listed (user or team bound to
1758
+ viewer, editor, or admin), including expired grants so a client can
1759
+ DELETE before re-granting. Project-secret setup (`sk_proj`) and
1760
+ owning-team (`relation=team`) rows are not returned. Grants are not in
1761
+ `resource_scope_index`; project scope is required on the query (same as
1762
+ get). Requires `project.read`. `expand: ["principal"]` adds envelope
1763
+ fields on `user` / `team` and additionally requires `user.read` and
1764
+ `team.read` for project secrets (documented on the expand enum; those
1765
+ scopes cannot be ANDed onto this security block because they are
1766
+ body-conditional). A user-bound Console session that already passed
1767
+ the project Check may expand without those scopes.
1768
+
1769
+ Accepts either a project secret (`oauth2`) or a user-bound Console
1770
+ session cookie (`nextgenSession`). CSRF/Origin for cookie mutations
1771
+ is a follow-up (#1140).
1772
+
1773
+ * @summary Query grants
1774
+ */
1775
+ const queryGrants = async (queryGrantsBody, params, options) => {
1776
+ return customFetch(getQueryGrantsUrl(params), {
1777
+ ...options,
1778
+ method: "POST",
1779
+ headers: {
1780
+ "Content-Type": "application/json",
1781
+ ...options?.headers
1782
+ },
1783
+ body: JSON.stringify(queryGrantsBody)
1784
+ });
1785
+ };
1499
1786
  const getGetGrantUrl = (id, params) => {
1500
1787
  const normalizedParams = new URLSearchParams();
1501
1788
  Object.entries(params || {}).forEach(([key, value]) => {
@@ -1513,6 +1800,14 @@ still ignores expired grants. Grants are not registered in
1513
1800
  `resource_scope_index`; project scope is required on the query (same as
1514
1801
  events). Misses, revoked rows, project-secret setup (`sk_proj`),
1515
1802
  owning-team (`relation=team`) rows, and cross-project ids return 404.
1803
+ `expand=principal` adds envelope fields on `user` or `team` and requires
1804
+ `user.read` and `team.read` in addition to `project.read` for project
1805
+ secrets. A user-bound Console session that already passed the project
1806
+ Check may expand without those scopes.
1807
+
1808
+ Accepts either a project secret (`oauth2`) or a user-bound Console
1809
+ session cookie (`nextgenSession`). CSRF/Origin for cookie mutations
1810
+ is a follow-up (#1140).
1516
1811
 
1517
1812
  * @summary Get grant
1518
1813
  */
@@ -1536,6 +1831,10 @@ Already-revoked, missing, project-secret setup, and owning-team grants
1536
1831
  return 404. The row is not un-revoked. Expired grants can still be
1537
1832
  revoked so the unique binding can be reused.
1538
1833
 
1834
+ Accepts either a project secret (`oauth2`) or a user-bound Console
1835
+ session cookie (`nextgenSession`). CSRF/Origin for cookie mutations
1836
+ is a follow-up (#1140).
1837
+
1539
1838
  * @summary Revoke grant
1540
1839
  */
1541
1840
  const deleteGrant = async (id, params, options) => {
@@ -1602,6 +1901,122 @@ const getEvent = async (id, params, options) => {
1602
1901
  method: "GET"
1603
1902
  });
1604
1903
  };
1904
+ const getGetVariablesUrl = (params) => {
1905
+ const normalizedParams = new URLSearchParams();
1906
+ Object.entries(params || {}).forEach(([key, value]) => {
1907
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1908
+ });
1909
+ const stringifiedParams = normalizedParams.toString();
1910
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/variables?${stringifiedParams}` : `${getProxyPath()}/variables`;
1911
+ };
1912
+ /**
1913
+ * Returns the variables entered at the owner this request addresses, keyed by
1914
+ name — one environment of the project with `environment_name`, the project
1915
+ level itself without it.
1916
+
1917
+ Owners are separate, not a ladder: an environment does not inherit the
1918
+ project's variables and the project does not see its environments'. Reading
1919
+ everything a project holds therefore means reading each owner in turn.
1920
+
1921
+ Secret values are not returned. A secret appears as `{"secret": true}`,
1922
+ which says a value is held without disclosing it.
1923
+
1924
+ * @summary Get variables
1925
+ */
1926
+ const getVariables = async (params, options) => {
1927
+ return customFetch(getGetVariablesUrl(params), {
1928
+ ...options,
1929
+ method: "GET"
1930
+ });
1931
+ };
1932
+ const getUpdateVariablesUrl = (params) => {
1933
+ const normalizedParams = new URLSearchParams();
1934
+ Object.entries(params || {}).forEach(([key, value]) => {
1935
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1936
+ });
1937
+ const stringifiedParams = normalizedParams.toString();
1938
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/variables?${stringifiedParams}` : `${getProxyPath()}/variables`;
1939
+ };
1940
+ /**
1941
+ * Enters, replaces and removes variables at the owner this request
1942
+ addresses.
1943
+
1944
+ Every name in the body is applied at exactly that owner — the project, or
1945
+ the environment named by `environment_name` — and reaches no other. Names
1946
+ not in the body are untouched.
1947
+
1948
+ A bare scalar enters a non-secret value. `{"value": …, "secret": true}`
1949
+ stores the value encrypted under the project's active `secret` key, after
1950
+ which it can be referenced but not read back. `null` removes the name from
1951
+ this owner (RFC 7386), which is how several variables are removed in one
1952
+ request; removing a name this owner does not hold is a no-op rather than an
1953
+ error.
1954
+
1955
+ The body is applied whole or not at all, so a rejected request leaves the
1956
+ owner exactly as it was. Writing the same name and owner twice replaces the
1957
+ value rather than duplicating it, which makes a retry safe.
1958
+
1959
+ * @summary Update variables
1960
+ */
1961
+ const updateVariables = async (updateVariablesBody, params, options) => {
1962
+ return customFetch(getUpdateVariablesUrl(params), {
1963
+ ...options,
1964
+ method: "PATCH",
1965
+ headers: {
1966
+ "Content-Type": "application/json",
1967
+ ...options?.headers
1968
+ },
1969
+ body: JSON.stringify(updateVariablesBody)
1970
+ });
1971
+ };
1972
+ const getGetVariableUrl = (variableName, params) => {
1973
+ const normalizedParams = new URLSearchParams();
1974
+ Object.entries(params || {}).forEach(([key, value]) => {
1975
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
1976
+ });
1977
+ const stringifiedParams = normalizedParams.toString();
1978
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/variables/${variableName}?${stringifiedParams}` : `${getProxyPath()}/variables/${variableName}`;
1979
+ };
1980
+ /**
1981
+ * Reads one variable by name from the owner this request addresses — one
1982
+ environment of the project with `environment_name`, the project level
1983
+ itself without it.
1984
+
1985
+ A name that owner has not entered answers `var.not_found`, even when
1986
+ another owner of the same project holds it: nothing is inherited. A secret
1987
+ is found but not disclosed: the response is `{"secret": true}`.
1988
+
1989
+ * @summary Get a variable
1990
+ */
1991
+ const getVariable = async (variableName, params, options) => {
1992
+ return customFetch(getGetVariableUrl(variableName, params), {
1993
+ ...options,
1994
+ method: "GET"
1995
+ });
1996
+ };
1997
+ const getDeleteVariableUrl = (variableName, params) => {
1998
+ const normalizedParams = new URLSearchParams();
1999
+ Object.entries(params || {}).forEach(([key, value]) => {
2000
+ if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
2001
+ });
2002
+ const stringifiedParams = normalizedParams.toString();
2003
+ return stringifiedParams.length > 0 ? `${getProxyPath()}/variables/${variableName}?${stringifiedParams}` : `${getProxyPath()}/variables/${variableName}`;
2004
+ };
2005
+ /**
2006
+ * Removes the variable this owner entered under this name.
2007
+
2008
+ A variable is deletable only by the owner that entered it. Deleting a name
2009
+ another owner of the same project holds answers `var.not_found` and leaves
2010
+ that owner's value standing.
2011
+
2012
+ * @summary Delete a variable
2013
+ */
2014
+ const deleteVariable = async (variableName, params, options) => {
2015
+ return customFetch(getDeleteVariableUrl(variableName, params), {
2016
+ ...options,
2017
+ method: "DELETE"
2018
+ });
2019
+ };
1605
2020
  //#endregion
1606
2021
  //#region ../api/dist/runtime/api-factory.mjs
1607
2022
  /**
@@ -1645,7 +2060,7 @@ function createZitadelClient(opts) {
1645
2060
  } });
1646
2061
  }
1647
2062
  //#endregion
1648
- //#region ../config/dist/defaults-DPq0o3iU.mjs
2063
+ //#region ../config/dist/defaults-DV6hY2KT.mjs
1649
2064
  var default_human_user_default = {
1650
2065
  title: "DefaultHumanUserSchema",
1651
2066
  $schema: "https://json-schema.org/draft/2020-12/schema",
@@ -1681,29 +2096,19 @@ var default_login_default = {
1681
2096
  {
1682
2097
  "name": "identifier",
1683
2098
  "fields": ["email"],
1684
- "actions": [
1685
- {
1686
- "name": "submit",
1687
- "kind": "submit",
1688
- "primary": true,
1689
- "text_key": "identifier.action.continue"
1690
- },
1691
- {
1692
- "name": "passkey",
1693
- "kind": "passkey",
1694
- "primary": false,
1695
- "text_key": "identifier.action.passkey"
1696
- },
1697
- {
1698
- "name": "register",
1699
- "kind": "navigate",
1700
- "primary": false,
1701
- "text_key": "identifier.action.register.link"
1702
- }
1703
- ],
2099
+ "actions": [{
2100
+ "name": "submit",
2101
+ "kind": "submit",
2102
+ "primary": true,
2103
+ "text_key": "identifier.action.continue"
2104
+ }, {
2105
+ "name": "register",
2106
+ "kind": "navigate",
2107
+ "primary": false,
2108
+ "text_key": "identifier.action.register.link"
2109
+ }],
1704
2110
  "transitions": {
1705
2111
  "submit": { "target": "password" },
1706
- "passkey": { "target": "done" },
1707
2112
  "user_not_found": { "target": "register" },
1708
2113
  "register": {
1709
2114
  "target": "register",
@@ -1719,43 +2124,25 @@ var default_login_default = {
1719
2124
  "kind": "submit",
1720
2125
  "primary": true,
1721
2126
  "text_key": "password.action.signin"
1722
- }, {
1723
- "name": "passkey",
1724
- "kind": "passkey",
1725
- "primary": false,
1726
- "text_key": "password.action.passkey"
1727
2127
  }],
1728
- "transitions": {
1729
- "submit": { "target": "done" },
1730
- "passkey": { "target": "done" }
1731
- }
2128
+ "transitions": { "submit": { "target": "done" } }
1732
2129
  },
1733
2130
  {
1734
2131
  "name": "register",
1735
2132
  "fields": ["email"],
1736
- "actions": [
1737
- {
1738
- "name": "submit",
1739
- "kind": "submit",
1740
- "primary": true,
1741
- "text_key": "register.action.password"
1742
- },
1743
- {
1744
- "name": "passkey_register",
1745
- "kind": "passkey_register",
1746
- "primary": false,
1747
- "text_key": "register.action.passkey"
1748
- },
1749
- {
1750
- "name": "sign_in",
1751
- "kind": "navigate",
1752
- "primary": false,
1753
- "text_key": "register.action.sign_in.link"
1754
- }
1755
- ],
2133
+ "actions": [{
2134
+ "name": "submit",
2135
+ "kind": "submit",
2136
+ "primary": true,
2137
+ "text_key": "register.action.password"
2138
+ }, {
2139
+ "name": "sign_in",
2140
+ "kind": "navigate",
2141
+ "primary": false,
2142
+ "text_key": "register.action.sign_in.link"
2143
+ }],
1756
2144
  "transitions": {
1757
2145
  "submit": { "target": "register-password" },
1758
- "passkey_register": { "target": "done" },
1759
2146
  "user_already_exists": { "target": "password" },
1760
2147
  "sign_in": {
1761
2148
  "target": "identifier",
@@ -2655,4 +3042,4 @@ Object.defineProperty(exports, "startLocalZitadel", {
2655
3042
  }
2656
3043
  });
2657
3044
 
2658
- //# sourceMappingURL=src-DtCJTEId.cjs.map
3045
+ //# sourceMappingURL=src-CFX_ayWr.cjs.map