@devries-cameron20 / t3code Mirror · read-only
Fork 0

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

main
ts 27 lines 941 Bytes
Raw
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 {
5 CreatePullRequestReview,
6 type CreatePullRequestReviewRequest,
7 } from "./CreatePullRequestReview.ts";
8
9 export const createPullRequestReviewOperation = BindingHttp.operation(
10 "pulls.createReview",
11 (repo) => (request: CreatePullRequestReviewRequest) =>
12 Pulls.createReview({ owner: repo.owner, repo: repo.repository, ...request }),
13 );
14
15 /**
16 * Token-backed implementation of {@link CreatePullRequestReview}. Provide it on a Worker or
17 * Function: it captures a `GitHub.PersonalAccessToken` for the host and binds
18 * the token and the repository into it.
19 *
20 * @layer
21 * @product Pull Request
22 * @provides GitHub.CreatePullRequestReview
23 */
24 export const CreatePullRequestReviewHttp = Layer.effect(
25 CreatePullRequestReview,
26 BindingHttp.make(createPullRequestReviewOperation),
27 );