apify-client 3.0.0-beta.0 → 3.0.0-beta.10

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 (94) hide show
  1. package/README.md +5 -3
  2. package/dist/apify_api_error.d.ts +59 -3
  3. package/dist/apify_api_error.js +71 -11
  4. package/dist/apify_client.d.ts +27 -27
  5. package/dist/apify_client.js +86 -91
  6. package/dist/base/api_client.d.ts +3 -3
  7. package/dist/base/api_client.js +6 -10
  8. package/dist/base/resource_client.d.ts +5 -4
  9. package/dist/base/resource_client.js +17 -21
  10. package/dist/base/resource_collection_client.d.ts +7 -6
  11. package/dist/base/resource_collection_client.js +11 -15
  12. package/dist/body_parser.js +6 -11
  13. package/dist/bundle.js +38 -48
  14. package/dist/bundle.js.map +1 -1
  15. package/dist/generated/api.d.ts +20595 -0
  16. package/dist/generated/api.js +5 -0
  17. package/dist/generated/schemas.d.ts +6699 -0
  18. package/dist/generated/schemas.js +1521 -0
  19. package/dist/http_client.d.ts +2 -2
  20. package/dist/http_client.js +23 -28
  21. package/dist/index.d.ts +33 -32
  22. package/dist/index.js +32 -36
  23. package/dist/interceptors.d.ts +1 -1
  24. package/dist/interceptors.js +14 -19
  25. package/dist/lazy_schema.d.ts +8 -0
  26. package/dist/lazy_schema.js +11 -0
  27. package/dist/models.d.ts +1053 -0
  28. package/dist/models.js +86 -0
  29. package/dist/resource_clients/actor.d.ts +13 -459
  30. package/dist/resource_clients/actor.js +70 -73
  31. package/dist/resource_clients/actor_collection.d.ts +10 -15
  32. package/dist/resource_clients/actor_collection.js +19 -20
  33. package/dist/resource_clients/actor_env_var.d.ts +3 -3
  34. package/dist/resource_clients/actor_env_var.js +7 -10
  35. package/dist/resource_clients/actor_env_var_collection.d.ts +11 -20
  36. package/dist/resource_clients/actor_env_var_collection.js +15 -19
  37. package/dist/resource_clients/actor_version.d.ts +14 -43
  38. package/dist/resource_clients/actor_version.js +15 -24
  39. package/dist/resource_clients/actor_version_collection.d.ts +13 -19
  40. package/dist/resource_clients/actor_version_collection.js +17 -19
  41. package/dist/resource_clients/build.d.ts +5 -80
  42. package/dist/resource_clients/build.js +14 -17
  43. package/dist/resource_clients/build_collection.d.ts +5 -5
  44. package/dist/resource_clients/build_collection.js +10 -13
  45. package/dist/resource_clients/dataset.d.ts +6 -72
  46. package/dist/resource_clients/dataset.js +73 -76
  47. package/dist/resource_clients/dataset_collection.d.ts +4 -4
  48. package/dist/resource_clients/dataset_collection.js +18 -21
  49. package/dist/resource_clients/key_value_store.d.ts +16 -77
  50. package/dist/resource_clients/key_value_store.js +64 -66
  51. package/dist/resource_clients/key_value_store_collection.d.ts +4 -4
  52. package/dist/resource_clients/key_value_store_collection.js +18 -21
  53. package/dist/resource_clients/log.d.ts +2 -2
  54. package/dist/resource_clients/log.js +15 -22
  55. package/dist/resource_clients/request_queue.d.ts +17 -183
  56. package/dist/resource_clients/request_queue.js +102 -108
  57. package/dist/resource_clients/request_queue_collection.d.ts +4 -4
  58. package/dist/resource_clients/request_queue_collection.js +16 -19
  59. package/dist/resource_clients/run.d.ts +8 -8
  60. package/dist/resource_clients/run.js +50 -53
  61. package/dist/resource_clients/run_collection.d.ts +4 -4
  62. package/dist/resource_clients/run_collection.js +15 -18
  63. package/dist/resource_clients/schedule.d.ts +8 -86
  64. package/dist/resource_clients/schedule.js +13 -21
  65. package/dist/resource_clients/schedule_collection.d.ts +4 -4
  66. package/dist/resource_clients/schedule_collection.js +13 -16
  67. package/dist/resource_clients/store_collection.d.ts +5 -33
  68. package/dist/resource_clients/store_collection.js +15 -18
  69. package/dist/resource_clients/task.d.ts +9 -79
  70. package/dist/resource_clients/task.js +47 -50
  71. package/dist/resource_clients/task_collection.d.ts +6 -5
  72. package/dist/resource_clients/task_collection.js +12 -15
  73. package/dist/resource_clients/user.d.ts +5 -181
  74. package/dist/resource_clients/user.js +11 -24
  75. package/dist/resource_clients/webhook.d.ts +6 -65
  76. package/dist/resource_clients/webhook.js +11 -14
  77. package/dist/resource_clients/webhook_collection.d.ts +4 -4
  78. package/dist/resource_clients/webhook_collection.js +13 -16
  79. package/dist/resource_clients/webhook_dispatch.d.ts +5 -38
  80. package/dist/resource_clients/webhook_dispatch.js +5 -13
  81. package/dist/resource_clients/webhook_dispatch_collection.d.ts +4 -4
  82. package/dist/resource_clients/webhook_dispatch_collection.js +10 -13
  83. package/dist/response_validation_error.d.ts +26 -0
  84. package/dist/response_validation_error.js +37 -0
  85. package/dist/schemas.d.ts +15 -0
  86. package/dist/schemas.js +15 -0
  87. package/dist/statistics.js +5 -9
  88. package/dist/timezones.js +1 -2
  89. package/dist/utils.d.ts +19 -24
  90. package/dist/utils.js +66 -96
  91. package/package.json +48 -40
  92. package/dist/argument_validation_error.d.ts +0 -17
  93. package/dist/argument_validation_error.js +0 -157
  94. package/dist/index.mjs +0 -42
