@zitadel/testing 0.0.0 → 0.1.0-alpha.19
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 +124 -42
- package/dist/{app-env-D3W0GYhA.d.mts → app-env-Btmfcflb.d.mts} +4 -4
- package/dist/{app-env-D3W0GYhA.d.mts.map → app-env-Btmfcflb.d.mts.map} +1 -1
- package/dist/app-runner.cjs +1 -1
- package/dist/app-runner.mjs +1 -1
- package/dist/{handshake-CggSIoxF.cjs → handshake-CRKcgkfN.cjs} +3 -2
- package/dist/{handshake-CggSIoxF.cjs.map → handshake-CRKcgkfN.cjs.map} +1 -1
- package/dist/{handshake-BPtWruO8.mjs → handshake-ClzWvG8z.mjs} +3 -2
- package/dist/{handshake-BPtWruO8.mjs.map → handshake-ClzWvG8z.mjs.map} +1 -1
- package/dist/index.cjs +2 -2
- package/dist/index.d.mts +4 -5
- package/dist/index.d.mts.map +1 -1
- package/dist/index.mjs +2 -2
- package/dist/playwright.cjs +273 -15
- package/dist/playwright.cjs.map +1 -1
- package/dist/playwright.d.mts +173 -6
- package/dist/playwright.d.mts.map +1 -1
- package/dist/playwright.mjs +265 -16
- package/dist/playwright.mjs.map +1 -1
- package/dist/{src-DkG0V4A6.mjs → src-9dFjTIAw.mjs} +19 -17
- package/dist/src-9dFjTIAw.mjs.map +1 -0
- package/dist/{src-BIL0PdSd.cjs → src-I0KAh1zU.cjs} +447 -429
- package/dist/src-I0KAh1zU.cjs.map +1 -0
- package/dist/supervisor.cjs +2 -2
- package/dist/supervisor.mjs +2 -2
- package/package.json +5 -5
- package/dist/src-BIL0PdSd.cjs.map +0 -1
- package/dist/src-DkG0V4A6.mjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_handshake = require("./handshake-
|
|
1
|
+
const require_handshake = require("./handshake-CRKcgkfN.cjs");
|
|
2
2
|
require("node:fs");
|
|
3
3
|
require("node:url");
|
|
4
4
|
let node_fs_promises = require("node:fs/promises");
|
|
@@ -129,9 +129,7 @@ function safeJsonParse(text) {
|
|
|
129
129
|
* OpenAPI spec version: 0.0.1
|
|
130
130
|
*/
|
|
131
131
|
var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
132
|
-
|
|
133
|
-
authorizeDevice: () => authorizeDevice,
|
|
134
|
-
authorizeGet: () => authorizeGet,
|
|
132
|
+
completeClaim: () => completeClaim,
|
|
135
133
|
createAuthAttempt: () => createAuthAttempt,
|
|
136
134
|
createBranding: () => createBranding,
|
|
137
135
|
createFlow: () => createFlow,
|
|
@@ -142,16 +140,14 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
142
140
|
createSession: () => createSession,
|
|
143
141
|
createTeam: () => createTeam,
|
|
144
142
|
createUser: () => createUser,
|
|
145
|
-
deactivateFlowDefinition: () => deactivateFlowDefinition,
|
|
146
143
|
deleteFlowDefinition: () => deleteFlowDefinition,
|
|
144
|
+
deleteTeam: () => deleteTeam,
|
|
147
145
|
deleteUserByID: () => deleteUserByID,
|
|
148
|
-
endSession: () => endSession,
|
|
149
146
|
exchangeHandoff: () => exchangeHandoff,
|
|
150
|
-
getActivateFlowDefinitionUrl: () => getActivateFlowDefinitionUrl,
|
|
151
147
|
getAuthAttempt: () => getAuthAttempt,
|
|
152
|
-
getAuthorizeDeviceUrl: () => getAuthorizeDeviceUrl,
|
|
153
|
-
getAuthorizeGetUrl: () => getAuthorizeGetUrl,
|
|
154
148
|
getBrandingById: () => getBrandingById,
|
|
149
|
+
getClaimStatus: () => getClaimStatus,
|
|
150
|
+
getCompleteClaimUrl: () => getCompleteClaimUrl,
|
|
155
151
|
getCreateAuthAttemptUrl: () => getCreateAuthAttemptUrl,
|
|
156
152
|
getCreateBrandingUrl: () => getCreateBrandingUrl,
|
|
157
153
|
getCreateFlowDefinitionUrl: () => getCreateFlowDefinitionUrl,
|
|
@@ -162,236 +158,80 @@ var zitadelNextGen_exports = /* @__PURE__ */ __exportAll({
|
|
|
162
158
|
getCreateSessionUrl: () => getCreateSessionUrl,
|
|
163
159
|
getCreateTeamUrl: () => getCreateTeamUrl,
|
|
164
160
|
getCreateUserUrl: () => getCreateUserUrl,
|
|
165
|
-
getDeactivateFlowDefinitionUrl: () => getDeactivateFlowDefinitionUrl,
|
|
166
161
|
getDeleteFlowDefinitionUrl: () => getDeleteFlowDefinitionUrl,
|
|
162
|
+
getDeleteTeamUrl: () => getDeleteTeamUrl,
|
|
167
163
|
getDeleteUserByIDUrl: () => getDeleteUserByIDUrl,
|
|
168
|
-
|
|
164
|
+
getEvent: () => getEvent,
|
|
169
165
|
getExchangeHandoffUrl: () => getExchangeHandoffUrl,
|
|
170
166
|
getFlowDefinition: () => getFlowDefinition,
|
|
171
167
|
getFlowStep: () => getFlowStep,
|
|
172
168
|
getGetAuthAttemptUrl: () => getGetAuthAttemptUrl,
|
|
173
169
|
getGetBrandingByIdUrl: () => getGetBrandingByIdUrl,
|
|
170
|
+
getGetClaimStatusUrl: () => getGetClaimStatusUrl,
|
|
171
|
+
getGetEventUrl: () => getGetEventUrl,
|
|
174
172
|
getGetFlowDefinitionUrl: () => getGetFlowDefinitionUrl,
|
|
175
173
|
getGetFlowStepUrl: () => getGetFlowStepUrl,
|
|
176
174
|
getGetHealthUrl: () => getGetHealthUrl,
|
|
177
|
-
getGetKeysUrl: () => getGetKeysUrl,
|
|
178
175
|
getGetLiveUrl: () => getGetLiveUrl,
|
|
179
176
|
getGetMySessionUrl: () => getGetMySessionUrl,
|
|
180
177
|
getGetMyUserUrl: () => getGetMyUserUrl,
|
|
181
|
-
getGetOpenIDConfigurationUrl: () => getGetOpenIDConfigurationUrl,
|
|
182
178
|
getGetProjectUrl: () => getGetProjectUrl,
|
|
183
179
|
getGetReadyUrl: () => getGetReadyUrl,
|
|
184
180
|
getGetSchemaByIdUrl: () => getGetSchemaByIdUrl,
|
|
185
181
|
getGetSessionUrl: () => getGetSessionUrl,
|
|
186
182
|
getGetTeamUrl: () => getGetTeamUrl,
|
|
187
|
-
getGetTokenUrl: () => getGetTokenUrl,
|
|
188
183
|
getGetUserByIDUrl: () => getGetUserByIDUrl,
|
|
189
|
-
getGetUserInfoUrl: () => getGetUserInfoUrl,
|
|
190
184
|
getHealth: () => getHealth,
|
|
191
|
-
|
|
185
|
+
getInitClaimUrl: () => getInitClaimUrl,
|
|
192
186
|
getIssueChallengeUrl: () => getIssueChallengeUrl,
|
|
193
|
-
getKeys: () => getKeys,
|
|
194
187
|
getListBrandingUrl: () => getListBrandingUrl,
|
|
188
|
+
getListEventsUrl: () => getListEventsUrl,
|
|
195
189
|
getListFlowDefinitionsUrl: () => getListFlowDefinitionsUrl,
|
|
196
190
|
getListSchemasUrl: () => getListSchemasUrl,
|
|
197
|
-
getListSessionsUrl: () => getListSessionsUrl,
|
|
198
191
|
getListUserPasskeysUrl: () => getListUserPasskeysUrl,
|
|
192
|
+
getListUserTeamsUrl: () => getListUserTeamsUrl,
|
|
199
193
|
getListUsersUrl: () => getListUsersUrl,
|
|
200
194
|
getLive: () => getLive,
|
|
201
195
|
getMySession: () => getMySession,
|
|
202
196
|
getMyUser: () => getMyUser,
|
|
203
|
-
getOpenIDConfiguration: () => getOpenIDConfiguration,
|
|
204
197
|
getPatchProjectUrl: () => getPatchProjectUrl,
|
|
205
198
|
getProject: () => getProject,
|
|
206
199
|
getQueryProjectsUrl: () => getQueryProjectsUrl,
|
|
200
|
+
getQuerySessionsUrl: () => getQuerySessionsUrl,
|
|
201
|
+
getQueryTeamsUrl: () => getQueryTeamsUrl,
|
|
207
202
|
getReady: () => getReady,
|
|
208
203
|
getRevokeMySessionUrl: () => getRevokeMySessionUrl,
|
|
209
204
|
getRevokeSessionUrl: () => getRevokeSessionUrl,
|
|
210
|
-
getRevokeTokenUrl: () => getRevokeTokenUrl,
|
|
211
205
|
getSchemaById: () => getSchemaById,
|
|
212
206
|
getSession: () => getSession,
|
|
213
207
|
getSetUserPasswordUrl: () => getSetUserPasswordUrl,
|
|
214
|
-
getSubmitFlowEventUrl: () => getSubmitFlowEventUrl,
|
|
215
208
|
getSubmitFlowStepUrl: () => getSubmitFlowStepUrl,
|
|
216
209
|
getTeam: () => getTeam,
|
|
217
|
-
getToken: () => getToken,
|
|
218
210
|
getUpdateFlowDefinitionUrl: () => getUpdateFlowDefinitionUrl,
|
|
211
|
+
getUpdateTeamUrl: () => getUpdateTeamUrl,
|
|
219
212
|
getUserByID: () => getUserByID,
|
|
220
|
-
getUserInfo: () => getUserInfo,
|
|
221
213
|
getVerifyChallengeProofUrl: () => getVerifyChallengeProofUrl,
|
|
222
|
-
|
|
214
|
+
initClaim: () => initClaim,
|
|
223
215
|
issueChallenge: () => issueChallenge,
|
|
224
216
|
listBranding: () => listBranding,
|
|
217
|
+
listEvents: () => listEvents,
|
|
225
218
|
listFlowDefinitions: () => listFlowDefinitions,
|
|
226
219
|
listSchemas: () => listSchemas,
|
|
227
|
-
listSessions: () => listSessions,
|
|
228
220
|
listUserPasskeys: () => listUserPasskeys,
|
|
221
|
+
listUserTeams: () => listUserTeams,
|
|
229
222
|
listUsers: () => listUsers,
|
|
230
223
|
patchProject: () => patchProject,
|
|
231
224
|
queryProjects: () => queryProjects,
|
|
225
|
+
querySessions: () => querySessions,
|
|
226
|
+
queryTeams: () => queryTeams,
|
|
232
227
|
revokeMySession: () => revokeMySession,
|
|
233
228
|
revokeSession: () => revokeSession,
|
|
234
|
-
revokeToken: () => revokeToken,
|
|
235
229
|
setUserPassword: () => setUserPassword,
|
|
236
|
-
submitFlowEvent: () => submitFlowEvent,
|
|
237
230
|
submitFlowStep: () => submitFlowStep,
|
|
238
231
|
updateFlowDefinition: () => updateFlowDefinition,
|
|
232
|
+
updateTeam: () => updateTeam,
|
|
239
233
|
verifyChallengeProof: () => verifyChallengeProof
|
|
240
234
|
});
|
|
241
|
-
const getGetOpenIDConfigurationUrl = () => {
|
|
242
|
-
return `${getProxyPath()}/.well-known/openid-configuration`;
|
|
243
|
-
};
|
|
244
|
-
/**
|
|
245
|
-
* Retrieve the OpenID Connect configuration
|
|
246
|
-
* @summary Get OpenID Connect configuration
|
|
247
|
-
*/
|
|
248
|
-
const getOpenIDConfiguration = async (options) => {
|
|
249
|
-
return customFetch(getGetOpenIDConfigurationUrl(), {
|
|
250
|
-
...options,
|
|
251
|
-
method: "GET"
|
|
252
|
-
});
|
|
253
|
-
};
|
|
254
|
-
const getAuthorizeGetUrl = (params) => {
|
|
255
|
-
const normalizedParams = new URLSearchParams();
|
|
256
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
257
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
258
|
-
});
|
|
259
|
-
const stringifiedParams = normalizedParams.toString();
|
|
260
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/authorize?${stringifiedParams}` : `${getProxyPath()}/auth/authorize`;
|
|
261
|
-
};
|
|
262
|
-
/**
|
|
263
|
-
* @summary Authorize a user
|
|
264
|
-
*/
|
|
265
|
-
const authorizeGet = async (params, options) => {
|
|
266
|
-
return customFetch(getAuthorizeGetUrl(params), {
|
|
267
|
-
...options,
|
|
268
|
-
method: "GET"
|
|
269
|
-
});
|
|
270
|
-
};
|
|
271
|
-
const getAuthorizeDeviceUrl = (params) => {
|
|
272
|
-
const normalizedParams = new URLSearchParams();
|
|
273
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
274
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
275
|
-
});
|
|
276
|
-
const stringifiedParams = normalizedParams.toString();
|
|
277
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/device-authorization?${stringifiedParams}` : `${getProxyPath()}/auth/device-authorization`;
|
|
278
|
-
};
|
|
279
|
-
/**
|
|
280
|
-
* @summary Authorize a device
|
|
281
|
-
*/
|
|
282
|
-
const authorizeDevice = async (params, options) => {
|
|
283
|
-
return customFetch(getAuthorizeDeviceUrl(params), {
|
|
284
|
-
...options,
|
|
285
|
-
method: "GET"
|
|
286
|
-
});
|
|
287
|
-
};
|
|
288
|
-
const getEndSessionUrl = (params) => {
|
|
289
|
-
const normalizedParams = new URLSearchParams();
|
|
290
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
291
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
292
|
-
});
|
|
293
|
-
const stringifiedParams = normalizedParams.toString();
|
|
294
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/auth/end-session?${stringifiedParams}` : `${getProxyPath()}/auth/end-session`;
|
|
295
|
-
};
|
|
296
|
-
/**
|
|
297
|
-
* @summary End a session
|
|
298
|
-
*/
|
|
299
|
-
const endSession = async (params, options) => {
|
|
300
|
-
return customFetch(getEndSessionUrl(params), {
|
|
301
|
-
...options,
|
|
302
|
-
method: "GET"
|
|
303
|
-
});
|
|
304
|
-
};
|
|
305
|
-
const getIntrospectUrl = () => {
|
|
306
|
-
return `${getProxyPath()}/auth/introspect`;
|
|
307
|
-
};
|
|
308
|
-
/**
|
|
309
|
-
* @summary Introspect a token
|
|
310
|
-
*/
|
|
311
|
-
const introspect = async (introspectBody, options) => {
|
|
312
|
-
const formUrlEncoded = new URLSearchParams();
|
|
313
|
-
formUrlEncoded.append(`token`, introspectBody.token);
|
|
314
|
-
if (introspectBody.token_type_hint !== void 0) formUrlEncoded.append(`token_type_hint`, introspectBody.token_type_hint);
|
|
315
|
-
return customFetch(getIntrospectUrl(), {
|
|
316
|
-
...options,
|
|
317
|
-
method: "POST",
|
|
318
|
-
headers: {
|
|
319
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
320
|
-
...options?.headers
|
|
321
|
-
},
|
|
322
|
-
body: formUrlEncoded
|
|
323
|
-
});
|
|
324
|
-
};
|
|
325
|
-
const getGetKeysUrl = () => {
|
|
326
|
-
return `${getProxyPath()}/auth/keys`;
|
|
327
|
-
};
|
|
328
|
-
/**
|
|
329
|
-
* @summary Get public keys
|
|
330
|
-
*/
|
|
331
|
-
const getKeys = async (options) => {
|
|
332
|
-
return customFetch(getGetKeysUrl(), {
|
|
333
|
-
...options,
|
|
334
|
-
method: "GET"
|
|
335
|
-
});
|
|
336
|
-
};
|
|
337
|
-
const getRevokeTokenUrl = () => {
|
|
338
|
-
return `${getProxyPath()}/auth/revoke`;
|
|
339
|
-
};
|
|
340
|
-
/**
|
|
341
|
-
* @summary Revoke an access token or refresh token
|
|
342
|
-
*/
|
|
343
|
-
const revokeToken = async (revokeTokenBody, options) => {
|
|
344
|
-
const formUrlEncoded = new URLSearchParams();
|
|
345
|
-
if (revokeTokenBody.token !== void 0) formUrlEncoded.append(`token`, revokeTokenBody.token);
|
|
346
|
-
if (revokeTokenBody.token_type_hint !== void 0) formUrlEncoded.append(`token_type_hint`, revokeTokenBody.token_type_hint);
|
|
347
|
-
return customFetch(getRevokeTokenUrl(), {
|
|
348
|
-
...options,
|
|
349
|
-
method: "POST",
|
|
350
|
-
headers: {
|
|
351
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
352
|
-
...options?.headers
|
|
353
|
-
},
|
|
354
|
-
body: formUrlEncoded
|
|
355
|
-
});
|
|
356
|
-
};
|
|
357
|
-
const getGetTokenUrl = () => {
|
|
358
|
-
return `${getProxyPath()}/auth/token`;
|
|
359
|
-
};
|
|
360
|
-
/**
|
|
361
|
-
* @summary Get access token
|
|
362
|
-
*/
|
|
363
|
-
const getToken = async (getTokenBody, options) => {
|
|
364
|
-
const formUrlEncoded = new URLSearchParams();
|
|
365
|
-
if (getTokenBody.code !== void 0) formUrlEncoded.append(`code`, getTokenBody.code);
|
|
366
|
-
if (getTokenBody.client_assertion !== void 0) formUrlEncoded.append(`client_assertion`, getTokenBody.client_assertion);
|
|
367
|
-
if (getTokenBody.client_assertion_type !== void 0) formUrlEncoded.append(`client_assertion_type`, getTokenBody.client_assertion_type);
|
|
368
|
-
if (getTokenBody.client_id !== void 0) formUrlEncoded.append(`client_id`, getTokenBody.client_id);
|
|
369
|
-
if (getTokenBody.client_secret !== void 0) formUrlEncoded.append(`client_secret`, getTokenBody.client_secret);
|
|
370
|
-
if (getTokenBody.code_verifier !== void 0) formUrlEncoded.append(`code_verifier`, getTokenBody.code_verifier);
|
|
371
|
-
if (getTokenBody.grant_type !== void 0) formUrlEncoded.append(`grant_type`, getTokenBody.grant_type);
|
|
372
|
-
if (getTokenBody.redirect_uri !== void 0) formUrlEncoded.append(`redirect_uri`, getTokenBody.redirect_uri);
|
|
373
|
-
return customFetch(getGetTokenUrl(), {
|
|
374
|
-
...options,
|
|
375
|
-
method: "POST",
|
|
376
|
-
headers: {
|
|
377
|
-
"Content-Type": "application/x-www-form-urlencoded",
|
|
378
|
-
...options?.headers
|
|
379
|
-
},
|
|
380
|
-
body: formUrlEncoded
|
|
381
|
-
});
|
|
382
|
-
};
|
|
383
|
-
const getGetUserInfoUrl = () => {
|
|
384
|
-
return `${getProxyPath()}/auth/userinfo`;
|
|
385
|
-
};
|
|
386
|
-
/**
|
|
387
|
-
* @summary Get user info
|
|
388
|
-
*/
|
|
389
|
-
const getUserInfo = async (options) => {
|
|
390
|
-
return customFetch(getGetUserInfoUrl(), {
|
|
391
|
-
...options,
|
|
392
|
-
method: "GET"
|
|
393
|
-
});
|
|
394
|
-
};
|
|
395
235
|
const getGetHealthUrl = () => {
|
|
396
236
|
return `${getProxyPath()}/healthz`;
|
|
397
237
|
};
|
|
@@ -487,19 +327,14 @@ const getUserByID = async (userId, params, options) => {
|
|
|
487
327
|
method: "GET"
|
|
488
328
|
});
|
|
489
329
|
};
|
|
490
|
-
const getDeleteUserByIDUrl = (userId
|
|
491
|
-
|
|
492
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
493
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
494
|
-
});
|
|
495
|
-
const stringifiedParams = normalizedParams.toString();
|
|
496
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}?${stringifiedParams}` : `${getProxyPath()}/users/${userId}`;
|
|
330
|
+
const getDeleteUserByIDUrl = (userId) => {
|
|
331
|
+
return `${getProxyPath()}/users/${userId}`;
|
|
497
332
|
};
|
|
498
333
|
/**
|
|
499
334
|
* @summary Delete user by ID
|
|
500
335
|
*/
|
|
501
|
-
const deleteUserByID = async (userId,
|
|
502
|
-
return customFetch(getDeleteUserByIDUrl(userId
|
|
336
|
+
const deleteUserByID = async (userId, options) => {
|
|
337
|
+
return customFetch(getDeleteUserByIDUrl(userId), {
|
|
503
338
|
...options,
|
|
504
339
|
method: "DELETE"
|
|
505
340
|
});
|
|
@@ -521,19 +356,14 @@ const listUserPasskeys = async (userId, params, options) => {
|
|
|
521
356
|
method: "GET"
|
|
522
357
|
});
|
|
523
358
|
};
|
|
524
|
-
const getSetUserPasswordUrl = (userId
|
|
525
|
-
|
|
526
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
527
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
528
|
-
});
|
|
529
|
-
const stringifiedParams = normalizedParams.toString();
|
|
530
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/password?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/password`;
|
|
359
|
+
const getSetUserPasswordUrl = (userId) => {
|
|
360
|
+
return `${getProxyPath()}/users/${userId}/password`;
|
|
531
361
|
};
|
|
532
362
|
/**
|
|
533
363
|
* @summary Set user password
|
|
534
364
|
*/
|
|
535
|
-
const setUserPassword = async (userId, setUserPasswordBody,
|
|
536
|
-
return customFetch(getSetUserPasswordUrl(userId
|
|
365
|
+
const setUserPassword = async (userId, setUserPasswordBody, options) => {
|
|
366
|
+
return customFetch(getSetUserPasswordUrl(userId), {
|
|
537
367
|
...options,
|
|
538
368
|
method: "PUT",
|
|
539
369
|
headers: {
|
|
@@ -543,6 +373,31 @@ const setUserPassword = async (userId, setUserPasswordBody, params, options) =>
|
|
|
543
373
|
body: JSON.stringify(setUserPasswordBody)
|
|
544
374
|
});
|
|
545
375
|
};
|
|
376
|
+
const getListUserTeamsUrl = (userId, params) => {
|
|
377
|
+
const normalizedParams = new URLSearchParams();
|
|
378
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
379
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
380
|
+
});
|
|
381
|
+
const stringifiedParams = normalizedParams.toString();
|
|
382
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/users/${userId}/teams?${stringifiedParams}` : `${getProxyPath()}/users/${userId}/teams`;
|
|
383
|
+
};
|
|
384
|
+
/**
|
|
385
|
+
* The user's team roster, ordered by team name. Each entry carries the
|
|
386
|
+
team's name, so a client renders a page without resolving ids one by one.
|
|
387
|
+
|
|
388
|
+
This is the N:N roster and it is not lifecycle ownership: the single team
|
|
389
|
+
that owns the user's lifecycle is reported as `metadata.lifecycle_owner_team_id`
|
|
390
|
+
on the user read endpoints. Memberships the user was removed from are not
|
|
391
|
+
returned.
|
|
392
|
+
|
|
393
|
+
* @summary List the teams a user belongs to
|
|
394
|
+
*/
|
|
395
|
+
const listUserTeams = async (userId, params, options) => {
|
|
396
|
+
return customFetch(getListUserTeamsUrl(userId, params), {
|
|
397
|
+
...options,
|
|
398
|
+
method: "GET"
|
|
399
|
+
});
|
|
400
|
+
};
|
|
546
401
|
const getGetMyUserUrl = () => {
|
|
547
402
|
return `${getProxyPath()}/users/me`;
|
|
548
403
|
};
|
|
@@ -564,7 +419,7 @@ the first capability step. Creates a new session implicitly unless
|
|
|
564
419
|
`session_id` is provided (for step-up / reauth on an existing session).
|
|
565
420
|
|
|
566
421
|
The response contains an `id` field — the flow handle. Use it as the path
|
|
567
|
-
parameter for all subsequent `/flow/{id}/submit`
|
|
422
|
+
parameter for all subsequent `/flow/{id}/submit` calls.
|
|
568
423
|
|
|
569
424
|
The response also sets an encrypted `HttpOnly` cookie (`_zflow`) containing
|
|
570
425
|
the flow's orchestration state (current step, collected data, history).
|
|
@@ -644,26 +499,6 @@ const submitFlowStep = async (id, submitFlowStepBody, options) => {
|
|
|
644
499
|
body: JSON.stringify(submitFlowStepBody)
|
|
645
500
|
});
|
|
646
501
|
};
|
|
647
|
-
const getSubmitFlowEventUrl = (id) => {
|
|
648
|
-
return `${getProxyPath()}/flow/${id}/event`;
|
|
649
|
-
};
|
|
650
|
-
/**
|
|
651
|
-
* Submits telemetry or fingerprint data from the frontend.
|
|
652
|
-
Does not advance the state machine. Used for risk evaluation.
|
|
653
|
-
|
|
654
|
-
* @summary Submit client-side event
|
|
655
|
-
*/
|
|
656
|
-
const submitFlowEvent = async (id, submitFlowEventBody, options) => {
|
|
657
|
-
return customFetch(getSubmitFlowEventUrl(id), {
|
|
658
|
-
...options,
|
|
659
|
-
method: "POST",
|
|
660
|
-
headers: {
|
|
661
|
-
"Content-Type": "application/json",
|
|
662
|
-
...options?.headers
|
|
663
|
-
},
|
|
664
|
-
body: JSON.stringify(submitFlowEventBody)
|
|
665
|
-
});
|
|
666
|
-
};
|
|
667
502
|
const getCreateAuthAttemptUrl = () => {
|
|
668
503
|
return `${getProxyPath()}/auth_attempts`;
|
|
669
504
|
};
|
|
@@ -851,6 +686,68 @@ const patchProject = async (projectId, patchProjectBody, options) => {
|
|
|
851
686
|
body: JSON.stringify(patchProjectBody)
|
|
852
687
|
});
|
|
853
688
|
};
|
|
689
|
+
const getInitClaimUrl = (projectId) => {
|
|
690
|
+
return `${getProxyPath()}/projects/${projectId}/claim/init`;
|
|
691
|
+
};
|
|
692
|
+
/**
|
|
693
|
+
* Starts a claim challenge for an unclaimed project. Authenticated by the
|
|
694
|
+
project secret, this mints a single-use, short-lived challenge and returns
|
|
695
|
+
the `claim_url` the developer opens in a browser to complete the claim,
|
|
696
|
+
together with the `challenge_id` the CLI polls with. The exact expiry is
|
|
697
|
+
carried by `expires_at` on the response.
|
|
698
|
+
|
|
699
|
+
* @summary Initialize a project claim
|
|
700
|
+
*/
|
|
701
|
+
const initClaim = async (projectId, options) => {
|
|
702
|
+
return customFetch(getInitClaimUrl(projectId), {
|
|
703
|
+
...options,
|
|
704
|
+
method: "POST"
|
|
705
|
+
});
|
|
706
|
+
};
|
|
707
|
+
const getGetClaimStatusUrl = (projectId, params) => {
|
|
708
|
+
const normalizedParams = new URLSearchParams();
|
|
709
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
710
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
711
|
+
});
|
|
712
|
+
const stringifiedParams = normalizedParams.toString();
|
|
713
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/projects/${projectId}/claim/status?${stringifiedParams}` : `${getProxyPath()}/projects/${projectId}/claim/status`;
|
|
714
|
+
};
|
|
715
|
+
/**
|
|
716
|
+
* Polled by the CLI while a browser completes the claim. Authorized by the
|
|
717
|
+
project secret that initiated the challenge. Returns `pending`, or
|
|
718
|
+
`completed` with the owning team, the claim timestamp, and the dashboard
|
|
719
|
+
URL once the browser leg has finished.
|
|
720
|
+
|
|
721
|
+
* @summary Get claim status
|
|
722
|
+
*/
|
|
723
|
+
const getClaimStatus = async (projectId, params, options) => {
|
|
724
|
+
return customFetch(getGetClaimStatusUrl(projectId, params), {
|
|
725
|
+
...options,
|
|
726
|
+
method: "GET"
|
|
727
|
+
});
|
|
728
|
+
};
|
|
729
|
+
const getCompleteClaimUrl = (projectId) => {
|
|
730
|
+
return `${getProxyPath()}/projects/${projectId}/claim/complete`;
|
|
731
|
+
};
|
|
732
|
+
/**
|
|
733
|
+
* Called by the browser after the developer authenticates on the claim page.
|
|
734
|
+
Authenticated by the `__nextgen_session` cookie, it attaches the project to
|
|
735
|
+
the developer's personal team using the `challenge_id` from the claim URL as
|
|
736
|
+
its single-use, browser-safe authorization.
|
|
737
|
+
|
|
738
|
+
* @summary Complete a project claim
|
|
739
|
+
*/
|
|
740
|
+
const completeClaim = async (projectId, completeClaimBody, options) => {
|
|
741
|
+
return customFetch(getCompleteClaimUrl(projectId), {
|
|
742
|
+
...options,
|
|
743
|
+
method: "POST",
|
|
744
|
+
headers: {
|
|
745
|
+
"Content-Type": "application/json",
|
|
746
|
+
...options?.headers
|
|
747
|
+
},
|
|
748
|
+
body: JSON.stringify(completeClaimBody)
|
|
749
|
+
});
|
|
750
|
+
};
|
|
854
751
|
const getCreateSessionUrl = () => {
|
|
855
752
|
return `${getProxyPath()}/sessions`;
|
|
856
753
|
};
|
|
@@ -863,8 +760,16 @@ Use this explicitly when you want to:
|
|
|
863
760
|
can be correlated with the eventual authenticated session from the start.
|
|
864
761
|
- Track anonymous state (bot detection, device fingerprint) that survives until authentication.
|
|
865
762
|
|
|
866
|
-
|
|
867
|
-
|
|
763
|
+
Creating a session is an app-plane operation on the project credential
|
|
764
|
+
(`session.write`). The returned `session_token` is a session credential for the
|
|
765
|
+
end-user client, not a management scope: it is delivered as the
|
|
766
|
+
`__nextgen_session` cookie and authorises the self-service operations
|
|
767
|
+
`GET /sessions/me` and `DELETE /sessions/me` (`nextgenSession` scheme). The
|
|
768
|
+
by-id operations `GET /sessions/{session_id}` and `DELETE /sessions/{session_id}`
|
|
769
|
+
are operator endpoints and require `session.read` / `session.delete` instead.
|
|
770
|
+
|
|
771
|
+
The `session_token` is superseded when a handoff exchange completes — clients must
|
|
772
|
+
replace it at that point.
|
|
868
773
|
|
|
869
774
|
Anonymous sessions expire aggressively (10-minute TTL). The TTL resets to the configured
|
|
870
775
|
full session TTL when the first authentication factor is written via a completing `auth_attempt`.
|
|
@@ -882,24 +787,30 @@ const createSession = async (createSessionBody, options) => {
|
|
|
882
787
|
body: JSON.stringify(createSessionBody)
|
|
883
788
|
});
|
|
884
789
|
};
|
|
885
|
-
const
|
|
790
|
+
const getQuerySessionsUrl = (params) => {
|
|
886
791
|
const normalizedParams = new URLSearchParams();
|
|
887
792
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
888
793
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
889
794
|
});
|
|
890
795
|
const stringifiedParams = normalizedParams.toString();
|
|
891
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions?${stringifiedParams}` : `${getProxyPath()}/sessions`;
|
|
796
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/query?${stringifiedParams}` : `${getProxyPath()}/sessions/query`;
|
|
892
797
|
};
|
|
893
798
|
/**
|
|
894
|
-
* Returns
|
|
895
|
-
|
|
799
|
+
* Returns the sessions of a project, paginated with a cursor.
|
|
800
|
+
Sessions of every lifecycle state are returned; each carries its `state`.
|
|
801
|
+
Requires `session.read` permission.
|
|
896
802
|
|
|
897
|
-
* @summary
|
|
803
|
+
* @summary Query sessions
|
|
898
804
|
*/
|
|
899
|
-
const
|
|
900
|
-
return customFetch(
|
|
805
|
+
const querySessions = async (querySessionsBody, params, options) => {
|
|
806
|
+
return customFetch(getQuerySessionsUrl(params), {
|
|
901
807
|
...options,
|
|
902
|
-
method: "
|
|
808
|
+
method: "POST",
|
|
809
|
+
headers: {
|
|
810
|
+
"Content-Type": "application/json",
|
|
811
|
+
...options?.headers
|
|
812
|
+
},
|
|
813
|
+
body: JSON.stringify(querySessionsBody)
|
|
903
814
|
});
|
|
904
815
|
};
|
|
905
816
|
const getExchangeHandoffUrl = (params) => {
|
|
@@ -942,13 +853,8 @@ const exchangeHandoff = async (exchangeHandoffBody, params, options) => {
|
|
|
942
853
|
body: JSON.stringify(exchangeHandoffBody)
|
|
943
854
|
});
|
|
944
855
|
};
|
|
945
|
-
const getGetSessionUrl = (sessionId
|
|
946
|
-
|
|
947
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
948
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
949
|
-
});
|
|
950
|
-
const stringifiedParams = normalizedParams.toString();
|
|
951
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
|
|
856
|
+
const getGetSessionUrl = (sessionId) => {
|
|
857
|
+
return `${getProxyPath()}/sessions/${sessionId}`;
|
|
952
858
|
};
|
|
953
859
|
/**
|
|
954
860
|
* Returns the current state of a session including its factors and all currently
|
|
@@ -960,33 +866,30 @@ against the same `session_id`) to restore a dropped assurance level.
|
|
|
960
866
|
|
|
961
867
|
* @summary Get session state
|
|
962
868
|
*/
|
|
963
|
-
const getSession = async (sessionId,
|
|
964
|
-
return customFetch(getGetSessionUrl(sessionId
|
|
869
|
+
const getSession = async (sessionId, options) => {
|
|
870
|
+
return customFetch(getGetSessionUrl(sessionId), {
|
|
965
871
|
...options,
|
|
966
872
|
method: "GET"
|
|
967
873
|
});
|
|
968
874
|
};
|
|
969
|
-
const getRevokeSessionUrl = (sessionId
|
|
970
|
-
|
|
971
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
972
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
973
|
-
});
|
|
974
|
-
const stringifiedParams = normalizedParams.toString();
|
|
975
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/sessions/${sessionId}?${stringifiedParams}` : `${getProxyPath()}/sessions/${sessionId}`;
|
|
875
|
+
const getRevokeSessionUrl = (sessionId) => {
|
|
876
|
+
return `${getProxyPath()}/sessions/${sessionId}`;
|
|
976
877
|
};
|
|
977
878
|
/**
|
|
978
|
-
*
|
|
879
|
+
* Permanently deletes the session, terminating it immediately.
|
|
979
880
|
|
|
980
881
|
This is the operator revoke path and requires the `session.delete` scope on a
|
|
981
882
|
project-bound credential. End-user logout with the `__nextgen_session` cookie is
|
|
982
883
|
`DELETE /sessions/me` (`nextgenSession` scheme).
|
|
983
884
|
|
|
984
|
-
|
|
885
|
+
Idempotent: deleting a session that does not exist (or was already deleted)
|
|
886
|
+
still returns 204. After deletion, any tokens derived from the session are
|
|
887
|
+
invalidated.
|
|
985
888
|
|
|
986
889
|
* @summary Revoke session
|
|
987
890
|
*/
|
|
988
|
-
const revokeSession = async (sessionId,
|
|
989
|
-
return customFetch(getRevokeSessionUrl(sessionId
|
|
891
|
+
const revokeSession = async (sessionId, options) => {
|
|
892
|
+
return customFetch(getRevokeSessionUrl(sessionId), {
|
|
990
893
|
...options,
|
|
991
894
|
method: "DELETE"
|
|
992
895
|
});
|
|
@@ -1014,10 +917,12 @@ const getRevokeMySessionUrl = () => {
|
|
|
1014
917
|
return `${getProxyPath()}/sessions/me`;
|
|
1015
918
|
};
|
|
1016
919
|
/**
|
|
1017
|
-
*
|
|
920
|
+
* Logs out by permanently deleting the session.
|
|
1018
921
|
|
|
1019
|
-
The __nextgen_session cookie issued at creation (or superseded by a handoff
|
|
1020
|
-
|
|
922
|
+
The `__nextgen_session` cookie issued at creation (or superseded by a handoff
|
|
923
|
+
exchange) is required. Idempotent: if the session is already gone this still
|
|
924
|
+
returns 204. Any tokens derived from the session are invalidated, and the
|
|
925
|
+
cookie itself is cleared in the response.
|
|
1021
926
|
|
|
1022
927
|
* @summary Revoke my session
|
|
1023
928
|
*/
|
|
@@ -1036,10 +941,12 @@ const getCreateSchemaUrl = (params) => {
|
|
|
1036
941
|
return stringifiedParams.length > 0 ? `${getProxyPath()}/schemas?${stringifiedParams}` : `${getProxyPath()}/schemas`;
|
|
1037
942
|
};
|
|
1038
943
|
/**
|
|
1039
|
-
* Create a new schema. The
|
|
1040
|
-
|
|
1041
|
-
|
|
1042
|
-
|
|
944
|
+
* Create a new schema. The optional `$id` field is the JSON Schema document
|
|
945
|
+
URI used to identify the schema in future requests (GitOps-stable identity,
|
|
946
|
+
not a free-form resource primary key). When `$id` is omitted, the server
|
|
947
|
+
generates a `sch_*` URL. When provided, `$id` must be unique within the
|
|
948
|
+
project and should ideally be a valid URI pointing at where the schema can
|
|
949
|
+
be accessed.
|
|
1043
950
|
|
|
1044
951
|
The schema can either be a concrete schema, e.g. a user schema, or a
|
|
1045
952
|
schema-url which will be resolved by the server.
|
|
@@ -1138,31 +1045,21 @@ const listFlowDefinitions = async (params, options) => {
|
|
|
1138
1045
|
method: "GET"
|
|
1139
1046
|
});
|
|
1140
1047
|
};
|
|
1141
|
-
const getGetFlowDefinitionUrl = (id
|
|
1142
|
-
|
|
1143
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1144
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1145
|
-
});
|
|
1146
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1147
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1048
|
+
const getGetFlowDefinitionUrl = (id) => {
|
|
1049
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1148
1050
|
};
|
|
1149
1051
|
/**
|
|
1150
1052
|
* Get a flow definition by id
|
|
1151
1053
|
* @summary Get a flow definition by id
|
|
1152
1054
|
*/
|
|
1153
|
-
const getFlowDefinition = async (id,
|
|
1154
|
-
return customFetch(getGetFlowDefinitionUrl(id
|
|
1055
|
+
const getFlowDefinition = async (id, options) => {
|
|
1056
|
+
return customFetch(getGetFlowDefinitionUrl(id), {
|
|
1155
1057
|
...options,
|
|
1156
1058
|
method: "GET"
|
|
1157
1059
|
});
|
|
1158
1060
|
};
|
|
1159
|
-
const getUpdateFlowDefinitionUrl = (id
|
|
1160
|
-
|
|
1161
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1162
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1163
|
-
});
|
|
1164
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1165
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1061
|
+
const getUpdateFlowDefinitionUrl = (id) => {
|
|
1062
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1166
1063
|
};
|
|
1167
1064
|
/**
|
|
1168
1065
|
* Update a flow definition by id. This endpoint replaces the existing flow definition.
|
|
@@ -1170,8 +1067,8 @@ If `flow_definition.status` is omitted, the current status is preserved
|
|
|
1170
1067
|
|
|
1171
1068
|
* @summary Update a flow definition by id
|
|
1172
1069
|
*/
|
|
1173
|
-
const updateFlowDefinition = async (id, updateFlowDefinitionBody,
|
|
1174
|
-
return customFetch(getUpdateFlowDefinitionUrl(id
|
|
1070
|
+
const updateFlowDefinition = async (id, updateFlowDefinitionBody, options) => {
|
|
1071
|
+
return customFetch(getUpdateFlowDefinitionUrl(id), {
|
|
1175
1072
|
...options,
|
|
1176
1073
|
method: "PUT",
|
|
1177
1074
|
headers: {
|
|
@@ -1181,13 +1078,8 @@ const updateFlowDefinition = async (id, updateFlowDefinitionBody, params, option
|
|
|
1181
1078
|
body: JSON.stringify(updateFlowDefinitionBody)
|
|
1182
1079
|
});
|
|
1183
1080
|
};
|
|
1184
|
-
const getDeleteFlowDefinitionUrl = (id
|
|
1185
|
-
|
|
1186
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1187
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1188
|
-
});
|
|
1189
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1190
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/flow_definitions/${id}?${stringifiedParams}` : `${getProxyPath()}/flow_definitions/${id}`;
|
|
1081
|
+
const getDeleteFlowDefinitionUrl = (id) => {
|
|
1082
|
+
return `${getProxyPath()}/flow_definitions/${id}`;
|
|
1191
1083
|
};
|
|
1192
1084
|
/**
|
|
1193
1085
|
* Delete a flow definition by id.
|
|
@@ -1196,94 +1088,112 @@ If the flow definition is the last active flow definition for a given purpose, t
|
|
|
1196
1088
|
|
|
1197
1089
|
* @summary Delete a flow definition by id
|
|
1198
1090
|
*/
|
|
1199
|
-
const deleteFlowDefinition = async (id,
|
|
1200
|
-
return customFetch(getDeleteFlowDefinitionUrl(id
|
|
1091
|
+
const deleteFlowDefinition = async (id, options) => {
|
|
1092
|
+
return customFetch(getDeleteFlowDefinitionUrl(id), {
|
|
1201
1093
|
...options,
|
|
1202
1094
|
method: "DELETE"
|
|
1203
1095
|
});
|
|
1204
1096
|
};
|
|
1205
|
-
const
|
|
1097
|
+
const getCreateTeamUrl = (params) => {
|
|
1206
1098
|
const normalizedParams = new URLSearchParams();
|
|
1207
1099
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1208
1100
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1209
1101
|
});
|
|
1210
1102
|
const stringifiedParams = normalizedParams.toString();
|
|
1211
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/
|
|
1103
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;
|
|
1212
1104
|
};
|
|
1213
1105
|
/**
|
|
1214
|
-
*
|
|
1215
|
-
Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
|
|
1216
|
-
|
|
1217
|
-
* @summary Activate a flow definition by ID.
|
|
1106
|
+
* @summary Create team
|
|
1218
1107
|
*/
|
|
1219
|
-
const
|
|
1220
|
-
return customFetch(
|
|
1108
|
+
const createTeam = async (createTeamBody, params, options) => {
|
|
1109
|
+
return customFetch(getCreateTeamUrl(params), {
|
|
1221
1110
|
...options,
|
|
1222
|
-
method: "POST"
|
|
1111
|
+
method: "POST",
|
|
1112
|
+
headers: {
|
|
1113
|
+
"Content-Type": "application/json",
|
|
1114
|
+
...options?.headers
|
|
1115
|
+
},
|
|
1116
|
+
body: JSON.stringify(createTeamBody)
|
|
1223
1117
|
});
|
|
1224
1118
|
};
|
|
1225
|
-
const
|
|
1119
|
+
const getQueryTeamsUrl = (params) => {
|
|
1226
1120
|
const normalizedParams = new URLSearchParams();
|
|
1227
1121
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1228
1122
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1229
1123
|
});
|
|
1230
1124
|
const stringifiedParams = normalizedParams.toString();
|
|
1231
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/
|
|
1125
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/query?${stringifiedParams}` : `${getProxyPath()}/teams/query`;
|
|
1232
1126
|
};
|
|
1233
1127
|
/**
|
|
1234
|
-
*
|
|
1235
|
-
Flow definitions in `draft` state cannot be used to start new flows. Existing flows that use the deactivated flow definition must gracefully handle this.
|
|
1236
|
-
Alternatively, the status of a flow definition can also be set via the `POST /flow_definitions` and `PUT /flow_definitions/{id}` endpoints by setting the `status` attribute in the flow definition payload.
|
|
1128
|
+
* Returns the teams of a project, paginated with a cursor.
|
|
1237
1129
|
|
|
1238
|
-
* @summary
|
|
1130
|
+
* @summary Query teams
|
|
1239
1131
|
*/
|
|
1240
|
-
const
|
|
1241
|
-
return customFetch(
|
|
1242
|
-
...options,
|
|
1243
|
-
method: "POST"
|
|
1244
|
-
});
|
|
1245
|
-
};
|
|
1246
|
-
const getCreateTeamUrl = (params) => {
|
|
1247
|
-
const normalizedParams = new URLSearchParams();
|
|
1248
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1249
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1250
|
-
});
|
|
1251
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1252
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams?${stringifiedParams}` : `${getProxyPath()}/teams`;
|
|
1253
|
-
};
|
|
1254
|
-
/**
|
|
1255
|
-
* @summary Create team
|
|
1256
|
-
*/
|
|
1257
|
-
const createTeam = async (createTeamBody, params, options) => {
|
|
1258
|
-
return customFetch(getCreateTeamUrl(params), {
|
|
1132
|
+
const queryTeams = async (queryTeamsBody, params, options) => {
|
|
1133
|
+
return customFetch(getQueryTeamsUrl(params), {
|
|
1259
1134
|
...options,
|
|
1260
1135
|
method: "POST",
|
|
1261
1136
|
headers: {
|
|
1262
1137
|
"Content-Type": "application/json",
|
|
1263
1138
|
...options?.headers
|
|
1264
1139
|
},
|
|
1265
|
-
body: JSON.stringify(
|
|
1140
|
+
body: JSON.stringify(queryTeamsBody)
|
|
1266
1141
|
});
|
|
1267
1142
|
};
|
|
1268
|
-
const getGetTeamUrl = (teamId
|
|
1269
|
-
|
|
1270
|
-
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1271
|
-
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1272
|
-
});
|
|
1273
|
-
const stringifiedParams = normalizedParams.toString();
|
|
1274
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/teams/${teamId}?${stringifiedParams}` : `${getProxyPath()}/teams/${teamId}`;
|
|
1143
|
+
const getGetTeamUrl = (teamId) => {
|
|
1144
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1275
1145
|
};
|
|
1276
1146
|
/**
|
|
1277
|
-
* Returns
|
|
1147
|
+
* Returns a Team by its id.
|
|
1278
1148
|
|
|
1279
1149
|
* @summary Get team
|
|
1280
1150
|
*/
|
|
1281
|
-
const getTeam = async (teamId,
|
|
1282
|
-
return customFetch(getGetTeamUrl(teamId
|
|
1151
|
+
const getTeam = async (teamId, options) => {
|
|
1152
|
+
return customFetch(getGetTeamUrl(teamId), {
|
|
1283
1153
|
...options,
|
|
1284
1154
|
method: "GET"
|
|
1285
1155
|
});
|
|
1286
1156
|
};
|
|
1157
|
+
const getDeleteTeamUrl = (teamId) => {
|
|
1158
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1159
|
+
};
|
|
1160
|
+
/**
|
|
1161
|
+
* Deactivates the team.
|
|
1162
|
+
|
|
1163
|
+
The team is tombstoned rather than erased: it stays readable through
|
|
1164
|
+
getTeam with status `deactivated`. Its memberships are removed and the
|
|
1165
|
+
users whose lifecycle it owns are deactivated with it.
|
|
1166
|
+
|
|
1167
|
+
The request is idempotent. Deleting a team that is already deactivated
|
|
1168
|
+
or doesn't exist succeeds without changing anything.
|
|
1169
|
+
|
|
1170
|
+
* @summary Delete team
|
|
1171
|
+
*/
|
|
1172
|
+
const deleteTeam = async (teamId, options) => {
|
|
1173
|
+
return customFetch(getDeleteTeamUrl(teamId), {
|
|
1174
|
+
...options,
|
|
1175
|
+
method: "DELETE"
|
|
1176
|
+
});
|
|
1177
|
+
};
|
|
1178
|
+
const getUpdateTeamUrl = (teamId) => {
|
|
1179
|
+
return `${getProxyPath()}/teams/${teamId}`;
|
|
1180
|
+
};
|
|
1181
|
+
/**
|
|
1182
|
+
* Update team. Only active teams can be updated.
|
|
1183
|
+
|
|
1184
|
+
* @summary Update team
|
|
1185
|
+
*/
|
|
1186
|
+
const updateTeam = async (teamId, updateTeamBody, options) => {
|
|
1187
|
+
return customFetch(getUpdateTeamUrl(teamId), {
|
|
1188
|
+
...options,
|
|
1189
|
+
method: "PATCH",
|
|
1190
|
+
headers: {
|
|
1191
|
+
"Content-Type": "application/json",
|
|
1192
|
+
...options?.headers
|
|
1193
|
+
},
|
|
1194
|
+
body: JSON.stringify(updateTeamBody)
|
|
1195
|
+
});
|
|
1196
|
+
};
|
|
1287
1197
|
const getCreateBrandingUrl = (params) => {
|
|
1288
1198
|
const normalizedParams = new URLSearchParams();
|
|
1289
1199
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
@@ -1339,20 +1249,73 @@ const listBranding = async (params, options) => {
|
|
|
1339
1249
|
method: "GET"
|
|
1340
1250
|
});
|
|
1341
1251
|
};
|
|
1342
|
-
const getGetBrandingByIdUrl = (id
|
|
1252
|
+
const getGetBrandingByIdUrl = (id) => {
|
|
1253
|
+
return `${getProxyPath()}/branding/${id}`;
|
|
1254
|
+
};
|
|
1255
|
+
/**
|
|
1256
|
+
* Retrieves a single branding revision, including its stored configuration.
|
|
1257
|
+
* @summary Get a branding revision by ID
|
|
1258
|
+
*/
|
|
1259
|
+
const getBrandingById = async (id, options) => {
|
|
1260
|
+
return customFetch(getGetBrandingByIdUrl(id), {
|
|
1261
|
+
...options,
|
|
1262
|
+
method: "GET"
|
|
1263
|
+
});
|
|
1264
|
+
};
|
|
1265
|
+
const getListEventsUrl = (params) => {
|
|
1343
1266
|
const normalizedParams = new URLSearchParams();
|
|
1344
1267
|
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1268
|
+
if (Array.isArray(value) && ["category", "event_type"].includes(key)) {
|
|
1269
|
+
value.forEach((v) => {
|
|
1270
|
+
normalizedParams.append(key, v === null ? "null" : v.toString());
|
|
1271
|
+
});
|
|
1272
|
+
return;
|
|
1273
|
+
}
|
|
1345
1274
|
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1346
1275
|
});
|
|
1347
1276
|
const stringifiedParams = normalizedParams.toString();
|
|
1348
|
-
return stringifiedParams.length > 0 ? `${getProxyPath()}/
|
|
1277
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/events?${stringifiedParams}` : `${getProxyPath()}/events`;
|
|
1349
1278
|
};
|
|
1350
1279
|
/**
|
|
1351
|
-
*
|
|
1352
|
-
|
|
1280
|
+
* Returns project-scoped audit events, newest-first by keyset on
|
|
1281
|
+
`(created_at, id)` (ADR 027 / ADR 049). Pass `order=asc` for oldest-first.
|
|
1282
|
+
Requires `events.read`.
|
|
1283
|
+
|
|
1284
|
+
Pre-claim projects return an empty list (events are stored but not
|
|
1285
|
+
visible until claim succeeds). Team-scoped credentials see only events
|
|
1286
|
+
whose emit-time `team_id` matches the credential team (enforced when
|
|
1287
|
+
team-scoped tokens exist).
|
|
1288
|
+
|
|
1289
|
+
Clients discriminate each item via `event_type` (OpenAPI Event oneOf) —
|
|
1290
|
+
see docs/design/api/events-catalog.md.
|
|
1291
|
+
|
|
1292
|
+
* @summary List events
|
|
1353
1293
|
*/
|
|
1354
|
-
const
|
|
1355
|
-
return customFetch(
|
|
1294
|
+
const listEvents = async (params, options) => {
|
|
1295
|
+
return customFetch(getListEventsUrl(params), {
|
|
1296
|
+
...options,
|
|
1297
|
+
method: "GET"
|
|
1298
|
+
});
|
|
1299
|
+
};
|
|
1300
|
+
const getGetEventUrl = (id, params) => {
|
|
1301
|
+
const normalizedParams = new URLSearchParams();
|
|
1302
|
+
Object.entries(params || {}).forEach(([key, value]) => {
|
|
1303
|
+
if (value !== void 0) normalizedParams.append(key, value === null ? "null" : value.toString());
|
|
1304
|
+
});
|
|
1305
|
+
const stringifiedParams = normalizedParams.toString();
|
|
1306
|
+
return stringifiedParams.length > 0 ? `${getProxyPath()}/events/${id}?${stringifiedParams}` : `${getProxyPath()}/events/${id}`;
|
|
1307
|
+
};
|
|
1308
|
+
/**
|
|
1309
|
+
* Loads a single event by `(project_id, id)`. Requires `events.read`.
|
|
1310
|
+
Events are not registered in `resource_scope_index`; project scope is
|
|
1311
|
+
required on the query (ADR 049). Misses and cross-project ids return 404.
|
|
1312
|
+
|
|
1313
|
+
Pre-claim projects return 404 (stored events stay invisible until claim).
|
|
1314
|
+
|
|
1315
|
+
* @summary Get event by ID
|
|
1316
|
+
*/
|
|
1317
|
+
const getEvent = async (id, params, options) => {
|
|
1318
|
+
return customFetch(getGetEventUrl(id, params), {
|
|
1356
1319
|
...options,
|
|
1357
1320
|
method: "GET"
|
|
1358
1321
|
});
|
|
@@ -1383,7 +1346,7 @@ const getBrandingById = async (id, params, options) => {
|
|
|
1383
1346
|
* generated orval function:
|
|
1384
1347
|
*
|
|
1385
1348
|
* const client = createZitadelClient({ baseUrl, token });
|
|
1386
|
-
* await client.createProject({
|
|
1349
|
+
* await client.createProject({ preview_origins: [] });
|
|
1387
1350
|
* await client.createSchema(body, { project_id });
|
|
1388
1351
|
*/
|
|
1389
1352
|
function createZitadelClient(opts) {
|
|
@@ -1400,7 +1363,7 @@ function createZitadelClient(opts) {
|
|
|
1400
1363
|
} });
|
|
1401
1364
|
}
|
|
1402
1365
|
//#endregion
|
|
1403
|
-
//#region ../config/dist/defaults-
|
|
1366
|
+
//#region ../config/dist/defaults-eiGHyI5Y.mjs
|
|
1404
1367
|
var default_human_user_default = {
|
|
1405
1368
|
title: "DefaultHumanUserSchema",
|
|
1406
1369
|
$schema: "https://json-schema.org/draft/2020-12/schema",
|
|
@@ -1411,14 +1374,8 @@ var default_human_user_default = {
|
|
|
1411
1374
|
type: "object",
|
|
1412
1375
|
description: "The default editable schema for human users.",
|
|
1413
1376
|
"x-auth-methods": {
|
|
1414
|
-
"password": {
|
|
1415
|
-
|
|
1416
|
-
"position": 1
|
|
1417
|
-
},
|
|
1418
|
-
"passkey": {
|
|
1419
|
-
"enabled": true,
|
|
1420
|
-
"position": 2
|
|
1421
|
-
}
|
|
1377
|
+
"password": { "enabled": true },
|
|
1378
|
+
"passkey": { "enabled": true }
|
|
1422
1379
|
},
|
|
1423
1380
|
required: ["email"],
|
|
1424
1381
|
properties: { "email": {
|
|
@@ -1441,21 +1398,34 @@ var default_login_default = {
|
|
|
1441
1398
|
{
|
|
1442
1399
|
"name": "identifier",
|
|
1443
1400
|
"fields": ["email"],
|
|
1444
|
-
"actions": [
|
|
1445
|
-
|
|
1446
|
-
|
|
1447
|
-
|
|
1448
|
-
|
|
1449
|
-
|
|
1450
|
-
|
|
1451
|
-
|
|
1452
|
-
|
|
1453
|
-
|
|
1454
|
-
|
|
1401
|
+
"actions": [
|
|
1402
|
+
{
|
|
1403
|
+
"name": "submit",
|
|
1404
|
+
"kind": "submit",
|
|
1405
|
+
"primary": true,
|
|
1406
|
+
"text_key": "identifier.action.continue"
|
|
1407
|
+
},
|
|
1408
|
+
{
|
|
1409
|
+
"name": "passkey",
|
|
1410
|
+
"kind": "passkey",
|
|
1411
|
+
"primary": false,
|
|
1412
|
+
"text_key": "identifier.action.passkey"
|
|
1413
|
+
},
|
|
1414
|
+
{
|
|
1415
|
+
"name": "register",
|
|
1416
|
+
"kind": "navigate",
|
|
1417
|
+
"primary": false,
|
|
1418
|
+
"text_key": "identifier.action.register.link"
|
|
1419
|
+
}
|
|
1420
|
+
],
|
|
1455
1421
|
"transitions": {
|
|
1456
1422
|
"submit": { "target": "password" },
|
|
1457
1423
|
"passkey": { "target": "done" },
|
|
1458
|
-
"user_not_found": { "target": "register" }
|
|
1424
|
+
"user_not_found": { "target": "register" },
|
|
1425
|
+
"register": {
|
|
1426
|
+
"target": "register",
|
|
1427
|
+
"purpose": "register"
|
|
1428
|
+
}
|
|
1459
1429
|
}
|
|
1460
1430
|
},
|
|
1461
1431
|
{
|
|
@@ -1480,21 +1450,34 @@ var default_login_default = {
|
|
|
1480
1450
|
{
|
|
1481
1451
|
"name": "register",
|
|
1482
1452
|
"fields": ["email"],
|
|
1483
|
-
"actions": [
|
|
1484
|
-
|
|
1485
|
-
|
|
1486
|
-
|
|
1487
|
-
|
|
1488
|
-
|
|
1489
|
-
|
|
1490
|
-
|
|
1491
|
-
|
|
1492
|
-
|
|
1493
|
-
|
|
1453
|
+
"actions": [
|
|
1454
|
+
{
|
|
1455
|
+
"name": "submit",
|
|
1456
|
+
"kind": "submit",
|
|
1457
|
+
"primary": true,
|
|
1458
|
+
"text_key": "register.action.password"
|
|
1459
|
+
},
|
|
1460
|
+
{
|
|
1461
|
+
"name": "passkey_register",
|
|
1462
|
+
"kind": "passkey_register",
|
|
1463
|
+
"primary": false,
|
|
1464
|
+
"text_key": "register.action.passkey"
|
|
1465
|
+
},
|
|
1466
|
+
{
|
|
1467
|
+
"name": "sign_in",
|
|
1468
|
+
"kind": "navigate",
|
|
1469
|
+
"primary": false,
|
|
1470
|
+
"text_key": "register.action.sign_in.link"
|
|
1471
|
+
}
|
|
1472
|
+
],
|
|
1494
1473
|
"transitions": {
|
|
1495
1474
|
"submit": { "target": "register-password" },
|
|
1496
1475
|
"passkey_register": { "target": "done" },
|
|
1497
|
-
"user_already_exists": { "target": "password" }
|
|
1476
|
+
"user_already_exists": { "target": "password" },
|
|
1477
|
+
"sign_in": {
|
|
1478
|
+
"target": "identifier",
|
|
1479
|
+
"purpose": "login"
|
|
1480
|
+
}
|
|
1498
1481
|
}
|
|
1499
1482
|
},
|
|
1500
1483
|
{
|
|
@@ -1528,14 +1511,8 @@ var human_user_default = {
|
|
|
1528
1511
|
type: "object",
|
|
1529
1512
|
description: "The default editable schema for human users (passkey-first sign-in).",
|
|
1530
1513
|
"x-auth-methods": {
|
|
1531
|
-
"passkey": {
|
|
1532
|
-
|
|
1533
|
-
"position": 1
|
|
1534
|
-
},
|
|
1535
|
-
"password": {
|
|
1536
|
-
"enabled": true,
|
|
1537
|
-
"position": 2
|
|
1538
|
-
}
|
|
1514
|
+
"passkey": { "enabled": true },
|
|
1515
|
+
"password": { "enabled": true }
|
|
1539
1516
|
},
|
|
1540
1517
|
required: ["email"],
|
|
1541
1518
|
properties: { "email": {
|
|
@@ -1558,41 +1535,67 @@ var login_default = {
|
|
|
1558
1535
|
{
|
|
1559
1536
|
"name": "passkey-first",
|
|
1560
1537
|
"fields": [],
|
|
1561
|
-
"actions": [
|
|
1562
|
-
|
|
1563
|
-
|
|
1564
|
-
|
|
1565
|
-
|
|
1566
|
-
|
|
1567
|
-
|
|
1568
|
-
|
|
1569
|
-
|
|
1570
|
-
|
|
1571
|
-
|
|
1538
|
+
"actions": [
|
|
1539
|
+
{
|
|
1540
|
+
"name": "passkey",
|
|
1541
|
+
"kind": "passkey",
|
|
1542
|
+
"primary": true,
|
|
1543
|
+
"text_key": "passkey-first.action.passkey"
|
|
1544
|
+
},
|
|
1545
|
+
{
|
|
1546
|
+
"name": "email_fallback",
|
|
1547
|
+
"kind": "navigate",
|
|
1548
|
+
"primary": false,
|
|
1549
|
+
"text_key": "passkey-first.action.email_fallback"
|
|
1550
|
+
},
|
|
1551
|
+
{
|
|
1552
|
+
"name": "register",
|
|
1553
|
+
"kind": "navigate",
|
|
1554
|
+
"primary": false,
|
|
1555
|
+
"text_key": "identifier.action.register.link"
|
|
1556
|
+
}
|
|
1557
|
+
],
|
|
1572
1558
|
"transitions": {
|
|
1573
1559
|
"passkey": { "target": "done" },
|
|
1574
1560
|
"email_fallback": { "target": "identifier" },
|
|
1575
|
-
"user_not_found": { "target": "register" }
|
|
1561
|
+
"user_not_found": { "target": "register" },
|
|
1562
|
+
"register": {
|
|
1563
|
+
"target": "register",
|
|
1564
|
+
"purpose": "register"
|
|
1565
|
+
}
|
|
1576
1566
|
}
|
|
1577
1567
|
},
|
|
1578
1568
|
{
|
|
1579
1569
|
"name": "identifier",
|
|
1580
1570
|
"fields": ["email"],
|
|
1581
|
-
"actions": [
|
|
1582
|
-
|
|
1583
|
-
|
|
1584
|
-
|
|
1585
|
-
|
|
1586
|
-
|
|
1587
|
-
|
|
1588
|
-
|
|
1589
|
-
|
|
1590
|
-
|
|
1591
|
-
|
|
1571
|
+
"actions": [
|
|
1572
|
+
{
|
|
1573
|
+
"name": "submit",
|
|
1574
|
+
"kind": "submit",
|
|
1575
|
+
"primary": true,
|
|
1576
|
+
"text_key": "identifier.action.continue"
|
|
1577
|
+
},
|
|
1578
|
+
{
|
|
1579
|
+
"name": "passkey",
|
|
1580
|
+
"kind": "passkey",
|
|
1581
|
+
"primary": false,
|
|
1582
|
+
"text_key": "identifier.action.passkey"
|
|
1583
|
+
},
|
|
1584
|
+
{
|
|
1585
|
+
"name": "register",
|
|
1586
|
+
"kind": "navigate",
|
|
1587
|
+
"primary": false,
|
|
1588
|
+
"text_key": "identifier.action.register.link"
|
|
1589
|
+
}
|
|
1590
|
+
],
|
|
1592
1591
|
"transitions": {
|
|
1593
1592
|
"submit": { "target": "password" },
|
|
1594
1593
|
"passkey": { "target": "done" },
|
|
1595
|
-
"user_not_found": { "target": "register" }
|
|
1594
|
+
"user_not_found": { "target": "register" },
|
|
1595
|
+
"register": {
|
|
1596
|
+
"target": "register",
|
|
1597
|
+
"purpose": "register"
|
|
1598
|
+
}
|
|
1596
1599
|
}
|
|
1597
1600
|
},
|
|
1598
1601
|
{
|
|
@@ -1617,21 +1620,34 @@ var login_default = {
|
|
|
1617
1620
|
{
|
|
1618
1621
|
"name": "register",
|
|
1619
1622
|
"fields": ["email"],
|
|
1620
|
-
"actions": [
|
|
1621
|
-
|
|
1622
|
-
|
|
1623
|
-
|
|
1624
|
-
|
|
1625
|
-
|
|
1626
|
-
|
|
1627
|
-
|
|
1628
|
-
|
|
1629
|
-
|
|
1630
|
-
|
|
1623
|
+
"actions": [
|
|
1624
|
+
{
|
|
1625
|
+
"name": "passkey_register",
|
|
1626
|
+
"kind": "passkey_register",
|
|
1627
|
+
"primary": true,
|
|
1628
|
+
"text_key": "register.action.passkey"
|
|
1629
|
+
},
|
|
1630
|
+
{
|
|
1631
|
+
"name": "submit",
|
|
1632
|
+
"kind": "submit",
|
|
1633
|
+
"primary": false,
|
|
1634
|
+
"text_key": "register.action.password"
|
|
1635
|
+
},
|
|
1636
|
+
{
|
|
1637
|
+
"name": "sign_in",
|
|
1638
|
+
"kind": "navigate",
|
|
1639
|
+
"primary": false,
|
|
1640
|
+
"text_key": "register.action.sign_in.link"
|
|
1641
|
+
}
|
|
1642
|
+
],
|
|
1631
1643
|
"transitions": {
|
|
1632
1644
|
"passkey_register": { "target": "done" },
|
|
1633
1645
|
"submit": { "target": "register-password" },
|
|
1634
|
-
"user_already_exists": { "target": "password" }
|
|
1646
|
+
"user_already_exists": { "target": "password" },
|
|
1647
|
+
"sign_in": {
|
|
1648
|
+
"target": "passkey-first",
|
|
1649
|
+
"purpose": "login"
|
|
1650
|
+
}
|
|
1635
1651
|
}
|
|
1636
1652
|
},
|
|
1637
1653
|
{
|
|
@@ -1832,12 +1848,12 @@ async function bootstrapProject(options) {
|
|
|
1832
1848
|
const { baseUrl } = options;
|
|
1833
1849
|
const project = await createZitadelClient({ baseUrl }).createProject({
|
|
1834
1850
|
name: options.projectName ?? DEFAULT_PROJECT_NAME,
|
|
1835
|
-
|
|
1836
|
-
|
|
1851
|
+
preview_origins: options.appOrigins ?? [],
|
|
1852
|
+
seed_defaults: false
|
|
1837
1853
|
});
|
|
1838
1854
|
const projectId = requireString(project.id, "project id");
|
|
1839
|
-
const projectSecret = requireString(project.
|
|
1840
|
-
const previewSecret = typeof project.
|
|
1855
|
+
const projectSecret = requireString(project.project_secret, "project secret");
|
|
1856
|
+
const previewSecret = typeof project.preview_secret === "string" ? project.preview_secret : void 0;
|
|
1841
1857
|
const client = createZitadelClient({
|
|
1842
1858
|
baseUrl,
|
|
1843
1859
|
token: projectSecret
|
|
@@ -1988,9 +2004,8 @@ function getFreePort() {
|
|
|
1988
2004
|
/**
|
|
1989
2005
|
* Boot an ephemeral local server by shelling out to `zitadel start` and parse
|
|
1990
2006
|
* its JSON envelope. The CLI owns the subtle parts (port preflight, health
|
|
1991
|
-
* wait, process-group stop
|
|
1992
|
-
*
|
|
1993
|
-
* shape returned here.
|
|
2007
|
+
* wait, process-group stop), so this module stays a thin adapter; swapping it
|
|
2008
|
+
* for direct library calls later must not change the shape returned here.
|
|
1994
2009
|
*/
|
|
1995
2010
|
async function bootLocalServer(options = {}) {
|
|
1996
2011
|
const ownsDir = options.dir === void 0;
|
|
@@ -2095,8 +2110,9 @@ function identity() {
|
|
|
2095
2110
|
}
|
|
2096
2111
|
/**
|
|
2097
2112
|
* Create a user that can immediately complete the password login flow:
|
|
2098
|
-
* `POST /users` (the body
|
|
2099
|
-
* `PUT /users/{id}/password` with
|
|
2113
|
+
* `POST /users` (the body carries `schema: <schema id>` and the schema-defined
|
|
2114
|
+
* content under `attributes`) followed by `PUT /users/{id}/password` with
|
|
2115
|
+
* `is_change_required: false`.
|
|
2100
2116
|
*
|
|
2101
2117
|
* Defaults mint a unique email per call (email is x-unique per project), which
|
|
2102
2118
|
* is what makes per-test seeding parallel-safe on a shared instance.
|
|
@@ -2106,14 +2122,16 @@ async function seedUser(client, context, input = {}) {
|
|
|
2106
2122
|
const email = input.email ?? fresh.email;
|
|
2107
2123
|
const password = input.password ?? fresh.password;
|
|
2108
2124
|
const id = requireString((await client.createUser({
|
|
2109
|
-
|
|
2110
|
-
|
|
2111
|
-
|
|
2125
|
+
schema: context.schemaId,
|
|
2126
|
+
attributes: {
|
|
2127
|
+
...input.attributes,
|
|
2128
|
+
email
|
|
2129
|
+
}
|
|
2112
2130
|
}, { project_id: context.projectId })).id, "user id");
|
|
2113
2131
|
await client.setUserPassword(id, {
|
|
2114
2132
|
password,
|
|
2115
|
-
|
|
2116
|
-
}
|
|
2133
|
+
is_change_required: false
|
|
2134
|
+
});
|
|
2117
2135
|
return {
|
|
2118
2136
|
id,
|
|
2119
2137
|
email,
|
|
@@ -2284,7 +2302,7 @@ function connectZitadel(handle) {
|
|
|
2284
2302
|
};
|
|
2285
2303
|
}
|
|
2286
2304
|
/**
|
|
2287
|
-
* Boot an ephemeral local instance (binary runtime +
|
|
2305
|
+
* Boot an ephemeral local instance (binary runtime + SQLite by default, no
|
|
2288
2306
|
* Docker) and bootstrap a project + default schema + login flow on it. The
|
|
2289
2307
|
* result can seed loginable password users immediately.
|
|
2290
2308
|
*/
|
|
@@ -2353,4 +2371,4 @@ Object.defineProperty(exports, "startLocalZitadel", {
|
|
|
2353
2371
|
}
|
|
2354
2372
|
});
|
|
2355
2373
|
|
|
2356
|
-
//# sourceMappingURL=src-
|
|
2374
|
+
//# sourceMappingURL=src-I0KAh1zU.cjs.map
|