repository-provider 32.4.9 → 32.5.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/package.json +3 -3
- package/src/base-object.mjs +8 -0
- package/src/base-provider.mjs +5 -4
- package/src/named-object.mjs +2 -4
- package/src/ref.mjs +2 -3
- package/src/repository.mjs +20 -8
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "32.
|
|
3
|
+
"version": "32.5.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -35,10 +35,10 @@
|
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"ava": "^5.1.0",
|
|
38
|
-
"browser-ava": "^1.3.
|
|
38
|
+
"browser-ava": "^1.3.15",
|
|
39
39
|
"c8": "^7.12.0",
|
|
40
40
|
"documentation": "^14.0.1",
|
|
41
|
-
"repository-provider-test-support": "^2.2.
|
|
41
|
+
"repository-provider-test-support": "^2.2.31",
|
|
42
42
|
"semantic-release": "^19.0.5",
|
|
43
43
|
"typescript": "^4.9.4"
|
|
44
44
|
},
|
package/src/base-object.mjs
CHANGED
|
@@ -59,6 +59,14 @@ export class BaseObject {
|
|
|
59
59
|
* @param {object} additionalProperties
|
|
60
60
|
*/
|
|
61
61
|
constructor(options, additionalProperties) {
|
|
62
|
+
this.updateAttributes(options, additionalProperties);
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Takes values from options.
|
|
67
|
+
* @param {object} options
|
|
68
|
+
*/
|
|
69
|
+
updateAttributes(options, additionalProperties) {
|
|
62
70
|
definePropertiesFromOptions(
|
|
63
71
|
this,
|
|
64
72
|
mapAttributes(options, this.constructor.attributeMapping),
|
package/src/base-provider.mjs
CHANGED
|
@@ -14,6 +14,7 @@ import { url_attribute, name_attribute, description_attribute, priority_attribut
|
|
|
14
14
|
* @typedef {Object} MessageDestination
|
|
15
15
|
* Endpoint to deliver log messages to.
|
|
16
16
|
* @property {Function} info
|
|
17
|
+
* @property {Function} debug
|
|
17
18
|
* @property {Function} warn
|
|
18
19
|
* @property {Function} error
|
|
19
20
|
* @property {Function} trace
|
|
@@ -97,10 +98,6 @@ export class BaseProvider extends BaseObject {
|
|
|
97
98
|
|
|
98
99
|
static get attributes() {
|
|
99
100
|
return {
|
|
100
|
-
url: url_attribute,
|
|
101
|
-
description : description_attribute,
|
|
102
|
-
priority: priority_attribute,
|
|
103
|
-
|
|
104
101
|
/**
|
|
105
102
|
* Name of the provider.
|
|
106
103
|
*/
|
|
@@ -109,6 +106,10 @@ export class BaseProvider extends BaseObject {
|
|
|
109
106
|
env: ["{{instanceIdentifier}}NAME"]
|
|
110
107
|
},
|
|
111
108
|
|
|
109
|
+
url: url_attribute,
|
|
110
|
+
description : description_attribute,
|
|
111
|
+
priority: priority_attribute,
|
|
112
|
+
|
|
112
113
|
/**
|
|
113
114
|
* To forward info/warn and error messages to
|
|
114
115
|
*/
|
package/src/named-object.mjs
CHANGED
|
@@ -11,13 +11,11 @@ import { name_attribute, url_attribute, description_attribute, id_attribute } fr
|
|
|
11
11
|
* @property {string} name
|
|
12
12
|
*/
|
|
13
13
|
export class NamedObject extends BaseObject {
|
|
14
|
-
|
|
15
|
-
* options
|
|
16
|
-
*/
|
|
14
|
+
|
|
17
15
|
static get attributes() {
|
|
18
16
|
return {
|
|
19
|
-
name: name_attribute,
|
|
20
17
|
id: id_attribute,
|
|
18
|
+
name: name_attribute,
|
|
21
19
|
description: description_attribute
|
|
22
20
|
};
|
|
23
21
|
}
|
package/src/ref.mjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
2
|
-
import { boolean_attribute } from "./attributes.mjs";
|
|
2
|
+
import { name_attribute, boolean_attribute } from "./attributes.mjs";
|
|
3
3
|
|
|
4
4
|
/**
|
|
5
5
|
* @typedef {Object} ContentEntry
|
|
@@ -16,7 +16,7 @@ export class Ref extends OwnedObject {
|
|
|
16
16
|
*/
|
|
17
17
|
static get attributes() {
|
|
18
18
|
return {
|
|
19
|
-
|
|
19
|
+
name: name_attribute,
|
|
20
20
|
|
|
21
21
|
/**
|
|
22
22
|
* Can the ref be modified.
|
|
@@ -28,7 +28,6 @@ export class Ref extends OwnedObject {
|
|
|
28
28
|
|
|
29
29
|
static get attributeMapping() {
|
|
30
30
|
return {
|
|
31
|
-
...super.attributeMapping,
|
|
32
31
|
protected: "isProtected"
|
|
33
32
|
};
|
|
34
33
|
}
|
package/src/repository.mjs
CHANGED
|
@@ -4,7 +4,13 @@ import { Hook } from "./hook.mjs";
|
|
|
4
4
|
import { Tag } from "./tag.mjs";
|
|
5
5
|
import { Branch } from "./branch.mjs";
|
|
6
6
|
import { PullRequest } from "./pull-request.mjs";
|
|
7
|
-
import {
|
|
7
|
+
import {
|
|
8
|
+
url_attribute,
|
|
9
|
+
size_attribute,
|
|
10
|
+
language_attribute,
|
|
11
|
+
boolean_attribute,
|
|
12
|
+
boolean_read_only_attribute
|
|
13
|
+
} from "./attributes.mjs";
|
|
8
14
|
|
|
9
15
|
/**
|
|
10
16
|
* Abstract repository
|
|
@@ -28,9 +34,8 @@ export class Repository extends OwnedObject {
|
|
|
28
34
|
return "_addRepository";
|
|
29
35
|
}
|
|
30
36
|
|
|
31
|
-
static get deleteMethodName()
|
|
32
|
-
|
|
33
|
-
return "_deleteRepository";
|
|
37
|
+
static get deleteMethodName() {
|
|
38
|
+
return "_deleteRepository";
|
|
34
39
|
}
|
|
35
40
|
|
|
36
41
|
static get collectionName() {
|
|
@@ -256,13 +261,20 @@ export class Repository extends OwnedObject {
|
|
|
256
261
|
* Add a new {@link Branch}.
|
|
257
262
|
* Internal branch creation does not call repository.initialize()
|
|
258
263
|
* @param {string} name of the new branch
|
|
259
|
-
* @param {Object} options
|
|
264
|
+
* @param {Object} options to be passed to the branch
|
|
260
265
|
* @return {Branch} newly created branch
|
|
261
266
|
*/
|
|
262
267
|
addBranch(name, options) {
|
|
263
|
-
|
|
264
|
-
|
|
265
|
-
|
|
268
|
+
const branch = this.#branches.get(name);
|
|
269
|
+
if (branch) {
|
|
270
|
+
if (options) {
|
|
271
|
+
branch.updateAttributes(options);
|
|
272
|
+
}
|
|
273
|
+
|
|
274
|
+
return branch;
|
|
275
|
+
}
|
|
276
|
+
|
|
277
|
+
return new this.branchClass(this, name, options);
|
|
266
278
|
}
|
|
267
279
|
|
|
268
280
|
_addBranch(branch) {
|