Skip to content

feat(extract): add client.extractFile for document and image uploads (3.6.0) - #144

Merged
lenzhq merged 2 commits into
mainfrom
feat/extract-file
Nov 1, 2026
Merged

lenzhq merged 2 commits into
mainfrom
feat/extract-file

Conversation

@lenzhq

@lenzhq lenzhq commented Nov 1, 2026

Copy link
Copy Markdown
Owner

Summary

Adds client.extractFile(file, options) to the Node SDK for POST /api/v1/extract/file (lenzhq/Lenz#1585), keeping the SDK version at 3.6.0 (3.5.0 is the latest published version on npm).

  • client.extractFile(file, options) accepts Blob | ArrayBuffer | Uint8Array for .docx, .pdf, .png, .jpg, .jpeg, and .webp files (up to 10 MB).
  • Supports filename, language (defaults to "auto", the document's own language), focus (up to 300 characters), locate (returns passage text in positions[i].text with start/end: null), idempotency / idempotencyKey, and per-call request options (timeoutMs, maxRetries, signal, headers).
  • Shares the 150s default timeout floor (EXTRACT_TIMEOUT_MS) with extract(), and preserves /extract/file review-family error codes in src/compat.ts.
  • Exports ExtractFileOptions from both src/index.ts and src/index.browser.ts.
  • Refreshes openapi.json with /api/v1/extract/file and updates README.md and CHANGELOG.md ([3.6.0]).

Reviews

  • Astra review (codex review --base origin/main): Reviewed e97be28; flagged openapi.json emitted without API_CANONICAL_ACCOUNTS_FROM (fixed in 69b6821).
  • Opus review (claude -p --model opus): Reviewed e97be28; flagged isReviewFamily missing /extract/file in src/compat.ts, client-side 20 MB cap in resolveUpload, language docstring default, and test assertions (all fixed in 69b6821).

Post-deploy actions and prod testing

  1. Deploy lenzhq/Lenz#1585 first so POST /api/v1/extract/file is live in production.
  2. Merge this PR (version stays 3.6.0 until ready to tag v3.6.0 for npm publish).
  3. Smoke-test await client.extractFile(pdfBytes, { filename: "sample.pdf", locate: true }) against https://lenz.io.

@lenzhq
lenzhq merged commit e9d7599 into main Nov 1, 2026
12 checks passed
@lenzhq
lenzhq deleted the feat/extract-file branch November 1, 2026 07:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant