@cesar-richard/git-connector-sdk 2.7.0 → 2.8.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/README.md CHANGED
@@ -317,9 +317,11 @@ cross-provider work is consolidated: the issue is the pivot.
317
317
 
318
318
  ### PR review status (`reviewStatus`)
319
319
 
320
- Each `LinkedActivity` carries an optional `reviewStatus` field with 8 possible
321
- values, computed server-side from the PR's state, draft flag, requested
322
- reviewers, and review history:
320
+ `reviewStatus` is carried by both `LinkedActivity` (on `/v1/work-items`) and
321
+ `Activity` (on `/v1/activities`), computed server-side from the PR's state,
322
+ draft flag, requested reviewers, and review history. It has 8 possible values —
323
+ plus `null` on `/v1/activities` for items of type `issue`, which are not under
324
+ review at all:
323
325
 
324
326
  | Value | Meaning |
325
327
  |---|---|
@@ -350,6 +352,42 @@ for (const wi of data.items) {
350
352
  }
351
353
  ```
352
354
 
355
+ ### Who is reviewing what (`requestedReviewer`)
356
+
357
+ `/v1/work-items` only reaches PR/MR that are **linked to an issue**. A merge
358
+ request with a requested reviewer but no issue link is invisible there — which
359
+ is exactly the case most likely to go unnoticed. `/v1/activities` has no such
360
+ constraint, and carries the same review fields: `requestedReviewers`,
361
+ `requestedReviewersResolved`, `awaitingReview`, `reviewRequestedAt` and
362
+ `reviewStatus`.
363
+
364
+ Filter with `?requestedReviewer=<login>` (CSV, case-insensitive, OR within,
365
+ AND with every other filter). Do not confuse it with `/v1/work-items`'
366
+ `?reviewerIs`, which matches items someone has **already reviewed**, not those
367
+ **awaiting** their review.
368
+
369
+ ```ts
370
+ const { data } = await client.GET("/v1/activities", {
371
+ params: {
372
+ query: {
373
+ requestedReviewer: "cesar",
374
+ state: "open",
375
+ viewer: "cesar",
376
+ },
377
+ },
378
+ });
379
+ for (const a of data.items) {
380
+ const names = (a.requestedReviewersResolved ?? []).map(r => r.name ?? r.login);
381
+ console.log(`${a.url} — ${a.reviewStatus} — ${names.join(", ")}`);
382
+ }
383
+ ```
384
+
385
+ To cover every alias of the same person, use `?reviewerIdentity=<id>` — the
386
+ reviewer-side counterpart of `?identity` (which filters on the author). The two
387
+ reviewer parameters are mutually exclusive, as are `?identity` and `?author`.
388
+ GitLab reviewer logins are sometimes numeric strings (`"7066488"`); those are
389
+ usernames like any other, and `/v1/identities` resolves them normally.
390
+
353
391
  ---
354
392
 
355
393
  ## API surface
package/dist/schema.d.ts CHANGED
@@ -247,6 +247,20 @@ export interface components {
247
247
  createdAt: string;
248
248
  updatedAt: string;
249
249
  mergedAt: string | null;
250
+ /** @description Provider-side logins requested as reviewers (GH `requested_reviewers`, GL `reviewers`). Always empty for issues. GitLab usernames may be numeric strings — those are usernames like any other, not ids. Same field and semantic as LinkedActivity.requestedReviewers, so an activity carries it whether or not it is linked to an issue. */
251
+ requestedReviewers: string[];
252
+ /** @description Resolved form of `requestedReviewers` (id + login + name + email). Subset: only the logins the GitLab user cache could resolve. Fall back to the raw login from `requestedReviewers` for the rest. */
253
+ requestedReviewersResolved?: {
254
+ id: string;
255
+ login: string;
256
+ name: string | null;
257
+ email: string | null;
258
+ }[];
259
+ /** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
260
+ awaitingReview: boolean;
261
+ reviewRequestedAt: string | null;
262
+ /** @description Review lifecycle bucket, or null for issues — an issue is not under review, so no bucket applies. Pass ?viewer to split 'open-awaiting-my-review' from 'open-awaiting-other-review'; without it, a pending review always reads as 'open-awaiting-other-review'. */
263
+ reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
250
264
  authorIdentity?: {
251
265
  id: string | number;
252
266
  displayName: string;
@@ -276,6 +290,20 @@ export interface components {
276
290
  createdAt: string;
277
291
  updatedAt: string;
278
292
  mergedAt: string | null;
293
+ /** @description Provider-side logins requested as reviewers (GH `requested_reviewers`, GL `reviewers`). Always empty for issues. GitLab usernames may be numeric strings — those are usernames like any other, not ids. Same field and semantic as LinkedActivity.requestedReviewers, so an activity carries it whether or not it is linked to an issue. */
294
+ requestedReviewers: string[];
295
+ /** @description Resolved form of `requestedReviewers` (id + login + name + email). Subset: only the logins the GitLab user cache could resolve. Fall back to the raw login from `requestedReviewers` for the rest. */
296
+ requestedReviewersResolved?: {
297
+ id: string;
298
+ login: string;
299
+ name: string | null;
300
+ email: string | null;
301
+ }[];
302
+ /** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
303
+ awaitingReview: boolean;
304
+ reviewRequestedAt: string | null;
305
+ /** @description Review lifecycle bucket, or null for issues — an issue is not under review, so no bucket applies. Pass ?viewer to split 'open-awaiting-my-review' from 'open-awaiting-other-review'; without it, a pending review always reads as 'open-awaiting-other-review'. */
306
+ reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
279
307
  authorIdentity?: {
280
308
  id: string | number;
281
309
  displayName: string;
@@ -3785,6 +3813,12 @@ export interface operations {
3785
3813
  identity?: string;
3786
3814
  /** @description When '1', enriches each activity with `authorIdentity: { id, displayName } | null`. */
3787
3815
  withIdentity?: string;
3816
+ /** @description CSV of GitHub/GitLab logins requested as reviewers (case-insensitive, OR within, AND with the other filters). Answers 'what is waiting on this person's review?' — including PR/MR not linked to any issue, which `linkedActivities[]` on /v1/work-items cannot reach. Distinct from /v1/work-items' `reviewerIs`, which matches items ALREADY reviewed rather than awaiting review. Mutually exclusive with ?reviewerIdentity. */
3817
+ requestedReviewer?: string;
3818
+ /** @description Filter by the requested reviewer's user identity ID, resolving all of its aliases. The reviewer-side counterpart of ?identity (which filters on the author). Mutually exclusive with ?requestedReviewer. */
3819
+ reviewerIdentity?: string;
3820
+ /** @description Login (case-insensitive) used to compute `reviewStatus`. When the viewer is among a PR/MR's requested reviewers and no verdict is active, reviewStatus is 'open-awaiting-my-review' instead of 'open-awaiting-other-review'. */
3821
+ viewer?: string;
3788
3822
  /** @description CSV: open,draft,merged,closed,unknown. Default returns all states. */
3789
3823
  state?: string;
3790
3824
  /** @description CSV: pr,mr,issue. Default returns all. */
@@ -3827,6 +3861,20 @@ export interface operations {
3827
3861
  createdAt: string;
3828
3862
  updatedAt: string;
3829
3863
  mergedAt: string | null;
3864
+ /** @description Provider-side logins requested as reviewers (GH `requested_reviewers`, GL `reviewers`). Always empty for issues. GitLab usernames may be numeric strings — those are usernames like any other, not ids. Same field and semantic as LinkedActivity.requestedReviewers, so an activity carries it whether or not it is linked to an issue. */
3865
+ requestedReviewers: string[];
3866
+ /** @description Resolved form of `requestedReviewers` (id + login + name + email). Subset: only the logins the GitLab user cache could resolve. Fall back to the raw login from `requestedReviewers` for the rest. */
3867
+ requestedReviewersResolved?: {
3868
+ id: string;
3869
+ login: string;
3870
+ name: string | null;
3871
+ email: string | null;
3872
+ }[];
3873
+ /** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
3874
+ awaitingReview: boolean;
3875
+ reviewRequestedAt: string | null;
3876
+ /** @description Review lifecycle bucket, or null for issues — an issue is not under review, so no bucket applies. Pass ?viewer to split 'open-awaiting-my-review' from 'open-awaiting-other-review'; without it, a pending review always reads as 'open-awaiting-other-review'. */
3877
+ reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
3830
3878
  authorIdentity?: {
3831
3879
  id: string | number;
3832
3880
  displayName: string;
@@ -3857,6 +3905,20 @@ export interface operations {
3857
3905
  createdAt: string;
3858
3906
  updatedAt: string;
3859
3907
  mergedAt: string | null;
3908
+ /** @description Provider-side logins requested as reviewers (GH `requested_reviewers`, GL `reviewers`). Always empty for issues. GitLab usernames may be numeric strings — those are usernames like any other, not ids. Same field and semantic as LinkedActivity.requestedReviewers, so an activity carries it whether or not it is linked to an issue. */
3909
+ requestedReviewers: string[];
3910
+ /** @description Resolved form of `requestedReviewers` (id + login + name + email). Subset: only the logins the GitLab user cache could resolve. Fall back to the raw login from `requestedReviewers` for the rest. */
3911
+ requestedReviewersResolved?: {
3912
+ id: string;
3913
+ login: string;
3914
+ name: string | null;
3915
+ email: string | null;
3916
+ }[];
3917
+ /** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
3918
+ awaitingReview: boolean;
3919
+ reviewRequestedAt: string | null;
3920
+ /** @description Review lifecycle bucket, or null for issues — an issue is not under review, so no bucket applies. Pass ?viewer to split 'open-awaiting-my-review' from 'open-awaiting-other-review'; without it, a pending review always reads as 'open-awaiting-other-review'. */
3921
+ reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
3860
3922
  authorIdentity?: {
3861
3923
  id: string | number;
3862
3924
  displayName: string;
@@ -3887,6 +3949,20 @@ export interface operations {
3887
3949
  createdAt: string;
3888
3950
  updatedAt: string;
3889
3951
  mergedAt: string | null;
3952
+ /** @description Provider-side logins requested as reviewers (GH `requested_reviewers`, GL `reviewers`). Always empty for issues. GitLab usernames may be numeric strings — those are usernames like any other, not ids. Same field and semantic as LinkedActivity.requestedReviewers, so an activity carries it whether or not it is linked to an issue. */
3953
+ requestedReviewers: string[];
3954
+ /** @description Resolved form of `requestedReviewers` (id + login + name + email). Subset: only the logins the GitLab user cache could resolve. Fall back to the raw login from `requestedReviewers` for the rest. */
3955
+ requestedReviewersResolved?: {
3956
+ id: string;
3957
+ login: string;
3958
+ name: string | null;
3959
+ email: string | null;
3960
+ }[];
3961
+ /** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
3962
+ awaitingReview: boolean;
3963
+ reviewRequestedAt: string | null;
3964
+ /** @description Review lifecycle bucket, or null for issues — an issue is not under review, so no bucket applies. Pass ?viewer to split 'open-awaiting-my-review' from 'open-awaiting-other-review'; without it, a pending review always reads as 'open-awaiting-other-review'. */
3965
+ reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
3890
3966
  authorIdentity?: {
3891
3967
  id: string | number;
3892
3968
  displayName: string;
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cesar-richard/git-connector-sdk",
3
- "version": "2.7.0",
3
+ "version": "2.8.0",
4
4
  "description": "TypeScript SDK for the git-connector v1 API (work items + iterations aggregated from GitHub/GitLab). Version published on npm tracks server releases.",
5
5
  "license": "MIT",
6
6
  "repository": {