@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 50 lines 1.55 KB
Raw
1 import type * as glacier from "@distilled.cloud/aws/glacier";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Vault } from "./Vault.ts";
5
6 /**
7 * `UploadArchive` request with `accountId` and `vaultName` injected from the bound
8 * {@link Vault}.
9 */
10 export interface UploadArchiveRequest extends Omit<
11 glacier.UploadArchiveInput,
12 "accountId" | "vaultName"
13 > {}
14
15 /**
16 * Runtime binding for the `UploadArchive` operation (IAM action
17 * `glacier:UploadArchive` on the vault ARN).
18 *
19 * Uploads an archive to the bound {@link Vault} in a single request (up to
20 * 4 GiB; use the multipart bindings for larger archives). The response
21 * carries the new `archiveId` — Glacier has no list-archives API outside of
22 * inventory jobs, so persist it.
23 * Provide the implementation with
24 * `Effect.provide(AWS.Glacier.UploadArchiveHttp)`.
25 * ### Uploading Archives
26 * **Example:** Upload a small archive
27 * ```typescript
28 * const uploadArchive = yield* AWS.Glacier.UploadArchive(vault);
29 *
30 * const { archiveId, checksum } = yield* uploadArchive({
31 * archiveDescription: "nightly backup",
32 * checksum: treeHash,
33 * body: payload,
34 * });
35 * ```
36 *
37 * @binding
38 */
39 export interface UploadArchive extends Binding.Service<
40 UploadArchive,
41 "AWS.Glacier.UploadArchive",
42 (
43 vault: Vault,
44 ) => Effect.Effect<
45 (
46 request?: UploadArchiveRequest,
47 ) => Effect.Effect<glacier.ArchiveCreationOutput, glacier.UploadArchiveError>
48 >
49 > {}
50 export const UploadArchive = Binding.Service<UploadArchive>("AWS.Glacier.UploadArchive");