Skip to content

Commit

Permalink
feat: add Actor Standby types (#569)
Browse files Browse the repository at this point in the history
This PR adds types for Actor Standby.
  • Loading branch information
jirimoravcik authored Jul 22, 2024
1 parent d9ae5c5 commit d3ba82b
Show file tree
Hide file tree
Showing 4 changed files with 20 additions and 3 deletions.
2 changes: 1 addition & 1 deletion package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "apify-client",
"version": "2.9.4",
"version": "2.9.5",
"description": "Apify API client for JavaScript",
"main": "dist/index.js",
"module": "dist/index.mjs",
Expand Down
12 changes: 12 additions & 0 deletions src/resource_clients/actor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -238,6 +238,9 @@ export interface Actor {
seoTitle?: string;
seoDescription?: string;
categories?: string[];
actorStandby?: ActorStandby & {
isEnabled: boolean
},
}

export interface ActorStats {
Expand Down Expand Up @@ -285,8 +288,17 @@ export type ActorUpdateOptions = Partial<Pick<
| 'versions'
| 'categories'
| 'defaultRunOptions'
| 'actorStandby'
>>

export interface ActorStandby {
desiredRequestsPerActorRun: number,
maxRequestsPerActorRun: number,
idleTimeoutSecs: number,
build: string,
memoryMbytes: number,
}

export interface ActorStartOptions {
/**
* Tag or number of the actor build to run (e.g. `beta` or `1.2.345`).
Expand Down
5 changes: 4 additions & 1 deletion src/resource_clients/actor_collection.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import ow from 'ow';

import { Actor, ActorDefaultRunOptions, ActorExampleRunInput } from './actor';
import { Actor, ActorDefaultRunOptions, ActorExampleRunInput, ActorStandby } from './actor';
import { ActorVersion } from './actor_version';
import { ApiClientSubResourceOptions } from '../base/api_client';
import { ResourceCollectionClient } from '../base/resource_collection_client';
Expand Down Expand Up @@ -71,4 +71,7 @@ export interface ActorCollectionCreateOptions {
seoDescription?: string;
title?: string;
versions?: ActorVersion[];
actorStandby?: ActorStandby & {
isEnabled: boolean
},
}
4 changes: 3 additions & 1 deletion src/resource_clients/task.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ACT_JOB_STATUSES, META_ORIGINS } from '@apify/consts';
import ow from 'ow';

import { ActorRun, ActorStartOptions } from './actor';
import { ActorRun, ActorStandby, ActorStartOptions } from './actor';
import { RunClient } from './run';
import { RunCollectionClient } from './run_collection';
import { WebhookCollectionClient } from './webhook_collection';
Expand Down Expand Up @@ -200,6 +200,7 @@ export interface Task {
stats: TaskStats;
options?: TaskOptions;
input?: Dictionary | Dictionary[];
actorStandby?: Partial<ActorStandby>,
}

export interface TaskStats {
Expand All @@ -220,6 +221,7 @@ export type TaskUpdateData = Partial<
| 'description'
| 'options'
| 'input'
| 'actorStandby'
>
>;

Expand Down

0 comments on commit d3ba82b

Please sign in to comment.