@nativescript/core 9.0.18-next.3 → 9.0.18-next.4

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 (32) hide show
  1. package/http/http-interfaces.d.ts +9 -10
  2. package/http/http-interfaces.js.map +1 -1
  3. package/http/http-request/http-request-common.d.ts +1 -0
  4. package/http/http-request/http-request-common.js +8 -0
  5. package/http/http-request/http-request-common.js.map +1 -1
  6. package/http/http-request/index.android.d.ts +1 -2
  7. package/http/http-request/index.android.js +54 -260
  8. package/http/http-request/index.android.js.map +1 -1
  9. package/http/http-request/index.d.ts +1 -1
  10. package/http/http-request/index.ios.d.ts +1 -2
  11. package/http/http-request/index.ios.js +35 -214
  12. package/http/http-request/index.ios.js.map +1 -1
  13. package/http/http-request-internal/http-request-internal-common.d.ts +2 -0
  14. package/http/http-request-internal/http-request-internal-common.js +12 -0
  15. package/http/http-request-internal/http-request-internal-common.js.map +1 -0
  16. package/http/http-request-internal/index.android.d.ts +4 -0
  17. package/http/http-request-internal/index.android.js +204 -0
  18. package/http/http-request-internal/index.android.js.map +1 -0
  19. package/http/http-request-internal/index.d.ts +28 -0
  20. package/http/http-request-internal/index.ios.d.ts +4 -0
  21. package/http/http-request-internal/index.ios.js +181 -0
  22. package/http/http-request-internal/index.ios.js.map +1 -0
  23. package/http/index.d.ts +1 -1
  24. package/http/index.js.map +1 -1
  25. package/image-source/index.android.js +2 -2
  26. package/image-source/index.android.js.map +1 -1
  27. package/image-source/index.ios.js +2 -2
  28. package/image-source/index.ios.js.map +1 -1
  29. package/package.json +1 -1
  30. package/http/http-shared.d.ts +0 -3
  31. package/http/http-shared.js +0 -2
  32. package/http/http-shared.js.map +0 -1
@@ -1,5 +1,6 @@
1
1
  import type { ImageSource } from '../image-source';
2
2
  import type { File } from '../file-system';
3
+ import type { BaseHttpContent } from './http-request-internal';
3
4
  /**
4
5
  * Provides options for the http requests.
5
6
  */
