@cookiemunch/sdk 0.19.0 → 0.20.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/dist/index.d.ts CHANGED
@@ -20,7 +20,7 @@ import type { ConformanceReport } from './executor-conformance.js';
20
20
  * This package's version, sent in the default User-Agent. Cloudflare answers a request with
21
21
  * no recognisable User-Agent with `403 error code: 1010`; a test pins this to package.json.
22
22
  */
23
- export declare const SDK_VERSION = "0.19.0";
23
+ export declare const SDK_VERSION = "0.20.1";
24
24
  export interface CookieMunchOptions {
25
25
  apiKey: string;
26
26
  /** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
@@ -1771,7 +1771,7 @@ export interface RightsCaptcha {
1771
1771
  }
1772
1772
  /**
1773
1773
  * `own` needs provider, siteKey and (the first time) secret; the provider is asked to accept the secret before
1774
- * anything is saved (422 captcha_secret_invalid / 502 captcha_unreachable). `off` removes spam protection beyond
1774
+ * anything is saved (422 captcha_secret_invalid / 424 captcha_unreachable). `off` removes spam protection beyond
1775
1775
  * the hidden spam-trap field, the rate limits and the email code.
1776
1776
  */
1777
1777
  export interface RightsCaptchaInput {
@@ -1807,7 +1807,7 @@ export interface RightsIdentity {
1807
1807
  updatedAt: number | null;
1808
1808
  }
1809
1809
  /**
1810
- * The JWKS is fetched and checked before anything is saved (502 identity_jwks_unreachable /
1810
+ * The JWKS is fetched and checked before anything is saved (424 identity_jwks_unreachable /
1811
1811
  * 422 identity_jwks_invalid). `authorizedParties` (your own origins) is required for clerk and atlas;
1812
1812
  * oidc_jwt needs an `audience` or `authorizedParties`. Issuer and JWKS URL are https on a host name,
1813
1813
  * never an IP address. The token must carry the email and a verified-email claim set to `true`
package/dist/index.js CHANGED
@@ -14,7 +14,7 @@ import {
14
14
  CONFORMANCE_RULES,
15
15
  canaryIdentityFor,
16
16
  runExecutorConformance
17
- } from "./chunk-UEFYGHV3.js";
17
+ } from "./chunk-5EGY2NXQ.js";
18
18
 
19
19
  // src/webhooks.ts
20
20
  import { createHmac, timingSafeEqual } from "crypto";
@@ -88,7 +88,7 @@ async function exchangeOperatorToken(input) {
88
88
  }
89
89
 
90
90
  // src/index.ts
91
- var SDK_VERSION = "0.19.0";
91
+ var SDK_VERSION = "0.20.1";
92
92
  var CookieMunchApiError = class extends Error {
93
93
  constructor(status, message, code, body) {
94
94
  super(message);
@@ -143,7 +143,8 @@ function createCookieMunch(opts) {
143
143
  try {
144
144
  const data = await res.json();
145
145
  parsed = data;
146
- if (typeof data.error === "string") message = data.error;
146
+ if (typeof data.message === "string") message = data.message;
147
+ else if (typeof data.error === "string") message = data.error;
147
148
  if (typeof data.code === "string") code = data.code;
148
149
  } catch {
149
150
  }