@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 40 lines 1.27 KB
Raw
1 import type {
2 BillingCreditGrant as StripeCreditGrant,
3 CreateBillingCreditGrantError,
4 CreateBillingCreditGrantRequest,
5 } from "@distilled.cloud/stripe/stripe";
6 import * as Binding from "alchemy/Binding";
7 import type { RuntimeContext } from "alchemy/RuntimeContext";
8 import type * as Effect from "effect/Effect";
9
10 /**
11 * Create a Stripe Credit Grant over HTTP. Account-scoped — binds the API
12 * key onto the host, not a specific grant resource.
13 *
14 * ### Creating a Credit Grant at runtime
15 * **Example:** Bind and create
16 * ```typescript
17 * const create = yield* Stripe.CreateCreditGrant();
18 * const grant = yield* create({
19 * customer: "cus_123",
20 * amount: { type: "monetary", monetary: { currency: "usd", value: 1000 } },
21 * applicability_config: { scope: { price_type: "metered" } },
22 * category: "promotional",
23 * name: "Welcome credits",
24 * });
25 * ```
26 *
27 * @binding
28 * @product Billing
29 */
30 export interface CreateCreditGrant extends Binding.Service<
31 CreateCreditGrant,
32 "Stripe.CreateCreditGrant",
33 () => Effect.Effect<
34 (
35 request: CreateBillingCreditGrantRequest,
36 ) => Effect.Effect<StripeCreditGrant, CreateBillingCreditGrantError, RuntimeContext>
37 >
38 > {}
39
40 export const CreateCreditGrant = Binding.Service<CreateCreditGrant>("Stripe.CreateCreditGrant");