@theholocron/github-client 1.58.0-alpha.14 → 1.58.0-alpha.16

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
@@ -412,6 +412,12 @@ interface OrgProperty {
412
412
  required?: boolean;
413
413
  /** The values a `single_select` or `multi_select` property accepts; `null` for any other type. */
414
414
  allowed_values?: string[] | null;
415
+ /** The value a repository gets when it sets none, or `null`. */
416
+ default_value?: string | string[] | null;
417
+ /** A line saying what the property is for, or `null`. */
418
+ description?: string | null;
419
+ /** Who may edit the property's value on a repository: `org_actors` or `org_and_repo_actors`, or `null`. */
420
+ values_editable_by?: string | null;
415
421
  }
416
422
  /** One custom property value set on a repository. */
417
423
  interface RepoPropertyValue {
@@ -426,6 +432,8 @@ interface GitHubPullRequest {
426
432
  number: number;
427
433
  /** The pull request's title. */
428
434
  title: string;
435
+ /** The pull request's description, as written (markdown); `null` when it has none. */
436
+ body?: string | null;
429
437
  /** Whether the pull request is open or closed. */
430
438
  state: "open" | "closed";
431
439
  /** When the pull request was merged as an ISO 8601 timestamp, or `null` if it was not merged. */
@@ -1001,6 +1009,7 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
1001
1009
  properties: {
1002
1010
  getValues: (repo: string) => Promise<RepoPropertyValue[]>;
1003
1011
  orgSchema: (org: string) => Promise<OrgProperty[]>;
1012
+ setOrgProperty: (org: string, property: OrgProperty) => Promise<OrgProperty>;
1004
1013
  setProperties: (repo: string, values: Record<string, string | string[]>) => Promise<void>;
1005
1014
  };
1006
1015
  pulls: {
package/dist/index.mjs CHANGED
@@ -345,6 +345,19 @@ function properties(rest) {
345
345
  */
346
346
  orgSchema: (org) => rest.request(`/orgs/${segment(org)}/properties/schema`),
347
347
  /**
348
+ * Creates or replaces one custom property definition of the organization. GitHub replaces the whole definition,
349
+ * so send back every field the property already has (`orgSchema` has them); a field left out is reset.
350
+ * The token needs write access to the organization's custom properties (`Custom properties: admin`).
351
+ */
352
+ setOrgProperty: (org, property) => {
353
+ const { property_name, ...definition } = property;
354
+ const body = Object.fromEntries(Object.entries(definition).filter(([, v]) => v !== void 0));
355
+ return rest.request(`/orgs/${segment(org)}/properties/schema/${segment(property_name)}`, {
356
+ method: "PUT",
357
+ body
358
+ });
359
+ },
360
+ /**
348
361
  * `value` is a plain string for `string`/`single_select`/`true_false`
349
362
  * custom properties, or a string array for `multi_select` ones —
350
363
  * GitHub's own PATCH body accepts either per property. A single-string
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.58.0-alpha.14",
3
+ "version": "1.58.0-alpha.16",
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/http-client": "^1.58.0-alpha.14",
36
- "@theholocron/observability": "^0.7.0-alpha.1"
35
+ "@theholocron/http-client": "^1.58.0-alpha.16",
36
+ "@theholocron/observability": "^0.7.0-alpha.2"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@types/node": "^26",
@@ -45,10 +45,10 @@
45
45
  "tsdown": "^0.23.4",
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^5.0.5",
48
- "@theholocron/eslint-config": "^8.9.0-alpha.9",
49
- "@theholocron/tsdown-config": "^8.9.0-alpha.9",
50
- "@theholocron/tsconfig": "^8.9.0-alpha.9",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.9"
48
+ "@theholocron/tsconfig": "^8.9.0-alpha.11",
49
+ "@theholocron/eslint-config": "^8.9.0-alpha.11",
50
+ "@theholocron/vitest-config": "^8.9.0-alpha.11",
51
+ "@theholocron/tsdown-config": "^8.9.0-alpha.11"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"