@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 43 lines 1.36 KB
Raw
1 import type * as ag from "@distilled.cloud/aws/api-gateway";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 export interface CreateApiKeyRequest extends ag.CreateApiKeyRequest {}
6
7 /**
8 * Runtime binding for issuing API Gateway API keys
9 * (`apigateway:POST` on `/apikeys`). Account-scoped — takes no resource.
10 *
11 * The response's `value` is `Redacted<string>` (distilled marks it
12 * sensitive), so the plaintext key never leaks into logs. Provide
13 * `ApiGateway.CreateApiKeyHttp` on the Function effect to implement the
14 * binding.
15 *
16 * ### Issuing API keys
17 * **Example:** Issue a key for a new customer
18 * ```typescript
19 * import * as Redacted from "effect/Redacted";
20 *
21 * // init — account-level binding takes no resource
22 * const createApiKey = yield* ApiGateway.CreateApiKey();
23 *
24 * // runtime
25 * const key = yield* createApiKey({
26 * name: `customer-${customerId}`,
27 * enabled: true,
28 * });
29 * const plaintext = Redacted.isRedacted(key.value)
30 * ? Redacted.value(key.value)
31 * : key.value;
32 * ```
33 *
34 * @binding
35 */
36 export interface CreateApiKey extends Binding.Service<
37 CreateApiKey,
38 "AWS.ApiGateway.CreateApiKey",
39 () => Effect.Effect<
40 (request?: CreateApiKeyRequest) => Effect.Effect<ag.ApiKey, ag.CreateApiKeyError>
41 >
42 > {}
43 export const CreateApiKey = Binding.Service<CreateApiKey>("AWS.ApiGateway.CreateApiKey");