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, 04:45 UTC
| 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 { CreatePullRequest, type CreatePullRequestRequest } from "./CreatePullRequest.ts"; |
| 5 | |
| 6 | export const createPullRequestOperation = BindingHttp.operation( |
| 7 | "pulls.create", |
| 8 | (repo) => (request: CreatePullRequestRequest) => |
| 9 | Pulls.create({ owner: repo.owner, repo: repo.repository, ...request }), |
| 10 | ); |
| 11 | |
| 12 | /** |
| 13 | * Token-backed implementation of {@link CreatePullRequest}. 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.CreatePullRequest |
| 20 | */ |
| 21 | export const CreatePullRequestHttp = Layer.effect( |
| 22 | CreatePullRequest, |
| 23 | BindingHttp.make(createPullRequestOperation), |
| 24 | ); |