repository-provider 26.4.1 → 26.4.5
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 +68 -63
- package/package.json +4 -4
- package/src/attribute.mjs +51 -54
- package/src/base-object.mjs +6 -1
- package/src/branch.mjs +2 -11
- package/src/commit.mjs +7 -0
- package/src/multi-group-provider.mjs +8 -4
- package/src/named-object.mjs +1 -1
- package/src/ref.mjs +1 -1
- package/src/util.mjs +1 -1
package/README.md
CHANGED
|
@@ -166,7 +166,6 @@ console.log(await readme.getString());
|
|
|
166
166
|
* [Parameters](#parameters-35)
|
|
167
167
|
* [removeEntries](#removeentries)
|
|
168
168
|
* [Parameters](#parameters-36)
|
|
169
|
-
* [entryClass](#entryclass-2)
|
|
170
169
|
* [createPullRequest](#createpullrequest)
|
|
171
170
|
* [Parameters](#parameters-37)
|
|
172
171
|
* [createBranch](#createbranch)
|
|
@@ -185,35 +184,37 @@ console.log(await readme.getString());
|
|
|
185
184
|
* [Parameters](#parameters-43)
|
|
186
185
|
* [repository](#repository)
|
|
187
186
|
* [Parameters](#parameters-44)
|
|
188
|
-
* [
|
|
187
|
+
* [branch](#branch-1)
|
|
189
188
|
* [Parameters](#parameters-45)
|
|
190
|
-
* [
|
|
189
|
+
* [repositoryGroup](#repositorygroup)
|
|
191
190
|
* [Parameters](#parameters-46)
|
|
192
|
-
* [
|
|
191
|
+
* [repositoryGroups](#repositorygroups)
|
|
193
192
|
* [Parameters](#parameters-47)
|
|
194
|
-
* [
|
|
193
|
+
* [createRepositoryGroup](#createrepositorygroup)
|
|
195
194
|
* [Parameters](#parameters-48)
|
|
195
|
+
* [addRepositoryGroup](#addrepositorygroup)
|
|
196
|
+
* [Parameters](#parameters-49)
|
|
196
197
|
* [NamedObject](#namedobject)
|
|
197
|
-
* [Parameters](#parameters-
|
|
198
|
+
* [Parameters](#parameters-50)
|
|
198
199
|
* [Properties](#properties-7)
|
|
199
200
|
* [equals](#equals-3)
|
|
200
|
-
* [Parameters](#parameters-
|
|
201
|
+
* [Parameters](#parameters-51)
|
|
201
202
|
* [displayName](#displayname)
|
|
202
203
|
* [toJSON](#tojson-2)
|
|
203
204
|
* [Project](#project)
|
|
204
|
-
* [Parameters](#parameters-51)
|
|
205
|
-
* [PullRequest](#pullrequest)
|
|
206
205
|
* [Parameters](#parameters-52)
|
|
206
|
+
* [PullRequest](#pullrequest)
|
|
207
|
+
* [Parameters](#parameters-53)
|
|
207
208
|
* [Properties](#properties-8)
|
|
208
209
|
* [fullName](#fullname)
|
|
209
210
|
* [url](#url-2)
|
|
210
211
|
* [repository](#repository-1)
|
|
211
212
|
* [provider](#provider-2)
|
|
212
213
|
* [equals](#equals-4)
|
|
213
|
-
* [Parameters](#parameters-
|
|
214
|
+
* [Parameters](#parameters-54)
|
|
214
215
|
* [delete](#delete-1)
|
|
215
216
|
* [merge](#merge)
|
|
216
|
-
* [Parameters](#parameters-
|
|
217
|
+
* [Parameters](#parameters-55)
|
|
217
218
|
* [decline](#decline)
|
|
218
219
|
* [reviews](#reviews)
|
|
219
220
|
* [identifier](#identifier)
|
|
@@ -221,9 +222,9 @@ console.log(await readme.getString());
|
|
|
221
222
|
* [defaultListStates](#defaultliststates)
|
|
222
223
|
* [validMergeMethods](#validmergemethods)
|
|
223
224
|
* [list](#list-1)
|
|
224
|
-
* [Parameters](#parameters-55)
|
|
225
|
-
* [open](#open)
|
|
226
225
|
* [Parameters](#parameters-56)
|
|
226
|
+
* [open](#open)
|
|
227
|
+
* [Parameters](#parameters-57)
|
|
227
228
|
* [title](#title)
|
|
228
229
|
* [body](#body)
|
|
229
230
|
* [state](#state)
|
|
@@ -233,19 +234,19 @@ console.log(await readme.getString());
|
|
|
233
234
|
* [ContentEntry](#contententry)
|
|
234
235
|
* [Properties](#properties-9)
|
|
235
236
|
* [Ref](#ref)
|
|
236
|
-
* [Parameters](#parameters-
|
|
237
|
+
* [Parameters](#parameters-58)
|
|
237
238
|
* [equals](#equals-5)
|
|
238
|
-
* [Parameters](#parameters-
|
|
239
|
+
* [Parameters](#parameters-59)
|
|
239
240
|
* [ref](#ref-1)
|
|
240
241
|
* [refId](#refid)
|
|
241
|
-
* [Parameters](#parameters-59)
|
|
242
|
-
* [entries](#entries)
|
|
243
242
|
* [Parameters](#parameters-60)
|
|
243
|
+
* [entries](#entries)
|
|
244
|
+
* [Parameters](#parameters-61)
|
|
244
245
|
* [asyncIterator](#asynciterator)
|
|
245
246
|
* [maybeEntry](#maybeentry)
|
|
246
|
-
* [Parameters](#parameters-61)
|
|
247
|
-
* [entry](#entry)
|
|
248
247
|
* [Parameters](#parameters-62)
|
|
248
|
+
* [entry](#entry)
|
|
249
|
+
* [Parameters](#parameters-63)
|
|
249
250
|
* [owner](#owner)
|
|
250
251
|
* [fullName](#fullname-1)
|
|
251
252
|
* [fullCondensedName](#fullcondensedname)
|
|
@@ -260,28 +261,28 @@ console.log(await readme.getString());
|
|
|
260
261
|
* [attributes](#attributes-1)
|
|
261
262
|
* [isProtected](#isprotected-1)
|
|
262
263
|
* [RepositoryGroup](#repositorygroup-1)
|
|
263
|
-
* [Parameters](#parameters-
|
|
264
|
+
* [Parameters](#parameters-64)
|
|
264
265
|
* [Properties](#properties-10)
|
|
265
266
|
* [attributeMapping](#attributemapping-1)
|
|
266
267
|
* [type](#type)
|
|
267
268
|
* [url](#url-3)
|
|
268
269
|
* [RepositoryOwner](#repositoryowner)
|
|
269
|
-
* [Parameters](#parameters-64)
|
|
270
|
-
* [Repository](#repository-2)
|
|
271
270
|
* [Parameters](#parameters-65)
|
|
271
|
+
* [Repository](#repository-2)
|
|
272
|
+
* [Parameters](#parameters-66)
|
|
272
273
|
* [Properties](#properties-11)
|
|
273
274
|
* [fullName](#fullname-2)
|
|
274
275
|
* [slug](#slug)
|
|
275
276
|
* [provider](#provider-3)
|
|
276
277
|
* [identifier](#identifier-2)
|
|
277
278
|
* [equals](#equals-6)
|
|
278
|
-
* [Parameters](#parameters-66)
|
|
279
|
-
* [entry](#entry-1)
|
|
280
279
|
* [Parameters](#parameters-67)
|
|
281
|
-
* [
|
|
280
|
+
* [entry](#entry-1)
|
|
282
281
|
* [Parameters](#parameters-68)
|
|
283
|
-
* [
|
|
282
|
+
* [entries](#entries-1)
|
|
284
283
|
* [Parameters](#parameters-69)
|
|
284
|
+
* [maybeEntry](#maybeentry-1)
|
|
285
|
+
* [Parameters](#parameters-70)
|
|
285
286
|
* [urls](#urls)
|
|
286
287
|
* [url](#url-4)
|
|
287
288
|
* [cloneURL](#cloneurl)
|
|
@@ -293,42 +294,42 @@ console.log(await readme.getString());
|
|
|
293
294
|
* [isDisabled](#isdisabled-1)
|
|
294
295
|
* [isTemplate](#istemplate)
|
|
295
296
|
* [defaultBranch](#defaultbranch)
|
|
296
|
-
* [branch](#branch-
|
|
297
|
-
* [Parameters](#parameters-70)
|
|
298
|
-
* [branches](#branches-1)
|
|
297
|
+
* [branch](#branch-2)
|
|
299
298
|
* [Parameters](#parameters-71)
|
|
300
|
-
* [
|
|
299
|
+
* [branches](#branches-1)
|
|
301
300
|
* [Parameters](#parameters-72)
|
|
302
|
-
* [
|
|
301
|
+
* [createBranch](#createbranch-1)
|
|
303
302
|
* [Parameters](#parameters-73)
|
|
304
|
-
* [
|
|
303
|
+
* [addBranch](#addbranch)
|
|
305
304
|
* [Parameters](#parameters-74)
|
|
306
|
-
* [
|
|
305
|
+
* [deleteBranch](#deletebranch)
|
|
307
306
|
* [Parameters](#parameters-75)
|
|
308
|
-
* [
|
|
307
|
+
* [tag](#tag)
|
|
309
308
|
* [Parameters](#parameters-76)
|
|
310
|
-
* [
|
|
309
|
+
* [tags](#tags-1)
|
|
311
310
|
* [Parameters](#parameters-77)
|
|
311
|
+
* [addTag](#addtag)
|
|
312
|
+
* [Parameters](#parameters-78)
|
|
312
313
|
* [delete](#delete-2)
|
|
313
314
|
* [createPullRequest](#createpullrequest-1)
|
|
314
|
-
* [Parameters](#parameters-78)
|
|
315
|
-
* [addPullRequest](#addpullrequest)
|
|
316
315
|
* [Parameters](#parameters-79)
|
|
316
|
+
* [addPullRequest](#addpullrequest)
|
|
317
|
+
* [Parameters](#parameters-80)
|
|
317
318
|
* [pullRequests](#pullrequests-1)
|
|
318
319
|
* [pullRequest](#pullrequest-1)
|
|
319
|
-
* [Parameters](#parameters-80)
|
|
320
|
-
* [deletePullRequest](#deletepullrequest)
|
|
321
320
|
* [Parameters](#parameters-81)
|
|
322
|
-
* [
|
|
321
|
+
* [deletePullRequest](#deletepullrequest)
|
|
323
322
|
* [Parameters](#parameters-82)
|
|
324
|
-
* [
|
|
323
|
+
* [addHook](#addhook)
|
|
325
324
|
* [Parameters](#parameters-83)
|
|
325
|
+
* [createHook](#createhook)
|
|
326
|
+
* [Parameters](#parameters-84)
|
|
326
327
|
* [hooks](#hooks-1)
|
|
327
328
|
* [hook](#hook-1)
|
|
328
|
-
* [Parameters](#parameters-
|
|
329
|
+
* [Parameters](#parameters-85)
|
|
329
330
|
* [type](#type-1)
|
|
330
331
|
* [refId](#refid-1)
|
|
331
|
-
* [Parameters](#parameters-
|
|
332
|
+
* [Parameters](#parameters-86)
|
|
332
333
|
* [toJSON](#tojson-3)
|
|
333
334
|
* [attributes](#attributes-2)
|
|
334
335
|
* [defaultBranchName](#defaultbranchname)
|
|
@@ -337,23 +338,23 @@ console.log(await readme.getString());
|
|
|
337
338
|
* [Review](#review)
|
|
338
339
|
* [SingleGroupProvider](#singlegroupprovider)
|
|
339
340
|
* [repository](#repository-3)
|
|
340
|
-
* [Parameters](#parameters-86)
|
|
341
|
-
* [repositoryGroup](#repositorygroup-2)
|
|
342
341
|
* [Parameters](#parameters-87)
|
|
343
|
-
* [
|
|
342
|
+
* [repositoryGroup](#repositorygroup-2)
|
|
344
343
|
* [Parameters](#parameters-88)
|
|
344
|
+
* [repositoryGroups](#repositorygroups-1)
|
|
345
|
+
* [Parameters](#parameters-89)
|
|
345
346
|
* [Tag](#tag-1)
|
|
346
|
-
* [Parameters](#parameters-
|
|
347
|
+
* [Parameters](#parameters-90)
|
|
347
348
|
* [refType](#reftype-1)
|
|
348
349
|
* [isWritable](#iswritable-1)
|
|
349
350
|
* [asArray](#asarray)
|
|
350
|
-
* [Parameters](#parameters-90)
|
|
351
|
-
* [stripBaseName](#stripbasename)
|
|
352
351
|
* [Parameters](#parameters-91)
|
|
353
|
-
* [
|
|
352
|
+
* [stripBaseName](#stripbasename)
|
|
354
353
|
* [Parameters](#parameters-92)
|
|
355
|
-
* [
|
|
354
|
+
* [stripBaseNames](#stripbasenames)
|
|
356
355
|
* [Parameters](#parameters-93)
|
|
356
|
+
* [generateBranchName](#generatebranchname)
|
|
357
|
+
* [Parameters](#parameters-94)
|
|
357
358
|
|
|
358
359
|
## Application
|
|
359
360
|
|
|
@@ -403,7 +404,7 @@ Object.definedProperties(new aClass(),{ with_default: { value: 77 }})
|
|
|
403
404
|
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** target object
|
|
404
405
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as passed to object constructor (optional, default `{}`)
|
|
405
406
|
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object properties (optional, default `{}`)
|
|
406
|
-
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `object.constructor.attributes`)
|
|
407
|
+
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `object.constructor.attributes||[]`)
|
|
407
408
|
|
|
408
409
|
## defaultValues
|
|
409
410
|
|
|
@@ -484,8 +485,8 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
484
485
|
|
|
485
486
|
### Parameters
|
|
486
487
|
|
|
487
|
-
* `options` **
|
|
488
|
-
* `additionalProperties` **
|
|
488
|
+
* `options` **any**
|
|
489
|
+
* `additionalProperties` **any**
|
|
489
490
|
|
|
490
491
|
### update
|
|
491
492
|
|
|
@@ -967,7 +968,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
967
968
|
|
|
968
969
|
Are we the default branch.
|
|
969
970
|
|
|
970
|
-
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if name
|
|
971
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if name matches the repository default branch
|
|
971
972
|
|
|
972
973
|
### delete
|
|
973
974
|
|
|
@@ -1014,12 +1015,6 @@ Remove entries form the branch.
|
|
|
1014
1015
|
|
|
1015
1016
|
* `entries` **AsyncIterator<[ContentEntry](#contententry)>**
|
|
1016
1017
|
|
|
1017
|
-
### entryClass
|
|
1018
|
-
|
|
1019
|
-
By default we use the providers implementation.
|
|
1020
|
-
|
|
1021
|
-
Returns **Class** as defined in the repository
|
|
1022
|
-
|
|
1023
1018
|
### createPullRequest
|
|
1024
1019
|
|
|
1025
1020
|
Create a pull request.
|
|
@@ -1116,6 +1111,16 @@ Lookup a repository in the provider and all of its repository groups.
|
|
|
1116
1111
|
|
|
1117
1112
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Repository](#repository)>**
|
|
1118
1113
|
|
|
1114
|
+
### branch
|
|
1115
|
+
|
|
1116
|
+
Lookup a branch.
|
|
1117
|
+
|
|
1118
|
+
#### Parameters
|
|
1119
|
+
|
|
1120
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of the branch
|
|
1121
|
+
|
|
1122
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Branch](#branch)>**
|
|
1123
|
+
|
|
1119
1124
|
### repositoryGroup
|
|
1120
1125
|
|
|
1121
1126
|
Lookup a repository group.
|
|
@@ -1187,7 +1192,7 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
1187
1192
|
|
|
1188
1193
|
### displayName
|
|
1189
1194
|
|
|
1190
|
-
|
|
1195
|
+
Beautified name use for human displaying only.
|
|
1191
1196
|
|
|
1192
1197
|
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** human readable name
|
|
1193
1198
|
|
|
@@ -2043,7 +2048,7 @@ Loops over names and executes stripBaseName.
|
|
|
2043
2048
|
* `repositoryBases` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** all possible bases
|
|
2044
2049
|
* `whenFound` **[Function](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Statements/function)?** to be called with the found base name
|
|
2045
2050
|
|
|
2046
|
-
Returns **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
2051
|
+
Returns **([Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)> | [undefined](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/undefined))** names without base
|
|
2047
2052
|
|
|
2048
2053
|
## generateBranchName
|
|
2049
2054
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "26.4.
|
|
3
|
+
"version": "26.4.5",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -30,15 +30,15 @@
|
|
|
30
30
|
"lint:tsc": "tsc --allowJs --checkJs --noEmit -module nodenext -t es2022 ./src/*.mjs"
|
|
31
31
|
},
|
|
32
32
|
"dependencies": {
|
|
33
|
-
"matching-iterator": "^2.0.
|
|
33
|
+
"matching-iterator": "^2.0.2"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
36
|
"ava": "^4.0.1",
|
|
37
37
|
"c8": "^7.11.0",
|
|
38
38
|
"documentation": "^13.2.5",
|
|
39
|
-
"repository-provider-test-support": "^1.
|
|
39
|
+
"repository-provider-test-support": "^1.11.1",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
|
-
"typescript": "^4.6.0-dev.
|
|
41
|
+
"typescript": "^4.6.0-dev.20220201"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=14.18.3"
|
package/src/attribute.mjs
CHANGED
|
@@ -34,69 +34,67 @@ export function definePropertiesFromOptions(
|
|
|
34
34
|
object,
|
|
35
35
|
options = {},
|
|
36
36
|
properties = {},
|
|
37
|
-
attributes = object.constructor.attributes
|
|
37
|
+
attributes = object.constructor.attributes || []
|
|
38
38
|
) {
|
|
39
39
|
const applyLater = {};
|
|
40
40
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
if (
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
value = attribute.default;
|
|
56
|
-
}
|
|
41
|
+
Object.entries(attributes).forEach(([name, attribute]) => {
|
|
42
|
+
const path = name.split(/\./);
|
|
43
|
+
const first = path.shift();
|
|
44
|
+
const property = properties[first];
|
|
45
|
+
|
|
46
|
+
let value = options[name];
|
|
47
|
+
if (value === undefined) {
|
|
48
|
+
if (attribute.getDefault) {
|
|
49
|
+
value = attribute.getDefault(attribute, object);
|
|
50
|
+
} else if (
|
|
51
|
+
attribute.default !== undefined &&
|
|
52
|
+
attribute.default !== getAttribute(object, name)
|
|
53
|
+
) {
|
|
54
|
+
value = attribute.default;
|
|
57
55
|
}
|
|
56
|
+
}
|
|
58
57
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
58
|
+
if (attribute.set) {
|
|
59
|
+
value = attribute.set(value);
|
|
60
|
+
} else {
|
|
61
|
+
switch (attribute.type) {
|
|
62
|
+
case "boolean":
|
|
63
|
+
if (value !== undefined) {
|
|
64
|
+
value =
|
|
65
|
+
value === 0 || value === "0" || value === false ? false : true;
|
|
66
|
+
}
|
|
67
|
+
break;
|
|
70
68
|
}
|
|
69
|
+
}
|
|
71
70
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} else {
|
|
77
|
-
const slice = {};
|
|
78
|
-
setAttribute(slice, remaining, value);
|
|
79
|
-
properties[first] = { configurable: true, value: slice };
|
|
80
|
-
}
|
|
71
|
+
if (path.length) {
|
|
72
|
+
const remaining = path.join(".");
|
|
73
|
+
if (property) {
|
|
74
|
+
setAttribute(property.value, remaining, value);
|
|
81
75
|
} else {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
76
|
+
const slice = {};
|
|
77
|
+
setAttribute(slice, remaining, value);
|
|
78
|
+
properties[first] = { configurable: true, value: slice };
|
|
79
|
+
}
|
|
80
|
+
} else {
|
|
81
|
+
if (value !== undefined) {
|
|
82
|
+
const op = Object.getOwnPropertyDescriptor(
|
|
83
|
+
object.constructor.prototype,
|
|
84
|
+
first
|
|
85
|
+
);
|
|
86
|
+
|
|
87
|
+
if ((op && op.set) || (property && property.set)) {
|
|
88
|
+
applyLater[first] = value;
|
|
89
|
+
} else {
|
|
90
|
+
properties[first] = Object.assign(
|
|
91
|
+
{ value, writable: attribute.writable },
|
|
92
|
+
property
|
|
86
93
|
);
|
|
87
|
-
|
|
88
|
-
if ((op && op.set) || (property && property.set)) {
|
|
89
|
-
applyLater[first] = value;
|
|
90
|
-
} else {
|
|
91
|
-
properties[first] = Object.assign(
|
|
92
|
-
{ value, writable: attribute.writable },
|
|
93
|
-
property
|
|
94
|
-
);
|
|
95
|
-
}
|
|
96
94
|
}
|
|
97
95
|
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
96
|
+
}
|
|
97
|
+
});
|
|
100
98
|
|
|
101
99
|
Object.defineProperties(object, properties);
|
|
102
100
|
Object.assign(object, applyLater);
|
|
@@ -114,8 +112,7 @@ export function defaultValues(attributes, object) {
|
|
|
114
112
|
|
|
115
113
|
if (attribute.default !== undefined) {
|
|
116
114
|
a.push([name, attribute.default]);
|
|
117
|
-
}
|
|
118
|
-
else if (attribute.getDefault !== undefined) {
|
|
115
|
+
} else if (attribute.getDefault !== undefined) {
|
|
119
116
|
a.push([name, attribute.getDefault(attribute, object)]);
|
|
120
117
|
}
|
|
121
118
|
|
package/src/base-object.mjs
CHANGED
|
@@ -63,6 +63,11 @@ export class BaseObject {
|
|
|
63
63
|
return {};
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* Creates an instance of BaseObject.
|
|
68
|
+
* @param {*} options
|
|
69
|
+
* @param {*} additionalProperties
|
|
70
|
+
*/
|
|
66
71
|
constructor(options, additionalProperties) {
|
|
67
72
|
definePropertiesFromOptions(
|
|
68
73
|
this,
|
|
@@ -161,7 +166,7 @@ export class BaseObject {
|
|
|
161
166
|
* By default we use the owners implementation.
|
|
162
167
|
* @return {Class} as defined in the owner
|
|
163
168
|
*/
|
|
164
|
-
|
|
169
|
+
get hookClass() {
|
|
165
170
|
return this.owner.hookClass;
|
|
166
171
|
}
|
|
167
172
|
}
|
package/src/branch.mjs
CHANGED
|
@@ -1,17 +1,8 @@
|
|
|
1
1
|
import { Ref } from "./ref.mjs";
|
|
2
2
|
import { PullRequest } from "./pull-request.mjs";
|
|
3
3
|
import { Repository } from "./repository.mjs";
|
|
4
|
+
import { Commit } from "./commit.mjs";
|
|
4
5
|
|
|
5
|
-
/**
|
|
6
|
-
* @typedef {Object} Commit
|
|
7
|
-
* @property {string} message
|
|
8
|
-
* @property {ContentEntry[]} updates
|
|
9
|
-
*/
|
|
10
|
-
|
|
11
|
-
/**
|
|
12
|
-
* @typedef {Object} CommitResult
|
|
13
|
-
* @property {string} ref
|
|
14
|
-
*/
|
|
15
6
|
|
|
16
7
|
/**
|
|
17
8
|
* Abstract branch.
|
|
@@ -49,7 +40,7 @@ export class Branch extends Ref {
|
|
|
49
40
|
|
|
50
41
|
/**
|
|
51
42
|
* Are we the default branch.
|
|
52
|
-
* @return {boolean} true if name
|
|
43
|
+
* @return {boolean} true if name matches the repository default branch
|
|
53
44
|
*/
|
|
54
45
|
get isDefault() {
|
|
55
46
|
return this.name === this.repository.defaultBranchName;
|
package/src/commit.mjs
CHANGED
|
@@ -2,6 +2,7 @@ import { matcher } from "matching-iterator";
|
|
|
2
2
|
import { BaseProvider } from "./base-provider.mjs";
|
|
3
3
|
import { stripBaseNames } from "./util.mjs";
|
|
4
4
|
import { Repository } from "./repository.mjs";
|
|
5
|
+
import { Branch } from "./branch.mjs";
|
|
5
6
|
import { RepositoryGroup } from "./repository-group.mjs";
|
|
6
7
|
|
|
7
8
|
/**
|
|
@@ -34,6 +35,11 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
34
35
|
}
|
|
35
36
|
}
|
|
36
37
|
|
|
38
|
+
/**
|
|
39
|
+
* Lookup a branch.
|
|
40
|
+
* @param {string} name of the branch
|
|
41
|
+
* @return {Promise<Branch>}
|
|
42
|
+
*/
|
|
37
43
|
async branch(name) {
|
|
38
44
|
const { base, group, repository, branch } = this.parseName(name);
|
|
39
45
|
|
|
@@ -44,9 +50,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
44
50
|
if (rg !== undefined) {
|
|
45
51
|
const r = await rg.repository(repository);
|
|
46
52
|
if (r !== undefined) {
|
|
47
|
-
return r.branch(
|
|
48
|
-
branch === undefined ? r.defaultBranchName : branch
|
|
49
|
-
);
|
|
53
|
+
return r.branch( r.defaultBranchName || branch);
|
|
50
54
|
}
|
|
51
55
|
}
|
|
52
56
|
}
|
|
@@ -78,7 +82,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
78
82
|
|
|
79
83
|
yield* matcher(
|
|
80
84
|
this._repositoryGroups.values(),
|
|
81
|
-
stripBaseNames(patterns,this.provider.repositoryBases),
|
|
85
|
+
stripBaseNames(patterns, this.provider.repositoryBases),
|
|
82
86
|
{
|
|
83
87
|
caseSensitive: this.areGroupNamesCaseSensitive,
|
|
84
88
|
name: "name"
|
package/src/named-object.mjs
CHANGED
package/src/ref.mjs
CHANGED
|
@@ -61,7 +61,7 @@ export class Ref extends NamedObject {
|
|
|
61
61
|
|
|
62
62
|
/**
|
|
63
63
|
* List entries of the branch.
|
|
64
|
-
* @param {string[]} matchingPatterns
|
|
64
|
+
* @param {string[]} [matchingPatterns]
|
|
65
65
|
* @return {AsyncIterator<ContentEntry>} all matching entries in the branch
|
|
66
66
|
*/
|
|
67
67
|
async *entries(matchingPatterns) {}
|
package/src/util.mjs
CHANGED
|
@@ -42,7 +42,7 @@ export function stripBaseName(name, repositoryBases, whenFound) {
|
|
|
42
42
|
* @param {*} repositoryBases
|
|
43
43
|
* @param {string[]} repositoryBases all possible bases
|
|
44
44
|
* @param {Function} [whenFound] to be called with the found base name
|
|
45
|
-
* @return {string[]} names without base
|
|
45
|
+
* @return {string[]|undefined} names without base
|
|
46
46
|
*/
|
|
47
47
|
export function stripBaseNames(names, repositoryBases, whenFound) {
|
|
48
48
|
return names === undefined
|