diff --git a/CHANGELOG.md b/CHANGELOG.md index 6e277cd..8b9fd9c 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,11 @@ # Changelog +## 0.14.1 + +- Synced with Apify OpenAPI spec `v2-2026-11-10T140017Z`, which only changes descriptions. +- Documented that `RunClient::charge()` is called from the Actor run with the `APIFY_TOKEN` of the run, and how to charge a multi-tenant Server Actor request. +- Documented that Apify Console shows an API token only once. + ## 0.14.0 - Synced with Apify OpenAPI spec `v2-2026-11-09T143926Z`: `zstd` is a documented `Content-Encoding`. diff --git a/README.md b/README.md index 31bbaad..543f2fe 100644 --- a/README.md +++ b/README.md @@ -34,7 +34,8 @@ echo 'Item count: ' . $items->getCount() . PHP_EOL; ``` The client does not read `APIFY_TOKEN`. Pass it yourself, for example `new ApifyClient(getenv('APIFY_TOKEN'))`. -You can find your token in [Apify Console → Settings → API & Integrations](https://console.apify.com/settings/integrations). +You can create a token in [Apify Console → Settings → API & Integrations](https://console.apify.com/settings/integrations). +Apify Console shows a token only once, right after you create or rotate it, so store it somewhere safe. ## Configuration diff --git a/docs/runs.md b/docs/runs.md index 8f02e91..8da22c0 100644 --- a/docs/runs.md +++ b/docs/runs.md @@ -26,7 +26,7 @@ An Actor's or task's runs are available at `$client->actor($id)->runs()` / `$cli - `metamorph(string $targetActorId, mixed $input = null, ?MetamorphOptions $options = null): ActorRun`: `$input` is as for `ActorClient::start()`. - `reboot(): ActorRun` - `resurrect(?RunResurrectOptions $options = null): ActorRun` -- `charge(RunChargeOptions $options): void`: for pay-per-event Actors. +- `charge(RunChargeOptions $options): void`: for pay-per-event Actors. Call it from the Actor run itself, with the token the run received in `APIFY_TOKEN`. For a multi-tenant Server Actor, set `requestId` to the request's `X-Actor-Request-ID` header value. - `waitForFinish(?int $waitSecs = null, int|float|string|null $timeoutSecs = null): ActorRun`: `$timeoutSecs` is the timeout of each poll request (default `'noTimeout'`). - `dataset(): DatasetClient`, `keyValueStore(): KeyValueStoreClient`, `requestQueue(): RequestQueueClient`: a 404 from `get()` or `delete()` is thrown, since the client cannot tell a missing run from a missing storage. - `iterateDatasetItems(?RunIterateDatasetItemsOptions $options = null, int|float|string|null $timeoutSecs = null): Generator`: lazily yields the items of the default dataset while the run is producing them, and returns when the run has finished and the dataset is drained. `$timeoutSecs` is the timeout of each request, polls included (default: the `long` tier). See [below](#reading-a-dataset-while-the-run-is-running). diff --git a/src/Resource/RunClient.php b/src/Resource/RunClient.php index 1e05404..098d5bf 100644 --- a/src/Resource/RunClient.php +++ b/src/Resource/RunClient.php @@ -156,7 +156,10 @@ public function resurrect(?RunResurrectOptions $options = null, int|float|string /** * Charges for events of a pay-per-event Actor run. * - * The request always carries an idempotency key, so a retried charge is applied once. + * Call it from the Actor run itself, with a client that uses the token the run received in its + * {@code APIFY_TOKEN} environment variable. The request always carries an idempotency key, so a retried + * charge is applied once. To charge a request to a multi-tenant Server Actor, set + * {@see RunChargeOptions::$requestId} to the request's {@code X-Actor-Request-ID} header value. */ public function charge(RunChargeOptions $options, int|float|string|null $timeoutSecs = null): void { diff --git a/src/Version.php b/src/Version.php index cbb9841..5644b6d 100644 --- a/src/Version.php +++ b/src/Version.php @@ -17,13 +17,13 @@ final class Version * The semantic version of this client library (see https://semver.org/). * Changes to the public interface other than additive ones are considered breaking changes. */ - public const CLIENT_VERSION = '0.14.0'; + public const CLIENT_VERSION = '0.14.1'; /** * The version of the Apify OpenAPI specification this client was generated and verified * against. Corresponds to the {@code info.version} field of the Apify OpenAPI document. */ - public const API_SPEC_VERSION = 'v2-2026-11-09T143926Z'; + public const API_SPEC_VERSION = 'v2-2026-11-10T140017Z'; private function __construct() {