feat: add FileSDK module for file storage operations#143
Open
NianJiuZst wants to merge 1 commit into
Open
Conversation
Add a new `file` property to MiniMaxSDK that exposes: - upload(filePath, purpose?) — upload a local file via multipart/form-data - list() — list all files in storage - delete(fileId) — delete a file by ID - retrieve(fileId) — get file metadata and optional download URL The module reuses existing endpoint definitions and API types from the shared client layer. FormData construction and file existence checks mirror the CLI's file upload command behavior. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
1e1c108 to
89b3d5c
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Closes #142
Adds a
fileproperty toMiniMaxSDKso SDK users can manage files in MiniMax storage without manually constructing HTTP requests.Motivation
Every CLI resource has a corresponding SDK module — except file storage:
mmx file uploadsdk.file.upload()mmx file listsdk.file.list()mmx file deletesdk.file.delete()sdk.file.retrieve()Usage
Implementation
FileSDKextendsClientand reuses existingfile*Endpoint()functions and API types from the shared client layerupload()mirrors the CLI's FormData construction and file existence validation/v1/files,/v1/files/list,/v1/files/delete,/v1/files/retrieve) are coveredFiles changed
src/sdk/file/index.tssrc/sdk/index.tsfilepropertytest/sdk/file.test.tsScreenshots