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,243 +0,0 @@
|
|
|
1
|
-
export function maybeStringify(value: any, options: any): any;
|
|
2
|
-
/**
|
|
3
|
-
* The `KeyValueStore` class represents a key-value store, a simple data storage that is used
|
|
4
|
-
* for saving and reading data records or files. Each data record is
|
|
5
|
-
* represented by a unique key and associated with a MIME content type. Key-value stores are ideal
|
|
6
|
-
* for saving screenshots, actor inputs and outputs, web pages, PDFs or to persist the state of crawlers.
|
|
7
|
-
*
|
|
8
|
-
* Do not instantiate this class directly, use the
|
|
9
|
-
* {@link Apify#openKeyValueStore} function instead.
|
|
10
|
-
*
|
|
11
|
-
* Each actor run is associated with a default key-value store, which is created exclusively
|
|
12
|
-
* for the run. By convention, the actor input and output are stored into the
|
|
13
|
-
* default key-value store under the `INPUT` and `OUTPUT` key, respectively.
|
|
14
|
-
* Typically, input and output are JSON files, although it can be any other format.
|
|
15
|
-
* To access the default key-value store directly, you can use the
|
|
16
|
-
* {@link Apify#getValue} and {@link Apify#setValue} convenience functions.
|
|
17
|
-
*
|
|
18
|
-
* To access the input, you can also use the {@link Apify#getInput} convenience function.
|
|
19
|
-
*
|
|
20
|
-
* `KeyValueStore` stores its data either on local disk or in the Apify cloud,
|
|
21
|
-
* depending on whether the [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir)
|
|
22
|
-
* or [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment variables are set.
|
|
23
|
-
*
|
|
24
|
-
* If the `APIFY_LOCAL_STORAGE_DIR` environment variable is set, the data is stored in
|
|
25
|
-
* the local directory in the following files:
|
|
26
|
-
* ```
|
|
27
|
-
* {APIFY_LOCAL_STORAGE_DIR}/key_value_stores/{STORE_ID}/{INDEX}.{EXT}
|
|
28
|
-
* ```
|
|
29
|
-
* Note that `{STORE_ID}` is the name or ID of the key-value store. The default key-value store has ID: `default`,
|
|
30
|
-
* unless you override it by setting the `APIFY_DEFAULT_KEY_VALUE_STORE_ID` environment variable.
|
|
31
|
-
* The `{KEY}` is the key of the record and `{EXT}` corresponds to the MIME content type of the data value.
|
|
32
|
-
*
|
|
33
|
-
* If the [`APIFY_TOKEN`](../guides/environment-variables#apify_token) environment variable is set but
|
|
34
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) not,
|
|
35
|
-
* the data is stored in the [Apify Key-value store](https://docs.apify.com/storage/key-value-store)
|
|
36
|
-
* cloud storage. Note that you can force usage of the cloud storage also by passing the `forceCloud`
|
|
37
|
-
* option to {@link Apify#openKeyValueStore} function, even if the
|
|
38
|
-
* [`APIFY_LOCAL_STORAGE_DIR`](../guides/environment-variables#apify_local_storage_dir) variable is set.
|
|
39
|
-
*
|
|
40
|
-
* **Example usage:**
|
|
41
|
-
*
|
|
42
|
-
* ```javascript
|
|
43
|
-
* // Get actor input from the default key-value store.
|
|
44
|
-
* const input = await Apify.getInput();
|
|
45
|
-
* // Get some value from the default key-value store.
|
|
46
|
-
* const otherValue = await Apify.getValue('my-key');
|
|
47
|
-
*
|
|
48
|
-
* // Write actor output to the default key-value store.
|
|
49
|
-
* await Apify.setValue('OUTPUT', { myResult: 123 });
|
|
50
|
-
*
|
|
51
|
-
* // Open a named key-value store
|
|
52
|
-
* const store = await Apify.openKeyValueStore('some-name');
|
|
53
|
-
*
|
|
54
|
-
* // Write a record. JavaScript object is automatically converted to JSON,
|
|
55
|
-
* // strings and binary buffers are stored as they are
|
|
56
|
-
* await store.setValue('some-key', { foo: 'bar' });
|
|
57
|
-
*
|
|
58
|
-
* // Read a record. Note that JSON is automatically parsed to a JavaScript object,
|
|
59
|
-
* // text data returned as a string and other data is returned as binary buffer
|
|
60
|
-
* const value = await store.getValue('some-key');
|
|
61
|
-
*
|
|
62
|
-
* // Drop (delete) the store
|
|
63
|
-
* await store.drop();
|
|
64
|
-
* ```
|
|
65
|
-
* @hideconstructor
|
|
66
|
-
*/
|
|
67
|
-
export class KeyValueStore {
|
|
68
|
-
/**
|
|
69
|
-
* @param {object} options
|
|
70
|
-
* @param {string} options.id
|
|
71
|
-
* @param {string} [options.name]
|
|
72
|
-
* @param {ApifyClient|ApifyStorageLocal} options.client
|
|
73
|
-
* @param {boolean} options.isLocal
|
|
74
|
-
* @param {Configuration} [config]
|
|
75
|
-
*/
|
|
76
|
-
constructor(options: {
|
|
77
|
-
id: string;
|
|
78
|
-
name?: string | undefined;
|
|
79
|
-
client: ApifyClient | ApifyStorageLocal;
|
|
80
|
-
isLocal: boolean;
|
|
81
|
-
}, config?: Configuration | undefined);
|
|
82
|
-
id: string;
|
|
83
|
-
name: string | undefined;
|
|
84
|
-
isLocal: boolean;
|
|
85
|
-
client: import("@apify/storage-local/dist/resource_clients/key_value_store").KeyValueStoreClient | import("apify-client").KeyValueStoreClient;
|
|
86
|
-
log: import("@apify/log/log").Log;
|
|
87
|
-
config: Configuration;
|
|
88
|
-
/**
|
|
89
|
-
* Gets a value from the key-value store.
|
|
90
|
-
*
|
|
91
|
-
* The function returns a `Promise` that resolves to the record value,
|
|
92
|
-
* whose JavaScript type depends on the MIME content type of the record.
|
|
93
|
-
* Records with the `application/json`
|
|
94
|
-
* content type are automatically parsed and returned as a JavaScript object.
|
|
95
|
-
* Similarly, records with `text/plain` content types are returned as a string.
|
|
96
|
-
* For all other content types, the value is returned as a raw
|
|
97
|
-
* [`Buffer`](https://nodejs.org/api/buffer.html) instance.
|
|
98
|
-
*
|
|
99
|
-
* If the record does not exist, the function resolves to `null`.
|
|
100
|
-
*
|
|
101
|
-
* To save or delete a value in the key-value store, use the
|
|
102
|
-
* {@link KeyValueStore#setValue} function.
|
|
103
|
-
*
|
|
104
|
-
* **Example usage:**
|
|
105
|
-
*
|
|
106
|
-
* ```javascript
|
|
107
|
-
* const store = await Apify.openKeyValueStore();
|
|
108
|
-
* const buffer = await store.getValue('screenshot1.png');
|
|
109
|
-
* ```
|
|
110
|
-
* @param {string} key
|
|
111
|
-
* Unique key of the record. It can be at most 256 characters long and only consist
|
|
112
|
-
* of the following characters: `a`-`z`, `A`-`Z`, `0`-`9` and `!-_.'()`
|
|
113
|
-
* @returns {Promise<KeyValueStoreValueTypes>}
|
|
114
|
-
* Returns a promise that resolves to an object, string
|
|
115
|
-
* or [`Buffer`](https://nodejs.org/api/buffer.html), depending
|
|
116
|
-
* on the MIME content type of the record.
|
|
117
|
-
*/
|
|
118
|
-
getValue(key: string): Promise<KeyValueStoreValueTypes>;
|
|
119
|
-
/**
|
|
120
|
-
* Saves or deletes a record in the key-value store.
|
|
121
|
-
* The function returns a promise that resolves once the record has been saved or deleted.
|
|
122
|
-
*
|
|
123
|
-
* **Example usage:**
|
|
124
|
-
*
|
|
125
|
-
* ```javascript
|
|
126
|
-
* const store = await Apify.openKeyValueStore();
|
|
127
|
-
* await store.setValue('OUTPUT', { foo: 'bar' });
|
|
128
|
-
* ```
|
|
129
|
-
*
|
|
130
|
-
* Beware that the key can be at most 256 characters long and only contain the following characters: `a-zA-Z0-9!-_.'()`
|
|
131
|
-
*
|
|
132
|
-
* By default, `value` is converted to JSON and stored with the
|
|
133
|
-
* `application/json; charset=utf-8` MIME content type.
|
|
134
|
-
* To store the value with another content type, pass it in the options as follows:
|
|
135
|
-
* ```javascript
|
|
136
|
-
* const store = await Apify.openKeyValueStore('my-text-store');
|
|
137
|
-
* await store.setValue('RESULTS', 'my text data', { contentType: 'text/plain' });
|
|
138
|
-
* ```
|
|
139
|
-
* If you set custom content type, `value` must be either a string or
|
|
140
|
-
* [`Buffer`](https://nodejs.org/api/buffer.html), otherwise an error will be thrown.
|
|
141
|
-
*
|
|
142
|
-
* If `value` is `null`, the record is deleted instead. Note that the `setValue()` function succeeds
|
|
143
|
-
* regardless whether the record existed or not.
|
|
144
|
-
*
|
|
145
|
-
* To retrieve a value from the key-value store, use the
|
|
146
|
-
* {@link KeyValueStore#getValue} function.
|
|
147
|
-
*
|
|
148
|
-
* **IMPORTANT:** Always make sure to use the `await` keyword when calling `setValue()`,
|
|
149
|
-
* otherwise the actor process might finish before the value is stored!
|
|
150
|
-
*
|
|
151
|
-
* @param {string} key
|
|
152
|
-
* Unique key of the record. It can be at most 256 characters long and only consist
|
|
153
|
-
* of the following characters: `a`-`z`, `A`-`Z`, `0`-`9` and `!-_.'()`
|
|
154
|
-
* @param {KeyValueStoreValueTypes} value
|
|
155
|
-
* Record data, which can be one of the following values:
|
|
156
|
-
* - If `null`, the record in the key-value store is deleted.
|
|
157
|
-
* - If no `options.contentType` is specified, `value` can be any JavaScript object and it will be stringified to JSON.
|
|
158
|
-
* - If `options.contentType` is set, `value` is taken as is and it must be a `String` or [`Buffer`](https://nodejs.org/api/buffer.html).
|
|
159
|
-
* For any other value an error will be thrown.
|
|
160
|
-
* @param {object} [options]
|
|
161
|
-
* @param {string} [options.contentType]
|
|
162
|
-
* Specifies a custom MIME content type of the record.
|
|
163
|
-
* @returns {Promise<void>}
|
|
164
|
-
*
|
|
165
|
-
*/
|
|
166
|
-
setValue(key: string, value: KeyValueStoreValueTypes, options?: {
|
|
167
|
-
contentType?: string | undefined;
|
|
168
|
-
} | undefined): Promise<void>;
|
|
169
|
-
/**
|
|
170
|
-
* Removes the key-value store either from the Apify cloud storage or from the local directory,
|
|
171
|
-
* depending on the mode of operation.
|
|
172
|
-
*
|
|
173
|
-
* @return {Promise<void>}
|
|
174
|
-
*/
|
|
175
|
-
drop(): Promise<void>;
|
|
176
|
-
/**
|
|
177
|
-
* Returns a URL for the given key that may be used to publicly
|
|
178
|
-
* access the value in the remote key-value store.
|
|
179
|
-
*
|
|
180
|
-
* @param {string} key
|
|
181
|
-
* @return {string}
|
|
182
|
-
*/
|
|
183
|
-
getPublicUrl(key: string): string;
|
|
184
|
-
/**
|
|
185
|
-
* Iterates over key-value store keys, yielding each in turn to an `iteratee` function.
|
|
186
|
-
* Each invocation of `iteratee` is called with three arguments: `(key, index, info)`, where `key`
|
|
187
|
-
* is the record key, `index` is a zero-based index of the key in the current iteration
|
|
188
|
-
* (regardless of `options.exclusiveStartKey`) and `info` is an object that contains a single property `size`
|
|
189
|
-
* indicating size of the record in bytes.
|
|
190
|
-
*
|
|
191
|
-
* If the `iteratee` function returns a Promise then it is awaited before the next call.
|
|
192
|
-
* If it throws an error, the iteration is aborted and the `forEachKey` function throws the error.
|
|
193
|
-
*
|
|
194
|
-
* **Example usage**
|
|
195
|
-
* ```javascript
|
|
196
|
-
* const keyValueStore = await Apify.openKeyValueStore();
|
|
197
|
-
* await keyValueStore.forEachKey(async (key, index, info) => {
|
|
198
|
-
* console.log(`Key at ${index}: ${key} has size ${info.size}`);
|
|
199
|
-
* });
|
|
200
|
-
* ```
|
|
201
|
-
*
|
|
202
|
-
* @param {KeyConsumer} iteratee A function that is called for every key in the key-value store.
|
|
203
|
-
* @param {object} [options] All `forEachKey()` parameters are passed
|
|
204
|
-
* via an options object with the following keys:
|
|
205
|
-
* @param {string} [options.exclusiveStartKey] All keys up to this one (including) are skipped from the result.
|
|
206
|
-
* @return {Promise<void>}
|
|
207
|
-
*/
|
|
208
|
-
forEachKey(iteratee: KeyConsumer, options?: {
|
|
209
|
-
exclusiveStartKey?: string | undefined;
|
|
210
|
-
} | undefined): Promise<void>;
|
|
211
|
-
/**
|
|
212
|
-
* @param {KeyConsumer} iteratee
|
|
213
|
-
* @param {Record<string, any>} [options]
|
|
214
|
-
* @param {number} [index=0]
|
|
215
|
-
* @return {Promise<Promise<void> | undefined>}
|
|
216
|
-
* @private
|
|
217
|
-
*/
|
|
218
|
-
private _forEachKey;
|
|
219
|
-
}
|
|
220
|
-
export function openKeyValueStore(storeIdOrName?: string | undefined, options?: {
|
|
221
|
-
forceCloud?: boolean | undefined;
|
|
222
|
-
config?: Configuration | undefined;
|
|
223
|
-
} | undefined): Promise<KeyValueStore>;
|
|
224
|
-
export function getValue(key: string): Promise<{
|
|
225
|
-
[x: string]: any;
|
|
226
|
-
} | string | Buffer | null>;
|
|
227
|
-
export function setValue(key: string, value: any, options?: {
|
|
228
|
-
contentType?: string | undefined;
|
|
229
|
-
} | undefined): Promise<void>;
|
|
230
|
-
export function getInput(): Promise<{
|
|
231
|
-
[x: string]: any;
|
|
232
|
-
} | string | Buffer | null>;
|
|
233
|
-
export type KeyValueStoreValueTypes = ({
|
|
234
|
-
[x: string]: any;
|
|
235
|
-
} | null | Buffer | string);
|
|
236
|
-
/**
|
|
237
|
-
* User-function used in the {@link KeyValueStoreforEachKey } method.
|
|
238
|
-
*/
|
|
239
|
-
export type KeyConsumer = (key: string, index: number, info: any, size: number) => any;
|
|
240
|
-
import { Configuration } from "../configuration";
|
|
241
|
-
import { ApifyClient } from "apify-client/dist/apify_client";
|
|
242
|
-
import { ApifyStorageLocal } from "@apify/storage-local";
|
|
243
|
-
//# sourceMappingURL=key_value_store.d.ts.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"key_value_store.d.ts","sourceRoot":"","sources":["../../src/storages/key_value_store.js"],"names":[],"mappings":"AAwBO,8DAuBN;AAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;GAgEG;AACH;IACI;;;;;;;OAOG;IACH;QAN2B,EAAE,EAAlB,MAAM;QACW,IAAI;QACkB,MAAM,EAA7C,WAAW,GAAC,iBAAiB;QACZ,OAAO,EAAxB,OAAO;2CAUjB;IANG,WAAoB;IACpB,yBAAwB;IACxB,iBAA8B;IAC9B,8IAAmD;IACnD,kCAAiD;IACjD,sBAAoB;IAGxB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA6BG;IACH,cARW,MAAM,GAGJ,QAAQ,uBAAuB,CAAC,CAa5C;IAED;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;OA8CG;IACH,cAfW,MAAM,SAGN,uBAAuB;;oBASrB,QAAQ,IAAI,CAAC,CA+BzB;IAED;;;;;OAKG;IACH,QAFY,QAAQ,IAAI,CAAC,CAMxB;IAED;;;;;;OAMG;IACH,kBAHW,MAAM,GACL,MAAM,CAIjB;IAED;;;;;;;;;;;;;;;;;;;;;;;OAuBG;IACH,qBANW,WAAW;;oBAIV,QAAQ,IAAI,CAAC,CAIxB;IAED;;;;;;OAMG;IACH,oBAeC;CACJ;AAwBM;;;gBALM,QAAQ,aAAa,CAAC,CAclC;AAiCM,8BAXI,MAAM,GAEJ,QAAQ;QAAO,MAAM;IAAK,MAAM,GAAC,MAAM,GAAC,IAAI,CAAC,CAazD;AAsCM,8BAhBI,MAAM;;gBAWL,QAAQ,IAAI,CAAC,CASxB;AAiCM,4BATM,QAAQ;QAAO,MAAM;IAAK,MAAM,GAAC,MAAM,GAAC,IAAI,CAAC,CASiD;sCApc9F,CAAC;QAAO,MAAM;IAAK,IAAI,GAAC,MAAM,GAAC,MAAM,CAAC;;;;gCAycxC,MAAM,SAEN,MAAM,mBAIN,MAAM"}
|