Skip to content

Commit

Permalink
Add more fields to MultipartUploadDetails for CLI to use
Browse files Browse the repository at this point in the history
  • Loading branch information
Winston-Hsiao committed Nov 20, 2024
1 parent 019e383 commit c5fb466
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 1 deletion.
4 changes: 4 additions & 0 deletions frontend/src/gen/api.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1752,6 +1752,10 @@ export interface components {
bucket: string;
/** Key */
key: string;
/** Part Size */
part_size: number;
/** Num Parts */
num_parts: number;
};
/** MyUserInfoResponse */
MyUserInfoResponse: {
Expand Down
11 changes: 10 additions & 1 deletion store/app/crud/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -66,6 +66,8 @@ class MultipartUploadDetails(TypedDict):
presigned_urls: list[dict[str, str | int]]
bucket: str
key: str
part_size: int
num_parts: int


class BaseCrud(AsyncContextManager["BaseCrud"]):
Expand Down Expand Up @@ -664,4 +666,11 @@ async def _initiate_multipart_upload(
bucket, upload_id = await self._create_multipart_upload(key, content_type, metadata)
presigned_urls = await self._generate_presigned_urls(key, upload_id, num_parts, expires_in)

return MultipartUploadDetails(upload_id=upload_id, presigned_urls=presigned_urls, bucket=bucket, key=key)
return MultipartUploadDetails(
upload_id=upload_id,
presigned_urls=presigned_urls,
bucket=bucket,
key=key,
part_size=part_size,
num_parts=num_parts,
)

0 comments on commit c5fb466

Please sign in to comment.