@cookiemunch/sdk 0.19.0 → 0.20.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.
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.0";
24
24
  export interface CookieMunchOptions {
25
25
  apiKey: string;
26
26
  /** "https://api.cookiemunch.net" — the /v1 prefix is appended automatically. */
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.0";
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
  }