The best way to control Claude Code, Codex and more from any computer or phone
| 1 | import * as Pulls from "@distilled.cloud/github/pulls"; |
| 2 | import * as Layer from "effect/Layer"; |
| 3 | import * as BindingHttp from "./BindingHttp.ts"; |
| 4 | import { ListPullRequests, type ListPullRequestsRequest } from "./ListPullRequests.ts"; |
| 5 | |
| 6 | export const listPullRequestsOperation = BindingHttp.operation( |
| 7 | "pulls.list", |
| 8 | (repo) => (request?: ListPullRequestsRequest) => |
| 9 | Pulls.list({ owner: repo.owner, repo: repo.repository, ...request }), |
| 10 | ); |
| 11 | |
| 12 | /** |
| 13 | * Token-backed implementation of {@link ListPullRequests}. Provide it on a Worker or |
| 14 | * Function: it captures a `GitHub.PersonalAccessToken` for the host and binds |
| 15 | * the token and the repository into it. |
| 16 | * |
| 17 | * @layer |
| 18 | * @product Pull Request |
| 19 | * @provides GitHub.ListPullRequests |
| 20 | */ |
| 21 | export const ListPullRequestsHttp = Layer.effect( |
| 22 | ListPullRequests, |
| 23 | BindingHttp.make(listPullRequestsOperation), |
| 24 | ); |