apify-client 3.0.0-beta.0 → 3.0.0-beta.1
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/bundle.js +6 -6
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +20522 -0
- package/dist/generated/api.js +6 -0
- package/dist/models.d.ts +1072 -0
- package/dist/models.js +89 -0
- package/dist/resource_clients/actor.d.ts +2 -448
- package/dist/resource_clients/actor_collection.d.ts +2 -7
- package/dist/resource_clients/actor_version.d.ts +3 -40
- package/dist/resource_clients/actor_version.js +3 -8
- package/dist/resource_clients/build.d.ts +2 -77
- package/dist/resource_clients/build_collection.d.ts +2 -2
- package/dist/resource_clients/dataset.d.ts +2 -68
- package/dist/resource_clients/key_value_store.d.ts +2 -71
- package/dist/resource_clients/key_value_store.js +3 -1
- package/dist/resource_clients/request_queue.d.ts +15 -174
- package/dist/resource_clients/request_queue.js +2 -2
- package/dist/resource_clients/schedule.d.ts +3 -81
- package/dist/resource_clients/schedule.js +3 -9
- package/dist/resource_clients/store_collection.d.ts +2 -30
- package/dist/resource_clients/task.d.ts +3 -73
- package/dist/resource_clients/task_collection.d.ts +2 -1
- package/dist/resource_clients/user.d.ts +3 -179
- package/dist/resource_clients/user.js +3 -11
- package/dist/resource_clients/webhook.d.ts +2 -61
- package/dist/resource_clients/webhook_dispatch.d.ts +3 -36
- package/dist/resource_clients/webhook_dispatch.js +3 -7
- package/dist/utils.js +9 -3
- package/package.json +13 -3
package/dist/models.d.ts
ADDED
|
@@ -0,0 +1,1072 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Public models adapted from the generated OpenAPI types in `./generated/api`.
|
|
3
|
+
*
|
|
4
|
+
* The generated file is never re-exported directly. Every type here is declared on top of a generated
|
|
5
|
+
* schema so the compiler reports drift, and the spec is adopted as-is wherever it is trustworthy. What
|
|
6
|
+
* remains is deliberately small, and each deviation falls into exactly one of five kinds, one block per
|
|
7
|
+
* kind per schema:
|
|
8
|
+
*
|
|
9
|
+
* - `*SpecGaps` -- fields the API returns that the spec does not describe at all. Tracked upstream;
|
|
10
|
+
* each entry disappears from here as the spec catches up, and `./spec_guards` fails the build once
|
|
11
|
+
* one is filled.
|
|
12
|
+
* - `*SpecNarrowings` -- the spec is narrower than what the API actually returns, so the wider type is
|
|
13
|
+
* kept. Widening needs no evidence and is adopted freely.
|
|
14
|
+
* - `*ClientNarrowings` -- the published type is narrower than the spec on purpose. This makes the
|
|
15
|
+
* compiler promise something the spec does not, so every entry carries its evidence.
|
|
16
|
+
* - `*ClientConversions` -- the client rewrites the value before the caller sees it, so the published
|
|
17
|
+
* type is the converted one rather than the wire type the spec describes.
|
|
18
|
+
* - `*RePointed` -- the field's type is replaced by a name this package owns: an adapted model, a
|
|
19
|
+
* `@apify/consts` union, or a published runtime enum. Left alone, the reference would render the
|
|
20
|
+
* generated schema as an indexed access into `./generated/api`, adapted fields on it would be
|
|
21
|
+
* unreachable, and a string union would replace an enum callers compare against.
|
|
22
|
+
*
|
|
23
|
+
* Backward-compatibility shims are deliberately absent. This lands in the next major, so the spec's
|
|
24
|
+
* nullability and optionality are adopted rather than papered over.
|
|
25
|
+
*/
|
|
26
|
+
import type { ACTOR_JOB_STATUSES, ACTOR_PERMISSION_LEVEL, META_ORIGINS, RUN_GENERAL_ACCESS, STORAGE_GENERAL_ACCESS, ValueOf, WEBHOOK_EVENT_TYPES } from '@apify/consts';
|
|
27
|
+
import type { components } from './generated/api';
|
|
28
|
+
import type { Timezone } from './timezones';
|
|
29
|
+
import type { Dictionary } from './utils';
|
|
30
|
+
type Schemas = components['schemas'];
|
|
31
|
+
/**
|
|
32
|
+
* Event types that can trigger webhooks.
|
|
33
|
+
*
|
|
34
|
+
* Declared here rather than in `./resource_clients/webhook` so that both `Webhook` and
|
|
35
|
+
* `WebhookDispatch` can reference it without closing an import cycle. It is re-exported from there, so
|
|
36
|
+
* the public name and import path are unchanged.
|
|
37
|
+
*/
|
|
38
|
+
export type WebhookEventType = (typeof WEBHOOK_EVENT_TYPES)[keyof typeof WEBHOOK_EVENT_TYPES];
|
|
39
|
+
/**
|
|
40
|
+
* Status of a webhook dispatch.
|
|
41
|
+
*
|
|
42
|
+
* Declared here rather than in `./resource_clients/webhook_dispatch` so that `WebhookDispatch` can
|
|
43
|
+
* reference it without closing an import cycle. It is re-exported from there, so the public name and
|
|
44
|
+
* import path are unchanged.
|
|
45
|
+
*/
|
|
46
|
+
export declare enum WebhookDispatchStatus {
|
|
47
|
+
Active = "ACTIVE",
|
|
48
|
+
Succeeded = "SUCCEEDED",
|
|
49
|
+
Failed = "FAILED"
|
|
50
|
+
}
|
|
51
|
+
/**
|
|
52
|
+
* Fields the API returns on a dataset that the OpenAPI spec does not describe yet.
|
|
53
|
+
*
|
|
54
|
+
* TODO: Remove once the spec covers them.
|
|
55
|
+
*/
|
|
56
|
+
export interface DatasetSpecGaps {
|
|
57
|
+
title?: string;
|
|
58
|
+
username?: string;
|
|
59
|
+
}
|
|
60
|
+
export interface DatasetRePointed {
|
|
61
|
+
stats?: DatasetStats;
|
|
62
|
+
}
|
|
63
|
+
export interface DatasetSpecNarrowings {
|
|
64
|
+
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
65
|
+
consoleUrl?: string;
|
|
66
|
+
}
|
|
67
|
+
/**
|
|
68
|
+
* Represents a dataset storage on the Apify platform.
|
|
69
|
+
*
|
|
70
|
+
* Datasets store structured data as a sequence of items (records). Each item is a JSON object.
|
|
71
|
+
* Datasets are useful for storing results from web scraping, crawling, or data processing tasks.
|
|
72
|
+
*/
|
|
73
|
+
export interface Dataset extends Omit<Schemas['Dataset'], keyof DatasetRePointed | keyof DatasetSpecNarrowings>, DatasetRePointed, DatasetSpecNarrowings, DatasetSpecGaps {
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Fields the API returns in dataset stats that the OpenAPI spec does not describe yet.
|
|
77
|
+
*
|
|
78
|
+
* TODO: Remove once the spec covers them.
|
|
79
|
+
*/
|
|
80
|
+
export interface DatasetStatsSpecGaps {
|
|
81
|
+
deleteCount?: number;
|
|
82
|
+
}
|
|
83
|
+
/** An interface cannot extend an indexed access type directly, so each schema is named first. */
|
|
84
|
+
type GeneratedDatasetStats = Schemas['DatasetStats'];
|
|
85
|
+
type GeneratedDatasetFieldStatistics = Schemas['DatasetFieldStatistics'];
|
|
86
|
+
type GeneratedWebhookDispatchCall = NonNullable<Schemas['WebhookDispatch']['calls']>[number];
|
|
87
|
+
type GeneratedWebhookDispatchEventData = NonNullable<Schemas['WebhookDispatch']['eventData']>;
|
|
88
|
+
/** Statistics about dataset usage and storage. */
|
|
89
|
+
export interface DatasetStats extends GeneratedDatasetStats, DatasetStatsSpecGaps {
|
|
90
|
+
}
|
|
91
|
+
export interface DatasetStatisticsRePointed {
|
|
92
|
+
/**
|
|
93
|
+
* Statistics such as `min`, `max`, `nullCount` and `emptyCount` for each field of the dataset's
|
|
94
|
+
* [fields schema](https://docs.apify.com/platform/actors/development/actor-definition/dataset-schema/validation).
|
|
95
|
+
*/
|
|
96
|
+
fieldStatistics?: Record<string, FieldStatistics> | null;
|
|
97
|
+
}
|
|
98
|
+
/**
|
|
99
|
+
* Statistical information about dataset fields.
|
|
100
|
+
*
|
|
101
|
+
* Provides insights into the data structure and content of the dataset.
|
|
102
|
+
* @since Added in 2.11.2
|
|
103
|
+
*/
|
|
104
|
+
export interface DatasetStatistics extends Omit<Schemas['DatasetStatistics'], keyof DatasetStatisticsRePointed>, DatasetStatisticsRePointed {
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Statistics for a single field in a dataset.
|
|
108
|
+
* @since Added in 2.11.2
|
|
109
|
+
*/
|
|
110
|
+
export interface FieldStatistics extends GeneratedDatasetFieldStatistics {
|
|
111
|
+
}
|
|
112
|
+
export interface WebhookDispatchWebhookSummaryRePointed {
|
|
113
|
+
condition?: WebhookCondition;
|
|
114
|
+
}
|
|
115
|
+
/** The subset of a webhook that a dispatch carries. */
|
|
116
|
+
export interface WebhookDispatchWebhookSummary extends Omit<Schemas['WebhookDispatchWebhookSummary'], keyof WebhookDispatchWebhookSummaryRePointed>, WebhookDispatchWebhookSummaryRePointed {
|
|
117
|
+
}
|
|
118
|
+
export interface WebhookDispatchRePointed {
|
|
119
|
+
calls?: WebhookDispatchCall[];
|
|
120
|
+
webhook?: WebhookDispatchWebhookSummary | null;
|
|
121
|
+
eventData?: WebhookDispatchEventData | null;
|
|
122
|
+
eventType: WebhookEventType;
|
|
123
|
+
status: WebhookDispatchStatus;
|
|
124
|
+
}
|
|
125
|
+
export interface WebhookDispatch extends Omit<Schemas['WebhookDispatch'], keyof WebhookDispatchRePointed>, WebhookDispatchRePointed {
|
|
126
|
+
}
|
|
127
|
+
/** A single delivery attempt made by a webhook dispatch. */
|
|
128
|
+
export interface WebhookDispatchCall extends GeneratedWebhookDispatchCall {
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Identifiers of the resource whose event triggered a webhook.
|
|
132
|
+
* @since Added in 2.13.0
|
|
133
|
+
*/
|
|
134
|
+
export interface WebhookDispatchEventData extends GeneratedWebhookDispatchEventData {
|
|
135
|
+
}
|
|
136
|
+
type GeneratedKeyValueStoreStats = Schemas['KeyValueStoreStats'];
|
|
137
|
+
type GeneratedKeyValueStoreKey = Schemas['KeyValueStoreKey'];
|
|
138
|
+
/**
|
|
139
|
+
* Fields the API returns on a key-value store that the OpenAPI spec does not describe yet.
|
|
140
|
+
*
|
|
141
|
+
* TODO: Remove once the spec covers them.
|
|
142
|
+
*/
|
|
143
|
+
export interface KeyValueStoreSpecGaps {
|
|
144
|
+
title?: string;
|
|
145
|
+
}
|
|
146
|
+
export interface KeyValueStoreRePointed {
|
|
147
|
+
stats?: KeyValueStoreStats;
|
|
148
|
+
}
|
|
149
|
+
export interface KeyValueStoreSpecNarrowings {
|
|
150
|
+
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
151
|
+
}
|
|
152
|
+
/**
|
|
153
|
+
* Represents a Key-Value Store storage on the Apify platform.
|
|
154
|
+
*
|
|
155
|
+
* Key-value stores are used to store arbitrary data records or files. Each record is identified
|
|
156
|
+
* by a unique key and can contain any data - JSON objects, strings, binary files, etc.
|
|
157
|
+
*/
|
|
158
|
+
export interface KeyValueStore extends Omit<Schemas['KeyValueStore'], keyof KeyValueStoreRePointed | keyof KeyValueStoreSpecNarrowings>, KeyValueStoreRePointed, KeyValueStoreSpecNarrowings, KeyValueStoreSpecGaps {
|
|
159
|
+
}
|
|
160
|
+
/** Statistics about Key-Value Store usage and storage. */
|
|
161
|
+
export interface KeyValueStoreStats extends GeneratedKeyValueStoreStats {
|
|
162
|
+
}
|
|
163
|
+
/** Metadata about a single key in a Key-Value Store. */
|
|
164
|
+
export interface KeyValueListItem extends GeneratedKeyValueStoreKey {
|
|
165
|
+
}
|
|
166
|
+
export interface KeyValueClientListKeysResultRePointed {
|
|
167
|
+
items: KeyValueListItem[];
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* Result of listing keys in a Key-Value Store.
|
|
171
|
+
*
|
|
172
|
+
* Contains paginated list of keys with metadata and pagination information.
|
|
173
|
+
*/
|
|
174
|
+
export interface KeyValueClientListKeysResult extends Omit<Schemas['ListOfKeys'], keyof KeyValueClientListKeysResultRePointed>, KeyValueClientListKeysResultRePointed {
|
|
175
|
+
}
|
|
176
|
+
type GeneratedVersion = Schemas['Version'];
|
|
177
|
+
type GeneratedSourceCodeFile = Schemas['SourceCodeFile'];
|
|
178
|
+
type GeneratedSourceCodeFolder = Schemas['SourceCodeFolder'];
|
|
179
|
+
type GeneratedEnvVar = Schemas['EnvVar'];
|
|
180
|
+
/**
|
|
181
|
+
* Where the source code of an Actor version lives.
|
|
182
|
+
*
|
|
183
|
+
* Declared here rather than in `./resource_clients/actor_version` so that the version types can
|
|
184
|
+
* reference it without closing an import cycle. It is re-exported from there, so the public name and
|
|
185
|
+
* import path are unchanged.
|
|
186
|
+
*/
|
|
187
|
+
export declare enum ActorSourceType {
|
|
188
|
+
SourceFiles = "SOURCE_FILES",
|
|
189
|
+
GitRepo = "GIT_REPO",
|
|
190
|
+
Tarball = "TARBALL",
|
|
191
|
+
GitHubGist = "GITHUB_GIST",
|
|
192
|
+
SourceCode = "SOURCE_CODE"
|
|
193
|
+
}
|
|
194
|
+
/** An environment variable of an Actor version. */
|
|
195
|
+
export interface ActorEnvironmentVariable extends GeneratedEnvVar {
|
|
196
|
+
}
|
|
197
|
+
/** A single file of an Actor version's source code. */
|
|
198
|
+
export interface ActorVersionSourceFile extends GeneratedSourceCodeFile {
|
|
199
|
+
}
|
|
200
|
+
/**
|
|
201
|
+
* A folder in an Actor version's source code tree.
|
|
202
|
+
*
|
|
203
|
+
* `sourceFiles` is a flat list that mixes files and folders, told apart by this shape's `folder` flag
|
|
204
|
+
* rather than by nesting.
|
|
205
|
+
*/
|
|
206
|
+
export interface ActorVersionSourceFolder extends GeneratedSourceCodeFolder {
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* The four fields that hold a version's source location, exactly one of which applies per source
|
|
210
|
+
* type. The spec marks all of them optional on a single flat schema; each union variant below
|
|
211
|
+
* reinstates the one that its `sourceType` implies, as required.
|
|
212
|
+
*/
|
|
213
|
+
export type ActorVersionSourceLocation = 'sourceFiles' | 'gitRepoUrl' | 'tarballUrl' | 'gitHubGistUrl';
|
|
214
|
+
export interface ActorVersionRePointed {
|
|
215
|
+
envVars?: ActorEnvironmentVariable[] | null;
|
|
216
|
+
}
|
|
217
|
+
export interface ActorVersionClientNarrowings {
|
|
218
|
+
sourceType: ActorSourceType;
|
|
219
|
+
}
|
|
220
|
+
/**
|
|
221
|
+
* Fields every Actor version carries, whatever its source type.
|
|
222
|
+
*
|
|
223
|
+
* The spec models a version as one flat object with all four source locations optional. This client
|
|
224
|
+
* keeps a union discriminated on `sourceType` instead, because that narrows the source location down
|
|
225
|
+
* to the single field which applies -- so the four are dropped here and reinstated per variant.
|
|
226
|
+
*/
|
|
227
|
+
export interface BaseActorVersion<SourceType extends ActorSourceType> extends Omit<GeneratedVersion, keyof ActorVersionClientNarrowings | keyof ActorVersionRePointed | ActorVersionSourceLocation>, ActorVersionRePointed {
|
|
228
|
+
sourceType: SourceType;
|
|
229
|
+
}
|
|
230
|
+
/**
|
|
231
|
+
* An Actor version whose source code is stored on the Apify platform.
|
|
232
|
+
* @since Added in 2.6.1
|
|
233
|
+
*/
|
|
234
|
+
export interface ActorVersionSourceFiles extends BaseActorVersion<ActorSourceType.SourceFiles> {
|
|
235
|
+
sourceFiles: (ActorVersionSourceFile | ActorVersionSourceFolder)[];
|
|
236
|
+
}
|
|
237
|
+
/** An Actor version built from a Git repository. */
|
|
238
|
+
export interface ActorVersionGitRepo extends BaseActorVersion<ActorSourceType.GitRepo> {
|
|
239
|
+
gitRepoUrl: NonNullable<GeneratedVersion['gitRepoUrl']>;
|
|
240
|
+
}
|
|
241
|
+
/** An Actor version built from a downloadable tarball or ZIP archive. */
|
|
242
|
+
export interface ActorVersionTarball extends BaseActorVersion<ActorSourceType.Tarball> {
|
|
243
|
+
tarballUrl: NonNullable<GeneratedVersion['tarballUrl']>;
|
|
244
|
+
}
|
|
245
|
+
/** An Actor version built from a GitHub Gist. */
|
|
246
|
+
export interface ActorVersionGitHubGist extends BaseActorVersion<ActorSourceType.GitHubGist> {
|
|
247
|
+
gitHubGistUrl: NonNullable<GeneratedVersion['gitHubGistUrl']>;
|
|
248
|
+
}
|
|
249
|
+
/**
|
|
250
|
+
* An Actor version whose source is a single inline script.
|
|
251
|
+
*
|
|
252
|
+
* It carries no source location of its own, so it adds nothing to `BaseActorVersion`; the variant
|
|
253
|
+
* exists so that `SOURCE_CODE`, which both the spec and `@apify/consts` list, is representable.
|
|
254
|
+
*/
|
|
255
|
+
export interface ActorVersionSourceCode extends BaseActorVersion<ActorSourceType.SourceCode> {
|
|
256
|
+
}
|
|
257
|
+
/** A version of an Actor, discriminated on where its source code comes from. */
|
|
258
|
+
export type ActorVersion = ActorVersionSourceFiles | ActorVersionGitRepo | ActorVersionTarball | ActorVersionGitHubGist | ActorVersionSourceCode;
|
|
259
|
+
/**
|
|
260
|
+
* An Actor version as the API returns it, where the build tag is always set.
|
|
261
|
+
*
|
|
262
|
+
* `Required` would not be enough: it strips `undefined` but leaves the `null` the spec allows on
|
|
263
|
+
* `buildTag`, so a caller would still have to null-check a field this type promises is set. It is
|
|
264
|
+
* unwrapped with `NonNullable` instead.
|
|
265
|
+
*/
|
|
266
|
+
export type FinalActorVersion = ActorVersion & {
|
|
267
|
+
buildTag: NonNullable<ActorVersion['buildTag']>;
|
|
268
|
+
};
|
|
269
|
+
type GeneratedActorStats = Schemas['ActorStats'];
|
|
270
|
+
type GeneratedActorStandby = Schemas['ActorStandby'];
|
|
271
|
+
type GeneratedExampleRunInput = Schemas['ExampleRunInput'];
|
|
272
|
+
type GeneratedTaggedBuildInfo = Schemas['TaggedBuildInfo'];
|
|
273
|
+
type GeneratedFreeActorPricingInfo = Schemas['FreeActorPricingInfo'];
|
|
274
|
+
type GeneratedFlatPricePerMonthActorPricingInfo = Schemas['FlatPricePerMonthActorPricingInfo'];
|
|
275
|
+
type GeneratedTieredPricingPerDatasetItemEntry = Schemas['TieredPricingPerDatasetItemEntry'];
|
|
276
|
+
type GeneratedTieredPricingPerEventEntry = Schemas['TieredPricingPerEventEntry'];
|
|
277
|
+
/** Statistics about Actor usage and activity. */
|
|
278
|
+
export interface ActorStats extends GeneratedActorStats {
|
|
279
|
+
}
|
|
280
|
+
/**
|
|
281
|
+
* Standby mode configuration, for keeping an Actor warm and responsive.
|
|
282
|
+
* @since Added in 2.9.5
|
|
283
|
+
*/
|
|
284
|
+
export interface ActorStandby extends GeneratedActorStandby {
|
|
285
|
+
}
|
|
286
|
+
/** Example input data to demonstrate Actor usage. */
|
|
287
|
+
export interface ActorExampleRunInput extends GeneratedExampleRunInput {
|
|
288
|
+
}
|
|
289
|
+
/** Information about a specific tagged build. */
|
|
290
|
+
export interface ActorTaggedBuild extends GeneratedTaggedBuildInfo {
|
|
291
|
+
}
|
|
292
|
+
/** Mapping of build tags (e.g. 'latest', 'beta') to their corresponding build information. */
|
|
293
|
+
export type ActorTaggedBuilds = Record<string, ActorTaggedBuild | null>;
|
|
294
|
+
export interface ActorDefaultRunOptionsRePointed {
|
|
295
|
+
forcePermissionLevel?: ACTOR_PERMISSION_LEVEL | null;
|
|
296
|
+
}
|
|
297
|
+
/** Default configuration options for Actor runs. */
|
|
298
|
+
export interface ActorDefaultRunOptions extends Omit<Schemas['DefaultRunOptions'], keyof ActorDefaultRunOptionsRePointed>, ActorDefaultRunOptionsRePointed {
|
|
299
|
+
}
|
|
300
|
+
/**
|
|
301
|
+
* Fields of an Actor definition that the OpenAPI spec does not describe yet.
|
|
302
|
+
*
|
|
303
|
+
* TODO: Remove once the spec covers them.
|
|
304
|
+
*/
|
|
305
|
+
export interface ActorDefinitionSpecGaps {
|
|
306
|
+
/**
|
|
307
|
+
* Output schema for the Actor.
|
|
308
|
+
*
|
|
309
|
+
* @see https://docs.apify.com/platform/actors/development/actor-definition/output-schema
|
|
310
|
+
*/
|
|
311
|
+
output?: object | null;
|
|
312
|
+
}
|
|
313
|
+
export interface ActorDefinitionSpecNarrowings {
|
|
314
|
+
readme?: string | null;
|
|
315
|
+
input?: object | null;
|
|
316
|
+
changelog?: string | null;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Actor definition from the `.actor/actor.json` file.
|
|
320
|
+
*
|
|
321
|
+
* Contains the Actor's configuration, input schema, and other metadata.
|
|
322
|
+
* @see https://docs.apify.com/platform/actors/development/actor-definition/actor-json
|
|
323
|
+
* @since Added in 2.11.0
|
|
324
|
+
*/
|
|
325
|
+
export interface ActorDefinition extends Omit<Schemas['ActorDefinition'], keyof ActorDefinitionSpecNarrowings>, ActorDefinitionSpecNarrowings, ActorDefinitionSpecGaps {
|
|
326
|
+
}
|
|
327
|
+
export interface ActorChargeEventRePointed {
|
|
328
|
+
eventTieredPricingUsd?: TieredPricingPerEvent;
|
|
329
|
+
}
|
|
330
|
+
/**
|
|
331
|
+
* Definition of a chargeable event for pay-per-event Actors.
|
|
332
|
+
* @since Added in 2.11.1
|
|
333
|
+
*/
|
|
334
|
+
export interface ActorChargeEvent extends Omit<Schemas['ActorChargeEvent'], keyof ActorChargeEventRePointed>, ActorChargeEventRePointed {
|
|
335
|
+
}
|
|
336
|
+
/**
|
|
337
|
+
* Mapping of event names to their pricing information.
|
|
338
|
+
* @since Added in 2.11.1
|
|
339
|
+
*/
|
|
340
|
+
export type ActorChargeEvents = Record<string, ActorChargeEvent>;
|
|
341
|
+
/**
|
|
342
|
+
* Pricing information for free Actors.
|
|
343
|
+
* @since Added in 2.11.1
|
|
344
|
+
*/
|
|
345
|
+
export interface FreeActorPricingInfo extends GeneratedFreeActorPricingInfo {
|
|
346
|
+
}
|
|
347
|
+
/**
|
|
348
|
+
* Pricing information for Actors with a flat monthly subscription fee.
|
|
349
|
+
* @since Added in 2.11.1
|
|
350
|
+
*/
|
|
351
|
+
export interface FlatPricePerMonthActorPricingInfo extends GeneratedFlatPricePerMonthActorPricingInfo {
|
|
352
|
+
}
|
|
353
|
+
export interface PricePerDatasetItemActorPricingInfoRePointed {
|
|
354
|
+
tieredPricing?: TieredPricingPerDatasetItem;
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Pricing information for pay-per-result Actors.
|
|
358
|
+
*
|
|
359
|
+
* These Actors charge based on the number of items saved to the dataset.
|
|
360
|
+
* @since Added in 2.11.1
|
|
361
|
+
*/
|
|
362
|
+
export interface PricePerDatasetItemActorPricingInfo extends Omit<Schemas['PricePerDatasetItemActorPricingInfo'], keyof PricePerDatasetItemActorPricingInfoRePointed>, PricePerDatasetItemActorPricingInfoRePointed {
|
|
363
|
+
}
|
|
364
|
+
export interface PricePerEventActorPricingInfoRePointed {
|
|
365
|
+
pricingPerEvent: {
|
|
366
|
+
actorChargeEvents?: ActorChargeEvents;
|
|
367
|
+
};
|
|
368
|
+
}
|
|
369
|
+
/**
|
|
370
|
+
* Pricing information for pay-per-event Actors.
|
|
371
|
+
*
|
|
372
|
+
* These Actors charge based on specific events (e.g., emails sent, API calls made). The spec names
|
|
373
|
+
* this schema `PayPerEventActorPricingInfo`; the published name is kept as it is.
|
|
374
|
+
* @since Added in 2.11.1
|
|
375
|
+
*/
|
|
376
|
+
export interface PricePerEventActorPricingInfo extends Omit<Schemas['PayPerEventActorPricingInfo'], keyof PricePerEventActorPricingInfoRePointed>, PricePerEventActorPricingInfoRePointed {
|
|
377
|
+
}
|
|
378
|
+
/**
|
|
379
|
+
* Union type representing all possible Actor pricing models.
|
|
380
|
+
* @since Added in 2.11.1
|
|
381
|
+
*/
|
|
382
|
+
export type ActorRunPricingInfo = PricePerEventActorPricingInfo | PricePerDatasetItemActorPricingInfo | FlatPricePerMonthActorPricingInfo | FreeActorPricingInfo;
|
|
383
|
+
/** One subscription tier's price per dataset item. */
|
|
384
|
+
export interface TieredPricingPerDatasetItemEntry extends GeneratedTieredPricingPerDatasetItemEntry {
|
|
385
|
+
}
|
|
386
|
+
/** One subscription tier's price for a single charge event. */
|
|
387
|
+
export interface TieredPricingPerEventEntry extends GeneratedTieredPricingPerEventEntry {
|
|
388
|
+
}
|
|
389
|
+
/**
|
|
390
|
+
* Tiered price-per-dataset-item pricing, keyed by subscription tier such as `FREE` or `GOLD`.
|
|
391
|
+
*
|
|
392
|
+
* The spec models both tiered maps as index signatures over an entry schema, and the entry is what a
|
|
393
|
+
* caller reads, so it is published in its own right and the map points at it.
|
|
394
|
+
*/
|
|
395
|
+
export interface TieredPricingPerDatasetItem {
|
|
396
|
+
[tier: string]: TieredPricingPerDatasetItemEntry;
|
|
397
|
+
}
|
|
398
|
+
/** Tiered pay-per-event pricing, keyed by subscription tier such as `FREE` or `GOLD`. */
|
|
399
|
+
export interface TieredPricingPerEvent {
|
|
400
|
+
[tier: string]: TieredPricingPerEventEntry;
|
|
401
|
+
}
|
|
402
|
+
/**
|
|
403
|
+
* Fields the API returns on an Actor that the OpenAPI spec does not describe yet.
|
|
404
|
+
*
|
|
405
|
+
* TODO: Remove once the spec covers them.
|
|
406
|
+
*/
|
|
407
|
+
export interface ActorSpecGaps {
|
|
408
|
+
/** Whether the Actor can be run by anonymous users without authentication */
|
|
409
|
+
isAnonymouslyRunnable?: boolean;
|
|
410
|
+
}
|
|
411
|
+
export interface ActorRePointed {
|
|
412
|
+
stats: ActorStats;
|
|
413
|
+
versions: ActorVersion[];
|
|
414
|
+
pricingInfos?: ActorRunPricingInfo[];
|
|
415
|
+
defaultRunOptions: ActorDefaultRunOptions;
|
|
416
|
+
exampleRunInput?: ActorExampleRunInput | null;
|
|
417
|
+
taggedBuilds?: ActorTaggedBuilds | null;
|
|
418
|
+
actorStandby?: ActorStandby | null;
|
|
419
|
+
actorPermissionLevel?: ACTOR_PERMISSION_LEVEL;
|
|
420
|
+
}
|
|
421
|
+
/**
|
|
422
|
+
* Represents an Actor in the Apify platform.
|
|
423
|
+
*
|
|
424
|
+
* Actors are serverless computing units that can perform arbitrary tasks such as web scraping,
|
|
425
|
+
* data processing, automation, and more. Each Actor has versions, builds, and can be executed
|
|
426
|
+
* with different configurations.
|
|
427
|
+
*/
|
|
428
|
+
export interface Actor extends Omit<Schemas['Actor'], keyof ActorRePointed>, ActorRePointed, ActorSpecGaps {
|
|
429
|
+
}
|
|
430
|
+
export interface ActorCollectionListItemRePointed {
|
|
431
|
+
stats?: ActorStats | null;
|
|
432
|
+
}
|
|
433
|
+
/** An Actor as it appears in a listing, which carries fewer fields than the full resource. */
|
|
434
|
+
export interface ActorCollectionListItem extends Omit<Schemas['ActorShort'], keyof ActorCollectionListItemRePointed>, ActorCollectionListItemRePointed {
|
|
435
|
+
}
|
|
436
|
+
type GeneratedBuildUsage = Schemas['BuildUsage'];
|
|
437
|
+
type GeneratedBuildStats = Schemas['BuildStats'];
|
|
438
|
+
type GeneratedBuildOptions = Schemas['BuildOptions'];
|
|
439
|
+
/**
|
|
440
|
+
* Resource usage for an Actor build.
|
|
441
|
+
* @since Added in 2.7.2
|
|
442
|
+
*/
|
|
443
|
+
export interface BuildUsage extends GeneratedBuildUsage {
|
|
444
|
+
}
|
|
445
|
+
/** Runtime statistics for an Actor build. */
|
|
446
|
+
export interface BuildStats extends GeneratedBuildStats {
|
|
447
|
+
}
|
|
448
|
+
/** Configuration options used for an Actor build. */
|
|
449
|
+
export interface BuildOptions extends GeneratedBuildOptions {
|
|
450
|
+
}
|
|
451
|
+
export interface BuildMetaRePointed {
|
|
452
|
+
origin: ValueOf<typeof META_ORIGINS>;
|
|
453
|
+
}
|
|
454
|
+
/**
|
|
455
|
+
* Metadata about how a Build was initiated.
|
|
456
|
+
*
|
|
457
|
+
* The spec names this schema `BuildsMeta`; the published name is kept as it is.
|
|
458
|
+
*/
|
|
459
|
+
export interface BuildMeta extends Omit<Schemas['BuildsMeta'], keyof BuildMetaRePointed>, BuildMetaRePointed {
|
|
460
|
+
}
|
|
461
|
+
export interface BuildRePointed {
|
|
462
|
+
meta: BuildMeta;
|
|
463
|
+
stats?: BuildStats | null;
|
|
464
|
+
options?: BuildOptions | null;
|
|
465
|
+
usage?: BuildUsage | null;
|
|
466
|
+
usageUsd?: BuildUsage | null;
|
|
467
|
+
actorDefinition?: ActorDefinition | null;
|
|
468
|
+
status: ValueOf<typeof ACTOR_JOB_STATUSES>;
|
|
469
|
+
}
|
|
470
|
+
/**
|
|
471
|
+
* Represents an Actor build.
|
|
472
|
+
*
|
|
473
|
+
* Builds compile Actor source code and prepare it for execution. Each build has a unique ID
|
|
474
|
+
* and can be tagged (e.g., 'latest', 'beta') for easy reference.
|
|
475
|
+
*/
|
|
476
|
+
export interface Build extends Omit<Schemas['Build'], keyof BuildRePointed>, BuildRePointed {
|
|
477
|
+
}
|
|
478
|
+
export interface BuildCollectionClientListItemRePointed {
|
|
479
|
+
meta?: BuildMeta;
|
|
480
|
+
status: ValueOf<typeof ACTOR_JOB_STATUSES>;
|
|
481
|
+
}
|
|
482
|
+
/** A build as it appears in a listing, which carries fewer fields than the full resource. */
|
|
483
|
+
export interface BuildCollectionClientListItem extends Omit<Schemas['BuildShort'], keyof BuildCollectionClientListItemRePointed>, BuildCollectionClientListItemRePointed {
|
|
484
|
+
}
|
|
485
|
+
type GeneratedRunUsage = Schemas['RunUsage'];
|
|
486
|
+
type GeneratedRunStats = Schemas['RunStats'];
|
|
487
|
+
type GeneratedRunOptions = Schemas['RunOptions'];
|
|
488
|
+
type GeneratedMetamorph = Schemas['Metamorph'];
|
|
489
|
+
type GeneratedRunStorageIds = NonNullable<Schemas['Run']['storageIds']>;
|
|
490
|
+
/**
|
|
491
|
+
* Resource usage metrics for an Actor run.
|
|
492
|
+
*
|
|
493
|
+
* All values represent the total consumption during the run's lifetime. The same shape doubles as the
|
|
494
|
+
* cost breakdown on `ActorRun.usageUsd`, where the spec names it `RunUsageUsd`; the two are
|
|
495
|
+
* structurally identical, so the published type stays single.
|
|
496
|
+
* @since Added in 2.7.0
|
|
497
|
+
*/
|
|
498
|
+
export interface ActorRunUsage extends GeneratedRunUsage {
|
|
499
|
+
}
|
|
500
|
+
/**
|
|
501
|
+
* Runtime statistics for an Actor run.
|
|
502
|
+
*
|
|
503
|
+
* Provides detailed metrics about resource consumption and performance during the run.
|
|
504
|
+
*/
|
|
505
|
+
export interface ActorRunStats extends GeneratedRunStats {
|
|
506
|
+
}
|
|
507
|
+
/** A metamorph event that occurred during an Actor run. */
|
|
508
|
+
export interface ActorRunMetamorph extends GeneratedMetamorph {
|
|
509
|
+
}
|
|
510
|
+
/**
|
|
511
|
+
* Aliased storage IDs associated with an Actor run, grouped by storage type.
|
|
512
|
+
*
|
|
513
|
+
* Each group is a map from alias to storage ID. The spec describes no alias as guaranteed, not even
|
|
514
|
+
* `default`, so a lookup can come back `undefined`.
|
|
515
|
+
* @since Added in 2.22.3
|
|
516
|
+
*/
|
|
517
|
+
export interface ActorRunStorageIds extends GeneratedRunStorageIds {
|
|
518
|
+
}
|
|
519
|
+
export interface ActorRunMetaRePointed {
|
|
520
|
+
origin: ValueOf<typeof META_ORIGINS>;
|
|
521
|
+
}
|
|
522
|
+
/** Metadata about how an Actor run was initiated. */
|
|
523
|
+
export interface ActorRunMeta extends Omit<Schemas['RunMeta'], keyof ActorRunMetaRePointed>, ActorRunMetaRePointed {
|
|
524
|
+
}
|
|
525
|
+
/**
|
|
526
|
+
* Fields the API returns in an Actor run's options that the OpenAPI spec does not describe yet.
|
|
527
|
+
*
|
|
528
|
+
* TODO: Remove once the spec covers it.
|
|
529
|
+
*/
|
|
530
|
+
export interface ActorRunOptionsSpecGaps {
|
|
531
|
+
restartOnError?: boolean;
|
|
532
|
+
}
|
|
533
|
+
/**
|
|
534
|
+
* Configuration options used for an Actor run.
|
|
535
|
+
*
|
|
536
|
+
* These are the actual options that were applied to the run (may differ from requested options).
|
|
537
|
+
*/
|
|
538
|
+
export interface ActorRunOptions extends GeneratedRunOptions, ActorRunOptionsSpecGaps {
|
|
539
|
+
}
|
|
540
|
+
export interface ActorRunListItemRePointed {
|
|
541
|
+
meta: ActorRunMeta;
|
|
542
|
+
status: ValueOf<typeof ACTOR_JOB_STATUSES>;
|
|
543
|
+
}
|
|
544
|
+
/**
|
|
545
|
+
* An Actor run as it appears in a listing, which carries fewer fields than the full resource.
|
|
546
|
+
* @since Added in 2.7.0
|
|
547
|
+
*/
|
|
548
|
+
export interface ActorRunListItem extends Omit<Schemas['RunShort'], keyof ActorRunListItemRePointed>, ActorRunListItemRePointed {
|
|
549
|
+
}
|
|
550
|
+
export interface ActorRunRePointed {
|
|
551
|
+
meta: ActorRunMeta;
|
|
552
|
+
stats: ActorRunStats;
|
|
553
|
+
options: ActorRunOptions;
|
|
554
|
+
usage?: ActorRunUsage | null;
|
|
555
|
+
usageUsd?: ActorRunUsage | null;
|
|
556
|
+
storageIds?: ActorRunStorageIds;
|
|
557
|
+
metamorphs?: ActorRunMetamorph[] | null;
|
|
558
|
+
pricingInfo?: ActorRunPricingInfo;
|
|
559
|
+
status: ValueOf<typeof ACTOR_JOB_STATUSES>;
|
|
560
|
+
}
|
|
561
|
+
export interface ActorRunClientNarrowings {
|
|
562
|
+
generalAccess?: RUN_GENERAL_ACCESS | null;
|
|
563
|
+
}
|
|
564
|
+
/**
|
|
565
|
+
* Complete Actor run information including statistics and usage details.
|
|
566
|
+
*
|
|
567
|
+
* Represents a single execution of an Actor with all its configuration, status,
|
|
568
|
+
* and resource usage information.
|
|
569
|
+
*/
|
|
570
|
+
export interface ActorRun extends Omit<Schemas['Run'], keyof ActorRunRePointed | keyof ActorRunClientNarrowings>, ActorRunRePointed, ActorRunClientNarrowings {
|
|
571
|
+
}
|
|
572
|
+
type GeneratedTaskStats = Schemas['TaskStats'];
|
|
573
|
+
type GeneratedTaskOptions = Schemas['TaskOptions'];
|
|
574
|
+
type GeneratedCurrentPricingInfo = Schemas['CurrentPricingInfo'];
|
|
575
|
+
/** Statistics about Actor task usage. */
|
|
576
|
+
export interface TaskStats extends GeneratedTaskStats {
|
|
577
|
+
}
|
|
578
|
+
/** Configuration options for an Actor task. */
|
|
579
|
+
export interface TaskOptions extends GeneratedTaskOptions {
|
|
580
|
+
}
|
|
581
|
+
/**
|
|
582
|
+
* Public-facing display configuration of a task's public landing page.
|
|
583
|
+
*
|
|
584
|
+
* The task is published when `publishedAt` is set and unpublished when it is `null`. The
|
|
585
|
+
* `publishedAt` field is read-only - use {@apilink TaskClient.publish} and
|
|
586
|
+
* {@apilink TaskClient.unpublish} to change the publication state.
|
|
587
|
+
* @since Added in 2.25.0
|
|
588
|
+
*/
|
|
589
|
+
export interface TaskPublicConfig {
|
|
590
|
+
publishedAt: Date | null;
|
|
591
|
+
seoTitle?: string | null;
|
|
592
|
+
seoDescription?: string | null;
|
|
593
|
+
categorization?: string | null;
|
|
594
|
+
inputSchemaFields?: string[] | null;
|
|
595
|
+
datasetName?: string | null;
|
|
596
|
+
datasetView?: string | null;
|
|
597
|
+
}
|
|
598
|
+
/**
|
|
599
|
+
* Fields the API returns on a task that the OpenAPI spec does not describe yet.
|
|
600
|
+
*
|
|
601
|
+
* TODO: Remove once the spec covers it.
|
|
602
|
+
*/
|
|
603
|
+
export interface TaskSpecGaps {
|
|
604
|
+
description?: string;
|
|
605
|
+
/**
|
|
606
|
+
* Whether the task is published on its public landing page. Derived from
|
|
607
|
+
* `publicConfig.publishedAt` -- set it on update to publish or unpublish the task.
|
|
608
|
+
* @since Added in 2.25.0
|
|
609
|
+
*/
|
|
610
|
+
isPublic?: boolean;
|
|
611
|
+
/**
|
|
612
|
+
* @since Added in 2.25.0
|
|
613
|
+
*/
|
|
614
|
+
publicConfig?: TaskPublicConfig | null;
|
|
615
|
+
}
|
|
616
|
+
export interface TaskRePointed {
|
|
617
|
+
stats?: TaskStats | null;
|
|
618
|
+
options?: TaskOptions | null;
|
|
619
|
+
actorStandby?: ActorStandby | null;
|
|
620
|
+
}
|
|
621
|
+
export interface TaskSpecNarrowings {
|
|
622
|
+
input?: Dictionary | Dictionary[] | null;
|
|
623
|
+
}
|
|
624
|
+
/**
|
|
625
|
+
* Represents an Actor task.
|
|
626
|
+
*
|
|
627
|
+
* Tasks are saved Actor configurations with input and settings that can be executed
|
|
628
|
+
* repeatedly without having to specify the full input each time.
|
|
629
|
+
*/
|
|
630
|
+
export interface Task extends Omit<Schemas['Task'], keyof TaskRePointed | keyof TaskSpecNarrowings>, TaskRePointed, TaskSpecNarrowings, TaskSpecGaps {
|
|
631
|
+
}
|
|
632
|
+
export interface TaskListRePointed {
|
|
633
|
+
stats?: TaskStats | null;
|
|
634
|
+
}
|
|
635
|
+
/**
|
|
636
|
+
* Fields the API returns on a listed task that the OpenAPI spec does not describe yet.
|
|
637
|
+
*
|
|
638
|
+
* `description` is deliberately not here, although `TaskSpecGaps` claims it on the full resource: the
|
|
639
|
+
* list endpoint publishes a smaller set of fields, and that is one of the fields it leaves out.
|
|
640
|
+
*
|
|
641
|
+
* TODO: Remove once the spec covers it.
|
|
642
|
+
*/
|
|
643
|
+
export interface TaskListSpecGaps {
|
|
644
|
+
title?: string | null;
|
|
645
|
+
}
|
|
646
|
+
/** A task as it appears in a listing, which carries fewer fields than the full resource. */
|
|
647
|
+
export interface TaskList extends Omit<Schemas['TaskShort'], keyof TaskListRePointed>, TaskListRePointed, TaskListSpecGaps {
|
|
648
|
+
}
|
|
649
|
+
export interface ActorStoreListRePointed {
|
|
650
|
+
stats: ActorStats;
|
|
651
|
+
currentPricingInfo?: PricingInfo;
|
|
652
|
+
}
|
|
653
|
+
/**
|
|
654
|
+
* Pricing information as Apify Store reports it.
|
|
655
|
+
*
|
|
656
|
+
* The spec names this schema `CurrentPricingInfo`; the published name is kept as it is. It is a flat
|
|
657
|
+
* summary rather than one of the `ActorRunPricingInfo` variants, so `pricingModel` is a plain string
|
|
658
|
+
* and every price field is optional.
|
|
659
|
+
* @since Added in 2.7.2
|
|
660
|
+
*/
|
|
661
|
+
export interface PricingInfo extends GeneratedCurrentPricingInfo {
|
|
662
|
+
}
|
|
663
|
+
/**
|
|
664
|
+
* An Actor as it appears in Apify Store.
|
|
665
|
+
* @since Added in 2.7.2
|
|
666
|
+
*/
|
|
667
|
+
export interface ActorStoreList extends Omit<Schemas['StoreListActor'], keyof ActorStoreListRePointed>, ActorStoreListRePointed {
|
|
668
|
+
}
|
|
669
|
+
type GeneratedWebhookStats = Schemas['WebhookStats'];
|
|
670
|
+
type GeneratedWebhookCondition = Schemas['WebhookCondition'];
|
|
671
|
+
/** Statistics about webhook usage. */
|
|
672
|
+
export interface WebhookStats extends GeneratedWebhookStats {
|
|
673
|
+
}
|
|
674
|
+
/** A webhook that fires for any run of a given Actor. */
|
|
675
|
+
export interface WebhookAnyRunOfActorCondition {
|
|
676
|
+
actorId: NonNullable<GeneratedWebhookCondition['actorId']>;
|
|
677
|
+
}
|
|
678
|
+
/** A webhook that fires for any run of a given Actor task. */
|
|
679
|
+
export interface WebhookAnyRunOfActorTaskCondition {
|
|
680
|
+
actorTaskId: NonNullable<GeneratedWebhookCondition['actorTaskId']>;
|
|
681
|
+
}
|
|
682
|
+
/** A webhook that fires for one specific Actor run. */
|
|
683
|
+
export interface WebhookCertainRunCondition {
|
|
684
|
+
actorRunId: NonNullable<GeneratedWebhookCondition['actorRunId']>;
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* The keys of the spec's flat `WebhookCondition` schema, exactly one of which is set per condition.
|
|
688
|
+
* The published type is a union of one-key variants instead, so each key is reinstated as required by
|
|
689
|
+
* the variant that owns it.
|
|
690
|
+
*/
|
|
691
|
+
export type WebhookConditionKey = 'actorId' | 'actorTaskId' | 'actorRunId';
|
|
692
|
+
/**
|
|
693
|
+
* Condition that determines when a webhook should be triggered.
|
|
694
|
+
*
|
|
695
|
+
* The spec models this as one flat object with all three ids optional and nullable. The published type
|
|
696
|
+
* stays a union of single-id variants: exactly one of them applies to any given webhook, and this same
|
|
697
|
+
* type backs `WebhookUpdateData`, where the flat shape would let a caller send none of them or all
|
|
698
|
+
* three at once.
|
|
699
|
+
*/
|
|
700
|
+
export type WebhookCondition = WebhookAnyRunOfActorCondition | WebhookAnyRunOfActorTaskCondition | WebhookCertainRunCondition;
|
|
701
|
+
export interface WebhookLastDispatchRePointed {
|
|
702
|
+
status: WebhookDispatchStatus;
|
|
703
|
+
}
|
|
704
|
+
/**
|
|
705
|
+
* The summary of a webhook's most recent dispatch that the webhook resource carries.
|
|
706
|
+
*
|
|
707
|
+
* The spec names this schema `ExampleWebhookDispatch`.
|
|
708
|
+
*/
|
|
709
|
+
export interface WebhookLastDispatch extends Omit<Schemas['ExampleWebhookDispatch'], keyof WebhookLastDispatchRePointed>, WebhookLastDispatchRePointed {
|
|
710
|
+
}
|
|
711
|
+
/**
|
|
712
|
+
* Fields the API returns on a webhook that the OpenAPI spec does not describe yet.
|
|
713
|
+
*
|
|
714
|
+
* The spec does carry `isApifyIntegration` on `WebhookShort`, the listing shape, and simply omits it
|
|
715
|
+
* from the full `Webhook` schema.
|
|
716
|
+
*
|
|
717
|
+
* TODO: Remove once the spec covers it.
|
|
718
|
+
*/
|
|
719
|
+
export interface WebhookSpecGaps {
|
|
720
|
+
isApifyIntegration?: boolean;
|
|
721
|
+
}
|
|
722
|
+
export interface WebhookRePointed {
|
|
723
|
+
condition: WebhookCondition;
|
|
724
|
+
stats?: WebhookStats | null;
|
|
725
|
+
lastDispatch?: WebhookLastDispatch | null;
|
|
726
|
+
eventTypes: WebhookEventType[];
|
|
727
|
+
}
|
|
728
|
+
/**
|
|
729
|
+
* Represents a webhook configuration.
|
|
730
|
+
*
|
|
731
|
+
* Webhooks send HTTP POST requests to specified URLs when certain events occur
|
|
732
|
+
* (e.g., Actor run succeeds, fails, or times out).
|
|
733
|
+
*/
|
|
734
|
+
export interface Webhook extends Omit<Schemas['Webhook'], keyof WebhookRePointed>, WebhookRePointed, WebhookSpecGaps {
|
|
735
|
+
}
|
|
736
|
+
type GeneratedScheduleActionRunInput = Schemas['ScheduleActionRunInput'];
|
|
737
|
+
/**
|
|
738
|
+
* Types of actions that can be scheduled.
|
|
739
|
+
*
|
|
740
|
+
* Declared here rather than in `./resource_clients/schedule` so that the action types can reference it
|
|
741
|
+
* without closing an import cycle. It is re-exported from there, so the public name and import path are
|
|
742
|
+
* unchanged.
|
|
743
|
+
*/
|
|
744
|
+
export declare enum ScheduleActions {
|
|
745
|
+
RunActor = "RUN_ACTOR",
|
|
746
|
+
RunActorTask = "RUN_ACTOR_TASK"
|
|
747
|
+
}
|
|
748
|
+
/** Input configuration for a scheduled Actor run. */
|
|
749
|
+
export interface ScheduledActorRunInput extends GeneratedScheduleActionRunInput {
|
|
750
|
+
}
|
|
751
|
+
/**
|
|
752
|
+
* Run options for a scheduled Actor run.
|
|
753
|
+
*
|
|
754
|
+
* The spec reuses its `TaskOptions` schema here; the published name is kept as it is.
|
|
755
|
+
*/
|
|
756
|
+
export interface ScheduledActorRunOptions extends GeneratedTaskOptions {
|
|
757
|
+
}
|
|
758
|
+
export interface ScheduleActionRunActorRePointed {
|
|
759
|
+
type: ScheduleActions.RunActor;
|
|
760
|
+
runInput?: ScheduledActorRunInput | null;
|
|
761
|
+
runOptions?: ScheduledActorRunOptions | null;
|
|
762
|
+
}
|
|
763
|
+
/** Scheduled action to run an Actor. */
|
|
764
|
+
export interface ScheduleActionRunActor extends Omit<Schemas['ScheduleActionRunActor'], keyof ScheduleActionRunActorRePointed>, ScheduleActionRunActorRePointed {
|
|
765
|
+
}
|
|
766
|
+
export interface ScheduleActionRunActorTaskRePointed {
|
|
767
|
+
type: ScheduleActions.RunActorTask;
|
|
768
|
+
}
|
|
769
|
+
/** Scheduled action to run an Actor task. */
|
|
770
|
+
export interface ScheduleActionRunActorTask extends Omit<Schemas['ScheduleActionRunActorTask'], keyof ScheduleActionRunActorTaskRePointed>, ScheduleActionRunActorTaskRePointed {
|
|
771
|
+
}
|
|
772
|
+
/** Union type representing all possible scheduled actions. */
|
|
773
|
+
export type ScheduleAction = ScheduleActionRunActor | ScheduleActionRunActorTask;
|
|
774
|
+
export interface ScheduleRePointed {
|
|
775
|
+
actions: ScheduleAction[];
|
|
776
|
+
}
|
|
777
|
+
export interface ScheduleClientNarrowings {
|
|
778
|
+
timezone: Timezone;
|
|
779
|
+
}
|
|
780
|
+
/**
|
|
781
|
+
* Represents a schedule for automated Actor or Task runs.
|
|
782
|
+
*
|
|
783
|
+
* Schedules use cron expressions to define when Actors or Tasks should run automatically.
|
|
784
|
+
*/
|
|
785
|
+
export interface Schedule extends Omit<Schemas['Schedule'], keyof ScheduleRePointed | keyof ScheduleClientNarrowings>, ScheduleRePointed, ScheduleClientNarrowings {
|
|
786
|
+
}
|
|
787
|
+
type GeneratedProfile = Schemas['Profile'];
|
|
788
|
+
type GeneratedProxyGroup = Schemas['ProxyGroup'];
|
|
789
|
+
type GeneratedEffectivePlatformFeature = Schemas['EffectivePlatformFeature'];
|
|
790
|
+
type GeneratedUsageCycle = Schemas['UsageCycle'];
|
|
791
|
+
type GeneratedPriceTiers = Schemas['PriceTiers'];
|
|
792
|
+
type GeneratedLimits = Schemas['Limits'];
|
|
793
|
+
type GeneratedCurrent = Schemas['Current'];
|
|
794
|
+
/**
|
|
795
|
+
* Platform features a plan can enable.
|
|
796
|
+
*
|
|
797
|
+
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types
|
|
798
|
+
* as a plain `string[]`: the platform has features this list never gained -- `PROXY_RESIDENTIAL`,
|
|
799
|
+
* `ACTORS_PUBLIC_ALL` and `ACTORS_PUBLIC_DEVELOPER` all appear as keys of `EffectivePlatformFeatures`
|
|
800
|
+
* -- so using it there promised a completeness that was not real. It stays published for comparisons.
|
|
801
|
+
*
|
|
802
|
+
* Declared here rather than in `./resource_clients/user` so the user types can live alongside it. It is
|
|
803
|
+
* re-exported from there, so the public name and import path are unchanged.
|
|
804
|
+
*/
|
|
805
|
+
export declare enum PlatformFeature {
|
|
806
|
+
Actors = "ACTORS",
|
|
807
|
+
Storage = "STORAGE",
|
|
808
|
+
ProxySERPS = "PROXY_SERPS",
|
|
809
|
+
Scheduler = "SCHEDULER",
|
|
810
|
+
Webhooks = "WEBHOOKS",
|
|
811
|
+
Proxy = "PROXY",
|
|
812
|
+
ProxyExternalAccess = "PROXY_EXTERNAL_ACCESS"
|
|
813
|
+
}
|
|
814
|
+
/** The public part of a user's profile. */
|
|
815
|
+
export interface UserProfile extends GeneratedProfile {
|
|
816
|
+
}
|
|
817
|
+
export interface UserProxyRePointed {
|
|
818
|
+
groups: ProxyGroup[];
|
|
819
|
+
}
|
|
820
|
+
/** A user's proxy credentials and the groups they may use. */
|
|
821
|
+
export interface UserProxy extends Omit<Schemas['Proxy'], keyof UserProxyRePointed>, UserProxyRePointed {
|
|
822
|
+
}
|
|
823
|
+
/** One proxy group available to a user. */
|
|
824
|
+
export interface ProxyGroup extends GeneratedProxyGroup {
|
|
825
|
+
}
|
|
826
|
+
/** Whether one platform feature is enabled for a user, and why not if it is off. */
|
|
827
|
+
export interface EffectivePlatformFeature extends GeneratedEffectivePlatformFeature {
|
|
828
|
+
}
|
|
829
|
+
export interface EffectivePlatformFeaturesRePointed {
|
|
830
|
+
ACTORS: EffectivePlatformFeature;
|
|
831
|
+
STORAGE: EffectivePlatformFeature;
|
|
832
|
+
SCHEDULER: EffectivePlatformFeature;
|
|
833
|
+
PROXY: EffectivePlatformFeature;
|
|
834
|
+
PROXY_EXTERNAL_ACCESS: EffectivePlatformFeature;
|
|
835
|
+
PROXY_RESIDENTIAL: EffectivePlatformFeature;
|
|
836
|
+
PROXY_SERPS: EffectivePlatformFeature;
|
|
837
|
+
WEBHOOKS: EffectivePlatformFeature;
|
|
838
|
+
ACTORS_PUBLIC_ALL: EffectivePlatformFeature;
|
|
839
|
+
ACTORS_PUBLIC_DEVELOPER: EffectivePlatformFeature;
|
|
840
|
+
}
|
|
841
|
+
/** The effective state of every platform feature for a user. */
|
|
842
|
+
export interface EffectivePlatformFeatures extends Omit<Schemas['EffectivePlatformFeatures'], keyof EffectivePlatformFeaturesRePointed>, EffectivePlatformFeaturesRePointed {
|
|
843
|
+
}
|
|
844
|
+
export interface UserPlanRePointed {
|
|
845
|
+
availableProxyGroups: Record<string, number>;
|
|
846
|
+
}
|
|
847
|
+
/** The subscription plan a user is on, with the quotas it grants. */
|
|
848
|
+
export interface UserPlan extends Omit<Schemas['Plan'], keyof UserPlanRePointed>, UserPlanRePointed {
|
|
849
|
+
}
|
|
850
|
+
export interface UserRePointed {
|
|
851
|
+
profile?: UserProfile;
|
|
852
|
+
proxy?: UserProxy;
|
|
853
|
+
}
|
|
854
|
+
export interface UserSpecNarrowings {
|
|
855
|
+
plan?: UserPlan;
|
|
856
|
+
effectivePlatformFeatures?: EffectivePlatformFeatures;
|
|
857
|
+
isPaying?: boolean;
|
|
858
|
+
}
|
|
859
|
+
/**
|
|
860
|
+
* A user account.
|
|
861
|
+
*
|
|
862
|
+
* The private fields are only populated for `GET /v2/users/me`, which needs a token; the public
|
|
863
|
+
* endpoint returns the username and profile alone.
|
|
864
|
+
*/
|
|
865
|
+
export interface User extends Omit<Schemas['UserPrivateInfo'], keyof UserRePointed | keyof UserSpecNarrowings>, UserRePointed, UserSpecNarrowings {
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* The start and end of a billing cycle.
|
|
869
|
+
* @since Added in 2.9.2
|
|
870
|
+
*/
|
|
871
|
+
export interface UsageCycle extends GeneratedUsageCycle {
|
|
872
|
+
}
|
|
873
|
+
/**
|
|
874
|
+
* The start and end of a monthly billing cycle. The spec reuses its `UsageCycle` schema here.
|
|
875
|
+
* @since Added in 2.9.2
|
|
876
|
+
*/
|
|
877
|
+
export interface MonthlyUsageCycle extends GeneratedUsageCycle {
|
|
878
|
+
}
|
|
879
|
+
/** One tier of a volume-discounted price. The spec names this schema `PriceTiers`. */
|
|
880
|
+
export interface PriceTier extends GeneratedPriceTiers {
|
|
881
|
+
}
|
|
882
|
+
export interface UsageItemRePointed {
|
|
883
|
+
priceTiers?: PriceTier[];
|
|
884
|
+
}
|
|
885
|
+
/** What one service cost over a period, before and after volume discounts. */
|
|
886
|
+
export interface UsageItem extends Omit<Schemas['UsageItem'], keyof UsageItemRePointed>, UsageItemRePointed {
|
|
887
|
+
}
|
|
888
|
+
/**
|
|
889
|
+
* Usage of each service, keyed by service name such as `ACTOR_COMPUTE_UNITS`.
|
|
890
|
+
*
|
|
891
|
+
* The spec names the monthly map `MonthlyServiceUsage` and the per-day one `ServiceUsage`. The two are
|
|
892
|
+
* structurally identical, so the published type stays single.
|
|
893
|
+
*/
|
|
894
|
+
export interface ServiceUsage {
|
|
895
|
+
[service: string]: UsageItem;
|
|
896
|
+
}
|
|
897
|
+
export interface DailyServiceUsageRePointed {
|
|
898
|
+
serviceUsage: ServiceUsage;
|
|
899
|
+
}
|
|
900
|
+
export interface DailyServiceUsageClientConversions {
|
|
901
|
+
date: Date;
|
|
902
|
+
}
|
|
903
|
+
/** A single day's usage within a monthly cycle. The spec names this schema `DailyServiceUsages`. */
|
|
904
|
+
export interface DailyServiceUsage extends Omit<Schemas['DailyServiceUsages'], keyof DailyServiceUsageRePointed | keyof DailyServiceUsageClientConversions>, DailyServiceUsageRePointed, DailyServiceUsageClientConversions {
|
|
905
|
+
}
|
|
906
|
+
export interface MonthlyUsageRePointed {
|
|
907
|
+
usageCycle: UsageCycle;
|
|
908
|
+
monthlyServiceUsage: ServiceUsage;
|
|
909
|
+
dailyServiceUsages: DailyServiceUsage[];
|
|
910
|
+
}
|
|
911
|
+
/**
|
|
912
|
+
* A user's platform usage over the current monthly cycle, broken down by service.
|
|
913
|
+
* @since Added in 2.9.2
|
|
914
|
+
*/
|
|
915
|
+
export interface MonthlyUsage extends Omit<Schemas['MonthlyUsage'], keyof MonthlyUsageRePointed>, MonthlyUsageRePointed {
|
|
916
|
+
}
|
|
917
|
+
/**
|
|
918
|
+
* The quotas a user's plan grants.
|
|
919
|
+
* @since Added in 2.9.2
|
|
920
|
+
*/
|
|
921
|
+
export interface Limits extends GeneratedLimits {
|
|
922
|
+
}
|
|
923
|
+
/**
|
|
924
|
+
* How much of each quota a user has consumed in the current cycle.
|
|
925
|
+
* @since Added in 2.9.2
|
|
926
|
+
*/
|
|
927
|
+
export interface Current extends GeneratedCurrent {
|
|
928
|
+
}
|
|
929
|
+
export interface AccountAndUsageLimitsRePointed {
|
|
930
|
+
monthlyUsageCycle: MonthlyUsageCycle;
|
|
931
|
+
limits: Limits;
|
|
932
|
+
current: Current;
|
|
933
|
+
}
|
|
934
|
+
/**
|
|
935
|
+
* A user's quotas together with their current consumption.
|
|
936
|
+
* @since Added in 2.9.2
|
|
937
|
+
*/
|
|
938
|
+
export interface AccountAndUsageLimits extends Omit<Schemas['AccountLimits'], keyof AccountAndUsageLimitsRePointed>, AccountAndUsageLimitsRePointed {
|
|
939
|
+
}
|
|
940
|
+
type GeneratedRequestQueueStats = Schemas['RequestQueueStats'];
|
|
941
|
+
type GeneratedHeadRequest = Schemas['HeadRequest'];
|
|
942
|
+
type GeneratedLockedHeadRequest = Schemas['LockedHeadRequest'];
|
|
943
|
+
type GeneratedRequestRegistration = Schemas['RequestRegistration'];
|
|
944
|
+
type GeneratedRequestLockInfo = Schemas['RequestLockInfo'];
|
|
945
|
+
type GeneratedUnlockRequestsResult = Schemas['UnlockRequestsResult'];
|
|
946
|
+
type GeneratedBatchAddResult = Schemas['BatchAddResult'];
|
|
947
|
+
type GeneratedBatchDeleteResult = Schemas['BatchDeleteResult'];
|
|
948
|
+
type GeneratedRequest = Schemas['Request'];
|
|
949
|
+
/** HTTP methods supported by Request Queue requests. */
|
|
950
|
+
export type AllowedHttpMethods = Schemas['HttpMethod'];
|
|
951
|
+
/** Statistics about Request Queue usage and storage. */
|
|
952
|
+
export interface RequestQueueStats extends GeneratedRequestQueueStats {
|
|
953
|
+
}
|
|
954
|
+
/**
|
|
955
|
+
* Fields the API returns on a request queue that the OpenAPI spec does not describe yet.
|
|
956
|
+
*
|
|
957
|
+
* The spec does carry `username` and `expireAt` on `RequestQueueShort`, the listing shape, and simply
|
|
958
|
+
* omits both from the full `RequestQueue` schema. `title` is absent from either.
|
|
959
|
+
*
|
|
960
|
+
* TODO: Remove once the spec covers them.
|
|
961
|
+
*/
|
|
962
|
+
export interface RequestQueueSpecGaps {
|
|
963
|
+
title?: string;
|
|
964
|
+
username?: string;
|
|
965
|
+
expireAt?: Date;
|
|
966
|
+
}
|
|
967
|
+
export interface RequestQueueRePointed {
|
|
968
|
+
stats?: RequestQueueStats;
|
|
969
|
+
}
|
|
970
|
+
export interface RequestQueueSpecNarrowings {
|
|
971
|
+
generalAccess?: STORAGE_GENERAL_ACCESS | null;
|
|
972
|
+
consoleUrl?: string;
|
|
973
|
+
}
|
|
974
|
+
/**
|
|
975
|
+
* Represents a Request Queue storage on the Apify platform.
|
|
976
|
+
*
|
|
977
|
+
* Request queues store URLs (requests) to be processed by web crawlers. They provide
|
|
978
|
+
* automatic deduplication, request locking for parallel processing, and persistence.
|
|
979
|
+
*/
|
|
980
|
+
export interface RequestQueue extends Omit<Schemas['RequestQueue'], keyof RequestQueueRePointed | keyof RequestQueueSpecNarrowings>, RequestQueueRePointed, RequestQueueSpecNarrowings, RequestQueueSpecGaps {
|
|
981
|
+
}
|
|
982
|
+
/** Simplified request information used in queue-head results. */
|
|
983
|
+
export interface RequestQueueClientListItem extends GeneratedHeadRequest {
|
|
984
|
+
}
|
|
985
|
+
/** A queue-head request that has been locked for processing, so it also reports its lock expiry. */
|
|
986
|
+
export interface RequestQueueClientLockedListItem extends GeneratedLockedHeadRequest {
|
|
987
|
+
}
|
|
988
|
+
export interface RequestQueueClientListHeadResultRePointed {
|
|
989
|
+
items: RequestQueueClientListItem[];
|
|
990
|
+
}
|
|
991
|
+
/** Result of listing requests from the queue head. */
|
|
992
|
+
export interface RequestQueueClientListHeadResult extends Omit<Schemas['RequestQueueHead'], keyof RequestQueueClientListHeadResultRePointed>, RequestQueueClientListHeadResultRePointed {
|
|
993
|
+
}
|
|
994
|
+
export interface RequestQueueClientListAndLockHeadResultRePointed {
|
|
995
|
+
items: RequestQueueClientLockedListItem[];
|
|
996
|
+
}
|
|
997
|
+
/**
|
|
998
|
+
* Result of listing and locking requests from the queue head.
|
|
999
|
+
*
|
|
1000
|
+
* The spec describes this and {@link RequestQueueClientListHeadResult} as separate schemas that
|
|
1001
|
+
* disagree about which fields are required, and the locked variant carries a different element type,
|
|
1002
|
+
* so both are derived independently.
|
|
1003
|
+
* @since Added in 2.4.1
|
|
1004
|
+
*/
|
|
1005
|
+
export interface RequestQueueClientListAndLockHeadResult extends Omit<Schemas['LockedRequestQueueHead'], keyof RequestQueueClientListAndLockHeadResultRePointed>, RequestQueueClientListAndLockHeadResultRePointed {
|
|
1006
|
+
}
|
|
1007
|
+
/**
|
|
1008
|
+
* Complete schema for a request in the queue.
|
|
1009
|
+
*
|
|
1010
|
+
* Represents a URL to be crawled along with its metadata, retry information, and custom data.
|
|
1011
|
+
*/
|
|
1012
|
+
export interface RequestQueueClientRequestSchema extends GeneratedRequest {
|
|
1013
|
+
}
|
|
1014
|
+
/**
|
|
1015
|
+
* A request as the caller submits it to the queue.
|
|
1016
|
+
*
|
|
1017
|
+
* The API assigns the id, so it is dropped. The unique key and the URL the caller has to supply come
|
|
1018
|
+
* required from {@link RequestQueueClientRequestSchema}.
|
|
1019
|
+
*/
|
|
1020
|
+
export interface RequestQueueClientRequestToAdd extends Omit<RequestQueueClientRequestSchema, 'id'> {
|
|
1021
|
+
}
|
|
1022
|
+
/**
|
|
1023
|
+
* A request as the caller submits it to an update of a stored one.
|
|
1024
|
+
*
|
|
1025
|
+
* The update addresses that request by its id, which a stored request always carries, so the shape is
|
|
1026
|
+
* {@link RequestQueueClientRequestSchema} unchanged. The name stays published as the argument type of
|
|
1027
|
+
* `updateRequest()`.
|
|
1028
|
+
*/
|
|
1029
|
+
export interface RequestQueueClientRequestToUpdate extends RequestQueueClientRequestSchema {
|
|
1030
|
+
}
|
|
1031
|
+
export interface RequestQueueClientListRequestsResultRePointed {
|
|
1032
|
+
items: RequestQueueClientRequestSchema[];
|
|
1033
|
+
}
|
|
1034
|
+
/**
|
|
1035
|
+
* Result of listing all requests in the queue.
|
|
1036
|
+
* @since Added in 2.5.1
|
|
1037
|
+
*/
|
|
1038
|
+
export interface RequestQueueClientListRequestsResult extends Omit<Schemas['ListOfRequests'], keyof RequestQueueClientListRequestsResultRePointed>, RequestQueueClientListRequestsResultRePointed {
|
|
1039
|
+
}
|
|
1040
|
+
/** Result of adding a request to the queue. */
|
|
1041
|
+
export interface RequestQueueClientAddRequestResult extends GeneratedRequestRegistration {
|
|
1042
|
+
}
|
|
1043
|
+
/**
|
|
1044
|
+
* Result of prolonging a request lock.
|
|
1045
|
+
* @since Added in 2.4.1
|
|
1046
|
+
*/
|
|
1047
|
+
export interface RequestQueueClientProlongRequestLockResult extends GeneratedRequestLockInfo {
|
|
1048
|
+
}
|
|
1049
|
+
/**
|
|
1050
|
+
* Result of unlocking requests in the queue.
|
|
1051
|
+
* @since Added in 2.12.5
|
|
1052
|
+
*/
|
|
1053
|
+
export interface RequestQueueClientUnlockRequestsResult extends GeneratedUnlockRequestsResult {
|
|
1054
|
+
}
|
|
1055
|
+
/**
|
|
1056
|
+
* Result of a batch add operation on requests.
|
|
1057
|
+
*
|
|
1058
|
+
* Contains lists of successfully processed and unprocessed requests.
|
|
1059
|
+
* @since Added in 2.3.0
|
|
1060
|
+
*/
|
|
1061
|
+
export interface RequestQueueClientBatchRequestsOperationResult extends GeneratedBatchAddResult {
|
|
1062
|
+
}
|
|
1063
|
+
/**
|
|
1064
|
+
* Result of a batch delete operation on requests.
|
|
1065
|
+
*
|
|
1066
|
+
* A deletion is confirmed by whichever of the two ids addressed it, so a processed entry carries `id`
|
|
1067
|
+
* and `uniqueKey` rather than the `requestId`, `wasAlreadyPresent` and `wasAlreadyHandled` that a batch
|
|
1068
|
+
* add reports.
|
|
1069
|
+
*/
|
|
1070
|
+
export interface RequestQueueClientBatchDeleteRequestsResult extends GeneratedBatchDeleteResult {
|
|
1071
|
+
}
|
|
1072
|
+
export {};
|