apify-client 3.0.0-beta.12 → 3.0.0-beta.121

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.
Files changed (128) hide show
  1. package/README.md +23 -2
  2. package/dist/apify_api_error.d.ts +14 -28
  3. package/dist/apify_api_error.js +33 -23
  4. package/dist/apify_client.d.ts +125 -10
  5. package/dist/apify_client.js +133 -48
  6. package/dist/apify_client_error.d.ts +10 -0
  7. package/dist/apify_client_error.js +10 -0
  8. package/dist/axios.d.ts +2 -0
  9. package/dist/axios.js +1 -0
  10. package/dist/base/api_client.d.ts +7 -7
  11. package/dist/base/api_client.js +36 -36
  12. package/dist/base/resource_client.d.ts +13 -8
  13. package/dist/base/resource_client.js +60 -34
  14. package/dist/base/resource_collection_client.d.ts +12 -4
  15. package/dist/base/resource_collection_client.js +34 -11
  16. package/dist/body_parser.d.ts +4 -5
  17. package/dist/body_parser.js +19 -26
  18. package/dist/bundle.js +41 -35
  19. package/dist/bundle.js.map +1 -1
  20. package/dist/generated/api.d.ts +3266 -1103
  21. package/dist/generated/schemas.d.ts +2608 -1079
  22. package/dist/generated/schemas.js +600 -239
  23. package/dist/http_clients/axios.d.ts +80 -0
  24. package/dist/http_clients/axios.js +165 -0
  25. package/dist/http_clients/base.d.ts +402 -0
  26. package/dist/http_clients/base.js +680 -0
  27. package/dist/http_clients/fetch.d.ts +53 -0
  28. package/dist/http_clients/fetch.js +219 -0
  29. package/dist/http_clients/index.d.ts +4 -0
  30. package/dist/http_clients/index.js +2 -0
  31. package/dist/http_compressors/base.d.ts +40 -0
  32. package/dist/http_compressors/base.js +9 -0
  33. package/dist/http_compressors/brotli.d.ts +33 -0
  34. package/dist/http_compressors/brotli.js +39 -0
  35. package/dist/http_compressors/gzip.d.ts +33 -0
  36. package/dist/http_compressors/gzip.js +39 -0
  37. package/dist/http_compressors/index.d.ts +8 -0
  38. package/dist/http_compressors/index.js +3 -0
  39. package/dist/http_compressors/resolve.d.ts +24 -0
  40. package/dist/http_compressors/resolve.js +30 -0
  41. package/dist/http_compressors/zstd.d.ts +34 -0
  42. package/dist/http_compressors/zstd.js +43 -0
  43. package/dist/index.d.ts +7 -2
  44. package/dist/index.js +5 -1
  45. package/dist/invalid_response_body_error.d.ts +14 -0
  46. package/dist/invalid_response_body_error.js +18 -0
  47. package/dist/models.d.ts +177 -240
  48. package/dist/models.js +6 -4
  49. package/dist/resource_clients/actor.d.ts +94 -23
  50. package/dist/resource_clients/actor.js +129 -43
  51. package/dist/resource_clients/actor_collection.d.ts +15 -11
  52. package/dist/resource_clients/actor_collection.js +9 -3
  53. package/dist/resource_clients/actor_env_var.d.ts +11 -4
  54. package/dist/resource_clients/actor_env_var.js +16 -6
  55. package/dist/resource_clients/actor_env_var_collection.d.ts +9 -4
  56. package/dist/resource_clients/actor_env_var_collection.js +11 -4
  57. package/dist/resource_clients/actor_server.d.ts +149 -0
  58. package/dist/resource_clients/actor_server.js +195 -0
  59. package/dist/resource_clients/actor_version.d.ts +19 -6
  60. package/dist/resource_clients/actor_version.js +19 -8
  61. package/dist/resource_clients/actor_version_collection.d.ts +10 -4
  62. package/dist/resource_clients/actor_version_collection.js +12 -4
  63. package/dist/resource_clients/build.d.ts +18 -7
  64. package/dist/resource_clients/build.js +33 -15
  65. package/dist/resource_clients/build_collection.d.ts +7 -5
  66. package/dist/resource_clients/build_collection.js +4 -1
  67. package/dist/resource_clients/dataset.d.ts +83 -37
  68. package/dist/resource_clients/dataset.js +99 -109
  69. package/dist/resource_clients/dataset_collection.d.ts +10 -6
  70. package/dist/resource_clients/dataset_collection.js +13 -2
  71. package/dist/resource_clients/key_value_store.d.ts +108 -33
  72. package/dist/resource_clients/key_value_store.js +134 -53
  73. package/dist/resource_clients/key_value_store_collection.d.ts +10 -6
  74. package/dist/resource_clients/key_value_store_collection.js +13 -2
  75. package/dist/resource_clients/log.d.ts +41 -25
  76. package/dist/resource_clients/log.js +142 -65
  77. package/dist/resource_clients/request_queue.d.ts +77 -31
  78. package/dist/resource_clients/request_queue.js +178 -93
  79. package/dist/resource_clients/request_queue_collection.d.ts +9 -5
  80. package/dist/resource_clients/request_queue_collection.js +9 -3
  81. package/dist/resource_clients/run.d.ts +119 -29
  82. package/dist/resource_clients/run.js +188 -49
  83. package/dist/resource_clients/run_collection.d.ts +5 -3
  84. package/dist/resource_clients/run_collection.js +4 -1
  85. package/dist/resource_clients/schedule.d.ts +15 -6
  86. package/dist/resource_clients/schedule.js +25 -10
  87. package/dist/resource_clients/schedule_collection.d.ts +6 -2
  88. package/dist/resource_clients/schedule_collection.js +9 -3
  89. package/dist/resource_clients/store_collection.d.ts +10 -4
  90. package/dist/resource_clients/store_collection.js +4 -1
  91. package/dist/resource_clients/task.d.ts +35 -12
  92. package/dist/resource_clients/task.js +75 -35
  93. package/dist/resource_clients/task_collection.d.ts +9 -5
  94. package/dist/resource_clients/task_collection.js +9 -3
  95. package/dist/resource_clients/user.d.ts +16 -7
  96. package/dist/resource_clients/user.js +34 -16
  97. package/dist/resource_clients/webhook.d.ts +16 -7
  98. package/dist/resource_clients/webhook.js +25 -10
  99. package/dist/resource_clients/webhook_collection.d.ts +8 -4
  100. package/dist/resource_clients/webhook_collection.js +9 -3
  101. package/dist/resource_clients/webhook_dispatch.d.ts +4 -1
  102. package/dist/resource_clients/webhook_dispatch.js +7 -2
  103. package/dist/resource_clients/webhook_dispatch_collection.d.ts +3 -1
  104. package/dist/resource_clients/webhook_dispatch_collection.js +4 -1
  105. package/dist/response_validation_error.d.ts +2 -1
  106. package/dist/response_validation_error.js +2 -1
  107. package/dist/runtime/node.d.ts +6 -0
  108. package/dist/runtime/node.js +111 -0
  109. package/dist/runtime/types.d.ts +82 -0
  110. package/dist/runtime/types.js +1 -0
  111. package/dist/runtime/web.d.ts +5 -0
  112. package/dist/runtime/web.js +60 -0
  113. package/dist/schemas.d.ts +372 -4
  114. package/dist/schemas.js +26 -4
  115. package/dist/statistics.d.ts +1 -6
  116. package/dist/statistics.js +2 -2
  117. package/dist/timeouts.d.ts +84 -0
  118. package/dist/timeouts.js +37 -0
  119. package/dist/timezones.d.ts +1 -1
  120. package/dist/utils.d.ts +115 -61
  121. package/dist/utils.js +220 -161
  122. package/dist/wait_for_resources.d.ts +8 -0
  123. package/dist/wait_for_resources.js +39 -0
  124. package/package.json +53 -38
  125. package/dist/http_client.d.ts +0 -88
  126. package/dist/http_client.js +0 -255
  127. package/dist/interceptors.d.ts +0 -19
  128. 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
