@theholocron/github-client 1.23.0 → 1.25.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 +9 -1
- package/dist/index.mjs +10 -1
- package/package.json +4 -4
package/dist/index.d.mts
CHANGED
|
@@ -187,6 +187,13 @@ interface GitHubPullRequest {
|
|
|
187
187
|
ref: string;
|
|
188
188
|
};
|
|
189
189
|
}
|
|
190
|
+
/** One commit as returned by `GET /pulls/{pull_number}/commits` — only the fields any known consumer needs. */
|
|
191
|
+
interface GitHubPullRequestCommit {
|
|
192
|
+
sha: string;
|
|
193
|
+
commit: {
|
|
194
|
+
message: string;
|
|
195
|
+
};
|
|
196
|
+
}
|
|
190
197
|
//#endregion
|
|
191
198
|
//#region src/repos/repos.d.ts
|
|
192
199
|
interface GitHubRepo {
|
|
@@ -415,6 +422,7 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
415
422
|
};
|
|
416
423
|
pulls: {
|
|
417
424
|
getPullRequest: (repo: string, number: number) => Promise<GitHubPullRequest>;
|
|
425
|
+
listCommits: (repo: string, number: number) => Promise<GitHubPullRequestCommit[]>;
|
|
418
426
|
};
|
|
419
427
|
repos: {
|
|
420
428
|
getRepo: (repo: string) => Promise<GitHubRepo>;
|
|
@@ -457,4 +465,4 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
457
465
|
};
|
|
458
466
|
type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
459
467
|
//#endregion
|
|
460
|
-
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 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 };
|
|
468
|
+
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 };
|
package/dist/index.mjs
CHANGED
|
@@ -216,7 +216,16 @@ setProperties: (repo, values) => {
|
|
|
216
216
|
//#endregion
|
|
217
217
|
//#region src/pulls/pulls.ts
|
|
218
218
|
function pulls(rest) {
|
|
219
|
-
return {
|
|
219
|
+
return {
|
|
220
|
+
getPullRequest: (repo, number) => rest.request(`${repoBase(repo)}/pulls/${number}`),
|
|
221
|
+
/**
|
|
222
|
+
* A PR's own commits, in commit order. `per_page=100` — GitHub's max —
|
|
223
|
+
* covers every real PR in this org; a PR genuinely exceeding 100
|
|
224
|
+
* commits (GitHub caps this endpoint at 250 regardless of pagination)
|
|
225
|
+
* is an edge case no consumer here needs to paginate for today.
|
|
226
|
+
*/
|
|
227
|
+
listCommits: (repo, number) => rest.request(`${repoBase(repo)}/pulls/${number}/commits?per_page=100`)
|
|
228
|
+
};
|
|
220
229
|
}
|
|
221
230
|
//#endregion
|
|
222
231
|
//#region src/repos/repos.ts
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/github-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.25.0",
|
|
4
4
|
"description": "A TypeScript client for the GitHub REST API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -33,11 +33,11 @@
|
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
35
|
"@theholocron/observability": "^0.3.0",
|
|
36
|
-
"@theholocron/http-client": "^1.
|
|
36
|
+
"@theholocron/http-client": "^1.25.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
|
-
"@theholocron/cli": "5.0.0-alpha.
|
|
40
|
-
"@theholocron/eslint-config": "^8.
|
|
39
|
+
"@theholocron/cli": "5.0.0-alpha.33",
|
|
40
|
+
"@theholocron/eslint-config": "^8.4.3",
|
|
41
41
|
"@theholocron/tsconfig": "^8.2.0",
|
|
42
42
|
"@theholocron/tsdown-config": "^8.2.0",
|
|
43
43
|
"@theholocron/vitest-config": "^8.2.0",
|