@workos-inc/node 9.2.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.
@@ -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": this.addClientToUserAgent((userAgent || "workos-node").toString())
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
- this.message = `The following ${errors.length === 1 ? "requirement" : "requirements"} must be met:\n`;
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
- payload = JSON.stringify(payload);
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-CxKOxXjo.mjs");
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: AuthenticateWithSessionCookieFailureReason.NO_SESSION_COOKIE_PROVIDED
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: AuthenticateWithSessionCookieFailureReason.INVALID_SESSION_COOKIE
3386
+ reason: "invalid_session_cookie"
3354
3387
  };
3355
3388
  if (!await this.isValidJwt(session.accessToken)) return {
3356
3389
  authenticated: false,
3357
- reason: AuthenticateWithSessionCookieFailureReason.INVALID_JWT
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: RefreshSessionFailureReason.INVALID_SESSION_COOKIE
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 === RefreshSessionFailureReason.INVALID_GRANT || error.error === RefreshSessionFailureReason.MFA_ENROLLMENT || error.error === RefreshSessionFailureReason.SSO_REQUIRED)) return {
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: AuthenticateWithSessionCookieFailureReason.NO_SESSION_COOKIE_PROVIDED
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: AuthenticateWithSessionCookieFailureReason.INVALID_SESSION_COOKIE
3736
+ reason: "invalid_session_cookie"
3703
3737
  };
3704
3738
  if (!await this.isValidJwt(session.accessToken)) return {
3705
3739
  authenticated: false,
3706
- reason: AuthenticateWithSessionCookieFailureReason.INVALID_JWT
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
  }
@@ -4798,6 +4837,20 @@ const deserializeRoleAssignment = (response) => ({
4798
4837
  updatedAt: response.updated_at
4799
4838
  });
4800
4839
  //#endregion
4840
+ //#region src/authorization/serializers/list-role-assignments-options.serializer.ts
4841
+ const serializeListRoleAssignmentsOptions = (options) => ({
4842
+ ...options.resourceId && { resource_id: options.resourceId },
4843
+ ...options.resourceExternalId && { resource_external_id: options.resourceExternalId },
4844
+ ...options.resourceTypeSlug && { resource_type_slug: options.resourceTypeSlug },
4845
+ ...serializePaginationOptions(options)
4846
+ });
4847
+ //#endregion
4848
+ //#region src/authorization/serializers/list-role-assignments-for-resource-options.serializer.ts
4849
+ const serializeListRoleAssignmentsForResourceOptions = (options) => ({
4850
+ ...options.roleSlug && { role_slug: options.roleSlug },
4851
+ ...serializePaginationOptions(options)
4852
+ });
4853
+ //#endregion
4801
4854
  //#region src/authorization/serializers/assign-role-options.serializer.ts
