@firmenakte/api-client 2.8.0 → 2.11.8

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/index.d.ts.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAGA,MAAM,MAAM,YAAY,GAAG;IACzB,MAAM,EAAE,MAAM,CAAC;IACf,OAAO,CAAC,EAAE,MAAM,CAAC;CAClB,CAAC;AAEF;;GAEG;AACH,eAAO,MAAM,eAAe,GAAI,qBAAqB,YAAY;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAchE,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAA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;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;CAqBd,CAAC;AAEF,cAAc,UAAU,CAAC;AACzB,cAAc,cAAc,CAAC;AAC7B,cAAc,oBAAoB,CAAC;AAEnC,OAAO,KAAK,EAAE,kBAAkB,EAAE,MAAM,cAAc,CAAC;AAEvD,KAAK,YAAY,GAAG,OAAO,UAAU,EAAE,GAAG,CAAC,gBAAgB,CAAC,YAAY,CAAC;AACzE,KAAK,wBAAwB,GAAG,OAAO,CACrC,MAAM,YAAY,EAClB,GAAG,kBAAkB,MAAM,GAAG,GAAG,kBAAkB,MAAM,CAC1D,CAAC;AAEF;;;GAGG;AACH,MAAM,MAAM,uBAAuB,GAAG,IAAI,CAAC,YAAY,EAAE,wBAAwB,CAAC,GAAG;IACnF,gBAAgB,CAAC,EAAE,OAAO,CACxB,MAAM,CAAC,kBAAkB,EAAE;QAAE,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;QAAC,GAAG,CAAC,EAAE,MAAM,GAAG,IAAI,CAAA;KAAE,CAAC,CACzE,CAAC;CACH,CAAC"}
package/index.js CHANGED
@@ -14,19 +14,24 @@ var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
14
  for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
15
  };
16
16
  Object.defineProperty(exports, "__esModule", { value: true });
17
- exports.createApiClient = void 0;
17
+ exports.createApiClient = exports.DEFAULT_BACKEND_TIMEOUT_MS = void 0;
18
18
  // packages/api-client/src/index.ts
19
19
  const client_1 = require("./client");
20
- /**
21
- * SOTA Factory: Creates a fresh, isolated instance of the API client.
22
- */
23
- const createApiClient = ({ apiKey, baseUrl }) => {
20
+ exports.DEFAULT_BACKEND_TIMEOUT_MS = 10000;
21
+ const createApiClient = ({ apiKey, baseUrl, timeoutMs = exports.DEFAULT_BACKEND_TIMEOUT_MS, }) => {
22
+ const customFetch = ((...args) => {
23
+ const [input, init] = args;
24
+ const deadline = AbortSignal.timeout(timeoutMs);
25
+ const signal = init?.signal ? AbortSignal.any([init.signal, deadline]) : deadline;
26
+ return fetch(input, { ...init, signal });
27
+ });
24
28
  const config = {
25
29
  baseApiParams: {
26
30
  headers: {
27
31
  "x-api-key": apiKey,
28
32
  },
29
33
  },
34
+ customFetch,
30
35
  };
31
36
  if (baseUrl) {
32
37
  config.baseUrl = baseUrl;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@firmenakte/api-client",
3
- "version": "2.8.0",
3
+ "version": "2.11.8",
4
4
  "description": "TypeScript/JavaScript client for the Firmenakte API",
5
5
  "main": "./index.js",
6
6
  "types": "./index.d.ts",