@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 50 lines 1.76 KB
Raw
1 import type * as appconfig from "@distilled.cloud/aws/appconfig";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4 import type { Application } from "./Application.ts";
5 import type { ConfigurationProfile } from "./ConfigurationProfile.ts";
6
7 export interface ValidateConfigurationRequest extends Omit<
8 appconfig.ValidateConfigurationRequest,
9 "ApplicationId" | "ConfigurationProfileId"
10 > {}
11
12 /**
13 * Validate a configuration version against a configuration profile's
14 * validators from a Lambda (or other AWS runtime). Pairs with
15 * {@link CreateHostedConfigurationVersion} + {@link StartDeployment}: write
16 * the new content, validate it, then roll it out. Fails with a typed
17 * `BadRequestException` when a validator rejects the content; succeeds with
18 * an empty response when validation passes (including when the profile has
19 * no validators).
20 *
21 * Provide `AppConfig.ValidateConfigurationHttp` on the hosting function's
22 * Effect to implement the binding.
23 *
24 * ### Writing Configuration at Runtime
25 * **Example:** Validate a version before deploying it
26 * ```typescript
27 * const validate = yield* AppConfig.ValidateConfiguration(app, profile);
28 * yield* validate({ ConfigurationVersion: "2" });
29 * ```
30 *
31 * @binding
32 */
33 export interface ValidateConfiguration extends Binding.Service<
34 ValidateConfiguration,
35 "AWS.AppConfig.ValidateConfiguration",
36 (
37 application: Application,
38 configurationProfile: ConfigurationProfile,
39 ) => Effect.Effect<
40 (
41 request: ValidateConfigurationRequest,
42 ) => Effect.Effect<
43 appconfig.ValidateConfigurationResponse,
44 appconfig.ValidateConfigurationError
45 >
46 >
47 > {}
48 export const ValidateConfiguration = Binding.Service<ValidateConfiguration>(
49 "AWS.AppConfig.ValidateConfiguration",
50 );