| 1 | import type { |
| 2 | AppsSecret as StripeAppsSecret, |
| 3 | CreateAppsSecretError, |
| 4 | CreateAppsSecretRequest, |
| 5 | } from "@distilled.cloud/stripe/stripe"; |
| 6 | import type * as Effect from "effect/Effect"; |
| 7 | import * as Binding from "../Binding.ts"; |
| 8 | import type { RuntimeContext } from "../RuntimeContext.ts"; |
| 9 | |
| 10 | /** |
| 11 | * Create or replace a Stripe Apps Secret over HTTP. Account-scoped — |
| 12 | * binds the API key onto the host, not a specific secret resource. |
| 13 | * |
| 14 | * ### Creating a Secret at runtime |
| 15 | * **Example:** Bind and create |
| 16 | * ```typescript |
| 17 | * const create = yield* Stripe.CreateAppsSecret(); |
| 18 | * const secret = yield* create({ |
| 19 | * name: "third-party-api", |
| 20 | * payload: "sk_live_example", |
| 21 | * scope: { type: "account" }, |
| 22 | * }); |
| 23 | * ``` |
| 24 | * |
| 25 | * @binding |
| 26 | * @product Secrets |
| 27 | */ |
| 28 | export interface CreateAppsSecret extends Binding.Service< |
| 29 | CreateAppsSecret, |
| 30 | "Stripe.CreateAppsSecret", |
| 31 | () => Effect.Effect< |
| 32 | ( |
| 33 | request: CreateAppsSecretRequest, |
| 34 | ) => Effect.Effect<StripeAppsSecret, CreateAppsSecretError, RuntimeContext> |
| 35 | > |
| 36 | > {} |
| 37 | |
| 38 | export const CreateAppsSecret = Binding.Service<CreateAppsSecret>( |
| 39 | "Stripe.CreateAppsSecret", |
| 40 | ); |