@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 46 lines 1.37 KB
Raw
1 import type * as paymentcryptographydata from "@distilled.cloud/aws/payment-cryptography-data";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Key } from "./Key.ts";
5
6 export interface GenerateMacRequest extends Omit<
7 paymentcryptographydata.GenerateMacInput,
8 "KeyIdentifier"
9 > {}
10
11 /**
12 * Runtime binding for `payment-cryptography:GenerateMac` — computes a
13 * Message Authentication Code over hex-encoded message data under a
14 * {@link Key}. Provide `GenerateMacHttp` on the Function to satisfy this
15 * service.
16 * ### Generating MACs
17 * **Example:** Generate an HMAC over message data
18 * ```typescript
19 * // init
20 * const generateMac = yield* PaymentCryptography.GenerateMac(macKey);
21 *
22 * // runtime — MessageData is hex-encoded
23 * const result = yield* generateMac({
24 * MessageData: "31323334353637383930313233343536",
25 * GenerationAttributes: { Algorithm: "HMAC" },
26 * });
27 * ```
28 *
29 * @binding
30 */
31 export interface GenerateMac extends Binding.Service<
32 GenerateMac,
33 "AWS.PaymentCryptography.GenerateMac",
34 <K extends Key>(
35 key: K,
36 ) => Effect.Effect<
37 (
38 request: GenerateMacRequest,
39 ) => Effect.Effect<
40 paymentcryptographydata.GenerateMacOutput,
41 paymentcryptographydata.GenerateMacError
42 >
43 >
44 > {}
45
46 export const GenerateMac = Binding.Service<GenerateMac>("AWS.PaymentCryptography.GenerateMac");