@theholocron/github-client 1.58.0-alpha.14 → 1.58.0-alpha.15
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 +7 -0
- package/dist/index.mjs +13 -0
- package/package.json +3 -3
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 {
|
|
@@ -1001,6 +1007,7 @@ export declare function createGitHubClient(opts: GitHubClientOptions): {
|
|
|
1001
1007
|
properties: {
|
|
1002
1008
|
getValues: (repo: string) => Promise<RepoPropertyValue[]>;
|
|
1003
1009
|
orgSchema: (org: string) => Promise<OrgProperty[]>;
|
|
1010
|
+
setOrgProperty: (org: string, property: OrgProperty) => Promise<OrgProperty>;
|
|
1004
1011
|
setProperties: (repo: string, values: Record<string, string | string[]>) => Promise<void>;
|
|
1005
1012
|
};
|
|
1006
1013
|
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.
|
|
3
|
+
"version": "1.58.0-alpha.15",
|
|
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.
|
|
35
|
+
"@theholocron/http-client": "^1.58.0-alpha.15",
|
|
36
36
|
"@theholocron/observability": "^0.7.0-alpha.1"
|
|
37
37
|
},
|
|
38
38
|
"devDependencies": {
|
|
@@ -45,9 +45,9 @@
|
|
|
45
45
|
"tsdown": "^0.23.4",
|
|
46
46
|
"typescript": "^5.9.3",
|
|
47
47
|
"vitest": "^5.0.5",
|
|
48
|
+
"@theholocron/tsconfig": "^8.9.0-alpha.9",
|
|
48
49
|
"@theholocron/eslint-config": "^8.9.0-alpha.9",
|
|
49
50
|
"@theholocron/tsdown-config": "^8.9.0-alpha.9",
|
|
50
|
-
"@theholocron/tsconfig": "^8.9.0-alpha.9",
|
|
51
51
|
"@theholocron/vitest-config": "^8.9.0-alpha.9"
|
|
52
52
|
},
|
|
53
53
|
"engines": {
|