apify-client 3.0.0-beta.0 → 3.0.0-beta.1
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/bundle.js +6 -6
- package/dist/bundle.js.map +1 -1
- package/dist/generated/api.d.ts +20522 -0
- package/dist/generated/api.js +6 -0
- package/dist/models.d.ts +1072 -0
- package/dist/models.js +89 -0
- package/dist/resource_clients/actor.d.ts +2 -448
- package/dist/resource_clients/actor_collection.d.ts +2 -7
- package/dist/resource_clients/actor_version.d.ts +3 -40
- package/dist/resource_clients/actor_version.js +3 -8
- package/dist/resource_clients/build.d.ts +2 -77
- package/dist/resource_clients/build_collection.d.ts +2 -2
- package/dist/resource_clients/dataset.d.ts +2 -68
- package/dist/resource_clients/key_value_store.d.ts +2 -71
- package/dist/resource_clients/key_value_store.js +3 -1
- package/dist/resource_clients/request_queue.d.ts +15 -174
- package/dist/resource_clients/request_queue.js +2 -2
- package/dist/resource_clients/schedule.d.ts +3 -81
- package/dist/resource_clients/schedule.js +3 -9
- package/dist/resource_clients/store_collection.d.ts +2 -30
- package/dist/resource_clients/task.d.ts +3 -73
- package/dist/resource_clients/task_collection.d.ts +2 -1
- package/dist/resource_clients/user.d.ts +3 -179
- package/dist/resource_clients/user.js +3 -11
- package/dist/resource_clients/webhook.d.ts +2 -61
- package/dist/resource_clients/webhook_dispatch.d.ts +3 -36
- package/dist/resource_clients/webhook_dispatch.js +3 -7
- package/dist/utils.js +9 -3
- package/package.json +13 -3
package/dist/models.js
ADDED
|
@@ -0,0 +1,89 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
/**
|
|
3
|
+
* Public models adapted from the generated OpenAPI types in `./generated/api`.
|
|
4
|
+
*
|
|
5
|
+
* The generated file is never re-exported directly. Every type here is declared on top of a generated
|
|
6
|
+
* schema so the compiler reports drift, and the spec is adopted as-is wherever it is trustworthy. What
|
|
7
|
+
* remains is deliberately small, and each deviation falls into exactly one of five kinds, one block per
|
|
8
|
+
* kind per schema:
|
|
9
|
+
*
|
|
10
|
+
* - `*SpecGaps` -- fields the API returns that the spec does not describe at all. Tracked upstream;
|
|
11
|
+
* each entry disappears from here as the spec catches up, and `./spec_guards` fails the build once
|
|
12
|
+
* one is filled.
|
|
13
|
+
* - `*SpecNarrowings` -- the spec is narrower than what the API actually returns, so the wider type is
|
|
14
|
+
* kept. Widening needs no evidence and is adopted freely.
|
|
15
|
+
* - `*ClientNarrowings` -- the published type is narrower than the spec on purpose. This makes the
|
|
16
|
+
* compiler promise something the spec does not, so every entry carries its evidence.
|
|
17
|
+
* - `*ClientConversions` -- the client rewrites the value before the caller sees it, so the published
|
|
18
|
+
* type is the converted one rather than the wire type the spec describes.
|
|
19
|
+
* - `*RePointed` -- the field's type is replaced by a name this package owns: an adapted model, a
|
|
20
|
+
* `@apify/consts` union, or a published runtime enum. Left alone, the reference would render the
|
|
21
|
+
* generated schema as an indexed access into `./generated/api`, adapted fields on it would be
|
|
22
|
+
* unreachable, and a string union would replace an enum callers compare against.
|
|
23
|
+
*
|
|
24
|
+
* Backward-compatibility shims are deliberately absent. This lands in the next major, so the spec's
|
|
25
|
+
* nullability and optionality are adopted rather than papered over.
|
|
26
|
+
*/
|
|
27
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
28
|
+
exports.PlatformFeature = exports.ScheduleActions = exports.ActorSourceType = exports.WebhookDispatchStatus = void 0;
|
|
29
|
+
/**
|
|
30
|
+
* Status of a webhook dispatch.
|
|
31
|
+
*
|
|
32
|
+
* Declared here rather than in `./resource_clients/webhook_dispatch` so that `WebhookDispatch` can
|
|
33
|
+
* reference it without closing an import cycle. It is re-exported from there, so the public name and
|
|
34
|
+
* import path are unchanged.
|
|
35
|
+
*/
|
|
36
|
+
var WebhookDispatchStatus;
|
|
37
|
+
(function (WebhookDispatchStatus) {
|
|
38
|
+
WebhookDispatchStatus["Active"] = "ACTIVE";
|
|
39
|
+
WebhookDispatchStatus["Succeeded"] = "SUCCEEDED";
|
|
40
|
+
WebhookDispatchStatus["Failed"] = "FAILED";
|
|
41
|
+
})(WebhookDispatchStatus || (exports.WebhookDispatchStatus = WebhookDispatchStatus = {}));
|
|
42
|
+
/**
|
|
43
|
+
* Where the source code of an Actor version lives.
|
|
44
|
+
*
|
|
45
|
+
* Declared here rather than in `./resource_clients/actor_version` so that the version types can
|
|
46
|
+
* reference it without closing an import cycle. It is re-exported from there, so the public name and
|
|
47
|
+
* import path are unchanged.
|
|
48
|
+
*/
|
|
49
|
+
var ActorSourceType;
|
|
50
|
+
(function (ActorSourceType) {
|
|
51
|
+
ActorSourceType["SourceFiles"] = "SOURCE_FILES";
|
|
52
|
+
ActorSourceType["GitRepo"] = "GIT_REPO";
|
|
53
|
+
ActorSourceType["Tarball"] = "TARBALL";
|
|
54
|
+
ActorSourceType["GitHubGist"] = "GITHUB_GIST";
|
|
55
|
+
ActorSourceType["SourceCode"] = "SOURCE_CODE";
|
|
56
|
+
})(ActorSourceType || (exports.ActorSourceType = ActorSourceType = {}));
|
|
57
|
+
/**
|
|
58
|
+
* Types of actions that can be scheduled.
|
|
59
|
+
*
|
|
60
|
+
* Declared here rather than in `./resource_clients/schedule` so that the action types can reference it
|
|
61
|
+
* without closing an import cycle. It is re-exported from there, so the public name and import path are
|
|
62
|
+
* unchanged.
|
|
63
|
+
*/
|
|
64
|
+
var ScheduleActions;
|
|
65
|
+
(function (ScheduleActions) {
|
|
66
|
+
ScheduleActions["RunActor"] = "RUN_ACTOR";
|
|
67
|
+
ScheduleActions["RunActorTask"] = "RUN_ACTOR_TASK";
|
|
68
|
+
})(ScheduleActions || (exports.ScheduleActions = ScheduleActions = {}));
|
|
69
|
+
/**
|
|
70
|
+
* Platform features a plan can enable.
|
|
71
|
+
*
|
|
72
|
+
* This enum is not the element type of `UserPlan.enabledPlatformFeatures`, which the spec types
|
|
73
|
+
* as a plain `string[]`: the platform has features this list never gained -- `PROXY_RESIDENTIAL`,
|
|
74
|
+
* `ACTORS_PUBLIC_ALL` and `ACTORS_PUBLIC_DEVELOPER` all appear as keys of `EffectivePlatformFeatures`
|
|
75
|
+
* -- so using it there promised a completeness that was not real. It stays published for comparisons.
|
|
76
|
+
*
|
|
77
|
+
* Declared here rather than in `./resource_clients/user` so the user types can live alongside it. It is
|
|
78
|
+
* re-exported from there, so the public name and import path are unchanged.
|
|
79
|
+
*/
|
|
80
|
+
var PlatformFeature;
|
|
81
|
+
(function (PlatformFeature) {
|
|
82
|
+
PlatformFeature["Actors"] = "ACTORS";
|
|
83
|
+
PlatformFeature["Storage"] = "STORAGE";
|
|
84
|
+
PlatformFeature["ProxySERPS"] = "PROXY_SERPS";
|
|
85
|
+
PlatformFeature["Scheduler"] = "SCHEDULER";
|
|
86
|
+
PlatformFeature["Webhooks"] = "WEBHOOKS";
|
|
87
|
+
PlatformFeature["Proxy"] = "PROXY";
|
|
88
|
+
PlatformFeature["ProxyExternalAccess"] = "PROXY_EXTERNAL_ACCESS";
|
|
89
|
+
})(PlatformFeature || (exports.PlatformFeature = PlatformFeature = {}));
|
|
@@ -1,9 +1,8 @@
|
|
|
1
|
-
import type { RUN_GENERAL_ACCESS } from '@apify/consts';
|
|
2
1
|
import { ACTOR_JOB_STATUSES, ACTOR_PERMISSION_LEVEL, META_ORIGINS } from '@apify/consts';
|
|
3
2
|
import { Log } from '@apify/log';
|
|
4
3
|
import type { ApiClientSubResourceOptions } from '../base/api_client';
|
|
5
4
|
import { ResourceClient } from '../base/resource_client';
|
|
6
|
-
import type {
|
|
5
|
+
import type { Actor, ActorRun } from '../models';
|
|
7
6
|
import { ActorVersionClient } from './actor_version';
|
|
8
7
|
import { ActorVersionCollectionClient } from './actor_version_collection';
|
|
9
8
|
import type { Build, BuildClientGetOptions } from './build';
|
|
@@ -14,6 +13,7 @@ import { RunCollectionClient } from './run_collection';
|
|
|
14
13
|
import type { WebhookUpdateData } from './webhook';
|
|
15
14
|
import { WebhookCollectionClient } from './webhook_collection';
|
|
16
15
|
import type { ValueOf } from 'type-fest';
|
|
16
|
+
export type { Actor, ActorChargeEvent, ActorChargeEvents, ActorDefaultRunOptions, ActorDefinition, ActorExampleRunInput, ActorRun, ActorRunListItem, ActorRunMeta, ActorRunMetamorph, ActorRunOptions, ActorRunPricingInfo, ActorRunStats, ActorRunStorageIds, ActorRunUsage, ActorStandby, ActorStats, ActorTaggedBuild, ActorTaggedBuilds, FlatPricePerMonthActorPricingInfo, FreeActorPricingInfo, PricePerDatasetItemActorPricingInfo, PricePerEventActorPricingInfo, TieredPricingPerDatasetItem, TieredPricingPerDatasetItemEntry, TieredPricingPerEvent, TieredPricingPerEventEntry, } from '../models';
|
|
17
17
|
/**
|
|
18
18
|
* Client for managing a specific Actor.
|
|
19
19
|
*
|
|
@@ -276,166 +276,10 @@ export declare class ActorClient extends ResourceClient {
|
|
|
276
276
|
*/
|
|
277
277
|
webhooks(): WebhookCollectionClient;
|
|
278
278
|
}
|
|
279
|
-
/**
|
|
280
|
-
* Represents an Actor in the Apify platform.
|
|
281
|
-
*
|
|
282
|
-
* Actors are serverless computing units that can perform arbitrary tasks such as web scraping,
|
|
283
|
-
* data processing, automation, and more. Each Actor has versions, builds, and can be executed
|
|
284
|
-
* with different configurations.
|
|
285
|
-
*/
|
|
286
|
-
export interface Actor {
|
|
287
|
-
/** Unique Actor ID */
|
|
288
|
-
id: string;
|
|
289
|
-
/** ID of the user who owns the Actor */
|
|
290
|
-
userId: string;
|
|
291
|
-
/** Unique name of the Actor (used in API paths, e.g., 'my-actor') */
|
|
292
|
-
name: string;
|
|
293
|
-
/** Username of the Actor's owner */
|
|
294
|
-
username: string;
|
|
295
|
-
/** Detailed description of what the Actor does */
|
|
296
|
-
description?: string;
|
|
297
|
-
/** @deprecated Use defaultRunOptions.restartOnError instead */
|
|
298
|
-
restartOnError?: boolean;
|
|
299
|
-
/** Whether the Actor is publicly available in Apify Store */
|
|
300
|
-
isPublic: boolean;
|
|
301
|
-
/** Whether the Actor can be run by anonymous users without authentication */
|
|
302
|
-
isAnonymouslyRunnable?: boolean;
|
|
303
|
-
/** Timestamp when the Actor was created */
|
|
304
|
-
createdAt: Date;
|
|
305
|
-
/** Timestamp when the Actor was last modified */
|
|
306
|
-
modifiedAt: Date;
|
|
307
|
-
/** Usage and run statistics for the Actor */
|
|
308
|
-
stats: ActorStats;
|
|
309
|
-
/** All versions of this Actor */
|
|
310
|
-
versions: ActorVersion[];
|
|
311
|
-
/**
|
|
312
|
-
* Pricing information for pay-per-result or pay-per-event Actors
|
|
313
|
-
* @since Added in 2.12.4
|
|
314
|
-
*/
|
|
315
|
-
pricingInfos?: ActorRunPricingInfo[];
|
|
316
|
-
/** Default configuration options for Actor runs */
|
|
317
|
-
defaultRunOptions: ActorDefaultRunOptions;
|
|
318
|
-
/** Example input to help users understand how to use the Actor */
|
|
319
|
-
exampleRunInput?: ActorExampleRunInput;
|
|
320
|
-
/** Whether the Actor is deprecated and should not be used */
|
|
321
|
-
isDeprecated?: boolean;
|
|
322
|
-
/** Deployment key used for automated deployments */
|
|
323
|
-
deploymentKey: string;
|
|
324
|
-
/** Human-readable title of the Actor (displayed in UI) */
|
|
325
|
-
title?: string;
|
|
326
|
-
/** Mapping of tags to specific builds (e.g., 'latest', 'beta') */
|
|
327
|
-
taggedBuilds?: ActorTaggedBuilds;
|
|
328
|
-
/**
|
|
329
|
-
* SEO-optimized title for the Actor's public page
|
|
330
|
-
* @since Added in 2.6.1
|
|
331
|
-
*/
|
|
332
|
-
seoTitle?: string;
|
|
333
|
-
/**
|
|
334
|
-
* SEO-optimized description for the Actor's public page
|
|
335
|
-
* @since Added in 2.6.1
|
|
336
|
-
*/
|
|
337
|
-
seoDescription?: string;
|
|
338
|
-
/**
|
|
339
|
-
* Categories the Actor belongs to (e.g., 'ECOMMERCE', 'SCRAPING')
|
|
340
|
-
* @since Added in 2.6.1
|
|
341
|
-
*/
|
|
342
|
-
categories?: string[];
|
|
343
|
-
/**
|
|
344
|
-
* Standby mode configuration for keeping Actor warm and responsive
|
|
345
|
-
* @since Added in 2.9.5
|
|
346
|
-
*/
|
|
347
|
-
actorStandby?: ActorStandby & {
|
|
348
|
-
isEnabled: boolean;
|
|
349
|
-
};
|
|
350
|
-
/**
|
|
351
|
-
* Permission level of the Actor on Apify platform
|
|
352
|
-
* @since Added in 2.21.0
|
|
353
|
-
*/
|
|
354
|
-
actorPermissionLevel: ACTOR_PERMISSION_LEVEL;
|
|
355
|
-
/**
|
|
356
|
-
* A brief, LLM-generated readme summary
|
|
357
|
-
* @since Added in 2.22.1
|
|
358
|
-
*/
|
|
359
|
-
readmeSummary?: string;
|
|
360
|
-
}
|
|
361
|
-
/**
|
|
362
|
-
* Statistics about Actor usage and activity.
|
|
363
|
-
*/
|
|
364
|
-
export interface ActorStats {
|
|
365
|
-
/** Total number of builds created for this Actor */
|
|
366
|
-
totalBuilds: number;
|
|
367
|
-
/** Total number of times this Actor has been run */
|
|
368
|
-
totalRuns: number;
|
|
369
|
-
/** Total number of unique users who have run this Actor */
|
|
370
|
-
totalUsers: number;
|
|
371
|
-
/** Number of unique users in the last 7 days */
|
|
372
|
-
totalUsers7Days: number;
|
|
373
|
-
/** Number of unique users in the last 30 days */
|
|
374
|
-
totalUsers30Days: number;
|
|
375
|
-
/** Number of unique users in the last 90 days */
|
|
376
|
-
totalUsers90Days: number;
|
|
377
|
-
/** Total number of times this Actor was used via metamorph */
|
|
378
|
-
totalMetamorphs: number;
|
|
379
|
-
/** Timestamp when the last run was started */
|
|
380
|
-
lastRunStartedAt: Date;
|
|
381
|
-
}
|
|
382
|
-
/**
|
|
383
|
-
* Default configuration options for Actor runs.
|
|
384
|
-
*/
|
|
385
|
-
export interface ActorDefaultRunOptions {
|
|
386
|
-
build: string;
|
|
387
|
-
timeoutSecs: number;
|
|
388
|
-
memoryMbytes: number;
|
|
389
|
-
/**
|
|
390
|
-
* @since Added in 2.19.0
|
|
391
|
-
*/
|
|
392
|
-
restartOnError?: boolean;
|
|
393
|
-
}
|
|
394
|
-
/**
|
|
395
|
-
* Example input data to demonstrate Actor usage.
|
|
396
|
-
*/
|
|
397
|
-
export interface ActorExampleRunInput {
|
|
398
|
-
body: string;
|
|
399
|
-
contentType: string;
|
|
400
|
-
}
|
|
401
|
-
/**
|
|
402
|
-
* Mapping of build tags (e.g., 'latest', 'beta') to their corresponding build information.
|
|
403
|
-
*/
|
|
404
|
-
export type ActorTaggedBuilds = Record<string, ActorTaggedBuild>;
|
|
405
|
-
/**
|
|
406
|
-
* Information about a specific tagged build.
|
|
407
|
-
*/
|
|
408
|
-
export interface ActorTaggedBuild {
|
|
409
|
-
buildId?: string;
|
|
410
|
-
buildNumber?: string;
|
|
411
|
-
finishedAt?: Date;
|
|
412
|
-
}
|
|
413
279
|
/**
|
|
414
280
|
* Fields that can be updated when modifying an Actor.
|
|
415
281
|
*/
|
|
416
282
|
export type ActorUpdateOptions = Partial<Pick<Actor, 'name' | 'description' | 'isPublic' | 'isDeprecated' | 'seoTitle' | 'seoDescription' | 'title' | 'restartOnError' | 'versions' | 'categories' | 'defaultRunOptions' | 'actorStandby' | 'actorPermissionLevel' | 'taggedBuilds'>>;
|
|
417
|
-
/**
|
|
418
|
-
* Configuration for Actor standby mode.
|
|
419
|
-
*
|
|
420
|
-
* Standby mode keeps Actor containers warm and ready to process requests with minimal latency.
|
|
421
|
-
* This is useful for Actors that need to respond quickly to incoming requests.
|
|
422
|
-
* @since Added in 2.9.5
|
|
423
|
-
*/
|
|
424
|
-
export interface ActorStandby {
|
|
425
|
-
build?: string;
|
|
426
|
-
desiredRequestsPerActorRun?: number;
|
|
427
|
-
/**
|
|
428
|
-
* @since Added in 2.22.0
|
|
429
|
-
*/
|
|
430
|
-
disableStandbyFieldsOverride?: boolean;
|
|
431
|
-
idleTimeoutSecs?: number;
|
|
432
|
-
maxRequestsPerActorRun?: number;
|
|
433
|
-
memoryMbytes?: number;
|
|
434
|
-
/**
|
|
435
|
-
* @since Added in 2.22.0
|
|
436
|
-
*/
|
|
437
|
-
shouldPassActorInput?: boolean;
|
|
438
|
-
}
|
|
439
283
|
export interface ActorStartOptions {
|
|
440
284
|
/**
|
|
441
285
|
* Tag or number of the Actor build to run (e.g. `beta` or `1.2.345`).
|
|
@@ -521,187 +365,6 @@ export interface ActorCallOptions extends Omit<ActorStartOptions, 'waitForFinish
|
|
|
521
365
|
*/
|
|
522
366
|
log?: Log | null | 'default';
|
|
523
367
|
}
|
|
524
|
-
/**
|
|
525
|
-
* Simplified Actor run information used in list results.
|
|
526
|
-
*
|
|
527
|
-
* Contains basic information about a run without detailed statistics.
|
|
528
|
-
* @since Added in 2.7.0
|
|
529
|
-
*/
|
|
530
|
-
export interface ActorRunListItem {
|
|
531
|
-
id: string;
|
|
532
|
-
actId: string;
|
|
533
|
-
actorTaskId?: string;
|
|
534
|
-
startedAt: Date;
|
|
535
|
-
finishedAt: Date;
|
|
536
|
-
status: (typeof ACTOR_JOB_STATUSES)[keyof typeof ACTOR_JOB_STATUSES];
|
|
537
|
-
meta: ActorRunMeta;
|
|
538
|
-
buildId: string;
|
|
539
|
-
buildNumber: string;
|
|
540
|
-
defaultKeyValueStoreId: string;
|
|
541
|
-
defaultDatasetId: string;
|
|
542
|
-
/**
|
|
543
|
-
* @since Added in 2.6.1
|
|
544
|
-
*/
|
|
545
|
-
defaultRequestQueueId: string;
|
|
546
|
-
/**
|
|
547
|
-
* @since Added in 2.7.2
|
|
548
|
-
*/
|
|
549
|
-
usageTotalUsd?: number;
|
|
550
|
-
}
|
|
551
|
-
/**
|
|
552
|
-
* @since Added in 2.22.3
|
|
553
|
-
*/
|
|
554
|
-
export interface ActorRunStorageIds {
|
|
555
|
-
/** Aliased dataset IDs for this run. */
|
|
556
|
-
datasets: {
|
|
557
|
-
default: string;
|
|
558
|
-
[alias: string]: string;
|
|
559
|
-
};
|
|
560
|
-
/** Aliased key-value store IDs for this run. */
|
|
561
|
-
keyValueStores: {
|
|
562
|
-
default: string;
|
|
563
|
-
[alias: string]: string;
|
|
564
|
-
};
|
|
565
|
-
/** Aliased request queue IDs for this run. */
|
|
566
|
-
requestQueues: {
|
|
567
|
-
default: string;
|
|
568
|
-
[alias: string]: string;
|
|
569
|
-
};
|
|
570
|
-
}
|
|
571
|
-
/**
|
|
572
|
-
* Complete Actor run information including statistics and usage details.
|
|
573
|
-
*
|
|
574
|
-
* Represents a single execution of an Actor with all its configuration, status,
|
|
575
|
-
* and resource usage information.
|
|
576
|
-
*/
|
|
577
|
-
export interface ActorRun extends ActorRunListItem {
|
|
578
|
-
userId: string;
|
|
579
|
-
/**
|
|
580
|
-
* @since Added in 2.6.0
|
|
581
|
-
*/
|
|
582
|
-
statusMessage?: string;
|
|
583
|
-
stats: ActorRunStats;
|
|
584
|
-
options: ActorRunOptions;
|
|
585
|
-
exitCode?: number;
|
|
586
|
-
containerUrl: string;
|
|
587
|
-
/**
|
|
588
|
-
* @since Added in 2.7.0
|
|
589
|
-
*/
|
|
590
|
-
isContainerServerReady?: boolean;
|
|
591
|
-
/**
|
|
592
|
-
* @since Added in 2.7.0
|
|
593
|
-
*/
|
|
594
|
-
gitBranchName?: string;
|
|
595
|
-
/**
|
|
596
|
-
* @since Added in 2.7.0
|
|
597
|
-
*/
|
|
598
|
-
usage?: ActorRunUsage;
|
|
599
|
-
/**
|
|
600
|
-
* @since Added in 2.7.2
|
|
601
|
-
*/
|
|
602
|
-
usageUsd?: ActorRunUsage;
|
|
603
|
-
/**
|
|
604
|
-
* @since Added in 2.11.1
|
|
605
|
-
*/
|
|
606
|
-
pricingInfo?: ActorRunPricingInfo;
|
|
607
|
-
/**
|
|
608
|
-
* @since Added in 2.11.1
|
|
609
|
-
*/
|
|
610
|
-
chargedEventCounts?: Record<string, number>;
|
|
611
|
-
/**
|
|
612
|
-
* @since Added in 2.12.2
|
|
613
|
-
*/
|
|
614
|
-
generalAccess?: RUN_GENERAL_ACCESS | null;
|
|
615
|
-
/**
|
|
616
|
-
* @since Added in 2.22.3
|
|
617
|
-
*/
|
|
618
|
-
storageIds?: ActorRunStorageIds;
|
|
619
|
-
}
|
|
620
|
-
/**
|
|
621
|
-
* Resource usage metrics for an Actor run.
|
|
622
|
-
*
|
|
623
|
-
* All values represent the total consumption during the run's lifetime.
|
|
624
|
-
* @since Added in 2.7.0
|
|
625
|
-
*/
|
|
626
|
-
export interface ActorRunUsage {
|
|
627
|
-
/** Compute units consumed (combines CPU and memory usage over time) */
|
|
628
|
-
ACTOR_COMPUTE_UNITS?: number;
|
|
629
|
-
/** Number of Dataset read operations */
|
|
630
|
-
DATASET_READS?: number;
|
|
631
|
-
/** Number of Dataset write operations */
|
|
632
|
-
DATASET_WRITES?: number;
|
|
633
|
-
/** Number of key-value store read operations */
|
|
634
|
-
KEY_VALUE_STORE_READS?: number;
|
|
635
|
-
/** Number of key-value store write operations */
|
|
636
|
-
KEY_VALUE_STORE_WRITES?: number;
|
|
637
|
-
/** Number of key-value store list operations */
|
|
638
|
-
KEY_VALUE_STORE_LISTS?: number;
|
|
639
|
-
/** Number of Request queue read operations */
|
|
640
|
-
REQUEST_QUEUE_READS?: number;
|
|
641
|
-
/** Number of Request queue write operations */
|
|
642
|
-
REQUEST_QUEUE_WRITES?: number;
|
|
643
|
-
/** Internal data transfer within Apify platform (in gigabytes) */
|
|
644
|
-
DATA_TRANSFER_INTERNAL_GBYTES?: number;
|
|
645
|
-
/** External data transfer to/from internet (in gigabytes) */
|
|
646
|
-
DATA_TRANSFER_EXTERNAL_GBYTES?: number;
|
|
647
|
-
/** Residential proxy data transfer (in gigabytes) */
|
|
648
|
-
PROXY_RESIDENTIAL_TRANSFER_GBYTES?: number;
|
|
649
|
-
/** Number of SERP (Search Engine Results Page) proxy requests */
|
|
650
|
-
PROXY_SERPS?: number;
|
|
651
|
-
}
|
|
652
|
-
/**
|
|
653
|
-
* Metadata about how an Actor run was initiated.
|
|
654
|
-
*/
|
|
655
|
-
export interface ActorRunMeta {
|
|
656
|
-
origin: string;
|
|
657
|
-
clientIp?: string;
|
|
658
|
-
userAgent: string;
|
|
659
|
-
}
|
|
660
|
-
/**
|
|
661
|
-
* Runtime statistics for an Actor run.
|
|
662
|
-
*
|
|
663
|
-
* Provides detailed metrics about resource consumption and performance during the run.
|
|
664
|
-
*/
|
|
665
|
-
export interface ActorRunStats {
|
|
666
|
-
inputBodyLen: number;
|
|
667
|
-
restartCount: number;
|
|
668
|
-
resurrectCount: number;
|
|
669
|
-
memAvgBytes: number;
|
|
670
|
-
memMaxBytes: number;
|
|
671
|
-
memCurrentBytes: number;
|
|
672
|
-
cpuAvgUsage: number;
|
|
673
|
-
cpuMaxUsage: number;
|
|
674
|
-
cpuCurrentUsage: number;
|
|
675
|
-
netRxBytes: number;
|
|
676
|
-
netTxBytes: number;
|
|
677
|
-
durationMillis: number;
|
|
678
|
-
runTimeSecs: number;
|
|
679
|
-
metamorph: number;
|
|
680
|
-
computeUnits: number;
|
|
681
|
-
}
|
|
682
|
-
/**
|
|
683
|
-
* Configuration options used for an Actor run.
|
|
684
|
-
*
|
|
685
|
-
* These are the actual options that were applied to the run (may differ from requested options).
|
|
686
|
-
*/
|
|
687
|
-
export interface ActorRunOptions {
|
|
688
|
-
build: string;
|
|
689
|
-
timeoutSecs: number;
|
|
690
|
-
memoryMbytes: number;
|
|
691
|
-
diskMbytes: number;
|
|
692
|
-
/**
|
|
693
|
-
* @since Added in 2.20.0
|
|
694
|
-
*/
|
|
695
|
-
maxItems?: number;
|
|
696
|
-
/**
|
|
697
|
-
* @since Added in 2.11.1
|
|
698
|
-
*/
|
|
699
|
-
maxTotalChargeUsd?: number;
|
|
700
|
-
/**
|
|
701
|
-
* @since Added in 2.19.0
|
|
702
|
-
*/
|
|
703
|
-
restartOnError?: boolean;
|
|
704
|
-
}
|
|
705
368
|
/**
|
|
706
369
|
* Options for validating an Actor input.
|
|
707
370
|
* @since Added in 2.24.0
|
|
@@ -739,112 +402,3 @@ export interface ActorLastRunOptions {
|
|
|
739
402
|
*/
|
|
740
403
|
origin?: ValueOf<typeof META_ORIGINS>;
|
|
741
404
|
}
|
|
742
|
-
/**
|
|
743
|
-
* Actor definition from the `.actor/actor.json` file.
|
|
744
|
-
*
|
|
745
|
-
* Contains the Actor's configuration, input schema, and other metadata.
|
|
746
|
-
* @see https://docs.apify.com/platform/actors/development/actor-definition/actor-json
|
|
747
|
-
* @since Added in 2.11.0
|
|
748
|
-
*/
|
|
749
|
-
export interface ActorDefinition {
|
|
750
|
-
actorSpecification: number;
|
|
751
|
-
name: string;
|
|
752
|
-
version: string;
|
|
753
|
-
buildTag?: string;
|
|
754
|
-
environmentVariables?: Record<string, string>;
|
|
755
|
-
dockerfile?: string;
|
|
756
|
-
dockerContextDir?: string;
|
|
757
|
-
readme?: string | null;
|
|
758
|
-
/**
|
|
759
|
-
* Input schema for the Actor.
|
|
760
|
-
* @see https://docs.apify.com/platform/actors/development/actor-definition/input-schema
|
|
761
|
-
*/
|
|
762
|
-
input?: object | null;
|
|
763
|
-
/**
|
|
764
|
-
* Output schema for the Actor.
|
|
765
|
-
* @see https://docs.apify.com/platform/actors/development/actor-definition/output-schema
|
|
766
|
-
* @since Added in 2.23.0
|
|
767
|
-
*/
|
|
768
|
-
output?: object | null;
|
|
769
|
-
changelog?: string | null;
|
|
770
|
-
storages?: {
|
|
771
|
-
dataset?: object;
|
|
772
|
-
};
|
|
773
|
-
minMemoryMbytes?: number;
|
|
774
|
-
maxMemoryMbytes?: number;
|
|
775
|
-
usesStandbyMode?: boolean;
|
|
776
|
-
}
|
|
777
|
-
interface CommonActorPricingInfo {
|
|
778
|
-
/** In [0, 1], fraction of pricePerUnitUsd that goes to Apify */
|
|
779
|
-
apifyMarginPercentage: number;
|
|
780
|
-
/** When this pricing info record has been created */
|
|
781
|
-
createdAt: Date;
|
|
782
|
-
/** Since when is this pricing info record effective for a given Actor */
|
|
783
|
-
startedAt: Date;
|
|
784
|
-
notifiedAboutFutureChangeAt?: Date;
|
|
785
|
-
notifiedAboutChangeAt?: Date;
|
|
786
|
-
reasonForChange?: string;
|
|
787
|
-
}
|
|
788
|
-
/**
|
|
789
|
-
* Pricing information for free Actors.
|
|
790
|
-
* @since Added in 2.11.1
|
|
791
|
-
*/
|
|
792
|
-
export interface FreeActorPricingInfo extends CommonActorPricingInfo {
|
|
793
|
-
pricingModel: 'FREE';
|
|
794
|
-
}
|
|
795
|
-
/**
|
|
796
|
-
* Pricing information for Actors with a flat monthly subscription fee.
|
|
797
|
-
* @since Added in 2.11.1
|
|
798
|
-
*/
|
|
799
|
-
export interface FlatPricePerMonthActorPricingInfo extends CommonActorPricingInfo {
|
|
800
|
-
pricingModel: 'FLAT_PRICE_PER_MONTH';
|
|
801
|
-
/** For how long this Actor can be used for free in trial period */
|
|
802
|
-
trialMinutes?: number;
|
|
803
|
-
/** Monthly flat price in USD */
|
|
804
|
-
pricePerUnitUsd: number;
|
|
805
|
-
}
|
|
806
|
-
/**
|
|
807
|
-
* Pricing information for pay-per-result Actors.
|
|
808
|
-
*
|
|
809
|
-
* These Actors charge based on the number of items saved to the dataset.
|
|
810
|
-
* @since Added in 2.11.1
|
|
811
|
-
*/
|
|
812
|
-
export interface PricePerDatasetItemActorPricingInfo extends CommonActorPricingInfo {
|
|
813
|
-
pricingModel: 'PRICE_PER_DATASET_ITEM';
|
|
814
|
-
/** Name of the unit that is being charged */
|
|
815
|
-
unitName?: string;
|
|
816
|
-
pricePerUnitUsd: number;
|
|
817
|
-
}
|
|
818
|
-
/**
|
|
819
|
-
* Definition of a chargeable event for pay-per-event Actors.
|
|
820
|
-
* @since Added in 2.11.1
|
|
821
|
-
*/
|
|
822
|
-
export interface ActorChargeEvent {
|
|
823
|
-
eventPriceUsd: number;
|
|
824
|
-
eventTitle: string;
|
|
825
|
-
eventDescription?: string;
|
|
826
|
-
}
|
|
827
|
-
/**
|
|
828
|
-
* Mapping of event names to their pricing information.
|
|
829
|
-
* @since Added in 2.11.1
|
|
830
|
-
*/
|
|
831
|
-
export type ActorChargeEvents = Record<string, ActorChargeEvent>;
|
|
832
|
-
/**
|
|
833
|
-
* Pricing information for pay-per-event Actors.
|
|
834
|
-
*
|
|
835
|
-
* These Actors charge based on specific events (e.g., emails sent, API calls made).
|
|
836
|
-
* @since Added in 2.11.1
|
|
837
|
-
*/
|
|
838
|
-
export interface PricePerEventActorPricingInfo extends CommonActorPricingInfo {
|
|
839
|
-
pricingModel: 'PAY_PER_EVENT';
|
|
840
|
-
pricingPerEvent: {
|
|
841
|
-
actorChargeEvents: ActorChargeEvents;
|
|
842
|
-
};
|
|
843
|
-
minimalMaxTotalChargeUsd?: number;
|
|
844
|
-
}
|
|
845
|
-
/**
|
|
846
|
-
* Union type representing all possible Actor pricing models.
|
|
847
|
-
* @since Added in 2.11.1
|
|
848
|
-
*/
|
|
849
|
-
export type ActorRunPricingInfo = PricePerEventActorPricingInfo | PricePerDatasetItemActorPricingInfo | FlatPricePerMonthActorPricingInfo | FreeActorPricingInfo;
|
|
850
|
-
export {};
|
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import type { ACTOR_PERMISSION_LEVEL } from '@apify/consts';
|
|
2
2
|
import type { ApiClientSubResourceOptions } from '../base/api_client';
|
|
3
3
|
import { ResourceCollectionClient } from '../base/resource_collection_client';
|
|
4
|
+
import type { ActorCollectionListItem } from '../models';
|
|
4
5
|
import type { PaginatedIterator, PaginatedList, PaginationOptions } from '../utils';
|
|
5
6
|
import type { Actor, ActorDefaultRunOptions, ActorExampleRunInput, ActorStandby } from './actor';
|
|
6
7
|
import type { ActorVersion } from './actor_version';
|
|
8
|
+
export type { ActorCollectionListItem } from '../models';
|
|
7
9
|
/**
|
|
8
10
|
* Client for managing the collection of Actors in your account.
|
|
9
11
|
*
|
|
@@ -77,13 +79,6 @@ export interface ActorCollectionListOptions extends PaginationOptions {
|
|
|
77
79
|
*/
|
|
78
80
|
sortBy?: ActorListSortBy;
|
|
79
81
|
}
|
|
80
|
-
export interface ActorCollectionListItem {
|
|
81
|
-
id: string;
|
|
82
|
-
createdAt: Date;
|
|
83
|
-
modifiedAt: Date;
|
|
84
|
-
name: string;
|
|
85
|
-
username: string;
|
|
86
|
-
}
|
|
87
82
|
export type ActorCollectionListResult = PaginatedList<ActorCollectionListItem>;
|
|
88
83
|
export interface ActorCollectionCreateOptions {
|
|
89
84
|
/**
|
|
@@ -1,7 +1,10 @@
|
|
|
1
1
|
import type { ApiClientSubResourceOptions } from '../base/api_client';
|
|
2
2
|
import { ResourceClient } from '../base/resource_client';
|
|
3
|
+
import type { ActorVersion, FinalActorVersion } from '../models';
|
|
3
4
|
import { ActorEnvVarClient } from './actor_env_var';
|
|
4
5
|
import { ActorEnvVarCollectionClient } from './actor_env_var_collection';
|
|
6
|
+
export type { ActorEnvironmentVariable, ActorVersion, ActorVersionGitHubGist, ActorVersionGitRepo, ActorVersionSourceCode, ActorVersionSourceFile, ActorVersionSourceFiles, ActorVersionSourceFolder, ActorVersionTarball, BaseActorVersion, FinalActorVersion, } from '../models';
|
|
7
|
+
export { ActorSourceType } from '../models';
|
|
5
8
|
/**
|
|
6
9
|
* Client for managing a specific Actor version.
|
|
7
10
|
*
|
|
@@ -67,43 +70,3 @@ export declare class ActorVersionClient extends ResourceClient {
|
|
|
67
70
|
*/
|
|
68
71
|
envVars(): ActorEnvVarCollectionClient;
|
|
69
72
|
}
|
|
70
|
-
export interface BaseActorVersion<SourceType extends ActorSourceType> {
|
|
71
|
-
versionNumber?: string;
|
|
72
|
-
sourceType: SourceType;
|
|
73
|
-
envVars?: ActorEnvironmentVariable[];
|
|
74
|
-
applyEnvVarsToBuild?: boolean;
|
|
75
|
-
buildTag?: string;
|
|
76
|
-
}
|
|
77
|
-
/**
|
|
78
|
-
* @since Added in 2.6.1
|
|
79
|
-
*/
|
|
80
|
-
export interface ActorVersionSourceFiles extends BaseActorVersion<ActorSourceType.SourceFiles> {
|
|
81
|
-
sourceFiles: ActorVersionSourceFile[];
|
|
82
|
-
}
|
|
83
|
-
export interface ActorVersionSourceFile {
|
|
84
|
-
name: string;
|
|
85
|
-
format: 'TEXT' | 'BASE64';
|
|
86
|
-
content: string;
|
|
87
|
-
}
|
|
88
|
-
export interface ActorVersionGitRepo extends BaseActorVersion<ActorSourceType.GitRepo> {
|
|
89
|
-
gitRepoUrl: string;
|
|
90
|
-
}
|
|
91
|
-
export interface ActorVersionTarball extends BaseActorVersion<ActorSourceType.Tarball> {
|
|
92
|
-
tarballUrl: string;
|
|
93
|
-
}
|
|
94
|
-
export interface ActorVersionGitHubGist extends BaseActorVersion<ActorSourceType.GitHubGist> {
|
|
95
|
-
gitHubGistUrl: string;
|
|
96
|
-
}
|
|
97
|
-
export declare enum ActorSourceType {
|
|
98
|
-
SourceFiles = "SOURCE_FILES",
|
|
99
|
-
GitRepo = "GIT_REPO",
|
|
100
|
-
Tarball = "TARBALL",
|
|
101
|
-
GitHubGist = "GITHUB_GIST"
|
|
102
|
-
}
|
|
103
|
-
export interface ActorEnvironmentVariable {
|
|
104
|
-
name?: string;
|
|
105
|
-
value?: string;
|
|
106
|
-
isSecret?: boolean;
|
|
107
|
-
}
|
|
108
|
-
export type ActorVersion = ActorVersionSourceFiles | ActorVersionGitRepo | ActorVersionTarball | ActorVersionGitHubGist;
|
|
109
|
-
export type FinalActorVersion = ActorVersion & Required<Pick<ActorVersion, 'versionNumber' | 'buildTag'>>;
|
|
@@ -1,12 +1,14 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.
|
|
3
|
+
exports.ActorVersionClient = exports.ActorSourceType = void 0;
|
|
4
4
|
const zod_1 = require("zod");
|
|
5
5
|
const resource_client_1 = require("../base/resource_client");
|
|
6
6
|
const utils_1 = require("../utils");
|
|
7
7
|
const actor_env_var_1 = require("./actor_env_var");
|
|
8
8
|
const actor_env_var_collection_1 = require("./actor_env_var_collection");
|
|
9
9
|
const envVarNameSchema = zod_1.z.string();
|
|
10
|
+
var models_1 = require("../models");
|
|
11
|
+
Object.defineProperty(exports, "ActorSourceType", { enumerable: true, get: function () { return models_1.ActorSourceType; } });
|
|
10
12
|
/**
|
|
11
13
|
* Client for managing a specific Actor version.
|
|
12
14
|
*
|
|
@@ -92,10 +94,3 @@ class ActorVersionClient extends resource_client_1.ResourceClient {
|
|
|
92
94
|
}
|
|
93
95
|
}
|
|
94
96
|
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 = {}));
|