@theholocron/github-client 1.58.0-alpha.35 → 1.58.0-alpha.37
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 +49 -1
- package/dist/index.mjs +23 -0
- package/package.json +8 -8
package/dist/index.d.mts
CHANGED
|
@@ -292,6 +292,48 @@ interface CreatePullInput {
|
|
|
292
292
|
/** The pull request's description. */
|
|
293
293
|
body?: string;
|
|
294
294
|
}
|
|
295
|
+
/** One option of a single-select issue field. */
|
|
296
|
+
interface GitHubIssueFieldOption {
|
|
297
|
+
/** The option's id. */
|
|
298
|
+
id: number;
|
|
299
|
+
/** The option's name, which is how a value is set. */
|
|
300
|
+
name: string;
|
|
301
|
+
}
|
|
302
|
+
/** An issue field an organization defines (Priority, Effort, Start date and so on). */
|
|
303
|
+
interface GitHubIssueField {
|
|
304
|
+
/** The field's id, which is how a value is set. */
|
|
305
|
+
id: number;
|
|
306
|
+
/** The field's name. */
|
|
307
|
+
name: string;
|
|
308
|
+
/** `single_select`, `text`, `number` or `date`. */
|
|
309
|
+
data_type: string;
|
|
310
|
+
/** The options of a single-select field. */
|
|
311
|
+
options?: GitHubIssueFieldOption[];
|
|
312
|
+
}
|
|
313
|
+
/** The value an issue has for one field. */
|
|
314
|
+
interface GitHubIssueFieldValue {
|
|
315
|
+
/** The id of the field. */
|
|
316
|
+
issue_field_id: number;
|
|
317
|
+
/** The name of the field, when GitHub gives it. */
|
|
318
|
+
issue_field_name?: string;
|
|
319
|
+
/** The field's type. */
|
|
320
|
+
data_type: string;
|
|
321
|
+
/** The value; for a single-select field read the option from `single_select_option`. */
|
|
322
|
+
value: string | number;
|
|
323
|
+
/** The selected option of a single-select field, or `null`. */
|
|
324
|
+
single_select_option?: {
|
|
325
|
+
id: number;
|
|
326
|
+
name: string;
|
|
327
|
+
color: string;
|
|
328
|
+
} | null;
|
|
329
|
+
}
|
|
330
|
+
/** One value to set: a field's id and, for a single-select field, the option's name. */
|
|
331
|
+
interface IssueFieldValueInput {
|
|
332
|
+
/** The field's id. */
|
|
333
|
+
field_id: number;
|
|
334
|
+
/** The option's name, text, number or date. */
|
|
335
|
+
value: string | number;
|
|
336
|
+
}
|
|
295
337
|
/** An issue as GitHub returns it, with only the fields this client reads. */
|
|
296
338
|
interface GitHubIssue {
|
|
297
339
|
/** The issue's numeric id. */
|
|
@@ -1013,6 +1055,12 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
1013
1055
|
};
|
|
1014
1056
|
/** The GraphQL client, for the callers whose API (Projects v2) has no REST form. */
|
|
1015
1057
|
graphql: GraphQLClient;
|
|
1058
|
+
issueFields: {
|
|
1059
|
+
list: (org: string) => Promise<GitHubIssueField[]>;
|
|
1060
|
+
values: (repo: string, number: number) => Promise<GitHubIssueFieldValue[]>;
|
|
1061
|
+
addValues: (repo: string, number: number, values: IssueFieldValueInput[]) => Promise<GitHubIssueFieldValue[]>;
|
|
1062
|
+
deleteValue: (repo: string, number: number, fieldId: number) => Promise<void>;
|
|
1063
|
+
};
|
|
1016
1064
|
issues: {
|
|
1017
1065
|
listIssues: (repo: string, params?: IssueSearchParams) => Promise<GitHubIssue[]>;
|
|
1018
1066
|
getIssue: (repo: string, number: number) => Promise<GitHubIssue>;
|
|
@@ -1120,4 +1168,4 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
1120
1168
|
};
|
|
1121
1169
|
/** The client returned by `createGitHubClient()`: one group of methods per GitHub API area. */
|
|
1122
1170
|
export type GitHubClient = ReturnType<typeof createGitHubClient>;
|
|
1123
|
-
export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubInstallationWebhookPayload, GitHubIssue, GitHubIssueComment, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubRulesetDetail, GitHubUser, GitHubUserWithExpiry, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, GraphQLClient, InstallationAccessToken, IssueSearchParams, ListDirectoryOptions, OrgProperty, OrgSecretInfo, OrgSecretVisibility, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
|
|
1171
|
+
export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitDirectoryEntry, GitHubApp, GitHubAppAccount, GitHubAppCredentials, GitHubAppInstallation, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, 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, InstallationAccessToken, IssueFieldValueInput, IssueSearchParams, ListDirectoryOptions, OrgProperty, OrgSecretInfo, OrgSecretVisibility, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, RepoPropertyValue, RepoTeam, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
|
package/dist/index.mjs
CHANGED
|
@@ -248,6 +248,28 @@ function git(rest) {
|
|
|
248
248
|
})
|
|
249
249
|
};
|
|
250
250
|
}
|
|
251
|
+
// src/issue-fields/issue-fields.ts
|
|
252
|
+
function issueFields(rest) {
|
|
253
|
+
return {
|
|
254
|
+
/** The issue fields an organization defines (read-only). */
|
|
255
|
+
list: (org) => rest.request(`/orgs/${segment(org)}/issue-fields`),
|
|
256
|
+
/** The values an issue has for the organization's issue fields (read-only). */
|
|
257
|
+
values: (repo, number) => rest.request(`${repoBase(repo)}/issues/${number}/issue-field-values`),
|
|
258
|
+
/**
|
|
259
|
+
* Adds values to an issue without touching the others it has. The caller needs push access to the repository.
|
|
260
|
+
* (GitHub's `PUT` on the same path replaces every value of the issue, so this client never uses it.)
|
|
261
|
+
*/
|
|
262
|
+
addValues: (repo, number, values) => rest.request(`${repoBase(repo)}/issues/${number}/issue-field-values`, {
|
|
263
|
+
method: "POST",
|
|
264
|
+
body: { issue_field_values: values }
|
|
265
|
+
}),
|
|
266
|
+
/** Removes an issue's value for one field. */
|
|
267
|
+
deleteValue: (repo, number, fieldId) => rest.request(`${repoBase(repo)}/issues/${number}/issue-field-values/${fieldId}`, {
|
|
268
|
+
method: "DELETE",
|
|
269
|
+
expectNoContent: true
|
|
270
|
+
})
|
|
271
|
+
};
|
|
272
|
+
}
|
|
251
273
|
// src/issues/issues.ts
|
|
252
274
|
function issues(rest) {
|
|
253
275
|
return {
|
|
@@ -1056,6 +1078,7 @@ function createGitHubClient(opts) {
|
|
|
1056
1078
|
git: git(rest),
|
|
1057
1079
|
/** The GraphQL client, for the callers whose API (Projects v2) has no REST form. */
|
|
1058
1080
|
graphql,
|
|
1081
|
+
issueFields: issueFields(rest),
|
|
1059
1082
|
issues: issues(rest),
|
|
1060
1083
|
labels: labels(rest),
|
|
1061
1084
|
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.37",
|
|
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/
|
|
36
|
-
"@theholocron/
|
|
35
|
+
"@theholocron/observability": "^0.7.0-alpha.4",
|
|
36
|
+
"@theholocron/http-client": "^1.58.0-alpha.37"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
39
39
|
"@types/node": "^26",
|
|
@@ -42,13 +42,13 @@
|
|
|
42
42
|
"eslint": "^10.14.0",
|
|
43
43
|
"eslint-plugin-n": "^18.5.0",
|
|
44
44
|
"globals": "^17.14.0",
|
|
45
|
-
"tsdown": "^0.23.
|
|
45
|
+
"tsdown": "^0.23.7",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.1.0",
|
|
48
|
-
"@theholocron/eslint-config": "^8.9.0-alpha.
|
|
49
|
-
"@theholocron/
|
|
50
|
-
"@theholocron/
|
|
51
|
-
"@theholocron/
|
|
48
|
+
"@theholocron/eslint-config": "^8.9.0-alpha.18",
|
|
49
|
+
"@theholocron/tsdown-config": "^8.9.0-alpha.18",
|
|
50
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.18",
|
|
51
|
+
"@theholocron/vitest-config": "^8.9.0-alpha.18"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|
|
54
54
|
"node": ">=22.0.0"
|