apify 3.3.3-beta.13 → 3.4.1-beta.29
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/.turbo/turbo-build.log +12 -6
- package/.turbo/turbo-copy.log +1 -1
- package/LICENSE.md +183 -183
- package/README.md +1 -1
- package/dist/LICENSE.md +183 -183
- package/dist/README.md +1 -1
- package/dist/actor.d.ts +309 -309
- package/dist/actor.d.ts.map +1 -1
- package/dist/actor.js +168 -127
- package/dist/actor.js.map +1 -1
- package/dist/charging.d.ts +18 -18
- package/dist/charging.d.ts.map +1 -1
- package/dist/charging.js +26 -14
- package/dist/charging.js.map +1 -1
- package/dist/configuration.d.ts +4 -4
- package/dist/configuration.d.ts.map +1 -1
- package/dist/configuration.js +14 -3
- package/dist/configuration.js.map +1 -1
- package/dist/index.d.ts +6 -6
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +6 -6
- package/dist/index.js.map +1 -1
- package/dist/key_value_store.d.ts.map +1 -1
- package/dist/key_value_store.js +1 -1
- package/dist/key_value_store.js.map +1 -1
- package/dist/package.json +3 -3
- package/dist/platform_event_manager.d.ts +4 -4
- package/dist/platform_event_manager.d.ts.map +1 -1
- package/dist/platform_event_manager.js +13 -10
- package/dist/platform_event_manager.js.map +1 -1
- package/dist/proxy_configuration.d.ts +10 -10
- package/dist/proxy_configuration.d.ts.map +1 -1
- package/dist/proxy_configuration.js +52 -40
- package/dist/proxy_configuration.js.map +1 -1
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js +5 -6
- package/dist/utils.js.map +1 -1
- package/package.json +3 -3
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"platform_event_manager.js","sourceRoot":"","sources":["../src/platform_event_manager.ts"],"names":[],"mappings":";;;AAAA,
|
|
1
|
+
{"version":3,"file":"platform_event_manager.js","sourceRoot":"","sources":["../src/platform_event_manager.ts"],"names":[],"mappings":";;;AAAA,wCAAwD;AACxD,2BAA+B;AAE/B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AAC,SAAS,CAAC,YAAa,CAAC,CAAC,CAAC,4CAA4C;oBAC/F,IAAI,CAAC,MAAM,CAAC,IAAI,+CAA0B;wBACtC,WAAW,EAAE,IAAI;qBACpB,CAAC,CAAC;gBACP,CAAC;YACL,CAAC;YAAC,OAAO,GAAG,EAAE,CAAC;gBACX,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAY,EAAE,0BAA0B,CAAC,CAAC;YACjE,CAAC;QACL,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,CAAC,GAAG,EAAE,EAAE;YAC9B,iFAAiF;YACjF,IACI,GAAG,CAAC,OAAO;gBACX,4DAA4D;gBAE5D,OAAO;YAEX,IAAI,CAAC,GAAG,CAAC,SAAS,CAAC,GAAG,EAAE,8BAA8B,CAAC,CAAC;QAC5D,CAAC,CAAC,CAAC;QACH,IAAI,CAAC,QAAQ,CAAC,EAAE,CAAC,OAAO,EAAE,GAAG,EAAE;YAC3B,IAAI,CAAC,GAAG,CAAC,KAAK,CAAC,4BAA4B,CAAC,CAAC;YAC7C,IAAI,CAAC,QAAQ,GAAG,SAAS,CAAC;QAC9B,CAAC,CAAC,CAAC;IACP,CAAC;IAED;;;;OAIG;IACM,KAAK,CAAC,KAAK;QAChB,IAAI,CAAC,IAAI,CAAC,WAAW,EAAE,CAAC;YACpB,OAAO;QACX,CAAC;QAED,MAAM,KAAK,CAAC,KAAK,EAAE,CAAC;QACpB,IAAI,CAAC,QAAQ,EAAE,KAAK,EAAE,CAAC;IAC3B,CAAC;CACJ;AA/ED,oDA+EC"}
|
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import type { ProxyConfigurationOptions as CoreProxyConfigurationOptions, ProxyInfo as CoreProxyInfo } from '@crawlee/core';
|
|
2
2
|
import { ProxyConfiguration as CoreProxyConfiguration } from '@crawlee/core';
|
|
3
|
-
import { Configuration } from './configuration';
|
|
3
|
+
import { Configuration } from './configuration.js';
|
|
4
4
|
export interface ProxyConfigurationOptions extends CoreProxyConfigurationOptions {
|
|
5
5
|
/**
|
|
6
6
|
* User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD`
|
|
@@ -43,7 +43,7 @@ export interface ProxyConfigurationOptions extends CoreProxyConfigurationOptions
|
|
|
43
43
|
/**
|
|
44
44
|
* The main purpose of the ProxyInfo object is to provide information
|
|
45
45
|
* about the current proxy connection used by the crawler for the request.
|
|
46
|
-
* Outside of crawlers, you can get this object by calling {@
|
|
46
|
+
* Outside of crawlers, you can get this object by calling {@link ProxyConfiguration.newProxyInfo}.
|
|
47
47
|
*
|
|
48
48
|
* **Example usage:**
|
|
49
49
|
*
|
|
@@ -100,13 +100,13 @@ export interface ProxyInfo extends CoreProxyInfo {
|
|
|
100
100
|
* Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking
|
|
101
101
|
* your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
102
102
|
* them to use the selected proxies for all connections. You can get information about the currently used proxy by inspecting
|
|
103
|
-
* the {@
|
|
103
|
+
* the {@link ProxyInfo} property in your crawler's page function. There, you can inspect the proxy's URL and other attributes.
|
|
104
104
|
*
|
|
105
105
|
* The proxy servers are managed by [Apify Proxy](https://docs.apify.com/proxy). To be able to use Apify Proxy,
|
|
106
106
|
* you need an Apify account and access to the selected proxies. If you provide no configuration option,
|
|
107
107
|
* the proxies will be managed automatically using a smart algorithm.
|
|
108
108
|
*
|
|
109
|
-
* If you want to use your own proxies, use the {@
|
|
109
|
+
* If you want to use your own proxies, use the {@link ProxyConfigurationOptions.proxyUrls} option. Your list of proxy URLs will
|
|
110
110
|
* be rotated by the configuration if this option is provided.
|
|
111
111
|
*
|
|
112
112
|
* **Example usage:**
|
|
@@ -146,21 +146,21 @@ export declare class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
146
146
|
* if Apify Proxy configuration is used.
|
|
147
147
|
* Also checks if country has access to Apify Proxy groups if the country code is provided.
|
|
148
148
|
*
|
|
149
|
-
* You should use the {@
|
|
149
|
+
* You should use the {@link createProxyConfiguration} function to create a pre-initialized
|
|
150
150
|
* `ProxyConfiguration` instance instead of calling this manually.
|
|
151
151
|
*/
|
|
152
152
|
initialize(): Promise<boolean>;
|
|
153
153
|
/**
|
|
154
|
-
* This function creates a new {@
|
|
154
|
+
* This function creates a new {@link ProxyInfo} info object.
|
|
155
155
|
* It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
|
|
156
156
|
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
157
157
|
* Use it if you want to work with a rich representation of a proxy URL.
|
|
158
|
-
* If you need the URL string only, use {@
|
|
158
|
+
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
159
159
|
* @param [sessionId]
|
|
160
|
-
* Represents the identifier of user {@
|
|
160
|
+
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
161
161
|
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
162
162
|
* When the provided sessionId is a number, it's converted to a string. Property sessionId of
|
|
163
|
-
* {@
|
|
163
|
+
* {@link ProxyInfo} is always returned as a type string.
|
|
164
164
|
*
|
|
165
165
|
* All the HTTP requests going through the proxy with the same session identifier
|
|
166
166
|
* will use the same target proxy server (i.e. the same IP address).
|
|
@@ -171,7 +171,7 @@ export declare class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
171
171
|
/**
|
|
172
172
|
* Returns a new proxy URL based on provided configuration options and the `sessionId` parameter.
|
|
173
173
|
* @param [sessionId]
|
|
174
|
-
* Represents the identifier of user {@
|
|
174
|
+
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
175
175
|
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
176
176
|
* When the provided sessionId is a number, it's converted to a string.
|
|
177
177
|
*
|
|
@@ -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.ts","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACR,yBAAyB,IAAI,6BAA6B,EAC1D,SAAS,IAAI,aAAa,EAC7B,MAAM,eAAe,CAAC;AACvB,OAAO,EAAE,kBAAkB,IAAI,sBAAsB,EAAE,MAAM,eAAe,CAAC;AAS7E,OAAO,EAAE,aAAa,EAAE,MAAM,oBAAoB,CAAC;AAQnD,MAAM,WAAW,yBACb,SAAQ,6BAA6B;IACrC;;;OAGG;IACH,QAAQ,CAAC,EAAE,MAAM,CAAC;IAElB;;;OAGG;IACH,MAAM,CAAC,EAAE,MAAM,EAAE,CAAC;IAElB;;;;;;;;;;OAUG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;OAGG;IACH,gBAAgB,CAAC,EAAE,MAAM,EAAE,CAAC;IAE5B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;IAE3B;;;OAGG;IACH,iBAAiB,CAAC,EAAE,IAAI,CACpB,yBAAyB,EACzB,MAAM,6BAA6B,GAAG,mBAAmB,CAC5D,EAAE,CAAC;CACP;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GA+BG;AACH,MAAM,WAAW,SAAU,SAAQ,aAAa;IAC5C;;;OAGG;IACH,MAAM,EAAE,MAAM,EAAE,CAAC;IAEjB;;;;;;;;;OASG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;IAErB;;;;OAIG;IACH,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgCG;AACH,qBAAa,kBAAmB,SAAQ,sBAAsB;IAatD,QAAQ,CAAC,MAAM;IAZnB,OAAO,CAAC,MAAM,CAAW;IACzB,OAAO,CAAC,WAAW,CAAC,CAAS;IAC7B,OAAO,CAAC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BD;;;OAGG;IACH,SAAS,CAAC,kCAAkC;CAO/C"}
|
|
@@ -2,13 +2,13 @@
|
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.ProxyConfiguration = void 0;
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
|
-
const consts_1 = require("@apify/consts");
|
|
6
|
-
const utilities_1 = require("@apify/utilities");
|
|
7
5
|
const core_1 = require("@crawlee/core");
|
|
8
6
|
const utils_1 = require("@crawlee/utils");
|
|
9
7
|
const ow_1 = tslib_1.__importDefault(require("ow"));
|
|
10
|
-
const
|
|
11
|
-
const
|
|
8
|
+
const consts_1 = require("@apify/consts");
|
|
9
|
+
const utilities_1 = require("@apify/utilities");
|
|
10
|
+
const actor_js_1 = require("./actor.js");
|
|
11
|
+
const configuration_js_1 = require("./configuration.js");
|
|
12
12
|
// https://docs.apify.com/proxy/datacenter-proxy#username-parameters
|
|
13
13
|
const MAX_SESSION_ID_LENGTH = 50;
|
|
14
14
|
const CHECK_ACCESS_REQUEST_TIMEOUT_MILLIS = 4000;
|
|
@@ -18,13 +18,13 @@ const COUNTRY_CODE_REGEX = /^[A-Z]{2}$/;
|
|
|
18
18
|
* Configures connection to a proxy server with the provided options. Proxy servers are used to prevent target websites from blocking
|
|
19
19
|
* your crawlers based on IP address rate limits or blacklists. Setting proxy configuration in your crawlers automatically configures
|
|
20
20
|
* them to use the selected proxies for all connections. You can get information about the currently used proxy by inspecting
|
|
21
|
-
* the {@
|
|
21
|
+
* the {@link ProxyInfo} property in your crawler's page function. There, you can inspect the proxy's URL and other attributes.
|
|
22
22
|
*
|
|
23
23
|
* The proxy servers are managed by [Apify Proxy](https://docs.apify.com/proxy). To be able to use Apify Proxy,
|
|
24
24
|
* you need an Apify account and access to the selected proxies. If you provide no configuration option,
|
|
25
25
|
* the proxies will be managed automatically using a smart algorithm.
|
|
26
26
|
*
|
|
27
|
-
* If you want to use your own proxies, use the {@
|
|
27
|
+
* If you want to use your own proxies, use the {@link ProxyConfigurationOptions.proxyUrls} option. Your list of proxy URLs will
|
|
28
28
|
* be rotated by the configuration if this option is provided.
|
|
29
29
|
*
|
|
30
30
|
* **Example usage:**
|
|
@@ -51,9 +51,13 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
51
51
|
/**
|
|
52
52
|
* @internal
|
|
53
53
|
*/
|
|
54
|
-
constructor(options = {}, config =
|
|
54
|
+
constructor(options = {}, config = configuration_js_1.Configuration.getGlobalConfig()) {
|
|
55
55
|
const { proxyUrls, newUrlFunction, ...rest } = options;
|
|
56
|
-
super({
|
|
56
|
+
super({
|
|
57
|
+
proxyUrls,
|
|
58
|
+
newUrlFunction,
|
|
59
|
+
['validateRequired']: false,
|
|
60
|
+
});
|
|
57
61
|
Object.defineProperty(this, "config", {
|
|
58
62
|
enumerable: true,
|
|
59
63
|
configurable: true,
|
|
@@ -115,7 +119,8 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
115
119
|
const hostname = config.get('proxyHostname');
|
|
116
120
|
const port = config.get('proxyPort');
|
|
117
121
|
// Validation
|
|
118
|
-
if ((
|
|
122
|
+
if ((proxyUrls || newUrlFunction) &&
|
|
123
|
+
(groupsToUse.length || countryCodeToUse)) {
|
|
119
124
|
this._throwCannotCombineCustomWithApify();
|
|
120
125
|
}
|
|
121
126
|
if (proxyUrls && newUrlFunction)
|
|
@@ -127,8 +132,8 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
127
132
|
this.port = port;
|
|
128
133
|
this.usesApifyProxy = !this.proxyUrls && !this.newUrlFunction;
|
|
129
134
|
if (proxyUrls && proxyUrls.some((url) => url.includes('apify.com'))) {
|
|
130
|
-
this.log.warning('Some Apify proxy features may work incorrectly. Please consider setting up Apify properties instead of `proxyUrls`.\n'
|
|
131
|
-
|
|
135
|
+
this.log.warning('Some Apify proxy features may work incorrectly. Please consider setting up Apify properties instead of `proxyUrls`.\n' +
|
|
136
|
+
'See https://sdk.apify.com/docs/guides/proxy-management#apify-proxy-configuration');
|
|
132
137
|
}
|
|
133
138
|
}
|
|
134
139
|
/**
|
|
@@ -136,7 +141,7 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
136
141
|
* if Apify Proxy configuration is used.
|
|
137
142
|
* Also checks if country has access to Apify Proxy groups if the country code is provided.
|
|
138
143
|
*
|
|
139
|
-
* You should use the {@
|
|
144
|
+
* You should use the {@link createProxyConfiguration} function to create a pre-initialized
|
|
140
145
|
* `ProxyConfiguration` instance instead of calling this manually.
|
|
141
146
|
*/
|
|
142
147
|
async initialize() {
|
|
@@ -147,16 +152,16 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
147
152
|
return true;
|
|
148
153
|
}
|
|
149
154
|
/**
|
|
150
|
-
* This function creates a new {@
|
|
155
|
+
* This function creates a new {@link ProxyInfo} info object.
|
|
151
156
|
* It is used by CheerioCrawler and PuppeteerCrawler to generate proxy URLs and also to allow the user to inspect
|
|
152
157
|
* the currently used proxy via the requestHandler parameter `proxyInfo`.
|
|
153
158
|
* Use it if you want to work with a rich representation of a proxy URL.
|
|
154
|
-
* If you need the URL string only, use {@
|
|
159
|
+
* If you need the URL string only, use {@link ProxyConfiguration.newUrl}.
|
|
155
160
|
* @param [sessionId]
|
|
156
|
-
* Represents the identifier of user {@
|
|
161
|
+
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
157
162
|
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
158
163
|
* When the provided sessionId is a number, it's converted to a string. Property sessionId of
|
|
159
|
-
* {@
|
|
164
|
+
* {@link ProxyInfo} is always returned as a type string.
|
|
160
165
|
*
|
|
161
166
|
* All the HTTP requests going through the proxy with the same session identifier
|
|
162
167
|
* will use the same target proxy server (i.e. the same IP address).
|
|
@@ -166,7 +171,9 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
166
171
|
async newProxyInfo(sessionId, options) {
|
|
167
172
|
if (typeof sessionId === 'number')
|
|
168
173
|
sessionId = `${sessionId}`;
|
|
169
|
-
(0, ow_1.default)(sessionId, ow_1.default.optional.string
|
|
174
|
+
(0, ow_1.default)(sessionId, ow_1.default.optional.string
|
|
175
|
+
.maxLength(MAX_SESSION_ID_LENGTH)
|
|
176
|
+
.matches(consts_1.APIFY_PROXY_VALUE_REGEX));
|
|
170
177
|
const proxyInfo = await super.newProxyInfo(sessionId, options);
|
|
171
178
|
if (!proxyInfo)
|
|
172
179
|
return proxyInfo;
|
|
@@ -177,7 +184,9 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
177
184
|
groups,
|
|
178
185
|
countryCode,
|
|
179
186
|
// this.password is not encoded, but the password from the URL will be, we need to normalize
|
|
180
|
-
password: this.usesApifyProxy
|
|
187
|
+
password: this.usesApifyProxy
|
|
188
|
+
? (password ?? '')
|
|
189
|
+
: decodeURIComponent(password),
|
|
181
190
|
hostname,
|
|
182
191
|
port: port,
|
|
183
192
|
};
|
|
@@ -185,7 +194,7 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
185
194
|
/**
|
|
186
195
|
* Returns a new proxy URL based on provided configuration options and the `sessionId` parameter.
|
|
187
196
|
* @param [sessionId]
|
|
188
|
-
* Represents the identifier of user {@
|
|
197
|
+
* Represents the identifier of user {@link Session} that can be managed by the {@link SessionPool} or
|
|
189
198
|
* you can use the Apify Proxy [Session](https://docs.apify.com/proxy#sessions) identifier.
|
|
190
199
|
* When the provided sessionId is a number, it's converted to a string.
|
|
191
200
|
*
|
|
@@ -198,21 +207,24 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
198
207
|
async newUrl(sessionId, options) {
|
|
199
208
|
if (typeof sessionId === 'number')
|
|
200
209
|
sessionId = `${sessionId}`;
|
|
201
|
-
(0, ow_1.default)(sessionId, ow_1.default.optional.string
|
|
210
|
+
(0, ow_1.default)(sessionId, ow_1.default.optional.string
|
|
211
|
+
.maxLength(MAX_SESSION_ID_LENGTH)
|
|
212
|
+
.matches(consts_1.APIFY_PROXY_VALUE_REGEX));
|
|
202
213
|
if (this.newUrlFunction) {
|
|
203
|
-
return (await this._callNewUrlFunction(sessionId, {
|
|
214
|
+
return ((await this._callNewUrlFunction(sessionId, {
|
|
215
|
+
request: options?.request,
|
|
216
|
+
})) ?? undefined);
|
|
204
217
|
}
|
|
205
218
|
if (this.proxyUrls) {
|
|
206
219
|
return this._handleCustomUrl(sessionId);
|
|
207
220
|
}
|
|
208
221
|
if (this.tieredProxyUrls) {
|
|
209
|
-
return this._handleTieredUrl(sessionId ?? (0, utilities_1.cryptoRandomObjectId)(6), options).proxyUrl ?? undefined;
|
|
222
|
+
return (this._handleTieredUrl(sessionId ?? (0, utilities_1.cryptoRandomObjectId)(6), options).proxyUrl ?? undefined);
|
|
210
223
|
}
|
|
211
224
|
return this.composeDefaultUrl(sessionId);
|
|
212
225
|
}
|
|
213
226
|
_generateTieredProxyUrls(tieredProxyConfig, globalOptions) {
|
|
214
|
-
return tieredProxyConfig
|
|
215
|
-
.map((config) => [
|
|
227
|
+
return tieredProxyConfig.map((config) => [
|
|
216
228
|
new ProxyConfiguration({
|
|
217
229
|
...globalOptions,
|
|
218
230
|
...config,
|
|
@@ -257,11 +269,11 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
257
269
|
if (token) {
|
|
258
270
|
let proxy;
|
|
259
271
|
try {
|
|
260
|
-
const user = await
|
|
272
|
+
const user = await actor_js_1.Actor.apifyClient.user().get();
|
|
261
273
|
proxy = user.proxy;
|
|
262
274
|
}
|
|
263
275
|
catch (error) {
|
|
264
|
-
if (
|
|
276
|
+
if (actor_js_1.Actor.isAtHome()) {
|
|
265
277
|
throw error;
|
|
266
278
|
}
|
|
267
279
|
else {
|
|
@@ -272,8 +284,8 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
272
284
|
const { password } = proxy;
|
|
273
285
|
if (this.password) {
|
|
274
286
|
if (this.password !== password) {
|
|
275
|
-
this.log.warning('The Apify Proxy password you provided belongs to'
|
|
276
|
-
|
|
287
|
+
this.log.warning('The Apify Proxy password you provided belongs to' +
|
|
288
|
+
' a different user than the Apify token you are using. Are you sure this is correct?');
|
|
277
289
|
}
|
|
278
290
|
}
|
|
279
291
|
else {
|
|
@@ -281,14 +293,14 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
281
293
|
}
|
|
282
294
|
}
|
|
283
295
|
if (!this.password) {
|
|
284
|
-
if (
|
|
285
|
-
throw new Error(`Apify Proxy password must be provided using options.password or the "${consts_1.APIFY_ENV_VARS.PROXY_PASSWORD}" environment variable. `
|
|
286
|
-
|
|
296
|
+
if (actor_js_1.Actor.isAtHome()) {
|
|
297
|
+
throw new Error(`Apify Proxy password must be provided using options.password or the "${consts_1.APIFY_ENV_VARS.PROXY_PASSWORD}" environment variable. ` +
|
|
298
|
+
`If you add the "${consts_1.APIFY_ENV_VARS.TOKEN}" environment variable, the password will be automatically inferred.`);
|
|
287
299
|
}
|
|
288
300
|
else {
|
|
289
|
-
this.log.warning(`No proxy password or token detected, running without proxy. To use Apify Proxy locally, `
|
|
290
|
-
|
|
291
|
-
|
|
301
|
+
this.log.warning(`No proxy password or token detected, running without proxy. To use Apify Proxy locally, ` +
|
|
302
|
+
`provide options.password or "${consts_1.APIFY_ENV_VARS.PROXY_PASSWORD}" environment variable. ` +
|
|
303
|
+
`If you add the "${consts_1.APIFY_ENV_VARS.TOKEN}" environment variable, the password will be automatically inferred.`);
|
|
292
304
|
}
|
|
293
305
|
}
|
|
294
306
|
}
|
|
@@ -300,8 +312,8 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
300
312
|
async _checkAccess() {
|
|
301
313
|
const status = await this._fetchStatus();
|
|
302
314
|
if (!status) {
|
|
303
|
-
this.log.warning('Apify Proxy access check timed out. Watch out for errors with status code 407. '
|
|
304
|
-
|
|
315
|
+
this.log.warning('Apify Proxy access check timed out. Watch out for errors with status code 407. ' +
|
|
316
|
+
"If you see some, it most likely means you don't have access to either all or some of the proxies you're trying to use.");
|
|
305
317
|
return true;
|
|
306
318
|
}
|
|
307
319
|
const { connected, connectionError, isManInTheMiddle } = status;
|
|
@@ -312,7 +324,7 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
312
324
|
// Throw only on the platform, locally we just print a warning and run requests without the proxy.
|
|
313
325
|
// This is because the user might not have set up things correctly yet.
|
|
314
326
|
// It still fails on the platform, where we don't want to allow this behavior.
|
|
315
|
-
if (
|
|
327
|
+
if (actor_js_1.Actor.isAtHome()) {
|
|
316
328
|
throw new Error(connectionError);
|
|
317
329
|
}
|
|
318
330
|
this.log.warning(connectionError);
|
|
@@ -345,9 +357,9 @@ class ProxyConfiguration extends core_1.ProxyConfiguration {
|
|
|
345
357
|
* @internal
|
|
346
358
|
*/
|
|
347
359
|
_throwCannotCombineCustomWithApify() {
|
|
348
|
-
throw new Error('Cannot combine custom proxies with Apify Proxy! '
|
|
349
|
-
|
|
350
|
-
|
|
360
|
+
throw new Error('Cannot combine custom proxies with Apify Proxy! ' +
|
|
361
|
+
'It is not allowed to set "options.proxyUrls" or "options.newUrlFunction" combined with ' +
|
|
362
|
+
'"options.groups" or "options.apifyProxyGroups" and "options.countryCode" or "options.apifyProxyCountry".');
|
|
351
363
|
}
|
|
352
364
|
}
|
|
353
365
|
exports.ProxyConfiguration = ProxyConfiguration;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"proxy_configuration.js","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":";;;;
|
|
1
|
+
{"version":3,"file":"proxy_configuration.js","sourceRoot":"","sources":["../src/proxy_configuration.ts"],"names":[],"mappings":";;;;AAIA,wCAA6E;AAC7E,0CAA6C;AAE7C,oDAAoB;AAEpB,0CAAwE;AACxE,gDAAwD;AAExD,yCAAmC;AACnC,yDAAmD;AAEnD,oEAAoE;AACpE,MAAM,qBAAqB,GAAG,EAAE,CAAC;AACjC,MAAM,mCA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Y,EAAE,MAAM;SACd,CAAC;QAEX,KAAK,IAAI,OAAO,GAAG,CAAC,EAAE,OAAO,IAAI,yBAAyB,EAAE,OAAO,EAAE,EAAE,CAAC;YACpE,IAAI,CAAC;gBACD,MAAM,QAAQ,GAAG,MAAM,IAAA,mBAAW,EAI/B,WAAW,CAAC,CAAC;gBAChB,OAAO,QAAQ,CAAC,IAAI,CAAC;YACzB,CAAC;YAAC,MAAM,CAAC;gBACL,0BAA0B;YAC9B,CAAC;QACL,CAAC;QAED,OAAO,SAAS,CAAC;IACrB,CAAC;IAED;;;OAGG;IACO,kCAAkC;QACxC,MAAM,IAAI,KAAK,CACX,kDAAkD;YAC9C,yFAAyF;YACzF,0GAA0G,CACjH,CAAC;IACN,CAAC;CACJ;AAvYD,gDAuYC"}
|
package/dist/utils.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"utils.d.ts","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":"AAgBA;;;GAGG;AACH,wBAAgB,aAAa;;;;;;EAQ5B;AAED;;GAEG;AACH,wBAAgB,mBAAmB,SA4ClC;AAED;;;GAGG;AACH,wBAAgB,uBAAuB,SAQtC"}
|
package/dist/utils.js
CHANGED
|
@@ -6,15 +6,15 @@ exports.printOutdatedSdkWarning = printOutdatedSdkWarning;
|
|
|
6
6
|
const tslib_1 = require("tslib");
|
|
7
7
|
const node_os_1 = require("node:os");
|
|
8
8
|
const node_path_1 = require("node:path");
|
|
9
|
-
|
|
10
|
-
const log_1 = tslib_1.__importDefault(require("@apify/log"));
|
|
11
|
-
// @ts-expect-error if we enable resolveJsonModule, we end up with `src` folder in `dist`
|
|
9
|
+
// @ts-ignore if we enable resolveJsonModule, we end up with `src` folder in `dist`
|
|
12
10
|
const package_json_1 = require("@crawlee/core/package.json");
|
|
13
|
-
// @ts-
|
|
11
|
+
// @ts-ignore if we enable resolveJsonModule, we end up with `src` folder in `dist`
|
|
14
12
|
const package_json_2 = require("apify-client/package.json");
|
|
15
13
|
const fs_extra_1 = require("fs-extra");
|
|
16
14
|
const semver_1 = tslib_1.__importDefault(require("semver"));
|
|
17
|
-
|
|
15
|
+
const consts_1 = require("@apify/consts");
|
|
16
|
+
const log_1 = tslib_1.__importDefault(require("@apify/log"));
|
|
17
|
+
// @ts-ignore if we enable resolveJsonModule, we end up with `src` folder in `dist`
|
|
18
18
|
const package_json_3 = require("./package.json");
|
|
19
19
|
/**
|
|
20
20
|
* Gets info about system, node version and apify package version.
|
|
@@ -63,7 +63,6 @@ function checkCrawleeVersion() {
|
|
|
63
63
|
}
|
|
64
64
|
if (version != null && version !== package_json_1.version) {
|
|
65
65
|
const details = `User installed version (${version}) found in ${path}.\nSDK uses ${package_json_1.version} from ${require.resolve('@crawlee/core')}`;
|
|
66
|
-
// eslint-disable-next-line max-len
|
|
67
66
|
throw new Error(`Detected incompatible Crawlee version used by the SDK. User installed ${version} but the SDK uses ${package_json_1.version}.\n\n${details}`);
|
|
68
67
|
}
|
|
69
68
|
}
|
package/dist/utils.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;
|
|
1
|
+
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../src/utils.ts"],"names":[],"mappings":";;AAoBA,sCAQC;AAKD,kDA4CC;AAMD,0DAQC;;AA3FD,qCAA+B;AAC/B,yCAAsC;AAEtC,mFAAmF;AACnF,6DAAuE;AACvE,mFAAmF;AACnF,4DAA0E;AAC1E,uCAAwD;AACxD,4DAA4B;AAE5B,0CAA+C;AAC/C,6DAA6B;AAE7B,mFAAmF;AACnF,kDAA0D;AAE1D;;;GAGG;AACH,SAAgB,aAAa;IACzB,OAAO;QACH,YAAY,EAAZ,sBAAY;QACZ,kBAAkB,EAAlB,sBAAkB;QAClB,cAAc,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GAGG;AACH,SAAgB,uBAAuB;IACnC,IAAI,OAAO,CAAC,GAAG,CAAC,uBAAc,CAAC,wBAAwB,CAAC;QAAE,OAAO;IACjE,MAAM,kBAAkB,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAc,CAAC,kBAAkB,CAAC,CAAC;IAC1E,IAAI,CAAC,kBAAkB,IAAI,CAAC,gBAAM,CAAC,EAAE,CAAC,sBAAY,EAAE,kBAAkB,CAAC;QACnE,OAAO;IAEX,aAAG,CAAC,OAAO,CAAC,sCAAsC,sBAAY,qEAAqE,kBAAkB;iIACxB,CAAC,CAAC;AACnI,CAAC"}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apify",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.4.1-beta.29+ccae1ac973",
|
|
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": ">=16.0.0"
|
|
@@ -48,7 +48,7 @@
|
|
|
48
48
|
"clean": "rimraf ./dist",
|
|
49
49
|
"compile": "tsc -p tsconfig.build.json && gen-esm-wrapper ./dist/index.js ./dist/index.mjs",
|
|
50
50
|
"copy": "tsx ../../scripts/copy.ts --readme=local",
|
|
51
|
-
"fixApifyExport": "
|
|
51
|
+
"fixApifyExport": "node ../../scripts/temp_fix_apify_exports.mjs"
|
|
52
52
|
},
|
|
53
53
|
"publishConfig": {
|
|
54
54
|
"access": "public"
|
|
@@ -76,5 +76,5 @@
|
|
|
76
76
|
}
|
|
77
77
|
}
|
|
78
78
|
},
|
|
79
|
-
"gitHead": "
|
|
79
|
+
"gitHead": "ccae1ac9737dfc5bfc64e4586846e413ddb54a37"
|
|
80
80
|
}
|