sailfork / t3code-github / .repos/ alchemy-effect/ packages/ stripe/ src/ RetrievePriceHttp.ts

import { GetPrice } from "@distilled.cloud/stripe/stripe";
import * as Layer from "effect/Layer";
import { RetrievePrice } from "./RetrievePrice.ts";
import { makeHttpStripeIdBinding } from "./StripeHttp.ts";

/**
 * HTTP implementation of {@link RetrievePrice}. Provide it on the
 * Function or Worker Effect.
 *
 * @layer
 * @product Product
 * @provides Stripe.RetrievePrice
 */
export const RetrievePriceHttp = Layer.effect(
  RetrievePrice,
  makeHttpStripeIdBinding({
    tag: "Stripe.RetrievePrice",
    operation: GetPrice,
    idField: "price",
    permissions: ["prices_read"],
  }),
);