@crawlee/core 3.0.3-beta.7 → 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.
Files changed (46) hide show
  1. package/README.md +1 -1
  2. package/autoscaling/autoscaled_pool.d.ts +16 -16
  3. package/autoscaling/autoscaled_pool.js +13 -13
  4. package/autoscaling/snapshotter.d.ts +1 -1
  5. package/autoscaling/snapshotter.js +1 -1
  6. package/autoscaling/system_status.d.ts +12 -12
  7. package/autoscaling/system_status.js +11 -11
  8. package/configuration.d.ts +33 -13
  9. package/configuration.d.ts.map +1 -1
  10. package/configuration.js +27 -7
  11. package/configuration.js.map +1 -1
  12. package/crawlers/crawler_commons.d.ts +2 -2
  13. package/crawlers/statistics.d.ts +1 -1
  14. package/crawlers/statistics.js +1 -1
  15. package/enqueue_links/enqueue_links.d.ts +14 -13
  16. package/enqueue_links/enqueue_links.d.ts.map +1 -1
  17. package/enqueue_links/enqueue_links.js +6 -5
  18. package/enqueue_links/enqueue_links.js.map +1 -1
  19. package/enqueue_links/shared.d.ts +2 -2
  20. package/errors.d.ts +6 -0
  21. package/errors.d.ts.map +1 -1
  22. package/errors.js +10 -1
  23. package/errors.js.map +1 -1
  24. package/index.mjs +1 -0
  25. package/package.json +4 -4
  26. package/proxy_configuration.d.ts +11 -11
  27. package/proxy_configuration.js +8 -8
  28. package/request.d.ts +3 -3
  29. package/request.js +2 -2
  30. package/session_pool/session.d.ts +1 -1
  31. package/session_pool/session_pool.d.ts +12 -12
  32. package/session_pool/session_pool.d.ts.map +1 -1
  33. package/session_pool/session_pool.js +10 -10
  34. package/storages/dataset.d.ts +14 -14
  35. package/storages/dataset.js +8 -8
  36. package/storages/key_value_store.d.ts +30 -49
  37. package/storages/key_value_store.d.ts.map +1 -1
  38. package/storages/key_value_store.js +51 -46
  39. package/storages/key_value_store.js.map +1 -1
  40. package/storages/request_list.d.ts +33 -33
  41. package/storages/request_list.js +23 -23
  42. package/storages/request_queue.d.ts +25 -25
  43. package/storages/request_queue.js +23 -23
  44. package/storages/utils.d.ts +1 -1
  45. package/storages/utils.js +1 -1
  46. package/tsconfig.build.tsbuildinfo +1 -1
package/README.md CHANGED
@@ -63,7 +63,7 @@ Additionally, the package provides various helper functions to simplify running
63
63
 
64
64
  ## Quick Start
65
65
 
