diff --git a/CHANGELOG.md b/CHANGELOG.md index c6a9fd9..cb57138 100644 --- a/CHANGELOG.md +++ b/CHANGELOG.md @@ -1,5 +1,20 @@ # Changelog +## 0.6.2 + +- Bumped `Version::API_SPEC_VERSION` to the Apify OpenAPI spec `v2-2026-09-28T115051Z`. No public + interface changes. +- Updated the `TaskClient::publish()` doc comment and `docs/tasks.md` to reflect the new published-task + limits (up to 10 published tasks per Actor, 100 per account; previously documented as "fewer than + 50 per Actor"), matching the spec's corrected description. Behavior is unchanged: the client already + surfaces the API's rejection as-is when a task can't be published. +- The `idempotency-key` header on `RunClient::charge()` is now a required parameter in the spec (was + optional). No client change needed: this client already always sends an idempotency key, generating + one automatically when the caller doesn't supply one. +- Documented that the charge idempotency key expires 3 minutes after the charge (a later request + reusing it creates a new charge rather than deduplicating), per the spec's updated description. + `RunChargeOptions::$idempotencyKey` and `docs/options.md`. + ## 0.6.1 - Bumped `Version::API_SPEC_VERSION` to the Apify OpenAPI spec `v2-2026-09-10T091137Z`. This diff --git a/docs/options.md b/docs/options.md index 774b0b2..8e68807 100644 --- a/docs/options.md +++ b/docs/options.md @@ -152,7 +152,7 @@ For `run()->charge()` (pay-per-event Actors). `eventName` is **required**. |---|---|---| | `eventName` | `string` | Name of the event to charge for. | | `count` | `?int` | Number of times to charge the event (defaults to 1). | -| `idempotencyKey` | `?string` | Deduplicates the charge across retries; auto-generated if unset. | +| `idempotencyKey` | `?string` | Deduplicates the charge across retries; auto-generated if unset. Expires 3 minutes after the charge — reusing it later creates a new charge rather than deduplicating. | ## Builds diff --git a/docs/tasks.md b/docs/tasks.md index 61444a2..ccbbdcd 100644 --- a/docs/tasks.md +++ b/docs/tasks.md @@ -26,8 +26,10 @@ foreach ($client->tasks()->iterate(new ListOptions(), 50) as $t) { - `get(): ?Task`, `update(mixed $newFields): Task`, `delete(): void` - `publish(): Task`, `unpublish(): Task` — publish/unpublish the task's public landing page, by setting `isPublic` through `update()`. Both require write permission to the task's Actor; - publishing additionally requires the Actor to be public, to have fewer than 50 already-published - tasks, and the task's `publicConfig.inputSchemaFields`/`publicConfig.datasetView` to be set. + publishing additionally requires the Actor to be public and the task's + `publicConfig.inputSchemaFields`/`publicConfig.datasetView` to be set. An Actor can have up to 10 + published tasks and an account up to 100 (contact Apify support to raise these limits); if the + conditions aren't met, the request fails and nothing is changed. - `start(mixed $input = null, ?TaskStartOptions $options = null): ActorRun` - `call(mixed $input = null, ?TaskStartOptions $options = null, ?int $waitSecs = null): ActorRun` - `getInput(): mixed`, `updateInput(mixed $input): mixed` diff --git a/src/Options/RunChargeOptions.php b/src/Options/RunChargeOptions.php index 2bbf3fc..0f59d8f 100644 --- a/src/Options/RunChargeOptions.php +++ b/src/Options/RunChargeOptions.php @@ -15,6 +15,8 @@ public function __construct( /** * A key that deduplicates the charge across retries. If unset, one is auto-generated as * {@code "{runId}-{eventName}-{timestampMillis}-{random}"}, matching the reference client. + * The key expires 3 minutes after the charge; a later request reusing it creates a new + * charge instead of being deduplicated against the original. */ public readonly ?string $idempotencyKey = null, ) { diff --git a/src/Resource/TaskClient.php b/src/Resource/TaskClient.php index d04f814..f907fc0 100644 --- a/src/Resource/TaskClient.php +++ b/src/Resource/TaskClient.php @@ -61,10 +61,11 @@ public function delete(): void * Publishes the task on its public landing page, by setting {@code isPublic} through * {@see update()}. Requires write permission to the task's Actor. * - * To publish, the task's Actor must be public, its {@code publicConfig.inputSchemaFields} and - * {@code publicConfig.datasetView} must be set, and the Actor must have fewer than 50 - * published tasks; if any of these are not met, the request fails and nothing is changed. - * Publishing an already published task does nothing. + * To publish, the task's Actor must be public and its {@code publicConfig.inputSchemaFields} + * and {@code publicConfig.datasetView} must be set. An Actor can have up to 10 published + * tasks and an account up to 100; contact Apify support to raise these limits. If any of + * these conditions are not met, the request fails and nothing is changed (including fields + * unrelated to publishing). Publishing an already published task does nothing. */ public function publish(): Task { diff --git a/src/Version.php b/src/Version.php index 1018efa..ec92dc5 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.6.1'; + public const CLIENT_VERSION = '0.6.2'; /** * 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-09-10T091137Z'; + public const API_SPEC_VERSION = 'v2-2026-09-28T115051Z'; private function __construct() {