@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.
- 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 +33 -13
- package/configuration.d.ts.map +1 -1
- package/configuration.js +27 -7
- package/configuration.js.map +1 -1
- 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 +30 -49
- package/storages/key_value_store.d.ts.map +1 -1
- package/storages/key_value_store.js +51 -46
- 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
package/storages/dataset.d.ts
CHANGED
|
@@ -90,7 +90,7 @@ export interface DatasetIteratorOptions extends Omit<DatasetDataOptions, 'offset
|
|
|
90
90
|
* Typically it is used to store crawling results.
|
|
91
91
|
*
|
|
92
92
|
* Do not instantiate this class directly, use the
|
|
93
|
-
* {@
|
|
93
|
+
* {@apilink Dataset.open} function instead.
|
|
94
94
|
*
|
|
95
95
|
* `Dataset` stores its data either on local disk or in the Apify cloud,
|
|
96
96
|
* depending on whether the `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variables are set.
|
|
@@ -107,7 +107,7 @@ export interface DatasetIteratorOptions extends Omit<DatasetDataOptions, 'offset
|
|
|
107
107
|
* If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the
|
|
108
108
|
* [Apify Dataset](https://docs.apify.com/storage/dataset)
|
|
109
109
|
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
110
|
-
* option to {@
|
|
110
|
+
* option to {@apilink Dataset.open} function,
|
|
111
111
|
* even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.
|
|
112
112
|
*
|
|
113
113
|
* **Example usage:**
|
|
@@ -166,7 +166,7 @@ export declare class Dataset<Data extends Dictionary = Dictionary> {
|
|
|
166
166
|
*/
|
|
167
167
|
pushData(data: Data | Data[]): Promise<void>;
|
|
168
168
|
/**
|
|
169
|
-
* Returns {@
|
|
169
|
+
* Returns {@apilink DatasetContent} object holding the items in the dataset based on the provided parameters.
|
|
170
170
|
*/
|
|
171
171
|
getData(options?: DatasetDataOptions): Promise<PaginatedList<Data>>;
|
|
172
172
|
/**
|
|
@@ -245,13 +245,13 @@ export declare class Dataset<Data extends Dictionary = Dictionary> {
|
|
|
245
245
|
*/
|
|
246
246
|
drop(): Promise<void>;
|
|
247
247
|
/**
|
|
248
|
-
* Opens a dataset and returns a promise resolving to an instance of the {@
|
|
248
|
+
* Opens a dataset and returns a promise resolving to an instance of the {@apilink Dataset} class.
|
|
249
249
|
*
|
|
250
250
|
* Datasets are used to store structured data where each object stored has the same attributes,
|
|
251
251
|
* such as online store products or real estate offers.
|
|
252
252
|
* The actual data is stored either on the local filesystem or in the cloud.
|
|
253
253
|
*
|
|
254
|
-
* For more details and code examples, see the {@
|
|
254
|
+
* For more details and code examples, see the {@apilink Dataset} class.
|
|
255
255
|
*
|
|
256
256
|
* @param [datasetIdOrName]
|
|
257
257
|
* ID or name of the dataset to be opened. If `null` or `undefined`,
|
|
@@ -260,9 +260,9 @@ export declare class Dataset<Data extends Dictionary = Dictionary> {
|
|
|
260
260
|
*/
|
|
261
261
|
static open<Data extends Dictionary = Dictionary>(datasetIdOrName?: string | null, options?: StorageManagerOptions): Promise<Dataset<Data>>;
|
|
262
262
|
/**
|
|
263
|
-
* Stores an object or an array of objects to the default {@
|
|
263
|
+
* Stores an object or an array of objects to the default {@apilink Dataset} of the current crawler run.
|
|
264
264
|
*
|
|
265
|
-
* This is just a convenient shortcut for {@
|
|
265
|
+
* This is just a convenient shortcut for {@apilink Dataset.pushData}.
|
|
266
266
|
* For example, calling the following code:
|
|
267
267
|
* ```javascript
|
|
268
268
|
* await Dataset.pushData({ myValue: 123 });
|
|
@@ -274,7 +274,7 @@ export declare class Dataset<Data extends Dictionary = Dictionary> {
|
|
|
274
274
|
* await dataset.pushData({ myValue: 123 });
|
|
275
275
|
* ```
|
|
276
276
|
*
|
|
277
|
-
* For more information, see {@
|
|
277
|
+
* For more information, see {@apilink Dataset.open} and {@apilink Dataset.pushData}
|
|
278
278
|
*
|
|
279
279
|
* **IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`,
|
|
280
280
|
* otherwise the crawler process might finish before the data are stored!
|
|
@@ -290,8 +290,8 @@ export declare class Dataset<Data extends Dictionary = Dictionary> {
|
|
|
290
290
|
*/
|
|
291
291
|
export interface DatasetConsumer<Data> {
|
|
292
292
|
/**
|
|
293
|
-
* @param item Current {@
|
|
294
|
-
* @param index Position of current {@
|
|
293
|
+
* @param item Current {@apilink Dataset} entry being processed.
|
|
294
|
+
* @param index Position of current {@apilink Dataset} entry.
|
|
295
295
|
*/
|
|
296
296
|
(item: Data, index: number): Awaitable<void>;
|
|
297
297
|
}
|
|
@@ -301,8 +301,8 @@ export interface DatasetConsumer<Data> {
|
|
|
301
301
|
export interface DatasetMapper<Data, R> {
|
|
302
302
|
/**
|
|
303
303
|
* User-function used in the `Dataset.map()` API.
|
|
304
|
-
* @param item Current {@
|
|
305
|
-
* @param index Position of current {@
|
|
304
|
+
* @param item Current {@apilink Dataset} entry being processed.
|
|
305
|
+
* @param index Position of current {@apilink Dataset} entry.
|
|
306
306
|
*/
|
|
307
307
|
(item: Data, index: number): Awaitable<R>;
|
|
308
308
|
}
|
|
@@ -312,8 +312,8 @@ export interface DatasetMapper<Data, R> {
|
|
|
312
312
|
export interface DatasetReducer<T, Data> {
|
|
313
313
|
/**
|
|
314
314
|
* @param memo Previous state of the reduction.
|
|
315
|
-
* @param item Current {@
|
|
316
|
-
* @param index Position of current {@
|
|
315
|
+
* @param item Current {@apilink Dataset} entry being processed.
|
|
316
|
+
* @param index Position of current {@apilink Dataset} entry.
|
|
317
317
|
*/
|
|
318
318
|
(memo: T, item: Data, index: number): Awaitable<T>;
|
|
319
319
|
}
|
package/storages/dataset.js
CHANGED
|
@@ -87,7 +87,7 @@ exports.chunkBySize = chunkBySize;
|
|
|
87
87
|
* Typically it is used to store crawling results.
|
|
88
88
|
*
|
|
89
89
|
* Do not instantiate this class directly, use the
|
|
90
|
-
* {@
|
|
90
|
+
* {@apilink Dataset.open} function instead.
|
|
91
91
|
*
|
|
92
92
|
* `Dataset` stores its data either on local disk or in the Apify cloud,
|
|
93
93
|
* depending on whether the `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variables are set.
|
|
@@ -104,7 +104,7 @@ exports.chunkBySize = chunkBySize;
|
|
|
104
104
|
* If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the
|
|
105
105
|
* [Apify Dataset](https://docs.apify.com/storage/dataset)
|
|
106
106
|
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
107
|
-
* option to {@
|
|
107
|
+
* option to {@apilink Dataset.open} function,
|
|
108
108
|
* even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.
|
|
109
109
|
*
|
|
110
110
|
* **Example usage:**
|
|
@@ -208,7 +208,7 @@ class Dataset {
|
|
|
208
208
|
}
|
|
209
209
|
}
|
|
210
210
|
/**
|
|
211
|
-
* Returns {@
|
|
211
|
+
* Returns {@apilink DatasetContent} object holding the items in the dataset based on the provided parameters.
|
|
212
212
|
*/
|
|
213
213
|
async getData(options = {}) {
|
|
214
214
|
try {
|
|
@@ -343,13 +343,13 @@ class Dataset {
|
|
|
343
343
|
manager.closeStorage(this);
|
|
344
344
|
}
|
|
345
345
|
/**
|
|
346
|
-
* Opens a dataset and returns a promise resolving to an instance of the {@
|
|
346
|
+
* Opens a dataset and returns a promise resolving to an instance of the {@apilink Dataset} class.
|
|
347
347
|
*
|
|
348
348
|
* Datasets are used to store structured data where each object stored has the same attributes,
|
|
349
349
|
* such as online store products or real estate offers.
|
|
350
350
|
* The actual data is stored either on the local filesystem or in the cloud.
|
|
351
351
|
*
|
|
352
|
-
* For more details and code examples, see the {@
|
|
352
|
+
* For more details and code examples, see the {@apilink Dataset} class.
|
|
353
353
|
*
|
|
354
354
|
* @param [datasetIdOrName]
|
|
355
355
|
* ID or name of the dataset to be opened. If `null` or `undefined`,
|
|
@@ -367,9 +367,9 @@ class Dataset {
|
|
|
367
367
|
return manager.openStorage(datasetIdOrName, options.config.getStorageClient());
|
|
368
368
|
}
|
|
369
369
|
/**
|
|
370
|
-
* Stores an object or an array of objects to the default {@
|
|
370
|
+
* Stores an object or an array of objects to the default {@apilink Dataset} of the current crawler run.
|
|
371
371
|
*
|
|
372
|
-
* This is just a convenient shortcut for {@
|
|
372
|
+
* This is just a convenient shortcut for {@apilink Dataset.pushData}.
|
|
373
373
|
* For example, calling the following code:
|
|
374
374
|
* ```javascript
|
|
375
375
|
* await Dataset.pushData({ myValue: 123 });
|
|
@@ -381,7 +381,7 @@ class Dataset {
|
|
|
381
381
|
* await dataset.pushData({ myValue: 123 });
|
|
382
382
|
* ```
|
|
383
383
|
*
|
|
384
|
-
* For more information, see {@
|
|
384
|
+
* For more information, see {@apilink Dataset.open} and {@apilink Dataset.pushData}
|
|
385
385
|
*
|
|
386
386
|
* **IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`,
|
|
387
387
|
* otherwise the crawler process might finish before the data are stored!
|
|
@@ -18,37 +18,28 @@ 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
|
-
* `KeyValueStore` stores its data
|
|
33
|
-
* depending on whether the [`APIFY_IS_AT_HOME`](/docs/guides/environment-variables#apify_is_at_home)
|
|
34
|
-
* environment variable is set.
|
|
32
|
+
* `KeyValueStore` stores its data on a local disk.
|
|
35
33
|
*
|
|
36
|
-
* If the `
|
|
34
|
+
* If the `CRAWLEE_STORAGE_DIR` environment variable is set, the data is stored in
|
|
37
35
|
* the local directory in the following files:
|
|
38
36
|
* ```
|
|
39
|
-
* {
|
|
37
|
+
* {CRAWLEE_STORAGE_DIR}/key_value_stores/{STORE_ID}/{INDEX}.{EXT}
|
|
40
38
|
* ```
|
|
41
39
|
* Note that `{STORE_ID}` is the name or ID of the key-value store. The default key-value store has ID: `default`,
|
|
42
|
-
* unless you override it by setting the `
|
|
40
|
+
* unless you override it by setting the `CRAWLEE_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
|
|
43
41
|
* The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the data value.
|
|
44
42
|
*
|
|
45
|
-
* If the [`APIFY_TOKEN`](/docs/guides/environment-variables#apify_token) environment variable is set but
|
|
46
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) not,
|
|
47
|
-
* the data is stored in the [Apify Key-value store](https://docs.apify.com/storage/key-value-store)
|
|
48
|
-
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
49
|
-
* option to {@link KeyValueStore.open} function, even if the
|
|
50
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) variable is set.
|
|
51
|
-
*
|
|
52
43
|
* **Example usage:**
|
|
53
44
|
*
|
|
54
45
|
* ```javascript
|
|
@@ -102,7 +93,7 @@ export declare class KeyValueStore {
|
|
|
102
93
|
* If the record does not exist, the function resolves to `null`.
|
|
103
94
|
*
|
|
104
95
|
* To save or delete a value in the key-value store, use the
|
|
105
|
-
* {@
|
|
96
|
+
* {@apilink KeyValueStore.setValue} function.
|
|
106
97
|
*
|
|
107
98
|
* **Example usage:**
|
|
108
99
|
*
|
|
@@ -150,7 +141,7 @@ export declare class KeyValueStore {
|
|
|
150
141
|
* regardless whether the record existed or not.
|
|
151
142
|
*
|
|
152
143
|
* To retrieve a value from the key-value store, use the
|
|
153
|
-
* {@
|
|
144
|
+
* {@apilink KeyValueStore.getValue} function.
|
|
154
145
|
*
|
|
155
146
|
* **IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`,
|
|
156
147
|
* otherwise the crawler process might finish before the value is stored!
|
|
@@ -198,13 +189,13 @@ export declare class KeyValueStore {
|
|
|
198
189
|
forEachKey(iteratee: KeyConsumer, options?: KeyValueStoreIteratorOptions): Promise<void>;
|
|
199
190
|
private _forEachKey;
|
|
200
191
|
/**
|
|
201
|
-
* 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.
|
|
202
193
|
*
|
|
203
194
|
* Key-value stores are used to store records or files, along with their MIME content type.
|
|
204
195
|
* The records are stored and retrieved using a unique key.
|
|
205
196
|
* The actual data is stored either on a local filesystem or in the Apify cloud.
|
|
206
197
|
*
|
|
207
|
-
* For more details and code examples, see the {@
|
|
198
|
+
* For more details and code examples, see the {@apilink KeyValueStore} class.
|
|
208
199
|
*
|
|
209
200
|
* @param [storeIdOrName]
|
|
210
201
|
* ID or name of the key-value store to be opened. If `null` or `undefined`,
|
|
@@ -213,9 +204,9 @@ export declare class KeyValueStore {
|
|
|
213
204
|
*/
|
|
214
205
|
static open(storeIdOrName?: string | null, options?: StorageManagerOptions): Promise<KeyValueStore>;
|
|
215
206
|
/**
|
|
216
|
-
* Gets a value from the default {@
|
|
207
|
+
* Gets a value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
217
208
|
*
|
|
218
|
-
* This is just a convenient shortcut for {@
|
|
209
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.getValue}.
|
|
219
210
|
* For example, calling the following code:
|
|
220
211
|
* ```javascript
|
|
221
212
|
* const value = await KeyValueStore.getValue('my-key');
|
|
@@ -227,10 +218,10 @@ export declare class KeyValueStore {
|
|
|
227
218
|
* const value = await store.getValue('my-key');
|
|
228
219
|
* ```
|
|
229
220
|
*
|
|
230
|
-
* 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.
|
|
231
222
|
*
|
|
232
|
-
* For more information, see {@
|
|
233
|
-
* and {@
|
|
223
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
224
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
234
225
|
*
|
|
235
226
|
* @param key Unique record key.
|
|
236
227
|
* @param defaultValue Fallback that will be returned if no value if present in the storage.
|
|
@@ -244,9 +235,9 @@ export declare class KeyValueStore {
|
|
|
244
235
|
static getValue<T = unknown>(key: string, defaultValue?: T): Promise<T | null>;
|
|
245
236
|
static getAutoSavedValue<T extends Dictionary = Dictionary>(key: string, defaultValue?: T): Promise<T>;
|
|
246
237
|
/**
|
|
247
|
-
* 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.
|
|
248
239
|
*
|
|
249
|
-
* This is just a convenient shortcut for {@
|
|
240
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.setValue}.
|
|
250
241
|
* For example, calling the following code:
|
|
251
242
|
* ```javascript
|
|
252
243
|
* await KeyValueStore.setValue('OUTPUT', { foo: "bar" });
|
|
@@ -258,10 +249,10 @@ export declare class KeyValueStore {
|
|
|
258
249
|
* await store.setValue('OUTPUT', { foo: "bar" });
|
|
259
250
|
* ```
|
|
260
251
|
*
|
|
261
|
-
* 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.
|
|
262
253
|
*
|
|
263
|
-
* For more information, see {@
|
|
264
|
-
* and {@
|
|
254
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
255
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
265
256
|
*
|
|
266
257
|
* @param key
|
|
267
258
|
* Unique record key.
|
|
@@ -276,26 +267,16 @@ export declare class KeyValueStore {
|
|
|
276
267
|
*/
|
|
277
268
|
static setValue<T>(key: string, value: T | null, options?: RecordOptions): Promise<void>;
|
|
278
269
|
/**
|
|
279
|
-
* Gets the crawler input value from the default {@
|
|
280
|
-
*
|
|
281
|
-
*
|
|
282
|
-
* For example, calling the following code:
|
|
283
|
-
* ```javascript
|
|
284
|
-
* const input = await KeyValueStore.getInput();
|
|
285
|
-
* ```
|
|
286
|
-
*
|
|
287
|
-
* is equivalent to:
|
|
288
|
-
* ```javascript
|
|
289
|
-
* const store = await KeyValueStore.open();
|
|
290
|
-
* await store.getValue('INPUT');
|
|
291
|
-
* ```
|
|
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}.
|
|
292
273
|
*
|
|
293
274
|
* Note that the `getInput()` function does not cache the value read from the key-value store.
|
|
294
275
|
* If you need to use the input multiple times in your crawler,
|
|
295
276
|
* it is far more efficient to read it once and store it locally.
|
|
296
277
|
*
|
|
297
|
-
* For more information, see
|
|
298
|
-
* and {@
|
|
278
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
279
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
299
280
|
*
|
|
300
281
|
* @returns
|
|
301
282
|
* Returns a promise that resolves to an object, string
|
|
@@ -307,13 +288,13 @@ export declare class KeyValueStore {
|
|
|
307
288
|
static getInput<T = Dictionary | string | Buffer>(): Promise<T | null>;
|
|
308
289
|
}
|
|
309
290
|
/**
|
|
310
|
-
* User-function used in the {@
|
|
291
|
+
* User-function used in the {@apilink KeyValueStore.forEachKey} method.
|
|
311
292
|
*/
|
|
312
293
|
export interface KeyConsumer {
|
|
313
294
|
/**
|
|
314
|
-
* @param key Current {@
|
|
315
|
-
* @param index Position of the current key in {@
|
|
316
|
-
* @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.
|
|
317
298
|
* @param info.size Size of the value associated with the current key in bytes.
|
|
318
299
|
*/
|
|
319
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,EAAuB,aAAa,EAAE,MAAM,gBAAgB,CAAC;
|
|
1
|
+
{"version":3,"file":"key_value_store.d.ts","sourceRoot":"","sources":["../../src/storages/key_value_store.ts"],"names":[],"mappings":";AAGA,OAAO,KAAK,EAAE,UAAU,EAAuB,aAAa,EAAE,MAAM,gBAAgB,CAAC;AAGrF,OAAO,EAAE,aAAa,EAAE,MAAM,kBAAkB,CAAC;AACjD,OAAO,KAAK,EAAE,SAAS,EAAE,MAAM,aAAa,CAAC;AAC7C,OAAO,KAAK,EAAE,qBAAqB,EAAE,MAAM,mBAAmB,CAAC;AAI/D;;;;GAIG;AACH,eAAO,MAAM,cAAc,yBAA0B;IAAE,WAAW,CAAC,EAAE,MAAM,CAAA;CAAE,MAwB5E,CAAC;AAEF;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAuDG;AACH,qBAAa,aAAa;IAYqB,QAAQ,CAAC,MAAM;IAX1D,QAAQ,CAAC,EAAE,EAAE,MAAM,CAAC;IACpB,QAAQ,CAAC,IAAI,CAAC,EAAE,MAAM,CAAC;IACvB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAsB;IAC7C,OAAO,CAAC,wBAAwB,CAAS;IAEzC,wHAAwH;IACxH,OAAO,CAAC,QAAQ,CAAC,KAAK,CAA8B;IAEpD;;OAEG;gBACS,OAAO,EAAE,oBAAoB,EAAW,MAAM,gBAAkC;IAM5F;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA+BG;IACG,QAAQ,CAAC,CAAC,GAAG,OAAO,EAAE,GAAG,EAAE,MAAM,EAAE,YAAY,CAAC,EAAE,CAAC,GAAG,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GAAG,OAAO,CAAC,IAAI,CAAC;IAKlG;;;;;;;;;;;;;;;;;;OAkBG;WACU,QAAQ,CAAC,CAAC,GAAG,UAAU,GAAG,MAAM,GAAG,MAAM,KAAK,OAAO,CAAC,CAAC,GAAG,IAAI,CAAC;CA6B/E;AAED;;GAEG;AACH,MAAM,WAAW,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,37 +46,28 @@ 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
|
-
* `KeyValueStore` stores its data
|
|
59
|
-
* depending on whether the [`APIFY_IS_AT_HOME`](/docs/guides/environment-variables#apify_is_at_home)
|
|
60
|
-
* environment variable is set.
|
|
60
|
+
* `KeyValueStore` stores its data on a local disk.
|
|
61
61
|
*
|
|
62
|
-
* If the `
|
|
62
|
+
* If the `CRAWLEE_STORAGE_DIR` environment variable is set, the data is stored in
|
|
63
63
|
* the local directory in the following files:
|
|
64
64
|
* ```
|
|
65
|
-
* {
|
|
65
|
+
* {CRAWLEE_STORAGE_DIR}/key_value_stores/{STORE_ID}/{INDEX}.{EXT}
|
|
66
66
|
* ```
|
|
67
67
|
* Note that `{STORE_ID}` is the name or ID of the key-value store. The default key-value store has ID: `default`,
|
|
68
|
-
* unless you override it by setting the `
|
|
68
|
+
* unless you override it by setting the `CRAWLEE_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
|
|
69
69
|
* The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the data value.
|
|
70
70
|
*
|
|
71
|
-
* If the [`APIFY_TOKEN`](/docs/guides/environment-variables#apify_token) environment variable is set but
|
|
72
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) not,
|
|
73
|
-
* the data is stored in the [Apify Key-value store](https://docs.apify.com/storage/key-value-store)
|
|
74
|
-
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
75
|
-
* option to {@link KeyValueStore.open} function, even if the
|
|
76
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](/docs/guides/environment-variables#apify_local_storage_dir) variable is set.
|
|
77
|
-
*
|
|
78
71
|
* **Example usage:**
|
|
79
72
|
*
|
|
80
73
|
* ```javascript
|
|
@@ -162,7 +155,7 @@ class KeyValueStore {
|
|
|
162
155
|
* If the record does not exist, the function resolves to `null`.
|
|
163
156
|
*
|
|
164
157
|
* To save or delete a value in the key-value store, use the
|
|
165
|
-
* {@
|
|
158
|
+
* {@apilink KeyValueStore.setValue} function.
|
|
166
159
|
*
|
|
167
160
|
* **Example usage:**
|
|
168
161
|
*
|
|
@@ -232,7 +225,7 @@ class KeyValueStore {
|
|
|
232
225
|
* regardless whether the record existed or not.
|
|
233
226
|
*
|
|
234
227
|
* To retrieve a value from the key-value store, use the
|
|
235
|
-
* {@
|
|
228
|
+
* {@apilink KeyValueStore.getValue} function.
|
|
236
229
|
*
|
|
237
230
|
* **IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`,
|
|
238
231
|
* otherwise the crawler process might finish before the value is stored!
|
|
@@ -342,13 +335,13 @@ class KeyValueStore {
|
|
|
342
335
|
: undefined; // [].forEach() returns undefined.
|
|
343
336
|
}
|
|
344
337
|
/**
|
|
345
|
-
* 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.
|
|
346
339
|
*
|
|
347
340
|
* Key-value stores are used to store records or files, along with their MIME content type.
|
|
348
341
|
* The records are stored and retrieved using a unique key.
|
|
349
342
|
* The actual data is stored either on a local filesystem or in the Apify cloud.
|
|
350
343
|
*
|
|
351
|
-
* For more details and code examples, see the {@
|
|
344
|
+
* For more details and code examples, see the {@apilink KeyValueStore} class.
|
|
352
345
|
*
|
|
353
346
|
* @param [storeIdOrName]
|
|
354
347
|
* ID or name of the key-value store to be opened. If `null` or `undefined`,
|
|
@@ -365,9 +358,9 @@ class KeyValueStore {
|
|
|
365
358
|
return manager.openStorage(storeIdOrName);
|
|
366
359
|
}
|
|
367
360
|
/**
|
|
368
|
-
* Gets a value from the default {@
|
|
361
|
+
* Gets a value from the default {@apilink KeyValueStore} associated with the current crawler run.
|
|
369
362
|
*
|
|
370
|
-
* This is just a convenient shortcut for {@
|
|
363
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.getValue}.
|
|
371
364
|
* For example, calling the following code:
|
|
372
365
|
* ```javascript
|
|
373
366
|
* const value = await KeyValueStore.getValue('my-key');
|
|
@@ -379,10 +372,10 @@ class KeyValueStore {
|
|
|
379
372
|
* const value = await store.getValue('my-key');
|
|
380
373
|
* ```
|
|
381
374
|
*
|
|
382
|
-
* 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.
|
|
383
376
|
*
|
|
384
|
-
* For more information, see {@
|
|
385
|
-
* and {@
|
|
377
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
378
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
386
379
|
*
|
|
387
380
|
* @param key Unique record key.
|
|
388
381
|
* @param defaultValue Fallback that will be returned if no value if present in the storage.
|
|
@@ -402,9 +395,9 @@ class KeyValueStore {
|
|
|
402
395
|
return store.getAutoSavedValue(key, defaultValue);
|
|
403
396
|
}
|
|
404
397
|
/**
|
|
405
|
-
* 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.
|
|
406
399
|
*
|
|
407
|
-
* This is just a convenient shortcut for {@
|
|
400
|
+
* This is just a convenient shortcut for {@apilink KeyValueStore.setValue}.
|
|
408
401
|
* For example, calling the following code:
|
|
409
402
|
* ```javascript
|
|
410
403
|
* await KeyValueStore.setValue('OUTPUT', { foo: "bar" });
|
|
@@ -416,10 +409,10 @@ class KeyValueStore {
|
|
|
416
409
|
* await store.setValue('OUTPUT', { foo: "bar" });
|
|
417
410
|
* ```
|
|
418
411
|
*
|
|
419
|
-
* 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.
|
|
420
413
|
*
|
|
421
|
-
* For more information, see {@
|
|
422
|
-
* and {@
|
|
414
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
415
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
423
416
|
*
|
|
424
417
|
* @param key
|
|
425
418
|
* Unique record key.
|
|
@@ -437,26 +430,16 @@ class KeyValueStore {
|
|
|
437
430
|
return store.setValue(key, value, options);
|
|
438
431
|
}
|
|
439
432
|
/**
|
|
440
|
-
* Gets the crawler input value from the default {@
|
|
441
|
-
*
|
|
442
|
-
*
|
|
443
|
-
* For example, calling the following code:
|
|
444
|
-
* ```javascript
|
|
445
|
-
* const input = await KeyValueStore.getInput();
|
|
446
|
-
* ```
|
|
447
|
-
*
|
|
448
|
-
* is equivalent to:
|
|
449
|
-
* ```javascript
|
|
450
|
-
* const store = await KeyValueStore.open();
|
|
451
|
-
* await store.getValue('INPUT');
|
|
452
|
-
* ```
|
|
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}.
|
|
453
436
|
*
|
|
454
437
|
* Note that the `getInput()` function does not cache the value read from the key-value store.
|
|
455
438
|
* If you need to use the input multiple times in your crawler,
|
|
456
439
|
* it is far more efficient to read it once and store it locally.
|
|
457
440
|
*
|
|
458
|
-
* For more information, see
|
|
459
|
-
* and {@
|
|
441
|
+
* For more information, see {@apilink KeyValueStore.open}
|
|
442
|
+
* and {@apilink KeyValueStore.getValue}.
|
|
460
443
|
*
|
|
461
444
|
* @returns
|
|
462
445
|
* Returns a promise that resolves to an object, string
|
|
@@ -467,7 +450,29 @@ class KeyValueStore {
|
|
|
467
450
|
*/
|
|
468
451
|
static async getInput() {
|
|
469
452
|
const store = await this.open();
|
|
470
|
-
|
|
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);
|
|
471
476
|
}
|
|
472
477
|
}
|
|
473
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;SAC/E;QAAC,OAAO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