66
- This short tutorial will set you up to start using Crawlee in a minute or two. If you want to learn more, proceed to the [Getting Started](https://crawlee.dev/docs/guides/getting-started) tutorial that will take you step by step through creating your first scraper.
66
+ This short tutorial will set you up to start using Crawlee in a minute or two. If you want to learn more, proceed to the [Getting Started](https://crawlee.dev/docs/introduction) tutorial that will take you step by step through creating your first scraper.
67
67
 
68
68
  ### Local stand-alone usage
69
69
 
@@ -20,7 +20,7 @@ export interface AutoscaledPoolOptions {
20
20
  * If it resolves to `true` then the pool's run finishes. Being called only
21
21
  * when there are no tasks being processed means that as long as `isTaskReadyFunction()`
22
22
  * keeps resolving to `true`, `isFinishedFunction()` will never be called.
23
- * To abort a run, use the {@link AutoscaledPool.abort} method.
23
+ * To abort a run, use the {@apilink AutoscaledPool.abort} method.
24
24
  */
25
25
  isFinishedFunction?: () => Promise<boolean>;
26
26
  /**
@@ -84,12 +84,12 @@ export interface AutoscaledPoolOptions {
84
84
  */
85
85
  taskTimeoutSecs?: number;
86
86
  /**
87
- * Options to be passed down to the {@link Snapshotter} constructor. This is useful for fine-tuning
87
+ * Options to be passed down to the {@apilink Snapshotter} constructor. This is useful for fine-tuning
88
88
  * the snapshot intervals and history.
89
89
  */
90
90
  snapshotterOptions?: SnapshotterOptions;
91
91
  /**
92
- * Options to be passed down to the {@link SystemStatus} constructor. This is useful for fine-tuning
92
+ * Options to be passed down to the {@apilink SystemStatus} constructor. This is useful for fine-tuning
93
93
  * the system status reports. If a custom snapshotter is set in the options, it will be used
94
94
  * by the pool.
95
95
  */
@@ -106,22 +106,22 @@ export interface AutoscaledPoolOptions {
106
106
  * The pool only starts new tasks if there is enough free CPU and memory available
107
107
  * and the Javascript event loop is not blocked.
108
108
  *
109
- * The information about the CPU and memory usage is obtained by the {@link Snapshotter} class,
109
+ * The information about the CPU and memory usage is obtained by the {@apilink Snapshotter} class,
110
110
  * which makes regular snapshots of system resources that may be either local
111
111
  * or from the Apify cloud infrastructure in case the process is running on the Apify platform.
112
- * Meaningful data gathered from these snapshots is provided to `AutoscaledPool` by the {@link SystemStatus} class.
112
+ * Meaningful data gathered from these snapshots is provided to `AutoscaledPool` by the {@apilink SystemStatus} class.
113
113
  *
114
114
  * Before running the pool, you need to implement the following three functions:
115
- * {@link AutoscaledPoolOptions.runTaskFunction},
116
- * {@link AutoscaledPoolOptions.isTaskReadyFunction} and
117
- * {@link AutoscaledPoolOptions.isFinishedFunction}.
115
+ * {@apilink AutoscaledPoolOptions.runTaskFunction},
116
+ * {@apilink AutoscaledPoolOptions.isTaskReadyFunction} and
117
+ * {@apilink AutoscaledPoolOptions.isFinishedFunction}.
118
118
  *
119
- * The auto-scaled pool is started by calling the {@link AutoscaledPool.run} function.
120
- * The pool periodically queries the {@link AutoscaledPoolOptions.isTaskReadyFunction} function
119
+ * The auto-scaled pool is started by calling the {@apilink AutoscaledPool.run} function.
120
+ * The pool periodically queries the {@apilink AutoscaledPoolOptions.isTaskReadyFunction} function
121
121
  * for more tasks, managing optimal concurrency, until the function resolves to `false`. The pool then queries
122
- * the {@link AutoscaledPoolOptions.isFinishedFunction}. If it resolves to `true`, the run finishes after all running tasks complete.
122
+ * the {@apilink AutoscaledPoolOptions.isFinishedFunction}. If it resolves to `true`, the run finishes after all running tasks complete.
123
123
  * If it resolves to `false`, it assumes there will be more tasks available later and keeps periodically querying for tasks.
124
- * If any of the tasks throws then the {@link AutoscaledPool.run} function rejects the promise with an error.
124
+ * If any of the tasks throws then the {@apilink AutoscaledPool.run} function rejects the promise with an error.
125
125
  *
126
126
  * The pool evaluates whether it should start a new task every time one of the tasks finishes
127
127
  * and also in the interval set by the `options.maybeRunIntervalSecs` parameter.
@@ -221,7 +221,7 @@ export declare class AutoscaledPool {
221
221
  run(): Promise<void>;
222
222
  /**
223
223
  * Aborts the run of the auto-scaled pool and destroys it. The promise returned from
224
- * the {@link AutoscaledPool.run} function will immediately resolve, no more new tasks
224
+ * the {@apilink AutoscaledPool.run} function will immediately resolve, no more new tasks
225
225
  * will be spawned and all running tasks will be left in their current state.
226
226
  *
227
227
  * Due to the nature of the tasks, auto-scaled pool cannot reliably guarantee abortion
@@ -233,19 +233,19 @@ export declare class AutoscaledPool {
233
233
  abort(): Promise<void>;
234
234
  /**
235
235
  * Prevents the auto-scaled pool from starting new tasks, but allows the running ones to finish
236
- * (unlike abort, which terminates them). Used together with {@link AutoscaledPool.resume}
236
+ * (unlike abort, which terminates them). Used together with {@apilink AutoscaledPool.resume}
237
237
  *
238
238
  * The function's promise will resolve once all running tasks have completed and the pool
239
239
  * is effectively idle. If the `timeoutSecs` argument is provided, the promise will reject
240
240
  * with a timeout error after the `timeoutSecs` seconds.
241
241
  *
242
- * The promise returned from the {@link AutoscaledPool.run} function will not resolve
242
+ * The promise returned from the {@apilink AutoscaledPool.run} function will not resolve
243
243
  * when `.pause()` is invoked (unlike abort, which resolves it).
244
244
  */
245
245
  pause(timeoutSecs?: number): Promise<void>;
246
246
  /**
247
247
  * Resumes the operation of the autoscaled-pool by allowing more tasks to be run.
248
- * Used together with {@link AutoscaledPool.pause}
248
+ * Used together with {@apilink AutoscaledPool.pause}
249
249
  *
250
250
  * Tasks will automatically start running again in `options.maybeRunIntervalSecs`.
251
251
  */
@@ -14,22 +14,22 @@ const system_status_1 = require("./system_status");
14
14
  * The pool only starts new tasks if there is enough free CPU and memory available
15
15
  * and the Javascript event loop is not blocked.
16
16
  *
17
- * The information about the CPU and memory usage is obtained by the {@link Snapshotter} class,
17
+ * The information about the CPU and memory usage is obtained by the {@apilink Snapshotter} class,
18
18
  * which makes regular snapshots of system resources that may be either local
19
19
  * or from the Apify cloud infrastructure in case the process is running on the Apify platform.
20
- * Meaningful data gathered from these snapshots is provided to `AutoscaledPool` by the {@link SystemStatus} class.
20
+ * Meaningful data gathered from these snapshots is provided to `AutoscaledPool` by the {@apilink SystemStatus} class.
21
21
  *
22
22
  * Before running the pool, you need to implement the following three functions:
23
- * {@link AutoscaledPoolOptions.runTaskFunction},
24
- * {@link AutoscaledPoolOptions.isTaskReadyFunction} and
25
- * {@link AutoscaledPoolOptions.isFinishedFunction}.
23
+ * {@apilink AutoscaledPoolOptions.runTaskFunction},
24
+ * {@apilink AutoscaledPoolOptions.isTaskReadyFunction} and
25
+ * {@apilink AutoscaledPoolOptions.isFinishedFunction}.
26
26
  *
27
- * The auto-scaled pool is started by calling the {@link AutoscaledPool.run} function.
28
- * The pool periodically queries the {@link AutoscaledPoolOptions.isTaskReadyFunction} function
27
+ * The auto-scaled pool is started by calling the {@apilink AutoscaledPool.run} function.
28
+ * The pool periodically queries the {@apilink AutoscaledPoolOptions.isTaskReadyFunction} function
29
29
  * for more tasks, managing optimal concurrency, until the function resolves to `false`. The pool then queries
30
- * the {@link AutoscaledPoolOptions.isFinishedFunction}. If it resolves to `true`, the run finishes after all running tasks complete.
30
+ * the {@apilink AutoscaledPoolOptions.isFinishedFunction}. If it resolves to `true`, the run finishes after all running tasks complete.
31
31
  * If it resolves to `false`, it assumes there will be more tasks available later and keeps periodically querying for tasks.
32
- * If any of the tasks throws then the {@link AutoscaledPool.run} function rejects the promise with an error.
32
+ * If any of the tasks throws then the {@apilink AutoscaledPool.run} function rejects the promise with an error.
33
33
  *
34
34
  * The pool evaluates whether it should start a new task every time one of the tasks finishes
35
35
  * and also in the interval set by the `options.maybeRunIntervalSecs` parameter.
@@ -378,7 +378,7 @@ class AutoscaledPool {
378
378
  }
379
379
  /**
380
380
  * Aborts the run of the auto-scaled pool and destroys it. The promise returned from
381
- * the {@link AutoscaledPool.run} function will immediately resolve, no more new tasks
381
+ * the {@apilink AutoscaledPool.run} function will immediately resolve, no more new tasks
382
382
  * will be spawned and all running tasks will be left in their current state.
383
383
  *
384
384
  * Due to the nature of the tasks, auto-scaled pool cannot reliably guarantee abortion
@@ -396,13 +396,13 @@ class AutoscaledPool {
396
396
  }
397
397
  /**
398
398
  * Prevents the auto-scaled pool from starting new tasks, but allows the running ones to finish
399
- * (unlike abort, which terminates them). Used together with {@link AutoscaledPool.resume}
399
+ * (unlike abort, which terminates them). Used together with {@apilink AutoscaledPool.resume}
400
400
  *
401
401
  * The function's promise will resolve once all running tasks have completed and the pool
402
402
  * is effectively idle. If the `timeoutSecs` argument is provided, the promise will reject
403
403
  * with a timeout error after the `timeoutSecs` seconds.
404
404
  *
405
- * The promise returned from the {@link AutoscaledPool.run} function will not resolve
405
+ * The promise returned from the {@apilink AutoscaledPool.run} function will not resolve
406
406
  * when `.pause()` is invoked (unlike abort, which resolves it).
407
407
  */
408
408
  async pause(timeoutSecs) {
@@ -431,7 +431,7 @@ class AutoscaledPool {
431
431
  }
432
432
  /**
433
433
  * Resumes the operation of the autoscaled-pool by allowing more tasks to be run.
434
- * Used together with {@link AutoscaledPool.pause}
434
+ * Used together with {@apilink AutoscaledPool.pause}
435
435
  *
436
436
  * Tasks will automatically start running again in `options.maybeRunIntervalSecs`.
437
437
  */
@@ -75,7 +75,7 @@ interface ClientSnapshot {
75
75
  * Creates snapshots of system resources at given intervals and marks the resource
76
76
  * as either overloaded or not during the last interval. Keeps a history of the snapshots.
77
77
  * It tracks the following resources: Memory, EventLoop, API and CPU.
78
- * The class is used by the {@link AutoscaledPool} class.
78
+ * The class is used by the {@apilink AutoscaledPool} class.
79
79
  *
80
80
  * When running on the Apify platform, the CPU and memory statistics are provided by the platform,
81
81
  * as collected from the running Docker container. When running locally, `Snapshotter`
@@ -14,7 +14,7 @@ const CRITICAL_OVERLOAD_RATE_LIMIT_MILLIS = 10000;
14
14
  * Creates snapshots of system resources at given intervals and marks the resource
15
15
  * as either overloaded or not during the last interval. Keeps a history of the snapshots.
16
16
  * It tracks the following resources: Memory, EventLoop, API and CPU.
17
- * The class is used by the {@link AutoscaledPool} class.
17
+ * The class is used by the {@apilink AutoscaledPool} class.
18
18
  *
19
19
  * When running on the Apify platform, the CPU and memory statistics are provided by the platform,
20
20
  * as collected from the running Docker container. When running locally, `Snapshotter`
@@ -29,7 +29,7 @@ export interface SystemInfo {
29
29
  }
30
30
  export interface SystemStatusOptions {
31
31
  /**
32
- * Defines max age of snapshots used in the {@link SystemStatus.getCurrentStatus} measurement.
32
+ * Defines max age of snapshots used in the {@apilink SystemStatus.getCurrentStatus} measurement.
33
33
  * @default 5
34
34
  */
35
35
  currentHistorySecs?: number;
@@ -82,25 +82,25 @@ export interface FinalStatistics {
82
82
  crawlerRuntimeMillis: number;
83
83
  }
84
84
  /**
85
- * Provides a simple interface to reading system status from a {@link Snapshotter} instance.
86
- * It only exposes two functions {@link SystemStatus.getCurrentStatus}
87
- * and {@link SystemStatus.getHistoricalStatus}.
85
+ * Provides a simple interface to reading system status from a {@apilink Snapshotter} instance.
86
+ * It only exposes two functions {@apilink SystemStatus.getCurrentStatus}
87
+ * and {@apilink SystemStatus.getHistoricalStatus}.
88
88
  * The system status is calculated using a weighted average of overloaded
89
89
  * messages in the snapshots, with the weights being the time intervals
90
90
  * between the snapshots. Each resource is calculated separately
91
91
  * and the system is overloaded whenever at least one resource is overloaded.
92
- * The class is used by the {@link AutoscaledPool} class.
92
+ * The class is used by the {@apilink AutoscaledPool} class.
93
93
  *
94
- * {@link SystemStatus.getCurrentStatus}
94
+ * {@apilink SystemStatus.getCurrentStatus}
95
95
  * returns a boolean that represents the current status of the system.
96
96
  * The length of the current timeframe in seconds is configurable
97
97
  * by the `currentHistorySecs` option and represents the max age
98
98
  * of snapshots to be considered for the calculation.
99
99
  *
100
- * {@link SystemStatus.getHistoricalStatus}
100
+ * {@apilink SystemStatus.getHistoricalStatus}
101
101
  * returns a boolean that represents the long-term status
102
102
  * of the system. It considers the full snapshot history available
103
- * in the {@link Snapshotter} instance.
103
+ * in the {@apilink Snapshotter} instance.
104
104
  * @category Scaling
105
105
  */
106
106
  export declare class SystemStatus {
@@ -112,7 +112,7 @@ export declare class SystemStatus {
112
112
  private readonly snapshotter;
113
113
  constructor(options?: SystemStatusOptions);
114
114
  /**
115
- * Returns an {@link SystemInfo} object with the following structure:
115
+ * Returns an {@apilink SystemInfo} object with the following structure:
116
116
  *
117
117
  * ```javascript
118
118
  * {
@@ -129,7 +129,7 @@ export declare class SystemStatus {
129
129
  */
130
130
  getCurrentStatus(): SystemInfo;
131
131
  /**
132
- * Returns an {@link SystemInfo} object with the following structure:
132
+ * Returns an {@apilink SystemInfo} object with the following structure:
133
133
  *
134
134
  * ```javascript
135
135
  * {
@@ -141,8 +141,8 @@ export declare class SystemStatus {
141
141
  * ```
142
142
  *
143
143
  * Where the `isSystemIdle` property is set to `false` if the system
144
- * has been overloaded in the full history of the {@link Snapshotter}
145
- * (which is configurable in the {@link Snapshotter}) and `true` otherwise.
144
+ * has been overloaded in the full history of the {@apilink Snapshotter}
145
+ * (which is configurable in the {@apilink Snapshotter}) and `true` otherwise.
146
146
  */
147
147
  getHistoricalStatus(): SystemInfo;
148
148
  /**
@@ -6,25 +6,25 @@ const ow_1 = tslib_1.__importDefault(require("ow"));
6
6
  const utils_1 = require("@crawlee/utils");
7
7
  const snapshotter_1 = require("./snapshotter");
8
8
  /**
9
- * Provides a simple interface to reading system status from a {@link Snapshotter} instance.
10
- * It only exposes two functions {@link SystemStatus.getCurrentStatus}
11
- * and {@link SystemStatus.getHistoricalStatus}.
9
+ * Provides a simple interface to reading system status from a {@apilink Snapshotter} instance.
10
+ * It only exposes two functions {@apilink SystemStatus.getCurrentStatus}
11
+ * and {@apilink SystemStatus.getHistoricalStatus}.
12
12
  * The system status is calculated using a weighted average of overloaded
13
13
  * messages in the snapshots, with the weights being the time intervals
14
14
  * between the snapshots. Each resource is calculated separately
15
15
  * and the system is overloaded whenever at least one resource is overloaded.
16
- * The class is used by the {@link AutoscaledPool} class.
16
+ * The class is used by the {@apilink AutoscaledPool} class.
17
17
  *
18
- * {@link SystemStatus.getCurrentStatus}
18
+ * {@apilink SystemStatus.getCurrentStatus}
19
19
  * returns a boolean that represents the current status of the system.
20
20
  * The length of the current timeframe in seconds is configurable
21
21
  * by the `currentHistorySecs` option and represents the max age
22
22
  * of snapshots to be considered for the calculation.
23
23
  *
24
- * {@link SystemStatus.getHistoricalStatus}
24
+ * {@apilink SystemStatus.getHistoricalStatus}
25
25
  * returns a boolean that represents the long-term status
26
26
  * of the system. It considers the full snapshot history available
27
- * in the {@link Snapshotter} instance.
27
+ * in the {@apilink Snapshotter} instance.
28
28
  * @category Scaling
29
29
  */
30
30
  class SystemStatus {
@@ -83,7 +83,7 @@ class SystemStatus {
83
83
  this.snapshotter = snapshotter || new snapshotter_1.Snapshotter({ config });
84
84
  }
85
85
  /**
86
- * Returns an {@link SystemInfo} object with the following structure:
86
+ * Returns an {@apilink SystemInfo} object with the following structure:
87
87
  *
88
88
  * ```javascript
89
89
  * {
@@ -102,7 +102,7 @@ class SystemStatus {
102
102
  return this._isSystemIdle(this.currentHistorySecs);
103
103
  }
104
104
  /**
105
- * Returns an {@link SystemInfo} object with the following structure:
105
+ * Returns an {@apilink SystemInfo} object with the following structure:
106
106
  *
107
107
  * ```javascript
108
108
  * {
@@ -114,8 +114,8 @@ class SystemStatus {
114
114
  * ```
115
115
  *
116
116
  * Where the `isSystemIdle` property is set to `false` if the system
117
- * has been overloaded in the full history of the {@link Snapshotter}
118
- * (which is configurable in the {@link Snapshotter}) and `true` otherwise.
117
+ * has been overloaded in the full history of the {@apilink Snapshotter}
118
+ * (which is configurable in the {@apilink Snapshotter}) and `true` otherwise.
119
119
  */
120
120
  getHistoricalStatus() {
121
121
  return this._isSystemIdle();
@@ -8,17 +8,17 @@ import type { EventManager } from './events';
8
8
  export interface ConfigurationOptions {
9
9
  /**
10
10
  * Defines storage client to be used.
11
- * @default {@link MemoryStorage}
11
+ * @default {@apilink MemoryStorage}
12
12
  */
13
13
  storageClient?: StorageClient;
14
14
  /**
15
15
  * Defines the Event Manager to be used.
16
- * @default {@link EventManager}
16
+ * @default {@apilink EventManager}
17
17
  */
18
18
  eventManager?: EventManager;
19
19
  /**
20
20
  * Could be used to adjust the storage client behavior
21
- * e.g. {@link MemoryStorageOptions} could be used to adjust the {@link MemoryStorage} behavior.
21
+ * e.g. {@apilink MemoryStorageOptions} could be used to adjust the {@apilink MemoryStorage} behavior.
22
22
  */
23
23
  storageClientOptions?: Dictionary;
24
24
  /**
@@ -56,7 +56,7 @@ export interface ConfigurationOptions {
56
56
  */
57
57
  maxUsedCpuRatio?: number;
58
58
  /**
59
- * Sets the ratio, defining the amount of system memory that could be used by the {@link AutoscaledPool}.
59
+ * Sets the ratio, defining the amount of system memory that could be used by the {@apilink AutoscaledPool}.
60
60
  * When the memory usage is more than the provided ratio, the memory is considered overloaded.
61
61
  *
62
62
  * Alternative to `CRAWLEE_AVAILABLE_MEMORY_RATIO` environment variable.
@@ -64,7 +64,7 @@ export interface ConfigurationOptions {
64
64
  */
65
65
  availableMemoryRatio?: number;
66
66
  /**
67
- * Sets the amount of system memory in megabytes to be used by the {@link AutoscaledPool}.
67
+ * Sets the amount of system memory in megabytes to be used by the {@apilink AutoscaledPool}.
68
68
  * By default, the maximum memory is set to one quarter of total system memory.
69
69
  *
70
70
  * Alternative to `CRAWLEE_MEMORY_MBYTES` environment variable.
@@ -84,7 +84,7 @@ export interface ConfigurationOptions {
84
84
  systemInfoIntervalMillis?: number;
85
85
  /**
86
86
  * Defines the default input key, i.e. the key that is used to get the crawler input value
87
- * from the default {@link KeyValueStore} associated with the current crawler run.
87
+ * from the default {@apilink KeyValueStore} associated with the current crawler run.
88
88
  *
89
89
  * Alternative to `CRAWLEE_INPUT_KEY` environment variable.
90
90
  * @default 'INPUT'
@@ -133,21 +133,41 @@ export interface ConfigurationOptions {
133
133
  /**
134
134
  * `Configuration` is a value object holding Crawlee configuration. By default, there is a
135
135
  * global singleton instance of this class available via `Configuration.getGlobalConfig()`.
136
- * Places that depend on a configurable behaviour depend on this class as have the global
136
+ * Places that depend on a configurable behaviour depend on this class, as they have the global
137
137
  * instance as the default value.
138
138
  *
139
+ * *Using global configuration:*
139
140
  * ```js
140
141
  * import { BasicCrawler, Configuration } from 'crawlee';
141
142
  *
143
+ * // Get the global configuration
144
+ * const config = Configuration.getGlobalConfig();
145
+ * // Set the 'persistStateIntervalMillis' option
146
+ * // of global configuration to 10 seconds
147
+ * config.set('persistStateIntervalMillis', 10_000);
148
+ *
149
+ * // No need to pass the configuration to the crawler,
150
+ * // as it's using the global configuration by default
151
+ * const crawler = new BasicCrawler();
152
+ * ```
153
+ *
154
+ * *Using custom configuration:*
155
+ * ```js
156
+ * import { BasicCrawler, Configuration } from 'crawlee';
157
+ *
158
+ * // Create a new configuration
142
159
  * const config = new Configuration({ persistStateIntervalMillis: 30_000 });
160
+ * // Pass the configuration to the crawler
143
161
  * const crawler = new BasicCrawler({ ... }, config);
144
162
  * ```
145
163
  *
146
164
  * The configuration provided via environment variables always takes precedence. We can also
147
165
  * define the `crawlee.json` file in the project root directory which will serve as a baseline,
148
- * so the options provided in constructor will override those.
166
+ * so the options provided in constructor will override those. In other words, the precedence is:
149
167
  *
150
- * > In other words, the precedence is: crawlee.json < constructor options < environment variables.
168
+ * ```text
169
+ * crawlee.json < constructor options < environment variables
170
+ * ```
151
171
  *
152
172
  * ## Supported Configuration Options
153
173
  *
@@ -204,8 +224,8 @@ export declare class Configuration {
204
224
  */
205
225
  set(key: keyof ConfigurationOptions, value?: any): void;
206
226
  /**
207
- * Returns cached instance of {@link StorageClient} using options as defined in the environment variables or in
208
- * this {@link Configuration} instance. Only first call of this method will create the client, following calls will
227
+ * Returns cached instance of {@apilink StorageClient} using options as defined in the environment variables or in
228
+ * this {@apilink Configuration} instance. Only first call of this method will create the client, following calls will
209
229
  * return the same client instance.
210
230
  *
211
231
  * Caching works based on the `storageClientOptions`, so calling this method with different options will return
@@ -226,11 +246,11 @@ export declare class Configuration {
226
246
  */
227
247
  static getGlobalConfig(): Configuration;
228
248
  /**
229
- * Gets default {@link StorageClient} instance.
249
+ * Gets default {@apilink StorageClient} instance.
230
250
  */
231
251
  static getStorageClient(): StorageClient;
232
252
  /**
233
- * Gets default {@link EventManager} instance.
253
+ * Gets default {@apilink EventManager} instance.
234
254
  */
235
255
  static getEventManager(): EventManager;
236
256
  /**
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.d.ts","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":";AAAA,OAAO,KAAK,EAAE,oBAAoB,EAAE,MAAM,yBAAyB,CAAC;AACpE,OAAO,EAAE,aAAa,EAAE,MAAM,yBAAyB,CAAC;AAGxD,OAAO,EAAE,iBAAiB,EAAE,MAAM,kBAAkB,CAAC;AAErD,OAAO,KAAK,EAAE,UAAU,EAAE,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAChE,OAAY,EAAE,QAAQ,EAAE,MAAM,YAAY,CAAC;AAE3C,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,UAAU,CAAC;AAG7C,MAAM,WAAW,oBAAoB;IACjC;;;OAGG;IACH,aAAa,CAAC,EAAE,aAAa,CAAC;IAE9B;;;OAGG;IACH,YAAY,CAAC,EAAE,YAAY,CAAC;IAE5B;;;OAGG;IACH,oBAAoB,CAAC,EAAE,UAAU,CAAC;IAElC;;;;;OAKG;IACH,gBAAgB,CAAC,EAAE,MAAM,CAAC;IAE1B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,OAAO,CAAC;IAEvB;;;;;OAKG;IACH,sBAAsB,CAAC,EAAE,MAAM,CAAC;IAEhC;;;;;OAKG;IACH,qBAAqB,CAAC,EAAE,MAAM,CAAC;IAE/B;;;;OAIG;IACH,eAAe,CAAC,EAAE,MAAM,CAAC;IAEzB;;;;;;OAMG;IACH,oBAAoB,CAAC,EAAE,MAAM,CAAC;IAE9B;;;;;OAKG;IACH,YAAY,CAAC,EAAE,MAAM,CAAC;IAEtB;;;;;OAKG;IACH,0BAA0B,CAAC,EAAE,MAAM,CAAC;IAEpC;;;OAGG;IACH,wBAA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1 = require("./events");
13
13
  /**
14
14
  * `Configuration` is a value object holding Crawlee configuration. By default, there is a
15
15
  * global singleton instance of this class available via `Configuration.getGlobalConfig()`.
16
- * Places that depend on a configurable behaviour depend on this class as have the global
16
+ * Places that depend on a configurable behaviour depend on this class, as they have the global
17
17
  * instance as the default value.
18
18
  *
19
+ * *Using global configuration:*
19
20
  * ```js
20
21
  * import { BasicCrawler, Configuration } from 'crawlee';
21
22
  *
23
+ * // Get the global configuration
24
+ * const config = Configuration.getGlobalConfig();
25
+ * // Set the 'persistStateIntervalMillis' option
26
+ * // of global configuration to 10 seconds
27
+ * config.set('persistStateIntervalMillis', 10_000);
28
+ *
29
+ * // No need to pass the configuration to the crawler,
30
+ * // as it's using the global configuration by default
31
+ * const crawler = new BasicCrawler();
32
+ * ```
33
+ *
34
+ * *Using custom configuration:*
35
+ * ```js
36
+ * import { BasicCrawler, Configuration } from 'crawlee';
37
+ *
38
+ * // Create a new configuration
22
39
  * const config = new Configuration({ persistStateIntervalMillis: 30_000 });
40
+ * // Pass the configuration to the crawler
23
41
  * const crawler = new BasicCrawler({ ... }, config);
24
42
  * ```
25
43
  *
26
44
  * The configuration provided via environment variables always takes precedence. We can also
27
45
  * define the `crawlee.json` file in the project root directory which will serve as a baseline,
28
- * so the options provided in constructor will override those.
46
+ * so the options provided in constructor will override those. In other words, the precedence is:
29
47
  *
30
- * > In other words, the precedence is: crawlee.json < constructor options < environment variables.
48
+ * ```text
49
+ * crawlee.json < constructor options < environment variables
50
+ * ```
31
51
  *
32
52
  * ## Supported Configuration Options
33
53
  *
@@ -121,8 +141,8 @@ class Configuration {
121
141
  this.options.set(key, value);
122
142
  }
123
143
  /**
124
- * Returns cached instance of {@link StorageClient} using options as defined in the environment variables or in
125
- * this {@link Configuration} instance. Only first call of this method will create the client, following calls will
144
+ * Returns cached instance of {@apilink StorageClient} using options as defined in the environment variables or in
145
+ * this {@apilink Configuration} instance. Only first call of this method will create the client, following calls will
126
146
  * return the same client instance.
127
147
  *
128
148
  * Caching works based on the `storageClientOptions`, so calling this method with different options will return
@@ -177,13 +197,13 @@ class Configuration {
177
197
  return Configuration.globalConfig;
178
198
  }
179
199
  /**
180
- * Gets default {@link StorageClient} instance.
200
+ * Gets default {@apilink StorageClient} instance.
181
201
  */
182
202
  static getStorageClient() {
183
203
  return this.getGlobalConfig().getStorageClient();
184
204
  }
185
205
  /**
186
- * Gets default {@link EventManager} instance.
206
+ * Gets default {@apilink EventManager} instance.
187
207
  */
188
208
  static getEventManager() {
189
209
  return this.getGlobalConfig().getEventManager();
@@ -1 +1 @@
1
- {"version":3,"file":"configuration.js","sourceRoot":"","sources":["../src/configuration.ts"],"names":[],"mappings":";;;;AACA,4DAAwD;AACxD,uCAAwD;AACxD,yCAAiC;AACjC,uDAAqD;AACrD,6CAA2C;AAE3C,0DAA2C;AAC3C,yCAAqC;AAErC,qCAA6C;AAkJ7C;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuCG;AACH,MAAa,aAAa;IAmDtB;;OAEG;IACH,YAAY,UAAgC,EAAE;QAT9C;;;;;WAAsG;QACtG;;;;mBAAqB,IAAI,GAAG,EAAmB;WAAC;QAS5C,IAAI,CAAC,YAAY,CAAC,OAAO,CAAC,CAAC;QAE3B,oEAAoE;QACpE,0BAAY,CAAC,mBAAmB,GAAG,EAAE,CAAC;QAEtC,6DAA6D;QAC7D,MAAM,QAAQ,GAAG,IAAI,CAAC,GAAG,CAAC,UAAU,CAAC,CAAC;QAEtC,IAAI,QAAQ,EAAE;YACV,MAAM,KAAK,GAAG,MAAM,CAAC,QAAQ,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,CAAC,CAAC,QAAQ,CAAC,CAAC,CAAC,cAAQ,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC,WAAW,EAAyB,CAAC,CAAC;YACvH,aAAG,CAAC,QAAQ,CAAC,KAAiB,CAAC,CAAC;SACnC;IACL,CAAC;IAED;;;;OAIG;IACH,GAAG,CAA0E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M;QACpB,8BAA8B,EAAE,sBAAsB;QACtD,4BAA4B,EAAE,oBAAoB;QAClD,+BAA+B,EAAE,uBAAuB;QACxD,iBAAiB,EAAE,UAAU;KAChC;GAAC;AAEF;;;;WAAgC,CAAC,cAAc,EAAE,UAAU,EAAE,MAAM,EAAE,uBAAuB,CAAC;GAAC;AAE9F;;;;WAAgC,CAAC,cAAc,EAAE,4BAA4B,EAAE,0BAA0B,CAAC;GAAC;AAE3G;;;;WAAwC;QACpC,sBAAsB,EAAE,SAAS;QACjC,gBAAgB,EAAE,SAAS;QAC3B,qBAAqB,EAAE,SAAS;QAChC,QAAQ,EAAE,OAAO;QACjB,eAAe,EAAE,IAAI;QACrB,oBAAoB,EAAE,IAAI;QAC1B,oBAAoB,EAAE,EAAE;QACxB,YAAY,EAAE,IAAI;QAClB,QAAQ,EAAE,IAAI;QACd,0BAA0B,EAAE,KAAM;QAClC,wBAAwB,EAAE,KAAM;KACnC;GAAC;AAEF;;;GAGG;AACH;;;;WAAiB,IAAI,oCAAiB,EAAiB;GAAC"}
@@ -6,13 +6,13 @@ import type { Session } from '../session_pool/session';
6
6
  export interface CrawlingContext<UserData extends Dictionary = Dictionary> extends Record<PropertyKey, unknown> {
7
7
  id: string;
8
8
  /**
9
- * The original {@link Request} object.
9
+ * The original {@apilink Request} object.
10
10
  */
11
11
  request: Request<UserData>;
12
12
  session?: Session;
13
13
  /**
14
14
  * An object with information about currently used proxy by the crawler
15
- * and configured by the {@link ProxyConfiguration} class.
15
+ * and configured by the {@apilink ProxyConfiguration} class.
16
16
  */
17
17
  proxyInfo?: ProxyInfo;
18
18
  log: Log;
@@ -28,7 +28,7 @@ export declare class Statistics {
28
28
  */
29
29
  readonly id: number;
30
30
  /**
31
- * Current statistic state used for doing calculations on {@link Statistics.calculate} calls
31
+ * Current statistic state used for doing calculations on {@apilink Statistics.calculate} calls
32
32
  */
33
33
  state: StatisticState;
34
34
  /**
@@ -67,7 +67,7 @@ class Statistics {
67
67
  value: Statistics.id++
68
68
  }); // assign an id while incrementing so it can be saved/restored from KV
69
69
  /**
70
- * Current statistic state used for doing calculations on {@link Statistics.calculate} calls
70
+ * Current statistic state used for doing calculations on {@apilink Statistics.calculate} calls
71
71
  */
72
72
  Object.defineProperty(this, "state", {
73
73
  enumerable: true,