@theholocron/github-client 1.32.1 → 1.34.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/dist/index.d.mts CHANGED
@@ -221,12 +221,28 @@ interface GitHubPullRequest {
221
221
  ref: string;
222
222
  };
223
223
  }
224
+ /** A commit's name/email as git itself recorded it — `commit.author`/`commit.committer`, distinct from the GitHub-account `author` below (a commit can carry any email, linked to a GitHub account or not). */
225
+ interface GitHubCommitIdentity {
226
+ name: string;
227
+ email: string;
228
+ }
224
229
  /** One commit as returned by `GET /pulls/{pull_number}/commits` — only the fields any known consumer needs. */
225
230
  interface GitHubPullRequestCommit {
226
231
  sha: string;
227
232
  commit: {
228
233
  message: string;
234
+ author: GitHubCommitIdentity;
235
+ committer: GitHubCommitIdentity;
229
236
  };
237
+ /** The commit's linked GitHub account, when GitHub can associate one — `null` for a commit email with no linked account. `type: "Bot"` identifies an app-authored commit (e.g. Dependabot, a prior Sentinel auto-fix-commit). */
238
+ author: {
239
+ login: string;
240
+ type: "User" | "Bot";
241
+ } | null;
242
+ /** More than one entry marks a merge commit — it has no authorship of its own beyond its parents', the reason DCO enforcement (and this org's own CI) never requires a signoff on one. */
243
+ parents: Array<{
244
+ sha: string;
245
+ }>;
230
246
  }
231
247
  /** One file as returned by `GET /pulls/{pull_number}/files` — only the fields any known consumer needs. */
232
248
  interface GitHubPullRequestFile {
@@ -276,6 +292,19 @@ interface ReviewThread {
276
292
  isResolved: boolean;
277
293
  /** The thread's first comment's author login (e.g. `"the-holocron-sentinel[bot]"`) — `undefined` if GitHub ever returns a thread with no comments, which shouldn't happen in practice. Callers filter on this before resolving anything, so a bot never touches a human reviewer's own thread. */
278
294
  authorLogin: string | undefined;
295
+ /** The file the thread is anchored to on the PR's current diff — `null` once GitHub can no longer place it there (e.g. the file was since deleted). */
296
+ path: string | null;
297
+ /** 1-indexed line the thread is anchored to — `null` in the same "can no longer place it" case as `path`. */
298
+ line: number | null;
299
+ /**
300
+ * The thread's first comment's own body — the exact text a caller like
301
+ * Sentinel posted for a specific finding. Lets a caller diff a prior
302
+ * thread's own content against the current push's findings (holocron#860)
303
+ * to decide whether that finding is still live, rather than only knowing
304
+ * a thread exists. `undefined` in the same no-comments case as
305
+ * `authorLogin`.
306
+ */
307
+ body: string | undefined;
279
308
  }
280
309
  //#endregion
281
310
  //#region ../../../../../src/repos/repos.d.ts
package/dist/index.mjs CHANGED
@@ -276,9 +276,12 @@ const LIST_REVIEW_THREADS_QUERY = `
276
276
  nodes {
277
277
  id
278
278
  isResolved
279
+ path
280
+ line
279
281
  comments(first: 1) {
280
282
  nodes {
281
283
  author { login }
284
+ body
282
285
  }
283
286
  }
284
287
  }
@@ -331,7 +334,10 @@ function pulls(rest, graphql) {
331
334
  })).repository.pullRequest.reviewThreads.nodes.map((node) => ({
332
335
  id: node.id,
333
336
  isResolved: node.isResolved,
334
- authorLogin: node.comments.nodes[0]?.author?.login
337
+ path: node.path,
338
+ line: node.line,
339
+ authorLogin: node.comments.nodes[0]?.author?.login,
340
+ body: node.comments.nodes[0]?.body
335
341
  }));
336
342
  },
337
343
  /**
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@theholocron/github-client",
3
- "version": "1.32.1",
3
+ "version": "1.34.0",
4
4
  "description": "A TypeScript client for the GitHub REST API",
5
5
  "keywords": [
6
6
  "github",
@@ -33,7 +33,7 @@
33
33
  ],
34
34
  "dependencies": {
35
35
  "@theholocron/observability": "^0.3.0",
36
- "@theholocron/http-client": "^1.32.1"
36
+ "@theholocron/http-client": "^1.34.0"
37
37
  },
38
38
  "devDependencies": {
39
39
  "@theholocron/cli": "5.0.0-alpha.79",