@cesar-richard/git-connector-sdk 1.61.0 → 1.62.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 +72 -1
- package/dist/schema.d.ts +2114 -1265
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -354,7 +354,7 @@ for (const wi of data.items) {
|
|
|
354
354
|
|
|
355
355
|
## API surface
|
|
356
356
|
|
|
357
|
-
The `/v1/*` API exposes
|
|
357
|
+
The `/v1/*` API exposes these resources: work items, iterations, work-item details, the unified events stream, raw activities, deliverables, and per-project delivery rules.
|
|
358
358
|
|
|
359
359
|
### `GET /v1/work-items` — list aggregated work items
|
|
360
360
|
|
|
@@ -427,6 +427,77 @@ Event types in the stream:
|
|
|
427
427
|
| `state-transition` | Derived from activity state diff | resolves to PR/MR/issue | `from`, `to` |
|
|
428
428
|
| `ci-run` | GH Actions job / GL pipeline job | resolves to PR/MR via head SHA | `runId`, `jobName`, `conclusion`, `durationSec`, `sha`, `branch` |
|
|
429
429
|
|
|
430
|
+
### `GET /v1/deliverables` — classified deliverables of a window
|
|
431
|
+
|
|
432
|
+
Issues classified as **delivered**, **in_progress**, or **not_delivered** over a
|
|
433
|
+
time window, driven by a per-project label convention (see delivery-rules below).
|
|
434
|
+
`not_delivered` issues are always dropped from the response.
|
|
435
|
+
|
|
436
|
+
Query params:
|
|
437
|
+
|
|
438
|
+
| param | required | meaning |
|
|
439
|
+
|-------|----------|---------|
|
|
440
|
+
| `from` | **yes** | Window start. ISO date (`YYYY-MM-DD`) or datetime. |
|
|
441
|
+
| `to` | **yes** | Window end. ISO date (inclusive end-of-day) or datetime. |
|
|
442
|
+
| `projectKey` | no | CSV of project keys to restrict to. |
|
|
443
|
+
| `author` | no | CSV of author login aliases (case-insensitive). When set, only issues attributable to one of the aliases are returned and `attribution` is populated. When **absent**, every window deliverable is returned with `attribution: null`. |
|
|
444
|
+
| `source` | no | `github` or `gitlab`. |
|
|
445
|
+
|
|
446
|
+
Each `DeliverableIssue` carries `deliveryState`, `deliveredAt`, `deliveryLabel`,
|
|
447
|
+
`attribution` (`{ isAssignee, hasOwnCommit, isMergedPRAuthor, result }` with
|
|
448
|
+
`result` precedence `assigned > committer > pr_author > none`), `linkedActivities`,
|
|
449
|
+
and an `evidence` blob (`deliveryTransitions`, `consideredCommits`, `consideredPRs`)
|
|
450
|
+
for human audit.
|
|
451
|
+
|
|
452
|
+
```ts
|
|
453
|
+
// Monthly CRA: who delivered what this month, attributed to me.
|
|
454
|
+
const { data } = await client.GET("/v1/deliverables", {
|
|
455
|
+
params: {
|
|
456
|
+
query: {
|
|
457
|
+
from: "2026-05-01",
|
|
458
|
+
to: "2026-05-31",
|
|
459
|
+
projectKey: "id/cohort360/gestion-de-projet",
|
|
460
|
+
author: "cesar-richard,crichard",
|
|
461
|
+
},
|
|
462
|
+
},
|
|
463
|
+
});
|
|
464
|
+
// data.issues: DeliverableIssue[] — deliveryState, deliveredAt, attribution, evidence
|
|
465
|
+
for (const issue of data.issues) {
|
|
466
|
+
console.log(
|
|
467
|
+
`${issue.projectKey}#${issue.number} — ${issue.deliveryState} ` +
|
|
468
|
+
`(${issue.attribution?.result ?? "n/a"}) @ ${issue.deliveredAt ?? "?"}`,
|
|
469
|
+
);
|
|
470
|
+
}
|
|
471
|
+
```
|
|
472
|
+
|
|
473
|
+
When `author` is omitted you get the full set of window deliverables with
|
|
474
|
+
`attribution: null` — useful for a team-wide "what shipped this month" view.
|
|
475
|
+
|
|
476
|
+
### `GET` / `PATCH /v1/projects/{source}/{projectKey}/delivery-rules` — label convention
|
|
477
|
+
|
|
478
|
+
The classification above is configurable per project. `deliveryLabels` are the
|
|
479
|
+
scoped labels whose "added" transition marks an issue **delivered** (e.g. the
|
|
480
|
+
GitLab scoped label `=::Pushed en dev`); `openedLabels` mark **in_progress**. When
|
|
481
|
+
no rule row exists (or `deliveryLabels` is empty) the endpoint falls back to a
|
|
482
|
+
native closed-state heuristic.
|
|
483
|
+
|
|
484
|
+
```ts
|
|
485
|
+
// Read the current convention (empty defaults when unset).
|
|
486
|
+
const { data: rules } = await client.GET(
|
|
487
|
+
"/v1/projects/{source}/{projectKey}/delivery-rules",
|
|
488
|
+
{ params: { path: { source: "gitlab", projectKey: "acme/ops" } } },
|
|
489
|
+
);
|
|
490
|
+
// { source, projectKey, deliveryLabels, openedLabels, updatedAt }
|
|
491
|
+
|
|
492
|
+
// PATCH is partial — omitted keys keep their stored value.
|
|
493
|
+
await client.PATCH("/v1/projects/{source}/{projectKey}/delivery-rules", {
|
|
494
|
+
params: { path: { source: "gitlab", projectKey: "acme/ops" } },
|
|
495
|
+
body: { deliveryLabels: ["=::Pushed en dev"], openedLabels: ["=::En cours"] },
|
|
496
|
+
});
|
|
497
|
+
```
|
|
498
|
+
|
|
499
|
+
`projectKey` segments containing `/` must be URL-encoded (e.g. `acme%2Fops`).
|
|
500
|
+
|
|
430
501
|
---
|
|
431
502
|
|
|
432
503
|
## Schema as a separate import
|