@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, 04:45 UTC

main
ts 44 lines 1.33 KB
Raw
1 import type * as cloudfront from "@distilled.cloud/aws/cloudfront";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Distribution } from "./Distribution.ts";
5
6 export interface CreateInvalidationRequest extends Omit<
7 cloudfront.CreateInvalidationRequest,
8 "DistributionId"
9 > {}
10
11 /**
12 * Grants a Function permission to create CloudFront cache invalidations for a
13 * distribution at runtime — the classic post-publish/CMS purge pattern.
14 * ### Invalidating from a Function
15 * **Example:** Purge Paths After a Content Update
16 * ```typescript
17 * const invalidate = yield* CloudFront.CreateInvalidation(distribution);
18 *
19 * const response = yield* invalidate({
20 * InvalidationBatch: {
21 * CallerReference: crypto.randomUUID(),
22 * Paths: { Quantity: 1, Items: ["/blog/*"] },
23 * },
24 * });
25 * // response.Invalidation?.Id
26 * ```
27 *
28 * @binding
29 */
30 export interface CreateInvalidation extends Binding.Service<
31 CreateInvalidation,
32 "AWS.CloudFront.CreateInvalidation",
33 (
34 distribution: Distribution,
35 ) => Effect.Effect<
36 (
37 request: CreateInvalidationRequest,
38 ) => Effect.Effect<cloudfront.CreateInvalidationResult, cloudfront.CreateInvalidationError>
39 >
40 > {}
41
42 export const CreateInvalidation = Binding.Service<CreateInvalidation>(
43 "AWS.CloudFront.CreateInvalidation",
44 );