@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.
Files changed (152) hide show
  1. package/README.md +47 -2
  2. package/dist/access.d.ts +18 -0
  3. package/dist/access.js +18 -0
  4. package/dist/access.js.map +1 -0
  5. package/dist/auth.d.ts +11 -0
  6. package/dist/auth.js +16 -0
  7. package/dist/auth.js.map +1 -0
  8. package/dist/changelog/generate.d.ts +18 -0
  9. package/dist/changelog/generate.js +166 -0
  10. package/dist/changelog/generate.js.map +1 -0
  11. package/dist/changelog/index.d.ts +5 -0
  12. package/dist/changelog/index.js +3 -0
  13. package/dist/changelog/index.js.map +1 -0
  14. package/dist/changelog/parse.d.ts +43 -0
  15. package/dist/changelog/parse.js +91 -0
  16. package/dist/changelog/parse.js.map +1 -0
  17. package/dist/changelog/types.d.ts +85 -0
  18. package/dist/changelog/types.js +2 -0
  19. package/dist/changelog/types.js.map +1 -0
  20. package/dist/checkout/credential.d.ts +14 -0
  21. package/dist/checkout/credential.js +29 -0
  22. package/dist/checkout/credential.js.map +1 -0
  23. package/dist/checkout/git.d.ts +78 -0
  24. package/dist/checkout/git.js +191 -0
  25. package/dist/checkout/git.js.map +1 -0
  26. package/dist/checkout/index.d.ts +3 -0
  27. package/dist/checkout/index.js +4 -0
  28. package/dist/checkout/index.js.map +1 -0
  29. package/dist/checkout/sync.d.ts +156 -0
  30. package/dist/checkout/sync.js +211 -0
  31. package/dist/checkout/sync.js.map +1 -0
  32. package/dist/closing.d.ts +1 -0
  33. package/dist/closing.js +14 -0
  34. package/dist/closing.js.map +1 -0
  35. package/dist/config.d.ts +53 -0
  36. package/dist/config.js +40 -0
  37. package/dist/config.js.map +1 -0
  38. package/dist/deletion.d.ts +19 -0
  39. package/dist/deletion.js +27 -0
  40. package/dist/deletion.js.map +1 -0
  41. package/dist/errors.d.ts +26 -0
  42. package/dist/errors.js +47 -0
  43. package/dist/errors.js.map +1 -0
  44. package/dist/factory.d.ts +20 -0
  45. package/dist/factory.js +46 -0
  46. package/dist/factory.js.map +1 -0
  47. package/dist/github/client.d.ts +44 -0
  48. package/dist/github/client.js +145 -0
  49. package/dist/github/client.js.map +1 -0
  50. package/dist/github/config.d.ts +24 -0
  51. package/dist/github/config.js +11 -0
  52. package/dist/github/config.js.map +1 -0
  53. package/dist/github/provider.d.ts +510 -0
  54. package/dist/github/provider.js +1009 -0
  55. package/dist/github/provider.js.map +1 -0
  56. package/dist/gitlab/client.d.ts +50 -0
  57. package/dist/gitlab/client.js +228 -0
  58. package/dist/gitlab/client.js.map +1 -0
  59. package/dist/gitlab/provider.d.ts +487 -0
  60. package/dist/gitlab/provider.js +719 -0
  61. package/dist/gitlab/provider.js.map +1 -0
  62. package/dist/host.d.ts +27 -0
  63. package/dist/host.js +45 -0
  64. package/dist/host.js.map +1 -0
  65. package/dist/index.d.ts +46 -0
  66. package/dist/index.js +31 -0
  67. package/dist/index.js.map +1 -0
  68. package/dist/local/diff.d.ts +3 -0
  69. package/dist/local/diff.js +43 -0
  70. package/dist/local/diff.js.map +1 -0
  71. package/dist/local/git.d.ts +24 -0
  72. package/dist/local/git.js +51 -0
  73. package/dist/local/git.js.map +1 -0
  74. package/dist/local/health.d.ts +36 -0
  75. package/dist/local/health.js +57 -0
  76. package/dist/local/health.js.map +1 -0
  77. package/dist/local/hooks.d.ts +2 -0
  78. package/dist/local/hooks.js +44 -0
  79. package/dist/local/hooks.js.map +1 -0
  80. package/dist/local/http.d.ts +35 -0
  81. package/dist/local/http.js +160 -0
  82. package/dist/local/http.js.map +1 -0
  83. package/dist/local/provider.d.ts +571 -0
  84. package/dist/local/provider.js +1237 -0
  85. package/dist/local/provider.js.map +1 -0
  86. package/dist/local/store.d.ts +136 -0
  87. package/dist/local/store.js +171 -0
  88. package/dist/local/store.js.map +1 -0
  89. package/dist/packages/github-source.d.ts +69 -0
  90. package/dist/packages/github-source.js +133 -0
  91. package/dist/packages/github-source.js.map +1 -0
  92. package/dist/packages/gitlab-source.d.ts +59 -0
  93. package/dist/packages/gitlab-source.js +214 -0
  94. package/dist/packages/gitlab-source.js.map +1 -0
  95. package/dist/packages/index.d.ts +30 -0
  96. package/dist/packages/index.js +45 -0
  97. package/dist/packages/index.js.map +1 -0
  98. package/dist/packages/provider-source.d.ts +34 -0
  99. package/dist/packages/provider-source.js +57 -0
  100. package/dist/packages/provider-source.js.map +1 -0
  101. package/dist/packages/repository-files.d.ts +12 -0
  102. package/dist/packages/repository-files.js +16 -0
  103. package/dist/packages/repository-files.js.map +1 -0
  104. package/dist/provider.d.ts +888 -0
  105. package/dist/provider.js +29 -0
  106. package/dist/provider.js.map +1 -0
  107. package/dist/read-cache.d.ts +5 -0
  108. package/dist/read-cache.js +101 -0
  109. package/dist/read-cache.js.map +1 -0
  110. package/dist/registry/catalog.d.ts +55 -0
  111. package/dist/registry/catalog.js +143 -0
  112. package/dist/registry/catalog.js.map +1 -0
  113. package/dist/registry/kinds.d.ts +21 -0
  114. package/dist/registry/kinds.js +43 -0
  115. package/dist/registry/kinds.js.map +1 -0
  116. package/dist/registry/packages.d.ts +165 -0
  117. package/dist/registry/packages.js +290 -0
  118. package/dist/registry/packages.js.map +1 -0
  119. package/dist/registry/publish.d.ts +35 -0
  120. package/dist/registry/publish.js +155 -0
  121. package/dist/registry/publish.js.map +1 -0
  122. package/dist/registry/release.d.ts +63 -0
  123. package/dist/registry/release.js +79 -0
  124. package/dist/registry/release.js.map +1 -0
  125. package/dist/restoration.d.ts +14 -0
  126. package/dist/restoration.js +33 -0
  127. package/dist/restoration.js.map +1 -0
  128. package/dist/templates.d.ts +8 -0
  129. package/dist/templates.js +39 -0
  130. package/dist/templates.js.map +1 -0
  131. package/dist/testing/contract.d.ts +43 -0
  132. package/dist/testing/contract.js +713 -0
  133. package/dist/testing/contract.js.map +1 -0
  134. package/dist/testing/diff.d.ts +1 -0
  135. package/dist/testing/diff.js +65 -0
  136. package/dist/testing/diff.js.map +1 -0
  137. package/dist/testing/git-http.d.ts +12 -0
  138. package/dist/testing/git-http.js +308 -0
  139. package/dist/testing/git-http.js.map +1 -0
  140. package/dist/testing/github-double.d.ts +151 -0
  141. package/dist/testing/github-double.js +1129 -0
  142. package/dist/testing/github-double.js.map +1 -0
  143. package/dist/testing/gitlab-double.d.ts +161 -0
  144. package/dist/testing/gitlab-double.js +1554 -0
  145. package/dist/testing/gitlab-double.js.map +1 -0
  146. package/dist/testing/index.d.ts +7 -0
  147. package/dist/testing/index.js +8 -0
  148. package/dist/testing/index.js.map +1 -0
  149. package/dist/version.d.ts +2 -0
  150. package/dist/version.js +12 -0
  151. package/dist/version.js.map +1 -0
  152. package/package.json +66 -4
