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, 04:45 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 UploadPartCopyRequest extends Omit<S3.UploadPartCopyRequest, "Bucket"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `s3:UploadPartCopy`. |
| 10 | * |
| 11 | * Bind this operation to a bucket to get a callable that uploads a multipart |
| 12 | * part by copying from an existing object — the destination bucket name is |
| 13 | * injected automatically and `s3:PutObject`, `s3:GetObject`, and |
| 14 | * `s3:GetObjectVersion` are granted on the bucket's objects. Select a source |
| 15 | * version by appending `?versionId=<encoded version ID>` to the URL-encoded |
| 16 | * `CopySource` bucket/key. Copying from a *different* source bucket additionally |
| 17 | * requires read access to that bucket (bind `GetObject` on it). Provide the |
| 18 | * implementation with `Effect.provide(AWS.S3.UploadPartCopyHttp)`. |
| 19 | * ### Multipart Uploads |
| 20 | * **Example:** Copy an Existing Object as a Part |
| 21 | * ```typescript |
| 22 | * const uploadPartCopy = yield* AWS.S3.UploadPartCopy(bucket); |
| 23 | * |
| 24 | * const part = yield* uploadPartCopy({ |
| 25 | * Key: "combined.bin", |
| 26 | * UploadId: uploadId, |
| 27 | * PartNumber: 1, |
| 28 | * CopySource: `${bucketName}/source.bin`, |
| 29 | * }); |
| 30 | * ``` |
| 31 | * |
| 32 | * @binding |
| 33 | */ |
| 34 | export interface UploadPartCopy extends Binding.Service< |
| 35 | UploadPartCopy, |
| 36 | "AWS.S3.UploadPartCopy", |
| 37 | ( |
| 38 | bucket: Bucket, |
| 39 | ) => Effect.Effect< |
| 40 | ( |
| 41 | request: UploadPartCopyRequest, |
| 42 | ) => Effect.Effect<S3.UploadPartCopyOutput, S3.UploadPartCopyError> |
| 43 | > |
| 44 | > {} |
| 45 | export const UploadPartCopy = Binding.Service<UploadPartCopy>("AWS.S3.UploadPartCopy"); |