apify-client 3.0.0-beta.70 → 3.0.0-beta.71
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 +4 -4
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +125 -74
- package/dist/generated/schemas.d.ts +124 -79
- package/dist/generated/schemas.js +51 -30
- package/dist/models.d.ts +5 -0
- package/dist/schemas.d.ts +200 -3
- package/dist/schemas.js +18 -3
- package/package.json +1 -1
|
@@ -57,10 +57,13 @@ export const ErrorDetail = lazySchema(() => z.looseObject({
|
|
|
57
57
|
export const ErrorResponse = lazySchema(() => z.looseObject({
|
|
58
58
|
error: ErrorDetail(),
|
|
59
59
|
}));
|
|
60
|
-
|
|
61
|
-
export const
|
|
60
|
+
/** Determines the permission level that the Actor requires to run. For details, see [Actor permissions](https://docs.apify.com/platform/actors/development/permissions). */
|
|
61
|
+
export const ActorPermissionLevel = lazySchema(() => z.enum(["LIMITED_PERMISSIONS", "FULL_PERMISSIONS"]).or(z.string()));
|
|
62
|
+
/** The version source types accepted in request bodies. Same as `VersionSourceType`, without `SOURCE_CODE`. */
|
|
63
|
+
export const WritableVersionSourceType = lazySchema(() => z.enum(["SOURCE_FILES", "GIT_REPO", "TARBALL", "GITHUB_GIST"]).or(z.string()));
|
|
64
|
+
export const EnvVarRequest = lazySchema(() => z.looseObject({
|
|
62
65
|
name: z.string(),
|
|
63
|
-
value: z.string()
|
|
66
|
+
value: z.string(),
|
|
64
67
|
isSecret: z.boolean().nullable().optional(),
|
|
65
68
|
}));
|
|
66
69
|
export const SourceCodeFileFormat = lazySchema(() => z.enum(["BASE64", "TEXT"]).or(z.string()));
|
|
@@ -79,19 +82,17 @@ export const SourceCodeFolder = lazySchema(() => z.looseObject({
|
|
|
79
82
|
folder: z.boolean(),
|
|
80
83
|
}));
|
|
81
84
|
export const VersionSourceFiles = lazySchema(() => z.array(z.union([SourceCodeFile(), SourceCodeFolder()])));
|
|
82
|
-
export const
|
|
85
|
+
export const CreateVersionRequest = lazySchema(() => z.looseObject({
|
|
83
86
|
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),
|
|
84
|
-
sourceType:
|
|
85
|
-
envVars: z.array(
|
|
87
|
+
sourceType: WritableVersionSourceType(),
|
|
88
|
+
envVars: z.array(EnvVarRequest()).optional(),
|
|
86
89
|
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
87
90
|
buildTag: z.string().nullable().optional(),
|
|
88
91
|
sourceFiles: VersionSourceFiles().optional(),
|
|
89
|
-
gitRepoUrl: z.string().
|
|
90
|
-
tarballUrl: z.string().
|
|
91
|
-
gitHubGistUrl: z.string().
|
|
92
|
+
gitRepoUrl: z.string().optional(),
|
|
93
|
+
tarballUrl: z.string().optional(),
|
|
94
|
+
gitHubGistUrl: z.string().optional(),
|
|
92
95
|
}));
|
|
93
|
-
/** Determines the permission level that the Actor requires to run. For details, see [Actor permissions](https://docs.apify.com/platform/actors/development/permissions). */
|
|
94
|
-
export const ActorPermissionLevel = lazySchema(() => z.enum(["LIMITED_PERMISSIONS", "FULL_PERMISSIONS"]).or(z.string()));
|
|
95
96
|
/** The default settings applied to an Actor run. Can be overridden elsewhere. */
|
|
96
97
|
export const DefaultRunOptions = lazySchema(() => z.looseObject({
|
|
97
98
|
build: z.string().optional(),
|
|
@@ -119,17 +120,35 @@ export const CreateActorRequest = lazySchema(() => z.looseObject({
|
|
|
119
120
|
name: z.string().nullable().optional(),
|
|
120
121
|
description: z.string().nullable().optional(),
|
|
121
122
|
title: z.string().nullable().optional(),
|
|
122
|
-
isPublic: z.boolean().
|
|
123
|
+
isPublic: z.boolean().optional(),
|
|
124
|
+
actorPermissionLevel: ActorPermissionLevel().optional(),
|
|
123
125
|
seoTitle: z.string().nullable().optional(),
|
|
124
126
|
seoDescription: z.string().nullable().optional(),
|
|
125
127
|
restartOnError: z.boolean().optional(),
|
|
126
|
-
versions: z.array(
|
|
128
|
+
versions: z.array(CreateVersionRequest()).min(1).optional(),
|
|
127
129
|
categories: z.array(z.string()).nullable().optional(),
|
|
128
130
|
defaultRunOptions: DefaultRunOptions().optional(),
|
|
129
131
|
actorStandby: ActorStandby().nullable().optional(),
|
|
130
132
|
exampleRunInput: ExampleRunInput().nullable().optional(),
|
|
131
133
|
isDeprecated: z.boolean().nullable().optional(),
|
|
132
134
|
}));
|
|
135
|
+
export const VersionSourceType = lazySchema(() => z.enum(["SOURCE_FILES", "GIT_REPO", "TARBALL", "GITHUB_GIST", "SOURCE_CODE"]).or(z.string()));
|
|
136
|
+
export const EnvVar = lazySchema(() => z.looseObject({
|
|
137
|
+
name: z.string(),
|
|
138
|
+
value: z.string().optional(),
|
|
139
|
+
isSecret: z.boolean().nullable().optional(),
|
|
140
|
+
}));
|
|
141
|
+
export const Version = lazySchema(() => z.looseObject({
|
|
142
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/),
|
|
143
|
+
sourceType: VersionSourceType().nullable(),
|
|
144
|
+
envVars: z.array(EnvVar()).nullable().optional(),
|
|
145
|
+
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
146
|
+
buildTag: z.string().nullable().optional(),
|
|
147
|
+
sourceFiles: VersionSourceFiles().optional(),
|
|
148
|
+
gitRepoUrl: z.string().nullable().optional(),
|
|
149
|
+
tarballUrl: z.string().nullable().optional(),
|
|
150
|
+
gitHubGistUrl: z.string().nullable().optional(),
|
|
151
|
+
}));
|
|
133
152
|
export const CommonActorPricingInfo = lazySchema(() => z.looseObject({
|
|
134
153
|
apifyMarginPercentage: z.number(),
|
|
135
154
|
createdAt: z.iso.datetime({ offset: true }).pipe(z.coerce.date()),
|
|
@@ -240,17 +259,6 @@ export const ActorResource = lazySchema(() => z.looseObject({
|
|
|
240
259
|
export const ActorResponse = lazySchema(() => z.looseObject({
|
|
241
260
|
data: ActorResource(),
|
|
242
261
|
}));
|
|
243
|
-
export const CreateOrUpdateVersionRequest = lazySchema(() => z.looseObject({
|
|
244
|
-
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).nullable().optional(),
|
|
245
|
-
sourceType: VersionSourceType().nullable().optional(),
|
|
246
|
-
envVars: z.array(EnvVar()).nullable().optional(),
|
|
247
|
-
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
248
|
-
buildTag: z.string().nullable().optional(),
|
|
249
|
-
sourceFiles: VersionSourceFiles().optional(),
|
|
250
|
-
gitRepoUrl: z.string().nullable().optional(),
|
|
251
|
-
tarballUrl: z.string().nullable().optional(),
|
|
252
|
-
gitHubGistUrl: z.string().nullable().optional(),
|
|
253
|
-
}));
|
|
254
262
|
/** The name of the build tag. */
|
|
255
263
|
export const UpdatedBuildProperty = lazySchema(() => z.looseObject({
|
|
256
264
|
buildId: z.string(),
|
|
@@ -259,12 +267,12 @@ export const UpdateActorRequest = lazySchema(() => z.looseObject({
|
|
|
259
267
|
name: z.string().optional(),
|
|
260
268
|
description: z.string().nullable().optional(),
|
|
261
269
|
isPublic: z.boolean().optional(),
|
|
262
|
-
actorPermissionLevel: ActorPermissionLevel().
|
|
270
|
+
actorPermissionLevel: ActorPermissionLevel().optional(),
|
|
263
271
|
seoTitle: z.string().nullable().optional(),
|
|
264
272
|
seoDescription: z.string().nullable().optional(),
|
|
265
273
|
title: z.string().nullable().optional(),
|
|
266
274
|
restartOnError: z.boolean().optional(),
|
|
267
|
-
versions: z.array(
|
|
275
|
+
versions: z.array(CreateVersionRequest()).min(1).optional(),
|
|
268
276
|
pricingInfos: z.array(ActorRunPricingInfo()).optional(),
|
|
269
277
|
categories: z.array(z.string()).nullable().optional(),
|
|
270
278
|
defaultRunOptions: DefaultRunOptions().nullable().optional(),
|
|
@@ -283,6 +291,17 @@ export const ListOfVersionsResponse = lazySchema(() => z.looseObject({
|
|
|
283
291
|
export const VersionResponse = lazySchema(() => z.looseObject({
|
|
284
292
|
data: Version(),
|
|
285
293
|
}));
|
|
294
|
+
export const UpdateVersionRequest = lazySchema(() => z.looseObject({
|
|
295
|
+
versionNumber: z.string().regex(/^([0-9]|[1-9][0-9])\.([0-9]|[1-9][0-9])$/).optional(),
|
|
296
|
+
sourceType: WritableVersionSourceType().optional(),
|
|
297
|
+
envVars: z.array(EnvVarRequest()).optional(),
|
|
298
|
+
applyEnvVarsToBuild: z.boolean().nullable().optional(),
|
|
299
|
+
buildTag: z.string().nullable().optional(),
|
|
300
|
+
sourceFiles: VersionSourceFiles().optional(),
|
|
301
|
+
gitRepoUrl: z.string().optional(),
|
|
302
|
+
tarballUrl: z.string().optional(),
|
|
303
|
+
gitHubGistUrl: z.string().optional(),
|
|
304
|
+
}));
|
|
286
305
|
export const ListOfEnvVars = lazySchema(() => z.looseObject({
|
|
287
306
|
total: z.int(),
|
|
288
307
|
items: z.array(EnvVar()),
|
|
@@ -290,7 +309,6 @@ export const ListOfEnvVars = lazySchema(() => z.looseObject({
|
|
|
290
309
|
export const ListOfEnvVarsResponse = lazySchema(() => z.looseObject({
|
|
291
310
|
data: ListOfEnvVars(),
|
|
292
311
|
}));
|
|
293
|
-
export const EnvVarRequest = lazySchema(() => EnvVar().required({ value: true }));
|
|
294
312
|
export const EnvVarResponse = lazySchema(() => z.looseObject({
|
|
295
313
|
data: EnvVar(),
|
|
296
314
|
}));
|
|
@@ -1228,6 +1246,10 @@ export const ListOfSchedules = lazySchema(() => PaginationResponse().extend({
|
|
|
1228
1246
|
export const ListOfSchedulesResponse = lazySchema(() => z.looseObject({
|
|
1229
1247
|
data: ListOfSchedules(),
|
|
1230
1248
|
}));
|
|
1249
|
+
/** Notification settings for this schedule. */
|
|
1250
|
+
export const ScheduleNotifications = lazySchema(() => z.looseObject({
|
|
1251
|
+
email: z.boolean().optional(),
|
|
1252
|
+
}));
|
|
1231
1253
|
export const ScheduleActionRunInput = lazySchema(() => z.looseObject({
|
|
1232
1254
|
body: z.string().nullable().optional(),
|
|
1233
1255
|
contentType: z.string().nullable().optional(),
|
|
@@ -1252,6 +1274,7 @@ export const CreateOrUpdateScheduleRequest = lazySchema(() => z.looseObject({
|
|
|
1252
1274
|
timezone: z.string().nullable().optional(),
|
|
1253
1275
|
description: z.string().nullable().optional(),
|
|
1254
1276
|
title: z.string().nullable().optional(),
|
|
1277
|
+
notifications: ScheduleNotifications().optional(),
|
|
1255
1278
|
actions: z.array(ScheduleCreateAction()).nullable().optional(),
|
|
1256
1279
|
}));
|
|
1257
1280
|
export const ScheduleActionRunActor = lazySchema(() => z.looseObject({
|
|
@@ -1271,9 +1294,7 @@ export const ScheduleAction = lazySchema(() => z.discriminatedUnion("type", [Sch
|
|
|
1271
1294
|
export const Schedule = lazySchema(() => ScheduleBase().extend({
|
|
1272
1295
|
description: z.string().nullable().optional(),
|
|
1273
1296
|
title: z.string().nullable().optional(),
|
|
1274
|
-
notifications:
|
|
1275
|
-
email: z.boolean().optional(),
|
|
1276
|
-
}).optional(),
|
|
1297
|
+
notifications: ScheduleNotifications().optional(),
|
|
1277
1298
|
actions: z.array(ScheduleAction()),
|
|
1278
1299
|
}));
|
|
1279
1300
|
export const ScheduleResponse = lazySchema(() => z.looseObject({
|
package/dist/models.d.ts
CHANGED
|
@@ -437,6 +437,7 @@ export interface ActorListItem extends Omit<Schemas['ActorListItem'], keyof Acto
|
|
|
437
437
|
type GeneratedBuildUsage = Schemas['BuildUsage'];
|
|
438
438
|
type GeneratedBuildStats = Schemas['BuildStats'];
|
|
439
439
|
type GeneratedBuildOptions = Schemas['BuildOptions'];
|
|
440
|
+
type GeneratedBuildActVersion = NonNullable<Schemas['Build']['actVersion']>;
|
|
440
441
|
/**
|
|
441
442
|
* Resource usage for an Actor build.
|
|
442
443
|
* @since Added in 2.7.2
|
|
@@ -463,6 +464,10 @@ export interface BuildRePointed {
|
|
|
463
464
|
usageUsd?: BuildUsage | null;
|
|
464
465
|
actorDefinition?: ActorDefinition | null;
|
|
465
466
|
status: ValueOf<typeof ACTOR_JOB_STATUSES>;
|
|
467
|
+
/** The API returns `buildTag` as `null` for some builds, which the specification types as a string. */
|
|
468
|
+
actVersion?: Omit<GeneratedBuildActVersion, 'buildTag'> & {
|
|
469
|
+
buildTag?: string | null;
|
|
470
|
+
};
|
|
466
471
|
}
|
|
467
472
|
/**
|
|
468
473
|
* Represents an Actor build.
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The schemas the resource clients validate API responses with.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Most of these are the generated ones. This module is the one place where a generated schema is widened
|
|
5
|
+
* when the API is known to return something the specification does not describe, so a documented deviation
|
|
6
|
+
* never sends a resource client reaching into `./generated` directly. An override
|
|
7
7
|
* declared here shadows the generated export of the same name and takes the same form, a `lazySchema()` thunk
|
|
8
8
|
* built on the generated schema it replaces. Every schema that embeds an overridden one has to be rebuilt on
|
|
9
9
|
* top of it, and `spec_guards.ts` checks that each override still produces what the specification describes,
|
|
@@ -12,4 +12,201 @@
|
|
|
12
12
|
* Spec gaps need no override: the generated objects are loose, so a field the specification omits passes
|
|
13
13
|
* through. Neither do client narrowings: a schema only ever accepts more than the published type.
|
|
14
14
|
*/
|
|
15
|
+
import { z } from 'zod';
|
|
15
16
|
export * from './generated/schemas.js';
|
|
17
|
+
/** The API returns `actVersion.buildTag` as `null` for some builds, which the specification types as a string. */
|
|
18
|
+
export declare const Build: () => z.ZodObject<{
|
|
19
|
+
id: z.ZodString;
|
|
20
|
+
actId: z.ZodString;
|
|
21
|
+
userId: z.ZodString;
|
|
22
|
+
startedAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
23
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
24
|
+
status: z.ZodUnion<[z.ZodEnum<{
|
|
25
|
+
ABORTED: "ABORTED";
|
|
26
|
+
ABORTING: "ABORTING";
|
|
27
|
+
FAILED: "FAILED";
|
|
28
|
+
READY: "READY";
|
|
29
|
+
RUNNING: "RUNNING";
|
|
30
|
+
SUCCEEDED: "SUCCEEDED";
|
|
31
|
+
"TIMED-OUT": "TIMED-OUT";
|
|
32
|
+
"TIMING-OUT": "TIMING-OUT";
|
|
33
|
+
}>, z.ZodString]>;
|
|
34
|
+
meta: z.ZodObject<{
|
|
35
|
+
origin: z.ZodUnion<[z.ZodEnum<{
|
|
36
|
+
ACTOR: "ACTOR";
|
|
37
|
+
API: "API";
|
|
38
|
+
CI: "CI";
|
|
39
|
+
CLI: "CLI";
|
|
40
|
+
DEVELOPMENT: "DEVELOPMENT";
|
|
41
|
+
MCP: "MCP";
|
|
42
|
+
SCHEDULER: "SCHEDULER";
|
|
43
|
+
STANDBY: "STANDBY";
|
|
44
|
+
TEST: "TEST";
|
|
45
|
+
WEB: "WEB";
|
|
46
|
+
WEBHOOK: "WEBHOOK";
|
|
47
|
+
}>, z.ZodString]>;
|
|
48
|
+
clientIp: z.ZodOptional<z.ZodString>;
|
|
49
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
50
|
+
}, z.core.$loose>;
|
|
51
|
+
stats: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
52
|
+
durationMillis: z.ZodOptional<z.ZodInt>;
|
|
53
|
+
runTimeSecs: z.ZodOptional<z.ZodNumber>;
|
|
54
|
+
computeUnits: z.ZodOptional<z.ZodNumber>;
|
|
55
|
+
imageSizeBytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
56
|
+
}, z.core.$loose>>>;
|
|
57
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
58
|
+
useCache: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
59
|
+
betaPackages: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
60
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
61
|
+
diskMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
62
|
+
}, z.core.$loose>>>;
|
|
63
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
64
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
65
|
+
}, z.core.$loose>>>;
|
|
66
|
+
usageTotalUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
67
|
+
usageUsd: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
68
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
69
|
+
}, z.core.$loose>>>;
|
|
70
|
+
inputSchema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
71
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
buildNumber: z.ZodString;
|
|
73
|
+
imageDigest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
74
|
+
actorDefinition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
75
|
+
actorSpecification: z.ZodOptional<z.ZodLiteral<1>>;
|
|
76
|
+
name: z.ZodOptional<z.ZodString>;
|
|
77
|
+
version: z.ZodOptional<z.ZodString>;
|
|
78
|
+
buildTag: z.ZodOptional<z.ZodString>;
|
|
79
|
+
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
80
|
+
dockerfile: z.ZodOptional<z.ZodString>;
|
|
81
|
+
dockerContextDir: z.ZodOptional<z.ZodString>;
|
|
82
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
83
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
84
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
85
|
+
storages: z.ZodOptional<z.ZodObject<{
|
|
86
|
+
dataset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
87
|
+
}, z.core.$loose>>;
|
|
88
|
+
defaultMemoryMbytes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
89
|
+
minMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
90
|
+
maxMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
91
|
+
usesStandbyMode: z.ZodOptional<z.ZodBoolean>;
|
|
92
|
+
}, z.core.$loose>>>;
|
|
93
|
+
actVersion: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
sourceType: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
95
|
+
GITHUB_GIST: "GITHUB_GIST";
|
|
96
|
+
GIT_REPO: "GIT_REPO";
|
|
97
|
+
SOURCE_CODE: "SOURCE_CODE";
|
|
98
|
+
SOURCE_FILES: "SOURCE_FILES";
|
|
99
|
+
TARBALL: "TARBALL";
|
|
100
|
+
}>, z.ZodString]>>;
|
|
101
|
+
versionNumber: z.ZodOptional<z.ZodString>;
|
|
102
|
+
gitRepoUrl: z.ZodOptional<z.ZodString>;
|
|
103
|
+
sourceFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
104
|
+
format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
105
|
+
BASE64: "BASE64";
|
|
106
|
+
TEXT: "TEXT";
|
|
107
|
+
}>, z.ZodString]>>;
|
|
108
|
+
content: z.ZodOptional<z.ZodString>;
|
|
109
|
+
name: z.ZodString;
|
|
110
|
+
}, z.core.$loose>>>;
|
|
111
|
+
buildTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
112
|
+
}, z.core.$loose>>;
|
|
113
|
+
}, z.core.$loose>;
|
|
114
|
+
/** Response containing Actor build data. */
|
|
115
|
+
export declare const BuildResponse: () => z.ZodObject<{
|
|
116
|
+
data: z.ZodObject<{
|
|
117
|
+
id: z.ZodString;
|
|
118
|
+
actId: z.ZodString;
|
|
119
|
+
userId: z.ZodString;
|
|
120
|
+
startedAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
121
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
122
|
+
status: z.ZodUnion<[z.ZodEnum<{
|
|
123
|
+
ABORTED: "ABORTED";
|
|
124
|
+
ABORTING: "ABORTING";
|
|
125
|
+
FAILED: "FAILED";
|
|
126
|
+
READY: "READY";
|
|
127
|
+
RUNNING: "RUNNING";
|
|
128
|
+
SUCCEEDED: "SUCCEEDED";
|
|
129
|
+
"TIMED-OUT": "TIMED-OUT";
|
|
130
|
+
"TIMING-OUT": "TIMING-OUT";
|
|
131
|
+
}>, z.ZodString]>;
|
|
132
|
+
meta: z.ZodObject<{
|
|
133
|
+
origin: z.ZodUnion<[z.ZodEnum<{
|
|
134
|
+
ACTOR: "ACTOR";
|
|
135
|
+
API: "API";
|
|
136
|
+
CI: "CI";
|
|
137
|
+
CLI: "CLI";
|
|
138
|
+
DEVELOPMENT: "DEVELOPMENT";
|
|
139
|
+
MCP: "MCP";
|
|
140
|
+
SCHEDULER: "SCHEDULER";
|
|
141
|
+
STANDBY: "STANDBY";
|
|
142
|
+
TEST: "TEST";
|
|
143
|
+
WEB: "WEB";
|
|
144
|
+
WEBHOOK: "WEBHOOK";
|
|
145
|
+
}>, z.ZodString]>;
|
|
146
|
+
clientIp: z.ZodOptional<z.ZodString>;
|
|
147
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
148
|
+
}, z.core.$loose>;
|
|
149
|
+
stats: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
150
|
+
durationMillis: z.ZodOptional<z.ZodInt>;
|
|
151
|
+
runTimeSecs: z.ZodOptional<z.ZodNumber>;
|
|
152
|
+
computeUnits: z.ZodOptional<z.ZodNumber>;
|
|
153
|
+
imageSizeBytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
154
|
+
}, z.core.$loose>>>;
|
|
155
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
156
|
+
useCache: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
157
|
+
betaPackages: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
158
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
159
|
+
diskMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
160
|
+
}, z.core.$loose>>>;
|
|
161
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
162
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
163
|
+
}, z.core.$loose>>>;
|
|
164
|
+
usageTotalUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
165
|
+
usageUsd: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
166
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
167
|
+
}, z.core.$loose>>>;
|
|
168
|
+
inputSchema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
169
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
170
|
+
buildNumber: z.ZodString;
|
|
171
|
+
imageDigest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
172
|
+
actorDefinition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
173
|
+
actorSpecification: z.ZodOptional<z.ZodLiteral<1>>;
|
|
174
|
+
name: z.ZodOptional<z.ZodString>;
|
|
175
|
+
version: z.ZodOptional<z.ZodString>;
|
|
176
|
+
buildTag: z.ZodOptional<z.ZodString>;
|
|
177
|
+
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
178
|
+
dockerfile: z.ZodOptional<z.ZodString>;
|
|
179
|
+
dockerContextDir: z.ZodOptional<z.ZodString>;
|
|
180
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
181
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
182
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
183
|
+
storages: z.ZodOptional<z.ZodObject<{
|
|
184
|
+
dataset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
185
|
+
}, z.core.$loose>>;
|
|
186
|
+
defaultMemoryMbytes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
187
|
+
minMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
188
|
+
maxMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
189
|
+
usesStandbyMode: z.ZodOptional<z.ZodBoolean>;
|
|
190
|
+
}, z.core.$loose>>>;
|
|
191
|
+
actVersion: z.ZodOptional<z.ZodObject<{
|
|
192
|
+
sourceType: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
193
|
+
GITHUB_GIST: "GITHUB_GIST";
|
|
194
|
+
GIT_REPO: "GIT_REPO";
|
|
195
|
+
SOURCE_CODE: "SOURCE_CODE";
|
|
196
|
+
SOURCE_FILES: "SOURCE_FILES";
|
|
197
|
+
TARBALL: "TARBALL";
|
|
198
|
+
}>, z.ZodString]>>;
|
|
199
|
+
versionNumber: z.ZodOptional<z.ZodString>;
|
|
200
|
+
gitRepoUrl: z.ZodOptional<z.ZodString>;
|
|
201
|
+
sourceFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
202
|
+
format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
203
|
+
BASE64: "BASE64";
|
|
204
|
+
TEXT: "TEXT";
|
|
205
|
+
}>, z.ZodString]>>;
|
|
206
|
+
content: z.ZodOptional<z.ZodString>;
|
|
207
|
+
name: z.ZodString;
|
|
208
|
+
}, z.core.$loose>>>;
|
|
209
|
+
buildTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
|
+
}, z.core.$loose>>;
|
|
211
|
+
}, z.core.$loose>;
|
|
212
|
+
}, z.core.$loose>;
|
package/dist/schemas.js
CHANGED
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* The schemas the resource clients validate API responses with.
|
|
3
3
|
*
|
|
4
|
-
*
|
|
5
|
-
*
|
|
6
|
-
*
|
|
4
|
+
* Most of these are the generated ones. This module is the one place where a generated schema is widened
|
|
5
|
+
* when the API is known to return something the specification does not describe, so a documented deviation
|
|
6
|
+
* never sends a resource client reaching into `./generated` directly. An override
|
|
7
7
|
* declared here shadows the generated export of the same name and takes the same form, a `lazySchema()` thunk
|
|
8
8
|
* built on the generated schema it replaces. Every schema that embeds an overridden one has to be rebuilt on
|
|
9
9
|
* top of it, and `spec_guards.ts` checks that each override still produces what the specification describes,
|
|
@@ -12,4 +12,19 @@
|
|
|
12
12
|
* Spec gaps need no override: the generated objects are loose, so a field the specification omits passes
|
|
13
13
|
* through. Neither do client narrowings: a schema only ever accepts more than the published type.
|
|
14
14
|
*/
|
|
15
|
+
import { z } from 'zod';
|
|
16
|
+
import * as generated from './generated/schemas.js';
|
|
17
|
+
import { lazySchema } from './lazy_schema.js';
|
|
15
18
|
export * from './generated/schemas.js';
|
|
19
|
+
/** The API returns `actVersion.buildTag` as `null` for some builds, which the specification types as a string. */
|
|
20
|
+
export const Build = lazySchema(() => {
|
|
21
|
+
const generatedBuild = generated.Build();
|
|
22
|
+
return generatedBuild.extend({
|
|
23
|
+
actVersion: generatedBuild.shape.actVersion
|
|
24
|
+
.unwrap()
|
|
25
|
+
.extend({ buildTag: z.string().nullable().optional() })
|
|
26
|
+
.optional(),
|
|
27
|
+
});
|
|
28
|
+
});
|
|
29
|
+
/** Response containing Actor build data. */
|
|
30
|
+
export const BuildResponse = lazySchema(() => generated.BuildResponse().extend({ data: Build() }));
|