@theholocron/github-client 1.58.0-alpha.34 → 1.58.0-alpha.35

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.
Files changed (2) hide show
  1. package/dist/index.mjs +11 -2
  2. package/package.json +5 -5
package/dist/index.mjs CHANGED
@@ -349,6 +349,15 @@ function pages(rest) {
349
349
  };
350
350
  }
351
351
  // src/properties/properties.ts
352
+ /** The keys of an {@link OrgProperty} that GitHub accepts when a definition is written. */
353
+ const WRITABLE_FIELDS = [
354
+ "value_type",
355
+ "required",
356
+ "default_value",
357
+ "description",
358
+ "allowed_values",
359
+ "values_editable_by"
360
+ ];
352
361
  function properties(rest) {
353
362
  return {
354
363
  /** The custom property values set on a repository (read-only). */
@@ -364,8 +373,8 @@ function properties(rest) {
364
373
  * The token needs write access to the organization's custom properties (`Custom properties: admin`).
365
374
  */
366
375
  setOrgProperty: (org, property) => {
367
- const { property_name, ...definition } = property;
368
- const body = Object.fromEntries(Object.entries(definition).filter(([, v]) => v !== void 0));
376
+ const { property_name } = property;
377
+ const body = Object.fromEntries(WRITABLE_FIELDS.map((key) => [key, property[key]]).filter(([, v]) => v !== void 0));
369
378
  return rest.request(`/orgs/${segment(org)}/properties/schema/${segment(property_name)}`, {
370
379
  method: "PUT",
371
380
  body
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.58.0-alpha.34",
3
+ "version": "1.58.0-alpha.35",
4
4
  "description": "A TypeScript client for the GitHub REST API",
5
5
  "keywords": [
6
6
  "github",
@@ -32,7 +32,7 @@
32
32
  "dist"
33
33
  ],
34
34
  "dependencies": {
35
- "@theholocron/http-client": "^1.58.0-alpha.34",
35
+ "@theholocron/http-client": "^1.58.0-alpha.35",
36
36
  "@theholocron/observability": "^0.7.0-alpha.4"
37
37
  },
38
38
  "devDependencies": {
@@ -45,10 +45,10 @@
45
45
  "tsdown": "^0.23.5",
46
46
  "typescript": "^5.9.3",
47
47
  "vitest": "^5.1.0",
48
- "@theholocron/tsconfig": "^8.9.0-alpha.17",
49
- "@theholocron/tsdown-config": "^8.9.0-alpha.17",
50
48
  "@theholocron/eslint-config": "^8.9.0-alpha.17",
51
- "@theholocron/vitest-config": "^8.9.0-alpha.17"
49
+ "@theholocron/vitest-config": "^8.9.0-alpha.17",
50
+ "@theholocron/tsdown-config": "^8.9.0-alpha.17",
51
+ "@theholocron/tsconfig": "^8.9.0-alpha.17"
52
52
  },
53
53
  "engines": {
54
54
  "node": ">=22.0.0"