@codecks/fetch 1.0.0-rc.0 → 1.0.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.
@@ -1,4 +1,4 @@
1
- import { bearerTransport, configuredFetch, ensureMapValue } from "../collection-utils-T3bx0BS1.js";
1
+ import { bearerTransport, configuredFetch, ensureMapValue } from "../collection-utils-KmtGUuXm.js";
2
2
  import { serializeModel } from "../query-helpers-iX1fiqLv.js";
3
3
 
4
4
  //#region src/_exploration/utils/concurrency-limiter.ts
@@ -31,7 +31,8 @@ var CodecksApiError = class extends Error {
31
31
  constructor(status, body) {
32
32
  const obj = typeof body === "object" && body !== null ? body : {};
33
33
  const str = (v) => typeof v === "string" ? v : null;
34
- const code = str(obj.error);
34
+ const isCode = (v) => v !== null && /^[a-z][a-z0-9_]*$/.test(v);
35
+ const code = [str(obj.error), str(obj.message)].find(isCode) ?? null;
35
36
  super(`[${status}] ${str(obj.message) ?? code ?? (str(body) || "request failed")}`);
36
37
  this.name = "CodecksApiError";
37
38
  this.status = status;
package/dist/index.js CHANGED
@@ -1,4 +1,4 @@
1
- import { CodecksApiError, bearerTransport, configuredFetch, ensureMapValue, legacyTransport } from "./collection-utils-T3bx0BS1.js";
1
+ import { CodecksApiError, bearerTransport, configuredFetch, ensureMapValue, legacyTransport } from "./collection-utils-KmtGUuXm.js";
2
2
  import { _rootDesc, getRelKey, makeModelQuerySerializable, modelMap, serializeInstanceQuery } from "./query-helpers-iX1fiqLv.js";
3
3
 
4
4
  //#region src/model-pool.ts
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@codecks/fetch",
3
- "version": "1.0.0-rc.0",
3
+ "version": "1.0.1",
4
4
  "description": "Quickly create deeply nested queries for the Codecks API with advanced TypeScript support",
5
5
  "type": "module",
6
6
  "license": "MIT",