@@ -32,7 +33,7 @@ export interface HttpRequestOptions {
32
33
  /**
33
34
  * Encapsulates HTTP-response information from an HTTP-request.
34
35
  */
35
- export interface HttpResponse {
36
+ export interface HttpResponse<T = HttpContent> {
36
37
  /**
37
38
  * Gets the response status code.
38
39
  */
@@ -44,7 +45,7 @@ export interface HttpResponse {
44
45
  /**
45
46
  * Gets the response content.
46
47
  */
47
- content?: HttpContent;
48
+ content?: T;
48
49
  }
49
50
  export type Headers = {
50
51
  [key: string]: string | string[];
@@ -53,14 +54,7 @@ export declare enum HttpResponseEncoding {
53
54
  UTF8 = 0,
54
55
  GBK = 1
55
56
  }
56
- /**
57
- * Encapsulates the content of an HttpResponse.
58
- */
59
- export interface HttpContent {
60
- /**
61
- * Gets the response body as raw data.
62
- */
63
- raw: any;
57
+ export interface HttpContentHandler {
64
58
  /**
65
59
  * Gets the response body as ArrayBuffer
66
60
  */
@@ -82,3 +76,8 @@ export interface HttpContent {
82
76
  */
83
77
  toFile: (destinationFilePath?: string) => File;
84
78
  }
79
+ /**
80
+ * Encapsulates the content of an HttpResponse.
81
+ */
82
+ export interface HttpContent extends HttpContentHandler, BaseHttpContent {
83
+ }
@@ -1 +1 @@
1
- {"version":3,"file":"http-interfaces.js","sourceRoot":"","sources":["../../../../packages/core/http/http-interfaces.ts"],"names":[],"mappings":"AA4DA,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC/B,+DAAI,CAAA;IACJ,6DAAG,CAAA;AACJ,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
1
+ {"version":3,"file":"http-interfaces.js","sourceRoot":"","sources":["../../../../packages/core/http/http-interfaces.ts"],"names":[],"mappings":"AA6DA,MAAM,CAAN,IAAY,oBAGX;AAHD,WAAY,oBAAoB;IAC/B,+DAAI,CAAA;IACJ,6DAAG,CAAA;AACJ,CAAC,EAHW,oBAAoB,KAApB,oBAAoB,QAG/B"}
@@ -1 +1,2 @@
1
1
  export declare function getFilenameFromUrl(url: string): string;
2
+ export declare function parseJSON(source: string): any;
@@ -12,4 +12,12 @@ export function getFilenameFromUrl(url) {
12
12
  const result = path.join(knownFolders.documents().path, actualFileName);
13
13
  return result;
14
14
  }
15
+ export function parseJSON(source) {
16
+ const src = source.trim();
17
+ const lastIndex = src.lastIndexOf(')');
18
+ if (lastIndex === src.length - 1) {
19
+ return JSON.parse(src.substring(src.indexOf('(') + 1, lastIndex));
20
+ }
21
+ return JSON.parse(src);
22
+ }
15
23
  //# sourceMappingURL=http-request-common.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"http-request-common.js","sourceRoot":"","sources":["../../../../../packages/core/http/http-request/http-request-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAE7C,IAAI,cAAsB,CAAC;IAC3B,IAAI,eAAe,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5B,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACP,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC;AACf,CAAC"}
1
+ {"version":3,"file":"http-request-common.js","sourceRoot":"","sources":["../../../../../packages/core/http/http-request/http-request-common.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,YAAY,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AAEvD,MAAM,UAAU,kBAAkB,CAAC,GAAW;IAC7C,MAAM,QAAQ,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,GAAG,CAAC,CAAC;IAC1C,MAAM,eAAe,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAE7C,IAAI,cAAsB,CAAC;IAC3B,IAAI,eAAe,KAAK,CAAC,CAAC,EAAE,CAAC;QAC5B,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,EAAE,eAAe,CAAC,CAAC;IAC3D,CAAC;SAAM,CAAC;QACP,cAAc,GAAG,GAAG,CAAC,SAAS,CAAC,QAAQ,CAAC,CAAC;IAC1C,CAAC;IAED,MAAM,MAAM,GAAG,IAAI,CAAC,IAAI,CAAC,YAAY,CAAC,SAAS,EAAE,CAAC,IAAI,EAAE,cAAc,CAAC,CAAC;IAExE,OAAO,MAAM,CAAC;AACf,CAAC;AAED,MAAM,UAAU,SAAS,CAAC,MAAc;IACvC,MAAM,GAAG,GAAG,MAAM,CAAC,IAAI,EAAE,CAAC;IAC1B,MAAM,SAAS,GAAG,GAAG,CAAC,WAAW,CAAC,GAAG,CAAC,CAAC;IAEvC,IAAI,SAAS,KAAK,GAAG,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;QAClC,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,CAAC,OAAO,CAAC,GAAG,CAAC,GAAG,CAAC,EAAE,SAAS,CAAC,CAAC,CAAC;IACnE,CAAC;IAED,OAAO,IAAI,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC;AACxB,CAAC"}
@@ -1,3 +1,2 @@
1
- import type { Headers, HttpResponse, HttpRequestOptions } from '../../http';
1
+ import type { HttpResponse, HttpRequestOptions } from '../../http';
2
2
  export declare function request(options: HttpRequestOptions): Promise<HttpResponse>;
3
- export declare function addHeader(headers: Headers, key: string, value: string): void;
@@ -1,274 +1,68 @@
1
1
  import { ImageSource } from '../../image-source';
2
- import { Screen } from '../../platform/screen';
3
2
  import { File } from '../../file-system';
4
3
  import { HttpResponseEncoding } from '../http-interfaces';
5
- import { getFilenameFromUrl } from './http-request-common';
6
- import * as domainDebugger from '../../debugger';
7
- function parseJSON(source) {
8
- const src = source.trim();
9
- if (src.lastIndexOf(')') === src.length - 1) {
10
- return JSON.parse(src.substring(src.indexOf('(') + 1, src.lastIndexOf(')')));
11
- }
12
- return JSON.parse(src);
13
- }
14
- let requestIdCounter = 0;
15
- const pendingRequests = {};
16
- let debugRequests;
17
- if (__DEV__) {
18
- debugRequests = new Map();
19
- }
20
- let completeCallback;
21
- function ensureCompleteCallback() {
22
- if (completeCallback) {
23
- return;
24
- }
25
- completeCallback = new org.nativescript.widgets.Async.CompleteCallback({
26
- onComplete: function (result, context) {
27
- // as a context we will receive the id of the request
28
- onRequestComplete(context, result);
29
- },
30
- onError: function (error, context) {
31
- onRequestError(error, context);
32
- },
33
- });
34
- }
35
- function onRequestComplete(requestId, result) {
36
- const callbacks = pendingRequests[requestId];
37
- delete pendingRequests[requestId];
38
- if (result.error) {
39
- callbacks.rejectCallback(new Error(result.error.toString()));
40
- return;
41
- }
42
- // read the headers
43
- const headers = {};
44
- if (result.headers) {
45
- const jHeaders = result.headers;
46
- const length = jHeaders.size();
47
- let pair;
48
- for (let i = 0; i < length; i++) {
49
- pair = jHeaders.get(i);
50
- addHeader(headers, pair.key, pair.value);
4
+ import { requestInternal } from '../http-request-internal';
5
+ import { getFilenameFromUrl, parseJSON } from './http-request-common';
6
+ const contentHandler = {
7
+ toArrayBuffer() {
8
+ return Uint8Array.from(this.raw.toByteArray()).buffer;
9
+ },
10
+ toString(encoding) {
11
+ let str;
12
+ if (encoding) {
13
+ str = decodeResponse(this.raw, encoding);
51
14
  }
52
- }
53
- if (__DEV__) {
54
- const debugRequestInfo = debugRequests.get(requestId);
55
- if (debugRequestInfo) {
56
- const debugRequest = debugRequestInfo.debugRequest;
57
- let mime = (headers['Content-Type'] ?? 'text/plain');
58
- if (typeof mime === 'string') {
59
- mime = mime.split(';')[0] ?? 'text/plain';
60
- }
61
- debugRequest.mimeType = mime;
62
- debugRequest.data = result.raw;
63
- const debugResponse = {
64
- url: result.url,
65
- status: result.statusCode,
66
- statusText: result.statusText,
67
- headers: headers,
68
- mimeType: mime,
69
- fromDiskCache: false,
70
- timing: {
71
- requestTime: debugRequestInfo.timestamp,
72
- proxyStart: -1,
73
- proxyEnd: -1,
74
- dnsStart: -1,
75
- dnsEnd: -1,
76
- connectStart: -1,
77
- connectEnd: -1,
78
- sslStart: -1,
79
- sslEnd: -1,
80
- serviceWorkerFetchStart: -1,
81
- serviceWorkerFetchReady: -1,
82
- serviceWorkerFetchEnd: -1,
83
- sendStart: -1,
84
- sendEnd: -1,
85
- receiveHeadersEnd: -1,
86
- },
87
- };
88
- debugRequest.responseReceived(debugResponse);
89
- debugRequest.loadingFinished();
90
- debugRequests.delete(requestId);
15
+ else {
16
+ str = this.toNativeString(encoding);
91
17
  }
92
- }
93
- callbacks.resolveCallback({
94
- content: {
95
- raw: result.raw,
96
- toArrayBuffer: () => Uint8Array.from(result.raw.toByteArray()).buffer,
97
- toString: (encoding) => {
98
- let str;
99
- if (encoding) {
100
- str = decodeResponse(result.raw, encoding);
101
- }
102
- else {
103
- str = result.responseAsString;
104
- }
105
- if (typeof str === 'string') {
106
- return str;
107
- }
108
- else {
109
- throw new Error('Response content may not be converted to string');
110
- }
111
- },
112
- toJSON: (encoding) => {
113
- let str;
114
- if (encoding) {
115
- str = decodeResponse(result.raw, encoding);
116
- }
117
- else {
118
- str = result.responseAsString;
119
- }
120
- return parseJSON(str);
121
- },
122
- toImage: () => {
123
- return new Promise((resolveImage, rejectImage) => {
124
- if (result.responseAsImage != null) {
125
- resolveImage(new ImageSource(result.responseAsImage));
126
- }
127
- else {
128
- rejectImage(new Error('Response content may not be converted to an Image'));
129
- }
130
- });
131
- },
132
- toFile: (destinationFilePath) => {
133
- if (!destinationFilePath) {
134
- destinationFilePath = getFilenameFromUrl(callbacks.url);
135
- }
136
- let stream;
137
- try {
138
- // ensure destination path exists by creating any missing parent directories
139
- const file = File.fromPath(destinationFilePath);
140
- const javaFile = new java.io.File(destinationFilePath);
141
- stream = new java.io.FileOutputStream(javaFile);
142
- stream.write(result.raw.toByteArray());
143
- return file;
144
- }
145
- catch (exception) {
146
- throw new Error(`Cannot save file with path: ${destinationFilePath}.`);
147
- }
148
- finally {
149
- if (stream) {
150
- stream.close();
151
- }
152
- }
153
- },
154
- },
155
- statusCode: result.statusCode,
156
- headers: headers,
157
- });
158
- }
159
- function onRequestError(error, requestId) {
160
- const callbacks = pendingRequests[requestId];
161
- delete pendingRequests[requestId];
162
- if (callbacks) {
163
- callbacks.rejectCallback(new Error(error));
164
- }
165
- }
166
- function buildJavaOptions(options) {
167
- if (typeof options.url !== 'string') {
168
- throw new Error('Http request must provide a valid url.');
169
- }
170
- const javaOptions = new org.nativescript.widgets.Async.Http.RequestOptions();
171
- javaOptions.url = options.url;
172
- if (typeof options.method === 'string') {
173
- javaOptions.method = options.method;
174
- }
175
- if (typeof options.content === 'string' || options.content instanceof FormData) {
176
- const nativeString = new java.lang.String(options.content.toString());
177
- const nativeBytes = nativeString.getBytes('UTF-8');
178
- const nativeBuffer = java.nio.ByteBuffer.wrap(nativeBytes);
179
- javaOptions.content = nativeBuffer;
180
- }
181
- else if (options.content instanceof ArrayBuffer) {
182
- const typedArray = new Uint8Array(options.content);
183
- const nativeBuffer = java.nio.ByteBuffer.wrap(Array.from(typedArray));
184
- javaOptions.content = nativeBuffer;
185
- }
186
- if (typeof options.timeout === 'number') {
187
- javaOptions.timeout = options.timeout;
188
- }
189
- if (typeof options.dontFollowRedirects === 'boolean') {
190
- javaOptions.dontFollowRedirects = options.dontFollowRedirects;
191
- }
192
- if (options.headers) {
193
- const arrayList = new java.util.ArrayList();
194
- const pair = org.nativescript.widgets.Async.Http.KeyValuePair;
195
- for (const key in options.headers) {
196
- arrayList.add(new pair(key, options.headers[key] + ''));
18
+ if (typeof str === 'string') {
19
+ return str;
197
20
  }
198
- javaOptions.headers = arrayList;
199
- }
200
- // pass the maximum available image size to the request options in case we need a bitmap conversion
201
- javaOptions.screenWidth = Screen.mainScreen.widthPixels;
202
- javaOptions.screenHeight = Screen.mainScreen.heightPixels;
203
- return javaOptions;
204
- }
205
- export function request(options) {
206
- if (options === undefined || options === null) {
207
- // TODO: Shouldn't we throw an error here - defensive programming
208
- return;
209
- }
210
- return new Promise((resolve, reject) => {
21
+ else {
22
+ throw new Error('Response content may not be converted to string');
23
+ }
24
+ },
25
+ toJSON(encoding) {
26
+ let str;
27
+ if (encoding) {
28
+ str = decodeResponse(this.raw, encoding);
29
+ }
30
+ else {
31
+ str = this.toNativeString(encoding);
32
+ }
33
+ return parseJSON(str);
34
+ },
35
+ toImage() {
36
+ return this.toNativeImage().then((value) => new ImageSource(value));
37
+ },
38
+ toFile(destinationFilePath) {
39
+ if (!destinationFilePath) {
40
+ destinationFilePath = getFilenameFromUrl(this.requestURL);
41
+ }
42
+ let stream;
211
43
  try {
212
- // initialize the options
213
- const javaOptions = buildJavaOptions(options);
214
- // // send request data to network debugger
215
- // if (global.__inspector && global.__inspector.isConnected) {
216
- // NetworkAgent.requestWillBeSent(requestIdCounter, options);
217
- // }
218
- if (__DEV__) {
219
- const network = domainDebugger.getNetwork();
220
- const debugRequest = network && network.create();
221
- if (options.url && debugRequest) {
222
- const timestamp = Date.now() / 1000;
223
- debugRequests.set(requestIdCounter, {
224
- debugRequest,
225
- timestamp,
226
- });
227
- const request = {
228
- url: options.url,
229
- method: 'GET',
230
- headers: options.headers,
231
- timestamp,
232
- };
233
- debugRequest.requestWillBeSent(request);
234
- }
235
- }
236
- // remember the callbacks so that we can use them when the CompleteCallback is called
237
- const callbacks = {
238
- url: options.url,
239
- resolveCallback: resolve,
240
- rejectCallback: reject,
241
- };
242
- pendingRequests[requestIdCounter] = callbacks;
243
- ensureCompleteCallback();
244
- //make the actual async call
245
- org.nativescript.widgets.Async.Http.MakeRequest(javaOptions, completeCallback, new java.lang.Integer(requestIdCounter));
246
- // increment the id counter
247
- requestIdCounter++;
44
+ // ensure destination path exists by creating any missing parent directories
45
+ const file = File.fromPath(destinationFilePath);
46
+ const javaFile = new java.io.File(destinationFilePath);
47
+ stream = new java.io.FileOutputStream(javaFile);
48
+ stream.write(this.raw.toByteArray());
49
+ return file;
248
50
  }
249
- catch (ex) {
250
- reject(ex);
51
+ catch (exception) {
52
+ throw new Error(`Cannot save file with path: ${destinationFilePath}.`);
251
53
  }
252
- });
54
+ finally {
55
+ if (stream) {
56
+ stream.close();
57
+ }
58
+ }
59
+ },
60
+ };
61
+ export function request(options) {
62
+ return requestInternal(options, contentHandler);
253
63
  }
254
64
  function decodeResponse(raw, encoding) {
255
- let charsetName = 'UTF-8';
256
- if (encoding === HttpResponseEncoding.GBK) {
257
- charsetName = 'GBK';
258
- }
65
+ const charsetName = encoding === HttpResponseEncoding.GBK ? 'GBK' : 'UTF-8';
259
66
  return raw.toString(charsetName);
260
67
  }
261
- export function addHeader(headers, key, value) {
262
- if (!headers[key]) {
263
- headers[key] = value;
264
- }
265
- else if (Array.isArray(headers[key])) {
266
- headers[key].push(value);
267
- }
268
- else {
269
- const values = [headers[key]];
270
- values.push(value);
271
- headers[key] = values;
272
- }
273
- }
274
68
  //# sourceMappingURL=index.android.js.map
@@ -1 +1 @@
1
- {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/http/http-request/index.android.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,MAAM,EAAE,MAAM,uBAAuB,CAAC;AAC/C,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAE,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAC3D,OAAO,KAAK,cAAc,MAAM,gBAAgB,CAAC;AAEjD,SAAS,SAAS,CAAC,MAAc;IAChC,MAA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AAK,CAAC,CAAC;IACtC,CAAC;SAAM,CAAC;QACP,MAAM,MAAM,GAAa,CAAS,OAAO,CAAC,GAAG,CAAC,CAAC,CAAC;QAChD,MAAM,CAAC,IAAI,CAAC,KAAK,CAAC,CAAC;QACnB,OAAO,CAAC,GAAG,CAAC,GAAG,MAAM,CAAC;IACvB,CAAC;AACF,CAAC"}
1
+ {"version":3,"file":"index.android.js","sourceRoot":"","sources":["../../../../../packages/core/http/http-request/index.android.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,WAAW,EAAE,MAAM,oBAAoB,CAAC;AACjD,OAAO,EAAE,IAAI,EAAE,MAAM,mBAAmB,CAAC;AACzC,OAAO,EAAE,oBAAoB,EAAE,MAAM,oBAAoB,CAAC;AAC1D,OAAO,EAAmB,eAAe,EAAE,MAAM,0BAA0B,CAAC;AAC5E,OAAO,EAAE,kBAAkB,EAAE,SAAS,EAAE,MAAM,uBAAuB,CAAC;AAEtE,MAAM,cAAc,GAAuB;IAC1C,aAAa;QACZ,OAAO,UAAU,CAAC,IAAI,CAAE,IAAI,CAAC,GAAqC,CAAC,WAAW,EAAE,CAAC,CAAC,MAAM,CAAC;IAC1F,CAAC;IACD,QAAQ,CAAwB,QAA+B;QAC9D,IAAI,GAAW,CAAC;QAChB,IAAI,QAAQ,EAAE,CAAC;YACd,GAAG,GAAG,cAAc,CAAC,IAAI,CAAC,GAAoC,EAAE,QAAQ,CAAC,CAAC;QAC3E,CAAC;aAAM,CAAC;YACP,GAAG,GAAG,IAAI,CAAC,cAAc,CAAC,QAAQ,CAAC,CAAC;QACrC,CAAC;QACD,IAAI,OAAO,GAAG,KAAK,QAAQ,EAAE,CAAC;YAC7B,OAAO,GAAG,CAAC;QACZ,CAAC;aAAM,CAAC;YACP,MAAM,IAAI,KAAK,CAAC,iDAAiD,CAAC,CAAC;QACpE,CAAC;IACF,CAAC;IACD,MAAM,CAAwB,QAA+B;QAC5D,IAAI,GAAW,CAAC;QAChB,IAAI,QAAQ,EAAE,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,EAAE,cAAc,CAAC,CAAC;AACjD,CAAC;AAED,SAAS,cAAc,CAAC,GAAkC,EAAE,QAA+B;IAC1F,MAAM,WAAW,GAAG,QAAQ,KAAK,oBAAoB,CAAC,GAAG,CAAC,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,OAAO,CAAC;IAC5E,OAAO,GAAG,CAAC,QAAQ,CAAC,WAAW,CAAC,CAAC;AAClC,CAAC"}
@@ -1,7 +1,7 @@
1
1
  import { HttpRequestOptions, HttpResponse, Headers } from '../http-interfaces';
2
+
2
3
  /**
3
4
  * Makes a generic http request using the provided options and returns a HttpResponse Object.
4
5
  * @param options An object that specifies various request options.
5
6
  */
6
7
  export const request: (options: HttpRequestOptions) => Promise<HttpResponse>;
7
- export function addHeader(headers: Headers, key: string, value: string): void;
@@ -1,3 +1,2 @@
1
- import type { HttpRequestOptions, HttpResponse, Headers } from '../http-interfaces';
1
+ import type { HttpRequestOptions, HttpResponse } from '../http-interfaces';
2
2
  export declare function request(options: HttpRequestOptions): Promise<HttpResponse>;
3
- export declare function addHeader(headers: Headers, key: string, value: string): void;