@theholocron/github-client 1.18.0 → 1.19.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/README.md +1 -0
- package/dist/index.d.mts +31 -1
- package/dist/index.mjs +9 -0
- package/package.json +2 -2
package/README.md
CHANGED
|
@@ -51,6 +51,7 @@ const blob = await client.git.createBlob("owner/name", "file contents");
|
|
|
51
51
|
| `topics` | `setTopics` |
|
|
52
52
|
| `properties` | `setProperties` |
|
|
53
53
|
| `git` | `getRef`, `getCommit`, `getTree`, `getContents`, `createBlob`, `createTree`, `createCommit`, `createRef`, `updateRef`, `createPull` |
|
|
54
|
+
| `checks` | `createCheckRun` |
|
|
54
55
|
|
|
55
56
|
## Webhooks
|
|
56
57
|
|
package/dist/index.d.mts
CHANGED
|
@@ -11,6 +11,33 @@ interface GitHubClientOptions {
|
|
|
11
11
|
errors?: ErrorSink;
|
|
12
12
|
}
|
|
13
13
|
//#endregion
|
|
14
|
+
//#region src/checks/checks.d.ts
|
|
15
|
+
type CheckRunStatus = "queued" | "in_progress" | "completed";
|
|
16
|
+
type CheckRunConclusion = "success" | "failure" | "neutral" | "cancelled" | "timed_out" | "action_required" | "skipped";
|
|
17
|
+
interface CheckRunOutput {
|
|
18
|
+
title: string;
|
|
19
|
+
summary: string;
|
|
20
|
+
text?: string;
|
|
21
|
+
}
|
|
22
|
+
interface CreateCheckRunInput {
|
|
23
|
+
name: string;
|
|
24
|
+
/** The commit SHA the check run attaches to. */
|
|
25
|
+
head_sha: string;
|
|
26
|
+
/** Defaults to `"queued"` (GitHub's own default) when omitted. */
|
|
27
|
+
status?: CheckRunStatus;
|
|
28
|
+
/** Required when `status` is `"completed"`. */
|
|
29
|
+
conclusion?: CheckRunConclusion;
|
|
30
|
+
output?: CheckRunOutput;
|
|
31
|
+
}
|
|
32
|
+
interface GitHubCheckRun {
|
|
33
|
+
id: number;
|
|
34
|
+
name: string;
|
|
35
|
+
head_sha: string;
|
|
36
|
+
status: CheckRunStatus;
|
|
37
|
+
conclusion: CheckRunConclusion | null;
|
|
38
|
+
html_url: string;
|
|
39
|
+
}
|
|
40
|
+
//#endregion
|
|
14
41
|
//#region src/environments/environments.d.ts
|
|
15
42
|
interface GitHubEnvironment {
|
|
16
43
|
name: string;
|
|
@@ -300,6 +327,9 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
300
327
|
branches: {
|
|
301
328
|
protectBranch: (repo: string, branch: string, payload: Record<string, unknown>) => Promise<void>;
|
|
302
329
|
};
|
|
330
|
+
checks: {
|
|
331
|
+
createCheckRun: (repo: string, input: CreateCheckRunInput) => Promise<GitHubCheckRun>;
|
|
332
|
+
};
|
|
303
333
|
environments: {
|
|
304
334
|
listEnvironments: (repo: string) => Promise<GitHubEnvironment[]>;
|
|
305
335
|
upsertEnvironment: (repo: string, name: string, body: Record<string, unknown>) => Promise<void>;
|
|
@@ -399,4 +429,4 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
399
429
|
};
|
|
400
430
|
type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
401
431
|
//#endregion
|
|
402
|
-
export { type CodeScanningSetupResult, type CreatePagesPayload, type CreatePullInput, type GitBlob, type GitCommit, type GitContents, 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 IssueSearchParams, type PagesBuildStatus, type PagesBuildType, type SecretScope, type TeamPermission, type UpdatePagesPayload, type WorkflowRunFilter, createGitHubClient, parseGitHubWebhookHeaders, verifyGitHubWebhookSignature };
|
|
432
|
+
export { type CheckRunConclusion, type CheckRunOutput, type CheckRunStatus, type CodeScanningSetupResult, type CreateCheckRunInput, type CreatePagesPayload, type CreatePullInput, type GitBlob, type GitCommit, type GitContents, 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 IssueSearchParams, type PagesBuildStatus, type PagesBuildType, type SecretScope, type TeamPermission, type UpdatePagesPayload, type WorkflowRunFilter, createGitHubClient, parseGitHubWebhookHeaders, verifyGitHubWebhookSignature };
|
package/dist/index.mjs
CHANGED
|
@@ -29,6 +29,14 @@ function branches(rest) {
|
|
|
29
29
|
}) };
|
|
30
30
|
}
|
|
31
31
|
//#endregion
|
|
32
|
+
//#region src/checks/checks.ts
|
|
33
|
+
function checks(rest) {
|
|
34
|
+
return { createCheckRun: (repo, input) => rest.request(`${repoBase(repo)}/check-runs`, {
|
|
35
|
+
method: "POST",
|
|
36
|
+
body: input
|
|
37
|
+
}) };
|
|
38
|
+
}
|
|
39
|
+
//#endregion
|
|
32
40
|
//#region src/environments/environments.ts
|
|
33
41
|
function environments(rest) {
|
|
34
42
|
return {
|
|
@@ -396,6 +404,7 @@ function createGitHubClient(opts) {
|
|
|
396
404
|
const rest = createGitHubRestClient(opts);
|
|
397
405
|
return {
|
|
398
406
|
branches: branches(rest),
|
|
407
|
+
checks: checks(rest),
|
|
399
408
|
environments: environments(rest),
|
|
400
409
|
git: git(rest),
|
|
401
410
|
issues: issues(rest),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/github-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.19.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.
|
|
36
|
+
"@theholocron/http-client": "^1.19.0"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@theholocron/cli": "5.0.0-alpha.3",
|