The best way to control Claude Code, Codex and more from any computer or phone

main
ts 43 lines 1.44 KB
Raw
1 import type * as licensemanager from "@distilled.cloud/aws/license-manager";
2 import * as Binding from "alchemy/Binding";
3 import type * as Effect from "effect/Effect";
4
5 /**
6 * Request for {@link CreateToken}.
7 */
8 export interface CreateTokenRequest extends licensemanager.CreateTokenRequest {}
9
10 /**
11 * Runtime binding for `license-manager:CreateToken` — mint a long-lived
12 * refresh token for a license. The token (a claims-based JWT, `Redacted`
13 * end-to-end) is distributed to license consumers, who exchange it for
14 * temporary credentials with `GetAccessToken` +
15 * `AssumeRoleWithWebIdentity`.
16 *
17 * Provide the implementation with
18 * `Effect.provide(AWS.LicenseManager.CreateTokenHttp)`.
19 * ### License Checkout Data Plane
20 * **Example:** Mint an Activation Token for a License
21 * ```typescript
22 * // init
23 * const createToken = yield* AWS.LicenseManager.CreateToken();
24 *
25 * // runtime — Token is Redacted; hand it to the consumer without logging it
26 * const { TokenId, Token } = yield* createToken({
27 * LicenseArn: licenseArn,
28 * ClientToken: crypto.randomUUID(),
29 * });
30 * ```
31 *
32 * @binding
33 */
34 export interface CreateToken extends Binding.Service<
35 CreateToken,
36 "AWS.LicenseManager.CreateToken",
37 () => Effect.Effect<
38 (
39 request: CreateTokenRequest,
40 ) => Effect.Effect<licensemanager.CreateTokenResponse, licensemanager.CreateTokenError>
41 >
42 > {}
43 export const CreateToken = Binding.Service<CreateToken>("AWS.LicenseManager.CreateToken");