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 GetObjectAttributesRequest extends Omit<S3.GetObjectAttributesRequest, "Bucket"> {} |
| 7 | |
| 8 | /** |
| 9 | * Runtime binding for `s3:GetObjectAttributes`. |
| 10 | * |
| 11 | * Bind this operation to a bucket to get a callable that reads object |
| 12 | * metadata (size, ETag, checksum, storage class, object parts) without |
| 13 | * fetching the body — the bucket name is injected automatically and the |
| 14 | * object-read attribute actions are granted on the bucket's objects. Provide |
| 15 | * the implementation with `Effect.provide(AWS.S3.GetObjectAttributesHttp)`. |
| 16 | * ### Reading Objects |
| 17 | * **Example:** Read Object Size and ETag |
| 18 | * ```typescript |
| 19 | * const getObjectAttributes = yield* AWS.S3.GetObjectAttributes(bucket); |
| 20 | * |
| 21 | * const attrs = yield* getObjectAttributes({ |
| 22 | * Key: "reports/q3.csv", |
| 23 | * ObjectAttributes: ["ObjectSize", "ETag", "StorageClass"], |
| 24 | * }); |
| 25 | * ``` |
| 26 | * |
| 27 | * @binding |
| 28 | */ |
| 29 | export interface GetObjectAttributes extends Binding.Service< |
| 30 | GetObjectAttributes, |
| 31 | "AWS.S3.GetObjectAttributes", |
| 32 | ( |
| 33 | bucket: Bucket, |
| 34 | ) => Effect.Effect< |
| 35 | ( |
| 36 | request: GetObjectAttributesRequest, |
| 37 | ) => Effect.Effect<S3.GetObjectAttributesOutput, S3.GetObjectAttributesError> |
| 38 | > |
| 39 | > {} |
| 40 | export const GetObjectAttributes = Binding.Service<GetObjectAttributes>( |
| 41 | "AWS.S3.GetObjectAttributes", |
| 42 | ); |