apify-client 3.0.0-beta.51 → 3.0.0-beta.53
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/apify_api_error.d.ts +4 -4
- package/dist/apify_api_error.js +1 -1
- package/dist/base/resource_client.js +13 -7
- package/dist/bundle.js +2 -2
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +173 -177
- package/dist/generated/schemas.d.ts +51 -101
- package/dist/generated/schemas.js +91 -94
- package/dist/http_clients/base.d.ts +2 -4
- package/dist/models.d.ts +157 -180
- package/dist/models.js +6 -4
- package/dist/resource_clients/actor.d.ts +7 -7
- package/dist/resource_clients/actor.js +2 -2
- package/dist/resource_clients/actor_collection.d.ts +10 -10
- package/dist/resource_clients/actor_collection.js +1 -1
- package/dist/resource_clients/actor_env_var.d.ts +3 -3
- package/dist/resource_clients/actor_env_var_collection.d.ts +4 -4
- package/dist/resource_clients/actor_version.d.ts +5 -5
- package/dist/resource_clients/actor_version_collection.d.ts +4 -4
- package/dist/resource_clients/build.d.ts +2 -1
- package/dist/resource_clients/build.js +1 -0
- package/dist/resource_clients/build_collection.d.ts +4 -4
- package/dist/resource_clients/dataset.d.ts +4 -4
- package/dist/resource_clients/dataset.js +2 -2
- package/dist/resource_clients/dataset_collection.d.ts +4 -4
- package/dist/resource_clients/dataset_collection.js +1 -1
- package/dist/resource_clients/key_value_store.d.ts +6 -6
- package/dist/resource_clients/key_value_store.js +2 -2
- package/dist/resource_clients/key_value_store_collection.d.ts +4 -4
- package/dist/resource_clients/key_value_store_collection.js +1 -1
- package/dist/resource_clients/request_queue.d.ts +18 -18
- package/dist/resource_clients/request_queue.js +3 -3
- package/dist/resource_clients/request_queue_collection.d.ts +4 -4
- package/dist/resource_clients/request_queue_collection.js +1 -1
- package/dist/resource_clients/run.d.ts +16 -15
- package/dist/resource_clients/run.js +8 -7
- package/dist/resource_clients/run_collection.d.ts +2 -2
- package/dist/resource_clients/schedule.d.ts +3 -3
- package/dist/resource_clients/schedule.js +1 -1
- package/dist/resource_clients/store_collection.d.ts +3 -3
- package/dist/resource_clients/task.d.ts +3 -3
- package/dist/resource_clients/task_collection.d.ts +3 -3
- package/dist/resource_clients/user.d.ts +4 -4
- package/dist/resource_clients/webhook.d.ts +5 -5
- package/dist/resource_clients/webhook.js +2 -2
- package/dist/resource_clients/webhook_collection.d.ts +3 -3
- package/dist/resource_clients/webhook_collection.js +1 -1
- package/dist/utils.d.ts +3 -3
- package/package.json +1 -1
package/dist/models.js
CHANGED
|
@@ -1,6 +1,8 @@
|
|
|
1
1
|
/**
|
|
2
2
|
* Public models adapted from the generated OpenAPI types in `./generated/api`.
|
|
3
3
|
*
|
|
4
|
+
* Each model takes the name of the spec schema it is declared on, as the Python client does.
|
|
5
|
+
*
|
|
4
6
|
* The generated file is never re-exported directly. Every type here is declared on top of a generated
|
|
5
7
|
* schema so the compiler reports drift, and the spec is adopted as-is wherever it is trustworthy. What
|
|
6
8
|
* remains is deliberately small, and each deviation falls into exactly one of five kinds, one block per
|
|
@@ -66,10 +68,10 @@ export var ScheduleActions;
|
|
|
66
68
|
/**
|
|
67
69
|
* Platform features a plan can enable.
|
|
68
70
|
*
|
|
69
|
-
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types
|
|
70
|
-
*
|
|
71
|
-
*
|
|
72
|
-
*
|
|
71
|
+
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types as a plain
|
|
72
|
+
* `string[]`: the platform has features this list never gained -- `PROXY_RESIDENTIAL`, `ACTORS_PUBLIC_ALL`
|
|
73
|
+
* and `ACTORS_PUBLIC_DEVELOPER` all appear as keys of `EffectivePlatformFeatures` -- so using it there
|
|
74
|
+
* promised a completeness that was not real. It stays published for comparisons.
|
|
73
75
|
*
|
|
74
76
|
* Declared here rather than in `./resource_clients/user` so the user types can live alongside it. It is
|
|
75
77
|
* re-exported from there, so the public name and import path are unchanged.
|
|
@@ -2,7 +2,7 @@ import { ACTOR_JOB_STATUSES, ACTOR_PERMISSION_LEVEL, META_ORIGINS } from '@apify
|
|
|
2
2
|
import { Log } from '@apify/log';
|
|
3
3
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
4
4
|
import { ResourceClient } from '../base/resource_client.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { ActorResource, Run } from '../models.js';
|
|
6
6
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
7
7
|
import type { Dictionary } from '../utils.js';
|
|
8
8
|
import { ActorVersionClient } from './actor_version.js';
|
|
@@ -15,7 +15,7 @@ import { RunCollectionClient } from './run_collection.js';
|
|
|
15
15
|
import type { WebhookUpdateData } from './webhook.js';
|
|
16
16
|
import { WebhookCollectionClient } from './webhook_collection.js';
|
|
17
17
|
import type { ValueOf } from 'type-fest';
|
|
18
|
-
export type {
|
|
18
|
+
export type { ActorResource, ActorChargeEvent, ActorChargeEvents, ActorDefinition, ActorRunPricingInfo, ActorRunStorageIds, ActorStandby, ActorStats, DefaultRunOptions, ExampleRunInput, FlatPricePerMonthActorPricingInfo, FreeActorPricingInfo, RunMetamorphEvent, PayPerEventActorPricingInfo, PricePerDatasetItemActorPricingInfo, Run, RunMeta, RunOptions, RunListItem, RunStats, RunUsage, TaggedBuildInfo, TaggedBuilds, TieredPricingPerDatasetItem, TieredPricingPerDatasetItemEntry, TieredPricingPerEvent, TieredPricingPerEventEntry, } from '../models.js';
|
|
19
19
|
/**
|
|
20
20
|
* Client for managing a specific Actor.
|
|
21
21
|
*
|
|
@@ -49,7 +49,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
49
49
|
* @returns The Actor object, or `undefined` if it does not exist
|
|
50
50
|
* @see https://docs.apify.com/api/v2/act-get
|
|
51
51
|
*/
|
|
52
|
-
get(options?: TimeoutOptions): Promise<
|
|
52
|
+
get(options?: TimeoutOptions): Promise<ActorResource | undefined>;
|
|
53
53
|
/**
|
|
54
54
|
* Updates the Actor with specified fields.
|
|
55
55
|
*
|
|
@@ -59,7 +59,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
59
59
|
* @returns The updated Actor object
|
|
60
60
|
* @see https://docs.apify.com/api/v2/act-put
|
|
61
61
|
*/
|
|
62
|
-
update(newFields: ActorUpdateOptions, options?: TimeoutOptions): Promise<
|
|
62
|
+
update(newFields: ActorUpdateOptions, options?: TimeoutOptions): Promise<ActorResource>;
|
|
63
63
|
/**
|
|
64
64
|
* Deletes the Actor.
|
|
65
65
|
*
|
|
@@ -105,7 +105,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
105
105
|
* );
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
|
-
start(input?: ActorInput, options?: ActorStartOptions): Promise<
|
|
108
|
+
start(input?: ActorInput, options?: ActorStartOptions): Promise<Run>;
|
|
109
109
|
/**
|
|
110
110
|
* Starts the Actor and waits for it to finish before returning the Run object.
|
|
111
111
|
*
|
|
@@ -147,7 +147,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
147
147
|
* const run = await client.actor('my-actor').call({ url: 'https://example.com' }, { log });
|
|
148
148
|
* ```
|
|
149
149
|
*/
|
|
150
|
-
call(input?: ActorInput, options?: ActorCallOptions): Promise<
|
|
150
|
+
call(input?: ActorInput, options?: ActorCallOptions): Promise<Run>;
|
|
151
151
|
/**
|
|
152
152
|
* Validates the provided input for the Actor against its input schema.
|
|
153
153
|
*
|
|
@@ -297,7 +297,7 @@ export declare class ActorClient extends ResourceClient {
|
|
|
297
297
|
/**
|
|
298
298
|
* Fields that can be updated when modifying an Actor.
|
|
299
299
|
*/
|
|
300
|
-
export type ActorUpdateOptions = Partial<Pick<
|
|
300
|
+
export type ActorUpdateOptions = Partial<Pick<ActorResource, 'name' | 'description' | 'isPublic' | 'isDeprecated' | 'seoTitle' | 'seoDescription' | 'title' | 'versions' | 'categories' | 'defaultRunOptions' | 'actorStandby' | 'actorPermissionLevel' | 'taggedBuilds'>>;
|
|
301
301
|
/**
|
|
302
302
|
* Input for an Actor run, as taken by {@link ActorClient.start}, {@link ActorClient.call},
|
|
303
303
|
* {@link ActorClient.validateInput} and {@link RunClient.metamorph}.
|
|
@@ -100,7 +100,7 @@ export class ActorClient extends ResourceClient {
|
|
|
100
100
|
*/
|
|
101
101
|
async get(options = {}) {
|
|
102
102
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
103
|
-
return this.getResource(schemas.
|
|
103
|
+
return this.getResource(schemas.ActorResource(), {}, timeoutSecs, signal);
|
|
104
104
|
}
|
|
105
105
|
/**
|
|
106
106
|
* Updates the Actor with specified fields.
|
|
@@ -114,7 +114,7 @@ export class ActorClient extends ResourceClient {
|
|
|
114
114
|
async update(newFields, options = {}) {
|
|
115
115
|
parseArgument(newFields, anyObjectSchema);
|
|
116
116
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
117
|
-
return this.updateResource(schemas.
|
|
117
|
+
return this.updateResource(schemas.ActorResource(), newFields, timeoutSecs, signal);
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
* Deletes the Actor.
|
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
import type { ACTOR_PERMISSION_LEVEL } from '@apify/consts';
|
|
2
2
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { ActorListItem } from '../models.js';
|
|
5
5
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
6
6
|
import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils.js';
|
|
7
|
-
import type {
|
|
8
|
-
import type {
|
|
9
|
-
export type {
|
|
7
|
+
import type { ActorResource, ActorStandby, DefaultRunOptions, ExampleRunInput } from './actor.js';
|
|
8
|
+
import type { Version } from './actor_version.js';
|
|
9
|
+
export type { ActorListItem } from '../models.js';
|
|
10
10
|
/**
|
|
11
11
|
* Client for managing the collection of Actors in your account.
|
|
12
12
|
*
|
|
@@ -56,7 +56,7 @@ export declare class ActorCollectionClient extends ResourceCollectionClient {
|
|
|
56
56
|
* @returns A paginated iterator of Actors.
|
|
57
57
|
* @see https://docs.apify.com/api/v2/acts-get
|
|
58
58
|
*/
|
|
59
|
-
list(options?: ActorCollectionListOptions): PaginatedIterator<
|
|
59
|
+
list(options?: ActorCollectionListOptions): PaginatedIterator<ActorListItem>;
|
|
60
60
|
/**
|
|
61
61
|
* Creates a new Actor.
|
|
62
62
|
*
|
|
@@ -66,7 +66,7 @@ export declare class ActorCollectionClient extends ResourceCollectionClient {
|
|
|
66
66
|
* @returns The created Actor object.
|
|
67
67
|
* @see https://docs.apify.com/api/v2/acts-post
|
|
68
68
|
*/
|
|
69
|
-
create(actor: ActorCollectionCreateOptions, options?: TimeoutOptions): Promise<
|
|
69
|
+
create(actor: ActorCollectionCreateOptions, options?: TimeoutOptions): Promise<ActorResource>;
|
|
70
70
|
}
|
|
71
71
|
/**
|
|
72
72
|
* Field to order a list of Actors by.
|
|
@@ -85,7 +85,7 @@ export interface ActorCollectionListOptions extends PaginationOptions, TimeoutOp
|
|
|
85
85
|
*/
|
|
86
86
|
sortBy?: `${ActorListSortBy}`;
|
|
87
87
|
}
|
|
88
|
-
export type ActorCollectionListResult = PaginatedList<
|
|
88
|
+
export type ActorCollectionListResult = PaginatedList<ActorListItem>;
|
|
89
89
|
export interface ActorCollectionCreateOptions {
|
|
90
90
|
/**
|
|
91
91
|
* @since Added in 2.8.6
|
|
@@ -94,12 +94,12 @@ export interface ActorCollectionCreateOptions {
|
|
|
94
94
|
/**
|
|
95
95
|
* @since Added in 2.8.6
|
|
96
96
|
*/
|
|
97
|
-
defaultRunOptions?:
|
|
97
|
+
defaultRunOptions?: DefaultRunOptions;
|
|
98
98
|
description?: string;
|
|
99
99
|
/**
|
|
100
100
|
* @since Added in 2.8.6
|
|
101
101
|
*/
|
|
102
|
-
exampleRunInput?:
|
|
102
|
+
exampleRunInput?: ExampleRunInput;
|
|
103
103
|
/**
|
|
104
104
|
* @since Added in 2.8.6
|
|
105
105
|
*/
|
|
@@ -115,7 +115,7 @@ export interface ActorCollectionCreateOptions {
|
|
|
115
115
|
*/
|
|
116
116
|
seoDescription?: string;
|
|
117
117
|
title?: string;
|
|
118
|
-
versions?:
|
|
118
|
+
versions?: Version[];
|
|
119
119
|
/**
|
|
120
120
|
* @since Added in 2.9.5
|
|
121
121
|
*/
|
|
@@ -74,7 +74,7 @@ export class ActorCollectionClient extends ResourceCollectionClient {
|
|
|
74
74
|
async create(actor, options = {}) {
|
|
75
75
|
parseArgument(actor, actorCreateSchema);
|
|
76
76
|
const { timeoutSecs = 'medium', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
77
|
-
return this.createResource(schemas.
|
|
77
|
+
return this.createResource(schemas.ActorResource(), actor, timeoutSecs, signal);
|
|
78
78
|
}
|
|
79
79
|
}
|
|
80
80
|
/**
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client.js';
|
|
3
3
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { EnvVar } from './actor_version.js';
|
|
5
5
|
/**
|
|
6
6
|
* Client for managing a specific Actor environment variable.
|
|
7
7
|
*
|
|
@@ -38,7 +38,7 @@ export declare class ActorEnvVarClient extends ResourceClient {
|
|
|
38
38
|
* @returns The environment variable object, or `undefined` if it does not exist.
|
|
39
39
|
* @see https://docs.apify.com/api/v2/act-version-env-var-get
|
|
40
40
|
*/
|
|
41
|
-
get(options?: TimeoutOptions): Promise<
|
|
41
|
+
get(options?: TimeoutOptions): Promise<EnvVar | undefined>;
|
|
42
42
|
/**
|
|
43
43
|
* Updates the environment variable.
|
|
44
44
|
*
|
|
@@ -48,7 +48,7 @@ export declare class ActorEnvVarClient extends ResourceClient {
|
|
|
48
48
|
* @returns The updated environment variable object.
|
|
49
49
|
* @see https://docs.apify.com/api/v2/act-version-env-var-put
|
|
50
50
|
*/
|
|
51
|
-
update(actorEnvVar:
|
|
51
|
+
update(actorEnvVar: EnvVar, options?: TimeoutOptions): Promise<EnvVar>;
|
|
52
52
|
/**
|
|
53
53
|
* Deletes the environment variable.
|
|
54
54
|
*
|
|
@@ -2,7 +2,7 @@ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
|
2
2
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
3
3
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
4
4
|
import type { PaginatedList } from '../utils.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { EnvVar } from './actor_version.js';
|
|
6
6
|
/**
|
|
7
7
|
* Client for managing the collection of environment variables for an Actor version.
|
|
8
8
|
*
|
|
@@ -55,7 +55,7 @@ export declare class ActorEnvVarCollectionClient extends ResourceCollectionClien
|
|
|
55
55
|
* @returns The environment variables, awaitable as a whole list or iterable one by one.
|
|
56
56
|
* @see https://docs.apify.com/api/v2/act-version-env-vars-get
|
|
57
57
|
*/
|
|
58
|
-
list(options?: TimeoutOptions): Promise<ActorEnvVarListResult> & AsyncIterable<
|
|
58
|
+
list(options?: TimeoutOptions): Promise<ActorEnvVarListResult> & AsyncIterable<EnvVar>;
|
|
59
59
|
/**
|
|
60
60
|
* Creates a new environment variable for this Actor version.
|
|
61
61
|
*
|
|
@@ -65,9 +65,9 @@ export declare class ActorEnvVarCollectionClient extends ResourceCollectionClien
|
|
|
65
65
|
* @returns The created environment variable object.
|
|
66
66
|
* @see https://docs.apify.com/api/v2/act-version-env-vars-post
|
|
67
67
|
*/
|
|
68
|
-
create(actorEnvVar:
|
|
68
|
+
create(actorEnvVar: EnvVar, options?: TimeoutOptions): Promise<EnvVar>;
|
|
69
69
|
}
|
|
70
70
|
/**
|
|
71
71
|
* @since Added in 2.1.0
|
|
72
72
|
*/
|
|
73
|
-
export type ActorEnvVarListResult = Pick<PaginatedList<
|
|
73
|
+
export type ActorEnvVarListResult = Pick<PaginatedList<EnvVar>, 'total' | 'items'>;
|
|
@@ -1,10 +1,10 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { FinalVersion, Version } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import { ActorEnvVarClient } from './actor_env_var.js';
|
|
6
6
|
import { ActorEnvVarCollectionClient } from './actor_env_var_collection.js';
|
|
7
|
-
export type {
|
|
7
|
+
export type { BaseVersion, EnvVar, FinalVersion, SourceCodeFile, SourceCodeFolder, Version, VersionGitHubGist, VersionGitRepo, VersionSourceCode, VersionSourceFiles, VersionTarball, } from '../models.js';
|
|
8
8
|
export { ActorSourceType } from '../models.js';
|
|
9
9
|
/**
|
|
10
10
|
* Client for managing a specific Actor version.
|
|
@@ -40,7 +40,7 @@ export declare class ActorVersionClient extends ResourceClient {
|
|
|
40
40
|
* @returns The Actor version object, or `undefined` if it does not exist.
|
|
41
41
|
* @see https://docs.apify.com/api/v2/act-version-get
|
|
42
42
|
*/
|
|
43
|
-
get(options?: TimeoutOptions): Promise<
|
|
43
|
+
get(options?: TimeoutOptions): Promise<FinalVersion | undefined>;
|
|
44
44
|
/**
|
|
45
45
|
* Updates the Actor version with the specified fields.
|
|
46
46
|
*
|
|
@@ -50,7 +50,7 @@ export declare class ActorVersionClient extends ResourceClient {
|
|
|
50
50
|
* @returns The updated Actor version object.
|
|
51
51
|
* @see https://docs.apify.com/api/v2/act-version-put
|
|
52
52
|
*/
|
|
53
|
-
update(newFields: ActorVersionUpdateData, options?: TimeoutOptions): Promise<
|
|
53
|
+
update(newFields: ActorVersionUpdateData, options?: TimeoutOptions): Promise<FinalVersion>;
|
|
54
54
|
/**
|
|
55
55
|
* Deletes the Actor version.
|
|
56
56
|
*
|
|
@@ -84,4 +84,4 @@ export declare class ActorVersionClient extends ResourceClient {
|
|
|
84
84
|
* mention. The version union enforces the pairing: a `sourceType` can only be sent next to the
|
|
85
85
|
* source location it implies, never next to one of the other three.
|
|
86
86
|
*/
|
|
87
|
-
export type ActorVersionUpdateData = Partial<
|
|
87
|
+
export type ActorVersionUpdateData = Partial<Version>;
|
|
@@ -2,7 +2,7 @@ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
|
2
2
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
3
3
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
4
4
|
import type { PaginatedList } from '../utils.js';
|
|
5
|
-
import type {
|
|
5
|
+
import type { FinalVersion, Version } from './actor_version.js';
|
|
6
6
|
/**
|
|
7
7
|
* Client for managing the collection of Actor versions.
|
|
8
8
|
*
|
|
@@ -54,7 +54,7 @@ export declare class ActorVersionCollectionClient extends ResourceCollectionClie
|
|
|
54
54
|
* @returns The Actor versions, awaitable as a whole list or iterable one by one.
|
|
55
55
|
* @see https://docs.apify.com/api/v2/act-versions-get
|
|
56
56
|
*/
|
|
57
|
-
list(options?: TimeoutOptions): Promise<ActorVersionListResult> & AsyncIterable<
|
|
57
|
+
list(options?: TimeoutOptions): Promise<ActorVersionListResult> & AsyncIterable<FinalVersion>;
|
|
58
58
|
/**
|
|
59
59
|
* Creates a new Actor version.
|
|
60
60
|
*
|
|
@@ -64,6 +64,6 @@ export declare class ActorVersionCollectionClient extends ResourceCollectionClie
|
|
|
64
64
|
* @returns The created Actor version object.
|
|
65
65
|
* @see https://docs.apify.com/api/v2/act-versions-post
|
|
66
66
|
*/
|
|
67
|
-
create(actorVersion:
|
|
67
|
+
create(actorVersion: Version, options?: TimeoutOptions): Promise<FinalVersion>;
|
|
68
68
|
}
|
|
69
|
-
export type ActorVersionListResult = Pick<PaginatedList<
|
|
69
|
+
export type ActorVersionListResult = Pick<PaginatedList<FinalVersion>, 'total' | 'items'>;
|
|
@@ -3,7 +3,7 @@ import { ResourceClient } from '../base/resource_client.js';
|
|
|
3
3
|
import type { Build } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import { LogClient } from './log.js';
|
|
6
|
-
export type { Build,
|
|
6
|
+
export type { Build, BuildOptions, BuildStats, BuildUsage, BuildMeta } from '../models.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing a specific Actor build.
|
|
9
9
|
*
|
|
@@ -98,6 +98,7 @@ export declare class BuildClient extends ResourceClient {
|
|
|
98
98
|
* Unlike the `waitForFinish` parameter in {@link get}, this method can wait indefinitely
|
|
99
99
|
* by polling the build status. It uses the `waitForFinish` parameter internally (max 60s per call)
|
|
100
100
|
* and continuously polls until the build finishes or the timeout is reached.
|
|
101
|
+
* Rejects with a {@link NotFoundError} if the build keeps returning 404 for 3 seconds.
|
|
101
102
|
*
|
|
102
103
|
* This is useful when you need to immediately start a run after a build finishes.
|
|
103
104
|
*
|
|
@@ -131,6 +131,7 @@ export class BuildClient extends ResourceClient {
|
|
|
131
131
|
* Unlike the `waitForFinish` parameter in {@link get}, this method can wait indefinitely
|
|
132
132
|
* by polling the build status. It uses the `waitForFinish` parameter internally (max 60s per call)
|
|
133
133
|
* and continuously polls until the build finishes or the timeout is reached.
|
|
134
|
+
* Rejects with a {@link NotFoundError} if the build keeps returning 404 for 3 seconds.
|
|
134
135
|
*
|
|
135
136
|
* This is useful when you need to immediately start a run after a build finishes.
|
|
136
137
|
*
|
|
@@ -1,9 +1,9 @@
|
|
|
1
1
|
import type { ApiClientOptionsWithOptionalResourcePath } from '../base/api_client.js';
|
|
2
2
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
3
|
-
import type {
|
|
3
|
+
import type { BuildListItem } from '../models.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils.js';
|
|
6
|
-
export type {
|
|
6
|
+
export type { BuildListItem } from '../models.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing the collection of Actor builds.
|
|
9
9
|
*
|
|
@@ -51,9 +51,9 @@ export declare class BuildCollectionClient extends ResourceCollectionClient {
|
|
|
51
51
|
* @returns A paginated iterator of Actor builds.
|
|
52
52
|
* @see https://docs.apify.com/api/v2/actor-builds-get
|
|
53
53
|
*/
|
|
54
|
-
list(options?: BuildCollectionClientListOptions): PaginatedIterator<
|
|
54
|
+
list(options?: BuildCollectionClientListOptions): PaginatedIterator<BuildListItem>;
|
|
55
55
|
}
|
|
56
56
|
export interface BuildCollectionClientListOptions extends PaginationOptions, TimeoutOptions {
|
|
57
57
|
desc?: boolean;
|
|
58
58
|
}
|
|
59
|
-
export type BuildCollectionClientListResult = PaginatedList<
|
|
59
|
+
export type BuildCollectionClientListResult = PaginatedList<BuildListItem>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import type { STORAGE_GENERAL_ACCESS } from '@apify/consts';
|
|
2
2
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
3
3
|
import { ResourceClient } from '../base/resource_client.js';
|
|
4
|
-
import type {
|
|
4
|
+
import type { DatasetResource, DatasetStatistics } from '../models.js';
|
|
5
5
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
6
6
|
import type { PaginatedIterator, PaginationOptions } from '../utils.js';
|
|
7
7
|
/**
|
|
@@ -16,7 +16,7 @@ export declare enum DownloadItemsFormat {
|
|
|
16
16
|
XLSX = "xlsx",
|
|
17
17
|
RSS = "rss"
|
|
18
18
|
}
|
|
19
|
-
export type {
|
|
19
|
+
export type { DatasetResource, DatasetFieldStatistics, DatasetStatistics, DatasetStats } from '../models.js';
|
|
20
20
|
/**
|
|
21
21
|
* Client for managing a specific Dataset.
|
|
22
22
|
*
|
|
@@ -60,7 +60,7 @@ export declare class DatasetClient<Data extends Record<string | number, any> = R
|
|
|
60
60
|
* @returns The Dataset object, or `undefined` if it does not exist
|
|
61
61
|
* @see https://docs.apify.com/api/v2/dataset-get
|
|
62
62
|
*/
|
|
63
|
-
get(options?: TimeoutOptions): Promise<
|
|
63
|
+
get(options?: TimeoutOptions): Promise<DatasetResource | undefined>;
|
|
64
64
|
/**
|
|
65
65
|
* Updates the dataset with specified fields.
|
|
66
66
|
*
|
|
@@ -70,7 +70,7 @@ export declare class DatasetClient<Data extends Record<string | number, any> = R
|
|
|
70
70
|
* @returns The updated Dataset object
|
|
71
71
|
* @see https://docs.apify.com/api/v2/dataset-put
|
|
72
72
|
*/
|
|
73
|
-
update(newFields: DatasetClientUpdateOptions, options?: TimeoutOptions): Promise<
|
|
73
|
+
update(newFields: DatasetClientUpdateOptions, options?: TimeoutOptions): Promise<DatasetResource>;
|
|
74
74
|
/**
|
|
75
75
|
* Deletes the dataset.
|
|
76
76
|
*
|
|
@@ -126,7 +126,7 @@ export class DatasetClient extends ResourceClient {
|
|
|
126
126
|
*/
|
|
127
127
|
async get(options = {}) {
|
|
128
128
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
129
|
-
return this.getResource(schemas.
|
|
129
|
+
return this.getResource(schemas.DatasetResource(), {}, timeoutSecs, signal);
|
|
130
130
|
}
|
|
131
131
|
/**
|
|
132
132
|
* Updates the dataset with specified fields.
|
|
@@ -140,7 +140,7 @@ export class DatasetClient extends ResourceClient {
|
|
|
140
140
|
async update(newFields, options = {}) {
|
|
141
141
|
parseArgument(newFields, anyObjectSchema);
|
|
142
142
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
143
|
-
return this.updateResource(schemas.
|
|
143
|
+
return this.updateResource(schemas.DatasetResource(), newFields, timeoutSecs, signal);
|
|
144
144
|
}
|
|
145
145
|
/**
|
|
146
146
|
* Deletes the dataset.
|
|
@@ -3,7 +3,7 @@ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedList, PaginationOptions } from '../utils.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { DatasetResource } from './dataset.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing the collection of datasets in your account.
|
|
9
9
|
*
|
|
@@ -50,7 +50,7 @@ export declare class DatasetCollectionClient extends ResourceCollectionClient {
|
|
|
50
50
|
* @returns A paginated iterator of Datasets.
|
|
51
51
|
* @see https://docs.apify.com/api/v2/datasets-get
|
|
52
52
|
*/
|
|
53
|
-
list(options?: DatasetCollectionClientListOptions): Promise<DatasetCollectionClientListResult> & AsyncIterable<
|
|
53
|
+
list(options?: DatasetCollectionClientListOptions): Promise<DatasetCollectionClientListResult> & AsyncIterable<DatasetResource>;
|
|
54
54
|
/**
|
|
55
55
|
* Gets or creates a dataset with the specified name.
|
|
56
56
|
*
|
|
@@ -61,7 +61,7 @@ export declare class DatasetCollectionClient extends ResourceCollectionClient {
|
|
|
61
61
|
* @returns The dataset object.
|
|
62
62
|
* @see https://docs.apify.com/api/v2/datasets-post
|
|
63
63
|
*/
|
|
64
|
-
getOrCreate(name?: string, options?: DatasetCollectionClientGetOrCreateOptions): Promise<
|
|
64
|
+
getOrCreate(name?: string, options?: DatasetCollectionClientGetOrCreateOptions): Promise<DatasetResource>;
|
|
65
65
|
}
|
|
66
66
|
export interface DatasetCollectionClientListOptions extends PaginationOptions, TimeoutOptions {
|
|
67
67
|
unnamed?: boolean;
|
|
@@ -78,6 +78,6 @@ export interface DatasetCollectionClientListOptions extends PaginationOptions, T
|
|
|
78
78
|
export interface DatasetCollectionClientGetOrCreateOptions extends TimeoutOptions {
|
|
79
79
|
schema?: Record<string, unknown>;
|
|
80
80
|
}
|
|
81
|
-
export type DatasetCollectionClientListResult = PaginatedList<
|
|
81
|
+
export type DatasetCollectionClientListResult = PaginatedList<DatasetResource> & {
|
|
82
82
|
unnamed: boolean;
|
|
83
83
|
};
|
|
@@ -87,6 +87,6 @@ export class DatasetCollectionClient extends ResourceCollectionClient {
|
|
|
87
87
|
// absent when there is nothing else to send.
|
|
88
88
|
const { timeoutSecs = 'short', signal, ...resource } = options ?? {};
|
|
89
89
|
const hasResource = Object.keys(resource).length > 0;
|
|
90
|
-
return this.getOrCreateResource(schemas.
|
|
90
|
+
return this.getOrCreateResource(schemas.DatasetResource(), name, hasResource ? resource : undefined, timeoutSecs, signal);
|
|
91
91
|
}
|
|
92
92
|
}
|
|
@@ -3,9 +3,9 @@ import type { JsonValue, TypedArray } from 'type-fest';
|
|
|
3
3
|
import type { STORAGE_GENERAL_ACCESS } from '@apify/consts';
|
|
4
4
|
import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
5
5
|
import { ResourceClient } from '../base/resource_client.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { KeyValueStoreResource, KeyValueStoreKey, ListOfKeys } from '../models.js';
|
|
7
7
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
8
|
-
export type {
|
|
8
|
+
export type { KeyValueStoreResource, KeyValueStoreKey, KeyValueStoreStats, ListOfKeys } from '../models.js';
|
|
9
9
|
/**
|
|
10
10
|
* Client for managing a specific key-value store.
|
|
11
11
|
*
|
|
@@ -47,7 +47,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
47
47
|
* @returns The KeyValueStore object, or `undefined` if it does not exist
|
|
48
48
|
* @see https://docs.apify.com/api/v2/key-value-store-get
|
|
49
49
|
*/
|
|
50
|
-
get(options?: TimeoutOptions): Promise<
|
|
50
|
+
get(options?: TimeoutOptions): Promise<KeyValueStoreResource | undefined>;
|
|
51
51
|
/**
|
|
52
52
|
* Updates the key-value store with specified fields.
|
|
53
53
|
*
|
|
@@ -60,7 +60,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
60
60
|
* @returns The updated KeyValueStore object
|
|
61
61
|
* @see https://docs.apify.com/api/v2/key-value-store-put
|
|
62
62
|
*/
|
|
63
|
-
update(newFields: KeyValueClientUpdateOptions, options?: TimeoutOptions): Promise<
|
|
63
|
+
update(newFields: KeyValueClientUpdateOptions, options?: TimeoutOptions): Promise<KeyValueStoreResource>;
|
|
64
64
|
/**
|
|
65
65
|
* Deletes the key-value store.
|
|
66
66
|
*
|
|
@@ -105,7 +105,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
105
105
|
* } while (result.isTruncated);
|
|
106
106
|
* ```
|
|
107
107
|
*/
|
|
108
|
-
listKeys(options?: KeyValueClientListKeysOptions): Promise<
|
|
108
|
+
listKeys(options?: KeyValueClientListKeysOptions): Promise<ListOfKeys> & AsyncIterable<KeyValueStoreKey>;
|
|
109
109
|
/**
|
|
110
110
|
* Generates a public URL for accessing a specific record in the key-value store.
|
|
111
111
|
*
|
|
@@ -185,7 +185,7 @@ export declare class KeyValueStoreClient extends ResourceClient {
|
|
|
185
185
|
* use the `stream` option to get a Readable stream.
|
|
186
186
|
*
|
|
187
187
|
* When the record does not exist, the function resolves to `undefined`. It does
|
|
188
|
-
* NOT resolve to a `
|
|
188
|
+
* NOT resolve to a `KeyValueStoreRecord` with an `undefined` value.
|
|
189
189
|
*
|
|
190
190
|
* @param key - The record key
|
|
191
191
|
* @param options - Retrieval options
|
|
@@ -97,7 +97,7 @@ export class KeyValueStoreClient extends ResourceClient {
|
|
|
97
97
|
*/
|
|
98
98
|
async get(options = {}) {
|
|
99
99
|
const { timeoutSecs = 'short', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
100
|
-
return this.getResource(schemas.
|
|
100
|
+
return this.getResource(schemas.KeyValueStoreResource(), {}, timeoutSecs, signal);
|
|
101
101
|
}
|
|
102
102
|
/**
|
|
103
103
|
* Updates the key-value store with specified fields.
|
|
@@ -114,7 +114,7 @@ export class KeyValueStoreClient extends ResourceClient {
|
|
|
114
114
|
async update(newFields, options = {}) {
|
|
115
115
|
parseArgument(newFields, anyObjectSchema);
|
|
116
116
|
const { timeoutSecs = 'long', signal } = parseArgument(options, timeoutOptionsSchema, 'TimeoutOptions');
|
|
117
|
-
return this.updateResource(schemas.
|
|
117
|
+
return this.updateResource(schemas.KeyValueStoreResource(), newFields, timeoutSecs, signal);
|
|
118
118
|
}
|
|
119
119
|
/**
|
|
120
120
|
* Deletes the key-value store.
|
|
@@ -3,7 +3,7 @@ import type { ApiClientSubResourceOptions } from '../base/api_client.js';
|
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client.js';
|
|
4
4
|
import type { TimeoutOptions } from '../timeouts.js';
|
|
5
5
|
import type { PaginatedList, PaginationOptions } from '../utils.js';
|
|
6
|
-
import type {
|
|
6
|
+
import type { KeyValueStoreResource } from './key_value_store.js';
|
|
7
7
|
/**
|
|
8
8
|
* Client for managing the collection of Key-value stores in your account.
|
|
9
9
|
*
|
|
@@ -50,7 +50,7 @@ export declare class KeyValueStoreCollectionClient extends ResourceCollectionCli
|
|
|
50
50
|
* @returns A paginated iterator of Key-value stores.
|
|
51
51
|
* @see https://docs.apify.com/api/v2/key-value-stores-get
|
|
52
52
|
*/
|
|
53
|
-
list(options?: KeyValueStoreCollectionClientListOptions): Promise<KeyValueStoreCollectionListResult> & AsyncIterable<
|
|
53
|
+
list(options?: KeyValueStoreCollectionClientListOptions): Promise<KeyValueStoreCollectionListResult> & AsyncIterable<KeyValueStoreResource>;
|
|
54
54
|
/**
|
|
55
55
|
* Gets or creates a key-value store with the specified name.
|
|
56
56
|
*
|
|
@@ -61,7 +61,7 @@ export declare class KeyValueStoreCollectionClient extends ResourceCollectionCli
|
|
|
61
61
|
* @returns The key-value store object.
|
|
62
62
|
* @see https://docs.apify.com/api/v2/key-value-stores-post
|
|
63
63
|
*/
|
|
64
|
-
getOrCreate(name?: string, options?: KeyValueStoreCollectionClientGetOrCreateOptions): Promise<
|
|
64
|
+
getOrCreate(name?: string, options?: KeyValueStoreCollectionClientGetOrCreateOptions): Promise<KeyValueStoreResource>;
|
|
65
65
|
}
|
|
66
66
|
export interface KeyValueStoreCollectionClientListOptions extends PaginationOptions, TimeoutOptions {
|
|
67
67
|
unnamed?: boolean;
|
|
@@ -78,6 +78,6 @@ export interface KeyValueStoreCollectionClientListOptions extends PaginationOpti
|
|
|
78
78
|
export interface KeyValueStoreCollectionClientGetOrCreateOptions extends TimeoutOptions {
|
|
79
79
|
schema?: Record<string, unknown>;
|
|
80
80
|
}
|
|
81
|
-
export type KeyValueStoreCollectionListResult = PaginatedList<
|
|
81
|
+
export type KeyValueStoreCollectionListResult = PaginatedList<KeyValueStoreResource> & {
|
|
82
82
|
unnamed: boolean;
|
|
83
83
|
};
|
|
@@ -87,6 +87,6 @@ export class KeyValueStoreCollectionClient extends ResourceCollectionClient {
|
|
|
87
87
|
// absent when there is nothing else to send.
|
|
88
88
|
const { timeoutSecs = 'short', signal, ...resource } = options ?? {};
|
|
89
89
|
const hasResource = Object.keys(resource).length > 0;
|
|
90
|
-
return this.getOrCreateResource(schemas.
|
|
90
|
+
return this.getOrCreateResource(schemas.KeyValueStoreResource(), name, hasResource ? resource : undefined, timeoutSecs, signal);
|
|
91
91
|
}
|
|
92
92
|
}
|