repository-provider 27.0.4 → 28.0.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 +26 -12
- package/package.json +5 -5
- package/src/base-provider.mjs +8 -8
- package/src/branch.mjs +1 -1
- package/src/commit.mjs +7 -0
- package/src/ref.mjs +6 -2
- package/src/repository.mjs +23 -12
- package/src/tag.mjs +1 -1
package/README.md
CHANGED
|
@@ -250,6 +250,7 @@ console.log(await readme.getString());
|
|
|
250
250
|
* [fullName](#fullname-3)
|
|
251
251
|
* [fullCondensedName](#fullcondensedname)
|
|
252
252
|
* [identifier](#identifier-1)
|
|
253
|
+
* [toString](#tostring)
|
|
253
254
|
* [issuesURL](#issuesurl)
|
|
254
255
|
* [homePageURL](#homepageurl-1)
|
|
255
256
|
* [isLocked](#islocked)
|
|
@@ -292,6 +293,7 @@ console.log(await readme.getString());
|
|
|
292
293
|
* [isLocked](#islocked-1)
|
|
293
294
|
* [isDisabled](#isdisabled-1)
|
|
294
295
|
* [isTemplate](#istemplate)
|
|
296
|
+
* [delete](#delete-2)
|
|
295
297
|
* [defaultBranch](#defaultbranch)
|
|
296
298
|
* [branch](#branch-2)
|
|
297
299
|
* [Parameters](#parameters-70)
|
|
@@ -309,7 +311,6 @@ console.log(await readme.getString());
|
|
|
309
311
|
* [Parameters](#parameters-76)
|
|
310
312
|
* [addTag](#addtag)
|
|
311
313
|
* [Parameters](#parameters-77)
|
|
312
|
-
* [delete](#delete-2)
|
|
313
314
|
* [createPullRequest](#createpullrequest-1)
|
|
314
315
|
* [Parameters](#parameters-78)
|
|
315
316
|
* [addPullRequest](#addpullrequest)
|
|
@@ -329,6 +330,7 @@ console.log(await readme.getString());
|
|
|
329
330
|
* [type](#type-1)
|
|
330
331
|
* [refId](#refid-1)
|
|
331
332
|
* [Parameters](#parameters-85)
|
|
333
|
+
* [toString](#tostring-1)
|
|
332
334
|
* [toJSON](#tojson-3)
|
|
333
335
|
* [attributes](#attributes-2)
|
|
334
336
|
* [defaultBranchName](#defaultbranchname)
|
|
@@ -1416,7 +1418,7 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
1416
1418
|
|
|
1417
1419
|
### ref
|
|
1418
1420
|
|
|
1419
|
-
ref
|
|
1421
|
+
Full ref path.
|
|
1420
1422
|
|
|
1421
1423
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** git ref of the Ref
|
|
1422
1424
|
|
|
@@ -1470,7 +1472,7 @@ Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
1470
1472
|
|
|
1471
1473
|
* **See**: [Repository#owner](Repository#owner)
|
|
1472
1474
|
|
|
1473
|
-
|
|
1475
|
+
Ref owner.
|
|
1474
1476
|
By default we provide the repository owner
|
|
1475
1477
|
|
|
1476
1478
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
@@ -1494,6 +1496,12 @@ Short human readable identifier with provider and branch.
|
|
|
1494
1496
|
|
|
1495
1497
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1496
1498
|
|
|
1499
|
+
### toString
|
|
1500
|
+
|
|
1501
|
+
Same as identifier.
|
|
1502
|
+
|
|
1503
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1504
|
+
|
|
1497
1505
|
### issuesURL
|
|
1498
1506
|
|
|
1499
1507
|
* **See**: [Repository#issuesURL](#repositoryissuesurl)
|
|
@@ -1618,7 +1626,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
1618
1626
|
|
|
1619
1627
|
### slug
|
|
1620
1628
|
|
|
1621
|
-
|
|
1629
|
+
Name of the repo as used in the URL.
|
|
1622
1630
|
|
|
1623
1631
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1624
1632
|
|
|
@@ -1689,7 +1697,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
1689
1697
|
|
|
1690
1698
|
### cloneURL
|
|
1691
1699
|
|
|
1692
|
-
The url used
|
|
1700
|
+
The url used for cloning the repo.
|
|
1693
1701
|
|
|
1694
1702
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1695
1703
|
|
|
@@ -1735,6 +1743,13 @@ By default we are not a template.
|
|
|
1735
1743
|
|
|
1736
1744
|
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
|
|
1737
1745
|
|
|
1746
|
+
### delete
|
|
1747
|
+
|
|
1748
|
+
Delete the repository from the [Provider](Provider).
|
|
1749
|
+
[Provider#deleteRepository](Provider#deleteRepository)
|
|
1750
|
+
|
|
1751
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>**
|
|
1752
|
+
|
|
1738
1753
|
### defaultBranch
|
|
1739
1754
|
|
|
1740
1755
|
Lookup the default branch.
|
|
@@ -1823,13 +1838,6 @@ Internal tag creation does not call repository.initialize()
|
|
|
1823
1838
|
|
|
1824
1839
|
Returns **[Tag](#tag)** newly created tag
|
|
1825
1840
|
|
|
1826
|
-
### delete
|
|
1827
|
-
|
|
1828
|
-
Delete the repository from the [Provider](Provider).
|
|
1829
|
-
[Provider#deleteRepository](Provider#deleteRepository)
|
|
1830
|
-
|
|
1831
|
-
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)\<any>**
|
|
1832
|
-
|
|
1833
1841
|
### createPullRequest
|
|
1834
1842
|
|
|
1835
1843
|
Create a pull request (or deliver an already present for thefiven name).
|
|
@@ -1928,6 +1936,12 @@ Get sha of a ref.
|
|
|
1928
1936
|
|
|
1929
1937
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** sha of the ref
|
|
1930
1938
|
|
|
1939
|
+
### toString
|
|
1940
|
+
|
|
1941
|
+
full name.
|
|
1942
|
+
|
|
1943
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1944
|
+
|
|
1931
1945
|
### toJSON
|
|
1932
1946
|
|
|
1933
1947
|
Provide name and all defined attributes
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "28.0.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,18 +30,18 @@
|
|
|
30
30
|
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t es2022 ./src/*.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"matching-iterator": "^2.0.
|
|
33
|
+
"matching-iterator": "^2.0.4"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"ava": "^4.1.0",
|
|
37
37
|
"c8": "^7.11.0",
|
|
38
38
|
"documentation": "^13.2.5",
|
|
39
|
-
"repository-provider-test-support": "^1.12.
|
|
39
|
+
"repository-provider-test-support": "^1.12.11",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
|
-
"typescript": "^4.6.
|
|
41
|
+
"typescript": "^4.6.3"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
|
-
"node": ">=14.
|
|
44
|
+
"node": ">=16.14.2"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
package/src/base-provider.mjs
CHANGED
|
@@ -12,9 +12,9 @@ import { BaseObject } from "./base-object.mjs";
|
|
|
12
12
|
/**
|
|
13
13
|
* @typedef {Object} MessageDestination
|
|
14
14
|
* Endpoint to deliver log messages to.
|
|
15
|
-
* @
|
|
16
|
-
* @
|
|
17
|
-
* @
|
|
15
|
+
* @property {Function} info
|
|
16
|
+
* @property {Function} warn
|
|
17
|
+
* @property {Function} error
|
|
18
18
|
*/
|
|
19
19
|
|
|
20
20
|
/**
|
|
@@ -31,8 +31,8 @@ export class BaseProvider extends BaseObject {
|
|
|
31
31
|
/**
|
|
32
32
|
* Extract options suitable for the constructor
|
|
33
33
|
* form the given set of environment variables.
|
|
34
|
-
* @param {Object} env
|
|
35
|
-
* @param {string} instanceIdentifier
|
|
34
|
+
* @param {Object} env as of from process.env
|
|
35
|
+
* @param {string} instanceIdentifier part of variable name.
|
|
36
36
|
* @return {Object} undefined if no suitable environment variables have been found
|
|
37
37
|
*/
|
|
38
38
|
static optionsFromEnvironment(
|
|
@@ -89,7 +89,7 @@ export class BaseProvider extends BaseObject {
|
|
|
89
89
|
return {
|
|
90
90
|
...super.attributes,
|
|
91
91
|
/**
|
|
92
|
-
* In case there are several
|
|
92
|
+
* In case there are several providers able to support a given source which one sould be used ?
|
|
93
93
|
* this defines the order
|
|
94
94
|
*/
|
|
95
95
|
priority: {
|
|
@@ -98,7 +98,7 @@ export class BaseProvider extends BaseObject {
|
|
|
98
98
|
},
|
|
99
99
|
|
|
100
100
|
/**
|
|
101
|
-
* Name of the provider
|
|
101
|
+
* Name of the provider.
|
|
102
102
|
*/
|
|
103
103
|
name: {
|
|
104
104
|
type: "string",
|
|
@@ -111,7 +111,7 @@ export class BaseProvider extends BaseObject {
|
|
|
111
111
|
},
|
|
112
112
|
|
|
113
113
|
/**
|
|
114
|
-
*
|
|
114
|
+
* To forward info/warn and error messages to
|
|
115
115
|
*/
|
|
116
116
|
messageDestination: {
|
|
117
117
|
type: "object",
|
package/src/branch.mjs
CHANGED
package/src/commit.mjs
CHANGED
|
@@ -5,10 +5,17 @@
|
|
|
5
5
|
* @property {string} ref
|
|
6
6
|
*/
|
|
7
7
|
|
|
8
|
+
export class User
|
|
9
|
+
{
|
|
10
|
+
|
|
11
|
+
}
|
|
12
|
+
|
|
8
13
|
/**
|
|
9
14
|
* @property {Repository} repository
|
|
10
15
|
* @property {string} message
|
|
11
16
|
* @property {string} sha
|
|
17
|
+
* @property {User} author
|
|
18
|
+
* @property {User} committer
|
|
12
19
|
*/
|
|
13
20
|
export class Commit {
|
|
14
21
|
constructor(repository) {
|
package/src/ref.mjs
CHANGED
|
@@ -43,7 +43,7 @@ export class Ref extends NamedObject {
|
|
|
43
43
|
}
|
|
44
44
|
|
|
45
45
|
/**
|
|
46
|
-
* ref
|
|
46
|
+
* Full ref path.
|
|
47
47
|
* @return {string} git ref of the Ref
|
|
48
48
|
*/
|
|
49
49
|
get ref() {
|
|
@@ -97,7 +97,7 @@ export class Ref extends NamedObject {
|
|
|
97
97
|
}
|
|
98
98
|
|
|
99
99
|
/**
|
|
100
|
-
*
|
|
100
|
+
* Ref owner.
|
|
101
101
|
* By default we provide the repository owner
|
|
102
102
|
* @see {@link Repository#owner}
|
|
103
103
|
* @return {string}
|
|
@@ -137,6 +137,10 @@ export class Ref extends NamedObject {
|
|
|
137
137
|
return `${this.provider.name}:${this.fullCondensedName}`;
|
|
138
138
|
}
|
|
139
139
|
|
|
140
|
+
/**
|
|
141
|
+
* Same as identifier.
|
|
142
|
+
* @return {string}
|
|
143
|
+
*/
|
|
140
144
|
toString() {
|
|
141
145
|
return this.identifier;
|
|
142
146
|
}
|
package/src/repository.mjs
CHANGED
|
@@ -84,7 +84,7 @@ export class Repository extends NamedObject {
|
|
|
84
84
|
}
|
|
85
85
|
|
|
86
86
|
/**
|
|
87
|
-
*
|
|
87
|
+
* Name of the repo as used in the URL.
|
|
88
88
|
* @return {string}
|
|
89
89
|
*/
|
|
90
90
|
get slug() {
|
|
@@ -149,6 +149,14 @@ export class Repository extends NamedObject {
|
|
|
149
149
|
return (await this.defaultBranch).maybeEntry(name);
|
|
150
150
|
}
|
|
151
151
|
|
|
152
|
+
/**
|
|
153
|
+
* List commits of the default branch.
|
|
154
|
+
* @param {Object} options
|
|
155
|
+
* @return {AsyncIterator<Commit>} all matching commits in the repository
|
|
156
|
+
*/
|
|
157
|
+
async *commits(options) {
|
|
158
|
+
}
|
|
159
|
+
|
|
152
160
|
/**
|
|
153
161
|
* Urls to access the repo.
|
|
154
162
|
* @return {string[]}
|
|
@@ -166,7 +174,7 @@ export class Repository extends NamedObject {
|
|
|
166
174
|
}
|
|
167
175
|
|
|
168
176
|
/**
|
|
169
|
-
* The url used
|
|
177
|
+
* The url used for cloning the repo.
|
|
170
178
|
* @return {string}
|
|
171
179
|
*/
|
|
172
180
|
get cloneURL() {
|
|
@@ -229,6 +237,15 @@ export class Repository extends NamedObject {
|
|
|
229
237
|
return false;
|
|
230
238
|
}
|
|
231
239
|
|
|
240
|
+
/**
|
|
241
|
+
* Delete the repository from the {@link Provider}.
|
|
242
|
+
* {@link Provider#deleteRepository}
|
|
243
|
+
* @return {Promise<any>}
|
|
244
|
+
*/
|
|
245
|
+
async delete() {
|
|
246
|
+
return this.owner.deleteRepository(this.name);
|
|
247
|
+
}
|
|
248
|
+
|
|
232
249
|
/**
|
|
233
250
|
* Lookup the default branch.
|
|
234
251
|
* @return {Promise<Branch>} branch named after defaultBranchName
|
|
@@ -340,15 +357,6 @@ export class Repository extends NamedObject {
|
|
|
340
357
|
this._tags.set(tag.name, tag);
|
|
341
358
|
}
|
|
342
359
|
|
|
343
|
-
/**
|
|
344
|
-
* Delete the repository from the {@link Provider}.
|
|
345
|
-
* {@link Provider#deleteRepository}
|
|
346
|
-
* @return {Promise<any>}
|
|
347
|
-
*/
|
|
348
|
-
async delete() {
|
|
349
|
-
return this.owner.deleteRepository(this.name);
|
|
350
|
-
}
|
|
351
|
-
|
|
352
360
|
/**
|
|
353
361
|
* Create a pull request (or deliver an already present for thefiven name).
|
|
354
362
|
* @param {string} name of the pr
|
|
@@ -487,9 +495,12 @@ export class Repository extends NamedObject {
|
|
|
487
495
|
* @return {Promise<string>} sha of the ref
|
|
488
496
|
*/
|
|
489
497
|
async refId(ref) {
|
|
490
|
-
return undefined;
|
|
491
498
|
}
|
|
492
499
|
|
|
500
|
+
/**
|
|
501
|
+
* full name.
|
|
502
|
+
* @returns {string}
|
|
503
|
+
*/
|
|
493
504
|
toString() {
|
|
494
505
|
return this.fullName;
|
|
495
506
|
}
|