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

main
ts 56 lines 1.93 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 CreateLicense}.
7 */
8 export interface CreateLicenseRequest extends licensemanager.CreateLicenseRequest {}
9
10 /**
11 * Runtime binding for `license-manager:CreateLicense` — issue a
12 * seller-issued license from the calling application. The core of an ISV
13 * ordering/fulfillment backend: when a customer purchases, the backend
14 * mints a license with the product SKU, entitlements, validity window,
15 * and consumption configuration, then distributes it via grants or
16 * activation tokens.
17 *
18 * Provide the implementation with
19 * `Effect.provide(AWS.LicenseManager.CreateLicenseHttp)`.
20 * ### Issuing Licenses
21 * **Example:** Issue a License on Purchase
22 * ```typescript
23 * // init — account-level binding takes no resource
24 * const createLicense = yield* AWS.LicenseManager.CreateLicense();
25 *
26 * // runtime
27 * const { LicenseArn, Version } = yield* createLicense({
28 * LicenseName: "my-product-license",
29 * ProductName: "My Product",
30 * ProductSKU: "my-product-sku",
31 * Issuer: { Name: "my-company" },
32 * HomeRegion: region,
33 * Validity: { Begin: new Date().toISOString() },
34 * Entitlements: [
35 * { Name: "seats", MaxCount: 10, Unit: "Count", AllowCheckIn: true },
36 * ],
37 * Beneficiary: customerAccountId,
38 * ConsumptionConfiguration: {
39 * ProvisionalConfiguration: { MaxTimeToLiveInMinutes: 60 },
40 * },
41 * ClientToken: crypto.randomUUID(),
42 * });
43 * ```
44 *
45 * @binding
46 */
47 export interface CreateLicense extends Binding.Service<
48 CreateLicense,
49 "AWS.LicenseManager.CreateLicense",
50 () => Effect.Effect<
51 (
52 request: CreateLicenseRequest,
53 ) => Effect.Effect<licensemanager.CreateLicenseResponse, licensemanager.CreateLicenseError>
54 >
55 > {}
56 export const CreateLicense = Binding.Service<CreateLicense>("AWS.LicenseManager.CreateLicense");