@@ -0,0 +1,510 @@
1
+ import type { AuthConfig, Capabilities, ChangeRequest, CiRunners, Comment, CommitSummary, Comparison, Delivery, DiffPosition, FileAction, FileDiff, GitProvider, Id, Issue, IssueChanges, IssueFilter, Label, Member, MergeOptions, MergeRequest, MergeRequestChanges, MergeRequestFilter, Milestone, Namespace, Page, Pipeline, PipelineJob, Release, ReleaseChanges, Repository, RepositoryFile, Template, TemplateKind, Thread, Tokens, PendingDeletion } from '../provider.js';
2
+ import { GitHubClient } from './client.js';
3
+ import { type GitHubConfig } from './config.js';
4
+ export interface GitHubProviderOptions {
5
+ config?: GitHubConfig;
6
+ client?: GitHubClient;
7
+ /** How long to wait between looks at a pull request GitHub has not finished working out. */
8
+ pollMs?: number;
9
+ pollAttempts?: number;
10
+ }
11
+ export declare class GitHubProvider implements GitProvider {
12
+ readonly kind: "github";
13
+ readonly nestsNamespaces = false;
14
+ readonly webhookPath = "/api/webhooks/github";
15
+ private readonly config;
16
+ private readonly client;
17
+ private readonly undo;
18
+ private readonly pollMs;
19
+ private readonly pollAttempts;
20
+ constructor({ config, client, pollMs, pollAttempts }?: GitHubProviderOptions);
21
+ private json;
22
+ /** What can be undone is remembered, newest first. */
23
+ private remember;
24
+ private repoJson;
25
+ private parentIdOf;
26
+ /** The name LINEA knows a repository by: a product's repository is `<line>-<product>` on GitHub. */
27
+ private logicalName;
28
+ private toRepository;
29
+ /** Names of the lines the given repositories belong to, from the repositories themselves when they are among them. */
30
+ private withParents;
31
+ private login;
32
+ /** Where a repository is to be made: the account that owns it and the name of its namespace, and the line it is in, if any. */
33
+ private placeOf;
34
+ authConfig(): AuthConfig;
35
+ private tokenRequest;
36
+ exchangeCode({ code, redirectUri }: {
37
+ code: string;
38
+ redirectUri: string;
39
+ }): Promise<Tokens>;
40
+ /** An OAuth App's tokens do not expire and have no refresh token: the one the user has is kept. A GitHub App's are renewed. */
41
+ refreshToken({ refreshToken, accessToken }: {
42
+ refreshToken: string | null;
43
+ accessToken: string;
44
+ }): Promise<Tokens>;
45
+ getUser({ token }: {
46
+ token: string;
47
+ }): Promise<{
48
+ username: string;
49
+ avatarUrl: string;
50
+ }>;
51
+ listNamespaces({ token }: {
52
+ token: string;
53
+ }): Promise<Namespace[]>;
54
+ findNamespace({ token, fullPath }: {
55
+ token: string;
56
+ fullPath: string;
57
+ }): Promise<Namespace | null>;
58
+ createNamespace({ token, name, parentId }: {
59
+ token: string;
60
+ name: string;
61
+ parentId?: Id | undefined;
62
+ }): Promise<Namespace>;
63
+ /** The repository of a namespace is deleted with the repositories that are in it (a line takes its products with it). */
64
+ deleteNamespace({ token, id }: {
65
+ token: string;
66
+ id: Id;
67
+ }): Promise<unknown>;
68
+ renameNamespace({ token, id, name }: {
69
+ token: string;
70
+ id: Id;
71
+ name: string;
72
+ }): Promise<unknown>;
73
+ createRepository({ token, name, namespaceId, topics, defaultBranch }: {
74
+ token: string;
75
+ name: string;
76
+ namespaceId?: Id | undefined;
77
+ topics?: string[];
78
+ defaultBranch?: string | undefined;
79
+ }): Promise<Repository>;
80
+ deleteRepository({ token, id }: {
81
+ token: string;
82
+ id: Id;
83
+ }): Promise<unknown>;
84
+ listPendingDeletion(): Promise<PendingDeletion[]>;
85
+ restoreRepository(): Promise<unknown>;
86
+ restoreNamespace(): Promise<unknown>;
87
+ renameRepository({ token, id, name }: {
88
+ token: string;
89
+ id: Id;
90
+ name: string;
91
+ }): Promise<Repository>;
92
+ getRepository({ token, id }: {
93
+ token: string;
94
+ id: Id;
95
+ }): Promise<Repository>;
96
+ findRepository({ token, path }: {
97
+ token: string;
98
+ path: string;
99
+ }): Promise<Repository | null>;
100
+ listRepositories({ token, topic }: {
101
+ token: string;
102
+ topic: string;
103
+ }): Promise<Repository[]>;
104
+ addTopic({ token, id, topic }: {
105
+ token: string;
106
+ id: Id;
107
+ topic: string;
108
+ }): Promise<void>;
109
+ setDefaultBranch({ token, id, branch }: {
110
+ token: string;
111
+ id: Id;
112
+ branch: string;
113
+ }): Promise<unknown>;
114
+ getMembers({ token, id }: {
115
+ token: string;
116
+ id: Id;
117
+ }): Promise<Member[]>;
118
+ /** What the user of `token` may do on a repository (GitHub answers for the token's own user, whoever `username` is). */
119
+ getAccessLevel({ token, id }: {
120
+ token: string;
121
+ id: Id;
122
+ username: string;
123
+ }): Promise<number>;
124
+ private toFile;
125
+ getFileRevision({ token, id, path, ref }: {
126
+ token: string;
127
+ id: Id;
128
+ path: string;
129
+ ref: string;
130
+ }): Promise<RepositoryFile>;
131
+ getFile(args: {
132
+ token: string;
133
+ id: Id;
134
+ path: string;
135
+ ref: string;
136
+ }): Promise<RepositoryFile>;
137
+ readFile({ token, id, path, ref }: {
138
+ token: string;
139
+ id: Id;
140
+ path: string;
141
+ ref: string;
142
+ }): Promise<Buffer | null>;
143
+ listFiles({ token, id, ref }: {
144
+ token: string;
145
+ id: Id;
146
+ ref: string;
147
+ }): Promise<string[]>;
148
+ createFile({ token, id, path, branch, content }: {
149
+ token: string;
150
+ id: Id;
151
+ path: string;
152
+ branch: string;
153
+ content: string;
154
+ }): Promise<unknown>;
155
+ saveFile({ token, id, path, branch, content }: {
156
+ token: string;
157
+ id: Id;
158
+ path: string;
159
+ branch: string;
160
+ content: string;
161
+ }): Promise<unknown>;
162
+ /**
163
+ * One commit with all the changes, made with the git data API (blobs, a tree, a commit, then the branch is moved). A change made from
164
+ * a revision that is no longer the file's, or a branch that moved while this was being built, fails with status 409.
165
+ */
166
+ commit({ token, id, branch, message, actions, track }: {
167
+ token: string;
168
+ id: Id;
169
+ branch: string;
170
+ message: string;
171
+ actions: FileAction[];
172
+ track?: boolean;
173
+ }): Promise<{
174
+ id: string;
175
+ }>;
176
+ downloadArchive({ token, id, ref }: {
177
+ token: string;
178
+ id: Id;
179
+ ref?: string;
180
+ }): Promise<NodeJS.ReadableStream>;
181
+ compare({ token, id, from, to }: {
182
+ token: string;
183
+ id: Id;
184
+ from: string;
185
+ to: string;
186
+ }): Promise<Comparison>;
187
+ getCommits({ token, id, ref, perPage }: {
188
+ token: string;
189
+ id: Id;
190
+ ref: string;
191
+ perPage?: number;
192
+ }): Promise<CommitSummary[]>;
193
+ createBranch({ token, id, branch, ref, track }: {
194
+ token: string;
195
+ id: Id;
196
+ branch: string;
197
+ ref: string;
198
+ track?: boolean;
199
+ }): Promise<unknown>;
200
+ listBranches({ token, id }: {
201
+ token: string;
202
+ id: Id;
203
+ }): Promise<string[]>;
204
+ getBranch({ token, id, branch }: {
205
+ token: string;
206
+ id: Id;
207
+ branch: string;
208
+ }): Promise<{
209
+ name: string;
210
+ lastCommit: CommitSummary | null;
211
+ }>;
212
+ listTags({ token, id }: {
213
+ token: string;
214
+ id: Id;
215
+ }): Promise<{
216
+ name: string;
217
+ }[]>;
218
+ getTag({ token, id, tag }: {
219
+ token: string;
220
+ id: Id;
221
+ tag: string;
222
+ }): Promise<{
223
+ name: string;
224
+ commitId: string;
225
+ message: string | null;
226
+ } | null>;
227
+ createTag({ token, id, tag, ref, message }: {
228
+ token: string;
229
+ id: Id;
230
+ tag: string;
231
+ ref: string;
232
+ message?: string;
233
+ }): Promise<unknown>;
234
+ private toRelease;
235
+ private releaseJson;
236
+ createRelease({ token, id, tag, name, description, prerelease }: {
237
+ token: string;
238
+ id: Id;
239
+ tag: string;
240
+ name?: string;
241
+ description?: string;
242
+ prerelease?: boolean;
243
+ }): Promise<Release>;
244
+ getRelease({ token, id, tag }: {
245
+ token: string;
246
+ id: Id;
247
+ tag: string;
248
+ }): Promise<Release | null>;
249
+ listReleases({ token, id }: {
250
+ token: string;
251
+ id: Id;
252
+ }): Promise<Release[]>;
253
+ updateRelease({ token, id, tag, changes }: {
254
+ token: string;
255
+ id: Id;
256
+ tag: string;
257
+ changes: ReleaseChanges;
258
+ }): Promise<Release>;
259
+ private toChangeRequest;
260
+ capabilities(): Capabilities;
261
+ private toIssue;
262
+ /** GitHub names a milestone by its number, LINEA by its title. */
263
+ private milestoneNumber;
264
+ listIssues({ token, id, filter }: {
265
+ token: string;
266
+ id: Id;
267
+ filter?: IssueFilter;
268
+ }): Promise<Page<Issue>>;
269
+ getIssue({ token, id, number }: {
270
+ token: string;
271
+ id: Id;
272
+ number: number;
273
+ }): Promise<Issue>;
274
+ createIssue({ token, id, title, description, labels, assignees, milestone }: {
275
+ token: string;
276
+ id: Id;
277
+ title: string;
278
+ description?: string;
279
+ labels?: string[];
280
+ assignees?: string[];
281
+ milestone?: string | null;
282
+ }): Promise<Issue>;
283
+ private requireMilestone;
284
+ updateIssue({ token, id, number, changes }: {
285
+ token: string;
286
+ id: Id;
287
+ number: number;
288
+ changes: IssueChanges;
289
+ }): Promise<Issue>;
290
+ private toComment;
291
+ listIssueComments({ token, id, number }: {
292
+ token: string;
293
+ id: Id;
294
+ number: number;
295
+ }): Promise<Comment[]>;
296
+ addIssueComment({ token, id, number, body }: {
297
+ token: string;
298
+ id: Id;
299
+ number: number;
300
+ body: string;
301
+ }): Promise<Comment>;
302
+ listLabels({ token, id }: {
303
+ token: string;
304
+ id: Id;
305
+ }): Promise<Label[]>;
306
+ listTemplates({ token, id, kind }: {
307
+ token: string;
308
+ id: Id;
309
+ kind: TemplateKind;
310
+ }): Promise<Template[]>;
311
+ saveTemplate(_args: {
312
+ token: string;
313
+ id: Id;
314
+ kind: TemplateKind;
315
+ name: string;
316
+ content: string;
317
+ }): Promise<Template>;
318
+ deleteTemplate(_args: {
319
+ token: string;
320
+ id: Id;
321
+ kind: TemplateKind;
322
+ name: string;
323
+ }): Promise<void>;
324
+ listMilestones({ token, id }: {
325
+ token: string;
326
+ id: Id;
327
+ }): Promise<Milestone[]>;
328
+ private toMergeRequest;
329
+ listMergeRequests({ token, id, filter }: {
330
+ token: string;
331
+ id: Id;
332
+ filter?: MergeRequestFilter;
333
+ }): Promise<Page<MergeRequest>>;
334
+ getMergeRequest({ token, id, number }: {
335
+ token: string;
336
+ id: Id;
337
+ number: number;
338
+ }): Promise<MergeRequest>;
339
+ createMergeRequest({ token, id, title, description, sourceBranch, targetBranch, labels, reviewers }: {
340
+ token: string;
341
+ id: Id;
342
+ title: string;
343
+ description?: string;
344
+ sourceBranch: string;
345
+ targetBranch: string;
346
+ labels?: string[];
347
+ reviewers?: string[];
348
+ }): Promise<MergeRequest>;
349
+ updateMergeRequest({ token, id, number, changes }: {
350
+ token: string;
351
+ id: Id;
352
+ number: number;
353
+ changes: MergeRequestChanges;
354
+ }): Promise<MergeRequest>;
355
+ getMergeRequestDiff({ token, id, number }: {
356
+ token: string;
357
+ id: Id;
358
+ number: number;
359
+ }): Promise<FileDiff[]>;
360
+ /** A thread of the code is the first comment of a conversation and its answers; a general message is a thread of its own. */
361
+ private reviewThreads;
362
+ listMergeRequestThreads({ token, id, number }: {
363
+ token: string;
364
+ id: Id;
365
+ number: number;
366
+ }): Promise<Thread[]>;
367
+ addMergeRequestComment({ token, id, number, body, position, threadId }: {
368
+ token: string;
369
+ id: Id;
370
+ number: number;
371
+ body: string;
372
+ position?: DiffPosition;
373
+ threadId?: Id;
374
+ }): Promise<Thread>;
375
+ setThreadResolved(_args: {
376
+ token: string;
377
+ id: Id;
378
+ number: number;
379
+ threadId: Id;
380
+ resolved: boolean;
381
+ }): Promise<Thread>;
382
+ mergeMergeRequest({ token, id, number, options }: {
383
+ token: string;
384
+ id: Id;
385
+ number: number;
386
+ options?: MergeOptions;
387
+ }): Promise<boolean>;
388
+ approveMergeRequest({ token, id, number }: {
389
+ token: string;
390
+ id: Id;
391
+ number: number;
392
+ }): Promise<void>;
393
+ createChangeRequest({ token, id, title, sourceBranch, targetBranch }: {
394
+ token: string;
395
+ id: Id;
396
+ title: string;
397
+ sourceBranch: string;
398
+ targetBranch: string;
399
+ }): Promise<ChangeRequest>;
400
+ createOrRenameChangeRequest({ token, id, title, sourceBranch, targetBranch }: {
401
+ token: string;
402
+ id: Id;
403
+ title: string;
404
+ sourceBranch: string;
405
+ targetBranch?: string;
406
+ }): Promise<ChangeRequest>;
407
+ listChangeRequests({ token, id, state, targetBranch }: {
408
+ token: string;
409
+ id: Id;
410
+ state?: 'opened' | 'merged' | 'closed' | 'all';
411
+ targetBranch?: string;
412
+ }): Promise<ChangeRequest[]>;
413
+ /**
414
+ * Merges the pull request when it can be merged, waiting for GitHub to work out whether it can. Answers `true` when it has conflicts
415
+ * (or is not open), `false` when it was merged: the same answer GitLab's merge gave.
416
+ */
417
+ mergeChangeRequest({ token, id, number, deleteSourceBranch }: {
418
+ token: string;
419
+ id: Id;
420
+ number: number;
421
+ deleteSourceBranch?: boolean;
422
+ }): Promise<boolean>;
423
+ private mergePull;
424
+ listChangeRequestPipelines({ token, id, number }: {
425
+ token: string;
426
+ id: Id;
427
+ number: number;
428
+ }): Promise<Pipeline[]>;
429
+ getLatestPipeline({ token, id, ref }: {
430
+ token: string;
431
+ id: Id;
432
+ ref: string;
433
+ }): Promise<Pipeline | null>;
434
+ getCiRunners(_args: {
435
+ token: string;
436
+ id: Id;
437
+ }): Promise<CiRunners>;
438
+ setInstanceRunners(_args: {
439
+ token: string;
440
+ id: Id;
441
+ enabled: boolean;
442
+ }): Promise<void>;
443
+ listPipelines({ token, id, ref, perPage }: {
444
+ token: string;
445
+ id: Id;
446
+ ref?: string;
447
+ perPage?: number;
448
+ }): Promise<Pipeline[]>;
449
+ getPipelineJobs({ token, id, pipelineId }: {
450
+ token: string;
451
+ id: Id;
452
+ pipelineId: Id;
453
+ }): Promise<PipelineJob[]>;
454
+ retryPipeline({ token, id, pipelineId }: {
455
+ token: string;
456
+ id: Id;
457
+ pipelineId: Id;
458
+ }): Promise<void>;
459
+ enablePipelines(_args: {
460
+ token: string;
461
+ id: Id;
462
+ }): Promise<boolean>;
463
+ disablePipelines(_args: {
464
+ token: string;
465
+ id: Id;
466
+ }): Promise<boolean>;
467
+ pipelinesEnabled(_args: {
468
+ token: string;
469
+ id: Id;
470
+ }): Promise<boolean | null>;
471
+ cancelPipeline({ token, id, pipelineId }: {
472
+ token: string;
473
+ id: Id;
474
+ pipelineId: Id;
475
+ }): Promise<void>;
476
+ cancelJob(_args: {
477
+ token: string;
478
+ id: Id;
479
+ jobId: Id;
480
+ }): Promise<void>;
481
+ getJobTrace({ token, id, jobId, lines }: {
482
+ token: string;
483
+ id: Id;
484
+ jobId: Id;
485
+ lines?: number;
486
+ }): Promise<string>;
487
+ /** GitHub sends every push, whatever the branch: the receiver looks at `ref` (see `parsePushEvent`). */
488
+ ensureWebhook({ token, id, url, secret }: {
489
+ token: string;
490
+ id: Id;
491
+ url: string;
492
+ secret: string;
493
+ branch?: string;
494
+ }): Promise<{
495
+ status: 'created' | 'already_exists';
496
+ hookId?: Id | null;
497
+ }>;
498
+ /** Whether a webhook delivery is from GitHub: the signature of the raw body with the shared secret. */
499
+ verifyWebhook({ headers, rawBody, secret }: Required<Delivery>): boolean;
500
+ parsePushEvent({ headers, body }: {
501
+ headers: Record<string, string | undefined>;
502
+ body: any;
503
+ }): {
504
+ repositoryId: Id;
505
+ branch: string;
506
+ } | null;
507
+ rollback(): Promise<void>;
508
+ isAuthError(error: unknown): boolean;
509
+ isAlreadyExistsError(error: unknown): boolean;
510
+ }