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

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