@workos-inc/node 12.4.0 → 12.4.2

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.
@@ -1567,6 +1567,7 @@ declare enum ConnectionType {
1567
1567
  GenericSAML = "GenericSAML",
1568
1568
  GitHubOAuth = "GitHubOAuth",
1569
1569
  GoogleOAuth = "GoogleOAuth",
1570
+ GoogleOIDC = "GoogleOIDC",
1570
1571
  GoogleSAML = "GoogleSAML",
1571
1572
  JumpCloudSAML = "JumpCloudSAML",
1572
1573
  KeycloakSAML = "KeycloakSAML",
@@ -9367,9 +9368,10 @@ declare class AuditLogs {
9367
9368
  *
9368
9369
  * This API supports idempotency which guarantees that performing the same operation multiple times will have the same result as if the operation were performed only once. This is handy in situations where you may need to retry a request due to a failure or prevent accidental duplicate requests from creating more than one resource.
9369
9370
  *
9370
- * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. Each subsequent request matching this unique string will return the same response. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
9371
+ * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
9371
9372
  *
9372
- * Idempotency keys expire after 24 hours. The API will generate a new response if you submit a request with an expired key.
9373
+ * WorkOS uses the idempotency key and event data together to detect duplicates.
9374
+ * When retrying an event, reuse its original key and send the same event data.
9373
9375
  * @param payload - Object containing organizationId, event.
9374
9376
  * @returns {Promise<void>}
9375
9377
  * @throws {BadRequestException} 400
@@ -9869,13 +9871,6 @@ declare class UserManagement {
9869
9871
  * the token; errors that are not JWT validation failures propagate.
9870
9872
  */
9871
9873
  private verifyJwt;
9872
- /**
9873
- * Whether a jose error means the presented token is invalid, as opposed to
9874
- * a failure to verify it at all. Network errors, JWKS timeouts and crypto
9875
- * failures propagate so they surface as errors rather than as rejected
9876
- * tokens.
9877
- */
9878
- private static isJwtValidationError;
9879
9874
  private prepareAuthenticationResponse;
9880
9875
  private sealSessionDataFromAuthenticationResponse;
9881
9876
  getSessionFromCookie({ sessionData, cookiePassword }: SessionHandlerOptions): Promise<SessionCookieData | undefined>;
@@ -1567,6 +1567,7 @@ declare enum ConnectionType {
1567
1567
  GenericSAML = "GenericSAML",
1568
1568
  GitHubOAuth = "GitHubOAuth",
1569
1569
  GoogleOAuth = "GoogleOAuth",
1570
+ GoogleOIDC = "GoogleOIDC",
1570
1571
  GoogleSAML = "GoogleSAML",
1571
1572
  JumpCloudSAML = "JumpCloudSAML",
1572
1573
  KeycloakSAML = "KeycloakSAML",
@@ -9724,9 +9725,10 @@ declare class AuditLogs {
9724
9725
  *
9725
9726
  * This API supports idempotency which guarantees that performing the same operation multiple times will have the same result as if the operation were performed only once. This is handy in situations where you may need to retry a request due to a failure or prevent accidental duplicate requests from creating more than one resource.
9726
9727
  *
9727
- * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. Each subsequent request matching this unique string will return the same response. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
9728
+ * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
9728
9729
  *
9729
- * Idempotency keys expire after 24 hours. The API will generate a new response if you submit a request with an expired key.
9730
+ * WorkOS uses the idempotency key and event data together to detect duplicates.
9731
+ * When retrying an event, reuse its original key and send the same event data.
9730
9732
  * @param payload - Object containing organizationId, event.
9731
9733
  * @returns {Promise<void>}
9732
9734
  * @throws {BadRequestException} 400
@@ -10226,13 +10228,6 @@ declare class UserManagement {
10226
10228
  * the token; errors that are not JWT validation failures propagate.
10227
10229
  */
10228
10230
  private verifyJwt;
10229
- /**
10230
- * Whether a jose error means the presented token is invalid, as opposed to
10231
- * a failure to verify it at all. Network errors, JWKS timeouts and crypto
10232
- * failures propagate so they surface as errors rather than as rejected
10233
- * tokens.
10234
- */
10235
- private static isJwtValidationError;
10236
10231
  private prepareAuthenticationResponse;
10237
10232
  private sealSessionDataFromAuthenticationResponse;
10238
10233
  getSessionFromCookie({ sessionData, cookiePassword }: SessionHandlerOptions): Promise<SessionCookieData | undefined>;
@@ -2782,6 +2782,15 @@ let _josePromise;
2782
2782
  function getJose() {
2783
2783
  return _josePromise ??= import("./webapi-CFOFAgDt.mjs");
2784
2784
  }
2785
+ /**
2786
+ * Whether a jose error means the presented token is invalid, as opposed to
2787
+ * a failure to verify it at all. Network errors, JWKS timeouts and crypto
2788
+ * failures propagate so they surface as errors rather than as rejected tokens.
2789
+ */
2790
+ function isJwtValidationError(e) {
2791
+ if (!(e instanceof Error) || !("code" in e) || typeof e.code !== "string") return false;
2792
+ return e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_") || e.code === "ERR_JWKS_NO_MATCHING_KEY" || e.code === "ERR_JWKS_MULTIPLE_MATCHING_KEYS" || e.code === "ERR_JOSE_NOT_SUPPORTED";
2793
+ }
2785
2794
  // src/agents/serializers/agent-instance-session.serializer.ts
2786
2795
  function deserializeAgentInstanceSession(session) {
2787
2796
  return {
@@ -3228,7 +3237,7 @@ var Agents = class {
3228
3237
  if (payload.exp * 1e3 <= Date.now()) return null;
3229
3238
  return deserializeAgentAccessTokenClaims(payload);
3230
3239
  } catch (e) {
3231
- if (e instanceof Error && "code" in e && typeof e.code === "string" && (e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_"))) return null;
3240
+ if (isJwtValidationError(e)) return null;
3232
3241
  throw e;
3233
3242
  }
3234
3243
  }
@@ -6048,9 +6057,10 @@ var AuditLogs = class {
6048
6057
  *
6049
6058
  * This API supports idempotency which guarantees that performing the same operation multiple times will have the same result as if the operation were performed only once. This is handy in situations where you may need to retry a request due to a failure or prevent accidental duplicate requests from creating more than one resource.
6050
6059
  *
6051
- * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. Each subsequent request matching this unique string will return the same response. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
6060
+ * To achieve idempotency, you can add `Idempotency-Key` request header to a Create Event request with a unique string as the value. We suggest using [v4 UUIDs](https://en.wikipedia.org/wiki/Universally_unique_identifier) for idempotency keys to avoid collisions.
6052
6061
  *
6053
- * Idempotency keys expire after 24 hours. The API will generate a new response if you submit a request with an expired key.
6062
+ * WorkOS uses the idempotency key and event data together to detect duplicates.
6063
+ * When retrying an event, reuse its original key and send the same event data.
6054
6064
  * @param payload - Object containing organizationId, event.
6055
6065
  * @returns {Promise<void>}
6056
6066
  * @throws {BadRequestException} 400
@@ -7130,20 +7140,10 @@ var UserManagement = class UserManagement {
7130
7140
  const { payload } = await jwtVerify(accessToken, jwks, this.issuer ? { issuer: this.issuer } : void 0);
7131
7141
  return payload;
7132
7142
  } catch (e) {
7133
- if (UserManagement.isJwtValidationError(e)) return null;
7143
+ if (isJwtValidationError(e)) return null;
7134
7144
  throw e;
7135
7145
  }
7136
7146
  }
7137
- /**
7138
- * Whether a jose error means the presented token is invalid, as opposed to
7139
- * a failure to verify it at all. Network errors, JWKS timeouts and crypto
7140
- * failures propagate so they surface as errors rather than as rejected
7141
- * tokens.
7142
- */
7143
- static isJwtValidationError(e) {
7144
- if (!(e instanceof Error) || !("code" in e) || typeof e.code !== "string") return false;
7145
- return e.code.startsWith("ERR_JWT_") || e.code.startsWith("ERR_JWS_") || e.code === "ERR_JWKS_NO_MATCHING_KEY" || e.code === "ERR_JWKS_MULTIPLE_MATCHING_KEYS" || e.code === "ERR_JOSE_NOT_SUPPORTED" || e.code === "ERR_JOSE_ALG_NOT_ALLOWED";
7146
- }
7147
7147
  async prepareAuthenticationResponse({ authenticationResponse, session }) {
7148
7148
  if (session?.sealSession) {
7149
7149
  if (!this.workos.key) throw new Error("Session sealing requires server-side usage with an API key. Public clients should store tokens directly (e.g., secure storage on mobile, keychain on desktop).");
@@ -10159,7 +10159,7 @@ var Vault = class {
10159
10159
  }
10160
10160
  };
10161
10161
  // package.json
10162
- var version = "12.4.0";
10162
+ var version = "12.4.2";
10163
10163
  // src/workos.ts
10164
10164
  const DEFAULT_HOSTNAME = "api.workos.com";
10165
10165
  const HEADER_AUTHORIZATION = "Authorization";
@@ -10536,6 +10536,7 @@ let ConnectionType = /* @__PURE__ */ function(ConnectionType) {
10536
10536
  ConnectionType["GenericSAML"] = "GenericSAML";
10537
10537
  ConnectionType["GitHubOAuth"] = "GitHubOAuth";
10538
10538
  ConnectionType["GoogleOAuth"] = "GoogleOAuth";
10539
+ ConnectionType["GoogleOIDC"] = "GoogleOIDC";
10539
10540
  ConnectionType["GoogleSAML"] = "GoogleSAML";
10540
10541
  ConnectionType["JumpCloudSAML"] = "JumpCloudSAML";
10541
10542
  ConnectionType["KeycloakSAML"] = "KeycloakSAML";
@@ -10566,4 +10567,4 @@ function createWorkOS(options) {
10566
10567
  }
10567
10568
  export { AuthenticationException as A, SignatureVerificationException as C, NoApiKeyProvidedException as D, NotFoundException as E, SubtleCryptoProvider as F, GenericServerException as M, ApiKeyRequiredException as N, ConflictException as O, FetchHttpClient as P, UnauthorizedException as S, OauthException as T, PKCE as _, ItContactIntent as a, Actions as b, GenerateLinkIntent as c, FeatureFlagsRuntimeClient as d, CreateRuleWithTargetsError as f, AuthenticateWithSessionCookieFailureReason as g, serializeRevokeSessionOptions as h, OrganizationDomainVerificationStrategy as i, isAuthenticationErrorData as j, BadRequestException as k, UpdateAuditLogsRetentionRetentionPeriod as l, RefreshSessionFailureReason as m, ConnectionType as n, DomainDataState as o, CookieSession as p, OrganizationDomainState as r, DirectoryUserWithGroupsState as s, createWorkOS as t, WorkOS as u, Webhooks as v, RateLimitExceededException as w, UnprocessableEntityException as x, AutoPaginatable as y };
10568
10569
 
10569
- //# sourceMappingURL=factory-BrukHQPr.mjs.map
10570
+ //# sourceMappingURL=factory-DBq6auF0.mjs.map