apify-client 2.20.1-beta.6 → 2.20.1-beta.8
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_client.d.ts +237 -25
- package/dist/apify_client.d.ts.map +1 -1
- package/dist/apify_client.js +234 -25
- package/dist/apify_client.js.map +1 -1
- package/dist/bundle.js +2042 -253
- package/dist/bundle.js.map +1 -1
- package/dist/resource_clients/actor.d.ts +322 -31
- package/dist/resource_clients/actor.d.ts.map +1 -1
- package/dist/resource_clients/actor.js +167 -19
- package/dist/resource_clients/actor.js.map +1 -1
- package/dist/resource_clients/actor_collection.d.ts +34 -3
- package/dist/resource_clients/actor_collection.d.ts.map +1 -1
- package/dist/resource_clients/actor_collection.js +34 -3
- package/dist/resource_clients/actor_collection.js.map +1 -1
- package/dist/resource_clients/actor_env_var.d.ts +34 -3
- package/dist/resource_clients/actor_env_var.d.ts.map +1 -1
- package/dist/resource_clients/actor_env_var.js +34 -3
- package/dist/resource_clients/actor_env_var.js.map +1 -1
- package/dist/resource_clients/actor_env_var_collection.d.ts +37 -3
- package/dist/resource_clients/actor_env_var_collection.d.ts.map +1 -1
- package/dist/resource_clients/actor_env_var_collection.js +37 -3
- package/dist/resource_clients/actor_env_var_collection.js.map +1 -1
- package/dist/resource_clients/actor_version.d.ts +42 -6
- package/dist/resource_clients/actor_version.d.ts.map +1 -1
- package/dist/resource_clients/actor_version.js +42 -6
- package/dist/resource_clients/actor_version.js.map +1 -1
- package/dist/resource_clients/actor_version_collection.d.ts +35 -3
- package/dist/resource_clients/actor_version_collection.d.ts.map +1 -1
- package/dist/resource_clients/actor_version_collection.js +35 -3
- package/dist/resource_clients/actor_version_collection.js.map +1 -1
- package/dist/resource_clients/build.d.ts +123 -11
- package/dist/resource_clients/build.d.ts.map +1 -1
- package/dist/resource_clients/build.js +93 -11
- package/dist/resource_clients/build.js.map +1 -1
- package/dist/resource_clients/build_collection.d.ts +27 -2
- package/dist/resource_clients/build_collection.d.ts.map +1 -1
- package/dist/resource_clients/build_collection.js +27 -2
- package/dist/resource_clients/build_collection.js.map +1 -1
- package/dist/resource_clients/dataset.d.ts +221 -15
- package/dist/resource_clients/dataset.d.ts.map +1 -1
- package/dist/resource_clients/dataset.js +185 -15
- package/dist/resource_clients/dataset.js.map +1 -1
- package/dist/resource_clients/dataset_collection.d.ts +32 -3
- package/dist/resource_clients/dataset_collection.d.ts.map +1 -1
- package/dist/resource_clients/dataset_collection.js +32 -3
- package/dist/resource_clients/dataset_collection.js.map +1 -1
- package/dist/resource_clients/key_value_store.d.ts +219 -26
- package/dist/resource_clients/key_value_store.d.ts.map +1 -1
- package/dist/resource_clients/key_value_store.js +172 -25
- package/dist/resource_clients/key_value_store.js.map +1 -1
- package/dist/resource_clients/key_value_store_collection.d.ts +32 -3
- package/dist/resource_clients/key_value_store_collection.d.ts.map +1 -1
- package/dist/resource_clients/key_value_store_collection.js +32 -3
- package/dist/resource_clients/key_value_store_collection.js.map +1 -1
- package/dist/resource_clients/log.d.ts +34 -3
- package/dist/resource_clients/log.d.ts.map +1 -1
- package/dist/resource_clients/log.js +34 -3
- package/dist/resource_clients/log.js.map +1 -1
- package/dist/resource_clients/request_queue.d.ts +290 -19
- package/dist/resource_clients/request_queue.d.ts.map +1 -1
- package/dist/resource_clients/request_queue.js +233 -19
- package/dist/resource_clients/request_queue.js.map +1 -1
- package/dist/resource_clients/request_queue_collection.d.ts +31 -3
- package/dist/resource_clients/request_queue_collection.d.ts.map +1 -1
- package/dist/resource_clients/request_queue_collection.js +31 -3
- package/dist/resource_clients/request_queue_collection.js.map +1 -1
- package/dist/resource_clients/run.d.ts +224 -27
- package/dist/resource_clients/run.d.ts.map +1 -1
- package/dist/resource_clients/run.js +200 -27
- package/dist/resource_clients/run.js.map +1 -1
- package/dist/resource_clients/run_collection.d.ts +27 -2
- package/dist/resource_clients/run_collection.d.ts.map +1 -1
- package/dist/resource_clients/run_collection.js +27 -2
- package/dist/resource_clients/run_collection.js.map +1 -1
- package/dist/resource_clients/schedule.d.ts +65 -4
- package/dist/resource_clients/schedule.d.ts.map +1 -1
- package/dist/resource_clients/schedule.js +42 -4
- package/dist/resource_clients/schedule.js.map +1 -1
- package/dist/resource_clients/schedule_collection.d.ts +35 -3
- package/dist/resource_clients/schedule_collection.d.ts.map +1 -1
- package/dist/resource_clients/schedule_collection.js +35 -3
- package/dist/resource_clients/schedule_collection.js.map +1 -1
- package/dist/resource_clients/store_collection.d.ts +26 -2
- package/dist/resource_clients/store_collection.d.ts.map +1 -1
- package/dist/resource_clients/store_collection.js +26 -2
- package/dist/resource_clients/store_collection.js.map +1 -1
- package/dist/resource_clients/task.d.ts +110 -11
- package/dist/resource_clients/task.d.ts.map +1 -1
- package/dist/resource_clients/task.js +83 -11
- package/dist/resource_clients/task.js.map +1 -1
- package/dist/resource_clients/task_collection.d.ts +35 -8
- package/dist/resource_clients/task_collection.d.ts.map +1 -1
- package/dist/resource_clients/task_collection.js +35 -8
- package/dist/resource_clients/task_collection.js.map +1 -1
- package/dist/resource_clients/user.d.ts +41 -4
- package/dist/resource_clients/user.d.ts.map +1 -1
- package/dist/resource_clients/user.js +41 -4
- package/dist/resource_clients/user.js.map +1 -1
- package/dist/resource_clients/webhook.d.ts +66 -5
- package/dist/resource_clients/webhook.d.ts.map +1 -1
- package/dist/resource_clients/webhook.js +48 -5
- package/dist/resource_clients/webhook.js.map +1 -1
- package/dist/resource_clients/webhook_collection.d.ts +34 -3
- package/dist/resource_clients/webhook_collection.d.ts.map +1 -1
- package/dist/resource_clients/webhook_collection.js +34 -3
- package/dist/resource_clients/webhook_collection.js.map +1 -1
- package/dist/resource_clients/webhook_dispatch.d.ts +22 -1
- package/dist/resource_clients/webhook_dispatch.d.ts.map +1 -1
- package/dist/resource_clients/webhook_dispatch.js +22 -1
- package/dist/resource_clients/webhook_dispatch.js.map +1 -1
- package/dist/resource_clients/webhook_dispatch_collection.d.ts +24 -2
- package/dist/resource_clients/webhook_dispatch_collection.d.ts.map +1 -1
- package/dist/resource_clients/webhook_dispatch_collection.js +24 -2
- package/dist/resource_clients/webhook_dispatch_collection.js.map +1 -1
- package/dist/utils.d.ts +42 -0
- package/dist/utils.d.ts.map +1 -1
- package/dist/utils.js.map +1 -1
- package/package.json +1 -1
|
@@ -14,6 +14,26 @@ const build_collection_1 = require("./build_collection");
|
|
|
14
14
|
const run_1 = require("./run");
|
|
15
15
|
const run_collection_1 = require("./run_collection");
|
|
16
16
|
const webhook_collection_1 = require("./webhook_collection");
|
|
17
|
+
/**
|
|
18
|
+
* Client for managing a specific Actor.
|
|
19
|
+
*
|
|
20
|
+
* Provides methods to start, call, build, update, and delete an Actor, as well as manage its
|
|
21
|
+
* versions, builds, runs, and webhooks.
|
|
22
|
+
*
|
|
23
|
+
* @example
|
|
24
|
+
* ```javascript
|
|
25
|
+
* const client = new ApifyClient({ token: 'my-token' });
|
|
26
|
+
* const actorClient = client.actor('my-actor-id');
|
|
27
|
+
*
|
|
28
|
+
* // Start an Actor
|
|
29
|
+
* const run = await actorClient.start(input, { memory: 256 });
|
|
30
|
+
*
|
|
31
|
+
* // Call an Actor and wait for it to finish
|
|
32
|
+
* const finishedRun = await actorClient.call({ url: 'https://example.com' });
|
|
33
|
+
* ```
|
|
34
|
+
*
|
|
35
|
+
* @see https://docs.apify.com/platform/actors
|
|
36
|
+
*/
|
|
17
37
|
class ActorClient extends resource_client_1.ResourceClient {
|
|
18
38
|
/**
|
|
19
39
|
* @hidden
|
|
@@ -25,27 +45,66 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
25
45
|
});
|
|
26
46
|
}
|
|
27
47
|
/**
|
|
28
|
-
*
|
|
48
|
+
* Gets the Actor object from the Apify API.
|
|
49
|
+
*
|
|
50
|
+
* @returns The Actor object, or `undefined` if it does not exist
|
|
51
|
+
* @see https://docs.apify.com/api/v2/act-get
|
|
29
52
|
*/
|
|
30
53
|
async get() {
|
|
31
54
|
return this._get();
|
|
32
55
|
}
|
|
33
56
|
/**
|
|
34
|
-
*
|
|
57
|
+
* Updates the Actor with specified fields.
|
|
58
|
+
*
|
|
59
|
+
* @param newFields - Fields to update in the Actor
|
|
60
|
+
* @returns The updated Actor object
|
|
61
|
+
* @see https://docs.apify.com/api/v2/act-put
|
|
35
62
|
*/
|
|
36
63
|
async update(newFields) {
|
|
37
64
|
(0, ow_1.default)(newFields, ow_1.default.object);
|
|
38
65
|
return this._update(newFields);
|
|
39
66
|
}
|
|
40
67
|
/**
|
|
41
|
-
*
|
|
68
|
+
* Deletes the Actor.
|
|
69
|
+
*
|
|
70
|
+
* @see https://docs.apify.com/api/v2/act-delete
|
|
42
71
|
*/
|
|
43
72
|
async delete() {
|
|
44
73
|
return this._delete();
|
|
45
74
|
}
|
|
46
75
|
/**
|
|
47
|
-
* Starts
|
|
48
|
-
*
|
|
76
|
+
* Starts the Actor and immediately returns the Run object.
|
|
77
|
+
*
|
|
78
|
+
* The Actor run can be configured with optional input and various options. The run starts
|
|
79
|
+
* asynchronously and this method returns immediately without waiting for completion.
|
|
80
|
+
* Use the {@link call} method if you want to wait for the Actor to finish.
|
|
81
|
+
*
|
|
82
|
+
* @param input - Input for the Actor. Can be any JSON-serializable value (object, array, string, number).
|
|
83
|
+
* If `contentType` is specified in options, input should be a string or Buffer.
|
|
84
|
+
* @param options - Run configuration options
|
|
85
|
+
* @param options.build - Tag or number of the build to run (e.g., `'beta'` or `'1.2.345'`). If not provided, uses the default build.
|
|
86
|
+
* @param options.memory - Memory in megabytes allocated for the run. If not provided, uses the Actor's default memory setting.
|
|
87
|
+
* @param options.timeout - Timeout for the run in seconds. Zero means no timeout. If not provided, uses the Actor's default timeout.
|
|
88
|
+
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the run to finish on the API side before returning. Default is 0 (returns immediately).
|
|
89
|
+
* @param options.webhooks - Webhooks to trigger when the Actor run reaches a specific state (e.g., `SUCCEEDED`, `FAILED`).
|
|
90
|
+
* @param options.maxItems - Maximum number of dataset items that will be charged (only for pay-per-result Actors).
|
|
91
|
+
* @param options.maxTotalChargeUsd - Maximum cost in USD (only for pay-per-event Actors).
|
|
92
|
+
* @param options.contentType - Content type of the input. If specified, input must be a string or Buffer.
|
|
93
|
+
* @returns The Actor run object with status, usage, and storage IDs
|
|
94
|
+
* @see https://docs.apify.com/api/v2/act-runs-post
|
|
95
|
+
*
|
|
96
|
+
* @example
|
|
97
|
+
* ```javascript
|
|
98
|
+
* // Start Actor with simple input
|
|
99
|
+
* const run = await client.actor('my-actor').start({ url: 'https://example.com' });
|
|
100
|
+
* console.log(`Run started with ID: ${run.id}, status: ${run.status}`);
|
|
101
|
+
*
|
|
102
|
+
* // Start Actor with specific build and memory
|
|
103
|
+
* const run = await client.actor('my-actor').start(
|
|
104
|
+
* { url: 'https://example.com' },
|
|
105
|
+
* { build: '0.1.2', memory: 512, timeout: 300 }
|
|
106
|
+
* );
|
|
107
|
+
* ```
|
|
49
108
|
*/
|
|
50
109
|
async start(input, options = {}) {
|
|
51
110
|
// input can be anything, so no point in validating it. E.g. if you set content-type to application/pdf
|
|
@@ -95,9 +154,41 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
95
154
|
return (0, utils_1.cast)((0, utils_1.parseDateFields)((0, utils_1.pluckData)(response.data)));
|
|
96
155
|
}
|
|
97
156
|
/**
|
|
98
|
-
* Starts
|
|
99
|
-
*
|
|
100
|
-
*
|
|
157
|
+
* Starts the Actor and waits for it to finish before returning the Run object.
|
|
158
|
+
*
|
|
159
|
+
* This is a convenience method that starts the Actor run and waits for its completion
|
|
160
|
+
* by polling the run status. It optionally streams logs to the console or a custom Log instance.
|
|
161
|
+
* By default, it waits indefinitely unless the `waitSecs` option is provided.
|
|
162
|
+
*
|
|
163
|
+
* @param input - Input for the Actor. Can be any JSON-serializable value (object, array, string, number).
|
|
164
|
+
* If `contentType` is specified in options, input should be a string or Buffer.
|
|
165
|
+
* @param options - Run configuration options (extends all options from {@link start})
|
|
166
|
+
* @param options.waitSecs - Maximum time to wait for the run to finish, in seconds. If omitted, waits indefinitely.
|
|
167
|
+
* @param options.log - Log instance for streaming run logs. Use `'default'` for console output, `null` to disable logging, or provide a custom Log instance.
|
|
168
|
+
* @param options.build - Tag or number of the build to run (e.g., `'beta'` or `'1.2.345'`).
|
|
169
|
+
* @param options.memory - Memory in megabytes allocated for the run.
|
|
170
|
+
* @param options.timeout - Maximum run duration in seconds.
|
|
171
|
+
* @returns The finished Actor run object with final status (`SUCCEEDED`, `FAILED`, `ABORTED`, or `TIMED-OUT`)
|
|
172
|
+
* @see https://docs.apify.com/api/v2/act-runs-post
|
|
173
|
+
*
|
|
174
|
+
* @example
|
|
175
|
+
* ```javascript
|
|
176
|
+
* // Run an Actor and wait for it to finish
|
|
177
|
+
* const run = await client.actor('my-actor').call({ url: 'https://example.com' });
|
|
178
|
+
* console.log(`Run finished with status: ${run.status}`);
|
|
179
|
+
* console.log(`Dataset ID: ${run.defaultDatasetId}`);
|
|
180
|
+
*
|
|
181
|
+
* // Run with a timeout and log streaming to console
|
|
182
|
+
* const run = await client.actor('my-actor').call(
|
|
183
|
+
* { url: 'https://example.com' },
|
|
184
|
+
* { waitSecs: 300, log: 'default' }
|
|
185
|
+
* );
|
|
186
|
+
*
|
|
187
|
+
* // Run with custom log instance
|
|
188
|
+
* import { Log } from '@apify/log';
|
|
189
|
+
* const log = new Log({ prefix: 'My Actor' });
|
|
190
|
+
* const run = await client.actor('my-actor').call({ url: 'https://example.com' }, { log });
|
|
191
|
+
* ```
|
|
101
192
|
*/
|
|
102
193
|
async call(input, options = {}) {
|
|
103
194
|
// input can be anything, so no point in validating it. E.g. if you set content-type to application/pdf
|
|
@@ -131,8 +222,33 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
131
222
|
});
|
|
132
223
|
}
|
|
133
224
|
/**
|
|
134
|
-
*
|
|
135
|
-
*
|
|
225
|
+
* Builds the Actor.
|
|
226
|
+
*
|
|
227
|
+
* Creates a new build of the specified Actor version. The build compiles the Actor's
|
|
228
|
+
* source code, installs dependencies, and prepares it for execution.
|
|
229
|
+
*
|
|
230
|
+
* @param versionNumber - Version number or tag to build (e.g., `'0.1'`, `'0.2'`, `'latest'`)
|
|
231
|
+
* @param options - Build configuration options
|
|
232
|
+
* @param options.betaPackages - If `true`, the build uses beta versions of Apify NPM packages.
|
|
233
|
+
* @param options.tag - Tag to be applied to the build (e.g., `'latest'`, `'beta'`). Existing tag with the same name will be replaced.
|
|
234
|
+
* @param options.useCache - If `false`, Docker build cache will be ignored. Default is `true`.
|
|
235
|
+
* @param options.waitForFinish - Maximum time to wait (in seconds, max 60s) for the build to finish on the API side before returning. Default is 0 (returns immediately).
|
|
236
|
+
* @returns The Build object with status and build details
|
|
237
|
+
* @see https://docs.apify.com/api/v2/act-builds-post
|
|
238
|
+
*
|
|
239
|
+
* @example
|
|
240
|
+
* ```javascript
|
|
241
|
+
* // Start a build and return immediately
|
|
242
|
+
* const build = await client.actor('my-actor').build('0.1');
|
|
243
|
+
* console.log(`Build ${build.id} started with status: ${build.status}`);
|
|
244
|
+
*
|
|
245
|
+
* // Build and wait up to 120 seconds for it to finish
|
|
246
|
+
* const build = await client.actor('my-actor').build('0.1', {
|
|
247
|
+
* waitForFinish: 120,
|
|
248
|
+
* tag: 'latest',
|
|
249
|
+
* useCache: true
|
|
250
|
+
* });
|
|
251
|
+
* ```
|
|
136
252
|
*/
|
|
137
253
|
async build(versionNumber, options = {}) {
|
|
138
254
|
(0, ow_1.default)(versionNumber, ow_1.default.string);
|
|
@@ -153,7 +269,11 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
153
269
|
return (0, utils_1.cast)((0, utils_1.parseDateFields)((0, utils_1.pluckData)(response.data)));
|
|
154
270
|
}
|
|
155
271
|
/**
|
|
156
|
-
*
|
|
272
|
+
* Retrieves the default build of the Actor.
|
|
273
|
+
*
|
|
274
|
+
* @param options - Options for getting the build.
|
|
275
|
+
* @returns A client for the default build.
|
|
276
|
+
* @see https://docs.apify.com/api/v2/act-build-default-get
|
|
157
277
|
*/
|
|
158
278
|
async defaultBuild(options = {}) {
|
|
159
279
|
const response = await this.httpClient.call({
|
|
@@ -171,7 +291,21 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
171
291
|
});
|
|
172
292
|
}
|
|
173
293
|
/**
|
|
174
|
-
*
|
|
294
|
+
* Returns a client for the last run of this Actor.
|
|
295
|
+
*
|
|
296
|
+
* Provides access to the most recent Actor run, optionally filtered by status or origin.
|
|
297
|
+
*
|
|
298
|
+
* @param options - Options to filter the last run
|
|
299
|
+
* @param options.status - Filter by run status (e.g., `'SUCCEEDED'`, `'FAILED'`, `'RUNNING'`, `'ABORTED'`, `'TIMED-OUT'`).
|
|
300
|
+
* @param options.origin - Filter by run origin (e.g., `'DEVELOPMENT'`, `'WEB'`, `'API'`, `'SCHEDULER'`).
|
|
301
|
+
* @returns A client for the last run
|
|
302
|
+
* @see https://docs.apify.com/api/v2/act-runs-last-get
|
|
303
|
+
*
|
|
304
|
+
* @example
|
|
305
|
+
* ```javascript
|
|
306
|
+
* // Get the last successful run
|
|
307
|
+
* const lastRun = await client.actor('my-actor').lastRun({ status: 'SUCCEEDED' }).get();
|
|
308
|
+
* ```
|
|
175
309
|
*/
|
|
176
310
|
lastRun(options = {}) {
|
|
177
311
|
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
@@ -185,7 +319,10 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
185
319
|
}));
|
|
186
320
|
}
|
|
187
321
|
/**
|
|
188
|
-
*
|
|
322
|
+
* Returns a client for managing builds of this Actor.
|
|
323
|
+
*
|
|
324
|
+
* @returns A client for the Actor's build collection
|
|
325
|
+
* @see https://docs.apify.com/api/v2/act-builds-get
|
|
189
326
|
*/
|
|
190
327
|
builds() {
|
|
191
328
|
return new build_collection_1.BuildCollectionClient(this._subResourceOptions({
|
|
@@ -193,7 +330,10 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
193
330
|
}));
|
|
194
331
|
}
|
|
195
332
|
/**
|
|
196
|
-
*
|
|
333
|
+
* Returns a client for managing runs of this Actor.
|
|
334
|
+
*
|
|
335
|
+
* @returns A client for the Actor's run collection
|
|
336
|
+
* @see https://docs.apify.com/api/v2/act-runs-get
|
|
197
337
|
*/
|
|
198
338
|
runs() {
|
|
199
339
|
return new run_collection_1.RunCollectionClient(this._subResourceOptions({
|
|
@@ -201,7 +341,11 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
201
341
|
}));
|
|
202
342
|
}
|
|
203
343
|
/**
|
|
204
|
-
*
|
|
344
|
+
* Returns a client for a specific version of this Actor.
|
|
345
|
+
*
|
|
346
|
+
* @param versionNumber - Version number (e.g., '0.1', '1.2.3')
|
|
347
|
+
* @returns A client for the specified Actor version
|
|
348
|
+
* @see https://docs.apify.com/api/v2/act-version-get
|
|
205
349
|
*/
|
|
206
350
|
version(versionNumber) {
|
|
207
351
|
(0, ow_1.default)(versionNumber, ow_1.default.string);
|
|
@@ -210,15 +354,19 @@ class ActorClient extends resource_client_1.ResourceClient {
|
|
|
210
354
|
}));
|
|
211
355
|
}
|
|
212
356
|
/**
|
|
213
|
-
*
|
|
214
|
-
*
|
|
357
|
+
* Returns a client for managing versions of this Actor.
|
|
358
|
+
*
|
|
359
|
+
* @returns A client for the Actor's version collection
|
|
360
|
+
* @see https://docs.apify.com/api/v2/act-versions-get
|
|
215
361
|
*/
|
|
216
362
|
versions() {
|
|
217
363
|
return new actor_version_collection_1.ActorVersionCollectionClient(this._subResourceOptions());
|
|
218
364
|
}
|
|
219
365
|
/**
|
|
220
|
-
*
|
|
221
|
-
*
|
|
366
|
+
* Returns a client for managing webhooks associated with this Actor.
|
|
367
|
+
*
|
|
368
|
+
* @returns A client for the Actor's webhook collection
|
|
369
|
+
* @see https://docs.apify.com/api/v2/act-webhooks-get
|
|
222
370
|
*/
|
|
223
371
|
webhooks() {
|
|
224
372
|
return new webhook_collection_1.WebhookCollectionClient(this._subResourceOptions());
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../src/resource_clients/actor.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AAGpB,0CAAuF;AACvF,oCAAiC;AAGjC,6DAAyD;AACzD,oCAAuF;AAEvF,mDAAqD;AACrD,yEAA0E;AAE1E,mCAAsC;AACtC,yDAA2D;AAC3D,+BAAkC;AAClC,qDAAuD;AAEvD,6DAA+D;AAE/D,MAAa,WAAY,SAAQ,gCAAc;IAC3C;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,MAAM;YACpB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"actor.js","sourceRoot":"","sources":["../../src/resource_clients/actor.ts"],"names":[],"mappings":";;;;AACA,oDAAoB;AAGpB,0CAAuF;AACvF,oCAAiC;AAGjC,6DAAyD;AACzD,oCAAuF;AAEvF,mDAAqD;AACrD,yEAA0E;AAE1E,mCAAsC;AACtC,yDAA2D;AAC3D,+BAAkC;AAClC,qDAAuD;AAEvD,6DAA+D;AAE/D;;;;;;;;;;;;;;;;;;;GAmBG;AACH,MAAa,WAAY,SAAQ,gCAAc;IAC3C;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,MAAM;YACpB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,SAA6B;QACtC,IAAA,YAAE,EAAC,SAAS,EAAE,YAAE,CAAC,MAAM,CAAC,CAAC;QAEzB,OAAO,IAAI,CAAC,OAAO,CAAC,SAAS,CAAC,CAAC;IACnC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC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O,IAAI,kCAAkB,CACzB,IAAI,CAAC,mBAAmB,CAAC;YACrB,EAAE,EAAE,aAAa;SACpB,CAAC,CACL,CAAC;IACN,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAI,uDAA4B,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACxE,CAAC;IAED;;;;;OAKG;IACH,QAAQ;QACJ,OAAO,IAAI,4CAAuB,CAAC,IAAI,CAAC,mBAAmB,EAAE,CAAC,CAAC;IACnE,CAAC;CACJ;AAxYD,kCAwYC"}
|
|
@@ -3,19 +3,42 @@ import { ResourceCollectionClient } from '../base/resource_collection_client';
|
|
|
3
3
|
import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils';
|
|
4
4
|
import type { Actor, ActorDefaultRunOptions, ActorExampleRunInput, ActorStandby } from './actor';
|
|
5
5
|
import type { ActorVersion } from './actor_version';
|
|
6
|
+
/**
|
|
7
|
+
* Client for managing the collection of Actors in your account.
|
|
8
|
+
*
|
|
9
|
+
* Provides methods to list and create Actors. To access an individual Actor,
|
|
10
|
+
* use the `actor()` method on the main ApifyClient.
|
|
11
|
+
*
|
|
12
|
+
* @example
|
|
13
|
+
* ```javascript
|
|
14
|
+
* const client = new ApifyClient({ token: 'my-token' });
|
|
15
|
+
* const actorsClient = client.actors();
|
|
16
|
+
*
|
|
17
|
+
* // List all Actors
|
|
18
|
+
* const { items } = await actorsClient.list();
|
|
19
|
+
*
|
|
20
|
+
* // Create a new Actor
|
|
21
|
+
* const newActor = await actorsClient.create({
|
|
22
|
+
* name: 'my-actor',
|
|
23
|
+
* title: 'My Actor'
|
|
24
|
+
* });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://docs.apify.com/platform/actors
|
|
28
|
+
*/
|
|
6
29
|
export declare class ActorCollectionClient extends ResourceCollectionClient {
|
|
7
30
|
/**
|
|
8
31
|
* @hidden
|
|
9
32
|
*/
|
|
10
33
|
constructor(options: ApiClientSubResourceOptions);
|
|
11
34
|
/**
|
|
12
|
-
*
|
|
35
|
+
* Lists all Actors.
|
|
13
36
|
*
|
|
14
37
|
* Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
|
|
15
38
|
* items in a single API call is limited.
|
|
16
39
|
* ```javascript
|
|
17
40
|
* const paginatedList = await client.list(options);
|
|
18
|
-
|
|
41
|
+
* ```
|
|
19
42
|
*
|
|
20
43
|
* Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
|
|
21
44
|
* retrieved.
|
|
@@ -23,10 +46,18 @@ export declare class ActorCollectionClient extends ResourceCollectionClient {
|
|
|
23
46
|
* ```javascript
|
|
24
47
|
* for await (const singleItem of client.list(options)) {...}
|
|
25
48
|
* ```
|
|
49
|
+
*
|
|
50
|
+
* @param options - Pagination options.
|
|
51
|
+
* @returns A paginated iterator of Actors.
|
|
52
|
+
* @see https://docs.apify.com/api/v2/acts-get
|
|
26
53
|
*/
|
|
27
54
|
list(options?: ActorCollectionListOptions): PaginatedIterator<ActorCollectionListItem>;
|
|
28
55
|
/**
|
|
29
|
-
*
|
|
56
|
+
* Creates a new Actor.
|
|
57
|
+
*
|
|
58
|
+
* @param actor - The Actor data.
|
|
59
|
+
* @returns The created Actor object.
|
|
60
|
+
* @see https://docs.apify.com/api/v2/acts-post
|
|
30
61
|
*/
|
|
31
62
|
create(actor: ActorCollectionCreateOptions): Promise<Actor>;
|
|
32
63
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_collection.d.ts","sourceRoot":"","sources":["../../src/resource_clients/actor_collection.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,wBAAwB,EAAE,MAAM,oCAAoC,CAAC;AAC9E,OAAO,KAAK,EAAE,iBAAiB,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,UAAU,CAAC;AACpF,OAAO,KAAK,EAAE,KAAK,EAAE,s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UAAU,EAAE,IAAI,CAAC;IACjB,IAAI,EAAE,MAAM,CAAC;IACb,QAAQ,EAAE,MAAM,CAAC;CACpB;AAED,MAAM,MAAM,yBAAyB,GAAG,aAAa,CAAC,uBAAuB,CAAC,CAAC;AAE/E,MAAM,WAAW,4BAA4B;IACzC,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,iBAAiB,CAAC,EAAE,sBAAsB,CAAC;IAC3C,WAAW,CAAC,EAAE,MAAM,CAAC;IACrB,eAAe,CAAC,EAAE,oBAAoB,CAAC;IACvC,YAAY,CAAC,EAAE,OAAO,CAAC;IACvB,QAAQ,CAAC,EAAE,OAAO,CAAC;IACnB,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,+DAA+D;IAC/D,cAAc,CAAC,EAAE,OAAO,CAAC;IACzB,QAAQ,CAAC,EAAE,MAAM,CAAC;IAClB,cAAc,CAAC,EAAE,MAAM,CAAC;IACxB,KAAK,CAAC,EAAE,MAAM,CAAC;IACf,QAAQ,CAAC,EAAE,YAAY,EAAE,CAAC;IAC1B,YAAY,CAAC,EAAE,YAAY,GAAG;QAC1B,SAAS,EAAE,OAAO,CAAC;KACtB,CAAC;CACL"}
|
|
@@ -4,6 +4,29 @@ exports.ActorListSortBy = exports.ActorCollectionClient = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ow_1 = tslib_1.__importDefault(require("ow"));
|
|
6
6
|
const resource_collection_client_1 = require("../base/resource_collection_client");
|
|
7
|
+
/**
|
|
8
|
+
* Client for managing the collection of Actors in your account.
|
|
9
|
+
*
|
|
10
|
+
* Provides methods to list and create Actors. To access an individual Actor,
|
|
11
|
+
* use the `actor()` method on the main ApifyClient.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```javascript
|
|
15
|
+
* const client = new ApifyClient({ token: 'my-token' });
|
|
16
|
+
* const actorsClient = client.actors();
|
|
17
|
+
*
|
|
18
|
+
* // List all Actors
|
|
19
|
+
* const { items } = await actorsClient.list();
|
|
20
|
+
*
|
|
21
|
+
* // Create a new Actor
|
|
22
|
+
* const newActor = await actorsClient.create({
|
|
23
|
+
* name: 'my-actor',
|
|
24
|
+
* title: 'My Actor'
|
|
25
|
+
* });
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @see https://docs.apify.com/platform/actors
|
|
29
|
+
*/
|
|
7
30
|
class ActorCollectionClient extends resource_collection_client_1.ResourceCollectionClient {
|
|
8
31
|
/**
|
|
9
32
|
* @hidden
|
|
@@ -15,13 +38,13 @@ class ActorCollectionClient extends resource_collection_client_1.ResourceCollect
|
|
|
15
38
|
});
|
|
16
39
|
}
|
|
17
40
|
/**
|
|
18
|
-
*
|
|
41
|
+
* Lists all Actors.
|
|
19
42
|
*
|
|
20
43
|
* Awaiting the return value (as you would with a Promise) will result in a single API call. The amount of fetched
|
|
21
44
|
* items in a single API call is limited.
|
|
22
45
|
* ```javascript
|
|
23
46
|
* const paginatedList = await client.list(options);
|
|
24
|
-
|
|
47
|
+
* ```
|
|
25
48
|
*
|
|
26
49
|
* Asynchronous iteration is also supported. This will fetch additional pages if needed until all items are
|
|
27
50
|
* retrieved.
|
|
@@ -29,6 +52,10 @@ class ActorCollectionClient extends resource_collection_client_1.ResourceCollect
|
|
|
29
52
|
* ```javascript
|
|
30
53
|
* for await (const singleItem of client.list(options)) {...}
|
|
31
54
|
* ```
|
|
55
|
+
*
|
|
56
|
+
* @param options - Pagination options.
|
|
57
|
+
* @returns A paginated iterator of Actors.
|
|
58
|
+
* @see https://docs.apify.com/api/v2/acts-get
|
|
32
59
|
*/
|
|
33
60
|
list(options = {}) {
|
|
34
61
|
(0, ow_1.default)(options, ow_1.default.object.exactShape({
|
|
@@ -41,7 +68,11 @@ class ActorCollectionClient extends resource_collection_client_1.ResourceCollect
|
|
|
41
68
|
return this._listPaginated(options);
|
|
42
69
|
}
|
|
43
70
|
/**
|
|
44
|
-
*
|
|
71
|
+
* Creates a new Actor.
|
|
72
|
+
*
|
|
73
|
+
* @param actor - The Actor data.
|
|
74
|
+
* @returns The created Actor object.
|
|
75
|
+
* @see https://docs.apify.com/api/v2/acts-post
|
|
45
76
|
*/
|
|
46
77
|
async create(actor) {
|
|
47
78
|
(0, ow_1.default)(actor, ow_1.default.optional.object);
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_collection.js","sourceRoot":"","sources":["../../src/resource_clients/actor_collection.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,mFAA8E;AAK9E,MAAa,qBAAsB,SAAQ,qDAAwB;IAC/D;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,MAAM;YACpB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"actor_collection.js","sourceRoot":"","sources":["../../src/resource_clients/actor_collection.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,mFAA8E;AAK9E;;;;;;;;;;;;;;;;;;;;;;GAsBG;AACH,MAAa,qBAAsB,SAAQ,qDAAwB;IAC/D;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,MAAM;YACpB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED;;;;;;;;;;;;;;;;;;;OAmBG;IACH,IAAI,CAAC,UAAsC,EAAE;QACzC,IAAA,YAAE,EACE,OAAO,EACP,YAAE,CAAC,MAAM,CAAC,UAAU,CAAC;YACjB,EAAE,EAAE,YAAE,CAAC,QAAQ,CAAC,OAAO;YACvB,KAAK,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YACzB,MAAM,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM;YAC1B,IAAI,EAAE,YAAE,CAAC,QAAQ,CAAC,OAAO;YACzB,MAAM,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,eAAe,CAAC,CAAC;SACnE,CAAC,CACL,CAAC;QAEF,OAAO,IAAI,CAAC,cAAc,CAAC,OAAO,CAAC,CAAC;IACxC,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,KAAmC;QAC5C,IAAA,YAAE,EAAC,KAAK,EAAE,YAAE,CAAC,QAAQ,CAAC,MAAM,CAAC,CAAC;QAE9B,OAAO,IAAI,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;IAC/B,CAAC;CACJ;AA1DD,sDA0DC;AAED,IAAY,eAGX;AAHD,WAAY,eAAe;IACvB,2CAAwB,CAAA;IACxB,iEAA8C,CAAA;AAClD,CAAC,EAHW,eAAe,+BAAf,eAAe,QAG1B"}
|
|
@@ -1,21 +1,52 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client';
|
|
3
3
|
import type { ActorEnvironmentVariable } from './actor_version';
|
|
4
|
+
/**
|
|
5
|
+
* Client for managing a specific Actor environment variable.
|
|
6
|
+
*
|
|
7
|
+
* Environment variables are key-value pairs that are available to the Actor during execution.
|
|
8
|
+
* This client provides methods to get, update, and delete environment variables.
|
|
9
|
+
*
|
|
10
|
+
* @example
|
|
11
|
+
* ```javascript
|
|
12
|
+
* const client = new ApifyClient({ token: 'my-token' });
|
|
13
|
+
* const actorClient = client.actor('my-actor-id');
|
|
14
|
+
* const versionClient = actorClient.version('0.1');
|
|
15
|
+
*
|
|
16
|
+
* // Get an environment variable
|
|
17
|
+
* const envVarClient = versionClient.envVar('MY_VAR');
|
|
18
|
+
* const envVar = await envVarClient.get();
|
|
19
|
+
*
|
|
20
|
+
* // Update environment variable
|
|
21
|
+
* await envVarClient.update({ value: 'new-value' });
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @see https://docs.apify.com/platform/actors/development/actor-definition/environment-variables
|
|
25
|
+
*/
|
|
4
26
|
export declare class ActorEnvVarClient extends ResourceClient {
|
|
5
27
|
/**
|
|
6
28
|
* @hidden
|
|
7
29
|
*/
|
|
8
30
|
constructor(options: ApiClientSubResourceOptions);
|
|
9
31
|
/**
|
|
10
|
-
*
|
|
32
|
+
* Retrieves the environment variable.
|
|
33
|
+
*
|
|
34
|
+
* @returns The environment variable object, or `undefined` if it does not exist.
|
|
35
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-get
|
|
11
36
|
*/
|
|
12
37
|
get(): Promise<ActorEnvironmentVariable | undefined>;
|
|
13
38
|
/**
|
|
14
|
-
*
|
|
39
|
+
* Updates the environment variable.
|
|
40
|
+
*
|
|
41
|
+
* @param actorEnvVar - The updated environment variable data.
|
|
42
|
+
* @returns The updated environment variable object.
|
|
43
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-put
|
|
15
44
|
*/
|
|
16
45
|
update(actorEnvVar: ActorEnvironmentVariable): Promise<ActorEnvironmentVariable>;
|
|
17
46
|
/**
|
|
18
|
-
*
|
|
47
|
+
* Deletes the environment variable.
|
|
48
|
+
*
|
|
49
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-delete
|
|
19
50
|
*/
|
|
20
51
|
delete(): Promise<void>;
|
|
21
52
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_env_var.d.ts","sourceRoot":"","sources":["../../src/resource_clients/actor_env_var.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE,qBAAa,iBAAkB,SAAQ,cAAc;IACjD;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD
|
|
1
|
+
{"version":3,"file":"actor_env_var.d.ts","sourceRoot":"","sources":["../../src/resource_clients/actor_env_var.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,2BAA2B,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,cAAc,EAAE,MAAM,yBAAyB,CAAC;AACzD,OAAO,KAAK,EAAE,wBAAwB,EAAE,MAAM,iBAAiB,CAAC;AAEhE;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,qBAAa,iBAAkB,SAAQ,cAAc;IACjD;;OAEG;gBACS,OAAO,EAAE,2BAA2B;IAOhD;;;;;OAKG;IACG,GAAG,IAAI,OAAO,CAAC,wBAAwB,GAAG,SAAS,CAAC;IAI1D;;;;;;OAMG;IACG,MAAM,CAAC,WAAW,EAAE,wBAAwB,GAAG,OAAO,CAAC,wBAAwB,CAAC;IAKtF;;;;OAIG;IACG,MAAM,IAAI,OAAO,CAAC,IAAI,CAAC;CAGhC"}
|
|
@@ -4,6 +4,28 @@ exports.ActorEnvVarClient = void 0;
|
|
|
4
4
|
const tslib_1 = require("tslib");
|
|
5
5
|
const ow_1 = tslib_1.__importDefault(require("ow"));
|
|
6
6
|
const resource_client_1 = require("../base/resource_client");
|
|
7
|
+
/**
|
|
8
|
+
* Client for managing a specific Actor environment variable.
|
|
9
|
+
*
|
|
10
|
+
* Environment variables are key-value pairs that are available to the Actor during execution.
|
|
11
|
+
* This client provides methods to get, update, and delete environment variables.
|
|
12
|
+
*
|
|
13
|
+
* @example
|
|
14
|
+
* ```javascript
|
|
15
|
+
* const client = new ApifyClient({ token: 'my-token' });
|
|
16
|
+
* const actorClient = client.actor('my-actor-id');
|
|
17
|
+
* const versionClient = actorClient.version('0.1');
|
|
18
|
+
*
|
|
19
|
+
* // Get an environment variable
|
|
20
|
+
* const envVarClient = versionClient.envVar('MY_VAR');
|
|
21
|
+
* const envVar = await envVarClient.get();
|
|
22
|
+
*
|
|
23
|
+
* // Update environment variable
|
|
24
|
+
* await envVarClient.update({ value: 'new-value' });
|
|
25
|
+
* ```
|
|
26
|
+
*
|
|
27
|
+
* @see https://docs.apify.com/platform/actors/development/actor-definition/environment-variables
|
|
28
|
+
*/
|
|
7
29
|
class ActorEnvVarClient extends resource_client_1.ResourceClient {
|
|
8
30
|
/**
|
|
9
31
|
* @hidden
|
|
@@ -15,20 +37,29 @@ class ActorEnvVarClient extends resource_client_1.ResourceClient {
|
|
|
15
37
|
});
|
|
16
38
|
}
|
|
17
39
|
/**
|
|
18
|
-
*
|
|
40
|
+
* Retrieves the environment variable.
|
|
41
|
+
*
|
|
42
|
+
* @returns The environment variable object, or `undefined` if it does not exist.
|
|
43
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-get
|
|
19
44
|
*/
|
|
20
45
|
async get() {
|
|
21
46
|
return this._get();
|
|
22
47
|
}
|
|
23
48
|
/**
|
|
24
|
-
*
|
|
49
|
+
* Updates the environment variable.
|
|
50
|
+
*
|
|
51
|
+
* @param actorEnvVar - The updated environment variable data.
|
|
52
|
+
* @returns The updated environment variable object.
|
|
53
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-put
|
|
25
54
|
*/
|
|
26
55
|
async update(actorEnvVar) {
|
|
27
56
|
(0, ow_1.default)(actorEnvVar, ow_1.default.object);
|
|
28
57
|
return this._update(actorEnvVar);
|
|
29
58
|
}
|
|
30
59
|
/**
|
|
31
|
-
*
|
|
60
|
+
* Deletes the environment variable.
|
|
61
|
+
*
|
|
62
|
+
* @see https://docs.apify.com/api/v2/act-version-env-var-delete
|
|
32
63
|
*/
|
|
33
64
|
async delete() {
|
|
34
65
|
return this._delete();
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"actor_env_var.js","sourceRoot":"","sources":["../../src/resource_clients/actor_env_var.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,6DAAyD;AAGzD,MAAa,iBAAkB,SAAQ,gCAAc;IACjD;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,UAAU;YACxB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED
|
|
1
|
+
{"version":3,"file":"actor_env_var.js","sourceRoot":"","sources":["../../src/resource_clients/actor_env_var.ts"],"names":[],"mappings":";;;;AAAA,oDAAoB;AAGpB,6DAAyD;AAGzD;;;;;;;;;;;;;;;;;;;;;GAqBG;AACH,MAAa,iBAAkB,SAAQ,gCAAc;IACjD;;OAEG;IACH,YAAY,OAAoC;QAC5C,KAAK,CAAC;YACF,YAAY,EAAE,UAAU;YACxB,GAAG,OAAO;SACb,CAAC,CAAC;IACP,CAAC;IAED;;;;;OAKG;IACH,KAAK,CAAC,GAAG;QACL,OAAO,IAAI,CAAC,IAAI,EAAE,CAAC;IACvB,CAAC;IAED;;;;;;OAMG;IACH,KAAK,CAAC,MAAM,CAAC,WAAqC;QAC9C,IAAA,YAAE,EAAC,WAAW,EAAE,YAAE,CAAC,MAAM,CAAC,CAAC;QAC3B,OAAO,IAAI,CAAC,OAAO,CAAC,WAAW,CAAC,CAAC;IACrC,CAAC;IAED;;;;OAIG;IACH,KAAK,CAAC,MAAM;QACR,OAAO,IAAI,CAAC,OAAO,EAAE,CAAC;IAC1B,CAAC;CACJ;AAzCD,8CAyCC"}
|