@theholocron/github-client 1.57.1-alpha.1 → 1.57.1-alpha.2

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 CHANGED
@@ -226,6 +226,15 @@ interface UpdatePagesPayload {
226
226
  cname?: string | null;
227
227
  https_enforced?: boolean;
228
228
  }
229
+ /** One custom property of an organization, as its schema defines it. */
230
+ interface OrgProperty {
231
+ property_name: string;
232
+ /** `string`, `single_select`, `multi_select`, `true_false` or `url`. */
233
+ value_type: string;
234
+ required?: boolean;
235
+ /** The values a `single_select` or `multi_select` property accepts; `null` for any other type. */
236
+ allowed_values?: string[] | null;
237
+ }
229
238
  interface GitHubPullRequest {
230
239
  number: number;
231
240
  title: string;
@@ -561,6 +570,7 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
561
570
  updatePages: (repo: string, payload: UpdatePagesPayload) => Promise<void>;
562
571
  };
563
572
  properties: {
573
+ orgSchema: (org: string) => Promise<OrgProperty[]>;
564
574
  setProperties: (repo: string, values: Record<string, string | string[]>) => Promise<void>;
565
575
  };
566
576
  pulls: {
@@ -620,4 +630,4 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
620
630
  };
621
631
  };
622
632
  export type GitHubClient = ReturnType<typeof createGitHubClient>;
623
- export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitHubAppCredentials, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubInstallationWebhookPayload, GitHubIssue, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubUser, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, InstallationAccessToken, IssueSearchParams, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
633
+ export type { CheckRunAnnotation, CheckRunAnnotationLevel, CheckRunConclusion, CheckRunOutput, CheckRunStatus, CodeScanningSetupResult, CreateCheckRunInput, CreatePagesPayload, CreatePullInput, CreateReviewComment, CreateReviewInput, GitBlob, GitCommit, GitContents, GitHubAppCredentials, GitHubCheckRun, GitHubClientOptions, GitHubContents, GitHubEnvironment, GitHubInstallationWebhookPayload, GitHubIssue, GitHubLabel, GitHubMilestone, GitHubPages, GitHubPublicKey, GitHubPullRequest, GitHubPullRequestCommit, GitHubPullRequestFile, GitHubPullRequestReview, GitHubPullRequestWebhookPayload, GitHubPushWebhookPayload, GitHubRepo, GitHubRuleset, GitHubUser, GitHubVariable, GitHubWebhookHeaders, GitHubWorkflowRun, GitPull, GitRef, GitTree, GitTreeItem, InstallationAccessToken, IssueSearchParams, OrgProperty, PagesBuildStatus, PagesBuildType, PutContentsInput, PutContentsResult, ReviewThread, SecretScope, TeamMember, TeamPermission, UpdateCheckRunInput, UpdatePagesPayload, VariableScope, VariableVisibility, WorkflowRunFilter };
package/dist/index.mjs CHANGED
@@ -275,25 +275,31 @@ function pages(rest) {
275
275
  }
276
276
  // src/properties/properties.ts
277
277
  function properties(rest) {
278
- return {
279
- /**
280
- * `value` is a plain string for `string`/`single_select`/`true_false`
281
- * custom properties, or a string array for `multi_select` ones —
282
- * GitHub's own PATCH body accepts either per property. A single-string
283
- * comma-joined value has no length ceiling GitHub documents, but real
284
- * usage hits one in practice (a `string`-type property with enough
285
- * joined values 422s as "too long"); `multi_select` has none.
286
- */
287
- setProperties: (repo, values) => {
288
- const propertyList = Object.entries(values).map(([property_name, value]) => ({
289
- property_name,
290
- value
291
- }));
292
- return rest.request(`${repoBase(repo)}/properties/values`, {
293
- method: "PATCH",
294
- body: { properties: propertyList }
295
- });
296
- } };
278
+ return {
279
+ /**
280
+ * The custom properties an organization defines, with their types and allowed values (read-only).
281
+ * The token needs read access to the organization's custom properties.
282
+ */
283
+ orgSchema: (org) => rest.request(`/orgs/${segment(org)}/properties/schema`),
284
+ /**
285
+ * `value` is a plain string for `string`/`single_select`/`true_false`
286
+ * custom properties, or a string array for `multi_select` ones —
287
+ * GitHub's own PATCH body accepts either per property. A single-string
288
+ * comma-joined value has no length ceiling GitHub documents, but real
289
+ * usage hits one in practice (a `string`-type property with enough
290
+ * joined values 422s as "too long"); `multi_select` has none.
291
+ */
292
+ setProperties: (repo, values) => {
293
+ const propertyList = Object.entries(values).map(([property_name, value]) => ({
294
+ property_name,
295
+ value
296
+ }));
297
+ return rest.request(`${repoBase(repo)}/properties/values`, {
298
+ method: "PATCH",
299
+ body: { properties: propertyList }
300
+ });
301
+ }
302
+ };
297
303
  }
298
304
  // src/pulls/pulls.ts
299
305
  const LIST_REVIEW_THREADS_QUERY = `
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.57.1-alpha.1",
3
+ "version": "1.57.1-alpha.2",
4
4
  "description": "A TypeScript client for the GitHub REST API",
5
5
  "keywords": [
6
6
  "github",
@@ -32,14 +32,10 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/observability": "^0.6.0",
36
- "@theholocron/http-client": "^1.57.1-alpha.1"
35
+ "@theholocron/http-client": "^1.57.1-alpha.2",
36
+ "@theholocron/observability": "^0.6.1-alpha.1"
37
37
  },
38
38
  "devDependencies": {
39
- "@theholocron/eslint-config": "^8.8.2",
40
- "@theholocron/tsconfig": "^8.8.2",
41
- "@theholocron/tsdown-config": "^8.8.2",
42
- "@theholocron/vitest-config": "^8.8.2",
43
39
  "@types/node": "^26",
44
40
  "@vitest/coverage-v8": "^5.0.5",
45
41
  "@vitest/eslint-plugin": "^1.6.27",
@@ -48,7 +44,11 @@
48
44
  "globals": "^17.11.0",
49
45
  "tsdown": "^0.23.3",
50
46
  "typescript": "^5.9.3",
51
- "vitest": "^5.0.5"
47
+ "vitest": "^5.0.5",
48
+ "@theholocron/tsconfig": "^8.9.0-alpha.3",
49
+ "@theholocron/eslint-config": "^8.9.0-alpha.3",
50
+ "@theholocron/tsdown-config": "^8.9.0-alpha.3",
51
+ "@theholocron/vitest-config": "^8.9.0-alpha.3"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"