@lbdudc/linea-git 0.0.0-stage → 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 +47 -2
- package/dist/access.d.ts +18 -0
- package/dist/access.js +18 -0
- package/dist/access.js.map +1 -0
- package/dist/auth.d.ts +11 -0
- package/dist/auth.js +16 -0
- package/dist/auth.js.map +1 -0
- package/dist/changelog/generate.d.ts +18 -0
- package/dist/changelog/generate.js +166 -0
- package/dist/changelog/generate.js.map +1 -0
- package/dist/changelog/index.d.ts +5 -0
- package/dist/changelog/index.js +3 -0
- package/dist/changelog/index.js.map +1 -0
- package/dist/changelog/parse.d.ts +43 -0
- package/dist/changelog/parse.js +91 -0
- package/dist/changelog/parse.js.map +1 -0
- package/dist/changelog/types.d.ts +85 -0
- package/dist/changelog/types.js +2 -0
- package/dist/changelog/types.js.map +1 -0
- package/dist/checkout/credential.d.ts +14 -0
- package/dist/checkout/credential.js +29 -0
- package/dist/checkout/credential.js.map +1 -0
- package/dist/checkout/git.d.ts +78 -0
- package/dist/checkout/git.js +191 -0
- package/dist/checkout/git.js.map +1 -0
- package/dist/checkout/index.d.ts +3 -0
- package/dist/checkout/index.js +4 -0
- package/dist/checkout/index.js.map +1 -0
- package/dist/checkout/sync.d.ts +156 -0
- package/dist/checkout/sync.js +211 -0
- package/dist/checkout/sync.js.map +1 -0
- package/dist/closing.d.ts +1 -0
- package/dist/closing.js +14 -0
- package/dist/closing.js.map +1 -0
- package/dist/config.d.ts +53 -0
- package/dist/config.js +40 -0
- package/dist/config.js.map +1 -0
- package/dist/deletion.d.ts +19 -0
- package/dist/deletion.js +27 -0
- package/dist/deletion.js.map +1 -0
- package/dist/errors.d.ts +26 -0
- package/dist/errors.js +47 -0
- package/dist/errors.js.map +1 -0
- package/dist/factory.d.ts +20 -0
- package/dist/factory.js +46 -0
- package/dist/factory.js.map +1 -0
- package/dist/github/client.d.ts +44 -0
- package/dist/github/client.js +145 -0
- package/dist/github/client.js.map +1 -0
- package/dist/github/config.d.ts +24 -0
- package/dist/github/config.js +11 -0
- package/dist/github/config.js.map +1 -0
- package/dist/github/provider.d.ts +510 -0
- package/dist/github/provider.js +1009 -0
- package/dist/github/provider.js.map +1 -0
- package/dist/gitlab/client.d.ts +50 -0
- package/dist/gitlab/client.js +228 -0
- package/dist/gitlab/client.js.map +1 -0
- package/dist/gitlab/provider.d.ts +487 -0
- package/dist/gitlab/provider.js +719 -0
- package/dist/gitlab/provider.js.map +1 -0
- package/dist/host.d.ts +27 -0
- package/dist/host.js +45 -0
- package/dist/host.js.map +1 -0
- package/dist/index.d.ts +46 -0
- package/dist/index.js +31 -0
- package/dist/index.js.map +1 -0
- package/dist/local/diff.d.ts +3 -0
- package/dist/local/diff.js +43 -0
- package/dist/local/diff.js.map +1 -0
- package/dist/local/git.d.ts +24 -0
- package/dist/local/git.js +51 -0
- package/dist/local/git.js.map +1 -0
- package/dist/local/health.d.ts +36 -0
- package/dist/local/health.js +57 -0
- package/dist/local/health.js.map +1 -0
- package/dist/local/hooks.d.ts +2 -0
- package/dist/local/hooks.js +44 -0
- package/dist/local/hooks.js.map +1 -0
- package/dist/local/http.d.ts +35 -0
- package/dist/local/http.js +160 -0
- package/dist/local/http.js.map +1 -0
- package/dist/local/provider.d.ts +571 -0
- package/dist/local/provider.js +1237 -0
- package/dist/local/provider.js.map +1 -0
- package/dist/local/store.d.ts +136 -0
- package/dist/local/store.js +171 -0
- package/dist/local/store.js.map +1 -0
- package/dist/packages/github-source.d.ts +69 -0
- package/dist/packages/github-source.js +133 -0
- package/dist/packages/github-source.js.map +1 -0
- package/dist/packages/gitlab-source.d.ts +59 -0
- package/dist/packages/gitlab-source.js +214 -0
- package/dist/packages/gitlab-source.js.map +1 -0
- package/dist/packages/index.d.ts +30 -0
- package/dist/packages/index.js +45 -0
- package/dist/packages/index.js.map +1 -0
- package/dist/packages/provider-source.d.ts +34 -0
- package/dist/packages/provider-source.js +57 -0
- package/dist/packages/provider-source.js.map +1 -0
- package/dist/packages/repository-files.d.ts +12 -0
- package/dist/packages/repository-files.js +16 -0
- package/dist/packages/repository-files.js.map +1 -0
- package/dist/provider.d.ts +888 -0
- package/dist/provider.js +29 -0
- package/dist/provider.js.map +1 -0
- package/dist/read-cache.d.ts +5 -0
- package/dist/read-cache.js +101 -0
- package/dist/read-cache.js.map +1 -0
- package/dist/registry/catalog.d.ts +55 -0
- package/dist/registry/catalog.js +143 -0
- package/dist/registry/catalog.js.map +1 -0
- package/dist/registry/kinds.d.ts +21 -0
- package/dist/registry/kinds.js +43 -0
- package/dist/registry/kinds.js.map +1 -0
- package/dist/registry/packages.d.ts +165 -0
- package/dist/registry/packages.js +290 -0
- package/dist/registry/packages.js.map +1 -0
- package/dist/registry/publish.d.ts +35 -0
- package/dist/registry/publish.js +155 -0
- package/dist/registry/publish.js.map +1 -0
- package/dist/registry/release.d.ts +63 -0
- package/dist/registry/release.js +79 -0
- package/dist/registry/release.js.map +1 -0
- package/dist/restoration.d.ts +14 -0
- package/dist/restoration.js +33 -0
- package/dist/restoration.js.map +1 -0
- package/dist/templates.d.ts +8 -0
- package/dist/templates.js +39 -0
- package/dist/templates.js.map +1 -0
- package/dist/testing/contract.d.ts +43 -0
- package/dist/testing/contract.js +713 -0
- package/dist/testing/contract.js.map +1 -0
- package/dist/testing/diff.d.ts +1 -0
- package/dist/testing/diff.js +65 -0
- package/dist/testing/diff.js.map +1 -0
- package/dist/testing/git-http.d.ts +12 -0
- package/dist/testing/git-http.js +308 -0
- package/dist/testing/git-http.js.map +1 -0
- package/dist/testing/github-double.d.ts +151 -0
- package/dist/testing/github-double.js +1129 -0
- package/dist/testing/github-double.js.map +1 -0
- package/dist/testing/gitlab-double.d.ts +161 -0
- package/dist/testing/gitlab-double.js +1554 -0
- package/dist/testing/gitlab-double.js.map +1 -0
- package/dist/testing/index.d.ts +7 -0
- package/dist/testing/index.js +8 -0
- package/dist/testing/index.js.map +1 -0
- package/dist/version.d.ts +2 -0
- package/dist/version.js +12 -0
- package/dist/version.js.map +1 -0
- package/package.json +66 -4
|
@@ -0,0 +1,888 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The git host LINEA works on (GitLab, or GitHub): everything LINEA needs from it, in the host's own words left out.
|
|
3
|
+
*
|
|
4
|
+
* A deployment talks to ONE host. The server and the CLI never speak a host's API: they take a `GitProvider` (`createGitProvider`) and
|
|
5
|
+
* use only the methods below, with the shapes below. What differs between hosts is hidden in the provider: GitLab calls the same things
|
|
6
|
+
* groups, projects and merge requests; GitHub calls them organisations, repositories and pull requests, and has no groups inside
|
|
7
|
+
* groups (see docs/git-provider.md for how each difference is absorbed).
|
|
8
|
+
*
|
|
9
|
+
* A provider object is also a unit of work: what it creates (namespaces, repositories, files, commits, branches, tags) is remembered,
|
|
10
|
+
* and `rollback()` undoes it, newest first. Make one per operation.
|
|
11
|
+
*
|
|
12
|
+
* Every method takes the user's access `token` first. `id` is the repository id (or its `path`), `namespaceId` the id of a namespace.
|
|
13
|
+
*/
|
|
14
|
+
export type Id = number | string;
|
|
15
|
+
export interface Repository {
|
|
16
|
+
id: Id;
|
|
17
|
+
name: string;
|
|
18
|
+
/** Full path as the host shows it: `group/sub/name`, `owner/name`. */
|
|
19
|
+
path: string;
|
|
20
|
+
description: string;
|
|
21
|
+
webUrl: string;
|
|
22
|
+
webIdeUrl: string;
|
|
23
|
+
namespaceId: Id | undefined;
|
|
24
|
+
/** The namespace that contains this repository's namespace (for a product: the one that is its line). */
|
|
25
|
+
parentNamespaceId?: Id | undefined;
|
|
26
|
+
defaultBranch?: string | undefined;
|
|
27
|
+
topics: string[];
|
|
28
|
+
/** When the host made it (a host that does not keep it says nothing). */
|
|
29
|
+
createdAt?: string | undefined;
|
|
30
|
+
}
|
|
31
|
+
export interface Namespace {
|
|
32
|
+
id: Id;
|
|
33
|
+
fullPath: string;
|
|
34
|
+
name: string;
|
|
35
|
+
/** Made by `createNamespace` but not yet on the host: the repository that follows is what creates it. */
|
|
36
|
+
pending?: boolean;
|
|
37
|
+
}
|
|
38
|
+
export interface Member {
|
|
39
|
+
username: string;
|
|
40
|
+
/** 10 guest, 20 reporter/read, 30 developer/write, 40 maintainer, 50 owner/admin. */
|
|
41
|
+
accessLevel: number;
|
|
42
|
+
}
|
|
43
|
+
export interface RepositoryFile {
|
|
44
|
+
path: string;
|
|
45
|
+
name: string;
|
|
46
|
+
/** base64 */
|
|
47
|
+
content: string;
|
|
48
|
+
encoding: 'base64';
|
|
49
|
+
/** What to quote to say "I changed this file starting from this version" (GitLab: last commit id; GitHub: blob sha). */
|
|
50
|
+
revision: string;
|
|
51
|
+
}
|
|
52
|
+
export interface CommitSummary {
|
|
53
|
+
shortId: string;
|
|
54
|
+
title: string;
|
|
55
|
+
authorName: string;
|
|
56
|
+
createdAt: string;
|
|
57
|
+
webUrl?: string | undefined;
|
|
58
|
+
/** The whole message (title, blank line, body), when the host gives it. */
|
|
59
|
+
message?: string | undefined;
|
|
60
|
+
}
|
|
61
|
+
/** A merge request (GitLab) or a pull request (GitHub). */
|
|
62
|
+
export interface ChangeRequest {
|
|
63
|
+
number: number;
|
|
64
|
+
title: string;
|
|
65
|
+
sourceBranch: string;
|
|
66
|
+
targetBranch: string;
|
|
67
|
+
webUrl: string;
|
|
68
|
+
hasConflicts: boolean;
|
|
69
|
+
/** `opened`, `merged` or `closed`. Only the lists that ask for every state fill what follows. */
|
|
70
|
+
state?: 'opened' | 'merged' | 'closed' | undefined;
|
|
71
|
+
author?: string | undefined;
|
|
72
|
+
createdAt?: string | undefined;
|
|
73
|
+
mergedAt?: string | null | undefined;
|
|
74
|
+
/** The commit at the tip of the source branch: the one its checks are for. */
|
|
75
|
+
headSha?: string | undefined;
|
|
76
|
+
}
|
|
77
|
+
/** An issue, as every host shows it. `number` is the one of the repository (GitLab `iid`, GitHub `number`). */
|
|
78
|
+
/** The difference between two refs: what `to` brought since it left `from`. */
|
|
79
|
+
export interface Comparison {
|
|
80
|
+
commits: CommitSummary[];
|
|
81
|
+
files: FileDiff[];
|
|
82
|
+
}
|
|
83
|
+
export interface Issue {
|
|
84
|
+
number: number;
|
|
85
|
+
title: string;
|
|
86
|
+
/** Markdown. */
|
|
87
|
+
description: string;
|
|
88
|
+
state: 'opened' | 'closed';
|
|
89
|
+
author: string | undefined;
|
|
90
|
+
assignees: string[];
|
|
91
|
+
labels: string[];
|
|
92
|
+
/** The title of the milestone it belongs to. */
|
|
93
|
+
milestone: string | null;
|
|
94
|
+
createdAt: string;
|
|
95
|
+
updatedAt: string;
|
|
96
|
+
closedAt: string | null;
|
|
97
|
+
/** The page of the issue on the host (empty for a host that has no pages). */
|
|
98
|
+
webUrl: string;
|
|
99
|
+
commentCount: number;
|
|
100
|
+
}
|
|
101
|
+
/** One message of the thread of an issue. */
|
|
102
|
+
export interface Comment {
|
|
103
|
+
id: Id;
|
|
104
|
+
author: string | undefined;
|
|
105
|
+
/** Markdown. */
|
|
106
|
+
body: string;
|
|
107
|
+
createdAt: string;
|
|
108
|
+
updatedAt: string;
|
|
109
|
+
}
|
|
110
|
+
/** A release of a tag: what the host shows as the release notes of a version. `tag` is its key (one release per tag). */
|
|
111
|
+
export interface Release {
|
|
112
|
+
tag: string;
|
|
113
|
+
name: string;
|
|
114
|
+
/** Markdown. */
|
|
115
|
+
description: string;
|
|
116
|
+
createdAt: string;
|
|
117
|
+
/** The page of it on the host (empty for a host that has no pages). */
|
|
118
|
+
url: string;
|
|
119
|
+
prerelease: boolean;
|
|
120
|
+
}
|
|
121
|
+
export interface ReleaseChanges {
|
|
122
|
+
name?: string;
|
|
123
|
+
description?: string;
|
|
124
|
+
prerelease?: boolean;
|
|
125
|
+
}
|
|
126
|
+
export interface Label {
|
|
127
|
+
name: string;
|
|
128
|
+
/** `#rrggbb`, when the host has colours for labels. */
|
|
129
|
+
color?: string | undefined;
|
|
130
|
+
}
|
|
131
|
+
export interface Milestone {
|
|
132
|
+
title: string;
|
|
133
|
+
state: 'opened' | 'closed';
|
|
134
|
+
dueDate?: string | null | undefined;
|
|
135
|
+
}
|
|
136
|
+
export interface IssueFilter {
|
|
137
|
+
/** Default `opened`. */
|
|
138
|
+
state?: 'opened' | 'closed' | 'all';
|
|
139
|
+
author?: string;
|
|
140
|
+
assignee?: string;
|
|
141
|
+
/** All of them. */
|
|
142
|
+
labels?: string[];
|
|
143
|
+
/** The title of a milestone. */
|
|
144
|
+
milestone?: string;
|
|
145
|
+
/** Text in the title or the description. */
|
|
146
|
+
search?: string;
|
|
147
|
+
/** From 1. */
|
|
148
|
+
page?: number;
|
|
149
|
+
/** Default 20, at most 100. */
|
|
150
|
+
perPage?: number;
|
|
151
|
+
}
|
|
152
|
+
/** One page of a list. A host does not always know how many there are in all: `hasMore` is what every host can say. */
|
|
153
|
+
export interface Page<T> {
|
|
154
|
+
items: T[];
|
|
155
|
+
page: number;
|
|
156
|
+
perPage: number;
|
|
157
|
+
hasMore: boolean;
|
|
158
|
+
}
|
|
159
|
+
export interface IssueChanges {
|
|
160
|
+
title?: string;
|
|
161
|
+
description?: string;
|
|
162
|
+
labels?: string[];
|
|
163
|
+
assignees?: string[];
|
|
164
|
+
/** The title of a milestone; `null` takes the issue out of its milestone. */
|
|
165
|
+
milestone?: string | null;
|
|
166
|
+
state?: 'opened' | 'closed';
|
|
167
|
+
}
|
|
168
|
+
/**
|
|
169
|
+
* What a host can do beyond the common part. The UI offers only what is `true`, and a call for something that is not is refused with
|
|
170
|
+
* status 400 rather than ignored.
|
|
171
|
+
*/
|
|
172
|
+
/** A repository the host is about to delete for good. */
|
|
173
|
+
export interface PendingDeletion {
|
|
174
|
+
id: Id;
|
|
175
|
+
name: string;
|
|
176
|
+
/** Where it was, as it was called before the host renamed it for the deletion. */
|
|
177
|
+
path: string;
|
|
178
|
+
/** Its page now, with whatever name the host gave it for the deletion: the only address that opens. */
|
|
179
|
+
webUrl: string;
|
|
180
|
+
namespaceId: Id | undefined;
|
|
181
|
+
/** The namespace that contains this repository's namespace (for a product: the one that is its line). */
|
|
182
|
+
parentNamespaceId?: Id | undefined;
|
|
183
|
+
/** The day the host deletes it for good; `null` when the host does not say. */
|
|
184
|
+
deletesOn: string | null;
|
|
185
|
+
/** When the host made the repository, if it says. */
|
|
186
|
+
createdAt?: string;
|
|
187
|
+
repositoryScheduled: boolean;
|
|
188
|
+
namespaceScheduled: boolean;
|
|
189
|
+
/** Something above its namespace waits to be deleted: it cannot come back before that does. */
|
|
190
|
+
ancestorScheduled: boolean;
|
|
191
|
+
}
|
|
192
|
+
export type TemplateKind = 'issue' | 'mergeRequest';
|
|
193
|
+
export interface Template {
|
|
194
|
+
name: string;
|
|
195
|
+
content: string;
|
|
196
|
+
}
|
|
197
|
+
export interface Capabilities {
|
|
198
|
+
issues: {
|
|
199
|
+
labels: boolean;
|
|
200
|
+
milestones: boolean;
|
|
201
|
+
assignees: boolean;
|
|
202
|
+
closingWords: boolean;
|
|
203
|
+
};
|
|
204
|
+
templates: {
|
|
205
|
+
editable: boolean;
|
|
206
|
+
};
|
|
207
|
+
mergeRequests: {
|
|
208
|
+
labels: boolean;
|
|
209
|
+
reviewers: boolean;
|
|
210
|
+
/** Approvals can be given (and counted). */
|
|
211
|
+
approvals: boolean;
|
|
212
|
+
/** A thread of the code can be marked resolved. */
|
|
213
|
+
resolvableThreads: boolean;
|
|
214
|
+
/** A merge can leave one commit. */
|
|
215
|
+
squash: boolean;
|
|
216
|
+
};
|
|
217
|
+
deletion: {
|
|
218
|
+
namespaceIsRepository: boolean;
|
|
219
|
+
delayed: boolean;
|
|
220
|
+
};
|
|
221
|
+
releases: {
|
|
222
|
+
/** A release can be marked as a prerelease (GitLab has no such mark: it ignores it and always says `false`). */
|
|
223
|
+
prerelease: boolean;
|
|
224
|
+
};
|
|
225
|
+
}
|
|
226
|
+
/** A merge request (GitLab) or a pull request (GitHub) as the pages of LINEA show it: more than `ChangeRequest`, which is what the code needs. */
|
|
227
|
+
export interface MergeRequest {
|
|
228
|
+
number: number;
|
|
229
|
+
title: string;
|
|
230
|
+
/** Markdown. */
|
|
231
|
+
description: string;
|
|
232
|
+
state: 'opened' | 'merged' | 'closed';
|
|
233
|
+
author: string | undefined;
|
|
234
|
+
sourceBranch: string;
|
|
235
|
+
targetBranch: string;
|
|
236
|
+
labels: string[];
|
|
237
|
+
reviewers: string[];
|
|
238
|
+
assignees: string[];
|
|
239
|
+
createdAt: string;
|
|
240
|
+
updatedAt: string;
|
|
241
|
+
mergedAt: string | null;
|
|
242
|
+
/** The page of it on the host (empty for a host that has no pages). */
|
|
243
|
+
webUrl: string;
|
|
244
|
+
hasConflicts: boolean;
|
|
245
|
+
/** The commit at the tip of the source branch: the one its checks are for. */
|
|
246
|
+
headSha: string | undefined;
|
|
247
|
+
/** Messages of people in all its threads. */
|
|
248
|
+
commentCount: number;
|
|
249
|
+
/** Who approved it, and how many approvals it asks for (`null`: it does not say). Only on a host that has approvals. */
|
|
250
|
+
approvals?: {
|
|
251
|
+
required: number | null;
|
|
252
|
+
given: string[];
|
|
253
|
+
} | undefined;
|
|
254
|
+
}
|
|
255
|
+
export interface MergeRequestFilter {
|
|
256
|
+
/** Default `opened`. */
|
|
257
|
+
state?: 'opened' | 'merged' | 'closed' | 'all';
|
|
258
|
+
author?: string;
|
|
259
|
+
reviewer?: string;
|
|
260
|
+
labels?: string[];
|
|
261
|
+
search?: string;
|
|
262
|
+
sourceBranch?: string;
|
|
263
|
+
targetBranch?: string;
|
|
264
|
+
page?: number;
|
|
265
|
+
perPage?: number;
|
|
266
|
+
}
|
|
267
|
+
/** One file of the code a merge request proposes. `patch` is the unified diff from the first `@@` on (empty for a file git cannot show, as a binary one). */
|
|
268
|
+
export interface FileDiff {
|
|
269
|
+
oldPath: string;
|
|
270
|
+
newPath: string;
|
|
271
|
+
status: 'added' | 'modified' | 'deleted' | 'renamed';
|
|
272
|
+
additions: number;
|
|
273
|
+
deletions: number;
|
|
274
|
+
patch: string;
|
|
275
|
+
}
|
|
276
|
+
/** A line of the code of a merge request: of the new version of the file, or (`old`) of the one it replaces. */
|
|
277
|
+
export interface DiffPosition {
|
|
278
|
+
path: string;
|
|
279
|
+
line: number;
|
|
280
|
+
side: 'new' | 'old';
|
|
281
|
+
}
|
|
282
|
+
/** A conversation of a merge request: a message of its own, or a line of the code with what was said about it. */
|
|
283
|
+
export interface Thread {
|
|
284
|
+
id: Id;
|
|
285
|
+
/** The host can mark it resolved (GitHub can only through an API LINEA does not use). */
|
|
286
|
+
resolvable: boolean;
|
|
287
|
+
resolved: boolean;
|
|
288
|
+
/** The line it is about; none for a general message. */
|
|
289
|
+
position?: DiffPosition | undefined;
|
|
290
|
+
comments: Comment[];
|
|
291
|
+
}
|
|
292
|
+
export interface MergeOptions {
|
|
293
|
+
/** One commit in the target instead of the history of the branch. */
|
|
294
|
+
squash?: boolean;
|
|
295
|
+
deleteSourceBranch?: boolean;
|
|
296
|
+
/** The message of the commit that is made. */
|
|
297
|
+
message?: string;
|
|
298
|
+
}
|
|
299
|
+
export interface MergeRequestChanges {
|
|
300
|
+
title?: string;
|
|
301
|
+
description?: string;
|
|
302
|
+
labels?: string[];
|
|
303
|
+
reviewers?: string[];
|
|
304
|
+
/** Closing and reopening are `state`. */
|
|
305
|
+
state?: 'opened' | 'closed';
|
|
306
|
+
}
|
|
307
|
+
export interface FileAction {
|
|
308
|
+
action: 'create' | 'update' | 'delete';
|
|
309
|
+
path: string;
|
|
310
|
+
content?: string;
|
|
311
|
+
/** How `content` is written (default text). */
|
|
312
|
+
encoding?: 'text' | 'base64';
|
|
313
|
+
/** Refuse the change when the file moved on from this revision (status 409). */
|
|
314
|
+
expectedRevision?: string;
|
|
315
|
+
}
|
|
316
|
+
export interface Pipeline {
|
|
317
|
+
/** The id the host gives it, for asking about its jobs or running it again. */
|
|
318
|
+
id?: Id;
|
|
319
|
+
/** The commit it ran for. */
|
|
320
|
+
sha?: string;
|
|
321
|
+
/** `success`, `failed`, `running`, `pending`, `canceled`, `skipped`. */
|
|
322
|
+
status: string;
|
|
323
|
+
ref: string;
|
|
324
|
+
createdAt: string;
|
|
325
|
+
webUrl: string;
|
|
326
|
+
}
|
|
327
|
+
/** One step of a pipeline (a job of GitLab, a job of a workflow run of GitHub). */
|
|
328
|
+
export interface PipelineJob {
|
|
329
|
+
id: Id;
|
|
330
|
+
name: string;
|
|
331
|
+
/** The stage it belongs to (GitHub has none: its jobs are all `jobs`). */
|
|
332
|
+
stage: string;
|
|
333
|
+
/** `success`, `failed`, `running`, `pending`, `canceled`, `skipped`. */
|
|
334
|
+
status: string;
|
|
335
|
+
/** Seconds, when it has started. */
|
|
336
|
+
duration: number | null;
|
|
337
|
+
webUrl: string;
|
|
338
|
+
}
|
|
339
|
+
/** A runner of the host's CI, as it shows for a repository. */
|
|
340
|
+
export interface Runner {
|
|
341
|
+
id: Id;
|
|
342
|
+
description: string;
|
|
343
|
+
online: boolean;
|
|
344
|
+
paused: boolean;
|
|
345
|
+
/** A runner shared by the whole instance (not one of the repository). */
|
|
346
|
+
shared: boolean;
|
|
347
|
+
/** Jobs that ask for none of these tags are not run by it, unless it takes untagged jobs. */
|
|
348
|
+
tags: string[];
|
|
349
|
+
runsUntagged: boolean;
|
|
350
|
+
}
|
|
351
|
+
/** What the host's CI offers a repository: whether it has runners to take its jobs. */
|
|
352
|
+
export interface CiRunners {
|
|
353
|
+
/** `false` for a host that runs no pipelines (or whose runners cannot be asked for). */
|
|
354
|
+
supported: boolean;
|
|
355
|
+
/** Whether the runners of the whole instance take this repository's jobs (`null`: not asked, or not a thing of this host). */
|
|
356
|
+
instanceRunners: boolean | null;
|
|
357
|
+
/** `false` when the host would not list them for this token: `runners` being empty then says nothing. */
|
|
358
|
+
listed?: boolean;
|
|
359
|
+
runners: Runner[];
|
|
360
|
+
}
|
|
361
|
+
export interface Tokens {
|
|
362
|
+
accessToken: string;
|
|
363
|
+
refreshToken: string | null;
|
|
364
|
+
}
|
|
365
|
+
export interface AuthConfig {
|
|
366
|
+
kind: GitHostKind;
|
|
367
|
+
clientId: string | undefined;
|
|
368
|
+
redirectUri: string;
|
|
369
|
+
/** The address of the host's website. */
|
|
370
|
+
url: string;
|
|
371
|
+
/** Where a browser is sent to log in; add `client_id`, `redirect_uri`, `response_type=code`, `scope` and `state`. */
|
|
372
|
+
authorizeUrl: string;
|
|
373
|
+
/** What to ask the user to allow. */
|
|
374
|
+
scope: string;
|
|
375
|
+
}
|
|
376
|
+
export type GitHostKind = 'local' | 'gitlab' | 'github';
|
|
377
|
+
export interface Delivery {
|
|
378
|
+
headers: Record<string, string | undefined>;
|
|
379
|
+
rawBody?: Buffer | string;
|
|
380
|
+
secret?: string;
|
|
381
|
+
}
|
|
382
|
+
export interface GitProvider {
|
|
383
|
+
readonly kind: GitHostKind;
|
|
384
|
+
/** Whether a namespace can hold namespaces (GitLab groups do; a GitHub account cannot). */
|
|
385
|
+
readonly nestsNamespaces: boolean;
|
|
386
|
+
readonly webhookPath: string;
|
|
387
|
+
authConfig(): AuthConfig;
|
|
388
|
+
exchangeCode(args: {
|
|
389
|
+
code: string;
|
|
390
|
+
redirectUri: string;
|
|
391
|
+
}): Promise<Tokens>;
|
|
392
|
+
/** Keeps `accessToken` when the host's tokens do not expire. */
|
|
393
|
+
refreshToken(args: {
|
|
394
|
+
refreshToken: string | null;
|
|
395
|
+
accessToken: string;
|
|
396
|
+
}): Promise<Tokens>;
|
|
397
|
+
getUser(args: {
|
|
398
|
+
token: string;
|
|
399
|
+
}): Promise<{
|
|
400
|
+
username: string;
|
|
401
|
+
avatarUrl: string;
|
|
402
|
+
}>;
|
|
403
|
+
/** Where the user may create things. */
|
|
404
|
+
listNamespaces(args: {
|
|
405
|
+
token: string;
|
|
406
|
+
}): Promise<Namespace[]>;
|
|
407
|
+
findNamespace(args: {
|
|
408
|
+
token: string;
|
|
409
|
+
fullPath: string;
|
|
410
|
+
}): Promise<Namespace | null>;
|
|
411
|
+
createNamespace(args: {
|
|
412
|
+
token: string;
|
|
413
|
+
name: string;
|
|
414
|
+
parentId?: Id | undefined;
|
|
415
|
+
}): Promise<Namespace>;
|
|
416
|
+
/** With everything in it. */
|
|
417
|
+
deleteNamespace(args: {
|
|
418
|
+
token: string;
|
|
419
|
+
id: Id;
|
|
420
|
+
}): Promise<unknown>;
|
|
421
|
+
renameNamespace(args: {
|
|
422
|
+
token: string;
|
|
423
|
+
id: Id;
|
|
424
|
+
name: string;
|
|
425
|
+
}): Promise<unknown>;
|
|
426
|
+
createRepository(args: {
|
|
427
|
+
token: string;
|
|
428
|
+
name: string;
|
|
429
|
+
namespaceId?: Id | undefined;
|
|
430
|
+
topics?: string[];
|
|
431
|
+
defaultBranch?: string | undefined;
|
|
432
|
+
}): Promise<Repository>;
|
|
433
|
+
deleteRepository(args: {
|
|
434
|
+
token: string;
|
|
435
|
+
id: Id;
|
|
436
|
+
}): Promise<unknown>;
|
|
437
|
+
/** The repositories with this topic the user reaches that wait to be deleted; a host that deletes at once has none. */
|
|
438
|
+
listPendingDeletion(args: {
|
|
439
|
+
token: string;
|
|
440
|
+
topic: string;
|
|
441
|
+
}): Promise<PendingDeletion[]>;
|
|
442
|
+
restoreRepository(args: {
|
|
443
|
+
token: string;
|
|
444
|
+
id: Id;
|
|
445
|
+
}): Promise<unknown>;
|
|
446
|
+
restoreNamespace(args: {
|
|
447
|
+
token: string;
|
|
448
|
+
id: Id;
|
|
449
|
+
}): Promise<unknown>;
|
|
450
|
+
renameRepository(args: {
|
|
451
|
+
token: string;
|
|
452
|
+
id: Id;
|
|
453
|
+
name: string;
|
|
454
|
+
}): Promise<Repository>;
|
|
455
|
+
getRepository(args: {
|
|
456
|
+
token: string;
|
|
457
|
+
id: Id;
|
|
458
|
+
}): Promise<Repository>;
|
|
459
|
+
/** By its full path; `null` when there is none. */
|
|
460
|
+
findRepository(args: {
|
|
461
|
+
token: string;
|
|
462
|
+
path: string;
|
|
463
|
+
}): Promise<Repository | null>;
|
|
464
|
+
/** The live repositories of the user that have a topic. */
|
|
465
|
+
listRepositories(args: {
|
|
466
|
+
token: string;
|
|
467
|
+
topic: string;
|
|
468
|
+
}): Promise<Repository[]>;
|
|
469
|
+
addTopic(args: {
|
|
470
|
+
token: string;
|
|
471
|
+
id: Id;
|
|
472
|
+
topic: string;
|
|
473
|
+
}): Promise<void>;
|
|
474
|
+
setDefaultBranch(args: {
|
|
475
|
+
token: string;
|
|
476
|
+
id: Id;
|
|
477
|
+
branch: string;
|
|
478
|
+
}): Promise<unknown>;
|
|
479
|
+
getMembers(args: {
|
|
480
|
+
token: string;
|
|
481
|
+
id: Id;
|
|
482
|
+
}): Promise<Member[]>;
|
|
483
|
+
/** The level of the user of `token` on the repository (0: none). */
|
|
484
|
+
getAccessLevel(args: {
|
|
485
|
+
token: string;
|
|
486
|
+
id: Id;
|
|
487
|
+
username: string;
|
|
488
|
+
}): Promise<number>;
|
|
489
|
+
getFile(args: {
|
|
490
|
+
token: string;
|
|
491
|
+
id: Id;
|
|
492
|
+
path: string;
|
|
493
|
+
ref: string;
|
|
494
|
+
}): Promise<RepositoryFile>;
|
|
495
|
+
/** Like `getFile`, never remembered for rollback. */
|
|
496
|
+
getFileRevision(args: {
|
|
497
|
+
token: string;
|
|
498
|
+
id: Id;
|
|
499
|
+
path: string;
|
|
500
|
+
ref: string;
|
|
501
|
+
}): Promise<RepositoryFile>;
|
|
502
|
+
/** The bytes, or `null` when there is no such file. */
|
|
503
|
+
readFile(args: {
|
|
504
|
+
token: string;
|
|
505
|
+
id: Id;
|
|
506
|
+
path: string;
|
|
507
|
+
ref: string;
|
|
508
|
+
}): Promise<Buffer | null>;
|
|
509
|
+
/** Every file of a repository at `ref`. */
|
|
510
|
+
listFiles(args: {
|
|
511
|
+
token: string;
|
|
512
|
+
id: Id;
|
|
513
|
+
ref: string;
|
|
514
|
+
}): Promise<string[]>;
|
|
515
|
+
createFile(args: {
|
|
516
|
+
token: string;
|
|
517
|
+
id: Id;
|
|
518
|
+
path: string;
|
|
519
|
+
branch: string;
|
|
520
|
+
content: string;
|
|
521
|
+
}): Promise<unknown>;
|
|
522
|
+
saveFile(args: {
|
|
523
|
+
token: string;
|
|
524
|
+
id: Id;
|
|
525
|
+
path: string;
|
|
526
|
+
branch: string;
|
|
527
|
+
content: string;
|
|
528
|
+
}): Promise<unknown>;
|
|
529
|
+
commit(args: {
|
|
530
|
+
token: string;
|
|
531
|
+
id: Id;
|
|
532
|
+
branch: string;
|
|
533
|
+
message: string;
|
|
534
|
+
actions: FileAction[];
|
|
535
|
+
track?: boolean;
|
|
536
|
+
}): Promise<{
|
|
537
|
+
id: string;
|
|
538
|
+
}>;
|
|
539
|
+
/** A zip of the repository at `ref`. */
|
|
540
|
+
downloadArchive(args: {
|
|
541
|
+
token: string;
|
|
542
|
+
id: Id;
|
|
543
|
+
ref?: string;
|
|
544
|
+
}): Promise<NodeJS.ReadableStream>;
|
|
545
|
+
getCommits(args: {
|
|
546
|
+
token: string;
|
|
547
|
+
id: Id;
|
|
548
|
+
ref: string;
|
|
549
|
+
perPage?: number;
|
|
550
|
+
}): Promise<CommitSummary[]>;
|
|
551
|
+
/** What `to` has that `from` has not: its commits (newest first) and the files they change, as the host's own comparison shows them. */
|
|
552
|
+
compare(args: {
|
|
553
|
+
token: string;
|
|
554
|
+
id: Id;
|
|
555
|
+
from: string;
|
|
556
|
+
to: string;
|
|
557
|
+
}): Promise<Comparison>;
|
|
558
|
+
createBranch(args: {
|
|
559
|
+
token: string;
|
|
560
|
+
id: Id;
|
|
561
|
+
branch: string;
|
|
562
|
+
ref: string;
|
|
563
|
+
track?: boolean;
|
|
564
|
+
}): Promise<unknown>;
|
|
565
|
+
/** The names of the branches of a repository. */
|
|
566
|
+
listBranches(args: {
|
|
567
|
+
token: string;
|
|
568
|
+
id: Id;
|
|
569
|
+
}): Promise<string[]>;
|
|
570
|
+
getBranch(args: {
|
|
571
|
+
token: string;
|
|
572
|
+
id: Id;
|
|
573
|
+
branch: string;
|
|
574
|
+
}): Promise<{
|
|
575
|
+
name: string;
|
|
576
|
+
lastCommit: CommitSummary | null;
|
|
577
|
+
}>;
|
|
578
|
+
listTags(args: {
|
|
579
|
+
token: string;
|
|
580
|
+
id: Id;
|
|
581
|
+
}): Promise<{
|
|
582
|
+
name: string;
|
|
583
|
+
}[]>;
|
|
584
|
+
/** `message` is the annotation of the tag (null for one that has none): what `createTag` was given. */
|
|
585
|
+
getTag(args: {
|
|
586
|
+
token: string;
|
|
587
|
+
id: Id;
|
|
588
|
+
tag: string;
|
|
589
|
+
}): Promise<{
|
|
590
|
+
name: string;
|
|
591
|
+
commitId: string;
|
|
592
|
+
message: string | null;
|
|
593
|
+
} | null>;
|
|
594
|
+
createTag(args: {
|
|
595
|
+
token: string;
|
|
596
|
+
id: Id;
|
|
597
|
+
tag: string;
|
|
598
|
+
ref: string;
|
|
599
|
+
message?: string;
|
|
600
|
+
}): Promise<unknown>;
|
|
601
|
+
/** `name` defaults to the tag. `prerelease` is ignored by a host whose `capabilities().releases.prerelease` is `false`. */
|
|
602
|
+
createRelease(args: {
|
|
603
|
+
token: string;
|
|
604
|
+
id: Id;
|
|
605
|
+
tag: string;
|
|
606
|
+
name?: string;
|
|
607
|
+
description?: string;
|
|
608
|
+
prerelease?: boolean;
|
|
609
|
+
}): Promise<Release>;
|
|
610
|
+
/** `null` when the tag has no release. */
|
|
611
|
+
getRelease(args: {
|
|
612
|
+
token: string;
|
|
613
|
+
id: Id;
|
|
614
|
+
tag: string;
|
|
615
|
+
}): Promise<Release | null>;
|
|
616
|
+
/** Newest first. */
|
|
617
|
+
listReleases(args: {
|
|
618
|
+
token: string;
|
|
619
|
+
id: Id;
|
|
620
|
+
}): Promise<Release[]>;
|
|
621
|
+
/** Only what is in `changes` is touched (`prerelease` only where the host has it); status 404 when the tag has no release. */
|
|
622
|
+
updateRelease(args: {
|
|
623
|
+
token: string;
|
|
624
|
+
id: Id;
|
|
625
|
+
tag: string;
|
|
626
|
+
changes: ReleaseChanges;
|
|
627
|
+
}): Promise<Release>;
|
|
628
|
+
createChangeRequest(args: {
|
|
629
|
+
token: string;
|
|
630
|
+
id: Id;
|
|
631
|
+
title: string;
|
|
632
|
+
sourceBranch: string;
|
|
633
|
+
targetBranch: string;
|
|
634
|
+
}): Promise<ChangeRequest>;
|
|
635
|
+
createOrRenameChangeRequest(args: {
|
|
636
|
+
token: string;
|
|
637
|
+
id: Id;
|
|
638
|
+
title: string;
|
|
639
|
+
sourceBranch: string;
|
|
640
|
+
targetBranch?: string;
|
|
641
|
+
}): Promise<ChangeRequest>;
|
|
642
|
+
listChangeRequests(args: {
|
|
643
|
+
token: string;
|
|
644
|
+
id: Id;
|
|
645
|
+
state?: 'opened' | 'merged' | 'closed' | 'all';
|
|
646
|
+
targetBranch?: string;
|
|
647
|
+
}): Promise<ChangeRequest[]>;
|
|
648
|
+
/** The pipelines that ran for a change request (its checks), newest first. */
|
|
649
|
+
listChangeRequestPipelines(args: {
|
|
650
|
+
token: string;
|
|
651
|
+
id: Id;
|
|
652
|
+
number: number;
|
|
653
|
+
}): Promise<Pipeline[]>;
|
|
654
|
+
/** Merges it when it can; `true` when it has conflicts (or is not open). */
|
|
655
|
+
mergeChangeRequest(args: {
|
|
656
|
+
token: string;
|
|
657
|
+
id: Id;
|
|
658
|
+
number: number;
|
|
659
|
+
deleteSourceBranch?: boolean;
|
|
660
|
+
}): Promise<boolean>;
|
|
661
|
+
capabilities(): Capabilities;
|
|
662
|
+
listIssues(args: {
|
|
663
|
+
token: string;
|
|
664
|
+
id: Id;
|
|
665
|
+
filter?: IssueFilter;
|
|
666
|
+
}): Promise<Page<Issue>>;
|
|
667
|
+
getIssue(args: {
|
|
668
|
+
token: string;
|
|
669
|
+
id: Id;
|
|
670
|
+
number: number;
|
|
671
|
+
}): Promise<Issue>;
|
|
672
|
+
createIssue(args: {
|
|
673
|
+
token: string;
|
|
674
|
+
id: Id;
|
|
675
|
+
title: string;
|
|
676
|
+
description?: string;
|
|
677
|
+
labels?: string[];
|
|
678
|
+
assignees?: string[];
|
|
679
|
+
milestone?: string | null;
|
|
680
|
+
}): Promise<Issue>;
|
|
681
|
+
/** Only what is in `changes` is touched. Closing and reopening are `state`. */
|
|
682
|
+
updateIssue(args: {
|
|
683
|
+
token: string;
|
|
684
|
+
id: Id;
|
|
685
|
+
number: number;
|
|
686
|
+
changes: IssueChanges;
|
|
687
|
+
}): Promise<Issue>;
|
|
688
|
+
/** The messages the people wrote, oldest first (what the host writes by itself, "changed the label", is left out). */
|
|
689
|
+
listIssueComments(args: {
|
|
690
|
+
token: string;
|
|
691
|
+
id: Id;
|
|
692
|
+
number: number;
|
|
693
|
+
}): Promise<Comment[]>;
|
|
694
|
+
addIssueComment(args: {
|
|
695
|
+
token: string;
|
|
696
|
+
id: Id;
|
|
697
|
+
number: number;
|
|
698
|
+
body: string;
|
|
699
|
+
}): Promise<Comment>;
|
|
700
|
+
listLabels(args: {
|
|
701
|
+
token: string;
|
|
702
|
+
id: Id;
|
|
703
|
+
}): Promise<Label[]>;
|
|
704
|
+
listMilestones(args: {
|
|
705
|
+
token: string;
|
|
706
|
+
id: Id;
|
|
707
|
+
}): Promise<Milestone[]>;
|
|
708
|
+
listTemplates(args: {
|
|
709
|
+
token: string;
|
|
710
|
+
id: Id;
|
|
711
|
+
kind: TemplateKind;
|
|
712
|
+
}): Promise<Template[]>;
|
|
713
|
+
saveTemplate(args: {
|
|
714
|
+
token: string;
|
|
715
|
+
id: Id;
|
|
716
|
+
kind: TemplateKind;
|
|
717
|
+
name: string;
|
|
718
|
+
content: string;
|
|
719
|
+
}): Promise<Template>;
|
|
720
|
+
deleteTemplate(args: {
|
|
721
|
+
token: string;
|
|
722
|
+
id: Id;
|
|
723
|
+
kind: TemplateKind;
|
|
724
|
+
name: string;
|
|
725
|
+
}): Promise<void>;
|
|
726
|
+
listMergeRequests(args: {
|
|
727
|
+
token: string;
|
|
728
|
+
id: Id;
|
|
729
|
+
filter?: MergeRequestFilter;
|
|
730
|
+
}): Promise<Page<MergeRequest>>;
|
|
731
|
+
getMergeRequest(args: {
|
|
732
|
+
token: string;
|
|
733
|
+
id: Id;
|
|
734
|
+
number: number;
|
|
735
|
+
}): Promise<MergeRequest>;
|
|
736
|
+
createMergeRequest(args: {
|
|
737
|
+
token: string;
|
|
738
|
+
id: Id;
|
|
739
|
+
title: string;
|
|
740
|
+
description?: string;
|
|
741
|
+
sourceBranch: string;
|
|
742
|
+
targetBranch: string;
|
|
743
|
+
labels?: string[];
|
|
744
|
+
reviewers?: string[];
|
|
745
|
+
}): Promise<MergeRequest>;
|
|
746
|
+
/** Only what is in `changes` is touched. */
|
|
747
|
+
updateMergeRequest(args: {
|
|
748
|
+
token: string;
|
|
749
|
+
id: Id;
|
|
750
|
+
number: number;
|
|
751
|
+
changes: MergeRequestChanges;
|
|
752
|
+
}): Promise<MergeRequest>;
|
|
753
|
+
/** The files it changes, as the target would see them after the merge. */
|
|
754
|
+
getMergeRequestDiff(args: {
|
|
755
|
+
token: string;
|
|
756
|
+
id: Id;
|
|
757
|
+
number: number;
|
|
758
|
+
}): Promise<FileDiff[]>;
|
|
759
|
+
/** Every conversation, oldest first: the general messages and the ones about lines of the code. */
|
|
760
|
+
listMergeRequestThreads(args: {
|
|
761
|
+
token: string;
|
|
762
|
+
id: Id;
|
|
763
|
+
number: number;
|
|
764
|
+
}): Promise<Thread[]>;
|
|
765
|
+
/** A general message, one about a line (`position`), or an answer in a thread (`threadId`). Answers with the thread it is in. */
|
|
766
|
+
addMergeRequestComment(args: {
|
|
767
|
+
token: string;
|
|
768
|
+
id: Id;
|
|
769
|
+
number: number;
|
|
770
|
+
body: string;
|
|
771
|
+
position?: DiffPosition;
|
|
772
|
+
threadId?: Id;
|
|
773
|
+
}): Promise<Thread>;
|
|
774
|
+
setThreadResolved(args: {
|
|
775
|
+
token: string;
|
|
776
|
+
id: Id;
|
|
777
|
+
number: number;
|
|
778
|
+
threadId: Id;
|
|
779
|
+
resolved: boolean;
|
|
780
|
+
}): Promise<Thread>;
|
|
781
|
+
/** Merges it; `true` when it has conflicts (or is not open), as `mergeChangeRequest`. */
|
|
782
|
+
mergeMergeRequest(args: {
|
|
783
|
+
token: string;
|
|
784
|
+
id: Id;
|
|
785
|
+
number: number;
|
|
786
|
+
options?: MergeOptions;
|
|
787
|
+
}): Promise<boolean>;
|
|
788
|
+
/** Gives the approval of the user of `token` (a host with no approvals refuses with status 400). */
|
|
789
|
+
approveMergeRequest(args: {
|
|
790
|
+
token: string;
|
|
791
|
+
id: Id;
|
|
792
|
+
number: number;
|
|
793
|
+
}): Promise<void>;
|
|
794
|
+
getLatestPipeline(args: {
|
|
795
|
+
token: string;
|
|
796
|
+
id: Id;
|
|
797
|
+
ref: string;
|
|
798
|
+
}): Promise<Pipeline | null>;
|
|
799
|
+
/** The last pipelines of a branch (or of the repository, without `ref`), newest first. */
|
|
800
|
+
listPipelines(args: {
|
|
801
|
+
token: string;
|
|
802
|
+
id: Id;
|
|
803
|
+
ref?: string;
|
|
804
|
+
perPage?: number;
|
|
805
|
+
}): Promise<Pipeline[]>;
|
|
806
|
+
/** The jobs of a pipeline, in the order they run. */
|
|
807
|
+
getPipelineJobs(args: {
|
|
808
|
+
token: string;
|
|
809
|
+
id: Id;
|
|
810
|
+
pipelineId: Id;
|
|
811
|
+
}): Promise<PipelineJob[]>;
|
|
812
|
+
/** Runs the failed jobs of a pipeline again. */
|
|
813
|
+
retryPipeline(args: {
|
|
814
|
+
token: string;
|
|
815
|
+
id: Id;
|
|
816
|
+
pipelineId: Id;
|
|
817
|
+
}): Promise<void>;
|
|
818
|
+
/** Stops a pipeline that has not finished: its running and waiting jobs are canceled. */
|
|
819
|
+
cancelPipeline(args: {
|
|
820
|
+
token: string;
|
|
821
|
+
id: Id;
|
|
822
|
+
pipelineId: Id;
|
|
823
|
+
}): Promise<void>;
|
|
824
|
+
/** Makes sure a repository can run pipelines (a project made with CI/CD switched off gets it switched on). Answers whether it changed anything. */
|
|
825
|
+
enablePipelines(args: {
|
|
826
|
+
token: string;
|
|
827
|
+
id: Id;
|
|
828
|
+
}): Promise<boolean>;
|
|
829
|
+
/** Turns CI/CD off for a repository; `true` when it had to be changed. A host where that is not the repository's to choose does nothing. */
|
|
830
|
+
disablePipelines(args: {
|
|
831
|
+
token: string;
|
|
832
|
+
id: Id;
|
|
833
|
+
}): Promise<boolean>;
|
|
834
|
+
/** Whether CI/CD is on for a repository; `null` when the host does not say, or it is not a thing of this host. */
|
|
835
|
+
pipelinesEnabled(args: {
|
|
836
|
+
token: string;
|
|
837
|
+
id: Id;
|
|
838
|
+
}): Promise<boolean | null>;
|
|
839
|
+
/** Stops one job that has not finished (hosts that cannot cancel a single job say so). */
|
|
840
|
+
cancelJob(args: {
|
|
841
|
+
token: string;
|
|
842
|
+
id: Id;
|
|
843
|
+
jobId: Id;
|
|
844
|
+
}): Promise<void>;
|
|
845
|
+
/** The runners that can take the jobs of a repository, and whether the instance's own are turned on for it. */
|
|
846
|
+
getCiRunners(args: {
|
|
847
|
+
token: string;
|
|
848
|
+
id: Id;
|
|
849
|
+
}): Promise<CiRunners>;
|
|
850
|
+
/** Turns on (or off) the runners of the whole instance for a repository. */
|
|
851
|
+
setInstanceRunners(args: {
|
|
852
|
+
token: string;
|
|
853
|
+
id: Id;
|
|
854
|
+
enabled: boolean;
|
|
855
|
+
}): Promise<void>;
|
|
856
|
+
/** The end of what a job printed (the last `lines`). */
|
|
857
|
+
getJobTrace(args: {
|
|
858
|
+
token: string;
|
|
859
|
+
id: Id;
|
|
860
|
+
jobId: Id;
|
|
861
|
+
lines?: number;
|
|
862
|
+
}): Promise<string>;
|
|
863
|
+
ensureWebhook(args: {
|
|
864
|
+
token: string;
|
|
865
|
+
id: Id;
|
|
866
|
+
url: string;
|
|
867
|
+
secret: string;
|
|
868
|
+
branch?: string;
|
|
869
|
+
}): Promise<{
|
|
870
|
+
status: 'created' | 'already_exists';
|
|
871
|
+
hookId?: Id | null;
|
|
872
|
+
}>;
|
|
873
|
+
verifyWebhook(args: Required<Delivery>): boolean;
|
|
874
|
+
parsePushEvent(args: {
|
|
875
|
+
headers: Record<string, string | undefined>;
|
|
876
|
+
body: any;
|
|
877
|
+
}): {
|
|
878
|
+
repositoryId: Id;
|
|
879
|
+
branch: string;
|
|
880
|
+
} | null;
|
|
881
|
+
rollback(): Promise<void>;
|
|
882
|
+
/** The token is expired or revoked. */
|
|
883
|
+
isAuthError(error: unknown): boolean;
|
|
884
|
+
/** A branch (or other ref) that exists already. */
|
|
885
|
+
isAlreadyExistsError(error: unknown): boolean;
|
|
886
|
+
}
|
|
887
|
+
/** The methods a provider has to have: what the contract test checks and what a new host has to fill in. */
|
|
888
|
+
export declare const GIT_PROVIDER_METHODS: readonly ["authConfig", "exchangeCode", "refreshToken", "getUser", "listNamespaces", "findNamespace", "createNamespace", "deleteNamespace", "renameNamespace", "createRepository", "deleteRepository", "listPendingDeletion", "restoreRepository", "restoreNamespace", "renameRepository", "getRepository", "findRepository", "listRepositories", "addTopic", "setDefaultBranch", "getMembers", "getAccessLevel", "getFile", "getFileRevision", "readFile", "listFiles", "createFile", "saveFile", "commit", "downloadArchive", "getCommits", "compare", "createBranch", "listBranches", "getBranch", "listTags", "getTag", "createTag", "createRelease", "getRelease", "listReleases", "updateRelease", "createChangeRequest", "createOrRenameChangeRequest", "listChangeRequests", "listChangeRequestPipelines", "mergeChangeRequest", "getLatestPipeline", "listPipelines", "getPipelineJobs", "retryPipeline", "cancelPipeline", "cancelJob", "enablePipelines", "disablePipelines", "pipelinesEnabled", "getCiRunners", "setInstanceRunners", "getJobTrace", "ensureWebhook", "verifyWebhook", "parsePushEvent", "listMergeRequests", "getMergeRequest", "createMergeRequest", "updateMergeRequest", "getMergeRequestDiff", "listMergeRequestThreads", "addMergeRequestComment", "setThreadResolved", "mergeMergeRequest", "approveMergeRequest", "capabilities", "listIssues", "getIssue", "createIssue", "updateIssue", "listIssueComments", "addIssueComment", "listLabels", "listMilestones", "listTemplates", "saveTemplate", "deleteTemplate", "rollback", "isAuthError", "isAlreadyExistsError"];
|