apify-client 3.0.0-beta.52 → 3.0.0-beta.54
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_api_error.d.ts +4 -4
- package/dist/apify_api_error.js +1 -1
- package/dist/bundle.js +1 -1
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +173 -177
- package/dist/generated/schemas.d.ts +51 -101
- package/dist/generated/schemas.js +91 -94
- package/dist/http_clients/base.d.ts +2 -4
- package/dist/models.d.ts +157 -180
- package/dist/models.js +6 -4
- package/dist/resource_clients/actor.d.ts +7 -7
- package/dist/resource_clients/actor.js +2 -2
- package/dist/resource_clients/actor_collection.d.ts +10 -10
- package/dist/resource_clients/actor_collection.js +1 -1
- package/dist/resource_clients/actor_env_var.d.ts +3 -3
- package/dist/resource_clients/actor_env_var_collection.d.ts +4 -4
- package/dist/resource_clients/actor_version.d.ts +5 -5
- package/dist/resource_clients/actor_version_collection.d.ts +4 -4
- package/dist/resource_clients/build.d.ts +1 -1
- package/dist/resource_clients/build_collection.d.ts +4 -4
- package/dist/resource_clients/dataset.d.ts +4 -4
- package/dist/resource_clients/dataset.js +2 -2
- package/dist/resource_clients/dataset_collection.d.ts +4 -4
- package/dist/resource_clients/dataset_collection.js +1 -1
- package/dist/resource_clients/key_value_store.d.ts +6 -6
- package/dist/resource_clients/key_value_store.js +2 -2
- package/dist/resource_clients/key_value_store_collection.d.ts +4 -4
- package/dist/resource_clients/key_value_store_collection.js +1 -1
- package/dist/resource_clients/request_queue.d.ts +18 -18
- package/dist/resource_clients/request_queue.js +3 -3
- package/dist/resource_clients/request_queue_collection.d.ts +4 -4
- package/dist/resource_clients/request_queue_collection.js +1 -1
- package/dist/resource_clients/run.d.ts +15 -15
- package/dist/resource_clients/run.js +7 -7
- package/dist/resource_clients/run_collection.d.ts +2 -2
- package/dist/resource_clients/schedule.d.ts +3 -3
- package/dist/resource_clients/schedule.js +1 -1
- package/dist/resource_clients/store_collection.d.ts +3 -3
- package/dist/resource_clients/task.d.ts +3 -3
- package/dist/resource_clients/task_collection.d.ts +3 -3
- package/dist/resource_clients/user.d.ts +4 -4
- package/dist/resource_clients/webhook.d.ts +5 -5
- package/dist/resource_clients/webhook.js +2 -2
- package/dist/resource_clients/webhook_collection.d.ts +3 -3
- package/dist/resource_clients/webhook_collection.js +1 -1
- package/dist/utils.d.ts +3 -3
- package/package.json +4 -4
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { STORAGE_GENERAL_ACCESS } from '@apify/consts';
|
|
2
2
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
3
3
|
import { ResourceClient } from '../base/resource_client.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { BatchAddResult, BatchDeleteResult, ListOfRequests, LockedRequestQueueHead, RequestResource, RequestLockInfo, RequestQueueResource, RequestQueueClientRequestToAdd, RequestQueueClientRequestToUpdate, RequestQueueHead, RequestRegistration, UnlockRequestsResult } from '../models.js';
|
|
5
5
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
6
6
|
/**
|
|
7
7
|
* A request to add, serialized once up front: `byteLength` decides which batch it goes into, `json` is what the body of
|
|
@@ -12,7 +12,7 @@ interface SerializedRequestToAdd {
|
|
|
12
12
|
json: string;
|
|
13
13
|
byteLength: number;
|
|
14
14
|
}
|
|
15
|
-
export type {
|
|
15
|
+
export type { HttpMethod, BatchAddResult, BatchDeleteResult, RequestQueueHeadItem, ListOfRequests, LockedRequestQueueHeadItem, LockedRequestQueueHead, RequestResource, RequestLockInfo, RequestQueueResource, RequestQueueClientRequestToAdd, RequestQueueClientRequestToUpdate, RequestQueueHead, RequestQueueStats, RequestRegistration, UnlockRequestsResult, } from '../models.js';
|
|
16
16
|
/**
|
|
17
17
|
* Client for managing a specific Request queue.
|
|
18
18
|
*
|
|
@@ -57,7 +57,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
57
57
|
* @returns The RequestQueue object, or `undefined` if it does not exist
|
|
58
58
|
* @see https://docs.apify.com/api/v2/request-queue-get
|
|
59
59
|
*/
|
|
60
|
-
get(options?: TimeoutOptions): Promise<
|
|
60
|
+
get(options?: TimeoutOptions): Promise<RequestQueueResource | undefined>;
|
|
61
61
|
/**
|
|
62
62
|
* Updates the Request queue with specified fields.
|
|
63
63
|
*
|
|
@@ -67,7 +67,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
67
67
|
* @returns The updated RequestQueue object
|
|
68
68
|
* @see https://docs.apify.com/api/v2/request-queue-put
|
|
69
69
|
*/
|
|
70
|
-
update(newFields: RequestQueueClientUpdateOptions, options?: TimeoutOptions): Promise<
|
|
70
|
+
update(newFields: RequestQueueClientUpdateOptions, options?: TimeoutOptions): Promise<RequestQueueResource>;
|
|
71
71
|
/**
|
|
72
72
|
* Deletes the Request queue.
|
|
73
73
|
*
|
|
@@ -88,7 +88,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
88
88
|
* @returns List of requests from the queue head
|
|
89
89
|
* @see https://docs.apify.com/api/v2/request-queue-head-get
|
|
90
90
|
*/
|
|
91
|
-
listHead(options?: RequestQueueClientListHeadOptions): Promise<
|
|
91
|
+
listHead(options?: RequestQueueClientListHeadOptions): Promise<RequestQueueHead>;
|
|
92
92
|
/**
|
|
93
93
|
* Gets and locks the next requests from the queue head for processing.
|
|
94
94
|
*
|
|
@@ -123,7 +123,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
123
123
|
* ```
|
|
124
124
|
* @since Added in 2.4.1
|
|
125
125
|
*/
|
|
126
|
-
listAndLockHead(options: RequestQueueClientListAndLockHeadOptions): Promise<
|
|
126
|
+
listAndLockHead(options: RequestQueueClientListAndLockHeadOptions): Promise<LockedRequestQueueHead>;
|
|
127
127
|
/**
|
|
128
128
|
* Adds a single request to the queue.
|
|
129
129
|
*
|
|
@@ -163,14 +163,14 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
163
163
|
* );
|
|
164
164
|
* ```
|
|
165
165
|
*/
|
|
166
|
-
addRequest(request: RequestQueueClientRequestToAdd, options?: RequestQueueClientAddRequestOptions): Promise<
|
|
166
|
+
addRequest(request: RequestQueueClientRequestToAdd, options?: RequestQueueClientAddRequestOptions): Promise<RequestRegistration>;
|
|
167
167
|
/**
|
|
168
168
|
* Writes requests to Request queue in batch.
|
|
169
169
|
*
|
|
170
170
|
* @private
|
|
171
171
|
*/
|
|
172
|
-
protected addRequestBatch(requests: SerializedRequestToAdd[], options?: RequestQueueClientAddRequestOptions): Promise<
|
|
173
|
-
protected addRequestBatchWithRetries(requests: SerializedRequestToAdd[], options?: RequestQueueClientBatchAddRequestWithRetriesOptions): Promise<
|
|
172
|
+
protected addRequestBatch(requests: SerializedRequestToAdd[], options?: RequestQueueClientAddRequestOptions): Promise<BatchAddResult>;
|
|
173
|
+
protected addRequestBatchWithRetries(requests: SerializedRequestToAdd[], options?: RequestQueueClientBatchAddRequestWithRetriesOptions): Promise<BatchAddResult>;
|
|
174
174
|
/**
|
|
175
175
|
* Adds multiple requests to the queue in a single operation.
|
|
176
176
|
*
|
|
@@ -210,7 +210,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
210
210
|
* ```
|
|
211
211
|
* @since Added in 2.1.0
|
|
212
212
|
*/
|
|
213
|
-
batchAddRequests(requests: RequestQueueClientRequestToAdd[], options?: RequestQueueClientBatchAddRequestWithRetriesOptions): Promise<
|
|
213
|
+
batchAddRequests(requests: RequestQueueClientRequestToAdd[], options?: RequestQueueClientBatchAddRequestWithRetriesOptions): Promise<BatchAddResult>;
|
|
214
214
|
/**
|
|
215
215
|
* Deletes multiple requests from the queue in a single operation.
|
|
216
216
|
*
|
|
@@ -223,7 +223,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
223
223
|
* @see https://docs.apify.com/api/v2/request-queue-requests-batch-delete
|
|
224
224
|
* @since Added in 2.3.0
|
|
225
225
|
*/
|
|
226
|
-
batchDeleteRequests(requests: RequestQueueClientRequestToDelete[], options?: TimeoutOptions): Promise<
|
|
226
|
+
batchDeleteRequests(requests: RequestQueueClientRequestToDelete[], options?: TimeoutOptions): Promise<BatchDeleteResult>;
|
|
227
227
|
/**
|
|
228
228
|
* Gets a specific request from the queue by its ID.
|
|
229
229
|
*
|
|
@@ -244,7 +244,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
244
244
|
* @returns Information about the updated request
|
|
245
245
|
* @see https://docs.apify.com/api/v2/request-queue-request-put
|
|
246
246
|
*/
|
|
247
|
-
updateRequest(request: RequestQueueClientRequestToUpdate, options?: RequestQueueClientAddRequestOptions): Promise<
|
|
247
|
+
updateRequest(request: RequestQueueClientRequestToUpdate, options?: RequestQueueClientAddRequestOptions): Promise<RequestRegistration>;
|
|
248
248
|
/**
|
|
249
249
|
* Deletes a specific request from the queue.
|
|
250
250
|
*
|
|
@@ -279,7 +279,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
279
279
|
* ```
|
|
280
280
|
* @since Added in 2.4.1
|
|
281
281
|
*/
|
|
282
|
-
prolongRequestLock(id: string, options: RequestQueueClientProlongRequestLockOptions): Promise<
|
|
282
|
+
prolongRequestLock(id: string, options: RequestQueueClientProlongRequestLockOptions): Promise<RequestLockInfo>;
|
|
283
283
|
/**
|
|
284
284
|
* Releases the lock on a request, allowing other clients to process it.
|
|
285
285
|
*
|
|
@@ -306,7 +306,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
306
306
|
* @see https://docs.apify.com/api/v2/request-queue-requests-get
|
|
307
307
|
* @since Added in 2.5.1
|
|
308
308
|
*/
|
|
309
|
-
listRequests(options?: RequestQueueClientListRequestsOptions): Promise<
|
|
309
|
+
listRequests(options?: RequestQueueClientListRequestsOptions): Promise<ListOfRequests> & AsyncIterable<RequestResource>;
|
|
310
310
|
/**
|
|
311
311
|
* Unlocks all requests locked by this client.
|
|
312
312
|
*
|
|
@@ -319,7 +319,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
319
319
|
* @see https://docs.apify.com/api/v2/request-queue-requests-unlock-post
|
|
320
320
|
* @since Added in 2.12.5
|
|
321
321
|
*/
|
|
322
|
-
unlockRequests(options?: TimeoutOptions): Promise<
|
|
322
|
+
unlockRequests(options?: TimeoutOptions): Promise<UnlockRequestsResult>;
|
|
323
323
|
/**
|
|
324
324
|
* Returns an async iterable for paginating through all requests in the queue.
|
|
325
325
|
*
|
|
@@ -339,7 +339,7 @@ export declare class RequestQueueClient extends ResourceClient {
|
|
|
339
339
|
* ```
|
|
340
340
|
* @since Added in 2.5.1
|
|
341
341
|
*/
|
|
342
|
-
paginateRequests(options?: RequestQueueClientPaginateRequestsOptions): RequestQueueRequestsAsyncIterable<
|
|
342
|
+
paginateRequests(options?: RequestQueueClientPaginateRequestsOptions): RequestQueueRequestsAsyncIterable<ListOfRequests>;
|
|
343
343
|
}
|
|
344
344
|
/**
|
|
345
345
|
* User-specific options for RequestQueueClient.
|
|
@@ -447,14 +447,14 @@ export interface RequestQueueClientBatchAddRequestWithRetriesOptions extends Tim
|
|
|
447
447
|
/**
|
|
448
448
|
* @since Added in 2.3.0
|
|
449
449
|
*/
|
|
450
|
-
export type RequestQueueClientRequestToDelete = Pick<
|
|
450
|
+
export type RequestQueueClientRequestToDelete = Pick<RequestResource, 'id'> | Pick<RequestResource, 'uniqueKey'>;
|
|
451
451
|
/**
|
|
452
452
|
* Result of getting a single request from the queue.
|
|
453
453
|
*
|
|
454
454
|
* `GET /v2/request-queues/{queueId}/requests/{requestId}` answers with the whole request rather than
|
|
455
455
|
* a queue-head projection.
|
|
456
456
|
*/
|
|
457
|
-
export type RequestQueueClientGetRequestResult =
|
|
457
|
+
export type RequestQueueClientGetRequestResult = RequestResource;
|
|
458
458
|
/**
|
|
459
459
|
* @since Added in 2.5.1
|
|
460
460
|
*/
|
|
@@ -116,7 +116,7 @@ export class RequestQueueClient extends ResourceClient {
|
|
|
116
116
|
*/
|
|
117
117
|
async get(options = {}) {
|
|
118
118
|
const { timeoutSecs, signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
119
|
-
return this.getResource(schemas.
|
|
119
|
+
return this.getResource(schemas.RequestQueueResource(), {}, this.#resolveTimeout(timeoutSecs, 'short'), signal);
|
|
120
120
|
}
|
|
121
121
|
/**
|
|
122
122
|
* Updates the Request queue with specified fields.
|
|
@@ -130,7 +130,7 @@ export class RequestQueueClient extends ResourceClient {
|
|
|
130
130
|
async update(newFields, options = {}) {
|
|
131
131
|
parseArgument(newFields, anyObjectSchema);
|
|
132
132
|
const { timeoutSecs, signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
133
|
-
return this.updateResource(schemas.
|
|
133
|
+
return this.updateResource(schemas.RequestQueueResource(), newFields, this.#resolveTimeout(timeoutSecs, 'short'), signal);
|
|
134
134
|
}
|
|
135
135
|
/**
|
|
136
136
|
* Deletes the Request queue.
|
|
@@ -493,7 +493,7 @@ export class RequestQueueClient extends ResourceClient {
|
|
|
493
493
|
};
|
|
494
494
|
try {
|
|
495
495
|
const response = await this.httpClient.call(requestOpts);
|
|
496
|
-
return parseResponse(response, schemas.
|
|
496
|
+
return parseResponse(response, schemas.RequestResource());
|
|
497
497
|
}
|
|
498
498
|
catch (err) {
|
|
499
499
|
catchNotFoundOrThrow(err);
|
|
@@ -3,7 +3,7 @@ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedList, PaginationOptions } from '../utils.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { RequestQueueResource } from './request_queue.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing the collection of Request queues in your account.
|
|
9
9
|
*
|
|
@@ -50,7 +50,7 @@ export declare class RequestQueueCollectionClient extends ResourceCollectionClie
|
|
|
50
50
|
* @returns A paginated iterator of Request queues.
|
|
51
51
|
* @see https://docs.apify.com/api/v2/request-queues-get
|
|
52
52
|
*/
|
|
53
|
-
list(options?: RequestQueueCollectionListOptions): Promise<RequestQueueCollectionListResult> & AsyncIterable<
|
|
53
|
+
list(options?: RequestQueueCollectionListOptions): Promise<RequestQueueCollectionListResult> & AsyncIterable<RequestQueueResource>;
|
|
54
54
|
/**
|
|
55
55
|
* Gets or creates a Request queue with the specified name.
|
|
56
56
|
*
|
|
@@ -60,7 +60,7 @@ export declare class RequestQueueCollectionClient extends ResourceCollectionClie
|
|
|
60
60
|
* @returns The Request queue object.
|
|
61
61
|
* @see https://docs.apify.com/api/v2/request-queues-post
|
|
62
62
|
*/
|
|
63
|
-
getOrCreate(name?: string, options?: TimeoutOptions): Promise<
|
|
63
|
+
getOrCreate(name?: string, options?: TimeoutOptions): Promise<RequestQueueResource>;
|
|
64
64
|
}
|
|
65
65
|
export interface RequestQueueCollectionListOptions extends PaginationOptions, TimeoutOptions {
|
|
66
66
|
unnamed?: boolean;
|
|
@@ -71,6 +71,6 @@ export interface RequestQueueCollectionListOptions extends PaginationOptions, Ti
|
|
|
71
71
|
*/
|
|
72
72
|
ownership?: STORAGE_OWNERSHIP_FILTER;
|
|
73
73
|
}
|
|
74
|
-
export type RequestQueueCollectionListResult = PaginatedList<
|
|
74
|
+
export type RequestQueueCollectionListResult = PaginatedList<RequestQueueResource> & {
|
|
75
75
|
unnamed: boolean;
|
|
76
76
|
};
|
|
@@ -79,6 +79,6 @@ export class RequestQueueCollectionClient extends ResourceCollectionClient {
|
|
|
79
79
|
async getOrCreate(name, options = {}) {
|
|
80
80
|
parseArgument(name, nameSchema);
|
|
81
81
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
82
|
-
return this.getOrCreateResource(schemas.
|
|
82
|
+
return this.getOrCreateResource(schemas.RequestQueueResource(), name, undefined, timeoutSecs, signal);
|
|
83
83
|
}
|
|
84
84
|
}
|
|
@@ -5,7 +5,7 @@ import { ResourceClient } from '../base/resource_client.js';
|
|
|
5
5
|
import type { ApifyResponse } from '../http_clients/index.js';
|
|
6
6
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
7
7
|
import type { PaginationOptions } from '../utils.js';
|
|
8
|
-
import type { ActorInput,
|
|
8
|
+
import type { ActorInput, Run } from './actor.js';
|
|
9
9
|
import { DatasetClient } from './dataset.js';
|
|
10
10
|
import { KeyValueStoreClient } from './key_value_store.js';
|
|
11
11
|
import { LogClient, StreamedLog } from './log.js';
|
|
@@ -45,7 +45,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
45
45
|
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the run to finish on the API side before returning. Default is 0 (returns immediately).
|
|
46
46
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`, extended to cover `waitForFinish`
|
|
47
47
|
* when the API is asked to hold the response.
|
|
48
|
-
* @returns The
|
|
48
|
+
* @returns The Run object, or `undefined` if it does not exist
|
|
49
49
|
* @see https://docs.apify.com/api/v2/actor-run-get
|
|
50
50
|
*
|
|
51
51
|
* @example
|
|
@@ -58,14 +58,14 @@ export declare class RunClient extends ResourceClient {
|
|
|
58
58
|
* const run = await client.run('run-id').get({ waitForFinish: 60 });
|
|
59
59
|
* ```
|
|
60
60
|
*/
|
|
61
|
-
get(options?: RunGetOptions): Promise<
|
|
61
|
+
get(options?: RunGetOptions): Promise<Run | undefined>;
|
|
62
62
|
/**
|
|
63
63
|
* Aborts the Actor run.
|
|
64
64
|
*
|
|
65
65
|
* @param options - Abort options
|
|
66
66
|
* @param options.gracefully - If `true`, the Actor run will abort gracefully - it can send status messages and perform cleanup. Default is `false` (immediate abort).
|
|
67
67
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
68
|
-
* @returns The updated
|
|
68
|
+
* @returns The updated Run object with `ABORTING` or `ABORTED` status
|
|
69
69
|
* @see https://docs.apify.com/api/v2/actor-run-abort-post
|
|
70
70
|
*
|
|
71
71
|
* @example
|
|
@@ -77,7 +77,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
77
77
|
* await client.run('run-id').abort({ gracefully: true });
|
|
78
78
|
* ```
|
|
79
79
|
*/
|
|
80
|
-
abort(options?: RunAbortOptions): Promise<
|
|
80
|
+
abort(options?: RunAbortOptions): Promise<Run>;
|
|
81
81
|
/**
|
|
82
82
|
* Deletes the Actor run.
|
|
83
83
|
*
|
|
@@ -100,7 +100,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
100
100
|
* @param options - Metamorph options
|
|
101
101
|
* @param options.build - Tag or number of the target Actor's build to run. Default is the target Actor's default build.
|
|
102
102
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
103
|
-
* @returns The metamorphed
|
|
103
|
+
* @returns The metamorphed Run object (same ID, but now running the target Actor)
|
|
104
104
|
* @see https://docs.apify.com/api/v2/actor-run-metamorph-post
|
|
105
105
|
*
|
|
106
106
|
* @example
|
|
@@ -113,7 +113,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
113
113
|
* console.log(`Run ${metamorphedRun.id} is now running ${metamorphedRun.actId}`);
|
|
114
114
|
* ```
|
|
115
115
|
*/
|
|
116
|
-
metamorph(targetActorId: string, input?: ActorInput, options?: RunMetamorphOptions): Promise<
|
|
116
|
+
metamorph(targetActorId: string, input?: ActorInput, options?: RunMetamorphOptions): Promise<Run>;
|
|
117
117
|
/**
|
|
118
118
|
* Reboots the Actor run.
|
|
119
119
|
*
|
|
@@ -123,7 +123,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
123
123
|
*
|
|
124
124
|
* @param options - Request options
|
|
125
125
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
126
|
-
* @returns The updated
|
|
126
|
+
* @returns The updated Run object
|
|
127
127
|
* @see https://docs.apify.com/api/v2/actor-run-reboot-post
|
|
128
128
|
*
|
|
129
129
|
* @example
|
|
@@ -132,7 +132,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
132
132
|
* ```
|
|
133
133
|
* @since Added in 2.8.0
|
|
134
134
|
*/
|
|
135
|
-
reboot(options?: TimeoutOptions): Promise<
|
|
135
|
+
reboot(options?: TimeoutOptions): Promise<Run>;
|
|
136
136
|
/**
|
|
137
137
|
* Updates the Actor run with specified fields.
|
|
138
138
|
*
|
|
@@ -142,7 +142,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
142
142
|
* @param newFields.generalAccess - General resource access level ('FOLLOW_USER_SETTING', 'ANYONE_WITH_ID_CAN_READ' or 'RESTRICTED')
|
|
143
143
|
* @param options - Request options
|
|
144
144
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
145
|
-
* @returns The updated
|
|
145
|
+
* @returns The updated Run object
|
|
146
146
|
*
|
|
147
147
|
* @example
|
|
148
148
|
* ```javascript
|
|
@@ -153,7 +153,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
153
153
|
* ```
|
|
154
154
|
* @since Added in 2.6.0
|
|
155
155
|
*/
|
|
156
|
-
update(newFields: RunUpdateOptions, options?: TimeoutOptions): Promise<
|
|
156
|
+
update(newFields: RunUpdateOptions, options?: TimeoutOptions): Promise<Run>;
|
|
157
157
|
/**
|
|
158
158
|
* Resurrects a finished Actor run, starting it again with the same settings.
|
|
159
159
|
*
|
|
@@ -168,7 +168,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
168
168
|
* @param options.maxTotalChargeUsd - Maximum cost in USD (pay-per-event Actors).
|
|
169
169
|
* @param options.restartOnError - Whether to restart on error.
|
|
170
170
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
171
|
-
* @returns The new (resurrected)
|
|
171
|
+
* @returns The new (resurrected) Run object
|
|
172
172
|
* @see https://docs.apify.com/api/v2/post-resurrect-run
|
|
173
173
|
*
|
|
174
174
|
* @example
|
|
@@ -178,7 +178,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
178
178
|
* console.log(`New run started: ${newRun.id}`);
|
|
179
179
|
* ```
|
|
180
180
|
*/
|
|
181
|
-
resurrect(options?: RunResurrectOptions): Promise<
|
|
181
|
+
resurrect(options?: RunResurrectOptions): Promise<Run>;
|
|
182
182
|
/**
|
|
183
183
|
* Charges the Actor run for a specific event.
|
|
184
184
|
*
|
|
@@ -207,7 +207,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
207
207
|
* @param options - Wait options
|
|
208
208
|
* @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If the limit is reached, the returned promise resolves to a run object that will have status `READY` or `RUNNING`. If omitted, waits indefinitely.
|
|
209
209
|
* @param options.timeoutSecs - Timeout for each polling API request. Default is `'noTimeout'`.
|
|
210
|
-
* @returns The
|
|
210
|
+
* @returns The Run object (finished or still running if the timeout was reached)
|
|
211
211
|
*
|
|
212
212
|
* @example
|
|
213
213
|
* ```javascript
|
|
@@ -222,7 +222,7 @@ export declare class RunClient extends ResourceClient {
|
|
|
222
222
|
* }
|
|
223
223
|
* ```
|
|
224
224
|
*/
|
|
225
|
-
waitForFinish(options?: RunWaitForFinishOptions): Promise<
|
|
225
|
+
waitForFinish(options?: RunWaitForFinishOptions): Promise<Run>;
|
|
226
226
|
/**
|
|
227
227
|
* Returns a client for the default dataset of this Actor run.
|
|
228
228
|
*
|
|
@@ -87,7 +87,7 @@ export class RunClient extends ResourceClient {
|
|
|
87
87
|
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the run to finish on the API side before returning. Default is 0 (returns immediately).
|
|
88
88
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`, extended to cover `waitForFinish`
|
|
89
89
|
* when the API is asked to hold the response.
|
|
90
|
-
* @returns The
|
|
90
|
+
* @returns The Run object, or `undefined` if it does not exist
|
|
91
91
|
* @see https://docs.apify.com/api/v2/actor-run-get
|
|
92
92
|
*
|
|
93
93
|
* @example
|
|
@@ -110,7 +110,7 @@ export class RunClient extends ResourceClient {
|
|
|
110
110
|
* @param options - Abort options
|
|
111
111
|
* @param options.gracefully - If `true`, the Actor run will abort gracefully - it can send status messages and perform cleanup. Default is `false` (immediate abort).
|
|
112
112
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
113
|
-
* @returns The updated
|
|
113
|
+
* @returns The updated Run object with `ABORTING` or `ABORTED` status
|
|
114
114
|
* @see https://docs.apify.com/api/v2/actor-run-abort-post
|
|
115
115
|
*
|
|
116
116
|
* @example
|
|
@@ -158,7 +158,7 @@ export class RunClient extends ResourceClient {
|
|
|
158
158
|
* @param options - Metamorph options
|
|
159
159
|
* @param options.build - Tag or number of the target Actor's build to run. Default is the target Actor's default build.
|
|
160
160
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
161
|
-
* @returns The metamorphed
|
|
161
|
+
* @returns The metamorphed Run object (same ID, but now running the target Actor)
|
|
162
162
|
* @see https://docs.apify.com/api/v2/actor-run-metamorph-post
|
|
163
163
|
*
|
|
164
164
|
* @example
|
|
@@ -206,7 +206,7 @@ export class RunClient extends ResourceClient {
|
|
|
206
206
|
*
|
|
207
207
|
* @param options - Request options
|
|
208
208
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
209
|
-
* @returns The updated
|
|
209
|
+
* @returns The updated Run object
|
|
210
210
|
* @see https://docs.apify.com/api/v2/actor-run-reboot-post
|
|
211
211
|
*
|
|
212
212
|
* @example
|
|
@@ -235,7 +235,7 @@ export class RunClient extends ResourceClient {
|
|
|
235
235
|
* @param newFields.generalAccess - General resource access level ('FOLLOW_USER_SETTING', 'ANYONE_WITH_ID_CAN_READ' or 'RESTRICTED')
|
|
236
236
|
* @param options - Request options
|
|
237
237
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
238
|
-
* @returns The updated
|
|
238
|
+
* @returns The updated Run object
|
|
239
239
|
*
|
|
240
240
|
* @example
|
|
241
241
|
* ```javascript
|
|
@@ -265,7 +265,7 @@ export class RunClient extends ResourceClient {
|
|
|
265
265
|
* @param options.maxTotalChargeUsd - Maximum cost in USD (pay-per-event Actors).
|
|
266
266
|
* @param options.restartOnError - Whether to restart on error.
|
|
267
267
|
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`.
|
|
268
|
-
* @returns The new (resurrected)
|
|
268
|
+
* @returns The new (resurrected) Run object
|
|
269
269
|
* @see https://docs.apify.com/api/v2/post-resurrect-run
|
|
270
270
|
*
|
|
271
271
|
* @example
|
|
@@ -335,7 +335,7 @@ export class RunClient extends ResourceClient {
|
|
|
335
335
|
* @param options - Wait options
|
|
336
336
|
* @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If the limit is reached, the returned promise resolves to a run object that will have status `READY` or `RUNNING`. If omitted, waits indefinitely.
|
|
337
337
|
* @param options.timeoutSecs - Timeout for each polling API request. Default is `'noTimeout'`.
|
|
338
|
-
* @returns The
|
|
338
|
+
* @returns The Run object (finished or still running if the timeout was reached)
|
|
339
339
|
*
|
|
340
340
|
* @example
|
|
341
341
|
* ```javascript
|
|
@@ -3,7 +3,7 @@ import type { ApiClientOptionsWithOptionalResourcePath } from '../base/api_clien
|
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedIterator, PaginationOptions } from '../utils.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { RunListItem } from './actor.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing the collection of Actor runs.
|
|
9
9
|
*
|
|
@@ -51,7 +51,7 @@ export declare class RunCollectionClient extends ResourceCollectionClient {
|
|
|
51
51
|
* @returns A paginated iterator of Actor runs.
|
|
52
52
|
* @see https://docs.apify.com/api/v2/actor-runs-get
|
|
53
53
|
*/
|
|
54
|
-
list(options?: RunCollectionListOptions): PaginatedIterator<
|
|
54
|
+
list(options?: RunCollectionListOptions): PaginatedIterator<RunListItem>;
|
|
55
55
|
}
|
|
56
56
|
export interface RunCollectionListOptions extends PaginationOptions, TimeoutOptions {
|
|
57
57
|
desc?: boolean;
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client.js';
|
|
3
|
-
import type { Schedule, ScheduleAction,
|
|
3
|
+
import type { Schedule, ScheduleAction, ScheduleLogEntry } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { DistributiveOptional } from '../utils.js';
|
|
6
|
-
export type { Schedule, ScheduleAction, ScheduleActionRunActor, ScheduleActionRunActorTask,
|
|
6
|
+
export type { Schedule, ScheduleAction, ScheduleActionRunActor, ScheduleActionRunActorTask, ScheduleActionRunInput, ScheduleLogEntry, TaskOptions, } from '../models.js';
|
|
7
7
|
export { ScheduleActions } from '../models.js';
|
|
8
8
|
/**
|
|
9
9
|
* Client for managing a specific Schedule.
|
|
@@ -68,7 +68,7 @@ export declare class ScheduleClient extends ResourceClient {
|
|
|
68
68
|
* @returns The schedule log, one entry per invocation.
|
|
69
69
|
* @see https://docs.apify.com/api/v2/schedule-log-get
|
|
70
70
|
*/
|
|
71
|
-
getLog(options?: TimeoutOptions): Promise<
|
|
71
|
+
getLog(options?: TimeoutOptions): Promise<ScheduleLogEntry[]>;
|
|
72
72
|
}
|
|
73
73
|
/**
|
|
74
74
|
* Data for creating or updating a Schedule.
|
|
@@ -4,7 +4,7 @@ import * as schemas from '../schemas.js';
|
|
|
4
4
|
import { timeoutOptionsSchema } from '../timeouts.js';
|
|
5
5
|
import { anyObjectSchema, parseArgument, parseResponse } from '../utils.js';
|
|
6
6
|
export { ScheduleActions } from '../models.js';
|
|
7
|
-
const scheduleLogSchema = z.array(schemas.
|
|
7
|
+
const scheduleLogSchema = z.array(schemas.ScheduleLogEntry());
|
|
8
8
|
/**
|
|
9
9
|
* Client for managing a specific Schedule.
|
|
10
10
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { StoreActor } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedIterator, PaginationOptions } from '../utils.js';
|
|
6
|
-
export type {
|
|
6
|
+
export type { CurrentPricingInfo, StoreActor } from '../models.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for browsing Actors in the Apify Store.
|
|
9
9
|
*
|
|
@@ -51,7 +51,7 @@ export declare class StoreCollectionClient extends ResourceCollectionClient {
|
|
|
51
51
|
* @returns A paginated iterator of store Actors.
|
|
52
52
|
* @see https://docs.apify.com/api/v2/store-get
|
|
53
53
|
*/
|
|
54
|
-
list(options?: StoreCollectionListOptions): PaginatedIterator<
|
|
54
|
+
list(options?: StoreCollectionListOptions): PaginatedIterator<StoreActor>;
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* @since Added in 2.7.2
|
|
@@ -3,7 +3,7 @@ import { ResourceClient } from '../base/resource_client.js';
|
|
|
3
3
|
import type { Task, TaskPublicConfig } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { Dictionary } from '../utils.js';
|
|
6
|
-
import type { ActorLastRunOptions,
|
|
6
|
+
import type { ActorLastRunOptions, ActorStartOptions, Run } from './actor.js';
|
|
7
7
|
import { RunClient } from './run.js';
|
|
8
8
|
import { RunCollectionClient } from './run_collection.js';
|
|
9
9
|
import { WebhookCollectionClient } from './webhook_collection.js';
|
|
@@ -110,7 +110,7 @@ export declare class TaskClient extends ResourceClient {
|
|
|
110
110
|
* @returns The Actor Run object.
|
|
111
111
|
* @see https://docs.apify.com/api/v2/actor-task-runs-post
|
|
112
112
|
*/
|
|
113
|
-
start(input?: Dictionary, options?: TaskStartOptions): Promise<
|
|
113
|
+
start(input?: Dictionary, options?: TaskStartOptions): Promise<Run>;
|
|
114
114
|
/**
|
|
115
115
|
* Starts a task and waits for it to finish before returning the Run object.
|
|
116
116
|
* It waits indefinitely, unless the `waitSecs` option is provided.
|
|
@@ -132,7 +132,7 @@ export declare class TaskClient extends ResourceClient {
|
|
|
132
132
|
* @returns The Actor run object.
|
|
133
133
|
* @see https://docs.apify.com/api/v2/actor-task-runs-post
|
|
134
134
|
*/
|
|
135
|
-
call(input?: Dictionary, options?: TaskCallOptions): Promise<
|
|
135
|
+
call(input?: Dictionary, options?: TaskCallOptions): Promise<Run>;
|
|
136
136
|
/**
|
|
137
137
|
* Retrieves the Actor task's input object.
|
|
138
138
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { TaskListItem } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedIterator, PaginationOptions } from '../utils.js';
|
|
6
6
|
import type { Task, TaskUpdateData } from './task.js';
|
|
7
|
-
export type {
|
|
7
|
+
export type { TaskListItem } from '../models.js';
|
|
8
8
|
/**
|
|
9
9
|
* Client for managing the collection of Actor tasks in your account.
|
|
10
10
|
*
|
|
@@ -55,7 +55,7 @@ export declare class TaskCollectionClient extends ResourceCollectionClient {
|
|
|
55
55
|
* @returns A paginated iterator of tasks.
|
|
56
56
|
* @see https://docs.apify.com/api/v2/actor-tasks-get
|
|
57
57
|
*/
|
|
58
|
-
list(options?: TaskCollectionListOptions): PaginatedIterator<
|
|
58
|
+
list(options?: TaskCollectionListOptions): PaginatedIterator<TaskListItem>;
|
|
59
59
|
/**
|
|
60
60
|
* Creates a new task.
|
|
61
61
|
*
|
|
@@ -1,8 +1,8 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { AccountLimits, MonthlyUsage, UserPrivateInfo } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
|
-
export type {
|
|
5
|
+
export type { AccountLimits, CurrentUsage, DailyServiceUsage, EffectivePlatformFeature, EffectivePlatformFeatures, Limits, MonthlyUsage, UserPlan, PriceTier, UserProfile, ProxyResource, ProxyGroup, ServiceUsage, UsageCycle, UsageItem, UserPrivateInfo, } from '../models.js';
|
|
6
6
|
export { PlatformFeature } from '../models.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing user account information.
|
|
@@ -44,7 +44,7 @@ export declare class UserClient extends ResourceClient {
|
|
|
44
44
|
* @returns The user object, or `undefined` if it does not exist.
|
|
45
45
|
* @see https://docs.apify.com/api/v2/user-get
|
|
46
46
|
*/
|
|
47
|
-
get(options?: TimeoutOptions): Promise<
|
|
47
|
+
get(options?: TimeoutOptions): Promise<UserPrivateInfo | undefined>;
|
|
48
48
|
/**
|
|
49
49
|
* Retrieves the user's monthly usage data.
|
|
50
50
|
*
|
|
@@ -64,7 +64,7 @@ export declare class UserClient extends ResourceClient {
|
|
|
64
64
|
* @see https://docs.apify.com/api/v2/users-me-limits-get
|
|
65
65
|
* @since Added in 2.9.2
|
|
66
66
|
*/
|
|
67
|
-
limits(options?: TimeoutOptions): Promise<
|
|
67
|
+
limits(options?: TimeoutOptions): Promise<AccountLimits>;
|
|
68
68
|
/**
|
|
69
69
|
* Updates the user's account and usage limits.
|
|
70
70
|
*
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { WebhookResource, WebhookEventType } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { WebhookDispatch } from './webhook_dispatch.js';
|
|
6
6
|
import { WebhookDispatchCollectionClient } from './webhook_dispatch_collection.js';
|
|
7
|
-
export type {
|
|
7
|
+
export type { WebhookLastDispatch, WebhookResource, WebhookAnyRunOfActorCondition, WebhookAnyRunOfActorTaskCondition, WebhookCertainRunCondition, WebhookCondition, WebhookEventType, WebhookStats, } from '../models.js';
|
|
8
8
|
/**
|
|
9
9
|
* Client for managing a specific webhook.
|
|
10
10
|
*
|
|
@@ -46,7 +46,7 @@ export declare class WebhookClient extends ResourceClient {
|
|
|
46
46
|
* @returns The webhook object, or `undefined` if it does not exist.
|
|
47
47
|
* @see https://docs.apify.com/api/v2/webhook-get
|
|
48
48
|
*/
|
|
49
|
-
get(options?: TimeoutOptions): Promise<
|
|
49
|
+
get(options?: TimeoutOptions): Promise<WebhookResource | undefined>;
|
|
50
50
|
/**
|
|
51
51
|
* Updates the webhook with the specified fields.
|
|
52
52
|
*
|
|
@@ -56,7 +56,7 @@ export declare class WebhookClient extends ResourceClient {
|
|
|
56
56
|
* @returns The updated webhook object.
|
|
57
57
|
* @see https://docs.apify.com/api/v2/webhook-put
|
|
58
58
|
*/
|
|
59
|
-
update(newFields: WebhookUpdateData, options?: TimeoutOptions): Promise<
|
|
59
|
+
update(newFields: WebhookUpdateData, options?: TimeoutOptions): Promise<WebhookResource>;
|
|
60
60
|
/**
|
|
61
61
|
* Deletes the webhook.
|
|
62
62
|
*
|
|
@@ -88,6 +88,6 @@ export interface WebhookIdempotencyKey {
|
|
|
88
88
|
/**
|
|
89
89
|
* Data for updating a webhook.
|
|
90
90
|
*/
|
|
91
|
-
export type WebhookUpdateData = Partial<Pick<
|
|
91
|
+
export type WebhookUpdateData = Partial<Pick<WebhookResource, 'isAdHoc' | 'condition' | 'ignoreSslErrors' | 'doNotRetry' | 'requestUrl' | 'payloadTemplate' | 'shouldInterpolateStrings' | 'isApifyIntegration' | 'headersTemplate' | 'description'> & {
|
|
92
92
|
eventTypes: readonly WebhookEventType[];
|
|
93
93
|
}> & WebhookIdempotencyKey;
|
|
@@ -51,7 +51,7 @@ export class WebhookClient extends ResourceClient {
|
|
|
51
51
|
*/
|
|
52
52
|
async get(options = {}) {
|
|
53
53
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
54
|
-
return this.getResource(schemas.
|
|
54
|
+
return this.getResource(schemas.WebhookResource(), {}, timeoutSecs, signal);
|
|
55
55
|
}
|
|
56
56
|
/**
|
|
57
57
|
* Updates the webhook with the specified fields.
|
|
@@ -65,7 +65,7 @@ export class WebhookClient extends ResourceClient {
|
|
|
65
65
|
async update(newFields, options = {}) {
|
|
66
66
|
parseArgument(newFields, anyObjectSchema);
|
|
67
67
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
68
|
-
return this.updateResource(schemas.
|
|
68
|
+
return this.updateResource(schemas.WebhookResource(), newFields, timeoutSecs, signal);
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* Deletes the webhook.
|