@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 44 lines 1.25 KB
Raw
1 import type * as S3 from "@distilled.cloud/aws/s3";
2 import * as Binding from "alchemy/Binding";
3 import type { RuntimeContext } from "alchemy/RuntimeContext";
4 import type * as Config from "effect/Config";
5 import type * as Effect from "effect/Effect";
6 import type { Bucket } from "./Bucket.ts";
7 import type { RailwayS3CredentialsMissing } from "./BucketBinding.ts";
8
9 export interface HeadObjectRequest extends Omit<S3.HeadObjectRequest, "Bucket"> {}
10
11 /**
12 * Runtime binding for Railway `HeadObject` over the S3 API.
13 *
14 * Bind this operation to a {@link Bucket} in Service init. Provide
15 * {@link HeadObjectHttp}.
16 *
17 *
18 * ### Inspecting Objects
19 * **Example:** Check an Object's Metadata
20 * ```typescript
21 * const headObject = yield* Railway.HeadObject(Data);
22 * const head = yield* headObject({ Key: "hello.txt" });
23 * ```
24 *
25 * @binding
26 * @product Bucket
27 */
28 export interface HeadObject extends Binding.Service<
29 HeadObject,
30 "Railway.HeadObject",
31 (
32 bucket: Bucket,
33 ) => Effect.Effect<
34 (
35 request?: HeadObjectRequest,
36 ) => Effect.Effect<
37 S3.HeadObjectOutput,
38 S3.HeadObjectError | Config.ConfigError | RailwayS3CredentialsMissing,
39 RuntimeContext
40 >
41 >
42 > {}
43
44 export const HeadObject = Binding.Service<HeadObject>("Railway.HeadObject");