apify 2.3.1-beta.4 → 3.0.0-alpha.0
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 +6 -5
- package/package.json +69 -128
- package/build/actor.d.ts +0 -113
- package/build/actor.d.ts.map +0 -1
- package/build/actor.js +0 -582
- package/build/actor.js.map +0 -1
- package/build/apify.d.ts +0 -752
- package/build/apify.d.ts.map +0 -1
- package/build/apify.js +0 -877
- package/build/apify.js.map +0 -1
- package/build/autoscaling/autoscaled_pool.d.ts +0 -384
- package/build/autoscaling/autoscaled_pool.d.ts.map +0 -1
- package/build/autoscaling/autoscaled_pool.js +0 -557
- package/build/autoscaling/autoscaled_pool.js.map +0 -1
- package/build/autoscaling/snapshotter.d.ts +0 -278
- package/build/autoscaling/snapshotter.d.ts.map +0 -1
- package/build/autoscaling/snapshotter.js +0 -447
- package/build/autoscaling/snapshotter.js.map +0 -1
- package/build/autoscaling/system_status.d.ts +0 -224
- package/build/autoscaling/system_status.d.ts.map +0 -1
- package/build/autoscaling/system_status.js +0 -228
- package/build/autoscaling/system_status.js.map +0 -1
- package/build/browser_launchers/browser_launcher.d.ts +0 -154
- package/build/browser_launchers/browser_launcher.d.ts.map +0 -1
- package/build/browser_launchers/browser_launcher.js +0 -160
- package/build/browser_launchers/browser_launcher.js.map +0 -1
- package/build/browser_launchers/browser_plugin.d.ts +0 -23
- package/build/browser_launchers/browser_plugin.d.ts.map +0 -1
- package/build/browser_launchers/browser_plugin.js +0 -25
- package/build/browser_launchers/browser_plugin.js.map +0 -1
- package/build/browser_launchers/playwright_launcher.d.ts +0 -131
- package/build/browser_launchers/playwright_launcher.d.ts.map +0 -1
- package/build/browser_launchers/playwright_launcher.js +0 -150
- package/build/browser_launchers/playwright_launcher.js.map +0 -1
- package/build/browser_launchers/puppeteer_launcher.d.ts +0 -153
- package/build/browser_launchers/puppeteer_launcher.d.ts.map +0 -1
- package/build/browser_launchers/puppeteer_launcher.js +0 -197
- package/build/browser_launchers/puppeteer_launcher.js.map +0 -1
- package/build/cache_container.d.ts +0 -31
- package/build/cache_container.d.ts.map +0 -1
- package/build/cache_container.js +0 -48
- package/build/cache_container.js.map +0 -1
- package/build/configuration.d.ts +0 -226
- package/build/configuration.d.ts.map +0 -1
- package/build/configuration.js +0 -325
- package/build/configuration.js.map +0 -1
- package/build/constants.d.ts +0 -37
- package/build/constants.d.ts.map +0 -1
- package/build/constants.js +0 -41
- package/build/constants.js.map +0 -1
- package/build/crawlers/basic_crawler.d.ts +0 -443
- package/build/crawlers/basic_crawler.d.ts.map +0 -1
- package/build/crawlers/basic_crawler.js +0 -664
- package/build/crawlers/basic_crawler.js.map +0 -1
- package/build/crawlers/browser_crawler.d.ts +0 -512
- package/build/crawlers/browser_crawler.d.ts.map +0 -1
- package/build/crawlers/browser_crawler.js +0 -540
- package/build/crawlers/browser_crawler.js.map +0 -1
- package/build/crawlers/cheerio_crawler.d.ts +0 -931
- package/build/crawlers/cheerio_crawler.d.ts.map +0 -1
- package/build/crawlers/cheerio_crawler.js +0 -913
- package/build/crawlers/cheerio_crawler.js.map +0 -1
- package/build/crawlers/crawler_extension.d.ts +0 -10
- package/build/crawlers/crawler_extension.d.ts.map +0 -1
- package/build/crawlers/crawler_extension.js +0 -19
- package/build/crawlers/crawler_extension.js.map +0 -1
- package/build/crawlers/crawler_utils.d.ts +0 -34
- package/build/crawlers/crawler_utils.d.ts.map +0 -1
- package/build/crawlers/crawler_utils.js +0 -87
- package/build/crawlers/crawler_utils.js.map +0 -1
- package/build/crawlers/playwright_crawler.d.ts +0 -448
- package/build/crawlers/playwright_crawler.d.ts.map +0 -1
- package/build/crawlers/playwright_crawler.js +0 -299
- package/build/crawlers/playwright_crawler.js.map +0 -1
- package/build/crawlers/puppeteer_crawler.d.ts +0 -425
- package/build/crawlers/puppeteer_crawler.d.ts.map +0 -1
- package/build/crawlers/puppeteer_crawler.js +0 -299
- package/build/crawlers/puppeteer_crawler.js.map +0 -1
- package/build/crawlers/statistics.d.ts +0 -185
- package/build/crawlers/statistics.d.ts.map +0 -1
- package/build/crawlers/statistics.js +0 -331
- package/build/crawlers/statistics.js.map +0 -1
- package/build/enqueue_links/click_elements.d.ts +0 -179
- package/build/enqueue_links/click_elements.d.ts.map +0 -1
- package/build/enqueue_links/click_elements.js +0 -434
- package/build/enqueue_links/click_elements.js.map +0 -1
- package/build/enqueue_links/enqueue_links.d.ts +0 -117
- package/build/enqueue_links/enqueue_links.d.ts.map +0 -1
- package/build/enqueue_links/enqueue_links.js +0 -163
- package/build/enqueue_links/enqueue_links.js.map +0 -1
- package/build/enqueue_links/shared.d.ts +0 -42
- package/build/enqueue_links/shared.d.ts.map +0 -1
- package/build/enqueue_links/shared.js +0 -121
- package/build/enqueue_links/shared.js.map +0 -1
- package/build/errors.d.ts +0 -29
- package/build/errors.d.ts.map +0 -1
- package/build/errors.js +0 -38
- package/build/errors.js.map +0 -1
- package/build/events.d.ts +0 -11
- package/build/events.d.ts.map +0 -1
- package/build/events.js +0 -147
- package/build/events.js.map +0 -1
- package/build/index.d.ts +0 -4
- package/build/index.d.ts.map +0 -1
- package/build/index.js +0 -7
- package/build/index.js.map +0 -1
- package/build/main.d.ts +0 -179
- package/build/main.d.ts.map +0 -1
- package/build/main.js +0 -81
- package/build/main.js.map +0 -1
- package/build/playwright_utils.d.ts +0 -9
- package/build/playwright_utils.d.ts.map +0 -1
- package/build/playwright_utils.js +0 -90
- package/build/playwright_utils.js.map +0 -1
- package/build/proxy_configuration.d.ts +0 -411
- package/build/proxy_configuration.d.ts.map +0 -1
- package/build/proxy_configuration.js +0 -517
- package/build/proxy_configuration.js.map +0 -1
- package/build/pseudo_url.d.ts +0 -86
- package/build/pseudo_url.d.ts.map +0 -1
- package/build/pseudo_url.js +0 -153
- package/build/pseudo_url.js.map +0 -1
- package/build/puppeteer_request_interception.d.ts +0 -8
- package/build/puppeteer_request_interception.d.ts.map +0 -1
- package/build/puppeteer_request_interception.js +0 -235
- package/build/puppeteer_request_interception.js.map +0 -1
- package/build/puppeteer_utils.d.ts +0 -250
- package/build/puppeteer_utils.d.ts.map +0 -1
- package/build/puppeteer_utils.js +0 -551
- package/build/puppeteer_utils.js.map +0 -1
- package/build/request.d.ts +0 -180
- package/build/request.d.ts.map +0 -1
- package/build/request.js +0 -261
- package/build/request.js.map +0 -1
- package/build/request_list.d.ts +0 -581
- package/build/request_list.d.ts.map +0 -1
- package/build/request_list.js +0 -826
- package/build/request_list.js.map +0 -1
- package/build/serialization.d.ts +0 -5
- package/build/serialization.d.ts.map +0 -1
- package/build/serialization.js +0 -139
- package/build/serialization.js.map +0 -1
- package/build/session_pool/errors.d.ts +0 -11
- package/build/session_pool/errors.d.ts.map +0 -1
- package/build/session_pool/errors.js +0 -18
- package/build/session_pool/errors.js.map +0 -1
- package/build/session_pool/events.d.ts +0 -5
- package/build/session_pool/events.d.ts.map +0 -1
- package/build/session_pool/events.js +0 -6
- package/build/session_pool/events.js.map +0 -1
- package/build/session_pool/session.d.ts +0 -286
- package/build/session_pool/session.d.ts.map +0 -1
- package/build/session_pool/session.js +0 -355
- package/build/session_pool/session.js.map +0 -1
- package/build/session_pool/session_pool.d.ts +0 -280
- package/build/session_pool/session_pool.d.ts.map +0 -1
- package/build/session_pool/session_pool.js +0 -393
- package/build/session_pool/session_pool.js.map +0 -1
- package/build/session_pool/session_utils.d.ts +0 -4
- package/build/session_pool/session_utils.d.ts.map +0 -1
- package/build/session_pool/session_utils.js +0 -24
- package/build/session_pool/session_utils.js.map +0 -1
- package/build/stealth/hiding_tricks.d.ts +0 -22
- package/build/stealth/hiding_tricks.d.ts.map +0 -1
- package/build/stealth/hiding_tricks.js +0 -308
- package/build/stealth/hiding_tricks.js.map +0 -1
- package/build/stealth/stealth.d.ts +0 -56
- package/build/stealth/stealth.d.ts.map +0 -1
- package/build/stealth/stealth.js +0 -125
- package/build/stealth/stealth.js.map +0 -1
- package/build/storages/dataset.d.ts +0 -288
- package/build/storages/dataset.d.ts.map +0 -1
- package/build/storages/dataset.js +0 -480
- package/build/storages/dataset.js.map +0 -1
- package/build/storages/key_value_store.d.ts +0 -243
- package/build/storages/key_value_store.d.ts.map +0 -1
- package/build/storages/key_value_store.js +0 -462
- package/build/storages/key_value_store.js.map +0 -1
- package/build/storages/request_queue.d.ts +0 -318
- package/build/storages/request_queue.d.ts.map +0 -1
- package/build/storages/request_queue.js +0 -636
- package/build/storages/request_queue.js.map +0 -1
- package/build/storages/storage_manager.d.ts +0 -87
- package/build/storages/storage_manager.d.ts.map +0 -1
- package/build/storages/storage_manager.js +0 -150
- package/build/storages/storage_manager.js.map +0 -1
- package/build/tsconfig.tsbuildinfo +0 -1
- package/build/typedefs.d.ts +0 -146
- package/build/typedefs.d.ts.map +0 -1
- package/build/typedefs.js +0 -88
- package/build/typedefs.js.map +0 -1
- package/build/utils.d.ts +0 -175
- package/build/utils.d.ts.map +0 -1
- package/build/utils.js +0 -731
- package/build/utils.js.map +0 -1
- package/build/utils_log.d.ts +0 -41
- package/build/utils_log.d.ts.map +0 -1
- package/build/utils_log.js +0 -192
- package/build/utils_log.js.map +0 -1
- package/build/utils_request.d.ts +0 -77
- package/build/utils_request.d.ts.map +0 -1
- package/build/utils_request.js +0 -385
- package/build/utils_request.js.map +0 -1
- package/build/utils_social.d.ts +0 -210
- package/build/utils_social.d.ts.map +0 -1
- package/build/utils_social.js +0 -787
- package/build/utils_social.js.map +0 -1
- package/build/validators.d.ts +0 -23
- package/build/validators.d.ts.map +0 -1
- package/build/validators.js +0 -29
- package/build/validators.js.map +0 -1
|
@@ -1,480 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.pushData = exports.openDataset = exports.Dataset = exports.chunkBySize = exports.checkAndSerialize = exports.LOCAL_FILENAME_DIGITS = exports.DATASET_ITERATORS_DEFAULT_LIMIT = void 0;
|
|
4
|
-
const tslib_1 = require("tslib");
|
|
5
|
-
const ow_1 = (0, tslib_1.__importDefault)(require("ow"));
|
|
6
|
-
const underscore_1 = (0, tslib_1.__importDefault)(require("underscore"));
|
|
7
|
-
const consts_1 = require("@apify/consts");
|
|
8
|
-
const storage_manager_1 = require("./storage_manager");
|
|
9
|
-
const utils_log_1 = (0, tslib_1.__importDefault)(require("../utils_log"));
|
|
10
|
-
const configuration_1 = require("../configuration");
|
|
11
|
-
/* eslint-enable no-unused-vars,import/named,import/no-duplicates,import/order */
|
|
12
|
-
exports.DATASET_ITERATORS_DEFAULT_LIMIT = 10000;
|
|
13
|
-
exports.LOCAL_FILENAME_DIGITS = 9;
|
|
14
|
-
const SAFETY_BUFFER_PERCENT = 0.01 / 100; // 0.01%
|
|
15
|
-
/**
|
|
16
|
-
* Accepts a JSON serializable object as an input, validates its serializability,
|
|
17
|
-
* and validates its serialized size against limitBytes. Optionally accepts its index
|
|
18
|
-
* in an array to provide better error messages. Returns serialized object.
|
|
19
|
-
*
|
|
20
|
-
* @param {*} item
|
|
21
|
-
* @param {number} limitBytes
|
|
22
|
-
* @param {number} [index]
|
|
23
|
-
* @returns {string}
|
|
24
|
-
* @ignore
|
|
25
|
-
*/
|
|
26
|
-
const checkAndSerialize = (item, limitBytes, index) => {
|
|
27
|
-
const s = typeof index === 'number' ? ` at index ${index} ` : ' ';
|
|
28
|
-
const isItemObject = item && typeof item === 'object' && !Array.isArray(item);
|
|
29
|
-
if (!isItemObject) {
|
|
30
|
-
throw new Error(`Data item${s}is not an object. You can push only objects into a dataset.`);
|
|
31
|
-
}
|
|
32
|
-
let payload;
|
|
33
|
-
try {
|
|
34
|
-
payload = JSON.stringify(item);
|
|
35
|
-
}
|
|
36
|
-
catch (err) {
|
|
37
|
-
throw new Error(`Data item${s}is not serializable to JSON.\nCause: ${err.message}`);
|
|
38
|
-
}
|
|
39
|
-
const bytes = Buffer.byteLength(payload);
|
|
40
|
-
if (bytes > limitBytes) {
|
|
41
|
-
throw new Error(`Data item${s}is too large (size: ${bytes} bytes, limit: ${limitBytes} bytes)`);
|
|
42
|
-
}
|
|
43
|
-
return payload;
|
|
44
|
-
};
|
|
45
|
-
exports.checkAndSerialize = checkAndSerialize;
|
|
46
|
-
/**
|
|
47
|
-
* Takes an array of JSONs (payloads) as input and produces an array of JSON strings
|
|
48
|
-
* where each string is a JSON array of payloads with a maximum size of limitBytes per one
|
|
49
|
-
* JSON array. Fits as many payloads as possible into a single JSON array and then moves
|
|
50
|
-
* on to the next, preserving item order.
|
|
51
|
-
*
|
|
52
|
-
* The function assumes that none of the items is larger than limitBytes and does not validate.
|
|
53
|
-
*
|
|
54
|
-
* @param {Array<string>} items
|
|
55
|
-
* @param {number} limitBytes
|
|
56
|
-
* @returns {Array<string>}
|
|
57
|
-
* @ignore
|
|
58
|
-
*/
|
|
59
|
-
const chunkBySize = (items, limitBytes) => {
|
|
60
|
-
if (!items.length)
|
|
61
|
-
return [];
|
|
62
|
-
if (items.length === 1)
|
|
63
|
-
return items;
|
|
64
|
-
let lastChunkBytes = 2; // Add 2 bytes for [] wrapper.
|
|
65
|
-
const chunks = [];
|
|
66
|
-
// Split payloads into buckets of valid size.
|
|
67
|
-
for (const payload of items) { // eslint-disable-line
|
|
68
|
-
const bytes = Buffer.byteLength(payload);
|
|
69
|
-
if (bytes <= limitBytes && (bytes + 2) > limitBytes) {
|
|
70
|
-
// Handle cases where wrapping with [] would fail, but solo object is fine.
|
|
71
|
-
chunks.push(payload);
|
|
72
|
-
lastChunkBytes = bytes;
|
|
73
|
-
}
|
|
74
|
-
else if (lastChunkBytes + bytes <= limitBytes) {
|
|
75
|
-
if (!Array.isArray(underscore_1.default.last(chunks)))
|
|
76
|
-
chunks.push([]); // ensure array
|
|
77
|
-
underscore_1.default.last(chunks).push(payload);
|
|
78
|
-
lastChunkBytes += bytes + 1; // Add 1 byte for ',' separator.
|
|
79
|
-
}
|
|
80
|
-
else {
|
|
81
|
-
chunks.push([payload]);
|
|
82
|
-
lastChunkBytes = bytes + 2; // Add 2 bytes for [] wrapper.
|
|
83
|
-
}
|
|
84
|
-
}
|
|
85
|
-
// Stringify array chunks.
|
|
86
|
-
return chunks.map((chunk) => (typeof chunk === 'string' ? chunk : `[${chunk.join(',')}]`));
|
|
87
|
-
};
|
|
88
|
-
exports.chunkBySize = chunkBySize;
|
|
89
|
-
/**
|
|
90
|
-
* The `Dataset` class represents a store for structured data where each object stored has the same attributes,
|
|
91
|
-
* such as online store products or real estate offers. You can imagine it as a table,
|
|
92
|
-
* where each object is a row and its attributes are columns.
|
|
93
|
-
* Dataset is an append-only storage - you can only add new records to it but you cannot modify or remove existing records.
|
|
94
|
-
* Typically it is used to store crawling results.
|
|
95
|
-
*
|
|
96
|
-
* Do not instantiate this class directly, use the
|
|
97
|
-
* {@link Apify#openDataset} function instead.
|
|
98
|
-
*
|
|
99
|
-
* `Dataset` stores its data either on local disk or in the Apify cloud,
|
|
100
|
-
* depending on whether the `APIFY_LOCAL_STORAGE_DIR` or `APIFY_TOKEN` environment variables are set.
|
|
101
|
-
*
|
|
102
|
-
* If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the data is stored in
|
|
103
|
-
* the local directory in the following files:
|
|
104
|
-
* ```
|
|
105
|
-
* {APIFY_LOCAL_STORAGE_DIR}/datasets/{DATASET_ID}/{INDEX}.json
|
|
106
|
-
* ```
|
|
107
|
-
* Note that `{DATASET_ID}` is the name or ID of the dataset. The default dataset has ID: `default`,
|
|
108
|
-
* unless you override it by setting the `APIFY_DEFAULT_DATASET_ID` environment variable.
|
|
109
|
-
* Each dataset item is stored as a separate JSON file, where `{INDEX}` is a zero-based index of the item in the dataset.
|
|
110
|
-
*
|
|
111
|
-
* If the `APIFY_TOKEN` environment variable is set but `APIFY_LOCAL_STORAGE_DIR` not, the data is stored in the
|
|
112
|
-
* [Apify Dataset](https://docs.apify.com/storage/dataset)
|
|
113
|
-
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
114
|
-
* option to {@link Apify#openDataset} function,
|
|
115
|
-
* even if the `APIFY_LOCAL_STORAGE_DIR` variable is set.
|
|
116
|
-
*
|
|
117
|
-
* **Example usage:**
|
|
118
|
-
*
|
|
119
|
-
* ```javascript
|
|
120
|
-
* // Write a single row to the default dataset
|
|
121
|
-
* await Apify.pushData({ col1: 123, col2: 'val2' });
|
|
122
|
-
*
|
|
123
|
-
* // Open a named dataset
|
|
124
|
-
* const dataset = await Apify.openDataset('some-name');
|
|
125
|
-
*
|
|
126
|
-
* // Write a single row
|
|
127
|
-
* await dataset.pushData({ foo: 'bar' });
|
|
128
|
-
*
|
|
129
|
-
* // Write multiple rows
|
|
130
|
-
* await dataset.pushData([
|
|
131
|
-
* { foo: 'bar2', col2: 'val2' },
|
|
132
|
-
* { col3: 123 },
|
|
133
|
-
* ]);
|
|
134
|
-
* ```
|
|
135
|
-
* @hideconstructor
|
|
136
|
-
*/
|
|
137
|
-
class Dataset {
|
|
138
|
-
/**
|
|
139
|
-
* @param {object} options
|
|
140
|
-
* @param {string} options.id
|
|
141
|
-
* @param {string} [options.name]
|
|
142
|
-
* @param {ApifyClient|ApifyStorageLocal} options.client
|
|
143
|
-
* @param {boolean} options.isLocal
|
|
144
|
-
*/
|
|
145
|
-
constructor(options) {
|
|
146
|
-
this.id = options.id;
|
|
147
|
-
this.name = options.name;
|
|
148
|
-
this.isLocal = options.isLocal;
|
|
149
|
-
this.client = options.client.dataset(this.id);
|
|
150
|
-
this.log = utils_log_1.default.child({ prefix: 'Dataset' });
|
|
151
|
-
}
|
|
152
|
-
/**
|
|
153
|
-
* Stores an object or an array of objects to the dataset.
|
|
154
|
-
* The function returns a promise that resolves when the operation finishes.
|
|
155
|
-
* It has no result, but throws on invalid args or other errors.
|
|
156
|
-
*
|
|
157
|
-
* **IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`,
|
|
158
|
-
* otherwise the actor process might finish before the data is stored!
|
|
159
|
-
*
|
|
160
|
-
* The size of the data is limited by the receiving API and therefore `pushData()` will only
|
|
161
|
-
* allow objects whose JSON representation is smaller than 9MB. When an array is passed,
|
|
162
|
-
* none of the included objects
|
|
163
|
-
* may be larger than 9MB, but the array itself may be of any size.
|
|
164
|
-
*
|
|
165
|
-
* The function internally
|
|
166
|
-
* chunks the array into separate items and pushes them sequentially.
|
|
167
|
-
* The chunking process is stable (keeps order of data), but it does not provide a transaction
|
|
168
|
-
* safety mechanism. Therefore, in the event of an uploading error (after several automatic retries),
|
|
169
|
-
* the function's Promise will reject and the dataset will be left in a state where some of
|
|
170
|
-
* the items have already been saved to the dataset while other items from the source array were not.
|
|
171
|
-
* To overcome this limitation, the developer may, for example, read the last item saved in the dataset
|
|
172
|
-
* and re-attempt the save of the data from this item onwards to prevent duplicates.
|
|
173
|
-
* @param {object|Array<object>} data Object or array of objects containing data to be stored in the default dataset.
|
|
174
|
-
* The objects must be serializable to JSON and the JSON representation of each object must be smaller than 9MB.
|
|
175
|
-
* @return {Promise<void>}
|
|
176
|
-
*/
|
|
177
|
-
async pushData(data) {
|
|
178
|
-
(0, ow_1.default)(data, ow_1.default.object);
|
|
179
|
-
// eslint-disable-next-line no-return-await
|
|
180
|
-
const dispatch = async (payload) => await this.client.pushItems(payload);
|
|
181
|
-
const limit = consts_1.MAX_PAYLOAD_SIZE_BYTES - Math.ceil(consts_1.MAX_PAYLOAD_SIZE_BYTES * SAFETY_BUFFER_PERCENT);
|
|
182
|
-
// Handle singular Objects
|
|
183
|
-
if (!Array.isArray(data)) {
|
|
184
|
-
const payload = (0, exports.checkAndSerialize)(data, limit);
|
|
185
|
-
return dispatch(payload);
|
|
186
|
-
}
|
|
187
|
-
// Handle Arrays
|
|
188
|
-
const payloads = data.map((item, index) => (0, exports.checkAndSerialize)(item, limit, index));
|
|
189
|
-
const chunks = (0, exports.chunkBySize)(payloads, limit);
|
|
190
|
-
// Invoke client in series to preserve order of data
|
|
191
|
-
for (const chunk of chunks) {
|
|
192
|
-
await dispatch(chunk);
|
|
193
|
-
}
|
|
194
|
-
}
|
|
195
|
-
/**
|
|
196
|
-
* Returns {@link DatasetContent} object holding the items in the dataset based on the provided parameters.
|
|
197
|
-
*
|
|
198
|
-
* If you need to get data in an unparsed format, use the {@link Apify#newClient} function to get a new
|
|
199
|
-
* `apify-client` instance and call
|
|
200
|
-
* [`datasetClient.downloadItems()`](https://github.com/apify/apify-client-js#DatasetClient+downloadItems)
|
|
201
|
-
*
|
|
202
|
-
* @param {Object} [options] All `getData()` parameters are passed
|
|
203
|
-
* via an options object with the following keys:
|
|
204
|
-
* @param {number} [options.offset=0]
|
|
205
|
-
* Number of array elements that should be skipped at the start.
|
|
206
|
-
* @param {number} [options.limit=250000]
|
|
207
|
-
* Maximum number of array elements to return.
|
|
208
|
-
* @param {boolean} [options.desc=false]
|
|
209
|
-
* If `true` then the objects are sorted by `createdAt` in descending order.
|
|
210
|
-
* Otherwise they are sorted in ascending order.
|
|
211
|
-
* @param {string[]} [options.fields]
|
|
212
|
-
* An array of field names that will be included in the result. If omitted, all fields are included in the results.
|
|
213
|
-
* @param {string} [options.unwind]
|
|
214
|
-
* Specifies a name of the field in the result objects that will be used to unwind the resulting objects.
|
|
215
|
-
* By default, the results are returned as they are.
|
|
216
|
-
* @param {boolean} [options.clean=false]
|
|
217
|
-
* If `true` then the function returns only non-empty items and skips hidden fields (i.e. fields starting with `#` character).
|
|
218
|
-
* Note that the `clean` parameter is a shortcut for `skipHidden: true` and `skipEmpty: true` options.
|
|
219
|
-
* @param {boolean} [options.skipHidden=false]
|
|
220
|
-
* If `true` then the function doesn't return hidden fields (fields starting with "#" character).
|
|
221
|
-
* @param {boolean} [options.skipEmpty=false]
|
|
222
|
-
* If `true` then the function doesn't return empty items.
|
|
223
|
-
* Note that in this case the returned number of items might be lower than limit parameter and pagination must be done using the `limit` value.
|
|
224
|
-
* @return {Promise<DatasetContent>}
|
|
225
|
-
*/
|
|
226
|
-
async getData(options = {}) {
|
|
227
|
-
try {
|
|
228
|
-
return await this.client.listItems(options);
|
|
229
|
-
}
|
|
230
|
-
catch (e) {
|
|
231
|
-
if (e.message.includes('Cannot create a string longer than')) {
|
|
232
|
-
throw new Error('dataset.getData(): The response is too large for parsing. You can fix this by lowering the "limit" option.');
|
|
233
|
-
}
|
|
234
|
-
throw e;
|
|
235
|
-
}
|
|
236
|
-
}
|
|
237
|
-
/**
|
|
238
|
-
* Returns an object containing general information about the dataset.
|
|
239
|
-
*
|
|
240
|
-
* The function returns the same object as the Apify API Client's
|
|
241
|
-
* [getDataset](https://docs.apify.com/api/apify-client-js/latest#ApifyClient-datasets-getDataset)
|
|
242
|
-
* function, which in turn calls the
|
|
243
|
-
* [Get dataset](https://apify.com/docs/api/v2#/reference/datasets/dataset/get-dataset)
|
|
244
|
-
* API endpoint.
|
|
245
|
-
*
|
|
246
|
-
* **Example:**
|
|
247
|
-
* ```
|
|
248
|
-
* {
|
|
249
|
-
* id: "WkzbQMuFYuamGv3YF",
|
|
250
|
-
* name: "my-dataset",
|
|
251
|
-
* userId: "wRsJZtadYvn4mBZmm",
|
|
252
|
-
* createdAt: new Date("2015-12-12T07:34:14.202Z"),
|
|
253
|
-
* modifiedAt: new Date("2015-12-13T08:36:13.202Z"),
|
|
254
|
-
* accessedAt: new Date("2015-12-14T08:36:13.202Z"),
|
|
255
|
-
* itemCount: 14,
|
|
256
|
-
* cleanItemCount: 10
|
|
257
|
-
* }
|
|
258
|
-
* ```
|
|
259
|
-
*
|
|
260
|
-
* @returns {Promise<object>}
|
|
261
|
-
*/
|
|
262
|
-
async getInfo() {
|
|
263
|
-
return this.client.get();
|
|
264
|
-
}
|
|
265
|
-
/**
|
|
266
|
-
* Iterates over dataset items, yielding each in turn to an `iteratee` function.
|
|
267
|
-
* Each invocation of `iteratee` is called with two arguments: `(item, index)`.
|
|
268
|
-
*
|
|
269
|
-
* If the `iteratee` function returns a Promise then it is awaited before the next call.
|
|
270
|
-
* If it throws an error, the iteration is aborted and the `forEach` function throws the error.
|
|
271
|
-
*
|
|
272
|
-
* **Example usage**
|
|
273
|
-
* ```javascript
|
|
274
|
-
* const dataset = await Apify.openDataset('my-results');
|
|
275
|
-
* await dataset.forEach(async (item, index) => {
|
|
276
|
-
* console.log(`Item at ${index}: ${JSON.stringify(item)}`);
|
|
277
|
-
* });
|
|
278
|
-
* ```
|
|
279
|
-
*
|
|
280
|
-
* @param {DatasetConsumer} iteratee A function that is called for every item in the dataset.
|
|
281
|
-
* @param {Object} [options] All `forEach()` parameters are passed
|
|
282
|
-
* via an options object with the following keys:
|
|
283
|
-
* @param {boolean} [options.desc=false] If `true` then the objects are sorted by `createdAt` in descending order.
|
|
284
|
-
* @param {string[]} [options.fields] If provided then returned objects will only contain specified keys.
|
|
285
|
-
* @param {string} [options.unwind] If provided then objects will be unwound based on provided field.
|
|
286
|
-
* @param {number} [index=0] Specifies the initial index number passed to the `iteratee` function.
|
|
287
|
-
* @return {Promise<void>}
|
|
288
|
-
*/
|
|
289
|
-
async forEach(iteratee, options = {}, index = 0) {
|
|
290
|
-
if (!options.offset)
|
|
291
|
-
options.offset = 0;
|
|
292
|
-
if (options.format && options.format !== 'json')
|
|
293
|
-
throw new Error('Dataset.forEach/map/reduce() support only a "json" format.');
|
|
294
|
-
if (!options.limit)
|
|
295
|
-
options.limit = exports.DATASET_ITERATORS_DEFAULT_LIMIT;
|
|
296
|
-
const { items, total, limit, offset } = await this.getData(options);
|
|
297
|
-
for (const item of items) {
|
|
298
|
-
await iteratee(item, index++);
|
|
299
|
-
}
|
|
300
|
-
const newOffset = offset + limit;
|
|
301
|
-
if (newOffset >= total)
|
|
302
|
-
return;
|
|
303
|
-
const newOpts = { ...options, offset: newOffset };
|
|
304
|
-
return this.forEach(iteratee, newOpts, index);
|
|
305
|
-
}
|
|
306
|
-
/**
|
|
307
|
-
* Produces a new array of values by mapping each value in list through a transformation function `iteratee()`.
|
|
308
|
-
* Each invocation of `iteratee()` is called with two arguments: `(element, index)`.
|
|
309
|
-
*
|
|
310
|
-
* If `iteratee` returns a `Promise` then it's awaited before a next call.
|
|
311
|
-
*
|
|
312
|
-
* @param {DatasetMapper} iteratee
|
|
313
|
-
* @param {Object} [options] All `map()` parameters are passed
|
|
314
|
-
* via an options object with the following keys:
|
|
315
|
-
* @param {boolean} [options.desc=false] If `true` then the objects are sorted by createdAt in descending order.
|
|
316
|
-
* @param {string[]} [options.fields] If provided then returned objects will only contain specified keys
|
|
317
|
-
* @param {string} [options.unwind] If provided then objects will be unwound based on provided field.
|
|
318
|
-
* @return {Promise<Array<object>>}
|
|
319
|
-
*/
|
|
320
|
-
map(iteratee, options) {
|
|
321
|
-
const result = [];
|
|
322
|
-
const wrappedFunc = (item, index) => {
|
|
323
|
-
return Promise
|
|
324
|
-
.resolve()
|
|
325
|
-
.then(() => iteratee(item, index))
|
|
326
|
-
.then((res) => result.push(res));
|
|
327
|
-
};
|
|
328
|
-
return this
|
|
329
|
-
.forEach(wrappedFunc, options)
|
|
330
|
-
.then(() => result);
|
|
331
|
-
}
|
|
332
|
-
/**
|
|
333
|
-
* Reduces a list of values down to a single value.
|
|
334
|
-
*
|
|
335
|
-
* Memo is the initial state of the reduction, and each successive step of it should be returned by `iteratee()`.
|
|
336
|
-
* The `iteratee()` is passed three arguments: the `memo`, then the `value` and `index` of the iteration.
|
|
337
|
-
*
|
|
338
|
-
* If no `memo` is passed to the initial invocation of reduce, the `iteratee()` is not invoked on the first element of the list.
|
|
339
|
-
* The first element is instead passed as the memo in the invocation of the `iteratee()` on the next element in the list.
|
|
340
|
-
*
|
|
341
|
-
* If `iteratee()` returns a `Promise` then it's awaited before a next call.
|
|
342
|
-
*
|
|
343
|
-
* @param {DatasetReducer} iteratee
|
|
344
|
-
* @param {object} memo Initial state of the reduction.
|
|
345
|
-
* @param {Object} [options] All `reduce()` parameters are passed
|
|
346
|
-
* via an options object with the following keys:
|
|
347
|
-
* @param {boolean} [options.desc=false] If `true` then the objects are sorted by createdAt in descending order.
|
|
348
|
-
* @param {string[]} [options.fields] If provided then returned objects will only contain specified keys
|
|
349
|
-
* @param {string} [options.unwind] If provided then objects will be unwound based on provided field.
|
|
350
|
-
* @return {Promise<object>}
|
|
351
|
-
*/
|
|
352
|
-
reduce(iteratee, memo, options) {
|
|
353
|
-
let currentMemo = memo;
|
|
354
|
-
const wrappedFunc = (item, index) => {
|
|
355
|
-
return Promise
|
|
356
|
-
.resolve()
|
|
357
|
-
.then(() => {
|
|
358
|
-
return !index && currentMemo === undefined
|
|
359
|
-
? item
|
|
360
|
-
: iteratee(currentMemo, item, index);
|
|
361
|
-
})
|
|
362
|
-
.then((newMemo) => {
|
|
363
|
-
currentMemo = newMemo;
|
|
364
|
-
});
|
|
365
|
-
};
|
|
366
|
-
return this
|
|
367
|
-
.forEach(wrappedFunc, options)
|
|
368
|
-
.then(() => currentMemo);
|
|
369
|
-
}
|
|
370
|
-
/**
|
|
371
|
-
* Removes the dataset either from the Apify cloud storage or from the local directory,
|
|
372
|
-
* depending on the mode of operation.
|
|
373
|
-
*
|
|
374
|
-
* @return {Promise<void>}
|
|
375
|
-
*/
|
|
376
|
-
async drop() {
|
|
377
|
-
await this.client.delete();
|
|
378
|
-
const manager = new storage_manager_1.StorageManager(Dataset);
|
|
379
|
-
manager.closeStorage(this);
|
|
380
|
-
}
|
|
381
|
-
}
|
|
382
|
-
exports.Dataset = Dataset;
|
|
383
|
-
/**
|
|
384
|
-
* Opens a dataset and returns a promise resolving to an instance of the {@link Dataset} class.
|
|
385
|
-
*
|
|
386
|
-
* Datasets are used to store structured data where each object stored has the same attributes,
|
|
387
|
-
* such as online store products or real estate offers.
|
|
388
|
-
* The actual data is stored either on the local filesystem or in the cloud.
|
|
389
|
-
*
|
|
390
|
-
* For more details and code examples, see the {@link Dataset} class.
|
|
391
|
-
*
|
|
392
|
-
* @param {string} [datasetIdOrName]
|
|
393
|
-
* ID or name of the dataset to be opened. If `null` or `undefined`,
|
|
394
|
-
* the function returns the default dataset associated with the actor run.
|
|
395
|
-
* @param {Object} [options]
|
|
396
|
-
* @param {boolean} [options.forceCloud=false]
|
|
397
|
-
* If set to `true` then the function uses cloud storage usage even if the `APIFY_LOCAL_STORAGE_DIR`
|
|
398
|
-
* environment variable is set. This way it is possible to combine local and cloud storage.
|
|
399
|
-
* @param {Configuration} [options.config] SDK configuration instance, defaults to the static register
|
|
400
|
-
* @returns {Promise<Dataset>}
|
|
401
|
-
* @memberof module:Apify
|
|
402
|
-
* @name openDataset
|
|
403
|
-
* @function
|
|
404
|
-
*/
|
|
405
|
-
const openDataset = (datasetIdOrName, options = {}) => {
|
|
406
|
-
(0, ow_1.default)(datasetIdOrName, ow_1.default.optional.string);
|
|
407
|
-
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
408
|
-
forceCloud: ow_1.default.optional.boolean,
|
|
409
|
-
config: ow_1.default.optional.object.instanceOf(configuration_1.Configuration),
|
|
410
|
-
}));
|
|
411
|
-
const manager = new storage_manager_1.StorageManager(Dataset, options.config);
|
|
412
|
-
return manager.openStorage(datasetIdOrName, options);
|
|
413
|
-
};
|
|
414
|
-
exports.openDataset = openDataset;
|
|
415
|
-
/**
|
|
416
|
-
* Stores an object or an array of objects to the default {@link Dataset} of the current actor run.
|
|
417
|
-
*
|
|
418
|
-
* This is just a convenient shortcut for {@link Dataset#pushData}.
|
|
419
|
-
* For example, calling the following code:
|
|
420
|
-
* ```javascript
|
|
421
|
-
* await Apify.pushData({ myValue: 123 });
|
|
422
|
-
* ```
|
|
423
|
-
*
|
|
424
|
-
* is equivalent to:
|
|
425
|
-
* ```javascript
|
|
426
|
-
* const dataset = await Apify.openDataset();
|
|
427
|
-
* await dataset.pushData({ myValue: 123 });
|
|
428
|
-
* ```
|
|
429
|
-
*
|
|
430
|
-
* For more information, see {@link Apify#openDataset} and {@link Dataset#pushData}
|
|
431
|
-
*
|
|
432
|
-
* **IMPORTANT**: Make sure to use the `await` keyword when calling `pushData()`,
|
|
433
|
-
* otherwise the actor process might finish before the data are stored!
|
|
434
|
-
*
|
|
435
|
-
* @param {object} item Object or array of objects containing data to be stored in the default dataset.
|
|
436
|
-
* The objects must be serializable to JSON and the JSON representation of each object must be smaller than 9MB.
|
|
437
|
-
* @returns {Promise<void>}
|
|
438
|
-
*
|
|
439
|
-
* @memberof module:Apify
|
|
440
|
-
* @name pushData
|
|
441
|
-
* @function
|
|
442
|
-
*/
|
|
443
|
-
const pushData = async (item) => {
|
|
444
|
-
const dataset = await (0, exports.openDataset)();
|
|
445
|
-
return dataset.pushData(item);
|
|
446
|
-
};
|
|
447
|
-
exports.pushData = pushData;
|
|
448
|
-
/**
|
|
449
|
-
* @typedef DatasetContent
|
|
450
|
-
* @property {Array<object>} items Dataset entries based on chosen format parameter.
|
|
451
|
-
* @property {number} total Total count of entries in the dataset.
|
|
452
|
-
* @property {number} offset Position of the first returned entry in the dataset.
|
|
453
|
-
* @property {number} count Count of dataset entries returned in this set.
|
|
454
|
-
* @property {number} limit Maximum number of dataset entries requested.
|
|
455
|
-
*/
|
|
456
|
-
/**
|
|
457
|
-
* User-function used in the `Dataset.forEach()` API.
|
|
458
|
-
*
|
|
459
|
-
* @callback DatasetConsumer
|
|
460
|
-
* @param {object} item Current {@link Dataset} entry being processed.
|
|
461
|
-
* @param {number} index Position of current {Dataset} entry.
|
|
462
|
-
* @returns {object}
|
|
463
|
-
*/
|
|
464
|
-
/**
|
|
465
|
-
* User-function used in the `Dataset.map()` API.
|
|
466
|
-
*
|
|
467
|
-
* @callback DatasetMapper
|
|
468
|
-
* @param {object} item Currect {@link Dataset} entry being processed.
|
|
469
|
-
* @param {number} index Position of current {Dataset} entry.
|
|
470
|
-
* @returns {object}
|
|
471
|
-
*/
|
|
472
|
-
/**
|
|
473
|
-
* User-function used in the `Dataset.reduce()` API.
|
|
474
|
-
* @callback DatasetReducer
|
|
475
|
-
* @param {object} memo Previous state of the reduction.
|
|
476
|
-
* @param {object} item Currect {@link Dataset} entry being processed.
|
|
477
|
-
* @param {number} index Position of current {Dataset} entry.
|
|
478
|
-
* @returns {object}
|
|
479
|
-
*/
|
|
480
|
-
//# sourceMappingURL=dataset.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version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