@workos-inc/node 9.3.0 → 9.3.1
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/lib/{factory-DSVg8BX4.mjs → factory-B2N5WzoO.mjs} +72 -80
- package/lib/factory-B2N5WzoO.mjs.map +1 -0
- package/lib/{factory-5S80C27h.cjs → factory-ljCdlI7q.cjs} +72 -80
- package/lib/factory-ljCdlI7q.cjs.map +1 -0
- package/lib/index.cjs +1 -1
- package/lib/index.cjs.map +1 -1
- package/lib/index.d.cts +1 -1
- package/lib/index.d.mts +1 -1
- package/lib/index.mjs +1 -1
- package/lib/index.mjs.map +1 -1
- package/lib/index.worker.cjs +1 -1
- package/lib/index.worker.cjs.map +1 -1
- package/lib/index.worker.d.cts +1 -1
- package/lib/index.worker.d.mts +1 -1
- package/lib/index.worker.mjs +1 -1
- package/lib/index.worker.mjs.map +1 -1
- package/lib/{webapi-CxKOxXjo.mjs → webapi-CKFbiPvQ.mjs} +3 -2
- package/lib/webapi-CKFbiPvQ.mjs.map +1 -0
- package/lib/{webapi-N7c2LUJd.cjs → webapi-lTzmUixq.cjs} +3 -2
- package/lib/webapi-lTzmUixq.cjs.map +1 -0
- package/lib/{workos-DS8Htvr7.d.cts → workos-D5a84gFU.d.mts} +9 -10
- package/lib/{workos-Bm__aISC.d.mts → workos-DPWj5UVH.d.cts} +9 -10
- package/package.json +5 -5
- package/lib/factory-5S80C27h.cjs.map +0 -1
- package/lib/factory-DSVg8BX4.mjs.map +0 -1
- package/lib/webapi-CxKOxXjo.mjs.map +0 -1
- package/lib/webapi-N7c2LUJd.cjs.map +0 -1
|
@@ -99,6 +99,8 @@ for (let i = 0; i < byteHexMapping.length; i++) byteHexMapping[i] = i.toString(1
|
|
|
99
99
|
//#endregion
|
|
100
100
|
//#region src/common/net/http-client.ts
|
|
101
101
|
var HttpClient = class HttpClient {
|
|
102
|
+
baseURL;
|
|
103
|
+
options;
|
|
102
104
|
MAX_RETRY_ATTEMPTS = 3;
|
|
103
105
|
BACKOFF_MULTIPLIER = 1.5;
|
|
104
106
|
MINIMUM_SLEEP_TIME_IN_MILLISECONDS = 500;
|
|
@@ -112,14 +114,6 @@ var HttpClient = class HttpClient {
|
|
|
112
114
|
this.baseURL = baseURL;
|
|
113
115
|
this.options = options;
|
|
114
116
|
}
|
|
115
|
-
/** The HTTP client name used for diagnostics */
|
|
116
|
-
getClientName() {
|
|
117
|
-
throw new Error("getClientName not implemented");
|
|
118
|
-
}
|
|
119
|
-
addClientToUserAgent(userAgent) {
|
|
120
|
-
if (userAgent.indexOf(" ") > -1) return userAgent.replace(/\b\s/, `/${this.getClientName()} `);
|
|
121
|
-
else return `${userAgent}/${this.getClientName()}`;
|
|
122
|
-
}
|
|
123
117
|
static getResourceURL(baseURL, path, params) {
|
|
124
118
|
const queryString = HttpClient.getQueryString(params);
|
|
125
119
|
return new URL([path, queryString].filter(Boolean).join("?"), baseURL).toString();
|
|
@@ -190,6 +184,8 @@ var ParseError = class extends Error {
|
|
|
190
184
|
//#region src/common/net/fetch-client.ts
|
|
191
185
|
const DEFAULT_FETCH_TIMEOUT = 6e4;
|
|
192
186
|
var FetchHttpClient = class extends HttpClient {
|
|
187
|
+
baseURL;
|
|
188
|
+
options;
|
|
193
189
|
_fetchFn;
|
|
194
190
|
constructor(baseURL, options, fetchFn) {
|
|
195
191
|
super(baseURL, options);
|
|
@@ -201,10 +197,6 @@ var FetchHttpClient = class extends HttpClient {
|
|
|
201
197
|
}
|
|
202
198
|
this._fetchFn = fetchFn.bind(globalThis);
|
|
203
199
|
}
|
|
204
|
-
/** @override */
|
|
205
|
-
getClientName() {
|
|
206
|
-
return "fetch";
|
|
207
|
-
}
|
|
208
200
|
async get(path, options) {
|
|
209
201
|
const resourceURL = HttpClient.getResourceURL(this.baseURL, path, options.params);
|
|
210
202
|
if (HttpClient.isPathRetryable(path)) return await this.fetchRequestWithRetry(resourceURL, "GET", null, options.headers);
|
|
@@ -275,7 +267,7 @@ var FetchHttpClient = class extends HttpClient {
|
|
|
275
267
|
"Content-Type": "application/json",
|
|
276
268
|
...this.options?.headers,
|
|
277
269
|
...headers,
|
|
278
|
-
"User-Agent":
|
|
270
|
+
"User-Agent": (userAgent || "workos-node").toString()
|
|
279
271
|
},
|
|
280
272
|
body: requestBody,
|
|
281
273
|
signal: abortController?.signal
|
|
@@ -370,6 +362,19 @@ var FetchHttpClientResponse = class FetchHttpClientResponse extends HttpClientRe
|
|
|
370
362
|
}
|
|
371
363
|
};
|
|
372
364
|
//#endregion
|
|
365
|
+
//#region src/common/crypto/decode-payload.ts
|
|
366
|
+
function isBinaryPayload(payload) {
|
|
367
|
+
return ArrayBuffer.isView(payload) || Object.prototype.toString.call(payload) === "[object ArrayBuffer]";
|
|
368
|
+
}
|
|
369
|
+
function decodePayloadToString(payload) {
|
|
370
|
+
if (typeof payload === "string") return payload;
|
|
371
|
+
if (isBinaryPayload(payload)) {
|
|
372
|
+
const bytes = Object.prototype.toString.call(payload) === "[object ArrayBuffer]" ? new Uint8Array(payload) : payload;
|
|
373
|
+
return new TextDecoder("utf-8", { ignoreBOM: true }).decode(bytes);
|
|
374
|
+
}
|
|
375
|
+
return JSON.stringify(payload);
|
|
376
|
+
}
|
|
377
|
+
//#endregion
|
|
373
378
|
//#region src/common/exceptions/api-key-required.exception.ts
|
|
374
379
|
var ApiKeyRequiredException = class extends Error {
|
|
375
380
|
status = 403;
|
|
@@ -383,6 +388,9 @@ var ApiKeyRequiredException = class extends Error {
|
|
|
383
388
|
//#endregion
|
|
384
389
|
//#region src/common/exceptions/generic-server.exception.ts
|
|
385
390
|
var GenericServerException = class extends Error {
|
|
391
|
+
status;
|
|
392
|
+
rawData;
|
|
393
|
+
requestID;
|
|
386
394
|
name = "GenericServerException";
|
|
387
395
|
message = "The request could not be completed.";
|
|
388
396
|
code;
|
|
@@ -417,6 +425,7 @@ function isAuthenticationErrorData(data) {
|
|
|
417
425
|
return getAuthenticationErrorCode(data) !== void 0;
|
|
418
426
|
}
|
|
419
427
|
var AuthenticationException = class extends GenericServerException {
|
|
428
|
+
rawData;
|
|
420
429
|
name = "AuthenticationException";
|
|
421
430
|
code;
|
|
422
431
|
pendingAuthenticationToken;
|
|
@@ -486,6 +495,11 @@ var NotFoundException = class extends Error {
|
|
|
486
495
|
//#endregion
|
|
487
496
|
//#region src/common/exceptions/oauth.exception.ts
|
|
488
497
|
var OauthException = class extends Error {
|
|
498
|
+
status;
|
|
499
|
+
requestID;
|
|
500
|
+
error;
|
|
501
|
+
errorDescription;
|
|
502
|
+
rawData;
|
|
489
503
|
name = "OauthException";
|
|
490
504
|
constructor(status, requestID, error, errorDescription, rawData) {
|
|
491
505
|
super();
|
|
@@ -502,6 +516,7 @@ var OauthException = class extends Error {
|
|
|
502
516
|
//#endregion
|
|
503
517
|
//#region src/common/exceptions/rate-limit-exceeded.exception.ts
|
|
504
518
|
var RateLimitExceededException = class extends GenericServerException {
|
|
519
|
+
retryAfter;
|
|
505
520
|
name = "RateLimitExceededException";
|
|
506
521
|
constructor(message, requestID, retryAfter) {
|
|
507
522
|
super(429, message, {}, requestID);
|
|
@@ -519,6 +534,7 @@ var SignatureVerificationException = class extends Error {
|
|
|
519
534
|
//#endregion
|
|
520
535
|
//#region src/common/exceptions/unauthorized.exception.ts
|
|
521
536
|
var UnauthorizedException = class extends Error {
|
|
537
|
+
requestID;
|
|
522
538
|
status = 401;
|
|
523
539
|
name = "UnauthorizedException";
|
|
524
540
|
message;
|
|
@@ -542,7 +558,8 @@ var UnprocessableEntityException = class extends Error {
|
|
|
542
558
|
if (message) this.message = message;
|
|
543
559
|
if (code) this.code = code;
|
|
544
560
|
if (errors) {
|
|
545
|
-
|
|
561
|
+
const requirement = errors.length === 1 ? "requirement" : "requirements";
|
|
562
|
+
this.message = `The following ${requirement} must be met:\n`;
|
|
546
563
|
for (const { code } of errors) this.message = this.message.concat(`\t${code}\n`);
|
|
547
564
|
}
|
|
548
565
|
}
|
|
@@ -570,8 +587,7 @@ var SignatureProvider = class {
|
|
|
570
587
|
return [timestamp, signatureHash];
|
|
571
588
|
}
|
|
572
589
|
async computeSignature(timestamp, payload, secret) {
|
|
573
|
-
|
|
574
|
-
const signedPayload = `${timestamp}.${payload}`;
|
|
590
|
+
const signedPayload = `${timestamp}.${decodePayloadToString(payload)}`;
|
|
575
591
|
return await this.cryptoProvider.computeHMACSignatureAsync(signedPayload, secret);
|
|
576
592
|
}
|
|
577
593
|
};
|
|
@@ -1062,7 +1078,7 @@ var Actions = class {
|
|
|
1062
1078
|
tolerance
|
|
1063
1079
|
};
|
|
1064
1080
|
await this.verifyHeader(options);
|
|
1065
|
-
return deserializeAction(payload);
|
|
1081
|
+
return deserializeAction(typeof payload === "string" || isBinaryPayload(payload) ? JSON.parse(decodePayloadToString(payload)) : payload);
|
|
1066
1082
|
}
|
|
1067
1083
|
};
|
|
1068
1084
|
//#endregion
|
|
@@ -1697,6 +1713,10 @@ const serializePaginationOptions = (options) => ({
|
|
|
1697
1713
|
});
|
|
1698
1714
|
//#endregion
|
|
1699
1715
|
//#region src/webhooks/webhooks.ts
|
|
1716
|
+
function parseVerifiedPayload(payload) {
|
|
1717
|
+
if (typeof payload === "object" && !isBinaryPayload(payload)) return payload;
|
|
1718
|
+
return JSON.parse(decodePayloadToString(payload));
|
|
1719
|
+
}
|
|
1700
1720
|
var Webhooks = class {
|
|
1701
1721
|
signatureProvider;
|
|
1702
1722
|
constructor(cryptoProvider) {
|
|
@@ -1719,7 +1739,7 @@ var Webhooks = class {
|
|
|
1719
1739
|
tolerance
|
|
1720
1740
|
};
|
|
1721
1741
|
await this.verifyHeader(options);
|
|
1722
|
-
return deserializeEvent(payload);
|
|
1742
|
+
return deserializeEvent(parseVerifiedPayload(payload));
|
|
1723
1743
|
}
|
|
1724
1744
|
};
|
|
1725
1745
|
//#endregion
|
|
@@ -1775,6 +1795,8 @@ var PKCE = class {
|
|
|
1775
1795
|
//#endregion
|
|
1776
1796
|
//#region src/common/utils/pagination.ts
|
|
1777
1797
|
var AutoPaginatable = class {
|
|
1798
|
+
list;
|
|
1799
|
+
apiCall;
|
|
1778
1800
|
object = "list";
|
|
1779
1801
|
options;
|
|
1780
1802
|
constructor(list, apiCall, options) {
|
|
@@ -1858,6 +1880,7 @@ const fetchAndDeserialize = async (workos, endpoint, deserializeFn, options, req
|
|
|
1858
1880
|
//#endregion
|
|
1859
1881
|
//#region src/api-keys/api-keys.ts
|
|
1860
1882
|
var ApiKeys = class {
|
|
1883
|
+
workos;
|
|
1861
1884
|
constructor(workos) {
|
|
1862
1885
|
this.workos = workos;
|
|
1863
1886
|
}
|
|
@@ -1929,6 +1952,7 @@ var ApiKeys = class {
|
|
|
1929
1952
|
//#endregion
|
|
1930
1953
|
//#region src/directory-sync/directory-sync.ts
|
|
1931
1954
|
var DirectorySync = class {
|
|
1955
|
+
workos;
|
|
1932
1956
|
constructor(workos) {
|
|
1933
1957
|
this.workos = workos;
|
|
1934
1958
|
}
|
|
@@ -2050,6 +2074,7 @@ const serializeListEventOptions = (options) => ({
|
|
|
2050
2074
|
//#endregion
|
|
2051
2075
|
//#region src/events/events.ts
|
|
2052
2076
|
var Events = class {
|
|
2077
|
+
workos;
|
|
2053
2078
|
constructor(workos) {
|
|
2054
2079
|
this.workos = workos;
|
|
2055
2080
|
}
|
|
@@ -2070,6 +2095,7 @@ var Events = class {
|
|
|
2070
2095
|
//#endregion
|
|
2071
2096
|
//#region src/organizations/organizations.ts
|
|
2072
2097
|
var Organizations = class {
|
|
2098
|
+
workos;
|
|
2073
2099
|
constructor(workos) {
|
|
2074
2100
|
this.workos = workos;
|
|
2075
2101
|
}
|
|
@@ -2172,6 +2198,7 @@ const serializeCreateOrganizationDomainOptions = (options) => ({
|
|
|
2172
2198
|
//#endregion
|
|
2173
2199
|
//#region src/organization-domains/organization-domains.ts
|
|
2174
2200
|
var OrganizationDomains = class {
|
|
2201
|
+
workos;
|
|
2175
2202
|
constructor(workos) {
|
|
2176
2203
|
this.workos = workos;
|
|
2177
2204
|
}
|
|
@@ -2247,6 +2274,7 @@ const deserializePasswordlessSession = (passwordlessSession) => ({
|
|
|
2247
2274
|
//#endregion
|
|
2248
2275
|
//#region src/passwordless/passwordless.ts
|
|
2249
2276
|
var Passwordless = class {
|
|
2277
|
+
workos;
|
|
2250
2278
|
constructor(workos) {
|
|
2251
2279
|
this.workos = workos;
|
|
2252
2280
|
}
|
|
@@ -2295,6 +2323,7 @@ function deserializeGetAccessTokenResponse(response) {
|
|
|
2295
2323
|
//#endregion
|
|
2296
2324
|
//#region src/pipes/pipes.ts
|
|
2297
2325
|
var Pipes = class {
|
|
2326
|
+
workos;
|
|
2298
2327
|
constructor(workos) {
|
|
2299
2328
|
this.workos = workos;
|
|
2300
2329
|
}
|
|
@@ -2306,6 +2335,7 @@ var Pipes = class {
|
|
|
2306
2335
|
//#endregion
|
|
2307
2336
|
//#region src/admin-portal/admin-portal.ts
|
|
2308
2337
|
var AdminPortal = class {
|
|
2338
|
+
workos;
|
|
2309
2339
|
constructor(workos) {
|
|
2310
2340
|
this.workos = workos;
|
|
2311
2341
|
}
|
|
@@ -2369,6 +2399,7 @@ function encodeRFC1738(str) {
|
|
|
2369
2399
|
//#endregion
|
|
2370
2400
|
//#region src/sso/sso.ts
|
|
2371
2401
|
var SSO = class {
|
|
2402
|
+
workos;
|
|
2372
2403
|
constructor(workos) {
|
|
2373
2404
|
this.workos = workos;
|
|
2374
2405
|
}
|
|
@@ -2571,6 +2602,7 @@ const deserializeVerifyResponse = (verifyResponse) => ({
|
|
|
2571
2602
|
//#endregion
|
|
2572
2603
|
//#region src/multi-factor-auth/multi-factor-auth.ts
|
|
2573
2604
|
var MultiFactorAuth = class {
|
|
2605
|
+
workos;
|
|
2574
2606
|
constructor(workos) {
|
|
2575
2607
|
this.workos = workos;
|
|
2576
2608
|
}
|
|
@@ -2772,6 +2804,7 @@ const deserializeAuditLogSchema = (auditLogSchema) => ({
|
|
|
2772
2804
|
//#endregion
|
|
2773
2805
|
//#region src/audit-logs/audit-logs.ts
|
|
2774
2806
|
var AuditLogs = class {
|
|
2807
|
+
workos;
|
|
2775
2808
|
constructor(workos) {
|
|
2776
2809
|
this.workos = workos;
|
|
2777
2810
|
}
|
|
@@ -3323,7 +3356,7 @@ let _josePromise;
|
|
|
3323
3356
|
* @returns Promise that resolves to the jose module
|
|
3324
3357
|
*/
|
|
3325
3358
|
function getJose() {
|
|
3326
|
-
return _josePromise ??= import("./webapi-
|
|
3359
|
+
return _josePromise ??= import("./webapi-CKFbiPvQ.mjs");
|
|
3327
3360
|
}
|
|
3328
3361
|
//#endregion
|
|
3329
3362
|
//#region src/user-management/session.ts
|
|
@@ -3345,16 +3378,16 @@ var CookieSession = class {
|
|
|
3345
3378
|
async authenticate() {
|
|
3346
3379
|
if (!this.sessionData) return {
|
|
3347
3380
|
authenticated: false,
|
|
3348
|
-
reason:
|
|
3381
|
+
reason: "no_session_cookie_provided"
|
|
3349
3382
|
};
|
|
3350
3383
|
const session = await unsealData(this.sessionData, { password: this.cookiePassword });
|
|
3351
3384
|
if (!session.accessToken) return {
|
|
3352
3385
|
authenticated: false,
|
|
3353
|
-
reason:
|
|
3386
|
+
reason: "invalid_session_cookie"
|
|
3354
3387
|
};
|
|
3355
3388
|
if (!await this.isValidJwt(session.accessToken)) return {
|
|
3356
3389
|
authenticated: false,
|
|
3357
|
-
reason:
|
|
3390
|
+
reason: "invalid_jwt"
|
|
3358
3391
|
};
|
|
3359
3392
|
const { decodeJwt } = await getJose();
|
|
3360
3393
|
const { sid: sessionId, org_id: organizationId, role, roles, permissions, entitlements, feature_flags: featureFlags } = decodeJwt(session.accessToken);
|
|
@@ -3386,7 +3419,7 @@ var CookieSession = class {
|
|
|
3386
3419
|
const session = await unsealData(this.sessionData, { password: this.cookiePassword });
|
|
3387
3420
|
if (!session.refreshToken || !session.user) return {
|
|
3388
3421
|
authenticated: false,
|
|
3389
|
-
reason:
|
|
3422
|
+
reason: "invalid_session_cookie"
|
|
3390
3423
|
};
|
|
3391
3424
|
const { org_id: organizationIdFromAccessToken } = decodeJwt(session.accessToken);
|
|
3392
3425
|
try {
|
|
@@ -3419,7 +3452,7 @@ var CookieSession = class {
|
|
|
3419
3452
|
impersonator: session.impersonator
|
|
3420
3453
|
};
|
|
3421
3454
|
} catch (error) {
|
|
3422
|
-
if (error instanceof OauthException && (error.error ===
|
|
3455
|
+
if (error instanceof OauthException && (error.error === "invalid_grant" || error.error === "mfa_enrollment" || error.error === "sso_required")) return {
|
|
3423
3456
|
authenticated: false,
|
|
3424
3457
|
reason: error.error
|
|
3425
3458
|
};
|
|
@@ -3458,6 +3491,7 @@ var CookieSession = class {
|
|
|
3458
3491
|
//#endregion
|
|
3459
3492
|
//#region src/user-management/user-management.ts
|
|
3460
3493
|
var UserManagement = class {
|
|
3494
|
+
workos;
|
|
3461
3495
|
_jwks;
|
|
3462
3496
|
clientId;
|
|
3463
3497
|
constructor(workos) {
|
|
@@ -3694,16 +3728,16 @@ var UserManagement = class {
|
|
|
3694
3728
|
const { decodeJwt } = await getJose();
|
|
3695
3729
|
if (!sessionData) return {
|
|
3696
3730
|
authenticated: false,
|
|
3697
|
-
reason:
|
|
3731
|
+
reason: "no_session_cookie_provided"
|
|
3698
3732
|
};
|
|
3699
3733
|
const session = await unsealData(sessionData, { password: cookiePassword });
|
|
3700
3734
|
if (!session.accessToken) return {
|
|
3701
3735
|
authenticated: false,
|
|
3702
|
-
reason:
|
|
3736
|
+
reason: "invalid_session_cookie"
|
|
3703
3737
|
};
|
|
3704
3738
|
if (!await this.isValidJwt(session.accessToken)) return {
|
|
3705
3739
|
authenticated: false,
|
|
3706
|
-
reason:
|
|
3740
|
+
reason: "invalid_jwt"
|
|
3707
3741
|
};
|
|
3708
3742
|
const { sid: sessionId, org_id: organizationId, role, roles, permissions, entitlements, feature_flags: featureFlags } = decodeJwt(session.accessToken);
|
|
3709
3743
|
return {
|
|
@@ -4238,6 +4272,7 @@ var InMemoryStore = class {
|
|
|
4238
4272
|
//#endregion
|
|
4239
4273
|
//#region src/feature-flags/evaluator.ts
|
|
4240
4274
|
var Evaluator = class {
|
|
4275
|
+
store;
|
|
4241
4276
|
constructor(store) {
|
|
4242
4277
|
this.store = store;
|
|
4243
4278
|
}
|
|
@@ -4273,6 +4308,7 @@ const INITIAL_RETRY_MS = 1e3;
|
|
|
4273
4308
|
const MAX_RETRY_MS = 6e4;
|
|
4274
4309
|
const BACKOFF_MULTIPLIER = 2;
|
|
4275
4310
|
var FeatureFlagsRuntimeClient = class extends EventEmitter {
|
|
4311
|
+
workos;
|
|
4276
4312
|
store;
|
|
4277
4313
|
evaluator;
|
|
4278
4314
|
pollingIntervalMs;
|
|
@@ -4455,6 +4491,7 @@ var FeatureFlagsRuntimeClient = class extends EventEmitter {
|
|
|
4455
4491
|
//#endregion
|
|
4456
4492
|
//#region src/feature-flags/feature-flags.ts
|
|
4457
4493
|
var FeatureFlags = class {
|
|
4494
|
+
workos;
|
|
4458
4495
|
constructor(workos) {
|
|
4459
4496
|
this.workos = workos;
|
|
4460
4497
|
}
|
|
@@ -4577,6 +4614,7 @@ var FeatureFlags = class {
|
|
|
4577
4614
|
//#endregion
|
|
4578
4615
|
//#region src/groups/groups.ts
|
|
4579
4616
|
var Groups = class {
|
|
4617
|
+
workos;
|
|
4580
4618
|
constructor(workos) {
|
|
4581
4619
|
this.workos = workos;
|
|
4582
4620
|
}
|
|
@@ -4629,6 +4667,7 @@ const deserializeGetTokenResponse = (data) => ({ token: data.token });
|
|
|
4629
4667
|
//#endregion
|
|
4630
4668
|
//#region src/widgets/widgets.ts
|
|
4631
4669
|
var Widgets = class {
|
|
4670
|
+
workos;
|
|
4632
4671
|
constructor(workos) {
|
|
4633
4672
|
this.workos = workos;
|
|
4634
4673
|
}
|
|
@@ -4837,6 +4876,7 @@ const serializeListEffectivePermissionsOptions = (options) => ({ ...serializePag
|
|
|
4837
4876
|
//#endregion
|
|
4838
4877
|
//#region src/authorization/authorization.ts
|
|
4839
4878
|
var Authorization = class {
|
|
4879
|
+
workos;
|
|
4840
4880
|
constructor(workos) {
|
|
4841
4881
|
this.workos = workos;
|
|
4842
4882
|
}
|
|
@@ -5788,6 +5828,7 @@ const serializeUpdateObjectEntity = (options) => ({
|
|
|
5788
5828
|
//#endregion
|
|
5789
5829
|
//#region src/vault/vault.ts
|
|
5790
5830
|
var Vault = class {
|
|
5831
|
+
workos;
|
|
5791
5832
|
cryptoProvider;
|
|
5792
5833
|
constructor(workos) {
|
|
5793
5834
|
this.workos = workos;
|
|
@@ -5881,50 +5922,8 @@ var Vault = class {
|
|
|
5881
5922
|
}
|
|
5882
5923
|
};
|
|
5883
5924
|
//#endregion
|
|
5884
|
-
//#region src/common/utils/runtime-info.ts
|
|
5885
|
-
/**
|
|
5886
|
-
* Get runtime information including name and version.
|
|
5887
|
-
* Safely extracts version information for different JavaScript runtimes.
|
|
5888
|
-
* @returns RuntimeInfo object with name and optional version
|
|
5889
|
-
*/
|
|
5890
|
-
function getRuntimeInfo() {
|
|
5891
|
-
const name = detectRuntime();
|
|
5892
|
-
let version;
|
|
5893
|
-
try {
|
|
5894
|
-
switch (name) {
|
|
5895
|
-
case "node":
|
|
5896
|
-
version = typeof process !== "undefined" ? process.version : void 0;
|
|
5897
|
-
break;
|
|
5898
|
-
case "deno":
|
|
5899
|
-
version = globalThis.Deno?.version?.deno;
|
|
5900
|
-
break;
|
|
5901
|
-
case "bun":
|
|
5902
|
-
version = globalThis.Bun?.version || extractBunVersionFromUserAgent();
|
|
5903
|
-
break;
|
|
5904
|
-
default:
|
|
5905
|
-
version = void 0;
|
|
5906
|
-
break;
|
|
5907
|
-
}
|
|
5908
|
-
} catch {
|
|
5909
|
-
version = void 0;
|
|
5910
|
-
}
|
|
5911
|
-
return {
|
|
5912
|
-
name,
|
|
5913
|
-
version
|
|
5914
|
-
};
|
|
5915
|
-
}
|
|
5916
|
-
/**
|
|
5917
|
-
* Extract Bun version from navigator.userAgent as fallback.
|
|
5918
|
-
* @returns Bun version string or undefined
|
|
5919
|
-
*/
|
|
5920
|
-
function extractBunVersionFromUserAgent() {
|
|
5921
|
-
try {
|
|
5922
|
-
if (typeof navigator !== "undefined" && navigator.userAgent) return navigator.userAgent.match(/Bun\/(\d+\.\d+\.\d+)/)?.[1];
|
|
5923
|
-
} catch {}
|
|
5924
|
-
}
|
|
5925
|
-
//#endregion
|
|
5926
5925
|
//#region package.json
|
|
5927
|
-
var version = "9.3.
|
|
5926
|
+
var version = "9.3.1";
|
|
5928
5927
|
//#endregion
|
|
5929
5928
|
//#region src/workos.ts
|
|
5930
5929
|
const DEFAULT_HOSTNAME = "api.workos.com";
|
|
@@ -6003,15 +6002,8 @@ var WorkOS = class {
|
|
|
6003
6002
|
const userAgent = this.createUserAgent(this.options);
|
|
6004
6003
|
this.client = this.createHttpClient(this.options, userAgent);
|
|
6005
6004
|
}
|
|
6006
|
-
createUserAgent(
|
|
6007
|
-
|
|
6008
|
-
const { name: runtimeName, version: runtimeVersion } = getRuntimeInfo();
|
|
6009
|
-
userAgent += ` (${runtimeName}${runtimeVersion ? `/${runtimeVersion}` : ""})`;
|
|
6010
|
-
if (options.appInfo) {
|
|
6011
|
-
const { name, version } = options.appInfo;
|
|
6012
|
-
userAgent += ` ${name}: ${version}`;
|
|
6013
|
-
}
|
|
6014
|
-
return userAgent;
|
|
6005
|
+
createUserAgent(_options) {
|
|
6006
|
+
return `workos-node/${version}`;
|
|
6015
6007
|
}
|
|
6016
6008
|
createWebhookClient() {
|
|
6017
6009
|
return new Webhooks(this.getCryptoProvider());
|
|
@@ -6309,4 +6301,4 @@ function createWorkOS(options) {
|
|
|
6309
6301
|
//#endregion
|
|
6310
6302
|
export { FetchHttpClient as A, NoApiKeyProvidedException as C, isAuthenticationErrorData as D, AuthenticationException as E, GenericServerException as O, NotFoundException as S, BadRequestException as T, UnprocessableEntityException as _, DomainDataState as a, RateLimitExceededException as b, FeatureFlagsRuntimeClient as c, serializeRevokeSessionOptions as d, AuthenticateWithSessionCookieFailureReason as f, Actions as g, Webhooks as h, OrganizationDomainVerificationStrategy as i, SubtleCryptoProvider as j, ApiKeyRequiredException as k, CookieSession as l, PKCE as m, ConnectionType as n, GenerateLinkIntent as o, AutoPaginatable as p, OrganizationDomainState as r, WorkOS as s, createWorkOS as t, RefreshSessionFailureReason as u, UnauthorizedException as v, ConflictException as w, OauthException as x, SignatureVerificationException as y };
|
|
6311
6303
|
|
|
6312
|
-
//# sourceMappingURL=factory-
|
|
6304
|
+
//# sourceMappingURL=factory-B2N5WzoO.mjs.map
|