@workos-inc/node 10.13.0 → 10.14.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +22 -0
- package/lib/{factory-BfdUyn2X.cjs → factory-BkKapXtb.cjs} +304 -136
- package/lib/factory-BkKapXtb.cjs.map +1 -0
- package/lib/{factory-C4y25QQJ.d.cts → factory-CW0E3JEC.d.mts} +626 -133
- package/lib/{factory-DQwwZIi5.mjs → factory-Dqju-gCl.mjs} +299 -137
- package/lib/factory-Dqju-gCl.mjs.map +1 -0
- package/lib/{factory-C4y25QQJ.d.mts → factory-zrNVaAD9.d.cts} +627 -133
- package/lib/index.cjs +2 -1
- package/lib/index.d.cts +69 -69
- package/lib/index.d.mts +69 -69
- package/lib/index.mjs +2 -2
- package/lib/index.worker.cjs +2 -1
- package/lib/index.worker.d.cts +2 -2
- package/lib/index.worker.d.mts +2 -2
- package/lib/index.worker.mjs +2 -2
- package/lib/rolldown-runtime-D7D4PA-g.mjs +13 -0
- package/lib/webapi-C2FQ2NNL.mjs +2445 -0
- package/lib/webapi-C2FQ2NNL.mjs.map +1 -0
- package/lib/webapi-MD5xmNba.cjs +2503 -0
- package/lib/webapi-MD5xmNba.cjs.map +1 -0
- package/package.json +4 -4
- package/lib/factory-BfdUyn2X.cjs.map +0 -1
- package/lib/factory-DQwwZIi5.mjs.map +0 -1
- package/lib/webapi-BlhUk1KL.mjs +0 -2905
- package/lib/webapi-BlhUk1KL.mjs.map +0 -1
- package/lib/webapi-D3QZrB15.cjs +0 -2952
- package/lib/webapi-D3QZrB15.cjs.map +0 -1
|
@@ -122,9 +122,32 @@ var HttpClient = class HttpClient {
|
|
|
122
122
|
this.MAX_RETRY_ATTEMPTS = options?.maxRetries ?? 3;
|
|
123
123
|
}
|
|
124
124
|
static getResourceURL(baseURL, path, params) {
|
|
125
|
+
HttpClient.assertNoDotSegments(path);
|
|
125
126
|
const queryString = HttpClient.getQueryString(params);
|
|
126
127
|
return new URL([path, queryString].filter(Boolean).join("?"), baseURL).toString();
|
|
127
128
|
}
|
|
129
|
+
/**
|
|
130
|
+
* Reject request paths that contain a single-dot or double-dot segment.
|
|
131
|
+
*
|
|
132
|
+
* SDK path templates never contain such segments themselves, but a
|
|
133
|
+
* caller-supplied identifier interpolated with bare `encodeURIComponent`
|
|
134
|
+
* (the form the generated modules use) passes `.` and `..` through
|
|
135
|
+
* unchanged, and the WHATWG `URL` parser then collapses them, retargeting
|
|
136
|
+
* the request to a different endpoint (for example
|
|
137
|
+
* `/organizations/../api_keys` resolves to `/api_keys`). The parser also
|
|
138
|
+
* treats the percent-encoded forms (`%2e`, case-insensitive) as dots, so
|
|
139
|
+
* those are matched as well. Encoded values never trip this check because
|
|
140
|
+
* `encodeURIComponent` turns `%` into `%25` and `/` into `%2F`, keeping
|
|
141
|
+
* each identifier inside its own segment. Fail closed before any request
|
|
142
|
+
* is built.
|
|
143
|
+
*/
|
|
144
|
+
static assertNoDotSegments(path) {
|
|
145
|
+
const pathOnly = path.split(/[?#]/, 1)[0];
|
|
146
|
+
for (const segment of pathOnly.split("/")) {
|
|
147
|
+
const normalized = segment.replace(/%2e/gi, ".");
|
|
148
|
+
if (normalized === "." || normalized === "..") throw new TypeError(`Invalid request path "${path}": a path segment must not be "." or "..".`);
|
|
149
|
+
}
|
|
150
|
+
}
|
|
128
151
|
static getQueryString(queryObj) {
|
|
129
152
|
if (!queryObj) return void 0;
|
|
130
153
|
const sanitizedQueryObj = {};
|
|
@@ -273,10 +296,19 @@ var FetchHttpClient = class FetchHttpClient extends HttpClient {
|
|
|
273
296
|
const timeout = this.options?.timeout ?? DEFAULT_FETCH_TIMEOUT;
|
|
274
297
|
const abortController = new AbortController();
|
|
275
298
|
const timeoutId = setTimeout(() => {
|
|
276
|
-
abortController
|
|
299
|
+
abortController.abort();
|
|
277
300
|
}, timeout);
|
|
301
|
+
const timeoutError = (responseHeaders) => new HttpClientError({
|
|
302
|
+
message: `Request timeout after ${timeout}ms`,
|
|
303
|
+
response: {
|
|
304
|
+
status: 408,
|
|
305
|
+
headers: responseHeaders ?? new Headers(),
|
|
306
|
+
data: { error: "Request timeout" }
|
|
307
|
+
}
|
|
308
|
+
});
|
|
309
|
+
let res;
|
|
278
310
|
try {
|
|
279
|
-
|
|
311
|
+
res = await this._fetchFn(url, {
|
|
280
312
|
method,
|
|
281
313
|
headers: {
|
|
282
314
|
Accept: "application/json, text/plain, */*",
|
|
@@ -286,12 +318,12 @@ var FetchHttpClient = class FetchHttpClient extends HttpClient {
|
|
|
286
318
|
"User-Agent": (userAgent || "workos-node").toString()
|
|
287
319
|
},
|
|
288
320
|
body: requestBody,
|
|
289
|
-
signal: abortController
|
|
321
|
+
signal: abortController.signal
|
|
290
322
|
});
|
|
291
|
-
if (timeoutId) clearTimeout(timeoutId);
|
|
292
323
|
if (!res.ok) {
|
|
293
324
|
const requestID = res.headers.get("X-Request-ID") ?? "";
|
|
294
325
|
const rawBody = await res.text();
|
|
326
|
+
clearTimeout(timeoutId);
|
|
295
327
|
let responseJson;
|
|
296
328
|
try {
|
|
297
329
|
responseJson = JSON.parse(rawBody);
|
|
@@ -314,17 +346,21 @@ var FetchHttpClient = class FetchHttpClient extends HttpClient {
|
|
|
314
346
|
}
|
|
315
347
|
});
|
|
316
348
|
}
|
|
317
|
-
|
|
318
|
-
|
|
319
|
-
|
|
320
|
-
|
|
321
|
-
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
325
|
-
data: { error: "Request timeout" }
|
|
349
|
+
const response = res;
|
|
350
|
+
const rawBody = (async () => {
|
|
351
|
+
try {
|
|
352
|
+
return await response.text();
|
|
353
|
+
} catch (error) {
|
|
354
|
+
throw abortController.signal.aborted ? timeoutError(response.headers) : error;
|
|
355
|
+
} finally {
|
|
356
|
+
clearTimeout(timeoutId);
|
|
326
357
|
}
|
|
327
|
-
});
|
|
358
|
+
})();
|
|
359
|
+
rawBody.catch(() => void 0);
|
|
360
|
+
return new FetchHttpClientResponse(res, rawBody);
|
|
361
|
+
} catch (error) {
|
|
362
|
+
clearTimeout(timeoutId);
|
|
363
|
+
if (abortController.signal.aborted) throw timeoutError(res?.headers);
|
|
328
364
|
throw error;
|
|
329
365
|
}
|
|
330
366
|
}
|
|
@@ -384,16 +420,18 @@ var FetchHttpClient = class FetchHttpClient extends HttpClient {
|
|
|
384
420
|
};
|
|
385
421
|
var FetchHttpClientResponse = class FetchHttpClientResponse extends HttpClientResponse {
|
|
386
422
|
_res;
|
|
387
|
-
|
|
423
|
+
_rawBody;
|
|
424
|
+
constructor(res, rawBody) {
|
|
388
425
|
super(res.status, FetchHttpClientResponse._transformHeadersToObject(res.headers));
|
|
389
426
|
this._res = res;
|
|
427
|
+
this._rawBody = rawBody;
|
|
390
428
|
}
|
|
391
429
|
getRawResponse() {
|
|
392
430
|
return this._res;
|
|
393
431
|
}
|
|
394
432
|
async toJSON() {
|
|
433
|
+
const rawBody = await this._rawBody;
|
|
395
434
|
if (!this._res.headers.get("content-type")?.includes("application/json")) return null;
|
|
396
|
-
const rawBody = await this._res.text();
|
|
397
435
|
try {
|
|
398
436
|
return JSON.parse(rawBody);
|
|
399
437
|
} catch (error) {
|
|
@@ -2203,7 +2241,7 @@ let _josePromise;
|
|
|
2203
2241
|
* @returns Promise that resolves to the jose module
|
|
2204
2242
|
*/
|
|
2205
2243
|
function getJose() {
|
|
2206
|
-
return _josePromise ??= Promise.resolve().then(() => require("./webapi-
|
|
2244
|
+
return _josePromise ??= Promise.resolve().then(() => require("./webapi-MD5xmNba.cjs"));
|
|
2207
2245
|
}
|
|
2208
2246
|
//#endregion
|
|
2209
2247
|
//#region src/agents/serializers/agent-blueprint.serializer.ts
|
|
@@ -2811,7 +2849,7 @@ var ApiKeys = class {
|
|
|
2811
2849
|
* @throws {NotFoundException} 404
|
|
2812
2850
|
*/
|
|
2813
2851
|
async deleteApiKey(id) {
|
|
2814
|
-
await this.workos.delete(`/api_keys/${id}`);
|
|
2852
|
+
await this.workos.delete(`/api_keys/${encodeURIComponent(id)}`);
|
|
2815
2853
|
}
|
|
2816
2854
|
/**
|
|
2817
2855
|
* List API keys for an organization
|
|
@@ -2828,7 +2866,7 @@ var ApiKeys = class {
|
|
|
2828
2866
|
*/
|
|
2829
2867
|
async listOrganizationApiKeys(options) {
|
|
2830
2868
|
const { organizationId, ...paginationOptions } = options;
|
|
2831
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${organizationId}/api_keys`, deserializeApiKey, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${organizationId}/api_keys`, deserializeApiKey, params), paginationOptions);
|
|
2869
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${encodeURIComponent(organizationId)}/api_keys`, deserializeApiKey, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${encodeURIComponent(organizationId)}/api_keys`, deserializeApiKey, params), paginationOptions);
|
|
2832
2870
|
}
|
|
2833
2871
|
/**
|
|
2834
2872
|
* Create an API key for an organization
|
|
@@ -2846,7 +2884,7 @@ var ApiKeys = class {
|
|
|
2846
2884
|
*/
|
|
2847
2885
|
async createOrganizationApiKey(options, requestOptions = {}) {
|
|
2848
2886
|
const { organizationId } = options;
|
|
2849
|
-
const { data } = await this.workos.post(`/organizations/${organizationId}/api_keys`, serializeCreateOrganizationApiKeyOptions(options), requestOptions);
|
|
2887
|
+
const { data } = await this.workos.post(`/organizations/${encodeURIComponent(organizationId)}/api_keys`, serializeCreateOrganizationApiKeyOptions(options), requestOptions);
|
|
2850
2888
|
return deserializeCreatedApiKey(data);
|
|
2851
2889
|
}
|
|
2852
2890
|
};
|
|
@@ -3203,6 +3241,43 @@ var Connect = class {
|
|
|
3203
3241
|
}
|
|
3204
3242
|
};
|
|
3205
3243
|
//#endregion
|
|
3244
|
+
//#region src/common/utils/encode-path-parameter.ts
|
|
3245
|
+
/**
|
|
3246
|
+
* Encode a caller-supplied identifier for safe interpolation into a single URL
|
|
3247
|
+
* path segment.
|
|
3248
|
+
*
|
|
3249
|
+
* SDK path templates interpolate caller-supplied identifiers (user IDs,
|
|
3250
|
+
* invitation tokens, MFA factor IDs, organization IDs, external IDs, role and
|
|
3251
|
+
* permission slugs, ...) into the request path. Without encoding, a value such
|
|
3252
|
+
* as `../../user_management/users/user_01ABC` would be resolved by the WHATWG
|
|
3253
|
+
* `URL` parser (see `HttpClient.getResourceURL`) into a different API path,
|
|
3254
|
+
* letting an attacker who influences one identifier retarget the request to an
|
|
3255
|
+
* arbitrary same-verb endpoint. `encodeURIComponent` neutralizes this by
|
|
3256
|
+
* percent-encoding the path/query/fragment metacharacters (`/`, `?`, `#`, ...)
|
|
3257
|
+
* that enable the injection, keeping one parameter mapped to exactly one path
|
|
3258
|
+
* segment.
|
|
3259
|
+
*
|
|
3260
|
+
* `encodeURIComponent` alone is not sufficient for the two dot-only segments
|
|
3261
|
+
* `.` and `..`: it leaves them unchanged, and the WHATWG `URL` parser then
|
|
3262
|
+
* removes them as relative path segments (even when a value like `..` is a
|
|
3263
|
+
* single segment, a template such as `/feature-flags/${slug}/enable` supplies
|
|
3264
|
+
* the trailing segment, so `..` still climbs and retargets the request).
|
|
3265
|
+
* Percent-encoding the dots does not help because the parser also treats the
|
|
3266
|
+
* `%2e` forms as dot segments. A `.` or `..` is never a valid WorkOS
|
|
3267
|
+
* identifier, so we fail closed and throw rather than emit an ambiguous path.
|
|
3268
|
+
*
|
|
3269
|
+
* The one deviation from `encodeURIComponent` is that a literal `:` is kept
|
|
3270
|
+
* unescaped. Colons are valid path-segment characters (RFC 3986 `pchar`) and
|
|
3271
|
+
* are used by WorkOS RBAC slugs (e.g. `users:read`); an interpolated value is
|
|
3272
|
+
* always preceded by a `/`-delimited segment, so a `:` can never be read as a
|
|
3273
|
+
* URL scheme. Preserving it keeps the wire format identical for existing slugs.
|
|
3274
|
+
*/
|
|
3275
|
+
function encodePathParameter(value) {
|
|
3276
|
+
const encoded = encodeURIComponent(value).replace(/%3A/gi, ":");
|
|
3277
|
+
if (encoded === "." || encoded === "..") throw new TypeError("Invalid path parameter: a path parameter must not be \".\" or \"..\".");
|
|
3278
|
+
return encoded;
|
|
3279
|
+
}
|
|
3280
|
+
//#endregion
|
|
3206
3281
|
//#region src/directory-sync/directory-sync.ts
|
|
3207
3282
|
var DirectorySync = class {
|
|
3208
3283
|
workos;
|
|
@@ -3235,7 +3310,7 @@ var DirectorySync = class {
|
|
|
3235
3310
|
* @throws {NotFoundException} 404
|
|
3236
3311
|
*/
|
|
3237
3312
|
async getDirectory(id) {
|
|
3238
|
-
const { data } = await this.workos.get(`/directories/${id}`);
|
|
3313
|
+
const { data } = await this.workos.get(`/directories/${encodePathParameter(id)}`);
|
|
3239
3314
|
return deserializeDirectory(data);
|
|
3240
3315
|
}
|
|
3241
3316
|
/**
|
|
@@ -3251,7 +3326,7 @@ var DirectorySync = class {
|
|
|
3251
3326
|
* @throws 403 response from the API.
|
|
3252
3327
|
*/
|
|
3253
3328
|
async deleteDirectory(id) {
|
|
3254
|
-
await this.workos.delete(`/directories/${id}`);
|
|
3329
|
+
await this.workos.delete(`/directories/${encodePathParameter(id)}`);
|
|
3255
3330
|
}
|
|
3256
3331
|
/**
|
|
3257
3332
|
* List Directory Groups
|
|
@@ -3293,7 +3368,7 @@ var DirectorySync = class {
|
|
|
3293
3368
|
* @throws {NotFoundException} 404
|
|
3294
3369
|
*/
|
|
3295
3370
|
async getUser(user) {
|
|
3296
|
-
const { data } = await this.workos.get(`/directory_users/${user}`);
|
|
3371
|
+
const { data } = await this.workos.get(`/directory_users/${encodePathParameter(user)}`);
|
|
3297
3372
|
return deserializeDirectoryUserWithGroups(data);
|
|
3298
3373
|
}
|
|
3299
3374
|
/**
|
|
@@ -3309,7 +3384,7 @@ var DirectorySync = class {
|
|
|
3309
3384
|
* @throws {NotFoundException} 404
|
|
3310
3385
|
*/
|
|
3311
3386
|
async getGroup(group) {
|
|
3312
|
-
const { data } = await this.workos.get(`/directory_groups/${group}`);
|
|
3387
|
+
const { data } = await this.workos.get(`/directory_groups/${encodePathParameter(group)}`);
|
|
3313
3388
|
return deserializeDirectoryGroup(data);
|
|
3314
3389
|
}
|
|
3315
3390
|
};
|
|
@@ -3390,7 +3465,7 @@ var Organizations = class {
|
|
|
3390
3465
|
* @throws 403 response from the API.
|
|
3391
3466
|
*/
|
|
3392
3467
|
async deleteOrganization(id) {
|
|
3393
|
-
await this.workos.delete(`/organizations/${id}`);
|
|
3468
|
+
await this.workos.delete(`/organizations/${encodePathParameter(id)}`);
|
|
3394
3469
|
}
|
|
3395
3470
|
/**
|
|
3396
3471
|
* Get an Organization
|
|
@@ -3405,7 +3480,7 @@ var Organizations = class {
|
|
|
3405
3480
|
* @throws {NotFoundException} 404
|
|
3406
3481
|
*/
|
|
3407
3482
|
async getOrganization(id) {
|
|
3408
|
-
const { data } = await this.workos.get(`/organizations/${id}`);
|
|
3483
|
+
const { data } = await this.workos.get(`/organizations/${encodePathParameter(id)}`);
|
|
3409
3484
|
return deserializeOrganization(data);
|
|
3410
3485
|
}
|
|
3411
3486
|
/**
|
|
@@ -3421,7 +3496,7 @@ var Organizations = class {
|
|
|
3421
3496
|
* @throws {NotFoundException} 404
|
|
3422
3497
|
*/
|
|
3423
3498
|
async getOrganizationByExternalId(externalId) {
|
|
3424
|
-
const { data } = await this.workos.get(`/organizations/external_id/${externalId}`);
|
|
3499
|
+
const { data } = await this.workos.get(`/organizations/external_id/${encodePathParameter(externalId)}`);
|
|
3425
3500
|
return deserializeOrganization(data);
|
|
3426
3501
|
}
|
|
3427
3502
|
/**
|
|
@@ -3438,7 +3513,7 @@ var Organizations = class {
|
|
|
3438
3513
|
*/
|
|
3439
3514
|
async updateOrganization(options) {
|
|
3440
3515
|
const { organization: organizationId, ...payload } = options;
|
|
3441
|
-
const { data } = await this.workos.put(`/organizations/${organizationId}`, serializeUpdateOrganizationOptions(payload));
|
|
3516
|
+
const { data } = await this.workos.put(`/organizations/${encodePathParameter(organizationId)}`, serializeUpdateOrganizationOptions(payload));
|
|
3442
3517
|
return deserializeOrganization(data);
|
|
3443
3518
|
}
|
|
3444
3519
|
/**
|
|
@@ -3452,7 +3527,7 @@ var Organizations = class {
|
|
|
3452
3527
|
*/
|
|
3453
3528
|
async listItContacts(options) {
|
|
3454
3529
|
const { organizationId } = options;
|
|
3455
|
-
const { data } = await this.workos.get(`/organizations/${organizationId}/it_contacts`);
|
|
3530
|
+
const { data } = await this.workos.get(`/organizations/${encodePathParameter(organizationId)}/it_contacts`);
|
|
3456
3531
|
return {
|
|
3457
3532
|
object: data.object,
|
|
3458
3533
|
data: data.data.map(deserializeItContact),
|
|
@@ -3477,7 +3552,7 @@ var Organizations = class {
|
|
|
3477
3552
|
*/
|
|
3478
3553
|
async createItContact(options) {
|
|
3479
3554
|
const { organizationId, ...payload } = options;
|
|
3480
|
-
const { data } = await this.workos.post(`/organizations/${organizationId}/it_contacts`, serializeCreateItContactOptions(payload));
|
|
3555
|
+
const { data } = await this.workos.post(`/organizations/${encodePathParameter(organizationId)}/it_contacts`, serializeCreateItContactOptions(payload));
|
|
3481
3556
|
return deserializeItContact(data);
|
|
3482
3557
|
}
|
|
3483
3558
|
/**
|
|
@@ -3492,7 +3567,7 @@ var Organizations = class {
|
|
|
3492
3567
|
*/
|
|
3493
3568
|
async deleteItContact(options) {
|
|
3494
3569
|
const { organizationId, contactId } = options;
|
|
3495
|
-
await this.workos.delete(`/organizations/${organizationId}/it_contacts/${contactId}`);
|
|
3570
|
+
await this.workos.delete(`/organizations/${encodePathParameter(organizationId)}/it_contacts/${encodePathParameter(contactId)}`);
|
|
3496
3571
|
}
|
|
3497
3572
|
/**
|
|
3498
3573
|
* Invite an IT Contact
|
|
@@ -3508,7 +3583,7 @@ var Organizations = class {
|
|
|
3508
3583
|
*/
|
|
3509
3584
|
async inviteItContact(options) {
|
|
3510
3585
|
const { organizationId, contactId, ...payload } = options;
|
|
3511
|
-
await this.workos.post(`/organizations/${organizationId}/it_contacts/${contactId}/invite`, serializeInviteItContactOptions(payload));
|
|
3586
|
+
await this.workos.post(`/organizations/${encodePathParameter(organizationId)}/it_contacts/${encodePathParameter(contactId)}/invite`, serializeInviteItContactOptions(payload));
|
|
3512
3587
|
}
|
|
3513
3588
|
/**
|
|
3514
3589
|
* Revoke an IT Contact's invitation
|
|
@@ -3521,7 +3596,7 @@ var Organizations = class {
|
|
|
3521
3596
|
*/
|
|
3522
3597
|
async revokeItContact(options) {
|
|
3523
3598
|
const { organizationId, contactId } = options;
|
|
3524
|
-
await this.workos.post(`/organizations/${organizationId}/it_contacts/${contactId}/revoke`, {});
|
|
3599
|
+
await this.workos.post(`/organizations/${encodePathParameter(organizationId)}/it_contacts/${encodePathParameter(contactId)}/revoke`, {});
|
|
3525
3600
|
}
|
|
3526
3601
|
};
|
|
3527
3602
|
//#endregion
|
|
@@ -3550,7 +3625,7 @@ var OrganizationDomains = class {
|
|
|
3550
3625
|
* @throws {NotFoundException} 404
|
|
3551
3626
|
*/
|
|
3552
3627
|
async getOrganizationDomain(id) {
|
|
3553
|
-
const { data } = await this.workos.get(`/organization_domains/${id}`);
|
|
3628
|
+
const { data } = await this.workos.get(`/organization_domains/${encodePathParameter(id)}`);
|
|
3554
3629
|
return deserializeOrganizationDomain(data);
|
|
3555
3630
|
}
|
|
3556
3631
|
/**
|
|
@@ -3566,7 +3641,7 @@ var OrganizationDomains = class {
|
|
|
3566
3641
|
* @throws {BadRequestException} 400
|
|
3567
3642
|
*/
|
|
3568
3643
|
async verifyOrganizationDomain(id) {
|
|
3569
|
-
const { data } = await this.workos.post(`/organization_domains/${id}/verify`, {});
|
|
3644
|
+
const { data } = await this.workos.post(`/organization_domains/${encodePathParameter(id)}/verify`, {});
|
|
3570
3645
|
return deserializeOrganizationDomain(data);
|
|
3571
3646
|
}
|
|
3572
3647
|
/**
|
|
@@ -3594,7 +3669,7 @@ var OrganizationDomains = class {
|
|
|
3594
3669
|
* @throws {NotFoundException} 404
|
|
3595
3670
|
*/
|
|
3596
3671
|
async deleteOrganizationDomain(id) {
|
|
3597
|
-
await this.workos.delete(`/organization_domains/${id}`);
|
|
3672
|
+
await this.workos.delete(`/organization_domains/${encodePathParameter(id)}`);
|
|
3598
3673
|
}
|
|
3599
3674
|
};
|
|
3600
3675
|
//#endregion
|
|
@@ -3622,7 +3697,7 @@ var Passwordless = class {
|
|
|
3622
3697
|
return deserializePasswordlessSession(data);
|
|
3623
3698
|
}
|
|
3624
3699
|
async sendSession(sessionId) {
|
|
3625
|
-
const { data } = await this.workos.post(`/passwordless/sessions/${sessionId}/send`, {});
|
|
3700
|
+
const { data } = await this.workos.post(`/passwordless/sessions/${encodePathParameter(sessionId)}/send`, {});
|
|
3626
3701
|
return data;
|
|
3627
3702
|
}
|
|
3628
3703
|
};
|
|
@@ -4384,7 +4459,7 @@ var SSO = class {
|
|
|
4384
4459
|
* @throws {NotFoundException} 404
|
|
4385
4460
|
*/
|
|
4386
4461
|
async deleteConnection(id) {
|
|
4387
|
-
await this.workos.delete(`/connections/${id}`);
|
|
4462
|
+
await this.workos.delete(`/connections/${encodePathParameter(id)}`);
|
|
4388
4463
|
}
|
|
4389
4464
|
getAuthorizationUrl(options) {
|
|
4390
4465
|
const { codeChallenge, codeChallengeMethod, connection, clientId, domainHint, loginHint, organization, provider, providerQueryParams, providerScopes, redirectUri, state } = options;
|
|
@@ -4470,7 +4545,7 @@ var SSO = class {
|
|
|
4470
4545
|
* @throws {NotFoundException} 404
|
|
4471
4546
|
*/
|
|
4472
4547
|
async getConnection(id) {
|
|
4473
|
-
const { data } = await this.workos.get(`/connections/${id}`);
|
|
4548
|
+
const { data } = await this.workos.get(`/connections/${encodePathParameter(id)}`);
|
|
4474
4549
|
return deserializeConnection(data);
|
|
4475
4550
|
}
|
|
4476
4551
|
/**
|
|
@@ -4571,7 +4646,7 @@ var MultiFactorAuth = class {
|
|
|
4571
4646
|
* @throws {NotFoundException} 404
|
|
4572
4647
|
*/
|
|
4573
4648
|
async deleteFactor(id) {
|
|
4574
|
-
await this.workos.delete(`/auth/factors/${id}`);
|
|
4649
|
+
await this.workos.delete(`/auth/factors/${encodePathParameter(id)}`);
|
|
4575
4650
|
}
|
|
4576
4651
|
/**
|
|
4577
4652
|
* Get Factor
|
|
@@ -4586,7 +4661,7 @@ var MultiFactorAuth = class {
|
|
|
4586
4661
|
* @throws {NotFoundException} 404
|
|
4587
4662
|
*/
|
|
4588
4663
|
async getFactor(id) {
|
|
4589
|
-
const { data } = await this.workos.get(`/auth/factors/${id}`);
|
|
4664
|
+
const { data } = await this.workos.get(`/auth/factors/${encodePathParameter(id)}`);
|
|
4590
4665
|
return deserializeFactor(data);
|
|
4591
4666
|
}
|
|
4592
4667
|
/**
|
|
@@ -4623,7 +4698,7 @@ var MultiFactorAuth = class {
|
|
|
4623
4698
|
* @throws {UnprocessableEntityException} 422
|
|
4624
4699
|
*/
|
|
4625
4700
|
async challengeFactor(options) {
|
|
4626
|
-
const { data } = await this.workos.post(`/auth/factors/${options.authenticationFactorId}/challenge`, { sms_template: "smsTemplate" in options ? options.smsTemplate : void 0 });
|
|
4701
|
+
const { data } = await this.workos.post(`/auth/factors/${encodePathParameter(options.authenticationFactorId)}/challenge`, { sms_template: "smsTemplate" in options ? options.smsTemplate : void 0 });
|
|
4627
4702
|
return deserializeChallenge(data);
|
|
4628
4703
|
}
|
|
4629
4704
|
/**
|
|
@@ -4637,7 +4712,7 @@ var MultiFactorAuth = class {
|
|
|
4637
4712
|
* @throws {UnprocessableEntityException} 422
|
|
4638
4713
|
*/
|
|
4639
4714
|
async verifyChallenge(options) {
|
|
4640
|
-
const { data } = await this.workos.post(`/auth/challenges/${options.authenticationChallengeId}/verify`, { code: options.code });
|
|
4715
|
+
const { data } = await this.workos.post(`/auth/challenges/${encodePathParameter(options.authenticationChallengeId)}/verify`, { code: options.code });
|
|
4641
4716
|
return deserializeVerifyResponse(data);
|
|
4642
4717
|
}
|
|
4643
4718
|
/**
|
|
@@ -4649,7 +4724,7 @@ var MultiFactorAuth = class {
|
|
|
4649
4724
|
* @throws {UnprocessableEntityException} 422
|
|
4650
4725
|
*/
|
|
4651
4726
|
async createUserAuthFactor(payload) {
|
|
4652
|
-
const { data } = await this.workos.post(`/user_management/users/${payload.userId}/auth_factors`, serializeEnrollAuthFactorOptions(payload));
|
|
4727
|
+
const { data } = await this.workos.post(`/user_management/users/${encodePathParameter(payload.userId)}/auth_factors`, serializeEnrollAuthFactorOptions(payload));
|
|
4653
4728
|
return {
|
|
4654
4729
|
authenticationFactor: deserializeFactorWithSecrets$1(data.authentication_factor),
|
|
4655
4730
|
authenticationChallenge: deserializeChallenge(data.authentication_challenge)
|
|
@@ -4665,7 +4740,7 @@ var MultiFactorAuth = class {
|
|
|
4665
4740
|
*/
|
|
4666
4741
|
async listUserAuthFactors(options) {
|
|
4667
4742
|
const { userId, ...restOfOptions } = options;
|
|
4668
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/auth_factors`, deserializeFactor$1, restOfOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/auth_factors`, deserializeFactor$1, params), restOfOptions);
|
|
4743
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/auth_factors`, deserializeFactor$1, restOfOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/auth_factors`, deserializeFactor$1, params), restOfOptions);
|
|
4669
4744
|
}
|
|
4670
4745
|
};
|
|
4671
4746
|
//#endregion
|
|
@@ -4754,6 +4829,12 @@ const deserializeAuditLogSchema = (auditLogSchema) => ({
|
|
|
4754
4829
|
createdAt: auditLogSchema.created_at
|
|
4755
4830
|
});
|
|
4756
4831
|
//#endregion
|
|
4832
|
+
//#region src/audit-logs/serializers/audit-logs-retention.serializer.ts
|
|
4833
|
+
const deserializeAuditLogsRetention = (response) => ({ retentionPeriodInDays: response.retention_period_in_days ?? null });
|
|
4834
|
+
//#endregion
|
|
4835
|
+
//#region src/audit-logs/serializers/update-audit-logs-retention.serializer.ts
|
|
4836
|
+
const serializeUpdateAuditLogsRetention = (model) => ({ retention_period: model.retentionPeriod });
|
|
4837
|
+
//#endregion
|
|
4757
4838
|
//#region src/audit-logs/audit-logs.ts
|
|
4758
4839
|
var AuditLogs = class {
|
|
4759
4840
|
workos;
|
|
@@ -4761,6 +4842,39 @@ var AuditLogs = class {
|
|
|
4761
4842
|
this.workos = workos;
|
|
4762
4843
|
}
|
|
4763
4844
|
/**
|
|
4845
|
+
* Get Retention
|
|
4846
|
+
*
|
|
4847
|
+
* Get the configured event retention period for the given Organization.
|
|
4848
|
+
* @param options - The request options.
|
|
4849
|
+
* @param options.id - Unique identifier of the Organization.
|
|
4850
|
+
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
|
|
4851
|
+
* @returns {Promise<AuditLogsRetention>}
|
|
4852
|
+
* @throws {NotFoundException} 404
|
|
4853
|
+
*/
|
|
4854
|
+
async getOrganizationAuditLogsRetention(options) {
|
|
4855
|
+
const { id } = options;
|
|
4856
|
+
const { data } = await this.workos.get(`/organizations/${encodeURIComponent(id)}/audit_logs_retention`);
|
|
4857
|
+
return deserializeAuditLogsRetention(data);
|
|
4858
|
+
}
|
|
4859
|
+
/**
|
|
4860
|
+
* Set Retention
|
|
4861
|
+
*
|
|
4862
|
+
* Set the event retention period for the given Organization.
|
|
4863
|
+
* @param options - Object containing retentionPeriod.
|
|
4864
|
+
* @param options.id - Unique identifier of the Organization.
|
|
4865
|
+
* @example "org_01EHZNVPK3SFK441A1RGBFSHRT"
|
|
4866
|
+
* @param options.retentionPeriod - The period Audit Log events will be retained. Valid values are `1_MONTH` through `11_MONTHS` in one-month increments and `1_YEAR` through `10_YEARS` in one-year increments.
|
|
4867
|
+
* @example "1_MONTH"
|
|
4868
|
+
* @returns {Promise<AuditLogsRetention>}
|
|
4869
|
+
* @throws {NotFoundException} 404
|
|
4870
|
+
* @throws {UnprocessableEntityException} 422
|
|
4871
|
+
*/
|
|
4872
|
+
async updateOrganizationAuditLogsRetention(options) {
|
|
4873
|
+
const { id, ...payload } = options;
|
|
4874
|
+
const { data } = await this.workos.put(`/organizations/${encodeURIComponent(id)}/audit_logs_retention`, serializeUpdateAuditLogsRetention(payload));
|
|
4875
|
+
return deserializeAuditLogsRetention(data);
|
|
4876
|
+
}
|
|
4877
|
+
/**
|
|
4764
4878
|
* Create Event
|
|
4765
4879
|
*
|
|
4766
4880
|
* Create an Audit Log Event.
|
|
@@ -4812,7 +4926,7 @@ var AuditLogs = class {
|
|
|
4812
4926
|
* @throws {NotFoundException} 404
|
|
4813
4927
|
*/
|
|
4814
4928
|
async getExport(auditLogExportId) {
|
|
4815
|
-
const { data } = await this.workos.get(`/audit_logs/exports/${auditLogExportId}`);
|
|
4929
|
+
const { data } = await this.workos.get(`/audit_logs/exports/${encodePathParameter(auditLogExportId)}`);
|
|
4816
4930
|
return deserializeAuditLogExport(data);
|
|
4817
4931
|
}
|
|
4818
4932
|
/**
|
|
@@ -4824,11 +4938,11 @@ var AuditLogs = class {
|
|
|
4824
4938
|
* @throws {UnprocessableEntityException} 422
|
|
4825
4939
|
*/
|
|
4826
4940
|
async createSchema(schema, options = {}) {
|
|
4827
|
-
const { data } = await this.workos.post(`/audit_logs/actions/${schema.action}/schemas`, serializeCreateAuditLogSchemaOptions(schema), options);
|
|
4941
|
+
const { data } = await this.workos.post(`/audit_logs/actions/${encodePathParameter(schema.action)}/schemas`, serializeCreateAuditLogSchemaOptions(schema), options);
|
|
4828
4942
|
return deserializeAuditLogSchema(data);
|
|
4829
4943
|
}
|
|
4830
4944
|
async listSchemas(action, options) {
|
|
4831
|
-
const endpoint = `/audit_logs/actions/${action}/schemas`;
|
|
4945
|
+
const endpoint = `/audit_logs/actions/${encodePathParameter(action)}/schemas`;
|
|
4832
4946
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeAuditLogSchema, options), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeAuditLogSchema, params), options);
|
|
4833
4947
|
}
|
|
4834
4948
|
};
|
|
@@ -5407,8 +5521,8 @@ var CookieSession = class {
|
|
|
5407
5521
|
permissions,
|
|
5408
5522
|
entitlements,
|
|
5409
5523
|
featureFlags,
|
|
5410
|
-
user:
|
|
5411
|
-
impersonator:
|
|
5524
|
+
user: authenticationResponse.user,
|
|
5525
|
+
impersonator: authenticationResponse.impersonator
|
|
5412
5526
|
};
|
|
5413
5527
|
} catch (error) {
|
|
5414
5528
|
const terminalReason = classifyTerminalRefreshError(error);
|
|
@@ -5442,8 +5556,9 @@ var CookieSession = class {
|
|
|
5442
5556
|
const { jwtVerify } = await getJose();
|
|
5443
5557
|
const jwks = await this.userManagement.getJWKS();
|
|
5444
5558
|
if (!jwks) throw new Error("Missing client ID. Did you provide it when initializing WorkOS?");
|
|
5559
|
+
const { issuer } = this.userManagement;
|
|
5445
5560
|
try {
|
|
5446
|
-
await jwtVerify(accessToken, jwks);
|
|
5561
|
+
await jwtVerify(accessToken, jwks, issuer ? { issuer } : void 0);
|
|
5447
5562
|
return true;
|
|
5448
5563
|
} catch (e) {
|
|
5449
5564
|
if (e instanceof Error && "code" in e && typeof e.code === "string" && (e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_"))) return false;
|
|
@@ -5513,10 +5628,11 @@ var UserManagement = class {
|
|
|
5513
5628
|
workos;
|
|
5514
5629
|
_jwks;
|
|
5515
5630
|
clientId;
|
|
5631
|
+
issuer;
|
|
5516
5632
|
constructor(workos) {
|
|
5517
5633
|
this.workos = workos;
|
|
5518
|
-
|
|
5519
|
-
this.
|
|
5634
|
+
this.clientId = workos.clientId;
|
|
5635
|
+
this.issuer = workos.options.issuer;
|
|
5520
5636
|
}
|
|
5521
5637
|
/**
|
|
5522
5638
|
* Resolve clientId from method options or fall back to constructor-provided value.
|
|
@@ -5553,7 +5669,7 @@ var UserManagement = class {
|
|
|
5553
5669
|
* @throws {NotFoundException} 404
|
|
5554
5670
|
*/
|
|
5555
5671
|
async getUser(userId) {
|
|
5556
|
-
const { data } = await this.workos.get(`/user_management/users/${userId}`);
|
|
5672
|
+
const { data } = await this.workos.get(`/user_management/users/${encodePathParameter(userId)}`);
|
|
5557
5673
|
return deserializeUser(data);
|
|
5558
5674
|
}
|
|
5559
5675
|
/**
|
|
@@ -5569,7 +5685,7 @@ var UserManagement = class {
|
|
|
5569
5685
|
* @throws {NotFoundException} 404
|
|
5570
5686
|
*/
|
|
5571
5687
|
async getUserByExternalId(externalId) {
|
|
5572
|
-
const { data } = await this.workos.get(`/user_management/users/external_id/${externalId}`);
|
|
5688
|
+
const { data } = await this.workos.get(`/user_management/users/external_id/${encodePathParameter(externalId)}`);
|
|
5573
5689
|
return deserializeUser(data);
|
|
5574
5690
|
}
|
|
5575
5691
|
/**
|
|
@@ -5818,7 +5934,7 @@ var UserManagement = class {
|
|
|
5818
5934
|
const { jwtVerify } = await getJose();
|
|
5819
5935
|
if (!jwks) throw new Error("Must provide clientId to initialize JWKS");
|
|
5820
5936
|
try {
|
|
5821
|
-
await jwtVerify(accessToken, jwks);
|
|
5937
|
+
await jwtVerify(accessToken, jwks, this.issuer ? { issuer: this.issuer } : void 0);
|
|
5822
5938
|
return true;
|
|
5823
5939
|
} catch (e) {
|
|
5824
5940
|
if (e instanceof Error && "code" in e && typeof e.code === "string" && (e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_"))) return false;
|
|
@@ -5863,7 +5979,7 @@ var UserManagement = class {
|
|
|
5863
5979
|
* @throws {NotFoundException} 404
|
|
5864
5980
|
*/
|
|
5865
5981
|
async getEmailVerification(emailVerificationId) {
|
|
5866
|
-
const { data } = await this.workos.get(`/user_management/email_verification/${emailVerificationId}`);
|
|
5982
|
+
const { data } = await this.workos.get(`/user_management/email_verification/${encodePathParameter(emailVerificationId)}`);
|
|
5867
5983
|
return deserializeEmailVerification(data);
|
|
5868
5984
|
}
|
|
5869
5985
|
/**
|
|
@@ -5876,7 +5992,7 @@ var UserManagement = class {
|
|
|
5876
5992
|
* @throws {RateLimitExceededException} 429
|
|
5877
5993
|
*/
|
|
5878
5994
|
async sendVerificationEmail({ userId }) {
|
|
5879
|
-
const { data } = await this.workos.post(`/user_management/users/${userId}/email_verification/send`, {});
|
|
5995
|
+
const { data } = await this.workos.post(`/user_management/users/${encodePathParameter(userId)}/email_verification/send`, {});
|
|
5880
5996
|
return { user: deserializeUser(data.user) };
|
|
5881
5997
|
}
|
|
5882
5998
|
/**
|
|
@@ -5887,7 +6003,7 @@ var UserManagement = class {
|
|
|
5887
6003
|
* @throws {NotFoundException} 404
|
|
5888
6004
|
*/
|
|
5889
6005
|
async getMagicAuth(magicAuthId) {
|
|
5890
|
-
const { data } = await this.workos.get(`/user_management/magic_auth/${magicAuthId}`);
|
|
6006
|
+
const { data } = await this.workos.get(`/user_management/magic_auth/${encodePathParameter(magicAuthId)}`);
|
|
5891
6007
|
return deserializeMagicAuth(data);
|
|
5892
6008
|
}
|
|
5893
6009
|
/**
|
|
@@ -5919,7 +6035,7 @@ var UserManagement = class {
|
|
|
5919
6035
|
* @throws {UnprocessableEntityException} 422
|
|
5920
6036
|
*/
|
|
5921
6037
|
async verifyEmail({ code, userId }) {
|
|
5922
|
-
const { data } = await this.workos.post(`/user_management/users/${userId}/email_verification/confirm`, { code });
|
|
6038
|
+
const { data } = await this.workos.post(`/user_management/users/${encodePathParameter(userId)}/email_verification/confirm`, { code });
|
|
5923
6039
|
return { user: deserializeUser(data.user) };
|
|
5924
6040
|
}
|
|
5925
6041
|
/**
|
|
@@ -5930,7 +6046,7 @@ var UserManagement = class {
|
|
|
5930
6046
|
* @throws {NotFoundException} 404
|
|
5931
6047
|
*/
|
|
5932
6048
|
async getPasswordReset(passwordResetId) {
|
|
5933
|
-
const { data } = await this.workos.get(`/user_management/password_reset/${passwordResetId}`);
|
|
6049
|
+
const { data } = await this.workos.get(`/user_management/password_reset/${encodePathParameter(passwordResetId)}`);
|
|
5934
6050
|
return deserializePasswordReset(data);
|
|
5935
6051
|
}
|
|
5936
6052
|
async createPasswordReset(options) {
|
|
@@ -5964,7 +6080,7 @@ var UserManagement = class {
|
|
|
5964
6080
|
* @throws {UnprocessableEntityException} 422
|
|
5965
6081
|
*/
|
|
5966
6082
|
async updateUser(payload) {
|
|
5967
|
-
const { data } = await this.workos.put(`/user_management/users/${payload.userId}`, serializeUpdateUserOptions(payload));
|
|
6083
|
+
const { data } = await this.workos.put(`/user_management/users/${encodePathParameter(payload.userId)}`, serializeUpdateUserOptions(payload));
|
|
5968
6084
|
return deserializeUser(data);
|
|
5969
6085
|
}
|
|
5970
6086
|
/**
|
|
@@ -5977,7 +6093,7 @@ var UserManagement = class {
|
|
|
5977
6093
|
* @throws {UnprocessableEntityException} 422
|
|
5978
6094
|
*/
|
|
5979
6095
|
async listSessions(userId, options) {
|
|
5980
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/sessions`, deserializeSession, options ? serializeListSessionsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/sessions`, deserializeSession, params), options ? serializeListSessionsOptions(options) : void 0);
|
|
6096
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/sessions`, deserializeSession, options ? serializeListSessionsOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/sessions`, deserializeSession, params), options ? serializeListSessionsOptions(options) : void 0);
|
|
5981
6097
|
}
|
|
5982
6098
|
/**
|
|
5983
6099
|
* Delete a user
|
|
@@ -5987,7 +6103,7 @@ var UserManagement = class {
|
|
|
5987
6103
|
* @throws {NotFoundException} 404
|
|
5988
6104
|
*/
|
|
5989
6105
|
async deleteUser(userId) {
|
|
5990
|
-
await this.workos.delete(`/user_management/users/${userId}`);
|
|
6106
|
+
await this.workos.delete(`/user_management/users/${encodePathParameter(userId)}`);
|
|
5991
6107
|
}
|
|
5992
6108
|
/**
|
|
5993
6109
|
* List API keys for a user
|
|
@@ -6000,7 +6116,7 @@ var UserManagement = class {
|
|
|
6000
6116
|
*/
|
|
6001
6117
|
async listUserApiKeys(userId, options) {
|
|
6002
6118
|
const serializedOptions = options ? serializeListUserApiKeysOptions(options) : void 0;
|
|
6003
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/api_keys`, deserializeUserApiKey, serializedOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/api_keys`, deserializeUserApiKey, params), serializedOptions);
|
|
6119
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/api_keys`, deserializeUserApiKey, serializedOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/api_keys`, deserializeUserApiKey, params), serializedOptions);
|
|
6004
6120
|
}
|
|
6005
6121
|
/**
|
|
6006
6122
|
* Create an API key for a user
|
|
@@ -6014,7 +6130,7 @@ var UserManagement = class {
|
|
|
6014
6130
|
* @throws {UnprocessableEntityException} 422
|
|
6015
6131
|
*/
|
|
6016
6132
|
async createUserApiKey(userId, options, requestOptions = {}) {
|
|
6017
|
-
const { data } = await this.workos.post(`/user_management/users/${userId}/api_keys`, serializeCreateUserApiKeyOptions(options), requestOptions);
|
|
6133
|
+
const { data } = await this.workos.post(`/user_management/users/${encodePathParameter(userId)}/api_keys`, serializeCreateUserApiKeyOptions(options), requestOptions);
|
|
6018
6134
|
return deserializeUserApiKeyWithValue(data);
|
|
6019
6135
|
}
|
|
6020
6136
|
/**
|
|
@@ -6026,7 +6142,7 @@ var UserManagement = class {
|
|
|
6026
6142
|
*/
|
|
6027
6143
|
async getUserIdentities(userId) {
|
|
6028
6144
|
if (!userId) throw new TypeError(`Incomplete arguments. Need to specify 'userId'.`);
|
|
6029
|
-
const { data } = await this.workos.get(`/user_management/users/${userId}/identities`);
|
|
6145
|
+
const { data } = await this.workos.get(`/user_management/users/${encodePathParameter(userId)}/identities`);
|
|
6030
6146
|
return deserializeIdentities(data);
|
|
6031
6147
|
}
|
|
6032
6148
|
/**
|
|
@@ -6037,7 +6153,7 @@ var UserManagement = class {
|
|
|
6037
6153
|
* @throws {NotFoundException} 404
|
|
6038
6154
|
*/
|
|
6039
6155
|
async getOrganizationMembership(organizationMembershipId) {
|
|
6040
|
-
const { data } = await this.workos.get(`/user_management/organization_memberships/${organizationMembershipId}`);
|
|
6156
|
+
const { data } = await this.workos.get(`/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}`);
|
|
6041
6157
|
return deserializeOrganizationMembership(data);
|
|
6042
6158
|
}
|
|
6043
6159
|
/**
|
|
@@ -6080,7 +6196,7 @@ var UserManagement = class {
|
|
|
6080
6196
|
* @throws {UnprocessableEntityException} 422
|
|
6081
6197
|
*/
|
|
6082
6198
|
async updateOrganizationMembership(organizationMembershipId, options) {
|
|
6083
|
-
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}`, serializeUpdateOrganizationMembershipOptions(options));
|
|
6199
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}`, serializeUpdateOrganizationMembershipOptions(options));
|
|
6084
6200
|
return deserializeOrganizationMembership(data);
|
|
6085
6201
|
}
|
|
6086
6202
|
/**
|
|
@@ -6091,7 +6207,7 @@ var UserManagement = class {
|
|
|
6091
6207
|
* @throws {NotFoundException} 404
|
|
6092
6208
|
*/
|
|
6093
6209
|
async deleteOrganizationMembership(organizationMembershipId) {
|
|
6094
|
-
await this.workos.delete(`/user_management/organization_memberships/${organizationMembershipId}`);
|
|
6210
|
+
await this.workos.delete(`/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}`);
|
|
6095
6211
|
}
|
|
6096
6212
|
/**
|
|
6097
6213
|
* Deactivate an organization membership
|
|
@@ -6108,7 +6224,7 @@ var UserManagement = class {
|
|
|
6108
6224
|
* @throws {UnprocessableEntityException} 422
|
|
6109
6225
|
*/
|
|
6110
6226
|
async deactivateOrganizationMembership(organizationMembershipId) {
|
|
6111
|
-
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}/deactivate`, {});
|
|
6227
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}/deactivate`, {});
|
|
6112
6228
|
return deserializeOrganizationMembership(data);
|
|
6113
6229
|
}
|
|
6114
6230
|
/**
|
|
@@ -6126,16 +6242,16 @@ var UserManagement = class {
|
|
|
6126
6242
|
* @throws {UnprocessableEntityException} 422
|
|
6127
6243
|
*/
|
|
6128
6244
|
async reactivateOrganizationMembership(organizationMembershipId) {
|
|
6129
|
-
const { data } = await this.workos.put(`/user_management/organization_memberships/${organizationMembershipId}/reactivate`, {});
|
|
6245
|
+
const { data } = await this.workos.put(`/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}/reactivate`, {});
|
|
6130
6246
|
return deserializeOrganizationMembership(data);
|
|
6131
6247
|
}
|
|
6132
6248
|
async listGroupsForOrganizationMembership(options) {
|
|
6133
6249
|
const { organizationMembershipId, ...paginationOptions } = options;
|
|
6134
|
-
const endpoint = `/user_management/organization_memberships/${organizationMembershipId}/groups`;
|
|
6250
|
+
const endpoint = `/user_management/organization_memberships/${encodePathParameter(organizationMembershipId)}/groups`;
|
|
6135
6251
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeGroup, paginationOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeGroup, params), paginationOptions);
|
|
6136
6252
|
}
|
|
6137
6253
|
async getInvitation(invitationId) {
|
|
6138
|
-
const { data } = await this.workos.get(`/user_management/invitations/${invitationId}`);
|
|
6254
|
+
const { data } = await this.workos.get(`/user_management/invitations/${encodePathParameter(invitationId)}`);
|
|
6139
6255
|
return deserializeInvitation(data);
|
|
6140
6256
|
}
|
|
6141
6257
|
/**
|
|
@@ -6146,7 +6262,7 @@ var UserManagement = class {
|
|
|
6146
6262
|
* @throws {NotFoundException} 404
|
|
6147
6263
|
*/
|
|
6148
6264
|
async findInvitationByToken(invitationToken) {
|
|
6149
|
-
const { data } = await this.workos.get(`/user_management/invitations/by_token/${invitationToken}`);
|
|
6265
|
+
const { data } = await this.workos.get(`/user_management/invitations/by_token/${encodePathParameter(invitationToken)}`);
|
|
6150
6266
|
return deserializeInvitation(data);
|
|
6151
6267
|
}
|
|
6152
6268
|
/**
|
|
@@ -6183,7 +6299,7 @@ var UserManagement = class {
|
|
|
6183
6299
|
* @throws {NotFoundException} 404
|
|
6184
6300
|
*/
|
|
6185
6301
|
async acceptInvitation(invitationId) {
|
|
6186
|
-
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/accept`, null);
|
|
6302
|
+
const { data } = await this.workos.post(`/user_management/invitations/${encodePathParameter(invitationId)}/accept`, null);
|
|
6187
6303
|
return deserializeInvitation(data);
|
|
6188
6304
|
}
|
|
6189
6305
|
/**
|
|
@@ -6194,7 +6310,7 @@ var UserManagement = class {
|
|
|
6194
6310
|
* @throws {BadRequestException} 400
|
|
6195
6311
|
*/
|
|
6196
6312
|
async revokeInvitation(invitationId) {
|
|
6197
|
-
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/revoke`, null);
|
|
6313
|
+
const { data } = await this.workos.post(`/user_management/invitations/${encodePathParameter(invitationId)}/revoke`, null);
|
|
6198
6314
|
return deserializeInvitation(data);
|
|
6199
6315
|
}
|
|
6200
6316
|
/**
|
|
@@ -6208,7 +6324,7 @@ var UserManagement = class {
|
|
|
6208
6324
|
* @throws {UnprocessableEntityException} 422
|
|
6209
6325
|
*/
|
|
6210
6326
|
async resendInvitation(invitationId, options) {
|
|
6211
|
-
const { data } = await this.workos.post(`/user_management/invitations/${invitationId}/resend`, options ? serializeResendInvitationOptions(options) : {});
|
|
6327
|
+
const { data } = await this.workos.post(`/user_management/invitations/${encodePathParameter(invitationId)}/resend`, options ? serializeResendInvitationOptions(options) : {});
|
|
6212
6328
|
return deserializeInvitation(data);
|
|
6213
6329
|
}
|
|
6214
6330
|
/**
|
|
@@ -6231,7 +6347,7 @@ var UserManagement = class {
|
|
|
6231
6347
|
* @throws {NotFoundException} 404
|
|
6232
6348
|
*/
|
|
6233
6349
|
async getWaitlist(waitlistId) {
|
|
6234
|
-
const { data } = await this.workos.get(`/user_management/waitlists/${waitlistId}`);
|
|
6350
|
+
const { data } = await this.workos.get(`/user_management/waitlists/${encodePathParameter(waitlistId)}`);
|
|
6235
6351
|
return deserializeWaitlist(data);
|
|
6236
6352
|
}
|
|
6237
6353
|
/**
|
|
@@ -6247,7 +6363,7 @@ var UserManagement = class {
|
|
|
6247
6363
|
* @throws {UnprocessableEntityException} 422
|
|
6248
6364
|
*/
|
|
6249
6365
|
async listWaitlistEntries(waitlistId, options) {
|
|
6250
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/waitlists/${waitlistId}/entries`, deserializeWaitlistEntry, options ? serializeListWaitlistEntriesOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/waitlists/${waitlistId}/entries`, deserializeWaitlistEntry, params), options ? serializeListWaitlistEntriesOptions(options) : void 0);
|
|
6366
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/waitlists/${encodePathParameter(waitlistId)}/entries`, deserializeWaitlistEntry, options ? serializeListWaitlistEntriesOptions(options) : void 0), (params) => fetchAndDeserialize(this.workos, `/user_management/waitlists/${encodePathParameter(waitlistId)}/entries`, deserializeWaitlistEntry, params), options ? serializeListWaitlistEntriesOptions(options) : void 0);
|
|
6251
6367
|
}
|
|
6252
6368
|
/**
|
|
6253
6369
|
* Create a waitlist entry
|
|
@@ -6263,7 +6379,7 @@ var UserManagement = class {
|
|
|
6263
6379
|
* @throws {UnprocessableEntityException} 422
|
|
6264
6380
|
*/
|
|
6265
6381
|
async createWaitlistEntry(waitlistId, payload) {
|
|
6266
|
-
const { data } = await this.workos.post(`/user_management/waitlists/${waitlistId}/entries`, serializeCreateWaitlistEntryOptions(payload));
|
|
6382
|
+
const { data } = await this.workos.post(`/user_management/waitlists/${encodePathParameter(waitlistId)}/entries`, serializeCreateWaitlistEntryOptions(payload));
|
|
6267
6383
|
return deserializeWaitlistEntry(data);
|
|
6268
6384
|
}
|
|
6269
6385
|
/**
|
|
@@ -6276,7 +6392,7 @@ var UserManagement = class {
|
|
|
6276
6392
|
* @throws {UnprocessableEntityException} 422
|
|
6277
6393
|
*/
|
|
6278
6394
|
async approveWaitlistEntry(waitlistEntryId) {
|
|
6279
|
-
const { data } = await this.workos.post(`/user_management/waitlist_entries/${waitlistEntryId}/approve`, null);
|
|
6395
|
+
const { data } = await this.workos.post(`/user_management/waitlist_entries/${encodePathParameter(waitlistEntryId)}/approve`, null);
|
|
6280
6396
|
return deserializeWaitlistEntry(data);
|
|
6281
6397
|
}
|
|
6282
6398
|
/**
|
|
@@ -6288,7 +6404,7 @@ var UserManagement = class {
|
|
|
6288
6404
|
* @throws {UnprocessableEntityException} 422
|
|
6289
6405
|
*/
|
|
6290
6406
|
async denyWaitlistEntry(waitlistEntryId) {
|
|
6291
|
-
const { data } = await this.workos.post(`/user_management/waitlist_entries/${waitlistEntryId}/deny`, null);
|
|
6407
|
+
const { data } = await this.workos.post(`/user_management/waitlist_entries/${encodePathParameter(waitlistEntryId)}/deny`, null);
|
|
6292
6408
|
return deserializeWaitlistEntry(data);
|
|
6293
6409
|
}
|
|
6294
6410
|
/**
|
|
@@ -6301,7 +6417,7 @@ var UserManagement = class {
|
|
|
6301
6417
|
* @throws {NotFoundException} 404
|
|
6302
6418
|
*/
|
|
6303
6419
|
async deleteWaitlistEntry(waitlistEntryId) {
|
|
6304
|
-
await this.workos.delete(`/user_management/waitlist_entries/${waitlistEntryId}`);
|
|
6420
|
+
await this.workos.delete(`/user_management/waitlist_entries/${encodePathParameter(waitlistEntryId)}`);
|
|
6305
6421
|
}
|
|
6306
6422
|
/**
|
|
6307
6423
|
* Revoke Session
|
|
@@ -6844,7 +6960,7 @@ var FeatureFlags = class {
|
|
|
6844
6960
|
* @throws {NotFoundException} 404
|
|
6845
6961
|
*/
|
|
6846
6962
|
async getFeatureFlag(slug) {
|
|
6847
|
-
const { data } = await this.workos.get(`/feature-flags/${slug}`);
|
|
6963
|
+
const { data } = await this.workos.get(`/feature-flags/${encodePathParameter(slug)}`);
|
|
6848
6964
|
return deserializeFeatureFlag(data);
|
|
6849
6965
|
}
|
|
6850
6966
|
/**
|
|
@@ -6860,7 +6976,7 @@ var FeatureFlags = class {
|
|
|
6860
6976
|
* @throws {NotFoundException} 404
|
|
6861
6977
|
*/
|
|
6862
6978
|
async enableFeatureFlag(slug) {
|
|
6863
|
-
const { data } = await this.workos.put(`/feature-flags/${slug}/enable`, {});
|
|
6979
|
+
const { data } = await this.workos.put(`/feature-flags/${encodePathParameter(slug)}/enable`, {});
|
|
6864
6980
|
return deserializeFeatureFlag(data);
|
|
6865
6981
|
}
|
|
6866
6982
|
/**
|
|
@@ -6876,7 +6992,7 @@ var FeatureFlags = class {
|
|
|
6876
6992
|
* @throws {NotFoundException} 404
|
|
6877
6993
|
*/
|
|
6878
6994
|
async disableFeatureFlag(slug) {
|
|
6879
|
-
const { data } = await this.workos.put(`/feature-flags/${slug}/disable`, {});
|
|
6995
|
+
const { data } = await this.workos.put(`/feature-flags/${encodePathParameter(slug)}/disable`, {});
|
|
6880
6996
|
return deserializeFeatureFlag(data);
|
|
6881
6997
|
}
|
|
6882
6998
|
/**
|
|
@@ -6891,7 +7007,7 @@ var FeatureFlags = class {
|
|
|
6891
7007
|
*/
|
|
6892
7008
|
async addFlagTarget(options) {
|
|
6893
7009
|
const { slug, targetId } = options;
|
|
6894
|
-
await this.workos.post(`/feature-flags/${slug}/targets/${targetId}`, {});
|
|
7010
|
+
await this.workos.post(`/feature-flags/${encodePathParameter(slug)}/targets/${encodePathParameter(targetId)}`, {});
|
|
6895
7011
|
}
|
|
6896
7012
|
/**
|
|
6897
7013
|
* Remove a feature flag target
|
|
@@ -6905,7 +7021,7 @@ var FeatureFlags = class {
|
|
|
6905
7021
|
*/
|
|
6906
7022
|
async removeFlagTarget(options) {
|
|
6907
7023
|
const { slug, targetId } = options;
|
|
6908
|
-
await this.workos.delete(`/feature-flags/${slug}/targets/${targetId}`);
|
|
7024
|
+
await this.workos.delete(`/feature-flags/${encodePathParameter(slug)}/targets/${encodePathParameter(targetId)}`);
|
|
6909
7025
|
}
|
|
6910
7026
|
/**
|
|
6911
7027
|
* List enabled feature flags for an organization
|
|
@@ -6917,7 +7033,7 @@ var FeatureFlags = class {
|
|
|
6917
7033
|
*/
|
|
6918
7034
|
async listOrganizationFeatureFlags(options) {
|
|
6919
7035
|
const { organizationId, ...paginationOptions } = options;
|
|
6920
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${organizationId}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${organizationId}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
7036
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/organizations/${encodePathParameter(organizationId)}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/organizations/${encodePathParameter(organizationId)}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
6921
7037
|
}
|
|
6922
7038
|
/**
|
|
6923
7039
|
* List enabled feature flags for a user
|
|
@@ -6928,7 +7044,7 @@ var FeatureFlags = class {
|
|
|
6928
7044
|
*/
|
|
6929
7045
|
async listUserFeatureFlags(options) {
|
|
6930
7046
|
const { userId, ...paginationOptions } = options;
|
|
6931
|
-
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${userId}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${userId}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
7047
|
+
return new AutoPaginatable(await fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/feature-flags`, deserializeFeatureFlag, paginationOptions), (params) => fetchAndDeserialize(this.workos, `/user_management/users/${encodePathParameter(userId)}/feature-flags`, deserializeFeatureFlag, params), paginationOptions);
|
|
6932
7048
|
}
|
|
6933
7049
|
createRuntimeClient(options) {
|
|
6934
7050
|
return new FeatureFlagsRuntimeClient(this.workos, options);
|
|
@@ -7417,7 +7533,7 @@ var Authorization = class {
|
|
|
7417
7533
|
* @throws {NotFoundException} 404
|
|
7418
7534
|
*/
|
|
7419
7535
|
async getEnvironmentRole(slug) {
|
|
7420
|
-
const { data } = await this.workos.get(`/authorization/roles/${slug}`);
|
|
7536
|
+
const { data } = await this.workos.get(`/authorization/roles/${encodePathParameter(slug)}`);
|
|
7421
7537
|
return deserializeEnvironmentRole(data);
|
|
7422
7538
|
}
|
|
7423
7539
|
/**
|
|
@@ -7437,7 +7553,7 @@ var Authorization = class {
|
|
|
7437
7553
|
* @throws {UnprocessableEntityException} 422
|
|
7438
7554
|
*/
|
|
7439
7555
|
async updateEnvironmentRole(slug, options) {
|
|
7440
|
-
const { data } = await this.workos.patch(`/authorization/roles/${slug}`, serializeUpdateEnvironmentRoleOptions(options));
|
|
7556
|
+
const { data } = await this.workos.patch(`/authorization/roles/${encodePathParameter(slug)}`, serializeUpdateEnvironmentRoleOptions(options));
|
|
7441
7557
|
return deserializeEnvironmentRole(data);
|
|
7442
7558
|
}
|
|
7443
7559
|
/**
|
|
@@ -7457,7 +7573,7 @@ var Authorization = class {
|
|
|
7457
7573
|
* @throws {UnprocessableEntityException} 422
|
|
7458
7574
|
*/
|
|
7459
7575
|
async setEnvironmentRolePermissions(slug, options) {
|
|
7460
|
-
const { data } = await this.workos.put(`/authorization/roles/${slug}/permissions`, { permissions: options.permissions });
|
|
7576
|
+
const { data } = await this.workos.put(`/authorization/roles/${encodePathParameter(slug)}/permissions`, { permissions: options.permissions });
|
|
7461
7577
|
return deserializeEnvironmentRole(data);
|
|
7462
7578
|
}
|
|
7463
7579
|
/**
|
|
@@ -7477,7 +7593,7 @@ var Authorization = class {
|
|
|
7477
7593
|
* @throws {UnprocessableEntityException} 422
|
|
7478
7594
|
*/
|
|
7479
7595
|
async addEnvironmentRolePermission(slug, options) {
|
|
7480
|
-
const { data } = await this.workos.post(`/authorization/roles/${slug}/permissions`, { slug: options.permissionSlug });
|
|
7596
|
+
const { data } = await this.workos.post(`/authorization/roles/${encodePathParameter(slug)}/permissions`, { slug: options.permissionSlug });
|
|
7481
7597
|
return deserializeEnvironmentRole(data);
|
|
7482
7598
|
}
|
|
7483
7599
|
/**
|
|
@@ -7498,7 +7614,7 @@ var Authorization = class {
|
|
|
7498
7614
|
* @throws {UnprocessableEntityException} 422
|
|
7499
7615
|
*/
|
|
7500
7616
|
async createOrganizationRole(organizationId, options) {
|
|
7501
|
-
const { data } = await this.workos.post(`/authorization/organizations/${organizationId}/roles`, serializeCreateOrganizationRoleOptions(options));
|
|
7617
|
+
const { data } = await this.workos.post(`/authorization/organizations/${encodePathParameter(organizationId)}/roles`, serializeCreateOrganizationRoleOptions(options));
|
|
7502
7618
|
return deserializeOrganizationRole(data);
|
|
7503
7619
|
}
|
|
7504
7620
|
/**
|
|
@@ -7515,7 +7631,7 @@ var Authorization = class {
|
|
|
7515
7631
|
* @throws {NotFoundException} 404
|
|
7516
7632
|
*/
|
|
7517
7633
|
async listOrganizationRoles(organizationId) {
|
|
7518
|
-
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/roles`);
|
|
7634
|
+
const { data } = await this.workos.get(`/authorization/organizations/${encodePathParameter(organizationId)}/roles`);
|
|
7519
7635
|
return {
|
|
7520
7636
|
object: "list",
|
|
7521
7637
|
data: data.data.map(deserializeRole)
|
|
@@ -7540,7 +7656,7 @@ var Authorization = class {
|
|
|
7540
7656
|
* @throws {NotFoundException} 404
|
|
7541
7657
|
*/
|
|
7542
7658
|
async getOrganizationRole(organizationId, slug) {
|
|
7543
|
-
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/roles/${slug}`);
|
|
7659
|
+
const { data } = await this.workos.get(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}`);
|
|
7544
7660
|
return deserializeRole(data);
|
|
7545
7661
|
}
|
|
7546
7662
|
/**
|
|
@@ -7565,7 +7681,7 @@ var Authorization = class {
|
|
|
7565
7681
|
* @throws {UnprocessableEntityException} 422
|
|
7566
7682
|
*/
|
|
7567
7683
|
async updateOrganizationRole(organizationId, slug, options) {
|
|
7568
|
-
const { data } = await this.workos.patch(`/authorization/organizations/${organizationId}/roles/${slug}`, serializeUpdateOrganizationRoleOptions(options));
|
|
7684
|
+
const { data } = await this.workos.patch(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}`, serializeUpdateOrganizationRoleOptions(options));
|
|
7569
7685
|
return deserializeOrganizationRole(data);
|
|
7570
7686
|
}
|
|
7571
7687
|
/**
|
|
@@ -7589,7 +7705,7 @@ var Authorization = class {
|
|
|
7589
7705
|
* @throws {ConflictException} 409
|
|
7590
7706
|
*/
|
|
7591
7707
|
async deleteOrganizationRole(organizationId, slug) {
|
|
7592
|
-
await this.workos.delete(`/authorization/organizations/${organizationId}/roles/${slug}`);
|
|
7708
|
+
await this.workos.delete(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}`);
|
|
7593
7709
|
}
|
|
7594
7710
|
/**
|
|
7595
7711
|
* Set permissions for a custom role
|
|
@@ -7612,7 +7728,7 @@ var Authorization = class {
|
|
|
7612
7728
|
* @throws {UnprocessableEntityException} 422
|
|
7613
7729
|
*/
|
|
7614
7730
|
async setOrganizationRolePermissions(organizationId, slug, options) {
|
|
7615
|
-
const { data } = await this.workos.put(`/authorization/organizations/${organizationId}/roles/${slug}/permissions`, { permissions: options.permissions });
|
|
7731
|
+
const { data } = await this.workos.put(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}/permissions`, { permissions: options.permissions });
|
|
7616
7732
|
return deserializeOrganizationRole(data);
|
|
7617
7733
|
}
|
|
7618
7734
|
/**
|
|
@@ -7637,7 +7753,7 @@ var Authorization = class {
|
|
|
7637
7753
|
* @throws {UnprocessableEntityException} 422
|
|
7638
7754
|
*/
|
|
7639
7755
|
async addOrganizationRolePermission(organizationId, slug, options) {
|
|
7640
|
-
const { data } = await this.workos.post(`/authorization/organizations/${organizationId}/roles/${slug}/permissions`, { slug: options.permissionSlug });
|
|
7756
|
+
const { data } = await this.workos.post(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}/permissions`, { slug: options.permissionSlug });
|
|
7641
7757
|
return deserializeOrganizationRole(data);
|
|
7642
7758
|
}
|
|
7643
7759
|
/**
|
|
@@ -7664,7 +7780,7 @@ var Authorization = class {
|
|
|
7664
7780
|
* @throws {NotFoundException} 404
|
|
7665
7781
|
*/
|
|
7666
7782
|
async removeOrganizationRolePermission(organizationId, slug, options) {
|
|
7667
|
-
await this.workos.delete(`/authorization/organizations/${organizationId}/roles/${slug}/permissions/${options.permissionSlug}`);
|
|
7783
|
+
await this.workos.delete(`/authorization/organizations/${encodePathParameter(organizationId)}/roles/${encodePathParameter(slug)}/permissions/${encodePathParameter(options.permissionSlug)}`);
|
|
7668
7784
|
}
|
|
7669
7785
|
/**
|
|
7670
7786
|
* Create a permission
|
|
@@ -7705,7 +7821,7 @@ var Authorization = class {
|
|
|
7705
7821
|
* @throws {NotFoundException} 404
|
|
7706
7822
|
*/
|
|
7707
7823
|
async getPermission(slug) {
|
|
7708
|
-
const { data } = await this.workos.get(`/authorization/permissions/${slug}`);
|
|
7824
|
+
const { data } = await this.workos.get(`/authorization/permissions/${encodePathParameter(slug)}`);
|
|
7709
7825
|
return deserializePermission(data);
|
|
7710
7826
|
}
|
|
7711
7827
|
/**
|
|
@@ -7724,7 +7840,7 @@ var Authorization = class {
|
|
|
7724
7840
|
* @throws {UnprocessableEntityException} 422
|
|
7725
7841
|
*/
|
|
7726
7842
|
async updatePermission(slug, options) {
|
|
7727
|
-
const { data } = await this.workos.patch(`/authorization/permissions/${slug}`, serializeUpdatePermissionOptions(options));
|
|
7843
|
+
const { data } = await this.workos.patch(`/authorization/permissions/${encodePathParameter(slug)}`, serializeUpdatePermissionOptions(options));
|
|
7728
7844
|
return deserializePermission(data);
|
|
7729
7845
|
}
|
|
7730
7846
|
/**
|
|
@@ -7741,7 +7857,7 @@ var Authorization = class {
|
|
|
7741
7857
|
* @throws {NotFoundException} 404
|
|
7742
7858
|
*/
|
|
7743
7859
|
async deletePermission(slug) {
|
|
7744
|
-
await this.workos.delete(`/authorization/permissions/${slug}`);
|
|
7860
|
+
await this.workos.delete(`/authorization/permissions/${encodePathParameter(slug)}`);
|
|
7745
7861
|
}
|
|
7746
7862
|
/**
|
|
7747
7863
|
* Get a resource
|
|
@@ -7758,7 +7874,7 @@ var Authorization = class {
|
|
|
7758
7874
|
* @throws {UnprocessableEntityException} 422
|
|
7759
7875
|
*/
|
|
7760
7876
|
async getResource(resourceId) {
|
|
7761
|
-
const { data } = await this.workos.get(`/authorization/resources/${resourceId}`);
|
|
7877
|
+
const { data } = await this.workos.get(`/authorization/resources/${encodePathParameter(resourceId)}`);
|
|
7762
7878
|
return deserializeAuthorizationResource(data);
|
|
7763
7879
|
}
|
|
7764
7880
|
/**
|
|
@@ -7790,7 +7906,7 @@ var Authorization = class {
|
|
|
7790
7906
|
* @throws {UnprocessableEntityException} 422
|
|
7791
7907
|
*/
|
|
7792
7908
|
async updateResource(options) {
|
|
7793
|
-
const { data } = await this.workos.patch(`/authorization/resources/${options.resourceId}`, serializeUpdateResourceOptions(options));
|
|
7909
|
+
const { data } = await this.workos.patch(`/authorization/resources/${encodePathParameter(options.resourceId)}`, serializeUpdateResourceOptions(options));
|
|
7794
7910
|
return deserializeAuthorizationResource(data);
|
|
7795
7911
|
}
|
|
7796
7912
|
/**
|
|
@@ -7809,7 +7925,7 @@ var Authorization = class {
|
|
|
7809
7925
|
async deleteResource(options) {
|
|
7810
7926
|
const { resourceId, cascadeDelete } = options;
|
|
7811
7927
|
const query = cascadeDelete !== void 0 ? { cascade_delete: cascadeDelete.toString() } : void 0;
|
|
7812
|
-
await this.workos.delete(`/authorization/resources/${resourceId}`, query);
|
|
7928
|
+
await this.workos.delete(`/authorization/resources/${encodePathParameter(resourceId)}`, query);
|
|
7813
7929
|
}
|
|
7814
7930
|
/**
|
|
7815
7931
|
* List resources
|
|
@@ -7849,7 +7965,7 @@ var Authorization = class {
|
|
|
7849
7965
|
*/
|
|
7850
7966
|
async getResourceByExternalId(options) {
|
|
7851
7967
|
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
7852
|
-
const { data } = await this.workos.get(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`);
|
|
7968
|
+
const { data } = await this.workos.get(`/authorization/organizations/${encodePathParameter(organizationId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}`);
|
|
7853
7969
|
return deserializeAuthorizationResource(data);
|
|
7854
7970
|
}
|
|
7855
7971
|
/**
|
|
@@ -7881,7 +7997,7 @@ var Authorization = class {
|
|
|
7881
7997
|
*/
|
|
7882
7998
|
async updateResourceByExternalId(options) {
|
|
7883
7999
|
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
7884
|
-
const { data } = await this.workos.patch(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`, serializeUpdateResourceByExternalIdOptions(options));
|
|
8000
|
+
const { data } = await this.workos.patch(`/authorization/organizations/${encodePathParameter(organizationId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}`, serializeUpdateResourceByExternalIdOptions(options));
|
|
7885
8001
|
return deserializeAuthorizationResource(data);
|
|
7886
8002
|
}
|
|
7887
8003
|
/**
|
|
@@ -7913,7 +8029,7 @@ var Authorization = class {
|
|
|
7913
8029
|
async deleteResourceByExternalId(options) {
|
|
7914
8030
|
const { organizationId, resourceTypeSlug, externalId, cascadeDelete } = options;
|
|
7915
8031
|
const query = cascadeDelete !== void 0 ? { cascade_delete: cascadeDelete.toString() } : void 0;
|
|
7916
|
-
await this.workos.delete(`/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}`, query);
|
|
8032
|
+
await this.workos.delete(`/authorization/organizations/${encodePathParameter(organizationId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}`, query);
|
|
7917
8033
|
}
|
|
7918
8034
|
/**
|
|
7919
8035
|
* Check authorization
|
|
@@ -7926,7 +8042,7 @@ var Authorization = class {
|
|
|
7926
8042
|
* @throws {UnprocessableEntityException} 422
|
|
7927
8043
|
*/
|
|
7928
8044
|
async check(options) {
|
|
7929
|
-
const { data } = await this.workos.post(`/authorization/organization_memberships/${options.organizationMembershipId}/check`, serializeAuthorizationCheckOptions(options));
|
|
8045
|
+
const { data } = await this.workos.post(`/authorization/organization_memberships/${encodePathParameter(options.organizationMembershipId)}/check`, serializeAuthorizationCheckOptions(options));
|
|
7930
8046
|
return data;
|
|
7931
8047
|
}
|
|
7932
8048
|
/**
|
|
@@ -7945,7 +8061,7 @@ var Authorization = class {
|
|
|
7945
8061
|
*/
|
|
7946
8062
|
async listRoleAssignments(options) {
|
|
7947
8063
|
const { organizationMembershipId, ...queryOptions } = options;
|
|
7948
|
-
const endpoint = `/authorization/organization_memberships/${organizationMembershipId}/role_assignments`;
|
|
8064
|
+
const endpoint = `/authorization/organization_memberships/${encodePathParameter(organizationMembershipId)}/role_assignments`;
|
|
7949
8065
|
const serializedOptions = serializeListRoleAssignmentsOptions(queryOptions);
|
|
7950
8066
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
|
|
7951
8067
|
}
|
|
@@ -7965,7 +8081,7 @@ var Authorization = class {
|
|
|
7965
8081
|
*/
|
|
7966
8082
|
async listRoleAssignmentsForResource(options) {
|
|
7967
8083
|
const { resourceId, ...queryOptions } = options;
|
|
7968
|
-
const endpoint = `/authorization/resources/${resourceId}/role_assignments`;
|
|
8084
|
+
const endpoint = `/authorization/resources/${encodePathParameter(resourceId)}/role_assignments`;
|
|
7969
8085
|
const serializedOptions = serializeListRoleAssignmentsForResourceOptions(queryOptions);
|
|
7970
8086
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
|
|
7971
8087
|
}
|
|
@@ -7995,7 +8111,7 @@ var Authorization = class {
|
|
|
7995
8111
|
*/
|
|
7996
8112
|
async listResourceRoleAssignments(options) {
|
|
7997
8113
|
const { organizationId, resourceTypeSlug, externalId, ...queryOptions } = options;
|
|
7998
|
-
const endpoint = `/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/role_assignments`;
|
|
8114
|
+
const endpoint = `/authorization/organizations/${encodePathParameter(organizationId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}/role_assignments`;
|
|
7999
8115
|
const serializedOptions = serializeListRoleAssignmentsForResourceOptions(queryOptions);
|
|
8000
8116
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
|
|
8001
8117
|
}
|
|
@@ -8010,7 +8126,7 @@ var Authorization = class {
|
|
|
8010
8126
|
* @throws {UnprocessableEntityException} 422
|
|
8011
8127
|
*/
|
|
8012
8128
|
async assignRole(options) {
|
|
8013
|
-
const { data } = await this.workos.post(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments`, serializeAssignRoleOptions(options));
|
|
8129
|
+
const { data } = await this.workos.post(`/authorization/organization_memberships/${encodePathParameter(options.organizationMembershipId)}/role_assignments`, serializeAssignRoleOptions(options));
|
|
8014
8130
|
return deserializeRoleAssignment(data);
|
|
8015
8131
|
}
|
|
8016
8132
|
/**
|
|
@@ -8024,7 +8140,7 @@ var Authorization = class {
|
|
|
8024
8140
|
* @throws {UnprocessableEntityException} 422
|
|
8025
8141
|
*/
|
|
8026
8142
|
async removeRole(options) {
|
|
8027
|
-
await this.workos.deleteWithBody(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments`, serializeRemoveRoleOptions(options));
|
|
8143
|
+
await this.workos.deleteWithBody(`/authorization/organization_memberships/${encodePathParameter(options.organizationMembershipId)}/role_assignments`, serializeRemoveRoleOptions(options));
|
|
8028
8144
|
}
|
|
8029
8145
|
/**
|
|
8030
8146
|
* Remove a role assignment by ID
|
|
@@ -8045,7 +8161,7 @@ var Authorization = class {
|
|
|
8045
8161
|
* @throws {NotFoundException} 404
|
|
8046
8162
|
*/
|
|
8047
8163
|
async removeRoleAssignment(options) {
|
|
8048
|
-
await this.workos.delete(`/authorization/organization_memberships/${options.organizationMembershipId}/role_assignments/${options.roleAssignmentId}`);
|
|
8164
|
+
await this.workos.delete(`/authorization/organization_memberships/${encodePathParameter(options.organizationMembershipId)}/role_assignments/${encodePathParameter(options.roleAssignmentId)}`);
|
|
8049
8165
|
}
|
|
8050
8166
|
/**
|
|
8051
8167
|
* List role assignments for a group
|
|
@@ -8063,7 +8179,7 @@ var Authorization = class {
|
|
|
8063
8179
|
*/
|
|
8064
8180
|
async listGroupRoleAssignments(options) {
|
|
8065
8181
|
const { groupId, ...paginationOptions } = options;
|
|
8066
|
-
const endpoint = `/authorization/groups/${groupId}/role_assignments`;
|
|
8182
|
+
const endpoint = `/authorization/groups/${encodePathParameter(groupId)}/role_assignments`;
|
|
8067
8183
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeGroupRoleAssignment, paginationOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeGroupRoleAssignment, params), paginationOptions);
|
|
8068
8184
|
}
|
|
8069
8185
|
/**
|
|
@@ -8086,7 +8202,7 @@ var Authorization = class {
|
|
|
8086
8202
|
* @throws {NotFoundException} 404
|
|
8087
8203
|
*/
|
|
8088
8204
|
async getGroupRoleAssignment(options) {
|
|
8089
|
-
const { data } = await this.workos.get(`/authorization/groups/${options.groupId}/role_assignments/${options.roleAssignmentId}`);
|
|
8205
|
+
const { data } = await this.workos.get(`/authorization/groups/${encodePathParameter(options.groupId)}/role_assignments/${encodePathParameter(options.roleAssignmentId)}`);
|
|
8090
8206
|
return deserializeGroupRoleAssignment(data);
|
|
8091
8207
|
}
|
|
8092
8208
|
/**
|
|
@@ -8101,7 +8217,7 @@ var Authorization = class {
|
|
|
8101
8217
|
* @throws {UnprocessableEntityException} 422
|
|
8102
8218
|
*/
|
|
8103
8219
|
async createGroupRoleAssignment(options) {
|
|
8104
|
-
const { data } = await this.workos.post(`/authorization/groups/${options.groupId}/role_assignments`, serializeCreateGroupRoleAssignmentOptions(options));
|
|
8220
|
+
const { data } = await this.workos.post(`/authorization/groups/${encodePathParameter(options.groupId)}/role_assignments`, serializeCreateGroupRoleAssignmentOptions(options));
|
|
8105
8221
|
return deserializeGroupRoleAssignment(data);
|
|
8106
8222
|
}
|
|
8107
8223
|
/**
|
|
@@ -8124,7 +8240,7 @@ var Authorization = class {
|
|
|
8124
8240
|
* @throws {NotFoundException} 404
|
|
8125
8241
|
*/
|
|
8126
8242
|
async removeGroupRoleAssignment(options) {
|
|
8127
|
-
await this.workos.delete(`/authorization/groups/${options.groupId}/role_assignments/${options.roleAssignmentId}`);
|
|
8243
|
+
await this.workos.delete(`/authorization/groups/${encodePathParameter(options.groupId)}/role_assignments/${encodePathParameter(options.roleAssignmentId)}`);
|
|
8128
8244
|
}
|
|
8129
8245
|
/**
|
|
8130
8246
|
* Remove group role assignments by criteria
|
|
@@ -8137,7 +8253,7 @@ var Authorization = class {
|
|
|
8137
8253
|
* @throws {UnprocessableEntityException} 422
|
|
8138
8254
|
*/
|
|
8139
8255
|
async removeGroupRoleAssignments(options) {
|
|
8140
|
-
await this.workos.deleteWithBody(`/authorization/groups/${options.groupId}/role_assignments`, serializeRemoveGroupRoleAssignmentsOptions(options));
|
|
8256
|
+
await this.workos.deleteWithBody(`/authorization/groups/${encodePathParameter(options.groupId)}/role_assignments`, serializeRemoveGroupRoleAssignmentsOptions(options));
|
|
8141
8257
|
}
|
|
8142
8258
|
/**
|
|
8143
8259
|
* Replace role assignments for a group
|
|
@@ -8150,7 +8266,7 @@ var Authorization = class {
|
|
|
8150
8266
|
* @throws {UnprocessableEntityException} 422
|
|
8151
8267
|
*/
|
|
8152
8268
|
async replaceGroupRoleAssignments(options) {
|
|
8153
|
-
const { data } = await this.workos.put(`/authorization/groups/${options.groupId}/role_assignments`, serializeReplaceGroupRoleAssignmentsOptions(options));
|
|
8269
|
+
const { data } = await this.workos.put(`/authorization/groups/${encodePathParameter(options.groupId)}/role_assignments`, serializeReplaceGroupRoleAssignmentsOptions(options));
|
|
8154
8270
|
return deserializeList(data, deserializeGroupRoleAssignment);
|
|
8155
8271
|
}
|
|
8156
8272
|
/**
|
|
@@ -8173,7 +8289,7 @@ var Authorization = class {
|
|
|
8173
8289
|
*/
|
|
8174
8290
|
async listResourcesForMembership(options) {
|
|
8175
8291
|
const { organizationMembershipId } = options;
|
|
8176
|
-
const endpoint = `/authorization/organization_memberships/${organizationMembershipId}/resources`;
|
|
8292
|
+
const endpoint = `/authorization/organization_memberships/${encodePathParameter(organizationMembershipId)}/resources`;
|
|
8177
8293
|
const serializedOptions = serializeListResourcesForMembershipOptions(options);
|
|
8178
8294
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationResource, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationResource, params), serializedOptions);
|
|
8179
8295
|
}
|
|
@@ -8190,7 +8306,7 @@ var Authorization = class {
|
|
|
8190
8306
|
*/
|
|
8191
8307
|
async listMembershipsForResource(options) {
|
|
8192
8308
|
const { resourceId } = options;
|
|
8193
|
-
const endpoint = `/authorization/resources/${resourceId}/organization_memberships`;
|
|
8309
|
+
const endpoint = `/authorization/resources/${encodePathParameter(resourceId)}/organization_memberships`;
|
|
8194
8310
|
const serializedOptions = serializeListMembershipsForResourceOptions(options);
|
|
8195
8311
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationOrganizationMembership, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationOrganizationMembership, params), serializedOptions);
|
|
8196
8312
|
}
|
|
@@ -8222,7 +8338,7 @@ var Authorization = class {
|
|
|
8222
8338
|
*/
|
|
8223
8339
|
async listMembershipsForResourceByExternalId(options) {
|
|
8224
8340
|
const { organizationId, resourceTypeSlug, externalId } = options;
|
|
8225
|
-
const endpoint = `/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/organization_memberships`;
|
|
8341
|
+
const endpoint = `/authorization/organizations/${encodePathParameter(organizationId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}/organization_memberships`;
|
|
8226
8342
|
const serializedOptions = serializeListMembershipsForResourceOptions(options);
|
|
8227
8343
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationOrganizationMembership, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeAuthorizationOrganizationMembership, params), serializedOptions);
|
|
8228
8344
|
}
|
|
@@ -8248,7 +8364,7 @@ var Authorization = class {
|
|
|
8248
8364
|
*/
|
|
8249
8365
|
async listEffectivePermissions(options) {
|
|
8250
8366
|
const { organizationMembershipId, resourceId } = options;
|
|
8251
|
-
const endpoint = `/authorization/resources/${resourceId}/organization_memberships/${organizationMembershipId}/permissions`;
|
|
8367
|
+
const endpoint = `/authorization/resources/${encodePathParameter(resourceId)}/organization_memberships/${encodePathParameter(organizationMembershipId)}/permissions`;
|
|
8252
8368
|
const serializedOptions = serializeListEffectivePermissionsOptions(options);
|
|
8253
8369
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializePermission, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializePermission, params), serializedOptions);
|
|
8254
8370
|
}
|
|
@@ -8264,7 +8380,7 @@ var Authorization = class {
|
|
|
8264
8380
|
*/
|
|
8265
8381
|
async listEffectivePermissionsByExternalId(options) {
|
|
8266
8382
|
const { organizationMembershipId, resourceTypeSlug, externalId } = options;
|
|
8267
|
-
const endpoint = `/authorization/organization_memberships/${organizationMembershipId}/resources/${resourceTypeSlug}/${externalId}/permissions`;
|
|
8383
|
+
const endpoint = `/authorization/organization_memberships/${encodePathParameter(organizationMembershipId)}/resources/${encodePathParameter(resourceTypeSlug)}/${encodePathParameter(externalId)}/permissions`;
|
|
8268
8384
|
const serializedOptions = serializeListEffectivePermissionsOptions(options);
|
|
8269
8385
|
return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializePermission, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializePermission, params), serializedOptions);
|
|
8270
8386
|
}
|
|
@@ -8280,6 +8396,8 @@ const CONTINUATION_BIT = 128;
|
|
|
8280
8396
|
const DATA_BITS_MASK = 127;
|
|
8281
8397
|
const DATA_BITS_PER_BYTE = 7;
|
|
8282
8398
|
const MAX_BYTES_FOR_UINT32 = 5;
|
|
8399
|
+
const FINAL_BYTE_SHIFT = 28;
|
|
8400
|
+
const FINAL_BYTE_MAX_DATA = 15;
|
|
8283
8401
|
/**
|
|
8284
8402
|
* Encodes an unsigned 32-bit integer into LEB128 format.
|
|
8285
8403
|
*
|
|
@@ -8315,6 +8433,7 @@ function decodeUInt32(data, offset = 0) {
|
|
|
8315
8433
|
const byte = data[index++];
|
|
8316
8434
|
bytesRead++;
|
|
8317
8435
|
if (bytesRead > MAX_BYTES_FOR_UINT32) throw new Error("LEB128 sequence exceeds maximum length for uint32");
|
|
8436
|
+
if (shift === FINAL_BYTE_SHIFT && (byte & DATA_BITS_MASK) > FINAL_BYTE_MAX_DATA) throw new Error("LEB128 sequence exceeds uint32 range");
|
|
8318
8437
|
result |= (byte & DATA_BITS_MASK) << shift;
|
|
8319
8438
|
if (!hasContinuationBit(byte)) return {
|
|
8320
8439
|
value: result >>> 0,
|
|
@@ -8721,7 +8840,7 @@ var Vault = class {
|
|
|
8721
8840
|
};
|
|
8722
8841
|
//#endregion
|
|
8723
8842
|
//#region package.json
|
|
8724
|
-
var version = "10.
|
|
8843
|
+
var version = "10.14.0";
|
|
8725
8844
|
//#endregion
|
|
8726
8845
|
//#region src/workos.ts
|
|
8727
8846
|
const DEFAULT_HOSTNAME = "api.workos.com";
|
|
@@ -8857,7 +8976,7 @@ var WorkOS = class {
|
|
|
8857
8976
|
});
|
|
8858
8977
|
throw error;
|
|
8859
8978
|
}
|
|
8860
|
-
return { data: await
|
|
8979
|
+
return { data: await this.readResponseJSON(path, res) };
|
|
8861
8980
|
}
|
|
8862
8981
|
async get(path, options = {}) {
|
|
8863
8982
|
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
@@ -8878,7 +8997,7 @@ var WorkOS = class {
|
|
|
8878
8997
|
});
|
|
8879
8998
|
throw error;
|
|
8880
8999
|
}
|
|
8881
|
-
return { data: await
|
|
9000
|
+
return { data: await this.readResponseJSON(path, res) };
|
|
8882
9001
|
}
|
|
8883
9002
|
async put(path, entity, options = {}) {
|
|
8884
9003
|
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
@@ -8898,7 +9017,7 @@ var WorkOS = class {
|
|
|
8898
9017
|
});
|
|
8899
9018
|
throw error;
|
|
8900
9019
|
}
|
|
8901
|
-
return { data: await
|
|
9020
|
+
return { data: await this.readResponseJSON(path, res) };
|
|
8902
9021
|
}
|
|
8903
9022
|
async patch(path, entity, options = {}) {
|
|
8904
9023
|
if (!options.skipApiKeyCheck) this.requireApiKey(path);
|
|
@@ -8918,7 +9037,7 @@ var WorkOS = class {
|
|
|
8918
9037
|
});
|
|
8919
9038
|
throw error;
|
|
8920
9039
|
}
|
|
8921
|
-
return { data: await
|
|
9040
|
+
return { data: await this.readResponseJSON(path, res) };
|
|
8922
9041
|
}
|
|
8923
9042
|
async delete(path, query) {
|
|
8924
9043
|
this.requireApiKey(path);
|
|
@@ -8944,6 +9063,24 @@ var WorkOS = class {
|
|
|
8944
9063
|
throw error;
|
|
8945
9064
|
}
|
|
8946
9065
|
}
|
|
9066
|
+
/**
|
|
9067
|
+
* Consume a successful response body. The request deadline covers the body,
|
|
9068
|
+
* so a stall while it is still streaming surfaces from the transport as a
|
|
9069
|
+
* 408 `HttpClientError` and is translated like a timeout before the headers.
|
|
9070
|
+
* Everything else (a `ParseError` for malformed JSON, a network failure
|
|
9071
|
+
* mid-body) propagates unchanged.
|
|
9072
|
+
*/
|
|
9073
|
+
async readResponseJSON(path, response) {
|
|
9074
|
+
try {
|
|
9075
|
+
return await response.toJSON();
|
|
9076
|
+
} catch (error) {
|
|
9077
|
+
if (error instanceof HttpClientError) this.handleHttpError({
|
|
9078
|
+
path,
|
|
9079
|
+
error
|
|
9080
|
+
});
|
|
9081
|
+
throw error;
|
|
9082
|
+
}
|
|
9083
|
+
}
|
|
8947
9084
|
emitWarning(warning) {
|
|
8948
9085
|
console.warn(`WorkOS: ${warning}`);
|
|
8949
9086
|
}
|
|
@@ -8993,6 +9130,31 @@ var WorkOS = class {
|
|
|
8993
9130
|
}
|
|
8994
9131
|
};
|
|
8995
9132
|
//#endregion
|
|
9133
|
+
//#region src/audit-logs/interfaces/update-audit-logs-retention-retention-period.interface.ts
|
|
9134
|
+
const UpdateAuditLogsRetentionRetentionPeriod = {
|
|
9135
|
+
Value1Month: "1_MONTH",
|
|
9136
|
+
Value2Months: "2_MONTHS",
|
|
9137
|
+
Value3Months: "3_MONTHS",
|
|
9138
|
+
Value4Months: "4_MONTHS",
|
|
9139
|
+
Value5Months: "5_MONTHS",
|
|
9140
|
+
Value6Months: "6_MONTHS",
|
|
9141
|
+
Value7Months: "7_MONTHS",
|
|
9142
|
+
Value8Months: "8_MONTHS",
|
|
9143
|
+
Value9Months: "9_MONTHS",
|
|
9144
|
+
Value10Months: "10_MONTHS",
|
|
9145
|
+
Value11Months: "11_MONTHS",
|
|
9146
|
+
Value1Year: "1_YEAR",
|
|
9147
|
+
Value2Years: "2_YEARS",
|
|
9148
|
+
Value3Years: "3_YEARS",
|
|
9149
|
+
Value4Years: "4_YEARS",
|
|
9150
|
+
Value5Years: "5_YEARS",
|
|
9151
|
+
Value6Years: "6_YEARS",
|
|
9152
|
+
Value7Years: "7_YEARS",
|
|
9153
|
+
Value8Years: "8_YEARS",
|
|
9154
|
+
Value9Years: "9_YEARS",
|
|
9155
|
+
Value10Years: "10_YEARS"
|
|
9156
|
+
};
|
|
9157
|
+
//#endregion
|
|
8996
9158
|
//#region src/common/interfaces/generate-link-intent.interface.ts
|
|
8997
9159
|
const GenerateLinkIntent = {
|
|
8998
9160
|
SSO: "sso",
|
|
@@ -9243,6 +9405,12 @@ Object.defineProperty(exports, "UnprocessableEntityException", {
|
|
|
9243
9405
|
return UnprocessableEntityException;
|
|
9244
9406
|
}
|
|
9245
9407
|
});
|
|
9408
|
+
Object.defineProperty(exports, "UpdateAuditLogsRetentionRetentionPeriod", {
|
|
9409
|
+
enumerable: true,
|
|
9410
|
+
get: function() {
|
|
9411
|
+
return UpdateAuditLogsRetentionRetentionPeriod;
|
|
9412
|
+
}
|
|
9413
|
+
});
|
|
9246
9414
|
Object.defineProperty(exports, "Webhooks", {
|
|
9247
9415
|
enumerable: true,
|
|
9248
9416
|
get: function() {
|
|
@@ -9274,4 +9442,4 @@ Object.defineProperty(exports, "serializeRevokeSessionOptions", {
|
|
|
9274
9442
|
}
|
|
9275
9443
|
});
|
|
9276
9444
|
|
|
9277
|
-
//# sourceMappingURL=factory-
|
|
9445
|
+
//# sourceMappingURL=factory-BkKapXtb.cjs.map
|