@osdlc/typed-gh 0.5.0 → 0.6.0
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/CHANGELOG.md +24 -0
- package/README.md +168 -36
- package/async.ts +131 -37
- package/dist/async.d.ts +43 -15
- package/dist/async.d.ts.map +1 -1
- package/dist/async.js +92 -30
- package/dist/index.d.ts +5 -5
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +2 -2
- package/dist/parse.d.ts +5 -1
- package/dist/parse.d.ts.map +1 -1
- package/dist/parse.js +48 -0
- package/dist/repo.d.ts +42 -10
- package/dist/repo.d.ts.map +1 -1
- package/dist/repo.js +76 -12
- package/dist/sync.d.ts +64 -12
- package/dist/sync.d.ts.map +1 -1
- package/dist/sync.js +107 -29
- package/dist/types.d.ts +37 -0
- package/dist/types.d.ts.map +1 -1
- package/dist/verbs.d.ts +194 -41
- package/dist/verbs.d.ts.map +1 -1
- package/dist/verbs.js +482 -83
- package/index.ts +26 -3
- package/package.json +3 -3
- package/parse.ts +50 -0
- package/repo.ts +87 -13
- package/sync.ts +146 -34
- package/types.ts +40 -0
- package/verbs.ts +606 -81
package/dist/repo.js
CHANGED
|
@@ -26,24 +26,88 @@ export function ownerRepoSlug(r) {
|
|
|
26
26
|
return `${r.owner}/${r.repo}`;
|
|
27
27
|
}
|
|
28
28
|
/**
|
|
29
|
-
* The `{owner, repo, number}` a GitHub pull-request URL names, or
|
|
30
|
-
* `url` is not one.
|
|
29
|
+
* The `{hostname, owner, repo, number}` a GitHub pull-request URL names, or
|
|
30
|
+
* null when `url` is not one.
|
|
31
31
|
*
|
|
32
|
-
* Accepts `https
|
|
33
|
-
*
|
|
34
|
-
*
|
|
35
|
-
*
|
|
32
|
+
* Accepts `https://<host>/<owner>/<repo>/pull/<n>` with or without a scheme,
|
|
33
|
+
* a trailing slash, a sub-page (`/files`, `/commits`), a query string or a
|
|
34
|
+
* fragment — every shape a browser's address bar hands over. The host is
|
|
35
|
+
* `github.com` (a `www.` prefix is dropped) or a GitHub Enterprise host such
|
|
36
|
+
* as `github.acme.com` or `acme.ghe.com`; without a scheme the host must
|
|
37
|
+
* contain a dot. `parseGitUrl` is the wrong tool here: it reads `/pull/<n>`
|
|
36
38
|
* as part of the project path.
|
|
37
|
-
*
|
|
38
|
-
* GitHub.com only. A GitHub Enterprise host is a different coordinate space
|
|
39
|
-
* (the `gh` CLI needs `--hostname`), so it is not silently accepted.
|
|
40
39
|
*/
|
|
41
40
|
export function parsePrUrl(url) {
|
|
42
|
-
const m = /^(?:https
|
|
41
|
+
const m = /^(?:(https?:)\/\/)?([a-z0-9](?:[a-z0-9.-]*[a-z0-9])?(?::\d+)?)\/([^/\s]+)\/([^/\s]+)\/pull\/(\d+)(?:[/?#].*)?$/i.exec(url.trim());
|
|
43
42
|
if (m === null)
|
|
44
43
|
return null;
|
|
45
|
-
const
|
|
44
|
+
const host = m[2].toLowerCase();
|
|
45
|
+
if (m[1] === undefined && !host.includes('.'))
|
|
46
|
+
return null;
|
|
47
|
+
const number = Number(m[5]);
|
|
46
48
|
if (!Number.isSafeInteger(number) || number <= 0)
|
|
47
49
|
return null;
|
|
48
|
-
return {
|
|
50
|
+
return {
|
|
51
|
+
hostname: host === 'www.github.com' ? 'github.com' : host,
|
|
52
|
+
owner: m[3],
|
|
53
|
+
repo: m[4].replace(/\.git$/, ''),
|
|
54
|
+
number,
|
|
55
|
+
};
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Read what a person typed to name a pull request: a number, `#42`,
|
|
59
|
+
* `owner/name#42`, a URL, or a branch name. Null when it is none of these.
|
|
60
|
+
*
|
|
61
|
+
* Pure: it starts no process. Digits are read as a number first, the way
|
|
62
|
+
* `gh pr view 42` reads them; `orBranch` keeps the branch reading. The
|
|
63
|
+
* clients' `prFind` tries both.
|
|
64
|
+
*/
|
|
65
|
+
export function parsePrRef(input) {
|
|
66
|
+
const text = input.trim();
|
|
67
|
+
const digits = /^(#?)(\d+)$/.exec(text);
|
|
68
|
+
if (digits !== null) {
|
|
69
|
+
const number = Number(digits[2]);
|
|
70
|
+
if (Number.isSafeInteger(number) && number > 0) {
|
|
71
|
+
return { kind: 'number', number, repo: null, orBranch: digits[1] === '' ? text : null };
|
|
72
|
+
}
|
|
73
|
+
}
|
|
74
|
+
const qualified = /^([^/\s#]+)\/([^/\s#]+)#(\d+)$/.exec(text);
|
|
75
|
+
if (qualified !== null) {
|
|
76
|
+
const number = Number(qualified[3]);
|
|
77
|
+
if (!Number.isSafeInteger(number) || number <= 0)
|
|
78
|
+
return null;
|
|
79
|
+
if (!isRepoSlug(`${qualified[1]}/${qualified[2]}`))
|
|
80
|
+
return null;
|
|
81
|
+
return {
|
|
82
|
+
kind: 'number',
|
|
83
|
+
number,
|
|
84
|
+
repo: { owner: qualified[1], repo: qualified[2] },
|
|
85
|
+
orBranch: null,
|
|
86
|
+
};
|
|
87
|
+
}
|
|
88
|
+
const url = parsePrUrl(text);
|
|
89
|
+
if (url !== null)
|
|
90
|
+
return { kind: 'url', url: text, ...url };
|
|
91
|
+
return isBranchName(text) ? { kind: 'branch', name: text } : null;
|
|
92
|
+
}
|
|
93
|
+
/** True for `owner/name` as GitHub spells it. */
|
|
94
|
+
export function isRepoSlug(text) {
|
|
95
|
+
return /^[A-Za-z0-9][A-Za-z0-9_.-]*\/[A-Za-z0-9_.][A-Za-z0-9_.-]*$/.test(text);
|
|
96
|
+
}
|
|
97
|
+
/**
|
|
98
|
+
* True when `name` is a branch name git would accept (`git check-ref-format
|
|
99
|
+
* --branch`), and does not start with `-`, so it cannot read as a flag.
|
|
100
|
+
*/
|
|
101
|
+
function isBranchName(name) {
|
|
102
|
+
if (name === '' || name === '@' || name.startsWith('-') || name.startsWith('/'))
|
|
103
|
+
return false;
|
|
104
|
+
if (name.endsWith('/') || name.endsWith('.'))
|
|
105
|
+
return false;
|
|
106
|
+
// Control characters, space, and the characters git reserves.
|
|
107
|
+
// oxlint-disable-next-line no-control-regex
|
|
108
|
+
if (/[\x00-\x20\x7f~^:?*[\\]/.test(name))
|
|
109
|
+
return false;
|
|
110
|
+
if (name.includes('..') || name.includes('@{') || name.includes('//'))
|
|
111
|
+
return false;
|
|
112
|
+
return name.split('/').every((part) => !part.startsWith('.') && !part.endsWith('.lock'));
|
|
49
113
|
}
|
package/dist/sync.d.ts
CHANGED
|
@@ -13,8 +13,8 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { type CommandResult, type CommandRunner } from '@osdlc/command-seam';
|
|
15
15
|
import * as v from './verbs.ts';
|
|
16
|
-
import type { ApiOptions, ApiResponse, AuthStatus, IssueListOptions, PrListOptions } from './verbs.ts';
|
|
17
|
-
import type { IssueRow, Label, OwnerRepo, PullRequest } from './types.ts';
|
|
16
|
+
import type { ApiOptions, ApiResponse, AuthStatus, GhTarget, IssueListOptions, ListResult, PrListOptions } from './verbs.ts';
|
|
17
|
+
import type { IssueRow, Label, OwnerRepo, PrSearchHit, PullRequest, Repository } from './types.ts';
|
|
18
18
|
/**
|
|
19
19
|
* Factory of per-binary runners — the injectable subprocess seam a CLI tail
|
|
20
20
|
* threads through its call graph. Production uses `spawnRunner`; tests supply
|
|
@@ -23,8 +23,19 @@ import type { IssueRow, Label, OwnerRepo, PullRequest } from './types.ts';
|
|
|
23
23
|
export type RunnerFactory = (binary: string) => CommandRunner;
|
|
24
24
|
/** Default factory: real, spawnSync-backed runners. */
|
|
25
25
|
export declare const defaultRunnerFactory: RunnerFactory;
|
|
26
|
+
/** What a client is built with: the runner, and the repository and host it talks to. */
|
|
27
|
+
export interface GhOptions extends GhTarget {
|
|
28
|
+
runner?: CommandRunner | undefined;
|
|
29
|
+
}
|
|
26
30
|
/**
|
|
27
|
-
* A typed gh client bound to one working directory
|
|
31
|
+
* A typed gh client bound to one working directory, and optionally to one
|
|
32
|
+
* repository and host.
|
|
33
|
+
*
|
|
34
|
+
* With `repo`, every call names that repository (`--repo`, or the
|
|
35
|
+
* `{owner}/{repo}` of an `api` endpoint), so no clone is needed. Without it,
|
|
36
|
+
* gh uses the repository of the clone at `cwd`. With `hostname`, every call
|
|
37
|
+
* goes to that GitHub host. An invalid `repo` or `hostname` throws
|
|
38
|
+
* `RangeError`.
|
|
28
39
|
*
|
|
29
40
|
* Every `timeoutMs` option is a hard cap on the call. An invalid value
|
|
30
41
|
* throws, as in command-seam: `RangeError` for 0, a negative value or `NaN`;
|
|
@@ -32,12 +43,15 @@ export declare const defaultRunnerFactory: RunnerFactory;
|
|
|
32
43
|
*/
|
|
33
44
|
export declare class Gh {
|
|
34
45
|
readonly cwd: string;
|
|
46
|
+
readonly repo: string | undefined;
|
|
47
|
+
readonly hostname: string | undefined;
|
|
48
|
+
private readonly target;
|
|
35
49
|
private readonly runner;
|
|
36
|
-
constructor(cwd: string, opts?:
|
|
37
|
-
|
|
38
|
-
});
|
|
39
|
-
/** The same client rooted at a different directory (same runner). */
|
|
50
|
+
constructor(cwd: string, opts?: GhOptions);
|
|
51
|
+
/** The same client rooted at a different directory (same runner, repo and host). */
|
|
40
52
|
at(cwd: string): Gh;
|
|
53
|
+
/** The same client aimed at another repository (same runner, directory and host). */
|
|
54
|
+
withRepo(repo: string): Gh;
|
|
41
55
|
/** Unchecked passthrough for verbs not yet lifted into the API. */
|
|
42
56
|
raw(argv: string[], opts?: {
|
|
43
57
|
timeoutMs?: number | undefined;
|
|
@@ -51,9 +65,25 @@ export declare class Gh {
|
|
|
51
65
|
/** Pull requests matching `opts`, or null when gh failed. */
|
|
52
66
|
prList(opts?: PrListOptions & {
|
|
53
67
|
timeoutMs?: number | undefined;
|
|
54
|
-
}): PullRequest
|
|
55
|
-
/**
|
|
56
|
-
|
|
68
|
+
}): ListResult<PullRequest> | null;
|
|
69
|
+
/**
|
|
70
|
+
* One PR by number, branch or URL, with the heavy fields; null when gh
|
|
71
|
+
* failed or there is no such PR.
|
|
72
|
+
*/
|
|
73
|
+
prView(ref: number | string, opts?: {
|
|
74
|
+
fields?: readonly string[] | undefined;
|
|
75
|
+
timeoutMs?: number | undefined;
|
|
76
|
+
}): PullRequest | null;
|
|
77
|
+
/**
|
|
78
|
+
* The one PR that `input` names, or null: what a person typed, such as `42`,
|
|
79
|
+
* `#42`, `owner/name#42`, a URL or a branch (read by `parsePrRef`).
|
|
80
|
+
*
|
|
81
|
+
* Digits are a PR number first; when no such PR comes back, they are tried
|
|
82
|
+
* as a branch. A branch gives its open PR, or else its newest closed or
|
|
83
|
+
* merged one, so a tool run after the merge still finds it. Fields default
|
|
84
|
+
* to {@link PR_LIST_FIELDS}.
|
|
85
|
+
*/
|
|
86
|
+
prFind(input: string, opts?: {
|
|
57
87
|
fields?: readonly string[] | undefined;
|
|
58
88
|
timeoutMs?: number | undefined;
|
|
59
89
|
}): PullRequest | null;
|
|
@@ -100,19 +130,41 @@ export declare class Gh {
|
|
|
100
130
|
api(endpoint: string, opts?: ApiOptions & {
|
|
101
131
|
timeoutMs?: number | undefined;
|
|
102
132
|
}): ApiResponse;
|
|
133
|
+
/**
|
|
134
|
+
* A GraphQL query; each page's `data`, or null on a failed or partial
|
|
135
|
+
* result. See the `graphql` verb.
|
|
136
|
+
*
|
|
137
|
+
* @experimental
|
|
138
|
+
*/
|
|
139
|
+
graphql(query: string, variables?: Record<string, v.GraphqlVariable>, opts?: v.GraphqlOptions & {
|
|
140
|
+
timeoutMs?: number | undefined;
|
|
141
|
+
}): unknown[] | null;
|
|
103
142
|
/** Every label on the repository (up to `opts.limit`, default 1000), or null when gh failed. */
|
|
104
143
|
labelList(opts?: {
|
|
105
144
|
limit?: number | undefined;
|
|
106
145
|
timeoutMs?: number | undefined;
|
|
107
|
-
}): Label
|
|
146
|
+
}): ListResult<Label> | null;
|
|
108
147
|
/** Issues matching `opts` (open by default, up to 200), or null when gh failed. */
|
|
109
148
|
issueList(opts?: IssueListOptions & {
|
|
110
149
|
timeoutMs?: number | undefined;
|
|
111
|
-
}): IssueRow
|
|
150
|
+
}): ListResult<IssueRow> | null;
|
|
112
151
|
/** One issue with its labels, or null when gh failed. */
|
|
113
152
|
issueView(number: number, opts?: {
|
|
114
153
|
timeoutMs?: number | undefined;
|
|
115
154
|
}): IssueRow | null;
|
|
155
|
+
/** An owner's repositories (up to `opts.limit`, default 100), or null when gh failed. */
|
|
156
|
+
repoList(owner: string, opts?: v.RepoListOptions & {
|
|
157
|
+
timeoutMs?: number | undefined;
|
|
158
|
+
}): ListResult<Repository> | null;
|
|
159
|
+
/** One repository: `repo`, else the client's repo, else the clone at `cwd`. Null when gh failed. */
|
|
160
|
+
repoView(repo?: string | undefined, opts?: {
|
|
161
|
+
fields?: readonly string[] | undefined;
|
|
162
|
+
timeoutMs?: number | undefined;
|
|
163
|
+
}): Repository | null;
|
|
164
|
+
/** Pull requests across repositories matching a search query, or null when gh failed. */
|
|
165
|
+
searchPrs(query: string, opts?: v.SearchPrsOptions & {
|
|
166
|
+
timeoutMs?: number | undefined;
|
|
167
|
+
}): ListResult<PrSearchHit> | null;
|
|
116
168
|
/** True iff the `gh` binary is on PATH and runs. */
|
|
117
169
|
installed(): boolean;
|
|
118
170
|
/**
|
package/dist/sync.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,CAAC,MAAM,YAAY,CAAA;AAC/B,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX,UAAU,
|
|
1
|
+
{"version":3,"file":"sync.d.ts","sourceRoot":"","sources":["../sync.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;GAYG;AAEH,OAAO,EAIL,KAAK,aAAa,EAClB,KAAK,aAAa,EAEnB,MAAM,qBAAqB,CAAA;AAE5B,OAAO,KAAK,CAAC,MAAM,YAAY,CAAA;AAC/B,OAAO,KAAK,EACV,UAAU,EACV,WAAW,EACX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E,MAAM,EAAE,KAAK,GAAE,OAAO,GAAG,QAAkB,GAAG,IAAI;IAIzE,4FAA4F;IAC5F,UAAU,CAAC,MAAM,EAAE,MAAM,EAAE,KAAK,EAAE,OAAO,GAAG,IAAI;IAIhD;;;;OAIG;IACH,gBAAgB,CAAC,SAAS,EAAE,MAAM,EAAE,IAAI,EAAE,MAAM,GAAG,IAAI;IAIvD,4EAA4E;IAC5E,OAAO,CAAC,MAAM,EAAE,MAAM,EAAE,IAAI,EAAE;QAAE,MAAM,EAAE,CAAC,CAAC,aAAa,CAAC;QAAC,OAAO,EAAE,MAAM,CAAA;KAAE,GAAG,IAAI;IAIjF,6EAA6E;IAC7E,eAAe,CAAC,MAAM,EAAE,MAAM,GAAG,CAAC,CAAC,YAAY,EAAE,GAAG,IAAI;IAIxD,uFAAuF;IACvF,WAAW,CAAC,IAAI,EAAE,CAAC,CAAC,kBAAkB,GAAG,IAAI;IAI7C,mDAAmD;IACnD,SAAS,CACP,IAAI,EAAE,MAAM,EACZ,IAAI,EAAE;QAAE,KAAK,CAAC,EAAE,MAAM,GAAG,SAAS,CAAC;QAAC,WAAW,CAAC,EAAE,MAAM,GAAG,SAAS,CAAA;KAAE,GACrE,IAAI;IAIP;;;;OAIG;IACH,aAAa,CAAC,MAAM,EAAE,MAAM,EAAE,YAAY,EAAE,MAAM,GAAG,IAAI,EAAE,QAAQ,EAAE,MAAM,GAAG,IAAI;CAGnF"}
|
package/dist/sync.js
CHANGED
|
@@ -13,13 +13,20 @@
|
|
|
13
13
|
*/
|
|
14
14
|
import { runChecked, resolveRunner, spawnRunner, } from '@osdlc/command-seam';
|
|
15
15
|
import * as v from "./verbs.js";
|
|
16
|
-
import { parseOwnerRepo } from "./repo.js";
|
|
16
|
+
import { ownerRepoSlug, parseOwnerRepo, parsePrRef } from "./repo.js";
|
|
17
17
|
/** Default factory: real, spawnSync-backed runners. */
|
|
18
18
|
export const defaultRunnerFactory = spawnRunner;
|
|
19
19
|
/** How long to wait between merge-state retries, in milliseconds. */
|
|
20
20
|
const MERGE_STATE_RETRY_DELAY_MS = 1_500;
|
|
21
21
|
/**
|
|
22
|
-
* A typed gh client bound to one working directory
|
|
22
|
+
* A typed gh client bound to one working directory, and optionally to one
|
|
23
|
+
* repository and host.
|
|
24
|
+
*
|
|
25
|
+
* With `repo`, every call names that repository (`--repo`, or the
|
|
26
|
+
* `{owner}/{repo}` of an `api` endpoint), so no clone is needed. Without it,
|
|
27
|
+
* gh uses the repository of the clone at `cwd`. With `hostname`, every call
|
|
28
|
+
* goes to that GitHub host. An invalid `repo` or `hostname` throws
|
|
29
|
+
* `RangeError`.
|
|
23
30
|
*
|
|
24
31
|
* Every `timeoutMs` option is a hard cap on the call. An invalid value
|
|
25
32
|
* throws, as in command-seam: `RangeError` for 0, a negative value or `NaN`;
|
|
@@ -27,14 +34,25 @@ const MERGE_STATE_RETRY_DELAY_MS = 1_500;
|
|
|
27
34
|
*/
|
|
28
35
|
export class Gh {
|
|
29
36
|
cwd;
|
|
37
|
+
repo;
|
|
38
|
+
hostname;
|
|
39
|
+
target;
|
|
30
40
|
runner;
|
|
31
41
|
constructor(cwd, opts = {}) {
|
|
42
|
+
v.checkTarget(opts);
|
|
32
43
|
this.cwd = cwd;
|
|
44
|
+
this.repo = opts.repo;
|
|
45
|
+
this.hostname = opts.hostname;
|
|
46
|
+
this.target = { repo: opts.repo, hostname: opts.hostname };
|
|
33
47
|
this.runner = resolveRunner('gh', opts.runner);
|
|
34
48
|
}
|
|
35
|
-
/** The same client rooted at a different directory (same runner). */
|
|
49
|
+
/** The same client rooted at a different directory (same runner, repo and host). */
|
|
36
50
|
at(cwd) {
|
|
37
|
-
return new Gh(cwd, { runner: this.runner });
|
|
51
|
+
return new Gh(cwd, { runner: this.runner, repo: this.repo, hostname: this.hostname });
|
|
52
|
+
}
|
|
53
|
+
/** The same client aimed at another repository (same runner, directory and host). */
|
|
54
|
+
withRepo(repo) {
|
|
55
|
+
return new Gh(this.cwd, { runner: this.runner, repo, hostname: this.hostname });
|
|
38
56
|
}
|
|
39
57
|
// ── escape hatches ────────────────────────────────────────────────────────
|
|
40
58
|
/** Unchecked passthrough for verbs not yet lifted into the API. */
|
|
@@ -50,6 +68,8 @@ export class Gh {
|
|
|
50
68
|
const opts = { cwd: this.cwd };
|
|
51
69
|
if (verb.input !== undefined)
|
|
52
70
|
opts.input = verb.input;
|
|
71
|
+
if (verb.env !== undefined)
|
|
72
|
+
opts.env = verb.env;
|
|
53
73
|
if (timeoutMs !== undefined)
|
|
54
74
|
opts.timeoutMs = timeoutMs;
|
|
55
75
|
const result = verb.checked
|
|
@@ -60,11 +80,37 @@ export class Gh {
|
|
|
60
80
|
// ── queries ───────────────────────────────────────────────────────────────
|
|
61
81
|
/** Pull requests matching `opts`, or null when gh failed. */
|
|
62
82
|
prList(opts = {}) {
|
|
63
|
-
return this.exec(v.prList(opts), opts.timeoutMs);
|
|
83
|
+
return this.exec(v.prList(opts, this.target), opts.timeoutMs);
|
|
64
84
|
}
|
|
65
|
-
/**
|
|
66
|
-
|
|
67
|
-
|
|
85
|
+
/**
|
|
86
|
+
* One PR by number, branch or URL, with the heavy fields; null when gh
|
|
87
|
+
* failed or there is no such PR.
|
|
88
|
+
*/
|
|
89
|
+
prView(ref, opts = {}) {
|
|
90
|
+
return this.exec(v.prView(ref, opts.fields ?? v.PR_VIEW_FIELDS, this.target), opts.timeoutMs);
|
|
91
|
+
}
|
|
92
|
+
/**
|
|
93
|
+
* The one PR that `input` names, or null: what a person typed, such as `42`,
|
|
94
|
+
* `#42`, `owner/name#42`, a URL or a branch (read by `parsePrRef`).
|
|
95
|
+
*
|
|
96
|
+
* Digits are a PR number first; when no such PR comes back, they are tried
|
|
97
|
+
* as a branch. A branch gives its open PR, or else its newest closed or
|
|
98
|
+
* merged one, so a tool run after the merge still finds it. Fields default
|
|
99
|
+
* to {@link PR_LIST_FIELDS}.
|
|
100
|
+
*/
|
|
101
|
+
prFind(input, opts = {}) {
|
|
102
|
+
const ref = parsePrRef(input);
|
|
103
|
+
if (ref === null)
|
|
104
|
+
return null;
|
|
105
|
+
const fields = opts.fields ?? v.PR_LIST_FIELDS;
|
|
106
|
+
const call = { fields, timeoutMs: opts.timeoutMs };
|
|
107
|
+
if (ref.kind === 'url')
|
|
108
|
+
return this.prView(ref.url, call);
|
|
109
|
+
if (ref.kind === 'branch')
|
|
110
|
+
return prForBranchOn(this, ref.name, call);
|
|
111
|
+
const client = ref.repo === null ? this : this.withRepo(ownerRepoSlug(ref.repo));
|
|
112
|
+
const pr = client.prView(ref.number, call);
|
|
113
|
+
return pr !== null || ref.orBranch === null ? pr : prForBranchOn(this, ref.orBranch, call);
|
|
68
114
|
}
|
|
69
115
|
/**
|
|
70
116
|
* The open PR whose head exactly equals `branch`, or null.
|
|
@@ -82,7 +128,7 @@ export class Gh {
|
|
|
82
128
|
limit: opts.limit ?? 5,
|
|
83
129
|
fields: opts.fields ?? v.PR_REF_FIELDS,
|
|
84
130
|
});
|
|
85
|
-
return v.pickPrForBranch(rows, branch);
|
|
131
|
+
return v.pickPrForBranch(rows?.rows ?? null, branch);
|
|
86
132
|
}
|
|
87
133
|
/**
|
|
88
134
|
* {@link prView}, re-asked until GitHub settles the merge state.
|
|
@@ -111,26 +157,47 @@ export class Gh {
|
|
|
111
157
|
}
|
|
112
158
|
/** A PR's body text, or null when gh failed. */
|
|
113
159
|
prBody(number, opts = {}) {
|
|
114
|
-
return this.exec(v.prBody(number), opts.timeoutMs);
|
|
160
|
+
return this.exec(v.prBody(number, this.target), opts.timeoutMs);
|
|
115
161
|
}
|
|
116
162
|
/**
|
|
117
163
|
* A REST GET through `gh api`. Never throws: failure is `ok: false` on the
|
|
118
164
|
* returned {@link ApiResponse}.
|
|
119
165
|
*/
|
|
120
166
|
api(endpoint, opts = {}) {
|
|
121
|
-
return this.exec(v.api(endpoint, opts), opts.timeoutMs);
|
|
167
|
+
return this.exec(v.api(endpoint, opts, this.target), opts.timeoutMs);
|
|
168
|
+
}
|
|
169
|
+
/**
|
|
170
|
+
* A GraphQL query; each page's `data`, or null on a failed or partial
|
|
171
|
+
* result. See the `graphql` verb.
|
|
172
|
+
*
|
|
173
|
+
* @experimental
|
|
174
|
+
*/
|
|
175
|
+
graphql(query, variables = {}, opts = {}) {
|
|
176
|
+
return this.exec(v.graphql(query, variables, opts, this.target), opts.timeoutMs);
|
|
122
177
|
}
|
|
123
178
|
/** Every label on the repository (up to `opts.limit`, default 1000), or null when gh failed. */
|
|
124
179
|
labelList(opts = {}) {
|
|
125
|
-
return this.exec(v.labelList(opts), opts.timeoutMs);
|
|
180
|
+
return this.exec(v.labelList(opts, this.target), opts.timeoutMs);
|
|
126
181
|
}
|
|
127
182
|
/** Issues matching `opts` (open by default, up to 200), or null when gh failed. */
|
|
128
183
|
issueList(opts = {}) {
|
|
129
|
-
return this.exec(v.issueList(opts), opts.timeoutMs);
|
|
184
|
+
return this.exec(v.issueList(opts, this.target), opts.timeoutMs);
|
|
130
185
|
}
|
|
131
186
|
/** One issue with its labels, or null when gh failed. */
|
|
132
187
|
issueView(number, opts = {}) {
|
|
133
|
-
return this.exec(v.issueView(number), opts.timeoutMs);
|
|
188
|
+
return this.exec(v.issueView(number, this.target), opts.timeoutMs);
|
|
189
|
+
}
|
|
190
|
+
/** An owner's repositories (up to `opts.limit`, default 100), or null when gh failed. */
|
|
191
|
+
repoList(owner, opts = {}) {
|
|
192
|
+
return this.exec(v.repoList(owner, opts, this.target), opts.timeoutMs);
|
|
193
|
+
}
|
|
194
|
+
/** One repository: `repo`, else the client's repo, else the clone at `cwd`. Null when gh failed. */
|
|
195
|
+
repoView(repo, opts = {}) {
|
|
196
|
+
return this.exec(v.repoView(repo, opts.fields ?? v.REPO_FIELDS, this.target), opts.timeoutMs);
|
|
197
|
+
}
|
|
198
|
+
/** Pull requests across repositories matching a search query, or null when gh failed. */
|
|
199
|
+
searchPrs(query, opts = {}) {
|
|
200
|
+
return this.exec(v.searchPrs(query, opts, this.target), opts.timeoutMs);
|
|
134
201
|
}
|
|
135
202
|
/** True iff the `gh` binary is on PATH and runs. */
|
|
136
203
|
installed() {
|
|
@@ -147,7 +214,7 @@ export class Gh {
|
|
|
147
214
|
}
|
|
148
215
|
/** Login state and what `gh auth status` printed; `authenticated()` is its `ok`. */
|
|
149
216
|
authStatus() {
|
|
150
|
-
return this.exec(v.authStatus());
|
|
217
|
+
return this.exec(v.authStatus(this.target));
|
|
151
218
|
}
|
|
152
219
|
/**
|
|
153
220
|
* True iff `gh` is installed AND authenticated — the two-step probe.
|
|
@@ -169,19 +236,19 @@ export class Gh {
|
|
|
169
236
|
// ── mutations (checked) ───────────────────────────────────────────────────
|
|
170
237
|
/** Open a PR and return its URL ('' if gh printed none). */
|
|
171
238
|
createPr(opts) {
|
|
172
|
-
return this.exec(v.createPr(opts));
|
|
239
|
+
return this.exec(v.createPr(opts, this.target));
|
|
173
240
|
}
|
|
174
241
|
/** Retitle or rewrite a PR body. */
|
|
175
242
|
editPr(number, opts) {
|
|
176
|
-
this.exec(v.editPr(number, opts));
|
|
243
|
+
this.exec(v.editPr(number, opts, this.target));
|
|
177
244
|
}
|
|
178
245
|
/** The PR's unified diff; throws `CommandFailed` when gh cannot produce it. */
|
|
179
246
|
prDiff(number) {
|
|
180
|
-
return this.exec(v.prDiff(number));
|
|
247
|
+
return this.exec(v.prDiff(number, this.target));
|
|
181
248
|
}
|
|
182
249
|
/** Post one conversation comment on a PR; returns its URL ('' if gh printed none). */
|
|
183
250
|
prComment(number, body) {
|
|
184
|
-
return this.exec(v.prComment(number, body));
|
|
251
|
+
return this.exec(v.prComment(number, body, this.target));
|
|
185
252
|
}
|
|
186
253
|
/**
|
|
187
254
|
* Create a `COMMENT` review with inline comments; returns the review's URL ('' if none came back).
|
|
@@ -189,19 +256,19 @@ export class Gh {
|
|
|
189
256
|
* @experimental
|
|
190
257
|
*/
|
|
191
258
|
createReview(number, opts) {
|
|
192
|
-
return this.exec(v.createReview(number, opts));
|
|
259
|
+
return this.exec(v.createReview(number, opts, this.target));
|
|
193
260
|
}
|
|
194
261
|
/** Rewrite just a PR's body. */
|
|
195
262
|
editPrBody(number, body) {
|
|
196
|
-
this.exec(v.editPrBody(number, body));
|
|
263
|
+
this.exec(v.editPrBody(number, body, this.target));
|
|
197
264
|
}
|
|
198
265
|
/** Bring a PR's head branch up to date with its base. */
|
|
199
266
|
prUpdateBranch(number, style = 'merge') {
|
|
200
|
-
this.exec(v.prUpdateBranch(number, style));
|
|
267
|
+
this.exec(v.prUpdateBranch(number, style, this.target));
|
|
201
268
|
}
|
|
202
269
|
/** Mark a PR ready for review (`draft: false`) or convert it to a draft (`draft: true`). */
|
|
203
270
|
prSetDraft(number, draft) {
|
|
204
|
-
this.exec(v.prSetDraft(number, draft));
|
|
271
|
+
this.exec(v.prSetDraft(number, draft, this.target));
|
|
205
272
|
}
|
|
206
273
|
/**
|
|
207
274
|
* Rewrite one PR conversation comment's body. `commentId` is the numeric REST id; anything else throws `RangeError`.
|
|
@@ -209,23 +276,23 @@ export class Gh {
|
|
|
209
276
|
* @experimental
|
|
210
277
|
*/
|
|
211
278
|
issueCommentEdit(commentId, body) {
|
|
212
|
-
this.exec(v.issueCommentEdit(commentId, body));
|
|
279
|
+
this.exec(v.issueCommentEdit(commentId, body, this.target));
|
|
213
280
|
}
|
|
214
281
|
/** Merge a PR; GitHub refuses when its head is no longer `opts.headSha`. */
|
|
215
282
|
prMerge(number, opts) {
|
|
216
|
-
this.exec(v.prMerge(number, opts));
|
|
283
|
+
this.exec(v.prMerge(number, opts, this.target));
|
|
217
284
|
}
|
|
218
285
|
/** A PR's review threads, or null when they could not be read completely. */
|
|
219
286
|
prReviewThreads(number) {
|
|
220
|
-
return this.exec(v.prReviewThreads(number));
|
|
287
|
+
return this.exec(v.prReviewThreads(number, this.target));
|
|
221
288
|
}
|
|
222
289
|
/** Create a label (or force it to `opts`'s color/description if it already exists). */
|
|
223
290
|
createLabel(opts) {
|
|
224
|
-
this.exec(v.createLabel(opts));
|
|
291
|
+
this.exec(v.createLabel(opts, this.target));
|
|
225
292
|
}
|
|
226
293
|
/** Recolor and/or redescribe an existing label. */
|
|
227
294
|
editLabel(name, opts) {
|
|
228
|
-
this.exec(v.editLabel(name, opts));
|
|
295
|
+
this.exec(v.editLabel(name, opts, this.target));
|
|
229
296
|
}
|
|
230
297
|
/**
|
|
231
298
|
* Swap an issue's label: remove `currentLabel` (when given) and add
|
|
@@ -233,9 +300,20 @@ export class Gh {
|
|
|
233
300
|
* or briefly-double-labeled intermediate state.
|
|
234
301
|
*/
|
|
235
302
|
setIssueLabel(number, currentLabel, newLabel) {
|
|
236
|
-
this.exec(v.setIssueLabel(number, currentLabel, newLabel));
|
|
303
|
+
this.exec(v.setIssueLabel(number, currentLabel, newLabel, this.target));
|
|
237
304
|
}
|
|
238
305
|
}
|
|
306
|
+
/** The open PR for `branch`, else its newest closed or merged one. */
|
|
307
|
+
function prForBranchOn(gh, branch, call) {
|
|
308
|
+
const rows = gh.prList({
|
|
309
|
+
head: branch,
|
|
310
|
+
state: 'all',
|
|
311
|
+
limit: 20,
|
|
312
|
+
fields: v.branchPrFields(call.fields),
|
|
313
|
+
timeoutMs: call.timeoutMs,
|
|
314
|
+
});
|
|
315
|
+
return v.branchPr(rows);
|
|
316
|
+
}
|
|
239
317
|
/**
|
|
240
318
|
* Block the calling thread. Crude on purpose: the synchronous client has no
|
|
241
319
|
* event loop to await on, and the alternative — making every caller async to
|
package/dist/types.d.ts
CHANGED
|
@@ -149,4 +149,41 @@ export interface OwnerRepo {
|
|
|
149
149
|
owner: string;
|
|
150
150
|
repo: string;
|
|
151
151
|
}
|
|
152
|
+
/** Who can see a repository. */
|
|
153
|
+
export type RepositoryVisibility = 'PUBLIC' | 'PRIVATE' | 'INTERNAL' | (string & {});
|
|
154
|
+
/**
|
|
155
|
+
* A repository, off `gh repo list`/`gh repo view --json`. A field not asked
|
|
156
|
+
* for comes back at its "not known" value. `nameWithOwner` is the only field
|
|
157
|
+
* without one: a row without it is dropped.
|
|
158
|
+
*/
|
|
159
|
+
export interface Repository {
|
|
160
|
+
/** `owner/name`. */
|
|
161
|
+
nameWithOwner: string;
|
|
162
|
+
owner: string;
|
|
163
|
+
name: string;
|
|
164
|
+
description: string;
|
|
165
|
+
/** The default branch; null when not asked for, or the repository is empty. */
|
|
166
|
+
defaultBranch: string | null;
|
|
167
|
+
visibility: RepositoryVisibility | null;
|
|
168
|
+
isArchived: boolean;
|
|
169
|
+
url: string;
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* One pull request found by `gh search prs`. Search has its own field set:
|
|
173
|
+
* it names the repository but carries no head or base branch, so this is not
|
|
174
|
+
* a {@link PullRequest}. `state` is upper-cased to match `PullRequest`.
|
|
175
|
+
*/
|
|
176
|
+
export interface PrSearchHit {
|
|
177
|
+
number: number;
|
|
178
|
+
title: string;
|
|
179
|
+
state: PullRequestState;
|
|
180
|
+
url: string;
|
|
181
|
+
isDraft: boolean;
|
|
182
|
+
repository: OwnerRepo | null;
|
|
183
|
+
author: Actor | null;
|
|
184
|
+
labels: Label[];
|
|
185
|
+
createdAt: string | null;
|
|
186
|
+
updatedAt: string | null;
|
|
187
|
+
closedAt: string | null;
|
|
188
|
+
}
|
|
152
189
|
//# sourceMappingURL=types.d.ts.map
|
package/dist/types.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../types.ts"],"names":[],"mappings":"AAAA;;;;;;;;;;;;;;;;;;GAkBG;AAEH;;;GAGG;AACH,MAAM,MAAM,cAAc,GAAG,WAAW,GAAG,aAAa,GAAG,SAAS,CAAA;AAEpE;;;;;;;GAOG;AACH,MAAM,MAAM,gBAAgB,GACxB,QAAQ,GACR,SAAS,GACT,OAAO,GACP,OAAO,GACP,OAAO,GACP,WAAW,GACX,SAAS,GACT,UAAU,GACV,CAAC,MAAM,GAAG,EAAE,CAAC,CAAA;AAEjB,oFAAoF;AACpF,MAAM,MAAM,gBAAgB,GAAG,MAAM,GAA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