apify-client 3.0.0-beta.6 → 3.0.0-beta.60
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 +10 -2
- package/dist/apify_api_error.d.ts +11 -26
- package/dist/apify_api_error.js +31 -22
- package/dist/apify_client.d.ts +125 -10
- package/dist/apify_client.js +133 -48
- package/dist/base/api_client.d.ts +7 -7
- package/dist/base/api_client.js +36 -36
- package/dist/base/resource_client.d.ts +21 -8
- package/dist/base/resource_client.js +67 -33
- package/dist/base/resource_collection_client.d.ts +12 -4
- package/dist/base/resource_collection_client.js +34 -11
- package/dist/body_parser.d.ts +3 -4
- package/dist/body_parser.js +19 -26
- package/dist/bundle.js +27 -22
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +785 -290
- package/dist/generated/schemas.d.ts +771 -798
- package/dist/generated/schemas.js +183 -179
- package/dist/http_clients/axios.d.ts +60 -0
- package/dist/http_clients/axios.js +117 -0
- package/dist/http_clients/base.d.ts +331 -0
- package/dist/http_clients/base.js +563 -0
- package/dist/http_clients/index.d.ts +4 -0
- package/dist/http_clients/index.js +2 -0
- package/dist/http_compressors/base.d.ts +40 -0
- package/dist/http_compressors/base.js +9 -0
- package/dist/http_compressors/brotli.d.ts +33 -0
- package/dist/http_compressors/brotli.js +39 -0
- package/dist/http_compressors/gzip.d.ts +33 -0
- package/dist/http_compressors/gzip.js +39 -0
- package/dist/http_compressors/index.d.ts +6 -0
- package/dist/http_compressors/index.js +2 -0
- package/dist/http_compressors/resolve.d.ts +23 -0
- package/dist/http_compressors/resolve.js +27 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -1
- package/dist/invalid_response_body_error.d.ts +13 -0
- package/dist/invalid_response_body_error.js +17 -0
- package/dist/models.d.ts +162 -194
- package/dist/models.js +6 -4
- package/dist/resource_clients/actor.d.ts +74 -34
- package/dist/resource_clients/actor.js +87 -56
- package/dist/resource_clients/actor_collection.d.ts +18 -14
- package/dist/resource_clients/actor_collection.js +11 -3
- package/dist/resource_clients/actor_env_var.d.ts +11 -4
- package/dist/resource_clients/actor_env_var.js +16 -6
- package/dist/resource_clients/actor_env_var_collection.d.ts +16 -20
- package/dist/resource_clients/actor_env_var_collection.js +17 -11
- package/dist/resource_clients/actor_version.d.ts +20 -5
- package/dist/resource_clients/actor_version.js +19 -9
- package/dist/resource_clients/actor_version_collection.d.ts +18 -19
- package/dist/resource_clients/actor_version_collection.js +19 -11
- package/dist/resource_clients/build.d.ts +20 -7
- package/dist/resource_clients/build.js +35 -15
- package/dist/resource_clients/build_collection.d.ts +7 -5
- package/dist/resource_clients/build_collection.js +4 -1
- package/dist/resource_clients/dataset.d.ts +53 -35
- package/dist/resource_clients/dataset.js +105 -80
- package/dist/resource_clients/dataset_collection.d.ts +10 -6
- package/dist/resource_clients/dataset_collection.js +13 -2
- package/dist/resource_clients/key_value_store.d.ts +73 -23
- package/dist/resource_clients/key_value_store.js +86 -43
- package/dist/resource_clients/key_value_store_collection.d.ts +10 -6
- package/dist/resource_clients/key_value_store_collection.js +13 -2
- package/dist/resource_clients/log.d.ts +13 -20
- package/dist/resource_clients/log.js +141 -59
- package/dist/resource_clients/request_queue.d.ts +74 -36
- package/dist/resource_clients/request_queue.js +182 -106
- package/dist/resource_clients/request_queue_collection.d.ts +9 -5
- package/dist/resource_clients/request_queue_collection.js +9 -3
- package/dist/resource_clients/run.d.ts +119 -28
- package/dist/resource_clients/run.js +190 -49
- package/dist/resource_clients/run_collection.d.ts +5 -3
- package/dist/resource_clients/run_collection.js +4 -1
- package/dist/resource_clients/schedule.d.ts +16 -7
- package/dist/resource_clients/schedule.js +30 -22
- package/dist/resource_clients/schedule_collection.d.ts +6 -2
- package/dist/resource_clients/schedule_collection.js +9 -3
- package/dist/resource_clients/store_collection.d.ts +6 -4
- package/dist/resource_clients/store_collection.js +4 -1
- package/dist/resource_clients/task.d.ts +36 -13
- package/dist/resource_clients/task.js +79 -46
- package/dist/resource_clients/task_collection.d.ts +9 -5
- package/dist/resource_clients/task_collection.js +9 -3
- package/dist/resource_clients/user.d.ts +19 -10
- package/dist/resource_clients/user.js +42 -38
- package/dist/resource_clients/webhook.d.ts +17 -8
- package/dist/resource_clients/webhook.js +30 -22
- package/dist/resource_clients/webhook_collection.d.ts +8 -4
- package/dist/resource_clients/webhook_collection.js +9 -3
- package/dist/resource_clients/webhook_dispatch.d.ts +4 -1
- package/dist/resource_clients/webhook_dispatch.js +7 -2
- package/dist/resource_clients/webhook_dispatch_collection.d.ts +3 -1
- package/dist/resource_clients/webhook_dispatch_collection.js +4 -1
- package/dist/runtime/node.d.ts +6 -0
- package/dist/runtime/node.js +49 -0
- package/dist/runtime/types.d.ts +52 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/web.d.ts +5 -0
- package/dist/runtime/web.js +18 -0
- package/dist/schemas.d.ts +1 -1
- package/dist/schemas.js +1 -1
- package/dist/statistics.d.ts +1 -6
- package/dist/statistics.js +2 -2
- package/dist/timeouts.d.ts +84 -0
- package/dist/timeouts.js +37 -0
- package/dist/timezones.d.ts +1 -1
- package/dist/utils.d.ts +89 -53
- package/dist/utils.js +214 -161
- package/dist/wait_for_resources.d.ts +8 -0
- package/dist/wait_for_resources.js +39 -0
- package/package.json +32 -29
- package/dist/http_client.d.ts +0 -88
- package/dist/http_client.js +0 -255
- package/dist/interceptors.d.ts +0 -19
- package/dist/interceptors.js +0 -105
package/dist/models.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public models adapted from the generated OpenAPI types in `./generated/api`.
|
|
3
3
|
*
|
|
4
|
+
* Each model takes the name of the spec schema it is declared on, as the Python client does.
|
|
5
|
+
*
|
|
4
6
|
* The generated file is never re-exported directly. Every type here is declared on top of a generated
|
|
5
7
|
* schema so the compiler reports drift, and the spec is adopted as-is wherever it is trustworthy. What
|
|
6
8
|
* remains is deliberately small, and each deviation falls into exactly one of five kinds, one block per
|
|
@@ -66,10 +68,10 @@ export var ScheduleActions;
|
|
|
66
68
|
/**
|
|
67
69
|
* Platform features a plan can enable.
|
|
68
70
|
*
|
|
69
|
-
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types as a plain
|
|
72
|
+
* `string[]`: the platform has features this list never gained -- `PROXY_RESIDENTIAL`, `ACTORS_PUBLIC_ALL`
|
|
73
|
+
* and `ACTORS_PUBLIC_DEVELOPER` all appear as keys of `EffectivePlatformFeatures` -- so using it there
|
|
74
|
+
* promised a completeness that was not real. It stays published for comparisons.
|
|
73
75
|
*
|
|
74
76
|
* Declared here rather than in `./resource_clients/user` so the user types can live alongside it. It is
|
|
75
77
|
* re-exported from there, so the public name and import path are unchanged.
|
|
@@ -2,7 +2,9 @@ import { ACTOR_JOB_STATUSES, ACTOR_PERMISSION_LEVEL, META_ORIGINS } from '@apify
|
|
|
2
2
|
import { Log } from '@apify/log';
|
|
3
3
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
4
4
|
import { ResourceClient } from '../base/resource_client.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ActorResource, Run } from '../models.js';
|
|
6
|
+
import type { TimeoutOptions } from '../timeouts.js';
|
|
7
|
+
import type { Dictionary } from '../utils.js';
|
|
6
8
|
import { ActorVersionClient } from './actor_version.js';
|
|
7
9
|
import { ActorVersionCollectionClient } from './actor_version_collection.js';
|
|
8
10
|
import type { Build, BuildClientGetOptions } from './build.js';
|
|
@@ -13,7 +15,7 @@ import { RunCollectionClient } from './run_collection.js';
|
|
|
13
15
|
import type { WebhookUpdateData } from './webhook.js';
|
|
14
16
|
import { WebhookCollectionClient } from './webhook_collection.js';
|
|
15
17
|
import type { ValueOf } from 'type-fest';
|
|
16
|
-
export type {
|
|
18
|
+
export type { ActorResource, ActorChargeEvent, ActorChargeEvents, ActorDefinition, ActorRunPricingInfo, ActorRunStorageIds, ActorStandby, ActorStats, DefaultRunOptions, ExampleRunInput, FlatPricePerMonthActorPricingInfo, FreeActorPricingInfo, RunMetamorphEvent, PayPerEventActorPricingInfo, PricePerDatasetItemActorPricingInfo, Run, RunMeta, RunOptions, RunListItem, RunStats, RunUsage, TaggedBuildInfo, TaggedBuilds, TieredPricingPerDatasetItem, TieredPricingPerDatasetItemEntry, TieredPricingPerEvent, TieredPricingPerEventEntry, } from '../models.js';
|
|
17
19
|
/**
|
|
18
20
|
* Client for managing a specific Actor.
|
|
19
21
|
*
|
|
@@ -42,24 +44,30 @@ export declare class ActorClient extends ResourceClient {
|
|
|
42
44
|
/**
|
|
43
45
|
* Gets the Actor object from the Apify API.
|
|
44
46
|
*
|
|
47
|
+
* @param options - Request options
|
|
48
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
45
49
|
* @returns The Actor object, or `undefined` if it does not exist
|
|
46
50
|
* @see https://docs.apify.com/api/v2/act-get
|
|
47
51
|
*/
|
|
48
|
-
get(): Promise<
|
|
52
|
+
get(options?: TimeoutOptions): Promise<ActorResource | undefined>;
|
|
49
53
|
/**
|
|
50
54
|
* Updates the Actor with specified fields.
|
|
51
55
|
*
|
|
52
56
|
* @param newFields - Fields to update in the Actor
|
|
57
|
+
* @param options - Request options
|
|
58
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
53
59
|
* @returns The updated Actor object
|
|
54
60
|
* @see https://docs.apify.com/api/v2/act-put
|
|
55
61
|
*/
|
|
56
|
-
update(newFields: ActorUpdateOptions): Promise<
|
|
62
|
+
update(newFields: ActorUpdateOptions, options?: TimeoutOptions): Promise<ActorResource>;
|
|
57
63
|
/**
|
|
58
64
|
* Deletes the Actor.
|
|
59
65
|
*
|
|
66
|
+
* @param options - Request options
|
|
67
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
60
68
|
* @see https://docs.apify.com/api/v2/act-delete
|
|
61
69
|
*/
|
|
62
|
-
delete(): Promise<void>;
|
|
70
|
+
delete(options?: TimeoutOptions): Promise<void>;
|
|
63
71
|
/**
|
|
64
72
|
* Starts the Actor and immediately returns the Run object.
|
|
65
73
|
*
|
|
@@ -67,17 +75,20 @@ export declare class ActorClient extends ResourceClient {
|
|
|
67
75
|
* asynchronously and this method returns immediately without waiting for completion.
|
|
68
76
|
* Use the {@link call} method if you want to wait for the Actor to finish.
|
|
69
77
|
*
|
|
70
|
-
* @param input - Input for the Actor
|
|
71
|
-
*
|
|
78
|
+
* @param input - Input for the Actor: an object or array serialized to JSON, or raw bytes sent as they are.
|
|
79
|
+
* Omit it to run the Actor without input.
|
|
72
80
|
* @param options - Run configuration options
|
|
73
81
|
* @param options.build - Tag or number of the build to run (e.g., `'beta'` or `'1.2.345'`). If not provided, uses the default build.
|
|
74
82
|
* @param options.memory - Memory in megabytes allocated for the run. If not provided, uses the Actor's default memory setting.
|
|
75
|
-
* @param options.
|
|
83
|
+
* @param options.runTimeoutSecs - Timeout for the run in seconds. Zero means no timeout. If not provided, uses the Actor's default timeout.
|
|
76
84
|
* @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).
|
|
77
85
|
* @param options.webhooks - Webhooks to trigger when the Actor run reaches a specific state (e.g., `SUCCEEDED`, `FAILED`).
|
|
78
86
|
* @param options.maxItems - Maximum number of dataset items that will be charged (only for pay-per-result Actors).
|
|
79
87
|
* @param options.maxTotalChargeUsd - Maximum cost in USD (only for pay-per-event Actors).
|
|
80
|
-
* @param options.
|
|
88
|
+
* @param options.waitForResources - Retry the start while the account lacks the memory or a concurrent-run slot for
|
|
89
|
+
* the run. `true` retries until the run starts, a number stops retrying after that many seconds.
|
|
90
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`, extended to cover `waitForFinish`
|
|
91
|
+
* when the API is asked to hold the response.
|
|
81
92
|
* @returns The Actor run object with status, usage, and storage IDs
|
|
82
93
|
* @see https://docs.apify.com/api/v2/act-runs-post
|
|
83
94
|
*
|
|
@@ -90,11 +101,11 @@ export declare class ActorClient extends ResourceClient {
|
|
|
90
101
|
* // Start Actor with specific build and memory
|
|
91
102
|
* const run = await client.actor('my-actor').start(
|
|
92
103
|
* { url: 'https://example.com' },
|
|
93
|
-
* { build: '0.1.2', memory: 512,
|
|
104
|
+
* { build: '0.1.2', memory: 512, runTimeoutSecs: 300 }
|
|
94
105
|
* );
|
|
95
106
|
* ```
|
|
96
107
|
*/
|
|
97
|
-
start(input?:
|
|
108
|
+
start(input?: ActorInput, options?: ActorStartOptions): Promise<Run>;
|
|
98
109
|
/**
|
|
99
110
|
* Starts the Actor and waits for it to finish before returning the Run object.
|
|
100
111
|
*
|
|
@@ -102,14 +113,18 @@ export declare class ActorClient extends ResourceClient {
|
|
|
102
113
|
* by polling the run status. It optionally streams logs to the console or a custom Log instance.
|
|
103
114
|
* By default, it waits indefinitely unless the `waitSecs` option is provided.
|
|
104
115
|
*
|
|
105
|
-
* @param input - Input for the Actor
|
|
106
|
-
*
|
|
116
|
+
* @param input - Input for the Actor: an object or array serialized to JSON, or raw bytes sent as they are.
|
|
117
|
+
* Omit it to run the Actor without input.
|
|
107
118
|
* @param options - Run configuration options (extends all options from {@link start})
|
|
108
119
|
* @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If omitted, waits indefinitely.
|
|
109
120
|
* @param options.log - Log instance for streaming run logs. Use `'default'` for console output, `null` to disable logging, or provide a custom Log instance.
|
|
110
121
|
* @param options.build - Tag or number of the build to run (e.g., `'beta'` or `'1.2.345'`).
|
|
111
122
|
* @param options.memory - Memory in megabytes allocated for the run.
|
|
112
|
-
* @param options.
|
|
123
|
+
* @param options.runTimeoutSecs - Maximum run duration in seconds.
|
|
124
|
+
* @param options.waitForResources - Retry the start while the account lacks the memory or a concurrent-run slot for
|
|
125
|
+
* the run. `true` retries until the run starts, a number stops retrying after that many seconds. The time spent
|
|
126
|
+
* retrying doesn't count toward `waitSecs`.
|
|
127
|
+
* @param options.timeoutSecs - Timeout for each API request, the start and every poll alike. Default is `'noTimeout'`.
|
|
113
128
|
* @returns The finished Actor run object with final status (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`)
|
|
114
129
|
* @see https://docs.apify.com/api/v2/act-runs-post
|
|
115
130
|
*
|
|
@@ -132,7 +147,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
132
147
|
* const run = await client.actor('my-actor').call({ url: 'https://example.com' }, { log });
|
|
133
148
|
* ```
|
|
134
149
|
*/
|
|
135
|
-
call(input?:
|
|
150
|
+
call(input?: ActorInput, options?: ActorCallOptions): Promise<Run>;
|
|
136
151
|
/**
|
|
137
152
|
* Validates the provided input for the Actor against its input schema.
|
|
138
153
|
*
|
|
@@ -141,13 +156,12 @@ export declare class ActorClient extends ResourceClient {
|
|
|
141
156
|
* invalid, the API responds with an error that is thrown as an `ApifyApiError` describing the
|
|
142
157
|
* validation problem.
|
|
143
158
|
*
|
|
144
|
-
* @param input - Input to validate against the Actor's input schema
|
|
145
|
-
*
|
|
146
|
-
* input should be a string or Buffer.
|
|
159
|
+
* @param input - Input to validate against the Actor's input schema: an object or array serialized to JSON, or
|
|
160
|
+
* raw bytes sent as they are.
|
|
147
161
|
* @param options - Validation options
|
|
148
162
|
* @param options.build - Tag or number of the build whose input schema the input is validated against
|
|
149
163
|
* (e.g., `'latest'` or `'1.2.345'`). If not provided, uses the default build.
|
|
150
|
-
* @param options.
|
|
164
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
|
|
151
165
|
* @returns `true` if the input is valid. Invalid input causes the underlying API call to throw an `ApifyApiError`.
|
|
152
166
|
* @see https://docs.apify.com/api/v2/act-validate-input-post
|
|
153
167
|
*
|
|
@@ -164,7 +178,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
164
178
|
* ```
|
|
165
179
|
* @since Added in 2.24.0
|
|
166
180
|
*/
|
|
167
|
-
validateInput(input?:
|
|
181
|
+
validateInput(input?: ActorInput, options?: ActorValidateInputOptions): Promise<boolean>;
|
|
168
182
|
/**
|
|
169
183
|
* Builds the Actor.
|
|
170
184
|
*
|
|
@@ -177,6 +191,8 @@ export declare class ActorClient extends ResourceClient {
|
|
|
177
191
|
* @param options.tag - Tag to be applied to the build (e.g., `'latest'`, `'beta'`). Existing tag with the same name will be replaced.
|
|
178
192
|
* @param options.useCache - If `false`, Docker build cache will be ignored. Default is `true`.
|
|
179
193
|
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the build to finish on the API side before returning. Default is 0 (returns immediately).
|
|
194
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`, extended to cover `waitForFinish`
|
|
195
|
+
* when the API is asked to hold the response.
|
|
180
196
|
* @returns The Build object with status and build details
|
|
181
197
|
* @see https://docs.apify.com/api/v2/act-builds-post
|
|
182
198
|
*
|
|
@@ -204,6 +220,8 @@ export declare class ActorClient extends ResourceClient {
|
|
|
204
220
|
*
|
|
205
221
|
* @param options - Options for getting the default build
|
|
206
222
|
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the build to finish on the API side before returning. Default is 0 (returns immediately).
|
|
223
|
+
* @param options.timeoutSecs - Timeout for the API request. Default is `'short'`, extended to cover `waitForFinish`
|
|
224
|
+
* when the API is asked to hold the response.
|
|
207
225
|
* @returns A client for the default build
|
|
208
226
|
* @see https://docs.apify.com/api/v2/act-build-default-get
|
|
209
227
|
*
|
|
@@ -279,18 +297,27 @@ export declare class ActorClient extends ResourceClient {
|
|
|
279
297
|
/**
|
|
280
298
|
* Fields that can be updated when modifying an Actor.
|
|
281
299
|
*/
|
|
282
|
-
export type ActorUpdateOptions = Partial<Pick<
|
|
283
|
-
|
|
300
|
+
export type ActorUpdateOptions = Partial<Pick<ActorResource, 'name' | 'description' | 'isPublic' | 'isDeprecated' | 'seoTitle' | 'seoDescription' | 'title' | 'versions' | 'categories' | 'defaultRunOptions' | 'actorStandby' | 'actorPermissionLevel' | 'taggedBuilds' | 'pricingInfos' | 'exampleRunInput'>>;
|
|
301
|
+
/**
|
|
302
|
+
* Input for an Actor run, as taken by {@link ActorClient.start}, {@link ActorClient.call},
|
|
303
|
+
* {@link ActorClient.validateInput} and {@link RunClient.metamorph}.
|
|
304
|
+
*
|
|
305
|
+
* A plain object or an array of plain objects, serialized into the request body, or raw bytes
|
|
306
|
+
* (a `Uint8Array` such as a `Buffer`, or an `ArrayBuffer`) sent as they are, typically with a
|
|
307
|
+
* `contentType`. An input typed as an `interface` or a class needs a spread (`{ ...input }`), or for
|
|
308
|
+
* an interface a `type` alias, to compile.
|
|
309
|
+
*/
|
|
310
|
+
export type ActorInput = Dictionary | readonly Dictionary[] | Uint8Array | ArrayBuffer;
|
|
311
|
+
export interface ActorStartOptions extends TimeoutOptions {
|
|
284
312
|
/**
|
|
285
313
|
* Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`).
|
|
286
314
|
* If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`).
|
|
287
315
|
*/
|
|
288
316
|
build?: string;
|
|
289
317
|
/**
|
|
290
|
-
* Content type
|
|
291
|
-
*
|
|
292
|
-
* `application/
|
|
293
|
-
* `String` or `Buffer`.
|
|
318
|
+
* Content type of the request body, which becomes the content type of the run's `INPUT` record.
|
|
319
|
+
* Without it, an input is serialized to JSON and sent as `application/json`. Pairing an object
|
|
320
|
+
* with `application/x-www-form-urlencoded` form-encodes it instead.
|
|
294
321
|
*/
|
|
295
322
|
contentType?: string;
|
|
296
323
|
/**
|
|
@@ -300,9 +327,9 @@ export interface ActorStartOptions {
|
|
|
300
327
|
memory?: number;
|
|
301
328
|
/**
|
|
302
329
|
* Timeout for the Actor run in seconds. Zero value means there is no timeout.
|
|
303
|
-
* If not provided, the run uses timeout of the default Actor run configuration.
|
|
330
|
+
* If not provided, the run uses the timeout of the default Actor run configuration.
|
|
304
331
|
*/
|
|
305
|
-
|
|
332
|
+
runTimeoutSecs?: number;
|
|
306
333
|
/**
|
|
307
334
|
* Maximum time to wait for the Actor run to finish, in seconds.
|
|
308
335
|
* If the limit is reached, the returned promise is resolved to a run object that will have
|
|
@@ -345,6 +372,20 @@ export interface ActorStartOptions {
|
|
|
345
372
|
* @since Added in 2.17.0
|
|
346
373
|
*/
|
|
347
374
|
forcePermissionLevel?: ACTOR_PERMISSION_LEVEL;
|
|
375
|
+
/**
|
|
376
|
+
* Retry the start while the account lacks the resources for the run, that is while the API rejects it with an
|
|
377
|
+
* `ApifyApiError` of type `actor-memory-limit-exceeded` or `concurrent-runs-limit-exceeded`. Both clear as
|
|
378
|
+
* other runs or builds finish. The start is retried every 10 seconds, and any other error is thrown right away.
|
|
379
|
+
*
|
|
380
|
+
* `true` retries until the run starts. A number stops retrying after that many seconds and throws the last
|
|
381
|
+
* error. Omitted or `false`, the first rejection is thrown.
|
|
382
|
+
*
|
|
383
|
+
* A run that requests more memory than the whole memory limit of the account is rejected with
|
|
384
|
+
* `actor-memory-limit-exceeded` as well and never starts, so `true` retries it forever.
|
|
385
|
+
*
|
|
386
|
+
* A `Readable` input can't be sent twice, so its start is never retried and the first rejection is thrown.
|
|
387
|
+
*/
|
|
388
|
+
waitForResources?: boolean | number;
|
|
348
389
|
}
|
|
349
390
|
/**
|
|
350
391
|
* Options for calling an Actor and waiting for it to finish.
|
|
@@ -369,24 +410,23 @@ export interface ActorCallOptions extends Omit<ActorStartOptions, 'waitForFinish
|
|
|
369
410
|
* Options for validating an Actor input.
|
|
370
411
|
* @since Added in 2.24.0
|
|
371
412
|
*/
|
|
372
|
-
export interface ActorValidateInputOptions {
|
|
413
|
+
export interface ActorValidateInputOptions extends TimeoutOptions {
|
|
373
414
|
/**
|
|
374
415
|
* Tag or number of the Actor build whose input schema the input is validated against
|
|
375
416
|
* (e.g. `beta` or `1.2.345`). If not provided, the default build is used.
|
|
376
417
|
*/
|
|
377
418
|
build?: string;
|
|
378
419
|
/**
|
|
379
|
-
* Content type
|
|
380
|
-
*
|
|
381
|
-
* `application/
|
|
382
|
-
* `String` or `Buffer`.
|
|
420
|
+
* Content type of the request body carrying the input to validate. Without it, the input is
|
|
421
|
+
* serialized to JSON and sent as `application/json`. Pairing an object with
|
|
422
|
+
* `application/x-www-form-urlencoded` form-encodes it instead.
|
|
383
423
|
*/
|
|
384
424
|
contentType?: string;
|
|
385
425
|
}
|
|
386
426
|
/**
|
|
387
427
|
* Options for building an Actor.
|
|
388
428
|
*/
|
|
389
|
-
export interface ActorBuildOptions {
|
|
429
|
+
export interface ActorBuildOptions extends TimeoutOptions {
|
|
390
430
|
betaPackages?: boolean;
|
|
391
431
|
tag?: string;
|
|
392
432
|
useCache?: boolean;
|