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 ListPullRequestsRequest extends Omit<Pulls.ListRequest, "owner" | "repo"> {} |
| 8 | |
| 9 | export type ListPullRequestsResponse = Pulls.ListResponse; |
| 10 | |
| 11 | /** |
| 12 | * List one page of the repository's pull requests (`pulls.list`). |
| 13 | * |
| 14 | * Provide `GitHub.ListPullRequestsHttp` on a Worker or Function, or |
| 15 | * `GitHub.ListPullRequestsLocal` on an Action. |
| 16 | * |
| 17 | * ### Listing Pull Requests at Runtime |
| 18 | * **Example:** List open pull requests into main |
| 19 | * ```typescript |
| 20 | * const listPullRequests = yield* GitHub.ListPullRequests(yield* Repo); |
| 21 | * const open = yield* listPullRequests({ state: "open", base: "main" }); |
| 22 | * ``` |
| 23 | * |
| 24 | * @binding |
| 25 | * @product Pull Request |
| 26 | */ |
| 27 | export interface ListPullRequests extends Binding.Service< |
| 28 | ListPullRequests, |
| 29 | "GitHub.ListPullRequests", |
| 30 | ( |
| 31 | repo: Repository, |
| 32 | ) => Effect.Effect< |
| 33 | ( |
| 34 | request?: ListPullRequestsRequest, |
| 35 | ) => Effect.Effect<ListPullRequestsResponse, Pulls.ListError, RuntimeContext> |
| 36 | > |
| 37 | > {} |
| 38 | |
| 39 | export const ListPullRequests = Binding.Service<ListPullRequests>("GitHub.ListPullRequests"); |