Skip to content

feat(types): expose conversionMode on DocumentType#22

Merged
rarce merged 2 commits into
mainfrom
feat/issue-21-document-type-conversion-mode
May 7, 2026
Merged

feat(types): expose conversionMode on DocumentType#22
rarce merged 2 commits into
mainfrom
feat/issue-21-document-type-conversion-mode

Conversation

@rarce
Copy link
Copy Markdown
Contributor

@rarce rarce commented May 7, 2026

Summary

Adds the conversionMode field to the DocumentType response type so consumers no longer need to cast results to read it. The API already returns the field and DocumentTypeCreateParams / DocumentTypeUpdateParams already accept it — this fixes the input/output asymmetry called out in #21.

Changes

  • Extract a shared ConversionMode = 'json' | 'toon' | 'multi_prompt' type and reuse it across DocumentType, DocumentTypeCreateParams, and DocumentTypeUpdateParams.
  • Re-export ConversionMode from the public entrypoints (src/types/index.ts, src/index.ts).
  • Update mock fixtures to include conversionMode.

Tests

  • Added a regression test in tests/resources/document-types.test.ts verifying conversionMode is exposed on the typed result without a cast.
  • npm run typecheck, npm run lint, npm test (195 passed), npm run build all pass.

Linked Issue

Closes #21

🤖 Generated with Claude Code

rarce and others added 2 commits May 7, 2026 14:44
The API returns conversionMode on document types and the create/update
params already accept it, but the response type omitted it — forcing
consumers (e.g. docutray-cli) to cast the result to read the field.

Add conversionMode to DocumentType, extract a shared ConversionMode
type, and re-export it from the public surface.

Closes #21

Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
@rarce rarce merged commit 527f7c6 into main May 7, 2026
6 checks passed
@rarce rarce deleted the feat/issue-21-document-type-conversion-mode branch May 7, 2026 18:59
@rarce rarce mentioned this pull request May 7, 2026
rarce added a commit that referenced this pull request May 7, 2026
Adds conversionMode to DocumentType and exports the ConversionMode union (#21, #22).

Co-authored-by: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
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.

feat(types): expose conversionMode on DocumentType

1 participant