The best way to control Claude Code, Codex and more from any computer or phone
Mirrored from https://github.com/Camo67/t3code.git
Synced Nov 21, 06:00 UTC
| 1 | import * as S3 from "@distilled.cloud/aws/s3"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import * as Effect from "effect/Effect"; |
| 4 | import type { Bucket } from "./Bucket.ts"; |
| 5 | |
| 6 | export interface ListPartsRequest extends Omit<S3.ListPartsRequest, "Bucket"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `s3:ListParts` (`s3:ListMultipartUploadParts`). |
| 10 | * |
| 11 | * Bind this operation to a bucket to get a callable that lists the parts |
| 12 | * uploaded for an in-progress multipart upload — the bucket name is injected |
| 13 | * automatically and `s3:ListMultipartUploadParts` is granted on the bucket's |
| 14 | * objects. Provide the implementation with |
| 15 | * `Effect.provide(AWS.S3.ListPartsHttp)`. |
| 16 | * ### Multipart Uploads |
| 17 | * **Example:** List Uploaded Parts |
| 18 | * ```typescript |
| 19 | * const listParts = yield* AWS.S3.ListParts(bucket); |
| 20 | * |
| 21 | * const result = yield* listParts({ Key: "large.bin", UploadId: uploadId }); |
| 22 | * const parts = result.Parts ?? []; |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | */ |
| 27 | export interface ListParts extends Binding.Service< |
| 28 | ListParts, |
| 29 | "AWS.S3.ListParts", |
| 30 | ( |
| 31 | bucket: Bucket, |
| 32 | ) => Effect.Effect< |
| 33 | (request: ListPartsRequest) => Effect.Effect<S3.ListPartsOutput, S3.ListPartsError> |
| 34 | > |
| 35 | > {} |
| 36 | export const ListParts = Binding.Service<ListParts>("AWS.S3.ListParts"); |