@voiceflow/fetch 1.1.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.
Files changed (40) hide show
  1. package/README.md +142 -0
  2. package/build/cjs/fetch.client.d.ts +27 -0
  3. package/build/cjs/fetch.client.js +55 -0
  4. package/build/cjs/fetch.client.js.map +1 -0
  5. package/build/cjs/fetch.client.test.d.ts +1 -0
  6. package/build/cjs/fetch.client.test.js +184 -0
  7. package/build/cjs/fetch.client.test.js.map +1 -0
  8. package/build/cjs/fetch.interface.d.ts +11 -0
  9. package/build/cjs/fetch.interface.js +3 -0
  10. package/build/cjs/fetch.interface.js.map +1 -0
  11. package/build/cjs/http-method.enum.d.ts +8 -0
  12. package/build/cjs/http-method.enum.js +13 -0
  13. package/build/cjs/http-method.enum.js.map +1 -0
  14. package/build/cjs/main.d.ts +4 -0
  15. package/build/cjs/main.js +21 -0
  16. package/build/cjs/main.js.map +1 -0
  17. package/build/cjs/request-options.interface.d.ts +7 -0
  18. package/build/cjs/request-options.interface.js +3 -0
  19. package/build/cjs/request-options.interface.js.map +1 -0
  20. package/build/esm/fetch.client.d.ts +27 -0
  21. package/build/esm/fetch.client.js +51 -0
  22. package/build/esm/fetch.client.js.map +1 -0
  23. package/build/esm/fetch.client.test.d.ts +1 -0
  24. package/build/esm/fetch.client.test.js +156 -0
  25. package/build/esm/fetch.client.test.js.map +1 -0
  26. package/build/esm/fetch.interface.d.ts +11 -0
  27. package/build/esm/fetch.interface.js +2 -0
  28. package/build/esm/fetch.interface.js.map +1 -0
  29. package/build/esm/http-method.enum.d.ts +8 -0
  30. package/build/esm/http-method.enum.js +10 -0
  31. package/build/esm/http-method.enum.js.map +1 -0
  32. package/build/esm/main.d.ts +4 -0
  33. package/build/esm/main.js +5 -0
  34. package/build/esm/main.js.map +1 -0
  35. package/build/esm/request-options.interface.d.ts +7 -0
  36. package/build/esm/request-options.interface.js +2 -0
  37. package/build/esm/request-options.interface.js.map +1 -0
  38. package/build/tsconfig.build.tsbuildinfo +1 -0
  39. package/build/tsconfig.esm.tsbuildinfo +1 -0
  40. package/package.json +55 -0
