@cesar-richard/git-connector-sdk 2.0.1 → 2.1.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
@@ -733,6 +733,32 @@ Le sujet 'Refactor auth' (#42), assigné à Bob Smith, dans Sprint-25, est in_pr
733
733
  - #24 'Polish' en attente de review de Alice Doe, Carol Roe
734
734
  ```
735
735
 
736
+ ## Deduplicating orphans (CRA "non rattachés")
737
+
738
+ Each `Activity` and `LinkedActivity` exposes `linkedIssueRefs: IssueRef[]` —
739
+ the issues this PR/MR is linked to in **either direction**:
740
+
741
+ - forward: the PR/MR mentions the issue (body/notes URL/short-ref/header).
742
+ - reverse: an issue's body/notes mentions this PR/MR.
743
+
744
+ The field is **window-independent** (derived from `git_activity_links`),
745
+ unlike `linkedActivities[].id` which is scoped to the issues a given query
746
+ returns.
747
+
748
+ Use it to dedupe a CRA "orphans" section:
749
+
750
+ ```ts
751
+ const acts = await client.GET("/v1/activities", {
752
+ params: { query: { updatedSince: monthStart, updatedBefore: monthEnd } },
753
+ });
754
+ const orphans = acts.data.items.filter(
755
+ (a) => (a.type === "pr" || a.type === "mr") && a.linkedIssueRefs.length === 0,
756
+ );
757
+ // A PR/MR linked to ANY issue (even one outside the queried window) is NOT
758
+ // an orphan. The dashboard can choose to render it under its linked issue
759
+ // when the issue is a deliverable of the month, or omit it otherwise.
760
+ ```
761
+
736
762
  ## Related
737
763
 
738
764
  - **Server / control UI:** [git-connector](https://github.com/cesar-richard-ei/git-connector)
package/dist/schema.d.ts CHANGED
@@ -219,6 +219,12 @@ export interface components {
219
219
  id: string | number;
220
220
  displayName: string;
221
221
  } | null;
222
+ /** @description Issues linked to this activity via any direction (PR mentions the issue, OR the issue mentions this PR). Window-independent — populated from git_activity_links union (forward + reverse). Empty array when no link exists in either direction. Use this to dedupe the 'orphans' section of a CRA dashboard. */
223
+ linkedIssueRefs: {
224
+ source: "github" | "gitlab";
225
+ projectKey: string;
226
+ number: string | number;
227
+ }[];
222
228
  }[];
223
229
  total: string | number;
224
230
  limit: string | number;
@@ -242,6 +248,12 @@ export interface components {
242
248
  id: string | number;
243
249
  displayName: string;
244
250
  } | null;
251
+ /** @description Issues linked to this activity via any direction (PR mentions the issue, OR the issue mentions this PR). Window-independent — populated from git_activity_links union (forward + reverse). Empty array when no link exists in either direction. Use this to dedupe the 'orphans' section of a CRA dashboard. */
252
+ linkedIssueRefs: {
253
+ source: "github" | "gitlab";
254
+ projectKey: string;
255
+ number: string | number;
256
+ }[];
245
257
  };
246
258
  ActivityIteration: {
247
259
  id: string | number;
@@ -421,6 +433,12 @@ export interface components {
421
433
  matchStart: string | number;
422
434
  matchEnd: string | number;
423
435
  } | null;
436
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
437
+ linkedIssueRefs: {
438
+ source: "github" | "gitlab";
439
+ projectKey: string;
440
+ number: string | number;
441
+ }[];
424
442
  }[];
425
443
  evidence: {
426
444
  deliveryTransitions: {
@@ -614,6 +632,12 @@ export interface components {
614
632
  matchStart: string | number;
615
633
  matchEnd: string | number;
616
634
  } | null;
635
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
636
+ linkedIssueRefs: {
637
+ source: "github" | "gitlab";
638
+ projectKey: string;
639
+ number: string | number;
640
+ }[];
617
641
  }[];
618
642
  evidence: {
619
643
  deliveryTransitions: {
@@ -821,6 +845,11 @@ export interface components {
821
845
  id: string | number;
822
846
  displayName: string;
823
847
  };
848
+ IssueRef: {
849
+ source: "github" | "gitlab";
850
+ projectKey: string;
851
+ number: string | number;
852
+ };
824
853
  IterationWithCount: {
825
854
  id: string | number;
826
855
  title: string;
@@ -947,6 +976,12 @@ export interface components {
947
976
  matchStart: string | number;
948
977
  matchEnd: string | number;
949
978
  } | null;
979
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
980
+ linkedIssueRefs: {
981
+ source: "github" | "gitlab";
982
+ projectKey: string;
983
+ number: string | number;
984
+ }[];
950
985
  };
951
986
  ProjectLabel: {
952
987
  name: string;
@@ -1168,6 +1203,12 @@ export interface components {
1168
1203
  matchStart: string | number;
1169
1204
  matchEnd: string | number;
1170
1205
  } | null;
1206
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
1207
+ linkedIssueRefs: {
1208
+ source: "github" | "gitlab";
1209
+ projectKey: string;
1210
+ number: string | number;
1211
+ }[];
1171
1212
  }[];
1172
1213
  statusHistory: {
1173
1214
  label: {
@@ -1329,6 +1370,12 @@ export interface components {
1329
1370
  matchStart: string | number;
1330
1371
  matchEnd: string | number;
1331
1372
  } | null;
1373
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
1374
+ linkedIssueRefs: {
1375
+ source: "github" | "gitlab";
1376
+ projectKey: string;
1377
+ number: string | number;
1378
+ }[];
1332
1379
  }[];
1333
1380
  statusHistory: {
1334
1381
  label: {
@@ -1543,6 +1590,12 @@ export interface operations {
1543
1590
  matchStart: string | number;
1544
1591
  matchEnd: string | number;
1545
1592
  } | null;
1593
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
1594
+ linkedIssueRefs: {
1595
+ source: "github" | "gitlab";
1596
+ projectKey: string;
1597
+ number: string | number;
1598
+ }[];
1546
1599
  }[];
1547
1600
  statusHistory: {
1548
1601
  label: {
@@ -1708,6 +1761,12 @@ export interface operations {
1708
1761
  matchStart: string | number;
1709
1762
  matchEnd: string | number;
1710
1763
  } | null;
1764
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
1765
+ linkedIssueRefs: {
1766
+ source: "github" | "gitlab";
1767
+ projectKey: string;
1768
+ number: string | number;
1769
+ }[];
1711
1770
  }[];
1712
1771
  statusHistory: {
1713
1772
  label: {
@@ -1873,6 +1932,12 @@ export interface operations {
1873
1932
  matchStart: string | number;
1874
1933
  matchEnd: string | number;
1875
1934
  } | null;
1935
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
1936
+ linkedIssueRefs: {
1937
+ source: "github" | "gitlab";
1938
+ projectKey: string;
1939
+ number: string | number;
1940
+ }[];
1876
1941
  }[];
1877
1942
  statusHistory: {
1878
1943
  label: {
@@ -2094,6 +2159,12 @@ export interface operations {
2094
2159
  matchStart: string | number;
2095
2160
  matchEnd: string | number;
2096
2161
  } | null;
2162
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
2163
+ linkedIssueRefs: {
2164
+ source: "github" | "gitlab";
2165
+ projectKey: string;
2166
+ number: string | number;
2167
+ }[];
2097
2168
  }[];
2098
2169
  statusHistory: {
2099
2170
  label: {
@@ -2254,6 +2325,12 @@ export interface operations {
2254
2325
  matchStart: string | number;
2255
2326
  matchEnd: string | number;
2256
2327
  } | null;
2328
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
2329
+ linkedIssueRefs: {
2330
+ source: "github" | "gitlab";
2331
+ projectKey: string;
2332
+ number: string | number;
2333
+ }[];
2257
2334
  }[];
2258
2335
  statusHistory: {
2259
2336
  label: {
@@ -2414,6 +2491,12 @@ export interface operations {
2414
2491
  matchStart: string | number;
2415
2492
  matchEnd: string | number;
2416
2493
  } | null;
2494
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
2495
+ linkedIssueRefs: {
2496
+ source: "github" | "gitlab";
2497
+ projectKey: string;
2498
+ number: string | number;
2499
+ }[];
2417
2500
  }[];
2418
2501
  statusHistory: {
2419
2502
  label: {
@@ -2736,6 +2819,12 @@ export interface operations {
2736
2819
  id: string | number;
2737
2820
  displayName: string;
2738
2821
  } | null;
2822
+ /** @description Issues linked to this activity via any direction (PR mentions the issue, OR the issue mentions this PR). Window-independent — populated from git_activity_links union (forward + reverse). Empty array when no link exists in either direction. Use this to dedupe the 'orphans' section of a CRA dashboard. */
2823
+ linkedIssueRefs: {
2824
+ source: "github" | "gitlab";
2825
+ projectKey: string;
2826
+ number: string | number;
2827
+ }[];
2739
2828
  }[];
2740
2829
  total: string | number;
2741
2830
  limit: string | number;
@@ -2760,6 +2849,12 @@ export interface operations {
2760
2849
  id: string | number;
2761
2850
  displayName: string;
2762
2851
  } | null;
2852
+ /** @description Issues linked to this activity via any direction (PR mentions the issue, OR the issue mentions this PR). Window-independent — populated from git_activity_links union (forward + reverse). Empty array when no link exists in either direction. Use this to dedupe the 'orphans' section of a CRA dashboard. */
2853
+ linkedIssueRefs: {
2854
+ source: "github" | "gitlab";
2855
+ projectKey: string;
2856
+ number: string | number;
2857
+ }[];
2763
2858
  }[];
2764
2859
  total: string | number;
2765
2860
  limit: string | number;
@@ -2784,6 +2879,12 @@ export interface operations {
2784
2879
  id: string | number;
2785
2880
  displayName: string;
2786
2881
  } | null;
2882
+ /** @description Issues linked to this activity via any direction (PR mentions the issue, OR the issue mentions this PR). Window-independent — populated from git_activity_links union (forward + reverse). Empty array when no link exists in either direction. Use this to dedupe the 'orphans' section of a CRA dashboard. */
2883
+ linkedIssueRefs: {
2884
+ source: "github" | "gitlab";
2885
+ projectKey: string;
2886
+ number: string | number;
2887
+ }[];
2787
2888
  }[];
2788
2889
  total: string | number;
2789
2890
  limit: string | number;
@@ -2983,6 +3084,12 @@ export interface operations {
2983
3084
  matchStart: string | number;
2984
3085
  matchEnd: string | number;
2985
3086
  } | null;
3087
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
3088
+ linkedIssueRefs: {
3089
+ source: "github" | "gitlab";
3090
+ projectKey: string;
3091
+ number: string | number;
3092
+ }[];
2986
3093
  }[];
2987
3094
  evidence: {
2988
3095
  deliveryTransitions: {
@@ -3177,6 +3284,12 @@ export interface operations {
3177
3284
  matchStart: string | number;
3178
3285
  matchEnd: string | number;
3179
3286
  } | null;
3287
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
3288
+ linkedIssueRefs: {
3289
+ source: "github" | "gitlab";
3290
+ projectKey: string;
3291
+ number: string | number;
3292
+ }[];
3180
3293
  }[];
3181
3294
  evidence: {
3182
3295
  deliveryTransitions: {
@@ -3371,6 +3484,12 @@ export interface operations {
3371
3484
  matchStart: string | number;
3372
3485
  matchEnd: string | number;
3373
3486
  } | null;
3487
+ /** @description Same semantic as Activity.linkedIssueRefs — populated from `git_activity_links` for the linked PR/MR. Includes the issue this LinkedActivity is rendered under, plus any other linked issues. */
3488
+ linkedIssueRefs: {
3489
+ source: "github" | "gitlab";
3490
+ projectKey: string;
3491
+ number: string | number;
3492
+ }[];
3374
3493
  }[];
3375
3494
  evidence: {
3376
3495
  deliveryTransitions: {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@cesar-richard/git-connector-sdk",
3
- "version": "2.0.1",
3
+ "version": "2.1.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": {