@cesar-richard/git-connector-sdk 1.29.0 → 1.31.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 +48 -1
- package/dist/schema.d.ts +41 -1
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -140,7 +140,54 @@ for (const e of data.events) {
|
|
|
140
140
|
|
|
141
141
|
Filters like `?author=cesar` (on `/v1/activities` and `/v1/work-items`) and `?user=cesar` (on `/v1/events`) match the login exactly (case-insensitive). They do NOT fuzzy-match display names. This is a deliberate design choice for auditable activity tracking.
|
|
142
142
|
|
|
143
|
-
**
|
|
143
|
+
**GitLab resolver:** commits ingested via polling are resolved server-side by mapping `commit.author_email` → GL user login via the GitLab Users API. The result is cached (default TTL 90 days). If the email cannot be resolved (anonymous commit, email not associated with any GL user, private email on a self-hosted instance), `author` stays `null` and the git-config name lives in `meta.commitAuthorName`. Webhook-ingested GL commits use the pusher's username directly (no resolver needed).
|
|
144
|
+
|
|
145
|
+
**Structured author access via `authorResolved`:** commit events also carry an `authorResolved` blob with `{login, name, email}` (each nullable) — a single typed accessor that aggregates everything we know about the author:
|
|
146
|
+
|
|
147
|
+
```ts
|
|
148
|
+
for (const e of data.events) {
|
|
149
|
+
if (e.type !== "commit") continue;
|
|
150
|
+
const { login, name, email } = e.authorResolved ?? {};
|
|
151
|
+
console.log(`${login ?? "anonymous"} (${name ?? "?"} <${email ?? "?"}>)`);
|
|
152
|
+
}
|
|
153
|
+
```
|
|
154
|
+
|
|
155
|
+
Available on every commit event regardless of provider or ingestion path. `event.author` is always equal to `event.authorResolved?.login`.
|
|
156
|
+
|
|
157
|
+
### PR review status (`reviewStatus`)
|
|
158
|
+
|
|
159
|
+
Each `LinkedActivity` carries an optional `reviewStatus` field with 8 possible
|
|
160
|
+
values, computed server-side from the PR's state, draft flag, requested
|
|
161
|
+
reviewers, and review history:
|
|
162
|
+
|
|
163
|
+
| Value | Meaning |
|
|
164
|
+
|---|---|
|
|
165
|
+
| `draft` | PR is a draft — not yet ready for review |
|
|
166
|
+
| `open-no-review` | Open, no reviewer requested |
|
|
167
|
+
| `open-awaiting-my-review` | Open, you (the `viewer`) are a requested reviewer |
|
|
168
|
+
| `open-awaiting-other-review` | Open, waiting on someone else's review |
|
|
169
|
+
| `open-changes-requested` | Open, at least one reviewer requested changes (and that verdict hasn't been superseded by an approval) |
|
|
170
|
+
| `open-approved` | Open and approved, no outstanding change requests |
|
|
171
|
+
| `merged` | Merged |
|
|
172
|
+
| `closed` | Closed without merging |
|
|
173
|
+
|
|
174
|
+
Pass `?viewer=<login>` (case-insensitive) on `GET /v1/work-items` or
|
|
175
|
+
`GET /v1/work-items/{source}/{projectKey}/{number}` to drive the
|
|
176
|
+
`open-awaiting-my-review` vs `open-awaiting-other-review` split. Without
|
|
177
|
+
`viewer`, awaiting-review PRs always show as `open-awaiting-other-review`.
|
|
178
|
+
|
|
179
|
+
```ts
|
|
180
|
+
const { data } = await client.GET("/v1/work-items", {
|
|
181
|
+
params: { query: { state: "open", viewer: "cesar" } },
|
|
182
|
+
});
|
|
183
|
+
for (const wi of data.items) {
|
|
184
|
+
for (const pr of wi.linkedActivities) {
|
|
185
|
+
if (pr.reviewStatus === "open-awaiting-my-review") {
|
|
186
|
+
console.log(`Needs your review: ${pr.url}`);
|
|
187
|
+
}
|
|
188
|
+
}
|
|
189
|
+
}
|
|
190
|
+
```
|
|
144
191
|
|
|
145
192
|
---
|
|
146
193
|
|
package/dist/schema.d.ts
CHANGED
|
@@ -160,6 +160,11 @@ export interface components {
|
|
|
160
160
|
meta: {
|
|
161
161
|
[key: string]: unknown;
|
|
162
162
|
} | null;
|
|
163
|
+
authorResolved?: {
|
|
164
|
+
login: string | null;
|
|
165
|
+
name: string | null;
|
|
166
|
+
email: string | null;
|
|
167
|
+
};
|
|
163
168
|
}[];
|
|
164
169
|
total: string | number;
|
|
165
170
|
nextCursor: string | null;
|
|
@@ -180,6 +185,11 @@ export interface components {
|
|
|
180
185
|
meta: {
|
|
181
186
|
[key: string]: unknown;
|
|
182
187
|
} | null;
|
|
188
|
+
authorResolved?: {
|
|
189
|
+
login: string | null;
|
|
190
|
+
name: string | null;
|
|
191
|
+
email: string | null;
|
|
192
|
+
};
|
|
183
193
|
};
|
|
184
194
|
IterationWithCount: {
|
|
185
195
|
id: string | number;
|
|
@@ -244,6 +254,7 @@ export interface components {
|
|
|
244
254
|
url: string | null;
|
|
245
255
|
}[];
|
|
246
256
|
} | null;
|
|
257
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
247
258
|
};
|
|
248
259
|
Provider: "github" | "gitlab";
|
|
249
260
|
Review: {
|
|
@@ -252,6 +263,7 @@ export interface components {
|
|
|
252
263
|
submittedAt: string;
|
|
253
264
|
url: string | null;
|
|
254
265
|
};
|
|
266
|
+
ReviewStatus: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
255
267
|
ReviewsSummary: {
|
|
256
268
|
approvedCount: string | number;
|
|
257
269
|
changesRequestedCount: string | number;
|
|
@@ -372,6 +384,7 @@ export interface components {
|
|
|
372
384
|
url: string | null;
|
|
373
385
|
}[];
|
|
374
386
|
} | null;
|
|
387
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
375
388
|
}[];
|
|
376
389
|
statusHistory: {
|
|
377
390
|
label: {
|
|
@@ -470,6 +483,7 @@ export interface components {
|
|
|
470
483
|
url: string | null;
|
|
471
484
|
}[];
|
|
472
485
|
} | null;
|
|
486
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
473
487
|
}[];
|
|
474
488
|
statusHistory: {
|
|
475
489
|
label: {
|
|
@@ -526,6 +540,8 @@ export interface operations {
|
|
|
526
540
|
withoutApproval?: string;
|
|
527
541
|
/** @description Returns only work items where AT LEAST ONE linked PR/MR has been reviewed by the given username (case-insensitive, any state). */
|
|
528
542
|
reviewerIs?: string;
|
|
543
|
+
/** @description Login (case-insensitive) used to compute linkedActivities[].reviewStatus. When the viewer is in a PR's requested reviewers and no verdict is active, reviewStatus is 'open-awaiting-my-review' instead of 'open-awaiting-other-review'. */
|
|
544
|
+
viewer?: string;
|
|
529
545
|
};
|
|
530
546
|
header?: never;
|
|
531
547
|
path?: never;
|
|
@@ -615,6 +631,7 @@ export interface operations {
|
|
|
615
631
|
url: string | null;
|
|
616
632
|
}[];
|
|
617
633
|
} | null;
|
|
634
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
618
635
|
}[];
|
|
619
636
|
statusHistory: {
|
|
620
637
|
label: {
|
|
@@ -717,6 +734,7 @@ export interface operations {
|
|
|
717
734
|
url: string | null;
|
|
718
735
|
}[];
|
|
719
736
|
} | null;
|
|
737
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
720
738
|
}[];
|
|
721
739
|
statusHistory: {
|
|
722
740
|
label: {
|
|
@@ -819,6 +837,7 @@ export interface operations {
|
|
|
819
837
|
url: string | null;
|
|
820
838
|
}[];
|
|
821
839
|
} | null;
|
|
840
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
822
841
|
}[];
|
|
823
842
|
statusHistory: {
|
|
824
843
|
label: {
|
|
@@ -850,7 +869,10 @@ export interface operations {
|
|
|
850
869
|
};
|
|
851
870
|
"getV1Work-itemsBySourceByProjectKeyByNumber": {
|
|
852
871
|
parameters: {
|
|
853
|
-
query?:
|
|
872
|
+
query?: {
|
|
873
|
+
/** @description Login (case-insensitive) used to compute linkedActivities[].reviewStatus. Drives the 'open-awaiting-my-review' vs 'open-awaiting-other-review' split. */
|
|
874
|
+
viewer?: string;
|
|
875
|
+
};
|
|
854
876
|
header?: never;
|
|
855
877
|
path: {
|
|
856
878
|
source: string;
|
|
@@ -942,6 +964,7 @@ export interface operations {
|
|
|
942
964
|
url: string | null;
|
|
943
965
|
}[];
|
|
944
966
|
} | null;
|
|
967
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
945
968
|
}[];
|
|
946
969
|
statusHistory: {
|
|
947
970
|
label: {
|
|
@@ -1039,6 +1062,7 @@ export interface operations {
|
|
|
1039
1062
|
url: string | null;
|
|
1040
1063
|
}[];
|
|
1041
1064
|
} | null;
|
|
1065
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
1042
1066
|
}[];
|
|
1043
1067
|
statusHistory: {
|
|
1044
1068
|
label: {
|
|
@@ -1136,6 +1160,7 @@ export interface operations {
|
|
|
1136
1160
|
url: string | null;
|
|
1137
1161
|
}[];
|
|
1138
1162
|
} | null;
|
|
1163
|
+
reviewStatus?: "draft" | "open-no-review" | "open-awaiting-my-review" | "open-awaiting-other-review" | "open-changes-requested" | "open-approved" | "merged" | "closed";
|
|
1139
1164
|
}[];
|
|
1140
1165
|
statusHistory: {
|
|
1141
1166
|
label: {
|
|
@@ -1286,6 +1311,11 @@ export interface operations {
|
|
|
1286
1311
|
meta: {
|
|
1287
1312
|
[key: string]: unknown;
|
|
1288
1313
|
} | null;
|
|
1314
|
+
authorResolved?: {
|
|
1315
|
+
login: string | null;
|
|
1316
|
+
name: string | null;
|
|
1317
|
+
email: string | null;
|
|
1318
|
+
};
|
|
1289
1319
|
}[];
|
|
1290
1320
|
total: string | number;
|
|
1291
1321
|
nextCursor: string | null;
|
|
@@ -1307,6 +1337,11 @@ export interface operations {
|
|
|
1307
1337
|
meta: {
|
|
1308
1338
|
[key: string]: unknown;
|
|
1309
1339
|
} | null;
|
|
1340
|
+
authorResolved?: {
|
|
1341
|
+
login: string | null;
|
|
1342
|
+
name: string | null;
|
|
1343
|
+
email: string | null;
|
|
1344
|
+
};
|
|
1310
1345
|
}[];
|
|
1311
1346
|
total: string | number;
|
|
1312
1347
|
nextCursor: string | null;
|
|
@@ -1328,6 +1363,11 @@ export interface operations {
|
|
|
1328
1363
|
meta: {
|
|
1329
1364
|
[key: string]: unknown;
|
|
1330
1365
|
} | null;
|
|
1366
|
+
authorResolved?: {
|
|
1367
|
+
login: string | null;
|
|
1368
|
+
name: string | null;
|
|
1369
|
+
email: string | null;
|
|
1370
|
+
};
|
|
1331
1371
|
}[];
|
|
1332
1372
|
total: string | number;
|
|
1333
1373
|
nextCursor: string | null;
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cesar-richard/git-connector-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.31.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": {
|