apify-client 2.25.1-beta.0 → 2.25.1-beta.2
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/dist/apify_client.d.ts +11 -1
- package/dist/apify_client.js +4 -0
- package/dist/base/api_client.d.ts +3 -0
- package/dist/base/api_client.js +3 -0
- package/dist/bundle.js +46 -4
- package/dist/bundle.js.map +1 -1
- package/dist/resource_clients/actor.d.ts +105 -7
- package/dist/resource_clients/actor.js +2 -0
- package/dist/resource_clients/actor_collection.d.ts +30 -0
- package/dist/resource_clients/actor_collection.js +3 -0
- package/dist/resource_clients/actor_env_var.d.ts +1 -0
- package/dist/resource_clients/actor_env_var.js +1 -0
- package/dist/resource_clients/actor_env_var_collection.d.ts +5 -0
- package/dist/resource_clients/actor_env_var_collection.js +1 -0
- package/dist/resource_clients/actor_version.d.ts +5 -0
- package/dist/resource_clients/actor_version.js +2 -0
- package/dist/resource_clients/build.d.ts +17 -0
- package/dist/resource_clients/build.js +3 -0
- package/dist/resource_clients/dataset.d.ts +35 -0
- package/dist/resource_clients/dataset.js +2 -0
- package/dist/resource_clients/dataset_collection.d.ts +7 -1
- package/dist/resource_clients/key_value_store.d.ts +39 -0
- package/dist/resource_clients/key_value_store.js +3 -0
- package/dist/resource_clients/key_value_store_collection.d.ts +7 -1
- package/dist/resource_clients/log.d.ts +8 -0
- package/dist/resource_clients/log.js +2 -0
- package/dist/resource_clients/request_queue.d.ts +86 -0
- package/dist/resource_clients/request_queue.js +8 -0
- package/dist/resource_clients/request_queue_collection.d.ts +4 -1
- package/dist/resource_clients/run.d.ts +23 -0
- package/dist/resource_clients/run.js +5 -0
- package/dist/resource_clients/run_collection.d.ts +6 -0
- package/dist/resource_clients/schedule.d.ts +10 -0
- package/dist/resource_clients/store_collection.d.ts +18 -1
- package/dist/resource_clients/store_collection.js +1 -0
- package/dist/resource_clients/task.d.ts +18 -0
- package/dist/resource_clients/task.js +2 -0
- package/dist/resource_clients/task_collection.d.ts +3 -0
- package/dist/resource_clients/user.d.ts +33 -0
- package/dist/resource_clients/user.js +3 -0
- package/dist/resource_clients/webhook.d.ts +12 -0
- package/dist/resource_clients/webhook_dispatch.d.ts +6 -0
- package/dist/utils.d.ts +2 -0
- package/package.json +3 -3
|
@@ -272,6 +272,7 @@ class DatasetClient extends resource_client_1.ResourceClient {
|
|
|
272
272
|
*
|
|
273
273
|
* @returns Dataset statistics, or `undefined` if not available
|
|
274
274
|
* @see https://docs.apify.com/api/v2/dataset-statistics-get
|
|
275
|
+
* @since Added in 2.11.2
|
|
275
276
|
*/
|
|
276
277
|
async getStatistics() {
|
|
277
278
|
const requestOpts = {
|
|
@@ -319,6 +320,7 @@ class DatasetClient extends resource_client_1.ResourceClient {
|
|
|
319
320
|
* skipEmpty: true
|
|
320
321
|
* });
|
|
321
322
|
* ```
|
|
323
|
+
* @since Added in 2.13.0
|
|
322
324
|
*/
|
|
323
325
|
async createItemsPublicUrl(options = {}) {
|
|
324
326
|
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
@@ -62,9 +62,15 @@ export declare class DatasetCollectionClient extends ResourceCollectionClient {
|
|
|
62
62
|
export interface DatasetCollectionClientListOptions extends PaginationOptions {
|
|
63
63
|
unnamed?: boolean;
|
|
64
64
|
desc?: boolean;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Filter by ownership: 'ownedByMe' returns only user's own datasets, 'sharedWithMe' returns only shared datasets.
|
|
67
|
+
* @since Added in 2.22.1
|
|
68
|
+
*/
|
|
66
69
|
ownership?: STORAGE_OWNERSHIP_FILTER;
|
|
67
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @since Added in 2.3.0
|
|
73
|
+
*/
|
|
68
74
|
export interface DatasetCollectionClientGetOrCreateOptions {
|
|
69
75
|
schema?: Record<string, unknown>;
|
|
70
76
|
}
|
|
@@ -112,6 +112,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
112
112
|
* console.log(`Public URL: ${url}`);
|
|
113
113
|
* // You can now share this URL or use it in a browser
|
|
114
114
|
* ```
|
|
115
|
+
* @since Added in 2.14.0
|
|
115
116
|
*/
|
|
116
117
|
getRecordPublicUrl(key: string): Promise<string>;
|
|
117
118
|
/**
|
|
@@ -135,6 +136,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
135
136
|
* });
|
|
136
137
|
* console.log(`Share this URL: ${url}`);
|
|
137
138
|
* ```
|
|
139
|
+
* @since Added in 2.13.0
|
|
138
140
|
*/
|
|
139
141
|
createKeysPublicUrl(options?: KeyValueClientCreateKeysUrlOptions): Promise<string>;
|
|
140
142
|
/**
|
|
@@ -153,6 +155,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
153
155
|
* console.log('OUTPUT record exists');
|
|
154
156
|
* }
|
|
155
157
|
* ```
|
|
158
|
+
* @since Added in 2.9.0
|
|
156
159
|
*/
|
|
157
160
|
recordExists(key: string): Promise<boolean>;
|
|
158
161
|
/**
|
|
@@ -237,8 +240,14 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
237
240
|
export interface KeyValueStore {
|
|
238
241
|
id: string;
|
|
239
242
|
name?: string;
|
|
243
|
+
/**
|
|
244
|
+
* @since Added in 2.6.1
|
|
245
|
+
*/
|
|
240
246
|
title?: string;
|
|
241
247
|
userId: string;
|
|
248
|
+
/**
|
|
249
|
+
* @since Added in 2.21.0
|
|
250
|
+
*/
|
|
242
251
|
username?: string;
|
|
243
252
|
createdAt: Date;
|
|
244
253
|
modifiedAt: Date;
|
|
@@ -246,8 +255,17 @@ export interface KeyValueStore {
|
|
|
246
255
|
actId?: string;
|
|
247
256
|
actRunId?: string;
|
|
248
257
|
stats?: KeyValueStoreStats;
|
|
258
|
+
/**
|
|
259
|
+
* @since Added in 2.12.2
|
|
260
|
+
*/
|
|
249
261
|
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
262
|
+
/**
|
|
263
|
+
* @since Added in 2.13.0
|
|
264
|
+
*/
|
|
250
265
|
urlSigningSecretKey?: string | null;
|
|
266
|
+
/**
|
|
267
|
+
* @since Added in 2.13.0
|
|
268
|
+
*/
|
|
251
269
|
keysPublicUrl: string;
|
|
252
270
|
}
|
|
253
271
|
/**
|
|
@@ -265,7 +283,13 @@ export interface KeyValueStoreStats {
|
|
|
265
283
|
*/
|
|
266
284
|
export interface KeyValueClientUpdateOptions {
|
|
267
285
|
name?: string | null;
|
|
286
|
+
/**
|
|
287
|
+
* @since Added in 2.6.1
|
|
288
|
+
*/
|
|
268
289
|
title?: string;
|
|
290
|
+
/**
|
|
291
|
+
* @since Added in 2.12.2
|
|
292
|
+
*/
|
|
269
293
|
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
270
294
|
}
|
|
271
295
|
/**
|
|
@@ -275,13 +299,20 @@ export interface KeyValueClientListKeysOptions {
|
|
|
275
299
|
limit?: number;
|
|
276
300
|
exclusiveStartKey?: string;
|
|
277
301
|
collection?: string;
|
|
302
|
+
/**
|
|
303
|
+
* @since Added in 2.12.5
|
|
304
|
+
*/
|
|
278
305
|
prefix?: string;
|
|
306
|
+
/**
|
|
307
|
+
* @since Added in 2.13.0
|
|
308
|
+
*/
|
|
279
309
|
signature?: string;
|
|
280
310
|
}
|
|
281
311
|
/**
|
|
282
312
|
* Options for creating a public URL to list keys in a Key-Value Store.
|
|
283
313
|
*
|
|
284
314
|
* Extends {@link KeyValueClientListKeysOptions} with URL expiration control.
|
|
315
|
+
* @since Added in 2.16.0
|
|
285
316
|
*/
|
|
286
317
|
export interface KeyValueClientCreateKeysUrlOptions extends KeyValueClientListKeysOptions {
|
|
287
318
|
expiresInSecs?: number;
|
|
@@ -305,6 +336,9 @@ export interface KeyValueClientListKeysResult {
|
|
|
305
336
|
export interface KeyValueListItem {
|
|
306
337
|
key: string;
|
|
307
338
|
size: number;
|
|
339
|
+
/**
|
|
340
|
+
* @since Added in 2.15.1
|
|
341
|
+
*/
|
|
308
342
|
recordPublicUrl: string;
|
|
309
343
|
}
|
|
310
344
|
/**
|
|
@@ -313,6 +347,9 @@ export interface KeyValueListItem {
|
|
|
313
347
|
export interface KeyValueClientGetRecordOptions {
|
|
314
348
|
buffer?: boolean;
|
|
315
349
|
stream?: boolean;
|
|
350
|
+
/**
|
|
351
|
+
* @since Added in 2.18.0
|
|
352
|
+
*/
|
|
316
353
|
signature?: string;
|
|
317
354
|
}
|
|
318
355
|
/**
|
|
@@ -327,6 +364,7 @@ export interface KeyValueStoreRecord<T> {
|
|
|
327
364
|
}
|
|
328
365
|
/**
|
|
329
366
|
* Options for storing a record in a Key-Value Store.
|
|
367
|
+
* @since Added in 2.12.4
|
|
330
368
|
*/
|
|
331
369
|
export interface KeyValueStoreRecordOptions {
|
|
332
370
|
timeoutSecs?: number;
|
|
@@ -337,5 +375,6 @@ export interface KeyValueStoreRecordOptions {
|
|
|
337
375
|
*
|
|
338
376
|
* Returns Readable if stream option is true, Buffer if buffer option is true,
|
|
339
377
|
* otherwise returns JsonValue.
|
|
378
|
+
* @since Added in 2.0.6
|
|
340
379
|
*/
|
|
341
380
|
export type ReturnTypeFromOptions<Options extends KeyValueClientGetRecordOptions> = Options['stream'] extends true ? Readable : Options['buffer'] extends true ? Buffer : JsonValue;
|
|
@@ -169,6 +169,7 @@ class KeyValueStoreClient extends resource_client_1.ResourceClient {
|
|
|
169
169
|
* console.log(`Public URL: ${url}`);
|
|
170
170
|
* // You can now share this URL or use it in a browser
|
|
171
171
|
* ```
|
|
172
|
+
* @since Added in 2.14.0
|
|
172
173
|
*/
|
|
173
174
|
async getRecordPublicUrl(key) {
|
|
174
175
|
(0, ow_1.default)(key, ow_1.default.string.nonEmpty);
|
|
@@ -201,6 +202,7 @@ class KeyValueStoreClient extends resource_client_1.ResourceClient {
|
|
|
201
202
|
* });
|
|
202
203
|
* console.log(`Share this URL: ${url}`);
|
|
203
204
|
* ```
|
|
205
|
+
* @since Added in 2.13.0
|
|
204
206
|
*/
|
|
205
207
|
async createKeysPublicUrl(options = {}) {
|
|
206
208
|
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
@@ -240,6 +242,7 @@ class KeyValueStoreClient extends resource_client_1.ResourceClient {
|
|
|
240
242
|
* console.log('OUTPUT record exists');
|
|
241
243
|
* }
|
|
242
244
|
* ```
|
|
245
|
+
* @since Added in 2.9.0
|
|
243
246
|
*/
|
|
244
247
|
async recordExists(key) {
|
|
245
248
|
const requestOpts = {
|
|
@@ -62,9 +62,15 @@ export declare class KeyValueStoreCollectionClient extends ResourceCollectionCli
|
|
|
62
62
|
export interface KeyValueStoreCollectionClientListOptions extends PaginationOptions {
|
|
63
63
|
unnamed?: boolean;
|
|
64
64
|
desc?: boolean;
|
|
65
|
-
/**
|
|
65
|
+
/**
|
|
66
|
+
* Filter by ownership: 'ownedByMe' returns only user's own key-value stores, 'sharedWithMe' returns only shared key-value stores.
|
|
67
|
+
* @since Added in 2.22.1
|
|
68
|
+
*/
|
|
66
69
|
ownership?: STORAGE_OWNERSHIP_FILTER;
|
|
67
70
|
}
|
|
71
|
+
/**
|
|
72
|
+
* @since Added in 2.3.0
|
|
73
|
+
*/
|
|
68
74
|
export interface KeyValueStoreCollectionClientGetOrCreateOptions {
|
|
69
75
|
schema?: Record<string, unknown>;
|
|
70
76
|
}
|
|
@@ -49,12 +49,16 @@ export declare class LogClient extends ResourceClient {
|
|
|
49
49
|
*/
|
|
50
50
|
stream(options?: LogOptions): Promise<Readable | undefined>;
|
|
51
51
|
}
|
|
52
|
+
/**
|
|
53
|
+
* @since Added in 2.20.0
|
|
54
|
+
*/
|
|
52
55
|
export interface LogOptions {
|
|
53
56
|
/** @default false */
|
|
54
57
|
raw?: boolean;
|
|
55
58
|
}
|
|
56
59
|
/**
|
|
57
60
|
* Logger for redirected actor logs.
|
|
61
|
+
* @since Added in 2.20.0
|
|
58
62
|
*/
|
|
59
63
|
export declare class LoggerActorRedirect extends Logger {
|
|
60
64
|
constructor(options?: {});
|
|
@@ -62,6 +66,7 @@ export declare class LoggerActorRedirect extends Logger {
|
|
|
62
66
|
}
|
|
63
67
|
/**
|
|
64
68
|
* Helper class for redirecting streamed Actor logs to another log.
|
|
69
|
+
* @since Added in 2.20.0
|
|
65
70
|
*/
|
|
66
71
|
export declare class StreamedLog {
|
|
67
72
|
private destinationLog;
|
|
@@ -90,6 +95,9 @@ export declare class StreamedLog {
|
|
|
90
95
|
*/
|
|
91
96
|
private logBufferContent;
|
|
92
97
|
}
|
|
98
|
+
/**
|
|
99
|
+
* @since Added in 2.20.0
|
|
100
|
+
*/
|
|
93
101
|
export interface StreamedLogOptions {
|
|
94
102
|
/** Log client used to communicate with the Apify API. */
|
|
95
103
|
logClient: LogClient;
|
|
@@ -93,6 +93,7 @@ class LogClient extends resource_client_1.ResourceClient {
|
|
|
93
93
|
exports.LogClient = LogClient;
|
|
94
94
|
/**
|
|
95
95
|
* Logger for redirected actor logs.
|
|
96
|
+
* @since Added in 2.20.0
|
|
96
97
|
*/
|
|
97
98
|
class LoggerActorRedirect extends log_1.Logger {
|
|
98
99
|
constructor(options = {}) {
|
|
@@ -121,6 +122,7 @@ class LoggerActorRedirect extends log_1.Logger {
|
|
|
121
122
|
exports.LoggerActorRedirect = LoggerActorRedirect;
|
|
122
123
|
/**
|
|
123
124
|
* Helper class for redirecting streamed Actor logs to another log.
|
|
125
|
+
* @since Added in 2.20.0
|
|
124
126
|
*/
|
|
125
127
|
class StreamedLog {
|
|
126
128
|
destinationLog;
|
|
@@ -101,6 +101,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
101
101
|
* await client.requestQueue('my-queue').deleteRequestLock(request.id);
|
|
102
102
|
* }
|
|
103
103
|
* ```
|
|
104
|
+
* @since Added in 2.4.1
|
|
104
105
|
*/
|
|
105
106
|
listAndLockHead(options: RequestQueueClientListAndLockHeadOptions): Promise<RequestQueueClientListAndLockHeadResult>;
|
|
106
107
|
/**
|
|
@@ -185,6 +186,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
185
186
|
* { maxUnprocessedRequestsRetries: 5, maxParallel: 10 }
|
|
186
187
|
* );
|
|
187
188
|
* ```
|
|
189
|
+
* @since Added in 2.1.0
|
|
188
190
|
*/
|
|
189
191
|
batchAddRequests(requests: Omit<RequestQueueClientRequestSchema, 'id'>[], options?: RequestQueueClientBatchAddRequestWithRetriesOptions): Promise<RequestQueueClientBatchRequestsOperationResult>;
|
|
190
192
|
/**
|
|
@@ -195,6 +197,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
195
197
|
* @param requests - Array of requests to delete (by id or uniqueKey)
|
|
196
198
|
* @returns Result containing processed and unprocessed requests
|
|
197
199
|
* @see https://docs.apify.com/api/v2/request-queue-requests-batch-delete
|
|
200
|
+
* @since Added in 2.3.0
|
|
198
201
|
*/
|
|
199
202
|
batchDeleteRequests(requests: RequestQueueClientRequestToDelete[]): Promise<RequestQueueClientBatchRequestsOperationResult>;
|
|
200
203
|
/**
|
|
@@ -243,6 +246,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
243
246
|
* // Processing takes longer than expected, extend the lock
|
|
244
247
|
* await client.requestQueue('my-queue').prolongRequestLock(request.id, { lockSecs: 120 });
|
|
245
248
|
* ```
|
|
249
|
+
* @since Added in 2.4.1
|
|
246
250
|
*/
|
|
247
251
|
prolongRequestLock(id: string, options: RequestQueueClientProlongRequestLockOptions): Promise<RequestQueueClientProlongRequestLockResult>;
|
|
248
252
|
/**
|
|
@@ -254,6 +258,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
254
258
|
* @param id - Request ID
|
|
255
259
|
* @param options - Options such as whether to move to front
|
|
256
260
|
* @see https://docs.apify.com/api/v2/request-queue-request-lock-delete
|
|
261
|
+
* @since Added in 2.4.1
|
|
257
262
|
*/
|
|
258
263
|
deleteRequestLock(id: string, options?: RequestQueueClientDeleteRequestLockOptions): Promise<void>;
|
|
259
264
|
/**
|
|
@@ -265,6 +270,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
265
270
|
* @param options - Pagination options
|
|
266
271
|
* @returns List of requests with pagination information
|
|
267
272
|
* @see https://docs.apify.com/api/v2/request-queue-requests-get
|
|
273
|
+
* @since Added in 2.5.1
|
|
268
274
|
*/
|
|
269
275
|
listRequests(options?: RequestQueueClientListRequestsOptions): Promise<RequestQueueClientListRequestsResult> & AsyncIterable<RequestQueueClientRequestSchema>;
|
|
270
276
|
/**
|
|
@@ -275,6 +281,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
275
281
|
*
|
|
276
282
|
* @returns Number of requests that were unlocked
|
|
277
283
|
* @see https://docs.apify.com/api/v2/request-queue-requests-unlock-post
|
|
284
|
+
* @since Added in 2.12.5
|
|
278
285
|
*/
|
|
279
286
|
unlockRequests(): Promise<RequestQueueClientUnlockRequestsResult>;
|
|
280
287
|
/**
|
|
@@ -293,6 +300,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
293
300
|
* items.forEach((request) => console.log(request.url));
|
|
294
301
|
* }
|
|
295
302
|
* ```
|
|
303
|
+
* @since Added in 2.5.1
|
|
296
304
|
*/
|
|
297
305
|
paginateRequests(options?: RequestQueueClientPaginateRequestsOptions): RequestQueueRequestsAsyncIterable<RequestQueueClientListRequestsResult>;
|
|
298
306
|
}
|
|
@@ -301,6 +309,9 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
301
309
|
*/
|
|
302
310
|
export interface RequestQueueUserOptions {
|
|
303
311
|
clientKey?: string;
|
|
312
|
+
/**
|
|
313
|
+
* @since Added in 2.2.0
|
|
314
|
+
*/
|
|
304
315
|
timeoutSecs?: number;
|
|
305
316
|
}
|
|
306
317
|
/**
|
|
@@ -312,8 +323,14 @@ export interface RequestQueueUserOptions {
|
|
|
312
323
|
export interface RequestQueue {
|
|
313
324
|
id: string;
|
|
314
325
|
name?: string;
|
|
326
|
+
/**
|
|
327
|
+
* @since Added in 2.6.1
|
|
328
|
+
*/
|
|
315
329
|
title?: string;
|
|
316
330
|
userId: string;
|
|
331
|
+
/**
|
|
332
|
+
* @since Added in 2.21.0
|
|
333
|
+
*/
|
|
317
334
|
username?: string;
|
|
318
335
|
createdAt: Date;
|
|
319
336
|
modifiedAt: Date;
|
|
@@ -326,6 +343,9 @@ export interface RequestQueue {
|
|
|
326
343
|
actRunId?: string;
|
|
327
344
|
hadMultipleClients: boolean;
|
|
328
345
|
stats: RequestQueueStats;
|
|
346
|
+
/**
|
|
347
|
+
* @since Added in 2.12.2
|
|
348
|
+
*/
|
|
329
349
|
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
330
350
|
}
|
|
331
351
|
/**
|
|
@@ -343,7 +363,13 @@ export interface RequestQueueStats {
|
|
|
343
363
|
*/
|
|
344
364
|
export interface RequestQueueClientUpdateOptions {
|
|
345
365
|
name?: string | null;
|
|
366
|
+
/**
|
|
367
|
+
* @since Added in 2.6.1
|
|
368
|
+
*/
|
|
346
369
|
title?: string;
|
|
370
|
+
/**
|
|
371
|
+
* @since Added in 2.12.2
|
|
372
|
+
*/
|
|
347
373
|
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
348
374
|
}
|
|
349
375
|
/**
|
|
@@ -361,9 +387,13 @@ export interface RequestQueueClientListHeadResult {
|
|
|
361
387
|
hadMultipleClients: boolean;
|
|
362
388
|
items: RequestQueueClientListItem[];
|
|
363
389
|
}
|
|
390
|
+
/**
|
|
391
|
+
* @since Added in 2.23.2
|
|
392
|
+
*/
|
|
364
393
|
export type RequestQueueListRequestsFilter = 'locked' | 'pending';
|
|
365
394
|
/**
|
|
366
395
|
* Options for listing all requests in the queue.
|
|
396
|
+
* @since Added in 2.5.1
|
|
367
397
|
*/
|
|
368
398
|
export interface RequestQueueClientListRequestsOptions {
|
|
369
399
|
limit?: number;
|
|
@@ -372,33 +402,54 @@ export interface RequestQueueClientListRequestsOptions {
|
|
|
372
402
|
* @deprecated Use `cursor` for pagination instead.
|
|
373
403
|
*/
|
|
374
404
|
exclusiveStartId?: string;
|
|
405
|
+
/**
|
|
406
|
+
* @since Added in 2.23.2
|
|
407
|
+
*/
|
|
375
408
|
cursor?: string;
|
|
409
|
+
/**
|
|
410
|
+
* @since Added in 2.23.2
|
|
411
|
+
*/
|
|
376
412
|
filter?: readonly RequestQueueListRequestsFilter[];
|
|
377
413
|
}
|
|
378
414
|
/**
|
|
379
415
|
* Options for paginating through requests in the queue.
|
|
416
|
+
* @since Added in 2.5.1
|
|
380
417
|
*/
|
|
381
418
|
export interface RequestQueueClientPaginateRequestsOptions {
|
|
382
419
|
limit?: number;
|
|
383
420
|
maxPageLimit?: number;
|
|
384
421
|
/** @deprecated Use `cursor` for pagination instead. */
|
|
385
422
|
exclusiveStartId?: string;
|
|
423
|
+
/**
|
|
424
|
+
* @since Added in 2.23.2
|
|
425
|
+
*/
|
|
386
426
|
cursor?: string;
|
|
427
|
+
/**
|
|
428
|
+
* @since Added in 2.23.2
|
|
429
|
+
*/
|
|
387
430
|
filter?: readonly RequestQueueListRequestsFilter[];
|
|
388
431
|
}
|
|
389
432
|
/**
|
|
390
433
|
* Result of listing all requests in the queue.
|
|
434
|
+
* @since Added in 2.5.1
|
|
391
435
|
*/
|
|
392
436
|
export interface RequestQueueClientListRequestsResult {
|
|
393
437
|
limit: number;
|
|
394
438
|
/** @deprecated Use `cursor` for pagination instead. */
|
|
395
439
|
exclusiveStartId?: string;
|
|
440
|
+
/**
|
|
441
|
+
* @since Added in 2.23.2
|
|
442
|
+
*/
|
|
396
443
|
cursor?: string;
|
|
444
|
+
/**
|
|
445
|
+
* @since Added in 2.23.2
|
|
446
|
+
*/
|
|
397
447
|
nextCursor?: string;
|
|
398
448
|
items: RequestQueueClientRequestSchema[];
|
|
399
449
|
}
|
|
400
450
|
/**
|
|
401
451
|
* Options for listing and locking requests from the queue head.
|
|
452
|
+
* @since Added in 2.4.1
|
|
402
453
|
*/
|
|
403
454
|
export interface RequestQueueClientListAndLockHeadOptions {
|
|
404
455
|
lockSecs: number;
|
|
@@ -408,10 +459,17 @@ export interface RequestQueueClientListAndLockHeadOptions {
|
|
|
408
459
|
* Result of listing and locking requests from the queue head.
|
|
409
460
|
*
|
|
410
461
|
* Extends {@link RequestQueueClientListHeadResult} with lock information.
|
|
462
|
+
* @since Added in 2.4.1
|
|
411
463
|
*/
|
|
412
464
|
export interface RequestQueueClientListAndLockHeadResult extends RequestQueueClientListHeadResult {
|
|
413
465
|
lockSecs: number;
|
|
466
|
+
/**
|
|
467
|
+
* @since Added in 2.11.0
|
|
468
|
+
*/
|
|
414
469
|
queueHasLockedRequests: boolean;
|
|
470
|
+
/**
|
|
471
|
+
* @since Added in 2.11.0
|
|
472
|
+
*/
|
|
415
473
|
clientKey: string;
|
|
416
474
|
}
|
|
417
475
|
/**
|
|
@@ -423,25 +481,43 @@ export interface RequestQueueClientListItem {
|
|
|
423
481
|
uniqueKey: string;
|
|
424
482
|
url: string;
|
|
425
483
|
method: AllowedHttpMethods;
|
|
484
|
+
/**
|
|
485
|
+
* @since Added in 2.4.1
|
|
486
|
+
*/
|
|
426
487
|
lockExpiresAt?: Date;
|
|
427
488
|
}
|
|
428
489
|
export interface RequestQueueClientAddRequestOptions {
|
|
429
490
|
forefront?: boolean;
|
|
430
491
|
}
|
|
492
|
+
/**
|
|
493
|
+
* @since Added in 2.4.1
|
|
494
|
+
*/
|
|
431
495
|
export interface RequestQueueClientProlongRequestLockOptions {
|
|
432
496
|
forefront?: boolean;
|
|
433
497
|
lockSecs: number;
|
|
434
498
|
}
|
|
499
|
+
/**
|
|
500
|
+
* @since Added in 2.4.1
|
|
501
|
+
*/
|
|
435
502
|
export interface RequestQueueClientDeleteRequestLockOptions {
|
|
436
503
|
forefront?: boolean;
|
|
437
504
|
}
|
|
505
|
+
/**
|
|
506
|
+
* @since Added in 2.4.1
|
|
507
|
+
*/
|
|
438
508
|
export interface RequestQueueClientProlongRequestLockResult {
|
|
439
509
|
lockExpiresAt: Date;
|
|
440
510
|
}
|
|
511
|
+
/**
|
|
512
|
+
* @since Added in 2.3.0
|
|
513
|
+
*/
|
|
441
514
|
export interface RequestQueueClientBatchAddRequestWithRetriesOptions {
|
|
442
515
|
forefront?: boolean;
|
|
443
516
|
maxUnprocessedRequestsRetries?: number;
|
|
444
517
|
maxParallel?: number;
|
|
518
|
+
/**
|
|
519
|
+
* @since Added in 2.4.0
|
|
520
|
+
*/
|
|
445
521
|
minDelayBetweenUnprocessedRequestsRetriesMillis?: number;
|
|
446
522
|
}
|
|
447
523
|
/**
|
|
@@ -482,6 +558,9 @@ interface UnprocessedRequest {
|
|
|
482
558
|
url: string;
|
|
483
559
|
method?: AllowedHttpMethods;
|
|
484
560
|
}
|
|
561
|
+
/**
|
|
562
|
+
* @since Added in 2.12.5
|
|
563
|
+
*/
|
|
485
564
|
export interface RequestQueueClientUnlockRequestsResult {
|
|
486
565
|
unlockedCount: number;
|
|
487
566
|
}
|
|
@@ -489,16 +568,23 @@ export interface RequestQueueClientUnlockRequestsResult {
|
|
|
489
568
|
* Result of a batch operation on requests.
|
|
490
569
|
*
|
|
491
570
|
* Contains lists of successfully processed and unprocessed requests.
|
|
571
|
+
* @since Added in 2.3.0
|
|
492
572
|
*/
|
|
493
573
|
export interface RequestQueueClientBatchRequestsOperationResult {
|
|
494
574
|
processedRequests: ProcessedRequest[];
|
|
495
575
|
unprocessedRequests: UnprocessedRequest[];
|
|
496
576
|
}
|
|
577
|
+
/**
|
|
578
|
+
* @since Added in 2.3.0
|
|
579
|
+
*/
|
|
497
580
|
export type RequestQueueClientRequestToDelete = Pick<RequestQueueClientRequestSchema, 'id'> | Pick<RequestQueueClientRequestSchema, 'uniqueKey'>;
|
|
498
581
|
export type RequestQueueClientGetRequestResult = Omit<RequestQueueClientListItem, 'retryCount'>;
|
|
499
582
|
/**
|
|
500
583
|
* HTTP methods supported by Request Queue requests.
|
|
501
584
|
*/
|
|
502
585
|
export type AllowedHttpMethods = 'GET' | 'HEAD' | 'POST' | 'PUT' | 'DELETE' | 'TRACE' | 'OPTIONS' | 'CONNECT' | 'PATCH';
|
|
586
|
+
/**
|
|
587
|
+
* @since Added in 2.5.1
|
|
588
|
+
*/
|
|
503
589
|
export type RequestQueueRequestsAsyncIterable<T> = AsyncIterable<T>;
|
|
504
590
|
export {};
|
|
@@ -140,6 +140,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
140
140
|
* await client.requestQueue('my-queue').deleteRequestLock(request.id);
|
|
141
141
|
* }
|
|
142
142
|
* ```
|
|
143
|
+
* @since Added in 2.4.1
|
|
143
144
|
*/
|
|
144
145
|
async listAndLockHead(options) {
|
|
145
146
|
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
@@ -327,6 +328,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
327
328
|
* { maxUnprocessedRequestsRetries: 5, maxParallel: 10 }
|
|
328
329
|
* );
|
|
329
330
|
* ```
|
|
331
|
+
* @since Added in 2.1.0
|
|
330
332
|
*/
|
|
331
333
|
async batchAddRequests(requests, options = {}) {
|
|
332
334
|
const { forefront, maxUnprocessedRequestsRetries = DEFAULT_UNPROCESSED_RETRIES_BATCH_ADD_REQUESTS, maxParallel = DEFAULT_PARALLEL_BATCH_ADD_REQUESTS, minDelayBetweenUnprocessedRequestsRetriesMillis = DEFAULT_MIN_DELAY_BETWEEN_UNPROCESSED_REQUESTS_RETRIES_MILLIS, } = options;
|
|
@@ -379,6 +381,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
379
381
|
* @param requests - Array of requests to delete (by id or uniqueKey)
|
|
380
382
|
* @returns Result containing processed and unprocessed requests
|
|
381
383
|
* @see https://docs.apify.com/api/v2/request-queue-requests-batch-delete
|
|
384
|
+
* @since Added in 2.3.0
|
|
382
385
|
*/
|
|
383
386
|
async batchDeleteRequests(requests) {
|
|
384
387
|
(0, ow_1.default)(requests, ow_1.default.array
|
|
@@ -486,6 +489,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
486
489
|
* // Processing takes longer than expected, extend the lock
|
|
487
490
|
* await client.requestQueue('my-queue').prolongRequestLock(request.id, { lockSecs: 120 });
|
|
488
491
|
* ```
|
|
492
|
+
* @since Added in 2.4.1
|
|
489
493
|
*/
|
|
490
494
|
async prolongRequestLock(id, options) {
|
|
491
495
|
(0, ow_1.default)(id, ow_1.default.string);
|
|
@@ -514,6 +518,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
514
518
|
* @param id - Request ID
|
|
515
519
|
* @param options - Options such as whether to move to front
|
|
516
520
|
* @see https://docs.apify.com/api/v2/request-queue-request-lock-delete
|
|
521
|
+
* @since Added in 2.4.1
|
|
517
522
|
*/
|
|
518
523
|
async deleteRequestLock(id, options = {}) {
|
|
519
524
|
(0, ow_1.default)(id, ow_1.default.string);
|
|
@@ -539,6 +544,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
539
544
|
* @param options - Pagination options
|
|
540
545
|
* @returns List of requests with pagination information
|
|
541
546
|
* @see https://docs.apify.com/api/v2/request-queue-requests-get
|
|
547
|
+
* @since Added in 2.5.1
|
|
542
548
|
*/
|
|
543
549
|
listRequests(options = {}) {
|
|
544
550
|
(0, ow_1.default)(options, ow_1.default.object
|
|
@@ -599,6 +605,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
599
605
|
*
|
|
600
606
|
* @returns Number of requests that were unlocked
|
|
601
607
|
* @see https://docs.apify.com/api/v2/request-queue-requests-unlock-post
|
|
608
|
+
* @since Added in 2.12.5
|
|
602
609
|
*/
|
|
603
610
|
async unlockRequests() {
|
|
604
611
|
const response = await this.httpClient.call({
|
|
@@ -627,6 +634,7 @@ class RequestQueueClient extends resource_client_1.ResourceClient {
|
|
|
627
634
|
* items.forEach((request) => console.log(request.url));
|
|
628
635
|
* }
|
|
629
636
|
* ```
|
|
637
|
+
* @since Added in 2.5.1
|
|
630
638
|
*/
|
|
631
639
|
paginateRequests(options = {}) {
|
|
632
640
|
(0, ow_1.default)(options, ow_1.default.object
|
|
@@ -61,7 +61,10 @@ export declare class RequestQueueCollectionClient extends ResourceCollectionClie
|
|
|
61
61
|
export interface RequestQueueCollectionListOptions extends PaginationOptions {
|
|
62
62
|
unnamed?: boolean;
|
|
63
63
|
desc?: boolean;
|
|
64
|
-
/**
|
|
64
|
+
/**
|
|
65
|
+
* Filter by ownership: 'ownedByMe' returns only user's own request queues, 'sharedWithMe' returns only shared request queues.
|
|
66
|
+
* @since Added in 2.22.1
|
|
67
|
+
*/
|
|
65
68
|
ownership?: STORAGE_OWNERSHIP_FILTER;
|
|
66
69
|
}
|
|
67
70
|
export type RequestQueueCollectionListResult = PaginatedList<RequestQueue> & {
|
|
@@ -77,6 +77,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
77
77
|
* Deletes the Actor run.
|
|
78
78
|
*
|
|
79
79
|
* @see https://docs.apify.com/api/v2/actor-run-delete
|
|
80
|
+
* @since Added in 2.8.1
|
|
80
81
|
*/
|
|
81
82
|
delete(): Promise<void>;
|
|
82
83
|
/**
|
|
@@ -119,6 +120,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
119
120
|
* ```javascript
|
|
120
121
|
* const run = await client.run('run-id').reboot();
|
|
121
122
|
* ```
|
|
123
|
+
* @since Added in 2.8.0
|
|
122
124
|
*/
|
|
123
125
|
reboot(): Promise<ActorRun>;
|
|
124
126
|
/**
|
|
@@ -137,6 +139,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
137
139
|
* statusMessage: 'Processing items: 50/100'
|
|
138
140
|
* });
|
|
139
141
|
* ```
|
|
142
|
+
* @since Added in 2.6.0
|
|
140
143
|
*/
|
|
141
144
|
update(newFields: RunUpdateOptions): Promise<ActorRun>;
|
|
142
145
|
/**
|
|
@@ -172,6 +175,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
172
175
|
* @param options.idempotencyKey - Optional key to ensure the charge is not duplicated. If not provided, one is auto-generated.
|
|
173
176
|
* @returns Empty response object.
|
|
174
177
|
* @see https://docs.apify.com/api/v2/post-charge-run
|
|
178
|
+
* @since Added in 2.11.0
|
|
175
179
|
*/
|
|
176
180
|
charge(options: RunChargeOptions): Promise<ApifyResponse<Record<string, never>>>;
|
|
177
181
|
/**
|
|
@@ -258,11 +262,13 @@ export declare class RunClient extends ResourceClient {
|
|
|
258
262
|
log(): LogClient;
|
|
259
263
|
/**
|
|
260
264
|
* Get StreamedLog for convenient streaming of the run log and their redirection.
|
|
265
|
+
* @since Added in 2.20.0
|
|
261
266
|
*/
|
|
262
267
|
getStreamedLog(options?: GetStreamedLogOptions): Promise<StreamedLog | undefined>;
|
|
263
268
|
}
|
|
264
269
|
/**
|
|
265
270
|
* Options for getting a streamed log.
|
|
271
|
+
* @since Added in 2.20.0
|
|
266
272
|
*/
|
|
267
273
|
export interface GetStreamedLogOptions {
|
|
268
274
|
toLog?: Log | null | 'default';
|
|
@@ -289,10 +295,17 @@ export interface RunMetamorphOptions {
|
|
|
289
295
|
}
|
|
290
296
|
/**
|
|
291
297
|
* Options for updating a Run.
|
|
298
|
+
* @since Added in 2.6.0
|
|
292
299
|
*/
|
|
293
300
|
export interface RunUpdateOptions {
|
|
294
301
|
statusMessage?: string;
|
|
302
|
+
/**
|
|
303
|
+
* @since Added in 2.6.3
|
|
304
|
+
*/
|
|
295
305
|
isStatusMessageTerminal?: boolean;
|
|
306
|
+
/**
|
|
307
|
+
* @since Added in 2.12.2
|
|
308
|
+
*/
|
|
296
309
|
generalAccess?: RUN_GENERAL_ACCESS | null;
|
|
297
310
|
}
|
|
298
311
|
/**
|
|
@@ -302,12 +315,22 @@ export interface RunResurrectOptions {
|
|
|
302
315
|
build?: string;
|
|
303
316
|
memory?: number;
|
|
304
317
|
timeout?: number;
|
|
318
|
+
/**
|
|
319
|
+
* @since Added in 2.12.1
|
|
320
|
+
*/
|
|
305
321
|
maxItems?: number;
|
|
322
|
+
/**
|
|
323
|
+
* @since Added in 2.12.1
|
|
324
|
+
*/
|
|
306
325
|
maxTotalChargeUsd?: number;
|
|
326
|
+
/**
|
|
327
|
+
* @since Added in 2.19.0
|
|
328
|
+
*/
|
|
307
329
|
restartOnError?: boolean;
|
|
308
330
|
}
|
|
309
331
|
/**
|
|
310
332
|
* Options for charging events in a pay-per-event Actor run.
|
|
333
|
+
* @since Added in 2.11.0
|
|
311
334
|
*/
|
|
312
335
|
export interface RunChargeOptions {
|
|
313
336
|
/** Name of the event to charge. Must be defined in the Actor's pricing info else the API will throw. */
|