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 type * as Pulls from "@distilled.cloud/github/pulls"; |
| 2 | import * as Binding from "alchemy/Binding"; |
| 3 | import type { RuntimeContext } from "alchemy/RuntimeContext"; |
| 4 | import type * as Effect from "effect/Effect"; |
| 5 | import type { Repository } from "./Repository.ts"; |
| 6 | |
| 7 | export interface ListPullRequestReviewsRequest extends Omit< |
| 8 | Pulls.ListReviewsRequest, |
| 9 | "owner" | "repo" |
| 10 | > {} |
| 11 | |
| 12 | export type ListPullRequestReviewsResponse = Pulls.ListReviewsResponse; |
| 13 | |
| 14 | /** |
| 15 | * List one page of a pull request's reviews (`pulls.listReviews`). |
| 16 | * |
| 17 | * Provide `GitHub.ListPullRequestReviewsHttp` on a Worker or Function, or |
| 18 | * `GitHub.ListPullRequestReviewsLocal` on an Action. |
| 19 | * |
| 20 | * ### Listing Reviews at Runtime |
| 21 | * **Example:** Check for an approval |
| 22 | * ```typescript |
| 23 | * const listReviews = yield* GitHub.ListPullRequestReviews(yield* Repo); |
| 24 | * const reviews = yield* listReviews({ pull_number: 9 }); |
| 25 | * const approved = reviews.some((review) => review.state === "APPROVED"); |
| 26 | * ``` |
| 27 | * |
| 28 | * @binding |
| 29 | * @product Pull Request |
| 30 | */ |
| 31 | export interface ListPullRequestReviews extends Binding.Service< |
| 32 | ListPullRequestReviews, |
| 33 | "GitHub.ListPullRequestReviews", |
| 34 | ( |
| 35 | repo: Repository, |
| 36 | ) => Effect.Effect< |
| 37 | ( |
| 38 | request: ListPullRequestReviewsRequest, |
| 39 | ) => Effect.Effect<ListPullRequestReviewsResponse, Pulls.ListReviewsError, RuntimeContext> |
| 40 | > |
| 41 | > {} |
| 42 | |
| 43 | export const ListPullRequestReviews = Binding.Service<ListPullRequestReviews>( |
| 44 | "GitHub.ListPullRequestReviews", |
| 45 | ); |