@cesar-richard/git-connector-sdk 2.7.1 → 2.9.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 +41 -3
- package/dist/schema.d.ts +100 -0
- package/package.json +1 -1
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
|
-
|
|
321
|
-
|
|
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;
|
|
@@ -356,9 +384,13 @@ export interface components {
|
|
|
356
384
|
[key: string]: unknown;
|
|
357
385
|
};
|
|
358
386
|
DeliverableAttribution: {
|
|
387
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
359
388
|
isAssignee: boolean;
|
|
389
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
360
390
|
hasOwnCommit: boolean;
|
|
391
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
361
392
|
isMergedPRAuthor: boolean;
|
|
393
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
362
394
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
363
395
|
};
|
|
364
396
|
DeliverableEvidence: {
|
|
@@ -403,9 +435,13 @@ export interface components {
|
|
|
403
435
|
transitionBy: string | null;
|
|
404
436
|
};
|
|
405
437
|
attribution: {
|
|
438
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
406
439
|
isAssignee: boolean;
|
|
440
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
407
441
|
hasOwnCommit: boolean;
|
|
442
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
408
443
|
isMergedPRAuthor: boolean;
|
|
444
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
409
445
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
410
446
|
} | null;
|
|
411
447
|
linkedActivities: {
|
|
@@ -608,9 +644,13 @@ export interface components {
|
|
|
608
644
|
transitionBy: string | null;
|
|
609
645
|
};
|
|
610
646
|
attribution: {
|
|
647
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
611
648
|
isAssignee: boolean;
|
|
649
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
612
650
|
hasOwnCommit: boolean;
|
|
651
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
613
652
|
isMergedPRAuthor: boolean;
|
|
653
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
614
654
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
615
655
|
} | null;
|
|
616
656
|
linkedActivities: {
|
|
@@ -3785,6 +3825,12 @@ export interface operations {
|
|
|
3785
3825
|
identity?: string;
|
|
3786
3826
|
/** @description When '1', enriches each activity with `authorIdentity: { id, displayName } | null`. */
|
|
3787
3827
|
withIdentity?: string;
|
|
3828
|
+
/** @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. */
|
|
3829
|
+
requestedReviewer?: string;
|
|
3830
|
+
/** @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. */
|
|
3831
|
+
reviewerIdentity?: string;
|
|
3832
|
+
/** @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'. */
|
|
3833
|
+
viewer?: string;
|
|
3788
3834
|
/** @description CSV: open,draft,merged,closed,unknown. Default returns all states. */
|
|
3789
3835
|
state?: string;
|
|
3790
3836
|
/** @description CSV: pr,mr,issue. Default returns all. */
|
|
@@ -3827,6 +3873,20 @@ export interface operations {
|
|
|
3827
3873
|
createdAt: string;
|
|
3828
3874
|
updatedAt: string;
|
|
3829
3875
|
mergedAt: string | null;
|
|
3876
|
+
/** @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. */
|
|
3877
|
+
requestedReviewers: string[];
|
|
3878
|
+
/** @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. */
|
|
3879
|
+
requestedReviewersResolved?: {
|
|
3880
|
+
id: string;
|
|
3881
|
+
login: string;
|
|
3882
|
+
name: string | null;
|
|
3883
|
+
email: string | null;
|
|
3884
|
+
}[];
|
|
3885
|
+
/** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
|
|
3886
|
+
awaitingReview: boolean;
|
|
3887
|
+
reviewRequestedAt: string | null;
|
|
3888
|
+
/** @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'. */
|
|
3889
|
+
reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
|
|
3830
3890
|
authorIdentity?: {
|
|
3831
3891
|
id: string | number;
|
|
3832
3892
|
displayName: string;
|
|
@@ -3857,6 +3917,20 @@ export interface operations {
|
|
|
3857
3917
|
createdAt: string;
|
|
3858
3918
|
updatedAt: string;
|
|
3859
3919
|
mergedAt: string | null;
|
|
3920
|
+
/** @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. */
|
|
3921
|
+
requestedReviewers: string[];
|
|
3922
|
+
/** @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. */
|
|
3923
|
+
requestedReviewersResolved?: {
|
|
3924
|
+
id: string;
|
|
3925
|
+
login: string;
|
|
3926
|
+
name: string | null;
|
|
3927
|
+
email: string | null;
|
|
3928
|
+
}[];
|
|
3929
|
+
/** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
|
|
3930
|
+
awaitingReview: boolean;
|
|
3931
|
+
reviewRequestedAt: string | null;
|
|
3932
|
+
/** @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'. */
|
|
3933
|
+
reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
|
|
3860
3934
|
authorIdentity?: {
|
|
3861
3935
|
id: string | number;
|
|
3862
3936
|
displayName: string;
|
|
@@ -3887,6 +3961,20 @@ export interface operations {
|
|
|
3887
3961
|
createdAt: string;
|
|
3888
3962
|
updatedAt: string;
|
|
3889
3963
|
mergedAt: string | null;
|
|
3964
|
+
/** @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. */
|
|
3965
|
+
requestedReviewers: string[];
|
|
3966
|
+
/** @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. */
|
|
3967
|
+
requestedReviewersResolved?: {
|
|
3968
|
+
id: string;
|
|
3969
|
+
login: string;
|
|
3970
|
+
name: string | null;
|
|
3971
|
+
email: string | null;
|
|
3972
|
+
}[];
|
|
3973
|
+
/** @description True when the activity is open AND has at least one requested reviewer who has not yet responded. Always false for issues. */
|
|
3974
|
+
awaitingReview: boolean;
|
|
3975
|
+
reviewRequestedAt: string | null;
|
|
3976
|
+
/** @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'. */
|
|
3977
|
+
reviewStatus: ("draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed") | null;
|
|
3890
3978
|
authorIdentity?: {
|
|
3891
3979
|
id: string | number;
|
|
3892
3980
|
displayName: string;
|
|
@@ -3987,9 +4075,13 @@ export interface operations {
|
|
|
3987
4075
|
transitionBy: string | null;
|
|
3988
4076
|
};
|
|
3989
4077
|
attribution: {
|
|
4078
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
3990
4079
|
isAssignee: boolean;
|
|
4080
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
3991
4081
|
hasOwnCommit: boolean;
|
|
4082
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
3992
4083
|
isMergedPRAuthor: boolean;
|
|
4084
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
3993
4085
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
3994
4086
|
} | null;
|
|
3995
4087
|
linkedActivities: {
|
|
@@ -4193,9 +4285,13 @@ export interface operations {
|
|
|
4193
4285
|
transitionBy: string | null;
|
|
4194
4286
|
};
|
|
4195
4287
|
attribution: {
|
|
4288
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
4196
4289
|
isAssignee: boolean;
|
|
4290
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
4197
4291
|
hasOwnCommit: boolean;
|
|
4292
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
4198
4293
|
isMergedPRAuthor: boolean;
|
|
4294
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
4199
4295
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
4200
4296
|
} | null;
|
|
4201
4297
|
linkedActivities: {
|
|
@@ -4399,9 +4495,13 @@ export interface operations {
|
|
|
4399
4495
|
transitionBy: string | null;
|
|
4400
4496
|
};
|
|
4401
4497
|
attribution: {
|
|
4498
|
+
/** @description The user is an assignee of the issue. Independent of any PR/MR link. */
|
|
4402
4499
|
isAssignee: boolean;
|
|
4500
|
+
/** @description The user authored a commit inside a PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). Commits on a PR/MR that merely mentions the issue do NOT count. */
|
|
4403
4501
|
hasOwnCommit: boolean;
|
|
4502
|
+
/** @description The user authored a merged PR/MR that CLOSES this issue (`linkedActivities[].resolves === true`). A merged PR/MR that only says 'Related to <issue>' does NOT count — it links the two without delivering the issue. */
|
|
4404
4503
|
isMergedPRAuthor: boolean;
|
|
4504
|
+
/** @description First match wins: assigned > committer > pr_author > none. Only `resolves` links feed the committer/pr_author paths — `attributable` (which includes plain references) drives TIME imputation, not delivery. */
|
|
4405
4505
|
result: "assigned" | "committer" | "pr_author" | "none";
|
|
4406
4506
|
} | null;
|
|
4407
4507
|
linkedActivities: {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cesar-richard/git-connector-sdk",
|
|
3
|
-
"version": "2.
|
|
3
|
+
"version": "2.9.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": {
|