Skip to content
Closed
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
16 changes: 16 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,22 @@ All notable changes to the Apify Java 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.6.1] - 2026-08-15

### Fixed

- `TaskClient.unpublish()`'s doc comment incorrectly claimed it needs write permission to the task
only, not its Actor. The spec states both `publish()` and `unpublish()` require write permission
to the task's Actor; corrected the comment (and the matching integration-test comment) to say so.

### Changed

- Bumped `Version.API_SPEC_VERSION` to `v2-2026-08-14T072928Z`. The new spec version documents the
previously-undocumented `Task.isPublic` / `Task.publicConfig` fields and adds the
`TaskPublicConfig` schema - already implemented here - so this is a metadata/doc-accuracy sync,
not a code change. Updated `Task.getIsPublic()` / `TaskPublicConfig`'s doc comments accordingly:
they no longer describe these as undocumented.

## [0.6.0] - 2026-08-11

### Added
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ Maven (Maven Central is a default repository, so no extra configuration is neede
<dependency>
<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.5.0</version>
<version>0.6.1</version>
</dependency>
```

Expand All @@ -35,7 +35,7 @@ repositories {
}

dependencies {
implementation 'com.apify:apify-client:0.5.0'
implementation 'com.apify:apify-client:0.6.1'
}
```

Expand Down Expand Up @@ -293,10 +293,10 @@ try {
The public `com.apify.client.Version` class (`import com.apify.client.Version;`) exposes two
constants:

- `Version.CLIENT_VERSION` — the semantic version of this client (`0.5.0`).
- `Version.CLIENT_VERSION` — the semantic version of this client (`0.6.1`).
- `Version.API_SPEC_VERSION` — the version of the [Apify OpenAPI specification](https://docs.apify.com/api/openapi.json)
(its `info.version` field) that this client's endpoints, parameters and models were last generated
and checked against (`v2-2026-07-22T122437Z`). It is a snapshot, not a live compatibility
and checked against (`v2-2026-08-14T072928Z`). It is a snapshot, not a live compatibility
guarantee: the client keeps working against newer, backward-compatible spec revisions, but a
feature added to the API after this snapshot has no corresponding method here yet.

Expand Down
2 changes: 1 addition & 1 deletion docs/tasks.md
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ Task task = client.tasks().create(Map.of(
| Method | Description |
|---|---|
| `get()` / `update(Object)` / `delete()` | CRUD. Complete with `Optional<Task>` / `Task` / no value. |
| `publish()` / `unpublish()` | Publish/unpublish the task on its public landing page, by setting `isPublic` through `update(Object)`. `publish()` requires the task's Actor to be public, write permission to both the task and its Actor, and a configured `publicConfig`. `unpublish()` only requires write permission to the task; it preserves `publicConfig` so the task can be republished without re-entering it. Complete with the updated `Task`. |
| `publish()` / `unpublish()` | Publish/unpublish the task on its public landing page, by setting `isPublic` through `update(Object)`. Both require write permission to both the task and its Actor; `publish()` additionally requires the task's Actor to be public and a configured `publicConfig`. `unpublish()` preserves `publicConfig` so the task can be republished without re-entering it. Complete with the updated `Task`. |
| `start(Object input, TaskStartOptions)` | Start a task run (input overrides stored input; `null` uses it). Completes with `ActorRun`. |
| `call(Object input, TaskStartOptions, Long waitSecs)` | Start and poll until finished; does **not** stream the run's log. Completes with `ActorRun`. |
| `call(Object input, TaskCallOptions, Long waitSecs)` | As above, additionally streaming the run's log for the duration of the wait by default (matching the reference client's `call` defaulting `options.log` to `'default'`). Use `TaskCallOptions.disableLogStreaming()` to opt out, or `logOptions(StreamedLogOptions)` for a custom destination. |
Expand Down
2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@

<groupId>com.apify</groupId>
<artifactId>apify-client</artifactId>
<version>0.6.0</version>
<version>0.6.1</version>
<packaging>jar</packaging>

<name>Apify Java Client</name>
Expand Down
4 changes: 2 additions & 2 deletions src/main/java/com/apify/client/Version.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,13 +13,13 @@ public final class Version {
* The semantic version of this client library (see <a href="https://semver.org/">SemVer</a>).
* Changes to the public interface other than additive ones are considered breaking changes.
*/
public static final String CLIENT_VERSION = "0.6.0";
public static final String CLIENT_VERSION = "0.6.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 static final String API_SPEC_VERSION = "v2-2026-08-05T133145Z";
public static final String API_SPEC_VERSION = "v2-2026-08-14T072928Z";

private Version() {}
}
7 changes: 4 additions & 3 deletions src/main/java/com/apify/client/task/Task.java
Original file line number Diff line number Diff line change
Expand Up @@ -87,9 +87,10 @@ public ActorStandby getActorStandby() {
}

/**
* Whether the task is published on its public landing page. Not part of the documented {@code
* Task} schema in the OpenAPI spec, but the API returns it in practice (mirroring the reference
* JS client). Use {@link TaskClient#publish()} / {@link TaskClient#unpublish()} to change it.
* Whether the task is published on its public landing page, derived from {@link
* TaskPublicConfig#getPublishedAt() publicConfig.publishedAt}. A boxed {@code Boolean} (rather
* than a primitive) to distinguish a field the response did not include from an explicit {@code
* false}. Use {@link TaskClient#publish()} / {@link TaskClient#unpublish()} to change it.
*/
public Boolean getIsPublic() {
return isPublic;
Expand Down
5 changes: 2 additions & 3 deletions src/main/java/com/apify/client/task/TaskClient.java
Original file line number Diff line number Diff line change
Expand Up @@ -66,9 +66,8 @@ public CompletableFuture<Task> publish() {
* #update(Object)}.
*
* <p>The public display configuration ({@code publicConfig}) is preserved, so the task can be
* published again without re-entering it. Requires write permission to the task only (unlike
* {@link #publish()}, it does not require permission to the task's Actor). Unpublishing a task
* that is not published does nothing.
* published again without re-entering it. Like {@link #publish()}, requires write permission to
* both the task and its Actor. Unpublishing a task that is not published does nothing.
*/
public CompletableFuture<Task> unpublish() {
return update(Map.of("isPublic", false));
Expand Down
10 changes: 7 additions & 3 deletions src/main/java/com/apify/client/task/TaskPublicConfig.java
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,9 @@
* null}. {@code publishedAt} is read-only - use {@link TaskClient#publish()} and {@link
* TaskClient#unpublish()} to change the publication state.
*
* <p>Not part of the documented {@code Task} schema in the OpenAPI spec, but the API returns it in
* practice (mirroring the reference JS client's {@code TaskPublicConfig}).
* <p>{@link #getCategorization()} is not part of the documented {@code TaskPublicConfig} schema in
* the OpenAPI spec, but is kept here for parity with the reference JS client, which also exposes
* it. Every other field below is part of the documented schema.
*/
public final class TaskPublicConfig extends ApifyResource {
private Instant publishedAt;
Expand All @@ -39,7 +40,10 @@ public String getSeoDescription() {
return seoDescription;
}

/** The category the task is listed under on its public landing page. */
/**
* The category the task is listed under on its public landing page. Not part of the documented
* schema; see the class-level note.
*/
public String getCategorization() {
return categorization;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -104,9 +104,11 @@ void taskPublishUnpublish() {
try {
TaskClient tc = client.task(task.getId());

// unpublish() only requires write permission to the task itself, not its Actor, so it
// succeeds here even though the task's Actor (apify/hello-world) is unowned by this test
// account. Reuses the update() PUT and leaves isPublic not-true.
// The freshly created task is already unpublished, so this unpublish() call is a no-op per
// the spec ("sending the value the task already has does nothing") - it succeeds even
// though the task's Actor (apify/hello-world) is unowned by this test account, without that
// being evidence that unpublish() needs less permission than publish(): both require write
// permission to the task's Actor. Reuses the update() PUT and leaves isPublic not-true.
Task unpublished = tc.unpublish().join();
assertFalse(Boolean.TRUE.equals(unpublished.getIsPublic()));

Expand Down
Loading