repository-provider 28.3.7 → 28.3.10
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 +21 -21
- package/package.json +1 -1
- package/src/base-object.mjs +16 -0
- package/src/base-provider.mjs +0 -8
- package/src/branch.mjs +5 -1
- package/src/named-object.mjs +0 -9
- package/src/owned-object.mjs +11 -2
- package/src/ref.mjs +4 -17
- package/src/tag.mjs +3 -3
package/README.md
CHANGED
|
@@ -2,12 +2,12 @@
|
|
|
2
2
|
[](https://opensource.org/licenses/BSD-3-Clause)
|
|
3
3
|
[](https://bundlephobia.com/result?p=repository-provider)
|
|
4
4
|
[](https://npmjs.org/package/repository-provider)
|
|
5
|
-
[](https://github.com/repository-provider/repository-provider/issues)
|
|
6
|
+
[](https://actions-badge.atrox.dev/repository-provider/repository-provider/goto)
|
|
7
7
|
[](https://github.com/prettier/prettier)
|
|
8
8
|
[](http://commitizen.github.io/cz-cli/)
|
|
9
|
-
[](https://snyk.io/test/github/repository-provider/repository-provider)
|
|
10
|
+
[](https://coveralls.io/github/repository-provider/repository-provider)
|
|
11
11
|
|
|
12
12
|
# repository-provider
|
|
13
13
|
|
|
@@ -65,6 +65,8 @@ console.log(await readme.getString());
|
|
|
65
65
|
* [BaseObject](#baseobject)
|
|
66
66
|
* [Parameters](#parameters-7)
|
|
67
67
|
* [update](#update)
|
|
68
|
+
* [toString](#tostring)
|
|
69
|
+
* [isWritable](#iswritable)
|
|
68
70
|
* [equals](#equals)
|
|
69
71
|
* [Parameters](#parameters-8)
|
|
70
72
|
* [provider](#provider)
|
|
@@ -152,6 +154,7 @@ console.log(await readme.getString());
|
|
|
152
154
|
* [Properties](#properties-3)
|
|
153
155
|
* [url](#url-1)
|
|
154
156
|
* [refType](#reftype)
|
|
157
|
+
* [isWritable](#iswritable-1)
|
|
155
158
|
* [isDefault](#isdefault)
|
|
156
159
|
* [delete](#delete)
|
|
157
160
|
* [commit](#commit)
|
|
@@ -195,7 +198,6 @@ console.log(await readme.getString());
|
|
|
195
198
|
* [Parameters](#parameters-46)
|
|
196
199
|
* [displayName](#displayname)
|
|
197
200
|
* [fullName](#fullname-1)
|
|
198
|
-
* [toString](#tostring)
|
|
199
201
|
* [toJSON](#tojson-2)
|
|
200
202
|
* [OwnedObject](#ownedobject)
|
|
201
203
|
* [Parameters](#parameters-47)
|
|
@@ -256,7 +258,6 @@ console.log(await readme.getString());
|
|
|
256
258
|
* [isArchived](#isarchived)
|
|
257
259
|
* [isDisabled](#isdisabled)
|
|
258
260
|
* [isProtected](#isprotected)
|
|
259
|
-
* [isWritable](#iswritable)
|
|
260
261
|
* [attributes](#attributes-1)
|
|
261
262
|
* [isProtected](#isprotected-1)
|
|
262
263
|
* [RepositoryGroup](#repositorygroup-1)
|
|
@@ -345,7 +346,6 @@ console.log(await readme.getString());
|
|
|
345
346
|
* [Tag](#tag-1)
|
|
346
347
|
* [Parameters](#parameters-85)
|
|
347
348
|
* [refType](#reftype-1)
|
|
348
|
-
* [isWritable](#iswritable-1)
|
|
349
349
|
* [asArray](#asarray)
|
|
350
350
|
* [Parameters](#parameters-86)
|
|
351
351
|
* [stripBaseName](#stripbasename)
|
|
@@ -490,6 +490,16 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
490
490
|
|
|
491
491
|
Save object attributes in the backing store.
|
|
492
492
|
|
|
493
|
+
### toString
|
|
494
|
+
|
|
495
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
|
|
496
|
+
|
|
497
|
+
### isWritable
|
|
498
|
+
|
|
499
|
+
By default cannot be written to.
|
|
500
|
+
|
|
501
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
|
|
502
|
+
|
|
493
503
|
### equals
|
|
494
504
|
|
|
495
505
|
Check for equality
|
|
@@ -944,6 +954,10 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
944
954
|
|
|
945
955
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** heades
|
|
946
956
|
|
|
957
|
+
### isWritable
|
|
958
|
+
|
|
959
|
+
Returns **any** true if not [isArchived](isArchived) and [isDisabled](isDisabled) and [isLocked](isLocked)
|
|
960
|
+
|
|
947
961
|
### isDefault
|
|
948
962
|
|
|
949
963
|
Are we the default branch.
|
|
@@ -1174,10 +1188,6 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
1174
1188
|
|
|
1175
1189
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
|
|
1176
1190
|
|
|
1177
|
-
### toString
|
|
1178
|
-
|
|
1179
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
|
|
1180
|
-
|
|
1181
1191
|
### toJSON
|
|
1182
1192
|
|
|
1183
1193
|
Provide name and all defined attributes.
|
|
@@ -1528,10 +1538,6 @@ Forwarded from the repository
|
|
|
1528
1538
|
|
|
1529
1539
|
Returns **any** false
|
|
1530
1540
|
|
|
1531
|
-
### isWritable
|
|
1532
|
-
|
|
1533
|
-
Returns **any** true if not [isArchived](isArchived) and [isDisabled](isDisabled) and [isLocked](isLocked)
|
|
1534
|
-
|
|
1535
1541
|
### attributes
|
|
1536
1542
|
|
|
1537
1543
|
options
|
|
@@ -2012,12 +2018,6 @@ Tag refs
|
|
|
2012
2018
|
|
|
2013
2019
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** tags
|
|
2014
2020
|
|
|
2015
|
-
### isWritable
|
|
2016
|
-
|
|
2017
|
-
Tags cannot be written to.
|
|
2018
|
-
|
|
2019
|
-
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
|
|
2020
|
-
|
|
2021
2021
|
## asArray
|
|
2022
2022
|
|
|
2023
2023
|
Convert scalar into an array.
|
package/package.json
CHANGED
package/src/base-object.mjs
CHANGED
|
@@ -88,6 +88,22 @@ export class BaseObject {
|
|
|
88
88
|
return this.name;
|
|
89
89
|
}
|
|
90
90
|
|
|
91
|
+
/**
|
|
92
|
+
* Beautified name use for human displaying only.
|
|
93
|
+
* @return {string} human readable name
|
|
94
|
+
*/
|
|
95
|
+
get displayName() {
|
|
96
|
+
return this.name;
|
|
97
|
+
}
|
|
98
|
+
|
|
99
|
+
/**
|
|
100
|
+
* Complete name in the hierachy.
|
|
101
|
+
* @return {string}
|
|
102
|
+
*/
|
|
103
|
+
get fullName() {
|
|
104
|
+
return this.name;
|
|
105
|
+
}
|
|
106
|
+
|
|
91
107
|
/**
|
|
92
108
|
* By default cannot be written to.
|
|
93
109
|
* @return {boolean} false
|
package/src/base-provider.mjs
CHANGED
|
@@ -405,14 +405,6 @@ export class BaseProvider extends BaseObject {
|
|
|
405
405
|
return this.constructor.name;
|
|
406
406
|
}
|
|
407
407
|
|
|
408
|
-
/**
|
|
409
|
-
* @return {string} name
|
|
410
|
-
*/
|
|
411
|
-
get fullName()
|
|
412
|
-
{
|
|
413
|
-
return this.name;
|
|
414
|
-
}
|
|
415
|
-
|
|
416
408
|
/**
|
|
417
409
|
* We are our own provider.
|
|
418
410
|
* @return {BaseProvider} this
|
package/src/branch.mjs
CHANGED
|
@@ -16,9 +16,13 @@ import { Commit } from "./commit.mjs";
|
|
|
16
16
|
* @property {string} name
|
|
17
17
|
*/
|
|
18
18
|
export class Branch extends Ref {
|
|
19
|
+
|
|
20
|
+
static get registerInstanceMethodName() {
|
|
21
|
+
return "_addBranch";
|
|
22
|
+
}
|
|
23
|
+
|
|
19
24
|
constructor(repository, name = repository.defaultBranchName, options) {
|
|
20
25
|
super(repository, name, options);
|
|
21
|
-
repository._addBranch(this);
|
|
22
26
|
}
|
|
23
27
|
|
|
24
28
|
/**
|
package/src/named-object.mjs
CHANGED
|
@@ -29,15 +29,6 @@ export class NamedObject extends BaseObject {
|
|
|
29
29
|
this.provider.equals(other.provider)
|
|
30
30
|
);
|
|
31
31
|
}
|
|
32
|
-
|
|
33
|
-
/**
|
|
34
|
-
* Beautified name use for human displaying only.
|
|
35
|
-
* @return {string} human readable name
|
|
36
|
-
*/
|
|
37
|
-
get displayName() {
|
|
38
|
-
return this.name;
|
|
39
|
-
}
|
|
40
|
-
|
|
41
32
|
/**
|
|
42
33
|
* @return {string} name with owner name
|
|
43
34
|
*/
|
package/src/owned-object.mjs
CHANGED
|
@@ -5,9 +5,9 @@ import { NamedObject } from "./named-object.mjs";
|
|
|
5
5
|
*/
|
|
6
6
|
export class OwnedObject extends NamedObject {
|
|
7
7
|
/**
|
|
8
|
-
* Method name to be called to register one instance in the owner.
|
|
8
|
+
* Method name to be called to register one instance in the owner.
|
|
9
9
|
* sample: Application => _addApplication
|
|
10
|
-
* @return {string}
|
|
10
|
+
* @return {string}
|
|
11
11
|
*/
|
|
12
12
|
static get registerInstanceMethodName() {
|
|
13
13
|
return "_add" + this.name;
|
|
@@ -21,4 +21,13 @@ export class OwnedObject extends NamedObject {
|
|
|
21
21
|
|
|
22
22
|
owner[this.constructor.registerInstanceMethodName](this);
|
|
23
23
|
}
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Check for equality.
|
|
27
|
+
* @param {OwnedObject} other
|
|
28
|
+
* @return {boolean} true if receiver and owner are equal
|
|
29
|
+
*/
|
|
30
|
+
equals(other) {
|
|
31
|
+
return super.equals(other) && this.owner.equals(other.owner);
|
|
32
|
+
}
|
|
24
33
|
}
|
package/src/ref.mjs
CHANGED
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import { OwnedObject } from "./owned-object.mjs";
|
|
2
2
|
|
|
3
3
|
/**
|
|
4
4
|
* @typedef {Object} ContentEntry
|
|
@@ -9,7 +9,7 @@ import { NamedObject } from "./named-object.mjs";
|
|
|
9
9
|
/**
|
|
10
10
|
* Base for Branch and Tag
|
|
11
11
|
*/
|
|
12
|
-
export class Ref extends
|
|
12
|
+
export class Ref extends OwnedObject {
|
|
13
13
|
/**
|
|
14
14
|
* options
|
|
15
15
|
*/
|
|
@@ -25,19 +25,6 @@ export class Ref extends NamedObject {
|
|
|
25
25
|
};
|
|
26
26
|
}
|
|
27
27
|
|
|
28
|
-
constructor(repository, name, options) {
|
|
29
|
-
super(name, options, { repository: { value: repository } });
|
|
30
|
-
}
|
|
31
|
-
|
|
32
|
-
/**
|
|
33
|
-
* Check for equality.
|
|
34
|
-
* @param {Ref} other
|
|
35
|
-
* @return {boolean} true if name and repository are equal
|
|
36
|
-
*/
|
|
37
|
-
equals(other) {
|
|
38
|
-
return super.equals(other) && this.repository.equals(other.repository);
|
|
39
|
-
}
|
|
40
|
-
|
|
41
28
|
get refType() {
|
|
42
29
|
return "unknown";
|
|
43
30
|
}
|
|
@@ -102,8 +89,8 @@ export class Ref extends NamedObject {
|
|
|
102
89
|
* @see {@link Repository#owner}
|
|
103
90
|
* @return {string}
|
|
104
91
|
*/
|
|
105
|
-
get
|
|
106
|
-
return this.
|
|
92
|
+
get repository() {
|
|
93
|
+
return this.owner;
|
|
107
94
|
}
|
|
108
95
|
|
|
109
96
|
get slug() {
|
package/src/tag.mjs
CHANGED
|
@@ -4,9 +4,9 @@ import { Ref } from "./ref.mjs";
|
|
|
4
4
|
* Tag refs
|
|
5
5
|
*/
|
|
6
6
|
export class Tag extends Ref {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
7
|
+
|
|
8
|
+
static get registerInstanceMethodName() {
|
|
9
|
+
return "_addTag";
|
|
10
10
|
}
|
|
11
11
|
|
|
12
12
|
/**
|