Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
19 changes: 19 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,25 @@ All notable changes to the Apify Go client are documented in this file.
The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/),
and this project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

## [0.8.2] - 2026-08-15

### Changed

- Synced against Apify OpenAPI spec `v2-2026-08-14T072928Z`, which formally documents the
Task `isPublic`/`publicConfig` fields this client already implemented; updated the
`Task.IsPublic` doc comment and `docs/tasks.md` to no longer describe them as undocumented.
- Bumped `APISpecVersion` to `v2-2026-08-14T072928Z` and `ClientVersion` to `0.8.2`.
- Updated `README.md`'s documented `APISpecVersion` example, which was stale by two spec
versions.

### Fixed

- Corrected the `TaskClient.Unpublish` doc comment (and the matching integration-test
comment): the spec's `PUT /actor-tasks/{id}` description now states that both publishing
and unpublishing require write permission to the task's Actor, which this client's comment
had (incorrectly, per the previous release's changelog) claimed was not the case for
unpublishing.

## [0.8.1] - 2026-08-11

### Changed
Expand Down
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,7 +202,7 @@ func main() {

- `apify.ClientVersion` — the semantic version of this library.
- `apify.APISpecVersion` — the Apify OpenAPI spec version this client was built against
(`v2-2026-07-13T092445Z`).
(`v2-2026-08-14T072928Z`).

### Releasing

Expand Down
4 changes: 2 additions & 2 deletions docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ A task is a pre-configured Actor run with stored input. Access the task collecti
| `Title` | `string` | Human-readable title shown in the UI. |
| `CreatedAt` | `*time.Time` | When the task was created. |
| `ModifiedAt` | `*time.Time` | When the task was last modified. |
| `IsPublic` | `*bool` | Whether the task is published on its public landing page. Not part of the documented Task schema, but returned by the API in practice; use `Publish`/`Unpublish` to change it. |
| `IsPublic` | `*bool` | Whether the task is published on its public landing page, derived from `PublicConfig.PublishedAt`; use `Publish`/`Unpublish` to change it. |
| `PublicConfig` | `*TaskPublicConfig` | Public-facing display configuration of the landing page, set once the task has been configured for publishing. |
| `Extra` | `map[string]json.RawMessage` | Any other fields returned by the API. |

Expand Down Expand Up @@ -92,7 +92,7 @@ if ok {

`Publish`/`Unpublish` toggle the task's public landing page by updating `IsPublic`; both reuse
the same `PUT /actor-tasks/{id}` endpoint as `Update`. `IsPublic` is a `*bool` (nil-checked
before use below) since it is not part of the documented Task schema.
before use below) so a missing field can be distinguished from `false`.

```go
published, err := client.Task("my-task-id").Publish(ctx)
Expand Down
7 changes: 4 additions & 3 deletions models.go
Original file line number Diff line number Diff line change
Expand Up @@ -157,9 +157,10 @@ type Task struct {
CreatedAt *time.Time `json:"createdAt"`
// ModifiedAt is when the task was last modified.
ModifiedAt *time.Time `json:"modifiedAt"`
// IsPublic reports whether the task is published on its public landing page. It is not part
// of the documented Task schema in the OpenAPI spec, but the API returns it in practice
// (mirroring the reference JS client); use TaskClient.Publish/Unpublish to change it.
// IsPublic reports whether the task is published on its public landing page, derived from
// PublicConfig.PublishedAt; use TaskClient.Publish/Unpublish to change it. Kept as *bool
// (the OpenAPI schema declares a plain boolean) so a missing field can be distinguished
// from false.
IsPublic *bool `json:"isPublic,omitempty"`
// PublicConfig is the public-facing display configuration of the task's landing page, set
// when the task has been configured for publishing (nil otherwise).
Expand Down
5 changes: 2 additions & 3 deletions task.go
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,8 @@ func (c *TaskClient) Publish(ctx context.Context) (Task, error) {
// Update.
//
// The public display configuration (PublicConfig) is preserved, so the task can be published
// again without re-entering it. Unlike Publish, Unpublish only requires write permission to
// the task itself - it succeeds even if the task's Actor is unowned or private. Unpublishing
// a task that is not published does nothing.
// again without re-entering it. Like Publish, Unpublish requires write permission to both the
// task and its Actor. Unpublishing a task that is not published does nothing.
func (c *TaskClient) Unpublish(ctx context.Context) (Task, error) {
return c.Update(ctx, map[string]any{"isPublic": false})
}
Expand Down
11 changes: 7 additions & 4 deletions tests/task_test.go
Original file line number Diff line number Diff line change
Expand Up @@ -78,10 +78,13 @@ func TestTaskCRUDFlow(t *testing.T) {
// TestTaskPublishUnpublish exercises Publish/Unpublish against a task whose Actor
// (apify/hello-world) is not owned by the test account.
//
// Publish requires write permission to both the task and its Actor, so it is expected to fail
// (400 for the missing PublicConfig, or 403 for the unowned Actor - the server may reject on
// either ground first). Unpublish only requires write permission to the task itself, so it is
// expected to succeed even though the Actor is unowned, and leaves IsPublic not-true.
// Publish (like Unpublish) requires write permission to both the task and its Actor, so it is
// expected to fail (400 for the missing PublicConfig, or 403 for the unowned Actor - the server
// may reject on either ground first). Unpublish is expected to succeed here because the task is
// already unpublished (created with IsPublic unset/false) and the API treats setting isPublic to
// its current value as a no-op, not because Unpublish has a smaller permission requirement than
// Publish - it does not create/verify an actually-published state on an unowned Actor, which is
// not achievable via this API (publishing always requires Actor write permission).
func TestTaskPublishUnpublish(t *testing.T) {
client := requireClient(t)
ctx, cancel := testContext(t)
Expand Down
4 changes: 2 additions & 2 deletions version.go
Original file line number Diff line number Diff line change
Expand Up @@ -4,10 +4,10 @@ package apify
//
// It follows Semantic Versioning (https://semver.org/). Changes to the public
// interface (other than additive ones) are considered breaking changes.
const ClientVersion = "0.8.1"
const ClientVersion = "0.8.2"

// APISpecVersion is the version of the Apify OpenAPI specification that this
// client was generated and verified against.
//
// It corresponds to the `info.version` field of the Apify OpenAPI document.
const APISpecVersion = "v2-2026-08-05T133145Z"
const APISpecVersion = "v2-2026-08-14T072928Z"
Loading