@voiceflow/fetch 1.14.0 → 1.15.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/package.json CHANGED
@@ -1,29 +1,30 @@
1
1
  {
2
2
  "name": "@voiceflow/fetch",
3
- "version": "1.14.0",
3
+ "version": "1.15.0",
4
4
  "description": "Voiceflow fetch wrapper and error handling for SDKs",
5
5
  "keywords": [
6
6
  "voiceflow"
7
7
  ],
8
8
  "license": "ISC",
9
+ "type": "module",
9
10
  "exports": {
10
11
  ".": {
11
- "types": "./build/cjs/main.d.ts",
12
+ "types": "./build/esm/main.d.ts",
12
13
  "import": "./build/esm/main.js",
13
- "default": "./build/cjs/main.js"
14
+ "default": "./build/esm/main.js"
14
15
  },
15
16
  "./undici": {
16
- "types": "./build/cjs/main.undici.d.ts",
17
+ "types": "./build/esm/main.undici.d.ts",
17
18
  "import": "./build/esm/main.undici.js",
18
- "default": "./build/cjs/main.undici.js"
19
+ "default": "./build/esm/main.undici.js"
19
20
  }
20
21
  },
21
- "main": "build/cjs/main.js",
22
- "types": "build/cjs/main.d.ts",
22
+ "main": "build/esm/main.js",
23
+ "types": "build/esm/main.d.ts",
23
24
  "typesVersions": {
24
25
  "*": {
25
26
  "undici": [
26
- "./build/cjs/main.undici.d.ts"
27
+ "./build/esm/main.undici.d.ts"
27
28
  ]
28
29
  }
29
30
  },
@@ -32,8 +33,7 @@
32
33
  ],
33
34
  "scripts": {
34
35
  "build": "yarn g:turbo run build:cmd --filter=@voiceflow/fetch...",
35
- "build:cjs": "yarn g:build:pkg cjs",
36
- "build:cmd": "yarn g:run-p build:cjs build:esm",
36
+ "build:cmd": "yarn build:esm",
37
37
  "build:esm": "yarn g:build:pkg esm",
38
38
  "clean": "yarn g:rimraf build",
39
39
  "lint": "yarn g:run-p -c lint:eslint lint:prettier",
@@ -48,7 +48,7 @@
48
48
  "test:unused": "yarn g:knip --workspace @voiceflow/fetch"
49
49
  },
50
50
  "devDependencies": {
51
- "@voiceflow/exception": "1.14.0",
51
+ "@voiceflow/exception": "1.15.0",
52
52
  "fetch-mock": "12.6.0",
53
53
  "jsdom": "26.0.0",
54
54
  "undici": "7.3.0",
@@ -72,5 +72,5 @@
72
72
  "publishConfig": {
73
73
  "access": "public"
74
74
  },
75
- "gitHead": "ad890a52852cbb4be8b96c21e8c5927860e5ef20"
75
+ "gitHead": "c88cb20155e489c081e5f29079b1ad4727903e17"
76
76
  }
