Skip to content

feat: port contentEncoding, streamed dataset export and raw-bytes log read from apify-client-js - #23

Merged
Pijukatel merged 3 commits into
masterfrom
claude/sharp-clarke-u46frr
Oct 20, 2026
Merged

Pijukatel merged 3 commits into
masterfrom
claude/sharp-clarke-u46frr

Conversation

@Pijukatel

@Pijukatel Pijukatel commented Oct 19, 2026 •

Copy link
Copy Markdown
Collaborator

Summary

Ports the Java-relevant changes from the latest apify-client-js batch (apify/apify-client-js#1140, #1141, #1139, #1152, #1145). No OpenAPI spec change: API_SPEC_VERSION stays v2-2026-10-08T073338Z.

  • SetRecordOptions.contentEncoding(String) uploads a key-value store record that is already compressed. The client sends it as Content-Encoding and doesn't compress it again. The value is trimmed and must not be blank (apify-client-js#1140).
  • DatasetClient.streamItems(DownloadItemsFormat, DatasetDownloadOptions) streams a dataset export as an InputStream (apify-client-js#1152, which supersedes #1139). It's a separate method rather than a stream option on downloadItems, because a Java method can't change its return type based on a runtime flag. This matches the existing LogClient.get()/stream() split.
  • LogClient.getAsBytes() / getAsBytes(LogOptions) read a log as raw bytes (apify-client-js#1141).
  • LogClient.stream and DatasetClient.streamItems share a new HttpClientCore.streamOrThrow helper for error handling. downloadItems and streamItems share a private itemsUrl helper.

apify-client-js#1145 (a common ApifyClientError base class) needed no change: ApifyClientException already fills that role, and ExceptionHierarchyTest covers it.

…om JS client

Ports the net effect of apify-client-js#1140, #1145, #1139/#1152 (superseded),
and #1141 to this client (no OpenAPI spec change this loop):

- SetRecordOptions.contentEncoding(String): upload a pre-compressed key-value
  store record without the client compressing it again.
- DatasetClient.streamItems(...): stream a dataset export as an InputStream
  instead of buffering it fully (named streamItems, not a downloadItems
  option, since Java cannot switch a method's return type on a runtime flag -
  mirrors this codebase's existing LogClient.get()/stream() split).
- LogClient.getAsBytes()/getAsBytes(LogOptions): read a log as raw bytes
  (named after Python's get_as_bytes(), for the same reason as above).
- The common ApifyClientError base class (#1145) was already implemented
  here pre-existing (ApifyClientException); verified, no change needed.

Bumps CLIENT_VERSION to 0.9.0 (API_SPEC_VERSION unchanged).

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
Addresses review feedback on the previous commit:

- SetRecordOptions.contentEncoding is now trimmed before validating and
  forwarding, matching the reference client's z.string().trim().min(1)
  schema (previously " gzip " would have been sent as a malformed header
  value instead of "gzip").
- Extracted HttpClientCore.streamOrThrow(url), replacing the duplicated
  drain+buildApiError+throw logic in LogClient.stream and
  DatasetClient.streamItems with one shared implementation.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
downloadItems and streamItems duplicated the same four-line export-URL
construction (format query param + options + mergedParams/applyToUrl),
differing only in the terminal buffered-vs-streamed call. Extract a
private itemsUrl(format, options) helper used by both.

Addresses review item: DRY (coding rule #4) from notes.md iteration 3.

Co-Authored-By: Claude Sonnet 5 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_01G3FfQf9r45KVCa5VAYAjkd
@Pijukatel Pijukatel added adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. labels Oct 19, 2026 — with Claude
@apify-service-account apify-service-account added the tested Temporary label used only programatically for some analytics. label Oct 19, 2026
@Pijukatel
Pijukatel merged commit d7c7bf6 into master Oct 20, 2026
3 of 7 checks passed
@Pijukatel
Pijukatel deleted the claude/sharp-clarke-u46frr branch October 20, 2026 06:57
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

adhoc Ad-hoc unplanned task added during the sprint. t-tooling Issues with this label are in the ownership of the tooling team. tested Temporary label used only programatically for some analytics.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants