@crawlee/core 3.0.3-beta.9 → 3.0.3
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 +1 -1
- package/autoscaling/autoscaled_pool.d.ts +16 -16
- package/autoscaling/autoscaled_pool.js +13 -13
- package/autoscaling/snapshotter.d.ts +1 -1
- package/autoscaling/snapshotter.js +1 -1
- package/autoscaling/system_status.d.ts +12 -12
- package/autoscaling/system_status.js +11 -11
- package/configuration.d.ts +10 -10
- package/configuration.js +4 -4
- package/crawlers/crawler_commons.d.ts +2 -2
- package/crawlers/statistics.d.ts +1 -1
- package/crawlers/statistics.js +1 -1
- package/enqueue_links/enqueue_links.d.ts +14 -13
- package/enqueue_links/enqueue_links.d.ts.map +1 -1
- package/enqueue_links/enqueue_links.js +6 -5
- package/enqueue_links/enqueue_links.js.map +1 -1
- package/enqueue_links/shared.d.ts +2 -2
- package/errors.d.ts +6 -0
- package/errors.d.ts.map +1 -1
- package/errors.js +10 -1
- package/errors.js.map +1 -1
- package/index.mjs +1 -0
- package/package.json +4 -4
- package/proxy_configuration.d.ts +11 -11
- package/proxy_configuration.js +8 -8
- package/request.d.ts +3 -3
- package/request.js +2 -2
- package/session_pool/session.d.ts +1 -1
- package/session_pool/session_pool.d.ts +12 -12
- package/session_pool/session_pool.d.ts.map +1 -1
- package/session_pool/session_pool.js +10 -10
- package/storages/dataset.d.ts +14 -14
- package/storages/dataset.js +8 -8
- package/storages/key_value_store.d.ts +26 -36
- package/storages/key_value_store.d.ts.map +1 -1
- package/storages/key_value_store.js +47 -33
- package/storages/key_value_store.js.map +1 -1
- package/storages/request_list.d.ts +33 -33
- package/storages/request_list.js +23 -23
- package/storages/request_queue.d.ts +25 -25
- package/storages/request_queue.js +23 -23
- package/storages/utils.d.ts +1 -1
- package/storages/utils.js +1 -1
- package/tsconfig.build.tsbuildinfo +1 -1
|
@@ -18,16 +18,16 @@ export declare const maybeStringify: <T>(value: T, options: {
|
|
|
18
18
|
* for saving screenshots, crawler inputs and outputs, web pages, PDFs or to persist the state of crawlers.
|
|
19
19
|
*
|
|
20
20
|
* Do not instantiate this class directly, use the
|
|
21
|
-
* {@
|
|
21
|
+
* {@apilink KeyValueStore.open} function instead.
|
|
22
22
|
*
|
|
23
23
|
* Each crawler run is associated with a default key-value store, which is created exclusively
|
|
24
24
|
* for the run. By convention, the crawler input and output are stored into the
|
|
25
25
|
* default key-value store under the `INPUT` and `OUTPUT` key, respectively.
|
|
26
26
|
* Typically, input and output are JSON files, although it can be any other format.
|
|
27
27
|
* To access the default key-value store directly, you can use the
|
|
28
|
-
* {@
|
|
28
|
+
* {@apilink KeyValueStore.getValue} and {@apilink KeyValueStore.setValue} convenience functions.
|
|
29
29
|
*
|
|
30
|
-
* To access the input, you can also use the {@
|
|
30
|
+
* To access the input, you can also use the {@apilink KeyValueStore.getInput} convenience function.
|
|
31
31
|
*
|
|
32
32
|
* `KeyValueStore` stores its data on a local disk.
|
|
33
33
|
*
|
|
@@ -93,7 +93,7 @@ export declare class KeyValueStore {
|
|
|
93
93
|
* If the record does not exist, the function resolves to `null`.
|
|
94
94
|
*
|
|
95
95
|
* To save or delete a value in the key-value store, use the
|
|
96
|
-
* {@
|
|
96
|
+
* {@apilink KeyValueStore.setValue} function.
|
|
97
97
|
*
|
|
98
98
|
* **Example usage:**
|
|
99
99
|
*
|
|
@@ -141,7 +141,7 @@ export declare class KeyValueStore {
|
|
|
141
141
|
* regardless whether the record existed or not.
|
|
142
142
|
*
|
|
143
143
|
* To retrieve a value from the key-value store, use the
|
|
144
|
-
* {@
|
|
144
|
+
* {@apilink KeyValueStore.getValue} function.
|
|
145
145
|
*
|
|
146
146
|
* **IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`,
|
|
147
147
|
* otherwise the crawler process might finish before the value is stored!
|
|
@@ -189,13 +189,13 @@ export declare class KeyValueStore {
|
|
|
189
189
|
forEachKey(iteratee: KeyConsumer, options?: KeyValueStoreIteratorOptions): Promise<void>;
|
|
190
190
|
private _forEachKey;
|
|
191
191
|
/**
|
|
192
|
-
* Opens a key-value store and returns a promise resolving to an instance of the {@
|
|
192
|
+
* Opens a key-value store and returns a promise resolving to an instance of the {@apilink KeyValueStore} class.
|
|
193
193
|
*
|
|
194
194
|
* Key-value stores are used to store records or files, along with their MIME content type.
|
|
195
195
|
* The records are stored and retrieved using a unique key.
|
|
196
196
|
* The actual data is stored either on a local filesystem or in the Apify cloud.
|
|
197
197
|
*
|
|
198
|
-
* For more details and code examples, see the {@
|
|
198
|
+
* For more details and code examples, see the {@apilink KeyValueStore} class.
|
|
199
199
|
*
|
|
200
200
|
* @param [storeIdOrName]
|
|
201
201
|
* ID or name of the key-value store to be opened. If `null` or `undefined`,
|
|
@@ -204,9 +204,9 @@ export declare class KeyValueStore {
|
|
|
204
204
|
*/
|
|
205
205
|
static open(storeIdOrName?: string | null, options?: StorageManagerOptions): Promise<KeyValueStore>;
|
|
206
206
|
/**
|
|
207
|
-
* Gets a value from the default {@
|
|
207
|
+
* Gets a value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
208
208
|
*
|
|
209
|
-
* This is just a convenient shortcut for {@
|
|
209
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.getValue}.
|
|
210
210
|
* For example, calling the following code:
|
|
211
211
|
* ```javascript
|
|
212
212
|
* const value = await KeyValueStore.getValue('my-key');
|
|
@@ -218,10 +218,10 @@ export declare class KeyValueStore {
|
|
|
218
218
|
* const value = await store.getValue('my-key');
|
|
219
219
|
* ```
|
|
220
220
|
*
|
|
221
|
-
* To store the value to the default key-value store, you can use the {@
|
|
221
|
+
* To store the value to the default key-value store, you can use the {@apilink KeyValueStore.setValue} function.
|
|
222
222
|
*
|
|
223
|
-
* For more information, see {@
|
|
224
|
-
* and {@
|
|
223
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
224
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
225
225
|
*
|
|
226
226
|
* @param key Unique record key.
|
|
227
227
|
* @param defaultValue Fallback that will be returned if no value if present in the storage.
|
|
@@ -235,9 +235,9 @@ export declare class KeyValueStore {
|
|
|
235
235
|
static getValue<T = unknown>(key: string, defaultValue?: T): Promise<T | null>;
|
|
236
236
|
static getAutoSavedValue<T extends Dictionary = Dictionary>(key: string, defaultValue?: T): Promise<T>;
|
|
237
237
|
/**
|
|
238
|
-
* Stores or deletes a value in the default {@
|
|
238
|
+
* Stores or deletes a value in the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
239
239
|
*
|
|
240
|
-
* This is just a convenient shortcut for {@
|
|
240
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.setValue}.
|
|
241
241
|
* For example, calling the following code:
|
|
242
242
|
* ```javascript
|
|
243
243
|
* await KeyValueStore.setValue('OUTPUT', { foo: "bar" });
|
|
@@ -249,10 +249,10 @@ export declare class KeyValueStore {
|
|
|
249
249
|
* await store.setValue('OUTPUT', { foo: "bar" });
|
|
250
250
|
* ```
|
|
251
251
|
*
|
|
252
|
-
* To get a value from the default key-value store, you can use the {@
|
|
252
|
+
* To get a value from the default key-value store, you can use the {@apilink KeyValueStore.getValue} function.
|
|
253
253
|
*
|
|
254
|
-
* For more information, see {@
|
|
255
|
-
* and {@
|
|
254
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
255
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
256
256
|
*
|
|
257
257
|
* @param key
|
|
258
258
|
* Unique record key.
|
|
@@ -267,26 +267,16 @@ export declare class KeyValueStore {
|
|
|
267
267
|
*/
|
|
268
268
|
static setValue<T>(key: string, value: T | null, options?: RecordOptions): Promise<void>;
|
|
269
269
|
/**
|
|
270
|
-
* Gets the crawler input value from the default {@
|
|
271
|
-
*
|
|
272
|
-
*
|
|
273
|
-
* For example, calling the following code:
|
|
274
|
-
* ```javascript
|
|
275
|
-
* const input = await KeyValueStore.getInput();
|
|
276
|
-
* ```
|
|
277
|
-
*
|
|
278
|
-
* is equivalent to:
|
|
279
|
-
* ```javascript
|
|
280
|
-
* const store = await KeyValueStore.open();
|
|
281
|
-
* await store.getValue('INPUT');
|
|
282
|
-
* ```
|
|
270
|
+
* Gets the crawler input value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
271
|
+
* By default, it will try to find root input files (either extension-less, `.json` or `.txt`),
|
|
272
|
+
* or alternatively read the input from the default {@apilink KeyValueStore}.
|
|
283
273
|
*
|
|
284
274
|
* Note that the `getInput()` function does not cache the value read from the key-value store.
|
|
285
275
|
* If you need to use the input multiple times in your crawler,
|
|
286
276
|
* it is far more efficient to read it once and store it locally.
|
|
287
277
|
*
|
|
288
|
-
* For more information, see
|
|
289
|
-
* and {@
|
|
278
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
279
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
290
280
|
*
|
|
291
281
|
* @returns
|
|
292
282
|
* Returns a promise that resolves to an object, string
|
|
@@ -298,13 +288,13 @@ export declare class KeyValueStore {
|
|
|
298
288
|
static getInput<T = Dictionary | string | Buffer>(): Promise<T | null>;
|
|
299
289
|
}
|
|
300
290
|
/**
|
|
301
|
-
* User-function used in the {@
|
|
291
|
+
* User-function used in the {@apilink KeyValueStore.forEachKey} method.
|
|
302
292
|
*/
|
|
303
293
|
export interface KeyConsumer {
|
|
304
294
|
/**
|
|
305
|
-
* @param key Current {@
|
|
306
|
-
* @param index Position of the current key in {@
|
|
307
|
-
* @param info Information about the current {@
|
|
295
|
+
* @param key Current {@apilink KeyValueStore} key being processed.
|
|
296
|
+
* @param index Position of the current key in {@apilink KeyValueStore}.
|
|
297
|
+
* @param info Information about the current {@apilink KeyValueStore} entry.
|
|
308
298
|
* @param info.size Size of the value associated with the current key in bytes.
|
|
309
299
|
*/
|
|
310
300
|
(key: string, index: number, info: {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key_value_store.d.ts","sourceRoot":"","sources":["../../src/storages/key_value_store.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU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AAW,WAAW;IACxB;;;;;OAKG;IACH,CAAC,GAAG,EAAE,MAAM,EAAE,KAAK,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,IAAI,EAAE,MAAM,CAAA;KAAE,GAAG,SAAS,CAAC,IAAI,CAAC,CAAC;CACzE;AAED,MAAM,WAAW,oBAAoB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,MAAM,EAAE,aAAa,CAAC;CACzB;AAED,MAAM,WAAW,aAAa;IAC1B;;OAEG;IACH,WAAW,CAAC,EAAE,MAAM,CAAC;CACxB;AAED,MAAM,WAAW,4BAA4B;IACzC;;OAEG;IACH,iBAAiB,CAAC,EAAE,MAAM,CAAC;CAC9B"}
|
|
@@ -5,6 +5,8 @@ const tslib_1 = require("tslib");
|
|
|
5
5
|
const consts_1 = require("@apify/consts");
|
|
6
6
|
const utilities_1 = require("@apify/utilities");
|
|
7
7
|
const ow_1 = tslib_1.__importStar(require("ow"));
|
|
8
|
+
const node_path_1 = require("node:path");
|
|
9
|
+
const promises_1 = require("node:fs/promises");
|
|
8
10
|
const configuration_1 = require("../configuration");
|
|
9
11
|
const storage_manager_1 = require("./storage_manager");
|
|
10
12
|
const utils_1 = require("./utils");
|
|
@@ -44,16 +46,16 @@ exports.maybeStringify = maybeStringify;
|
|
|
44
46
|
* for saving screenshots, crawler inputs and outputs, web pages, PDFs or to persist the state of crawlers.
|
|
45
47
|
*
|
|
46
48
|
* Do not instantiate this class directly, use the
|
|
47
|
-
* {@
|
|
49
|
+
* {@apilink KeyValueStore.open} function instead.
|
|
48
50
|
*
|
|
49
51
|
* Each crawler run is associated with a default key-value store, which is created exclusively
|
|
50
52
|
* for the run. By convention, the crawler input and output are stored into the
|
|
51
53
|
* default key-value store under the `INPUT` and `OUTPUT` key, respectively.
|
|
52
54
|
* Typically, input and output are JSON files, although it can be any other format.
|
|
53
55
|
* To access the default key-value store directly, you can use the
|
|
54
|
-
* {@
|
|
56
|
+
* {@apilink KeyValueStore.getValue} and {@apilink KeyValueStore.setValue} convenience functions.
|
|
55
57
|
*
|
|
56
|
-
* To access the input, you can also use the {@
|
|
58
|
+
* To access the input, you can also use the {@apilink KeyValueStore.getInput} convenience function.
|
|
57
59
|
*
|
|
58
60
|
* `KeyValueStore` stores its data on a local disk.
|
|
59
61
|
*
|
|
@@ -153,7 +155,7 @@ class KeyValueStore {
|
|
|
153
155
|
* If the record does not exist, the function resolves to `null`.
|
|
154
156
|
*
|
|
155
157
|
* To save or delete a value in the key-value store, use the
|
|
156
|
-
* {@
|
|
158
|
+
* {@apilink KeyValueStore.setValue} function.
|
|
157
159
|
*
|
|
158
160
|
* **Example usage:**
|
|
159
161
|
*
|
|
@@ -223,7 +225,7 @@ class KeyValueStore {
|
|
|
223
225
|
* regardless whether the record existed or not.
|
|
224
226
|
*
|
|
225
227
|
* To retrieve a value from the key-value store, use the
|
|
226
|
-
* {@
|
|
228
|
+
* {@apilink KeyValueStore.getValue} function.
|
|
227
229
|
*
|
|
228
230
|
* **IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`,
|
|
229
231
|
* otherwise the crawler process might finish before the value is stored!
|
|
@@ -333,13 +335,13 @@ class KeyValueStore {
|
|
|
333
335
|
: undefined; // [].forEach() returns undefined.
|
|
334
336
|
}
|
|
335
337
|
/**
|
|
336
|
-
* Opens a key-value store and returns a promise resolving to an instance of the {@
|
|
338
|
+
* Opens a key-value store and returns a promise resolving to an instance of the {@apilink KeyValueStore} class.
|
|
337
339
|
*
|
|
338
340
|
* Key-value stores are used to store records or files, along with their MIME content type.
|
|
339
341
|
* The records are stored and retrieved using a unique key.
|
|
340
342
|
* The actual data is stored either on a local filesystem or in the Apify cloud.
|
|
341
343
|
*
|
|
342
|
-
* For more details and code examples, see the {@
|
|
344
|
+
* For more details and code examples, see the {@apilink KeyValueStore} class.
|
|
343
345
|
*
|
|
344
346
|
* @param [storeIdOrName]
|
|
345
347
|
* ID or name of the key-value store to be opened. If `null` or `undefined`,
|
|
@@ -356,9 +358,9 @@ class KeyValueStore {
|
|
|
356
358
|
return manager.openStorage(storeIdOrName);
|
|
357
359
|
}
|
|
358
360
|
/**
|
|
359
|
-
* Gets a value from the default {@
|
|
361
|
+
* Gets a value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
360
362
|
*
|
|
361
|
-
* This is just a convenient shortcut for {@
|
|
363
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.getValue}.
|
|
362
364
|
* For example, calling the following code:
|
|
363
365
|
* ```javascript
|
|
364
366
|
* const value = await KeyValueStore.getValue('my-key');
|
|
@@ -370,10 +372,10 @@ class KeyValueStore {
|
|
|
370
372
|
* const value = await store.getValue('my-key');
|
|
371
373
|
* ```
|
|
372
374
|
*
|
|
373
|
-
* To store the value to the default key-value store, you can use the {@
|
|
375
|
+
* To store the value to the default key-value store, you can use the {@apilink KeyValueStore.setValue} function.
|
|
374
376
|
*
|
|
375
|
-
* For more information, see {@
|
|
376
|
-
* and {@
|
|
377
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
378
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
377
379
|
*
|
|
378
380
|
* @param key Unique record key.
|
|
379
381
|
* @param defaultValue Fallback that will be returned if no value if present in the storage.
|
|
@@ -393,9 +395,9 @@ class KeyValueStore {
|
|
|
393
395
|
return store.getAutoSavedValue(key, defaultValue);
|
|
394
396
|
}
|
|
395
397
|
/**
|
|
396
|
-
* Stores or deletes a value in the default {@
|
|
398
|
+
* Stores or deletes a value in the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
397
399
|
*
|
|
398
|
-
* This is just a convenient shortcut for {@
|
|
400
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.setValue}.
|
|
399
401
|
* For example, calling the following code:
|
|
400
402
|
* ```javascript
|
|
401
403
|
* await KeyValueStore.setValue('OUTPUT', { foo: "bar" });
|
|
@@ -407,10 +409,10 @@ class KeyValueStore {
|
|
|
407
409
|
* await store.setValue('OUTPUT', { foo: "bar" });
|
|
408
410
|
* ```
|
|
409
411
|
*
|
|
410
|
-
* To get a value from the default key-value store, you can use the {@
|
|
412
|
+
* To get a value from the default key-value store, you can use the {@apilink KeyValueStore.getValue} function.
|
|
411
413
|
*
|
|
412
|
-
* For more information, see {@
|
|
413
|
-
* and {@
|
|
414
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
415
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
414
416
|
*
|
|
415
417
|
* @param key
|
|
416
418
|
* Unique record key.
|
|
@@ -428,26 +430,16 @@ class KeyValueStore {
|
|
|
428
430
|
return store.setValue(key, value, options);
|
|
429
431
|
}
|
|
430
432
|
/**
|
|
431
|
-
* Gets the crawler input value from the default {@
|
|
432
|
-
*
|
|
433
|
-
*
|
|
434
|
-
* For example, calling the following code:
|
|
435
|
-
* ```javascript
|
|
436
|
-
* const input = await KeyValueStore.getInput();
|
|
437
|
-
* ```
|
|
438
|
-
*
|
|
439
|
-
* is equivalent to:
|
|
440
|
-
* ```javascript
|
|
441
|
-
* const store = await KeyValueStore.open();
|
|
442
|
-
* await store.getValue('INPUT');
|
|
443
|
-
* ```
|
|
433
|
+
* Gets the crawler input value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
434
|
+
* By default, it will try to find root input files (either extension-less, `.json` or `.txt`),
|
|
435
|
+
* or alternatively read the input from the default {@apilink KeyValueStore}.
|
|
444
436
|
*
|
|
445
437
|
* Note that the `getInput()` function does not cache the value read from the key-value store.
|
|
446
438
|
* If you need to use the input multiple times in your crawler,
|
|
447
439
|
* it is far more efficient to read it once and store it locally.
|
|
448
440
|
*
|
|
449
|
-
* For more information, see
|
|
450
|
-
* and {@
|
|
441
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
442
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
451
443
|
*
|
|
452
444
|
* @returns
|
|
453
445
|
* Returns a promise that resolves to an object, string
|
|
@@ -458,7 +450,29 @@ class KeyValueStore {
|
|
|
458
450
|
*/
|
|
459
451
|
static async getInput() {
|
|
460
452
|
const store = await this.open();
|
|
461
|
-
|
|
453
|
+
const inputKey = store.config.get('inputKey');
|
|
454
|
+
const cwd = process.cwd();
|
|
455
|
+
const possibleExtensions = ['', '.json', '.txt'];
|
|
456
|
+
// Attempt to read input from root file instead of key-value store
|
|
457
|
+
for (const extension of possibleExtensions) {
|
|
458
|
+
const inputFile = (0, node_path_1.join)(cwd, `${inputKey}${extension}`);
|
|
459
|
+
let input;
|
|
460
|
+
// Try getting the file from the file system
|
|
461
|
+
try {
|
|
462
|
+
input = await (0, promises_1.readFile)(inputFile);
|
|
463
|
+
}
|
|
464
|
+
catch {
|
|
465
|
+
continue;
|
|
466
|
+
}
|
|
467
|
+
// Attempt to parse as JSON, or return the input as is otherwise
|
|
468
|
+
try {
|
|
469
|
+
return JSON.parse(input.toString());
|
|
470
|
+
}
|
|
471
|
+
catch {
|
|
472
|
+
return input;
|
|
473
|
+
}
|
|
474
|
+
}
|
|
475
|
+
return store.getValue(inputKey);
|
|
462
476
|
}
|
|
463
477
|
}
|
|
464
478
|
exports.KeyValueStore = KeyValueStore;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"key_value_store.js","sourceRoot":"","sources":["../../src/storages/key_value_store.ts"],"names":[],"mappings":";;;;AAAA,0CAA0D;AAC1D,gDAAyD;AACzD,iDAAuC;AAEvC,oDAAiD;AAGjD,uDAAmD;AACnD,mCAA+C;AAE/C;;;;GAIG;AACI,MAAM,cAAc,GAAG,CAAI,KAAQ,EAAE,OAAiC,EAAE,EAAE;IAC7E,+DAA+D;IAC/D,IAAI,OAAO,CAAC,WAAW,KAAK,IAAI,IAAI,OAAO,CAAC,WAAW,KAAK,SAAS,EAAE;QACnE,OAAO,CAAC,WAAW,GAAG,iCAAiC,CAAC;QAExD,IAAI;YACA,kFAAkF;YAClF,KAAK,GAAG,IAAA,iCAAqB,EAAC,KAAmB,EAAE,IAAI,EAAE,CAAC,CAAiB,CAAC;S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;;;;;;;;;;;;OAkBG;IACH,MAAM,CAAC,KAAK,CAAC,QAAQ;QACjB,MAAM,KAAK,GAAG,MAAM,IAAI,CAAC,IAAI,EAAE,CAAC;QAChC,MAAM,QAAQ,GAAG,KAAK,CAAC,MAAM,CAAC,GAAG,CAAC,UAAU,CAAE,CAAC;QAE/C,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,EAAE,CAAC;QAC1B,MAAM,kBAAkB,GAAG,CAAC,EAAE,EAAE,OAAO,EAAE,MAAM,CAAC,CAAC;QAEjD,kEAAkE;QAClE,KAAK,MAAM,SAAS,IAAI,kBAAkB,EAAE;YACxC,MAAM,SAAS,GAAG,IAAA,gBAAI,EAAC,GAAG,EAAE,GAAG,QAAQ,GAAG,SAAS,EAAE,CAAC,CAAC;YACvD,IAAI,KAAa,CAAC;YAElB,4CAA4C;YAC5C,IAAI;gBACA,KAAK,GAAG,MAAM,IAAA,mBAAQ,EAAC,SAAS,CAAC,CAAC;aACrC;YAAC,MAAM;gBACJ,SAAS;aACZ;YAED,gEAAgE;YAChE,IAAI;gBACA,OAAO,IAAI,CAAC,KAAK,CAAC,KAAK,CAAC,QAAQ,EAAE,CAAM,CAAC;aAC5C;YAAC,MAAM;gBACJ,OAAO,KAAqB,CAAC;aAChC;SACJ;QAED,OAAO,KAAK,CAAC,QAAQ,CAAI,QAAQ,CAAC,CAAC;IACvC,CAAC;CACJ;AAzXD,sCAyXC"}
|
|
@@ -9,8 +9,8 @@ export declare const STATE_PERSISTENCE_KEY = "REQUEST_LIST_STATE";
|
|
|
9
9
|
export declare const REQUESTS_PERSISTENCE_KEY = "REQUEST_LIST_REQUESTS";
|
|
10
10
|
export interface RequestListOptions {
|
|
11
11
|
/**
|
|
12
|
-
* An array of sources of URLs for the {@
|
|
13
|
-
* plain objects that define at least the `url` property, or an array of {@
|
|
12
|
+
* An array of sources of URLs for the {@apilink RequestList}. It can be either an array of strings,
|
|
13
|
+
* plain objects that define at least the `url` property, or an array of {@apilink Request} instances.
|
|
14
14
|
*
|
|
15
15
|
* **IMPORTANT:** The `sources` array will be consumed (left empty) after `RequestList` initializes.
|
|
16
16
|
* This is a measure to prevent memory leaks in situations when millions of sources are
|
|
@@ -44,15 +44,15 @@ export interface RequestListOptions {
|
|
|
44
44
|
sources?: Source[];
|
|
45
45
|
/**
|
|
46
46
|
* A function that will be called to get the sources for the `RequestList`, but only if `RequestList`
|
|
47
|
-
* was not able to fetch their persisted version (see {@
|
|
48
|
-
* It must return an `Array` of {@
|
|
47
|
+
* was not able to fetch their persisted version (see {@apilink RequestListOptions.persistRequestsKey}).
|
|
48
|
+
* It must return an `Array` of {@apilink Request} or {@apilink RequestOptions}.
|
|
49
49
|
*
|
|
50
50
|
* This is very useful in a scenario when getting the sources is a resource intensive or time consuming
|
|
51
51
|
* task, such as fetching URLs from multiple sitemaps or parsing URLs from large datasets. Using the
|
|
52
52
|
* `sourcesFunction` in combination with `persistStateKey` and `persistRequestsKey` will allow you to
|
|
53
53
|
* fetch and parse those URLs only once, saving valuable time when your crawler migrates or restarts.
|
|
54
54
|
*
|
|
55
|
-
* If both {@
|
|
55
|
+
* If both {@apilink RequestListOptions.sources} and {@apilink RequestListOptions.sourcesFunction} are provided,
|
|
56
56
|
* the sources returned by the function will be added after the `sources`.
|
|
57
57
|
*
|
|
58
58
|
* **Example:**
|
|
@@ -99,12 +99,12 @@ export interface RequestListOptions {
|
|
|
99
99
|
persistStateKey?: string;
|
|
100
100
|
/**
|
|
101
101
|
* Identifies the key in the default key-value store under which the `RequestList` persists its
|
|
102
|
-
* Requests during the {@
|
|
102
|
+
* Requests during the {@apilink RequestList.initialize} call.
|
|
103
103
|
* This is necessary if `persistStateKey` is set and the source URLs might potentially change,
|
|
104
104
|
* to ensure consistency of the source URLs and state object. However, it comes with some
|
|
105
105
|
* storage and performance overheads.
|
|
106
106
|
*
|
|
107
|
-
* If `persistRequestsKey` is not set, {@
|
|
107
|
+
* If `persistRequestsKey` is not set, {@apilink RequestList.initialize} will always fetch the sources
|
|
108
108
|
* from their origin, check that they are consistent with the restored state (if any)
|
|
109
109
|
* and throw an error if they are not.
|
|
110
110
|
*/
|
|
@@ -130,7 +130,7 @@ export interface RequestListOptions {
|
|
|
130
130
|
state?: RequestListState;
|
|
131
131
|
/**
|
|
132
132
|
* By default, `RequestList` will deduplicate the provided URLs. Default deduplication is based
|
|
133
|
-
* on the `uniqueKey` property of passed source {@
|
|
133
|
+
* on the `uniqueKey` property of passed source {@apilink Request} objects.
|
|
134
134
|
*
|
|
135
135
|
* If the property is not present, it is generated by normalizing the URL. If present, it is kept intact.
|
|
136
136
|
* In any case, only one request per `uniqueKey` is added to the `RequestList` resulting in removal
|
|
@@ -150,19 +150,19 @@ export interface RequestListOptions {
|
|
|
150
150
|
/**
|
|
151
151
|
* Represents a static list of URLs to crawl.
|
|
152
152
|
* The URLs can be provided either in code or parsed from a text file hosted on the web.
|
|
153
|
-
* `RequestList` is used by {@
|
|
154
|
-
* and {@
|
|
153
|
+
* `RequestList` is used by {@apilink BasicCrawler}, {@apilink CheerioCrawler}, {@apilink PuppeteerCrawler}
|
|
154
|
+
* and {@apilink PlaywrightCrawler} as a source of URLs to crawl.
|
|
155
155
|
*
|
|
156
|
-
* Each URL is represented using an instance of the {@
|
|
156
|
+
* Each URL is represented using an instance of the {@apilink Request} class.
|
|
157
157
|
* The list can only contain unique URLs. More precisely, it can only contain `Request` instances
|
|
158
158
|
* with distinct `uniqueKey` properties. By default, `uniqueKey` is generated from the URL, but it can also be overridden.
|
|
159
|
-
* To add a single URL to the list multiple times, corresponding {@
|
|
159
|
+
* To add a single URL to the list multiple times, corresponding {@apilink Request} objects will need to have different
|
|
160
160
|
* `uniqueKey` properties. You can use the `keepDuplicateUrls` option to do this for you when initializing the
|
|
161
161
|
* `RequestList` from sources.
|
|
162
162
|
*
|
|
163
|
-
* Once you create an instance of `RequestList`, you need to call the {@
|
|
163
|
+
* Once you create an instance of `RequestList`, you need to call the {@apilink RequestList.initialize} function
|
|
164
164
|
* before the instance can be used. After that, no more URLs can be added to the list.
|
|
165
|
-
* Unlike {@
|
|
165
|
+
* Unlike {@apilink RequestQueue}, `RequestList` is static but it can contain even millions of URLs.
|
|
166
166
|
* > Note that `RequestList` can be used together with `RequestQueue` by the same crawler.
|
|
167
167
|
* > In such cases, each request from `RequestList` is enqueued into `RequestQueue` first and then consumed from the latter.
|
|
168
168
|
* > This is necessary to avoid the same URL being processed more than once (from the list first and then possibly from the queue).
|
|
@@ -171,9 +171,9 @@ export interface RequestListOptions {
|
|
|
171
171
|
*
|
|
172
172
|
* `RequestList` has an internal state where it stores information about which requests were already handled,
|
|
173
173
|
* which are in progress and which were reclaimed. The state may be automatically persisted to the default
|
|
174
|
-
* {@
|
|
174
|
+
* {@apilink KeyValueStore} by setting the `persistStateKey` option so that if the Node.js process is restarted,
|
|
175
175
|
* the crawling can continue where it left off. The automated persisting is launched upon receiving the `persistState`
|
|
176
|
-
* event that is periodically emitted by {@
|
|
176
|
+
* event that is periodically emitted by {@apilink EventManager}.
|
|
177
177
|
*
|
|
178
178
|
* The internal state is closely tied to the provided sources (URLs). If the sources change on crawler restart, the state will become corrupted and
|
|
179
179
|
* `RequestList` will raise an exception. This typically happens when the sources is a list of URLs downloaded from the web.
|
|
@@ -279,7 +279,7 @@ export declare class RequestList {
|
|
|
279
279
|
*/
|
|
280
280
|
protected _addRequestsFromSources(): Promise<void>;
|
|
281
281
|
/**
|
|
282
|
-
* Persists the current state of the `RequestList` into the default {@
|
|
282
|
+
* Persists the current state of the `RequestList` into the default {@apilink KeyValueStore}.
|
|
283
283
|
* The state is persisted automatically in regular intervals, but calling this method manually
|
|
284
284
|
* is useful in cases where you want to have the most current state available after you pause
|
|
285
285
|
* or stop fetching its requests. For example after you pause or abort a crawl. Or just before
|
|
@@ -307,7 +307,7 @@ export declare class RequestList {
|
|
|
307
307
|
*/
|
|
308
308
|
getState(): RequestListState;
|
|
309
309
|
/**
|
|
310
|
-
* Resolves to `true` if the next call to {@
|
|
310
|
+
* Resolves to `true` if the next call to {@apilink RequestList.fetchNextRequest} function
|
|
311
311
|
* would return `null`, otherwise it resolves to `false`.
|
|
312
312
|
* Note that even if the list is empty, there might be some pending requests currently being processed.
|
|
313
313
|
*/
|
|
@@ -317,8 +317,8 @@ export declare class RequestList {
|
|
|
317
317
|
*/
|
|
318
318
|
isFinished(): Promise<boolean>;
|
|
319
319
|
/**
|
|
320
|
-
* Gets the next {@
|
|
321
|
-
* using the {@
|
|
320
|
+
* Gets the next {@apilink Request} to process. First, the function gets a request previously reclaimed
|
|
321
|
+
* using the {@apilink RequestList.reclaimRequest} function, if there is any.
|
|
322
322
|
* Otherwise it gets the next request from sources.
|
|
323
323
|
*
|
|
324
324
|
* The function's `Promise` resolves to `null` if there are no more
|
|
@@ -372,14 +372,14 @@ export declare class RequestList {
|
|
|
372
372
|
handledCount(): number;
|
|
373
373
|
/**
|
|
374
374
|
* Opens a request list and returns a promise resolving to an instance
|
|
375
|
-
* of the {@
|
|
375
|
+
* of the {@apilink RequestList} class that is already initialized.
|
|
376
376
|
*
|
|
377
|
-
* {@
|
|
377
|
+
* {@apilink RequestList} represents a list of URLs to crawl, which is always stored in memory.
|
|
378
378
|
* To enable picking up where left off after a process restart, the request list sources
|
|
379
379
|
* are persisted to the key-value store at initialization of the list. Then, while crawling,
|
|
380
380
|
* a small state object is regularly persisted to keep track of the crawling status.
|
|
381
381
|
*
|
|
382
|
-
* For more details and code examples, see the {@
|
|
382
|
+
* For more details and code examples, see the {@apilink RequestList} class.
|
|
383
383
|
*
|
|
384
384
|
* **Example usage:**
|
|
385
385
|
*
|
|
@@ -405,23 +405,23 @@ export declare class RequestList {
|
|
|
405
405
|
* If `null`, the list will not be persisted and will only be stored in memory. Process restart
|
|
406
406
|
* will then cause the list to be crawled again from the beginning. We suggest always using a name.
|
|
407
407
|
* @param [sources]
|
|
408
|
-
* An array of sources of URLs for the {@
|
|
409
|
-
* plain objects that define at least the `url` property, or an array of {@
|
|
408
|
+
* An array of sources of URLs for the {@apilink RequestList}. It can be either an array of strings,
|
|
409
|
+
* plain objects that define at least the `url` property, or an array of {@apilink Request} instances.
|
|
410
410
|
*
|
|
411
|
-
* **IMPORTANT:** The `sources` array will be consumed (left empty) after {@
|
|
411
|
+
* **IMPORTANT:** The `sources` array will be consumed (left empty) after {@apilink RequestList} initializes.
|
|
412
412
|
* This is a measure to prevent memory leaks in situations when millions of sources are
|
|
413
413
|
* added.
|
|
414
414
|
*
|
|
415
415
|
* Additionally, the `requestsFromUrl` property may be used instead of `url`,
|
|
416
|
-
* which will instruct {@
|
|
416
|
+
* which will instruct {@apilink RequestList} to download the source URLs from a given remote location.
|
|
417
417
|
* The URLs will be parsed from the received response. In this case you can limit the URLs
|
|
418
418
|
* using `regex` parameter containing regular expression pattern for URLs to be included.
|
|
419
419
|
*
|
|
420
|
-
* For details, see the {@
|
|
420
|
+
* For details, see the {@apilink RequestListOptions.sources}
|
|
421
421
|
* @param [options]
|
|
422
|
-
* The {@
|
|
423
|
-
* the {@
|
|
424
|
-
* options and the `sources` parameter supersedes the {@
|
|
422
|
+
* The {@apilink RequestList} options. Note that the `listName` parameter supersedes
|
|
423
|
+
* the {@apilink RequestListOptions.persistStateKey} and {@apilink RequestListOptions.persistRequestsKey}
|
|
424
|
+
* options and the `sources` parameter supersedes the {@apilink RequestListOptions.sources} option.
|
|
425
425
|
*/
|
|
426
426
|
static open(listNameOrOptions: string | null | RequestListOptions, sources?: Source[], options?: RequestListOptions): Promise<RequestList>;
|
|
427
427
|
/**
|
|
@@ -430,8 +430,8 @@ export declare class RequestList {
|
|
|
430
430
|
private _downloadListOfUrls;
|
|
431
431
|
}
|
|
432
432
|
/**
|
|
433
|
-
* Represents state of a {@
|
|
434
|
-
* You can obtain the state by calling {@
|
|
433
|
+
* Represents state of a {@apilink RequestList}. It can be used to resume a {@apilink RequestList} which has been previously processed.
|
|
434
|
+
* You can obtain the state by calling {@apilink RequestList.getState} and receive an object with
|
|
435
435
|
* the following structure:
|
|
436
436
|
*
|
|
437
437
|
* ```
|