- * as a plain `string[]`: the platform has features this list never gained -- `PROXY_RESIDENTIAL`,
71
- * `ACTORS_PUBLIC_ALL` and `ACTORS_PUBLIC_DEVELOPER` all appear as keys of `EffectivePlatformFeatures`
72
- * -- so using it there promised a completeness that was not real. It stays published for comparisons.
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.
@@ -1,8 +1,12 @@
1
+ import type { ValueOf } from '@apify/consts';
1
2
  import { ACTOR_JOB_STATUSES, ACTOR_PERMISSION_LEVEL, META_ORIGINS } from '@apify/consts';
2
3
  import { Log } from '@apify/log';
3
4
  import type { ApiClientSubResourceOptions } from '../base/api_client.js';
4
5
  import { ResourceClient } from '../base/resource_client.js';
5
- import type { Actor, ActorRun } from '../models.js';
6
+ import type { ActorResource, Run } from '../models.js';
7
+ import type { TimeoutOptions } from '../timeouts.js';
8
+ import type { Dictionary } from '../utils.js';
9
+ import { ActorServerClient } from './actor_server.js';
6
10
  import { ActorVersionClient } from './actor_version.js';
7
11
  import { ActorVersionCollectionClient } from './actor_version_collection.js';
8
12
  import type { Build, BuildClientGetOptions } from './build.js';
