@zitadel/api 0.2.0 → 0.4.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +17 -3
- package/dist/api-factory-C5b1Gqwv.mjs +357 -0
- package/dist/api-factory-C5b1Gqwv.mjs.map +1 -0
- package/dist/api-factory-Dt5lUjyu.d.mts +212 -0
- package/dist/api-factory-Dt5lUjyu.d.mts.map +1 -0
- package/dist/{fetch-CtYe0OvX.d.mts → fetch-B-lgjlrf.d.mts} +22 -12
- package/dist/fetch-B-lgjlrf.d.mts.map +1 -0
- package/dist/generated/endpoints/zitadelNextGen.d.mts +2 -2
- package/dist/generated/endpoints/zitadelNextGen.mjs +192 -124
- package/dist/generated/endpoints/zitadelNextGen.mjs.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.msw.d.mts +3 -1
- package/dist/generated/endpoints/zitadelNextGen.msw.d.mts.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.msw.mjs +40 -7
- package/dist/generated/endpoints/zitadelNextGen.msw.mjs.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.zod.d.mts +104 -28
- package/dist/generated/endpoints/zitadelNextGen.zod.d.mts.map +1 -1
- package/dist/generated/endpoints/zitadelNextGen.zod.mjs +117 -37
- package/dist/generated/endpoints/zitadelNextGen.zod.mjs.map +1 -1
- package/dist/generated/model/index.d.mts +2 -2
- package/dist/generated/model/index.mjs +5 -1
- package/dist/generated/model/index.mjs.map +1 -1
- package/dist/generated/operations.mjs +22 -1
- package/dist/generated/operations.mjs.map +1 -1
- package/dist/{index-D7-l5LV6.d.mts → index-DGQY1rfH.d.mts} +398 -10
- package/dist/index-DGQY1rfH.d.mts.map +1 -0
- package/dist/runtime/api-factory.d.mts +2 -51
- package/dist/runtime/api-factory.mjs +3 -62
- package/dist/runtime/auth.mjs +1 -1
- package/dist/runtime/auth.mjs.map +1 -1
- package/dist/runtime/base-url.d.mts +14 -0
- package/dist/runtime/base-url.d.mts.map +1 -1
- package/dist/runtime/base-url.mjs +22 -1
- package/dist/runtime/base-url.mjs.map +1 -1
- package/dist/runtime/config.d.mts +1 -1
- package/dist/runtime/config.mjs +1 -1
- package/dist/runtime/fetch.d.mts +2 -2
- package/dist/runtime/fetch.mjs +41 -17
- package/dist/runtime/fetch.mjs.map +1 -1
- package/dist/runtime/paging.d.mts +35 -0
- package/dist/runtime/paging.d.mts.map +1 -0
- package/dist/runtime/paging.mjs +38 -0
- package/dist/runtime/paging.mjs.map +1 -0
- package/dist/{zitadelNextGen-Cw3DrCn1.d.mts → zitadelNextGen-BVO4sdKD.d.mts} +69 -34
- package/dist/zitadelNextGen-BVO4sdKD.d.mts.map +1 -0
- package/package.json +7 -1
- package/src/generated/endpoints/zitadelNextGen.faker.ts +9 -6
- package/src/generated/endpoints/zitadelNextGen.msw.ts +16 -1
- package/src/generated/endpoints/zitadelNextGen.ts +212 -125
- package/src/generated/endpoints/zitadelNextGen.zod.ts +120 -36
- package/src/generated/model/createFlowDefinition201UserSchemaMetadata.ts +5 -0
- package/src/generated/model/deleteUserByID409.ts +20 -0
- package/src/generated/model/deleteUserByID409Details.ts +12 -0
- package/src/generated/model/deleteUserByIDDefault.ts +9 -0
- package/src/generated/model/evaluatePolicy200.ts +30 -0
- package/src/generated/model/evaluatePolicy200Violations.ts +14 -0
- package/src/generated/model/evaluatePolicyBody.ts +82 -0
- package/src/generated/model/evaluatePolicyDefault.ts +90 -0
- package/src/generated/model/evaluatePolicyParams.ts +15 -0
- package/src/generated/model/getFlowDefinition200UserSchemaMetadata.ts +5 -0
- package/src/generated/model/getFlowStepDefault.ts +9 -0
- package/src/generated/model/getMyUserSchema200Metadata.ts +5 -0
- package/src/generated/model/getSchemaById200Metadata.ts +5 -0
- package/src/generated/model/index.ts +8 -0
- package/src/generated/model/listFlowDefinitions200FlowDefinitionsItemUserSchemaMetadata.ts +5 -0
- package/src/generated/model/listSchemas200SchemasItemMetadata.ts +5 -0
- package/src/generated/model/listSchemasExpandItem.ts +28 -0
- package/src/generated/model/listSchemasParams.ts +5 -0
- package/src/generated/model/queryTeamsParams.ts +3 -2
- package/src/generated/model/queryUsersBodyFilterItem.ts +11 -3
- package/src/generated/model/queryUsersBodyFilterItemField.ts +12 -3
- package/src/generated/model/submitFlowStepDefault.ts +9 -0
- package/src/generated/operations.ts +24 -1
- package/src/generated/paging.ts +128 -0
- package/src/runtime/api-factory.spec.ts +278 -0
- package/src/runtime/api-factory.ts +93 -12
- package/src/runtime/auth.ts +1 -1
- package/src/runtime/base-url.spec.ts +40 -4
- package/src/runtime/base-url.ts +28 -0
- package/src/runtime/fetch.spec.ts +51 -0
- package/src/runtime/fetch.ts +69 -30
- package/src/runtime/paged.spec.ts +104 -0
- package/src/runtime/paged.ts +61 -0
- package/src/runtime/paging.spec.ts +94 -0
- package/src/runtime/paging.ts +58 -0
- package/dist/fetch-CtYe0OvX.d.mts.map +0 -1
- package/dist/index-D7-l5LV6.d.mts.map +0 -1
- package/dist/runtime/api-factory.d.mts.map +0 -1
- package/dist/runtime/api-factory.mjs.map +0 -1
- package/dist/zitadelNextGen-Cw3DrCn1.d.mts.map +0 -1
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { t as __exportAll } from "../../rolldown-runtime-D7D4PA-g.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import { getApiBaseUrl } from "../../runtime/base-url.mjs";
|
|
3
3
|
import { customFetch } from "../../runtime/fetch.mjs";
|
|
4
4
|
//#region src/generated/endpoints/zitadelNextGen.ts
|
|
5
5
|
/**
|
|
@@ -32,6 +32,7 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
32
32
|
deleteTeam: () => deleteTeam,
|
|
33
33
|
deleteUserByID: () => deleteUserByID,
|
|
34
34
|
deleteVariable: () => deleteVariable,
|
|
35
|
+
evaluatePolicy: () => evaluatePolicy,
|
|
35
36
|
exchangeHandoff: () => exchangeHandoff,
|
|
36
37
|
finishUserPasskeyRegistration: () => finishUserPasskeyRegistration,
|
|
37
38
|
getAddOriginUrl: () => getAddOriginUrl,
|
|
@@ -62,6 +63,7 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
62
63
|
getDeleteVariableUrl: () => getDeleteVariableUrl,
|
|
63
64
|
getDeploymentById: () => getDeploymentById,
|
|
64
65
|
getDeploymentVariables: () => getDeploymentVariables,
|
|
66
|
+
getEvaluatePolicyUrl: () => getEvaluatePolicyUrl,
|
|
65
67
|
getEvent: () => getEvent,
|
|
66
68
|
getExchangeHandoffUrl: () => getExchangeHandoffUrl,
|
|
67
69
|
getFinishUserPasskeyRegistrationUrl: () => getFinishUserPasskeyRegistrationUrl,
|
|
@@ -202,14 +204,15 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
202
204
|
verifyChallengeProof: () => verifyChallengeProof
|
|
203
205
|
});
|
|
204
206
|
const getGetLiveUrl = () => {
|
|
205
|
-
return `${
|
|
207
|
+
return `${getApiBaseUrl()}/livez`;
|
|
206
208
|
};
|
|
207
209
|
/**
|
|
208
210
|
* Answers `ok` while the server process serves HTTP, and checks nothing behind it.
|
|
209
211
|
*
|
|
210
|
-
* Point a liveness probe
|
|
211
|
-
*
|
|
212
|
-
* instance
|
|
212
|
+
* Point a liveness probe at `/livez` at the root, where the probes stay,
|
|
213
|
+
* not under `/api/v1`. It never checks the database, so an outage of the
|
|
214
|
+
* database does not restart every instance; `GET /readyz` takes an instance
|
|
215
|
+
* out of rotation instead.
|
|
213
216
|
* @summary Check server liveness
|
|
214
217
|
*/
|
|
215
218
|
const getLive = async (options) => {
|
|
@@ -219,14 +222,14 @@ const getLive = async (options) => {
|
|
|
219
222
|
});
|
|
220
223
|
};
|
|
221
224
|
const getGetReadyUrl = () => {
|
|
222
|
-
return `${
|
|
225
|
+
return `${getApiBaseUrl()}/readyz`;
|
|
223
226
|
};
|
|
224
227
|
/**
|
|
225
228
|
* Answers whether the server can serve requests, which takes its database answering within a second.
|
|
226
229
|
*
|
|
227
|
-
* Point a readiness probe
|
|
228
|
-
*
|
|
229
|
-
* database.
|
|
230
|
+
* Point a readiness probe at `/readyz` at the root, where the probes stay,
|
|
231
|
+
* not under `/api/v1`, so that a server whose database does not answer gets
|
|
232
|
+
* no requests until it does. The check is one round trip to the database.
|
|
230
233
|
* @summary Check server readiness
|
|
231
234
|
*/
|
|
232
235
|
const getReady = async (options) => {
|
|
@@ -241,7 +244,7 @@ const getCreateUserUrl = (params) => {
|
|
|
241
244
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
242
245
|
});
|
|
243
246
|
const stringifiedParams = normalizedParams.toString();
|
|
244
|
-
return stringifiedParams.length > 0 ? `${
|
|
247
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users?${stringifiedParams}` : `${getApiBaseUrl()}/users`;
|
|
245
248
|
};
|
|
246
249
|
/**
|
|
247
250
|
* Creates a user whose attributes satisfy the user schema the request names.
|
|
@@ -276,7 +279,7 @@ const getQueryUsersUrl = (params) => {
|
|
|
276
279
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
277
280
|
});
|
|
278
281
|
const stringifiedParams = normalizedParams.toString();
|
|
279
|
-
return stringifiedParams.length > 0 ? `${
|
|
282
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/query?${stringifiedParams}` : `${getApiBaseUrl()}/users/query`;
|
|
280
283
|
};
|
|
281
284
|
/**
|
|
282
285
|
* Returns the users of a project, paginated with a cursor.
|
|
@@ -285,8 +288,8 @@ const getQueryUsersUrl = (params) => {
|
|
|
285
288
|
* project is listed.
|
|
286
289
|
*
|
|
287
290
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
288
|
-
* session cookie (`
|
|
289
|
-
* follow the scheme's CSRF rules (`
|
|
291
|
+
* session cookie (`sessionCookie`). Cookie-authenticated requests
|
|
292
|
+
* follow the scheme's CSRF rules (`sessionCookie`).
|
|
290
293
|
* @summary Query users
|
|
291
294
|
*/
|
|
292
295
|
const queryUsers = async (queryUsersBody, params, options) => {
|
|
@@ -314,7 +317,7 @@ const getGetUserByIDUrl = (userId, params) => {
|
|
|
314
317
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
315
318
|
});
|
|
316
319
|
const stringifiedParams = normalizedParams.toString();
|
|
317
|
-
return stringifiedParams.length > 0 ? `${
|
|
320
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}?${stringifiedParams}` : `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}`;
|
|
318
321
|
};
|
|
319
322
|
/**
|
|
320
323
|
* Returns a user by its id, with the attributes its schema defines.
|
|
@@ -330,7 +333,7 @@ const getUserByID = async (userId, params, options) => {
|
|
|
330
333
|
});
|
|
331
334
|
};
|
|
332
335
|
const getPatchUserByIDUrl = (userId) => {
|
|
333
|
-
return `${
|
|
336
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}`;
|
|
334
337
|
};
|
|
335
338
|
/**
|
|
336
339
|
* Partially updates a user's schema-defined attributes, and optionally
|
|
@@ -359,14 +362,18 @@ const patchUserByID = async (userId, patchUserByIDBody, options) => {
|
|
|
359
362
|
});
|
|
360
363
|
};
|
|
361
364
|
const getDeleteUserByIDUrl = (userId) => {
|
|
362
|
-
return `${
|
|
365
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}`;
|
|
363
366
|
};
|
|
364
367
|
/**
|
|
365
|
-
* Deletes a user
|
|
368
|
+
* Deletes a user, removes them from every team they belong to, and revokes
|
|
369
|
+
* every grant they hold, on any project.
|
|
366
370
|
*
|
|
367
|
-
* The user is removed, not deactivated, and the deletion emits `user.deleted
|
|
371
|
+
* The user is removed, not deactivated, and the deletion emits `user.deleted`,
|
|
372
|
+
* plus `authz.revoked` for each grant on that grant's project.
|
|
368
373
|
* With a project secret the request is idempotent: deleting a user that exists
|
|
369
|
-
* in no project succeeds without changing anything.
|
|
374
|
+
* in no project succeeds without changing anything. Deleting the last active
|
|
375
|
+
* member of a project's owning team returns 409 `proj.last_owner` and changes
|
|
376
|
+
* nothing.
|
|
370
377
|
* @summary Delete user by ID
|
|
371
378
|
*/
|
|
372
379
|
const deleteUserByID = async (userId, options) => {
|
|
@@ -381,7 +388,7 @@ const getListUserIdentityLinksUrl = (userId, params) => {
|
|
|
381
388
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
382
389
|
});
|
|
383
390
|
const stringifiedParams = normalizedParams.toString();
|
|
384
|
-
return stringifiedParams.length > 0 ? `${
|
|
391
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/identity_links?${stringifiedParams}` : `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/identity_links`;
|
|
385
392
|
};
|
|
386
393
|
/**
|
|
387
394
|
* The identity provider accounts a sign-in linked to the user, oldest first.
|
|
@@ -400,7 +407,7 @@ const getListUserPasskeysUrl = (userId, params) => {
|
|
|
400
407
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
401
408
|
});
|
|
402
409
|
const stringifiedParams = normalizedParams.toString();
|
|
403
|
-
return stringifiedParams.length > 0 ? `${
|
|
410
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/passkeys?${stringifiedParams}` : `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/passkeys`;
|
|
404
411
|
};
|
|
405
412
|
/**
|
|
406
413
|
* Returns the passkeys registered for a user, newest first, paginated with a
|
|
@@ -417,7 +424,7 @@ const listUserPasskeys = async (userId, params, options) => {
|
|
|
417
424
|
});
|
|
418
425
|
};
|
|
419
426
|
const getBeginUserPasskeyRegistrationUrl = (userId) => {
|
|
420
|
-
return `${
|
|
427
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/passkeys/registrations`;
|
|
421
428
|
};
|
|
422
429
|
/**
|
|
423
430
|
* Starts a WebAuthn registration ceremony for the user and returns the
|
|
@@ -447,7 +454,7 @@ const beginUserPasskeyRegistration = async (userId, beginUserPasskeyRegistration
|
|
|
447
454
|
});
|
|
448
455
|
};
|
|
449
456
|
const getFinishUserPasskeyRegistrationUrl = (userId, registrationId) => {
|
|
450
|
-
return `${
|
|
457
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/passkeys/registrations/${encodeURIComponent(String(registrationId))}`;
|
|
451
458
|
};
|
|
452
459
|
/**
|
|
453
460
|
* Verifies the attestation against the ceremony started by
|
|
@@ -478,7 +485,7 @@ const finishUserPasskeyRegistration = async (userId, registrationId, finishUserP
|
|
|
478
485
|
});
|
|
479
486
|
};
|
|
480
487
|
const getGetUserPasswordStateUrl = (userId) => {
|
|
481
|
-
return `${
|
|
488
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/password`;
|
|
482
489
|
};
|
|
483
490
|
/**
|
|
484
491
|
* Reports when the user's current password was set, and leaves `set_at` out
|
|
@@ -493,7 +500,7 @@ const getUserPasswordState = async (userId, options) => {
|
|
|
493
500
|
});
|
|
494
501
|
};
|
|
495
502
|
const getSetUserPasswordUrl = (userId) => {
|
|
496
|
-
return `${
|
|
503
|
+
return `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/password`;
|
|
497
504
|
};
|
|
498
505
|
/**
|
|
499
506
|
* Sets a user's password, hashed with the project's current password hashing
|
|
@@ -528,7 +535,7 @@ const getListUserTeamsUrl = (userId, params) => {
|
|
|
528
535
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
529
536
|
});
|
|
530
537
|
const stringifiedParams = normalizedParams.toString();
|
|
531
|
-
return stringifiedParams.length > 0 ? `${
|
|
538
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/teams?${stringifiedParams}` : `${getApiBaseUrl()}/users/${encodeURIComponent(String(userId))}/teams`;
|
|
532
539
|
};
|
|
533
540
|
/**
|
|
534
541
|
* The user's team roster, ordered by team name. Each entry carries the
|
|
@@ -552,7 +559,7 @@ const getGetMyUserUrl = (params) => {
|
|
|
552
559
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
553
560
|
});
|
|
554
561
|
const stringifiedParams = normalizedParams.toString();
|
|
555
|
-
return stringifiedParams.length > 0 ? `${
|
|
562
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me?${stringifiedParams}` : `${getApiBaseUrl()}/users/me`;
|
|
556
563
|
};
|
|
557
564
|
/**
|
|
558
565
|
* Returns the user signed in to the session that authenticates the request.
|
|
@@ -576,7 +583,7 @@ const getPatchMyUserUrl = (params) => {
|
|
|
576
583
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
577
584
|
});
|
|
578
585
|
const stringifiedParams = normalizedParams.toString();
|
|
579
|
-
return stringifiedParams.length > 0 ? `${
|
|
586
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me?${stringifiedParams}` : `${getApiBaseUrl()}/users/me`;
|
|
580
587
|
};
|
|
581
588
|
/**
|
|
582
589
|
* Partially updates the caller's own schema-defined attributes. The merged
|
|
@@ -612,7 +619,7 @@ const getListMyIdentityLinksUrl = (params) => {
|
|
|
612
619
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
613
620
|
});
|
|
614
621
|
const stringifiedParams = normalizedParams.toString();
|
|
615
|
-
return stringifiedParams.length > 0 ? `${
|
|
622
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/identity_links?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/identity_links`;
|
|
616
623
|
};
|
|
617
624
|
/**
|
|
618
625
|
* The identity provider accounts a sign-in linked to the signed-in user,
|
|
@@ -634,7 +641,7 @@ const getListMyPasskeysUrl = (params) => {
|
|
|
634
641
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
635
642
|
});
|
|
636
643
|
const stringifiedParams = normalizedParams.toString();
|
|
637
|
-
return stringifiedParams.length > 0 ? `${
|
|
644
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/passkeys?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/passkeys`;
|
|
638
645
|
};
|
|
639
646
|
/**
|
|
640
647
|
* The signed-in user's own passkeys, newest first, paginated with a cursor.
|
|
@@ -657,7 +664,7 @@ const getGetMyPasswordStateUrl = (params) => {
|
|
|
657
664
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
658
665
|
});
|
|
659
666
|
const stringifiedParams = normalizedParams.toString();
|
|
660
|
-
return stringifiedParams.length > 0 ? `${
|
|
667
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/password?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/password`;
|
|
661
668
|
};
|
|
662
669
|
/**
|
|
663
670
|
* Reports when the signed-in user's current password was set, and leaves
|
|
@@ -680,7 +687,7 @@ const getListMyProjectsUrl = (params) => {
|
|
|
680
687
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
681
688
|
});
|
|
682
689
|
const stringifiedParams = normalizedParams.toString();
|
|
683
|
-
return stringifiedParams.length > 0 ? `${
|
|
690
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/projects?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/projects`;
|
|
684
691
|
};
|
|
685
692
|
/**
|
|
686
693
|
* The projects the signed-in user can act on: those they hold an active grant
|
|
@@ -714,7 +721,7 @@ const getGetMyUserSchemaUrl = (params) => {
|
|
|
714
721
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
715
722
|
});
|
|
716
723
|
const stringifiedParams = normalizedParams.toString();
|
|
717
|
-
return stringifiedParams.length > 0 ? `${
|
|
724
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/schema?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/schema`;
|
|
718
725
|
};
|
|
719
726
|
/**
|
|
720
727
|
* The schema the signed-in user's own record is validated against.
|
|
@@ -735,7 +742,7 @@ const getListMyTeamsUrl = (params) => {
|
|
|
735
742
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
736
743
|
});
|
|
737
744
|
const stringifiedParams = normalizedParams.toString();
|
|
738
|
-
return stringifiedParams.length > 0 ? `${
|
|
745
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/users/me/teams?${stringifiedParams}` : `${getApiBaseUrl()}/users/me/teams`;
|
|
739
746
|
};
|
|
740
747
|
/**
|
|
741
748
|
* The signed-in user's own team roster, ordered by team name.
|
|
@@ -751,7 +758,7 @@ const listMyTeams = async (params, options) => {
|
|
|
751
758
|
});
|
|
752
759
|
};
|
|
753
760
|
const getCreateFlowUrl = () => {
|
|
754
|
-
return `${
|
|
761
|
+
return `${getApiBaseUrl()}/flow`;
|
|
755
762
|
};
|
|
756
763
|
/**
|
|
757
764
|
* Resolves a flow definition based on purpose + audience context and returns
|
|
@@ -803,7 +810,7 @@ const createFlow = async (createFlowBody, options) => {
|
|
|
803
810
|
});
|
|
804
811
|
};
|
|
805
812
|
const getGetFlowStepUrl = (id) => {
|
|
806
|
-
return `${
|
|
813
|
+
return `${getApiBaseUrl()}/flow/${encodeURIComponent(String(id))}`;
|
|
807
814
|
};
|
|
808
815
|
/**
|
|
809
816
|
* Returns the current capability step without advancing the state machine.
|
|
@@ -821,7 +828,7 @@ const getFlowStep = async (id, options) => {
|
|
|
821
828
|
});
|
|
822
829
|
};
|
|
823
830
|
const getSubmitFlowStepUrl = (id) => {
|
|
824
|
-
return `${
|
|
831
|
+
return `${getApiBaseUrl()}/flow/${encodeURIComponent(String(id))}/submit`;
|
|
825
832
|
};
|
|
826
833
|
/**
|
|
827
834
|
* Submits user input for the current step. The server validates,
|
|
@@ -898,7 +905,7 @@ const submitFlowStep = async (id, submitFlowStepBody, options) => {
|
|
|
898
905
|
});
|
|
899
906
|
};
|
|
900
907
|
const getCreateAuthAttemptUrl = () => {
|
|
901
|
-
return `${
|
|
908
|
+
return `${getApiBaseUrl()}/auth_attempts`;
|
|
902
909
|
};
|
|
903
910
|
/**
|
|
904
911
|
* Starts a new authentication attempt. This is the entry point for the auth_attempts state machine.
|
|
@@ -936,7 +943,7 @@ const createAuthAttempt = async (createAuthAttemptBody, options) => {
|
|
|
936
943
|
});
|
|
937
944
|
};
|
|
938
945
|
const getGetAuthAttemptUrl = (attemptId) => {
|
|
939
|
-
return `${
|
|
946
|
+
return `${getApiBaseUrl()}/auth_attempts/${encodeURIComponent(String(attemptId))}`;
|
|
940
947
|
};
|
|
941
948
|
/**
|
|
942
949
|
* Polls the current state of an authentication attempt.
|
|
@@ -955,7 +962,7 @@ const getAuthAttempt = async (attemptId, options) => {
|
|
|
955
962
|
});
|
|
956
963
|
};
|
|
957
964
|
const getIssueChallengeUrl = (attemptId) => {
|
|
958
|
-
return `${
|
|
965
|
+
return `${getApiBaseUrl()}/auth_attempts/${encodeURIComponent(String(attemptId))}/challenges`;
|
|
959
966
|
};
|
|
960
967
|
/**
|
|
961
968
|
* Issues a single-factor verification challenge within an auth attempt.
|
|
@@ -986,7 +993,7 @@ const issueChallenge = async (attemptId, issueChallengeBody, options) => {
|
|
|
986
993
|
});
|
|
987
994
|
};
|
|
988
995
|
const getVerifyChallengeProofUrl = (attemptId, challengeId) => {
|
|
989
|
-
return `${
|
|
996
|
+
return `${getApiBaseUrl()}/auth_attempts/${encodeURIComponent(String(attemptId))}/challenges/${encodeURIComponent(String(challengeId))}/verify`;
|
|
990
997
|
};
|
|
991
998
|
/**
|
|
992
999
|
* Submits a proof (credential, code, assertion) to verify a factor challenge.
|
|
@@ -1021,7 +1028,7 @@ const verifyChallengeProof = async (attemptId, challengeId, verifyChallengeProof
|
|
|
1021
1028
|
});
|
|
1022
1029
|
};
|
|
1023
1030
|
const getCreateHandoffUrl = (attemptId) => {
|
|
1024
|
-
return `${
|
|
1031
|
+
return `${getApiBaseUrl()}/auth_attempts/${encodeURIComponent(String(attemptId))}/handoff`;
|
|
1025
1032
|
};
|
|
1026
1033
|
/**
|
|
1027
1034
|
* Completes the authentication attempt and mints a `handoff_token`.
|
|
@@ -1045,7 +1052,7 @@ const createHandoff = async (attemptId, options) => {
|
|
|
1045
1052
|
});
|
|
1046
1053
|
};
|
|
1047
1054
|
const getCreateProjectUrl = () => {
|
|
1048
|
-
return `${
|
|
1055
|
+
return `${getApiBaseUrl()}/projects`;
|
|
1049
1056
|
};
|
|
1050
1057
|
/**
|
|
1051
1058
|
* Creates a project and returns its project secret and preview secret, which no
|
|
@@ -1076,7 +1083,7 @@ const createProject = async (createProjectBody, options) => {
|
|
|
1076
1083
|
});
|
|
1077
1084
|
};
|
|
1078
1085
|
const getQueryProjectsUrl = () => {
|
|
1079
|
-
return `${
|
|
1086
|
+
return `${getApiBaseUrl()}/projects/query`;
|
|
1080
1087
|
};
|
|
1081
1088
|
/**
|
|
1082
1089
|
* Returns the project the project secret belongs to, as a page of at most one
|
|
@@ -1107,7 +1114,7 @@ const queryProjects = async (queryProjectsBody, options) => {
|
|
|
1107
1114
|
});
|
|
1108
1115
|
};
|
|
1109
1116
|
const getGetProjectUrl = (projectId) => {
|
|
1110
|
-
return `${
|
|
1117
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}`;
|
|
1111
1118
|
};
|
|
1112
1119
|
/**
|
|
1113
1120
|
* Returns the current state of a project.
|
|
@@ -1120,7 +1127,7 @@ const getProject = async (projectId, options) => {
|
|
|
1120
1127
|
});
|
|
1121
1128
|
};
|
|
1122
1129
|
const getPatchProjectUrl = (projectId) => {
|
|
1123
|
-
return `${
|
|
1130
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}`;
|
|
1124
1131
|
};
|
|
1125
1132
|
/**
|
|
1126
1133
|
* Updates the state of a project.
|
|
@@ -1151,7 +1158,7 @@ const getListProjectAdminsUrl = (projectId, params) => {
|
|
|
1151
1158
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1152
1159
|
});
|
|
1153
1160
|
const stringifiedParams = normalizedParams.toString();
|
|
1154
|
-
return stringifiedParams.length > 0 ? `${
|
|
1161
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/admins?${stringifiedParams}` : `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/admins`;
|
|
1155
1162
|
};
|
|
1156
1163
|
/**
|
|
1157
1164
|
* Lists the people who can administer the project, and how each of them
|
|
@@ -1181,7 +1188,7 @@ const getListProjectAdminsUrl = (projectId, params) => {
|
|
|
1181
1188
|
* Ordered by `user_id` and paginated with `page_token`.
|
|
1182
1189
|
*
|
|
1183
1190
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
1184
|
-
* session cookie (`
|
|
1191
|
+
* session cookie (`sessionCookie`) that can read the project.
|
|
1185
1192
|
* @summary List project admins
|
|
1186
1193
|
*/
|
|
1187
1194
|
const listProjectAdmins = async (projectId, params, options) => {
|
|
@@ -1191,7 +1198,7 @@ const listProjectAdmins = async (projectId, params, options) => {
|
|
|
1191
1198
|
});
|
|
1192
1199
|
};
|
|
1193
1200
|
const getInitClaimUrl = (projectId) => {
|
|
1194
|
-
return `${
|
|
1201
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/init`;
|
|
1195
1202
|
};
|
|
1196
1203
|
/**
|
|
1197
1204
|
* Starts a claim challenge for an unclaimed project. Authenticated by the
|
|
@@ -1213,7 +1220,7 @@ const getGetClaimStatusUrl = (projectId, params) => {
|
|
|
1213
1220
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1214
1221
|
});
|
|
1215
1222
|
const stringifiedParams = normalizedParams.toString();
|
|
1216
|
-
return stringifiedParams.length > 0 ? `${
|
|
1223
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/status?${stringifiedParams}` : `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/status`;
|
|
1217
1224
|
};
|
|
1218
1225
|
/**
|
|
1219
1226
|
* Polled by the CLI while a browser completes the claim. Authorized by the
|
|
@@ -1233,11 +1240,11 @@ const getClaimStatus = async (projectId, params, options) => {
|
|
|
1233
1240
|
});
|
|
1234
1241
|
};
|
|
1235
1242
|
const getCompleteClaimUrl = (projectId) => {
|
|
1236
|
-
return `${
|
|
1243
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/complete`;
|
|
1237
1244
|
};
|
|
1238
1245
|
/**
|
|
1239
1246
|
* Called by the browser after the developer authenticates on the claim page.
|
|
1240
|
-
* Authenticated by the
|
|
1247
|
+
* Authenticated by the session cookie, it attaches the project to
|
|
1241
1248
|
* the developer's personal team using the `challenge_id` from the claim URL as
|
|
1242
1249
|
* its single-use, browser-safe authorization.
|
|
1243
1250
|
* @summary Complete a project claim
|
|
@@ -1267,7 +1274,7 @@ const getGetClaimWindowUrl = (projectId, params) => {
|
|
|
1267
1274
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1268
1275
|
});
|
|
1269
1276
|
const stringifiedParams = normalizedParams.toString();
|
|
1270
|
-
return stringifiedParams.length > 0 ? `${
|
|
1277
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/window?${stringifiedParams}` : `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/claim/window`;
|
|
1271
1278
|
};
|
|
1272
1279
|
/**
|
|
1273
1280
|
* Read by the claim page in the browser to show how long is left to claim the
|
|
@@ -1285,7 +1292,7 @@ const getClaimWindow = async (projectId, params, options) => {
|
|
|
1285
1292
|
});
|
|
1286
1293
|
};
|
|
1287
1294
|
const getAddOriginUrl = (projectId) => {
|
|
1288
|
-
return `${
|
|
1295
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/origins`;
|
|
1289
1296
|
};
|
|
1290
1297
|
/**
|
|
1291
1298
|
* Adds one `{pattern, kind}` to the project's origins. A primary pattern
|
|
@@ -1314,7 +1321,7 @@ const addOrigin = async (projectId, addOriginBody, options) => {
|
|
|
1314
1321
|
});
|
|
1315
1322
|
};
|
|
1316
1323
|
const getRemoveOriginUrl = (projectId) => {
|
|
1317
|
-
return `${
|
|
1324
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/origins/remove`;
|
|
1318
1325
|
};
|
|
1319
1326
|
/**
|
|
1320
1327
|
* Removes one pattern from the project's origins. Requests from URLs only
|
|
@@ -1348,7 +1355,7 @@ const getListPreviewsUrl = (projectId, params) => {
|
|
|
1348
1355
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1349
1356
|
});
|
|
1350
1357
|
const stringifiedParams = normalizedParams.toString();
|
|
1351
|
-
return stringifiedParams.length > 0 ? `${
|
|
1358
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/previews?${stringifiedParams}` : `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/previews`;
|
|
1352
1359
|
};
|
|
1353
1360
|
/**
|
|
1354
1361
|
* Lists the project's live previews, newest first by `created_at`. An
|
|
@@ -1363,7 +1370,7 @@ const listPreviews = async (projectId, params, options) => {
|
|
|
1363
1370
|
});
|
|
1364
1371
|
};
|
|
1365
1372
|
const getRemovePreviewUrl = (projectId) => {
|
|
1366
|
-
return `${
|
|
1373
|
+
return `${getApiBaseUrl()}/projects/${encodeURIComponent(String(projectId))}/previews/remove`;
|
|
1367
1374
|
};
|
|
1368
1375
|
/**
|
|
1369
1376
|
* Ends a preview before it expires: the URL stops being served at once.
|
|
@@ -1397,7 +1404,7 @@ const removePreview = async (projectId, removePreviewBody, options) => {
|
|
|
1397
1404
|
});
|
|
1398
1405
|
};
|
|
1399
1406
|
const getCreateSessionUrl = () => {
|
|
1400
|
-
return `${
|
|
1407
|
+
return `${getApiBaseUrl()}/sessions`;
|
|
1401
1408
|
};
|
|
1402
1409
|
/**
|
|
1403
1410
|
* Creates an anonymous session shell with no user and no factors (`state: building`).
|
|
@@ -1411,8 +1418,9 @@ const getCreateSessionUrl = () => {
|
|
|
1411
1418
|
* Creating a session is an app-plane operation on the project credential
|
|
1412
1419
|
* (`session.write`). The returned `session_token` is a session credential for the
|
|
1413
1420
|
* end-user client, not a management scope: it is delivered as the
|
|
1414
|
-
* `
|
|
1415
|
-
*
|
|
1421
|
+
* `__Host-zitadel_session` cookie (`zitadel_session` over plain http to a
|
|
1422
|
+
* loopback host) and authorises the self-service operations
|
|
1423
|
+
* `GET /sessions/me` and `DELETE /sessions/me` (`sessionCookie` scheme). The
|
|
1416
1424
|
* by-id operations `GET /sessions/{session_id}` and `DELETE /sessions/{session_id}`
|
|
1417
1425
|
* are operator endpoints and require `session.read` / `session.delete` instead.
|
|
1418
1426
|
*
|
|
@@ -1448,7 +1456,7 @@ const getQuerySessionsUrl = (params) => {
|
|
|
1448
1456
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1449
1457
|
});
|
|
1450
1458
|
const stringifiedParams = normalizedParams.toString();
|
|
1451
|
-
return stringifiedParams.length > 0 ? `${
|
|
1459
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/sessions/query?${stringifiedParams}` : `${getApiBaseUrl()}/sessions/query`;
|
|
1452
1460
|
};
|
|
1453
1461
|
/**
|
|
1454
1462
|
* Returns the sessions of a project, paginated with a cursor.
|
|
@@ -1481,7 +1489,7 @@ const getExchangeHandoffUrl = (params) => {
|
|
|
1481
1489
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1482
1490
|
});
|
|
1483
1491
|
const stringifiedParams = normalizedParams.toString();
|
|
1484
|
-
return stringifiedParams.length > 0 ? `${
|
|
1492
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/sessions/exchange?${stringifiedParams}` : `${getApiBaseUrl()}/sessions/exchange`;
|
|
1485
1493
|
};
|
|
1486
1494
|
/**
|
|
1487
1495
|
* Consumes a one-time `handoff_token` minted by `POST /auth_attempts/{id}/handoff`
|
|
@@ -1530,7 +1538,7 @@ const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
|
|
|
1530
1538
|
});
|
|
1531
1539
|
};
|
|
1532
1540
|
const getGetSessionUrl = (sessionId) => {
|
|
1533
|
-
return `${
|
|
1541
|
+
return `${getApiBaseUrl()}/sessions/${encodeURIComponent(String(sessionId))}`;
|
|
1534
1542
|
};
|
|
1535
1543
|
/**
|
|
1536
1544
|
* Returns the current state of a session including its factors and all currently
|
|
@@ -1548,14 +1556,14 @@ const getSession = async (sessionId, options) => {
|
|
|
1548
1556
|
});
|
|
1549
1557
|
};
|
|
1550
1558
|
const getRevokeSessionUrl = (sessionId) => {
|
|
1551
|
-
return `${
|
|
1559
|
+
return `${getApiBaseUrl()}/sessions/${encodeURIComponent(String(sessionId))}`;
|
|
1552
1560
|
};
|
|
1553
1561
|
/**
|
|
1554
1562
|
* Permanently deletes the session, terminating it immediately.
|
|
1555
1563
|
*
|
|
1556
1564
|
* This is the operator revoke path and requires the `session.delete` scope on a
|
|
1557
|
-
* project-bound credential. End-user logout with the
|
|
1558
|
-
* `DELETE /sessions/me` (`
|
|
1565
|
+
* project-bound credential. End-user logout with the session cookie is
|
|
1566
|
+
* `DELETE /sessions/me` (`sessionCookie` scheme).
|
|
1559
1567
|
*
|
|
1560
1568
|
* Idempotent: deleting a session that does not exist (or was already deleted)
|
|
1561
1569
|
* still returns 204. After deletion, any tokens derived from the session are
|
|
@@ -1574,7 +1582,7 @@ const getGetMySessionUrl = (params) => {
|
|
|
1574
1582
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1575
1583
|
});
|
|
1576
1584
|
const stringifiedParams = normalizedParams.toString();
|
|
1577
|
-
return stringifiedParams.length > 0 ? `${
|
|
1585
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/sessions/me?${stringifiedParams}` : `${getApiBaseUrl()}/sessions/me`;
|
|
1578
1586
|
};
|
|
1579
1587
|
/**
|
|
1580
1588
|
* Returns the current state of the current session including its factors and all currently
|
|
@@ -1599,12 +1607,12 @@ const getRevokeMySessionUrl = (params) => {
|
|
|
1599
1607
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1600
1608
|
});
|
|
1601
1609
|
const stringifiedParams = normalizedParams.toString();
|
|
1602
|
-
return stringifiedParams.length > 0 ? `${
|
|
1610
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/sessions/me?${stringifiedParams}` : `${getApiBaseUrl()}/sessions/me`;
|
|
1603
1611
|
};
|
|
1604
1612
|
/**
|
|
1605
1613
|
* Logs out by permanently deleting the session.
|
|
1606
1614
|
*
|
|
1607
|
-
* The
|
|
1615
|
+
* The session cookie issued at creation (or superseded by a handoff
|
|
1608
1616
|
* exchange) is required, with the session's token from `GET /sessions/me/csrf`
|
|
1609
1617
|
* in the `X-Zitadel-CSRF` header. Idempotent: if the session is already gone
|
|
1610
1618
|
* this still returns 204. Any tokens derived from the session are invalidated,
|
|
@@ -1626,13 +1634,13 @@ const getGetMySessionCsrfTokenUrl = (params) => {
|
|
|
1626
1634
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1627
1635
|
});
|
|
1628
1636
|
const stringifiedParams = normalizedParams.toString();
|
|
1629
|
-
return stringifiedParams.length > 0 ? `${
|
|
1637
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/sessions/me/csrf?${stringifiedParams}` : `${getApiBaseUrl()}/sessions/me/csrf`;
|
|
1630
1638
|
};
|
|
1631
1639
|
/**
|
|
1632
1640
|
* Returns the session-bound token for cross-site request forgery protection
|
|
1633
1641
|
* (ADR 053 §5). Browser code sends it in the `X-Zitadel-CSRF` header on the
|
|
1634
1642
|
* state-changing requests the session cookie authenticates that require it
|
|
1635
|
-
* — see the `
|
|
1643
|
+
* — see the `sessionCookie` scheme. It authorizes nothing on its own: the
|
|
1636
1644
|
* HttpOnly cookie is still the credential, and a cross-site page cannot
|
|
1637
1645
|
* read this response. It stays the same for the life of the session, so a
|
|
1638
1646
|
* client fetches it once per session.
|
|
@@ -1653,7 +1661,7 @@ const getCreateSchemaUrl = (params) => {
|
|
|
1653
1661
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1654
1662
|
});
|
|
1655
1663
|
const stringifiedParams = normalizedParams.toString();
|
|
1656
|
-
return stringifiedParams.length > 0 ? `${
|
|
1664
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/schemas?${stringifiedParams}` : `${getApiBaseUrl()}/schemas`;
|
|
1657
1665
|
};
|
|
1658
1666
|
/**
|
|
1659
1667
|
* Create a new schema. The optional `$id` field is the JSON Schema document
|
|
@@ -1689,10 +1697,16 @@ const createSchema = async (createSchemaBody, params, options) => {
|
|
|
1689
1697
|
const getListSchemasUrl = (params) => {
|
|
1690
1698
|
const normalizedParams = new URLSearchParams();
|
|
1691
1699
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1700
|
+
if (Array.isArray(value) && ["expand"].includes(key)) {
|
|
1701
|
+
value.forEach((v) => {
|
|
1702
|
+
normalizedParams.append(key, v === null ? "null" : String(v));
|
|
1703
|
+
});
|
|
1704
|
+
return;
|
|
1705
|
+
}
|
|
1692
1706
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1693
1707
|
});
|
|
1694
1708
|
const stringifiedParams = normalizedParams.toString();
|
|
1695
|
-
return stringifiedParams.length > 0 ? `${
|
|
1709
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/schemas?${stringifiedParams}` : `${getApiBaseUrl()}/schemas`;
|
|
1696
1710
|
};
|
|
1697
1711
|
/**
|
|
1698
1712
|
* Retrieve a list of all schemas available in the system. This endpoint
|
|
@@ -1711,7 +1725,7 @@ const getGetSchemaByIdUrl = (id, params) => {
|
|
|
1711
1725
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1712
1726
|
});
|
|
1713
1727
|
const stringifiedParams = normalizedParams.toString();
|
|
1714
|
-
return stringifiedParams.length > 0 ? `${
|
|
1728
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/schemas/${encodeURIComponent(String(id))}?${stringifiedParams}` : `${getApiBaseUrl()}/schemas/${encodeURIComponent(String(id))}`;
|
|
1715
1729
|
};
|
|
1716
1730
|
/**
|
|
1717
1731
|
* Get a schema by its ID. A schema ID identifies one immutable revision, so
|
|
@@ -1733,7 +1747,7 @@ const getSchemaById = async (id, params, options) => {
|
|
|
1733
1747
|
});
|
|
1734
1748
|
};
|
|
1735
1749
|
const getCreateFlowDefinitionUrl = () => {
|
|
1736
|
-
return `${
|
|
1750
|
+
return `${getApiBaseUrl()}/flow_definitions`;
|
|
1737
1751
|
};
|
|
1738
1752
|
/**
|
|
1739
1753
|
* Publishes a new flow definition revision.
|
|
@@ -1779,7 +1793,7 @@ const getListFlowDefinitionsUrl = (params) => {
|
|
|
1779
1793
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1780
1794
|
});
|
|
1781
1795
|
const stringifiedParams = normalizedParams.toString();
|
|
1782
|
-
return stringifiedParams.length > 0 ? `${
|
|
1796
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/flow_definitions?${stringifiedParams}` : `${getApiBaseUrl()}/flow_definitions`;
|
|
1783
1797
|
};
|
|
1784
1798
|
/**
|
|
1785
1799
|
* Retrieves a list of all flow definitions, newest by creation time first.
|
|
@@ -1794,7 +1808,7 @@ const listFlowDefinitions = async (params, options) => {
|
|
|
1794
1808
|
});
|
|
1795
1809
|
};
|
|
1796
1810
|
const getGetFlowDefinitionUrl = (id) => {
|
|
1797
|
-
return `${
|
|
1811
|
+
return `${getApiBaseUrl()}/flow_definitions/${encodeURIComponent(String(id))}`;
|
|
1798
1812
|
};
|
|
1799
1813
|
/**
|
|
1800
1814
|
* Get a flow definition by id
|
|
@@ -1812,7 +1826,7 @@ const getCreateTeamUrl = (params) => {
|
|
|
1812
1826
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1813
1827
|
});
|
|
1814
1828
|
const stringifiedParams = normalizedParams.toString();
|
|
1815
|
-
return stringifiedParams.length > 0 ? `${
|
|
1829
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/teams?${stringifiedParams}` : `${getApiBaseUrl()}/teams`;
|
|
1816
1830
|
};
|
|
1817
1831
|
/**
|
|
1818
1832
|
* Creates a team in the project, with a name no other team in the project has.
|
|
@@ -1846,10 +1860,13 @@ const getQueryTeamsUrl = (params) => {
|
|
|
1846
1860
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1847
1861
|
});
|
|
1848
1862
|
const stringifiedParams = normalizedParams.toString();
|
|
1849
|
-
return stringifiedParams.length > 0 ? `${
|
|
1863
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/teams/query?${stringifiedParams}` : `${getApiBaseUrl()}/teams/query`;
|
|
1850
1864
|
};
|
|
1851
1865
|
/**
|
|
1852
1866
|
* Returns the teams of a project, paginated with a cursor.
|
|
1867
|
+
*
|
|
1868
|
+
* `project_id` names the project to list; without it, the credential's own
|
|
1869
|
+
* project is listed.
|
|
1853
1870
|
* @summary Query teams
|
|
1854
1871
|
*/
|
|
1855
1872
|
const queryTeams = async (queryTeamsBody, params, options) => {
|
|
@@ -1872,7 +1889,7 @@ const queryTeams = async (queryTeamsBody, params, options) => {
|
|
|
1872
1889
|
});
|
|
1873
1890
|
};
|
|
1874
1891
|
const getGetTeamUrl = (teamId) => {
|
|
1875
|
-
return `${
|
|
1892
|
+
return `${getApiBaseUrl()}/teams/${encodeURIComponent(String(teamId))}`;
|
|
1876
1893
|
};
|
|
1877
1894
|
/**
|
|
1878
1895
|
* Returns a Team by its id.
|
|
@@ -1885,7 +1902,7 @@ const getTeam = async (teamId, options) => {
|
|
|
1885
1902
|
});
|
|
1886
1903
|
};
|
|
1887
1904
|
const getDeleteTeamUrl = (teamId) => {
|
|
1888
|
-
return `${
|
|
1905
|
+
return `${getApiBaseUrl()}/teams/${encodeURIComponent(String(teamId))}`;
|
|
1889
1906
|
};
|
|
1890
1907
|
/**
|
|
1891
1908
|
* Deactivates the team.
|
|
@@ -1910,7 +1927,7 @@ const deleteTeam = async (teamId, options) => {
|
|
|
1910
1927
|
});
|
|
1911
1928
|
};
|
|
1912
1929
|
const getUpdateTeamUrl = (teamId) => {
|
|
1913
|
-
return `${
|
|
1930
|
+
return `${getApiBaseUrl()}/teams/${encodeURIComponent(String(teamId))}`;
|
|
1914
1931
|
};
|
|
1915
1932
|
/**
|
|
1916
1933
|
* Update team. Only active teams can be updated.
|
|
@@ -1941,7 +1958,7 @@ const getCreateBrandingUrl = (params) => {
|
|
|
1941
1958
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1942
1959
|
});
|
|
1943
1960
|
const stringifiedParams = normalizedParams.toString();
|
|
1944
|
-
return stringifiedParams.length > 0 ? `${
|
|
1961
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/branding?${stringifiedParams}` : `${getApiBaseUrl()}/branding`;
|
|
1945
1962
|
};
|
|
1946
1963
|
/**
|
|
1947
1964
|
* Publishes a new immutable branding revision for the project. Branding
|
|
@@ -1979,7 +1996,7 @@ const getListBrandingUrl = (params) => {
|
|
|
1979
1996
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
1980
1997
|
});
|
|
1981
1998
|
const stringifiedParams = normalizedParams.toString();
|
|
1982
|
-
return stringifiedParams.length > 0 ? `${
|
|
1999
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/branding?${stringifiedParams}` : `${getApiBaseUrl()}/branding`;
|
|
1983
2000
|
};
|
|
1984
2001
|
/**
|
|
1985
2002
|
* Lists branding revisions for the project, newest first, capped at the
|
|
@@ -1996,7 +2013,7 @@ const listBranding = async (params, options) => {
|
|
|
1996
2013
|
});
|
|
1997
2014
|
};
|
|
1998
2015
|
const getGetBrandingByIdUrl = (id) => {
|
|
1999
|
-
return `${
|
|
2016
|
+
return `${getApiBaseUrl()}/branding/${encodeURIComponent(String(id))}`;
|
|
2000
2017
|
};
|
|
2001
2018
|
/**
|
|
2002
2019
|
* Retrieves a single branding revision, including its stored configuration.
|
|
@@ -2014,7 +2031,7 @@ const getCreateIdpUrl = (params) => {
|
|
|
2014
2031
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2015
2032
|
});
|
|
2016
2033
|
const stringifiedParams = normalizedParams.toString();
|
|
2017
|
-
return stringifiedParams.length > 0 ? `${
|
|
2034
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/idps?${stringifiedParams}` : `${getApiBaseUrl()}/idps`;
|
|
2018
2035
|
};
|
|
2019
2036
|
/**
|
|
2020
2037
|
* Creates or revises a connection document. If the slug does not already
|
|
@@ -2076,7 +2093,7 @@ const getQueryIdpsUrl = (params) => {
|
|
|
2076
2093
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2077
2094
|
});
|
|
2078
2095
|
const stringifiedParams = normalizedParams.toString();
|
|
2079
|
-
return stringifiedParams.length > 0 ? `${
|
|
2096
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/idps/query?${stringifiedParams}` : `${getApiBaseUrl()}/idps/query`;
|
|
2080
2097
|
};
|
|
2081
2098
|
/**
|
|
2082
2099
|
* Returns the identity provider connections of a project, paginated with a
|
|
@@ -2108,7 +2125,7 @@ const getGetIdpByIdUrl = (id, params) => {
|
|
|
2108
2125
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2109
2126
|
});
|
|
2110
2127
|
const stringifiedParams = normalizedParams.toString();
|
|
2111
|
-
return stringifiedParams.length > 0 ? `${
|
|
2128
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/idps/${encodeURIComponent(String(id))}?${stringifiedParams}` : `${getApiBaseUrl()}/idps/${encodeURIComponent(String(id))}`;
|
|
2112
2129
|
};
|
|
2113
2130
|
/**
|
|
2114
2131
|
* Reads a connection by its id, at its newest revision.
|
|
@@ -2129,7 +2146,7 @@ const getListIdpRevisionsUrl = (id, params) => {
|
|
|
2129
2146
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2130
2147
|
});
|
|
2131
2148
|
const stringifiedParams = normalizedParams.toString();
|
|
2132
|
-
return stringifiedParams.length > 0 ? `${
|
|
2149
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/idps/${encodeURIComponent(String(id))}/revisions?${stringifiedParams}` : `${getApiBaseUrl()}/idps/${encodeURIComponent(String(id))}/revisions`;
|
|
2133
2150
|
};
|
|
2134
2151
|
/**
|
|
2135
2152
|
* Returns every revision of one connection, newest first, paginated with a
|
|
@@ -2150,7 +2167,7 @@ const getGetIdpRevisionByIdUrl = (revisionId, params) => {
|
|
|
2150
2167
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2151
2168
|
});
|
|
2152
2169
|
const stringifiedParams = normalizedParams.toString();
|
|
2153
|
-
return stringifiedParams.length > 0 ? `${
|
|
2170
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/idps/revisions/${encodeURIComponent(String(revisionId))}?${stringifiedParams}` : `${getApiBaseUrl()}/idps/revisions/${encodeURIComponent(String(revisionId))}`;
|
|
2154
2171
|
};
|
|
2155
2172
|
/**
|
|
2156
2173
|
* Reads one revision of a connection by its `revision_id`, the value an auth
|
|
@@ -2171,7 +2188,7 @@ const getListPoliciesUrl = (params) => {
|
|
|
2171
2188
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2172
2189
|
});
|
|
2173
2190
|
const stringifiedParams = normalizedParams.toString();
|
|
2174
|
-
return stringifiedParams.length > 0 ? `${
|
|
2191
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies?${stringifiedParams}` : `${getApiBaseUrl()}/policies`;
|
|
2175
2192
|
};
|
|
2176
2193
|
/**
|
|
2177
2194
|
* Lists the project's policies, one per operation, each as its newest
|
|
@@ -2194,7 +2211,7 @@ const getPublishPolicyUrl = (params) => {
|
|
|
2194
2211
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2195
2212
|
});
|
|
2196
2213
|
const stringifiedParams = normalizedParams.toString();
|
|
2197
|
-
return stringifiedParams.length > 0 ? `${
|
|
2214
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies?${stringifiedParams}` : `${getApiBaseUrl()}/policies`;
|
|
2198
2215
|
};
|
|
2199
2216
|
/**
|
|
2200
2217
|
* Publishes the project's policy for an operation as a new immutable
|
|
@@ -2235,13 +2252,64 @@ const publishPolicy = async (publishPolicyBody, params, options) => {
|
|
|
2235
2252
|
body: JSON.stringify(publishPolicyBody)
|
|
2236
2253
|
});
|
|
2237
2254
|
};
|
|
2255
|
+
const getEvaluatePolicyUrl = (params) => {
|
|
2256
|
+
const normalizedParams = new URLSearchParams();
|
|
2257
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
2258
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2259
|
+
});
|
|
2260
|
+
const stringifiedParams = normalizedParams.toString();
|
|
2261
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies/evaluate?${stringifiedParams}` : `${getApiBaseUrl()}/policies/evaluate`;
|
|
2262
|
+
};
|
|
2263
|
+
/**
|
|
2264
|
+
* Evaluates a policy config against one request, without side effects, and
|
|
2265
|
+
* answers the decision the operation would reach. Nothing is read from or
|
|
2266
|
+
* written to the project: the config is the one in the body, checked
|
|
2267
|
+
* exactly as a publish checks it, so an invalid config answers `pol.invalid`
|
|
2268
|
+
* with the same violations.
|
|
2269
|
+
*
|
|
2270
|
+
* `input` is what the operation's request carries, in the operation's own
|
|
2271
|
+
* terms (a password, not its length): the server derives what the policy
|
|
2272
|
+
* checks with the code the live operation runs, guards included. `facts`
|
|
2273
|
+
* states what the operation would look up at runtime, such as whether the
|
|
2274
|
+
* candidate matches one of the user's kept passwords.
|
|
2275
|
+
*
|
|
2276
|
+
* The decision and the names of the failed rules hold wherever the
|
|
2277
|
+
* operation runs. `code` and `violations` are what an API call answers; a
|
|
2278
|
+
* login flow shows the same rules as field errors on the password field
|
|
2279
|
+
* (`error.x-auth-methods#password_<rule>` in `step.error`).
|
|
2280
|
+
*
|
|
2281
|
+
* Which policy a project or release applies is not decided here: read it
|
|
2282
|
+
* and pass its config.
|
|
2283
|
+
*
|
|
2284
|
+
* The caller needs read access to the project in `project_id`.
|
|
2285
|
+
* @summary Evaluate a policy
|
|
2286
|
+
*/
|
|
2287
|
+
const evaluatePolicy = async (evaluatePolicyBody, params, options) => {
|
|
2288
|
+
const getHeaders = (h) => {
|
|
2289
|
+
if (!h) return {};
|
|
2290
|
+
if (h instanceof Headers) return Object.fromEntries(h.entries());
|
|
2291
|
+
if (Symbol.iterator in h) return Object.fromEntries(Array.from(h, (entry) => Array.from(entry)));
|
|
2292
|
+
const headers = {};
|
|
2293
|
+
for (const [name, value] of Object.entries(h)) if (value !== void 0) headers[name] = value;
|
|
2294
|
+
return headers;
|
|
2295
|
+
};
|
|
2296
|
+
return customFetch(getEvaluatePolicyUrl(params), {
|
|
2297
|
+
...options,
|
|
2298
|
+
method: "POST",
|
|
2299
|
+
headers: {
|
|
2300
|
+
"Content-Type": "application/json",
|
|
2301
|
+
...getHeaders(options?.headers)
|
|
2302
|
+
},
|
|
2303
|
+
body: JSON.stringify(evaluatePolicyBody)
|
|
2304
|
+
});
|
|
2305
|
+
};
|
|
2238
2306
|
const getGetPolicyUrl = (policyId, params) => {
|
|
2239
2307
|
const normalizedParams = new URLSearchParams();
|
|
2240
2308
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
2241
2309
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2242
2310
|
});
|
|
2243
2311
|
const stringifiedParams = normalizedParams.toString();
|
|
2244
|
-
return stringifiedParams.length > 0 ? `${
|
|
2312
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies/${encodeURIComponent(String(policyId))}?${stringifiedParams}` : `${getApiBaseUrl()}/policies/${encodeURIComponent(String(policyId))}`;
|
|
2245
2313
|
};
|
|
2246
2314
|
/**
|
|
2247
2315
|
* Reads a policy as its newest revision, the one that applies the next time
|
|
@@ -2263,7 +2331,7 @@ const getListPolicyRevisionsUrl = (policyId, params) => {
|
|
|
2263
2331
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2264
2332
|
});
|
|
2265
2333
|
const stringifiedParams = normalizedParams.toString();
|
|
2266
|
-
return stringifiedParams.length > 0 ? `${
|
|
2334
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies/${encodeURIComponent(String(policyId))}/revisions?${stringifiedParams}` : `${getApiBaseUrl()}/policies/${encodeURIComponent(String(policyId))}/revisions`;
|
|
2267
2335
|
};
|
|
2268
2336
|
/**
|
|
2269
2337
|
* Returns every revision of one policy, newest first, paginated with a
|
|
@@ -2285,7 +2353,7 @@ const getGetPolicyRevisionUrl = (revisionId, params) => {
|
|
|
2285
2353
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2286
2354
|
});
|
|
2287
2355
|
const stringifiedParams = normalizedParams.toString();
|
|
2288
|
-
return stringifiedParams.length > 0 ? `${
|
|
2356
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/policies/revisions/${encodeURIComponent(String(revisionId))}?${stringifiedParams}` : `${getApiBaseUrl()}/policies/revisions/${encodeURIComponent(String(revisionId))}`;
|
|
2289
2357
|
};
|
|
2290
2358
|
/**
|
|
2291
2359
|
* Reads one revision of a policy, newest or not.
|
|
@@ -2306,7 +2374,7 @@ const getCreateReleaseUrl = (params) => {
|
|
|
2306
2374
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2307
2375
|
});
|
|
2308
2376
|
const stringifiedParams = normalizedParams.toString();
|
|
2309
|
-
return stringifiedParams.length > 0 ? `${
|
|
2377
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/releases?${stringifiedParams}` : `${getApiBaseUrl()}/releases`;
|
|
2310
2378
|
};
|
|
2311
2379
|
/**
|
|
2312
2380
|
* Assembles a release from existing revisions, given as
|
|
@@ -2355,7 +2423,7 @@ const getListReleasesUrl = (params) => {
|
|
|
2355
2423
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2356
2424
|
});
|
|
2357
2425
|
const stringifiedParams = normalizedParams.toString();
|
|
2358
|
-
return stringifiedParams.length > 0 ? `${
|
|
2426
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/releases?${stringifiedParams}` : `${getApiBaseUrl()}/releases`;
|
|
2359
2427
|
};
|
|
2360
2428
|
/**
|
|
2361
2429
|
* Lists the project's releases, newest first.
|
|
@@ -2383,7 +2451,7 @@ const getBuildReleaseUrl = (params) => {
|
|
|
2383
2451
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2384
2452
|
});
|
|
2385
2453
|
const stringifiedParams = normalizedParams.toString();
|
|
2386
|
-
return stringifiedParams.length > 0 ? `${
|
|
2454
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/releases/build?${stringifiedParams}` : `${getApiBaseUrl()}/releases/build`;
|
|
2387
2455
|
};
|
|
2388
2456
|
/**
|
|
2389
2457
|
* Builds a release from the resources of `.zitadel/` as authored on disk,
|
|
@@ -2445,7 +2513,7 @@ const getGetReleaseByIdUrl = (releaseId, params) => {
|
|
|
2445
2513
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2446
2514
|
});
|
|
2447
2515
|
const stringifiedParams = normalizedParams.toString();
|
|
2448
|
-
return stringifiedParams.length > 0 ? `${
|
|
2516
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/releases/${encodeURIComponent(String(releaseId))}?${stringifiedParams}` : `${getApiBaseUrl()}/releases/${encodeURIComponent(String(releaseId))}`;
|
|
2449
2517
|
};
|
|
2450
2518
|
/**
|
|
2451
2519
|
* Reads one release: its digest, its metadata, whether it was revoked, and
|
|
@@ -2475,7 +2543,7 @@ const getRevokeReleaseUrl = (releaseId, params) => {
|
|
|
2475
2543
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2476
2544
|
});
|
|
2477
2545
|
const stringifiedParams = normalizedParams.toString();
|
|
2478
|
-
return stringifiedParams.length > 0 ? `${
|
|
2546
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/releases/${encodeURIComponent(String(releaseId))}/revoke?${stringifiedParams}` : `${getApiBaseUrl()}/releases/${encodeURIComponent(String(releaseId))}/revoke`;
|
|
2479
2547
|
};
|
|
2480
2548
|
/**
|
|
2481
2549
|
* Marks the release revoked, so that its content is never served again.
|
|
@@ -2511,7 +2579,7 @@ const getCreateGrantUrl = (params) => {
|
|
|
2511
2579
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2512
2580
|
});
|
|
2513
2581
|
const stringifiedParams = normalizedParams.toString();
|
|
2514
|
-
return stringifiedParams.length > 0 ? `${
|
|
2582
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/grants?${stringifiedParams}` : `${getApiBaseUrl()}/grants`;
|
|
2515
2583
|
};
|
|
2516
2584
|
/**
|
|
2517
2585
|
* Bind a user or team to `project.viewer`, `project.editor`, or
|
|
@@ -2530,9 +2598,9 @@ const getCreateGrantUrl = (params) => {
|
|
|
2530
2598
|
* identifier and display.
|
|
2531
2599
|
*
|
|
2532
2600
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
2533
|
-
* session cookie (`
|
|
2601
|
+
* session cookie (`sessionCookie`). Session callers are authorized as
|
|
2534
2602
|
* the human against the target project (home may differ). Cookie-authenticated
|
|
2535
|
-
* requests follow the scheme's CSRF rules (`
|
|
2603
|
+
* requests follow the scheme's CSRF rules (`sessionCookie`).
|
|
2536
2604
|
* @summary Create grant
|
|
2537
2605
|
*/
|
|
2538
2606
|
const createGrant = async (createGrantBody, params, options) => {
|
|
@@ -2560,7 +2628,7 @@ const getQueryGrantsUrl = (params) => {
|
|
|
2560
2628
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2561
2629
|
});
|
|
2562
2630
|
const stringifiedParams = normalizedParams.toString();
|
|
2563
|
-
return stringifiedParams.length > 0 ? `${
|
|
2631
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/grants/query?${stringifiedParams}` : `${getApiBaseUrl()}/grants/query`;
|
|
2564
2632
|
};
|
|
2565
2633
|
/**
|
|
2566
2634
|
* Returns the collaboration grants of a project, paginated with a cursor.
|
|
@@ -2577,8 +2645,8 @@ const getQueryGrantsUrl = (params) => {
|
|
|
2577
2645
|
* the project Check may expand without those scopes.
|
|
2578
2646
|
*
|
|
2579
2647
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
2580
|
-
* session cookie (`
|
|
2581
|
-
* follow the scheme's CSRF rules (`
|
|
2648
|
+
* session cookie (`sessionCookie`). Cookie-authenticated requests
|
|
2649
|
+
* follow the scheme's CSRF rules (`sessionCookie`).
|
|
2582
2650
|
* @summary Query grants
|
|
2583
2651
|
*/
|
|
2584
2652
|
const queryGrants = async (queryGrantsBody, params, options) => {
|
|
@@ -2612,7 +2680,7 @@ const getGetGrantUrl = (id, params) => {
|
|
|
2612
2680
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2613
2681
|
});
|
|
2614
2682
|
const stringifiedParams = normalizedParams.toString();
|
|
2615
|
-
return stringifiedParams.length > 0 ? `${
|
|
2683
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/grants/${encodeURIComponent(String(id))}?${stringifiedParams}` : `${getApiBaseUrl()}/grants/${encodeURIComponent(String(id))}`;
|
|
2616
2684
|
};
|
|
2617
2685
|
/**
|
|
2618
2686
|
* Loads a grant by `(project_id, id)` that this API manages (user or team
|
|
@@ -2629,8 +2697,8 @@ const getGetGrantUrl = (id, params) => {
|
|
|
2629
2697
|
* Check may expand without those scopes.
|
|
2630
2698
|
*
|
|
2631
2699
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
2632
|
-
* session cookie (`
|
|
2633
|
-
* follow the scheme's CSRF rules (`
|
|
2700
|
+
* session cookie (`sessionCookie`). Cookie-authenticated requests
|
|
2701
|
+
* follow the scheme's CSRF rules (`sessionCookie`).
|
|
2634
2702
|
* @summary Get grant
|
|
2635
2703
|
*/
|
|
2636
2704
|
const getGrant = async (id, params, options) => {
|
|
@@ -2645,7 +2713,7 @@ const getDeleteGrantUrl = (id, params) => {
|
|
|
2645
2713
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2646
2714
|
});
|
|
2647
2715
|
const stringifiedParams = normalizedParams.toString();
|
|
2648
|
-
return stringifiedParams.length > 0 ? `${
|
|
2716
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/grants/${encodeURIComponent(String(id))}?${stringifiedParams}` : `${getApiBaseUrl()}/grants/${encodeURIComponent(String(id))}`;
|
|
2649
2717
|
};
|
|
2650
2718
|
/**
|
|
2651
2719
|
* Soft-revokes a grant this API manages and emits `authz.revoked`.
|
|
@@ -2654,8 +2722,8 @@ const getDeleteGrantUrl = (id, params) => {
|
|
|
2654
2722
|
* revoked so the unique binding can be reused.
|
|
2655
2723
|
*
|
|
2656
2724
|
* Accepts either a project secret (`oauth2`) or a user-bound Console
|
|
2657
|
-
* session cookie (`
|
|
2658
|
-
* follow the scheme's CSRF rules (`
|
|
2725
|
+
* session cookie (`sessionCookie`). Cookie-authenticated requests
|
|
2726
|
+
* follow the scheme's CSRF rules (`sessionCookie`).
|
|
2659
2727
|
* @summary Revoke grant
|
|
2660
2728
|
*/
|
|
2661
2729
|
const deleteGrant = async (id, params, options) => {
|
|
@@ -2676,7 +2744,7 @@ const getListEventsUrl = (params) => {
|
|
|
2676
2744
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2677
2745
|
});
|
|
2678
2746
|
const stringifiedParams = normalizedParams.toString();
|
|
2679
|
-
return stringifiedParams.length > 0 ? `${
|
|
2747
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/events?${stringifiedParams}` : `${getApiBaseUrl()}/events`;
|
|
2680
2748
|
};
|
|
2681
2749
|
/**
|
|
2682
2750
|
* Returns project-scoped audit events, newest-first by keyset on
|
|
@@ -2704,7 +2772,7 @@ const getGetEventUrl = (id, params) => {
|
|
|
2704
2772
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2705
2773
|
});
|
|
2706
2774
|
const stringifiedParams = normalizedParams.toString();
|
|
2707
|
-
return stringifiedParams.length > 0 ? `${
|
|
2775
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/events/${encodeURIComponent(String(id))}?${stringifiedParams}` : `${getApiBaseUrl()}/events/${encodeURIComponent(String(id))}`;
|
|
2708
2776
|
};
|
|
2709
2777
|
/**
|
|
2710
2778
|
* Loads a single event by `(project_id, id)`. Requires `events.read`.
|
|
@@ -2726,7 +2794,7 @@ const getGetVariablesUrl = (params) => {
|
|
|
2726
2794
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2727
2795
|
});
|
|
2728
2796
|
const stringifiedParams = normalizedParams.toString();
|
|
2729
|
-
return stringifiedParams.length > 0 ? `${
|
|
2797
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/variables?${stringifiedParams}` : `${getApiBaseUrl()}/variables`;
|
|
2730
2798
|
};
|
|
2731
2799
|
/**
|
|
2732
2800
|
* Returns the project's variables, keyed by name, each with its value per
|
|
@@ -2748,7 +2816,7 @@ const getUpdateVariablesUrl = (params) => {
|
|
|
2748
2816
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2749
2817
|
});
|
|
2750
2818
|
const stringifiedParams = normalizedParams.toString();
|
|
2751
|
-
return stringifiedParams.length > 0 ? `${
|
|
2819
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/variables?${stringifiedParams}` : `${getApiBaseUrl()}/variables`;
|
|
2752
2820
|
};
|
|
2753
2821
|
/**
|
|
2754
2822
|
* Enters, replaces and removes the project's variables for the requested
|
|
@@ -2796,7 +2864,7 @@ const getGetVariableUrl = (variableName, params) => {
|
|
|
2796
2864
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2797
2865
|
});
|
|
2798
2866
|
const stringifiedParams = normalizedParams.toString();
|
|
2799
|
-
return stringifiedParams.length > 0 ? `${
|
|
2867
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/variables/${encodeURIComponent(String(variableName))}?${stringifiedParams}` : `${getApiBaseUrl()}/variables/${encodeURIComponent(String(variableName))}`;
|
|
2800
2868
|
};
|
|
2801
2869
|
/**
|
|
2802
2870
|
* Reads one variable by name, with its value per kind. A name with no
|
|
@@ -2816,7 +2884,7 @@ const getDeleteVariableUrl = (variableName, params) => {
|
|
|
2816
2884
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2817
2885
|
});
|
|
2818
2886
|
const stringifiedParams = normalizedParams.toString();
|
|
2819
|
-
return stringifiedParams.length > 0 ? `${
|
|
2887
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/variables/${encodeURIComponent(String(variableName))}?${stringifiedParams}` : `${getApiBaseUrl()}/variables/${encodeURIComponent(String(variableName))}`;
|
|
2820
2888
|
};
|
|
2821
2889
|
/**
|
|
2822
2890
|
* Removes a variable for the requested kind, or for both kinds without
|
|
@@ -2836,7 +2904,7 @@ const getCreateDeploymentUrl = (params) => {
|
|
|
2836
2904
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2837
2905
|
});
|
|
2838
2906
|
const stringifiedParams = normalizedParams.toString();
|
|
2839
|
-
return stringifiedParams.length > 0 ? `${
|
|
2907
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/deployments?${stringifiedParams}` : `${getApiBaseUrl()}/deployments`;
|
|
2840
2908
|
};
|
|
2841
2909
|
/**
|
|
2842
2910
|
* Makes a release live on its targets by recording a deployment,
|
|
@@ -2900,7 +2968,7 @@ const getListDeploymentsUrl = (params) => {
|
|
|
2900
2968
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2901
2969
|
});
|
|
2902
2970
|
const stringifiedParams = normalizedParams.toString();
|
|
2903
|
-
return stringifiedParams.length > 0 ? `${
|
|
2971
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/deployments?${stringifiedParams}` : `${getApiBaseUrl()}/deployments`;
|
|
2904
2972
|
};
|
|
2905
2973
|
/**
|
|
2906
2974
|
* Lists what ran where, and when.
|
|
@@ -2932,7 +3000,7 @@ const getGetDeploymentByIdUrl = (deploymentId, params) => {
|
|
|
2932
3000
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2933
3001
|
});
|
|
2934
3002
|
const stringifiedParams = normalizedParams.toString();
|
|
2935
|
-
return stringifiedParams.length > 0 ? `${
|
|
3003
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}?${stringifiedParams}` : `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}`;
|
|
2936
3004
|
};
|
|
2937
3005
|
/**
|
|
2938
3006
|
* Reads one deployment record.
|
|
@@ -2955,7 +3023,7 @@ const getRollbackDeploymentUrl = (deploymentId, params) => {
|
|
|
2955
3023
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
2956
3024
|
});
|
|
2957
3025
|
const stringifiedParams = normalizedParams.toString();
|
|
2958
|
-
return stringifiedParams.length > 0 ? `${
|
|
3026
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}/rollback?${stringifiedParams}` : `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}/rollback`;
|
|
2959
3027
|
};
|
|
2960
3028
|
/**
|
|
2961
3029
|
* Re-deploys the release of the deployment named in the path to `primary`,
|
|
@@ -2999,7 +3067,7 @@ const getGetDeploymentVariablesUrl = (deploymentId, params) => {
|
|
|
2999
3067
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : String(value));
|
|
3000
3068
|
});
|
|
3001
3069
|
const stringifiedParams = normalizedParams.toString();
|
|
3002
|
-
return stringifiedParams.length > 0 ? `${
|
|
3070
|
+
return stringifiedParams.length > 0 ? `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}/variables?${stringifiedParams}` : `${getApiBaseUrl()}/deployments/${encodeURIComponent(String(deploymentId))}/variables`;
|
|
3003
3071
|
};
|
|
3004
3072
|
/**
|
|
3005
3073
|
* Returns the variable values the deployment froze when it was made. Later
|
|
@@ -3014,6 +3082,6 @@ const getDeploymentVariables = async (deploymentId, params, options) => {
|
|
|
3014
3082
|
});
|
|
3015
3083
|
};
|
|
3016
3084
|
//#endregion
|
|
3017
|
-
export { addOrigin, beginUserPasskeyRegistration, buildRelease, completeClaim, createAuthAttempt, createBranding, createDeployment, createFlow, createFlowDefinition, createGrant, createHandoff, createIdp, createProject, createRelease, createSchema, createSession, createTeam, createUser, deleteGrant, deleteTeam, deleteUserByID, deleteVariable, exchangeHandoff, finishUserPasskeyRegistration, getAddOriginUrl, getAuthAttempt, getBeginUserPasskeyRegistrationUrl, getBrandingById, getBuildReleaseUrl, getClaimStatus, getClaimWindow, getCompleteClaimUrl, getCreateAuthAttemptUrl, getCreateBrandingUrl, getCreateDeploymentUrl, getCreateFlowDefinitionUrl, getCreateFlowUrl, getCreateGrantUrl, getCreateHandoffUrl, getCreateIdpUrl, getCreateProjectUrl, getCreateReleaseUrl, getCreateSchemaUrl, getCreateSessionUrl, getCreateTeamUrl, getCreateUserUrl, getDeleteGrantUrl, getDeleteTeamUrl, getDeleteUserByIDUrl, getDeleteVariableUrl, getDeploymentById, getDeploymentVariables, getEvent, getExchangeHandoffUrl, getFinishUserPasskeyRegistrationUrl, getFlowDefinition, getFlowStep, getGetAuthAttemptUrl, getGetBrandingByIdUrl, getGetClaimStatusUrl, getGetClaimWindowUrl, getGetDeploymentByIdUrl, getGetDeploymentVariablesUrl, getGetEventUrl, getGetFlowDefinitionUrl, getGetFlowStepUrl, getGetGrantUrl, getGetIdpByIdUrl, getGetIdpRevisionByIdUrl, getGetLiveUrl, getGetMyPasswordStateUrl, getGetMySessionCsrfTokenUrl, getGetMySessionUrl, getGetMyUserSchemaUrl, getGetMyUserUrl, getGetPolicyRevisionUrl, getGetPolicyUrl, getGetProjectUrl, getGetReadyUrl, getGetReleaseByIdUrl, getGetSchemaByIdUrl, getGetSessionUrl, getGetTeamUrl, getGetUserByIDUrl, getGetUserPasswordStateUrl, getGetVariableUrl, getGetVariablesUrl, getGrant, getIdpById, getIdpRevisionById, getInitClaimUrl, getIssueChallengeUrl, getListBrandingUrl, getListDeploymentsUrl, getListEventsUrl, getListFlowDefinitionsUrl, getListIdpRevisionsUrl, getListMyIdentityLinksUrl, getListMyPasskeysUrl, getListMyProjectsUrl, getListMyTeamsUrl, getListPoliciesUrl, getListPolicyRevisionsUrl, getListPreviewsUrl, getListProjectAdminsUrl, getListReleasesUrl, getListSchemasUrl, getListUserIdentityLinksUrl, getListUserPasskeysUrl, getListUserTeamsUrl, getLive, getMyPasswordState, getMySession, getMySessionCsrfToken, getMyUser, getMyUserSchema, getPatchMyUserUrl, getPatchProjectUrl, getPatchUserByIDUrl, getPolicy, getPolicyRevision, getProject, getPublishPolicyUrl, getQueryGrantsUrl, getQueryIdpsUrl, getQueryProjectsUrl, getQuerySessionsUrl, getQueryTeamsUrl, getQueryUsersUrl, getReady, getReleaseById, getRemoveOriginUrl, getRemovePreviewUrl, getRevokeMySessionUrl, getRevokeReleaseUrl, getRevokeSessionUrl, getRollbackDeploymentUrl, getSchemaById, getSession, getSetUserPasswordUrl, getSubmitFlowStepUrl, getTeam, getUpdateTeamUrl, getUpdateVariablesUrl, getUserByID, getUserPasswordState, getVariable, getVariables, getVerifyChallengeProofUrl, initClaim, issueChallenge, listBranding, listDeployments, listEvents, listFlowDefinitions, listIdpRevisions, listMyIdentityLinks, listMyPasskeys, listMyProjects, listMyTeams, listPolicies, listPolicyRevisions, listPreviews, listProjectAdmins, listReleases, listSchemas, listUserIdentityLinks, listUserPasskeys, listUserTeams, patchMyUser, patchProject, patchUserByID, publishPolicy, queryGrants, queryIdps, queryProjects, querySessions, queryTeams, queryUsers, removeOrigin, removePreview, revokeMySession, revokeRelease, revokeSession, rollbackDeployment, setUserPassword, submitFlowStep, zitadelNextGen_exports as t, updateTeam, updateVariables, verifyChallengeProof };
|
|
3085
|
+
export { addOrigin, beginUserPasskeyRegistration, buildRelease, completeClaim, createAuthAttempt, createBranding, createDeployment, createFlow, createFlowDefinition, createGrant, createHandoff, createIdp, createProject, createRelease, createSchema, createSession, createTeam, createUser, deleteGrant, deleteTeam, deleteUserByID, deleteVariable, evaluatePolicy, exchangeHandoff, finishUserPasskeyRegistration, getAddOriginUrl, getAuthAttempt, getBeginUserPasskeyRegistrationUrl, getBrandingById, getBuildReleaseUrl, getClaimStatus, getClaimWindow, getCompleteClaimUrl, getCreateAuthAttemptUrl, getCreateBrandingUrl, getCreateDeploymentUrl, getCreateFlowDefinitionUrl, getCreateFlowUrl, getCreateGrantUrl, getCreateHandoffUrl, getCreateIdpUrl, getCreateProjectUrl, getCreateReleaseUrl, getCreateSchemaUrl, getCreateSessionUrl, getCreateTeamUrl, getCreateUserUrl, getDeleteGrantUrl, getDeleteTeamUrl, getDeleteUserByIDUrl, getDeleteVariableUrl, getDeploymentById, getDeploymentVariables, getEvaluatePolicyUrl, getEvent, getExchangeHandoffUrl, getFinishUserPasskeyRegistrationUrl, getFlowDefinition, getFlowStep, getGetAuthAttemptUrl, getGetBrandingByIdUrl, getGetClaimStatusUrl, getGetClaimWindowUrl, getGetDeploymentByIdUrl, getGetDeploymentVariablesUrl, getGetEventUrl, getGetFlowDefinitionUrl, getGetFlowStepUrl, getGetGrantUrl, getGetIdpByIdUrl, getGetIdpRevisionByIdUrl, getGetLiveUrl, getGetMyPasswordStateUrl, getGetMySessionCsrfTokenUrl, getGetMySessionUrl, getGetMyUserSchemaUrl, getGetMyUserUrl, getGetPolicyRevisionUrl, getGetPolicyUrl, getGetProjectUrl, getGetReadyUrl, getGetReleaseByIdUrl, getGetSchemaByIdUrl, getGetSessionUrl, getGetTeamUrl, getGetUserByIDUrl, getGetUserPasswordStateUrl, getGetVariableUrl, getGetVariablesUrl, getGrant, getIdpById, getIdpRevisionById, getInitClaimUrl, getIssueChallengeUrl, getListBrandingUrl, getListDeploymentsUrl, getListEventsUrl, getListFlowDefinitionsUrl, getListIdpRevisionsUrl, getListMyIdentityLinksUrl, getListMyPasskeysUrl, getListMyProjectsUrl, getListMyTeamsUrl, getListPoliciesUrl, getListPolicyRevisionsUrl, getListPreviewsUrl, getListProjectAdminsUrl, getListReleasesUrl, getListSchemasUrl, getListUserIdentityLinksUrl, getListUserPasskeysUrl, getListUserTeamsUrl, getLive, getMyPasswordState, getMySession, getMySessionCsrfToken, getMyUser, getMyUserSchema, getPatchMyUserUrl, getPatchProjectUrl, getPatchUserByIDUrl, getPolicy, getPolicyRevision, getProject, getPublishPolicyUrl, getQueryGrantsUrl, getQueryIdpsUrl, getQueryProjectsUrl, getQuerySessionsUrl, getQueryTeamsUrl, getQueryUsersUrl, getReady, getReleaseById, getRemoveOriginUrl, getRemovePreviewUrl, getRevokeMySessionUrl, getRevokeReleaseUrl, getRevokeSessionUrl, getRollbackDeploymentUrl, getSchemaById, getSession, getSetUserPasswordUrl, getSubmitFlowStepUrl, getTeam, getUpdateTeamUrl, getUpdateVariablesUrl, getUserByID, getUserPasswordState, getVariable, getVariables, getVerifyChallengeProofUrl, initClaim, issueChallenge, listBranding, listDeployments, listEvents, listFlowDefinitions, listIdpRevisions, listMyIdentityLinks, listMyPasskeys, listMyProjects, listMyTeams, listPolicies, listPolicyRevisions, listPreviews, listProjectAdmins, listReleases, listSchemas, listUserIdentityLinks, listUserPasskeys, listUserTeams, patchMyUser, patchProject, patchUserByID, publishPolicy, queryGrants, queryIdps, queryProjects, querySessions, queryTeams, queryUsers, removeOrigin, removePreview, revokeMySession, revokeRelease, revokeSession, rollbackDeployment, setUserPassword, submitFlowStep, zitadelNextGen_exports as t, updateTeam, updateVariables, verifyChallengeProof };
|
|
3018
3086
|
|
|
3019
3087
|
//# sourceMappingURL=zitadelNextGen.mjs.map
|