repository-provider 35.2.2 → 35.2.4
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 +946 -272
- package/package.json +4 -4
- package/src/base-object.mjs +3 -1
- package/src/base-provider.mjs +18 -5
- package/src/branch.mjs +11 -2
- package/src/index.mjs +10 -0
- package/src/multi-group-provider.mjs +1 -0
- package/src/named-object.mjs +7 -0
- package/src/owned-object.mjs +12 -1
- package/src/pull-request.mjs +5 -0
- package/src/ref.mjs +6 -0
- package/src/repository-owner.mjs +2 -0
- package/src/repository.mjs +11 -2
- package/src/single-group-provider.mjs +2 -0
- package/types/base-provider.d.mts +9 -4
- package/types/branch.d.mts +3 -3
- package/types/named-object.d.mts +6 -0
- package/types/owned-object.d.mts +21 -7
- package/types/ref.d.mts +9 -1
- package/types/repository-group.d.mts +1 -1
- package/types/repository-owner.d.mts +1 -1
- package/types/single-group-provider.d.mts +1 -1
package/package.json
CHANGED
|
@@ -1,17 +1,17 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "35.2.
|
|
3
|
+
"version": "35.2.4",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public",
|
|
6
6
|
"provenance": true
|
|
7
7
|
},
|
|
8
|
+
"types": "./types/index.d.mts",
|
|
8
9
|
"exports": {
|
|
9
10
|
".": {
|
|
10
|
-
"
|
|
11
|
-
"
|
|
11
|
+
"default": "./src/index.mjs",
|
|
12
|
+
"types": "./types/index.d.mts"
|
|
12
13
|
}
|
|
13
14
|
},
|
|
14
|
-
"types": "./types/index.d.mts",
|
|
15
15
|
"description": "abstract interface to git repository providers like github, bitbucket and gitlab",
|
|
16
16
|
"keywords": [
|
|
17
17
|
"git",
|
package/src/base-object.mjs
CHANGED
|
@@ -8,7 +8,7 @@ import { description_attribute, id_attribute } from "./attributes.mjs";
|
|
|
8
8
|
* Creates an instance of BaseObject.
|
|
9
9
|
* @param {Object} options
|
|
10
10
|
* @param {Object} [additionalProperties]
|
|
11
|
-
*
|
|
11
|
+
*
|
|
12
12
|
* @property {string?} id
|
|
13
13
|
* @property {string?} description
|
|
14
14
|
*/
|
|
@@ -72,6 +72,7 @@ export class BaseObject {
|
|
|
72
72
|
updateAttributes(options, additionalProperties) {
|
|
73
73
|
definePropertiesFromOptions(
|
|
74
74
|
this,
|
|
75
|
+
// @ts-ignore
|
|
75
76
|
mapAttributes(options, this.constructor.attributeMapping),
|
|
76
77
|
additionalProperties
|
|
77
78
|
);
|
|
@@ -94,6 +95,7 @@ export class BaseObject {
|
|
|
94
95
|
* @return {string}
|
|
95
96
|
*/
|
|
96
97
|
get fullName() {
|
|
98
|
+
// @ts-ignore
|
|
97
99
|
return this.name;
|
|
98
100
|
}
|
|
99
101
|
|
package/src/base-provider.mjs
CHANGED
|
@@ -1,13 +1,12 @@
|
|
|
1
|
+
import { ContentEntry } from "content-entry";
|
|
1
2
|
import { asArray, stripBaseName } from "./util.mjs";
|
|
2
3
|
import { PullRequest } from "./pull-request.mjs";
|
|
3
4
|
import { RepositoryGroup } from "./repository-group.mjs";
|
|
5
|
+
import { BaseObject } from "./base-object.mjs";
|
|
4
6
|
import { Repository } from "./repository.mjs";
|
|
5
|
-
import { Branch } from "./branch.mjs";
|
|
6
7
|
import { Tag } from "./tag.mjs";
|
|
8
|
+
import { Branch } from "./branch.mjs";
|
|
7
9
|
import { Hook } from "./hook.mjs";
|
|
8
|
-
import { Project } from "./project.mjs";
|
|
9
|
-
import { Milestone } from "./milestone.mjs";
|
|
10
|
-
import { BaseObject } from "./base-object.mjs";
|
|
11
10
|
import {
|
|
12
11
|
url_attribute,
|
|
13
12
|
name_attribute,
|
|
@@ -16,6 +15,11 @@ import {
|
|
|
16
15
|
default_attribute
|
|
17
16
|
} from "./attributes.mjs";
|
|
18
17
|
|
|
18
|
+
/**
|
|
19
|
+
* @typedef {import('./project.mjs').Project} Project
|
|
20
|
+
* @typedef {import('./milestone.mjs').Milestone} Milestone
|
|
21
|
+
*/
|
|
22
|
+
|
|
19
23
|
/**
|
|
20
24
|
* @typedef {Object} MessageDestination
|
|
21
25
|
* Endpoint to deliver log messages to.
|
|
@@ -154,7 +158,7 @@ export class BaseProvider extends BaseObject {
|
|
|
154
158
|
}
|
|
155
159
|
|
|
156
160
|
/**
|
|
157
|
-
* @param {
|
|
161
|
+
* @param {any} other
|
|
158
162
|
* @return {boolean} true if other provider is the same as the receiver
|
|
159
163
|
*/
|
|
160
164
|
equals(other) {
|
|
@@ -297,6 +301,7 @@ export class BaseProvider extends BaseObject {
|
|
|
297
301
|
*/
|
|
298
302
|
async createRepository(name, options) {
|
|
299
303
|
const { group, repository } = this.parseName(name);
|
|
304
|
+
// @ts-ignore
|
|
300
305
|
const rg = await this.repositoryGroup(group);
|
|
301
306
|
return rg.createRepository(repository, options);
|
|
302
307
|
}
|
|
@@ -309,6 +314,7 @@ export class BaseProvider extends BaseObject {
|
|
|
309
314
|
*/
|
|
310
315
|
async *list(type, patterns) {
|
|
311
316
|
if (patterns === undefined) {
|
|
317
|
+
// @ts-ignore
|
|
312
318
|
for await (const group of this.repositoryGroups()) {
|
|
313
319
|
yield* group[type]();
|
|
314
320
|
}
|
|
@@ -319,6 +325,7 @@ export class BaseProvider extends BaseObject {
|
|
|
319
325
|
this.repositoryBases
|
|
320
326
|
).split(/\//);
|
|
321
327
|
|
|
328
|
+
// @ts-ignore
|
|
322
329
|
for await (const group of this.repositoryGroups(groupPattern)) {
|
|
323
330
|
yield* group[type](repoPattern);
|
|
324
331
|
}
|
|
@@ -412,6 +419,7 @@ export class BaseProvider extends BaseObject {
|
|
|
412
419
|
toJSON() {
|
|
413
420
|
const json = { name: this.name };
|
|
414
421
|
|
|
422
|
+
// @ts-ignore
|
|
415
423
|
Object.entries(this.constructor.attributes).forEach(([k, v]) => {
|
|
416
424
|
if (
|
|
417
425
|
!v.private &&
|
|
@@ -428,22 +436,27 @@ export class BaseProvider extends BaseObject {
|
|
|
428
436
|
initializeRepositories() {}
|
|
429
437
|
|
|
430
438
|
trace(...args) {
|
|
439
|
+
// @ts-ignore
|
|
431
440
|
return this.messageDestination.trace(...args);
|
|
432
441
|
}
|
|
433
442
|
|
|
434
443
|
debug(...args) {
|
|
444
|
+
// @ts-ignore
|
|
435
445
|
return this.messageDestination.debug(...args);
|
|
436
446
|
}
|
|
437
447
|
|
|
438
448
|
info(...args) {
|
|
449
|
+
// @ts-ignore
|
|
439
450
|
return this.messageDestination.info(...args);
|
|
440
451
|
}
|
|
441
452
|
|
|
442
453
|
warn(...args) {
|
|
454
|
+
// @ts-ignore
|
|
443
455
|
return this.messageDestination.warn(...args);
|
|
444
456
|
}
|
|
445
457
|
|
|
446
458
|
error(...args) {
|
|
459
|
+
// @ts-ignore
|
|
447
460
|
return this.messageDestination.error(...args);
|
|
448
461
|
}
|
|
449
462
|
|
package/src/branch.mjs
CHANGED
|
@@ -84,9 +84,11 @@ export class Branch extends Ref {
|
|
|
84
84
|
* @param {string} message commit message
|
|
85
85
|
* @param {ContentEntry[]} updates content to be commited
|
|
86
86
|
* @param {Object} options
|
|
87
|
-
* @return {Promise<CommitResult>}
|
|
87
|
+
* @return {Promise<CommitResult|undefined>}
|
|
88
88
|
*/
|
|
89
|
-
async commit(message, updates, options) {
|
|
89
|
+
async commit(message, updates, options) {
|
|
90
|
+
return undefined;
|
|
91
|
+
}
|
|
90
92
|
|
|
91
93
|
/**
|
|
92
94
|
* Add commits into a pull request.
|
|
@@ -129,13 +131,16 @@ export class Branch extends Ref {
|
|
|
129
131
|
if (prBranch === undefined) {
|
|
130
132
|
prBranch = isBranch
|
|
131
133
|
? options.pullRequestBranch
|
|
134
|
+
// @ts-ignore
|
|
132
135
|
: await this.createBranch(options.pullRequestBranch);
|
|
133
136
|
}
|
|
134
137
|
await prBranch.commit(commit.message, commit.entries);
|
|
135
138
|
c2m(commit);
|
|
136
139
|
};
|
|
137
140
|
|
|
141
|
+
// @ts-ignore
|
|
138
142
|
if (commits.next) {
|
|
143
|
+
// @ts-ignore
|
|
139
144
|
for await (const commit of commits) {
|
|
140
145
|
await exec(commit);
|
|
141
146
|
}
|
|
@@ -148,7 +153,9 @@ export class Branch extends Ref {
|
|
|
148
153
|
options.body = options.body ? options.body + '\n' + body : body;
|
|
149
154
|
}
|
|
150
155
|
|
|
156
|
+
// @ts-ignore
|
|
151
157
|
if (options.body?.length > 0 && !options.skipWithoutCommits) {
|
|
158
|
+
// @ts-ignore
|
|
152
159
|
return prBranch.createPullRequest(this, options);
|
|
153
160
|
} else {
|
|
154
161
|
return new PullRequest(
|
|
@@ -160,6 +167,7 @@ export class Branch extends Ref {
|
|
|
160
167
|
}
|
|
161
168
|
} catch (e) {
|
|
162
169
|
if (!isBranch && prBranch) {
|
|
170
|
+
// @ts-ignore
|
|
163
171
|
await prBranch.delete();
|
|
164
172
|
}
|
|
165
173
|
throw e;
|
|
@@ -179,6 +187,7 @@ export class Branch extends Ref {
|
|
|
179
187
|
* @return {Promise<PullRequest>}
|
|
180
188
|
*/
|
|
181
189
|
async createPullRequest(toBranch, options) {
|
|
190
|
+
// @ts-ignore
|
|
182
191
|
return this.pullRequestClass.open(this, toBranch, options);
|
|
183
192
|
}
|
|
184
193
|
|
package/src/index.mjs
CHANGED
|
@@ -1,20 +1,30 @@
|
|
|
1
1
|
export * from "./base-object.mjs";
|
|
2
2
|
export * from "./named-object.mjs";
|
|
3
|
+
// @ts-ignore
|
|
3
4
|
export * from "./owned-object.mjs";
|
|
4
5
|
export * from "./repository-owner.mjs";
|
|
6
|
+
// @ts-ignore
|
|
5
7
|
export * from "./base-provider.mjs";
|
|
6
8
|
export * from "./single-group-provider.mjs";
|
|
7
9
|
export * from "./multi-group-provider.mjs";
|
|
8
10
|
export * from "./repository-group.mjs";
|
|
11
|
+
// @ts-ignore
|
|
9
12
|
export * from "./repository.mjs";
|
|
13
|
+
// @ts-ignore
|
|
10
14
|
export * from "./ref.mjs";
|
|
11
15
|
export * from "./commit.mjs";
|
|
16
|
+
// @ts-ignore
|
|
12
17
|
export * from "./branch.mjs";
|
|
18
|
+
// @ts-ignore
|
|
13
19
|
export * from "./tag.mjs";
|
|
20
|
+
// @ts-ignore
|
|
14
21
|
export * from "./project.mjs";
|
|
15
22
|
export * from "./issue.mjs";
|
|
23
|
+
// @ts-ignore
|
|
16
24
|
export * from "./pull-request.mjs";
|
|
25
|
+
// @ts-ignore
|
|
17
26
|
export * from "./hook.mjs";
|
|
27
|
+
// @ts-ignore
|
|
18
28
|
export * from "./milestone.mjs";
|
|
19
29
|
export * from "./review.mjs";
|
|
20
30
|
export * from "./application.mjs";
|
|
@@ -104,6 +104,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
104
104
|
* @return {RepositoryGroup}
|
|
105
105
|
*/
|
|
106
106
|
addRepositoryGroup(name, options) {
|
|
107
|
+
// @ts-ignore
|
|
107
108
|
return this.#repositoryGroups.get(this.normalizeGroupName(name, true)) || new this.repositoryGroupClass(this, name, options);
|
|
108
109
|
}
|
|
109
110
|
|
package/src/named-object.mjs
CHANGED
|
@@ -6,6 +6,12 @@ import {
|
|
|
6
6
|
id_attribute
|
|
7
7
|
} from "./attributes.mjs";
|
|
8
8
|
|
|
9
|
+
/**
|
|
10
|
+
* @typedef {import('./hook.mjs').Hook} Hook
|
|
11
|
+
* @typedef {import('./base-provider.mjs').BaseProvider} BaseProvider
|
|
12
|
+
*/
|
|
13
|
+
|
|
14
|
+
|
|
9
15
|
/**
|
|
10
16
|
* Object with a name.
|
|
11
17
|
* @param {string} name
|
|
@@ -73,6 +79,7 @@ export class NamedObject extends BaseObject {
|
|
|
73
79
|
return (
|
|
74
80
|
super.equals(other) &&
|
|
75
81
|
this.fullName === other.fullName &&
|
|
82
|
+
// @ts-ignore
|
|
76
83
|
this.provider.equals(other.provider)
|
|
77
84
|
);
|
|
78
85
|
}
|
package/src/owned-object.mjs
CHANGED
|
@@ -1,6 +1,15 @@
|
|
|
1
1
|
import { ContentEntry } from "content-entry";
|
|
2
2
|
import { NamedObject } from "./named-object.mjs";
|
|
3
3
|
|
|
4
|
+
/**
|
|
5
|
+
* @typedef {import('./base-provider.mjs').BaseProvider} BaseProvider
|
|
6
|
+
* @typedef {import('./repository.mjs').Repository} Repository
|
|
7
|
+
* @typedef {import('./hook.mjs').Hook} Hook
|
|
8
|
+
* @typedef {import('./tag.mjs').Tag} Tag
|
|
9
|
+
* @typedef {import('./branch.mjs').Branch} Branch
|
|
10
|
+
* @typedef {import('./pull-request.mjs').PullRequest} PullRequest
|
|
11
|
+
*/
|
|
12
|
+
|
|
4
13
|
/**
|
|
5
14
|
* Named Object registering itself in the owner.
|
|
6
15
|
*/
|
|
@@ -28,6 +37,7 @@ export class OwnedObject extends NamedObject {
|
|
|
28
37
|
constructor(owner, name, options, additionalProperties) {
|
|
29
38
|
super(name, options, additionalProperties);
|
|
30
39
|
this.owner = owner;
|
|
40
|
+
// @ts-ignore
|
|
31
41
|
owner[this.constructor.addMethodName](this);
|
|
32
42
|
}
|
|
33
43
|
|
|
@@ -35,6 +45,7 @@ export class OwnedObject extends NamedObject {
|
|
|
35
45
|
* Removes the receiver from the owner.
|
|
36
46
|
*/
|
|
37
47
|
delete() {
|
|
48
|
+
// @ts-ignore
|
|
38
49
|
this.owner[this.constructor.deleteMethodName](this);
|
|
39
50
|
}
|
|
40
51
|
|
|
@@ -59,7 +70,7 @@ export class OwnedObject extends NamedObject {
|
|
|
59
70
|
/**
|
|
60
71
|
* Url of issue tracking system.
|
|
61
72
|
* @see {@link Repository#issuesURL}
|
|
62
|
-
* @return {string} as provided from the repository
|
|
73
|
+
* @return {string|undefined} as provided from the repository
|
|
63
74
|
*/
|
|
64
75
|
get issuesURL() {
|
|
65
76
|
return this.owner.issuesURL;
|
package/src/pull-request.mjs
CHANGED
|
@@ -141,6 +141,7 @@ export class PullRequest extends OwnedObject {
|
|
|
141
141
|
state: {
|
|
142
142
|
set(value) {
|
|
143
143
|
value = value.toUpperCase();
|
|
144
|
+
// @ts-ignore
|
|
144
145
|
if (this.constructor.attributes.state.values.has(value)) {
|
|
145
146
|
state = value;
|
|
146
147
|
} else throw new Error(`Invalid Pull Request state ${value}`);
|
|
@@ -214,7 +215,9 @@ export class PullRequest extends OwnedObject {
|
|
|
214
215
|
*/
|
|
215
216
|
async merge(method = "MERGE") {
|
|
216
217
|
method = method.toUpperCase();
|
|
218
|
+
// @ts-ignore
|
|
217
219
|
if (this.constructor.validMergeMethods.has(method)) {
|
|
220
|
+
// @ts-ignore
|
|
218
221
|
await this._merge(method);
|
|
219
222
|
this.merged = true;
|
|
220
223
|
} else {
|
|
@@ -234,9 +237,11 @@ export class PullRequest extends OwnedObject {
|
|
|
234
237
|
|
|
235
238
|
toString() {
|
|
236
239
|
return [
|
|
240
|
+
// @ts-ignore
|
|
237
241
|
[this.name, this.title],
|
|
238
242
|
["source", this.source?.identifier],
|
|
239
243
|
["destination", this.owner.identifier],
|
|
244
|
+
// @ts-ignore
|
|
240
245
|
...Object.entries(this.constructor.attributes)
|
|
241
246
|
.filter(
|
|
242
247
|
([k, v]) =>
|
package/src/ref.mjs
CHANGED
|
@@ -2,6 +2,12 @@ import { ContentEntry } from "content-entry";
|
|
|
2
2
|
import { OwnedObject } from "./owned-object.mjs";
|
|
3
3
|
import { name_attribute, boolean_attribute } from "./attributes.mjs";
|
|
4
4
|
|
|
5
|
+
/**
|
|
6
|
+
* @typedef {import('./repository.mjs').Repository} Repository
|
|
7
|
+
* @typedef {import('./tag.mjs').Tag} Tag
|
|
8
|
+
* @typedef {import('./branch.mjs').Branch} Branch
|
|
9
|
+
*/
|
|
10
|
+
|
|
5
11
|
/**
|
|
6
12
|
* Base for Branch and Tag
|
|
7
13
|
*/
|
package/src/repository-owner.mjs
CHANGED
|
@@ -195,6 +195,7 @@ export function RepositoryOwner(base) {
|
|
|
195
195
|
* @return {Promise<Branch|undefined>}
|
|
196
196
|
*/
|
|
197
197
|
async branch(name) {
|
|
198
|
+
// @ts-ignore
|
|
198
199
|
return this.lookup(
|
|
199
200
|
"branch",
|
|
200
201
|
name,
|
|
@@ -209,6 +210,7 @@ export function RepositoryOwner(base) {
|
|
|
209
210
|
* @return {AsyncIterable<Branch>} all matching branches of the owner
|
|
210
211
|
*/
|
|
211
212
|
async *branches(patterns) {
|
|
213
|
+
// @ts-ignore
|
|
212
214
|
yield* this.list(
|
|
213
215
|
"branches",
|
|
214
216
|
patterns,
|
package/src/repository.mjs
CHANGED
|
@@ -98,6 +98,7 @@ export class Repository extends OwnedObject {
|
|
|
98
98
|
}
|
|
99
99
|
|
|
100
100
|
get url() {
|
|
101
|
+
// @ts-ignore
|
|
101
102
|
return `${this.provider.url}${this.slug}`;
|
|
102
103
|
}
|
|
103
104
|
|
|
@@ -270,6 +271,7 @@ export class Repository extends OwnedObject {
|
|
|
270
271
|
return branch;
|
|
271
272
|
}
|
|
272
273
|
|
|
274
|
+
// @ts-ignore
|
|
273
275
|
return new this.branchClass(this, name, options);
|
|
274
276
|
}
|
|
275
277
|
|
|
@@ -316,6 +318,7 @@ export class Repository extends OwnedObject {
|
|
|
316
318
|
* @return {Tag} newly created tag
|
|
317
319
|
*/
|
|
318
320
|
addTag(name, options) {
|
|
321
|
+
// @ts-ignore
|
|
319
322
|
return this.#tags.get(name) || new this.tagClass(this, name, options);
|
|
320
323
|
}
|
|
321
324
|
|
|
@@ -345,6 +348,7 @@ export class Repository extends OwnedObject {
|
|
|
345
348
|
addPullRequest(name, source, options) {
|
|
346
349
|
let pr = this.#pullRequests.get(name);
|
|
347
350
|
if (pr === undefined) {
|
|
351
|
+
// @ts-ignore
|
|
348
352
|
pr = new this.pullRequestClass(name, source, this, options);
|
|
349
353
|
this.#pullRequests.set(pr.name, pr);
|
|
350
354
|
}
|
|
@@ -395,6 +399,7 @@ export class Repository extends OwnedObject {
|
|
|
395
399
|
addHook(name, options) {
|
|
396
400
|
return (
|
|
397
401
|
this.#hooks.find(hook => hook.name == name) ||
|
|
402
|
+
// @ts-ignore
|
|
398
403
|
new this.hookClass(this, name, options)
|
|
399
404
|
);
|
|
400
405
|
}
|
|
@@ -429,6 +434,7 @@ export class Repository extends OwnedObject {
|
|
|
429
434
|
*/
|
|
430
435
|
async hook(id) {
|
|
431
436
|
for await (const hook of this.hooks()) {
|
|
437
|
+
// @ts-ignore
|
|
432
438
|
if (hook.id == id) {
|
|
433
439
|
// string of number
|
|
434
440
|
return hook;
|
|
@@ -488,7 +494,9 @@ export class Repository extends OwnedObject {
|
|
|
488
494
|
* @param {string} ref
|
|
489
495
|
* @return {Promise<string|undefined>} sha of the ref
|
|
490
496
|
*/
|
|
491
|
-
async refId(ref) {
|
|
497
|
+
async refId(ref) {
|
|
498
|
+
return undefined;
|
|
499
|
+
}
|
|
492
500
|
|
|
493
501
|
initialize() {}
|
|
494
502
|
|
|
@@ -505,7 +513,8 @@ export class Repository extends OwnedObject {
|
|
|
505
513
|
}
|
|
506
514
|
|
|
507
515
|
async initializePullRequests() {
|
|
508
|
-
|
|
516
|
+
// @ts-ignore
|
|
517
|
+
for await (const pr of this.pullRequestClass.list(this)) {
|
|
509
518
|
this.#pullRequests.set(pr.name, pr);
|
|
510
519
|
}
|
|
511
520
|
}
|
|
@@ -29,6 +29,7 @@ export class SingleGroupProvider extends RepositoryOwner(BaseProvider) {
|
|
|
29
29
|
const { base } = this.parseName(name);
|
|
30
30
|
|
|
31
31
|
if (name && this.supportsBase(base)) {
|
|
32
|
+
// @ts-ignore
|
|
32
33
|
return this;
|
|
33
34
|
}
|
|
34
35
|
}
|
|
@@ -46,6 +47,7 @@ export class SingleGroupProvider extends RepositoryOwner(BaseProvider) {
|
|
|
46
47
|
});
|
|
47
48
|
|
|
48
49
|
if (found) {
|
|
50
|
+
// @ts-ignore
|
|
49
51
|
yield this;
|
|
50
52
|
}
|
|
51
53
|
}
|
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./project.mjs').Project} Project
|
|
3
|
+
* @typedef {import('./milestone.mjs').Milestone} Milestone
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* @typedef {Object} MessageDestination
|
|
3
7
|
* Endpoint to deliver log messages to.
|
|
@@ -101,7 +105,7 @@ export class BaseProvider extends BaseObject {
|
|
|
101
105
|
}, env: any): BaseProvider | undefined;
|
|
102
106
|
get priority(): number;
|
|
103
107
|
/**
|
|
104
|
-
* @param {
|
|
108
|
+
* @param {any} other
|
|
105
109
|
* @return {boolean} true if other provider is the same as the receiver
|
|
106
110
|
*/
|
|
107
111
|
equals(other: any): boolean;
|
|
@@ -261,12 +265,14 @@ export class BaseProvider extends BaseObject {
|
|
|
261
265
|
/**
|
|
262
266
|
* @return {typeof ContentEntry} entry class used by the Provider
|
|
263
267
|
*/
|
|
264
|
-
get entryClass():
|
|
268
|
+
get entryClass(): typeof ContentEntry;
|
|
265
269
|
/**
|
|
266
270
|
* @return {typeof PullRequest} pull request class used by the Provider
|
|
267
271
|
*/
|
|
268
272
|
get pullRequestClass(): typeof PullRequest;
|
|
269
273
|
}
|
|
274
|
+
export type Project = import('./project.mjs').Project;
|
|
275
|
+
export type Milestone = import('./milestone.mjs').Milestone;
|
|
270
276
|
/**
|
|
271
277
|
* Endpoint to deliver log messages to.
|
|
272
278
|
*/
|
|
@@ -279,10 +285,9 @@ export type MessageDestination = {
|
|
|
279
285
|
};
|
|
280
286
|
import { BaseObject } from "./base-object.mjs";
|
|
281
287
|
import { Repository } from "./repository.mjs";
|
|
282
|
-
import { Project } from "./project.mjs";
|
|
283
|
-
import { Milestone } from "./milestone.mjs";
|
|
284
288
|
import { Branch } from "./branch.mjs";
|
|
285
289
|
import { Tag } from "./tag.mjs";
|
|
286
290
|
import { Hook } from "./hook.mjs";
|
|
287
291
|
import { PullRequest } from "./pull-request.mjs";
|
|
288
292
|
import { RepositoryGroup } from "./repository-group.mjs";
|
|
293
|
+
import { ContentEntry } from "content-entry";
|
package/types/branch.d.mts
CHANGED
|
@@ -23,9 +23,9 @@ export class Branch extends Ref {
|
|
|
23
23
|
* @param {string} message commit message
|
|
24
24
|
* @param {ContentEntry[]} updates content to be commited
|
|
25
25
|
* @param {Object} options
|
|
26
|
-
* @return {Promise<CommitResult>}
|
|
26
|
+
* @return {Promise<CommitResult|undefined>}
|
|
27
27
|
*/
|
|
28
|
-
commit(message: string, updates: ContentEntry[], options: any): Promise<CommitResult>;
|
|
28
|
+
commit(message: string, updates: ContentEntry[], options: any): Promise<CommitResult | undefined>;
|
|
29
29
|
/**
|
|
30
30
|
* Add commits into a pull request.
|
|
31
31
|
*
|
|
@@ -57,7 +57,7 @@ export class Branch extends Ref {
|
|
|
57
57
|
* @return {Promise<PullRequest>}
|
|
58
58
|
*/
|
|
59
59
|
createPullRequest(toBranch: Branch, options?: any): Promise<PullRequest>;
|
|
60
|
-
_addPullRequest(pullRequest: any): Promise<
|
|
60
|
+
_addPullRequest(pullRequest: any): Promise<void>;
|
|
61
61
|
deletePullRequest(name: any): Promise<any>;
|
|
62
62
|
/**
|
|
63
63
|
* Create a new {@link Branch} by cloning a given source branch.
|
package/types/named-object.d.mts
CHANGED
|
@@ -1,3 +1,7 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./hook.mjs').Hook} Hook
|
|
3
|
+
* @typedef {import('./base-provider.mjs').BaseProvider} BaseProvider
|
|
4
|
+
*/
|
|
1
5
|
/**
|
|
2
6
|
* Object with a name.
|
|
3
7
|
* @param {string} name
|
|
@@ -68,4 +72,6 @@ export class NamedObject extends BaseObject {
|
|
|
68
72
|
toJSON(): any;
|
|
69
73
|
#private;
|
|
70
74
|
}
|
|
75
|
+
export type Hook = import('./hook.mjs').Hook;
|
|
76
|
+
export type BaseProvider = import('./base-provider.mjs').BaseProvider;
|
|
71
77
|
import { BaseObject } from "./base-object.mjs";
|
package/types/owned-object.d.mts
CHANGED
|
@@ -1,3 +1,11 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./base-provider.mjs').BaseProvider} BaseProvider
|
|
3
|
+
* @typedef {import('./repository.mjs').Repository} Repository
|
|
4
|
+
* @typedef {import('./hook.mjs').Hook} Hook
|
|
5
|
+
* @typedef {import('./tag.mjs').Tag} Tag
|
|
6
|
+
* @typedef {import('./branch.mjs').Branch} Branch
|
|
7
|
+
* @typedef {import('./pull-request.mjs').PullRequest} PullRequest
|
|
8
|
+
*/
|
|
1
9
|
/**
|
|
2
10
|
* Named Object registering itself in the owner.
|
|
3
11
|
*/
|
|
@@ -35,7 +43,7 @@ export class OwnedObject extends NamedObject {
|
|
|
35
43
|
/**
|
|
36
44
|
* Url of issue tracking system.
|
|
37
45
|
* @see {@link Repository#issuesURL}
|
|
38
|
-
* @return {string} as provided from the repository
|
|
46
|
+
* @return {string|undefined} as provided from the repository
|
|
39
47
|
*/
|
|
40
48
|
get issuesURL(): string;
|
|
41
49
|
/**
|
|
@@ -72,7 +80,7 @@ export class OwnedObject extends NamedObject {
|
|
|
72
80
|
* The provider we live in.
|
|
73
81
|
* @return {BaseProvider}
|
|
74
82
|
*/
|
|
75
|
-
get provider(): BaseProvider;
|
|
83
|
+
get provider(): import("./base-provider.mjs").BaseProvider;
|
|
76
84
|
/**
|
|
77
85
|
* Forwarded to the owner.
|
|
78
86
|
* @param {...any} args
|
|
@@ -102,22 +110,22 @@ export class OwnedObject extends NamedObject {
|
|
|
102
110
|
* By default we use the owners implementation.
|
|
103
111
|
* @return {Repository} as defined in the owner
|
|
104
112
|
*/
|
|
105
|
-
get repositoryClass(): Repository;
|
|
113
|
+
get repositoryClass(): import("./repository.mjs").Repository;
|
|
106
114
|
/**
|
|
107
115
|
* By default we use the owners implementation.
|
|
108
116
|
* @return {PullRequest} as defined in the owner
|
|
109
117
|
*/
|
|
110
|
-
get pullRequestClass(): PullRequest;
|
|
118
|
+
get pullRequestClass(): import("./pull-request.mjs").PullRequest;
|
|
111
119
|
/**
|
|
112
120
|
* By default we use the owners implementation.
|
|
113
121
|
* @return {Branch} as defined in the owner
|
|
114
122
|
*/
|
|
115
|
-
get branchClass(): Branch;
|
|
123
|
+
get branchClass(): import("./branch.mjs").Branch;
|
|
116
124
|
/**
|
|
117
125
|
* By default we use the owners implementation.
|
|
118
126
|
* @return {Tag} as defined in the owner
|
|
119
127
|
*/
|
|
120
|
-
get tagClass(): Tag;
|
|
128
|
+
get tagClass(): import("./tag.mjs").Tag;
|
|
121
129
|
/**
|
|
122
130
|
* By default we use the owners implementation.
|
|
123
131
|
* @return {ContentEntry} as defined in the owner
|
|
@@ -127,7 +135,13 @@ export class OwnedObject extends NamedObject {
|
|
|
127
135
|
* By default we use the owners implementation.
|
|
128
136
|
* @return {Hook} as defined in the owner
|
|
129
137
|
*/
|
|
130
|
-
get hookClass(): Hook;
|
|
138
|
+
get hookClass(): import("./hook.mjs").Hook;
|
|
131
139
|
}
|
|
140
|
+
export type BaseProvider = import('./base-provider.mjs').BaseProvider;
|
|
141
|
+
export type Repository = import('./repository.mjs').Repository;
|
|
142
|
+
export type Hook = import('./hook.mjs').Hook;
|
|
143
|
+
export type Tag = import('./tag.mjs').Tag;
|
|
144
|
+
export type Branch = import('./branch.mjs').Branch;
|
|
145
|
+
export type PullRequest = import('./pull-request.mjs').PullRequest;
|
|
132
146
|
import { NamedObject } from "./named-object.mjs";
|
|
133
147
|
import { ContentEntry } from "content-entry";
|
package/types/ref.d.mts
CHANGED
|
@@ -1,3 +1,8 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* @typedef {import('./repository.mjs').Repository} Repository
|
|
3
|
+
* @typedef {import('./tag.mjs').Tag} Tag
|
|
4
|
+
* @typedef {import('./branch.mjs').Branch} Branch
|
|
5
|
+
*/
|
|
1
6
|
/**
|
|
2
7
|
* Base for Branch and Tag
|
|
3
8
|
*/
|
|
@@ -68,7 +73,7 @@ export class Ref extends OwnedObject {
|
|
|
68
73
|
* @see {@link Repository#owner}
|
|
69
74
|
* @return {Repository}
|
|
70
75
|
*/
|
|
71
|
-
get repository(): Repository;
|
|
76
|
+
get repository(): import("./repository.mjs").Repository;
|
|
72
77
|
get identifier(): any;
|
|
73
78
|
/**
|
|
74
79
|
*
|
|
@@ -86,5 +91,8 @@ export class Ref extends OwnedObject {
|
|
|
86
91
|
*/
|
|
87
92
|
[Symbol.asyncIterator](): AsyncGenerator<ContentEntry>;
|
|
88
93
|
}
|
|
94
|
+
export type Repository = import('./repository.mjs').Repository;
|
|
95
|
+
export type Tag = import('./tag.mjs').Tag;
|
|
96
|
+
export type Branch = import('./branch.mjs').Branch;
|
|
89
97
|
import { OwnedObject } from "./owned-object.mjs";
|
|
90
98
|
import { ContentEntry } from "content-entry";
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const RepositoryGroup_base: {
|
|
2
2
|
new (): {
|
|
3
3
|
[x: string]: any;
|
|
4
|
-
"__#
|
|
4
|
+
"__#1@#repositories": Map<any, any>;
|
|
5
5
|
normalizeRepositoryName(name: string, forLookup: boolean): string;
|
|
6
6
|
repository(name?: string): Promise<import("./repository.mjs").Repository>;
|
|
7
7
|
repositories(patterns?: string | string[]): AsyncIterable<import("./repository.mjs").Repository>;
|
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
declare const SingleGroupProvider_base: {
|
|
2
2
|
new (): {
|
|
3
3
|
[x: string]: any;
|
|
4
|
-
"__#
|
|
4
|
+
"__#1@#repositories": Map<any, any>;
|
|
5
5
|
normalizeRepositoryName(name: string, forLookup: boolean): string;
|
|
6
6
|
repository(name?: string): Promise<Repository>;
|
|
7
7
|
repositories(patterns?: string | string[]): AsyncIterable<Repository>;
|