4802
4855
  const serializeAssignRoleOptions = (options) => ({
4803
4856
  role_slug: options.roleSlug,
@@ -4823,6 +4876,7 @@ const serializeListEffectivePermissionsOptions = (options) => ({ ...serializePag
4823
4876
  //#endregion
4824
4877
  //#region src/authorization/authorization.ts
4825
4878
  var Authorization = class {
4879
+ workos;
4826
4880
  constructor(workos) {
4827
4881
  this.workos = workos;
4828
4882
  }
@@ -5399,7 +5453,8 @@ var Authorization = class {
5399
5453
  async listRoleAssignments(options) {
5400
5454
  const { organizationMembershipId, ...queryOptions } = options;
5401
5455
  const endpoint = `/authorization/organization_memberships/${organizationMembershipId}/role_assignments`;
5402
- return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5456
+ const serializedOptions = serializeListRoleAssignmentsOptions(queryOptions);
5457
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
5403
5458
  }
5404
5459
  /**
5405
5460
  * List role assignments for a resource
@@ -5418,7 +5473,8 @@ var Authorization = class {
5418
5473
  async listRoleAssignmentsForResource(options) {
5419
5474
  const { resourceId, ...queryOptions } = options;
5420
5475
  const endpoint = `/authorization/resources/${resourceId}/role_assignments`;
5421
- return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5476
+ const serializedOptions = serializeListRoleAssignmentsForResourceOptions(queryOptions);
5477
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
5422
5478
  }
5423
5479
  /**
5424
5480
  * List role assignments for a resource by external ID
@@ -5447,7 +5503,8 @@ var Authorization = class {
5447
5503
  async listResourceRoleAssignments(options) {
5448
5504
  const { organizationId, resourceTypeSlug, externalId, ...queryOptions } = options;
5449
5505
  const endpoint = `/authorization/organizations/${organizationId}/resources/${resourceTypeSlug}/${externalId}/role_assignments`;
5450
- return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, queryOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), queryOptions);
5506
+ const serializedOptions = serializeListRoleAssignmentsForResourceOptions(queryOptions);
5507
+ return new AutoPaginatable(await fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, serializedOptions), (params) => fetchAndDeserialize(this.workos, endpoint, deserializeRoleAssignment, params), serializedOptions);
5451
5508
  }
5452
5509
  /**
5453
5510
  * Assign a role
@@ -5771,6 +5828,7 @@ const serializeUpdateObjectEntity = (options) => ({
5771
5828
  //#endregion
5772
5829
  //#region src/vault/vault.ts
5773
5830
  var Vault = class {
5831
+ workos;
5774
5832
  cryptoProvider;
5775
5833
  constructor(workos) {
5776
5834
  this.workos = workos;
@@ -5864,50 +5922,8 @@ var Vault = class {
5864
5922
  }
5865
5923
  };
5866
5924
  //#endregion
5867
- //#region src/common/utils/runtime-info.ts
5868
- /**
5869
- * Get runtime information including name and version.
5870
- * Safely extracts version information for different JavaScript runtimes.
5871
- * @returns RuntimeInfo object with name and optional version
5872
- */
5873
- function getRuntimeInfo() {
5874
- const name = detectRuntime();
5875
- let version;
5876
- try {
5877
- switch (name) {
5878
- case "node":
5879
- version = typeof process !== "undefined" ? process.version : void 0;
5880
- break;
5881
- case "deno":
5882
- version = globalThis.Deno?.version?.deno;
5883
- break;
5884
- case "bun":
5885
- version = globalThis.Bun?.version || extractBunVersionFromUserAgent();
5886
- break;
5887
- default:
5888
- version = void 0;
5889
- break;
5890
- }
5891
- } catch {
5892
- version = void 0;
5893
- }
5894
- return {
5895
- name,
5896
- version
5897
- };
5898
- }
5899
- /**
5900
- * Extract Bun version from navigator.userAgent as fallback.
5901
- * @returns Bun version string or undefined
5902
- */
5903
- function extractBunVersionFromUserAgent() {
5904
- try {
5905
- if (typeof navigator !== "undefined" && navigator.userAgent) return navigator.userAgent.match(/Bun\/(\d+\.\d+\.\d+)/)?.[1];
5906
- } catch {}
5907
- }
5908
- //#endregion
5909
5925
  //#region package.json
5910
- var version = "9.2.0";
5926
+ var version = "9.3.1";
5911
5927
  //#endregion
5912
5928
  //#region src/workos.ts
5913
5929
  const DEFAULT_HOSTNAME = "api.workos.com";
@@ -5986,15 +6002,8 @@ var WorkOS = class {
5986
6002
  const userAgent = this.createUserAgent(this.options);
5987
6003
  this.client = this.createHttpClient(this.options, userAgent);
5988
6004
  }
5989
- createUserAgent(options) {
5990
- let userAgent = `workos-node/${version}`;
5991
- const { name: runtimeName, version: runtimeVersion } = getRuntimeInfo();
5992
- userAgent += ` (${runtimeName}${runtimeVersion ? `/${runtimeVersion}` : ""})`;
5993
- if (options.appInfo) {
5994
- const { name, version } = options.appInfo;
5995
- userAgent += ` ${name}: ${version}`;
5996
- }
5997
- return userAgent;
6005
+ createUserAgent(_options) {
6006
+ return `workos-node/${version}`;
5998
6007
  }
5999
6008
  createWebhookClient() {
6000
6009
  return new Webhooks(this.getCryptoProvider());
@@ -6292,4 +6301,4 @@ function createWorkOS(options) {
6292
6301
  //#endregion
6293
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 };
6294
6303
 
6295
- //# sourceMappingURL=factory-CdcF5208.mjs.map
6304
+ //# sourceMappingURL=factory-B2N5WzoO.mjs.map