From 4ffd1c620a6fdb0660d6a49a667e67a4840c8e6b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Novotn=C3=BD?= Date: Mon, 14 Oct 2024 15:04:17 +0200 Subject: [PATCH] feat: Rename maxCostPerRunUsd to maxTotalChargeUsd (#592) Renaming to match actor whitepaper https://github.com/apify/actor-whitepaper?tab=readme-ov-file#environment-variables Related PR in core https://github.com/apify/apify-core/pull/17870 --- src/resource_clients/actor.ts | 10 +++++----- src/resource_clients/task.ts | 8 ++++---- 2 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/resource_clients/actor.ts b/src/resource_clients/actor.ts index f8a28d43..18c23d38 100644 --- a/src/resource_clients/actor.ts +++ b/src/resource_clients/actor.ts @@ -68,10 +68,10 @@ export class ActorClient extends ResourceClient { waitForFinish: ow.optional.number, webhooks: ow.optional.array.ofType(ow.object), maxItems: ow.optional.number.not.negative, - maxCostPerRunUsd: ow.optional.number.not.negative, + maxTotalChargeUsd: ow.optional.number.not.negative, })); - const { waitForFinish, timeout, memory, build, maxItems, maxCostPerRunUsd } = options; + const { waitForFinish, timeout, memory, build, maxItems, maxTotalChargeUsd } = options; const params = { waitForFinish, @@ -80,7 +80,7 @@ export class ActorClient extends ResourceClient { build, webhooks: stringifyWebhooksToBase64(options.webhooks), maxItems, - maxCostPerRunUsd, + maxTotalChargeUsd, }; const request: AxiosRequestConfig = { @@ -121,7 +121,7 @@ export class ActorClient extends ResourceClient { waitSecs: ow.optional.number.not.negative, webhooks: ow.optional.array.ofType(ow.object), maxItems: ow.optional.number.not.negative, - maxCostPerRunUsd: ow.optional.number.not.negative, + maxTotalChargeUsd: ow.optional.number.not.negative, })); const { waitSecs, ...startOptions } = options; @@ -350,7 +350,7 @@ export interface ActorStartOptions { */ maxItems?: number; - // TODO(PPE): add maxCostPerRunUsd after finished + // TODO(PPE): add maxTotalChargeUsd after finished } export interface ActorCallOptions extends Omit { diff --git a/src/resource_clients/task.ts b/src/resource_clients/task.ts index 5dff3fc0..a24997c8 100644 --- a/src/resource_clients/task.ts +++ b/src/resource_clients/task.ts @@ -65,10 +65,10 @@ export class TaskClient extends ResourceClient { waitForFinish: ow.optional.number, webhooks: ow.optional.array.ofType(ow.object), maxItems: ow.optional.number.not.negative, - maxCostPerRunUsd: ow.optional.number.not.negative, + maxTotalChargeUsd: ow.optional.number.not.negative, })); - const { waitForFinish, timeout, memory, build, maxItems, maxCostPerRunUsd } = options; + const { waitForFinish, timeout, memory, build, maxItems, maxTotalChargeUsd } = options; const params = { waitForFinish, @@ -77,7 +77,7 @@ export class TaskClient extends ResourceClient { build, webhooks: stringifyWebhooksToBase64(options.webhooks), maxItems, - maxCostPerRunUsd, + maxTotalChargeUsd, }; const request: ApifyRequestConfig = { @@ -111,7 +111,7 @@ export class TaskClient extends ResourceClient { waitSecs: ow.optional.number.not.negative, webhooks: ow.optional.array.ofType(ow.object), maxItems: ow.optional.number.not.negative, - maxCostPerRunUsd: ow.optional.number.not.negative, + maxTotalChargeUsd: ow.optional.number.not.negative, })); const { waitSecs, ...startOptions } = options;