package/README.md ADDED
@@ -0,0 +1,142 @@
1
+ # fetch
2
+
3
+ Voiceflow fetch wrapper and error handling for SDKs
4
+
5
+ ## Installation
6
+
7
+ ```sh
8
+ yarn add --exact @voiceflow/fetch @voiceflow/exception
9
+
10
+ # if using for Node.JS
11
+ yarn add --exact undici
12
+ ```
13
+
14
+ ## Usage
15
+
16
+ This is a universal library and can be used in the browser or in a Node.JS environment by passing a `fetch` implementation.
17
+
18
+ ### Browser Usage
19
+
20
+ ```ts
21
+ import { FetchClient } from '@voiceflow/fetch';
22
+
23
+ const fetch = new FetchClient();
24
+ ```
25
+
26
+ ### Node Usage
27
+
28
+ ```ts
29
+ import { FetchClient } from '@voiceflow/fetch';
30
+ import * as undici from 'undici';
31
+
32
+ const fetch = new FetchClient(undici.fetch);
33
+ ```
34
+
35
+ ## Features
36
+
37
+ - [JSON requests](#json-requests)
38
+ - [JSON responses](#json-responses)
39
+ - [HTTP methods](#http-methods)
40
+ - [throws on non-2xx](#throws-on-non-2xx)
41
+ - [@voiceflow/exception integration](#voiceflowexception-integration)
42
+ - [raw request passthrough](#raw-request-passthrough)
43
+
44
+ ### JSON Requests
45
+
46
+ Use the `json` option to pass a payload that will be serialized with `JSON.stringify`.
47
+ This will also automatically add the request header `Content-Type: application/json`.
48
+
49
+ ```ts
50
+ const fetch = new FetchClient();
51
+
52
+ await fetch.put('http://example.com', {
53
+ json: { foo: 'bar' }
54
+ });
55
+ ```
56
+
57
+ ### JSON Responses
58
+
59
+ Use the `json()` method attached to the returned promise to resolve a parsed version of the response payload without needing an additional `await`.
60
+ You can also specify a type for the parsed result, by default the type will be `unknown`.
61
+
62
+ ```ts
63
+ const fetch = new FetchClient();
64
+
65
+ const result = await fetch.get('http://example.com').json<{ id: number, name: string }>();
66
+ ```
67
+
68
+ ### HTTP Methods
69
+
70
+ Use the appropriate method to set the HTTP method being used in the request.
71
+
72
+ ```ts
73
+ const fetch = new FetchClient();
74
+
75
+ fetch.delete('/foo'); // DELETE /foo
76
+ fetch.get('/foo'); // GET /foo
77
+ fetch.head('/foo'); // HEAD /foo
78
+ fetch.patch('/foo'); // PATCH /foo
79
+ fetch.post('/foo'); // POST /foo
80
+ fetch.put('/foo'); // PUT /foo
81
+ ```
82
+
83
+ ### Throws on non-2xx
84
+
85
+ If any non-`2xx` HTTP status is returned then a `ClientException` from `@voiceflow/exception` is thrown.
86
+
87
+ ```ts
88
+ const fetch = new FetchClient();
89
+
90
+ try {
91
+ await fetch.get('http://example.com'); // return 404
92
+ } catch (err) {
93
+ err; // ClientException
94
+ }
95
+ ```
96
+
97
+ ### `@voiceflow/exception` Integration
98
+
99
+ Internal error codes and other error details are automatically extracted from the response payload when a non-`2xx` status is returned.
100
+
101
+ ```ts
102
+ import { ClientException } from '@voiceflow/exception';
103
+
104
+ const fetch = new FetchClient();
105
+
106
+ try {
107
+ await fetch.get('http://example.com'); // return 404
108
+ } catch (err) {
109
+ if (ClientException.instanceOf(err)) {
110
+ err.errorCode; // ErrorCode | undefined
111
+ }
112
+ }
113
+ ```
114
+
115
+ ### Raw Request Passthrough
116
+
117
+ Use the `raw()` method to bypass all of the features above to access the underlying `fetch` interface directly.
118
+
119
+ #### Browser Native `fetch` Request
120
+
121
+ ```ts
122
+ const fetch = new FetchClient();
123
+
124
+ const url = new URL('http://example.com');
125
+ const request = new Request(url);
126
+
127
+ const response = await fetch.raw(request); // Response
128
+ ```
129
+
130
+ #### Node.JS Native `undici.fetch` Request
131
+
132
+ ```ts
133
+ import { URL } from 'node:url';
134
+ import * as undici from 'undici';
135
+
136
+ const fetch = new FetchClient(undici.fetch);
137
+
138
+ const url = new URL('http://example.com');
139
+ const request = new undici.Request(url);
140
+
141
+ const response = await fetch.raw(request); // undici.Response
142
+ ```
@@ -0,0 +1,27 @@
1
+ import { FetchAPI, FetchOptions, FetchResponse } from './fetch.interface';
2
+ import { RequestOptions } from './request-options.interface';
3
+ export declare class FetchClient<Opts extends FetchOptions<any, any> = RequestInit, Req = URL | Request, Res extends FetchResponse = Response> {
4
+ private readonly fetch?;
5
+ constructor(fetch?: FetchAPI<Opts, Req, Res> | undefined);
6
+ private send;
7
+ private createMethod;
8
+ raw(...args: Parameters<FetchAPI<Opts, Req, Res>>): Promise<Res>;
9
+ delete: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
10
+ json: <T = unknown>() => Promise<T>;
11
+ };
12
+ get: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
13
+ json: <T = unknown>() => Promise<T>;
14
+ };
15
+ head: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
16
+ json: <T = unknown>() => Promise<T>;
17
+ };
18
+ patch: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
19
+ json: <T = unknown>() => Promise<T>;
20
+ };
21
+ post: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
22
+ json: <T = unknown>() => Promise<T>;
23
+ };
24
+ put: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
25
+ json: <T = unknown>() => Promise<T>;
26
+ };
27
+ }
@@ -0,0 +1,55 @@
1
+ "use strict";
2
+ var __rest = (this && this.__rest) || function (s, e) {
3
+ var t = {};
4
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
5
+ t[p] = s[p];
6
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
7
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
8
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
9
+ t[p[i]] = s[p[i]];
10
+ }
11
+ return t;
12
+ };
13
+ Object.defineProperty(exports, "__esModule", { value: true });
14
+ exports.FetchClient = void 0;
15
+ const exception_1 = require("@voiceflow/exception");
16
+ const http_method_enum_1 = require("./http-method.enum");
17
+ class FetchClient {
18
+ constructor(fetch) {
19
+ this.fetch = fetch;
20
+ this.delete = this.createMethod(http_method_enum_1.HTTPMethod.DELETE);
21
+ this.get = this.createMethod(http_method_enum_1.HTTPMethod.GET);
22
+ this.head = this.createMethod(http_method_enum_1.HTTPMethod.HEAD);
23
+ this.patch = this.createMethod(http_method_enum_1.HTTPMethod.PATCH);
24
+ this.post = this.createMethod(http_method_enum_1.HTTPMethod.POST);
25
+ this.put = this.createMethod(http_method_enum_1.HTTPMethod.PUT);
26
+ }
27
+ async send(url, rawOptions) {
28
+ const { json } = rawOptions, options = __rest(rawOptions, ["json"]);
29
+ const headers = Object.assign({}, options.headers);
30
+ let { body } = options;
31
+ if (json != null) {
32
+ headers['content-type'] = 'application/json';
33
+ body = JSON.stringify(json);
34
+ }
35
+ const response = await this.raw(url, Object.assign(Object.assign({}, options), { headers, body }));
36
+ if (!response.ok) {
37
+ throw await new exception_1.ClientException(response).build();
38
+ }
39
+ return response;
40
+ }
41
+ createMethod(method) {
42
+ return (url, options) => {
43
+ const response = this.send(url, Object.assign(Object.assign({}, options), { method }));
44
+ return Object.assign(response, {
45
+ json: async () => (await response).json(),
46
+ });
47
+ };
48
+ }
49
+ raw(...args) {
50
+ var _a;
51
+ return ((_a = this.fetch) !== null && _a !== void 0 ? _a : window.fetch)(...args);
52
+ }
53
+ }
54
+ exports.FetchClient = FetchClient;
55
+ //# sourceMappingURL=fetch.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.client.js","sourceRoot":"","sources":["../../src/fetch.client.ts"],"names":[],"mappings":";;;;;;;;;;;;;;AAAA,oDAAuD;AAGvD,yDAAgD;AAGhD,MAAa,WAAW;IACtB,YAA6B,KAAgC;QAAhC,UAAK,GAAL,KAAK,CAA2B;QAoCtD,WAAM,GAAG,IAAI,CAAC,YAAY,CAAC,6BAAU,CAAC,MAAM,CAAC,CAAC;QAE9C,QAAG,GAAG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AAC;YAEhF,OAAO,MAAM,CAAC,MAAM,CAAC,QAAQ,EAAE;gBAC7B,IAAI,EAAE,KAAK,IAA6B,EAAE,CAAC,CAAC,MAAM,QAAQ,CAAC,CAAC,IAAI,EAAE;aACnE,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,GAAG,IAA0C;;QACtD,OAAO,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAK,MAAM,CAAC,KAAiC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5E,CAAC;CAaF;AAhDD,kCAgDC"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,184 @@
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 (mod) {
19
+ if (mod && mod.__esModule) return mod;
20
+ var result = {};
21
+ if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
22
+ __setModuleDefault(result, mod);
23
+ return result;
24
+ };
25
+ var __importDefault = (this && this.__importDefault) || function (mod) {
26
+ return (mod && mod.__esModule) ? mod : { "default": mod };
27
+ };
28
+ Object.defineProperty(exports, "__esModule", { value: true });
29
+ const exception_1 = require("@voiceflow/exception");
30
+ const chai_1 = require("chai");
31
+ const fetch_mock_1 = __importDefault(require("fetch-mock"));
32
+ const node_url_1 = require("node:url");
33
+ const sinon = __importStar(require("sinon"));
34
+ const undici = __importStar(require("undici"));
35
+ const fetch_client_1 = require("./fetch.client");
36
+ const TARGET_URL = 'http://example.com/resource/123';
37
+ const JSON_HEADERS = { 'content-type': 'application/json' };
38
+ describe('Fetch Client', () => {
39
+ let sandbox;
40
+ beforeEach(() => {
41
+ sandbox = fetch_mock_1.default.sandbox();
42
+ });
43
+ describe('#raw()', () => {
44
+ const url = 'http://example.com';
45
+ describe('window.fetch', () => {
46
+ let fetchStub;
47
+ let fetchClient;
48
+ beforeEach(() => {
49
+ fetchStub = sinon.stub(window, 'fetch');
50
+ fetchClient = new fetch_client_1.FetchClient();
51
+ });
52
+ afterEach(() => {
53
+ sinon.restore();
54
+ });
55
+ it('should pass through Request instance and options to window.fetch', async () => {
56
+ const request = new Request(new URL(url));
57
+ const options = { cache: 'only-if-cached' };
58
+ await fetchClient.raw(request, options);
59
+ (0, chai_1.expect)(fetchStub).to.be.calledWithExactly(request, options);
60
+ });
61
+ it('should pass through URL instance to window.fetch', async () => {
62
+ const request = new URL(url);
63
+ await fetchClient.raw(request);
64
+ (0, chai_1.expect)(fetchStub).to.be.calledWithExactly(request);
65
+ });
66
+ it('should pass through string to window.fetch', async () => {
67
+ await fetchClient.raw(url);
68
+ (0, chai_1.expect)(fetchStub).to.be.calledWithExactly(url);
69
+ });
70
+ });
71
+ describe('undici.fetch', () => {
72
+ let fetchSpy;
73
+ let fetchClient;
74
+ beforeEach(() => {
75
+ fetchSpy = sinon.spy();
76
+ fetchClient = new fetch_client_1.FetchClient(fetchSpy);
77
+ });
78
+ it('should pass through Request instance and options to undici.fetch', async () => {
79
+ const request = new undici.Request(new node_url_1.URL(url));
80
+ const options = { dispatcher: new undici.Dispatcher() };
81
+ await fetchClient.raw(request, options);
82
+ (0, chai_1.expect)(fetchSpy).to.be.calledWithExactly(request, options);
83
+ });
84
+ it('should pass through URL instance to undici.fetch', async () => {
85
+ const request = new node_url_1.URL(url);
86
+ await fetchClient.raw(request);
87
+ (0, chai_1.expect)(fetchSpy).to.be.calledWithExactly(request);
88
+ });
89
+ it('should pass through string to undici.fetch', async () => {
90
+ await fetchClient.raw(url);
91
+ (0, chai_1.expect)(fetchSpy).to.be.calledWithExactly(url);
92
+ });
93
+ });
94
+ });
95
+ describe('#delete()', () => {
96
+ it('should send DELETE request', async () => {
97
+ const fetch = new fetch_client_1.FetchClient(sandbox);
98
+ sandbox.delete(TARGET_URL, 200);
99
+ await fetch.delete(TARGET_URL);
100
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
101
+ });
102
+ });
103
+ describe('#get()', () => {
104
+ it('should send GET request', async () => {
105
+ const data = { foo: 'bar' };
106
+ const fetch = new fetch_client_1.FetchClient(sandbox);
107
+ sandbox.get(TARGET_URL, { status: 200, body: data });
108
+ const result = await fetch.get(TARGET_URL).json();
109
+ (0, chai_1.expect)(result).to.eql(data);
110
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
111
+ });
112
+ });
113
+ describe('#head()', () => {
114
+ it('should send HEAD request', async () => {
115
+ const fetch = new fetch_client_1.FetchClient(sandbox);
116
+ sandbox.head(TARGET_URL, 200);
117
+ await fetch.head(TARGET_URL);
118
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
119
+ });
120
+ });
121
+ describe('#patch()', () => {
122
+ it('should send PATCH request', async () => {
123
+ const body = { foo: 'bar' };
124
+ const fetch = new fetch_client_1.FetchClient(sandbox);
125
+ sandbox.patch({ url: TARGET_URL, body, headers: JSON_HEADERS }, 200);
126
+ await fetch.patch(TARGET_URL, { json: body });
127
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
128
+ });
129
+ });
130
+ describe('#post()', () => {
131
+ it('should send POST request', async () => {
132
+ const body = { foo: 'bar' };
133
+ const data = { fizz: 'buzz' };
134
+ const fetch = new fetch_client_1.FetchClient(sandbox);
135
+ sandbox.post({ url: TARGET_URL, body, headers: JSON_HEADERS }, { status: 200, body: data });
136
+ const result = await fetch.post(TARGET_URL, { json: body }).json();
137
+ (0, chai_1.expect)(result).to.eql(data);
138
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
139
+ });
140
+ });
141
+ describe('#put()', () => {
142
+ it('should send PUT request', async () => {
143
+ const body = { foo: 'bar' };
144
+ const fetch = new fetch_client_1.FetchClient(sandbox);
145
+ sandbox.put({ url: TARGET_URL, body, headers: JSON_HEADERS }, 200);
146
+ await fetch.put(TARGET_URL, { json: body });
147
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
148
+ });
149
+ });
150
+ describe('error handling', () => {
151
+ it('should throw ClientException on non-2xx status code', async () => {
152
+ const fetch = new fetch_client_1.FetchClient(sandbox);
153
+ sandbox.head(TARGET_URL, 404);
154
+ await (0, chai_1.expect)(fetch.head(TARGET_URL)).to.be.rejectedWith(exception_1.ClientException);
155
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
156
+ });
157
+ it('should extract error details from response body', async () => {
158
+ const status = 500;
159
+ const message = 'something went wrong!';
160
+ const cause = 'the dog ate my homework';
161
+ const details = { traceID: '123' };
162
+ const fetch = new fetch_client_1.FetchClient(sandbox);
163
+ sandbox.get(TARGET_URL, { status, body: { message, cause, details } });
164
+ try {
165
+ await fetch.get(TARGET_URL);
166
+ chai_1.expect.fail('expected to throw ClientException');
167
+ }
168
+ catch (err) {
169
+ if (exception_1.ClientException.instanceOf(err)) {
170
+ (0, chai_1.expect)(err.statusCode).to.eq(status);
171
+ (0, chai_1.expect)(err.statusText).to.eq('Internal Server Error');
172
+ (0, chai_1.expect)(err.message).to.eq(message);
173
+ (0, chai_1.expect)(err.cause).to.eq(cause);
174
+ (0, chai_1.expect)(err.details).to.eql(details);
175
+ }
176
+ else {
177
+ chai_1.expect.fail('should be an instance of ClientException');
178
+ }
179
+ }
180
+ (0, chai_1.expect)(sandbox.done()).to.be.true;
181
+ });
182
+ });
183
+ });
184
+ //# sourceMappingURL=fetch.client.test.js.map
@@ -0,0 +1 @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AE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;YAEvE,IAAI;gBACF,MAAM,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAE5B,aAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;aAClD;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,2BAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;oBACnC,IAAA,aAAM,EAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;oBACrC,IAAA,aAAM,EAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC;oBACtD,IAAA,aAAM,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;oBACnC,IAAA,aAAM,EAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;oBAC/B,IAAA,aAAM,EAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;iBACrC;qBAAM;oBACL,aAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;iBACzD;aACF;YAED,IAAA,aAAM,EAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { BaseResponse } from '@voiceflow/exception';
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 declare type FetchAPI<Opts extends FetchOptions<any, any>, Req, Res extends FetchResponse> = (input: string | Req, init?: Opts) => Promise<Res>;
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=fetch.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.interface.js","sourceRoot":"","sources":["../../src/fetch.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare enum HTTPMethod {
2
+ DELETE = "delete",
3
+ GET = "get",
4
+ HEAD = "head",
5
+ PATCH = "patch",
6
+ POST = "post",
7
+ PUT = "put"
8
+ }
@@ -0,0 +1,13 @@
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 || (exports.HTTPMethod = {}));
13
+ //# sourceMappingURL=http-method.enum.js.map
@@ -0,0 +1 @@
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,GAAV,kBAAU,KAAV,kBAAU,QAOrB"}
@@ -0,0 +1,4 @@
1
+ export * from './fetch.client';
2
+ export * from './fetch.interface';
3
+ export * from './http-method.enum';
4
+ export * from './request-options.interface';
@@ -0,0 +1,21 @@
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("./fetch.client"), exports);
18
+ __exportStar(require("./fetch.interface"), exports);
19
+ __exportStar(require("./http-method.enum"), exports);
20
+ __exportStar(require("./request-options.interface"), exports);
21
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":";;;;;;;;;;;;;;;;AAAA,iDAA+B;AAC/B,oDAAkC;AAClC,qDAAmC;AACnC,8DAA4C"}
@@ -0,0 +1,7 @@
1
+ import { FetchOptions } from './fetch.interface';
2
+ interface ExtraOptions {
3
+ json?: any;
4
+ headers?: Record<string, string>;
5
+ }
6
+ export declare type RequestOptions<Opts extends FetchOptions<any, any>> = Omit<Partial<Opts>, keyof ExtraOptions> & ExtraOptions;
7
+ export {};
@@ -0,0 +1,3 @@
1
+ "use strict";
2
+ Object.defineProperty(exports, "__esModule", { value: true });
3
+ //# sourceMappingURL=request-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-options.interface.js","sourceRoot":"","sources":["../../src/request-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,27 @@
1
+ import { FetchAPI, FetchOptions, FetchResponse } from './fetch.interface';
2
+ import { RequestOptions } from './request-options.interface';
3
+ export declare class FetchClient<Opts extends FetchOptions<any, any> = RequestInit, Req = URL | Request, Res extends FetchResponse = Response> {
4
+ private readonly fetch?;
5
+ constructor(fetch?: FetchAPI<Opts, Req, Res> | undefined);
6
+ private send;
7
+ private createMethod;
8
+ raw(...args: Parameters<FetchAPI<Opts, Req, Res>>): Promise<Res>;
9
+ delete: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
10
+ json: <T = unknown>() => Promise<T>;
11
+ };
12
+ get: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
13
+ json: <T = unknown>() => Promise<T>;
14
+ };
15
+ head: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
16
+ json: <T = unknown>() => Promise<T>;
17
+ };
18
+ patch: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
19
+ json: <T = unknown>() => Promise<T>;
20
+ };
21
+ post: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
22
+ json: <T = unknown>() => Promise<T>;
23
+ };
24
+ put: (url: string | Req, options?: Omit<RequestOptions<Opts>, 'method'>) => Promise<Res> & {
25
+ json: <T = unknown>() => Promise<T>;
26
+ };
27
+ }
@@ -0,0 +1,51 @@
1
+ var __rest = (this && this.__rest) || function (s, e) {
2
+ var t = {};
3
+ for (var p in s) if (Object.prototype.hasOwnProperty.call(s, p) && e.indexOf(p) < 0)
4
+ t[p] = s[p];
5
+ if (s != null && typeof Object.getOwnPropertySymbols === "function")
6
+ for (var i = 0, p = Object.getOwnPropertySymbols(s); i < p.length; i++) {
7
+ if (e.indexOf(p[i]) < 0 && Object.prototype.propertyIsEnumerable.call(s, p[i]))
8
+ t[p[i]] = s[p[i]];
9
+ }
10
+ return t;
11
+ };
12
+ import { ClientException } from '@voiceflow/exception';
13
+ import { HTTPMethod } from './http-method.enum';
14
+ export class FetchClient {
15
+ constructor(fetch) {
16
+ this.fetch = fetch;
17
+ this.delete = this.createMethod(HTTPMethod.DELETE);
18
+ this.get = this.createMethod(HTTPMethod.GET);
19
+ this.head = this.createMethod(HTTPMethod.HEAD);
20
+ this.patch = this.createMethod(HTTPMethod.PATCH);
21
+ this.post = this.createMethod(HTTPMethod.POST);
22
+ this.put = this.createMethod(HTTPMethod.PUT);
23
+ }
24
+ async send(url, rawOptions) {
25
+ const { json } = rawOptions, options = __rest(rawOptions, ["json"]);
26
+ const headers = Object.assign({}, options.headers);
27
+ let { body } = options;
28
+ if (json != null) {
29
+ headers['content-type'] = 'application/json';
30
+ body = JSON.stringify(json);
31
+ }
32
+ const response = await this.raw(url, Object.assign(Object.assign({}, options), { headers, body }));
33
+ if (!response.ok) {
34
+ throw await new ClientException(response).build();
35
+ }
36
+ return response;
37
+ }
38
+ createMethod(method) {
39
+ return (url, options) => {
40
+ const response = this.send(url, Object.assign(Object.assign({}, options), { method }));
41
+ return Object.assign(response, {
42
+ json: async () => (await response).json(),
43
+ });
44
+ };
45
+ }
46
+ raw(...args) {
47
+ var _a;
48
+ return ((_a = this.fetch) !== null && _a !== void 0 ? _a : window.fetch)(...args);
49
+ }
50
+ }
51
+ //# sourceMappingURL=fetch.client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.client.js","sourceRoot":"","sources":["../../src/fetch.client.ts"],"names":[],"mappings":";;;;;;;;;;;AAAA,OAAO,EAAE,eAAe,EAAE,MAAM,sBAAsB,CAAC;AAGvD,OAAO,EAAE,UAAU,EAAE,MAAM,oBAAoB,CAAC;AAGhD,MAAM,OAAO,WAAW;IACtB,YAA6B,KAAgC;QAAhC,UAAK,GAAL,KAAK,CAA2B;QAoCtD,WAAM,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,MAAM,CAAC,CAAC;QAE9C,QAAG,GAAG,IAAI,CAAC,YAAY,CAAC,UAAU,CAAC,GAAG,CAAC,CAAC;QAExC,SAAI,GAAG,IAAI,CAAC,YAAY,CAAC,U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,MAAM,QAAQ,CAAC,CAAC,IAAI,EAAE;aACnE,CAAC,CAAC;QACL,CAAC,CAAC;IACJ,CAAC;IAEM,GAAG,CAAC,GAAG,IAA0C;;QACtD,OAAO,CAAC,MAAA,IAAI,CAAC,KAAK,mCAAK,MAAM,CAAC,KAAiC,CAAC,CAAC,GAAG,IAAI,CAAC,CAAC;IAC5E,CAAC;CAaF"}
@@ -0,0 +1 @@
1
+ export {};
@@ -0,0 +1,156 @@
1
+ import { ClientException } from '@voiceflow/exception';
2
+ import { expect } from 'chai';
3
+ import fetchMock from 'fetch-mock';
4
+ import { URL as NodeURL } from 'node:url';
5
+ import * as sinon from 'sinon';
6
+ import * as undici from 'undici';
7
+ import { FetchClient } from './fetch.client';
8
+ const TARGET_URL = 'http://example.com/resource/123';
9
+ const JSON_HEADERS = { 'content-type': 'application/json' };
10
+ describe('Fetch Client', () => {
11
+ let sandbox;
12
+ beforeEach(() => {
13
+ sandbox = fetchMock.sandbox();
14
+ });
15
+ describe('#raw()', () => {
16
+ const url = 'http://example.com';
17
+ describe('window.fetch', () => {
18
+ let fetchStub;
19
+ let fetchClient;
20
+ beforeEach(() => {
21
+ fetchStub = sinon.stub(window, 'fetch');
22
+ fetchClient = new FetchClient();
23
+ });
24
+ afterEach(() => {
25
+ sinon.restore();
26
+ });
27
+ it('should pass through Request instance and options to window.fetch', async () => {
28
+ const request = new Request(new URL(url));
29
+ const options = { cache: 'only-if-cached' };
30
+ await fetchClient.raw(request, options);
31
+ expect(fetchStub).to.be.calledWithExactly(request, options);
32
+ });
33
+ it('should pass through URL instance to window.fetch', async () => {
34
+ const request = new URL(url);
35
+ await fetchClient.raw(request);
36
+ expect(fetchStub).to.be.calledWithExactly(request);
37
+ });
38
+ it('should pass through string to window.fetch', async () => {
39
+ await fetchClient.raw(url);
40
+ expect(fetchStub).to.be.calledWithExactly(url);
41
+ });
42
+ });
43
+ describe('undici.fetch', () => {
44
+ let fetchSpy;
45
+ let fetchClient;
46
+ beforeEach(() => {
47
+ fetchSpy = sinon.spy();
48
+ fetchClient = new FetchClient(fetchSpy);
49
+ });
50
+ it('should pass through Request instance and options to undici.fetch', async () => {
51
+ const request = new undici.Request(new NodeURL(url));
52
+ const options = { dispatcher: new undici.Dispatcher() };
53
+ await fetchClient.raw(request, options);
54
+ expect(fetchSpy).to.be.calledWithExactly(request, options);
55
+ });
56
+ it('should pass through URL instance to undici.fetch', async () => {
57
+ const request = new NodeURL(url);
58
+ await fetchClient.raw(request);
59
+ expect(fetchSpy).to.be.calledWithExactly(request);
60
+ });
61
+ it('should pass through string to undici.fetch', async () => {
62
+ await fetchClient.raw(url);
63
+ expect(fetchSpy).to.be.calledWithExactly(url);
64
+ });
65
+ });
66
+ });
67
+ describe('#delete()', () => {
68
+ it('should send DELETE request', async () => {
69
+ const fetch = new FetchClient(sandbox);
70
+ sandbox.delete(TARGET_URL, 200);
71
+ await fetch.delete(TARGET_URL);
72
+ expect(sandbox.done()).to.be.true;
73
+ });
74
+ });
75
+ describe('#get()', () => {
76
+ it('should send GET request', async () => {
77
+ const data = { foo: 'bar' };
78
+ const fetch = new FetchClient(sandbox);
79
+ sandbox.get(TARGET_URL, { status: 200, body: data });
80
+ const result = await fetch.get(TARGET_URL).json();
81
+ expect(result).to.eql(data);
82
+ expect(sandbox.done()).to.be.true;
83
+ });
84
+ });
85
+ describe('#head()', () => {
86
+ it('should send HEAD request', async () => {
87
+ const fetch = new FetchClient(sandbox);
88
+ sandbox.head(TARGET_URL, 200);
89
+ await fetch.head(TARGET_URL);
90
+ expect(sandbox.done()).to.be.true;
91
+ });
92
+ });
93
+ describe('#patch()', () => {
94
+ it('should send PATCH request', async () => {
95
+ const body = { foo: 'bar' };
96
+ const fetch = new FetchClient(sandbox);
97
+ sandbox.patch({ url: TARGET_URL, body, headers: JSON_HEADERS }, 200);
98
+ await fetch.patch(TARGET_URL, { json: body });
99
+ expect(sandbox.done()).to.be.true;
100
+ });
101
+ });
102
+ describe('#post()', () => {
103
+ it('should send POST request', async () => {
104
+ const body = { foo: 'bar' };
105
+ const data = { fizz: 'buzz' };
106
+ const fetch = new FetchClient(sandbox);
107
+ sandbox.post({ url: TARGET_URL, body, headers: JSON_HEADERS }, { status: 200, body: data });
108
+ const result = await fetch.post(TARGET_URL, { json: body }).json();
109
+ expect(result).to.eql(data);
110
+ expect(sandbox.done()).to.be.true;
111
+ });
112
+ });
113
+ describe('#put()', () => {
114
+ it('should send PUT request', async () => {
115
+ const body = { foo: 'bar' };
116
+ const fetch = new FetchClient(sandbox);
117
+ sandbox.put({ url: TARGET_URL, body, headers: JSON_HEADERS }, 200);
118
+ await fetch.put(TARGET_URL, { json: body });
119
+ expect(sandbox.done()).to.be.true;
120
+ });
121
+ });
122
+ describe('error handling', () => {
123
+ it('should throw ClientException on non-2xx status code', async () => {
124
+ const fetch = new FetchClient(sandbox);
125
+ sandbox.head(TARGET_URL, 404);
126
+ await expect(fetch.head(TARGET_URL)).to.be.rejectedWith(ClientException);
127
+ expect(sandbox.done()).to.be.true;
128
+ });
129
+ it('should extract error details from response body', async () => {
130
+ const status = 500;
131
+ const message = 'something went wrong!';
132
+ const cause = 'the dog ate my homework';
133
+ const details = { traceID: '123' };
134
+ const fetch = new FetchClient(sandbox);
135
+ sandbox.get(TARGET_URL, { status, body: { message, cause, details } });
136
+ try {
137
+ await fetch.get(TARGET_URL);
138
+ expect.fail('expected to throw ClientException');
139
+ }
140
+ catch (err) {
141
+ if (ClientException.instanceOf(err)) {
142
+ expect(err.statusCode).to.eq(status);
143
+ expect(err.statusText).to.eq('Internal Server Error');
144
+ expect(err.message).to.eq(message);
145
+ expect(err.cause).to.eq(cause);
146
+ expect(err.details).to.eql(details);
147
+ }
148
+ else {
149
+ expect.fail('should be an instance of ClientException');
150
+ }
151
+ }
152
+ expect(sandbox.done()).to.be.true;
153
+ });
154
+ });
155
+ });
156
+ //# sourceMappingURL=fetch.client.test.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.client.test.js","sourceRoot":"","sources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AC;YACvC,OAAO,CAAC,GAAG,CAAC,UAAU,EAAE,EAAE,MAAM,EAAE,IAAI,EAAE,EAAE,OAAO,EAAE,KAAK,EAAE,OAAO,EAAE,EAAE,CAAC,CAAC;YAEvE,IAAI;gBACF,MAAM,KAAK,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;gBAE5B,MAAM,CAAC,IAAI,CAAC,mCAAmC,CAAC,CAAC;aAClD;YAAC,OAAO,GAAG,EAAE;gBACZ,IAAI,eAAe,CAAC,UAAU,CAAC,GAAG,CAAC,EAAE;oBACnC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,MAAM,CAAC,CAAC;oBACrC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,uBAAuB,CAAC,CAAC;oBACtD,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,OAAO,CAAC,CAAC;oBACnC,MAAM,CAAC,GAAG,CAAC,KAAK,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,KAAK,CAAC,CAAC;oBAC/B,MAAM,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC,EAAE,CAAC,GAAG,CAAC,OAAO,CAAC,CAAC;iBACrC;qBAAM;oBACL,MAAM,CAAC,IAAI,CAAC,0CAA0C,CAAC,CAAC;iBACzD;aACF;YAED,MAAM,CAAC,OAAO,CAAC,IAAI,EAAE,CAAC,CAAC,EAAE,CAAC,EAAE,CAAC,IAAI,CAAC;QACpC,CAAC,CAAC,CAAC;IACL,CAAC,CAAC,CAAC;AACL,CAAC,CAAC,CAAC"}
@@ -0,0 +1,11 @@
1
+ import { BaseResponse } from '@voiceflow/exception';
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 declare type FetchAPI<Opts extends FetchOptions<any, any>, Req, Res extends FetchResponse> = (input: string | Req, init?: Opts) => Promise<Res>;
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=fetch.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"fetch.interface.js","sourceRoot":"","sources":["../../src/fetch.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1,8 @@
1
+ export declare enum HTTPMethod {
2
+ DELETE = "delete",
3
+ GET = "get",
4
+ HEAD = "head",
5
+ PATCH = "patch",
6
+ POST = "post",
7
+ PUT = "put"
8
+ }
@@ -0,0 +1,10 @@
1
+ export var HTTPMethod;
2
+ (function (HTTPMethod) {
3
+ HTTPMethod["DELETE"] = "delete";
4
+ HTTPMethod["GET"] = "get";
5
+ HTTPMethod["HEAD"] = "head";
6
+ HTTPMethod["PATCH"] = "patch";
7
+ HTTPMethod["POST"] = "post";
8
+ HTTPMethod["PUT"] = "put";
9
+ })(HTTPMethod || (HTTPMethod = {}));
10
+ //# sourceMappingURL=http-method.enum.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"http-method.enum.js","sourceRoot":"","sources":["../../src/http-method.enum.ts"],"names":[],"mappings":"AAAA,MAAM,CAAN,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,KAAV,UAAU,QAOrB"}
@@ -0,0 +1,4 @@
1
+ export * from './fetch.client';
2
+ export * from './fetch.interface';
3
+ export * from './http-method.enum';
4
+ export * from './request-options.interface';
@@ -0,0 +1,5 @@
1
+ export * from './fetch.client';
2
+ export * from './fetch.interface';
3
+ export * from './http-method.enum';
4
+ export * from './request-options.interface';
5
+ //# sourceMappingURL=main.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"main.js","sourceRoot":"","sources":["../../src/main.ts"],"names":[],"mappings":"AAAA,cAAc,gBAAgB,CAAC;AAC/B,cAAc,mBAAmB,CAAC;AAClC,cAAc,oBAAoB,CAAC;AACnC,cAAc,6BAA6B,CAAC"}
@@ -0,0 +1,7 @@
1
+ import { FetchOptions } from './fetch.interface';
2
+ interface ExtraOptions {
3
+ json?: any;
4
+ headers?: Record<string, string>;
5
+ }
6
+ export declare type RequestOptions<Opts extends FetchOptions<any, any>> = Omit<Partial<Opts>, keyof ExtraOptions> & ExtraOptions;
7
+ export {};
@@ -0,0 +1,2 @@
1
+ export {};
2
+ //# sourceMappingURL=request-options.interface.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"request-options.interface.js","sourceRoot":"","sources":["../../src/request-options.interface.ts"],"names":[],"mappings":""}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../exception/build/cjs/error-code.enum.d.ts","../../exception/build/cjs/base-error.interface.d.ts","../../exception/build/cjs/base-response.interface.d.ts","../../exception/build/cjs/error-payload.interface.d.ts","../../exception/build/cjs/client.exception.d.ts","../../exception/build/cjs/error-message.interface.d.ts","../../exception/build/cjs/internal.exception.d.ts","../../exception/build/cjs/http/http.exception.d.ts","../../exception/build/cjs/http/http-status.enum.d.ts","../../exception/build/cjs/http/utils.d.ts","../../exception/build/cjs/http/http-4xx.exception.d.ts","../../exception/build/cjs/http/http-5xx.exception.d.ts","../../exception/build/cjs/main.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/fetch-mock/types/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici/types/readable.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/undici/types/file.d.ts","../../../node_modules/undici/types/fetch.d.ts","../../../node_modules/undici/types/formdata.d.ts","../../../node_modules/undici/types/connector.d.ts","../../../node_modules/undici/types/client.d.ts","../../../node_modules/undici/types/errors.d.ts","../../../node_modules/undici/types/dispatcher.d.ts","../../../node_modules/undici/types/global-dispatcher.d.ts","../../../node_modules/undici/types/global-origin.d.ts","../../../node_modules/undici/types/pool-stats.d.ts","../../../node_modules/undici/types/pool.d.ts","../../../node_modules/undici/types/handlers.d.ts","../../../node_modules/undici/types/balanced-pool.d.ts","../../../node_modules/undici/types/agent.d.ts","../../../node_modules/undici/types/mock-interceptor.d.ts","../../../node_modules/undici/types/mock-agent.d.ts","../../../node_modules/undici/types/mock-client.d.ts","../../../node_modules/undici/types/mock-pool.d.ts","../../../node_modules/undici/types/mock-errors.d.ts","../../../node_modules/undici/types/proxy-agent.d.ts","../../../node_modules/undici/types/api.d.ts","../../../node_modules/undici/types/filereader.d.ts","../../../node_modules/undici/types/diagnostics-channel.d.ts","../../../node_modules/undici/types/interceptors.d.ts","../../../node_modules/undici/index.d.ts","../src/fetch.interface.ts","../src/http-method.enum.ts","../src/request-options.interface.ts","../src/fetch.client.ts","../src/fetch.client.test.ts","../src/main.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/@types/crypto-js/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/ioredis/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/jsonwebtoken/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/number-to-words/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/shallowequal/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/webidl-conversions/index.d.ts","../../../node_modules/@types/whatwg-url/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"f853e563de2c619d217bb40868a04c0c52153beddef1afc178ad6d666152f96e","c752db562fa5ed587768ea35eb56551a08d88b4877ef2d6a4daae8a3f3267756","a3f2d4863d6085132e1f8af892e8aa628da48ae00f9c4c2c8b95b8ab8de77812","55119d1ee3853bd5eb045bd8ef7acdfca802c0adddf62277b27757252bf8a874","93c8162c39d06c2cd637a2deef346ab54b9779d55f86d2bdbf888da0ea9b4367","e894e8917f9c6648bde6bcab721b6a057615719b0b3525e4098f7c8ef3e89419","894a7a9b637dfa6fff80d33e9d403e38b52e655c421fd14d3d4c3e2e52aaf21e","7b4081bca7861866c091f64497fac7941eb904af5643281947eb2851e363e881","123e6dc03ac2b52def63a9be9f7bbd8d7ea3bd60bcebe8c252b71b04fed4b084","08595f5fb6864cf242f74eba889071a3c865ffdef571af84f21956bc59c7842b","7506e9f8faecbbcc378c9b4952e6ee366883b4d0e5012eeac39783ccd99a1c7a","9ad71c94c43027ebda91d5db986823cbe275286689162519f2f2d1ba0342ed1a","72b92e2da5c2d103e5e2c6155014df82e3297dea9d27013e5e5e82a0da3b8537",{"version":"c8747693e5872ad5ef3aa016731a06915e1c34dae987829d9aa5bd40c7a2c54b","affectsGlobalScope":true},"e3faaa881a24840fce8b13e3580f4e9b6d6688b57eec81017e07611cefeb4902","f83b320cceccfc48457a818d18fc9a006ab18d0bdd727aa2c2e73dc1b4a45e98","354abbae08f72ea982b1a767a8908f1b3efe8bbe53955c64f9c0c249c8832d5d","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","e7c20bf3e73ed0996fabeb09284e93181900b6fa18c35aa16643c5449dffb64a","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","b9b963043551b034abd9e7c6d859f7a81d99479fde938d983114d167d0644a78","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"902cd98bf46e95caf4118a0733fb801e9e90eec3edaed6abdad77124afec9ca2","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1cdb8f094b969dcc183745dc88404e2d8fcf2a858c6e7cc2441011476573238e","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","76a28d995c53b19a373152b77032640052ded6b94a01208a30160e88ddf1275d","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","816924ed387a5206dc920674f9cb50ed9ef196aa1c92ef145618d4bb22abdcff","79865c228ab0062d1e8897fc2ef7b682c4918358cc42320bc804580f6aef7a1d","e0345e0fe484fe0035aefcd7b2f5f1a0c30d5e6bc678034c41a8288450633de7","af374d0ff9768de7abbc20dde30bb08af34dfca1beaa38867d44469128814025","731b1cf869c8d522aa62a3e2846daee0e0cdcdc277087f498d8cc5069972d03b","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","0ec3e3408326da3cfb8371edf27ba4b6beb44277a4e206ddb41ae32e91602b56","fecd3ded75d4ab2921b8f702e4b2317990cf203da118461e95349ac742b8579d","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","8cf23a0959cf72d938eb7c58d6ecc261491c1b4a5553f06dfb9fe6c21d4eaf63","0bf2d6bcd257ec8906339f4e07eede29ce9428b8f2aa56d5e764a88f70ec06be","10a38b861bbc21d9a4d195db18ef4dfa2135e2efeb5c2e3f70c7ad04dd460407","4115949ddc65bf2ccb507498a9c55486300284914dae5e2565f63e1967dfbeba","71afbc331804623823a208d7afaf53c39fefd4b249940a57470fb9722f3da954","957a167314e1b95b2ec1159dc5847d51e00946955ee051bd2b1a7ccf71ece9bf","67d510008ecf71f23942071e9e74cb9c308ab5cc6a55f4eea04532b92ef10453","01de4e744cb973d50806feacf14170a8febfa636ec63ec84a962edf0afde7a84","ee36be1145b9ca7c3d97cc5eb4a31b1f521ee10f32accf1949ce0b51627d967c","d1c90d3bfed34818ddc386c7bc3bcbd84c8bec56b8d76eaf177b3c2045e13b5c","a1f35b67778f29808580e3b667da49b1fba8b1426dd996276f81785c90382697","82cdcebf5c7df704cce2c3d1f905b5539b2f1ef3f701f8314e7a558dbc24fa38","f93a52992fcec143deca2d7395c45ec8b486097018aa53e2f678703e3a7d90ef",{"version":"6ba3a64b5ae0354f58c85b450d380be5ae629631122136337c2200376f4cfce0","signature":"181436c1ec6de3294ad2e7f7ea7a3e77e6e45030912dc84901d950d384a8e0a4"},{"version":"ff17139739ae8ca3cbe004f849c9b7cd1ea60028778ab260674eecc9cc99f3ac","signature":"a9fc70d9b501e83d41d6bd119298dc2b945d71f767047cd835d0de4354e26bb3"},{"version":"d0055888c2efd1ec2c761ce4a88f8fb948ea6fc51549b960770ff90bcbba4c70","signature":"9083303c436d668b2dd8e8adb7c3f92c861ca938048b2a0e78cf7e5f1b173c5f"},{"version":"a807e5efb66bfce30c220c2a5acfd67cbd76410ff4d6e36dd931a10ed12bc641","signature":"d24732de29042c4441e422d6358a1f9a950602c9bf348aeaa985ea06fcde51df"},{"version":"05b11effaf1b3677e15941497b719f5e9f699f98a029af00d61a1e28dcf0b148","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"c46e389d330737eb18c51f2a60be7ab02739770806b7078470f96258dc32343a","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90",{"version":"63e2182615c513e89bb8a3e749d08f7c379e86490fcdbf6d35f2c14b3507a6e8","affectsGlobalScope":true},{"version":"f170fd125ed7105ba874e0eb88e83c6b1fb4614bdeeeabef89df883612bd0b79","affectsGlobalScope":true},"16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"d2f7baf43dfa349d4010cbd9d64d84cdf3ec26c65fa5f44c8f74f052bedd0b49","affectsGlobalScope":true},"84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","0b85cb069d0e427ba946e5eb2d86ef65ffd19867042810516d16919f6c1a5aec","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","be00321090ed100e3bd1e566c0408004137e73feb19d6380eba57d68519ff6c5","0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","e5dd317ef2c7a2882b152337b03d592fafa8351b40351849a16a908b198bd3b5","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","5e03940534e2cfe6d971abfdda33326663c1c0788eac583874fea43bcae165f4","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","a440a1b0129449cdc6fa715d1998bcd5e914fec1e68b076a4230d71524561d48",{"version":"4f0ad52a7fbd6bfba88ec22ec719b6956a0fc647030462f9db490e74236d116f","affectsGlobalScope":true},"95d085761c8e8d469a9066a9cc7bd4b5bc671098d2f8442ae657fb35b3215cf1","67483628398336d0f9368578a9514bd8cc823a4f3b3ab784f3942077e5047335"],"options":{"composite":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"experimentalDecorators":true,"module":1,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./cjs","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[79,104,111,143],[55,104],[104],[79,104,111],[76,79,104,111,147,148],[104,144,148,149,151],[76,93,100,104,111],[104,111],[104,157,159,160,161,162,163,164,165,166,167,168,169],[104,157,158,160,161,162,163,164,165,166,167,168,169],[104,158,159,160,161,162,163,164,165,166,167,168,169],[104,157,158,159,161,162,163,164,165,166,167,168,169],[104,157,158,159,160,162,163,164,165,166,167,168,169],[104,157,158,159,160,161,163,164,165,166,167,168,169],[104,157,158,159,160,161,162,164,165,166,167,168,169],[104,157,158,159,160,161,162,163,165,166,167,168,169],[104,157,158,159,160,161,162,163,164,166,167,168,169],[104,157,158,159,160,161,162,163,164,165,167,168,169],[104,157,158,159,160,161,162,163,164,165,166,168,169],[104,157,158,159,160,161,162,163,164,165,166,167,169],[104,157,158,159,160,161,162,163,164,165,166,167,168],[61,104],[64,104],[65,70,104],[66,76,77,84,93,103,104],[66,67,76,84,104],[68,104],[69,70,77,85,104],[70,93,100,104],[71,73,76,84,104],[72,104],[73,74,104],[75,76,104],[76,104],[76,77,78,93,103,104],[76,77,78,93,104],[79,84,93,103,104],[76,77,79,80,84,93,100,103,104],[79,81,93,100,103,104],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110],[76,82,104],[83,103,104],[73,76,84,93,104],[85,104],[86,104],[64,87,104],[88,102,104,108],[89,104],[90,104],[76,91,104],[91,92,104,106],[76,93,94,95,104],[93,95,104],[93,94,104],[96,104],[97,104],[76,98,99,104],[98,99,104],[70,84,100,104],[101,104],[84,102,104],[65,79,90,103,104],[70,104],[93,104,105],[104,106],[104,107],[65,70,76,78,87,93,103,104,106,108],[93,104,109],[79,104,111,150],[55,58,104],[57,104],[104,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135],[103,104,118,122],[93,103,104,118],[103,104,116,118,122],[100,103,104,115,118],[84,100,104],[84,103,104,115,118],[60,65,76,79,93,103,104,114,117],[79,104,116],[65,96,103,104,111,114,118],[65,104,111],[104,111,112,113],[104,118],[104,118,125,126],[104,116,118,126,127],[104,117],[79,104,113,118],[104,118,122,126,127],[104,122],[103,104,116,118,121],[100,104,118,125],[65,93,104],[42,104],[42,44,45,104],[43,104],[51,104],[45,47,48,104],[47,49,50,104],[42,43,47,104],[42,43,44,45,46,47,48,49,50,52,53,104],[54,55,56,58,103,104,136,140],[54,104,137,138,139],[54,104],[104,137,138,139,140],[104,137],[137,139],[54],[137]],"referencedMap":[[144,1],[145,2],[55,3],[143,4],[146,3],[149,5],[152,6],[153,7],[154,3],[155,3],[156,8],[158,9],[159,10],[157,11],[160,12],[161,13],[162,14],[163,15],[164,16],[165,17],[166,18],[167,19],[168,20],[169,21],[150,3],[170,3],[171,3],[172,3],[61,22],[62,22],[64,23],[65,24],[66,25],[67,26],[68,27],[69,28],[70,29],[71,30],[72,31],[73,32],[74,32],[75,33],[76,34],[77,35],[78,36],[63,3],[110,3],[79,37],[80,38],[81,39],[111,40],[82,41],[83,42],[84,43],[85,44],[86,45],[87,46],[88,47],[89,48],[90,49],[91,50],[92,51],[93,52],[95,53],[94,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[107,66],[108,67],[109,68],[173,3],[174,3],[175,3],[148,3],[147,3],[151,69],[176,3],[177,70],[58,71],[57,3],[178,3],[179,8],[59,3],[56,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[136,72],[125,73],[132,74],[124,75],[116,76],[115,77],[134,78],[118,79],[117,80],[113,81],[112,82],[133,82],[114,83],[119,84],[120,3],[123,84],[135,84],[127,85],[128,86],[130,87],[126,88],[129,89],[121,90],[122,91],[131,92],[60,93],[43,94],[44,3],[46,95],[42,3],[47,96],[45,96],[52,97],[53,97],[50,3],[49,98],[51,99],[48,100],[54,101],[141,102],[140,103],[137,104],[138,3],[142,105],[139,106]],"exportedModulesMap":[[144,1],[145,2],[55,3],[143,4],[146,3],[149,5],[152,6],[153,7],[154,3],[155,3],[156,8],[158,9],[159,10],[157,11],[160,12],[161,13],[162,14],[163,15],[164,16],[165,17],[166,18],[167,19],[168,20],[169,21],[150,3],[170,3],[171,3],[172,3],[61,22],[62,22],[64,23],[65,24],[66,25],[67,26],[68,27],[69,28],[70,29],[71,30],[72,31],[73,32],[74,32],[75,33],[76,34],[77,35],[78,36],[63,3],[110,3],[79,37],[80,38],[81,39],[111,40],[82,41],[83,42],[84,43],[85,44],[86,45],[87,46],[88,47],[89,48],[90,49],[91,50],[92,51],[93,52],[95,53],[94,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[107,66],[108,67],[109,68],[173,3],[174,3],[175,3],[148,3],[147,3],[151,69],[176,3],[177,70],[58,71],[57,3],[178,3],[179,8],[59,3],[56,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[136,72],[125,73],[132,74],[124,75],[116,76],[115,77],[134,78],[118,79],[117,80],[113,81],[112,82],[133,82],[114,83],[119,84],[120,3],[123,84],[135,84],[127,85],[128,86],[130,87],[126,88],[129,89],[121,90],[122,91],[131,92],[60,93],[43,94],[44,3],[46,95],[42,3],[47,96],[45,96],[52,97],[53,97],[50,3],[49,98],[51,99],[48,100],[54,101],[140,107],[137,108],[142,105],[139,109]],"semanticDiagnosticsPerFile":[144,145,55,143,146,149,152,153,154,155,156,158,159,157,160,161,162,163,164,165,166,167,168,169,150,170,171,172,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,63,110,79,80,81,111,82,83,84,85,86,87,88,89,90,91,92,93,95,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,173,174,175,148,147,151,176,177,58,57,178,179,59,56,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,34,39,40,35,36,37,38,1,41,136,125,132,124,116,115,134,118,117,113,112,133,114,119,120,123,135,127,128,130,126,129,121,122,131,60,43,44,46,42,47,45,52,53,50,49,51,48,54,141,140,137,138,142,139]},"version":"4.7.4"}
@@ -0,0 +1 @@
1
+ {"program":{"fileNames":["../../../node_modules/typescript/lib/lib.es5.d.ts","../../../node_modules/typescript/lib/lib.es2015.d.ts","../../../node_modules/typescript/lib/lib.es2016.d.ts","../../../node_modules/typescript/lib/lib.es2017.d.ts","../../../node_modules/typescript/lib/lib.es2018.d.ts","../../../node_modules/typescript/lib/lib.es2019.d.ts","../../../node_modules/typescript/lib/lib.es2020.d.ts","../../../node_modules/typescript/lib/lib.dom.d.ts","../../../node_modules/typescript/lib/lib.es2015.core.d.ts","../../../node_modules/typescript/lib/lib.es2015.collection.d.ts","../../../node_modules/typescript/lib/lib.es2015.generator.d.ts","../../../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../../../node_modules/typescript/lib/lib.es2015.promise.d.ts","../../../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../../../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../../../node_modules/typescript/lib/lib.es2017.object.d.ts","../../../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2017.string.d.ts","../../../node_modules/typescript/lib/lib.es2017.intl.d.ts","../../../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../../../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../../../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../../../node_modules/typescript/lib/lib.es2018.intl.d.ts","../../../node_modules/typescript/lib/lib.es2018.promise.d.ts","../../../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../../../node_modules/typescript/lib/lib.es2019.array.d.ts","../../../node_modules/typescript/lib/lib.es2019.object.d.ts","../../../node_modules/typescript/lib/lib.es2019.string.d.ts","../../../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../../../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../../../node_modules/typescript/lib/lib.es2020.date.d.ts","../../../node_modules/typescript/lib/lib.es2020.promise.d.ts","../../../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../../../node_modules/typescript/lib/lib.es2020.string.d.ts","../../../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../../../node_modules/typescript/lib/lib.es2020.intl.d.ts","../../../node_modules/typescript/lib/lib.es2020.number.d.ts","../../../node_modules/typescript/lib/lib.esnext.intl.d.ts","../../exception/build/cjs/error-code.enum.d.ts","../../exception/build/cjs/base-error.interface.d.ts","../../exception/build/cjs/base-response.interface.d.ts","../../exception/build/cjs/error-payload.interface.d.ts","../../exception/build/cjs/client.exception.d.ts","../../exception/build/cjs/error-message.interface.d.ts","../../exception/build/cjs/internal.exception.d.ts","../../exception/build/cjs/http/http.exception.d.ts","../../exception/build/cjs/http/http-status.enum.d.ts","../../exception/build/cjs/http/utils.d.ts","../../exception/build/cjs/http/http-4xx.exception.d.ts","../../exception/build/cjs/http/http-5xx.exception.d.ts","../../exception/build/cjs/main.d.ts","../../../node_modules/@types/chai/index.d.ts","../../../node_modules/fetch-mock/types/index.d.ts","../../../node_modules/@types/sinonjs__fake-timers/index.d.ts","../../../node_modules/@types/sinon/index.d.ts","../../../node_modules/buffer/index.d.ts","../../../node_modules/undici/types/readable.d.ts","../../../node_modules/@types/node/assert.d.ts","../../../node_modules/@types/node/assert/strict.d.ts","../../../node_modules/@types/node/globals.d.ts","../../../node_modules/@types/node/async_hooks.d.ts","../../../node_modules/@types/node/buffer.d.ts","../../../node_modules/@types/node/child_process.d.ts","../../../node_modules/@types/node/cluster.d.ts","../../../node_modules/@types/node/console.d.ts","../../../node_modules/@types/node/constants.d.ts","../../../node_modules/@types/node/crypto.d.ts","../../../node_modules/@types/node/dgram.d.ts","../../../node_modules/@types/node/diagnostics_channel.d.ts","../../../node_modules/@types/node/dns.d.ts","../../../node_modules/@types/node/dns/promises.d.ts","../../../node_modules/@types/node/domain.d.ts","../../../node_modules/@types/node/events.d.ts","../../../node_modules/@types/node/fs.d.ts","../../../node_modules/@types/node/fs/promises.d.ts","../../../node_modules/@types/node/http.d.ts","../../../node_modules/@types/node/http2.d.ts","../../../node_modules/@types/node/https.d.ts","../../../node_modules/@types/node/inspector.d.ts","../../../node_modules/@types/node/module.d.ts","../../../node_modules/@types/node/net.d.ts","../../../node_modules/@types/node/os.d.ts","../../../node_modules/@types/node/path.d.ts","../../../node_modules/@types/node/perf_hooks.d.ts","../../../node_modules/@types/node/process.d.ts","../../../node_modules/@types/node/punycode.d.ts","../../../node_modules/@types/node/querystring.d.ts","../../../node_modules/@types/node/readline.d.ts","../../../node_modules/@types/node/repl.d.ts","../../../node_modules/@types/node/stream.d.ts","../../../node_modules/@types/node/stream/promises.d.ts","../../../node_modules/@types/node/stream/consumers.d.ts","../../../node_modules/@types/node/stream/web.d.ts","../../../node_modules/@types/node/string_decoder.d.ts","../../../node_modules/@types/node/timers.d.ts","../../../node_modules/@types/node/timers/promises.d.ts","../../../node_modules/@types/node/tls.d.ts","../../../node_modules/@types/node/trace_events.d.ts","../../../node_modules/@types/node/tty.d.ts","../../../node_modules/@types/node/url.d.ts","../../../node_modules/@types/node/util.d.ts","../../../node_modules/@types/node/v8.d.ts","../../../node_modules/@types/node/vm.d.ts","../../../node_modules/@types/node/wasi.d.ts","../../../node_modules/@types/node/worker_threads.d.ts","../../../node_modules/@types/node/zlib.d.ts","../../../node_modules/@types/node/globals.global.d.ts","../../../node_modules/@types/node/index.d.ts","../../../node_modules/undici/types/file.d.ts","../../../node_modules/undici/types/fetch.d.ts","../../../node_modules/undici/types/formdata.d.ts","../../../node_modules/undici/types/connector.d.ts","../../../node_modules/undici/types/client.d.ts","../../../node_modules/undici/types/errors.d.ts","../../../node_modules/undici/types/dispatcher.d.ts","../../../node_modules/undici/types/global-dispatcher.d.ts","../../../node_modules/undici/types/global-origin.d.ts","../../../node_modules/undici/types/pool-stats.d.ts","../../../node_modules/undici/types/pool.d.ts","../../../node_modules/undici/types/handlers.d.ts","../../../node_modules/undici/types/balanced-pool.d.ts","../../../node_modules/undici/types/agent.d.ts","../../../node_modules/undici/types/mock-interceptor.d.ts","../../../node_modules/undici/types/mock-agent.d.ts","../../../node_modules/undici/types/mock-client.d.ts","../../../node_modules/undici/types/mock-pool.d.ts","../../../node_modules/undici/types/mock-errors.d.ts","../../../node_modules/undici/types/proxy-agent.d.ts","../../../node_modules/undici/types/api.d.ts","../../../node_modules/undici/types/filereader.d.ts","../../../node_modules/undici/types/diagnostics-channel.d.ts","../../../node_modules/undici/types/interceptors.d.ts","../../../node_modules/undici/index.d.ts","../src/fetch.interface.ts","../src/http-method.enum.ts","../src/request-options.interface.ts","../src/fetch.client.ts","../src/fetch.client.test.ts","../src/main.ts","../../../node_modules/@types/connect/index.d.ts","../../../node_modules/@types/body-parser/index.d.ts","../../../node_modules/@types/chai-as-promised/index.d.ts","../../../node_modules/@types/crypto-js/index.d.ts","../../../node_modules/@types/range-parser/index.d.ts","../../../node_modules/@types/qs/index.d.ts","../../../node_modules/@types/express-serve-static-core/index.d.ts","../../../node_modules/@types/mime/index.d.ts","../../../node_modules/@types/serve-static/index.d.ts","../../../node_modules/@types/express/index.d.ts","../../../node_modules/@types/ioredis/index.d.ts","../../../node_modules/@types/json-schema/index.d.ts","../../../node_modules/@types/json5/index.d.ts","../../../node_modules/@types/jsonwebtoken/index.d.ts","../../../node_modules/@types/lodash/common/common.d.ts","../../../node_modules/@types/lodash/common/array.d.ts","../../../node_modules/@types/lodash/common/collection.d.ts","../../../node_modules/@types/lodash/common/date.d.ts","../../../node_modules/@types/lodash/common/function.d.ts","../../../node_modules/@types/lodash/common/lang.d.ts","../../../node_modules/@types/lodash/common/math.d.ts","../../../node_modules/@types/lodash/common/number.d.ts","../../../node_modules/@types/lodash/common/object.d.ts","../../../node_modules/@types/lodash/common/seq.d.ts","../../../node_modules/@types/lodash/common/string.d.ts","../../../node_modules/@types/lodash/common/util.d.ts","../../../node_modules/@types/lodash/index.d.ts","../../../node_modules/@types/minimatch/index.d.ts","../../../node_modules/@types/minimist/index.d.ts","../../../node_modules/@types/mocha/index.d.ts","../../../node_modules/@types/normalize-package-data/index.d.ts","../../../node_modules/@types/number-to-words/index.d.ts","../../../node_modules/@types/parse-json/index.d.ts","../../../node_modules/@types/shallowequal/index.d.ts","../../../node_modules/@types/sinon-chai/index.d.ts","../../../node_modules/@types/webidl-conversions/index.d.ts","../../../node_modules/@types/whatwg-url/index.d.ts"],"fileInfos":[{"version":"f5c28122bee592cfaf5c72ed7bcc47f453b79778ffa6e301f45d21a0970719d4","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"3f149f903dd20dfeb7c80e228b659f0e436532de772469980dbd00702cc05cc1","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"43fb1d932e4966a39a41b464a12a81899d9ae5f2c829063f5571b6b87e6d2f9c","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"810627a82ac06fb5166da5ada4159c4ec11978dfbb0805fe804c86406dab8357","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"12a310447c5d23c7d0d5ca2af606e3bd08afda69100166730ab92c62999ebb9d","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"cd483c056da900716879771893a3c9772b66c3c88f8943b4205aec738a94b1d0","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"c37f8a49593a0030eecb51bbfa270e709bec9d79a6cc3bb851ef348d4e6b26f8","affectsGlobalScope":true},"f853e563de2c619d217bb40868a04c0c52153beddef1afc178ad6d666152f96e","c752db562fa5ed587768ea35eb56551a08d88b4877ef2d6a4daae8a3f3267756","a3f2d4863d6085132e1f8af892e8aa628da48ae00f9c4c2c8b95b8ab8de77812","55119d1ee3853bd5eb045bd8ef7acdfca802c0adddf62277b27757252bf8a874","93c8162c39d06c2cd637a2deef346ab54b9779d55f86d2bdbf888da0ea9b4367","e894e8917f9c6648bde6bcab721b6a057615719b0b3525e4098f7c8ef3e89419","894a7a9b637dfa6fff80d33e9d403e38b52e655c421fd14d3d4c3e2e52aaf21e","7b4081bca7861866c091f64497fac7941eb904af5643281947eb2851e363e881","123e6dc03ac2b52def63a9be9f7bbd8d7ea3bd60bcebe8c252b71b04fed4b084","08595f5fb6864cf242f74eba889071a3c865ffdef571af84f21956bc59c7842b","7506e9f8faecbbcc378c9b4952e6ee366883b4d0e5012eeac39783ccd99a1c7a","9ad71c94c43027ebda91d5db986823cbe275286689162519f2f2d1ba0342ed1a","72b92e2da5c2d103e5e2c6155014df82e3297dea9d27013e5e5e82a0da3b8537",{"version":"c8747693e5872ad5ef3aa016731a06915e1c34dae987829d9aa5bd40c7a2c54b","affectsGlobalScope":true},"e3faaa881a24840fce8b13e3580f4e9b6d6688b57eec81017e07611cefeb4902","f83b320cceccfc48457a818d18fc9a006ab18d0bdd727aa2c2e73dc1b4a45e98","354abbae08f72ea982b1a767a8908f1b3efe8bbe53955c64f9c0c249c8832d5d","4967529644e391115ca5592184d4b63980569adf60ee685f968fd59ab1557188","e7c20bf3e73ed0996fabeb09284e93181900b6fa18c35aa16643c5449dffb64a","0d5a2ee1fdfa82740e0103389b9efd6bfe145a20018a2da3c02b89666181f4d9","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"92d63add669d18ebc349efbacd88966d6f2ccdddfb1b880b2db98ae3aa7bf7c4","affectsGlobalScope":true},"ccc94049a9841fe47abe5baef6be9a38fc6228807974ae675fb15dc22531b4be",{"version":"9acfe4d1ff027015151ce81d60797b04b52bffe97ad8310bb0ec2e8fd61e1303","affectsGlobalScope":true},"95843d5cfafced8f3f8a5ce57d2335f0bcd361b9483587d12a25e4bd403b8216","afc6e96061af46bcff47246158caee7e056f5288783f2d83d6858cd25be1c565",{"version":"34f5bcac12b36d70304b73de5f5aab3bb91bd9919f984be80579ebcad03a624e","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","2f520601649a893e6a49a8851ebfcf4be8ce090dc1281c2a08a871cb04e8251f","f50c975ab7b50e25a69e3d8a3773894125b44e9698924105f23b812bf7488baf","2b8c764f856a1dd0a9a2bf23e5efddbff157de8138b0754010be561ae5fcaa90","76650408392bf49a8fbf3e2b6b302712a92d76af77b06e2da1cc8077359c4409","0af3121e68297b2247dd331c0d24dba599e50736a7517a5622d5591aae4a3122","6972fca26f6e9bd56197568d4379f99071a90766e06b4fcb5920a0130a9202be",{"version":"4a2628e95962c8ab756121faa3ac2ed348112ff7a87b5c286dd2cc3326546b4c","affectsGlobalScope":true},"80793b2277f31baa199234daed806fff0fb11491d1ebd3357e520c3558063f00","a049a59a02009fc023684fcfaf0ac526fe36c35dcc5d2b7d620c1750ba11b083","b9b963043551b034abd9e7c6d859f7a81d99479fde938d983114d167d0644a78","b287b810b5035d5685f1df6e1e418f1ca452a3ed4f59fd5cc081dbf2045f0d9b","4b9a003b5c556c96784132945bb41c655ea11273b1917f5c8d0c154dd5fd20dd","a458dc78104cc80048ac24fdc02fe6dce254838094c2f25641b3f954d9721241",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"902cd98bf46e95caf4118a0733fb801e9e90eec3edaed6abdad77124afec9ca2","abc1c425b2ad6720433f40f1877abfa4223f0f3dd486c9c28c492179ca183cb6","cd4854d38f4eb5592afd98ab95ca17389a7dfe38013d9079e802d739bdbcc939","94eed4cc2f5f658d5e229ff1ccd38860bddf4233e347bf78edd2154dee1f2b99",{"version":"bd1a08e30569b0fb2f0b21035eb9b039871f68faa9b98accf847e9c878c5e0a9","affectsGlobalScope":true},"9f1069b9e2c051737b1f9b4f1baf50e4a63385a6a89c32235549ae87fc3d5492","ee18f2da7a037c6ceeb112a084e485aead9ea166980bf433474559eac1b46553","29c2706fa0cc49a2bd90c83234da33d08bb9554ecec675e91c1f85087f5a5324","0acbf26bf958f9e80c1ffa587b74749d2697b75b484062d36e103c137c562bc3","d7838022c7dab596357a9604b9c6adffe37dc34085ce0779c958ce9545bd7139","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"a7971f9fb2a32ec7788ec6cda9d7a33c02023dfe9a62db2030ad1359649d8050","c33a6ea7147af60d8e98f1ac127047f4b0d4e2ce28b8f08ff3de07ca7cc00637",{"version":"b42b47e17b8ece2424ae8039feb944c2e3ba4b262986aebd582e51efbdca93dc","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","2408611d9b4146e35d1dbd1f443ccd8e187c74614a54b80300728277529dbf11","998a3de5237518c0b3ac00a11b3b4417affb008aa20aedee52f3fdae3cb86151","ad41008ffe077206e1811fc873f4d9005b5fd7f6ab52bb6118fef600815a5cb4","d88ecca73348e7c337541c4b8b60a50aca5e87384f6b8a422fc6603c637e4c21","badae0df9a8016ac36994b0a0e7b82ba6aaa3528e175a8c3cb161e4683eec03e","c3db860bcaaaeb3bbc23f353bbda1f8ab82756c8d5e973bebb3953cb09ea68f2","235a53595bd20b0b0eeb1a29cb2887c67c48375e92f03749b2488fbd46d0b1a0","bc09393cd4cd13f69cf1366d4236fbae5359bb550f0de4e15767e9a91d63dfb1","9c266243b01545e11d2733a55ad02b4c00ecdbda99c561cd1674f96e89cdc958","c71155c05fc76ff948a4759abc1cb9feec036509f500174bc18dad4c7827a60c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"1cdb8f094b969dcc183745dc88404e2d8fcf2a858c6e7cc2441011476573238e","25c8056edf4314820382a5fdb4bb7816999acdcb929c8f75e3f39473b87e85bc","76a28d995c53b19a373152b77032640052ded6b94a01208a30160e88ddf1275d","3e4825171442666d31c845aeb47fcd34b62e14041bb353ae2b874285d78482aa","816924ed387a5206dc920674f9cb50ed9ef196aa1c92ef145618d4bb22abdcff","79865c228ab0062d1e8897fc2ef7b682c4918358cc42320bc804580f6aef7a1d","e0345e0fe484fe0035aefcd7b2f5f1a0c30d5e6bc678034c41a8288450633de7","af374d0ff9768de7abbc20dde30bb08af34dfca1beaa38867d44469128814025","731b1cf869c8d522aa62a3e2846daee0e0cdcdc277087f498d8cc5069972d03b","385aab901643aa54e1c36f5ef3107913b10d1b5bb8cbcd933d4263b80a0d7f20","0ec3e3408326da3cfb8371edf27ba4b6beb44277a4e206ddb41ae32e91602b56","fecd3ded75d4ab2921b8f702e4b2317990cf203da118461e95349ac742b8579d","c3b170c45fc031db31f782e612adf7314b167e60439d304b49e704010e7bafe5","8cf23a0959cf72d938eb7c58d6ecc261491c1b4a5553f06dfb9fe6c21d4eaf63","0bf2d6bcd257ec8906339f4e07eede29ce9428b8f2aa56d5e764a88f70ec06be","10a38b861bbc21d9a4d195db18ef4dfa2135e2efeb5c2e3f70c7ad04dd460407","4115949ddc65bf2ccb507498a9c55486300284914dae5e2565f63e1967dfbeba","71afbc331804623823a208d7afaf53c39fefd4b249940a57470fb9722f3da954","957a167314e1b95b2ec1159dc5847d51e00946955ee051bd2b1a7ccf71ece9bf","67d510008ecf71f23942071e9e74cb9c308ab5cc6a55f4eea04532b92ef10453","01de4e744cb973d50806feacf14170a8febfa636ec63ec84a962edf0afde7a84","ee36be1145b9ca7c3d97cc5eb4a31b1f521ee10f32accf1949ce0b51627d967c","d1c90d3bfed34818ddc386c7bc3bcbd84c8bec56b8d76eaf177b3c2045e13b5c","a1f35b67778f29808580e3b667da49b1fba8b1426dd996276f81785c90382697","82cdcebf5c7df704cce2c3d1f905b5539b2f1ef3f701f8314e7a558dbc24fa38","f93a52992fcec143deca2d7395c45ec8b486097018aa53e2f678703e3a7d90ef",{"version":"6ba3a64b5ae0354f58c85b450d380be5ae629631122136337c2200376f4cfce0","signature":"181436c1ec6de3294ad2e7f7ea7a3e77e6e45030912dc84901d950d384a8e0a4"},{"version":"ff17139739ae8ca3cbe004f849c9b7cd1ea60028778ab260674eecc9cc99f3ac","signature":"a9fc70d9b501e83d41d6bd119298dc2b945d71f767047cd835d0de4354e26bb3"},{"version":"d0055888c2efd1ec2c761ce4a88f8fb948ea6fc51549b960770ff90bcbba4c70","signature":"9083303c436d668b2dd8e8adb7c3f92c861ca938048b2a0e78cf7e5f1b173c5f"},{"version":"a807e5efb66bfce30c220c2a5acfd67cbd76410ff4d6e36dd931a10ed12bc641","signature":"d24732de29042c4441e422d6358a1f9a950602c9bf348aeaa985ea06fcde51df"},{"version":"05b11effaf1b3677e15941497b719f5e9f699f98a029af00d61a1e28dcf0b148","signature":"8e609bb71c20b858c77f0e9f90bb1319db8477b13f9f965f1a1e18524bf50881"},"c46e389d330737eb18c51f2a60be7ab02739770806b7078470f96258dc32343a","6d829824ead8999f87b6df21200df3c6150391b894b4e80662caa462bd48d073","afc559c1b93df37c25aef6b3dfa2d64325b0e112e887ee18bf7e6f4ec383fc90",{"version":"63e2182615c513e89bb8a3e749d08f7c379e86490fcdbf6d35f2c14b3507a6e8","affectsGlobalScope":true},{"version":"f170fd125ed7105ba874e0eb88e83c6b1fb4614bdeeeabef89df883612bd0b79","affectsGlobalScope":true},"16d51f964ec125ad2024cf03f0af444b3bc3ec3614d9345cc54d09bab45c9a4c","ba601641fac98c229ccd4a303f747de376d761babb33229bb7153bed9356c9cc",{"version":"d2f7baf43dfa349d4010cbd9d64d84cdf3ec26c65fa5f44c8f74f052bedd0b49","affectsGlobalScope":true},"84e3bbd6f80983d468260fdbfeeb431cc81f7ea98d284d836e4d168e36875e86","0b85cb069d0e427ba946e5eb2d86ef65ffd19867042810516d16919f6c1a5aec","15c88bfd1b8dc7231ff828ae8df5d955bae5ebca4cf2bcb417af5821e52299ae","be00321090ed100e3bd1e566c0408004137e73feb19d6380eba57d68519ff6c5","0359682c54e487c4cab2b53b2b4d35cc8dea4d9914bc6abcdb5701f8b8e745a4","96d14f21b7652903852eef49379d04dbda28c16ed36468f8c9fa08f7c14c9538","e5dd317ef2c7a2882b152337b03d592fafa8351b40351849a16a908b198bd3b5","675e702f2032766a91eeadee64f51014c64688525da99dccd8178f0c599f13a8","fe4a2042d087990ebfc7dc0142d5aaf5a152e4baea86b45f283f103ec1e871ea","d88a479cccf787b4aa82362150fbeba5211a32dbfafa7b92ba6995ecaf9a1a89","187119ff4f9553676a884e296089e131e8cc01691c546273b1d0089c3533ce42","c24ad9be9adf28f0927e3d9d9e9cec1c677022356f241ccbbfb97bfe8fb3d1a1","0ec0998e2d085e8ea54266f547976ae152c9dd6cdb9ac4d8a520a230f5ebae84","9364c7566b0be2f7b70ff5285eb34686f83ccb01bda529b82d23b2a844653bfb","00baffbe8a2f2e4875367479489b5d43b5fc1429ecb4a4cc98cfc3009095f52a","ae9930989ed57478eb03b9b80ad3efa7a3eacdfeff0f78ecf7894c4963a64f93","3c92b6dfd43cc1c2485d9eba5ff0b74a19bb8725b692773ef1d66dac48cda4bd","3e59f00ab03c33717b3130066d4debb272da90eeded4935ff0604c2bc25a5cae","6ac6f24aff52e62c3950461aa17eab26e3a156927858e6b654baef0058b4cd1e",{"version":"0714e2046df66c0e93c3330d30dbc0565b3e8cd3ee302cf99e4ede6220e5fec8","affectsGlobalScope":true},"8841e2aa774b89bd23302dede20663306dc1b9902431ac64b24be8b8d0e3f649","209e814e8e71aec74f69686a9506dd7610b97ab59dcee9446266446f72a76d05",{"version":"5f186a758a616c107c70e8918db4630d063bd782f22e6e0b17573b125765b40b","affectsGlobalScope":true},"6fa0008bf91a4cc9c8963bace4bba0bd6865cbfa29c3e3ccc461155660fb113a","5e03940534e2cfe6d971abfdda33326663c1c0788eac583874fea43bcae165f4","2b8264b2fefd7367e0f20e2c04eed5d3038831fe00f5efbc110ff0131aab899b","a440a1b0129449cdc6fa715d1998bcd5e914fec1e68b076a4230d71524561d48",{"version":"4f0ad52a7fbd6bfba88ec22ec719b6956a0fc647030462f9db490e74236d116f","affectsGlobalScope":true},"95d085761c8e8d469a9066a9cc7bd4b5bc671098d2f8442ae657fb35b3215cf1","67483628398336d0f9368578a9514bd8cc823a4f3b3ab784f3942077e5047335"],"options":{"composite":true,"declaration":true,"emitDecoratorMetadata":true,"esModuleInterop":true,"exactOptionalPropertyTypes":true,"experimentalDecorators":true,"module":99,"noFallthroughCasesInSwitch":true,"noImplicitReturns":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./esm","rootDir":"../src","skipLibCheck":false,"sourceMap":true,"strict":true,"target":4},"fileIdsList":[[79,104,111,143],[55,104],[104],[79,104,111],[76,79,104,111,147,148],[104,144,148,149,151],[76,93,100,104,111],[104,111],[104,157,159,160,161,162,163,164,165,166,167,168,169],[104,157,158,160,161,162,163,164,165,166,167,168,169],[104,158,159,160,161,162,163,164,165,166,167,168,169],[104,157,158,159,161,162,163,164,165,166,167,168,169],[104,157,158,159,160,162,163,164,165,166,167,168,169],[104,157,158,159,160,161,163,164,165,166,167,168,169],[104,157,158,159,160,161,162,164,165,166,167,168,169],[104,157,158,159,160,161,162,163,165,166,167,168,169],[104,157,158,159,160,161,162,163,164,166,167,168,169],[104,157,158,159,160,161,162,163,164,165,167,168,169],[104,157,158,159,160,161,162,163,164,165,166,168,169],[104,157,158,159,160,161,162,163,164,165,166,167,169],[104,157,158,159,160,161,162,163,164,165,166,167,168],[61,104],[64,104],[65,70,104],[66,76,77,84,93,103,104],[66,67,76,84,104],[68,104],[69,70,77,85,104],[70,93,100,104],[71,73,76,84,104],[72,104],[73,74,104],[75,76,104],[76,104],[76,77,78,93,103,104],[76,77,78,93,104],[79,84,93,103,104],[76,77,79,80,84,93,100,103,104],[79,81,93,100,103,104],[61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97,98,99,100,101,102,103,104,105,106,107,108,109,110],[76,82,104],[83,103,104],[73,76,84,93,104],[85,104],[86,104],[64,87,104],[88,102,104,108],[89,104],[90,104],[76,91,104],[91,92,104,106],[76,93,94,95,104],[93,95,104],[93,94,104],[96,104],[97,104],[76,98,99,104],[98,99,104],[70,84,100,104],[101,104],[84,102,104],[65,79,90,103,104],[70,104],[93,104,105],[104,106],[104,107],[65,70,76,78,87,93,103,104,106,108],[93,104,109],[79,104,111,150],[55,58,104],[57,104],[104,112,113,114,115,116,117,118,119,120,122,123,124,125,126,127,128,129,130,131,132,133,134,135],[103,104,118,122],[93,103,104,118],[103,104,116,118,122],[100,103,104,115,118],[84,100,104],[84,103,104,115,118],[60,65,76,79,93,103,104,114,117],[79,104,116],[65,96,103,104,111,114,118],[65,104,111],[104,111,112,113],[104,118],[104,118,125,126],[104,116,118,126,127],[104,117],[79,104,113,118],[104,118,122,126,127],[104,122],[103,104,116,118,121],[100,104,118,125],[65,93,104],[42,104],[42,44,45,104],[43,104],[51,104],[45,47,48,104],[47,49,50,104],[42,43,47,104],[42,43,44,45,46,47,48,49,50,52,53,104],[54,55,56,58,103,104,136,140],[54,104,137,138,139],[54,104],[104,137,138,139,140],[104,137],[137,139],[54],[137]],"referencedMap":[[144,1],[145,2],[55,3],[143,4],[146,3],[149,5],[152,6],[153,7],[154,3],[155,3],[156,8],[158,9],[159,10],[157,11],[160,12],[161,13],[162,14],[163,15],[164,16],[165,17],[166,18],[167,19],[168,20],[169,21],[150,3],[170,3],[171,3],[172,3],[61,22],[62,22],[64,23],[65,24],[66,25],[67,26],[68,27],[69,28],[70,29],[71,30],[72,31],[73,32],[74,32],[75,33],[76,34],[77,35],[78,36],[63,3],[110,3],[79,37],[80,38],[81,39],[111,40],[82,41],[83,42],[84,43],[85,44],[86,45],[87,46],[88,47],[89,48],[90,49],[91,50],[92,51],[93,52],[95,53],[94,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[107,66],[108,67],[109,68],[173,3],[174,3],[175,3],[148,3],[147,3],[151,69],[176,3],[177,70],[58,71],[57,3],[178,3],[179,8],[59,3],[56,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[136,72],[125,73],[132,74],[124,75],[116,76],[115,77],[134,78],[118,79],[117,80],[113,81],[112,82],[133,82],[114,83],[119,84],[120,3],[123,84],[135,84],[127,85],[128,86],[130,87],[126,88],[129,89],[121,90],[122,91],[131,92],[60,93],[43,94],[44,3],[46,95],[42,3],[47,96],[45,96],[52,97],[53,97],[50,3],[49,98],[51,99],[48,100],[54,101],[141,102],[140,103],[137,104],[138,3],[142,105],[139,106]],"exportedModulesMap":[[144,1],[145,2],[55,3],[143,4],[146,3],[149,5],[152,6],[153,7],[154,3],[155,3],[156,8],[158,9],[159,10],[157,11],[160,12],[161,13],[162,14],[163,15],[164,16],[165,17],[166,18],[167,19],[168,20],[169,21],[150,3],[170,3],[171,3],[172,3],[61,22],[62,22],[64,23],[65,24],[66,25],[67,26],[68,27],[69,28],[70,29],[71,30],[72,31],[73,32],[74,32],[75,33],[76,34],[77,35],[78,36],[63,3],[110,3],[79,37],[80,38],[81,39],[111,40],[82,41],[83,42],[84,43],[85,44],[86,45],[87,46],[88,47],[89,48],[90,49],[91,50],[92,51],[93,52],[95,53],[94,54],[96,55],[97,56],[98,57],[99,58],[100,59],[101,60],[102,61],[103,62],[104,63],[105,64],[106,65],[107,66],[108,67],[109,68],[173,3],[174,3],[175,3],[148,3],[147,3],[151,69],[176,3],[177,70],[58,71],[57,3],[178,3],[179,8],[59,3],[56,3],[8,3],[10,3],[9,3],[2,3],[11,3],[12,3],[13,3],[14,3],[15,3],[16,3],[17,3],[18,3],[3,3],[4,3],[22,3],[19,3],[20,3],[21,3],[23,3],[24,3],[25,3],[5,3],[26,3],[27,3],[28,3],[29,3],[6,3],[30,3],[31,3],[32,3],[33,3],[7,3],[34,3],[39,3],[40,3],[35,3],[36,3],[37,3],[38,3],[1,3],[41,3],[136,72],[125,73],[132,74],[124,75],[116,76],[115,77],[134,78],[118,79],[117,80],[113,81],[112,82],[133,82],[114,83],[119,84],[120,3],[123,84],[135,84],[127,85],[128,86],[130,87],[126,88],[129,89],[121,90],[122,91],[131,92],[60,93],[43,94],[44,3],[46,95],[42,3],[47,96],[45,96],[52,97],[53,97],[50,3],[49,98],[51,99],[48,100],[54,101],[140,107],[137,108],[142,105],[139,109]],"semanticDiagnosticsPerFile":[144,145,55,143,146,149,152,153,154,155,156,158,159,157,160,161,162,163,164,165,166,167,168,169,150,170,171,172,61,62,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,63,110,79,80,81,111,82,83,84,85,86,87,88,89,90,91,92,93,95,94,96,97,98,99,100,101,102,103,104,105,106,107,108,109,173,174,175,148,147,151,176,177,58,57,178,179,59,56,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,34,39,40,35,36,37,38,1,41,136,125,132,124,116,115,134,118,117,113,112,133,114,119,120,123,135,127,128,130,126,129,121,122,131,60,43,44,46,42,47,45,52,53,50,49,51,48,54,141,140,137,138,142,139]},"version":"4.7.4"}
package/package.json ADDED
@@ -0,0 +1,55 @@
1
+ {
2
+ "name": "@voiceflow/fetch",
3
+ "description": "Voiceflow fetch wrapper and error handling for SDKs",
4
+ "version": "1.1.0",
5
+ "author": "Voiceflow",
6
+ "bugs": {
7
+ "url": "https://github.com/voiceflow/libs/issues"
8
+ },
9
+ "devDependencies": {
10
+ "@voiceflow/exception": "1.1.0",
11
+ "fetch-mock": "^9.11.0",
12
+ "undici": "5.12.0"
13
+ },
14
+ "files": [
15
+ "build"
16
+ ],
17
+ "homepage": "https://github.com/voiceflow/libs#readme",
18
+ "keywords": [
19
+ "voiceflow"
20
+ ],
21
+ "license": "ISC",
22
+ "main": "build/cjs/main.js",
23
+ "module": "build/esm/main.js",
24
+ "peerDependencies": {
25
+ "@voiceflow/exception": "^1"
26
+ },
27
+ "publishConfig": {
28
+ "access": "public",
29
+ "types": "build/cjs/main.d.ts"
30
+ },
31
+ "repository": {
32
+ "type": "git",
33
+ "url": "git+https://github.com/voiceflow/libs.git"
34
+ },
35
+ "scripts": {
36
+ "build": "yarn clean && yarn build:cjs && yarn build:esm",
37
+ "build:cjs": "ttsc --build tsconfig.build.json",
38
+ "build:esm": "ttsc --build tsconfig.esm.json",
39
+ "clean": "rimraf build",
40
+ "commit": "cz",
41
+ "lint": "eslint '**/*.{js,ts}'",
42
+ "lint:fix": "yarn lint --fix",
43
+ "lint:quiet": "yarn lint --quiet",
44
+ "lint:report": "eslint-output --quiet '**/*.{js,ts}'",
45
+ "tdd": "yarn test --watch",
46
+ "test": "yarn test:run",
47
+ "test:dependencies": "depcheck",
48
+ "test:integration": "yarn test:run",
49
+ "test:run": "NODE_ENV=test nyc ts-mocha --paths --config config/test/mocharc.yml 'src/**/*.test.ts'",
50
+ "test:single": "NODE_ENV=test ts-mocha --paths --config config/test/mocharc.yml",
51
+ "test:unit": "yarn test:run"
52
+ },
53
+ "types": "build/cjs/main.d.ts",
54
+ "gitHead": "3f260381b819de634ef44fb7d82b5db63f27e02a"
55
+ }