apify 4.0.0-beta.38 → 4.0.0-beta.39
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/dist/actor.d.ts +22 -28
- package/dist/actor.js +21 -27
- package/dist/apify_dataset_backend.js +1 -1
- package/dist/apify_key_value_store_backend.js +3 -1
- package/dist/apify_request_queue_backend.js +1 -1
- package/dist/charging.js +2 -2
- package/dist/configuration.d.ts +6 -6
- package/dist/enqueue_links_filters.d.ts +2 -2
- package/dist/enqueue_links_filters.js +1 -1
- package/dist/proxy_configuration.d.ts +3 -4
- package/dist/proxy_configuration.js +5 -5
- package/package.json +6 -6
package/dist/actor.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { EventManager, EventTypeName, RecordOptions, UseStateOptions } from '@crawlee/core';
|
|
2
2
|
import { Dataset, KeyValueStore, RequestQueue } from '@crawlee/core';
|
|
3
3
|
import type { Awaitable, Dictionary, StorageBackend } from '@crawlee/types';
|
|
4
|
-
import type { ActorCallOptions, ActorStartOptions, ApifyClientOptions, RunAbortOptions, TaskCallOptions, Webhook, WebhookEventType } from 'apify-client';
|
|
4
|
+
import type { ActorCallOptions, ActorInput, ActorStartOptions, ApifyClientOptions, RunAbortOptions, TaskCallOptions, Webhook, WebhookEventType } from 'apify-client';
|
|
5
5
|
import { ActorRun as ClientActorRun, ApifyClient } from 'apify-client';
|
|
6
6
|
import { type ACTOR_PERMISSION_LEVEL } from '@apify/consts';
|
|
7
7
|
import type { RequestQueueAccessMode } from './apify_request_queue_backend.js';
|
|
@@ -222,11 +222,11 @@ export interface Timeout {
|
|
|
222
222
|
*/
|
|
223
223
|
timeout?: number | 'inherit';
|
|
224
224
|
}
|
|
225
|
-
export interface CallOptions extends Omit<ActorCallOptions, '
|
|
225
|
+
export interface CallOptions extends Omit<ActorCallOptions, 'runTimeoutSecs'>, Token, Timeout {
|
|
226
226
|
}
|
|
227
|
-
export interface StartOptions extends Omit<ActorStartOptions, 'waitForFinish' | '
|
|
227
|
+
export interface StartOptions extends Omit<ActorStartOptions, 'waitForFinish' | 'runTimeoutSecs'>, Token, Timeout {
|
|
228
228
|
}
|
|
229
|
-
export interface CallTaskOptions extends Omit<TaskCallOptions, '
|
|
229
|
+
export interface CallTaskOptions extends Omit<TaskCallOptions, 'runTimeoutSecs'>, Token, Timeout {
|
|
230
230
|
}
|
|
231
231
|
export interface AbortOptions extends RunAbortOptions, Token {
|
|
232
232
|
/** Exit with given status message */
|
|
@@ -293,7 +293,7 @@ export interface MetamorphOptions {
|
|
|
293
293
|
* Content type for the `input`. If not specified,
|
|
294
294
|
* `input` is expected to be an object that will be stringified to JSON and content type set to
|
|
295
295
|
* `application/json; charset=utf-8`. If `options.contentType` is specified, then `input` must be a
|
|
296
|
-
* `
|
|
296
|
+
* `Buffer`.
|
|
297
297
|
*/
|
|
298
298
|
contentType?: string;
|
|
299
299
|
/**
|
|
@@ -446,13 +446,12 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
446
446
|
* @param actorId
|
|
447
447
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
448
448
|
* @param [input]
|
|
449
|
-
* Input for the Actor.
|
|
450
|
-
*
|
|
451
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
449
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
450
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
452
451
|
* @param [options]
|
|
453
452
|
* @ignore
|
|
454
453
|
*/
|
|
455
|
-
call(actorId: string, input?:
|
|
454
|
+
call(actorId: string, input?: ActorInput, options?: CallOptions): Promise<ClientActorRun>;
|
|
456
455
|
/**
|
|
457
456
|
* Runs an Actor on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable),
|
|
458
457
|
* unlike `Actor.call`, this method just starts the run without waiting for finish.
|
|
@@ -471,13 +470,12 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
471
470
|
* @param actorId
|
|
472
471
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
473
472
|
* @param [input]
|
|
474
|
-
* Input for the Actor.
|
|
475
|
-
*
|
|
476
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
473
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
474
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
477
475
|
* @param [options]
|
|
478
476
|
* @ignore
|
|
479
477
|
*/
|
|
480
|
-
start(actorId: string, input?:
|
|
478
|
+
start(actorId: string, input?: ActorInput, options?: StartOptions): Promise<ClientActorRun>;
|
|
481
479
|
/**
|
|
482
480
|
* Aborts given Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
|
|
483
481
|
*
|
|
@@ -529,13 +527,12 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
529
527
|
* @param targetActorId
|
|
530
528
|
* Either `username/actor-name` or Actor ID of an Actor to which we want to metamorph.
|
|
531
529
|
* @param [input]
|
|
532
|
-
* Input for the Actor.
|
|
533
|
-
*
|
|
534
|
-
* Otherwise, the `options.contentType` parameter must be provided.
|
|
530
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
531
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
535
532
|
* @param [options]
|
|
536
533
|
* @ignore
|
|
537
534
|
*/
|
|
538
|
-
metamorph(targetActorId: string, input?:
|
|
535
|
+
metamorph(targetActorId: string, input?: ActorInput, options?: MetamorphOptions): Promise<void>;
|
|
539
536
|
/**
|
|
540
537
|
* Internally reboots this Actor. The system stops the current container and starts
|
|
541
538
|
* a new container with the same run ID.
|
|
@@ -978,12 +975,11 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
978
975
|
* @param actorId
|
|
979
976
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
980
977
|
* @param [input]
|
|
981
|
-
* Input for the Actor.
|
|
982
|
-
*
|
|
983
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
978
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
979
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
984
980
|
* @param [options]
|
|
985
981
|
*/
|
|
986
|
-
static call(actorId: string, input?:
|
|
982
|
+
static call(actorId: string, input?: ActorInput, options?: CallOptions): Promise<ClientActorRun>;
|
|
987
983
|
/**
|
|
988
984
|
* Runs an Actor task on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
|
|
989
985
|
*
|
|
@@ -1028,9 +1024,8 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
1028
1024
|
* @param actorId
|
|
1029
1025
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
1030
1026
|
* @param [input]
|
|
1031
|
-
* Input for the Actor.
|
|
1032
|
-
*
|
|
1033
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
1027
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
1028
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
1034
1029
|
* @param [options]
|
|
1035
1030
|
*/
|
|
1036
1031
|
static start(actorId: string, input?: Dictionary, options?: StartOptions): Promise<ClientActorRun>;
|
|
@@ -1057,12 +1052,11 @@ export declare class Actor<Data extends Dictionary = Dictionary> {
|
|
|
1057
1052
|
* @param targetActorId
|
|
1058
1053
|
* Either `username/actor-name` or Actor ID of an Actor to which we want to metamorph.
|
|
1059
1054
|
* @param [input]
|
|
1060
|
-
* Input for the Actor.
|
|
1061
|
-
*
|
|
1062
|
-
* Otherwise, the `options.contentType` parameter must be provided.
|
|
1055
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
1056
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
1063
1057
|
* @param [options]
|
|
1064
1058
|
*/
|
|
1065
|
-
static metamorph(targetActorId: string, input?:
|
|
1059
|
+
static metamorph(targetActorId: string, input?: ActorInput, options?: MetamorphOptions): Promise<void>;
|
|
1066
1060
|
/**
|
|
1067
1061
|
* Internally reboots this Actor run. The system stops the current container and starts
|
|
1068
1062
|
* a new container with the same run id.
|
package/dist/actor.js
CHANGED
|
@@ -378,17 +378,16 @@ export class Actor {
|
|
|
378
378
|
* @param actorId
|
|
379
379
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
380
380
|
* @param [input]
|
|
381
|
-
* Input for the Actor.
|
|
382
|
-
*
|
|
383
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
381
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
382
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
384
383
|
* @param [options]
|
|
385
384
|
* @ignore
|
|
386
385
|
*/
|
|
387
386
|
async call(actorId, input, options = {}) {
|
|
388
|
-
const
|
|
389
|
-
const { token, ...rest } = options;
|
|
387
|
+
const runTimeoutSecs = options.timeout === 'inherit' ? this.getRemainingTimeSecs() : options.timeout;
|
|
388
|
+
const { token, timeout: _timeout, ...rest } = options;
|
|
390
389
|
const client = token ? this.newClient({ token }) : this.apifyClient;
|
|
391
|
-
return client.actor(actorId).call(input, { ...rest,
|
|
390
|
+
return client.actor(actorId).call(input, { ...rest, runTimeoutSecs });
|
|
392
391
|
}
|
|
393
392
|
/**
|
|
394
393
|
* Runs an Actor on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable),
|
|
@@ -408,17 +407,16 @@ export class Actor {
|
|
|
408
407
|
* @param actorId
|
|
409
408
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
410
409
|
* @param [input]
|
|
411
|
-
* Input for the Actor.
|
|
412
|
-
*
|
|
413
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
410
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
411
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
414
412
|
* @param [options]
|
|
415
413
|
* @ignore
|
|
416
414
|
*/
|
|
417
415
|
async start(actorId, input, options = {}) {
|
|
418
|
-
const
|
|
419
|
-
const { token, ...rest } = options;
|
|
416
|
+
const runTimeoutSecs = options.timeout === 'inherit' ? this.getRemainingTimeSecs() : options.timeout;
|
|
417
|
+
const { token, timeout: _timeout, ...rest } = options;
|
|
420
418
|
const client = token ? this.newClient({ token }) : this.apifyClient;
|
|
421
|
-
return client.actor(actorId).start(input, { ...rest,
|
|
419
|
+
return client.actor(actorId).start(input, { ...rest, runTimeoutSecs });
|
|
422
420
|
}
|
|
423
421
|
/**
|
|
424
422
|
* Aborts given Actor run on the Apify platform using the current user account (determined by the `APIFY_TOKEN` environment variable).
|
|
@@ -472,10 +470,10 @@ export class Actor {
|
|
|
472
470
|
* @ignore
|
|
473
471
|
*/
|
|
474
472
|
async callTask(taskId, input, options = {}) {
|
|
475
|
-
const
|
|
476
|
-
const { token, ...rest } = options;
|
|
473
|
+
const runTimeoutSecs = options.timeout === 'inherit' ? this.getRemainingTimeSecs() : options.timeout;
|
|
474
|
+
const { token, timeout: _timeout, ...rest } = options;
|
|
477
475
|
const client = token ? this.newClient({ token }) : this.apifyClient;
|
|
478
|
-
return client.task(taskId).call(input, { ...rest,
|
|
476
|
+
return client.task(taskId).call(input, { ...rest, runTimeoutSecs });
|
|
479
477
|
}
|
|
480
478
|
/**
|
|
481
479
|
* Transforms this Actor run to an Actor run of a given Actor. The system stops the current container and starts
|
|
@@ -485,9 +483,8 @@ export class Actor {
|
|
|
485
483
|
* @param targetActorId
|
|
486
484
|
* Either `username/actor-name` or Actor ID of an Actor to which we want to metamorph.
|
|
487
485
|
* @param [input]
|
|
488
|
-
* Input for the Actor.
|
|
489
|
-
*
|
|
490
|
-
* Otherwise, the `options.contentType` parameter must be provided.
|
|
486
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
487
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
491
488
|
* @param [options]
|
|
492
489
|
* @ignore
|
|
493
490
|
*/
|
|
@@ -1224,9 +1221,8 @@ export class Actor {
|
|
|
1224
1221
|
* @param actorId
|
|
1225
1222
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
1226
1223
|
* @param [input]
|
|
1227
|
-
* Input for the Actor.
|
|
1228
|
-
*
|
|
1229
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
1224
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
1225
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
1230
1226
|
* @param [options]
|
|
1231
1227
|
*/
|
|
1232
1228
|
static async call(actorId, input, options = {}) {
|
|
@@ -1278,9 +1274,8 @@ export class Actor {
|
|
|
1278
1274
|
* @param actorId
|
|
1279
1275
|
* Allowed formats are `username/actor-name`, `userId/actor-name` or Actor ID.
|
|
1280
1276
|
* @param [input]
|
|
1281
|
-
* Input for the Actor.
|
|
1282
|
-
*
|
|
1283
|
-
* Otherwise the `options.contentType` parameter must be provided.
|
|
1277
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
1278
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
1284
1279
|
* @param [options]
|
|
1285
1280
|
*/
|
|
1286
1281
|
static async start(actorId, input, options = {}) {
|
|
@@ -1311,9 +1306,8 @@ export class Actor {
|
|
|
1311
1306
|
* @param targetActorId
|
|
1312
1307
|
* Either `username/actor-name` or Actor ID of an Actor to which we want to metamorph.
|
|
1313
1308
|
* @param [input]
|
|
1314
|
-
* Input for the Actor.
|
|
1315
|
-
*
|
|
1316
|
-
* Otherwise, the `options.contentType` parameter must be provided.
|
|
1309
|
+
* Input for the Actor. A plain object is stringified to JSON with content type
|
|
1310
|
+
* `application/json; charset=utf-8`. A `Buffer` is sent as-is and needs `options.contentType`.
|
|
1317
1311
|
* @param [options]
|
|
1318
1312
|
*/
|
|
1319
1313
|
static async metamorph(targetActorId, input, options = {}) {
|
|
@@ -16,7 +16,7 @@ export class ApifyKeyValueStoreBackend {
|
|
|
16
16
|
if (!metadata) {
|
|
17
17
|
throw new Error('Key-value store not found or has been deleted.');
|
|
18
18
|
}
|
|
19
|
-
return metadata;
|
|
19
|
+
return { ...metadata, name: metadata.name ?? undefined };
|
|
20
20
|
}
|
|
21
21
|
async drop() {
|
|
22
22
|
await this.#client.delete();
|
|
@@ -42,6 +42,8 @@ export class ApifyKeyValueStoreBackend {
|
|
|
42
42
|
// requires the field, so it is left undefined via the cast.
|
|
43
43
|
return {
|
|
44
44
|
...result,
|
|
45
|
+
exclusiveStartKey: result.exclusiveStartKey ?? undefined,
|
|
46
|
+
nextExclusiveStartKey: result.nextExclusiveStartKey ?? undefined,
|
|
45
47
|
items: result.items.map(({ key, size }) => ({ key, size })),
|
|
46
48
|
};
|
|
47
49
|
}
|
package/dist/charging.js
CHANGED
|
@@ -102,9 +102,9 @@ export class ChargingManager {
|
|
|
102
102
|
}
|
|
103
103
|
// Load per-event pricing information
|
|
104
104
|
if (pricingInfo?.pricingModel === 'PAY_PER_EVENT') {
|
|
105
|
-
for (const [eventName, eventPricing] of Object.entries(pricingInfo.pricingPerEvent.actorChargeEvents)) {
|
|
105
|
+
for (const [eventName, eventPricing] of Object.entries(pricingInfo.pricingPerEvent.actorChargeEvents ?? {})) {
|
|
106
106
|
this.#pricingInfo[eventName] = {
|
|
107
|
-
price: eventPricing.eventPriceUsd,
|
|
107
|
+
price: eventPricing.eventPriceUsd ?? 0,
|
|
108
108
|
title: eventPricing.eventTitle,
|
|
109
109
|
};
|
|
110
110
|
}
|
package/dist/configuration.d.ts
CHANGED
|
@@ -2,13 +2,13 @@ import type { ConfigField, FieldsInput, FieldsOutput } from '@crawlee/core';
|
|
|
2
2
|
import { Configuration as CoreConfiguration } from '@crawlee/core';
|
|
3
3
|
import { z } from 'zod';
|
|
4
4
|
export declare const apifyConfigFields: {
|
|
5
|
-
maxUsedCpuRatio: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodNumber>>>;
|
|
6
|
-
internalTimeoutMillis: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodNumber>>>;
|
|
7
|
-
systemInfoIntervalMillis: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodNumber>>>;
|
|
8
|
-
logLevel: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodEnum<typeof import("@crawlee/core").LogLevel
|
|
9
|
-
persistStorage: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
5
|
+
maxUsedCpuRatio: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
6
|
+
internalTimeoutMillis: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
7
|
+
systemInfoIntervalMillis: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
8
|
+
logLevel: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodEnum<typeof import("@crawlee/core").LogLevel>, unknown>>>;
|
|
9
|
+
persistStorage: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodBoolean, unknown>>>;
|
|
10
10
|
storageDir: ConfigField<z.ZodDefault<z.ZodString>>;
|
|
11
|
-
containerized: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean>>>;
|
|
11
|
+
containerized: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodBoolean, unknown>>>;
|
|
12
12
|
inputKey: ConfigField<z.ZodDefault<z.ZodString>>;
|
|
13
13
|
memoryMbytes: ConfigField<z.ZodOptional<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
14
14
|
availableMemoryRatio: ConfigField<z.ZodDefault<z.ZodPreprocess<z.ZodNumber, unknown>>>;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { RequestOptions
|
|
1
|
+
import type { RequestOptions } from '@crawlee/core';
|
|
2
2
|
/** Request options that the `globs` and `pseudoUrls` input editors can attach to a single URL pattern. */
|
|
3
3
|
export interface UrlPatternRequestOptions extends Pick<RequestOptions, 'method' | 'payload' | 'label' | 'userData' | 'headers'> {
|
|
4
4
|
}
|
|
@@ -26,4 +26,4 @@ export interface UrlPatternFilters {
|
|
|
26
26
|
* await enqueueLinks({ transformRequestFunction: createTransformRequestFunction({ globs: input.globs }) });
|
|
27
27
|
* ```
|
|
28
28
|
*/
|
|
29
|
-
export declare function createTransformRequestFunction({ globs, pseudoUrls }: UrlPatternFilters):
|
|
29
|
+
export declare function createTransformRequestFunction({ globs, pseudoUrls, }: UrlPatternFilters): (request: RequestOptions) => RequestOptions | false | 'unchanged';
|
|
@@ -10,7 +10,7 @@ import { purlToRegExp } from '@apify/pseudo_url';
|
|
|
10
10
|
* await enqueueLinks({ transformRequestFunction: createTransformRequestFunction({ globs: input.globs }) });
|
|
11
11
|
* ```
|
|
12
12
|
*/
|
|
13
|
-
export function createTransformRequestFunction({ globs = [], pseudoUrls = [] }) {
|
|
13
|
+
export function createTransformRequestFunction({ globs = [], pseudoUrls = [], }) {
|
|
14
14
|
const patterns = [
|
|
15
15
|
...globs.flatMap((item) => {
|
|
16
16
|
if (item == null) {
|
|
@@ -8,7 +8,6 @@ interface ProxyStatus {
|
|
|
8
8
|
connectionError: string;
|
|
9
9
|
isManInTheMiddle: boolean;
|
|
10
10
|
}
|
|
11
|
-
type NewUrlOptions = Parameters<CoreProxyConfiguration['newProxyInfo']>[0];
|
|
12
11
|
export interface ProxyConfigurationOptions extends CoreProxyConfigurationOptions {
|
|
13
12
|
/**
|
|
14
13
|
* User's password for the proxy. By default, it is taken from the `APIFY_PROXY_PASSWORD`
|
|
@@ -153,7 +152,7 @@ export interface ProxyInfo extends CoreProxyInfo {
|
|
|
153
152
|
export declare class ProxyConfiguration extends CoreProxyConfiguration {
|
|
154
153
|
#private;
|
|
155
154
|
readonly configuration: Configuration;
|
|
156
|
-
protected readonly log: import("@
|
|
155
|
+
protected readonly log: import("@crawlee/core").Log;
|
|
157
156
|
/**
|
|
158
157
|
* @internal
|
|
159
158
|
*/
|
|
@@ -174,13 +173,13 @@ export declare class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
174
173
|
* independent URL; for Apify Proxy a random session id is embedded so consecutive
|
|
175
174
|
* calls resolve to different IPs.
|
|
176
175
|
*/
|
|
177
|
-
newProxyInfo(
|
|
176
|
+
newProxyInfo(): Promise<ProxyInfo | undefined>;
|
|
178
177
|
/**
|
|
179
178
|
* Returns a new proxy URL. For Apify Proxy, each call generates a URL with a fresh
|
|
180
179
|
* random session id, so consecutive calls return independent URLs. For custom
|
|
181
180
|
* `proxyUrls`, the URLs are rotated round-robin.
|
|
182
181
|
*/
|
|
183
|
-
newUrl(
|
|
182
|
+
newUrl(): Promise<string | undefined>;
|
|
184
183
|
/**
|
|
185
184
|
* Returns proxy username.
|
|
186
185
|
*/
|
|
@@ -147,8 +147,8 @@ export class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
147
147
|
* independent URL; for Apify Proxy a random session id is embedded so consecutive
|
|
148
148
|
* calls resolve to different IPs.
|
|
149
149
|
*/
|
|
150
|
-
async newProxyInfo(
|
|
151
|
-
const url = await this.newUrl(
|
|
150
|
+
async newProxyInfo() {
|
|
151
|
+
const url = await this.newUrl();
|
|
152
152
|
if (!url)
|
|
153
153
|
return undefined;
|
|
154
154
|
const parsed = new URL(url);
|
|
@@ -173,9 +173,9 @@ export class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
173
173
|
* random session id, so consecutive calls return independent URLs. For custom
|
|
174
174
|
* `proxyUrls`, the URLs are rotated round-robin.
|
|
175
175
|
*/
|
|
176
|
-
async newUrl(
|
|
176
|
+
async newUrl() {
|
|
177
177
|
if (!this.#usesApifyProxy) {
|
|
178
|
-
return super.newUrl(
|
|
178
|
+
return super.newUrl();
|
|
179
179
|
}
|
|
180
180
|
return this.composeDefaultUrl(cryptoRandomObjectId(SESSION_ID_LENGTH));
|
|
181
181
|
}
|
|
@@ -213,7 +213,7 @@ export class ProxyConfiguration extends CoreProxyConfiguration {
|
|
|
213
213
|
return;
|
|
214
214
|
try {
|
|
215
215
|
const user = await Actor.apifyClient.user().get();
|
|
216
|
-
this.#password = user
|
|
216
|
+
this.#password = user?.proxy?.password;
|
|
217
217
|
}
|
|
218
218
|
catch (error) {
|
|
219
219
|
if (Actor.isAtHome()) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "apify",
|
|
3
|
-
"version": "4.0.0-beta.
|
|
3
|
+
"version": "4.0.0-beta.39",
|
|
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"
|
|
@@ -61,10 +61,10 @@
|
|
|
61
61
|
"@apify/timeout": "^1.0.1",
|
|
62
62
|
"@apify/utilities": "^3.0.1",
|
|
63
63
|
"@apify/validations": "^1.1.0",
|
|
64
|
-
"@crawlee/core": "
|
|
65
|
-
"@crawlee/types": "
|
|
66
|
-
"@crawlee/utils": "
|
|
67
|
-
"apify-client": "^
|
|
64
|
+
"@crawlee/core": ">=4.0.0-beta.194 <4.0.0-rc.0 || >4.0.0-rc.0 <5.0.0",
|
|
65
|
+
"@crawlee/types": ">=4.0.0-beta.194 <4.0.0-rc.0 || >4.0.0-rc.0 <5.0.0",
|
|
66
|
+
"@crawlee/utils": ">=4.0.0-beta.194 <4.0.0-rc.0 || >4.0.0-rc.0 <5.0.0",
|
|
67
|
+
"apify-client": "^3.0.0-beta.26",
|
|
68
68
|
"minimatch": "^10.2.6",
|
|
69
69
|
"semver": "^7.8.5",
|
|
70
70
|
"tslib": "^2.8.1",
|
|
@@ -81,7 +81,7 @@
|
|
|
81
81
|
"@types/tough-cookie": "^4.0.5",
|
|
82
82
|
"@types/ws": "^8.18.1",
|
|
83
83
|
"commitlint": "^21.2.2",
|
|
84
|
-
"crawlee": "
|
|
84
|
+
"crawlee": ">=4.0.0-beta.194 <4.0.0-rc.0 || >4.0.0-rc.0 <5.0.0",
|
|
85
85
|
"husky": "^9.1.7",
|
|
86
86
|
"lint-staged": "^17.3.0",
|
|
87
87
|
"oxfmt": "0.64.0",
|