@leitwerk-dev/github 0.2.0 → 0.2.1
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/README.md +26 -0
- package/dist/authorization.d.ts +4 -0
- package/dist/authorization.d.ts.map +1 -1
- package/dist/binding.d.ts +1 -0
- package/dist/binding.d.ts.map +1 -1
- package/dist/capability.d.ts +4 -1
- package/dist/capability.d.ts.map +1 -1
- package/dist/{chunk-PVE52UFH.js → chunk-6X3F3VHK.js} +48 -22
- package/dist/chunk-6X3F3VHK.js.map +1 -0
- package/dist/client.d.ts +98 -9
- package/dist/client.d.ts.map +1 -1
- package/dist/external.d.ts +65 -0
- package/dist/external.d.ts.map +1 -1
- package/dist/index.d.ts +13 -11
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +120 -139
- package/dist/index.js.map +1 -1
- package/dist/issue-watcher.d.ts +12 -0
- package/dist/issue-watcher.d.ts.map +1 -1
- package/dist/provider.d.ts +3 -1
- package/dist/provider.d.ts.map +1 -1
- package/dist/testing/tool-fixture.d.ts +45 -0
- package/dist/testing/tool-fixture.d.ts.map +1 -0
- package/dist/testing.d.ts +67 -3
- package/dist/testing.d.ts.map +1 -1
- package/dist/testing.js +29 -4
- package/dist/testing.js.map +1 -1
- package/dist/tools.d.ts +1 -2
- package/dist/tools.d.ts.map +1 -1
- package/package.json +6 -7
- package/src/authorization.ts +9 -1
- package/src/binding.ts +1 -0
- package/src/capability.ts +4 -1
- package/src/client.ts +135 -30
- package/src/external.ts +53 -0
- package/src/index.ts +31 -11
- package/src/issue-watcher.ts +16 -1
- package/src/testing/tool-fixture.ts +126 -0
- package/src/testing.ts +91 -9
- package/src/tools.ts +158 -175
- package/dist/chunk-PVE52UFH.js.map +0 -1
package/README.md
CHANGED
|
@@ -111,3 +111,29 @@ retrying it. Release-lock selection stays outside this integration.
|
|
|
111
111
|
The local adapter supports `createIssue`, `setIssueLabel`, `setMembership`,
|
|
112
112
|
`editFeedback` and `failNextResponse`. Membership, label events, feedback edits,
|
|
113
113
|
write outcomes and Git history survive restart.
|
|
114
|
+
|
|
115
|
+
Tool authorization and retry edge cases use an in-memory provider boundary.
|
|
116
|
+
The recovery integration exercises real Git and reopens both provider storage and
|
|
117
|
+
SQLite receipts: a lost create response and subsequent restart must retain one PR
|
|
118
|
+
and the same receipt. This verifies local persistence and tool wiring, not live
|
|
119
|
+
GitHub API compatibility.
|
|
120
|
+
|
|
121
|
+
## API support
|
|
122
|
+
|
|
123
|
+
The following exported declarations are `@public`:
|
|
124
|
+
|
|
125
|
+
- `@leitwerk-dev/github`: `GITHUB_CHECKS_KIND`, `GITHUB_ISSUE_CANCELLED_KIND`, `GITHUB_PR_FEEDBACK_KIND`, `GITHUB_PR_STATE_KIND`, `GITHUB_PR_TERMINAL_KIND`, `GitHubCheckSummary`, `GitHubGitIdentity`, `GitHubIntegration`, `GitHubIssue`, `GitHubPullRequest`, `default`, `githubExternal`, `githubIntegration`, `githubIssueWatcherSource`, `resolveGitHubProjectBinding`, `setupGitHubIntegration`.
|
|
126
|
+
- `@leitwerk-dev/github/testing`: `LocalGitHubAdapter`, `LocalGitHubOptions`, `LocalGitHubRepository`, `LocalGitHubState`.
|
|
127
|
+
|
|
128
|
+
Members have individual classifications; these exports do not make every member
|
|
129
|
+
public. Both `@public` and `@internal` APIs remain usable and fully typed. Source
|
|
130
|
+
annotations are authoritative; see the [SDK compatibility
|
|
131
|
+
policy](../../docs/process-sdk.md#api-compatibility).
|
|
132
|
+
|
|
133
|
+
### External-write replay
|
|
134
|
+
|
|
135
|
+
Writes follow the [shared reconciliation contract](../../docs/process-sdk.md#typed-external-writes).
|
|
136
|
+
Pull requests are matched by branch pair; comments and replies use hidden markers
|
|
137
|
+
within their repository and thread. Reaction recovery matches the bot's identity.
|
|
138
|
+
Update recovery compares requested fields, including normalized labels. Logged
|
|
139
|
+
replays return the current object without reapplying the patch.
|
package/dist/authorization.d.ts
CHANGED
|
@@ -1,10 +1,14 @@
|
|
|
1
1
|
import type { GitHubClient, GitHubFeedbackItem, GitHubIssue } from "./client.js";
|
|
2
2
|
type MembershipClient = Pick<GitHubClient, "profile" | "isOrganizationMember">;
|
|
3
3
|
export declare function authorizedTrigger(client: MembershipClient & Pick<GitHubClient, "getIssue" | "listIssueEvents">, owner: string, repo: string, number: number, trigger: string, done: string): Promise<{
|
|
4
|
+
/** @internal */
|
|
4
5
|
issue: GitHubIssue & {
|
|
6
|
+
/** @internal */
|
|
5
7
|
pull_request?: unknown;
|
|
6
8
|
};
|
|
9
|
+
/** @internal */
|
|
7
10
|
actor: string;
|
|
11
|
+
/** @internal */
|
|
8
12
|
eventId: number;
|
|
9
13
|
} | null>;
|
|
10
14
|
export declare function actionableFeedback(client: MembershipClient, feedback: GitHubFeedbackItem[]): Promise<GitHubFeedbackItem[]>;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF,KAAK,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,sBAAsB,CAAC,CAAC;AAE/E,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAC7E,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM;;
|
|
1
|
+
{"version":3,"file":"authorization.d.ts","sourceRoot":"","sources":["../src/authorization.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,MAAM,aAAa,CAAC;AAEjF,KAAK,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,SAAS,GAAG,sBAAsB,CAAC,CAAC;AAE/E,wBAAsB,iBAAiB,CACtC,MAAM,EAAE,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,UAAU,GAAG,iBAAiB,CAAC,EAC7E,KAAK,EAAE,MAAM,EACb,IAAI,EAAE,MAAM,EACZ,MAAM,EAAE,MAAM,EACd,OAAO,EAAE,MAAM,EACf,IAAI,EAAE,MAAM;IA+BX,gBAAgB;;QAvBhB,gBAAgB;uBACD,OAAO;;IAwBtB,gBAAgB;;IAEhB,gBAAgB;;UAGjB;AAED,wBAAsB,kBAAkB,CAAC,MAAM,EAAE,gBAAgB,EAAE,QAAQ,EAAE,kBAAkB,EAAE,iCAWhG"}
|
package/dist/binding.d.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { resolveRepositoryProjectBinding } from "@leitwerk-dev/process-sdk";
|
|
2
2
|
export type { RepositoryProjectBinding as GitHubProjectBinding } from "@leitwerk-dev/process-sdk";
|
|
3
|
+
/** @public */
|
|
3
4
|
export declare const resolveGitHubProjectBinding: (ctx: Parameters<typeof resolveRepositoryProjectBinding>[0]) => import("@leitwerk-dev/process-sdk").RepositoryProjectBinding;
|
|
4
5
|
//# sourceMappingURL=binding.d.ts.map
|
package/dist/binding.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,YAAY,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAClG,eAAO,MAAM,2BAA2B,GACvC,KAAK,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,iEACR,CAAC"}
|
|
1
|
+
{"version":3,"file":"binding.d.ts","sourceRoot":"","sources":["../src/binding.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,+BAA+B,EAAE,MAAM,2BAA2B,CAAC;AAE5E,YAAY,EAAE,wBAAwB,IAAI,oBAAoB,EAAE,MAAM,2BAA2B,CAAC;AAClG,cAAc;AACd,eAAO,MAAM,2BAA2B,GACvC,KAAK,UAAU,CAAC,OAAO,+BAA+B,CAAC,CAAC,CAAC,CAAC,iEACR,CAAC"}
|
package/dist/capability.d.ts
CHANGED
|
@@ -1,8 +1,11 @@
|
|
|
1
1
|
import type { GitHubClient } from "./client.js";
|
|
2
|
-
/** Public contract shared by HTTP and local adapters. */
|
|
2
|
+
/** Public contract shared by HTTP and local adapters. @public */
|
|
3
3
|
export type GitHubClientLike = Pick<GitHubClient, keyof GitHubClient>;
|
|
4
|
+
/** @public */
|
|
4
5
|
export interface GitHubIntegration {
|
|
6
|
+
/** @public */
|
|
5
7
|
client(profile: string): GitHubClientLike;
|
|
6
8
|
}
|
|
9
|
+
/** @public */
|
|
7
10
|
export declare const githubIntegration: import("@leitwerk-dev/process-sdk").CapabilityToken<GitHubIntegration>;
|
|
8
11
|
//# sourceMappingURL=capability.d.ts.map
|
package/dist/capability.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,
|
|
1
|
+
{"version":3,"file":"capability.d.ts","sourceRoot":"","sources":["../src/capability.ts"],"names":[],"mappings":"AACA,OAAO,KAAK,EAAE,YAAY,EAAE,MAAM,aAAa,CAAC;AAEhD,iEAAiE;AACjE,MAAM,MAAM,gBAAgB,GAAG,IAAI,CAAC,YAAY,EAAE,MAAM,YAAY,CAAC,CAAC;AAEtE,cAAc;AACd,MAAM,WAAW,iBAAiB;IACjC,cAAc;IACd,MAAM,CAAC,OAAO,EAAE,MAAM,GAAG,gBAAgB,CAAC;CAC1C;AAED,cAAc;AACd,eAAO,MAAM,iBAAiB,wEAE7B,CAAC"}
|
|
@@ -10,7 +10,14 @@ async function authorizedTrigger(client, owner, repo, number, trigger, done) {
|
|
|
10
10
|
).sort((a, b) => b.id - a.id)[0];
|
|
11
11
|
if (last?.event !== "labeled" || !last.actor?.login || !await client.isOrganizationMember(last.actor.login))
|
|
12
12
|
return null;
|
|
13
|
-
return {
|
|
13
|
+
return {
|
|
14
|
+
/** @internal */
|
|
15
|
+
issue,
|
|
16
|
+
/** @internal */
|
|
17
|
+
actor: last.actor.login,
|
|
18
|
+
/** @internal */
|
|
19
|
+
eventId: last.id
|
|
20
|
+
};
|
|
14
21
|
}
|
|
15
22
|
async function actionableFeedback(client, feedback) {
|
|
16
23
|
const authorized = [];
|
|
@@ -64,6 +71,7 @@ function assertGitHubRepository(profile, owner, repo) {
|
|
|
64
71
|
}
|
|
65
72
|
}
|
|
66
73
|
var GitHubClient = class extends RepositoryHttpClient {
|
|
74
|
+
/** @internal */
|
|
67
75
|
constructor(profile) {
|
|
68
76
|
super("GitHub", profile.apiBaseUrl, {
|
|
69
77
|
Accept: "application/vnd.github+json",
|
|
@@ -73,6 +81,7 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
73
81
|
this.profile = profile;
|
|
74
82
|
}
|
|
75
83
|
profile;
|
|
84
|
+
/** @internal */
|
|
76
85
|
response(path, init = {}) {
|
|
77
86
|
return super.response(path, {
|
|
78
87
|
...init,
|
|
@@ -80,10 +89,12 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
80
89
|
signal: init.signal ?? AbortSignal.timeout(3e4)
|
|
81
90
|
});
|
|
82
91
|
}
|
|
92
|
+
/** @internal */
|
|
83
93
|
repositoryPath(owner, repo) {
|
|
84
94
|
assertGitHubRepository(this.profile, owner, repo);
|
|
85
95
|
return super.repositoryPath(owner, repo);
|
|
86
96
|
}
|
|
97
|
+
/** @internal */
|
|
87
98
|
async listRepositories() {
|
|
88
99
|
return (await this.pages(
|
|
89
100
|
this.profile.allowedOrganization ? `/orgs/${this.profile.allowedOrganization}/repos?type=all` : "/user/repos?affiliation=owner,collaborator,organization_member"
|
|
@@ -91,16 +102,17 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
91
102
|
(repo) => (!this.profile.allowedOrganization || repo.owner.login.toLowerCase() === this.profile.allowedOrganization.toLowerCase()) && !repo.archived && repo.has_issues
|
|
92
103
|
);
|
|
93
104
|
}
|
|
105
|
+
/** @internal */
|
|
94
106
|
async listOpenIssues(owner, repo) {
|
|
95
|
-
return (await this.pages(
|
|
96
|
-
`${this.repositoryPath(owner, repo)}/issues?state=open`
|
|
97
|
-
)).filter((issue) => !issue.pull_request);
|
|
107
|
+
return (await this.pages(`${this.repositoryPath(owner, repo)}/issues?state=open`)).filter((issue) => !issue.pull_request);
|
|
98
108
|
}
|
|
109
|
+
/** @internal */
|
|
99
110
|
listIssueEvents(owner, repo, number) {
|
|
100
111
|
return this.pages(
|
|
101
112
|
`${this.repositoryPath(owner, repo)}/issues/${number}/events`
|
|
102
113
|
);
|
|
103
114
|
}
|
|
115
|
+
/** @internal */
|
|
104
116
|
async isOrganizationMember(login) {
|
|
105
117
|
if (!this.profile.allowedOrganization) return true;
|
|
106
118
|
if (!/^[a-z0-9-]+$/i.test(login)) return false;
|
|
@@ -117,9 +129,11 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
117
129
|
throw error;
|
|
118
130
|
}
|
|
119
131
|
}
|
|
132
|
+
/** @internal */
|
|
120
133
|
async authorizedTrigger(owner, repo, number, trigger, done) {
|
|
121
134
|
return authorizedTrigger(this, owner, repo, number, trigger, done);
|
|
122
135
|
}
|
|
136
|
+
/** @public */
|
|
123
137
|
async resolveGitIdentity(profile) {
|
|
124
138
|
const user = await this.request("/user");
|
|
125
139
|
if (user.login !== this.profile.botLogin)
|
|
@@ -132,21 +146,30 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
132
146
|
email: `${user.id}+${user.login}@users.noreply.github.com`
|
|
133
147
|
};
|
|
134
148
|
}
|
|
149
|
+
/** @public */
|
|
135
150
|
updateIssue(owner, repo, number, patch) {
|
|
136
151
|
return this.request(`${this.repositoryPath(owner, repo)}/issues/${number}`, {
|
|
137
152
|
method: "PATCH",
|
|
138
153
|
body: JSON.stringify(patch)
|
|
139
154
|
});
|
|
140
155
|
}
|
|
141
|
-
|
|
142
|
-
|
|
143
|
-
|
|
144
|
-
|
|
145
|
-
|
|
156
|
+
/** @internal */
|
|
157
|
+
listLabels(owner, repo) {
|
|
158
|
+
return this.pages(`${this.repositoryPath(owner, repo)}/labels`);
|
|
159
|
+
}
|
|
160
|
+
/** @internal */
|
|
161
|
+
createLabel(owner, repo, name) {
|
|
162
|
+
return this.request(`${this.repositoryPath(owner, repo)}/labels`, {
|
|
146
163
|
method: "POST",
|
|
147
164
|
body: JSON.stringify({ name, color: "238636" })
|
|
148
165
|
});
|
|
149
166
|
}
|
|
167
|
+
/** @internal */
|
|
168
|
+
async ensureLabel(owner, repo, name) {
|
|
169
|
+
const labels = await this.listLabels(owner, repo);
|
|
170
|
+
return labels.find((label) => label.name === name) ?? this.createLabel(owner, repo, name);
|
|
171
|
+
}
|
|
172
|
+
/** @internal */
|
|
150
173
|
addFeedbackReaction(owner, repo, kind, id) {
|
|
151
174
|
const segment = kind === "inline" ? "pulls/comments" : "issues/comments";
|
|
152
175
|
return this.request(`${this.repositoryPath(owner, repo)}/${segment}/${id}/reactions`, {
|
|
@@ -154,28 +177,28 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
154
177
|
body: JSON.stringify({ content: "eyes" })
|
|
155
178
|
});
|
|
156
179
|
}
|
|
180
|
+
/** @internal */
|
|
157
181
|
async replyFeedback(owner, repo, pr, kind, id, body) {
|
|
158
182
|
if (kind === "inline")
|
|
159
|
-
return this.
|
|
183
|
+
return this.writeJson(
|
|
160
184
|
`${this.repositoryPath(owner, repo)}/pulls/${pr}/comments/${id}/replies`,
|
|
161
|
-
|
|
162
|
-
|
|
163
|
-
body: JSON.stringify({ body })
|
|
164
|
-
}
|
|
185
|
+
"POST",
|
|
186
|
+
{ body }
|
|
165
187
|
);
|
|
166
188
|
return this.addIssueComment(owner, repo, pr, body);
|
|
167
189
|
}
|
|
190
|
+
/** @internal */
|
|
168
191
|
getCommit(owner, repo, ref) {
|
|
169
|
-
return this.request(
|
|
170
|
-
`${this.repositoryPath(owner, repo)}/commits/${encodeURIComponent(ref)}`
|
|
171
|
-
);
|
|
192
|
+
return this.request(`${this.repositoryPath(owner, repo)}/commits/${encodeURIComponent(ref)}`);
|
|
172
193
|
}
|
|
194
|
+
/** @public */
|
|
173
195
|
async isAncestor(owner, repo, ancestor, descendant) {
|
|
174
196
|
const comparison = await this.request(
|
|
175
197
|
`${this.repositoryPath(owner, repo)}/compare/${encodeURIComponent(ancestor)}...${encodeURIComponent(descendant)}`
|
|
176
198
|
);
|
|
177
199
|
return comparison.status === "identical" || comparison.status === "ahead";
|
|
178
200
|
}
|
|
201
|
+
/** @public */
|
|
179
202
|
async listPullRequestFeedback(owner, repo, number, signal) {
|
|
180
203
|
const prefix = `${this.repositoryPath(owner, repo)}`;
|
|
181
204
|
const [conversation, reviews, inline] = await Promise.all([
|
|
@@ -252,6 +275,7 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
252
275
|
}
|
|
253
276
|
return feedback;
|
|
254
277
|
}
|
|
278
|
+
/** @public */
|
|
255
279
|
async getCheckSummary(owner, repo, headSha) {
|
|
256
280
|
const runs = [];
|
|
257
281
|
for (let page = 1; ; page++) {
|
|
@@ -275,29 +299,31 @@ var GitHubClient = class extends RepositoryHttpClient {
|
|
|
275
299
|
failed
|
|
276
300
|
};
|
|
277
301
|
}
|
|
278
|
-
/** Human feedback checked against current membership; delivery receipts use raw reads. */
|
|
302
|
+
/** Human feedback checked against current membership; delivery receipts use raw reads. @internal */
|
|
279
303
|
async listActionablePullRequestFeedback(owner, repo, number, signal) {
|
|
280
304
|
return actionableFeedback(
|
|
281
305
|
this,
|
|
282
306
|
await this.listPullRequestFeedback(owner, repo, number, signal)
|
|
283
307
|
);
|
|
284
308
|
}
|
|
309
|
+
/** @internal */
|
|
285
310
|
listFeedbackReplies(owner, repo, pr, kind) {
|
|
286
311
|
return kind === "inline" ? this.pages(
|
|
287
312
|
`${this.repositoryPath(owner, repo)}/pulls/${pr}/comments`
|
|
288
313
|
) : this.listIssueComments(owner, repo, pr);
|
|
289
314
|
}
|
|
315
|
+
/** @internal */
|
|
290
316
|
listFeedbackReactions(owner, repo, kind, id) {
|
|
291
317
|
if (kind !== "inline" && kind !== "conversation")
|
|
292
318
|
throw new Error("Reviews do not support reactions");
|
|
293
319
|
const segment = kind === "inline" ? "pulls/comments" : "issues/comments";
|
|
294
|
-
return this.pages(
|
|
295
|
-
`${this.repositoryPath(owner, repo)}/${segment}/${id}/reactions`
|
|
296
|
-
);
|
|
320
|
+
return this.pages(`${this.repositoryPath(owner, repo)}/${segment}/${id}/reactions`);
|
|
297
321
|
}
|
|
322
|
+
/** @internal */
|
|
298
323
|
listReleases(owner, repo) {
|
|
299
324
|
return this.pages(`${this.repositoryPath(owner, repo)}/releases`);
|
|
300
325
|
}
|
|
326
|
+
/** @public */
|
|
301
327
|
downloadReleaseAsset(asset) {
|
|
302
328
|
const url = new URL(asset.url);
|
|
303
329
|
if (`${url.protocol}//${url.host}` !== this.profile.apiBaseUrl)
|
|
@@ -315,4 +341,4 @@ export {
|
|
|
315
341
|
assertGitHubRepository,
|
|
316
342
|
GitHubClient
|
|
317
343
|
};
|
|
318
|
-
//# sourceMappingURL=chunk-
|
|
344
|
+
//# sourceMappingURL=chunk-6X3F3VHK.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"sources":["../src/authorization.ts","../src/client.ts"],"sourcesContent":["import type { GitHubClient, GitHubFeedbackItem, GitHubIssue } from \"./client.js\";\n\ntype MembershipClient = Pick<GitHubClient, \"profile\" | \"isOrganizationMember\">;\n\nexport async function authorizedTrigger(\n\tclient: MembershipClient & Pick<GitHubClient, \"getIssue\" | \"listIssueEvents\">,\n\towner: string,\n\trepo: string,\n\tnumber: number,\n\ttrigger: string,\n\tdone: string,\n) {\n\tif (\n\t\tclient.profile.allowedOrganization &&\n\t\towner.toLowerCase() !== client.profile.allowedOrganization.toLowerCase()\n\t)\n\t\treturn null;\n\tconst issue = (await client.getIssue(owner, repo, number)) as GitHubIssue & {\n\t\t/** @internal */\n\t\tpull_request?: unknown;\n\t};\n\tif (\n\t\tissue.pull_request ||\n\t\tissue.state !== \"open\" ||\n\t\t!issue.labels.some((label) => label.name === trigger) ||\n\t\tissue.labels.some((label) => label.name === done)\n\t)\n\t\treturn null;\n\tconst last = (await client.listIssueEvents(owner, repo, number))\n\t\t.filter(\n\t\t\t(event) =>\n\t\t\t\t(event.event === \"labeled\" || event.event === \"unlabeled\") && event.label?.name === trigger,\n\t\t)\n\t\t.sort((a, b) => b.id - a.id)[0];\n\tif (\n\t\tlast?.event !== \"labeled\" ||\n\t\t!last.actor?.login ||\n\t\t!(await client.isOrganizationMember(last.actor.login))\n\t)\n\t\treturn null;\n\treturn {\n\t\t/** @internal */\n\t\tissue,\n\t\t/** @internal */\n\t\tactor: last.actor.login,\n\t\t/** @internal */\n\t\teventId: last.id,\n\t};\n}\n\nexport async function actionableFeedback(client: MembershipClient, feedback: GitHubFeedbackItem[]) {\n\tconst authorized: GitHubFeedbackItem[] = [];\n\tfor (const item of feedback) {\n\t\tif (\n\t\t\titem.author.toLowerCase() === client.profile.botLogin.toLowerCase() ||\n\t\t\titem.body.includes(\"<!-- leitwerk-write:\")\n\t\t)\n\t\t\tcontinue;\n\t\tif (await client.isOrganizationMember(item.author)) authorized.push(item);\n\t}\n\treturn authorized;\n}\n","import { asUnknownRecord } from \"@leitwerk-dev/domain\";\nimport {\n\ttype RepositoryFeedbackItem as GitHubFeedbackItem,\n\ttype RepositoryIssue as GitHubIssue,\n\ttype RepositoryPullRequest as GitHubPullRequest,\n\tIntegrationHttpError,\n\tnormalizeRepositoryFeedback as normalize,\n\tRepositoryHttpClient,\n} from \"@leitwerk-dev/process-sdk\";\n\nimport { actionableFeedback, authorizedTrigger } from \"./authorization.js\";\n\nexport type { GitHubFeedbackItem, GitHubIssue, GitHubPullRequest };\n\n/** @public */\nexport interface GitHubRepository {\n\t/** @public */\n\tname: string;\n\t/** @internal */\n\tfull_name: string;\n\t/** @public */\n\towner: {\n\t\t/** @public */\n\t\tlogin: string;\n\t};\n\t/** @public */\n\tssh_url: string;\n\t/** @public */\n\tdefault_branch: string;\n\t/** @internal */\n\thtml_url: string;\n\t/** @internal */\n\tarchived: boolean;\n\t/** @internal */\n\thas_issues: boolean;\n}\n/** @public */\nexport interface GitHubGitIdentity {\n\t/** @internal */\n\tprovider: \"github\";\n\t/** @internal */\n\tprofile: string;\n\t/** @internal */\n\tlogin: string;\n\t/** @public */\n\tname: string;\n\t/** @public */\n\temail: string;\n}\n/** @public */\nexport interface GitHubLabelEvent {\n\t/** @internal */\n\tid: number;\n\t/** @internal */\n\tevent: string;\n\t/** @internal */\n\tlabel?: {\n\t\t/** @internal */\n\t\tname: string;\n\t};\n\t/** @internal */\n\tactor: {\n\t\t/** @internal */\n\t\tlogin: string;\n\t} | null;\n}\n\n/** @internal */\ninterface GitHubLabel {\n\t/** @internal */\n\tid: number;\n\t/** @internal */\n\tname: string;\n}\n\n/** @internal */\nexport interface GitHubProfile {\n\t/** @internal */\n\tapiBaseUrl: string;\n\t/** @internal */\n\ttoken: string;\n\t/** @internal */\n\tbotLogin: string;\n\t/** @internal */\n\tallowedOrganization?: string;\n}\n\n/** @public */\nexport interface GitHubCheckSummary {\n\t/** @public */\n\theadSha: string;\n\t/** @public */\n\tstatus: \"pending\" | \"success\" | \"failure\";\n\t/** @public */\n\ttotal: number;\n\t/** @public */\n\tfailed: Array<{\n\t\t/** @public */\n\t\tname: string;\n\t\t/** @public */\n\t\tconclusion: string | null;\n\t\t/** @public */\n\t\turl: string | null;\n\t}>;\n}\n\n/** @public */\nexport interface GitHubRelease {\n\t/** @internal */\n\tid: number;\n\t/** @public */\n\ttag_name: string;\n\t/** @internal */\n\ttarget_commitish: string;\n\t/** @internal */\n\tdraft: boolean;\n\t/** @internal */\n\tprerelease: boolean;\n\t/** @internal */\n\thtml_url: string;\n\t/** @public */\n\tassets: Array<{\n\t\t/** @internal */\n\t\tname: string;\n\t\t/** @internal */\n\t\turl: string;\n\t\t/** @internal */\n\t\tbrowser_download_url: string;\n\t}>;\n}\n\n/** @internal */\nexport function parseGitHubProfiles(value: unknown): Map<string, GitHubProfile> {\n\tconst profiles = new Map<string, GitHubProfile>();\n\tfor (const [name, raw] of Object.entries(\n\t\tasUnknownRecord(asUnknownRecord(value)?.profiles) ?? {},\n\t)) {\n\t\tconst config = asUnknownRecord(raw) ?? {};\n\t\tconst apiBaseUrl =\n\t\t\ttypeof config.api_base_url === \"string\"\n\t\t\t\t? config.api_base_url.replace(/\\/+$/, \"\")\n\t\t\t\t: \"https://api.github.com\";\n\t\tconst token = typeof config.token === \"string\" ? config.token.trim() : \"\";\n\t\tconst botLogin = typeof config.bot_login === \"string\" ? config.bot_login.trim() : \"leitwerk\";\n\t\tif (!/^https:\\/\\//.test(apiBaseUrl))\n\t\t\tthrow new Error(`GitHub profile '${name}' requires an HTTPS api_base_url`);\n\t\tif (!token) throw new Error(`GitHub profile '${name}' requires a token`);\n\t\tif (!botLogin) throw new Error(`GitHub profile '${name}' requires bot_login`);\n\t\tconst allowedOrganization = config.allowed_organization;\n\t\tif (\n\t\t\tallowedOrganization !== undefined &&\n\t\t\t(typeof allowedOrganization !== \"string\" || !/^[a-z0-9-]+$/i.test(allowedOrganization))\n\t\t) {\n\t\t\tthrow new Error(`GitHub profile '${name}' requires a valid allowed_organization`);\n\t\t}\n\t\tprofiles.set(name, {\n\t\t\tapiBaseUrl,\n\t\t\ttoken,\n\t\t\tbotLogin,\n\t\t\t...(typeof allowedOrganization === \"string\"\n\t\t\t\t? { allowedOrganization: allowedOrganization.toLowerCase() }\n\t\t\t\t: {}),\n\t\t});\n\t}\n\treturn profiles;\n}\n\n/** @internal */\nexport function assertGitHubRepository(profile: GitHubProfile, owner: string, repo: string): void {\n\tif (\n\t\t!/^[a-z0-9-]+$/i.test(owner) ||\n\t\t!/^[a-z0-9_.-]+$/i.test(repo) ||\n\t\trepo === \".\" ||\n\t\trepo === \"..\"\n\t) {\n\t\tthrow new Error(\"Invalid GitHub repository\");\n\t}\n\tif (\n\t\tprofile.allowedOrganization &&\n\t\towner.toLowerCase() !== profile.allowedOrganization.toLowerCase()\n\t) {\n\t\tthrow new Error(`GitHub project must belong to ${profile.allowedOrganization}`);\n\t}\n}\n\n/** @public */\nexport class GitHubClient extends RepositoryHttpClient {\n\t/** @internal */\n\tconstructor(\n\t\t/** @internal */\n\t\treadonly profile: GitHubProfile,\n\t) {\n\t\tsuper(\"GitHub\", profile.apiBaseUrl, {\n\t\t\tAccept: \"application/vnd.github+json\",\n\t\t\tAuthorization: `Bearer ${profile.token}`,\n\t\t\t\"X-GitHub-Api-Version\": \"2022-11-28\",\n\t\t});\n\t}\n\n\t/** @internal */\n\tprotected override response(path: string, init: RequestInit = {}): Promise<Response> {\n\t\treturn super.response(path, {\n\t\t\t...init,\n\t\t\tredirect: \"error\",\n\t\t\tsignal: init.signal ?? AbortSignal.timeout(30_000),\n\t\t});\n\t}\n\n\t/** @internal */\n\tprotected override repositoryPath(owner: string, repo: string): string {\n\t\tassertGitHubRepository(this.profile, owner, repo);\n\t\treturn super.repositoryPath(owner, repo);\n\t}\n\n\t/** @internal */\n\tasync listRepositories() {\n\t\treturn (\n\t\t\tawait this.pages<GitHubRepository>(\n\t\t\t\tthis.profile.allowedOrganization\n\t\t\t\t\t? `/orgs/${this.profile.allowedOrganization}/repos?type=all`\n\t\t\t\t\t: \"/user/repos?affiliation=owner,collaborator,organization_member\",\n\t\t\t)\n\t\t).filter(\n\t\t\t(repo) =>\n\t\t\t\t(!this.profile.allowedOrganization ||\n\t\t\t\t\trepo.owner.login.toLowerCase() === this.profile.allowedOrganization.toLowerCase()) &&\n\t\t\t\t!repo.archived &&\n\t\t\t\trepo.has_issues,\n\t\t);\n\t}\n\t/** @internal */\n\tasync listOpenIssues(owner: string, repo: string) {\n\t\treturn (\n\t\t\tawait this.pages<\n\t\t\t\tGitHubIssue & {\n\t\t\t\t\t/** @internal */\n\t\t\t\t\tpull_request?: unknown;\n\t\t\t\t}\n\t\t\t>(`${this.repositoryPath(owner, repo)}/issues?state=open`)\n\t\t).filter((issue) => !issue.pull_request);\n\t}\n\t/** @internal */\n\tlistIssueEvents(owner: string, repo: string, number: number) {\n\t\treturn this.pages<GitHubLabelEvent>(\n\t\t\t`${this.repositoryPath(owner, repo)}/issues/${number}/events`,\n\t\t);\n\t}\n\t/** @internal */\n\tasync isOrganizationMember(login: string): Promise<boolean> {\n\t\tif (!this.profile.allowedOrganization) return true;\n\t\tif (!/^[a-z0-9-]+$/i.test(login)) return false;\n\t\ttry {\n\t\t\tconst response = await this.response(\n\t\t\t\t`/orgs/${this.profile.allowedOrganization}/members/${encodeURIComponent(login)}`,\n\t\t\t);\n\t\t\treturn response.status === 204;\n\t\t} catch (error) {\n\t\t\tif (error instanceof IntegrationHttpError) {\n\t\t\t\tif (error.status === 404) return false;\n\t\t\t\tthrow new Error(`GitHub membership check failed with ${error.status}`);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\t/** @internal */\n\tasync authorizedTrigger(\n\t\towner: string,\n\t\trepo: string,\n\t\tnumber: number,\n\t\ttrigger: string,\n\t\tdone: string,\n\t) {\n\t\treturn authorizedTrigger(this, owner, repo, number, trigger, done);\n\t}\n\t/** @public */\n\tasync resolveGitIdentity(profile: string): Promise<GitHubGitIdentity> {\n\t\tconst user = await this.request<{ login: string; name: string | null; id: number }>(\"/user\");\n\t\tif (user.login !== this.profile.botLogin)\n\t\t\tthrow new Error(\"GitHub authenticated user does not match bot_login\");\n\t\treturn {\n\t\t\tprovider: \"github\",\n\t\t\tprofile,\n\t\t\tlogin: user.login,\n\t\t\tname: user.name || user.login,\n\t\t\temail: `${user.id}+${user.login}@users.noreply.github.com`,\n\t\t};\n\t}\n\t/** @public */\n\tupdateIssue(owner: string, repo: string, number: number, patch: Record<string, unknown>) {\n\t\treturn this.request<GitHubIssue>(`${this.repositoryPath(owner, repo)}/issues/${number}`, {\n\t\t\tmethod: \"PATCH\",\n\t\t\tbody: JSON.stringify(patch),\n\t\t});\n\t}\n\t/** @internal */\n\tlistLabels(owner: string, repo: string) {\n\t\treturn this.pages<GitHubLabel>(`${this.repositoryPath(owner, repo)}/labels`);\n\t}\n\t/** @internal */\n\tcreateLabel(owner: string, repo: string, name: string) {\n\t\treturn this.request<GitHubLabel>(`${this.repositoryPath(owner, repo)}/labels`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({ name, color: \"238636\" }),\n\t\t});\n\t}\n\t/** @internal */\n\tasync ensureLabel(owner: string, repo: string, name: string) {\n\t\tconst labels = await this.listLabels(owner, repo);\n\t\treturn labels.find((label) => label.name === name) ?? this.createLabel(owner, repo, name);\n\t}\n\t/** @internal */\n\taddFeedbackReaction(owner: string, repo: string, kind: string, id: number) {\n\t\tconst segment = kind === \"inline\" ? \"pulls/comments\" : \"issues/comments\";\n\t\treturn this.request(`${this.repositoryPath(owner, repo)}/${segment}/${id}/reactions`, {\n\t\t\tmethod: \"POST\",\n\t\t\tbody: JSON.stringify({ content: \"eyes\" }),\n\t\t});\n\t}\n\t/** @internal */\n\tasync replyFeedback(\n\t\towner: string,\n\t\trepo: string,\n\t\tpr: number,\n\t\tkind: string,\n\t\tid: number,\n\t\tbody: string,\n\t) {\n\t\tif (kind === \"inline\")\n\t\t\treturn this.writeJson(\n\t\t\t\t`${this.repositoryPath(owner, repo)}/pulls/${pr}/comments/${id}/replies`,\n\t\t\t\t\"POST\",\n\t\t\t\t{ body },\n\t\t\t);\n\t\treturn this.addIssueComment(owner, repo, pr, body);\n\t}\n\n\t/** @internal */\n\tgetCommit(owner: string, repo: string, ref: string) {\n\t\treturn this.request<{\n\t\t\t/** @internal */\n\t\t\tsha: string;\n\t\t}>(`${this.repositoryPath(owner, repo)}/commits/${encodeURIComponent(ref)}`);\n\t}\n\n\t/** @public */\n\tasync isAncestor(owner: string, repo: string, ancestor: string, descendant: string) {\n\t\tconst comparison = await this.request<{ status: string }>(\n\t\t\t`${this.repositoryPath(owner, repo)}/compare/${encodeURIComponent(ancestor)}...${encodeURIComponent(descendant)}`,\n\t\t);\n\t\treturn comparison.status === \"identical\" || comparison.status === \"ahead\";\n\t}\n\n\t/** @public */\n\tasync listPullRequestFeedback(\n\t\towner: string,\n\t\trepo: string,\n\t\tnumber: number,\n\t\tsignal?: AbortSignal,\n\t): Promise<GitHubFeedbackItem[]> {\n\t\tconst prefix = `${this.repositoryPath(owner, repo)}`;\n\t\tconst [conversation, reviews, inline] = await Promise.all([\n\t\t\tthis.pages<Record<string, unknown>>(`${prefix}/issues/${number}/comments`, signal),\n\t\t\tthis.pages<Record<string, unknown>>(`${prefix}/pulls/${number}/reviews`, signal),\n\t\t\tthis.pages<Record<string, unknown>>(`${prefix}/pulls/${number}/comments`, signal),\n\t\t]);\n\n\t\tconst candidates = [\n\t\t\t...conversation.map((item) => ({ kind: \"conversation\" as const, item })),\n\t\t\t...reviews.map((item) => ({ kind: \"review\" as const, item })),\n\t\t\t...inline.map((item) => ({ kind: \"inline\" as const, item })),\n\t\t];\n\t\tconst feedback: GitHubFeedbackItem[] = [];\n\t\tconst needsProvenance: typeof candidates = [];\n\t\tfor (const candidate of candidates) {\n\t\t\tconst { kind, item } = candidate;\n\t\t\tconst normalized = normalize(kind, item);\n\t\t\tif (!normalized) continue;\n\t\t\tconst createdAt = typeof item.created_at === \"string\" ? Date.parse(item.created_at) : NaN;\n\t\t\tconst updatedAt = typeof item.updated_at === \"string\" ? Date.parse(item.updated_at) : NaN;\n\t\t\tif (\n\t\t\t\t!this.profile.allowedOrganization ||\n\t\t\t\t(kind !== \"review\" && Number.isFinite(createdAt) && createdAt === updatedAt)\n\t\t\t) {\n\t\t\t\tfeedback.push(normalized);\n\t\t\t} else if (typeof item.node_id === \"string\" && item.node_id) {\n\t\t\t\t// REST attributes edited bodies to their original author. Reviews also\n\t\t\t\t// omit edit timestamps, so obtain the body and latest editor together.\n\t\t\t\tneedsProvenance.push(candidate);\n\t\t\t}\n\t\t}\n\t\tfor (let offset = 0; offset < needsProvenance.length; offset += 100) {\n\t\t\tconst batch = needsProvenance.slice(offset, offset + 100);\n\t\t\tconst response = await this.request<{\n\t\t\t\tdata?: { nodes?: Array<Record<string, unknown> | null> };\n\t\t\t\terrors?: unknown[];\n\t\t\t}>(\"/graphql\", {\n\t\t\t\tmethod: \"POST\",\n\t\t\t\tsignal,\n\t\t\t\tbody: JSON.stringify({\n\t\t\t\t\tquery: `query LeitwerkFeedbackProvenance($ids: [ID!]!) {\n\t\t\t\t\t\tnodes(ids: $ids) {\n\t\t\t\t\t\t\tid __typename\n\t\t\t\t\t\t\t... on IssueComment { body createdAt lastEditedAt author { login } editor { login } }\n\t\t\t\t\t\t\t... on PullRequestReview { body createdAt submittedAt lastEditedAt author { login } editor { login } }\n\t\t\t\t\t\t\t... on PullRequestReviewComment { body createdAt lastEditedAt author { login } editor { login } path line }\n\t\t\t\t\t\t}\n\t\t\t\t\t}`,\n\t\t\t\t\tvariables: { ids: batch.map(({ item }) => item.node_id) },\n\t\t\t\t}),\n\t\t\t});\n\t\t\tif (response.errors?.length || !Array.isArray(response.data?.nodes)) {\n\t\t\t\tthrow new Error(\"GitHub feedback provenance lookup failed\");\n\t\t\t}\n\t\t\tconst snapshots = new Map(\n\t\t\t\tresponse.data.nodes.filter((node) => node !== null).map((node) => [node.id, node]),\n\t\t\t);\n\t\t\tfor (const { kind, item } of batch) {\n\t\t\t\tconst snapshot = snapshots.get(item.node_id);\n\t\t\t\tconst expectedType = {\n\t\t\t\t\tconversation: \"IssueComment\",\n\t\t\t\t\treview: \"PullRequestReview\",\n\t\t\t\t\tinline: \"PullRequestReviewComment\",\n\t\t\t\t}[kind];\n\t\t\t\tif (!snapshot || snapshot.__typename !== expectedType) continue;\n\t\t\t\tconst publishedAt = kind === \"review\" ? snapshot.submittedAt : snapshot.createdAt;\n\t\t\t\tif (typeof publishedAt !== \"string\" || !Number.isFinite(Date.parse(publishedAt))) continue;\n\t\t\t\tconst editedAt = snapshot.lastEditedAt;\n\t\t\t\tif (editedAt !== null) {\n\t\t\t\t\tif (typeof editedAt !== \"string\" || !Number.isFinite(Date.parse(editedAt))) continue;\n\t\t\t\t\tconst editor = asUnknownRecord(snapshot.editor)?.login;\n\t\t\t\t\tif (typeof editor !== \"string\" || !(await this.isOrganizationMember(editor))) continue;\n\t\t\t\t}\n\t\t\t\tconst normalized = normalize(kind, {\n\t\t\t\t\t...snapshot,\n\t\t\t\t\tid: item.id,\n\t\t\t\t\tuser: snapshot.author,\n\t\t\t\t\tcreated_at: editedAt ?? publishedAt,\n\t\t\t\t});\n\t\t\t\tif (normalized) feedback.push(normalized);\n\t\t\t}\n\t\t}\n\t\treturn feedback;\n\t}\n\n\t/** @public */\n\tasync getCheckSummary(owner: string, repo: string, headSha: string): Promise<GitHubCheckSummary> {\n\t\tconst runs: Array<Record<string, unknown>> = [];\n\t\tfor (let page = 1; ; page++) {\n\t\t\tconst response = await this.request<{ check_runs: Array<Record<string, unknown>> }>(\n\t\t\t\t`${this.repositoryPath(owner, repo)}/commits/${headSha}/check-runs?per_page=100&page=${page}`,\n\t\t\t);\n\t\t\truns.push(...response.check_runs);\n\t\t\tif (response.check_runs.length < 100) break;\n\t\t}\n\t\tconst terminalSuccess = new Set([\"success\", \"neutral\", \"skipped\"]);\n\t\tconst failed = runs\n\t\t\t.filter((run) => run.status === \"completed\" && !terminalSuccess.has(String(run.conclusion)))\n\t\t\t.map((run) => ({\n\t\t\t\tname: String(run.name ?? \"unknown\"),\n\t\t\t\tconclusion: typeof run.conclusion === \"string\" ? run.conclusion : null,\n\t\t\t\turl: typeof run.html_url === \"string\" ? run.html_url : null,\n\t\t\t}));\n\t\tconst pending = runs.some((run) => run.status !== \"completed\");\n\t\treturn {\n\t\t\theadSha,\n\t\t\tstatus: failed.length ? \"failure\" : pending || !runs.length ? \"pending\" : \"success\",\n\t\t\ttotal: runs.length,\n\t\t\tfailed,\n\t\t};\n\t}\n\n\t/** Human feedback checked against current membership; delivery receipts use raw reads. @internal */\n\tasync listActionablePullRequestFeedback(\n\t\towner: string,\n\t\trepo: string,\n\t\tnumber: number,\n\t\tsignal?: AbortSignal,\n\t) {\n\t\treturn actionableFeedback(\n\t\t\tthis,\n\t\t\tawait this.listPullRequestFeedback(owner, repo, number, signal),\n\t\t);\n\t}\n\n\t/** @internal */\n\tlistFeedbackReplies(owner: string, repo: string, pr: number, kind: string) {\n\t\treturn kind === \"inline\"\n\t\t\t? this.pages<Record<string, unknown>>(\n\t\t\t\t\t`${this.repositoryPath(owner, repo)}/pulls/${pr}/comments`,\n\t\t\t\t)\n\t\t\t: this.listIssueComments(owner, repo, pr);\n\t}\n\n\t/** @internal */\n\tlistFeedbackReactions(owner: string, repo: string, kind: string, id: number) {\n\t\tif (kind !== \"inline\" && kind !== \"conversation\")\n\t\t\tthrow new Error(\"Reviews do not support reactions\");\n\t\tconst segment = kind === \"inline\" ? \"pulls/comments\" : \"issues/comments\";\n\t\treturn this.pages<{\n\t\t\t/** @internal */\n\t\t\tid: number;\n\t\t\t/** @internal */\n\t\t\tcontent: string;\n\t\t\t/** @internal */\n\t\t\tuser: {\n\t\t\t\t/** @internal */\n\t\t\t\tlogin: string;\n\t\t\t};\n\t\t}>(`${this.repositoryPath(owner, repo)}/${segment}/${id}/reactions`);\n\t}\n\n\t/** @internal */\n\tlistReleases(owner: string, repo: string) {\n\t\treturn this.pages<GitHubRelease>(`${this.repositoryPath(owner, repo)}/releases`);\n\t}\n\n\t/** @public */\n\tdownloadReleaseAsset(asset: GitHubRelease[\"assets\"][number]): Promise<string> {\n\t\tconst url = new URL(asset.url);\n\t\tif (`${url.protocol}//${url.host}` !== this.profile.apiBaseUrl)\n\t\t\tthrow new Error(\"GitHub release asset URL does not match the configured API origin\");\n\t\treturn this.response(`${url.pathname}${url.search}`, {\n\t\t\theaders: { Accept: \"application/octet-stream\" },\n\t\t}).then((response) => response.text());\n\t}\n}\n"],"mappings":";AAIA,eAAsB,kBACrB,QACA,OACA,MACA,QACA,SACA,MACC;AACD,MACC,OAAO,QAAQ,uBACf,MAAM,YAAY,MAAM,OAAO,QAAQ,oBAAoB,YAAY;AAEvE,WAAO;AACR,QAAM,QAAS,MAAM,OAAO,SAAS,OAAO,MAAM,MAAM;AAIxD,MACC,MAAM,gBACN,MAAM,UAAU,UAChB,CAAC,MAAM,OAAO,KAAK,CAAC,UAAU,MAAM,SAAS,OAAO,KACpD,MAAM,OAAO,KAAK,CAAC,UAAU,MAAM,SAAS,IAAI;AAEhD,WAAO;AACR,QAAM,QAAQ,MAAM,OAAO,gBAAgB,OAAO,MAAM,MAAM,GAC5D;AAAA,IACA,CAAC,WACC,MAAM,UAAU,aAAa,MAAM,UAAU,gBAAgB,MAAM,OAAO,SAAS;AAAA,EACtF,EACC,KAAK,CAAC,GAAG,MAAM,EAAE,KAAK,EAAE,EAAE,EAAE,CAAC;AAC/B,MACC,MAAM,UAAU,aAChB,CAAC,KAAK,OAAO,SACb,CAAE,MAAM,OAAO,qBAAqB,KAAK,MAAM,KAAK;AAEpD,WAAO;AACR,SAAO;AAAA;AAAA,IAEN;AAAA;AAAA,IAEA,OAAO,KAAK,MAAM;AAAA;AAAA,IAElB,SAAS,KAAK;AAAA,EACf;AACD;AAEA,eAAsB,mBAAmB,QAA0B,UAAgC;AAClG,QAAM,aAAmC,CAAC;AAC1C,aAAW,QAAQ,UAAU;AAC5B,QACC,KAAK,OAAO,YAAY,MAAM,OAAO,QAAQ,SAAS,YAAY,KAClE,KAAK,KAAK,SAAS,sBAAsB;AAEzC;AACD,QAAI,MAAM,OAAO,qBAAqB,KAAK,MAAM,EAAG,YAAW,KAAK,IAAI;AAAA,EACzE;AACA,SAAO;AACR;;;AC7DA,SAAS,uBAAuB;AAChC;AAAA,EAIC;AAAA,EACA,+BAA+B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ssue as GitHubIssue, type RepositoryPullRequest as GitHubPullRequest, RepositoryHttpClient } from "@leitwerk-dev/process-sdk";
|
|
2
2
|
export type { GitHubFeedbackItem, GitHubIssue, GitHubPullRequest };
|
|
3
|
+
/** @public */
|
|
3
4
|
export interface GitHubRepository {
|
|
5
|
+
/** @public */
|
|
4
6
|
name: string;
|
|
7
|
+
/** @internal */
|
|
5
8
|
full_name: string;
|
|
9
|
+
/** @public */
|
|
6
10
|
owner: {
|
|
11
|
+
/** @public */
|
|
7
12
|
login: string;
|
|
8
13
|
};
|
|
14
|
+
/** @public */
|
|
9
15
|
ssh_url: string;
|
|
16
|
+
/** @public */
|
|
10
17
|
default_branch: string;
|
|
18
|
+
/** @internal */
|
|
11
19
|
html_url: string;
|
|
20
|
+
/** @internal */
|
|
12
21
|
archived: boolean;
|
|
22
|
+
/** @internal */
|
|
13
23
|
has_issues: boolean;
|
|
14
24
|
}
|
|
25
|
+
/** @public */
|
|
15
26
|
export interface GitHubGitIdentity {
|
|
27
|
+
/** @internal */
|
|
16
28
|
provider: "github";
|
|
29
|
+
/** @internal */
|
|
17
30
|
profile: string;
|
|
31
|
+
/** @internal */
|
|
18
32
|
login: string;
|
|
33
|
+
/** @public */
|
|
19
34
|
name: string;
|
|
35
|
+
/** @public */
|
|
20
36
|
email: string;
|
|
21
37
|
}
|
|
38
|
+
/** @public */
|
|
22
39
|
export interface GitHubLabelEvent {
|
|
40
|
+
/** @internal */
|
|
23
41
|
id: number;
|
|
42
|
+
/** @internal */
|
|
24
43
|
event: string;
|
|
44
|
+
/** @internal */
|
|
25
45
|
label?: {
|
|
46
|
+
/** @internal */
|
|
26
47
|
name: string;
|
|
27
48
|
};
|
|
49
|
+
/** @internal */
|
|
28
50
|
actor: {
|
|
51
|
+
/** @internal */
|
|
29
52
|
login: string;
|
|
30
53
|
} | null;
|
|
31
54
|
}
|
|
55
|
+
/** @internal */
|
|
56
|
+
interface GitHubLabel {
|
|
57
|
+
/** @internal */
|
|
58
|
+
id: number;
|
|
59
|
+
/** @internal */
|
|
60
|
+
name: string;
|
|
61
|
+
}
|
|
62
|
+
/** @internal */
|
|
32
63
|
export interface GitHubProfile {
|
|
64
|
+
/** @internal */
|
|
33
65
|
apiBaseUrl: string;
|
|
66
|
+
/** @internal */
|
|
34
67
|
token: string;
|
|
68
|
+
/** @internal */
|
|
35
69
|
botLogin: string;
|
|
70
|
+
/** @internal */
|
|
36
71
|
allowedOrganization?: string;
|
|
37
72
|
}
|
|
73
|
+
/** @public */
|
|
38
74
|
export interface GitHubCheckSummary {
|
|
75
|
+
/** @public */
|
|
39
76
|
headSha: string;
|
|
77
|
+
/** @public */
|
|
40
78
|
status: "pending" | "success" | "failure";
|
|
79
|
+
/** @public */
|
|
41
80
|
total: number;
|
|
81
|
+
/** @public */
|
|
42
82
|
failed: Array<{
|
|
83
|
+
/** @public */
|
|
43
84
|
name: string;
|
|
85
|
+
/** @public */
|
|
44
86
|
conclusion: string | null;
|
|
87
|
+
/** @public */
|
|
45
88
|
url: string | null;
|
|
46
89
|
}>;
|
|
47
90
|
}
|
|
91
|
+
/** @public */
|
|
48
92
|
export interface GitHubRelease {
|
|
93
|
+
/** @internal */
|
|
49
94
|
id: number;
|
|
95
|
+
/** @public */
|
|
50
96
|
tag_name: string;
|
|
97
|
+
/** @internal */
|
|
51
98
|
target_commitish: string;
|
|
99
|
+
/** @internal */
|
|
52
100
|
draft: boolean;
|
|
101
|
+
/** @internal */
|
|
53
102
|
prerelease: boolean;
|
|
103
|
+
/** @internal */
|
|
54
104
|
html_url: string;
|
|
105
|
+
/** @public */
|
|
55
106
|
assets: Array<{
|
|
107
|
+
/** @internal */
|
|
56
108
|
name: string;
|
|
109
|
+
/** @internal */
|
|
57
110
|
url: string;
|
|
111
|
+
/** @internal */
|
|
58
112
|
browser_download_url: string;
|
|
59
113
|
}>;
|
|
60
114
|
}
|
|
115
|
+
/** @internal */
|
|
61
116
|
export declare function parseGitHubProfiles(value: unknown): Map<string, GitHubProfile>;
|
|
117
|
+
/** @internal */
|
|
62
118
|
export declare function assertGitHubRepository(profile: GitHubProfile, owner: string, repo: string): void;
|
|
119
|
+
/** @public */
|
|
63
120
|
export declare class GitHubClient extends RepositoryHttpClient {
|
|
121
|
+
/** @internal */
|
|
64
122
|
readonly profile: GitHubProfile;
|
|
65
|
-
|
|
123
|
+
/** @internal */
|
|
124
|
+
constructor(
|
|
125
|
+
/** @internal */
|
|
126
|
+
profile: GitHubProfile);
|
|
127
|
+
/** @internal */
|
|
66
128
|
protected response(path: string, init?: RequestInit): Promise<Response>;
|
|
129
|
+
/** @internal */
|
|
67
130
|
protected repositoryPath(owner: string, repo: string): string;
|
|
131
|
+
/** @internal */
|
|
68
132
|
listRepositories(): Promise<GitHubRepository[]>;
|
|
133
|
+
/** @internal */
|
|
69
134
|
listOpenIssues(owner: string, repo: string): Promise<(GitHubIssue & {
|
|
135
|
+
/** @internal */
|
|
70
136
|
pull_request?: unknown;
|
|
71
137
|
})[]>;
|
|
138
|
+
/** @internal */
|
|
72
139
|
listIssueEvents(owner: string, repo: string, number: number): Promise<GitHubLabelEvent[]>;
|
|
140
|
+
/** @internal */
|
|
73
141
|
isOrganizationMember(login: string): Promise<boolean>;
|
|
142
|
+
/** @internal */
|
|
74
143
|
authorizedTrigger(owner: string, repo: string, number: number, trigger: string, done: string): Promise<{
|
|
144
|
+
/** @internal */
|
|
75
145
|
issue: GitHubIssue & {
|
|
146
|
+
/** @internal */
|
|
76
147
|
pull_request?: unknown;
|
|
77
148
|
};
|
|
149
|
+
/** @internal */
|
|
78
150
|
actor: string;
|
|
151
|
+
/** @internal */
|
|
79
152
|
eventId: number;
|
|
80
153
|
} | null>;
|
|
154
|
+
/** @public */
|
|
81
155
|
resolveGitIdentity(profile: string): Promise<GitHubGitIdentity>;
|
|
156
|
+
/** @public */
|
|
82
157
|
updateIssue(owner: string, repo: string, number: number, patch: Record<string, unknown>): Promise<GitHubIssue>;
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
86
|
-
|
|
87
|
-
|
|
88
|
-
|
|
89
|
-
|
|
158
|
+
/** @internal */
|
|
159
|
+
listLabels(owner: string, repo: string): Promise<GitHubLabel[]>;
|
|
160
|
+
/** @internal */
|
|
161
|
+
createLabel(owner: string, repo: string, name: string): Promise<GitHubLabel>;
|
|
162
|
+
/** @internal */
|
|
163
|
+
ensureLabel(owner: string, repo: string, name: string): Promise<GitHubLabel>;
|
|
164
|
+
/** @internal */
|
|
90
165
|
addFeedbackReaction(owner: string, repo: string, kind: string, id: number): Promise<unknown>;
|
|
166
|
+
/** @internal */
|
|
91
167
|
replyFeedback(owner: string, repo: string, pr: number, kind: string, id: number, body: string): Promise<unknown>;
|
|
168
|
+
/** @internal */
|
|
92
169
|
getCommit(owner: string, repo: string, ref: string): Promise<{
|
|
170
|
+
/** @internal */
|
|
93
171
|
sha: string;
|
|
94
172
|
}>;
|
|
173
|
+
/** @public */
|
|
95
174
|
isAncestor(owner: string, repo: string, ancestor: string, descendant: string): Promise<boolean>;
|
|
175
|
+
/** @public */
|
|
96
176
|
listPullRequestFeedback(owner: string, repo: string, number: number, signal?: AbortSignal): Promise<GitHubFeedbackItem[]>;
|
|
177
|
+
/** @public */
|
|
97
178
|
getCheckSummary(owner: string, repo: string, headSha: string): Promise<GitHubCheckSummary>;
|
|
98
|
-
/** Human feedback checked against current membership; delivery receipts use raw reads. */
|
|
179
|
+
/** Human feedback checked against current membership; delivery receipts use raw reads. @internal */
|
|
99
180
|
listActionablePullRequestFeedback(owner: string, repo: string, number: number, signal?: AbortSignal): Promise<GitHubFeedbackItem[]>;
|
|
181
|
+
/** @internal */
|
|
100
182
|
listFeedbackReplies(owner: string, repo: string, pr: number, kind: string): Promise<Record<string, unknown>[]>;
|
|
183
|
+
/** @internal */
|
|
101
184
|
listFeedbackReactions(owner: string, repo: string, kind: string, id: number): Promise<{
|
|
185
|
+
/** @internal */
|
|
102
186
|
id: number;
|
|
187
|
+
/** @internal */
|
|
103
188
|
content: string;
|
|
189
|
+
/** @internal */
|
|
104
190
|
user: {
|
|
191
|
+
/** @internal */
|
|
105
192
|
login: string;
|
|
106
193
|
};
|
|
107
194
|
}[]>;
|
|
195
|
+
/** @internal */
|
|
108
196
|
listReleases(owner: string, repo: string): Promise<GitHubRelease[]>;
|
|
197
|
+
/** @public */
|
|
109
198
|
downloadReleaseAsset(asset: GitHubRelease["assets"][number]): Promise<string>;
|
|
110
199
|
}
|
|
111
200
|
//# sourceMappingURL=client.d.ts.map
|
package/dist/client.d.ts.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,sBAAsB,IAAI,kBAAkB,EACjD,KAAK,eAAe,IAAI,WAAW,EACnC,KAAK,qBAAqB,IAAI,iBAAiB,EAG/C,oBAAoB,EACpB,MAAM,2BAA2B,CAAC;AAInC,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAEnE,MAAM,WAAW,gBAAgB;IAChC,IAAI,EAAE,MAAM,CAAC;IACb,SAAS,EAAE,MAAM,CAAC;IAClB,KAAK,EAAE;
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../src/client.ts"],"names":[],"mappings":"AACA,OAAO,EACN,KAAK,sBAAsB,IAAI,kBAAkB,EACjD,KAAK,eAAe,IAAI,WAAW,EACnC,KAAK,qBAAqB,IAAI,iBAAiB,EAG/C,oBAAoB,EACpB,MAAM,2BAA2B,CAAC;AAInC,YAAY,EAAE,kBAAkB,EAAE,WAAW,EAAE,iBAAiB,EAAE,CAAC;AAEnE,cAAc;AACd,MAAM,WAAW,gBAAgB;IAChC,cAAc;IACd,IAAI,EAAE,MAAM,CAAC;IACb,gBAAgB;IAChB,SAAS,EAAE,MAAM,CAAC;IAClB,cAAc;IACd,KAAK,EAAE;QACN,cAAc;QACd,KAAK,EAAE,MAAM,CAAC;KACd,CAAC;IACF,c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