@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 49 lines 1.67 KB
Raw
1 import type * as WAFV2 from "@distilled.cloud/aws/wafv2";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { WebACL } from "./WebACL.ts";
5
6 export interface GetRateBasedStatementManagedKeysRequest extends Omit<
7 WAFV2.GetRateBasedStatementManagedKeysRequest,
8 "Scope" | "WebACLName" | "WebACLId"
9 > {}
10
11 /**
12 * Runtime binding for `wafv2:GetRateBasedStatementManagedKeys` — read the
13 * IP addresses that a rate-based rule of the bound {@link WebACL} is
14 * currently blocking; the web ACL name, id, and scope are injected
15 * automatically.
16 *
17 * Provide `WAFv2.GetRateBasedStatementManagedKeysHttp` on the hosting
18 * Lambda Function to satisfy the requirement.
19 * ### Inspecting Traffic
20 * **Example:** Read the Currently Rate-Limited Addresses
21 * ```typescript
22 * // init — grants wafv2:GetRateBasedStatementManagedKeys on the web ACL
23 * const getManagedKeys = yield* AWS.WAFv2.GetRateBasedStatementManagedKeys(acl);
24 *
25 * // runtime
26 * const { ManagedKeysIPV4 } = yield* getManagedKeys({ RuleName: "rate-limit" });
27 * const blocked = ManagedKeysIPV4?.Addresses ?? [];
28 * ```
29 *
30 * @binding
31 */
32 export interface GetRateBasedStatementManagedKeys extends Binding.Service<
33 GetRateBasedStatementManagedKeys,
34 "AWS.WAFv2.GetRateBasedStatementManagedKeys",
35 (
36 webAcl: WebACL,
37 ) => Effect.Effect<
38 (
39 request: GetRateBasedStatementManagedKeysRequest,
40 ) => Effect.Effect<
41 WAFV2.GetRateBasedStatementManagedKeysResponse,
42 WAFV2.GetRateBasedStatementManagedKeysError
43 >
44 >
45 > {}
46
47 export const GetRateBasedStatementManagedKeys = Binding.Service<GetRateBasedStatementManagedKeys>(
48 "AWS.WAFv2.GetRateBasedStatementManagedKeys",
49 );