@@ -1,6 +0,0 @@
1
- import type { RequestHeaders } from './request-options.interface';
2
- export interface ClientConfiguration {
3
- baseURL?: string;
4
- headers?: RequestHeaders;
5
- }
6
- //# sourceMappingURL=client-configuration.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-configuration.interface.d.ts","sourceRoot":"","sources":["../../src/client-configuration.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,EAAE,MAAM,6BAA6B,CAAC;AAElE,MAAM,WAAW,mBAAmB;IAClC,OAAO,CAAC,EAAE,MAAM,CAAC;IACjB,OAAO,CAAC,EAAE,cAAc,CAAC;CAC1B"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=client-configuration.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"client-configuration.interface.js","sourceRoot":"","sources":["../../src/client-configuration.interface.ts"],"names":[],"mappings":""}
@@ -1,34 +0,0 @@
1
- import type { ClientConfiguration } from './client-configuration.interface';
2
- import type { FetchAPI, FetchOptions, FetchResponse } from './fetch.interface';
3
- import type { RequestOptions } from './request-options.interface';
4
- export declare class FetchClient<Opts extends FetchOptions<any, any> = RequestInit, Req = URL | Request, Res extends FetchResponse = Response> {
5
- private static extractHeaders;
6
- private static extractQuery;
7
- private static formatURL;
8
- private readonly config;
9
- private readonly fetch;
10
- constructor(config?: ClientConfiguration);
11
- constructor(fetch: FetchAPI<Opts, Req, Res>, options?: ClientConfiguration);
12
- private send;
13
- private createMethod;
14
- raw(...args: Parameters<FetchAPI<Opts, Req, Res>>): Promise<Res>;
15
- delete: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
16
- json: <T = unknown>() => Promise<T>;
17
- };
18
- get: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
19
- json: <T = unknown>() => Promise<T>;
20
- };
21
- head: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
22
- json: <T = unknown>() => Promise<T>;
23
- };
24
- patch: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
25
- json: <T = unknown>() => Promise<T>;
26
- };
27
- post: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
28
- json: <T = unknown>() => Promise<T>;
29
- };
30
- put: (url: string | Req, options?: Omit<RequestOptions<Opts>, "method">) => Promise<Res> & {
31
- json: <T = unknown>() => Promise<T>;
32
- };
33
- }
34
- //# sourceMappingURL=fetch.client.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.client.d.ts","sourceRoot":"","sources":["../../src/fetch.client.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,KAAK,EAAE,QAAQ,EAAE,YAAY,EAAE,aAAa,EAAE,MAAM,mBAAmB,CAAC;AAE/E,OAAO,KAAK,EAAkB,cAAc,EAAgB,MAAM,6BAA6B,CAAC;AAEhG,qBAAa,WAAW,CACtB,IAAI,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,GAAG,WAAW,EACjD,GAAG,GAAG,GAAG,GAAG,OAAO,EACnB,GAAG,SAAS,aAAa,GAAG,QAAQ;IAEpC,OAAO,CAAC,MAAM,CAAC,cAAc;IAI7B,OAAO,CAAC,MAAM,CAAC,YAAY;IAI3B,OAAO,CAAC,MAAM,CAAC,SAAS;IAMxB,OAAO,CAAC,QAAQ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CAAC,iBAAe,OAAO,CAAC,CAAC,CAAC;MAmBE;CAChD"}
@@ -1,71 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.FetchClient = void 0;
4
- const exception_1 = require("@voiceflow/exception");
5
- const http_method_enum_1 = require("./http-method.enum");
6
- class FetchClient {
7
- static extractHeaders(headers) {
8
- return new Map(headers instanceof Map ? headers : Object.entries(headers ?? {}));
9
- }
10
- static extractQuery(query) {
11
- return new URLSearchParams(query instanceof Map ? Object.entries(query) : query);
12
- }
13
- static formatURL(baseURL, path, query) {
14
- const url = new URL(path, baseURL);
15
- query.forEach((value, key) => url.searchParams.append(key, value));
16
- return url.href;
17
- }
18
- config;
19
- fetch;
20
- constructor(fetchOrConfig, config) {
21
- if (typeof fetchOrConfig === 'function') {
22
- this.fetch = fetchOrConfig;
23
- this.config = config ?? {};
24
- }
25
- else {
26
- this.config = fetchOrConfig ?? config ?? {};
27
- }
28
- }
29
- async send(url, rawOptions) {
30
- // eslint-disable-next-line prefer-const
31
- let { json, headers, query, body, ...options } = rawOptions;
32
- headers = new Map([
33
- ...FetchClient.extractHeaders(this.config.headers).entries(),
34
- ...FetchClient.extractHeaders(headers).entries(),
35
- ]);
36
- query = FetchClient.extractQuery(query);
37
- if (json != null) {
38
- headers.set('content-type', 'application/json');
39
- body = JSON.stringify(json);
40
- }
41
- const finalURL = typeof url === 'string' ? FetchClient.formatURL(this.config.baseURL, url, query) : url;
42
- const response = await this.raw(finalURL, {
43
- ...options,
44
- headers: Object.fromEntries(headers.entries()),
45
- body,
46
- });
47
- if (!response.ok) {
48
- throw await new exception_1.ClientException(response).build();
49
- }
50
- return response;
51
- }
52
- createMethod(method) {
53
- return (url, options) => {
54
- const response = this.send(url, { ...options, method: method.toUpperCase() });
55
- return Object.assign(response, {
56
- json: async () => (await response).json(),
57
- });
58
- };
59
- }
60
- raw(...args) {
61
- return (this.fetch ?? window.fetch)(...args);
62
- }
63
- delete = this.createMethod(http_method_enum_1.HTTPMethod.DELETE);
64
- get = this.createMethod(http_method_enum_1.HTTPMethod.GET);
65
- head = this.createMethod(http_method_enum_1.HTTPMethod.HEAD);
66
- patch = this.createMethod(http_method_enum_1.HTTPMethod.PATCH);
67
- post = this.createMethod(http_method_enum_1.HTTPMethod.POST);
68
- put = this.createMethod(http_method_enum_1.HTTPMethod.PUT);
69
- }
70
- exports.FetchClient = FetchClient;
71
- //# sourceMappingURL=fetch.client.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.client.js","sourceRoot":"","sources":["../../src/fetch.client.ts"],"names":[],"mappings":";;;AAAA,oDAAuD;AAIvD,yDAAgD;AAGhD,MAAa,WAAW;IAKd,MAAM,CAAC,cAAc,CAAC,OAAmC;QAC/D,OAAO,IAAI,GAAG,CAAC,OAAO,YAAY,GAAG,CAAC,CAAC,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,OAAO,IAAI,EAAE,CAAC,CAAC,CAAC;IACnF,CAAC;IAEO,MAAM,CAAC,YAAY,CAAC,KAA+B;QACzD,OAAO,IAAI,eAAe,CAAC,KAAK,YAAY,GAAG,CAAC,CAAC,CAAC,MAAM,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC;IACnF,CAAC;IAEO,MAAM,CAAC,SAAS,CAAC,OAA2B,EAAE,IAAY,EAAE,KAAsB;QACxF,MAAM,GAAG,GAAG,IAAI,GAAG,CAAC,IAAI,EAAE,OAAO,CAAC,CAAC;QACnC,KAAK,CAAC,OAAO,CAAC,CAAC,KAAK,EAAE,GAAG,EAAE,EAAE,CAAC,GAAG,CAAC,YAAY,CAAC,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,CAAC,CAAC;QACnE,OAAO,GAAG,CAAC,IAAI,CAAC;IAClB,CAAC;IAEgB,MAAM,CAAsB;IAE5B,KAAK,CAAuC;IAI7D,YAAY,aAA8D,EAAE,MAA4B;QACtG,IAAI,OAAO,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';
2
- export interface FetchOptions<Headers, Body> {
3
- method?: string;
4
- headers?: [string, string][] | Record<string, string> | Headers;
5
- body?: string | Body;
6
- }
7
- export interface FetchResponse extends BaseResponse {
8
- ok: boolean;
9
- json: () => Promise<any>;
10
- }
11
- export type FetchAPI<Opts extends FetchOptions<any, any>, Req, Res extends FetchResponse> = (input: string | Req, init?: Opts) => Promise<Res>;
12
- //# sourceMappingURL=fetch.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.interface.d.ts","sourceRoot":"","sources":["../../src/fetch.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,sBAAsB,CAAC;AAEzD,MAAM,WAAW,YAAY,CAAC,OAAO,EAAE,IAAI;IACzC,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,OAAO,CAAC,EAAE,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,OAAO,CAAC;IAChE,IAAI,CAAC,EAAE,MAAM,GAAG,IAAI,CAAC;CACtB;AAED,MAAM,WAAW,aAAc,SAAQ,YAAY;IACjD,EAAE,EAAE,OAAO,CAAC;IACZ,IAAI,EAAE,MAAM,OAAO,CAAC,GAAG,CAAC,CAAC;CAC1B;AAED,MAAM,MAAM,QAAQ,CAAC,IAAI,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,EAAE,GAAG,EAAE,GAAG,SAAS,aAAa,IAAI,CAC1F,KAAK,EAAE,MAAM,GAAG,GAAG,EACnB,IAAI,CAAC,EAAE,IAAI,KACR,OAAO,CAAC,GAAG,CAAC,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=fetch.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"fetch.interface.js","sourceRoot":"","sources":["../../src/fetch.interface.ts"],"names":[],"mappings":""}
@@ -1,9 +0,0 @@
1
- export declare enum HTTPMethod {
2
- DELETE = "delete",
3
- GET = "get",
4
- HEAD = "head",
5
- PATCH = "patch",
6
- POST = "post",
7
- PUT = "put"
8
- }
9
- //# sourceMappingURL=http-method.enum.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-method.enum.d.ts","sourceRoot":"","sources":["../../src/http-method.enum.ts"],"names":[],"mappings":"AAAA,oBAAY,UAAU;IACpB,MAAM,WAAW;IACjB,GAAG,QAAQ;IACX,IAAI,SAAS;IACb,KAAK,UAAU;IACf,IAAI,SAAS;IACb,GAAG,QAAQ;CACZ"}
@@ -1,13 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.HTTPMethod = void 0;
4
- var HTTPMethod;
5
- (function (HTTPMethod) {
6
- HTTPMethod["DELETE"] = "delete";
7
- HTTPMethod["GET"] = "get";
8
- HTTPMethod["HEAD"] = "head";
9
- HTTPMethod["PATCH"] = "patch";
10
- HTTPMethod["POST"] = "post";
11
- HTTPMethod["PUT"] = "put";
12
- })(HTTPMethod || (exports.HTTPMethod = HTTPMethod = {}));
13
- //# sourceMappingURL=http-method.enum.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"http-method.enum.js","sourceRoot":"","sources":["../../src/http-method.enum.ts"],"names":[],"mappings":";;;AAAA,IAAY,UAOX;AAPD,WAAY,UAAU;IACpB,+BAAiB,CAAA;IACjB,yBAAW,CAAA;IACX,2BAAa,CAAA;IACb,6BAAe,CAAA;IACf,2BAAa,CAAA;IACb,yBAAW,CAAA;AACb,CAAC,EAPW,UAAU,0BAAV,UAAU,QAOrB"}
@@ -1,6 +0,0 @@
1
- export * from './client-configuration.interface';
2
- export * from './fetch.client';
3
- export * from './fetch.interface';
4
- export * from './http-method.enum';
5
- export * from './request-options.interface';
6
- //# sourceMappingURL=main.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.d.ts","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,kCAAkC,CAAC;AACjD,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
package/build/cjs/main.js DELETED
@@ -1,22 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
14
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
15
- };
16
- Object.defineProperty(exports, "__esModule", { value: true });
17
- __exportStar(require("./client-configuration.interface"), exports);
18
- __exportStar(require("./fetch.client"), exports);
19
- __exportStar(require("./fetch.interface"), exports);
20
- __exportStar(require("./http-method.enum"), exports);
21
- __exportStar(require("./request-options.interface"), exports);
22
- //# sourceMappingURL=main.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,mEAAiD;AACjD,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,8DAA4C"}
@@ -1,11 +0,0 @@
1
- import * as undici from 'undici';
2
- import type { ClientConfiguration } from './client-configuration.interface';
3
- import { FetchClient as BaseFetchClient } from './fetch.client';
4
- export * from './client-configuration.interface';
5
- export * from './fetch.interface';
6
- export * from './http-method.enum';
7
- export * from './request-options.interface';
8
- export declare class FetchClient extends BaseFetchClient<undici.RequestInit, URL | undici.Request, undici.Response> {
9
- constructor(config?: ClientConfiguration);
10
- }
11
- //# sourceMappingURL=main.undici.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.undici.d.ts","sourceRoot":"","sources":["../../src/main.undici.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,MAAM,QAAQ,CAAC;AAEjC,OAAO,KAAK,EAAE,mBAAmB,EAAE,MAAM,kCAAkC,CAAC;AAC5E,OAAO,EAAE,WAAW,IAAI,eAAe,EAAE,MAAM,gBAAgB,CAAC;AAEhE,cAAc,kCAAkC,CAAC;AACjD,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC;AAE5C,qBAAa,WAAY,SAAQ,eAAe,CAAC,MAAM,CAAC,WAAW,EAAE,GAAG,GAAG,MAAM,CAAC,OAAO,EAAE,MAAM,CAAC,QAAQ,CAAC;gBAC7F,MAAM,GAAE,mBAAwB;CAG7C"}
@@ -1,52 +0,0 @@
1
- "use strict";
2
- var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
3
- if (k2 === undefined) k2 = k;
4
- var desc = Object.getOwnPropertyDescriptor(m, k);
5
- if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
6
- desc = { enumerable: true, get: function() { return m[k]; } };
7
- }
8
- Object.defineProperty(o, k2, desc);
9
- }) : (function(o, m, k, k2) {
10
- if (k2 === undefined) k2 = k;
11
- o[k2] = m[k];
12
- }));
13
- var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
14
- Object.defineProperty(o, "default", { enumerable: true, value: v });
15
- }) : function(o, v) {
16
- o["default"] = v;
17
- });
18
- var __importStar = (this && this.__importStar) || (function () {
19
- var ownKeys = function(o) {
20
- ownKeys = Object.getOwnPropertyNames || function (o) {
21
- var ar = [];
22
- for (var k in o) if (Object.prototype.hasOwnProperty.call(o, k)) ar[ar.length] = k;
23
- return ar;
24
- };
25
- return ownKeys(o);
26
- };
27
- return function (mod) {
28
- if (mod && mod.__esModule) return mod;
29
- var result = {};
30
- if (mod != null) for (var k = ownKeys(mod), i = 0; i < k.length; i++) if (k[i] !== "default") __createBinding(result, mod, k[i]);
31
- __setModuleDefault(result, mod);
32
- return result;
33
- };
34
- })();
35
- var __exportStar = (this && this.__exportStar) || function(m, exports) {
36
- for (var p in m) if (p !== "default" && !Object.prototype.hasOwnProperty.call(exports, p)) __createBinding(exports, m, p);
37
- };
38
- Object.defineProperty(exports, "__esModule", { value: true });
39
- exports.FetchClient = void 0;
40
- const undici = __importStar(require("undici"));
41
- const fetch_client_1 = require("./fetch.client");
42
- __exportStar(require("./client-configuration.interface"), exports);
43
- __exportStar(require("./fetch.interface"), exports);
44
- __exportStar(require("./http-method.enum"), exports);
45
- __exportStar(require("./request-options.interface"), exports);
46
- class FetchClient extends fetch_client_1.FetchClient {
47
- constructor(config = {}) {
48
- super(undici.fetch, config);
49
- }
50
- }
51
- exports.FetchClient = FetchClient;
52
- //# sourceMappingURL=main.undici.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"main.undici.js","sourceRoot":"","sources":["../../src/main.undici.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;AAAA,+CAAiC;AAGjC,iDAAgE;AAEhE,mEAAiD;AACjD,oDAAkC;AAClC,qDAAmC;AACnC,8DAA4C;AAE5C,MAAa,WAAY,SAAQ,0BAA0E;IACzG,YAAY,SAA8B,EAAE;QAC1C,KAAK,CAAC,MAAM,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IAC9B,CAAC;CACF;AAJD,kCAIC"}
@@ -1 +0,0 @@
1
- { "type": "commonjs" }
@@ -1,10 +0,0 @@
1
- import type { FetchOptions } from './fetch.interface';
2
- export type RequestHeaders = Record<string, string> | Map<string, string>;
3
- export type RequestQuery = URLSearchParams | [string, string][] | Record<string, string> | Map<string, string>;
4
- export interface ExtraOptions {
5
- json?: any;
6
- headers?: RequestHeaders;
7
- query?: RequestQuery | undefined;
8
- }
9
- export type RequestOptions<Opts extends FetchOptions<any, any>> = Omit<Partial<Opts>, keyof ExtraOptions> & ExtraOptions;
10
- //# sourceMappingURL=request-options.interface.d.ts.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-options.interface.d.ts","sourceRoot":"","sources":["../../src/request-options.interface.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,mBAAmB,CAAC;AAEtD,MAAM,MAAM,cAAc,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE1E,MAAM,MAAM,YAAY,GAAG,eAAe,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,MAAM,CAAC,MAAM,EAAE,MAAM,CAAC,GAAG,GAAG,CAAC,MAAM,EAAE,MAAM,CAAC,CAAC;AAE/G,MAAM,WAAW,YAAY;IAC3B,IAAI,CAAC,EAAE,GAAG,CAAC;IACX,OAAO,CAAC,EAAE,cAAc,CAAC;IACzB,KAAK,CAAC,EAAE,YAAY,GAAG,SAAS,CAAC;CAClC;AAED,MAAM,MAAM,cAAc,CAAC,IAAI,SAAS,YAAY,CAAC,GAAG,EAAE,GAAG,CAAC,IAAI,IAAI,CAAC,OAAO,CAAC,IAAI,CAAC,EAAE,MAAM,YAAY,CAAC,GACvG,YAAY,CAAC"}
@@ -1,3 +0,0 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- //# sourceMappingURL=request-options.interface.js.map
@@ -1 +0,0 @@
1
- {"version":3,"file":"request-options.interface.js","sourceRoot":"","sources":["../../src/request-options.interface.ts"],"names":[],"mappings":""}