@rawdash/connector-gitlab 0.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 +113 -0
- package/dist/index.d.ts +427 -0
- package/dist/index.js +811 -0
- package/dist/index.js.map +1 -0
- package/package.json +43 -0
package/README.md
ADDED
|
@@ -0,0 +1,113 @@
|
|
|
1
|
+
<!-- This file is generated from connector metadata by scripts/generate-connector-docs.ts. Do not edit by hand. -->
|
|
2
|
+
|
|
3
|
+
# @rawdash/connector-gitlab
|
|
4
|
+
|
|
5
|
+
[](https://www.npmjs.com/package/@rawdash/connector-gitlab)
|
|
6
|
+
[](https://github.com/rawdash/rawdash/blob/main/LICENSE)
|
|
7
|
+
|
|
8
|
+
Sync projects, merge requests, pipelines, issues, and releases from GitLab.com or a self-hosted GitLab instance.
|
|
9
|
+
|
|
10
|
+
## Install
|
|
11
|
+
|
|
12
|
+
```sh
|
|
13
|
+
npm install @rawdash/connector-gitlab
|
|
14
|
+
```
|
|
15
|
+
|
|
16
|
+
## Authentication
|
|
17
|
+
|
|
18
|
+
A GitLab Personal Access Token (PAT) with the `read_api` scope is required. The PAT must belong to an account with read access to the projects and groups you want to sync. Self-hosted GitLab is supported by overriding the `host` field.
|
|
19
|
+
|
|
20
|
+
1. Open GitLab -> User Preferences -> Access Tokens (or the equivalent on your self-hosted instance).
|
|
21
|
+
2. Create a Personal Access Token with the `read_api` scope.
|
|
22
|
+
3. Store it as a secret and reference it from the connector config as `apiToken: secret("GITLAB_API_TOKEN")`.
|
|
23
|
+
4. Set `projectIds` to a list of numeric project IDs, or `groupIds` to a list of numeric group IDs (or both). At least one must be set.
|
|
24
|
+
5. For self-hosted GitLab, set `host` to your instance hostname (no protocol or path), e.g. `gitlab.example.com`.
|
|
25
|
+
|
|
26
|
+
## Configuration
|
|
27
|
+
|
|
28
|
+
| Field | Type | Required | Description |
|
|
29
|
+
| ------------ | ------ | -------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |
|
|
30
|
+
| `apiToken` | secret | Yes | GitLab Personal Access Token with `read_api` scope. Create one at GitLab -> Preferences -> Access Tokens. |
|
|
31
|
+
| `host` | string | No | Your GitLab host. Defaults to `gitlab.com`. For self-hosted, supply the hostname only (e.g. `gitlab.example.com`). |
|
|
32
|
+
| `projectIds` | array | No | Numeric project IDs to sync directly (find one in Project -> Settings -> General). Combined with any projects discovered via `groupIds`. |
|
|
33
|
+
| `groupIds` | array | No | Numeric group IDs whose projects (including subgroups) will be discovered and synced. |
|
|
34
|
+
| `resources` | array | No | Which GitLab resources to sync. Omit to sync all of them. 'pipeline_event' rides the 'pipeline' phase - enabling it without 'pipeline' still fetches pipelines but skips writing pipeline entities. |
|
|
35
|
+
|
|
36
|
+
## Resources
|
|
37
|
+
|
|
38
|
+
- **`project`** _(entity)_ - GitLab projects (repositories) with namespace path, default branch, and archived/visibility flags.
|
|
39
|
+
- Endpoint: `GET /api/v4/projects/{id}`
|
|
40
|
+
- Discovered from configured `projectIds` and from `groupIds` via GET /api/v4/groups/{id}/projects?include_subgroups=true.
|
|
41
|
+
- **`merge_request`** _(entity)_ - Open, merged, and closed merge requests with author, source/target branches, and merge timestamps.
|
|
42
|
+
- Endpoint: `GET /api/v4/projects/{id}/merge_requests`
|
|
43
|
+
- **`pipeline`** _(entity)_ - CI/CD pipelines with status, ref, commit sha, source, duration, and start/finish timestamps.
|
|
44
|
+
- Endpoint: `GET /api/v4/projects/{id}/pipelines`
|
|
45
|
+
- **`pipeline_event`** _(event)_ - Pipeline lifecycle events. One event per pipeline covering created_at to finished_at (or updated_at if not yet finished), tagged with the terminal status.
|
|
46
|
+
- Endpoint: `GET /api/v4/projects/{id}/pipelines`
|
|
47
|
+
- Derived from the same pipelines response that builds the `pipeline` resource; the GitLab API does not expose an intermediate state-transition history endpoint.
|
|
48
|
+
- **`issue`** _(entity)_ - Open and closed issues with labels, author, assignees, and close timestamp.
|
|
49
|
+
- Endpoint: `GET /api/v4/projects/{id}/issues`
|
|
50
|
+
- **`release`** _(entity)_ - Project releases keyed by tag name, including released_at and the publishing author.
|
|
51
|
+
- Endpoint: `GET /api/v4/projects/{id}/releases`
|
|
52
|
+
|
|
53
|
+
## Example
|
|
54
|
+
|
|
55
|
+
```ts
|
|
56
|
+
import {
|
|
57
|
+
defineConfig,
|
|
58
|
+
defineDashboard,
|
|
59
|
+
defineMetric,
|
|
60
|
+
secret,
|
|
61
|
+
} from '@rawdash/core';
|
|
62
|
+
|
|
63
|
+
const gitlab = {
|
|
64
|
+
name: 'gitlab',
|
|
65
|
+
connectorId: 'gitlab',
|
|
66
|
+
config: {
|
|
67
|
+
apiToken: secret('GITLAB_API_TOKEN'),
|
|
68
|
+
host: 'gitlab.com',
|
|
69
|
+
projectIds: [278964],
|
|
70
|
+
},
|
|
71
|
+
};
|
|
72
|
+
|
|
73
|
+
export default defineConfig({
|
|
74
|
+
connectors: [gitlab],
|
|
75
|
+
dashboards: {
|
|
76
|
+
engineering: defineDashboard({
|
|
77
|
+
widgets: {
|
|
78
|
+
open_merge_requests: {
|
|
79
|
+
kind: 'stat',
|
|
80
|
+
title: 'Open MRs',
|
|
81
|
+
metric: defineMetric({
|
|
82
|
+
connector: gitlab,
|
|
83
|
+
shape: 'entity',
|
|
84
|
+
entityType: 'merge_request',
|
|
85
|
+
fn: 'count',
|
|
86
|
+
filter: [{ field: 'state', op: 'eq', value: 'opened' }],
|
|
87
|
+
}),
|
|
88
|
+
},
|
|
89
|
+
},
|
|
90
|
+
}),
|
|
91
|
+
},
|
|
92
|
+
});
|
|
93
|
+
```
|
|
94
|
+
|
|
95
|
+
## Rate limits
|
|
96
|
+
|
|
97
|
+
GitLab returns standard `RateLimit-Remaining` / `RateLimit-Reset` headers (reset is a Unix timestamp in seconds); list pagination uses the Link header (page size 100).
|
|
98
|
+
|
|
99
|
+
## Limitations
|
|
100
|
+
|
|
101
|
+
- Container Registry, Packages, and GitLab Duo / AI features are out of scope.
|
|
102
|
+
- Pipeline state-transition events are synthesized: one `pipeline_event` is emitted per pipeline lifecycle (created_at to finished_at/updated_at), not one per intermediate state change.
|
|
103
|
+
- Group project discovery walks each group with `include_subgroups=true`; very large groups may take multiple sync chunks to enumerate.
|
|
104
|
+
|
|
105
|
+
## Links
|
|
106
|
+
|
|
107
|
+
- [Rawdash docs](https://rawdash.dev/docs/connectors/)
|
|
108
|
+
- [GitLab API docs](https://docs.gitlab.com/ee/api/)
|
|
109
|
+
- [GitHub](https://github.com/rawdash/rawdash)
|
|
110
|
+
|
|
111
|
+
## License
|
|
112
|
+
|
|
113
|
+
Apache-2.0
|
package/dist/index.d.ts
ADDED
|
@@ -0,0 +1,427 @@
|
|
|
1
|
+
import { BaseConnector, ConnectorContext, SyncOptions, StorageHandle, SyncResult, ConnectorDoc } from '@rawdash/core';
|
|
2
|
+
import { z } from 'zod';
|
|
3
|
+
|
|
4
|
+
declare const configFields: z.ZodObject<{
|
|
5
|
+
apiToken: z.ZodObject<{
|
|
6
|
+
$secret: z.ZodString;
|
|
7
|
+
}, z.core.$strip>;
|
|
8
|
+
host: z.ZodOptional<z.ZodString>;
|
|
9
|
+
projectIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
10
|
+
groupIds: z.ZodOptional<z.ZodArray<z.ZodNumber>>;
|
|
11
|
+
resources: z.ZodOptional<z.ZodArray<z.ZodEnum<{
|
|
12
|
+
project: "project";
|
|
13
|
+
merge_request: "merge_request";
|
|
14
|
+
pipeline: "pipeline";
|
|
15
|
+
pipeline_event: "pipeline_event";
|
|
16
|
+
issue: "issue";
|
|
17
|
+
release: "release";
|
|
18
|
+
}>>>;
|
|
19
|
+
}, z.core.$strip>;
|
|
20
|
+
declare const doc: ConnectorDoc;
|
|
21
|
+
type GitLabResource = 'project' | 'merge_request' | 'pipeline' | 'pipeline_event' | 'issue' | 'release';
|
|
22
|
+
interface GitLabSettings {
|
|
23
|
+
host: string;
|
|
24
|
+
projectIds?: readonly number[];
|
|
25
|
+
groupIds?: readonly number[];
|
|
26
|
+
resources?: readonly GitLabResource[];
|
|
27
|
+
}
|
|
28
|
+
declare const gitlabCredentials: {
|
|
29
|
+
apiToken: {
|
|
30
|
+
description: string;
|
|
31
|
+
auth: "required";
|
|
32
|
+
};
|
|
33
|
+
};
|
|
34
|
+
type GitLabCredentials = typeof gitlabCredentials;
|
|
35
|
+
declare const gitlabResources: {
|
|
36
|
+
readonly project: {
|
|
37
|
+
readonly shape: "entity";
|
|
38
|
+
readonly description: "GitLab projects (repositories) with namespace path, default branch, and archived/visibility flags.";
|
|
39
|
+
readonly endpoint: "GET /api/v4/projects/{id}";
|
|
40
|
+
readonly notes: "Discovered from configured `projectIds` and from `groupIds` via GET /api/v4/groups/{id}/projects?include_subgroups=true.";
|
|
41
|
+
readonly responses: {
|
|
42
|
+
readonly projects: z.ZodArray<z.ZodObject<{
|
|
43
|
+
id: z.ZodNumber;
|
|
44
|
+
name: z.ZodString;
|
|
45
|
+
path_with_namespace: z.ZodString;
|
|
46
|
+
default_branch: z.ZodNullable<z.ZodString>;
|
|
47
|
+
web_url: z.ZodString;
|
|
48
|
+
created_at: z.ZodISODateTime;
|
|
49
|
+
last_activity_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
50
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
51
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
52
|
+
}, z.core.$strip>>;
|
|
53
|
+
};
|
|
54
|
+
};
|
|
55
|
+
readonly merge_request: {
|
|
56
|
+
readonly shape: "entity";
|
|
57
|
+
readonly description: "Open, merged, and closed merge requests with author, source/target branches, and merge timestamps.";
|
|
58
|
+
readonly endpoint: "GET /api/v4/projects/{id}/merge_requests";
|
|
59
|
+
readonly responses: {
|
|
60
|
+
readonly merge_requests: z.ZodArray<z.ZodObject<{
|
|
61
|
+
id: z.ZodNumber;
|
|
62
|
+
iid: z.ZodNumber;
|
|
63
|
+
project_id: z.ZodNumber;
|
|
64
|
+
title: z.ZodString;
|
|
65
|
+
state: z.ZodString;
|
|
66
|
+
draft: z.ZodOptional<z.ZodBoolean>;
|
|
67
|
+
work_in_progress: z.ZodOptional<z.ZodBoolean>;
|
|
68
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
69
|
+
id: z.ZodNumber;
|
|
70
|
+
username: z.ZodString;
|
|
71
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
72
|
+
}, z.core.$strip>>;
|
|
73
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
74
|
+
id: z.ZodNumber;
|
|
75
|
+
username: z.ZodString;
|
|
76
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
77
|
+
}, z.core.$strip>>>;
|
|
78
|
+
source_branch: z.ZodString;
|
|
79
|
+
target_branch: z.ZodString;
|
|
80
|
+
created_at: z.ZodISODateTime;
|
|
81
|
+
updated_at: z.ZodISODateTime;
|
|
82
|
+
merged_at: z.ZodNullable<z.ZodISODateTime>;
|
|
83
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
84
|
+
web_url: z.ZodString;
|
|
85
|
+
}, z.core.$strip>>;
|
|
86
|
+
};
|
|
87
|
+
};
|
|
88
|
+
readonly pipeline: {
|
|
89
|
+
readonly shape: "entity";
|
|
90
|
+
readonly description: "CI/CD pipelines with status, ref, commit sha, source, duration, and start/finish timestamps.";
|
|
91
|
+
readonly endpoint: "GET /api/v4/projects/{id}/pipelines";
|
|
92
|
+
readonly responses: {
|
|
93
|
+
readonly pipelines: z.ZodArray<z.ZodObject<{
|
|
94
|
+
id: z.ZodNumber;
|
|
95
|
+
iid: z.ZodOptional<z.ZodNumber>;
|
|
96
|
+
project_id: z.ZodNumber;
|
|
97
|
+
status: z.ZodString;
|
|
98
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
99
|
+
sha: z.ZodString;
|
|
100
|
+
source: z.ZodNullable<z.ZodString>;
|
|
101
|
+
created_at: z.ZodISODateTime;
|
|
102
|
+
updated_at: z.ZodISODateTime;
|
|
103
|
+
started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
104
|
+
finished_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
105
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
106
|
+
web_url: z.ZodString;
|
|
107
|
+
}, z.core.$strip>>;
|
|
108
|
+
};
|
|
109
|
+
};
|
|
110
|
+
readonly pipeline_event: {
|
|
111
|
+
readonly shape: "event";
|
|
112
|
+
readonly description: "Pipeline lifecycle events. One event per pipeline covering created_at to finished_at (or updated_at if not yet finished), tagged with the terminal status.";
|
|
113
|
+
readonly endpoint: "GET /api/v4/projects/{id}/pipelines";
|
|
114
|
+
readonly notes: "Derived from the same pipelines response that builds the `pipeline` resource; the GitLab API does not expose an intermediate state-transition history endpoint.";
|
|
115
|
+
};
|
|
116
|
+
readonly issue: {
|
|
117
|
+
readonly shape: "entity";
|
|
118
|
+
readonly description: "Open and closed issues with labels, author, assignees, and close timestamp.";
|
|
119
|
+
readonly endpoint: "GET /api/v4/projects/{id}/issues";
|
|
120
|
+
readonly responses: {
|
|
121
|
+
readonly issues: z.ZodArray<z.ZodObject<{
|
|
122
|
+
id: z.ZodNumber;
|
|
123
|
+
iid: z.ZodNumber;
|
|
124
|
+
project_id: z.ZodNumber;
|
|
125
|
+
title: z.ZodString;
|
|
126
|
+
state: z.ZodString;
|
|
127
|
+
labels: z.ZodArray<z.ZodString>;
|
|
128
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
129
|
+
id: z.ZodNumber;
|
|
130
|
+
username: z.ZodString;
|
|
131
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
132
|
+
}, z.core.$strip>>;
|
|
133
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
134
|
+
id: z.ZodNumber;
|
|
135
|
+
username: z.ZodString;
|
|
136
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
137
|
+
}, z.core.$strip>>>;
|
|
138
|
+
created_at: z.ZodISODateTime;
|
|
139
|
+
updated_at: z.ZodISODateTime;
|
|
140
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
141
|
+
web_url: z.ZodString;
|
|
142
|
+
}, z.core.$strip>>;
|
|
143
|
+
};
|
|
144
|
+
};
|
|
145
|
+
readonly release: {
|
|
146
|
+
readonly shape: "entity";
|
|
147
|
+
readonly description: "Project releases keyed by tag name, including released_at and the publishing author.";
|
|
148
|
+
readonly endpoint: "GET /api/v4/projects/{id}/releases";
|
|
149
|
+
readonly responses: {
|
|
150
|
+
readonly releases: z.ZodArray<z.ZodObject<{
|
|
151
|
+
tag_name: z.ZodString;
|
|
152
|
+
name: z.ZodNullable<z.ZodString>;
|
|
153
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
154
|
+
created_at: z.ZodISODateTime;
|
|
155
|
+
released_at: z.ZodNullable<z.ZodISODateTime>;
|
|
156
|
+
author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
157
|
+
id: z.ZodNumber;
|
|
158
|
+
username: z.ZodString;
|
|
159
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
160
|
+
}, z.core.$strip>>>;
|
|
161
|
+
}, z.core.$strip>>;
|
|
162
|
+
};
|
|
163
|
+
};
|
|
164
|
+
};
|
|
165
|
+
declare const id = "gitlab";
|
|
166
|
+
declare class GitLabConnector extends BaseConnector<GitLabSettings, GitLabCredentials> {
|
|
167
|
+
static readonly id = "gitlab";
|
|
168
|
+
static readonly resources: {
|
|
169
|
+
readonly project: {
|
|
170
|
+
readonly shape: "entity";
|
|
171
|
+
readonly description: "GitLab projects (repositories) with namespace path, default branch, and archived/visibility flags.";
|
|
172
|
+
readonly endpoint: "GET /api/v4/projects/{id}";
|
|
173
|
+
readonly notes: "Discovered from configured `projectIds` and from `groupIds` via GET /api/v4/groups/{id}/projects?include_subgroups=true.";
|
|
174
|
+
readonly responses: {
|
|
175
|
+
readonly projects: z.ZodArray<z.ZodObject<{
|
|
176
|
+
id: z.ZodNumber;
|
|
177
|
+
name: z.ZodString;
|
|
178
|
+
path_with_namespace: z.ZodString;
|
|
179
|
+
default_branch: z.ZodNullable<z.ZodString>;
|
|
180
|
+
web_url: z.ZodString;
|
|
181
|
+
created_at: z.ZodISODateTime;
|
|
182
|
+
last_activity_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
183
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
184
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
185
|
+
}, z.core.$strip>>;
|
|
186
|
+
};
|
|
187
|
+
};
|
|
188
|
+
readonly merge_request: {
|
|
189
|
+
readonly shape: "entity";
|
|
190
|
+
readonly description: "Open, merged, and closed merge requests with author, source/target branches, and merge timestamps.";
|
|
191
|
+
readonly endpoint: "GET /api/v4/projects/{id}/merge_requests";
|
|
192
|
+
readonly responses: {
|
|
193
|
+
readonly merge_requests: z.ZodArray<z.ZodObject<{
|
|
194
|
+
id: z.ZodNumber;
|
|
195
|
+
iid: z.ZodNumber;
|
|
196
|
+
project_id: z.ZodNumber;
|
|
197
|
+
title: z.ZodString;
|
|
198
|
+
state: z.ZodString;
|
|
199
|
+
draft: z.ZodOptional<z.ZodBoolean>;
|
|
200
|
+
work_in_progress: z.ZodOptional<z.ZodBoolean>;
|
|
201
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
202
|
+
id: z.ZodNumber;
|
|
203
|
+
username: z.ZodString;
|
|
204
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
205
|
+
}, z.core.$strip>>;
|
|
206
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
207
|
+
id: z.ZodNumber;
|
|
208
|
+
username: z.ZodString;
|
|
209
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
210
|
+
}, z.core.$strip>>>;
|
|
211
|
+
source_branch: z.ZodString;
|
|
212
|
+
target_branch: z.ZodString;
|
|
213
|
+
created_at: z.ZodISODateTime;
|
|
214
|
+
updated_at: z.ZodISODateTime;
|
|
215
|
+
merged_at: z.ZodNullable<z.ZodISODateTime>;
|
|
216
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
217
|
+
web_url: z.ZodString;
|
|
218
|
+
}, z.core.$strip>>;
|
|
219
|
+
};
|
|
220
|
+
};
|
|
221
|
+
readonly pipeline: {
|
|
222
|
+
readonly shape: "entity";
|
|
223
|
+
readonly description: "CI/CD pipelines with status, ref, commit sha, source, duration, and start/finish timestamps.";
|
|
224
|
+
readonly endpoint: "GET /api/v4/projects/{id}/pipelines";
|
|
225
|
+
readonly responses: {
|
|
226
|
+
readonly pipelines: z.ZodArray<z.ZodObject<{
|
|
227
|
+
id: z.ZodNumber;
|
|
228
|
+
iid: z.ZodOptional<z.ZodNumber>;
|
|
229
|
+
project_id: z.ZodNumber;
|
|
230
|
+
status: z.ZodString;
|
|
231
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
232
|
+
sha: z.ZodString;
|
|
233
|
+
source: z.ZodNullable<z.ZodString>;
|
|
234
|
+
created_at: z.ZodISODateTime;
|
|
235
|
+
updated_at: z.ZodISODateTime;
|
|
236
|
+
started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
237
|
+
finished_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
238
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
239
|
+
web_url: z.ZodString;
|
|
240
|
+
}, z.core.$strip>>;
|
|
241
|
+
};
|
|
242
|
+
};
|
|
243
|
+
readonly pipeline_event: {
|
|
244
|
+
readonly shape: "event";
|
|
245
|
+
readonly description: "Pipeline lifecycle events. One event per pipeline covering created_at to finished_at (or updated_at if not yet finished), tagged with the terminal status.";
|
|
246
|
+
readonly endpoint: "GET /api/v4/projects/{id}/pipelines";
|
|
247
|
+
readonly notes: "Derived from the same pipelines response that builds the `pipeline` resource; the GitLab API does not expose an intermediate state-transition history endpoint.";
|
|
248
|
+
};
|
|
249
|
+
readonly issue: {
|
|
250
|
+
readonly shape: "entity";
|
|
251
|
+
readonly description: "Open and closed issues with labels, author, assignees, and close timestamp.";
|
|
252
|
+
readonly endpoint: "GET /api/v4/projects/{id}/issues";
|
|
253
|
+
readonly responses: {
|
|
254
|
+
readonly issues: z.ZodArray<z.ZodObject<{
|
|
255
|
+
id: z.ZodNumber;
|
|
256
|
+
iid: z.ZodNumber;
|
|
257
|
+
project_id: z.ZodNumber;
|
|
258
|
+
title: z.ZodString;
|
|
259
|
+
state: z.ZodString;
|
|
260
|
+
labels: z.ZodArray<z.ZodString>;
|
|
261
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
262
|
+
id: z.ZodNumber;
|
|
263
|
+
username: z.ZodString;
|
|
264
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
265
|
+
}, z.core.$strip>>;
|
|
266
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
267
|
+
id: z.ZodNumber;
|
|
268
|
+
username: z.ZodString;
|
|
269
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
270
|
+
}, z.core.$strip>>>;
|
|
271
|
+
created_at: z.ZodISODateTime;
|
|
272
|
+
updated_at: z.ZodISODateTime;
|
|
273
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
274
|
+
web_url: z.ZodString;
|
|
275
|
+
}, z.core.$strip>>;
|
|
276
|
+
};
|
|
277
|
+
};
|
|
278
|
+
readonly release: {
|
|
279
|
+
readonly shape: "entity";
|
|
280
|
+
readonly description: "Project releases keyed by tag name, including released_at and the publishing author.";
|
|
281
|
+
readonly endpoint: "GET /api/v4/projects/{id}/releases";
|
|
282
|
+
readonly responses: {
|
|
283
|
+
readonly releases: z.ZodArray<z.ZodObject<{
|
|
284
|
+
tag_name: z.ZodString;
|
|
285
|
+
name: z.ZodNullable<z.ZodString>;
|
|
286
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
287
|
+
created_at: z.ZodISODateTime;
|
|
288
|
+
released_at: z.ZodNullable<z.ZodISODateTime>;
|
|
289
|
+
author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
290
|
+
id: z.ZodNumber;
|
|
291
|
+
username: z.ZodString;
|
|
292
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
293
|
+
}, z.core.$strip>>>;
|
|
294
|
+
}, z.core.$strip>>;
|
|
295
|
+
};
|
|
296
|
+
};
|
|
297
|
+
};
|
|
298
|
+
static readonly schemas: object & {
|
|
299
|
+
readonly projects: z.ZodArray<z.ZodObject<{
|
|
300
|
+
id: z.ZodNumber;
|
|
301
|
+
name: z.ZodString;
|
|
302
|
+
path_with_namespace: z.ZodString;
|
|
303
|
+
default_branch: z.ZodNullable<z.ZodString>;
|
|
304
|
+
web_url: z.ZodString;
|
|
305
|
+
created_at: z.ZodISODateTime;
|
|
306
|
+
last_activity_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
307
|
+
archived: z.ZodOptional<z.ZodBoolean>;
|
|
308
|
+
visibility: z.ZodOptional<z.ZodString>;
|
|
309
|
+
}, z.core.$strip>>;
|
|
310
|
+
} & {
|
|
311
|
+
readonly merge_requests: z.ZodArray<z.ZodObject<{
|
|
312
|
+
id: z.ZodNumber;
|
|
313
|
+
iid: z.ZodNumber;
|
|
314
|
+
project_id: z.ZodNumber;
|
|
315
|
+
title: z.ZodString;
|
|
316
|
+
state: z.ZodString;
|
|
317
|
+
draft: z.ZodOptional<z.ZodBoolean>;
|
|
318
|
+
work_in_progress: z.ZodOptional<z.ZodBoolean>;
|
|
319
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
320
|
+
id: z.ZodNumber;
|
|
321
|
+
username: z.ZodString;
|
|
322
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
323
|
+
}, z.core.$strip>>;
|
|
324
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
325
|
+
id: z.ZodNumber;
|
|
326
|
+
username: z.ZodString;
|
|
327
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
328
|
+
}, z.core.$strip>>>;
|
|
329
|
+
source_branch: z.ZodString;
|
|
330
|
+
target_branch: z.ZodString;
|
|
331
|
+
created_at: z.ZodISODateTime;
|
|
332
|
+
updated_at: z.ZodISODateTime;
|
|
333
|
+
merged_at: z.ZodNullable<z.ZodISODateTime>;
|
|
334
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
335
|
+
web_url: z.ZodString;
|
|
336
|
+
}, z.core.$strip>>;
|
|
337
|
+
} & {
|
|
338
|
+
readonly pipelines: z.ZodArray<z.ZodObject<{
|
|
339
|
+
id: z.ZodNumber;
|
|
340
|
+
iid: z.ZodOptional<z.ZodNumber>;
|
|
341
|
+
project_id: z.ZodNumber;
|
|
342
|
+
status: z.ZodString;
|
|
343
|
+
ref: z.ZodNullable<z.ZodString>;
|
|
344
|
+
sha: z.ZodString;
|
|
345
|
+
source: z.ZodNullable<z.ZodString>;
|
|
346
|
+
created_at: z.ZodISODateTime;
|
|
347
|
+
updated_at: z.ZodISODateTime;
|
|
348
|
+
started_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
349
|
+
finished_at: z.ZodOptional<z.ZodNullable<z.ZodISODateTime>>;
|
|
350
|
+
duration: z.ZodOptional<z.ZodNullable<z.ZodNumber>>;
|
|
351
|
+
web_url: z.ZodString;
|
|
352
|
+
}, z.core.$strip>>;
|
|
353
|
+
} & {
|
|
354
|
+
readonly issues: z.ZodArray<z.ZodObject<{
|
|
355
|
+
id: z.ZodNumber;
|
|
356
|
+
iid: z.ZodNumber;
|
|
357
|
+
project_id: z.ZodNumber;
|
|
358
|
+
title: z.ZodString;
|
|
359
|
+
state: z.ZodString;
|
|
360
|
+
labels: z.ZodArray<z.ZodString>;
|
|
361
|
+
author: z.ZodNullable<z.ZodObject<{
|
|
362
|
+
id: z.ZodNumber;
|
|
363
|
+
username: z.ZodString;
|
|
364
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
365
|
+
}, z.core.$strip>>;
|
|
366
|
+
assignees: z.ZodOptional<z.ZodArray<z.ZodObject<{
|
|
367
|
+
id: z.ZodNumber;
|
|
368
|
+
username: z.ZodString;
|
|
369
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
370
|
+
}, z.core.$strip>>>;
|
|
371
|
+
created_at: z.ZodISODateTime;
|
|
372
|
+
updated_at: z.ZodISODateTime;
|
|
373
|
+
closed_at: z.ZodNullable<z.ZodISODateTime>;
|
|
374
|
+
web_url: z.ZodString;
|
|
375
|
+
}, z.core.$strip>>;
|
|
376
|
+
} & {
|
|
377
|
+
readonly releases: z.ZodArray<z.ZodObject<{
|
|
378
|
+
tag_name: z.ZodString;
|
|
379
|
+
name: z.ZodNullable<z.ZodString>;
|
|
380
|
+
description: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
381
|
+
created_at: z.ZodISODateTime;
|
|
382
|
+
released_at: z.ZodNullable<z.ZodISODateTime>;
|
|
383
|
+
author: z.ZodOptional<z.ZodNullable<z.ZodObject<{
|
|
384
|
+
id: z.ZodNumber;
|
|
385
|
+
username: z.ZodString;
|
|
386
|
+
name: z.ZodOptional<z.ZodNullable<z.ZodString>>;
|
|
387
|
+
}, z.core.$strip>>>;
|
|
388
|
+
}, z.core.$strip>>;
|
|
389
|
+
} & Readonly<Record<string, z.ZodType<unknown, unknown, z.core.$ZodTypeInternals<unknown, unknown>>>>;
|
|
390
|
+
static create(input: unknown, ctx?: ConnectorContext): GitLabConnector;
|
|
391
|
+
readonly id = "gitlab";
|
|
392
|
+
readonly credentials: {
|
|
393
|
+
apiToken: {
|
|
394
|
+
description: string;
|
|
395
|
+
auth: "required";
|
|
396
|
+
};
|
|
397
|
+
};
|
|
398
|
+
private effectiveProjectIds;
|
|
399
|
+
private projectMetadataCache;
|
|
400
|
+
constructor(settings: GitLabSettings, creds?: {
|
|
401
|
+
apiToken: {
|
|
402
|
+
$secret: string;
|
|
403
|
+
} | string;
|
|
404
|
+
}, ctx?: ConnectorContext);
|
|
405
|
+
private buildHeaders;
|
|
406
|
+
private apiBase;
|
|
407
|
+
private fetch;
|
|
408
|
+
private sanitizeUrl;
|
|
409
|
+
private static readonly PHASE_RESOURCES;
|
|
410
|
+
private activePhases;
|
|
411
|
+
private isResourceAllowed;
|
|
412
|
+
private resolveEffectiveProjectIds;
|
|
413
|
+
private fetchGroupProjects;
|
|
414
|
+
private fetchProjectMetadata;
|
|
415
|
+
private fetchProjectsPhase;
|
|
416
|
+
private buildListPageUrl;
|
|
417
|
+
private fetchListPhase;
|
|
418
|
+
private writeProjects;
|
|
419
|
+
private writeMergeRequests;
|
|
420
|
+
private writePipelines;
|
|
421
|
+
private writeIssues;
|
|
422
|
+
private writeReleases;
|
|
423
|
+
private resolveCursor;
|
|
424
|
+
sync(options: SyncOptions, storage: StorageHandle, signal?: AbortSignal): Promise<SyncResult>;
|
|
425
|
+
}
|
|
426
|
+
|
|
427
|
+
export { GitLabConnector, type GitLabResource, type GitLabSettings, configFields, GitLabConnector as default, doc, id, gitlabResources as resources };
|