Skip to content

v2.1.0 - Streaming upload + task.type populated

Latest

Choose a tag to compare

@drdmitry drdmitry released this 20 May 20:05

✨ Highlights

πŸš€ Streaming upload

FilesAPI.upload() now streams a chunked multipart/form-data body instead of buffering the entire payload in memory. No more OOM cliff at ~200 MB. Safe for arbitrarily large files.

πŸ› Fixed: task.type is no longer empty

client.getTask(id) previously hardcoded task.type = "". With api 1.38.5+, the SDK reads the new type field from /v1/tasks/{id} and populates the Task instance correctly. Older API deployments still fall back to "" gracefully.

πŸ”§ New public API

  • HttpClient.postStream(path, body, contentType, extraHeaders?) β€” streaming POST. Skips retry (consumed streams can't be replayed).
  • New named exports: buildMultipartStream, sanitizeFilename.
  • TaskStatusResponse.type?: string typed for the new API response shape.

⚠️ Behaviour change

Uploads previously could be retried up to 3 times on transient network failures because the body was a fully-buffered FormData. Streamed uploads cannot be replayed, so a failed upload now surfaces the error immediately. All other operations retain the existing retry behaviour (3 retries, exponential backoff on 408/500/502/503/504).

πŸ§ͺ Tests

90 tests passing (12 new streaming tests covering binary byte preservation, chunk boundaries, large-input streaming, source-stream error propagation, sanitized filename, multipart envelope structure).

πŸ”’ Security

  • 0 npm audit vulnerabilities (vite 7.3.1 β†’ 7.3.2, postcss 8.5.6 β†’ 8.5.15, brace-expansion transitive bump).

πŸ“¦ Install

npm install conversiontools@2.1.0

Full Changelog: v2.0.4...v2.1.0