@@ -12,8 +16,7 @@ import { RunClient } from './run.js';
12
16
  import { RunCollectionClient } from './run_collection.js';
13
17
  import type { WebhookUpdateData } from './webhook.js';
14
18
  import { WebhookCollectionClient } from './webhook_collection.js';
15
- import type { ValueOf } from 'type-fest';
16
- export type { Actor, ActorChargeEvent, ActorChargeEvents, ActorDefaultRunOptions, ActorDefinition, ActorExampleRunInput, ActorRun, ActorRunListItem, ActorRunMeta, ActorRunMetamorph, ActorRunOptions, ActorRunPricingInfo, ActorRunStats, ActorRunStorageIds, ActorRunUsage, ActorStandby, ActorStats, ActorTaggedBuild, ActorTaggedBuilds, FlatPricePerMonthActorPricingInfo, FreeActorPricingInfo, PricePerDatasetItemActorPricingInfo, PricePerEventActorPricingInfo, TieredPricingPerDatasetItem, TieredPricingPerDatasetItemEntry, TieredPricingPerEvent, TieredPricingPerEventEntry, } from '../models.js';
19
+ 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
20
  /**
18
21
  * Client for managing a specific Actor.
19
22
  *
@@ -35,6 +38,7 @@ export type { Actor, ActorChargeEvent, ActorChargeEvents, ActorDefaultRunOptions
35
38
  * @see https://docs.apify.com/platform/actors
36
39
  */
37
40
  export declare class ActorClient extends ResourceClient {
41
+ #private;
38
42
  /**
39
43
  * @hidden
40
44
  */
@@ -42,24 +46,30 @@ export declare class ActorClient extends ResourceClient {
42
46
  /**
43
47
  * Gets the Actor object from the Apify API.
44
48
  *
49
+ * @param options - Request options
50
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
45
51
  * @returns The Actor object, or `undefined` if it does not exist
46
52
  * @see https://docs.apify.com/api/v2/act-get
47
53
  */
48
- get(): Promise<Actor | undefined>;
54
+ get(options?: TimeoutOptions): Promise<ActorResource | undefined>;
49
55
  /**
50
56
  * Updates the Actor with specified fields.
51
57
  *
52
58
  * @param newFields - Fields to update in the Actor
59
+ * @param options - Request options
60
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
53
61
  * @returns The updated Actor object
54
62
  * @see https://docs.apify.com/api/v2/act-put
55
63
  */
56
- update(newFields: ActorUpdateOptions): Promise<Actor>;
64
+ update(newFields: ActorUpdateOptions, options?: TimeoutOptions): Promise<ActorResource>;
57
65
  /**
58
66
  * Deletes the Actor.
59
67
  *
68
+ * @param options - Request options
69
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
60
70
  * @see https://docs.apify.com/api/v2/act-delete
61
71
  */
62
- delete(): Promise<void>;
72
+ delete(options?: TimeoutOptions): Promise<void>;
63
73
  /**
64
74
  * Starts the Actor and immediately returns the Run object.
65
75
  *
@@ -67,15 +77,20 @@ export declare class ActorClient extends ResourceClient {
67
77
  * asynchronously and this method returns immediately without waiting for completion.
68
78
  * Use the {@link call} method if you want to wait for the Actor to finish.
69
79
  *
70
- * @param input - Input for the Actor, serialized to JSON. Omit it to run the Actor without input.
80
+ * @param input - Input for the Actor: an object or array serialized to JSON, or raw bytes sent as they are.
81
+ * Omit it to run the Actor without input.
71
82
  * @param options - Run configuration options
72
83
  * @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.
73
84
  * @param options.memory - Memory in megabytes allocated for the run. If not provided, uses the Actor's default memory setting.
74
- * @param options.timeout - Timeout for the run in seconds. Zero means no timeout. If not provided, uses the Actor's default timeout.
85
+ * @param options.runTimeoutSecs - Timeout for the run in seconds. Zero means no timeout. If not provided, uses the Actor's default timeout.
75
86
  * @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).
76
87
  * @param options.webhooks - Webhooks to trigger when the Actor run reaches a specific state (e.g., `SUCCEEDED`, `FAILED`).
77
88
  * @param options.maxItems - Maximum number of dataset items that will be charged (only for pay-per-result Actors).
78
89
  * @param options.maxTotalChargeUsd - Maximum cost in USD (only for pay-per-event Actors).
90
+ * @param options.waitForResources - Retry the start while the account lacks the memory or a concurrent-run slot for
91
+ * the run. `true` retries until the run starts, a number stops retrying after that many seconds.
92
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`, extended to cover `waitForFinish`
93
+ * when the API is asked to hold the response.
79
94
  * @returns The Actor run object with status, usage, and storage IDs
80
95
  * @see https://docs.apify.com/api/v2/act-runs-post
81
96
  *
@@ -88,11 +103,11 @@ export declare class ActorClient extends ResourceClient {
88
103
  * // Start Actor with specific build and memory
89
104
  * const run = await client.actor('my-actor').start(
90
105
  * { url: 'https://example.com' },
91
- * { build: '0.1.2', memory: 512, timeout: 300 }
106
+ * { build: '0.1.2', memory: 512, runTimeoutSecs: 300 }
92
107
  * );
93
108
  * ```
94
109
  */
95
- start(input?: ActorInput, options?: ActorStartOptions): Promise<ActorRun>;
110
+ start(input?: ActorInput, options?: ActorStartOptions): Promise<Run>;
96
111
  /**
97
112
  * Starts the Actor and waits for it to finish before returning the Run object.
98
113
  *
@@ -100,13 +115,18 @@ export declare class ActorClient extends ResourceClient {
100
115
  * by polling the run status. It optionally streams logs to the console or a custom Log instance.
101
116
  * By default, it waits indefinitely unless the `waitSecs` option is provided.
102
117
  *
103
- * @param input - Input for the Actor, serialized to JSON. Omit it to run the Actor without input.
118
+ * @param input - Input for the Actor: an object or array serialized to JSON, or raw bytes sent as they are.
119
+ * Omit it to run the Actor without input.
104
120
  * @param options - Run configuration options (extends all options from {@link start})
105
121
  * @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If omitted, waits indefinitely.
106
122
  * @param options.log - Log instance for streaming run logs. Use `'default'` for console output, `null` to disable logging, or provide a custom Log instance.
107
123
  * @param options.build - Tag or number of the build to run (e.g., `'beta'` or `'1.2.345'`).
108
124
  * @param options.memory - Memory in megabytes allocated for the run.
109
- * @param options.timeout - Maximum run duration in seconds.
125
+ * @param options.runTimeoutSecs - Maximum run duration in seconds.
126
+ * @param options.waitForResources - Retry the start while the account lacks the memory or a concurrent-run slot for
127
+ * the run. `true` retries until the run starts, a number stops retrying after that many seconds. The time spent
128
+ * retrying doesn't count toward `waitSecs`.
129
+ * @param options.timeoutSecs - Timeout for each API request, the start and every poll alike. Default is `'noTimeout'`.
110
130
  * @returns The finished Actor run object with final status (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`)
111
131
  * @see https://docs.apify.com/api/v2/act-runs-post
112
132
  *
@@ -129,7 +149,7 @@ export declare class ActorClient extends ResourceClient {
129
149
  * const run = await client.actor('my-actor').call({ url: 'https://example.com' }, { log });
130
150
  * ```
131
151
  */
132
- call(input?: ActorInput, options?: ActorCallOptions): Promise<ActorRun>;
152
+ call(input?: ActorInput, options?: ActorCallOptions): Promise<Run>;
133
153
  /**
134
154
  * Validates the provided input for the Actor against its input schema.
135
155
  *
@@ -138,10 +158,12 @@ export declare class ActorClient extends ResourceClient {
138
158
  * invalid, the API responds with an error that is thrown as an `ApifyApiError` describing the
139
159
  * validation problem.
140
160
  *
141
- * @param input - Input to validate against the Actor's input schema, serialized to JSON.
161
+ * @param input - Input to validate against the Actor's input schema: an object or array serialized to JSON, or
162
+ * raw bytes sent as they are.
142
163
  * @param options - Validation options
143
164
  * @param options.build - Tag or number of the build whose input schema the input is validated against
144
165
  * (e.g., `'latest'` or `'1.2.345'`). If not provided, uses the default build.
166
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'short'`.
145
167
  * @returns `true` if the input is valid. Invalid input causes the underlying API call to throw an `ApifyApiError`.
146
168
  * @see https://docs.apify.com/api/v2/act-validate-input-post
147
169
  *
@@ -171,6 +193,8 @@ export declare class ActorClient extends ResourceClient {
171
193
  * @param options.tag - Tag to be applied to the build (e.g., `'latest'`, `'beta'`). Existing tag with the same name will be replaced.
172
194
  * @param options.useCache - If `false`, Docker build cache will be ignored. Default is `true`.
173
195
  * @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).
196
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'medium'`, extended to cover `waitForFinish`
197
+ * when the API is asked to hold the response.
174
198
  * @returns The Build object with status and build details
175
199
  * @see https://docs.apify.com/api/v2/act-builds-post
176
200
  *
@@ -198,6 +222,8 @@ export declare class ActorClient extends ResourceClient {
198
222
  *
199
223
  * @param options - Options for getting the default build
200
224
  * @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).
225
+ * @param options.timeoutSecs - Timeout for the API request. Default is `'short'`, extended to cover `waitForFinish`
226
+ * when the API is asked to hold the response.
201
227
  * @returns A client for the default build
202
228
  * @see https://docs.apify.com/api/v2/act-build-default-get
203
229
  *
@@ -269,20 +295,50 @@ export declare class ActorClient extends ResourceClient {
269
295
  * @see https://docs.apify.com/api/v2/act-webhooks-get
270
296
  */
271
297
  webhooks(): WebhookCollectionClient;
298
+ /**
299
+ * Returns a client for the server interface of this Actor.
300
+ *
301
+ * A Server Actor runs a web server, its server interface, that is called over HTTP without starting a run for
302
+ * each call. Server Actors were formerly called Actor Standby, and {@link standby} is a deprecated alias of this
303
+ * method. Every call returns the same client, so the server URL it fetches is reused.
304
+ *
305
+ * @returns The client for the server interface of this Actor
306
+ * @see https://docs.apify.com/platform/actors/running/standby
307
+ *
308
+ * @example
309
+ * ```javascript
310
+ * const response = await client.actor('username/actor-name').server().request('/search', {
311
+ * params: { q: 'apify' },
312
+ * });
313
+ * ```
314
+ */
315
+ server(): ActorServerClient;
316
+ /**
317
+ * Returns a client for the server interface of this Actor in Standby mode.
318
+ *
319
+ * Named after Actor Standby, the former name of Server Actors.
320
+ *
321
+ * @deprecated Use {@link server} instead. Will be removed in v4.
322
+ * @returns The client for the server interface of this Actor
323
+ * @see https://docs.apify.com/platform/actors/running/standby
324
+ */
325
+ standby(): ActorServerClient;
272
326
  }
273
327
  /**
274
328
  * Fields that can be updated when modifying an Actor.
275
329
  */
276
- export type ActorUpdateOptions = Partial<Pick<Actor, 'name' | 'description' | 'isPublic' | 'isDeprecated' | 'seoTitle' | 'seoDescription' | 'title' | 'restartOnError' | 'versions' | 'categories' | 'defaultRunOptions' | 'actorStandby' | 'actorPermissionLevel' | 'taggedBuilds'>>;
330
+ export type ActorUpdateOptions = Partial<Pick<ActorResource, 'name' | 'description' | 'isPublic' | 'isDeprecated' | 'seoTitle' | 'seoDescription' | 'title' | 'versions' | 'categories' | 'defaultRunOptions' | 'actorStandby' | 'actorPermissionLevel' | 'taggedBuilds' | 'pricingInfos' | 'exampleRunInput'>>;
277
331
  /**
278
332
  * Input for an Actor run, as taken by {@link ActorClient.start}, {@link ActorClient.call},
279
333
  * {@link ActorClient.validateInput} and {@link RunClient.metamorph}.
280
334
  *
281
- * An object or an array. Declared as `object` rather than an index-signature type such as
282
- * `Dictionary`, which would reject a caller's own `interface`.
335
+ * A plain object or an array of plain objects, serialized into the request body, or raw bytes
336
+ * (a `Uint8Array` such as a `Buffer`, or an `ArrayBuffer`) sent as they are, typically with a
337
+ * `contentType`. An input typed as an `interface` or a class needs a spread (`{ ...input }`), or for
338
+ * an interface a `type` alias, to compile.
283
339
  */
284
- export type ActorInput = object;
285
- export interface ActorStartOptions {
340
+ export type ActorInput = Dictionary | readonly Dictionary[] | Uint8Array | ArrayBuffer;
341
+ export interface ActorStartOptions extends TimeoutOptions {
286
342
  /**
287
343
  * Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`).
288
344
  * If not provided, the run uses build tag or number from the default Actor run configuration (typically `latest`).
@@ -301,9 +357,9 @@ export interface ActorStartOptions {
301
357
  memory?: number;
302
358
  /**
303
359
  * Timeout for the Actor run in seconds. Zero value means there is no timeout.
304
- * If not provided, the run uses timeout of the default Actor run configuration.
360
+ * If not provided, the run uses the timeout of the default Actor run configuration.
305
361
  */
306
- timeout?: number;
362
+ runTimeoutSecs?: number;
307
363
  /**
308
364
  * Maximum time to wait for the Actor run to finish, in seconds.
309
365
  * If the limit is reached, the returned promise is resolved to a run object that will have
@@ -346,6 +402,21 @@ export interface ActorStartOptions {
346
402
  * @since Added in 2.17.0
347
403
  */
348
404
  forcePermissionLevel?: ACTOR_PERMISSION_LEVEL;
405
+ /**
406
+ * Retry the start while the account lacks the resources for the run, that is while the API rejects it with an
407
+ * `ApifyApiError` of type `actor-memory-limit-exceeded` or `concurrent-runs-limit-exceeded`. Both clear as
408
+ * other runs or builds finish. The start is retried every 10 seconds, and any other error is thrown right away.
409
+ *
410
+ * `true` retries until the run starts. A number stops retrying after that many seconds and throws the last
411
+ * error. Omitted or `false`, the first rejection is thrown.
412
+ *
413
+ * A run that requests more memory than the whole memory limit of the account is rejected with
414
+ * `actor-memory-limit-exceeded` as well and never starts, so `true` retries it forever.
415
+ *
416
+ * A stream input (`Readable` or web `ReadableStream`) can't be sent twice, so its start is never retried and the
417
+ * first rejection is thrown.
418
+ */
419
+ waitForResources?: boolean | number;
349
420
  }
350
421
  /**
351
422
  * Options for calling an Actor and waiting for it to finish.
@@ -370,7 +441,7 @@ export interface ActorCallOptions extends Omit<ActorStartOptions, 'waitForFinish
370
441
  * Options for validating an Actor input.
371
442
  * @since Added in 2.24.0
372
443
  */
373
- export interface ActorValidateInputOptions {
444
+ export interface ActorValidateInputOptions extends TimeoutOptions {
374
445
  /**
375
446
  * Tag or number of the Actor build whose input schema the input is validated against
376
447
  * (e.g. `beta` or `1.2.345`). If not provided, the default build is used.
@@ -386,7 +457,7 @@ export interface ActorValidateInputOptions {
386
457
  /**
387
458
  * Options for building an Actor.
388
459
  */
389
- export interface ActorBuildOptions {
460
+ export interface ActorBuildOptions extends TimeoutOptions {
390
461
  betaPackages?: boolean;
391
462
  tag?: string;
392
463
  useCache?: boolean;