repository-provider 26.7.4 → 27.0.1
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 +7 -7
- package/package.json +3 -3
- package/src/attribute.mjs +10 -4
- package/src/multi-group-provider.mjs +1 -1
package/README.md
CHANGED
|
@@ -198,13 +198,14 @@ console.log(await readme.getString());
|
|
|
198
198
|
* [equals](#equals-3)
|
|
199
199
|
* [Parameters](#parameters-50)
|
|
200
200
|
* [displayName](#displayname)
|
|
201
|
+
* [fullName](#fullname-1)
|
|
201
202
|
* [toJSON](#tojson-2)
|
|
202
203
|
* [Project](#project)
|
|
203
204
|
* [Parameters](#parameters-51)
|
|
204
205
|
* [PullRequest](#pullrequest)
|
|
205
206
|
* [Parameters](#parameters-52)
|
|
206
207
|
* [Properties](#properties-7)
|
|
207
|
-
* [fullName](#fullname-
|
|
208
|
+
* [fullName](#fullname-2)
|
|
208
209
|
* [url](#url-2)
|
|
209
210
|
* [repository](#repository-1)
|
|
210
211
|
* [provider](#provider-2)
|
|
@@ -246,7 +247,7 @@ console.log(await readme.getString());
|
|
|
246
247
|
* [entry](#entry)
|
|
247
248
|
* [Parameters](#parameters-62)
|
|
248
249
|
* [owner](#owner)
|
|
249
|
-
* [fullName](#fullname-
|
|
250
|
+
* [fullName](#fullname-3)
|
|
250
251
|
* [fullCondensedName](#fullcondensedname)
|
|
251
252
|
* [identifier](#identifier-1)
|
|
252
253
|
* [issuesURL](#issuesurl)
|
|
@@ -261,7 +262,6 @@ console.log(await readme.getString());
|
|
|
261
262
|
* [RepositoryGroup](#repositorygroup-1)
|
|
262
263
|
* [Parameters](#parameters-63)
|
|
263
264
|
* [Properties](#properties-9)
|
|
264
|
-
* [fullName](#fullname-3)
|
|
265
265
|
* [attributeMapping](#attributemapping-1)
|
|
266
266
|
* [type](#type)
|
|
267
267
|
* [url](#url-3)
|
|
@@ -1189,6 +1189,10 @@ Beautified name use for human displaying only.
|
|
|
1189
1189
|
|
|
1190
1190
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable name
|
|
1191
1191
|
|
|
1192
|
+
### fullName
|
|
1193
|
+
|
|
1194
|
+
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
|
|
1195
|
+
|
|
1192
1196
|
### toJSON
|
|
1193
1197
|
|
|
1194
1198
|
Provide name and all defined attributes.
|
|
@@ -1555,10 +1559,6 @@ Abstract repository collection.
|
|
|
1555
1559
|
* `provider` **[BaseProvider](#baseprovider)**
|
|
1556
1560
|
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1557
1561
|
|
|
1558
|
-
### fullName
|
|
1559
|
-
|
|
1560
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
|
|
1561
|
-
|
|
1562
1562
|
### attributeMapping
|
|
1563
1563
|
|
|
1564
1564
|
Map attributes between external and internal representation.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "27.0.1",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -36,9 +36,9 @@
|
|
|
36
36
|
"ava": "^4.0.1",
|
|
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.7",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
|
-
"typescript": "^4.6.0-dev.
|
|
41
|
+
"typescript": "^4.6.0-dev.20220210"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=14.18.3"
|
package/src/attribute.mjs
CHANGED
|
@@ -4,8 +4,11 @@
|
|
|
4
4
|
* @property {string} type
|
|
5
5
|
* @property {boolean} writable
|
|
6
6
|
* @property {boolean} [private] should the value be shown
|
|
7
|
+
* @property {string} [depends] name of an attribute we depend on
|
|
7
8
|
* @property {string} description
|
|
8
9
|
* @property {any} [default] the default value
|
|
10
|
+
* @property {Function} [set] set the value
|
|
11
|
+
* @property {Function} [get] get the value can be used to calculate default values
|
|
9
12
|
* @property {string|string[]} [env] environment variable use to provide the value
|
|
10
13
|
*/
|
|
11
14
|
|
|
@@ -48,8 +51,8 @@ export function definePropertiesFromOptions(
|
|
|
48
51
|
let value = getAttribute(options, name);
|
|
49
52
|
|
|
50
53
|
if (value === undefined) {
|
|
51
|
-
if (attribute.
|
|
52
|
-
value = attribute.
|
|
54
|
+
if (attribute.get) {
|
|
55
|
+
value = attribute.get(attribute, object, properties);
|
|
53
56
|
} else if (
|
|
54
57
|
attribute.default !== undefined &&
|
|
55
58
|
attribute.default !== getAttribute(object, name)
|
|
@@ -115,8 +118,11 @@ export function defaultValues(attributes, object) {
|
|
|
115
118
|
|
|
116
119
|
if (attribute.default !== undefined) {
|
|
117
120
|
a.push([name, attribute.default]);
|
|
118
|
-
} else if (attribute.
|
|
119
|
-
|
|
121
|
+
} else if (attribute.get !== undefined) {
|
|
122
|
+
const value = attribute.get(attribute, object);
|
|
123
|
+
if(value !== undefined) {
|
|
124
|
+
a.push([name, value]);
|
|
125
|
+
}
|
|
120
126
|
}
|
|
121
127
|
|
|
122
128
|
return a;
|
|
@@ -50,7 +50,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
50
50
|
if (rg !== undefined) {
|
|
51
51
|
const r = await rg.repository(repository);
|
|
52
52
|
if (r !== undefined) {
|
|
53
|
-
return r.branch( r.defaultBranchName
|
|
53
|
+
return r.branch( branch || r.defaultBranchName);
|
|
54
54
|
}
|
|
55
55
|
}
|
|
56
56
|
}
|