@theholocron/github-client 1.6.6 → 1.7.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 +1 -36
- package/dist/index.mjs +1 -34
- package/package.json +6 -6
package/dist/index.d.mts
CHANGED
|
@@ -113,36 +113,6 @@ interface GitHubLabel {
|
|
|
113
113
|
description: string | null;
|
|
114
114
|
}
|
|
115
115
|
//#endregion
|
|
116
|
-
//#region src/pages/pages.d.ts
|
|
117
|
-
type PagesBuildType = "workflow" | "legacy";
|
|
118
|
-
interface GitHubPages {
|
|
119
|
-
status: "built" | "building" | "errored" | "unknown" | null;
|
|
120
|
-
build_type: PagesBuildType | null;
|
|
121
|
-
source?: {
|
|
122
|
-
branch: string;
|
|
123
|
-
path: string;
|
|
124
|
-
};
|
|
125
|
-
https_enforced: boolean;
|
|
126
|
-
custom_domain: string | null;
|
|
127
|
-
}
|
|
128
|
-
interface CreatePagesPayload {
|
|
129
|
-
build_type: PagesBuildType;
|
|
130
|
-
/** Required when build_type is "legacy". */
|
|
131
|
-
source?: {
|
|
132
|
-
branch: string;
|
|
133
|
-
path: string;
|
|
134
|
-
};
|
|
135
|
-
}
|
|
136
|
-
interface UpdatePagesPayload {
|
|
137
|
-
build_type?: PagesBuildType;
|
|
138
|
-
source?: {
|
|
139
|
-
branch: string;
|
|
140
|
-
path: string;
|
|
141
|
-
};
|
|
142
|
-
cname?: string | null;
|
|
143
|
-
https_enforced?: boolean;
|
|
144
|
-
}
|
|
145
|
-
//#endregion
|
|
146
116
|
//#region src/repos/repos.d.ts
|
|
147
117
|
interface GitHubRepo {
|
|
148
118
|
default_branch: string;
|
|
@@ -262,11 +232,6 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
262
232
|
}) => Promise<GitHubLabel>;
|
|
263
233
|
deleteLabel: (repo: string, name: string) => Promise<void>;
|
|
264
234
|
};
|
|
265
|
-
pages: {
|
|
266
|
-
getPages: (repo: string) => Promise<GitHubPages | null>;
|
|
267
|
-
createPages: (repo: string, payload: CreatePagesPayload) => Promise<GitHubPages>;
|
|
268
|
-
updatePages: (repo: string, payload: UpdatePagesPayload) => Promise<void>;
|
|
269
|
-
};
|
|
270
235
|
properties: {
|
|
271
236
|
setProperties: (repo: string, values: Record<string, string>) => Promise<void>;
|
|
272
237
|
};
|
|
@@ -311,4 +276,4 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
311
276
|
};
|
|
312
277
|
type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
313
278
|
//#endregion
|
|
314
|
-
export { type CodeScanningSetupResult, type
|
|
279
|
+
export { type CodeScanningSetupResult, type CreatePullInput, type GitBlob, type GitCommit, type GitContents, GitHubClient, type GitHubClientOptions, type GitHubContents, type GitHubEnvironment, type GitHubIssue, type GitHubLabel, type GitHubMilestone, type GitHubPublicKey, type GitHubRepo, type GitHubRuleset, type GitHubUser, type GitHubWorkflowRun, type GitPull, type GitRef, type GitTree, type GitTreeItem, type IssueSearchParams, type SecretScope, type TeamPermission, type WorkflowRunFilter, createGitHubClient };
|
package/dist/index.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { createRestClient } from "@theholocron/http-client";
|
|
2
2
|
//#region src/utils.ts
|
|
3
3
|
function createGitHubRestClient(opts) {
|
|
4
4
|
return createRestClient({
|
|
@@ -148,38 +148,6 @@ function labels(rest) {
|
|
|
148
148
|
};
|
|
149
149
|
}
|
|
150
150
|
//#endregion
|
|
151
|
-
//#region src/pages/pages.ts
|
|
152
|
-
function pages(rest) {
|
|
153
|
-
return {
|
|
154
|
-
/** Returns null when Pages is not yet enabled (404). */
|
|
155
|
-
getPages: async (repo) => {
|
|
156
|
-
try {
|
|
157
|
-
return await rest.request(`${repoBase(repo)}/pages`);
|
|
158
|
-
} catch (err) {
|
|
159
|
-
if (err instanceof ProviderApiError && err.status === 404) return null;
|
|
160
|
-
throw err;
|
|
161
|
-
}
|
|
162
|
-
},
|
|
163
|
-
/**
|
|
164
|
-
* Enables Pages for the first time.
|
|
165
|
-
* Throws on all errors except 409 Conflict (already enabled — callers
|
|
166
|
-
* should catch that and fall through to updatePages).
|
|
167
|
-
*/
|
|
168
|
-
createPages: (repo, payload) => rest.request(`${repoBase(repo)}/pages`, {
|
|
169
|
-
method: "POST",
|
|
170
|
-
body: payload
|
|
171
|
-
}),
|
|
172
|
-
/**
|
|
173
|
-
* Updates Pages settings on an existing site (build type, cname, https).
|
|
174
|
-
* GitHub returns 204 No Content.
|
|
175
|
-
*/
|
|
176
|
-
updatePages: (repo, payload) => rest.request(`${repoBase(repo)}/pages`, {
|
|
177
|
-
method: "PUT",
|
|
178
|
-
body: payload
|
|
179
|
-
})
|
|
180
|
-
};
|
|
181
|
-
}
|
|
182
|
-
//#endregion
|
|
183
151
|
//#region src/properties/properties.ts
|
|
184
152
|
function properties(rest) {
|
|
185
153
|
return { setProperties: (repo, values) => {
|
|
@@ -337,7 +305,6 @@ function createGitHubClient(opts) {
|
|
|
337
305
|
git: git(rest),
|
|
338
306
|
issues: issues(rest),
|
|
339
307
|
labels: labels(rest),
|
|
340
|
-
pages: pages(rest),
|
|
341
308
|
properties: properties(rest),
|
|
342
309
|
repos: repos(rest),
|
|
343
310
|
rulesets: rulesets(rest),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/github-client",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.7.0",
|
|
4
4
|
"description": "A TypeScript client for the GitHub REST API",
|
|
5
5
|
"homepage": "https://github.com/theholocron/clients/tree/main/packages/github-client#readme",
|
|
6
6
|
"bugs": "https://github.com/theholocron/clients/issues",
|
|
@@ -30,14 +30,14 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@theholocron/http-client": "^1.
|
|
33
|
+
"@theholocron/http-client": "^1.7.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.2.0",
|
|
37
|
-
"@theholocron/eslint-config": "^7.
|
|
38
|
-
"@theholocron/tsconfig": "^7.
|
|
39
|
-
"@theholocron/tsdown-config": "^7.
|
|
40
|
-
"@theholocron/vitest-config": "^7.
|
|
37
|
+
"@theholocron/eslint-config": "^7.19.0",
|
|
38
|
+
"@theholocron/tsconfig": "^7.19.0",
|
|
39
|
+
"@theholocron/tsdown-config": "^7.19.0",
|
|
40
|
+
"@theholocron/vitest-config": "^7.19.0",
|
|
41
41
|
"@vitest/coverage-v8": "^4.1.10",
|
|
42
42
|
"@vitest/eslint-plugin": "^1.6.25",
|
|
43
43
|
"eslint": "^10.8.1",
|