apify-client 3.0.0-beta.11 → 3.0.0-beta.110
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +16 -2
- package/dist/apify_api_error.d.ts +13 -27
- package/dist/apify_api_error.js +33 -23
- package/dist/apify_client.d.ts +125 -10
- package/dist/apify_client.js +133 -48
- package/dist/apify_client_error.d.ts +10 -0
- package/dist/apify_client_error.js +10 -0
- package/dist/base/api_client.d.ts +7 -7
- package/dist/base/api_client.js +36 -36
- package/dist/base/resource_client.d.ts +13 -8
- package/dist/base/resource_client.js +60 -34
- package/dist/base/resource_collection_client.d.ts +12 -4
- package/dist/base/resource_collection_client.js +34 -11
- package/dist/body_parser.d.ts +3 -4
- package/dist/body_parser.js +19 -26
- package/dist/bundle.js +27 -22
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +3109 -987
- package/dist/generated/schemas.d.ts +2563 -957
- package/dist/generated/schemas.js +585 -229
- package/dist/http_clients/axios.d.ts +63 -0
- package/dist/http_clients/axios.js +129 -0
- package/dist/http_clients/base.d.ts +397 -0
- package/dist/http_clients/base.js +656 -0
- package/dist/http_clients/index.d.ts +4 -0
- package/dist/http_clients/index.js +2 -0
- package/dist/http_compressors/base.d.ts +40 -0
- package/dist/http_compressors/base.js +9 -0
- package/dist/http_compressors/brotli.d.ts +33 -0
- package/dist/http_compressors/brotli.js +39 -0
- package/dist/http_compressors/gzip.d.ts +33 -0
- package/dist/http_compressors/gzip.js +39 -0
- package/dist/http_compressors/index.d.ts +8 -0
- package/dist/http_compressors/index.js +3 -0
- package/dist/http_compressors/resolve.d.ts +24 -0
- package/dist/http_compressors/resolve.js +30 -0
- package/dist/http_compressors/zstd.d.ts +34 -0
- package/dist/http_compressors/zstd.js +43 -0
- package/dist/index.d.ts +6 -1
- package/dist/index.js +5 -1
- package/dist/invalid_response_body_error.d.ts +14 -0
- package/dist/invalid_response_body_error.js +18 -0
- package/dist/models.d.ts +177 -240
- package/dist/models.js +6 -4
- package/dist/resource_clients/actor.d.ts +104 -34
- package/dist/resource_clients/actor.js +129 -55
- package/dist/resource_clients/actor_collection.d.ts +15 -11
- package/dist/resource_clients/actor_collection.js +9 -3
- package/dist/resource_clients/actor_env_var.d.ts +11 -4
- package/dist/resource_clients/actor_env_var.js +16 -6
- package/dist/resource_clients/actor_env_var_collection.d.ts +9 -4
- package/dist/resource_clients/actor_env_var_collection.js +11 -4
- package/dist/resource_clients/actor_server.d.ts +150 -0
- package/dist/resource_clients/actor_server.js +199 -0
- package/dist/resource_clients/actor_version.d.ts +18 -6
- package/dist/resource_clients/actor_version.js +18 -8
- package/dist/resource_clients/actor_version_collection.d.ts +9 -4
- package/dist/resource_clients/actor_version_collection.js +11 -4
- package/dist/resource_clients/build.d.ts +18 -7
- package/dist/resource_clients/build.js +33 -15
- package/dist/resource_clients/build_collection.d.ts +7 -5
- package/dist/resource_clients/build_collection.js +4 -1
- package/dist/resource_clients/dataset.d.ts +83 -36
- package/dist/resource_clients/dataset.js +103 -109
- package/dist/resource_clients/dataset_collection.d.ts +10 -6
- package/dist/resource_clients/dataset_collection.js +13 -2
- package/dist/resource_clients/key_value_store.d.ts +101 -27
- package/dist/resource_clients/key_value_store.js +132 -50
- package/dist/resource_clients/key_value_store_collection.d.ts +10 -6
- package/dist/resource_clients/key_value_store_collection.js +13 -2
- package/dist/resource_clients/log.d.ts +38 -21
- package/dist/resource_clients/log.js +139 -63
- package/dist/resource_clients/request_queue.d.ts +77 -31
- package/dist/resource_clients/request_queue.js +178 -93
- package/dist/resource_clients/request_queue_collection.d.ts +9 -5
- package/dist/resource_clients/request_queue_collection.js +9 -3
- package/dist/resource_clients/run.d.ts +124 -30
- package/dist/resource_clients/run.js +188 -51
- package/dist/resource_clients/run_collection.d.ts +5 -3
- package/dist/resource_clients/run_collection.js +4 -1
- package/dist/resource_clients/schedule.d.ts +15 -6
- package/dist/resource_clients/schedule.js +25 -10
- package/dist/resource_clients/schedule_collection.d.ts +6 -2
- package/dist/resource_clients/schedule_collection.js +9 -3
- package/dist/resource_clients/store_collection.d.ts +6 -4
- package/dist/resource_clients/store_collection.js +4 -1
- package/dist/resource_clients/task.d.ts +35 -12
- package/dist/resource_clients/task.js +75 -35
- package/dist/resource_clients/task_collection.d.ts +9 -5
- package/dist/resource_clients/task_collection.js +9 -3
- package/dist/resource_clients/user.d.ts +16 -7
- package/dist/resource_clients/user.js +34 -16
- package/dist/resource_clients/webhook.d.ts +16 -7
- package/dist/resource_clients/webhook.js +25 -10
- package/dist/resource_clients/webhook_collection.d.ts +8 -4
- package/dist/resource_clients/webhook_collection.js +9 -3
- package/dist/resource_clients/webhook_dispatch.d.ts +4 -1
- package/dist/resource_clients/webhook_dispatch.js +7 -2
- package/dist/resource_clients/webhook_dispatch_collection.d.ts +3 -1
- package/dist/resource_clients/webhook_dispatch_collection.js +4 -1
- package/dist/response_validation_error.d.ts +2 -1
- package/dist/response_validation_error.js +2 -1
- package/dist/runtime/node.d.ts +6 -0
- package/dist/runtime/node.js +87 -0
- package/dist/runtime/types.d.ts +60 -0
- package/dist/runtime/types.js +1 -0
- package/dist/runtime/web.d.ts +5 -0
- package/dist/runtime/web.js +21 -0
- package/dist/schemas.d.ts +370 -4
- package/dist/schemas.js +26 -4
- package/dist/statistics.d.ts +1 -6
- package/dist/statistics.js +2 -2
- package/dist/timeouts.d.ts +84 -0
- package/dist/timeouts.js +37 -0
- package/dist/timezones.d.ts +1 -1
- package/dist/utils.d.ts +87 -61
- package/dist/utils.js +208 -162
- package/dist/wait_for_resources.d.ts +8 -0
- package/dist/wait_for_resources.js +39 -0
- package/package.json +41 -38
- package/dist/http_client.d.ts +0 -88
- package/dist/http_client.js +0 -255
- package/dist/interceptors.d.ts +0 -19
- package/dist/interceptors.js +0 -105
|
@@ -0,0 +1,87 @@
|
|
|
1
|
+
import os from 'node:os';
|
|
2
|
+
import { Readable } from 'node:stream';
|
|
3
|
+
import { brotliCompress, constants, gzip, zstdCompress } from 'node:zlib';
|
|
4
|
+
/**
|
|
5
|
+
* The Node.js implementation of {@link Runtime}. Deno and Bun resolve the `node` condition too and
|
|
6
|
+
* provide the built-ins it uses.
|
|
7
|
+
*/
|
|
8
|
+
export const runtime = {
|
|
9
|
+
isNode: true,
|
|
10
|
+
platform: `${os.platform()}; Node/${process.version}`,
|
|
11
|
+
async compress(data, { algorithm, quality }) {
|
|
12
|
+
return new Promise((resolve, reject) => {
|
|
13
|
+
const done = (error, result) => (error ? reject(error) : resolve(result));
|
|
14
|
+
switch (algorithm) {
|
|
15
|
+
case 'br':
|
|
16
|
+
brotliCompress(data, { params: { [constants.BROTLI_PARAM_QUALITY]: quality } }, done);
|
|
17
|
+
break;
|
|
18
|
+
case 'gzip':
|
|
19
|
+
gzip(data, { level: quality }, done);
|
|
20
|
+
break;
|
|
21
|
+
case 'zstd':
|
|
22
|
+
zstdCompress(data, { params: { [constants.ZSTD_c_compressionLevel]: quality } }, done);
|
|
23
|
+
break;
|
|
24
|
+
default:
|
|
25
|
+
reject(new Error(`Unrecognized compression algorithm: ${String(algorithm)}`));
|
|
26
|
+
}
|
|
27
|
+
});
|
|
28
|
+
},
|
|
29
|
+
async createHttpAgents({ timeoutMillis }) {
|
|
30
|
+
// Loaded on the first request rather than with the client: the proxy support pulls in a sizeable
|
|
31
|
+
// dependency tree that a client which never sends a request should not pay for.
|
|
32
|
+
const { ProxyAgent } = await import('proxy-agent');
|
|
33
|
+
// We want to keep sockets alive for better performance.
|
|
34
|
+
const agentOptions = {
|
|
35
|
+
keepAlive: true,
|
|
36
|
+
// Timeout for inactive sockets
|
|
37
|
+
// Prevents socket leaks from idle connections
|
|
38
|
+
timeout: timeoutMillis,
|
|
39
|
+
// Keep alive timeout for free sockets (15 seconds)
|
|
40
|
+
// Node.js will close unused sockets after this period
|
|
41
|
+
keepAliveMsecs: 15_000,
|
|
42
|
+
// Maximum number of sockets per host
|
|
43
|
+
maxSockets: 256,
|
|
44
|
+
maxFreeSockets: 256,
|
|
45
|
+
// LIFO scheduling - reuse most recently used sockets for better performance
|
|
46
|
+
scheduling: 'lifo',
|
|
47
|
+
};
|
|
48
|
+
// ProxyAgent picks the proxy up from the environment variables and supports CONNECT tunneling.
|
|
49
|
+
const agent = new ProxyAgent(agentOptions);
|
|
50
|
+
// Disable Nagle's algorithm for lower latency
|
|
51
|
+
// This sends data immediately instead of buffering small packets
|
|
52
|
+
agent.on('socket', (socket) => {
|
|
53
|
+
socket.setNoDelay(true);
|
|
54
|
+
});
|
|
55
|
+
return { httpAgent: agent, httpsAgent: agent };
|
|
56
|
+
},
|
|
57
|
+
openBlobBody(blob, onSourceError) {
|
|
58
|
+
return Readable.from(readBlob(blob, onSourceError), { objectMode: false });
|
|
59
|
+
},
|
|
60
|
+
};
|
|
61
|
+
/**
|
|
62
|
+
* Yields the bytes of a blob. Ending the iteration early, which destroying the `Readable` around it does, cancels
|
|
63
|
+
* the read and releases a file the blob reads from. Only a failing read is reported: an error the `Readable` is
|
|
64
|
+
* destroyed with is thrown in at the `yield` and belongs to the transport. A `for await` loop would surface both at
|
|
65
|
+
* the same place, so the loop calls `next()` itself to catch only the read.
|
|
66
|
+
*/
|
|
67
|
+
async function* readBlob(blob, onSourceError) {
|
|
68
|
+
const chunks = blob.stream()[Symbol.asyncIterator]();
|
|
69
|
+
try {
|
|
70
|
+
while (true) {
|
|
71
|
+
let chunk;
|
|
72
|
+
try {
|
|
73
|
+
chunk = await chunks.next();
|
|
74
|
+
}
|
|
75
|
+
catch (error) {
|
|
76
|
+
onSourceError(error);
|
|
77
|
+
throw error;
|
|
78
|
+
}
|
|
79
|
+
if (chunk.done)
|
|
80
|
+
return;
|
|
81
|
+
yield chunk.value;
|
|
82
|
+
}
|
|
83
|
+
}
|
|
84
|
+
finally {
|
|
85
|
+
await chunks.return?.();
|
|
86
|
+
}
|
|
87
|
+
}
|
|
@@ -0,0 +1,60 @@
|
|
|
1
|
+
import type http from 'node:http';
|
|
2
|
+
import type https from 'node:https';
|
|
3
|
+
import type { Readable } from 'node:stream';
|
|
4
|
+
/**
|
|
5
|
+
* What to compress a request body with, as the built-in `HttpCompressor` implementations ask for it.
|
|
6
|
+
* @internal
|
|
7
|
+
*/
|
|
8
|
+
export interface CompressionOptions {
|
|
9
|
+
/** Algorithm to compress with, named by the `Content-Encoding` value it produces. */
|
|
10
|
+
algorithm: 'br' | 'gzip' | 'zstd';
|
|
11
|
+
/** Compression level, in the range the algorithm defines. */
|
|
12
|
+
quality: number;
|
|
13
|
+
}
|
|
14
|
+
/**
|
|
15
|
+
* The agents axios's Node.js adapter sends requests through.
|
|
16
|
+
* @internal
|
|
17
|
+
*/
|
|
18
|
+
export interface HttpAgents {
|
|
19
|
+
httpAgent: http.Agent;
|
|
20
|
+
httpsAgent: https.Agent;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* The runtime-specific part of the client. `#runtime` resolves to the Node.js implementation under the `node`
|
|
24
|
+
* condition and to the Web API one everywhere else (see the `imports` field of `package.json`), so a bundler
|
|
25
|
+
* targeting a browser or an edge runtime never sees the Node.js built-ins the Node.js one uses.
|
|
26
|
+
* @internal
|
|
27
|
+
*/
|
|
28
|
+
export interface Runtime {
|
|
29
|
+
/**
|
|
30
|
+
* Whether the Node.js implementation was selected, which the `node` condition settles when `#runtime` is
|
|
31
|
+
* resolved - so a Node.js application bundled for a browser or a neutral target reports `false`. Log
|
|
32
|
+
* streaming, the `stream` record option and request body compression are gated on it.
|
|
33
|
+
*/
|
|
34
|
+
isNode: boolean;
|
|
35
|
+
/**
|
|
36
|
+
* The platform part of the `User-Agent` header, or `undefined` where the runtime does not let a client
|
|
37
|
+
* set that header (browsers).
|
|
38
|
+
*/
|
|
39
|
+
platform: string | undefined;
|
|
40
|
+
/**
|
|
41
|
+
* Compresses a request body. The built-in compressors go through it, so a bundle for a browser or an edge
|
|
42
|
+
* runtime carries no `node:zlib`. Throws where the runtime has no compression, which the client never
|
|
43
|
+
* reaches, since it compresses only where {@link isNode} holds.
|
|
44
|
+
*/
|
|
45
|
+
compress(data: Uint8Array, options: CompressionOptions): Promise<Buffer>;
|
|
46
|
+
/**
|
|
47
|
+
* Creates the agents axios's Node.js adapter sends requests through, or resolves to `undefined` where
|
|
48
|
+
* axios does not use agents.
|
|
49
|
+
*/
|
|
50
|
+
createHttpAgents(options: {
|
|
51
|
+
timeoutMillis: number;
|
|
52
|
+
}): Promise<HttpAgents | undefined>;
|
|
53
|
+
/**
|
|
54
|
+
* Opens a `Blob` request body for one attempt. The Node.js implementation reads the blob into a `Readable` and
|
|
55
|
+
* reports an error the blob raises while it is read to `onSourceError` before the stream fails with it, so the
|
|
56
|
+
* pipeline can tell a failing source apart from a failing connection. The Web API one returns the blob itself,
|
|
57
|
+
* which `fetch` and `XMLHttpRequest` read on their own, and never calls `onSourceError`.
|
|
58
|
+
*/
|
|
59
|
+
openBlobBody(blob: Blob, onSourceError: (error: unknown) => void): Readable | Blob;
|
|
60
|
+
}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export {};
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The {@link Runtime} for browsers and edge runtimes, built on Web APIs only.
|
|
3
|
+
*/
|
|
4
|
+
export const runtime = {
|
|
5
|
+
isNode: false,
|
|
6
|
+
// Browsers do not let a page set the `User-Agent` header.
|
|
7
|
+
platform: undefined,
|
|
8
|
+
// No request compression: brotli, gzip and zstd have no Web API, and a `content-encoding` request header is not
|
|
9
|
+
// on the list of headers the Apify API allows in a cross-origin request, so a browser would fail the
|
|
10
|
+
// preflight. The client compresses in Node.js alone, so nothing reaches this.
|
|
11
|
+
async compress() {
|
|
12
|
+
throw new Error('Request body compression is only available in Node.js.');
|
|
13
|
+
},
|
|
14
|
+
// The XHR and fetch adapters of axios do not use agents.
|
|
15
|
+
async createHttpAgents() {
|
|
16
|
+
return undefined;
|
|
17
|
+
},
|
|
18
|
+
openBlobBody(blob) {
|
|
19
|
+
return blob;
|
|
20
|
+
},
|
|
21
|
+
};
|
package/dist/schemas.d.ts
CHANGED
|
@@ -1,15 +1,381 @@
|
|
|
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
|
-
* top of it, and `spec_guards.ts` checks that each override still
|
|
9
|
+
* top of it, and `spec_guards.ts` checks that each override still produces what the specification describes,
|
|
10
10
|
* so one cannot narrow by accident.
|
|
11
11
|
*
|
|
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
|
+
githubActionsRunUrl: z.ZodOptional<z.ZodString>;
|
|
51
|
+
actorRunId: z.ZodOptional<z.ZodString>;
|
|
52
|
+
webhookDispatchId: z.ZodOptional<z.ZodString>;
|
|
53
|
+
}, z.core.$loose>;
|
|
54
|
+
stats: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
55
|
+
durationMillis: z.ZodOptional<z.ZodInt>;
|
|
56
|
+
runTimeSecs: z.ZodOptional<z.ZodNumber>;
|
|
57
|
+
computeUnits: z.ZodOptional<z.ZodNumber>;
|
|
58
|
+
imageSizeBytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
59
|
+
}, z.core.$loose>>>;
|
|
60
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
61
|
+
useCache: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
62
|
+
betaPackages: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
63
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
64
|
+
diskMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
65
|
+
tag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
66
|
+
debug: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
67
|
+
}, z.core.$loose>>>;
|
|
68
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
69
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
70
|
+
}, z.core.$loose>>>;
|
|
71
|
+
usageTotalUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
72
|
+
usageUsd: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
73
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
74
|
+
}, z.core.$loose>>>;
|
|
75
|
+
inputSchema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
76
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
78
|
+
exitCode: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
79
|
+
gitCommitId: z.ZodOptional<z.ZodString>;
|
|
80
|
+
gitBranchName: z.ZodOptional<z.ZodString>;
|
|
81
|
+
createdByOrganizationMemberUserId: z.ZodOptional<z.ZodString>;
|
|
82
|
+
buildNumber: z.ZodString;
|
|
83
|
+
imageDigest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
84
|
+
actorDefinition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
85
|
+
actorSpecification: z.ZodOptional<z.ZodLiteral<1>>;
|
|
86
|
+
name: z.ZodOptional<z.ZodString>;
|
|
87
|
+
title: z.ZodOptional<z.ZodString>;
|
|
88
|
+
description: z.ZodOptional<z.ZodString>;
|
|
89
|
+
version: z.ZodOptional<z.ZodString>;
|
|
90
|
+
buildTag: z.ZodOptional<z.ZodString>;
|
|
91
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
92
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
93
|
+
generatedBy: z.ZodOptional<z.ZodString>;
|
|
94
|
+
}, z.core.$loose>>;
|
|
95
|
+
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
96
|
+
dockerfile: z.ZodOptional<z.ZodString>;
|
|
97
|
+
dockerContextDir: z.ZodOptional<z.ZodString>;
|
|
98
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
99
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
100
|
+
output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
101
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
102
|
+
storages: z.ZodOptional<z.ZodObject<{
|
|
103
|
+
dataset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
104
|
+
datasets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
105
|
+
keyValueStore: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
106
|
+
}, z.core.$loose>>;
|
|
107
|
+
defaultMemoryMbytes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
108
|
+
minMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
109
|
+
maxMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
110
|
+
usesStandbyMode: z.ZodOptional<z.ZodBoolean>;
|
|
111
|
+
webServerSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
112
|
+
webServerMcpPath: z.ZodOptional<z.ZodString>;
|
|
113
|
+
}, z.core.$loose>>>;
|
|
114
|
+
actVersion: z.ZodOptional<z.ZodObject<{
|
|
115
|
+
sourceType: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
116
|
+
GITHUB_GIST: "GITHUB_GIST";
|
|
117
|
+
GIT_REPO: "GIT_REPO";
|
|
118
|
+
SOURCE_CODE: "SOURCE_CODE";
|
|
119
|
+
SOURCE_FILES: "SOURCE_FILES";
|
|
120
|
+
TARBALL: "TARBALL";
|
|
121
|
+
}>, z.ZodString]>>;
|
|
122
|
+
versionNumber: z.ZodOptional<z.ZodString>;
|
|
123
|
+
gitRepoUrl: z.ZodOptional<z.ZodString>;
|
|
124
|
+
sourceFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
125
|
+
format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
126
|
+
BASE64: "BASE64";
|
|
127
|
+
TEXT: "TEXT";
|
|
128
|
+
}>, z.ZodString]>>;
|
|
129
|
+
content: z.ZodOptional<z.ZodString>;
|
|
130
|
+
name: z.ZodString;
|
|
131
|
+
}, z.core.$loose>>>;
|
|
132
|
+
gitHubGistUrl: z.ZodOptional<z.ZodString>;
|
|
133
|
+
tarballUrl: z.ZodOptional<z.ZodString>;
|
|
134
|
+
actorPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
135
|
+
buildTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
136
|
+
}, z.core.$loose>>;
|
|
137
|
+
}, z.core.$loose>;
|
|
138
|
+
/** Response containing Actor build data. */
|
|
139
|
+
export declare const BuildResponse: () => z.ZodObject<{
|
|
140
|
+
data: z.ZodObject<{
|
|
141
|
+
id: z.ZodString;
|
|
142
|
+
actId: z.ZodString;
|
|
143
|
+
userId: z.ZodString;
|
|
144
|
+
startedAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
145
|
+
finishedAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
146
|
+
status: z.ZodUnion<[z.ZodEnum<{
|
|
147
|
+
ABORTED: "ABORTED";
|
|
148
|
+
ABORTING: "ABORTING";
|
|
149
|
+
FAILED: "FAILED";
|
|
150
|
+
READY: "READY";
|
|
151
|
+
RUNNING: "RUNNING";
|
|
152
|
+
SUCCEEDED: "SUCCEEDED";
|
|
153
|
+
"TIMED-OUT": "TIMED-OUT";
|
|
154
|
+
"TIMING-OUT": "TIMING-OUT";
|
|
155
|
+
}>, z.ZodString]>;
|
|
156
|
+
meta: z.ZodObject<{
|
|
157
|
+
origin: z.ZodUnion<[z.ZodEnum<{
|
|
158
|
+
ACTOR: "ACTOR";
|
|
159
|
+
API: "API";
|
|
160
|
+
CI: "CI";
|
|
161
|
+
CLI: "CLI";
|
|
162
|
+
DEVELOPMENT: "DEVELOPMENT";
|
|
163
|
+
MCP: "MCP";
|
|
164
|
+
SCHEDULER: "SCHEDULER";
|
|
165
|
+
STANDBY: "STANDBY";
|
|
166
|
+
TEST: "TEST";
|
|
167
|
+
WEB: "WEB";
|
|
168
|
+
WEBHOOK: "WEBHOOK";
|
|
169
|
+
}>, z.ZodString]>;
|
|
170
|
+
clientIp: z.ZodOptional<z.ZodString>;
|
|
171
|
+
userAgent: z.ZodOptional<z.ZodString>;
|
|
172
|
+
githubActionsRunUrl: z.ZodOptional<z.ZodString>;
|
|
173
|
+
actorRunId: z.ZodOptional<z.ZodString>;
|
|
174
|
+
webhookDispatchId: z.ZodOptional<z.ZodString>;
|
|
175
|
+
}, z.core.$loose>;
|
|
176
|
+
stats: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
177
|
+
durationMillis: z.ZodOptional<z.ZodInt>;
|
|
178
|
+
runTimeSecs: z.ZodOptional<z.ZodNumber>;
|
|
179
|
+
computeUnits: z.ZodOptional<z.ZodNumber>;
|
|
180
|
+
imageSizeBytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
181
|
+
}, z.core.$loose>>>;
|
|
182
|
+
options: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
183
|
+
useCache: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
184
|
+
betaPackages: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
185
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
186
|
+
diskMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
187
|
+
tag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
188
|
+
debug: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
189
|
+
}, z.core.$loose>>>;
|
|
190
|
+
usage: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
191
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
192
|
+
}, z.core.$loose>>>;
|
|
193
|
+
usageTotalUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
194
|
+
usageUsd: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
195
|
+
ACTOR_COMPUTE_UNITS: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
196
|
+
}, z.core.$loose>>>;
|
|
197
|
+
inputSchema: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
198
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
199
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
200
|
+
exitCode: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
201
|
+
gitCommitId: z.ZodOptional<z.ZodString>;
|
|
202
|
+
gitBranchName: z.ZodOptional<z.ZodString>;
|
|
203
|
+
createdByOrganizationMemberUserId: z.ZodOptional<z.ZodString>;
|
|
204
|
+
buildNumber: z.ZodString;
|
|
205
|
+
imageDigest: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
206
|
+
actorDefinition: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
207
|
+
actorSpecification: z.ZodOptional<z.ZodLiteral<1>>;
|
|
208
|
+
name: z.ZodOptional<z.ZodString>;
|
|
209
|
+
title: z.ZodOptional<z.ZodString>;
|
|
210
|
+
description: z.ZodOptional<z.ZodString>;
|
|
211
|
+
version: z.ZodOptional<z.ZodString>;
|
|
212
|
+
buildTag: z.ZodOptional<z.ZodString>;
|
|
213
|
+
meta: z.ZodOptional<z.ZodObject<{
|
|
214
|
+
templateId: z.ZodOptional<z.ZodString>;
|
|
215
|
+
generatedBy: z.ZodOptional<z.ZodString>;
|
|
216
|
+
}, z.core.$loose>>;
|
|
217
|
+
environmentVariables: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
|
|
218
|
+
dockerfile: z.ZodOptional<z.ZodString>;
|
|
219
|
+
dockerContextDir: z.ZodOptional<z.ZodString>;
|
|
220
|
+
readme: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
221
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
222
|
+
output: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
223
|
+
changelog: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
224
|
+
storages: z.ZodOptional<z.ZodObject<{
|
|
225
|
+
dataset: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
226
|
+
datasets: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
227
|
+
keyValueStore: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
228
|
+
}, z.core.$loose>>;
|
|
229
|
+
defaultMemoryMbytes: z.ZodOptional<z.ZodUnion<readonly [z.ZodString, z.ZodInt]>>;
|
|
230
|
+
minMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
231
|
+
maxMemoryMbytes: z.ZodOptional<z.ZodInt>;
|
|
232
|
+
usesStandbyMode: z.ZodOptional<z.ZodBoolean>;
|
|
233
|
+
webServerSchema: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnknown>>;
|
|
234
|
+
webServerMcpPath: z.ZodOptional<z.ZodString>;
|
|
235
|
+
}, z.core.$loose>>>;
|
|
236
|
+
actVersion: z.ZodOptional<z.ZodObject<{
|
|
237
|
+
sourceType: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
238
|
+
GITHUB_GIST: "GITHUB_GIST";
|
|
239
|
+
GIT_REPO: "GIT_REPO";
|
|
240
|
+
SOURCE_CODE: "SOURCE_CODE";
|
|
241
|
+
SOURCE_FILES: "SOURCE_FILES";
|
|
242
|
+
TARBALL: "TARBALL";
|
|
243
|
+
}>, z.ZodString]>>;
|
|
244
|
+
versionNumber: z.ZodOptional<z.ZodString>;
|
|
245
|
+
gitRepoUrl: z.ZodOptional<z.ZodString>;
|
|
246
|
+
sourceFiles: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
247
|
+
format: z.ZodOptional<z.ZodUnion<[z.ZodEnum<{
|
|
248
|
+
BASE64: "BASE64";
|
|
249
|
+
TEXT: "TEXT";
|
|
250
|
+
}>, z.ZodString]>>;
|
|
251
|
+
content: z.ZodOptional<z.ZodString>;
|
|
252
|
+
name: z.ZodString;
|
|
253
|
+
}, z.core.$loose>>>;
|
|
254
|
+
gitHubGistUrl: z.ZodOptional<z.ZodString>;
|
|
255
|
+
tarballUrl: z.ZodOptional<z.ZodString>;
|
|
256
|
+
actorPath: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
257
|
+
buildTag: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
258
|
+
}, z.core.$loose>>;
|
|
259
|
+
}, z.core.$loose>;
|
|
260
|
+
}, z.core.$loose>;
|
|
261
|
+
/**
|
|
262
|
+
* The API returns `uiState` as `null` once an API update has changed the schedule's `cronExpression` or `timezone`,
|
|
263
|
+
* which the specification types as an object.
|
|
264
|
+
*/
|
|
265
|
+
export declare const Schedule: () => z.ZodObject<{
|
|
266
|
+
id: z.ZodString;
|
|
267
|
+
userId: z.ZodString;
|
|
268
|
+
name: z.ZodString;
|
|
269
|
+
cronExpression: z.ZodString;
|
|
270
|
+
timezone: z.ZodString;
|
|
271
|
+
isEnabled: z.ZodBoolean;
|
|
272
|
+
isExclusive: z.ZodBoolean;
|
|
273
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
274
|
+
modifiedAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
275
|
+
nextRunAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
276
|
+
lastRunAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
277
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
278
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
279
|
+
notifications: z.ZodOptional<z.ZodObject<{
|
|
280
|
+
email: z.ZodOptional<z.ZodBoolean>;
|
|
281
|
+
}, z.core.$loose>>;
|
|
282
|
+
integrationTracking: z.ZodOptional<z.ZodObject<{
|
|
283
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
284
|
+
appId: z.ZodOptional<z.ZodString>;
|
|
285
|
+
isAiTool: z.ZodOptional<z.ZodBoolean>;
|
|
286
|
+
}, z.core.$loose>>;
|
|
287
|
+
actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
288
|
+
id: z.ZodString;
|
|
289
|
+
type: z.ZodLiteral<"RUN_ACTOR">;
|
|
290
|
+
actorId: z.ZodString;
|
|
291
|
+
runInput: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
292
|
+
body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
contentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
294
|
+
}, z.core.$loose>>>;
|
|
295
|
+
runOptions: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
296
|
+
build: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
297
|
+
timeoutSecs: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
298
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
299
|
+
maxItems: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
300
|
+
maxTotalChargeUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
301
|
+
restartOnError: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
302
|
+
isMaxTotalChargeUsdSetByUser: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
303
|
+
forcePermissionLevel: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
|
|
304
|
+
FULL_PERMISSIONS: "FULL_PERMISSIONS";
|
|
305
|
+
LIMITED_PERMISSIONS: "LIMITED_PERMISSIONS";
|
|
306
|
+
}>, z.ZodString]>>>;
|
|
307
|
+
}, z.core.$loose>>>;
|
|
308
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
309
|
+
id: z.ZodString;
|
|
310
|
+
type: z.ZodLiteral<"RUN_ACTOR_TASK">;
|
|
311
|
+
actorTaskId: z.ZodString;
|
|
312
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
313
|
+
}, z.core.$loose>], "type">>;
|
|
314
|
+
uiState: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
|
|
315
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
316
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
317
|
+
cronExpression: z.ZodOptional<z.ZodString>;
|
|
318
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
319
|
+
}, z.core.$loose>>;
|
|
320
|
+
}, z.core.$loose>>>>;
|
|
321
|
+
}, z.core.$loose>;
|
|
322
|
+
/** Response containing schedule data. */
|
|
323
|
+
export declare const ScheduleResponse: () => z.ZodObject<{
|
|
324
|
+
data: z.ZodObject<{
|
|
325
|
+
id: z.ZodString;
|
|
326
|
+
userId: z.ZodString;
|
|
327
|
+
name: z.ZodString;
|
|
328
|
+
cronExpression: z.ZodString;
|
|
329
|
+
timezone: z.ZodString;
|
|
330
|
+
isEnabled: z.ZodBoolean;
|
|
331
|
+
isExclusive: z.ZodBoolean;
|
|
332
|
+
createdAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
333
|
+
modifiedAt: z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>;
|
|
334
|
+
nextRunAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
335
|
+
lastRunAt: z.ZodOptional<z.ZodNullable<z.ZodPipe<z.ZodISODateTime, z.ZodCoercedDate<string>>>>;
|
|
336
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
337
|
+
title: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
338
|
+
notifications: z.ZodOptional<z.ZodObject<{
|
|
339
|
+
email: z.ZodOptional<z.ZodBoolean>;
|
|
340
|
+
}, z.core.$loose>>;
|
|
341
|
+
integrationTracking: z.ZodOptional<z.ZodObject<{
|
|
342
|
+
platform: z.ZodOptional<z.ZodString>;
|
|
343
|
+
appId: z.ZodOptional<z.ZodString>;
|
|
344
|
+
isAiTool: z.ZodOptional<z.ZodBoolean>;
|
|
345
|
+
}, z.core.$loose>>;
|
|
346
|
+
actions: z.ZodArray<z.ZodDiscriminatedUnion<[z.ZodObject<{
|
|
347
|
+
id: z.ZodString;
|
|
348
|
+
type: z.ZodLiteral<"RUN_ACTOR">;
|
|
349
|
+
actorId: z.ZodString;
|
|
350
|
+
runInput: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
351
|
+
body: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
352
|
+
contentType: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
353
|
+
}, z.core.$loose>>>;
|
|
354
|
+
runOptions: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
355
|
+
build: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
356
|
+
timeoutSecs: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
357
|
+
memoryMbytes: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
358
|
+
maxItems: z.ZodOptional<z.ZodNullable<z.ZodInt>>;
|
|
359
|
+
maxTotalChargeUsd: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
360
|
+
restartOnError: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
361
|
+
isMaxTotalChargeUsdSetByUser: z.ZodOptional<z.ZodNullable<z.ZodBoolean>>;
|
|
362
|
+
forcePermissionLevel: z.ZodOptional<z.ZodNullable<z.ZodUnion<[z.ZodEnum<{
|
|
363
|
+
FULL_PERMISSIONS: "FULL_PERMISSIONS";
|
|
364
|
+
LIMITED_PERMISSIONS: "LIMITED_PERMISSIONS";
|
|
365
|
+
}>, z.ZodString]>>>;
|
|
366
|
+
}, z.core.$loose>>>;
|
|
367
|
+
}, z.core.$loose>, z.ZodObject<{
|
|
368
|
+
id: z.ZodString;
|
|
369
|
+
type: z.ZodLiteral<"RUN_ACTOR_TASK">;
|
|
370
|
+
actorTaskId: z.ZodString;
|
|
371
|
+
input: z.ZodOptional<z.ZodNullable<z.ZodRecord<z.ZodString, z.ZodUnknown>>>;
|
|
372
|
+
}, z.core.$loose>], "type">>;
|
|
373
|
+
uiState: z.ZodOptional<z.ZodNullable<z.ZodNullable<z.ZodObject<{
|
|
374
|
+
version: z.ZodOptional<z.ZodInt>;
|
|
375
|
+
data: z.ZodOptional<z.ZodObject<{
|
|
376
|
+
cronExpression: z.ZodOptional<z.ZodString>;
|
|
377
|
+
timezone: z.ZodOptional<z.ZodString>;
|
|
378
|
+
}, z.core.$loose>>;
|
|
379
|
+
}, z.core.$loose>>>>;
|
|
380
|
+
}, z.core.$loose>;
|
|
381
|
+
}, z.core.$loose>;
|
package/dist/schemas.js
CHANGED
|
@@ -1,15 +1,37 @@
|
|
|
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
|
-
* top of it, and `spec_guards.ts` checks that each override still
|
|
9
|
+
* top of it, and `spec_guards.ts` checks that each override still produces what the specification describes,
|
|
10
10
|
* so one cannot narrow by accident.
|
|
11
11
|
*
|
|
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() }));
|
|
31
|
+
/**
|
|
32
|
+
* The API returns `uiState` as `null` once an API update has changed the schedule's `cronExpression` or `timezone`,
|
|
33
|
+
* which the specification types as an object.
|
|
34
|
+
*/
|
|
35
|
+
export const Schedule = lazySchema(() => generated.Schedule().extend({ uiState: generated.ScheduleUiState().nullable().optional() }));
|
|
36
|
+
/** Response containing schedule data. */
|
|
37
|
+
export const ScheduleResponse = lazySchema(() => generated.ScheduleResponse().extend({ data: Schedule() }));
|
package/dist/statistics.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
export declare class Statistics {
|
|
2
|
+
#private;
|
|
2
3
|
/**
|
|
3
4
|
* Number of Apify client function calls
|
|
4
5
|
*/
|
|
@@ -13,10 +14,4 @@ export declare class Statistics {
|
|
|
13
14
|
*/
|
|
14
15
|
rateLimitErrors: number[];
|
|
15
16
|
addRateLimitError(attempt: number): void;
|
|
16
|
-
/**
|
|
17
|
-
* Removes the necessity to pre-initialize array with correct
|
|
18
|
-
* number of zeroes by dynamically filling the empty indexes
|
|
19
|
-
* when necessary.
|
|
20
|
-
*/
|
|
21
|
-
private _fillBlanksWithZeroes;
|
|
22
17
|
}
|
package/dist/statistics.js
CHANGED
|
@@ -20,7 +20,7 @@ export class Statistics {
|
|
|
20
20
|
// attempt is never 0,
|
|
21
21
|
// but we don't want index 0 empty
|
|
22
22
|
const index = attempt - 1;
|
|
23
|
-
this
|
|
23
|
+
this.#fillBlanksWithZeroes(index);
|
|
24
24
|
this.rateLimitErrors[index]++;
|
|
25
25
|
}
|
|
26
26
|
/**
|
|
@@ -28,7 +28,7 @@ export class Statistics {
|
|
|
28
28
|
* number of zeroes by dynamically filling the empty indexes
|
|
29
29
|
* when necessary.
|
|
30
30
|
*/
|
|
31
|
-
|
|
31
|
+
#fillBlanksWithZeroes(inclusiveIndex) {
|
|
32
32
|
if (this.rateLimitErrors.length <= inclusiveIndex) {
|
|
33
33
|
for (let k = 0; k <= inclusiveIndex; k++) {
|
|
34
34
|
if (typeof this.rateLimitErrors[k] !== 'number') {
|