@crawlee/http-client 4.0.0-beta.26 → 4.0.0-beta.261
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +15 -15
- package/base-http-client.d.ts +36 -8
- package/base-http-client.js +80 -23
- package/fetch-http-client.d.ts +6 -2
- package/fetch-http-client.js +9 -1
- package/index.d.ts +1 -2
- package/index.js +0 -1
- package/package.json +6 -6
- package/response.d.ts +2 -6
- package/response.js +0 -1
- package/base-http-client.d.ts.map +0 -1
- package/base-http-client.js.map +0 -1
- package/fetch-http-client.d.ts.map +0 -1
- package/fetch-http-client.js.map +0 -1
- package/index.d.ts.map +0 -1
- package/index.js.map +0 -1
- package/response.d.ts.map +0 -1
- package/response.js.map +0 -1
package/README.md
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
<h1 align="center">
|
|
2
2
|
<a href="https://crawlee.dev">
|
|
3
3
|
<picture>
|
|
4
|
-
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-dark.svg?sanitize=true"
|
|
5
|
-
<img alt="Crawlee" src="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-light.svg?sanitize=true" width="500"
|
|
4
|
+
<source media="(prefers-color-scheme: dark)" srcset="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-dark.svg?sanitize=true" />
|
|
5
|
+
<img alt="Crawlee" src="https://raw.githubusercontent.com/apify/crawlee/master/website/static/img/crawlee-light.svg?sanitize=true" width="500" />
|
|
6
6
|
</picture>
|
|
7
7
|
</a>
|
|
8
|
-
<br
|
|
8
|
+
<br />
|
|
9
9
|
<small>A web scraping and browser automation library</small>
|
|
10
10
|
</h1>
|
|
11
11
|
|
|
12
|
-
<p align=center>
|
|
13
|
-
<a href="https://trendshift.io/repositories/5179" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5179" alt="apify%2Fcrawlee | Trendshift"
|
|
12
|
+
<p align="center">
|
|
13
|
+
<a href="https://trendshift.io/repositories/5179" target="_blank"><img src="https://trendshift.io/api/badge/repositories/5179" alt="apify%2Fcrawlee | Trendshift" width="250" height="55"/></a>
|
|
14
14
|
</p>
|
|
15
15
|
|
|
16
|
-
<p align=center>
|
|
17
|
-
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/v/@crawlee/core.svg" alt="NPM latest version" data-canonical-src="https://img.shields.io/npm/v/@crawlee/core/next.svg"
|
|
18
|
-
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/dm/@crawlee/core.svg" alt="Downloads" data-canonical-src="https://img.shields.io/npm/dm/@crawlee/core.svg"
|
|
19
|
-
<a href="https://discord.gg/jyEM2PRvMU" rel="nofollow"><img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on discord" data-canonical-src="https://img.shields.io/discord/801163717915574323?label=discord"
|
|
20
|
-
<a href="https://github.com/apify/crawlee/actions/workflows/test-ci.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-ci.yml/badge.svg?branch=master" alt="Build Status"
|
|
16
|
+
<p align="center">
|
|
17
|
+
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/v/@crawlee/core.svg" alt="NPM latest version" data-canonical-src="https://img.shields.io/npm/v/@crawlee/core/next.svg" /></a>
|
|
18
|
+
<a href="https://www.npmjs.com/package/@crawlee/core" rel="nofollow"><img src="https://img.shields.io/npm/dm/@crawlee/core.svg" alt="Downloads" data-canonical-src="https://img.shields.io/npm/dm/@crawlee/core.svg" /></a>
|
|
19
|
+
<a href="https://discord.gg/jyEM2PRvMU" rel="nofollow"><img src="https://img.shields.io/discord/801163717915574323?label=discord" alt="Chat on discord" data-canonical-src="https://img.shields.io/discord/801163717915574323?label=discord" /></a>
|
|
20
|
+
<a href="https://github.com/apify/crawlee/actions/workflows/test-ci.yml"><img src="https://github.com/apify/crawlee/actions/workflows/test-ci.yml/badge.svg?branch=master" alt="Build Status" /></a>
|
|
21
21
|
</p>
|
|
22
22
|
|
|
23
23
|
Crawlee covers your crawling and scraping end-to-end and **helps you build reliable scrapers. Fast.**
|
|
@@ -34,7 +34,7 @@ Crawlee is available as the [`crawlee`](https://www.npmjs.com/package/crawlee) N
|
|
|
34
34
|
|
|
35
35
|
We recommend visiting the [Introduction tutorial](https://crawlee.dev/js/docs/introduction) in Crawlee documentation for more information.
|
|
36
36
|
|
|
37
|
-
> Crawlee requires **Node.js
|
|
37
|
+
> Crawlee requires **Node.js 22.13 or higher**.
|
|
38
38
|
|
|
39
39
|
### With Crawlee CLI
|
|
40
40
|
|
|
@@ -89,7 +89,7 @@ By default, Crawlee stores data to `./storage` in the current working directory.
|
|
|
89
89
|
We provide automated beta builds for every merged code change in Crawlee. You can find them in the npm [list of releases](https://www.npmjs.com/package/crawlee?activeTab=versions). If you want to test new features or bug fixes before we release them, feel free to install a beta build like this:
|
|
90
90
|
|
|
91
91
|
```bash
|
|
92
|
-
npm install crawlee@
|
|
92
|
+
npm install crawlee@next
|
|
93
93
|
```
|
|
94
94
|
|
|
95
95
|
If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need to specify dependency overrides in your `package.json` file so that you don't end up with multiple versions of Crawlee installed:
|
|
@@ -98,9 +98,9 @@ If you also use the [Apify SDK](https://github.com/apify/apify-sdk-js), you need
|
|
|
98
98
|
{
|
|
99
99
|
"overrides": {
|
|
100
100
|
"apify": {
|
|
101
|
-
"@crawlee/core": "
|
|
102
|
-
"@crawlee/types": "
|
|
103
|
-
"@crawlee/utils": "
|
|
101
|
+
"@crawlee/core": "$crawlee",
|
|
102
|
+
"@crawlee/types": "$crawlee",
|
|
103
|
+
"@crawlee/utils": "$crawlee"
|
|
104
104
|
}
|
|
105
105
|
}
|
|
106
106
|
}
|
package/base-http-client.d.ts
CHANGED
|
@@ -1,6 +1,37 @@
|
|
|
1
|
-
import type { BaseHttpClient as BaseHttpClientInterface, SendRequestOptions } from '@crawlee/types';
|
|
1
|
+
import type { BaseHttpClient as BaseHttpClientInterface, CookieJar, CrawleeLogger, SendRequestOptions, SessionFingerprint } from '@crawlee/types';
|
|
2
|
+
/**
|
|
3
|
+
* Per-request options handed to a concrete client's `fetch` implementation.
|
|
4
|
+
*/
|
|
2
5
|
export interface CustomFetchOptions {
|
|
6
|
+
/**
|
|
7
|
+
* Effective proxy URL for this request. `sendRequest` populates this from
|
|
8
|
+
* the explicit `SendRequestOptions.proxyUrl` override when set, falling back
|
|
9
|
+
* to `session.proxyInfo.url`.
|
|
10
|
+
*/
|
|
3
11
|
proxyUrl?: string;
|
|
12
|
+
/**
|
|
13
|
+
* Effective cookie jar for this request. `sendRequest` populates this from
|
|
14
|
+
* the explicit `SendRequestOptions.cookieJar` override when set, falling
|
|
15
|
+
* back to `session.cookieJar` (or a fresh jar when neither is provided).
|
|
16
|
+
*/
|
|
17
|
+
cookieJar?: CookieJar;
|
|
18
|
+
/**
|
|
19
|
+
* Hints about which browser-like setup this request should be impersonating —
|
|
20
|
+
* `browser`, `platform`, `device`, and an opaque `details` slot for richer
|
|
21
|
+
* payloads (e.g. a full browser fingerprint from `fingerprint-generator`).
|
|
22
|
+
* These are *suggestions*, not requirements: each client applies what it can
|
|
23
|
+
* (e.g. impit maps `browser` to its impersonation profile) and ignores the
|
|
24
|
+
* rest on a best-effort basis. Sourced from `SendRequestOptions.session.fingerprint`.
|
|
25
|
+
*/
|
|
26
|
+
fingerprint?: SessionFingerprint;
|
|
27
|
+
/**
|
|
28
|
+
* When `true`, TLS certificate errors should be ignored for this request.
|
|
29
|
+
* Set when `SendRequestOptions.ignoreTlsErrors` is passed (e.g. from the
|
|
30
|
+
* `ignoreTlsErrors` crawler option) or when the session's proxy is a MITM
|
|
31
|
+
* proxy (`session.proxyInfo.ignoreTlsErrors`). Best-effort: clients that
|
|
32
|
+
* cannot disable TLS verification ignore it.
|
|
33
|
+
*/
|
|
34
|
+
ignoreTlsErrors?: boolean;
|
|
4
35
|
}
|
|
5
36
|
/**
|
|
6
37
|
* Base HTTP client that provides fetch-like `sendRequest` with Crawlee-managed
|
|
@@ -8,20 +39,17 @@ export interface CustomFetchOptions {
|
|
|
8
39
|
* implement only the low-level network call in `fetch`.
|
|
9
40
|
*/
|
|
10
41
|
export declare abstract class BaseHttpClient implements BaseHttpClientInterface {
|
|
42
|
+
#private;
|
|
43
|
+
constructor(options?: {
|
|
44
|
+
logger?: CrawleeLogger;
|
|
45
|
+
});
|
|
11
46
|
/**
|
|
12
47
|
* Perform the raw network request and return a single Response without any
|
|
13
48
|
* automatic redirect following or special error handling.
|
|
14
49
|
*/
|
|
15
50
|
protected abstract fetch(input: Request, init?: RequestInit & CustomFetchOptions): Promise<Response>;
|
|
16
|
-
private applyCookies;
|
|
17
|
-
private setCookies;
|
|
18
|
-
private resolveRequestContext;
|
|
19
|
-
private createAbortSignal;
|
|
20
|
-
private isRedirect;
|
|
21
|
-
private buildRedirectRequest;
|
|
22
51
|
/**
|
|
23
52
|
* Public fetch-like method that handles redirects and uses provided proxy and cookie jar.
|
|
24
53
|
*/
|
|
25
54
|
sendRequest(initialRequest: Request, options?: SendRequestOptions): Promise<Response>;
|
|
26
55
|
}
|
|
27
|
-
//# sourceMappingURL=base-http-client.d.ts.map
|
package/base-http-client.js
CHANGED
|
@@ -1,35 +1,82 @@
|
|
|
1
|
-
import { CookieJar } from 'tough-cookie';
|
|
2
1
|
/**
|
|
3
2
|
* Base HTTP client that provides fetch-like `sendRequest` with Crawlee-managed
|
|
4
3
|
* behaviors (redirect handling, proxy and cookie handling). Concrete clients
|
|
5
4
|
* implement only the low-level network call in `fetch`.
|
|
6
5
|
*/
|
|
7
6
|
export class BaseHttpClient {
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
7
|
+
#log;
|
|
8
|
+
constructor(options) {
|
|
9
|
+
this.#log = options?.logger;
|
|
10
|
+
}
|
|
11
|
+
async #applyCookies(request, cookieJar) {
|
|
12
|
+
try {
|
|
13
|
+
const requestCookies = request.headers.get('cookie') ?? '';
|
|
14
|
+
if (!requestCookies) {
|
|
15
|
+
// Fast path: no header cookies, use the jar directly.
|
|
16
|
+
const cookieString = await cookieJar.getCookieString(request.url);
|
|
17
|
+
if (cookieString) {
|
|
18
|
+
request.headers.set('cookie', cookieString);
|
|
19
|
+
}
|
|
20
|
+
return request;
|
|
21
|
+
}
|
|
22
|
+
// Merge jar cookies with request Cookie header. Clone the jar so we
|
|
23
|
+
// don't persist the header-only cookies into the session.
|
|
24
|
+
const merged = await cookieJar.clone();
|
|
25
|
+
await Promise.all(requestCookies
|
|
26
|
+
.split(/; */)
|
|
27
|
+
.filter(Boolean)
|
|
28
|
+
.map((pair) => merged.setCookie(pair, request.url)));
|
|
29
|
+
const cookieString = await merged.getCookieString(request.url);
|
|
30
|
+
if (cookieString) {
|
|
31
|
+
request.headers.set('cookie', cookieString);
|
|
32
|
+
}
|
|
33
|
+
}
|
|
34
|
+
catch (e) {
|
|
35
|
+
this.#log?.warning(`Failed to get cookies for URL "${request.url}": ${e.message}`);
|
|
12
36
|
}
|
|
13
37
|
return request;
|
|
14
38
|
}
|
|
15
|
-
async setCookies(response, cookieJar) {
|
|
39
|
+
async #setCookies(response, cookieJar) {
|
|
16
40
|
const setCookieHeaders = response.headers.getSetCookie();
|
|
17
|
-
|
|
41
|
+
for (const header of setCookieHeaders) {
|
|
42
|
+
try {
|
|
43
|
+
await cookieJar.setCookie(header, response.url);
|
|
44
|
+
}
|
|
45
|
+
catch (e) {
|
|
46
|
+
this.#log?.warning(`Failed to set cookie for URL "${response.url}": ${e.message}`);
|
|
47
|
+
}
|
|
48
|
+
}
|
|
18
49
|
}
|
|
19
|
-
resolveRequestContext(options) {
|
|
50
|
+
async #resolveRequestContext(options) {
|
|
20
51
|
const proxyUrl = options?.proxyUrl ?? options?.session?.proxyInfo?.url;
|
|
21
|
-
const cookieJar = options?.cookieJar ?? options?.session?.cookieJar ??
|
|
22
|
-
const
|
|
23
|
-
return {
|
|
52
|
+
const cookieJar = options?.cookieJar ?? options?.session?.cookieJar ?? (await this.#createDefaultCookieJar());
|
|
53
|
+
const signal = this.#createAbortSignal(options?.signal, options?.timeoutMillis);
|
|
54
|
+
return {
|
|
55
|
+
proxyUrl,
|
|
56
|
+
cookieJar,
|
|
57
|
+
signal,
|
|
58
|
+
fingerprint: options?.session?.fingerprint,
|
|
59
|
+
ignoreTlsErrors: options?.ignoreTlsErrors || options?.session?.proxyInfo?.ignoreTlsErrors,
|
|
60
|
+
};
|
|
61
|
+
}
|
|
62
|
+
async #createDefaultCookieJar() {
|
|
63
|
+
const { CookieJar: ToughCookieJar } = await import('tough-cookie');
|
|
64
|
+
return new ToughCookieJar();
|
|
24
65
|
}
|
|
25
|
-
createAbortSignal(
|
|
26
|
-
|
|
66
|
+
#createAbortSignal(signal, timeoutMillis) {
|
|
67
|
+
if (signal && timeoutMillis) {
|
|
68
|
+
return AbortSignal.any([signal, AbortSignal.timeout(timeoutMillis)]);
|
|
69
|
+
}
|
|
70
|
+
if (signal) {
|
|
71
|
+
return signal;
|
|
72
|
+
}
|
|
73
|
+
return timeoutMillis ? AbortSignal.timeout(timeoutMillis) : undefined;
|
|
27
74
|
}
|
|
28
|
-
isRedirect(response) {
|
|
75
|
+
#isRedirect(response) {
|
|
29
76
|
const status = response.status;
|
|
30
77
|
return status >= 300 && status < 400 && !!response.headers.get('location');
|
|
31
78
|
}
|
|
32
|
-
buildRedirectRequest(currentRequest, response, initialRequest) {
|
|
79
|
+
#buildRedirectRequest(currentRequest, response, initialRequest) {
|
|
33
80
|
const location = response.headers.get('location');
|
|
34
81
|
const nextUrl = new URL(location, response.url ?? currentRequest.url);
|
|
35
82
|
const prevMethod = (currentRequest.method ?? 'GET').toUpperCase();
|
|
@@ -46,12 +93,20 @@ export class BaseHttpClient {
|
|
|
46
93
|
}
|
|
47
94
|
const nextHeaders = new Headers();
|
|
48
95
|
currentRequest.headers.forEach((value, key) => nextHeaders.set(key, value));
|
|
96
|
+
// Like native `fetch`, do not forward credentials to a different origin
|
|
97
|
+
if (nextUrl.origin !== new URL(currentRequest.url).origin) {
|
|
98
|
+
for (const header of ['authorization', 'proxy-authorization', 'cookie']) {
|
|
99
|
+
nextHeaders.delete(header);
|
|
100
|
+
}
|
|
101
|
+
}
|
|
49
102
|
return new Request(nextUrl.toString(), {
|
|
50
103
|
method: nextMethod,
|
|
51
104
|
headers: nextHeaders,
|
|
52
105
|
body: nextBody,
|
|
53
106
|
credentials: currentRequest.credentials,
|
|
54
107
|
redirect: 'manual',
|
|
108
|
+
// Node-specific option required for a stream body, which the replayed body always is
|
|
109
|
+
duplex: 'half',
|
|
55
110
|
});
|
|
56
111
|
}
|
|
57
112
|
/**
|
|
@@ -61,25 +116,27 @@ export class BaseHttpClient {
|
|
|
61
116
|
const maxRedirects = 10;
|
|
62
117
|
let currentRequest = initialRequest;
|
|
63
118
|
let redirectCount = 0;
|
|
64
|
-
const { proxyUrl, cookieJar,
|
|
119
|
+
const { proxyUrl, cookieJar, signal, fingerprint, ignoreTlsErrors } = await this.#resolveRequestContext(options);
|
|
65
120
|
currentRequest = initialRequest.clone();
|
|
66
121
|
while (true) {
|
|
67
|
-
|
|
68
|
-
const response = await this.fetch(currentRequest, {
|
|
69
|
-
signal
|
|
122
|
+
// Like `fetch`, set the jar cookies on a copy, so that the next redirect hop does not inherit them
|
|
123
|
+
const response = await this.fetch(await this.#applyCookies(new Request(currentRequest), cookieJar), {
|
|
124
|
+
signal,
|
|
70
125
|
proxyUrl,
|
|
126
|
+
cookieJar,
|
|
127
|
+
fingerprint,
|
|
128
|
+
ignoreTlsErrors,
|
|
71
129
|
redirect: 'manual',
|
|
72
130
|
});
|
|
73
|
-
await this
|
|
74
|
-
if (this
|
|
131
|
+
await this.#setCookies(response, cookieJar);
|
|
132
|
+
if (this.#isRedirect(response)) {
|
|
75
133
|
if (redirectCount++ >= maxRedirects) {
|
|
76
134
|
throw new Error(`Too many redirects (${maxRedirects}) while requesting ${currentRequest.url}`);
|
|
77
135
|
}
|
|
78
|
-
currentRequest = this
|
|
136
|
+
currentRequest = this.#buildRedirectRequest(currentRequest, response, initialRequest);
|
|
79
137
|
continue;
|
|
80
138
|
}
|
|
81
139
|
return response;
|
|
82
140
|
}
|
|
83
141
|
}
|
|
84
142
|
}
|
|
85
|
-
//# sourceMappingURL=base-http-client.js.map
|
package/fetch-http-client.d.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import type { CrawleeLogger } from '@crawlee/types';
|
|
1
2
|
import { BaseHttpClient, type CustomFetchOptions } from './base-http-client.js';
|
|
2
3
|
/**
|
|
3
4
|
* A HTTP client implementation using the native `fetch` API.
|
|
@@ -5,6 +6,9 @@ import { BaseHttpClient, type CustomFetchOptions } from './base-http-client.js';
|
|
|
5
6
|
* This implementation does not support proxying.
|
|
6
7
|
*/
|
|
7
8
|
export declare class FetchHttpClient extends BaseHttpClient {
|
|
8
|
-
|
|
9
|
+
#private;
|
|
10
|
+
constructor(options?: {
|
|
11
|
+
logger?: CrawleeLogger;
|
|
12
|
+
});
|
|
13
|
+
protected fetch(request: Request, options?: RequestInit & CustomFetchOptions): Promise<Response>;
|
|
9
14
|
}
|
|
10
|
-
//# sourceMappingURL=fetch-http-client.d.ts.map
|
package/fetch-http-client.js
CHANGED
|
@@ -5,8 +5,16 @@ import { BaseHttpClient } from './base-http-client.js';
|
|
|
5
5
|
* This implementation does not support proxying.
|
|
6
6
|
*/
|
|
7
7
|
export class FetchHttpClient extends BaseHttpClient {
|
|
8
|
+
#logger;
|
|
9
|
+
constructor(options) {
|
|
10
|
+
super(options);
|
|
11
|
+
this.#logger = options?.logger;
|
|
12
|
+
}
|
|
8
13
|
async fetch(request, options) {
|
|
14
|
+
if (options?.ignoreTlsErrors) {
|
|
15
|
+
this.#logger?.warningOnce('FetchHttpClient cannot disable TLS certificate verification, the `ignoreTlsErrors` option is ignored. ' +
|
|
16
|
+
'Install the optional @crawlee/impit-client dependency to make it work.');
|
|
17
|
+
}
|
|
9
18
|
return fetch(request, options);
|
|
10
19
|
}
|
|
11
20
|
}
|
|
12
|
-
//# sourceMappingURL=fetch-http-client.js.map
|
package/index.d.ts
CHANGED
|
@@ -1,4 +1,3 @@
|
|
|
1
1
|
export { BaseHttpClient, type CustomFetchOptions } from './base-http-client.js';
|
|
2
|
-
export { ResponseWithUrl
|
|
2
|
+
export { ResponseWithUrl } from './response.js';
|
|
3
3
|
export { FetchHttpClient } from './fetch-http-client.js';
|
|
4
|
-
//# sourceMappingURL=index.d.ts.map
|
package/index.js
CHANGED
package/package.json
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/http-client",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.261",
|
|
4
4
|
"description": "The scalable web crawling and scraping library for JavaScript/Node.js. Enables development of data extraction and web automation jobs (not only) with headless Chrome and Puppeteer.",
|
|
5
5
|
"engines": {
|
|
6
|
-
"node": ">=22.
|
|
6
|
+
"node": ">=22.13.0"
|
|
7
7
|
},
|
|
8
8
|
"type": "module",
|
|
9
9
|
"exports": {
|
|
@@ -38,7 +38,7 @@
|
|
|
38
38
|
},
|
|
39
39
|
"homepage": "https://crawlee.dev",
|
|
40
40
|
"scripts": {
|
|
41
|
-
"build": "
|
|
41
|
+
"build": "pnpm clean && pnpm compile && pnpm copy",
|
|
42
42
|
"clean": "rimraf ./dist",
|
|
43
43
|
"compile": "tsc -p tsconfig.build.json",
|
|
44
44
|
"copy": "tsx ../../scripts/copy.ts"
|
|
@@ -47,8 +47,8 @@
|
|
|
47
47
|
"access": "public"
|
|
48
48
|
},
|
|
49
49
|
"dependencies": {
|
|
50
|
-
"@crawlee/types": "4.0.0-beta.
|
|
51
|
-
"tough-cookie": "^6.0.
|
|
50
|
+
"@crawlee/types": "4.0.0-beta.261",
|
|
51
|
+
"tough-cookie": "^6.0.2"
|
|
52
52
|
},
|
|
53
53
|
"lerna": {
|
|
54
54
|
"command": {
|
|
@@ -57,5 +57,5 @@
|
|
|
57
57
|
}
|
|
58
58
|
}
|
|
59
59
|
},
|
|
60
|
-
"gitHead": "
|
|
60
|
+
"gitHead": "24e897c21c5f7ba19846bbca3eba4def5331a081"
|
|
61
61
|
}
|
package/response.d.ts
CHANGED
|
@@ -1,15 +1,11 @@
|
|
|
1
|
-
export interface IResponseWithUrl extends Response {
|
|
2
|
-
url: string;
|
|
3
|
-
}
|
|
4
1
|
/**
|
|
5
2
|
* A Response class that includes the original request URL.
|
|
6
3
|
*
|
|
7
4
|
* This class extends `Response` from `fetch` API and is fully compatible with this.
|
|
8
5
|
*/
|
|
9
|
-
export declare class ResponseWithUrl extends Response
|
|
10
|
-
url: string;
|
|
6
|
+
export declare class ResponseWithUrl extends Response {
|
|
7
|
+
readonly url: string;
|
|
11
8
|
constructor(body: BodyInit | null, init: ResponseInit & {
|
|
12
9
|
url?: string;
|
|
13
10
|
});
|
|
14
11
|
}
|
|
15
|
-
//# sourceMappingURL=response.d.ts.map
|
package/response.js
CHANGED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"base-http-client.d.ts","sourceRoot":"","sources":["../src/base-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,cAAc,IAAI,uBAAuB,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC;AAGpG,MAAM,WAAW,kBAAkB;IAC/B,QAAQ,CAAC,EAAE,MAAM,CAAC;CACrB;AAED;;;;GAIG;AACH,8BAAsB,cAAe,YAAW,uBAAuB;IACnE;;;OAGG;IACH,SAAS,CAAC,QAAQ,CAAC,KAAK,CAAC,KAAK,EAAE,OAAO,EAAE,IAAI,CAAC,EAAE,WAAW,GAAG,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;YAEtF,YAAY;YASZ,UAAU;IAMxB,OAAO,CAAC,qBAAqB;IAW7B,OAAO,CAAC,iBAAiB;IAIzB,OAAO,CAAC,UAAU;IA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,MAAM,IAAI,CAAC,UAAU,CAAC,QAAQ,EAAE,SAAS,CAAC,CAAC;YAE3C,IAAI,IAAI,CAAC,UAAU,CAAC,QAAQ,CAAC,EAAE,CAAC;gBAC5B,IAAI,aAAa,EAAE,IAAI,YAAY,EAAE,CAAC;oBAClC,MAAM,IAAI,KAAK,CAAC,uBAAuB,YAAY,sBAAsB,cAAc,CAAC,GAAG,EAAE,CAAC,CAAC;gBACnG,CAAC;gBACD,cAAc,GAAG,IAAI,CAAC,oBAAoB,CAAC,cAAc,EAAE,QAAQ,EAAE,cAAc,CAAC,CAAC;gBACrF,SAAS;YACb,CAAC;YAED,OAAO,QAAQ,CAAC;QACpB,CAAC;IACL,CAAC;CACJ"}
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-http-client.d.ts","sourceRoot":"","sources":["../src/fetch-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAEhF;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,cAAc;IAChC,KAAK,CAAC,OAAO,EAAE,OAAO,EAAE,OAAO,CAAC,EAAE,WAAW,GAAG,kBAAkB,GAAG,OAAO,CAAC,QAAQ,CAAC;CAGxG"}
|
package/fetch-http-client.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"fetch-http-client.js","sourceRoot":"","sources":["../src/fetch-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAEhF;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,cAAc;IACtC,KAAK,CAAC,KAAK,CAAC,OAAgB,EAAE,OAA0C;QAC7E,OAAO,KAAK,CAAC,OAAO,EAAE,OAAO,CAAC,CAAC;IACnC,CAAC;CACJ"}
|
package/index.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAAE,KAAK,kBAAkB,EAAE,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAE,KAAK,gBAAgB,EAAE,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
package/index.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,cAAc,EAA2B,MAAM,uBAAuB,CAAC;AAChF,OAAO,EAAE,eAAe,EAAyB,MAAM,eAAe,CAAC;AACvE,OAAO,EAAE,eAAe,EAAE,MAAM,wBAAwB,CAAC"}
|
package/response.d.ts.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response.d.ts","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,gBAAiB,SAAQ,QAAQ;IAC9C,GAAG,EAAE,MAAM,CAAC;CACf;AAKD;;;;GAIG;AACH,qBAAa,eAAgB,SAAQ,QAAS,YAAW,gBAAgB;IAC5D,GAAG,EAAE,MAAM,CAAC;gBACT,IAAI,EAAE,QAAQ,GAAG,IAAI,EAAE,IAAI,EAAE,YAAY,GAAG;QAAE,GAAG,CAAC,EAAE,MAAM,CAAA;KAAE;CAM3E"}
|
package/response.js.map
DELETED
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"response.js","sourceRoot":"","sources":["../src/response.ts"],"names":[],"mappings":"AAIA,mHAAmH;AACnH,MAAM,cAAc,GAAG,CAAC,GAAG,EAAE,GAAG,EAAE,GAAG,EAAE,GAAG,CAAC,CAAC;AAE5C;;;;GAIG;AACH,MAAM,OAAO,eAAgB,SAAQ,QAAQ;IAChC,GAAG,CAAS;IACrB,YAAY,IAAqB,EAAE,IAAqC;QACpE,MAAM,UAAU,GAAG,cAAc,CAAC,QAAQ,CAAC,IAAI,CAAC,MAAM,IAAI,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,CAAC,CAAC,IAAI,CAAC;QAE7E,KAAK,CAAC,UAAU,EAAE,IAAI,CAAC,CAAC;QACxB,IAAI,CAAC,GAAG,GAAG,IAAI,CAAC,GAAG,IAAI,EAAE,CAAC;IAC9B,CAAC;CACJ"}
|