@crawlee/core 3.0.3-beta.10 → 3.0.3-beta.13
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/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/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 +24 -24
- package/storages/key_value_store.js +20 -20
- 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
|
@@ -67,17 +67,17 @@ exports.getRequestId = getRequestId;
|
|
|
67
67
|
* where you start with several URLs and then recursively
|
|
68
68
|
* follow links to other pages. The data structure supports both breadth-first and depth-first crawling orders.
|
|
69
69
|
*
|
|
70
|
-
* Each URL is represented using an instance of the {@
|
|
71
|
-
* The queue can only contain unique URLs. More precisely, it can only contain {@
|
|
70
|
+
* Each URL is represented using an instance of the {@apilink Request} class.
|
|
71
|
+
* The queue can only contain unique URLs. More precisely, it can only contain {@apilink Request} instances
|
|
72
72
|
* with distinct `uniqueKey` properties. By default, `uniqueKey` is generated from the URL, but it can also be overridden.
|
|
73
73
|
* To add a single URL multiple times to the queue,
|
|
74
|
-
* corresponding {@
|
|
74
|
+
* corresponding {@apilink Request} objects will need to have different `uniqueKey` properties.
|
|
75
75
|
*
|
|
76
|
-
* Do not instantiate this class directly, use the {@
|
|
76
|
+
* Do not instantiate this class directly, use the {@apilink RequestQueue.open} function instead.
|
|
77
77
|
*
|
|
78
|
-
* `RequestQueue` is used by {@
|
|
79
|
-
* and {@
|
|
80
|
-
* Unlike {@
|
|
78
|
+
* `RequestQueue` is used by {@apilink BasicCrawler}, {@apilink CheerioCrawler}, {@apilink PuppeteerCrawler}
|
|
79
|
+
* and {@apilink PlaywrightCrawler} as a source of URLs to crawl.
|
|
80
|
+
* Unlike {@apilink RequestList}, `RequestQueue` supports dynamic adding and removing of requests.
|
|
81
81
|
* On the other hand, the queue is not optimized for operations that add or remove a large number of URLs in a batch.
|
|
82
82
|
*
|
|
83
83
|
* `RequestQueue` stores its data either on local disk or in the Apify Cloud,
|
|
@@ -89,7 +89,7 @@ exports.getRequestId = getRequestId;
|
|
|
89
89
|
* If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` is not, the data is stored in the
|
|
90
90
|
* [Apify Request Queue](https://docs.apify.com/storage/request-queue)
|
|
91
91
|
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
92
|
-
* option to {@
|
|
92
|
+
* option to {@apilink RequestQueue.open} function,
|
|
93
93
|
* even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.
|
|
94
94
|
*
|
|
95
95
|
* **Example usage:**
|
|
@@ -244,12 +244,12 @@ class RequestQueue {
|
|
|
244
244
|
*
|
|
245
245
|
* If a request with the same `uniqueKey` property is already present in the queue,
|
|
246
246
|
* it will not be updated. You can find out whether this happened from the resulting
|
|
247
|
-
* {@
|
|
247
|
+
* {@apilink QueueOperationInfo} object.
|
|
248
248
|
*
|
|
249
249
|
* To add multiple requests to the queue by extracting links from a webpage,
|
|
250
|
-
* see the {@
|
|
250
|
+
* see the {@apilink enqueueLinks} helper function.
|
|
251
251
|
*
|
|
252
|
-
* @param requestLike {@
|
|
252
|
+
* @param requestLike {@apilink Request} object or vanilla object with request data.
|
|
253
253
|
* Note that the function sets the `uniqueKey` and `id` fields to the passed Request.
|
|
254
254
|
* @param [options] Request queue operation options.
|
|
255
255
|
*/
|
|
@@ -295,9 +295,9 @@ class RequestQueue {
|
|
|
295
295
|
*
|
|
296
296
|
* If a request that is passed in is already present due to its `uniqueKey` property being the same,
|
|
297
297
|
* it will not be updated. You can find out whether this happened by finding the request in the resulting
|
|
298
|
-
* {@
|
|
298
|
+
* {@apilink BatchAddRequestsResult} object.
|
|
299
299
|
*
|
|
300
|
-
* @param requestsLike {@
|
|
300
|
+
* @param requestsLike {@apilink Request} objects or vanilla objects with request data.
|
|
301
301
|
* Note that the function sets the `uniqueKey` and `id` fields to the passed requests if missing.
|
|
302
302
|
* @param [options] Request queue operation options.
|
|
303
303
|
*/
|
|
@@ -386,15 +386,15 @@ class RequestQueue {
|
|
|
386
386
|
* Returns a next request in the queue to be processed, or `null` if there are no more pending requests.
|
|
387
387
|
*
|
|
388
388
|
* Once you successfully finish processing of the request, you need to call
|
|
389
|
-
* {@
|
|
389
|
+
* {@apilink RequestQueue.markRequestHandled}
|
|
390
390
|
* to mark the request as handled in the queue. If there was some error in processing the request,
|
|
391
|
-
* call {@
|
|
391
|
+
* call {@apilink RequestQueue.reclaimRequest} instead,
|
|
392
392
|
* so that the queue will give the request to some other consumer in another call to the `fetchNextRequest` function.
|
|
393
393
|
*
|
|
394
394
|
* Note that the `null` return value doesn't mean the queue processing finished,
|
|
395
395
|
* it means there are currently no pending requests.
|
|
396
396
|
* To check whether all requests in queue were finished,
|
|
397
|
-
* use {@
|
|
397
|
+
* use {@apilink RequestQueue.isFinished} instead.
|
|
398
398
|
*
|
|
399
399
|
* @returns
|
|
400
400
|
* Returns the request object or `null` if there are no more pending requests.
|
|
@@ -451,7 +451,7 @@ class RequestQueue {
|
|
|
451
451
|
}
|
|
452
452
|
/**
|
|
453
453
|
* Marks a request that was previously returned by the
|
|
454
|
-
* {@
|
|
454
|
+
* {@apilink RequestQueue.fetchNextRequest}
|
|
455
455
|
* function as handled after successful processing.
|
|
456
456
|
* Handled requests will never again be returned by the `fetchNextRequest` function.
|
|
457
457
|
*/
|
|
@@ -480,7 +480,7 @@ class RequestQueue {
|
|
|
480
480
|
}
|
|
481
481
|
/**
|
|
482
482
|
* Reclaims a failed request back to the queue, so that it can be returned for processing later again
|
|
483
|
-
* by another call to {@
|
|
483
|
+
* by another call to {@apilink RequestQueue.fetchNextRequest}.
|
|
484
484
|
* The request record in the queue is updated using the provided `request` parameter.
|
|
485
485
|
* For example, this lets you store the number of retries or error messages for the request.
|
|
486
486
|
*/
|
|
@@ -517,10 +517,10 @@ class RequestQueue {
|
|
|
517
517
|
return queueOperationInfo;
|
|
518
518
|
}
|
|
519
519
|
/**
|
|
520
|
-
* Resolves to `true` if the next call to {@
|
|
520
|
+
* Resolves to `true` if the next call to {@apilink RequestQueue.fetchNextRequest}
|
|
521
521
|
* would return `null`, otherwise it resolves to `false`.
|
|
522
522
|
* Note that even if the queue is empty, there might be some pending requests currently being processed.
|
|
523
|
-
* If you need to ensure that there is no activity in the queue, use {@
|
|
523
|
+
* If you need to ensure that there is no activity in the queue, use {@apilink RequestQueue.isFinished}.
|
|
524
524
|
*/
|
|
525
525
|
async isEmpty() {
|
|
526
526
|
await this._ensureHeadIsNonEmpty();
|
|
@@ -709,14 +709,14 @@ class RequestQueue {
|
|
|
709
709
|
}
|
|
710
710
|
/**
|
|
711
711
|
* Opens a request queue and returns a promise resolving to an instance
|
|
712
|
-
* of the {@
|
|
712
|
+
* of the {@apilink RequestQueue} class.
|
|
713
713
|
*
|
|
714
|
-
* {@
|
|
714
|
+
* {@apilink RequestQueue} represents a queue of URLs to crawl, which is stored either on local filesystem or in the cloud.
|
|
715
715
|
* The queue is used for deep crawling of websites, where you start with several URLs and then
|
|
716
716
|
* recursively follow links to other pages. The data structure supports both breadth-first
|
|
717
717
|
* and depth-first crawling orders.
|
|
718
718
|
*
|
|
719
|
-
* For more details and code examples, see the {@
|
|
719
|
+
* For more details and code examples, see the {@apilink RequestQueue} class.
|
|
720
720
|
*
|
|
721
721
|
* @param [queueIdOrName]
|
|
722
722
|
* ID or name of the request queue to be opened. If `null` or `undefined`,
|
package/storages/utils.d.ts
CHANGED
|
@@ -4,7 +4,7 @@ import { Configuration } from '../configuration';
|
|
|
4
4
|
* Purging will remove all the files in all storages except for INPUT.json in the default KV store.
|
|
5
5
|
*
|
|
6
6
|
* Purging of storages is happening automatically when we run our crawler (or when we open some storage
|
|
7
|
-
* explicitly, e.g. via `RequestList.open()`). We can disable that via `purgeOnStart` {@
|
|
7
|
+
* explicitly, e.g. via `RequestList.open()`). We can disable that via `purgeOnStart` {@apilink Configuration}
|
|
8
8
|
* option or by setting `CRAWLEE_PURGE_ON_START` environment variable to `0` or `false`.
|
|
9
9
|
*
|
|
10
10
|
* This is a shortcut for running (optional) `purge` method on the StorageClient interface, in other words
|
package/storages/utils.js
CHANGED
|
@@ -7,7 +7,7 @@ const configuration_1 = require("../configuration");
|
|
|
7
7
|
* Purging will remove all the files in all storages except for INPUT.json in the default KV store.
|
|
8
8
|
*
|
|
9
9
|
* Purging of storages is happening automatically when we run our crawler (or when we open some storage
|
|
10
|
-
* explicitly, e.g. via `RequestList.open()`). We can disable that via `purgeOnStart` {@
|
|
10
|
+
* explicitly, e.g. via `RequestList.open()`). We can disable that via `purgeOnStart` {@apilink Configuration}
|
|
11
11
|
* option or by setting `CRAWLEE_PURGE_ON_START` environment variable to `0` or `false`.
|
|
12
12
|
*
|
|
13
13
|
* This is a shortcut for running (optional) `purge` method on the StorageClient interface, in other words
|