@cesar-richard/git-connector-sdk 1.63.0 → 1.64.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 +22 -0
- package/dist/schema.d.ts +143 -0
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -543,6 +543,28 @@ const client = createGitConnectorClient({
|
|
|
543
543
|
});
|
|
544
544
|
```
|
|
545
545
|
|
|
546
|
+
## Listing the labels of a project
|
|
547
|
+
|
|
548
|
+
`GET /v1/projects/{source}/{projectKey}/labels` returns the live label set
|
|
549
|
+
of a GitLab project or GitHub repository, including `scope` computed
|
|
550
|
+
server-side for GitLab scoped labels (`<scope>::<value>`). Cached in-memory
|
|
551
|
+
for 15 minutes (configurable via `LABELS_CACHE_TTL_MS`).
|
|
552
|
+
|
|
553
|
+
```ts
|
|
554
|
+
const { data, error } = await client.GET(
|
|
555
|
+
"/v1/projects/{source}/{projectKey}/labels",
|
|
556
|
+
{ params: { path: { source: "gitlab", projectKey: "group/sub/project" } } },
|
|
557
|
+
);
|
|
558
|
+
if (error) throw error;
|
|
559
|
+
for (const label of data.labels) {
|
|
560
|
+
console.log(label.scope ?? "(no scope)", label.name, label.color);
|
|
561
|
+
}
|
|
562
|
+
```
|
|
563
|
+
|
|
564
|
+
The endpoint returns `404` when the project does not exist on the upstream
|
|
565
|
+
provider, `403` when the configured provider token lacks access, and `502`
|
|
566
|
+
on upstream unreachable (e.g. expired GitLab NSC cookie).
|
|
567
|
+
|
|
546
568
|
## Compatibility
|
|
547
569
|
|
|
548
570
|
- Node ≥ 18 (uses global `fetch`).
|
package/dist/schema.d.ts
CHANGED
|
@@ -116,6 +116,22 @@ export interface paths {
|
|
|
116
116
|
patch: operations["patchV1ProjectsBySourceByProjectKeyDelivery-rules"];
|
|
117
117
|
trace?: never;
|
|
118
118
|
};
|
|
119
|
+
"/v1/projects/{source}/{projectKey}/labels": {
|
|
120
|
+
parameters: {
|
|
121
|
+
query?: never;
|
|
122
|
+
header?: never;
|
|
123
|
+
path?: never;
|
|
124
|
+
cookie?: never;
|
|
125
|
+
};
|
|
126
|
+
get: operations["getV1ProjectsBySourceByProjectKeyLabels"];
|
|
127
|
+
put?: never;
|
|
128
|
+
post?: never;
|
|
129
|
+
delete?: never;
|
|
130
|
+
options?: never;
|
|
131
|
+
head?: never;
|
|
132
|
+
patch?: never;
|
|
133
|
+
trace?: never;
|
|
134
|
+
};
|
|
119
135
|
}
|
|
120
136
|
export type webhooks = Record<string, never>;
|
|
121
137
|
export interface components {
|
|
@@ -623,6 +639,21 @@ export interface components {
|
|
|
623
639
|
matchEnd: string | number;
|
|
624
640
|
} | null;
|
|
625
641
|
};
|
|
642
|
+
ProjectLabel: {
|
|
643
|
+
name: string;
|
|
644
|
+
color: string;
|
|
645
|
+
description: string | null;
|
|
646
|
+
scope: string | null;
|
|
647
|
+
};
|
|
648
|
+
ProjectLabelsResponse: {
|
|
649
|
+
labels: {
|
|
650
|
+
name: string;
|
|
651
|
+
color: string;
|
|
652
|
+
description: string | null;
|
|
653
|
+
scope: string | null;
|
|
654
|
+
}[];
|
|
655
|
+
fetchedAt: string;
|
|
656
|
+
};
|
|
626
657
|
Provider: "github" | "gitlab";
|
|
627
658
|
ResolvedUser: {
|
|
628
659
|
id: string;
|
|
@@ -2710,4 +2741,116 @@ export interface operations {
|
|
|
2710
2741
|
};
|
|
2711
2742
|
};
|
|
2712
2743
|
};
|
|
2744
|
+
getV1ProjectsBySourceByProjectKeyLabels: {
|
|
2745
|
+
parameters: {
|
|
2746
|
+
query?: never;
|
|
2747
|
+
header?: never;
|
|
2748
|
+
path: {
|
|
2749
|
+
source: string;
|
|
2750
|
+
projectKey: string;
|
|
2751
|
+
};
|
|
2752
|
+
cookie?: never;
|
|
2753
|
+
};
|
|
2754
|
+
requestBody?: never;
|
|
2755
|
+
responses: {
|
|
2756
|
+
200: {
|
|
2757
|
+
headers: {
|
|
2758
|
+
[name: string]: unknown;
|
|
2759
|
+
};
|
|
2760
|
+
content: {
|
|
2761
|
+
"application/json": {
|
|
2762
|
+
labels: {
|
|
2763
|
+
name: string;
|
|
2764
|
+
color: string;
|
|
2765
|
+
description: string | null;
|
|
2766
|
+
scope: string | null;
|
|
2767
|
+
}[];
|
|
2768
|
+
fetchedAt: string;
|
|
2769
|
+
};
|
|
2770
|
+
"multipart/form-data": {
|
|
2771
|
+
labels: {
|
|
2772
|
+
name: string;
|
|
2773
|
+
color: string;
|
|
2774
|
+
description: string | null;
|
|
2775
|
+
scope: string | null;
|
|
2776
|
+
}[];
|
|
2777
|
+
fetchedAt: string;
|
|
2778
|
+
};
|
|
2779
|
+
"text/plain": {
|
|
2780
|
+
labels: {
|
|
2781
|
+
name: string;
|
|
2782
|
+
color: string;
|
|
2783
|
+
description: string | null;
|
|
2784
|
+
scope: string | null;
|
|
2785
|
+
}[];
|
|
2786
|
+
fetchedAt: string;
|
|
2787
|
+
};
|
|
2788
|
+
};
|
|
2789
|
+
};
|
|
2790
|
+
400: {
|
|
2791
|
+
headers: {
|
|
2792
|
+
[name: string]: unknown;
|
|
2793
|
+
};
|
|
2794
|
+
content: {
|
|
2795
|
+
"application/json": {
|
|
2796
|
+
error: string;
|
|
2797
|
+
};
|
|
2798
|
+
"multipart/form-data": {
|
|
2799
|
+
error: string;
|
|
2800
|
+
};
|
|
2801
|
+
"text/plain": {
|
|
2802
|
+
error: string;
|
|
2803
|
+
};
|
|
2804
|
+
};
|
|
2805
|
+
};
|
|
2806
|
+
403: {
|
|
2807
|
+
headers: {
|
|
2808
|
+
[name: string]: unknown;
|
|
2809
|
+
};
|
|
2810
|
+
content: {
|
|
2811
|
+
"application/json": {
|
|
2812
|
+
error: string;
|
|
2813
|
+
};
|
|
2814
|
+
"multipart/form-data": {
|
|
2815
|
+
error: string;
|
|
2816
|
+
};
|
|
2817
|
+
"text/plain": {
|
|
2818
|
+
error: string;
|
|
2819
|
+
};
|
|
2820
|
+
};
|
|
2821
|
+
};
|
|
2822
|
+
404: {
|
|
2823
|
+
headers: {
|
|
2824
|
+
[name: string]: unknown;
|
|
2825
|
+
};
|
|
2826
|
+
content: {
|
|
2827
|
+
"application/json": {
|
|
2828
|
+
error: string;
|
|
2829
|
+
};
|
|
2830
|
+
"multipart/form-data": {
|
|
2831
|
+
error: string;
|
|
2832
|
+
};
|
|
2833
|
+
"text/plain": {
|
|
2834
|
+
error: string;
|
|
2835
|
+
};
|
|
2836
|
+
};
|
|
2837
|
+
};
|
|
2838
|
+
502: {
|
|
2839
|
+
headers: {
|
|
2840
|
+
[name: string]: unknown;
|
|
2841
|
+
};
|
|
2842
|
+
content: {
|
|
2843
|
+
"application/json": {
|
|
2844
|
+
error: string;
|
|
2845
|
+
};
|
|
2846
|
+
"multipart/form-data": {
|
|
2847
|
+
error: string;
|
|
2848
|
+
};
|
|
2849
|
+
"text/plain": {
|
|
2850
|
+
error: string;
|
|
2851
|
+
};
|
|
2852
|
+
};
|
|
2853
|
+
};
|
|
2854
|
+
};
|
|
2855
|
+
};
|
|
2713
2856
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@cesar-richard/git-connector-sdk",
|
|
3
|
-
"version": "1.
|
|
3
|
+
"version": "1.64.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": {
|