@theholocron/github-client 1.58.0-alpha.50 → 1.58.0-alpha.52
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 +32 -1
- package/dist/index.mjs +23 -0
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -378,6 +378,32 @@ interface IssueFieldValueInput {
|
|
|
378
378
|
/** The option's name, text, number or date. */
|
|
379
379
|
value: string | number;
|
|
380
380
|
}
|
|
381
|
+
/** The colour words GitHub's issue Types take. */
|
|
382
|
+
type IssueTypeColor = "gray" | "blue" | "green" | "yellow" | "orange" | "red" | "pink" | "purple";
|
|
383
|
+
/** One issue Type of an organization. */
|
|
384
|
+
interface OrgIssueTypeInfo {
|
|
385
|
+
/** GitHub's numeric id. */
|
|
386
|
+
id: number;
|
|
387
|
+
/** The Type's name. */
|
|
388
|
+
name: string;
|
|
389
|
+
/** One line, or `null`. */
|
|
390
|
+
description?: string | null;
|
|
391
|
+
/** The colour word, or `null`. */
|
|
392
|
+
color?: IssueTypeColor | null;
|
|
393
|
+
/** Whether new issues may take it. */
|
|
394
|
+
is_enabled: boolean;
|
|
395
|
+
}
|
|
396
|
+
/** What GitHub takes when a Type is made or replaced (`name` and `is_enabled` are required). */
|
|
397
|
+
interface IssueTypeInput {
|
|
398
|
+
/** The Type's name. */
|
|
399
|
+
name: string;
|
|
400
|
+
/** Whether new issues may take it. */
|
|
401
|
+
is_enabled: boolean;
|
|
402
|
+
/** One line. */
|
|
403
|
+
description?: string | null;
|
|
404
|
+
/** The colour word. */
|
|
405
|
+
color?: IssueTypeColor | null;
|
|
406
|
+
}
|
|
381
407
|
/** An issue as GitHub returns it, with only the fields this client reads. */
|
|
382
408
|
interface GitHubIssue {
|
|
383
409
|
/** The issue's numeric id. */
|
|
@@ -1144,6 +1170,11 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
1144
1170
|
addValues: (repo: string, number: number, values: IssueFieldValueInput[]) => Promise<GitHubIssueFieldValue[]>;
|
|
1145
1171
|
deleteValue: (repo: string, number: number, fieldId: number) => Promise<void>;
|
|
1146
1172
|
};
|
|
1173
|
+
issueTypes: {
|
|
1174
|
+
list: (org: string) => Promise<OrgIssueTypeInfo[]>;
|
|
1175
|
+
create: (org: string, input: IssueTypeInput) => Promise<OrgIssueTypeInfo>;
|
|
1176
|
+
update: (org: string, id: number, input: IssueTypeInput) => Promise<OrgIssueTypeInfo>;
|
|
1177
|
+
};
|
|
1147
1178
|
issues: {
|
|
1148
1179
|
listIssues: (repo: string, params?: IssueSearchParams) => Promise<GitHubIssue[]>;
|
|
1149
1180
|
getIssue: (repo: string, number: number) => Promise<GitHubIssue>;
|
|
@@ -1261,4 +1292,4 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
1261
1292
|
};
|
|
1262
1293
|
/** The client returned by `createGitHubClient()`: one group of methods per GitHub API area. */
|
|
1263
1294
|
export type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
1264
|
-
export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreateHookInput, CreatePagesPayload, CreatePullInput, CreatePullRequestInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubHook, GitHubInstallationWebhookPayload, GitHubIssue, GitHubIssueComment, GitHubIssueField, GitHubIssueFieldOption, GitHubIssueFieldValue, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubRulesetDetail, GitHubUser, GitHubUserWithExpiry, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, GraphQLClient, HookScope, InstallationAccessToken, IssueFieldValueInput, IssueSearchParams, ListDirectoryOptions, OrgProperty, OrgSecretInfo, OrgSecretVisibility, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdateHookInput, UpdatePagesPayload, UpdatePullRequestInput, VariableScope, VariableVisibility, WorkflowRunFilter };
|
|
1295
|
+
export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreateHookInput, CreatePagesPayload, CreatePullInput, CreatePullRequestInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubHook, GitHubInstallationWebhookPayload, GitHubIssue, GitHubIssueComment, GitHubIssueField, GitHubIssueFieldOption, GitHubIssueFieldValue, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubRulesetDetail, GitHubUser, GitHubUserWithExpiry, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, GraphQLClient, HookScope, InstallationAccessToken, IssueFieldValueInput, IssueSearchParams, IssueTypeColor, IssueTypeInput, ListDirectoryOptions, OrgIssueTypeInfo, OrgProperty, OrgSecretInfo, OrgSecretVisibility, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdateHookInput, UpdatePagesPayload, UpdatePullRequestInput, VariableScope, VariableVisibility, WorkflowRunFilter };
|
package/dist/index.mjs
CHANGED
|
@@ -349,6 +349,28 @@ function issueFields(rest) {
|
|
|
349
349
|
})
|
|
350
350
|
};
|
|
351
351
|
}
|
|
352
|
+
// src/issue-types/issue-types.ts
|
|
353
|
+
/**
|
|
354
|
+
* The organization's issue Types (REST, `Issue types`). Deliberately has no `delete`: the CLI never removes a Type,
|
|
355
|
+
* and a method that is not here cannot be called by mistake. The token needs the organization permission Issue types
|
|
356
|
+
* (read to list, write to create or update) and, to write, an organization administrator.
|
|
357
|
+
*/
|
|
358
|
+
function issueTypes(rest) {
|
|
359
|
+
return {
|
|
360
|
+
/** The Types the organization has. */
|
|
361
|
+
list: (org) => rest.request(`/orgs/${segment(org)}/issue-types`),
|
|
362
|
+
/** Makes a Type. */
|
|
363
|
+
create: (org, input) => rest.request(`/orgs/${segment(org)}/issue-types`, {
|
|
364
|
+
method: "POST",
|
|
365
|
+
body: input
|
|
366
|
+
}),
|
|
367
|
+
/** Replaces a Type: send back the name and `is_enabled` it already has, or they change. */
|
|
368
|
+
update: (org, id, input) => rest.request(`/orgs/${segment(org)}/issue-types/${id}`, {
|
|
369
|
+
method: "PUT",
|
|
370
|
+
body: input
|
|
371
|
+
})
|
|
372
|
+
};
|
|
373
|
+
}
|
|
352
374
|
// src/issues/issues.ts
|
|
353
375
|
function issues(rest) {
|
|
354
376
|
return {
|
|
@@ -1220,6 +1242,7 @@ function createGitHubClient(opts) {
|
|
|
1220
1242
|
graphql,
|
|
1221
1243
|
hooks: hooks(rest),
|
|
1222
1244
|
issueFields: issueFields(rest),
|
|
1245
|
+
issueTypes: issueTypes(rest),
|
|
1223
1246
|
issues: issues(rest),
|
|
1224
1247
|
labels: labels(rest),
|
|
1225
1248
|
pages: pages(rest),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@theholocron/github-client",
|
|
3
|
-
"version": "1.58.0-alpha.
|
|
3
|
+
"version": "1.58.0-alpha.52",
|
|
4
4
|
"description": "A TypeScript client for the GitHub REST API",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"github",
|
|
@@ -32,8 +32,8 @@
|
|
|
32
32
|
"dist"
|
|
33
33
|
],
|
|
34
34
|
"dependencies": {
|
|
35
|
-
"@theholocron/observability": "^0.7.0-alpha.
|
|
36
|
-
"@theholocron/http-client": "^1.58.0-alpha.
|
|
35
|
+
"@theholocron/observability": "^0.7.0-alpha.6",
|
|
36
|
+
"@theholocron/http-client": "^1.58.0-alpha.52"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|
|
@@ -43,12 +43,12 @@
|
|
|
43
43
|
"eslint-plugin-n": "^18.5.0",
|
|
44
44
|
"globals": "^17.14.0",
|
|
45
45
|
"tsdown": "^0.23.7",
|
|
46
|
-
"typescript": "^
|
|
46
|
+
"typescript": "^6.0.3",
|
|
47
47
|
"vitest": "^5.1.0",
|
|
48
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.
|
|
49
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.
|
|
50
|
-
"@theholocron/vitest-config": "^8.9.0-alpha.
|
|
51
|
-
"@theholocron/tsdown-config": "^8.9.0-alpha.
|
|
48
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.22",
|
|
49
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.22",
|
|
50
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.22",
|
|
51
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.22"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|