@crawlee/core 4.0.0-beta.2 → 4.0.0-beta.21
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 +5 -1
- package/autoscaling/snapshotter.d.ts.map +1 -1
- package/autoscaling/snapshotter.js +4 -11
- package/autoscaling/snapshotter.js.map +1 -1
- package/configuration.d.ts +0 -7
- package/configuration.d.ts.map +1 -1
- package/configuration.js +0 -4
- package/configuration.js.map +1 -1
- package/cookie_utils.d.ts +1 -1
- package/cookie_utils.d.ts.map +1 -1
- package/cookie_utils.js +4 -6
- package/cookie_utils.js.map +1 -1
- package/crawlers/context_pipeline.d.ts +61 -0
- package/crawlers/context_pipeline.d.ts.map +1 -0
- package/crawlers/context_pipeline.js +99 -0
- package/crawlers/context_pipeline.js.map +1 -0
- package/crawlers/crawler_commons.d.ts +12 -17
- package/crawlers/crawler_commons.d.ts.map +1 -1
- package/crawlers/crawler_commons.js +0 -8
- package/crawlers/crawler_commons.js.map +1 -1
- package/crawlers/error_snapshotter.d.ts +3 -2
- package/crawlers/error_snapshotter.d.ts.map +1 -1
- package/crawlers/error_snapshotter.js +2 -2
- package/crawlers/error_snapshotter.js.map +1 -1
- package/crawlers/error_tracker.d.ts +2 -1
- package/crawlers/error_tracker.d.ts.map +1 -1
- package/crawlers/error_tracker.js.map +1 -1
- package/crawlers/index.d.ts +1 -1
- package/crawlers/index.d.ts.map +1 -1
- package/crawlers/index.js +1 -1
- package/crawlers/index.js.map +1 -1
- package/crawlers/internals/types.d.ts +8 -0
- package/crawlers/internals/types.d.ts.map +1 -0
- package/crawlers/internals/types.js +2 -0
- package/crawlers/internals/types.js.map +1 -0
- package/crawlers/statistics.d.ts +11 -2
- package/crawlers/statistics.d.ts.map +1 -1
- package/crawlers/statistics.js +6 -3
- package/crawlers/statistics.js.map +1 -1
- package/enqueue_links/enqueue_links.d.ts +22 -15
- package/enqueue_links/enqueue_links.d.ts.map +1 -1
- package/enqueue_links/enqueue_links.js +33 -14
- package/enqueue_links/enqueue_links.js.map +1 -1
- package/enqueue_links/shared.d.ts +8 -2
- package/enqueue_links/shared.d.ts.map +1 -1
- package/enqueue_links/shared.js +40 -18
- package/enqueue_links/shared.js.map +1 -1
- package/errors.d.ts +12 -0
- package/errors.d.ts.map +1 -1
- package/errors.js +20 -0
- package/errors.js.map +1 -1
- package/events/local_event_manager.d.ts +0 -2
- package/events/local_event_manager.d.ts.map +1 -1
- package/events/local_event_manager.js +3 -32
- package/events/local_event_manager.js.map +1 -1
- package/http_clients/base-http-client.d.ts +6 -128
- package/http_clients/base-http-client.d.ts.map +1 -1
- package/http_clients/base-http-client.js +20 -9
- package/http_clients/base-http-client.js.map +1 -1
- package/http_clients/got-scraping-http-client.d.ts +10 -3
- package/http_clients/got-scraping-http-client.d.ts.map +1 -1
- package/http_clients/got-scraping-http-client.js +86 -39
- package/http_clients/got-scraping-http-client.js.map +1 -1
- package/index.d.ts +1 -0
- package/index.d.ts.map +1 -1
- package/index.js +1 -0
- package/index.js.map +1 -1
- package/log.d.ts +4 -2
- package/log.d.ts.map +1 -1
- package/log.js.map +1 -1
- package/package.json +6 -6
- package/proxy_configuration.d.ts +16 -93
- package/proxy_configuration.d.ts.map +1 -1
- package/proxy_configuration.js +15 -51
- package/proxy_configuration.js.map +1 -1
- package/recoverable_state.d.ts +123 -0
- package/recoverable_state.d.ts.map +1 -0
- package/recoverable_state.js +140 -0
- package/recoverable_state.js.map +1 -0
- package/request.d.ts +31 -5
- package/request.d.ts.map +1 -1
- package/request.js +35 -12
- package/request.js.map +1 -1
- package/session_pool/session.d.ts +7 -20
- package/session_pool/session.d.ts.map +1 -1
- package/session_pool/session.js +9 -2
- package/session_pool/session.js.map +1 -1
- package/session_pool/session_pool.d.ts +10 -3
- package/session_pool/session_pool.d.ts.map +1 -1
- package/session_pool/session_pool.js +13 -1
- package/session_pool/session_pool.js.map +1 -1
- package/storages/dataset.d.ts +7 -0
- package/storages/dataset.d.ts.map +1 -1
- package/storages/dataset.js +10 -1
- package/storages/dataset.js.map +1 -1
- package/storages/index.d.ts +2 -0
- package/storages/index.d.ts.map +1 -1
- package/storages/index.js +2 -0
- package/storages/index.js.map +1 -1
- package/storages/key_value_store.d.ts +13 -1
- package/storages/key_value_store.d.ts.map +1 -1
- package/storages/key_value_store.js +11 -6
- package/storages/key_value_store.js.map +1 -1
- package/storages/request_list.d.ts +8 -7
- package/storages/request_list.d.ts.map +1 -1
- package/storages/request_list.js +8 -2
- package/storages/request_list.js.map +1 -1
- package/storages/request_list_adapter.d.ts +58 -0
- package/storages/request_list_adapter.d.ts.map +1 -0
- package/storages/request_list_adapter.js +81 -0
- package/storages/request_list_adapter.js.map +1 -0
- package/storages/request_manager_tandem.d.ts +68 -0
- package/storages/request_manager_tandem.d.ts.map +1 -0
- package/storages/request_manager_tandem.js +124 -0
- package/storages/request_manager_tandem.js.map +1 -0
- package/storages/request_provider.d.ts +70 -5
- package/storages/request_provider.d.ts.map +1 -1
- package/storages/request_provider.js +81 -45
- package/storages/request_provider.js.map +1 -1
- package/storages/request_queue_v2.d.ts +2 -2
- package/storages/request_queue_v2.d.ts.map +1 -1
- package/storages/request_queue_v2.js.map +1 -1
- package/storages/sitemap_request_list.d.ts +7 -2
- package/storages/sitemap_request_list.d.ts.map +1 -1
- package/storages/sitemap_request_list.js +3 -2
- package/storages/sitemap_request_list.js.map +1 -1
- package/storages/storage_manager.d.ts +5 -1
- package/storages/storage_manager.d.ts.map +1 -1
- package/storages/storage_manager.js +1 -1
- package/storages/storage_manager.js.map +1 -1
- package/typedefs.d.ts +1 -1
- package/typedefs.d.ts.map +1 -1
- package/crawlers/crawler_extension.d.ts +0 -12
- package/crawlers/crawler_extension.d.ts.map +0 -1
- package/crawlers/crawler_extension.js +0 -14
- package/crawlers/crawler_extension.js.map +0 -1
- package/tsconfig.build.tsbuildinfo +0 -1
|
@@ -1,34 +1,99 @@
|
|
|
1
|
+
import { Readable } from 'node:stream';
|
|
1
2
|
import { gotScraping } from 'got-scraping';
|
|
3
|
+
import { ResponseWithUrl } from './base-http-client.js';
|
|
2
4
|
/**
|
|
3
5
|
* A HTTP client implementation based on the `got-scraping` library.
|
|
4
6
|
*/
|
|
5
7
|
export class GotScrapingHttpClient {
|
|
8
|
+
/**
|
|
9
|
+
* Type guard that validates the HTTP method (excluding CONNECT).
|
|
10
|
+
* @param request - The HTTP request to validate
|
|
11
|
+
*/
|
|
12
|
+
validateRequest(request) {
|
|
13
|
+
return !['CONNECT', 'connect'].includes(request.method);
|
|
14
|
+
}
|
|
15
|
+
*iterateHeaders(headers) {
|
|
16
|
+
for (const [key, value] of Object.entries(headers)) {
|
|
17
|
+
// Filter out pseudo-headers
|
|
18
|
+
if (key.startsWith(':') || value === undefined) {
|
|
19
|
+
continue;
|
|
20
|
+
}
|
|
21
|
+
if (Array.isArray(value)) {
|
|
22
|
+
for (const v of value) {
|
|
23
|
+
yield [key, v];
|
|
24
|
+
}
|
|
25
|
+
}
|
|
26
|
+
else {
|
|
27
|
+
yield [key, value];
|
|
28
|
+
}
|
|
29
|
+
}
|
|
30
|
+
}
|
|
31
|
+
parseHeaders(headers) {
|
|
32
|
+
return new Headers([...this.iterateHeaders(headers)]);
|
|
33
|
+
}
|
|
6
34
|
/**
|
|
7
35
|
* @inheritDoc
|
|
8
36
|
*/
|
|
9
|
-
async sendRequest(request) {
|
|
37
|
+
async sendRequest(request, options) {
|
|
38
|
+
const { session, timeout, proxyUrl } = options ?? {};
|
|
39
|
+
if (!this.validateRequest(request)) {
|
|
40
|
+
throw new Error(`The HTTP method CONNECT is not supported by the GotScrapingHttpClient.`);
|
|
41
|
+
}
|
|
10
42
|
const gotResult = await gotScraping({
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
43
|
+
url: request.url,
|
|
44
|
+
method: request.method,
|
|
45
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
46
|
+
body: request.body ? Readable.fromWeb(request.body) : undefined,
|
|
47
|
+
proxyUrl: proxyUrl ?? session?.proxyInfo?.url,
|
|
48
|
+
timeout: { request: timeout },
|
|
49
|
+
// We set cookieJar to undefined because
|
|
50
|
+
// `HttpCrawler` reads the cookies beforehand and sets them in `request.headers`.
|
|
51
|
+
// Using the `cookieJar` option directly would override that.
|
|
52
|
+
cookieJar: undefined,
|
|
53
|
+
});
|
|
54
|
+
const responseHeaders = this.parseHeaders(gotResult.headers);
|
|
55
|
+
return new ResponseWithUrl(new Uint8Array(gotResult.rawBody), {
|
|
56
|
+
headers: responseHeaders,
|
|
57
|
+
status: gotResult.statusCode,
|
|
58
|
+
statusText: gotResult.statusMessage ?? '',
|
|
59
|
+
url: gotResult.url,
|
|
16
60
|
});
|
|
17
|
-
return {
|
|
18
|
-
...gotResult,
|
|
19
|
-
body: gotResult.body,
|
|
20
|
-
request: { url: request.url, ...gotResult.request },
|
|
21
|
-
};
|
|
22
61
|
}
|
|
23
62
|
/**
|
|
24
63
|
* @inheritDoc
|
|
25
64
|
*/
|
|
26
|
-
async stream(request,
|
|
65
|
+
async stream(request, options) {
|
|
66
|
+
const { session, timeout } = options ?? {};
|
|
67
|
+
if (!this.validateRequest(request)) {
|
|
68
|
+
throw new Error(`The HTTP method CONNECT is not supported by the GotScrapingHttpClient.`);
|
|
69
|
+
}
|
|
27
70
|
// eslint-disable-next-line no-async-promise-executor
|
|
28
71
|
return new Promise(async (resolve, reject) => {
|
|
29
|
-
const stream = gotScraping({
|
|
72
|
+
const stream = gotScraping({
|
|
73
|
+
url: request.url,
|
|
74
|
+
method: request.method,
|
|
75
|
+
headers: Object.fromEntries(request.headers.entries()),
|
|
76
|
+
body: request.body ? Readable.fromWeb(request.body) : undefined,
|
|
77
|
+
isStream: true,
|
|
78
|
+
proxyUrl: session?.proxyInfo?.url,
|
|
79
|
+
timeout: { request: timeout },
|
|
80
|
+
cookieJar: undefined,
|
|
81
|
+
});
|
|
30
82
|
stream.on('redirect', (updatedOptions, redirectResponse) => {
|
|
31
|
-
|
|
83
|
+
const nativeRedirectResponse = new ResponseWithUrl(redirectResponse.rawBody, {
|
|
84
|
+
headers: redirectResponse.headers,
|
|
85
|
+
status: redirectResponse.statusCode,
|
|
86
|
+
statusText: redirectResponse.statusMessage,
|
|
87
|
+
url: redirectResponse.url,
|
|
88
|
+
});
|
|
89
|
+
const nativeHeaders = new Headers(Object.entries(updatedOptions.headers)
|
|
90
|
+
.map(([key, value]) => (Array.isArray(value) ? value.map((v) => [key, v]) : [[key, value]]))
|
|
91
|
+
.flat());
|
|
92
|
+
options?.onRedirect?.(nativeRedirectResponse, {
|
|
93
|
+
url: updatedOptions.url,
|
|
94
|
+
headers: nativeHeaders,
|
|
95
|
+
});
|
|
96
|
+
updatedOptions.headers = Object.fromEntries(nativeHeaders.entries());
|
|
32
97
|
});
|
|
33
98
|
// We need to end the stream for DELETE requests, otherwise it will hang.
|
|
34
99
|
if (request.method && ['DELETE', 'delete'].includes(request.method)) {
|
|
@@ -36,32 +101,14 @@ export class GotScrapingHttpClient {
|
|
|
36
101
|
}
|
|
37
102
|
stream.on('error', reject);
|
|
38
103
|
stream.on('response', (response) => {
|
|
39
|
-
const
|
|
40
|
-
|
|
41
|
-
|
|
42
|
-
|
|
104
|
+
const headers = this.parseHeaders(response.headers);
|
|
105
|
+
// Cast shouldn't be needed here, undici might have a different `ReadableStream` type
|
|
106
|
+
resolve(new ResponseWithUrl(Readable.toWeb(stream), {
|
|
107
|
+
status: response.statusCode,
|
|
108
|
+
statusText: response.statusMessage ?? '',
|
|
109
|
+
headers,
|
|
43
110
|
url: response.url,
|
|
44
|
-
|
|
45
|
-
statusCode: response.statusCode,
|
|
46
|
-
headers: response.headers,
|
|
47
|
-
trailers: response.trailers,
|
|
48
|
-
complete: response.complete,
|
|
49
|
-
get downloadProgress() {
|
|
50
|
-
return stream.downloadProgress;
|
|
51
|
-
},
|
|
52
|
-
get uploadProgress() {
|
|
53
|
-
return stream.uploadProgress;
|
|
54
|
-
},
|
|
55
|
-
};
|
|
56
|
-
Object.assign(result, response); // TODO BC - remove in 4.0
|
|
57
|
-
resolve(result);
|
|
58
|
-
stream.on('end', () => {
|
|
59
|
-
result.complete = response.complete;
|
|
60
|
-
result.trailers ??= {};
|
|
61
|
-
Object.assign(result.trailers, response.trailers);
|
|
62
|
-
result.rawTrailers ??= []; // TODO BC - remove in 4.0
|
|
63
|
-
Object.assign(result.rawTrailers, response.rawTrailers);
|
|
64
|
-
});
|
|
111
|
+
}));
|
|
65
112
|
});
|
|
66
113
|
});
|
|
67
114
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"got-scraping-http-client.js","sourceRoot":"","sources":["../../src/http_clients/got-scraping-http-client.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"got-scraping-http-client.js","sourceRoot":"","sources":["../../src/http_clients/got-scraping-http-client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,QAAQ,EAAE,MAAM,aAAa,CAAC;AAIvC,OAAO,EAAE,WAAW,EAAE,MAAM,cAAc,CAAC;AAE3C,OAAO,EAAE,eAAe,EAAE,MAAM,uBAAuB,CAAC;AAExD;;GAEG;AACH,MAAM,OAAO,qBAAqB;IAC9B;;;OAGG;IACK,eAAe,CACnB,OAAgB;QAEhB,OAAO,CAAC,CAAC,SAAS,EAAE,SAAS,CAAC,CAAC,QAAQ,CAAC,OAAO,CAAC,MAAO,CAAC,CAAC;IAC7D,CAAC;IAEO,CAAC,cAAc,CACnB,OAAsD;QAEtD,KAAK,MAAM,CAAC,GAAG,EAAE,KAAK,CAAC,IAAI,MAAM,CAAC,OAAO,CAAC,OAAO,CAAC,EAAE,CAAC;YACjD,4BAA4B;YAC5B,IAAI,GAAG,CAAC,UAAU,CAAC,GAAG,CAAC,IAAI,KAAK,KAAK,SAAS,EAAE,CAAC;gBAC7C,SAAS;YACb,CAAC;YAED,IAAI,KAAK,CAAC,OAAO,CAAC,KAAK,CAAC,EAAE,CAAC;gBACvB,KAAK,MAAM,CAAC,IAAI,KAA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CAAC,CAAC;gBACpD,qFAAqF;gBACrF,OAAO,CACH,IAAI,eAAe,CAAC,QAAQ,CAAC,KAAK,CAAC,MAAM,CAAQ,EAAE;oBAC/C,MAAM,EAAE,QAAQ,CAAC,UAAU;oBAC3B,UAAU,EAAE,QAAQ,CAAC,aAAa,IAAI,EAAE;oBACxC,OAAO;oBACP,GAAG,EAAE,QAAQ,CAAC,GAAG;iBACpB,CAAC,CACL,CAAC;YACN,CAAC,CAAC,CAAC;QACP,CAAC,CAAC,CAAC;IACP,CAAC;CACJ"}
|
package/index.d.ts
CHANGED
|
@@ -14,6 +14,7 @@ export * from './session_pool/index.js';
|
|
|
14
14
|
export * from './storages/index.js';
|
|
15
15
|
export * from './validators.js';
|
|
16
16
|
export * from './cookie_utils.js';
|
|
17
|
+
export * from './recoverable_state.js';
|
|
17
18
|
export { PseudoUrl } from '@apify/pseudo_url';
|
|
18
19
|
export { Dictionary, Awaitable, Constructor, StorageClient, Cookie, QueueOperationInfo } from '@crawlee/types';
|
|
19
20
|
//# sourceMappingURL=index.d.ts.map
|
package/index.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.d.ts","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC;AAC9C,OAAO,EAAE,UAAU,EAAE,SAAS,EAAE,WAAW,EAAE,aAAa,EAAE,MAAM,EAAE,kBAAkB,EAAE,MAAM,gBAAgB,CAAC"}
|
package/index.js
CHANGED
|
@@ -14,5 +14,6 @@ export * from './session_pool/index.js';
|
|
|
14
14
|
export * from './storages/index.js';
|
|
15
15
|
export * from './validators.js';
|
|
16
16
|
export * from './cookie_utils.js';
|
|
17
|
+
export * from './recoverable_state.js';
|
|
17
18
|
export { PseudoUrl } from '@apify/pseudo_url';
|
|
18
19
|
//# sourceMappingURL=index.js.map
|
package/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAC;AAC5B,cAAc,wBAAwB,CAAC;AACvC,cAAc,oBAAoB,CAAC;AACnC,cAAc,qBAAqB,CAAC;AACpC,cAAc,0BAA0B,CAAC;AACzC,cAAc,mBAAmB,CAAC;AAClC,cAAc,yBAAyB,CAAC;AACxC,cAAc,UAAU,CAAC;AACzB,cAAc,0BAA0B,CAAC;AACzC,cAAc,cAAc,CAAC;AAC7B,cAAc,aAAa,CAAC;AAC5B,cAAc,oBAAoB,CAAC;AACnC,cAAc,yBAAyB,CAAC;AACxC,cAAc,qBAAqB,CAAC;AACpC,cAAc,iBAAiB,CAAC;AAChC,cAAc,mBAAmB,CAAC;AAClC,cAAc,wBAAwB,CAAC;AACvC,OAAO,EAAE,SAAS,EAAE,MAAM,mBAAmB,CAAC"}
|
package/log.d.ts
CHANGED
|
@@ -1,3 +1,5 @@
|
|
|
1
|
-
import
|
|
2
|
-
|
|
1
|
+
import type { LoggerOptions } from '@apify/log';
|
|
2
|
+
import log, { Log, Logger, LoggerJson, LoggerText, LogLevel } from '@apify/log';
|
|
3
|
+
export { log, Log, LogLevel, Logger, LoggerJson, LoggerText };
|
|
4
|
+
export type { LoggerOptions };
|
|
3
5
|
//# sourceMappingURL=log.d.ts.map
|
package/log.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,
|
|
1
|
+
{"version":3,"file":"log.d.ts","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,aAAa,EAAE,MAAM,YAAY,CAAC;AAChD,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC;AAC9D,YAAY,EAAE,aAAa,EAAE,CAAC"}
|
package/log.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"log.js","sourceRoot":"","sources":["../src/log.ts"],"names":[],"mappings":"AACA,OAAO,GAAG,EAAE,EAAE,GAAG,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAEhF,OAAO,EAAE,GAAG,EAAE,GAAG,EAAE,QAAQ,EAAE,MAAM,EAAE,UAAU,EAAE,UAAU,EAAE,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@crawlee/core",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.21",
|
|
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
6
|
"node": ">=22.0.0"
|
|
@@ -53,9 +53,9 @@
|
|
|
53
53
|
"@apify/pseudo_url": "^2.0.59",
|
|
54
54
|
"@apify/timeout": "^0.3.2",
|
|
55
55
|
"@apify/utilities": "^2.15.5",
|
|
56
|
-
"@crawlee/memory-storage": "4.0.0-beta.
|
|
57
|
-
"@crawlee/types": "4.0.0-beta.
|
|
58
|
-
"@crawlee/utils": "4.0.0-beta.
|
|
56
|
+
"@crawlee/memory-storage": "4.0.0-beta.21",
|
|
57
|
+
"@crawlee/types": "4.0.0-beta.21",
|
|
58
|
+
"@crawlee/utils": "4.0.0-beta.21",
|
|
59
59
|
"@sapphire/async-queue": "^1.5.5",
|
|
60
60
|
"@vladfrangu/async_event_emitter": "^2.4.6",
|
|
61
61
|
"csv-stringify": "^6.5.2",
|
|
@@ -66,7 +66,7 @@
|
|
|
66
66
|
"ow": "^2.0.0",
|
|
67
67
|
"stream-json": "^1.9.1",
|
|
68
68
|
"tldts": "^7.0.6",
|
|
69
|
-
"tough-cookie": "^
|
|
69
|
+
"tough-cookie": "^6.0.0",
|
|
70
70
|
"tslib": "^2.8.1",
|
|
71
71
|
"type-fest": "^4.41.0"
|
|
72
72
|
},
|
|
@@ -77,5 +77,5 @@
|
|
|
77
77
|
}
|
|
78
78
|
}
|
|
79
79
|
},
|
|
80
|
-
"gitHead": "
|
|
80
|
+
"gitHead": "e370ab2f4ffcf4f63b52a61c9b6e97081d525e64"
|
|
81
81
|
}
|
package/proxy_configuration.d.ts
CHANGED
|
@@ -1,18 +1,20 @@
|
|
|
1
|
+
import type { ProxyInfo } from '@crawlee/types';
|
|
1
2
|
import type { Request } from './request.js';
|
|
2
3
|
export interface ProxyConfigurationFunction {
|
|
3
|
-
(
|
|
4
|
+
(options?: {
|
|
4
5
|
request?: Request;
|
|
5
6
|
}): string | null | Promise<string | null>;
|
|
6
7
|
}
|
|
8
|
+
type UrlList = (string | null)[];
|
|
7
9
|
export interface ProxyConfigurationOptions {
|
|
8
10
|
/**
|
|
9
11
|
* An array of custom proxy URLs to be rotated.
|
|
10
12
|
* Custom proxies are not compatible with Apify Proxy and an attempt to use both
|
|
11
13
|
* configuration options will cause an error to be thrown on initialize.
|
|
12
14
|
*/
|
|
13
|
-
proxyUrls?:
|
|
15
|
+
proxyUrls?: UrlList;
|
|
14
16
|
/**
|
|
15
|
-
* Custom function that allows you to generate the new proxy URL dynamically. It gets
|
|
17
|
+
* Custom function that allows you to generate the new proxy URL dynamically. It gets an optional parameter with the `Request` object when applicable.
|
|
16
18
|
* Can return either stringified proxy URL or `null` if the proxy should not be used. Can be asynchronous.
|
|
17
19
|
*
|
|
18
20
|
* This function is used to generate the URL when {@link ProxyConfiguration.newUrl} or {@link ProxyConfiguration.newProxyInfo} is called.
|
|
@@ -29,72 +31,12 @@ export interface ProxyConfigurationOptions {
|
|
|
29
31
|
*
|
|
30
32
|
* Use `null` as a proxy URL to disable the proxy for the given tier.
|
|
31
33
|
*/
|
|
32
|
-
tieredProxyUrls?:
|
|
34
|
+
tieredProxyUrls?: UrlList[];
|
|
33
35
|
}
|
|
34
36
|
export interface TieredProxy {
|
|
35
37
|
proxyUrl: string | null;
|
|
36
38
|
proxyTier?: number;
|
|
37
39
|
}
|
|
38
|
-
/**
|
|
39
|
-
* The main purpose of the ProxyInfo object is to provide information
|
|
40
|
-
* about the current proxy connection used by the crawler for the request.
|
|
41
|
-
* Outside of crawlers, you can get this object by calling {@link ProxyConfiguration.newProxyInfo}.
|
|
42
|
-
*
|
|
43
|
-
* **Example usage:**
|
|
44
|
-
*
|
|
45
|
-
* ```javascript
|
|
46
|
-
* const proxyConfiguration = new ProxyConfiguration({
|
|
47
|
-
* proxyUrls: ['...', '...'] // List of Proxy URLs to rotate
|
|
48
|
-
* });
|
|
49
|
-
*
|
|
50
|
-
* // Getting proxyInfo object by calling class method directly
|
|
51
|
-
* const proxyInfo = await proxyConfiguration.newProxyInfo();
|
|
52
|
-
*
|
|
53
|
-
* // In crawler
|
|
54
|
-
* const crawler = new CheerioCrawler({
|
|
55
|
-
* // ...
|
|
56
|
-
* proxyConfiguration,
|
|
57
|
-
* requestHandler({ proxyInfo }) {
|
|
58
|
-
* // Getting used proxy URL
|
|
59
|
-
* const proxyUrl = proxyInfo.url;
|
|
60
|
-
*
|
|
61
|
-
* // Getting ID of used Session
|
|
62
|
-
* const sessionIdentifier = proxyInfo.sessionId;
|
|
63
|
-
* }
|
|
64
|
-
* })
|
|
65
|
-
*
|
|
66
|
-
* ```
|
|
67
|
-
*/
|
|
68
|
-
export interface ProxyInfo {
|
|
69
|
-
/**
|
|
70
|
-
* The identifier of used {@link Session}, if used.
|
|
71
|
-
*/
|
|
72
|
-
sessionId?: string;
|
|
73
|
-
/**
|
|
74
|
-
* The URL of the proxy.
|
|
75
|
-
*/
|
|
76
|
-
url: string;
|
|
77
|
-
/**
|
|
78
|
-
* Username for the proxy.
|
|
79
|
-
*/
|
|
80
|
-
username?: string;
|
|
81
|
-
/**
|
|
82
|
-
* User's password for the proxy.
|
|
83
|
-
*/
|
|
84
|
-
password: string;
|
|
85
|
-
/**
|
|
86
|
-
* Hostname of your proxy.
|
|
87
|
-
*/
|
|
88
|
-
hostname: string;
|
|
89
|
-
/**
|
|
90
|
-
* Proxy port.
|
|
91
|
-
*/
|
|
92
|
-
port: number | string;
|
|
93
|
-
/**
|
|
94
|
-
* Proxy tier for the current proxy, if applicable (only for `tieredProxyUrls`).
|
|
95
|
-
*/
|
|
96
|
-
proxyTier?: number;
|
|
97
|
-
}
|
|
98
40
|
interface TieredProxyOptions {
|
|
99
41
|
request?: Request;
|
|
100
42
|
proxyTier?: number;
|
|
@@ -156,9 +98,9 @@ declare class ProxyTierTracker {
|
|
|
156
98
|
export declare class ProxyConfiguration {
|
|
157
99
|
isManInTheMiddle: boolean;
|
|
158
100
|
protected nextCustomUrlIndex: number;
|
|
159
|
-
protected proxyUrls?:
|
|
160
|
-
protected tieredProxyUrls?:
|
|
161
|
-
protected usedProxyUrls: Map<string, string>;
|
|
101
|
+
protected proxyUrls?: UrlList;
|
|
102
|
+
protected tieredProxyUrls?: UrlList[];
|
|
103
|
+
protected usedProxyUrls: Map<string, string | null>;
|
|
162
104
|
protected newUrlFunction?: ProxyConfigurationFunction;
|
|
163
105
|
// @ts-ignore optional peer dependency or compatibility with es2022
|
|
164
106
|
protected log: import("@apify/log").Log;
|
|
@@ -190,25 +132,16 @@ export declare class ProxyConfiguration {
|
|
|
190
132
|
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
191
133
|
* Use it if you want to work with a rich representation of a proxy URL.
|
|
192
134
|
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
193
|
-
* @param [sessionId]
|
|
194
|
-
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
195
|
-
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
196
|
-
* When the provided sessionId is a number, it's converted to a string. Property sessionId of
|
|
197
|
-
* {@link ProxyInfo} is always returned as a type string.
|
|
198
135
|
*
|
|
199
|
-
* All the HTTP requests going through the proxy with the same session identifier
|
|
200
|
-
* will use the same target proxy server (i.e. the same IP address).
|
|
201
|
-
* The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
|
|
202
136
|
* @return Represents information about used proxy and its configuration.
|
|
203
137
|
*/
|
|
204
|
-
newProxyInfo(
|
|
138
|
+
newProxyInfo(options?: TieredProxyOptions): Promise<ProxyInfo | undefined>;
|
|
205
139
|
/**
|
|
206
|
-
* Given a
|
|
207
|
-
* @param _sessionId Session identifier
|
|
140
|
+
* Given a request / proxy tier, this function returns a new proxy URL based on the provided configuration options.
|
|
208
141
|
* @param options Options for the tiered proxy rotation
|
|
209
142
|
* @returns An object with the proxy URL and the proxy tier used.
|
|
210
143
|
*/
|
|
211
|
-
protected _handleTieredUrl(
|
|
144
|
+
protected _handleTieredUrl(options?: TieredProxyOptions): TieredProxy;
|
|
212
145
|
/**
|
|
213
146
|
* Given a `Request` object, this function returns the tier of the proxy that should be used for the request.
|
|
214
147
|
*
|
|
@@ -216,27 +149,17 @@ export declare class ProxyConfiguration {
|
|
|
216
149
|
*/
|
|
217
150
|
protected predictProxyTier(request: Request): number | null;
|
|
218
151
|
/**
|
|
219
|
-
* Returns a new proxy URL based on provided configuration options
|
|
220
|
-
* @param [sessionId]
|
|
221
|
-
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
222
|
-
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
223
|
-
* When the provided sessionId is a number, it's converted to a string.
|
|
152
|
+
* Returns a new proxy URL based on provided configuration options.
|
|
224
153
|
*
|
|
225
|
-
* All the HTTP requests going through the proxy with the same session identifier
|
|
226
|
-
* will use the same target proxy server (i.e. the same IP address).
|
|
227
|
-
* The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
|
|
228
154
|
* @return A string with a proxy URL, including authentication credentials and port number.
|
|
229
155
|
* For example, `http://bob:password123@proxy.example.com:8000`
|
|
230
156
|
*/
|
|
231
|
-
newUrl(
|
|
232
|
-
|
|
233
|
-
* Handles custom url rotation with session
|
|
234
|
-
*/
|
|
235
|
-
protected _handleCustomUrl(sessionId?: string): string;
|
|
157
|
+
newUrl(options?: TieredProxyOptions): Promise<string | undefined>;
|
|
158
|
+
protected _handleProxyUrlsList(): string | null;
|
|
236
159
|
/**
|
|
237
160
|
* Calls the custom newUrlFunction and checks format of its return value
|
|
238
161
|
*/
|
|
239
|
-
protected _callNewUrlFunction(
|
|
162
|
+
protected _callNewUrlFunction(options?: {
|
|
240
163
|
request?: Request;
|
|
241
164
|
}): Promise<string | null>;
|
|
242
165
|
protected _throwCannotCombineCustomMethods(): never;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy_configuration.d.ts","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"proxy_configuration.d.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C,SAAS,CAAC,EAAE,OAAO,CAAC;IAC9B,SAAS,CAAC,eAAe,CAAC,EAAE,OAAO,EAAE,CAAC;IACtC,SAAS,CAAC,aAAa,6BAAoC;IAC3D,SAAS,CAAC,cAAc,CAAC,EAAE,0BAA0B,CAAC;IACtD,SAAS,CAAC,GAAG,2BAA+C;IAC5D,SAAS,CAAC,WAAW,gCAAuC;IAE5D;;;;;;;;;;;;;;;;;;;OAmBG;gBACS,OAAO,GAAE,yBAA8B;IAwBnD;;;;;;;;OAQG;IACG,YAAY,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,SAAS,GAAG,SAAS,CAAC;IAyBhF;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,WAAW;IAwBrE;;;;OAIG;IACH,SAAS,CAAC,gBAAgB,CAAC,OAAO,EAAE,OAAO,GAAG,MAAM,GAAG,IAAI;IAiC3D;;;;;OAKG;IACG,MAAM,CAAC,OAAO,CAAC,EAAE,kBAAkB,GAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAAC;IAYvE,SAAS,CAAC,oBAAoB,IAAI,MAAM,GAAG,IAAI;IAI/C;;OAEG;cACa,mBAAmB,CAAC,OAAO,CAAC,EAAE;QAAE,OAAO,CAAC,EAAE,OAAO,CAAA;KAAE;IAcnE,SAAS,CAAC,gCAAgC,IAAI,KAAK;IAMnD,SAAS,CAAC,uBAAuB,IAAI,KAAK;CAG7C"}
|
package/proxy_configuration.js
CHANGED
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import ow from 'ow';
|
|
2
2
|
import log from '@apify/log';
|
|
3
|
-
import { cryptoRandomObjectId } from '@apify/utilities';
|
|
4
3
|
/**
|
|
5
4
|
* Internal class for tracking the proxy tier history for a specific domain.
|
|
6
5
|
*
|
|
@@ -110,7 +109,7 @@ export class ProxyConfiguration {
|
|
|
110
109
|
constructor(options = {}) {
|
|
111
110
|
const { validateRequired, ...rest } = options;
|
|
112
111
|
ow(rest, ow.object.exactShape({
|
|
113
|
-
proxyUrls: ow.optional.array.nonEmpty.ofType(ow.string.url),
|
|
112
|
+
proxyUrls: ow.optional.array.nonEmpty.ofType(ow.any(ow.string.url, ow.null)),
|
|
114
113
|
newUrlFunction: ow.optional.function,
|
|
115
114
|
tieredProxyUrls: ow.optional.array.nonEmpty.ofType(ow.array.nonEmpty.ofType(ow.any(ow.string.url, ow.null))),
|
|
116
115
|
}));
|
|
@@ -129,35 +128,24 @@ export class ProxyConfiguration {
|
|
|
129
128
|
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
130
129
|
* Use it if you want to work with a rich representation of a proxy URL.
|
|
131
130
|
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
132
|
-
* @param [sessionId]
|
|
133
|
-
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
134
|
-
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
135
|
-
* When the provided sessionId is a number, it's converted to a string. Property sessionId of
|
|
136
|
-
* {@link ProxyInfo} is always returned as a type string.
|
|
137
131
|
*
|
|
138
|
-
* All the HTTP requests going through the proxy with the same session identifier
|
|
139
|
-
* will use the same target proxy server (i.e. the same IP address).
|
|
140
|
-
* The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
|
|
141
132
|
* @return Represents information about used proxy and its configuration.
|
|
142
133
|
*/
|
|
143
|
-
async newProxyInfo(
|
|
144
|
-
if (typeof sessionId === 'number')
|
|
145
|
-
sessionId = `${sessionId}`;
|
|
134
|
+
async newProxyInfo(options) {
|
|
146
135
|
let url;
|
|
147
136
|
let tier;
|
|
148
137
|
if (this.tieredProxyUrls) {
|
|
149
|
-
const { proxyUrl, proxyTier } = this._handleTieredUrl(
|
|
138
|
+
const { proxyUrl, proxyTier } = this._handleTieredUrl(options);
|
|
150
139
|
url = proxyUrl ?? undefined;
|
|
151
140
|
tier = proxyTier;
|
|
152
141
|
}
|
|
153
142
|
else {
|
|
154
|
-
url = await this.newUrl(
|
|
143
|
+
url = await this.newUrl(options);
|
|
155
144
|
}
|
|
156
145
|
if (!url)
|
|
157
146
|
return undefined;
|
|
158
147
|
const { username, password, port, hostname } = new URL(url);
|
|
159
148
|
return {
|
|
160
|
-
sessionId,
|
|
161
149
|
url,
|
|
162
150
|
username: decodeURIComponent(username),
|
|
163
151
|
password: decodeURIComponent(password),
|
|
@@ -167,12 +155,11 @@ export class ProxyConfiguration {
|
|
|
167
155
|
};
|
|
168
156
|
}
|
|
169
157
|
/**
|
|
170
|
-
* Given a
|
|
171
|
-
* @param _sessionId Session identifier
|
|
158
|
+
* Given a request / proxy tier, this function returns a new proxy URL based on the provided configuration options.
|
|
172
159
|
* @param options Options for the tiered proxy rotation
|
|
173
160
|
* @returns An object with the proxy URL and the proxy tier used.
|
|
174
161
|
*/
|
|
175
|
-
_handleTieredUrl(
|
|
162
|
+
_handleTieredUrl(options) {
|
|
176
163
|
if (!this.tieredProxyUrls)
|
|
177
164
|
throw new Error('Tiered proxy URLs are not set');
|
|
178
165
|
if (!options || (!options?.request && options?.proxyTier === undefined)) {
|
|
@@ -218,51 +205,28 @@ export class ProxyConfiguration {
|
|
|
218
205
|
return tierPrediction;
|
|
219
206
|
}
|
|
220
207
|
/**
|
|
221
|
-
* Returns a new proxy URL based on provided configuration options
|
|
222
|
-
* @param [sessionId]
|
|
223
|
-
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
224
|
-
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
225
|
-
* When the provided sessionId is a number, it's converted to a string.
|
|
208
|
+
* Returns a new proxy URL based on provided configuration options.
|
|
226
209
|
*
|
|
227
|
-
* All the HTTP requests going through the proxy with the same session identifier
|
|
228
|
-
* will use the same target proxy server (i.e. the same IP address).
|
|
229
|
-
* The identifier must not be longer than 50 characters and include only the following: `0-9`, `a-z`, `A-Z`, `"."`, `"_"` and `"~"`.
|
|
230
210
|
* @return A string with a proxy URL, including authentication credentials and port number.
|
|
231
211
|
* For example, `http://bob:password123@proxy.example.com:8000`
|
|
232
212
|
*/
|
|
233
|
-
async newUrl(
|
|
234
|
-
if (typeof sessionId === 'number')
|
|
235
|
-
sessionId = `${sessionId}`;
|
|
213
|
+
async newUrl(options) {
|
|
236
214
|
if (this.newUrlFunction) {
|
|
237
|
-
return (await this._callNewUrlFunction(
|
|
215
|
+
return (await this._callNewUrlFunction({ request: options?.request })) ?? undefined;
|
|
238
216
|
}
|
|
239
217
|
if (this.tieredProxyUrls) {
|
|
240
|
-
return this._handleTieredUrl(
|
|
218
|
+
return this._handleTieredUrl(options).proxyUrl ?? undefined;
|
|
241
219
|
}
|
|
242
|
-
return this.
|
|
220
|
+
return this._handleProxyUrlsList() ?? undefined;
|
|
243
221
|
}
|
|
244
|
-
|
|
245
|
-
|
|
246
|
-
*/
|
|
247
|
-
_handleCustomUrl(sessionId) {
|
|
248
|
-
let customUrlToUse;
|
|
249
|
-
if (!sessionId) {
|
|
250
|
-
return this.proxyUrls[this.nextCustomUrlIndex++ % this.proxyUrls.length];
|
|
251
|
-
}
|
|
252
|
-
if (this.usedProxyUrls.has(sessionId)) {
|
|
253
|
-
customUrlToUse = this.usedProxyUrls.get(sessionId);
|
|
254
|
-
}
|
|
255
|
-
else {
|
|
256
|
-
customUrlToUse = this.proxyUrls[this.nextCustomUrlIndex++ % this.proxyUrls.length];
|
|
257
|
-
this.usedProxyUrls.set(sessionId, customUrlToUse);
|
|
258
|
-
}
|
|
259
|
-
return customUrlToUse;
|
|
222
|
+
_handleProxyUrlsList() {
|
|
223
|
+
return this.proxyUrls[this.nextCustomUrlIndex++ % this.proxyUrls.length];
|
|
260
224
|
}
|
|
261
225
|
/**
|
|
262
226
|
* Calls the custom newUrlFunction and checks format of its return value
|
|
263
227
|
*/
|
|
264
|
-
async _callNewUrlFunction(
|
|
265
|
-
const proxyUrl = await this.newUrlFunction(
|
|
228
|
+
async _callNewUrlFunction(options) {
|
|
229
|
+
const proxyUrl = await this.newUrlFunction(options);
|
|
266
230
|
try {
|
|
267
231
|
if (proxyUrl) {
|
|
268
232
|
new URL(proxyUrl); // eslint-disable-line no-new
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy_configuration.js","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,GAAG,MAAM,YAAY,CAAC;
|
|
1
|
+
{"version":3,"file":"proxy_configuration.js","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,MAAM,IAAI,CAAC;AAEpB,OAAO,GAAG,MAAM,YAAY,CAAC;AAkD7B;;;;GAIG;AACH,MAAM,gBAAgB;IACV,SAAS,CAAW;IACpB,WAAW,CAAS;IAE5B,YAAY,eAAoC;QAC5C,IAAI,CAAC,SAAS,GAAG,eAAe,CAAC,GAAG,CAAC,GAAG,EAAE,CAAC,CAAC,CAAC,CAAC;QAC9C,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC;IACzB,CAAC;IAED;;OAEG;IACK,WAAW;QACf,IAAI,CAAC,SAAS,CAAC,OAAO,CAAC,CAAC,CAAC,EAAE,CAAC,EAAE,EAAE;YAC5B,IAAI,IAAI,CAAC,WAAW,KAAK,CAAC;gBAAE,OAAO;YACnC,IAAI,CAAC,GAAG,CAAC;gBAAE,IAAI,CAAC,SAAS,CAAC,CAAC,CAAC,EAAE,CAAC;QACnC,CAAC,CAAC,CAAC;QAEH,MAAM,IAAI,GAAG,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,IAAI,CAAC,SAAS,CAAC,IAAI,CAAC,WAAW,GAAG,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC;QACpF,MAAM,KAAK,GAAG,IAAI,CAAC,WAAW,GAAG,IAAI,CAAC,SAAS,CAAC,M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