Open History to see the last commit
1import * as Issues from "@distilled.cloud/github/issues";
2import * as Layer from "effect/Layer";
3import * as BindingHttp from "./BindingHttp.ts";
4import { CreateIssueComment, type CreateIssueCommentRequest } from "./CreateIssueComment.ts";
5
6export const createIssueCommentOperation = BindingHttp.operation(
7 "issues.createComment",
8 (repo) => (request: CreateIssueCommentRequest) =>
9 Issues.createComment({ owner: repo.owner, repo: repo.repository, ...request }),
10);
11
12/**
13 * Token-backed implementation of {@link CreateIssueComment}. 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 Issue
19 * @provides GitHub.CreateIssueComment
20 */
21export const CreateIssueCommentHttp = Layer.effect(
22 CreateIssueComment,
23 BindingHttp.make(createIssueCommentOperation),
24);