Open History to see the last commit
1/**
2 * Shared scaffolding for the GitHub `*Local` binding layers: the same
3 * operations as `*Http`, authenticated with the provider's current
4 * credentials instead of a token bound into a host. Provide them on an
5 * `Action` or any deploy-time Effect.
6 *
7 * NOT exported from `index.ts`.
8 */
9import * as Effect from "effect/Effect";
10import { type Operation, makeOperationClient } from "./BindingHttp.ts";
11import { Credentials } from "./Credentials.ts";
12
13export const make = <Request extends ReadonlyArray<any>, Out, E>(op: Operation<Request, Out, E>) =>
14 Effect.gen(function* () {
15 const credentials = yield* yield* Credentials;
16 return makeOperationClient(op, {
17 token: Effect.succeed(credentials.token),
18 apiUrl: Effect.succeed(credentials.apiBaseUrl),
19 });
20 });