@@ -1,12 +1,11 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActorSourceType = exports.ActorVersionClient = void 0;
4
- const zod_1 = require("zod");
5
- const resource_client_1 = require("../base/resource_client");
6
- const utils_1 = require("../utils");
7
- const actor_env_var_1 = require("./actor_env_var");
8
- const actor_env_var_collection_1 = require("./actor_env_var_collection");
9
- const envVarNameSchema = zod_1.z.string();
1
+ import { z } from 'zod';
2
+ import { ResourceClient } from '../base/resource_client.js';
3
+ import * as schemas from '../schemas.js';
4
+ import { anyObjectSchema, parseArgument } from '../utils.js';
5
+ import { ActorEnvVarClient } from './actor_env_var.js';
6
+ import { ActorEnvVarCollectionClient } from './actor_env_var_collection.js';
7
+ const envVarNameSchema = z.string();
8
+ export { ActorSourceType } from '../models.js';
10
9
  /**
11
10
  * Client for managing a specific Actor version.
12
11
  *
@@ -28,7 +27,7 @@ const envVarNameSchema = zod_1.z.string();
28
27
  *
29
28
  * @see https://docs.apify.com/api/v2/act-versions-get
30
29
  */
31
- class ActorVersionClient extends resource_client_1.ResourceClient {
30
+ export class ActorVersionClient extends ResourceClient {
32
31
  /**
33
32
  * @hidden
34
33
  */
@@ -45,7 +44,7 @@ class ActorVersionClient extends resource_client_1.ResourceClient {
45
44
  * @see https://docs.apify.com/api/v2/act-version-get
46
45
  */
47
46
  async get() {
48
- return this._get();
47
+ return this._get(schemas.Version());
49
48
  }
50
49
  /**
51
50
  * Updates the Actor version with the specified fields.
@@ -55,8 +54,8 @@ class ActorVersionClient extends resource_client_1.ResourceClient {
55
54
  * @see https://docs.apify.com/api/v2/act-version-put
56
55
  */
57
56
  async update(newFields) {
58
- (0, utils_1.parseArgument)(newFields, utils_1.anyObjectSchema);
59
- return this._update(newFields);
57
+ parseArgument(newFields, anyObjectSchema);
58
+ return this._update(schemas.Version(), newFields);
60
59
  }
61
60
  /**
62
61
  * Deletes the Actor version.
@@ -75,8 +74,8 @@ class ActorVersionClient extends resource_client_1.ResourceClient {
75
74
  * @since Added in 2.1.0
76
75
  */
77
76
  envVar(envVarName) {
78
- (0, utils_1.parseArgument)(envVarName, envVarNameSchema);
79
- return new actor_env_var_1.ActorEnvVarClient(this._subResourceOptions({
77
+ parseArgument(envVarName, envVarNameSchema);
78
+ return new ActorEnvVarClient(this._subResourceOptions({
80
79
  id: envVarName,
81
80
  }));
82
81
  }
@@ -88,14 +87,6 @@ class ActorVersionClient extends resource_client_1.ResourceClient {
88
87
  * @since Added in 2.1.0
89
88
  */
90
89
  envVars() {
91
- return new actor_env_var_collection_1.ActorEnvVarCollectionClient(this._subResourceOptions());
90
+ return new ActorEnvVarCollectionClient(this._subResourceOptions());
92
91
  }
93
92
  }
94
- exports.ActorVersionClient = ActorVersionClient;
95
- var ActorSourceType;
96
- (function (ActorSourceType) {
97
- ActorSourceType["SourceFiles"] = "SOURCE_FILES";
98
- ActorSourceType["GitRepo"] = "GIT_REPO";
99
- ActorSourceType["Tarball"] = "TARBALL";
100
- ActorSourceType["GitHubGist"] = "GITHUB_GIST";
101
- })(ActorSourceType || (exports.ActorSourceType = ActorSourceType = {}));
@@ -1,7 +1,7 @@
1
- import type { ApiClientSubResourceOptions } from '../base/api_client';
2
- import { ResourceCollectionClient } from '../base/resource_collection_client';
3
- import type { PaginatedList, PaginationOptions } from '../utils';
4
- import type { ActorVersion, FinalActorVersion } from './actor_version';
1
+ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
2
+ import { ResourceCollectionClient } from '../base/resource_collection_client.js';
3
+ import type { PaginatedList } from '../utils.js';
4
+ import type { ActorVersion, FinalActorVersion } from './actor_version.js';
5
5
  /**
6
6
  * Client for managing the collection of Actor versions.
7
7
  *
@@ -20,6 +20,8 @@ import type { ActorVersion, FinalActorVersion } from './actor_version';
20
20
  * // Create a new version
21
21
  * const newVersion = await versionsClient.create({
22
22
  * versionNumber: '0.2',
23
+ * sourceType: 'GIT_REPO',
24
+ * gitRepoUrl: 'https://github.com/my-account/my-actor',
23
25
  * buildTag: 'latest'
24
26
  * });
25
27
  * ```
@@ -34,23 +36,22 @@ export declare class ActorVersionCollectionClient extends ResourceCollectionClie
34
36
  /**
35
37
  * Lists all Actor versions.
36
38
  *
37
- * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
38
- * items in a single API call is limited.
39
+ * The endpoint returns every version in one response, so awaiting the return value (as you would with a Promise)
40
+ * gets the whole list.
39
41
  * ```javascript
40
- * const paginatedList = await client.list();
41
- *```
42
+ * const { items } = await client.list();
43
+ * ```
42
44
  *
43
- * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
44
- * retrieved.
45
+ * Asynchronous iteration is also supported, and yields the versions one by one.
45
46
  *
46
47
  * ```javascript
47
48
  * for await (const singleItem of client.list()) {...}
48
49
  * ```
49
50
  *
50
- * @returns A paginated iterator of Actor versions.
51
+ * @returns The Actor versions, awaitable as a whole list or iterable one by one.
51
52
  * @see https://docs.apify.com/api/v2/act-versions-get
52
53
  */
53
- list(_options?: ActorVersionCollectionListOptions): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion>;
54
+ list(): Promise<ActorVersionListResult> & AsyncIterable<FinalActorVersion>;
54
55
  /**
55
56
  * Creates a new Actor version.
56
57
  *
@@ -60,11 +61,4 @@ export declare class ActorVersionCollectionClient extends ResourceCollectionClie
60
61
  */
61
62
  create(actorVersion: ActorVersion): Promise<FinalActorVersion>;
62
63
  }
63
- /**
64
- * @deprecated No options are used in the current API implementation.
65
- * https://github.com/apify/apify-client-js/issues/799
66
- */
67
- export interface ActorVersionCollectionListOptions extends PaginationOptions {
68
- desc?: boolean;
69
- }
70
64
  export type ActorVersionListResult = Pick<PaginatedList<FinalActorVersion>, 'total' | 'items'>;
@@ -1,9 +1,7 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.ActorVersionCollectionClient = void 0;
4
- const resource_collection_client_1 = require("../base/resource_collection_client");
5
- const utils_1 = require("../utils");
6
- const actorVersionSchema = utils_1.anyObjectSchema.optional();
1
+ import { ResourceCollectionClient } from '../base/resource_collection_client.js';
2
+ import * as schemas from '../schemas.js';
3
+ import { anyObjectSchema, parseArgument } from '../utils.js';
4
+ const actorVersionSchema = anyObjectSchema.optional();
7
5
  /**
8
6
  * Client for managing the collection of Actor versions.
9
7
  *
@@ -22,13 +20,15 @@ const actorVersionSchema = utils_1.anyObjectSchema.optional();
22
20
  * // Create a new version
23
21
  * const newVersion = await versionsClient.create({
24
22
  * versionNumber: '0.2',
23
+ * sourceType: 'GIT_REPO',
24
+ * gitRepoUrl: 'https://github.com/my-account/my-actor',
25
25
  * buildTag: 'latest'
26
26
  * });
27
27
  * ```
28
28
  *
29
29
  * @see https://docs.apify.com/api/v2/act-versions-get
30
30
  */
31
- class ActorVersionCollectionClient extends resource_collection_client_1.ResourceCollectionClient {
31
+ export class ActorVersionCollectionClient extends ResourceCollectionClient {
32
32
  /**
33
33
  * @hidden
34
34
  */
@@ -41,24 +41,23 @@ class ActorVersionCollectionClient extends resource_collection_client_1.Resource
41
41
  /**
42
42
  * Lists all Actor versions.
43
43
  *
44
- * Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
45
- * items in a single API call is limited.
44
+ * The endpoint returns every version in one response, so awaiting the return value (as you would with a Promise)
45
+ * gets the whole list.
46
46
  * ```javascript
47
- * const paginatedList = await client.list();
48
- *```
47
+ * const { items } = await client.list();
48
+ * ```
49
49
  *
50
- * Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
51
- * retrieved.
50
+ * Asynchronous iteration is also supported, and yields the versions one by one.
52
51
  *
53
52
  * ```javascript
54
53
  * for await (const singleItem of client.list()) {...}
55
54
  * ```
56
55
  *
57
- * @returns A paginated iterator of Actor versions.
56
+ * @returns The Actor versions, awaitable as a whole list or iterable one by one.
58
57
  * @see https://docs.apify.com/api/v2/act-versions-get
59
58
  */
60
- list(_options = {}) {
61
- return this._listPaginated();
59
+ list() {
60
+ return this._listPaginated(schemas.ListOfVersions());
62
61
  }
63
62
  /**
64
63
  * Creates a new Actor version.
@@ -68,8 +67,7 @@ class ActorVersionCollectionClient extends resource_collection_client_1.Resource
68
67
  * @see https://docs.apify.com/api/v2/act-versions-post
69
68
  */
70
69
  async create(actorVersion) {
71
- (0, utils_1.parseArgument)(actorVersion, actorVersionSchema);
72
- return this._create(actorVersion);
70
+ parseArgument(actorVersion, actorVersionSchema);
71
+ return this._create(schemas.Version(), actorVersion);
73
72
  }
74
73
  }
75
- exports.ActorVersionCollectionClient = ActorVersionCollectionClient;
@@ -1,8 +1,8 @@
1
- import type { ACT_JOB_TERMINAL_STATUSES } from '@apify/consts';
2
- import type { ApiClientSubResourceOptions } from '../base/api_client';
3
- import { ResourceClient } from '../base/resource_client';
4
- import type { ActorDefinition } from './actor';
5
- import { LogClient } from './log';
1
+ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
2
+ import { ResourceClient } from '../base/resource_client.js';
3
+ import type { Build } from '../models.js';
4
+ import { LogClient } from './log.js';
5
+ export type { Build, BuildMeta, BuildOptions, BuildStats, BuildUsage } from '../models.js';
6
6
  /**
7
7
  * Client for managing a specific Actor build.
8
8
  *
@@ -143,80 +143,6 @@ export interface BuildClientWaitForFinishOptions {
143
143
  */
144
144
  waitSecs?: number;
145
145
  }
146
- /**
147
- * Metadata about how a Build was initiated.
148
- */
149
- export interface BuildMeta {
150
- origin: string;
151
- clientIp: string;
152
- userAgent: string;
153
- }
154
- /**
155
- * Represents an Actor build.
156
- *
157
- * Builds compile Actor source code and prepare it for execution. Each build has a unique ID
158
- * and can be tagged (e.g., 'latest', 'beta') for easy reference.
159
- */
160
- export interface Build {
161
- id: string;
162
- actId: string;
163
- userId: string;
164
- startedAt: Date;
165
- finishedAt?: Date;
166
- status: (typeof ACT_JOB_TERMINAL_STATUSES)[number];
167
- meta: BuildMeta;
168
- stats?: BuildStats;
169
- options?: BuildOptions;
170
- /**
171
- * @deprecated This property is deprecated in favor of `actorDefinition.input`.
172
- */
173
- inputSchema?: string;
174
- /**
175
- * @deprecated This property is deprecated in favor of `actorDefinition.readme`.
176
- */
177
- readme?: string;
178
- buildNumber: string;
179
- /**
180
- * @since Added in 2.7.2
181
- */
182
- usage?: BuildUsage;
183
- /**
184
- * @since Added in 2.7.2
185
- */
186
- usageTotalUsd?: number;
187
- /**
188
- * @since Added in 2.7.2
189
- */
190
- usageUsd?: BuildUsage;
191
- /**
192
- * @since Added in 2.11.0
193
- */
194
- actorDefinition?: ActorDefinition;
195
- }
196
- /**
197
- * Resource usage for an Actor build.
198
- * @since Added in 2.7.2
199
- */
200
- export interface BuildUsage {
201
- ACTOR_COMPUTE_UNITS?: number;
202
- }
203
- /**
204
- * Runtime statistics for an Actor build.
205
- */
206
- export interface BuildStats {
207
- durationMillis: number;
208
- runTimeSecs: number;
209
- computeUnits: number;
210
- }
211
- /**
212
- * Configuration options used for an Actor build.
213
- */
214
- export interface BuildOptions {
215
- useCache?: boolean;
216
- betaPackages?: boolean;
217
- memoryMbytes?: number;
218
- diskMbytes?: number;
219
- }
220
146
  /**
221
147
  * OpenAPI specification for an Actor.
222
148
  *
@@ -283,4 +209,3 @@ interface OpenApiOperation {
283
209
  };
284
210
  };
285
211
  }
286
- export {};
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildClient = void 0;
4
- const zod_1 = require("zod");
5
- const resource_client_1 = require("../base/resource_client");
6
- const utils_1 = require("../utils");
7
- const log_1 = require("./log");
8
- const getOptionsSchema = zod_1.z.strictObject({ waitForFinish: zod_1.z.number().optional() });
9
- const waitForFinishOptionsSchema = zod_1.z.strictObject({ waitSecs: zod_1.z.number().optional() });
1
+ import { z } from 'zod';
2
+ import { ResourceClient } from '../base/resource_client.js';
3
+ import * as schemas from '../schemas.js';
4
+ import { parseArgument, parseResponse } from '../utils.js';
5
+ import { LogClient } from './log.js';
6
+ const getOptionsSchema = z.strictObject({ waitForFinish: z.number().optional() });
7
+ const waitForFinishOptionsSchema = z.strictObject({ waitSecs: z.number().optional() });
10
8
  /**
11
9
  * Client for managing a specific Actor build.
12
10
  *
@@ -30,7 +28,7 @@ const waitForFinishOptionsSchema = zod_1.z.strictObject({ waitSecs: zod_1.z.numb
30
28
  *
31
29
  * @see https://docs.apify.com/platform/actors/running/runs-and-builds#builds
32
30
  */
33
- class BuildClient extends resource_client_1.ResourceClient {
31
+ export class BuildClient extends ResourceClient {
34
32
  /**
35
33
  * @hidden
36
34
  */
@@ -59,8 +57,8 @@ class BuildClient extends resource_client_1.ResourceClient {
59
57
  * ```
60
58
  */
61
59
  async get(options = {}) {
62
- const parsed = (0, utils_1.parseArgument)(options, getOptionsSchema, 'BuildClientGetOptions');
63
- return this._get(parsed);
60
+ const parsed = parseArgument(options, getOptionsSchema, 'BuildClientGetOptions');
61
+ return this._get(schemas.Build(), parsed);
64
62
  }
65
63
  /**
66
64
  * Aborts the Actor build.
@@ -81,7 +79,7 @@ class BuildClient extends resource_client_1.ResourceClient {
81
79
  method: 'POST',
82
80
  params: this._params(),
83
81
  });
84
- return (0, utils_1.cast)((0, utils_1.parseDateFields)((0, utils_1.pluckData)(response.data)));
82
+ return parseResponse(response, schemas.Build());
85
83
  }
86
84
  /**
87
85
  * Deletes the Actor build.
@@ -138,8 +136,8 @@ class BuildClient extends resource_client_1.ResourceClient {
138
136
  * ```
139
137
  */
140
138
  async waitForFinish(options = {}) {
141
- const parsed = (0, utils_1.parseArgument)(options, waitForFinishOptionsSchema, 'BuildClientWaitForFinishOptions');
142
- return this._waitForFinish(parsed);
139
+ const parsed = parseArgument(options, waitForFinishOptionsSchema, 'BuildClientWaitForFinishOptions');
140
+ return this._waitForFinish(schemas.Build(), parsed);
143
141
  }
144
142
  /**
145
143
  * Returns a client for accessing the log of this Actor build.
@@ -156,9 +154,8 @@ class BuildClient extends resource_client_1.ResourceClient {
156
154
  * @since Added in 2.9.0
157
155
  */
158
156
  log() {
159
- return new log_1.LogClient(this._subResourceOptions({
157
+ return new LogClient(this._subResourceOptions({
160
158
  resourcePath: 'log',
161
159
  }));
162
160
  }
163
161
  }
164
- exports.BuildClient = BuildClient;
@@ -1,7 +1,8 @@
1
- import type { ApiClientOptionsWithOptionalResourcePath } from '../base/api_client';
2
- import { ResourceCollectionClient } from '../base/resource_collection_client';
3
- import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils';
4
- import type { Build } from './build';
1
+ import type { ApiClientOptionsWithOptionalResourcePath } from '../base/api_client.js';
2
+ import { ResourceCollectionClient } from '../base/resource_collection_client.js';
3
+ import type { BuildCollectionClientListItem } from '../models.js';
4
+ import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils.js';
5
+ export type { BuildCollectionClientListItem } from '../models.js';
5
6
  /**
6
7
  * Client for managing the collection of Actor builds.
7
8
  *
@@ -53,5 +54,4 @@ export declare class BuildCollectionClient extends ResourceCollectionClient {
53
54
  export interface BuildCollectionClientListOptions extends PaginationOptions {
54
55
  desc?: boolean;
55
56
  }
56
- export type BuildCollectionClientListItem = Required<Pick<Build, 'id' | 'status' | 'startedAt' | 'finishedAt'>> & Partial<Pick<Build, 'meta' | 'usageTotalUsd'>>;
57
57
  export type BuildCollectionClientListResult = PaginatedList<BuildCollectionClientListItem>;
@@ -1,12 +1,10 @@
1
- "use strict";
2
- Object.defineProperty(exports, "__esModule", { value: true });
3
- exports.BuildCollectionClient = void 0;
4
- const zod_1 = require("zod");
5
- const resource_collection_client_1 = require("../base/resource_collection_client");
6
- const utils_1 = require("../utils");
7
- const listOptionsSchema = zod_1.z.strictObject({
8
- ...utils_1.paginationOptionsShape,
9
- desc: zod_1.z.boolean().optional(),
1
+ import { z } from 'zod';
2
+ import { ResourceCollectionClient } from '../base/resource_collection_client.js';
3
+ import * as schemas from '../schemas.js';
4
+ import { paginationOptionsShape, parseArgument } from '../utils.js';
5
+ const listOptionsSchema = z.strictObject({
6
+ ...paginationOptionsShape,
7
+ desc: z.boolean().optional(),
10
8
  });
11
9
  /**
12
10
  * Client for managing the collection of Actor builds.
@@ -29,7 +27,7 @@ const listOptionsSchema = zod_1.z.strictObject({
29
27
  *
30
28
  * @see https://docs.apify.com/platform/actors/running/runs-and-builds#builds
31
29
  */
32
- class BuildCollectionClient extends resource_collection_client_1.ResourceCollectionClient {
30
+ export class BuildCollectionClient extends ResourceCollectionClient {
33
31
  /**
34
32
  * @hidden
35
33
  */
@@ -60,8 +58,7 @@ class BuildCollectionClient extends resource_collection_client_1.ResourceCollect
60
58
  * @see https://docs.apify.com/api/v2/actor-builds-get
61
59
  */
62
60
  list(options = {}) {
63
- const parsed = (0, utils_1.parseArgument)(options, listOptionsSchema, 'BuildCollectionClientListOptions');
64
- return this._listPaginated(parsed);
61
+ const parsed = parseArgument(options, listOptionsSchema, 'BuildCollectionClientListOptions');
62
+ return this._listPaginated(schemas.ListOfBuilds(), parsed);
65
63
  }
66
64
  }
67
- exports.BuildCollectionClient = BuildCollectionClient;
@@ -1,7 +1,9 @@
1
1
  import type { STORAGE_GENERAL_ACCESS } from '@apify/consts';
2
- import type { ApiClientSubResourceOptions } from '../base/api_client';
3
- import { ResourceClient } from '../base/resource_client';
4
- import type { PaginatedIterator, PaginationOptions } from '../utils';
2
+ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
3
+ import { ResourceClient } from '../base/resource_client.js';
4
+ import type { Dataset, DatasetStatistics } from '../models.js';
5
+ import type { PaginatedIterator, PaginationOptions } from '../utils.js';
6
+ export type { Dataset, DatasetStatistics, DatasetStats, FieldStatistics } from '../models.js';
5
7
  /**
6
8
  * Client for managing a specific Dataset.
7
9
  *
@@ -142,7 +144,7 @@ export declare class DatasetClient<Data extends Record<string | number, any> = R
142
144
  * });
143
145
  * ```
144
146
  */
145
- downloadItems(format: DownloadItemsFormat, options?: DatasetClientDownloadItemsOptions): Promise<Buffer>;
147
+ downloadItems(format: `${DownloadItemsFormat}`, options?: DatasetClientDownloadItemsOptions): Promise<Buffer>;
146
148
  /**
147
149
  * Stores one or more items into the dataset.
148
150
  *
@@ -222,55 +224,6 @@ export declare class DatasetClient<Data extends Record<string | number, any> = R
222
224
  createItemsPublicUrl(options?: DatasetClientCreateItemsUrlOptions): Promise<string>;
223
225
  private _createPaginationList;
224
226
  }
225
- /**
226
- * Represents a dataset storage on the Apify platform.
227
- *
228
- * Datasets store structured data as a sequence of items (records). Each item is a JSON object.
229
- * Datasets are useful for storing results from web scraping, crawling, or data processing tasks.
230
- */
231
- export interface Dataset {
232
- id: string;
233
- name?: string;
234
- /**
235
- * @since Added in 2.6.1
236
- */
237
- title?: string;
238
- userId: string;
239
- /**
240
- * @since Added in 2.21.0
241
- */
242
- username?: string;
243
- createdAt: Date;
244
- modifiedAt: Date;
245
- accessedAt: Date;
246
- itemCount: number;
247
- cleanItemCount: number;
248
- actId?: string;
249
- actRunId?: string;
250
- stats: DatasetStats;
251
- fields: string[];
252
- /**
253
- * @since Added in 2.12.2
254
- */
255
- generalAccess?: STORAGE_GENERAL_ACCESS | null;
256
- /**
257
- * @since Added in 2.13.0
258
- */
259
- urlSigningSecretKey?: string | null;
260
- /**
261
- * @since Added in 2.13.0
262
- */
263
- itemsPublicUrl: string;
264
- }
265
- /**
266
- * Statistics about dataset usage and storage.
267
- */
268
- export interface DatasetStats {
269
- readCount?: number;
270
- writeCount?: number;
271
- deleteCount?: number;
272
- storageBytes?: number;
273
- }
274
227
  /**
275
228
  * Options for updating a dataset.
276
229
  */
@@ -348,22 +301,3 @@ export interface DatasetClientDownloadItemsOptions extends Omit<DatasetClientLis
348
301
  xmlRoot?: string;
349
302
  xmlRow?: string;
350
303
  }
351
- /**
352
- * Statistical information about dataset fields.
353
- *
354
- * Provides insights into the data structure and content of the dataset.
355
- * @since Added in 2.11.2
356
- */
357
- export interface DatasetStatistics {
358
- fieldStatistics: Record<string, FieldStatistics>;
359
- }
360
- /**
361
- * Statistics for a single field in a dataset.
362
- * @since Added in 2.11.2
363
- */
364
- export interface FieldStatistics {
365
- min?: number;
366
- max?: number;
367
- nullCount?: number;
368
- emptyCount?: number;
369
- }