-
Notifications
You must be signed in to change notification settings - Fork 5
feat: docs for sdk multipart #279
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Greptile Overview
Summary
This PR adds comprehensive documentation for SDK multipart upload functionality across three key files:
- New multipart upload examples: Added complete server and client code examples showing the three-step multipart upload flow (init, get parts, complete)
- Enhanced upload response documentation: Added details about the data properties returned on successful uploads (contentDisposition, contentType, modified, path, size, url)
- API consistency improvements: Updated parameter names from
methodtooperationin presigned URL examples for better consistency - Client-side configuration options: Documented new
multipart: trueandpartSizeoptions for the upload function
The changes provide developers with clear guidance on implementing large file uploads using Tigris multipart functionality, reducing bandwidth costs by enabling direct client-to-Tigris uploads.
Confidence Score: 4/5
- This PR is generally safe to merge with one minor bug fix needed
- Score reflects good documentation quality and consistency improvements, but reduced due to the error handling bug in examples.mdx that references undefined variable
- docs/sdks/tigris/examples.mdx requires attention for the error handling bug fix
Important Files Changed
File Analysis
| Filename | Score | Overview |
|---|---|---|
| docs/sdks/tigris/client-uploads.mdx | 4/5 | Added documentation for successful upload response properties and multipart parameter in example |
| docs/sdks/tigris/examples.mdx | 3/5 | Added comprehensive multipart upload examples but has error handling bug referencing wrong variable |
| docs/sdks/tigris/using-sdk.mdx | 5/5 | Updated parameter name from 'method' to 'operation' for presigned URLs for consistency |
Sequence Diagram
sequenceDiagram
participant Client as Client Browser
participant Server as Next.js Server
participant Tigris as Tigris Storage
Client->>Server: POST /api/upload (action: MultipartInit, path)
Server->>Tigris: initMultipartUpload(path)
Tigris-->>Server: uploadId
Server-->>Client: { data: { uploadId } }
Client->>Server: POST /api/upload (action: MultipartGetParts, uploadId, parts)
Server->>Tigris: getPartsPresignedUrls(path, parts, uploadId)
Tigris-->>Server: presigned URLs for parts
Server-->>Client: { data: presignedUrls }
loop For each part
Client->>Tigris: PUT to presigned URL (file chunk)
Tigris-->>Client: ETag for part
end
Client->>Server: POST /api/upload (action: MultipartComplete, uploadId, partIds)
Server->>Tigris: completeMultipartUpload(path, uploadId, partIds)
Tigris-->>Server: final object metadata
Server-->>Client: { data: { url, path, size, ... } }
3 files reviewed, 1 comment
| const result = await getPresignedUrl(path, { | ||
| method, | ||
| contentType, | ||
| operation: "put", |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this supposed to be PUT?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
not, it's lower-case put
Co-authored-by: greptile-apps[bot] <165735046+greptile-apps[bot]@users.noreply.github.com>
No description provided.