@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 45 lines 1.26 KB
Raw
1 import type {
2 GetProductError,
3 GetProductRequest,
4 Product as StripeProduct,
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 import type { Product } from "./Product.ts";
10
11 export interface RetrieveProductRequest extends Omit<GetProductRequest, "id"> {}
12
13 /**
14 * Retrieve a bound Stripe Product over HTTP. Pass the Product resource,
15 * a `prod_…` id string, or an Effect resolving to a Product.
16 *
17 * ### Reading a Product
18 * **Example:** Bind and retrieve
19 * ```typescript
20 * const retrieve = yield* Stripe.RetrieveProduct(product);
21 * const live = yield* retrieve();
22 * ```
23 *
24 * **Example:** By id
25 * ```typescript
26 * const retrieve = yield* Stripe.RetrieveProduct("prod_123");
27 * const live = yield* retrieve();
28 * ```
29 *
30 * @binding
31 * @product Product
32 */
33 export interface RetrieveProduct extends Binding.Service<
34 RetrieveProduct,
35 "Stripe.RetrieveProduct",
36 (
37 product: string | Product,
38 ) => Effect.Effect<
39 (
40 request?: RetrieveProductRequest,
41 ) => Effect.Effect<StripeProduct, GetProductError, RuntimeContext>
42 >
43 > {}
44
45 export const RetrieveProduct = Binding.Service<RetrieveProduct>("Stripe.RetrieveProduct");