@theholocron/github-client 1.0.2 → 1.1.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 +7 -1
- package/dist/index.mjs +9 -0
- package/package.json +2 -2
package/dist/index.d.mts
CHANGED
|
@@ -151,6 +151,9 @@ interface CodeScanningSetupResult {
|
|
|
151
151
|
run_url: string;
|
|
152
152
|
}
|
|
153
153
|
//#endregion
|
|
154
|
+
//#region src/teams/teams.d.ts
|
|
155
|
+
type TeamPermission = "pull" | "triage" | "push" | "maintain" | "admin";
|
|
156
|
+
//#endregion
|
|
154
157
|
//#region src/user/user.d.ts
|
|
155
158
|
interface GitHubUser {
|
|
156
159
|
login: string;
|
|
@@ -257,6 +260,9 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
257
260
|
enableCodeScanning: (repo: string) => Promise<CodeScanningSetupResult>;
|
|
258
261
|
disableDefaultCodeScanning: (repo: string) => Promise<void>;
|
|
259
262
|
};
|
|
263
|
+
teams: {
|
|
264
|
+
addRepo: (org: string, teamSlug: string, owner: string, repo: string, permission: TeamPermission) => Promise<void>;
|
|
265
|
+
};
|
|
260
266
|
topics: {
|
|
261
267
|
setTopics: (repo: string, names: string[]) => Promise<void>;
|
|
262
268
|
};
|
|
@@ -270,4 +276,4 @@ declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
270
276
|
};
|
|
271
277
|
type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
272
278
|
//#endregion
|
|
273
|
-
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 WorkflowRunFilter, createGitHubClient };
|
|
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
|
@@ -259,6 +259,14 @@ function security(rest) {
|
|
|
259
259
|
};
|
|
260
260
|
}
|
|
261
261
|
//#endregion
|
|
262
|
+
//#region src/teams/teams.ts
|
|
263
|
+
function teams(rest) {
|
|
264
|
+
return { addRepo: (org, teamSlug, owner, repo, permission) => rest.request(`/orgs/${org}/teams/${teamSlug}/repos/${owner}/${repo}`, {
|
|
265
|
+
method: "PUT",
|
|
266
|
+
body: { permission }
|
|
267
|
+
}) };
|
|
268
|
+
}
|
|
269
|
+
//#endregion
|
|
262
270
|
//#region src/topics/topics.ts
|
|
263
271
|
function topics(rest) {
|
|
264
272
|
return { setTopics: (repo, names) => rest.request(`${repoBase(repo)}/topics`, {
|
|
@@ -302,6 +310,7 @@ function createGitHubClient(opts) {
|
|
|
302
310
|
rulesets: rulesets(rest),
|
|
303
311
|
secrets: secrets(rest),
|
|
304
312
|
security: security(rest),
|
|
313
|
+
teams: teams(rest),
|
|
305
314
|
topics: topics(rest),
|
|
306
315
|
user: user(rest),
|
|
307
316
|
workflows: workflows(rest)
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/github-client",
|
|
3
|
-
"version": "1.0
|
|
3
|
+
"version": "1.1.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,7 +30,7 @@
|
|
|
30
30
|
}
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"@theholocron/http-client": "^1.0
|
|
33
|
+
"@theholocron/http-client": "^1.1.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"@types/node": "^26.1.1",
|