@workos-inc/node 8.10.0 → 8.11.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.
@@ -1627,8 +1627,8 @@ async function compress(input) {
1627
1627
  supported("CompressionStream");
1628
1628
  const cs = new CompressionStream("deflate-raw");
1629
1629
  const writer = cs.writable.getWriter();
1630
- writer.write(input);
1631
- writer.close();
1630
+ writer.write(input).catch(() => {});
1631
+ writer.close().catch(() => {});
1632
1632
  const chunks = [];
1633
1633
  const reader = cs.readable.getReader();
1634
1634
  for (;;) {
@@ -1642,8 +1642,8 @@ async function decompress(input, maxLength) {
1642
1642
  supported("DecompressionStream");
1643
1643
  const ds = new DecompressionStream("deflate-raw");
1644
1644
  const writer = ds.writable.getWriter();
1645
- writer.write(input);
1646
- writer.close();
1645
+ writer.write(input).catch(() => {});
1646
+ writer.close().catch(() => {});
1647
1647
  const chunks = [];
1648
1648
  let length = 0;
1649
1649
  const reader = ds.readable.getReader();
@@ -1723,7 +1723,10 @@ async function flattenedDecrypt(jwe, key, options) {
1723
1723
  const maxDecompressedLength = options?.maxDecompressedLength ?? 25e4;
1724
1724
  if (maxDecompressedLength === 0) throw new JOSENotSupported("JWE \"zip\" (Compression Algorithm) Header Parameter is not supported.");
1725
1725
  if (maxDecompressedLength !== Infinity && (!Number.isSafeInteger(maxDecompressedLength) || maxDecompressedLength < 1)) throw new TypeError("maxDecompressedLength must be 0, a positive safe integer, or Infinity");
1726
- result.plaintext = await decompress(plaintext, maxDecompressedLength);
1726
+ result.plaintext = await decompress(plaintext, maxDecompressedLength).catch((cause) => {
1727
+ if (cause instanceof JWEInvalid) throw cause;
1728
+ throw new JWEInvalid("Failed to decompress plaintext", { cause });
1729
+ });
1727
1730
  }
1728
1731
  if (jwe.protected !== void 0) result.protectedHeader = parsedProt;
1729
1732
  if (jwe.aad !== void 0) result.additionalAuthenticatedData = decodeBase64url(jwe.aad, "aad", JWEInvalid);
@@ -1878,7 +1881,9 @@ var FlattenedEncrypt = class {
1878
1881
  additionalData = concat(protectedHeaderB, encode$1("."), aadMemberBytes);
1879
1882
  } else additionalData = protectedHeaderB;
1880
1883
  let plaintext = this.#plaintext;
1881
- if (joseHeader.zip === "DEF") plaintext = await compress(plaintext);
1884
+ if (joseHeader.zip === "DEF") plaintext = await compress(plaintext).catch((cause) => {
1885
+ throw new JWEInvalid("Failed to compress plaintext", { cause });
1886
+ });
1882
1887
  const { ciphertext, tag, iv } = await encrypt$1(enc, plaintext, cek, this.#iv, additionalData);
1883
1888
  const jwe = { ciphertext: encode(ciphertext) };
1884
1889
  if (iv) jwe.iv = encode(iv);
@@ -2817,7 +2822,7 @@ function isCloudflareWorkers() {
2817
2822
  return typeof WebSocketPair !== "undefined" || typeof navigator !== "undefined" && navigator.userAgent === "Cloudflare-Workers" || typeof EdgeRuntime !== "undefined" && EdgeRuntime === "vercel";
2818
2823
  }
2819
2824
  let USER_AGENT;
2820
- if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `jose/v6.2.1`;
2825
+ if (typeof navigator === "undefined" || !navigator.userAgent?.startsWith?.("Mozilla/5.0 ")) USER_AGENT = `jose/v6.2.2`;
2821
2826
  const customFetch = Symbol();
2822
2827
  async function fetchJwks(url, headers, signal, fetchImpl = fetch) {
2823
2828
  const response = await fetchImpl(url, {
@@ -3259,4 +3264,4 @@ exports.jwksCache = jwksCache;
3259
3264
  exports.jwtDecrypt = jwtDecrypt;
3260
3265
  exports.jwtVerify = jwtVerify;
3261
3266
 
3262
- //# sourceMappingURL=webapi-Dk3R7830.cjs.map
3267
+ //# sourceMappingURL=webapi-N7c2LUJd.cjs.map