fix: preserve int64 file IDs - #228
Conversation
NianJiuZst
left a comment
There was a problem hiding this comment.
I do not recommend merging this revision until the File Delete wire contract is resolved.
[P2] Align the payload with the documented File Delete contract before changing the SDK type. The current official schema declares file_id as integer<int64> and purpose as required, while this sends only a decimal string; the PR also changes FileDeleteResponse.file_id to string. The examples and schema are inconsistent enough that self-authored mocks cannot prove compatibility. Please either send the documented shape (including purpose) or add provider-backed evidence for string IDs and document the supported purpose behavior before merging.
Official contract: https://platform.minimax.io/docs/api-reference/file-management-delete
Local verification: typecheck, lint (one pre-existing warning), build, 11 focused tests, and the full suite (453/453) passed. The tests currently assert the implementation's own request/response shape rather than the documented provider schema.
What changed
Why
JavaScript Number cannot precisely represent the complete int64 range documented by the file deletion API.
Impact
Large file IDs are sent without precision loss, while existing safe numeric callers remain supported.
Checks
bun test— 453 passedbun run typecheckbun run lint— no errors; one pre-existing test warninggit diff --checkNeed help on this PR? Tag
@codesmith-botwith what you need. Autofix is disabled.