@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 48 lines 1.42 KB
Raw
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 AbortMultipartUploadRequest extends Omit<
7 S3.AbortMultipartUploadRequest,
8 "Bucket"
9 > {}
10
11 /**
12 * Runtime binding for `s3:AbortMultipartUpload`.
13 *
14 * Discards an in-progress multipart upload and frees the storage its parts
15 * consume — abandoned uploads keep billing until aborted (or expired by a
16 * lifecycle rule). Provide the implementation with
17 * `Effect.provide(AWS.S3.AbortMultipartUploadHttp)`.
18 * ### Multipart Uploads
19 * **Example:** Abort an Upload When Part Uploads Fail
20 * ```typescript
21 * // init — bind the operation to the bucket
22 * const abortUpload = yield* AWS.S3.AbortMultipartUpload(bucket);
23 *
24 * // runtime — clean up if the part-upload pipeline fails
25 * yield* uploadAllParts.pipe(
26 * Effect.tapError(() =>
27 * abortUpload({ Key: "backups/archive.tar", UploadId }),
28 * ),
29 * );
30 * ```
31 *
32 * @binding
33 */
34 export interface AbortMultipartUpload extends Binding.Service<
35 AbortMultipartUpload,
36 "AWS.S3.AbortMultipartUpload",
37 (
38 bucket: Bucket,
39 ) => Effect.Effect<
40 (
41 request: AbortMultipartUploadRequest,
42 ) => Effect.Effect<S3.AbortMultipartUploadOutput, S3.AbortMultipartUploadError>
43 >
44 > {}
45
46 export const AbortMultipartUpload = Binding.Service<AbortMultipartUpload>(
47 "AWS.S3.AbortMultipartUpload",
48 );