apify-client 3.0.0-beta.70 → 3.0.0-beta.72

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/schemas.d.ts CHANGED
@@ -1,9 +1,9 @@
1
1
  /**
2
2
  * The schemas the resource clients validate API responses with.
3
3
  *
4
- * Today these are exactly the generated ones. The module still exists as the one place where a generated
5
- * schema is widened when the API is known to return something the specification does not describe, so a
6
- * documented deviation never sends a resource client reaching into `./generated` directly. An override
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
- * Today these are exactly the generated ones. The module still exists as the one place where a generated
5
- * schema is widened when the API is known to return something the specification does not describe, so a
6
- * documented deviation never sends a resource client reaching into `./generated` directly. An override
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() }));
package/dist/utils.d.ts CHANGED
@@ -101,6 +101,11 @@ export declare function splitIntoJsonArrayBatches<T extends {
101
101
  maxByteLength: number;
102
102
  }): T[][];
103
103
  export declare function isBuffer(value: unknown): value is Buffer | ArrayBuffer | TypedArray;
104
+ /**
105
+ * Whether a value is a `Blob`, a `File` included. Unlike a stream, a blob can be read again for every attempt of a
106
+ * request, so a request with a blob body can be retried.
107
+ */
108
+ export declare function isBlob(value: unknown): value is Blob;
104
109
  export declare function isStream(value: unknown): value is Readable;
105
110
  /**
106
111
  * Helper class to create async iterators from paginated list endpoints.
package/dist/utils.js CHANGED
@@ -236,6 +236,13 @@ export function isBuffer(value) {
236
236
  return !isTagged(value, 'DataView');
237
237
  return isTagged(value, 'ArrayBuffer');
238
238
  }
239
+ /**
240
+ * Whether a value is a `Blob`, a `File` included. Unlike a stream, a blob can be read again for every attempt of a
241
+ * request, so a request with a blob body can be retried.
242
+ */
243
+ export function isBlob(value) {
244
+ return isTagged(value, 'Blob') || isTagged(value, 'File');
245
+ }
239
246
  function isTagged(value, tag) {
240
247
  return Object.prototype.toString.call(value) === `[object ${tag}]`;
241
248
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "apify-client",
3
- "version": "3.0.0-beta.70",
3
+ "version": "3.0.0-beta.72",
4
4
  "description": "Apify API client for JavaScript",
5
5
  "engines": {
6
6
  "node": ">=22.13.0"