repository-provider 26.4.2 → 26.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/README.md +104 -103
- package/package.json +4 -4
- package/src/attribute.mjs +58 -55
- package/src/base-object.mjs +2 -2
- package/src/base-provider.mjs +8 -5
- package/src/branch.mjs +1 -10
- package/src/commit.mjs +7 -0
- package/src/multi-group-provider.mjs +1 -3
- package/src/ref.mjs +3 -1
package/README.md
CHANGED
|
@@ -146,33 +146,31 @@ console.log(await readme.getString());
|
|
|
146
146
|
* [priority](#priority)
|
|
147
147
|
* [name](#name-1)
|
|
148
148
|
* [messageDestination](#messagedestination-1)
|
|
149
|
-
* [Commit](#commit)
|
|
150
|
-
* [Properties](#properties-2)
|
|
151
|
-
* [Commit](#commit-1)
|
|
152
|
-
* [Parameters](#parameters-32)
|
|
153
|
-
* [Properties](#properties-3)
|
|
154
|
-
* [CommitResult](#commitresult)
|
|
155
|
-
* [Properties](#properties-4)
|
|
156
149
|
* [Branch](#branch)
|
|
157
|
-
* [Parameters](#parameters-
|
|
158
|
-
* [Properties](#properties-
|
|
150
|
+
* [Parameters](#parameters-32)
|
|
151
|
+
* [Properties](#properties-2)
|
|
159
152
|
* [url](#url-1)
|
|
160
153
|
* [refType](#reftype)
|
|
161
154
|
* [isDefault](#isdefault)
|
|
162
155
|
* [delete](#delete)
|
|
163
|
-
* [commit](#commit
|
|
164
|
-
* [Parameters](#parameters-
|
|
156
|
+
* [commit](#commit)
|
|
157
|
+
* [Parameters](#parameters-33)
|
|
165
158
|
* [commitIntoPullRequest](#commitintopullrequest)
|
|
166
|
-
* [Parameters](#parameters-
|
|
159
|
+
* [Parameters](#parameters-34)
|
|
167
160
|
* [removeEntries](#removeentries)
|
|
168
|
-
* [Parameters](#parameters-
|
|
161
|
+
* [Parameters](#parameters-35)
|
|
169
162
|
* [createPullRequest](#createpullrequest)
|
|
170
|
-
* [Parameters](#parameters-
|
|
163
|
+
* [Parameters](#parameters-36)
|
|
171
164
|
* [createBranch](#createbranch)
|
|
172
|
-
* [Parameters](#parameters-
|
|
165
|
+
* [Parameters](#parameters-37)
|
|
166
|
+
* [CommitResult](#commitresult)
|
|
167
|
+
* [Properties](#properties-3)
|
|
168
|
+
* [Commit](#commit-1)
|
|
169
|
+
* [Parameters](#parameters-38)
|
|
170
|
+
* [Properties](#properties-4)
|
|
173
171
|
* [Hook](#hook)
|
|
174
172
|
* [Parameters](#parameters-39)
|
|
175
|
-
* [Properties](#properties-
|
|
173
|
+
* [Properties](#properties-5)
|
|
176
174
|
* [equals](#equals-2)
|
|
177
175
|
* [Parameters](#parameters-40)
|
|
178
176
|
* [toJSON](#tojson-1)
|
|
@@ -184,35 +182,37 @@ console.log(await readme.getString());
|
|
|
184
182
|
* [Parameters](#parameters-43)
|
|
185
183
|
* [repository](#repository)
|
|
186
184
|
* [Parameters](#parameters-44)
|
|
187
|
-
* [
|
|
185
|
+
* [branch](#branch-1)
|
|
188
186
|
* [Parameters](#parameters-45)
|
|
189
|
-
* [
|
|
187
|
+
* [repositoryGroup](#repositorygroup)
|
|
190
188
|
* [Parameters](#parameters-46)
|
|
191
|
-
* [
|
|
189
|
+
* [repositoryGroups](#repositorygroups)
|
|
192
190
|
* [Parameters](#parameters-47)
|
|
193
|
-
* [
|
|
191
|
+
* [createRepositoryGroup](#createrepositorygroup)
|
|
194
192
|
* [Parameters](#parameters-48)
|
|
193
|
+
* [addRepositoryGroup](#addrepositorygroup)
|
|
194
|
+
* [Parameters](#parameters-49)
|
|
195
195
|
* [NamedObject](#namedobject)
|
|
196
|
-
* [Parameters](#parameters-
|
|
197
|
-
* [Properties](#properties-
|
|
196
|
+
* [Parameters](#parameters-50)
|
|
197
|
+
* [Properties](#properties-6)
|
|
198
198
|
* [equals](#equals-3)
|
|
199
|
-
* [Parameters](#parameters-
|
|
199
|
+
* [Parameters](#parameters-51)
|
|
200
200
|
* [displayName](#displayname)
|
|
201
201
|
* [toJSON](#tojson-2)
|
|
202
202
|
* [Project](#project)
|
|
203
|
-
* [Parameters](#parameters-51)
|
|
204
|
-
* [PullRequest](#pullrequest)
|
|
205
203
|
* [Parameters](#parameters-52)
|
|
206
|
-
|
|
204
|
+
* [PullRequest](#pullrequest)
|
|
205
|
+
* [Parameters](#parameters-53)
|
|
206
|
+
* [Properties](#properties-7)
|
|
207
207
|
* [fullName](#fullname)
|
|
208
208
|
* [url](#url-2)
|
|
209
209
|
* [repository](#repository-1)
|
|
210
210
|
* [provider](#provider-2)
|
|
211
211
|
* [equals](#equals-4)
|
|
212
|
-
* [Parameters](#parameters-
|
|
212
|
+
* [Parameters](#parameters-54)
|
|
213
213
|
* [delete](#delete-1)
|
|
214
214
|
* [merge](#merge)
|
|
215
|
-
* [Parameters](#parameters-
|
|
215
|
+
* [Parameters](#parameters-55)
|
|
216
216
|
* [decline](#decline)
|
|
217
217
|
* [reviews](#reviews)
|
|
218
218
|
* [identifier](#identifier)
|
|
@@ -220,9 +220,9 @@ console.log(await readme.getString());
|
|
|
220
220
|
* [defaultListStates](#defaultliststates)
|
|
221
221
|
* [validMergeMethods](#validmergemethods)
|
|
222
222
|
* [list](#list-1)
|
|
223
|
-
* [Parameters](#parameters-55)
|
|
224
|
-
* [open](#open)
|
|
225
223
|
* [Parameters](#parameters-56)
|
|
224
|
+
* [open](#open)
|
|
225
|
+
* [Parameters](#parameters-57)
|
|
226
226
|
* [title](#title)
|
|
227
227
|
* [body](#body)
|
|
228
228
|
* [state](#state)
|
|
@@ -230,21 +230,21 @@ console.log(await readme.getString());
|
|
|
230
230
|
* [merged](#merged)
|
|
231
231
|
* [draft](#draft)
|
|
232
232
|
* [ContentEntry](#contententry)
|
|
233
|
-
* [Properties](#properties-
|
|
233
|
+
* [Properties](#properties-8)
|
|
234
234
|
* [Ref](#ref)
|
|
235
|
-
* [Parameters](#parameters-
|
|
235
|
+
* [Parameters](#parameters-58)
|
|
236
236
|
* [equals](#equals-5)
|
|
237
|
-
* [Parameters](#parameters-
|
|
237
|
+
* [Parameters](#parameters-59)
|
|
238
238
|
* [ref](#ref-1)
|
|
239
239
|
* [refId](#refid)
|
|
240
|
-
* [Parameters](#parameters-59)
|
|
241
|
-
* [entries](#entries)
|
|
242
240
|
* [Parameters](#parameters-60)
|
|
241
|
+
* [entries](#entries)
|
|
242
|
+
* [Parameters](#parameters-61)
|
|
243
243
|
* [asyncIterator](#asynciterator)
|
|
244
244
|
* [maybeEntry](#maybeentry)
|
|
245
|
-
* [Parameters](#parameters-61)
|
|
246
|
-
* [entry](#entry)
|
|
247
245
|
* [Parameters](#parameters-62)
|
|
246
|
+
* [entry](#entry)
|
|
247
|
+
* [Parameters](#parameters-63)
|
|
248
248
|
* [owner](#owner)
|
|
249
249
|
* [fullName](#fullname-1)
|
|
250
250
|
* [fullCondensedName](#fullcondensedname)
|
|
@@ -259,28 +259,28 @@ console.log(await readme.getString());
|
|
|
259
259
|
* [attributes](#attributes-1)
|
|
260
260
|
* [isProtected](#isprotected-1)
|
|
261
261
|
* [RepositoryGroup](#repositorygroup-1)
|
|
262
|
-
* [Parameters](#parameters-
|
|
263
|
-
* [Properties](#properties-
|
|
262
|
+
* [Parameters](#parameters-64)
|
|
263
|
+
* [Properties](#properties-9)
|
|
264
264
|
* [attributeMapping](#attributemapping-1)
|
|
265
265
|
* [type](#type)
|
|
266
266
|
* [url](#url-3)
|
|
267
267
|
* [RepositoryOwner](#repositoryowner)
|
|
268
|
-
* [Parameters](#parameters-64)
|
|
269
|
-
* [Repository](#repository-2)
|
|
270
268
|
* [Parameters](#parameters-65)
|
|
271
|
-
|
|
269
|
+
* [Repository](#repository-2)
|
|
270
|
+
* [Parameters](#parameters-66)
|
|
271
|
+
* [Properties](#properties-10)
|
|
272
272
|
* [fullName](#fullname-2)
|
|
273
273
|
* [slug](#slug)
|
|
274
274
|
* [provider](#provider-3)
|
|
275
275
|
* [identifier](#identifier-2)
|
|
276
276
|
* [equals](#equals-6)
|
|
277
|
-
* [Parameters](#parameters-66)
|
|
278
|
-
* [entry](#entry-1)
|
|
279
277
|
* [Parameters](#parameters-67)
|
|
280
|
-
* [
|
|
278
|
+
* [entry](#entry-1)
|
|
281
279
|
* [Parameters](#parameters-68)
|
|
282
|
-
* [
|
|
280
|
+
* [entries](#entries-1)
|
|
283
281
|
* [Parameters](#parameters-69)
|
|
282
|
+
* [maybeEntry](#maybeentry-1)
|
|
283
|
+
* [Parameters](#parameters-70)
|
|
284
284
|
* [urls](#urls)
|
|
285
285
|
* [url](#url-4)
|
|
286
286
|
* [cloneURL](#cloneurl)
|
|
@@ -292,42 +292,42 @@ console.log(await readme.getString());
|
|
|
292
292
|
* [isDisabled](#isdisabled-1)
|
|
293
293
|
* [isTemplate](#istemplate)
|
|
294
294
|
* [defaultBranch](#defaultbranch)
|
|
295
|
-
* [branch](#branch-
|
|
296
|
-
* [Parameters](#parameters-70)
|
|
297
|
-
* [branches](#branches-1)
|
|
295
|
+
* [branch](#branch-2)
|
|
298
296
|
* [Parameters](#parameters-71)
|
|
299
|
-
* [
|
|
297
|
+
* [branches](#branches-1)
|
|
300
298
|
* [Parameters](#parameters-72)
|
|
301
|
-
* [
|
|
299
|
+
* [createBranch](#createbranch-1)
|
|
302
300
|
* [Parameters](#parameters-73)
|
|
303
|
-
* [
|
|
301
|
+
* [addBranch](#addbranch)
|
|
304
302
|
* [Parameters](#parameters-74)
|
|
305
|
-
* [
|
|
303
|
+
* [deleteBranch](#deletebranch)
|
|
306
304
|
* [Parameters](#parameters-75)
|
|
307
|
-
* [
|
|
305
|
+
* [tag](#tag)
|
|
308
306
|
* [Parameters](#parameters-76)
|
|
309
|
-
* [
|
|
307
|
+
* [tags](#tags-1)
|
|
310
308
|
* [Parameters](#parameters-77)
|
|
309
|
+
* [addTag](#addtag)
|
|
310
|
+
* [Parameters](#parameters-78)
|
|
311
311
|
* [delete](#delete-2)
|
|
312
312
|
* [createPullRequest](#createpullrequest-1)
|
|
313
|
-
* [Parameters](#parameters-78)
|
|
314
|
-
* [addPullRequest](#addpullrequest)
|
|
315
313
|
* [Parameters](#parameters-79)
|
|
314
|
+
* [addPullRequest](#addpullrequest)
|
|
315
|
+
* [Parameters](#parameters-80)
|
|
316
316
|
* [pullRequests](#pullrequests-1)
|
|
317
317
|
* [pullRequest](#pullrequest-1)
|
|
318
|
-
* [Parameters](#parameters-80)
|
|
319
|
-
* [deletePullRequest](#deletepullrequest)
|
|
320
318
|
* [Parameters](#parameters-81)
|
|
321
|
-
* [
|
|
319
|
+
* [deletePullRequest](#deletepullrequest)
|
|
322
320
|
* [Parameters](#parameters-82)
|
|
323
|
-
* [
|
|
321
|
+
* [addHook](#addhook)
|
|
324
322
|
* [Parameters](#parameters-83)
|
|
323
|
+
* [createHook](#createhook)
|
|
324
|
+
* [Parameters](#parameters-84)
|
|
325
325
|
* [hooks](#hooks-1)
|
|
326
326
|
* [hook](#hook-1)
|
|
327
|
-
* [Parameters](#parameters-
|
|
327
|
+
* [Parameters](#parameters-85)
|
|
328
328
|
* [type](#type-1)
|
|
329
329
|
* [refId](#refid-1)
|
|
330
|
-
* [Parameters](#parameters-
|
|
330
|
+
* [Parameters](#parameters-86)
|
|
331
331
|
* [toJSON](#tojson-3)
|
|
332
332
|
* [attributes](#attributes-2)
|
|
333
333
|
* [defaultBranchName](#defaultbranchname)
|
|
@@ -336,23 +336,23 @@ console.log(await readme.getString());
|
|
|
336
336
|
* [Review](#review)
|
|
337
337
|
* [SingleGroupProvider](#singlegroupprovider)
|
|
338
338
|
* [repository](#repository-3)
|
|
339
|
-
* [Parameters](#parameters-86)
|
|
340
|
-
* [repositoryGroup](#repositorygroup-2)
|
|
341
339
|
* [Parameters](#parameters-87)
|
|
342
|
-
* [
|
|
340
|
+
* [repositoryGroup](#repositorygroup-2)
|
|
343
341
|
* [Parameters](#parameters-88)
|
|
342
|
+
* [repositoryGroups](#repositorygroups-1)
|
|
343
|
+
* [Parameters](#parameters-89)
|
|
344
344
|
* [Tag](#tag-1)
|
|
345
|
-
* [Parameters](#parameters-
|
|
345
|
+
* [Parameters](#parameters-90)
|
|
346
346
|
* [refType](#reftype-1)
|
|
347
347
|
* [isWritable](#iswritable-1)
|
|
348
348
|
* [asArray](#asarray)
|
|
349
|
-
* [Parameters](#parameters-90)
|
|
350
|
-
* [stripBaseName](#stripbasename)
|
|
351
349
|
* [Parameters](#parameters-91)
|
|
352
|
-
* [
|
|
350
|
+
* [stripBaseName](#stripbasename)
|
|
353
351
|
* [Parameters](#parameters-92)
|
|
354
|
-
* [
|
|
352
|
+
* [stripBaseNames](#stripbasenames)
|
|
355
353
|
* [Parameters](#parameters-93)
|
|
354
|
+
* [generateBranchName](#generatebranchname)
|
|
355
|
+
* [Parameters](#parameters-94)
|
|
356
356
|
|
|
357
357
|
## Application
|
|
358
358
|
|
|
@@ -402,7 +402,7 @@ Object.definedProperties(new aClass(),{ with_default: { value: 77 }})
|
|
|
402
402
|
* `object` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** target object
|
|
403
403
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** as passed to object constructor (optional, default `{}`)
|
|
404
404
|
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object properties (optional, default `{}`)
|
|
405
|
-
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `object.constructor.attributes`)
|
|
405
|
+
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `object.constructor.attributes||[]`)
|
|
406
406
|
|
|
407
407
|
## defaultValues
|
|
408
408
|
|
|
@@ -903,35 +903,6 @@ Name of the provider
|
|
|
903
903
|
|
|
904
904
|
to forward info/warn and error messages to
|
|
905
905
|
|
|
906
|
-
## Commit
|
|
907
|
-
|
|
908
|
-
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
909
|
-
|
|
910
|
-
### Properties
|
|
911
|
-
|
|
912
|
-
* `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
913
|
-
* `updates` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[ContentEntry](#contententry)>**
|
|
914
|
-
|
|
915
|
-
## Commit
|
|
916
|
-
|
|
917
|
-
### Parameters
|
|
918
|
-
|
|
919
|
-
* `repository`
|
|
920
|
-
|
|
921
|
-
### Properties
|
|
922
|
-
|
|
923
|
-
* `repository` **[Repository](#repository)**
|
|
924
|
-
* `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
925
|
-
* `sha` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
926
|
-
|
|
927
|
-
## CommitResult
|
|
928
|
-
|
|
929
|
-
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
930
|
-
|
|
931
|
-
### Properties
|
|
932
|
-
|
|
933
|
-
* `ref` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
934
|
-
|
|
935
906
|
## Branch
|
|
936
907
|
|
|
937
908
|
**Extends Ref**
|
|
@@ -966,7 +937,7 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
966
937
|
|
|
967
938
|
Are we the default branch.
|
|
968
939
|
|
|
969
|
-
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if name
|
|
940
|
+
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if name matches the repository default branch
|
|
970
941
|
|
|
971
942
|
### delete
|
|
972
943
|
|
|
@@ -1036,6 +1007,26 @@ Simply calls Repository.createBranch() with the receiver as source branch
|
|
|
1036
1007
|
|
|
1037
1008
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Branch](#branch)>** newly created branch (or already present old one with the same name)
|
|
1038
1009
|
|
|
1010
|
+
## CommitResult
|
|
1011
|
+
|
|
1012
|
+
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
1013
|
+
|
|
1014
|
+
### Properties
|
|
1015
|
+
|
|
1016
|
+
* `ref` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1017
|
+
|
|
1018
|
+
## Commit
|
|
1019
|
+
|
|
1020
|
+
### Parameters
|
|
1021
|
+
|
|
1022
|
+
* `repository`
|
|
1023
|
+
|
|
1024
|
+
### Properties
|
|
1025
|
+
|
|
1026
|
+
* `repository` **[Repository](#repository)**
|
|
1027
|
+
* `message` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1028
|
+
* `sha` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
|
|
1029
|
+
|
|
1039
1030
|
## Hook
|
|
1040
1031
|
|
|
1041
1032
|
**Extends BaseObject**
|
|
@@ -1109,6 +1100,16 @@ Lookup a repository in the provider and all of its repository groups.
|
|
|
1109
1100
|
|
|
1110
1101
|
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Repository](#repository)>**
|
|
1111
1102
|
|
|
1103
|
+
### branch
|
|
1104
|
+
|
|
1105
|
+
Lookup a branch.
|
|
1106
|
+
|
|
1107
|
+
#### Parameters
|
|
1108
|
+
|
|
1109
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of the branch
|
|
1110
|
+
|
|
1111
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Branch](#branch)>**
|
|
1112
|
+
|
|
1112
1113
|
### repositoryGroup
|
|
1113
1114
|
|
|
1114
1115
|
Lookup a repository group.
|
|
@@ -1424,7 +1425,7 @@ List entries of the branch.
|
|
|
1424
1425
|
|
|
1425
1426
|
#### Parameters
|
|
1426
1427
|
|
|
1427
|
-
* `matchingPatterns` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)
|
|
1428
|
+
* `matchingPatterns` **[Array](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Array)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>?**
|
|
1428
1429
|
|
|
1429
1430
|
Returns **AsyncIterator<[ContentEntry](#contententry)>** all matching entries in the branch
|
|
1430
1431
|
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.5.0",
|
|
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.20220203"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
44
|
"node": ">=14.18.3"
|
package/src/attribute.mjs
CHANGED
|
@@ -3,8 +3,9 @@
|
|
|
3
3
|
*
|
|
4
4
|
* @property {string} type
|
|
5
5
|
* @property {boolean} writable
|
|
6
|
-
* @property {boolean} private
|
|
6
|
+
* @property {boolean} [private] should the value be shown
|
|
7
7
|
* @property {string} description
|
|
8
|
+
* @property {any} [default] the default value
|
|
8
9
|
*/
|
|
9
10
|
|
|
10
11
|
/**
|
|
@@ -34,69 +35,68 @@ export function definePropertiesFromOptions(
|
|
|
34
35
|
object,
|
|
35
36
|
options = {},
|
|
36
37
|
properties = {},
|
|
37
|
-
attributes = object.constructor.attributes
|
|
38
|
+
attributes = object.constructor.attributes || []
|
|
38
39
|
) {
|
|
39
40
|
const applyLater = {};
|
|
40
41
|
|
|
41
|
-
|
|
42
|
-
|
|
43
|
-
|
|
44
|
-
|
|
45
|
-
|
|
46
|
-
|
|
47
|
-
|
|
48
|
-
|
|
49
|
-
|
|
50
|
-
|
|
51
|
-
|
|
52
|
-
|
|
53
|
-
|
|
54
|
-
|
|
55
|
-
|
|
56
|
-
}
|
|
42
|
+
Object.entries(attributes).forEach(([name, attribute]) => {
|
|
43
|
+
const path = name.split(/\./);
|
|
44
|
+
const first = path.shift();
|
|
45
|
+
const property = properties[first];
|
|
46
|
+
|
|
47
|
+
let value = getAttribute(options, name);
|
|
48
|
+
|
|
49
|
+
if (value === undefined) {
|
|
50
|
+
if (attribute.getDefault) {
|
|
51
|
+
value = attribute.getDefault(attribute, object);
|
|
52
|
+
} else if (
|
|
53
|
+
attribute.default !== undefined &&
|
|
54
|
+
attribute.default !== getAttribute(object, name)
|
|
55
|
+
) {
|
|
56
|
+
value = attribute.default;
|
|
57
57
|
}
|
|
58
|
+
}
|
|
58
59
|
|
|
59
|
-
|
|
60
|
-
|
|
61
|
-
|
|
62
|
-
|
|
63
|
-
|
|
64
|
-
|
|
65
|
-
|
|
66
|
-
|
|
67
|
-
|
|
68
|
-
|
|
69
|
-
}
|
|
60
|
+
if (attribute.set) {
|
|
61
|
+
value = attribute.set(value);
|
|
62
|
+
} else {
|
|
63
|
+
switch (attribute.type) {
|
|
64
|
+
case "boolean":
|
|
65
|
+
if (value !== undefined) {
|
|
66
|
+
value =
|
|
67
|
+
value === 0 || value === "0" || value === false ? false : true;
|
|
68
|
+
}
|
|
69
|
+
break;
|
|
70
70
|
}
|
|
71
|
+
}
|
|
71
72
|
|
|
72
|
-
|
|
73
|
-
|
|
74
|
-
|
|
75
|
-
|
|
76
|
-
} else {
|
|
77
|
-
const slice = {};
|
|
78
|
-
setAttribute(slice, remaining, value);
|
|
79
|
-
properties[first] = { configurable: true, value: slice };
|
|
80
|
-
}
|
|
73
|
+
if (path.length) {
|
|
74
|
+
const remaining = path.join(".");
|
|
75
|
+
if (property) {
|
|
76
|
+
setAttribute(property.value, remaining, value);
|
|
81
77
|
} else {
|
|
82
|
-
|
|
83
|
-
|
|
84
|
-
|
|
85
|
-
|
|
78
|
+
const slice = {};
|
|
79
|
+
setAttribute(slice, remaining, value);
|
|
80
|
+
properties[first] = { configurable: true, value: slice };
|
|
81
|
+
}
|
|
82
|
+
} else {
|
|
83
|
+
if (value !== undefined) {
|
|
84
|
+
const op = Object.getOwnPropertyDescriptor(
|
|
85
|
+
object.constructor.prototype,
|
|
86
|
+
first
|
|
87
|
+
);
|
|
88
|
+
|
|
89
|
+
if ((op && op.set) || (property && property.set)) {
|
|
90
|
+
applyLater[first] = value;
|
|
91
|
+
} else {
|
|
92
|
+
properties[first] = Object.assign(
|
|
93
|
+
{ value, writable: attribute.writable },
|
|
94
|
+
property
|
|
86
95
|
);
|
|
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
96
|
}
|
|
97
97
|
}
|
|
98
|
-
}
|
|
99
|
-
}
|
|
98
|
+
}
|
|
99
|
+
});
|
|
100
100
|
|
|
101
101
|
Object.defineProperties(object, properties);
|
|
102
102
|
Object.assign(object, applyLater);
|
|
@@ -114,8 +114,7 @@ export function defaultValues(attributes, object) {
|
|
|
114
114
|
|
|
115
115
|
if (attribute.default !== undefined) {
|
|
116
116
|
a.push([name, attribute.default]);
|
|
117
|
-
}
|
|
118
|
-
else if (attribute.getDefault !== undefined) {
|
|
117
|
+
} else if (attribute.getDefault !== undefined) {
|
|
119
118
|
a.push([name, attribute.getDefault(attribute, object)]);
|
|
120
119
|
}
|
|
121
120
|
|
|
@@ -155,6 +154,10 @@ export function setAttribute(object, name, value) {
|
|
|
155
154
|
export function getAttribute(object, name) {
|
|
156
155
|
let value = object;
|
|
157
156
|
|
|
157
|
+
if(value && value[name] !== undefined) {
|
|
158
|
+
return value[name];
|
|
159
|
+
}
|
|
160
|
+
|
|
158
161
|
for (const p of name.split(/\./)) {
|
|
159
162
|
if (value === undefined) {
|
|
160
163
|
break;
|
package/src/base-object.mjs
CHANGED
|
@@ -65,8 +65,8 @@ export class BaseObject {
|
|
|
65
65
|
|
|
66
66
|
/**
|
|
67
67
|
* Creates an instance of BaseObject.
|
|
68
|
-
* @param {
|
|
69
|
-
* @param {
|
|
68
|
+
* @param {object} options
|
|
69
|
+
* @param {object} additionalProperties
|
|
70
70
|
*/
|
|
71
71
|
constructor(options, additionalProperties) {
|
|
72
72
|
definePropertiesFromOptions(
|
package/src/base-provider.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { Tag } from "./tag.mjs";
|
|
|
8
8
|
import { Hook } from "./hook.mjs";
|
|
9
9
|
import { Project } from "./project.mjs";
|
|
10
10
|
import { Milestone } from "./milestone.mjs";
|
|
11
|
+
import { BaseObject } from "./base-object.mjs";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @typedef {Object} MessageDestination
|
|
@@ -20,7 +21,7 @@ import { Milestone } from "./milestone.mjs";
|
|
|
20
21
|
/**
|
|
21
22
|
* @property {MessageDestination} messageDestination
|
|
22
23
|
*/
|
|
23
|
-
export class BaseProvider {
|
|
24
|
+
export class BaseProvider extends BaseObject {
|
|
24
25
|
/**
|
|
25
26
|
* @return {string} identifier for environment options
|
|
26
27
|
*/
|
|
@@ -87,6 +88,7 @@ export class BaseProvider {
|
|
|
87
88
|
|
|
88
89
|
static get attributes() {
|
|
89
90
|
return {
|
|
91
|
+
...super.attributes,
|
|
90
92
|
/**
|
|
91
93
|
* In case there are several provider able to support a given source which one sould be used ?
|
|
92
94
|
* this defines the order
|
|
@@ -141,10 +143,6 @@ export class BaseProvider {
|
|
|
141
143
|
}
|
|
142
144
|
}
|
|
143
145
|
|
|
144
|
-
constructor(options, properties) {
|
|
145
|
-
definePropertiesFromOptions(this, options, properties);
|
|
146
|
-
}
|
|
147
|
-
|
|
148
146
|
/**
|
|
149
147
|
* @return {boolean} true if other provider is the same as the receiver
|
|
150
148
|
*/
|
|
@@ -401,6 +399,11 @@ export class BaseProvider {
|
|
|
401
399
|
return this.constructor.name;
|
|
402
400
|
}
|
|
403
401
|
|
|
402
|
+
get fullName()
|
|
403
|
+
{
|
|
404
|
+
return this.name;
|
|
405
|
+
}
|
|
406
|
+
|
|
404
407
|
/**
|
|
405
408
|
* We are our own provider.
|
|
406
409
|
* @return {BaseProvider} this
|
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.
|
package/src/commit.mjs
CHANGED
|
@@ -50,9 +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(
|
|
54
|
-
branch === undefined ? r.defaultBranchName : branch
|
|
55
|
-
);
|
|
53
|
+
return r.branch( r.defaultBranchName || branch);
|
|
56
54
|
}
|
|
57
55
|
}
|
|
58
56
|
}
|
package/src/ref.mjs
CHANGED
|
@@ -1,9 +1,11 @@
|
|
|
1
1
|
import { NamedObject } from "./named-object.mjs";
|
|
2
|
+
|
|
2
3
|
/**
|
|
3
4
|
* @typedef {Object} ContentEntry
|
|
4
5
|
* @property {string} name
|
|
5
6
|
*
|
|
6
7
|
*/
|
|
8
|
+
|
|
7
9
|
/**
|
|
8
10
|
* Base for Branch and Tag
|
|
9
11
|
*/
|
|
@@ -59,7 +61,7 @@ export class Ref extends NamedObject {
|
|
|
59
61
|
|
|
60
62
|
/**
|
|
61
63
|
* List entries of the branch.
|
|
62
|
-
* @param {string[]} matchingPatterns
|
|
64
|
+
* @param {string[]} [matchingPatterns]
|
|
63
65
|
* @return {AsyncIterator<ContentEntry>} all matching entries in the branch
|
|
64
66
|
*/
|
|
65
67
|
async *entries(matchingPatterns) {}
|