@theholocron/github-client 1.26.0 → 1.28.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.mts CHANGED
@@ -196,6 +196,13 @@ interface GitHubPullRequestCommit {
196
196
  message: string;
197
197
  };
198
198
  }
199
+ /** One file as returned by `GET /pulls/{pull_number}/files` — only the fields any known consumer needs. */
200
+ interface GitHubPullRequestFile {
201
+ filename: string;
202
+ status: "added" | "removed" | "modified" | "renamed" | "copied" | "changed" | "unchanged";
203
+ /** Set only when `status === "renamed"`. */
204
+ previous_filename?: string;
205
+ }
199
206
  //#endregion
200
207
  //#region src/repos/repos.d.ts
201
208
  interface GitHubRepo {
@@ -425,6 +432,7 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
425
432
  pulls: {
426
433
  getPullRequest: (repo: string, number: number) => Promise<GitHubPullRequest>;
427
434
  listCommits: (repo: string, number: number) => Promise<GitHubPullRequestCommit[]>;
435
+ listFiles: (repo: string, number: number) => Promise<GitHubPullRequestFile[]>;
428
436
  };
429
437
  repos: {
430
438
  getRepo: (repo: string) => Promise<GitHubRepo>;
@@ -467,4 +475,4 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
467
475
  };
468
476
  type GitHubClient = ReturnType<typeof createGitHubClient>;
469
477
  //#endregion
470
- export { type CheckRunConclusion, type CheckRunOutput, type CheckRunStatus, type CodeScanningSetupResult, type CreateCheckRunInput, type CreatePagesPayload, type CreatePullInput, type GitBlob, type GitCommit, type GitContents, type GitHubAppCredentials, type GitHubCheckRun, GitHubClient, type GitHubClientOptions, type GitHubContents, type GitHubEnvironment, type GitHubInstallationWebhookPayload, type GitHubIssue, type GitHubLabel, type GitHubMilestone, type GitHubPages, type GitHubPublicKey, type GitHubPullRequest, type GitHubPullRequestCommit, type GitHubPullRequestWebhookPayload, type GitHubPushWebhookPayload, type GitHubRepo, type GitHubRuleset, type GitHubUser, type GitHubWebhookHeaders, type GitHubWorkflowRun, type GitPull, type GitRef, type GitTree, type GitTreeItem, type InstallationAccessToken, type IssueSearchParams, type PagesBuildStatus, type PagesBuildType, type SecretScope, type TeamPermission, type UpdatePagesPayload, type WorkflowRunFilter, createAppJWT, createGitHubClient, createInstallationClient, getInstallationAccessToken, parseGitHubWebhookHeaders, verifyGitHubWebhookSignature };
478
+ export { type CheckRunConclusion, type CheckRunOutput, type CheckRunStatus, type CodeScanningSetupResult, type CreateCheckRunInput, type CreatePagesPayload, type CreatePullInput, type GitBlob, type GitCommit, type GitContents, type GitHubAppCredentials, type GitHubCheckRun, GitHubClient, type GitHubClientOptions, type GitHubContents, type GitHubEnvironment, type GitHubInstallationWebhookPayload, type GitHubIssue, type GitHubLabel, type GitHubMilestone, type GitHubPages, type GitHubPublicKey, type GitHubPullRequest, type GitHubPullRequestCommit, type GitHubPullRequestFile, type GitHubPullRequestWebhookPayload, type GitHubPushWebhookPayload, type GitHubRepo, type GitHubRuleset, type GitHubUser, type GitHubWebhookHeaders, type GitHubWorkflowRun, type GitPull, type GitRef, type GitTree, type GitTreeItem, type InstallationAccessToken, type IssueSearchParams, type PagesBuildStatus, type PagesBuildType, type SecretScope, type TeamPermission, type UpdatePagesPayload, type WorkflowRunFilter, createAppJWT, createGitHubClient, createInstallationClient, getInstallationAccessToken, parseGitHubWebhookHeaders, verifyGitHubWebhookSignature };
package/dist/index.mjs CHANGED
@@ -224,7 +224,14 @@ function pulls(rest) {
224
224
  * commits (GitHub caps this endpoint at 250 regardless of pagination)
225
225
  * is an edge case no consumer here needs to paginate for today.
226
226
  */
227
- listCommits: (repo, number) => rest.request(`${repoBase(repo)}/pulls/${number}/commits?per_page=100`)
227
+ listCommits: (repo, number) => rest.request(`${repoBase(repo)}/pulls/${number}/commits?per_page=100`),
228
+ /**
229
+ * A PR's own changed files. `per_page=100` — GitHub's max — covers
230
+ * every real PR in this org; a PR genuinely exceeding 100 changed
231
+ * files (GitHub caps this endpoint at 3000 regardless of pagination)
232
+ * is an edge case no consumer here needs to paginate for today.
233
+ */
234
+ listFiles: (repo, number) => rest.request(`${repoBase(repo)}/pulls/${number}/files?per_page=100`)
228
235
  };
229
236
  }
230
237
  //#endregion
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.26.0",
3
+ "version": "1.28.0",
4
4
  "description": "A TypeScript client for the GitHub REST API",
5
5
  "keywords": [
6
6
  "github",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@theholocron/observability": "^0.3.0",
36
- "@theholocron/http-client": "^1.26.0"
36
+ "@theholocron/http-client": "^1.28.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@theholocron/cli": "5.0.0-alpha.33",