@zitadel/testing 0.1.0-alpha.18 → 1.0.0-alpha.20
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +66 -7
- package/dist/{app-env-D3W0GYhA.d.mts → app-env-DlrV_ePR.d.mts} +59 -7
- package/dist/app-env-DlrV_ePR.d.mts.map +1 -0
- package/dist/app-runner.cjs +1 -1
- package/dist/app-runner.mjs +1 -1
- package/dist/{handshake-CRKcgkfN.cjs → handshake-BOsVBPtn.cjs} +14 -1
- package/dist/handshake-BOsVBPtn.cjs.map +1 -0
- package/dist/{handshake-ClzWvG8z.mjs → handshake-BnAPXC6s.mjs} +14 -1
- package/dist/handshake-BnAPXC6s.mjs.map +1 -0
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +2 -2
- package/dist/index.mjs +2 -2
- package/dist/playwright.cjs +33 -15
- package/dist/playwright.cjs.map +1 -1
- package/dist/playwright.d.mts +19 -3
- package/dist/playwright.d.mts.map +1 -1
- package/dist/playwright.mjs +33 -15
- package/dist/playwright.mjs.map +1 -1
- package/dist/{src-eTcdx-ZS.mjs → src-Dkt0HHu8.mjs} +11 -8
- package/dist/src-Dkt0HHu8.mjs.map +1 -0
- package/dist/{src-DirKLqi4.cjs → src-DtCJTEId.cjs} +541 -195
- package/dist/src-DtCJTEId.cjs.map +1 -0
- package/dist/supervisor.cjs +2 -2
- package/dist/supervisor.mjs +2 -2
- package/package.json +4 -4
- package/dist/app-env-D3W0GYhA.d.mts.map +0 -1
- package/dist/handshake-CRKcgkfN.cjs.map +0 -1
- package/dist/handshake-ClzWvG8z.mjs.map +0 -1
- package/dist/src-DirKLqi4.cjs.map +0 -1
- package/dist/src-eTcdx-ZS.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_handshake = require("./handshake-
|
|
1
|
+
const require_handshake = require("./handshake-BOsVBPtn.cjs");
|
|
2
2
|
require("node:fs");
|
|
3
3
|
require("node:url");
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -129,22 +129,28 @@ function safeJsonParse(text) {
|
|
|
129
129
|
* OpenAPI spec version: 0.0.1
|
|
130
130
|
*/
|
|
131
131
|
var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
132
|
+
beginUserPasskeyRegistration: () => beginUserPasskeyRegistration,
|
|
132
133
|
completeClaim: () => completeClaim,
|
|
133
134
|
createAuthAttempt: () => createAuthAttempt,
|
|
134
135
|
createBranding: () => createBranding,
|
|
135
136
|
createFlow: () => createFlow,
|
|
136
137
|
createFlowDefinition: () => createFlowDefinition,
|
|
138
|
+
createGrant: () => createGrant,
|
|
137
139
|
createHandoff: () => createHandoff,
|
|
138
140
|
createProject: () => createProject,
|
|
141
|
+
createRelease: () => createRelease,
|
|
139
142
|
createSchema: () => createSchema,
|
|
140
143
|
createSession: () => createSession,
|
|
141
144
|
createTeam: () => createTeam,
|
|
142
145
|
createUser: () => createUser,
|
|
143
146
|
deleteFlowDefinition: () => deleteFlowDefinition,
|
|
147
|
+
deleteGrant: () => deleteGrant,
|
|
144
148
|
deleteTeam: () => deleteTeam,
|
|
145
149
|
deleteUserByID: () => deleteUserByID,
|
|
146
150
|
exchangeHandoff: () => exchangeHandoff,
|
|
151
|
+
finishUserPasskeyRegistration: () => finishUserPasskeyRegistration,
|
|
147
152
|
getAuthAttempt: () => getAuthAttempt,
|
|
153
|
+
getBeginUserPasskeyRegistrationUrl: () => getBeginUserPasskeyRegistrationUrl,
|
|
148
154
|
getBrandingById: () => getBrandingById,
|
|
149
155
|
getClaimStatus: () => getClaimStatus,
|
|
150
156
|
getCompleteClaimUrl: () => getCompleteClaimUrl,
|
|
@@ -152,42 +158,55 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
152
158
|
getCreateBrandingUrl: () => getCreateBrandingUrl,
|
|
153
159
|
getCreateFlowDefinitionUrl: () => getCreateFlowDefinitionUrl,
|
|
154
160
|
getCreateFlowUrl: () => getCreateFlowUrl,
|
|
161
|
+
getCreateGrantUrl: () => getCreateGrantUrl,
|
|
155
162
|
getCreateHandoffUrl: () => getCreateHandoffUrl,
|
|
156
163
|
getCreateProjectUrl: () => getCreateProjectUrl,
|
|
164
|
+
getCreateReleaseUrl: () => getCreateReleaseUrl,
|
|
157
165
|
getCreateSchemaUrl: () => getCreateSchemaUrl,
|
|
158
166
|
getCreateSessionUrl: () => getCreateSessionUrl,
|
|
159
167
|
getCreateTeamUrl: () => getCreateTeamUrl,
|
|
160
168
|
getCreateUserUrl: () => getCreateUserUrl,
|
|
161
169
|
getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
|
|
170
|
+
getDeleteGrantUrl: () => getDeleteGrantUrl,
|
|
162
171
|
getDeleteTeamUrl: () => getDeleteTeamUrl,
|
|
163
172
|
getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
|
|
173
|
+
getEnvironmentByName: () => getEnvironmentByName,
|
|
174
|
+
getEvent: () => getEvent,
|
|
164
175
|
getExchangeHandoffUrl: () => getExchangeHandoffUrl,
|
|
176
|
+
getFinishUserPasskeyRegistrationUrl: () => getFinishUserPasskeyRegistrationUrl,
|
|
165
177
|
getFlowDefinition: () => getFlowDefinition,
|
|
166
178
|
getFlowStep: () => getFlowStep,
|
|
167
179
|
getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
|
|
168
180
|
getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
|
|
169
181
|
getGetClaimStatusUrl: () => getGetClaimStatusUrl,
|
|
182
|
+
getGetEnvironmentByNameUrl: () => getGetEnvironmentByNameUrl,
|
|
183
|
+
getGetEventUrl: () => getGetEventUrl,
|
|
170
184
|
getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
|
|
171
185
|
getGetFlowStepUrl: () => getGetFlowStepUrl,
|
|
186
|
+
getGetGrantUrl: () => getGetGrantUrl,
|
|
172
187
|
getGetHealthUrl: () => getGetHealthUrl,
|
|
173
188
|
getGetLiveUrl: () => getGetLiveUrl,
|
|
174
189
|
getGetMySessionUrl: () => getGetMySessionUrl,
|
|
175
190
|
getGetMyUserUrl: () => getGetMyUserUrl,
|
|
176
191
|
getGetProjectUrl: () => getGetProjectUrl,
|
|
177
192
|
getGetReadyUrl: () => getGetReadyUrl,
|
|
193
|
+
getGetReleaseByIdUrl: () => getGetReleaseByIdUrl,
|
|
178
194
|
getGetSchemaByIdUrl: () => getGetSchemaByIdUrl,
|
|
179
195
|
getGetSessionUrl: () => getGetSessionUrl,
|
|
180
196
|
getGetTeamUrl: () => getGetTeamUrl,
|
|
181
197
|
getGetUserByIDUrl: () => getGetUserByIDUrl,
|
|
198
|
+
getGrant: () => getGrant,
|
|
182
199
|
getHealth: () => getHealth,
|
|
183
200
|
getInitClaimUrl: () => getInitClaimUrl,
|
|
184
201
|
getIssueChallengeUrl: () => getIssueChallengeUrl,
|
|
185
202
|
getListBrandingUrl: () => getListBrandingUrl,
|
|
203
|
+
getListEnvironmentsUrl: () => getListEnvironmentsUrl,
|
|
204
|
+
getListEventsUrl: () => getListEventsUrl,
|
|
186
205
|
getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
|
|
206
|
+
getListReleasesUrl: () => getListReleasesUrl,
|
|
187
207
|
getListSchemasUrl: () => getListSchemasUrl,
|
|
188
208
|
getListUserPasskeysUrl: () => getListUserPasskeysUrl,
|
|
189
209
|
getListUserTeamsUrl: () => getListUserTeamsUrl,
|
|
190
|
-
getListUsersUrl: () => getListUsersUrl,
|
|
191
210
|
getLive: () => getLive,
|
|
192
211
|
getMySession: () => getMySession,
|
|
193
212
|
getMyUser: () => getMyUser,
|
|
@@ -196,7 +215,9 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
196
215
|
getQueryProjectsUrl: () => getQueryProjectsUrl,
|
|
197
216
|
getQuerySessionsUrl: () => getQuerySessionsUrl,
|
|
198
217
|
getQueryTeamsUrl: () => getQueryTeamsUrl,
|
|
218
|
+
getQueryUsersUrl: () => getQueryUsersUrl,
|
|
199
219
|
getReady: () => getReady,
|
|
220
|
+
getReleaseById: () => getReleaseById,
|
|
200
221
|
getRevokeMySessionUrl: () => getRevokeMySessionUrl,
|
|
201
222
|
getRevokeSessionUrl: () => getRevokeSessionUrl,
|
|
202
223
|
getSchemaById: () => getSchemaById,
|
|
@@ -211,15 +232,18 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
211
232
|
initClaim: () => initClaim,
|
|
212
233
|
issueChallenge: () => issueChallenge,
|
|
213
234
|
listBranding: () => listBranding,
|
|
235
|
+
listEnvironments: () => listEnvironments,
|
|
236
|
+
listEvents: () => listEvents,
|
|
214
237
|
listFlowDefinitions: () => listFlowDefinitions,
|
|
238
|
+
listReleases: () => listReleases,
|
|
215
239
|
listSchemas: () => listSchemas,
|
|
216
240
|
listUserPasskeys: () => listUserPasskeys,
|
|
217
241
|
listUserTeams: () => listUserTeams,
|
|
218
|
-
listUsers: () => listUsers,
|
|
219
242
|
patchProject: () => patchProject,
|
|
220
243
|
queryProjects: () => queryProjects,
|
|
221
244
|
querySessions: () => querySessions,
|
|
222
245
|
queryTeams: () => queryTeams,
|
|
246
|
+
queryUsers: () => queryUsers,
|
|
223
247
|
revokeMySession: () => revokeMySession,
|
|
224
248
|
revokeSession: () => revokeSession,
|
|
225
249
|
setUserPassword: () => setUserPassword,
|
|
@@ -289,21 +313,27 @@ const createUser = async (createUserBody, params, options) => {
|
|
|
289
313
|
body: JSON.stringify(createUserBody)
|
|
290
314
|
});
|
|
291
315
|
};
|
|
292
|
-
const
|
|
293
|
-
|
|
294
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
295
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
296
|
-
});
|
|
297
|
-
const stringifiedParams = normalizedParams.toString();
|
|
298
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/users?${stringifiedParams}` : `${getProxyPath()}/users`;
|
|
316
|
+
const getQueryUsersUrl = () => {
|
|
317
|
+
return `${getProxyPath()}/users/query`;
|
|
299
318
|
};
|
|
300
319
|
/**
|
|
301
|
-
*
|
|
320
|
+
* Returns the users of a project, paginated with a cursor.
|
|
321
|
+
|
|
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.
|
|
325
|
+
|
|
326
|
+
* @summary Query users
|
|
302
327
|
*/
|
|
303
|
-
const
|
|
304
|
-
return customFetch(
|
|
328
|
+
const queryUsers = async (queryUsersBody, options) => {
|
|
329
|
+
return customFetch(getQueryUsersUrl(), {
|
|
305
330
|
...options,
|
|
306
|
-
method: "
|
|
331
|
+
method: "POST",
|
|
332
|
+
headers: {
|
|
333
|
+
"Content-Type": "application/json",
|
|
334
|
+
...options?.headers
|
|
335
|
+
},
|
|
336
|
+
body: JSON.stringify(queryUsersBody)
|
|
307
337
|
});
|
|
308
338
|
};
|
|
309
339
|
const getGetUserByIDUrl = (userId, params) => {
|
|
@@ -323,19 +353,14 @@ const getUserByID = async (userId, params, options) => {
|
|
|
323
353
|
method: "GET"
|
|
324
354
|
});
|
|
325
355
|
};
|
|
326
|
-
const getDeleteUserByIDUrl = (userId
|
|
327
|
-
|
|
328
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
329
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
330
|
-
});
|
|
331
|
-
const stringifiedParams = normalizedParams.toString();
|
|
332
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;
|
|
356
|
+
const getDeleteUserByIDUrl = (userId) => {
|
|
357
|
+
return `${getProxyPath()}/users/${userId}`;
|
|
333
358
|
};
|
|
334
359
|
/**
|
|
335
360
|
* @summary Delete user by ID
|
|
336
361
|
*/
|
|
337
|
-
const deleteUserByID = async (userId,
|
|
338
|
-
return customFetch(getDeleteUserByIDUrl(userId
|
|
362
|
+
const deleteUserByID = async (userId, options) => {
|
|
363
|
+
return customFetch(getDeleteUserByIDUrl(userId), {
|
|
339
364
|
...options,
|
|
340
365
|
method: "DELETE"
|
|
341
366
|
});
|
|
@@ -357,19 +382,61 @@ const listUserPasskeys = async (userId, params, options) => {
|
|
|
357
382
|
method: "GET"
|
|
358
383
|
});
|
|
359
384
|
};
|
|
360
|
-
const
|
|
361
|
-
|
|
362
|
-
|
|
363
|
-
|
|
385
|
+
const getBeginUserPasskeyRegistrationUrl = (userId) => {
|
|
386
|
+
return `${getProxyPath()}/users/${userId}/passkeys/registrations`;
|
|
387
|
+
};
|
|
388
|
+
/**
|
|
389
|
+
* Starts a WebAuthn registration ceremony for the user and returns the
|
|
390
|
+
creation options for `navigator.credentials.create()`. Complete the
|
|
391
|
+
ceremony with `POST /users/{user_id}/passkeys/registrations/{registration_id}` within
|
|
392
|
+
five minutes. Credentials already registered for the user are excluded
|
|
393
|
+
automatically.
|
|
394
|
+
|
|
395
|
+
* @summary Begin passkey registration
|
|
396
|
+
*/
|
|
397
|
+
const beginUserPasskeyRegistration = async (userId, beginUserPasskeyRegistrationBody, options) => {
|
|
398
|
+
return customFetch(getBeginUserPasskeyRegistrationUrl(userId), {
|
|
399
|
+
...options,
|
|
400
|
+
method: "POST",
|
|
401
|
+
headers: {
|
|
402
|
+
"Content-Type": "application/json",
|
|
403
|
+
...options?.headers
|
|
404
|
+
},
|
|
405
|
+
body: JSON.stringify(beginUserPasskeyRegistrationBody)
|
|
364
406
|
});
|
|
365
|
-
|
|
366
|
-
|
|
407
|
+
};
|
|
408
|
+
const getFinishUserPasskeyRegistrationUrl = (userId, registrationId) => {
|
|
409
|
+
return `${getProxyPath()}/users/${userId}/passkeys/registrations/${registrationId}`;
|
|
410
|
+
};
|
|
411
|
+
/**
|
|
412
|
+
* Verifies the attestation against the ceremony started by
|
|
413
|
+
`POST /users/{user_id}/passkeys/registrations` and persists the new credential. A
|
|
414
|
+
rejected attestation counts against the ceremony's failure budget and the
|
|
415
|
+
ceremony stays open for a retry. An expired ceremony surfaces as
|
|
416
|
+
`att.stale_challenge`; an unknown or already-consumed registration id
|
|
417
|
+
surfaces as `att.not_found`.
|
|
418
|
+
|
|
419
|
+
* @summary Finish passkey registration
|
|
420
|
+
*/
|
|
421
|
+
const finishUserPasskeyRegistration = async (userId, registrationId, finishUserPasskeyRegistrationBody, options) => {
|
|
422
|
+
return customFetch(getFinishUserPasskeyRegistrationUrl(userId, registrationId), {
|
|
423
|
+
...options,
|
|
424
|
+
method: "POST",
|
|
425
|
+
headers: {
|
|
426
|
+
"Content-Type": "application/json",
|
|
427
|
+
...options?.headers
|
|
428
|
+
},
|
|
429
|
+
body: JSON.stringify(finishUserPasskeyRegistrationBody)
|
|
430
|
+
});
|
|
431
|
+
};
|
|
432
|
+
const getSetUserPasswordUrl = (userId) => {
|
|
433
|
+
return `${getProxyPath()}/users/${userId}/password`;
|
|
367
434
|
};
|
|
368
435
|
/**
|
|
369
436
|
* @summary Set user password
|
|
370
437
|
*/
|
|
371
|
-
const setUserPassword = async (userId, setUserPasswordBody,
|
|
372
|
-
return customFetch(getSetUserPasswordUrl(userId
|
|
438
|
+
const setUserPassword = async (userId, setUserPasswordBody, options) => {
|
|
439
|
+
return customFetch(getSetUserPasswordUrl(userId), {
|
|
373
440
|
...options,
|
|
374
441
|
method: "PUT",
|
|
375
442
|
headers: {
|
|
@@ -859,13 +926,8 @@ const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
|
|
|
859
926
|
body: JSON.stringify(exchangeHandoffBody)
|
|
860
927
|
});
|
|
861
928
|
};
|
|
862
|
-
const getGetSessionUrl = (sessionId
|
|
863
|
-
|
|
864
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
865
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
866
|
-
});
|
|
867
|
-
const stringifiedParams = normalizedParams.toString();
|
|
868
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
|
|
929
|
+
const getGetSessionUrl = (sessionId) => {
|
|
930
|
+
return `${getProxyPath()}/sessions/${sessionId}`;
|
|
869
931
|
};
|
|
870
932
|
/**
|
|
871
933
|
* Returns the current state of a session including its factors and all currently
|
|
@@ -877,19 +939,14 @@ against the same `session_id`) to restore a dropped assurance level.
|
|
|
877
939
|
|
|
878
940
|
* @summary Get session state
|
|
879
941
|
*/
|
|
880
|
-
const getSession = async (sessionId,
|
|
881
|
-
return customFetch(getGetSessionUrl(sessionId
|
|
942
|
+
const getSession = async (sessionId, options) => {
|
|
943
|
+
return customFetch(getGetSessionUrl(sessionId), {
|
|
882
944
|
...options,
|
|
883
945
|
method: "GET"
|
|
884
946
|
});
|
|
885
947
|
};
|
|
886
|
-
const getRevokeSessionUrl = (sessionId
|
|
887
|
-
|
|
888
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
889
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
890
|
-
});
|
|
891
|
-
const stringifiedParams = normalizedParams.toString();
|
|
892
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
|
|
948
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
949
|
+
return `${getProxyPath()}/sessions/${sessionId}`;
|
|
893
950
|
};
|
|
894
951
|
/**
|
|
895
952
|
* Permanently deletes the session, terminating it immediately.
|
|
@@ -904,8 +961,8 @@ invalidated.
|
|
|
904
961
|
|
|
905
962
|
* @summary Revoke session
|
|
906
963
|
*/
|
|
907
|
-
const revokeSession = async (sessionId,
|
|
908
|
-
return customFetch(getRevokeSessionUrl(sessionId
|
|
964
|
+
const revokeSession = async (sessionId, options) => {
|
|
965
|
+
return customFetch(getRevokeSessionUrl(sessionId), {
|
|
909
966
|
...options,
|
|
910
967
|
method: "DELETE"
|
|
911
968
|
});
|
|
@@ -1009,7 +1066,10 @@ const getGetSchemaByIdUrl = (id, params) => {
|
|
|
1009
1066
|
return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas/${id}?${stringifiedParams}` : `${getProxyPath()}/schemas/${id}`;
|
|
1010
1067
|
};
|
|
1011
1068
|
/**
|
|
1012
|
-
* Get a schema by its ID.
|
|
1069
|
+
* Get a schema by its ID. A schema ID identifies one immutable revision, so
|
|
1070
|
+
this returns exactly that revision. To find the current revision of an
|
|
1071
|
+
object type, list with `revisions=latest`.
|
|
1072
|
+
|
|
1013
1073
|
* @summary Get schema by ID
|
|
1014
1074
|
*/
|
|
1015
1075
|
const getSchemaById = async (id, params, options) => {
|
|
@@ -1061,31 +1121,21 @@ const listFlowDefinitions = async (params, options) => {
|
|
|
1061
1121
|
method: "GET"
|
|
1062
1122
|
});
|
|
1063
1123
|
};
|
|
1064
|
-
const getGetFlowDefinitionUrl = (id
|
|
1065
|
-
|
|
1066
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1067
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1068
|
-
});
|
|
1069
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1070
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1124
|
+
const getGetFlowDefinitionUrl = (id) => {
|
|
1125
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1071
1126
|
};
|
|
1072
1127
|
/**
|
|
1073
1128
|
* Get a flow definition by id
|
|
1074
1129
|
* @summary Get a flow definition by id
|
|
1075
1130
|
*/
|
|
1076
|
-
const getFlowDefinition = async (id,
|
|
1077
|
-
return customFetch(getGetFlowDefinitionUrl(id
|
|
1131
|
+
const getFlowDefinition = async (id, options) => {
|
|
1132
|
+
return customFetch(getGetFlowDefinitionUrl(id), {
|
|
1078
1133
|
...options,
|
|
1079
1134
|
method: "GET"
|
|
1080
1135
|
});
|
|
1081
1136
|
};
|
|
1082
|
-
const getUpdateFlowDefinitionUrl = (id
|
|
1083
|
-
|
|
1084
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1085
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1086
|
-
});
|
|
1087
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1088
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1137
|
+
const getUpdateFlowDefinitionUrl = (id) => {
|
|
1138
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1089
1139
|
};
|
|
1090
1140
|
/**
|
|
1091
1141
|
* Update a flow definition by id. This endpoint replaces the existing flow definition.
|
|
@@ -1093,8 +1143,8 @@ If `flow_definition.status` is omitted, the current status is preserved
|
|
|
1093
1143
|
|
|
1094
1144
|
* @summary Update a flow definition by id
|
|
1095
1145
|
*/
|
|
1096
|
-
const updateFlowDefinition = async (id, updateFlowDefinitionBody,
|
|
1097
|
-
return customFetch(getUpdateFlowDefinitionUrl(id
|
|
1146
|
+
const updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {
|
|
1147
|
+
return customFetch(getUpdateFlowDefinitionUrl(id), {
|
|
1098
1148
|
...options,
|
|
1099
1149
|
method: "PUT",
|
|
1100
1150
|
headers: {
|
|
@@ -1104,13 +1154,8 @@ const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, option
|
|
|
1104
1154
|
body: JSON.stringify(updateFlowDefinitionBody)
|
|
1105
1155
|
});
|
|
1106
1156
|
};
|
|
1107
|
-
const getDeleteFlowDefinitionUrl = (id
|
|
1108
|
-
|
|
1109
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1110
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1111
|
-
});
|
|
1112
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1113
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1157
|
+
const getDeleteFlowDefinitionUrl = (id) => {
|
|
1158
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1114
1159
|
};
|
|
1115
1160
|
/**
|
|
1116
1161
|
* Delete a flow definition by id.
|
|
@@ -1119,8 +1164,8 @@ If the flow definition is the last active flow definition for a given purpose, t
|
|
|
1119
1164
|
|
|
1120
1165
|
* @summary Delete a flow definition by id
|
|
1121
1166
|
*/
|
|
1122
|
-
const deleteFlowDefinition = async (id,
|
|
1123
|
-
return customFetch(getDeleteFlowDefinitionUrl(id
|
|
1167
|
+
const deleteFlowDefinition = async (id, options) => {
|
|
1168
|
+
return customFetch(getDeleteFlowDefinitionUrl(id), {
|
|
1124
1169
|
...options,
|
|
1125
1170
|
method: "DELETE"
|
|
1126
1171
|
});
|
|
@@ -1157,7 +1202,6 @@ const getQueryTeamsUrl = (params) => {
|
|
|
1157
1202
|
};
|
|
1158
1203
|
/**
|
|
1159
1204
|
* Returns the teams of a project, paginated with a cursor.
|
|
1160
|
-
Teams of every lifecycle status are returned; each carries its `status`.
|
|
1161
1205
|
|
|
1162
1206
|
* @summary Query teams
|
|
1163
1207
|
*/
|
|
@@ -1172,32 +1216,22 @@ const queryTeams = async (queryTeamsBody, params, options) => {
|
|
|
1172
1216
|
body: JSON.stringify(queryTeamsBody)
|
|
1173
1217
|
});
|
|
1174
1218
|
};
|
|
1175
|
-
const getGetTeamUrl = (teamId
|
|
1176
|
-
|
|
1177
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1178
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1179
|
-
});
|
|
1180
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1181
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
|
|
1219
|
+
const getGetTeamUrl = (teamId) => {
|
|
1220
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1182
1221
|
};
|
|
1183
1222
|
/**
|
|
1184
1223
|
* Returns a Team by its id.
|
|
1185
1224
|
|
|
1186
1225
|
* @summary Get team
|
|
1187
1226
|
*/
|
|
1188
|
-
const getTeam = async (teamId,
|
|
1189
|
-
return customFetch(getGetTeamUrl(teamId
|
|
1227
|
+
const getTeam = async (teamId, options) => {
|
|
1228
|
+
return customFetch(getGetTeamUrl(teamId), {
|
|
1190
1229
|
...options,
|
|
1191
1230
|
method: "GET"
|
|
1192
1231
|
});
|
|
1193
1232
|
};
|
|
1194
|
-
const getDeleteTeamUrl = (teamId
|
|
1195
|
-
|
|
1196
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1197
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1198
|
-
});
|
|
1199
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1200
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
|
|
1233
|
+
const getDeleteTeamUrl = (teamId) => {
|
|
1234
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1201
1235
|
};
|
|
1202
1236
|
/**
|
|
1203
1237
|
* Deactivates the team.
|
|
@@ -1211,27 +1245,22 @@ or doesn't exist succeeds without changing anything.
|
|
|
1211
1245
|
|
|
1212
1246
|
* @summary Delete team
|
|
1213
1247
|
*/
|
|
1214
|
-
const deleteTeam = async (teamId,
|
|
1215
|
-
return customFetch(getDeleteTeamUrl(teamId
|
|
1248
|
+
const deleteTeam = async (teamId, options) => {
|
|
1249
|
+
return customFetch(getDeleteTeamUrl(teamId), {
|
|
1216
1250
|
...options,
|
|
1217
1251
|
method: "DELETE"
|
|
1218
1252
|
});
|
|
1219
1253
|
};
|
|
1220
|
-
const getUpdateTeamUrl = (teamId
|
|
1221
|
-
|
|
1222
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1223
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1224
|
-
});
|
|
1225
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1226
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
|
|
1254
|
+
const getUpdateTeamUrl = (teamId) => {
|
|
1255
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1227
1256
|
};
|
|
1228
1257
|
/**
|
|
1229
1258
|
* Update team. Only active teams can be updated.
|
|
1230
1259
|
|
|
1231
1260
|
* @summary Update team
|
|
1232
1261
|
*/
|
|
1233
|
-
const updateTeam = async (teamId, updateTeamBody,
|
|
1234
|
-
return customFetch(getUpdateTeamUrl(teamId
|
|
1262
|
+
const updateTeam = async (teamId, updateTeamBody, options) => {
|
|
1263
|
+
return customFetch(getUpdateTeamUrl(teamId), {
|
|
1235
1264
|
...options,
|
|
1236
1265
|
method: "PATCH",
|
|
1237
1266
|
headers: {
|
|
@@ -1241,6 +1270,47 @@ const updateTeam = async (teamId, updateTeamBody, params, options) => {
|
|
|
1241
1270
|
body: JSON.stringify(updateTeamBody)
|
|
1242
1271
|
});
|
|
1243
1272
|
};
|
|
1273
|
+
const getListEnvironmentsUrl = (params) => {
|
|
1274
|
+
const normalizedParams = new URLSearchParams();
|
|
1275
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1276
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1277
|
+
});
|
|
1278
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1279
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/environments?${stringifiedParams}` : `${getProxyPath()}/environments`;
|
|
1280
|
+
};
|
|
1281
|
+
/**
|
|
1282
|
+
* Lists the project's environments ordered by name.
|
|
1283
|
+
|
|
1284
|
+
* @summary List environments
|
|
1285
|
+
*/
|
|
1286
|
+
const listEnvironments = async (params, options) => {
|
|
1287
|
+
return customFetch(getListEnvironmentsUrl(params), {
|
|
1288
|
+
...options,
|
|
1289
|
+
method: "GET"
|
|
1290
|
+
});
|
|
1291
|
+
};
|
|
1292
|
+
const getGetEnvironmentByNameUrl = (name, params) => {
|
|
1293
|
+
const normalizedParams = new URLSearchParams();
|
|
1294
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1295
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1296
|
+
});
|
|
1297
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1298
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/environments/${name}?${stringifiedParams}` : `${getProxyPath()}/environments/${name}`;
|
|
1299
|
+
};
|
|
1300
|
+
/**
|
|
1301
|
+
* Reads one environment of the project by its name.
|
|
1302
|
+
|
|
1303
|
+
The lookup is scoped to the project in `project_id`: a name that exists in
|
|
1304
|
+
another project answers `env.not_found` exactly as an unused name does.
|
|
1305
|
+
|
|
1306
|
+
* @summary Get an environment by name
|
|
1307
|
+
*/
|
|
1308
|
+
const getEnvironmentByName = async (name, params, options) => {
|
|
1309
|
+
return customFetch(getGetEnvironmentByNameUrl(name, params), {
|
|
1310
|
+
...options,
|
|
1311
|
+
method: "GET"
|
|
1312
|
+
});
|
|
1313
|
+
};
|
|
1244
1314
|
const getCreateBrandingUrl = (params) => {
|
|
1245
1315
|
const normalizedParams = new URLSearchParams();
|
|
1246
1316
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -1296,20 +1366,238 @@ const listBranding = async (params, options) => {
|
|
|
1296
1366
|
method: "GET"
|
|
1297
1367
|
});
|
|
1298
1368
|
};
|
|
1299
|
-
const getGetBrandingByIdUrl = (id
|
|
1369
|
+
const getGetBrandingByIdUrl = (id) => {
|
|
1370
|
+
return `${getProxyPath()}/branding/${id}`;
|
|
1371
|
+
};
|
|
1372
|
+
/**
|
|
1373
|
+
* Retrieves a single branding revision, including its stored configuration.
|
|
1374
|
+
* @summary Get a branding revision by ID
|
|
1375
|
+
*/
|
|
1376
|
+
const getBrandingById = async (id, options) => {
|
|
1377
|
+
return customFetch(getGetBrandingByIdUrl(id), {
|
|
1378
|
+
...options,
|
|
1379
|
+
method: "GET"
|
|
1380
|
+
});
|
|
1381
|
+
};
|
|
1382
|
+
const getCreateReleaseUrl = (params) => {
|
|
1300
1383
|
const normalizedParams = new URLSearchParams();
|
|
1301
1384
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1302
1385
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1303
1386
|
});
|
|
1304
1387
|
const stringifiedParams = normalizedParams.toString();
|
|
1305
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/
|
|
1388
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/releases?${stringifiedParams}` : `${getProxyPath()}/releases`;
|
|
1306
1389
|
};
|
|
1307
1390
|
/**
|
|
1308
|
-
*
|
|
1309
|
-
|
|
1391
|
+
* Bundles a release from revisions that already exist, supplied as
|
|
1392
|
+
`(kind, revision_id)` pairs. No new revisions are allocated — use the
|
|
1393
|
+
per-kind create endpoints for that, then pin the ids here.
|
|
1394
|
+
|
|
1395
|
+
Every referenced `revision_id` must exist in the project. Each one's handle
|
|
1396
|
+
is read from the revision itself and recorded on the release, so a resource
|
|
1397
|
+
is always pinned under the identity it declares.
|
|
1398
|
+
|
|
1399
|
+
Creating a release does not deploy it. A release is environment-agnostic
|
|
1400
|
+
and the same release can later be deployed to any number of environments
|
|
1401
|
+
unchanged.
|
|
1402
|
+
|
|
1403
|
+
Idempotent on the pinned set: metadata is excluded from the comparison, so
|
|
1404
|
+
re-submitting the same revisions with a different `message` returns the
|
|
1405
|
+
release that already pins them rather than creating a second one.
|
|
1406
|
+
|
|
1407
|
+
* @summary Create a release
|
|
1310
1408
|
*/
|
|
1311
|
-
const
|
|
1312
|
-
return customFetch(
|
|
1409
|
+
const createRelease = async (createReleaseBody, params, options) => {
|
|
1410
|
+
return customFetch(getCreateReleaseUrl(params), {
|
|
1411
|
+
...options,
|
|
1412
|
+
method: "POST",
|
|
1413
|
+
headers: {
|
|
1414
|
+
"Content-Type": "application/json",
|
|
1415
|
+
...options?.headers
|
|
1416
|
+
},
|
|
1417
|
+
body: JSON.stringify(createReleaseBody)
|
|
1418
|
+
});
|
|
1419
|
+
};
|
|
1420
|
+
const getListReleasesUrl = (params) => {
|
|
1421
|
+
const normalizedParams = new URLSearchParams();
|
|
1422
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1423
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1424
|
+
});
|
|
1425
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1426
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/releases?${stringifiedParams}` : `${getProxyPath()}/releases`;
|
|
1427
|
+
};
|
|
1428
|
+
/**
|
|
1429
|
+
* Lists the project's releases, newest first.
|
|
1430
|
+
|
|
1431
|
+
Entries carry metadata only — the pinned set is omitted. Read one release
|
|
1432
|
+
with `GET /releases/{release_id}` to get its pointers.
|
|
1433
|
+
|
|
1434
|
+
* @summary List releases
|
|
1435
|
+
*/
|
|
1436
|
+
const listReleases = async (params, options) => {
|
|
1437
|
+
return customFetch(getListReleasesUrl(params), {
|
|
1438
|
+
...options,
|
|
1439
|
+
method: "GET"
|
|
1440
|
+
});
|
|
1441
|
+
};
|
|
1442
|
+
const getGetReleaseByIdUrl = (releaseId, params) => {
|
|
1443
|
+
const normalizedParams = new URLSearchParams();
|
|
1444
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1445
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1446
|
+
});
|
|
1447
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1448
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/releases/${releaseId}?${stringifiedParams}` : `${getProxyPath()}/releases/${releaseId}`;
|
|
1449
|
+
};
|
|
1450
|
+
/**
|
|
1451
|
+
* Reads one release: its metadata and the `(kind, handle, revision_id)`
|
|
1452
|
+
tuples it pins.
|
|
1453
|
+
|
|
1454
|
+
Does not embed resource content. Resolve each `revision_id` through the
|
|
1455
|
+
per-kind read endpoints when the bytes are needed.
|
|
1456
|
+
|
|
1457
|
+
The lookup is scoped to the project in `project_id`: a release id belonging
|
|
1458
|
+
to another project answers not found exactly as an unknown id does, so the
|
|
1459
|
+
endpoint cannot be used to probe for releases in projects the caller cannot
|
|
1460
|
+
read.
|
|
1461
|
+
|
|
1462
|
+
* @summary Get a release by id
|
|
1463
|
+
*/
|
|
1464
|
+
const getReleaseById = async (releaseId, params, options) => {
|
|
1465
|
+
return customFetch(getGetReleaseByIdUrl(releaseId, params), {
|
|
1466
|
+
...options,
|
|
1467
|
+
method: "GET"
|
|
1468
|
+
});
|
|
1469
|
+
};
|
|
1470
|
+
const getCreateGrantUrl = (params) => {
|
|
1471
|
+
const normalizedParams = new URLSearchParams();
|
|
1472
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1473
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1474
|
+
});
|
|
1475
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1476
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/grants?${stringifiedParams}` : `${getProxyPath()}/grants`;
|
|
1477
|
+
};
|
|
1478
|
+
/**
|
|
1479
|
+
* Bind a user or team to `project.viewer`, `project.editor`, or
|
|
1480
|
+
`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.
|
|
1485
|
+
|
|
1486
|
+
* @summary Create grant
|
|
1487
|
+
*/
|
|
1488
|
+
const createGrant = async (createGrantBody, params, options) => {
|
|
1489
|
+
return customFetch(getCreateGrantUrl(params), {
|
|
1490
|
+
...options,
|
|
1491
|
+
method: "POST",
|
|
1492
|
+
headers: {
|
|
1493
|
+
"Content-Type": "application/json",
|
|
1494
|
+
...options?.headers
|
|
1495
|
+
},
|
|
1496
|
+
body: JSON.stringify(createGrantBody)
|
|
1497
|
+
});
|
|
1498
|
+
};
|
|
1499
|
+
const getGetGrantUrl = (id, params) => {
|
|
1500
|
+
const normalizedParams = new URLSearchParams();
|
|
1501
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1502
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1503
|
+
});
|
|
1504
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1505
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/grants/${id}?${stringifiedParams}` : `${getProxyPath()}/grants/${id}`;
|
|
1506
|
+
};
|
|
1507
|
+
/**
|
|
1508
|
+
* Loads a grant by `(project_id, id)` that this API manages (user or team
|
|
1509
|
+
bound to viewer, editor, or admin) and that has not been revoked.
|
|
1510
|
+
"Active" here means not revoked: expired grants stay visible so the
|
|
1511
|
+
client can DELETE before re-granting the same binding. Authorization
|
|
1512
|
+
still ignores expired grants. Grants are not registered in
|
|
1513
|
+
`resource_scope_index`; project scope is required on the query (same as
|
|
1514
|
+
events). Misses, revoked rows, project-secret setup (`sk_proj`),
|
|
1515
|
+
owning-team (`relation=team`) rows, and cross-project ids return 404.
|
|
1516
|
+
|
|
1517
|
+
* @summary Get grant
|
|
1518
|
+
*/
|
|
1519
|
+
const getGrant = async (id, params, options) => {
|
|
1520
|
+
return customFetch(getGetGrantUrl(id, params), {
|
|
1521
|
+
...options,
|
|
1522
|
+
method: "GET"
|
|
1523
|
+
});
|
|
1524
|
+
};
|
|
1525
|
+
const getDeleteGrantUrl = (id, params) => {
|
|
1526
|
+
const normalizedParams = new URLSearchParams();
|
|
1527
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1528
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1529
|
+
});
|
|
1530
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1531
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/grants/${id}?${stringifiedParams}` : `${getProxyPath()}/grants/${id}`;
|
|
1532
|
+
};
|
|
1533
|
+
/**
|
|
1534
|
+
* Soft-revokes a grant this API manages and emits `authz.revoked`.
|
|
1535
|
+
Already-revoked, missing, project-secret setup, and owning-team grants
|
|
1536
|
+
return 404. The row is not un-revoked. Expired grants can still be
|
|
1537
|
+
revoked so the unique binding can be reused.
|
|
1538
|
+
|
|
1539
|
+
* @summary Revoke grant
|
|
1540
|
+
*/
|
|
1541
|
+
const deleteGrant = async (id, params, options) => {
|
|
1542
|
+
return customFetch(getDeleteGrantUrl(id, params), {
|
|
1543
|
+
...options,
|
|
1544
|
+
method: "DELETE"
|
|
1545
|
+
});
|
|
1546
|
+
};
|
|
1547
|
+
const getListEventsUrl = (params) => {
|
|
1548
|
+
const normalizedParams = new URLSearchParams();
|
|
1549
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1550
|
+
if (Array.isArray(value) && ["category", "event_type"].includes(key)) {
|
|
1551
|
+
value.forEach((v) => {
|
|
1552
|
+
normalizedParams.append(key, v === null ? "null" : v.toString());
|
|
1553
|
+
});
|
|
1554
|
+
return;
|
|
1555
|
+
}
|
|
1556
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1557
|
+
});
|
|
1558
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1559
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/events?${stringifiedParams}` : `${getProxyPath()}/events`;
|
|
1560
|
+
};
|
|
1561
|
+
/**
|
|
1562
|
+
* Returns project-scoped audit events, newest-first by keyset on
|
|
1563
|
+
`(created_at, id)` (ADR 027 / ADR 049). Pass `order=asc` for oldest-first.
|
|
1564
|
+
Requires `events.read`.
|
|
1565
|
+
|
|
1566
|
+
Pre-claim projects return an empty list (events are stored but not
|
|
1567
|
+
visible until claim succeeds). Team-scoped credentials see only events
|
|
1568
|
+
whose emit-time `team_id` matches the credential team (enforced when
|
|
1569
|
+
team-scoped tokens exist).
|
|
1570
|
+
|
|
1571
|
+
Clients discriminate each item via `event_type` (OpenAPI Event oneOf) —
|
|
1572
|
+
see docs/design/api/events-catalog.md.
|
|
1573
|
+
|
|
1574
|
+
* @summary List events
|
|
1575
|
+
*/
|
|
1576
|
+
const listEvents = async (params, options) => {
|
|
1577
|
+
return customFetch(getListEventsUrl(params), {
|
|
1578
|
+
...options,
|
|
1579
|
+
method: "GET"
|
|
1580
|
+
});
|
|
1581
|
+
};
|
|
1582
|
+
const getGetEventUrl = (id, params) => {
|
|
1583
|
+
const normalizedParams = new URLSearchParams();
|
|
1584
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1585
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1586
|
+
});
|
|
1587
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1588
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/events/${id}?${stringifiedParams}` : `${getProxyPath()}/events/${id}`;
|
|
1589
|
+
};
|
|
1590
|
+
/**
|
|
1591
|
+
* Loads a single event by `(project_id, id)`. Requires `events.read`.
|
|
1592
|
+
Events are not registered in `resource_scope_index`; project scope is
|
|
1593
|
+
required on the query (ADR 049). Misses and cross-project ids return 404.
|
|
1594
|
+
|
|
1595
|
+
Pre-claim projects return 404 (stored events stay invisible until claim).
|
|
1596
|
+
|
|
1597
|
+
* @summary Get event by ID
|
|
1598
|
+
*/
|
|
1599
|
+
const getEvent = async (id, params, options) => {
|
|
1600
|
+
return customFetch(getGetEventUrl(id, params), {
|
|
1313
1601
|
...options,
|
|
1314
1602
|
method: "GET"
|
|
1315
1603
|
});
|
|
@@ -1357,7 +1645,7 @@ function createZitadelClient(opts) {
|
|
|
1357
1645
|
} });
|
|
1358
1646
|
}
|
|
1359
1647
|
//#endregion
|
|
1360
|
-
//#region ../config/dist/defaults-
|
|
1648
|
+
//#region ../config/dist/defaults-DPq0o3iU.mjs
|
|
1361
1649
|
var default_human_user_default = {
|
|
1362
1650
|
title: "DefaultHumanUserSchema",
|
|
1363
1651
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -1366,16 +1654,11 @@ var default_human_user_default = {
|
|
|
1366
1654
|
objectType: "human-user",
|
|
1367
1655
|
kind: "user-schema",
|
|
1368
1656
|
type: "object",
|
|
1657
|
+
"x-identifier": "email",
|
|
1369
1658
|
description: "The default editable schema for human users.",
|
|
1370
1659
|
"x-auth-methods": {
|
|
1371
|
-
"password": {
|
|
1372
|
-
|
|
1373
|
-
"position": 1
|
|
1374
|
-
},
|
|
1375
|
-
"passkey": {
|
|
1376
|
-
"enabled": true,
|
|
1377
|
-
"position": 2
|
|
1378
|
-
}
|
|
1660
|
+
"password": { "enabled": true },
|
|
1661
|
+
"passkey": { "enabled": true }
|
|
1379
1662
|
},
|
|
1380
1663
|
required: ["email"],
|
|
1381
1664
|
properties: { "email": {
|
|
@@ -1398,21 +1681,34 @@ var default_login_default = {
|
|
|
1398
1681
|
{
|
|
1399
1682
|
"name": "identifier",
|
|
1400
1683
|
"fields": ["email"],
|
|
1401
|
-
"actions": [
|
|
1402
|
-
|
|
1403
|
-
|
|
1404
|
-
|
|
1405
|
-
|
|
1406
|
-
|
|
1407
|
-
|
|
1408
|
-
|
|
1409
|
-
|
|
1410
|
-
|
|
1411
|
-
|
|
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
|
+
],
|
|
1412
1704
|
"transitions": {
|
|
1413
1705
|
"submit": { "target": "password" },
|
|
1414
1706
|
"passkey": { "target": "done" },
|
|
1415
|
-
"user_not_found": { "target": "register" }
|
|
1707
|
+
"user_not_found": { "target": "register" },
|
|
1708
|
+
"register": {
|
|
1709
|
+
"target": "register",
|
|
1710
|
+
"purpose": "register"
|
|
1711
|
+
}
|
|
1416
1712
|
}
|
|
1417
1713
|
},
|
|
1418
1714
|
{
|
|
@@ -1437,21 +1733,34 @@ var default_login_default = {
|
|
|
1437
1733
|
{
|
|
1438
1734
|
"name": "register",
|
|
1439
1735
|
"fields": ["email"],
|
|
1440
|
-
"actions": [
|
|
1441
|
-
|
|
1442
|
-
|
|
1443
|
-
|
|
1444
|
-
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
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
|
+
],
|
|
1451
1756
|
"transitions": {
|
|
1452
1757
|
"submit": { "target": "register-password" },
|
|
1453
1758
|
"passkey_register": { "target": "done" },
|
|
1454
|
-
"user_already_exists": { "target": "password" }
|
|
1759
|
+
"user_already_exists": { "target": "password" },
|
|
1760
|
+
"sign_in": {
|
|
1761
|
+
"target": "identifier",
|
|
1762
|
+
"purpose": "login"
|
|
1763
|
+
}
|
|
1455
1764
|
}
|
|
1456
1765
|
},
|
|
1457
1766
|
{
|
|
@@ -1483,16 +1792,11 @@ var human_user_default = {
|
|
|
1483
1792
|
objectType: "human-user",
|
|
1484
1793
|
kind: "user-schema",
|
|
1485
1794
|
type: "object",
|
|
1795
|
+
"x-identifier": "email",
|
|
1486
1796
|
description: "The default editable schema for human users (passkey-first sign-in).",
|
|
1487
1797
|
"x-auth-methods": {
|
|
1488
|
-
"passkey": {
|
|
1489
|
-
|
|
1490
|
-
"position": 1
|
|
1491
|
-
},
|
|
1492
|
-
"password": {
|
|
1493
|
-
"enabled": true,
|
|
1494
|
-
"position": 2
|
|
1495
|
-
}
|
|
1798
|
+
"passkey": { "enabled": true },
|
|
1799
|
+
"password": { "enabled": true }
|
|
1496
1800
|
},
|
|
1497
1801
|
required: ["email"],
|
|
1498
1802
|
properties: { "email": {
|
|
@@ -1515,41 +1819,67 @@ var login_default = {
|
|
|
1515
1819
|
{
|
|
1516
1820
|
"name": "passkey-first",
|
|
1517
1821
|
"fields": [],
|
|
1518
|
-
"actions": [
|
|
1519
|
-
|
|
1520
|
-
|
|
1521
|
-
|
|
1522
|
-
|
|
1523
|
-
|
|
1524
|
-
|
|
1525
|
-
|
|
1526
|
-
|
|
1527
|
-
|
|
1528
|
-
|
|
1822
|
+
"actions": [
|
|
1823
|
+
{
|
|
1824
|
+
"name": "passkey",
|
|
1825
|
+
"kind": "passkey",
|
|
1826
|
+
"primary": true,
|
|
1827
|
+
"text_key": "passkey-first.action.passkey"
|
|
1828
|
+
},
|
|
1829
|
+
{
|
|
1830
|
+
"name": "email_fallback",
|
|
1831
|
+
"kind": "navigate",
|
|
1832
|
+
"primary": false,
|
|
1833
|
+
"text_key": "passkey-first.action.email_fallback"
|
|
1834
|
+
},
|
|
1835
|
+
{
|
|
1836
|
+
"name": "register",
|
|
1837
|
+
"kind": "navigate",
|
|
1838
|
+
"primary": false,
|
|
1839
|
+
"text_key": "identifier.action.register.link"
|
|
1840
|
+
}
|
|
1841
|
+
],
|
|
1529
1842
|
"transitions": {
|
|
1530
1843
|
"passkey": { "target": "done" },
|
|
1531
1844
|
"email_fallback": { "target": "identifier" },
|
|
1532
|
-
"user_not_found": { "target": "register" }
|
|
1845
|
+
"user_not_found": { "target": "register" },
|
|
1846
|
+
"register": {
|
|
1847
|
+
"target": "register",
|
|
1848
|
+
"purpose": "register"
|
|
1849
|
+
}
|
|
1533
1850
|
}
|
|
1534
1851
|
},
|
|
1535
1852
|
{
|
|
1536
1853
|
"name": "identifier",
|
|
1537
1854
|
"fields": ["email"],
|
|
1538
|
-
"actions": [
|
|
1539
|
-
|
|
1540
|
-
|
|
1541
|
-
|
|
1542
|
-
|
|
1543
|
-
|
|
1544
|
-
|
|
1545
|
-
|
|
1546
|
-
|
|
1547
|
-
|
|
1548
|
-
|
|
1855
|
+
"actions": [
|
|
1856
|
+
{
|
|
1857
|
+
"name": "submit",
|
|
1858
|
+
"kind": "submit",
|
|
1859
|
+
"primary": true,
|
|
1860
|
+
"text_key": "identifier.action.continue"
|
|
1861
|
+
},
|
|
1862
|
+
{
|
|
1863
|
+
"name": "passkey",
|
|
1864
|
+
"kind": "passkey",
|
|
1865
|
+
"primary": false,
|
|
1866
|
+
"text_key": "identifier.action.passkey"
|
|
1867
|
+
},
|
|
1868
|
+
{
|
|
1869
|
+
"name": "register",
|
|
1870
|
+
"kind": "navigate",
|
|
1871
|
+
"primary": false,
|
|
1872
|
+
"text_key": "identifier.action.register.link"
|
|
1873
|
+
}
|
|
1874
|
+
],
|
|
1549
1875
|
"transitions": {
|
|
1550
1876
|
"submit": { "target": "password" },
|
|
1551
1877
|
"passkey": { "target": "done" },
|
|
1552
|
-
"user_not_found": { "target": "register" }
|
|
1878
|
+
"user_not_found": { "target": "register" },
|
|
1879
|
+
"register": {
|
|
1880
|
+
"target": "register",
|
|
1881
|
+
"purpose": "register"
|
|
1882
|
+
}
|
|
1553
1883
|
}
|
|
1554
1884
|
},
|
|
1555
1885
|
{
|
|
@@ -1574,21 +1904,34 @@ var login_default = {
|
|
|
1574
1904
|
{
|
|
1575
1905
|
"name": "register",
|
|
1576
1906
|
"fields": ["email"],
|
|
1577
|
-
"actions": [
|
|
1578
|
-
|
|
1579
|
-
|
|
1580
|
-
|
|
1581
|
-
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1907
|
+
"actions": [
|
|
1908
|
+
{
|
|
1909
|
+
"name": "passkey_register",
|
|
1910
|
+
"kind": "passkey_register",
|
|
1911
|
+
"primary": true,
|
|
1912
|
+
"text_key": "register.action.passkey"
|
|
1913
|
+
},
|
|
1914
|
+
{
|
|
1915
|
+
"name": "submit",
|
|
1916
|
+
"kind": "submit",
|
|
1917
|
+
"primary": false,
|
|
1918
|
+
"text_key": "register.action.password"
|
|
1919
|
+
},
|
|
1920
|
+
{
|
|
1921
|
+
"name": "sign_in",
|
|
1922
|
+
"kind": "navigate",
|
|
1923
|
+
"primary": false,
|
|
1924
|
+
"text_key": "register.action.sign_in.link"
|
|
1925
|
+
}
|
|
1926
|
+
],
|
|
1588
1927
|
"transitions": {
|
|
1589
1928
|
"passkey_register": { "target": "done" },
|
|
1590
1929
|
"submit": { "target": "register-password" },
|
|
1591
|
-
"user_already_exists": { "target": "password" }
|
|
1930
|
+
"user_already_exists": { "target": "password" },
|
|
1931
|
+
"sign_in": {
|
|
1932
|
+
"target": "passkey-first",
|
|
1933
|
+
"purpose": "login"
|
|
1934
|
+
}
|
|
1592
1935
|
}
|
|
1593
1936
|
},
|
|
1594
1937
|
{
|
|
@@ -2051,8 +2394,9 @@ function identity() {
|
|
|
2051
2394
|
}
|
|
2052
2395
|
/**
|
|
2053
2396
|
* Create a user that can immediately complete the password login flow:
|
|
2054
|
-
* `POST /users` (the body
|
|
2055
|
-
* `PUT /users/{id}/password` with
|
|
2397
|
+
* `POST /users` (the body carries `schema: <schema id>` and the schema-defined
|
|
2398
|
+
* content under `attributes`) followed by `PUT /users/{id}/password` with
|
|
2399
|
+
* `is_change_required: false`.
|
|
2056
2400
|
*
|
|
2057
2401
|
* Defaults mint a unique email per call (email is x-unique per project), which
|
|
2058
2402
|
* is what makes per-test seeding parallel-safe on a shared instance.
|
|
@@ -2062,14 +2406,16 @@ async function seedUser(client, context, input = {}) {
|
|
|
2062
2406
|
const email = input.email ?? fresh.email;
|
|
2063
2407
|
const password = input.password ?? fresh.password;
|
|
2064
2408
|
const id = requireString((await client.createUser({
|
|
2065
|
-
|
|
2066
|
-
|
|
2067
|
-
|
|
2409
|
+
schema: context.schemaId,
|
|
2410
|
+
attributes: {
|
|
2411
|
+
...input.attributes,
|
|
2412
|
+
email
|
|
2413
|
+
}
|
|
2068
2414
|
}, { project_id: context.projectId })).id, "user id");
|
|
2069
2415
|
await client.setUserPassword(id, {
|
|
2070
2416
|
password,
|
|
2071
2417
|
is_change_required: false
|
|
2072
|
-
}
|
|
2418
|
+
});
|
|
2073
2419
|
return {
|
|
2074
2420
|
id,
|
|
2075
2421
|
email,
|
|
@@ -2309,4 +2655,4 @@ Object.defineProperty(exports, "startLocalZitadel", {
|
|
|
2309
2655
|
}
|
|
2310
2656
|
});
|
|
2311
2657
|
|
|
2312
|
-
//# sourceMappingURL=src-
|
|
2658
|
+
//# sourceMappingURL=src-DtCJTEId.cjs.map
|