Skip to content
Source
Sign inSign up
pingdotgg/t3code
Open History to see the last commit

CreatePullRequestReviewHttp.ts

27 lines941 Bytes

1import * as Pulls from "@distilled.cloud/github/pulls";
2import * as Layer from "effect/Layer";
3import * as BindingHttp from "./BindingHttp.ts";
4import {
5 CreatePullRequestReview,
6 type CreatePullRequestReviewRequest,
7} from "./CreatePullRequestReview.ts";
8​
9export 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 */
24export const CreatePullRequestReviewHttp = Layer.effect(
25 CreatePullRequestReview,
26 BindingHttp.make(createPullRequestReviewOperation),
27);