repository-provider 26.1.1 → 26.3.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/LICENSE +1 -1
- package/README.md +124 -98
- package/package.json +6 -6
- package/src/attribute.mjs +16 -14
- package/src/base-object.mjs +29 -0
- package/src/base-provider.mjs +44 -31
- package/src/branch.mjs +1 -0
- package/src/hook.mjs +5 -12
- package/src/named-object.mjs +0 -7
- package/src/ref.mjs +0 -12
- package/src/repository-group.mjs +13 -12
- package/src/repository.mjs +42 -30
package/LICENSE
CHANGED
package/README.md
CHANGED
|
@@ -51,20 +51,22 @@ console.log(await readme.getString());
|
|
|
51
51
|
* [Properties](#properties)
|
|
52
52
|
* [definePropertiesFromOptions](#definepropertiesfromoptions)
|
|
53
53
|
* [Parameters](#parameters-1)
|
|
54
|
-
* [
|
|
54
|
+
* [defaultValues](#defaultvalues)
|
|
55
55
|
* [Parameters](#parameters-2)
|
|
56
|
-
* [
|
|
56
|
+
* [setAttribute](#setattribute)
|
|
57
57
|
* [Parameters](#parameters-3)
|
|
58
|
-
* [
|
|
58
|
+
* [getAttribute](#getattribute)
|
|
59
59
|
* [Parameters](#parameters-4)
|
|
60
|
-
* [
|
|
60
|
+
* [optionJSON](#optionjson)
|
|
61
61
|
* [Parameters](#parameters-5)
|
|
62
|
-
* [
|
|
62
|
+
* [mapAttributes](#mapattributes)
|
|
63
63
|
* [Parameters](#parameters-6)
|
|
64
|
-
* [
|
|
64
|
+
* [mapAttributesInverse](#mapattributesinverse)
|
|
65
65
|
* [Parameters](#parameters-7)
|
|
66
|
+
* [BaseObject](#baseobject)
|
|
67
|
+
* [Parameters](#parameters-8)
|
|
66
68
|
* [equals](#equals)
|
|
67
|
-
* [Parameters](#parameters-
|
|
69
|
+
* [Parameters](#parameters-9)
|
|
68
70
|
* [attributes](#attributes)
|
|
69
71
|
* [writableAttributes](#writableattributes)
|
|
70
72
|
* [attributeMapping](#attributemapping)
|
|
@@ -74,129 +76,131 @@ console.log(await readme.getString());
|
|
|
74
76
|
* [avatarURL](#avatarurl)
|
|
75
77
|
* [homePageURL](#homepageurl)
|
|
76
78
|
* [MessageDestination](#messagedestination)
|
|
77
|
-
* [Parameters](#parameters-9)
|
|
78
|
-
* [BaseProvider](#baseprovider)
|
|
79
79
|
* [Parameters](#parameters-10)
|
|
80
|
+
* [BaseProvider](#baseprovider)
|
|
81
|
+
* [Parameters](#parameters-11)
|
|
80
82
|
* [Properties](#properties-1)
|
|
81
83
|
* [equals](#equals-1)
|
|
82
|
-
* [Parameters](#parameters-
|
|
84
|
+
* [Parameters](#parameters-12)
|
|
83
85
|
* [repositoryBases](#repositorybases)
|
|
84
86
|
* [normalizeRepositoryName](#normalizerepositoryname)
|
|
85
|
-
* [Parameters](#parameters-12)
|
|
86
|
-
* [normalizeGroupName](#normalizegroupname)
|
|
87
87
|
* [Parameters](#parameters-13)
|
|
88
|
+
* [normalizeGroupName](#normalizegroupname)
|
|
89
|
+
* [Parameters](#parameters-14)
|
|
88
90
|
* [areRepositoryNamesCaseSensitive](#arerepositorynamescasesensitive)
|
|
89
91
|
* [areGroupNamesCaseSensitive](#aregroupnamescasesensitive)
|
|
90
92
|
* [supportsBase](#supportsbase)
|
|
91
|
-
* [Parameters](#parameters-14)
|
|
92
|
-
* [parseName](#parsename)
|
|
93
93
|
* [Parameters](#parameters-15)
|
|
94
|
-
* [
|
|
94
|
+
* [parseName](#parsename)
|
|
95
95
|
* [Parameters](#parameters-16)
|
|
96
|
-
* [
|
|
96
|
+
* [createRepository](#createrepository)
|
|
97
97
|
* [Parameters](#parameters-17)
|
|
98
|
-
* [
|
|
98
|
+
* [list](#list)
|
|
99
99
|
* [Parameters](#parameters-18)
|
|
100
|
-
* [
|
|
100
|
+
* [projects](#projects)
|
|
101
101
|
* [Parameters](#parameters-19)
|
|
102
|
-
* [
|
|
102
|
+
* [milestones](#milestones)
|
|
103
103
|
* [Parameters](#parameters-20)
|
|
104
|
-
* [
|
|
104
|
+
* [repositories](#repositories)
|
|
105
105
|
* [Parameters](#parameters-21)
|
|
106
|
-
* [
|
|
106
|
+
* [branches](#branches)
|
|
107
107
|
* [Parameters](#parameters-22)
|
|
108
|
-
* [
|
|
108
|
+
* [tags](#tags)
|
|
109
109
|
* [Parameters](#parameters-23)
|
|
110
|
-
* [
|
|
111
|
-
|
|
110
|
+
* [hooks](#hooks)
|
|
111
|
+
* [Parameters](#parameters-24)
|
|
112
|
+
* [pullRequests](#pullrequests)
|
|
113
|
+
* [Parameters](#parameters-25)
|
|
112
114
|
* [name](#name)
|
|
113
115
|
* [provider](#provider)
|
|
114
116
|
* [url](#url)
|
|
115
117
|
* [toJSON](#tojson)
|
|
118
|
+
* [repositoryGroupClass](#repositorygroupclass)
|
|
119
|
+
* [hookClass](#hookclass)
|
|
116
120
|
* [repositoryClass](#repositoryclass)
|
|
117
121
|
* [branchClass](#branchclass)
|
|
118
122
|
* [entryClass](#entryclass)
|
|
119
123
|
* [pullRequestClass](#pullrequestclass)
|
|
120
124
|
* [instanceIdentifier](#instanceidentifier)
|
|
121
125
|
* [optionsFromEnvironment](#optionsfromenvironment)
|
|
122
|
-
* [Parameters](#parameters-
|
|
126
|
+
* [Parameters](#parameters-26)
|
|
123
127
|
* [areOptionsSufficcient](#areoptionssufficcient)
|
|
124
|
-
* [Parameters](#parameters-
|
|
128
|
+
* [Parameters](#parameters-27)
|
|
125
129
|
* [initialize](#initialize)
|
|
126
|
-
* [Parameters](#parameters-
|
|
130
|
+
* [Parameters](#parameters-28)
|
|
127
131
|
* [priority](#priority)
|
|
128
132
|
* [name](#name-1)
|
|
129
133
|
* [messageDestination](#messagedestination-1)
|
|
130
134
|
* [Commit](#commit)
|
|
131
135
|
* [Properties](#properties-2)
|
|
132
136
|
* [Commit](#commit-1)
|
|
133
|
-
* [Parameters](#parameters-
|
|
137
|
+
* [Parameters](#parameters-29)
|
|
134
138
|
* [Properties](#properties-3)
|
|
135
139
|
* [CommitResult](#commitresult)
|
|
136
140
|
* [Properties](#properties-4)
|
|
137
141
|
* [Branch](#branch)
|
|
138
|
-
* [Parameters](#parameters-
|
|
142
|
+
* [Parameters](#parameters-30)
|
|
139
143
|
* [Properties](#properties-5)
|
|
140
144
|
* [url](#url-1)
|
|
141
145
|
* [refType](#reftype)
|
|
142
146
|
* [isDefault](#isdefault)
|
|
143
147
|
* [delete](#delete)
|
|
144
148
|
* [commit](#commit-2)
|
|
145
|
-
* [Parameters](#parameters-
|
|
149
|
+
* [Parameters](#parameters-31)
|
|
146
150
|
* [commitIntoPullRequest](#commitintopullrequest)
|
|
147
|
-
* [Parameters](#parameters-
|
|
151
|
+
* [Parameters](#parameters-32)
|
|
148
152
|
* [removeEntries](#removeentries)
|
|
149
|
-
* [Parameters](#parameters-
|
|
153
|
+
* [Parameters](#parameters-33)
|
|
150
154
|
* [entryClass](#entryclass-1)
|
|
151
155
|
* [createPullRequest](#createpullrequest)
|
|
152
|
-
* [Parameters](#parameters-
|
|
156
|
+
* [Parameters](#parameters-34)
|
|
153
157
|
* [pullRequestClass](#pullrequestclass-1)
|
|
154
158
|
* [createBranch](#createbranch)
|
|
155
|
-
* [Parameters](#parameters-
|
|
159
|
+
* [Parameters](#parameters-35)
|
|
156
160
|
* [Hook](#hook)
|
|
157
|
-
* [Parameters](#parameters-
|
|
161
|
+
* [Parameters](#parameters-36)
|
|
158
162
|
* [Properties](#properties-6)
|
|
159
163
|
* [equals](#equals-2)
|
|
160
|
-
* [Parameters](#parameters-
|
|
164
|
+
* [Parameters](#parameters-37)
|
|
161
165
|
* [toJSON](#tojson-1)
|
|
162
166
|
* [Issue](#issue)
|
|
163
|
-
* [Parameters](#parameters-
|
|
167
|
+
* [Parameters](#parameters-38)
|
|
164
168
|
* [Milestone](#milestone)
|
|
165
|
-
* [Parameters](#parameters-
|
|
169
|
+
* [Parameters](#parameters-39)
|
|
166
170
|
* [MultiGroupProvider](#multigroupprovider)
|
|
167
|
-
* [Parameters](#parameters-
|
|
171
|
+
* [Parameters](#parameters-40)
|
|
168
172
|
* [repository](#repository)
|
|
169
|
-
* [Parameters](#parameters-
|
|
173
|
+
* [Parameters](#parameters-41)
|
|
170
174
|
* [repositoryGroup](#repositorygroup)
|
|
171
|
-
* [Parameters](#parameters-
|
|
175
|
+
* [Parameters](#parameters-42)
|
|
172
176
|
* [repositoryGroups](#repositorygroups)
|
|
173
|
-
* [Parameters](#parameters-
|
|
177
|
+
* [Parameters](#parameters-43)
|
|
174
178
|
* [createRepositoryGroup](#createrepositorygroup)
|
|
175
|
-
* [Parameters](#parameters-
|
|
179
|
+
* [Parameters](#parameters-44)
|
|
176
180
|
* [addRepositoryGroup](#addrepositorygroup)
|
|
177
|
-
* [Parameters](#parameters-
|
|
181
|
+
* [Parameters](#parameters-45)
|
|
178
182
|
* [NamedObject](#namedobject)
|
|
179
|
-
* [Parameters](#parameters-
|
|
183
|
+
* [Parameters](#parameters-46)
|
|
180
184
|
* [Properties](#properties-7)
|
|
181
185
|
* [equals](#equals-3)
|
|
182
|
-
* [Parameters](#parameters-
|
|
186
|
+
* [Parameters](#parameters-47)
|
|
183
187
|
* [displayName](#displayname)
|
|
184
188
|
* [update](#update)
|
|
185
189
|
* [toJSON](#tojson-2)
|
|
186
190
|
* [Project](#project)
|
|
187
|
-
* [Parameters](#parameters-
|
|
191
|
+
* [Parameters](#parameters-48)
|
|
188
192
|
* [PullRequest](#pullrequest)
|
|
189
|
-
* [Parameters](#parameters-
|
|
193
|
+
* [Parameters](#parameters-49)
|
|
190
194
|
* [Properties](#properties-8)
|
|
191
195
|
* [fullName](#fullname)
|
|
192
196
|
* [url](#url-2)
|
|
193
197
|
* [repository](#repository-1)
|
|
194
198
|
* [provider](#provider-1)
|
|
195
199
|
* [equals](#equals-4)
|
|
196
|
-
* [Parameters](#parameters-
|
|
200
|
+
* [Parameters](#parameters-50)
|
|
197
201
|
* [delete](#delete-1)
|
|
198
202
|
* [merge](#merge)
|
|
199
|
-
* [Parameters](#parameters-
|
|
203
|
+
* [Parameters](#parameters-51)
|
|
200
204
|
* [decline](#decline)
|
|
201
205
|
* [reviews](#reviews)
|
|
202
206
|
* [identifier](#identifier)
|
|
@@ -204,9 +208,9 @@ console.log(await readme.getString());
|
|
|
204
208
|
* [defaultListStates](#defaultliststates)
|
|
205
209
|
* [validMergeMethods](#validmergemethods)
|
|
206
210
|
* [list](#list-1)
|
|
207
|
-
* [Parameters](#parameters-
|
|
211
|
+
* [Parameters](#parameters-52)
|
|
208
212
|
* [open](#open)
|
|
209
|
-
* [Parameters](#parameters-
|
|
213
|
+
* [Parameters](#parameters-53)
|
|
210
214
|
* [title](#title)
|
|
211
215
|
* [body](#body)
|
|
212
216
|
* [state](#state)
|
|
@@ -216,19 +220,19 @@ console.log(await readme.getString());
|
|
|
216
220
|
* [ContentEntry](#contententry)
|
|
217
221
|
* [Properties](#properties-9)
|
|
218
222
|
* [Ref](#ref)
|
|
219
|
-
* [Parameters](#parameters-
|
|
223
|
+
* [Parameters](#parameters-54)
|
|
220
224
|
* [equals](#equals-5)
|
|
221
|
-
* [Parameters](#parameters-
|
|
225
|
+
* [Parameters](#parameters-55)
|
|
222
226
|
* [ref](#ref-1)
|
|
223
227
|
* [refId](#refid)
|
|
224
|
-
* [Parameters](#parameters-
|
|
228
|
+
* [Parameters](#parameters-56)
|
|
225
229
|
* [entries](#entries)
|
|
226
|
-
* [Parameters](#parameters-
|
|
230
|
+
* [Parameters](#parameters-57)
|
|
227
231
|
* [asyncIterator](#asynciterator)
|
|
228
232
|
* [maybeEntry](#maybeentry)
|
|
229
|
-
* [Parameters](#parameters-
|
|
233
|
+
* [Parameters](#parameters-58)
|
|
230
234
|
* [entry](#entry)
|
|
231
|
-
* [Parameters](#parameters-
|
|
235
|
+
* [Parameters](#parameters-59)
|
|
232
236
|
* [provider](#provider-2)
|
|
233
237
|
* [owner](#owner)
|
|
234
238
|
* [fullName](#fullname-1)
|
|
@@ -244,7 +248,7 @@ console.log(await readme.getString());
|
|
|
244
248
|
* [attributes](#attributes-1)
|
|
245
249
|
* [isProtected](#isprotected-1)
|
|
246
250
|
* [RepositoryGroup](#repositorygroup-1)
|
|
247
|
-
* [Parameters](#parameters-
|
|
251
|
+
* [Parameters](#parameters-60)
|
|
248
252
|
* [Properties](#properties-10)
|
|
249
253
|
* [repositoryClass](#repositoryclass-1)
|
|
250
254
|
* [branchClass](#branchclass-1)
|
|
@@ -255,22 +259,22 @@ console.log(await readme.getString());
|
|
|
255
259
|
* [type](#type)
|
|
256
260
|
* [url](#url-3)
|
|
257
261
|
* [RepositoryOwner](#repositoryowner)
|
|
258
|
-
* [Parameters](#parameters-
|
|
262
|
+
* [Parameters](#parameters-61)
|
|
259
263
|
* [Repository](#repository-2)
|
|
260
|
-
* [Parameters](#parameters-
|
|
264
|
+
* [Parameters](#parameters-62)
|
|
261
265
|
* [Properties](#properties-11)
|
|
262
266
|
* [fullName](#fullname-2)
|
|
263
267
|
* [slug](#slug)
|
|
264
268
|
* [provider](#provider-3)
|
|
265
269
|
* [identifier](#identifier-2)
|
|
266
270
|
* [equals](#equals-6)
|
|
267
|
-
* [Parameters](#parameters-
|
|
271
|
+
* [Parameters](#parameters-63)
|
|
268
272
|
* [entry](#entry-1)
|
|
269
|
-
* [Parameters](#parameters-
|
|
273
|
+
* [Parameters](#parameters-64)
|
|
270
274
|
* [entries](#entries-1)
|
|
271
|
-
* [Parameters](#parameters-
|
|
275
|
+
* [Parameters](#parameters-65)
|
|
272
276
|
* [maybeEntry](#maybeentry-1)
|
|
273
|
-
* [Parameters](#parameters-
|
|
277
|
+
* [Parameters](#parameters-66)
|
|
274
278
|
* [urls](#urls)
|
|
275
279
|
* [url](#url-4)
|
|
276
280
|
* [cloneURL](#cloneurl)
|
|
@@ -282,40 +286,40 @@ console.log(await readme.getString());
|
|
|
282
286
|
* [isDisabled](#isdisabled-1)
|
|
283
287
|
* [isTemplate](#istemplate)
|
|
284
288
|
* [branch](#branch-1)
|
|
285
|
-
* [Parameters](#parameters-
|
|
289
|
+
* [Parameters](#parameters-67)
|
|
286
290
|
* [defaultBranch](#defaultbranch)
|
|
287
291
|
* [branches](#branches-1)
|
|
288
|
-
* [Parameters](#parameters-
|
|
292
|
+
* [Parameters](#parameters-68)
|
|
289
293
|
* [createBranch](#createbranch-1)
|
|
290
|
-
* [Parameters](#parameters-
|
|
294
|
+
* [Parameters](#parameters-69)
|
|
291
295
|
* [addBranch](#addbranch)
|
|
292
|
-
* [Parameters](#parameters-
|
|
296
|
+
* [Parameters](#parameters-70)
|
|
293
297
|
* [deleteBranch](#deletebranch)
|
|
294
|
-
* [Parameters](#parameters-
|
|
298
|
+
* [Parameters](#parameters-71)
|
|
295
299
|
* [tags](#tags-1)
|
|
296
|
-
* [Parameters](#parameters-
|
|
300
|
+
* [Parameters](#parameters-72)
|
|
297
301
|
* [tag](#tag)
|
|
298
|
-
* [Parameters](#parameters-
|
|
302
|
+
* [Parameters](#parameters-73)
|
|
299
303
|
* [delete](#delete-2)
|
|
300
304
|
* [createPullRequest](#createpullrequest-1)
|
|
301
|
-
* [Parameters](#parameters-
|
|
305
|
+
* [Parameters](#parameters-74)
|
|
302
306
|
* [addPullRequest](#addpullrequest)
|
|
303
|
-
* [Parameters](#parameters-
|
|
307
|
+
* [Parameters](#parameters-75)
|
|
304
308
|
* [pullRequests](#pullrequests-1)
|
|
305
309
|
* [pullRequest](#pullrequest-1)
|
|
306
|
-
* [Parameters](#parameters-
|
|
310
|
+
* [Parameters](#parameters-76)
|
|
307
311
|
* [deletePullRequest](#deletepullrequest)
|
|
308
|
-
* [Parameters](#parameters-
|
|
312
|
+
* [Parameters](#parameters-77)
|
|
309
313
|
* [addHook](#addhook)
|
|
310
|
-
* [Parameters](#parameters-
|
|
314
|
+
* [Parameters](#parameters-78)
|
|
311
315
|
* [createHook](#createhook)
|
|
312
|
-
* [Parameters](#parameters-
|
|
316
|
+
* [Parameters](#parameters-79)
|
|
313
317
|
* [hooks](#hooks-1)
|
|
314
318
|
* [hook](#hook-1)
|
|
315
|
-
* [Parameters](#parameters-
|
|
319
|
+
* [Parameters](#parameters-80)
|
|
316
320
|
* [type](#type-1)
|
|
317
321
|
* [refId](#refid-1)
|
|
318
|
-
* [Parameters](#parameters-
|
|
322
|
+
* [Parameters](#parameters-81)
|
|
319
323
|
* [repositoryClass](#repositoryclass-2)
|
|
320
324
|
* [pullRequestClass](#pullrequestclass-3)
|
|
321
325
|
* [branchClass](#branchclass-2)
|
|
@@ -329,23 +333,23 @@ console.log(await readme.getString());
|
|
|
329
333
|
* [Review](#review)
|
|
330
334
|
* [SingleGroupProvider](#singlegroupprovider)
|
|
331
335
|
* [repository](#repository-3)
|
|
332
|
-
* [Parameters](#parameters-
|
|
336
|
+
* [Parameters](#parameters-82)
|
|
333
337
|
* [repositoryGroup](#repositorygroup-2)
|
|
334
|
-
* [Parameters](#parameters-
|
|
338
|
+
* [Parameters](#parameters-83)
|
|
335
339
|
* [repositoryGroups](#repositorygroups-1)
|
|
336
|
-
* [Parameters](#parameters-
|
|
340
|
+
* [Parameters](#parameters-84)
|
|
337
341
|
* [Tag](#tag-1)
|
|
338
|
-
* [Parameters](#parameters-
|
|
342
|
+
* [Parameters](#parameters-85)
|
|
339
343
|
* [refType](#reftype-1)
|
|
340
344
|
* [isWritable](#iswritable-1)
|
|
341
345
|
* [asArray](#asarray)
|
|
342
|
-
* [Parameters](#parameters-
|
|
346
|
+
* [Parameters](#parameters-86)
|
|
343
347
|
* [stripBaseName](#stripbasename)
|
|
344
|
-
* [Parameters](#parameters-
|
|
348
|
+
* [Parameters](#parameters-87)
|
|
345
349
|
* [stripBaseNames](#stripbasenames)
|
|
346
|
-
* [Parameters](#parameters-
|
|
350
|
+
* [Parameters](#parameters-88)
|
|
347
351
|
* [generateBranchName](#generatebranchname)
|
|
348
|
-
* [Parameters](#parameters-
|
|
352
|
+
* [Parameters](#parameters-89)
|
|
349
353
|
|
|
350
354
|
## Application
|
|
351
355
|
|
|
@@ -397,6 +401,17 @@ Object.definedProperties(new aClass(),{ with_default: { value: 77 }})
|
|
|
397
401
|
* `properties` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** object properties (optional, default `{}`)
|
|
398
402
|
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** (optional, default `object.constructor.attributes`)
|
|
399
403
|
|
|
404
|
+
## defaultValues
|
|
405
|
+
|
|
406
|
+
Get default values.
|
|
407
|
+
|
|
408
|
+
### Parameters
|
|
409
|
+
|
|
410
|
+
* `attributes` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
411
|
+
* `object`
|
|
412
|
+
|
|
413
|
+
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** filled with default values
|
|
414
|
+
|
|
400
415
|
## setAttribute
|
|
401
416
|
|
|
402
417
|
Set Object attribute.
|
|
@@ -553,7 +568,7 @@ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/
|
|
|
553
568
|
|
|
554
569
|
### repositoryBases
|
|
555
570
|
|
|
556
|
-
All
|
|
571
|
+
All supported base urls.
|
|
557
572
|
For github something like:
|
|
558
573
|
|
|
559
574
|
* <git@github.com>
|
|
@@ -624,6 +639,17 @@ base, group, repository and branch.
|
|
|
624
639
|
|
|
625
640
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** with separated attributes
|
|
626
641
|
|
|
642
|
+
### createRepository
|
|
643
|
+
|
|
644
|
+
Create a repository.
|
|
645
|
+
|
|
646
|
+
#### Parameters
|
|
647
|
+
|
|
648
|
+
* `name` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** of group and repository
|
|
649
|
+
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)**
|
|
650
|
+
|
|
651
|
+
Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[Repository](#repository)>**
|
|
652
|
+
|
|
627
653
|
### list
|
|
628
654
|
|
|
629
655
|
List provider objects of a given type.
|
|
@@ -703,14 +729,6 @@ List pull requests.
|
|
|
703
729
|
|
|
704
730
|
Returns **AsyncIterator<[PullRequest](#pullrequest)>** all matching pullRequests of the provider
|
|
705
731
|
|
|
706
|
-
### repositoryGroupClass
|
|
707
|
-
|
|
708
|
-
Returns **Class** repository group class used by the Provider
|
|
709
|
-
|
|
710
|
-
### hookClass
|
|
711
|
-
|
|
712
|
-
Returns **Class** hook class used by the Provider
|
|
713
|
-
|
|
714
732
|
### name
|
|
715
733
|
|
|
716
734
|
Deliver the provider name.
|
|
@@ -732,6 +750,14 @@ Returns **any** url otf the provider.
|
|
|
732
750
|
List all defined entries from attributes.
|
|
733
751
|
return {object}
|
|
734
752
|
|
|
753
|
+
### repositoryGroupClass
|
|
754
|
+
|
|
755
|
+
Returns **Class** repository group class used by the Provider
|
|
756
|
+
|
|
757
|
+
### hookClass
|
|
758
|
+
|
|
759
|
+
Returns **Class** hook class used by the Provider
|
|
760
|
+
|
|
735
761
|
### repositoryClass
|
|
736
762
|
|
|
737
763
|
Returns **Class** repository class used by the Provider
|
|
@@ -782,7 +808,7 @@ Creates a new provider for a given set of options.
|
|
|
782
808
|
|
|
783
809
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** additional options (optional, default `{}`)
|
|
784
810
|
|
|
785
|
-
* `options.instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?**
|
|
811
|
+
* `options.instanceIdentifier` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)?** name of the provider instance
|
|
786
812
|
* `env` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** taken from process.env
|
|
787
813
|
|
|
788
814
|
Returns **[BaseProvider](#baseprovider)** newly created provider or undefined if options are not sufficient to construct a provider
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "26.
|
|
3
|
+
"version": "26.3.0",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -33,15 +33,15 @@
|
|
|
33
33
|
"matching-iterator": "^2.0.0"
|
|
34
34
|
},
|
|
35
35
|
"devDependencies": {
|
|
36
|
-
"ava": "^
|
|
36
|
+
"ava": "^4.0.1",
|
|
37
37
|
"c8": "^7.11.0",
|
|
38
38
|
"documentation": "^13.2.5",
|
|
39
|
-
"repository-provider-test-support": "^1.9.
|
|
40
|
-
"semantic-release": "^
|
|
41
|
-
"typescript": "^4.6.0-dev.
|
|
39
|
+
"repository-provider-test-support": "^1.9.8",
|
|
40
|
+
"semantic-release": "^19.0.2",
|
|
41
|
+
"typescript": "^4.6.0-dev.20220124"
|
|
42
42
|
},
|
|
43
43
|
"engines": {
|
|
44
|
-
"node": ">=14.18.
|
|
44
|
+
"node": ">=14.18.3"
|
|
45
45
|
},
|
|
46
46
|
"repository": {
|
|
47
47
|
"type": "git",
|
package/src/attribute.mjs
CHANGED
|
@@ -103,23 +103,25 @@ export function definePropertiesFromOptions(
|
|
|
103
103
|
}
|
|
104
104
|
|
|
105
105
|
/**
|
|
106
|
-
*
|
|
106
|
+
* Get default values.
|
|
107
107
|
* @param {Object} attributes
|
|
108
108
|
* @return {Object} filled with default values
|
|
109
109
|
*/
|
|
110
|
-
export function defaultValues(attributes) {
|
|
111
|
-
Object.
|
|
112
|
-
|
|
113
|
-
|
|
114
|
-
|
|
115
|
-
|
|
116
|
-
|
|
117
|
-
|
|
118
|
-
|
|
119
|
-
|
|
120
|
-
|
|
121
|
-
|
|
122
|
-
|
|
110
|
+
export function defaultValues(attributes, object) {
|
|
111
|
+
return Object.fromEntries(
|
|
112
|
+
Object.entries(attributes).reduce((a, c) => {
|
|
113
|
+
const [name, attribute] = c;
|
|
114
|
+
|
|
115
|
+
if (attribute.default !== undefined) {
|
|
116
|
+
a.push([name, attribute.default]);
|
|
117
|
+
}
|
|
118
|
+
else if (attribute.getDefault !== undefined) {
|
|
119
|
+
a.push([name, attribute.getDefault(attribute, object)]);
|
|
120
|
+
}
|
|
121
|
+
|
|
122
|
+
return a;
|
|
123
|
+
}, [])
|
|
124
|
+
);
|
|
123
125
|
}
|
|
124
126
|
|
|
125
127
|
/**
|
package/src/base-object.mjs
CHANGED
|
@@ -71,6 +71,11 @@ export class BaseObject {
|
|
|
71
71
|
);
|
|
72
72
|
}
|
|
73
73
|
|
|
74
|
+
/**
|
|
75
|
+
* Save object attributes in the backing store.
|
|
76
|
+
*/
|
|
77
|
+
async update() {}
|
|
78
|
+
|
|
74
79
|
/**
|
|
75
80
|
* Check for equality
|
|
76
81
|
* @param {BaseObject} other
|
|
@@ -79,4 +84,28 @@ export class BaseObject {
|
|
|
79
84
|
equals(other) {
|
|
80
85
|
return other !== undefined;
|
|
81
86
|
}
|
|
87
|
+
|
|
88
|
+
/**
|
|
89
|
+
* Forwarded to the owner.
|
|
90
|
+
* @param {...any} args
|
|
91
|
+
*/
|
|
92
|
+
info(...args) {
|
|
93
|
+
return this.owner.info(...args);
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* Forwarded to the owner.
|
|
98
|
+
* @param {...any} args
|
|
99
|
+
*/
|
|
100
|
+
warn(...args) {
|
|
101
|
+
return this.owner.warn(...args);
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
/**
|
|
105
|
+
* Forwarded to the owner.
|
|
106
|
+
* @param {...any} args
|
|
107
|
+
*/
|
|
108
|
+
error(...args) {
|
|
109
|
+
return this.owner.error(...args);
|
|
110
|
+
}
|
|
82
111
|
}
|
package/src/base-provider.mjs
CHANGED
|
@@ -126,7 +126,7 @@ export class BaseProvider {
|
|
|
126
126
|
/**
|
|
127
127
|
* Creates a new provider for a given set of options.
|
|
128
128
|
* @param {Object} options additional options
|
|
129
|
-
* @param {string} [options.instanceIdentifier]
|
|
129
|
+
* @param {string} [options.instanceIdentifier] name of the provider instance
|
|
130
130
|
* @param {Object} env taken from process.env
|
|
131
131
|
* @return {BaseProvider} newly created provider or undefined if options are not sufficient to construct a provider
|
|
132
132
|
*/
|
|
@@ -153,7 +153,7 @@ export class BaseProvider {
|
|
|
153
153
|
}
|
|
154
154
|
|
|
155
155
|
/**
|
|
156
|
-
* All
|
|
156
|
+
* All supported base urls.
|
|
157
157
|
* For github something like:
|
|
158
158
|
* - git@github.com
|
|
159
159
|
* - git://github.com
|
|
@@ -293,6 +293,12 @@ export class BaseProvider {
|
|
|
293
293
|
return result;
|
|
294
294
|
}
|
|
295
295
|
|
|
296
|
+
/**
|
|
297
|
+
* Create a repository.
|
|
298
|
+
* @param {string} name of group and repository
|
|
299
|
+
* @param {Object} options
|
|
300
|
+
* @returns {Promise<Repository>}
|
|
301
|
+
*/
|
|
296
302
|
async createRepository(name, options) {
|
|
297
303
|
const { group, repository } = this.parseName(name);
|
|
298
304
|
const rg = await this.repositoryGroup(group);
|
|
@@ -311,7 +317,7 @@ export class BaseProvider {
|
|
|
311
317
|
yield* group[type]();
|
|
312
318
|
}
|
|
313
319
|
} else {
|
|
314
|
-
for (
|
|
320
|
+
for (const pattern of asArray(patterns)) {
|
|
315
321
|
const [groupPattern, repoPattern] = stripBaseName(
|
|
316
322
|
pattern,
|
|
317
323
|
this.repositoryBases
|
|
@@ -387,20 +393,6 @@ export class BaseProvider {
|
|
|
387
393
|
yield* this.list("pullRequests", patterns);
|
|
388
394
|
}
|
|
389
395
|
|
|
390
|
-
/**
|
|
391
|
-
* @return {Class} repository group class used by the Provider
|
|
392
|
-
*/
|
|
393
|
-
get repositoryGroupClass() {
|
|
394
|
-
return RepositoryGroup;
|
|
395
|
-
}
|
|
396
|
-
|
|
397
|
-
/**
|
|
398
|
-
* @return {Class} hook class used by the Provider
|
|
399
|
-
*/
|
|
400
|
-
get hookClass() {
|
|
401
|
-
return Hook;
|
|
402
|
-
}
|
|
403
|
-
|
|
404
396
|
/**
|
|
405
397
|
* Deliver the provider name.
|
|
406
398
|
* @return {string} class name by default
|
|
@@ -448,6 +440,34 @@ export class BaseProvider {
|
|
|
448
440
|
return json;
|
|
449
441
|
}
|
|
450
442
|
|
|
443
|
+
initializeRepositories() {}
|
|
444
|
+
|
|
445
|
+
info(...args) {
|
|
446
|
+
return this.messageDestination.info(...args);
|
|
447
|
+
}
|
|
448
|
+
|
|
449
|
+
warn(...args) {
|
|
450
|
+
return this.messageDestination.warn(...args);
|
|
451
|
+
}
|
|
452
|
+
|
|
453
|
+
error(...args) {
|
|
454
|
+
return this.messageDestination.error(...args);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* @return {Class} repository group class used by the Provider
|
|
459
|
+
*/
|
|
460
|
+
get repositoryGroupClass() {
|
|
461
|
+
return RepositoryGroup;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* @return {Class} hook class used by the Provider
|
|
466
|
+
*/
|
|
467
|
+
get hookClass() {
|
|
468
|
+
return Hook;
|
|
469
|
+
}
|
|
470
|
+
|
|
451
471
|
/**
|
|
452
472
|
* @return {Class} repository class used by the Provider
|
|
453
473
|
*/
|
|
@@ -462,6 +482,13 @@ export class BaseProvider {
|
|
|
462
482
|
return Branch;
|
|
463
483
|
}
|
|
464
484
|
|
|
485
|
+
/**
|
|
486
|
+
* @return {Class} branch class used by the Provider
|
|
487
|
+
*/
|
|
488
|
+
get tagClass() {
|
|
489
|
+
return Tag;
|
|
490
|
+
}
|
|
491
|
+
|
|
465
492
|
/**
|
|
466
493
|
* @return {Class} entry class used by the Provider
|
|
467
494
|
*/
|
|
@@ -475,18 +502,4 @@ export class BaseProvider {
|
|
|
475
502
|
get pullRequestClass() {
|
|
476
503
|
return PullRequest;
|
|
477
504
|
}
|
|
478
|
-
|
|
479
|
-
initializeRepositories() {}
|
|
480
|
-
|
|
481
|
-
info(...args) {
|
|
482
|
-
return this.messageDestination.info(...args);
|
|
483
|
-
}
|
|
484
|
-
|
|
485
|
-
warn(...args) {
|
|
486
|
-
return this.messageDestination.warn(...args);
|
|
487
|
-
}
|
|
488
|
-
|
|
489
|
-
error(...args) {
|
|
490
|
-
return this.messageDestination.error(...args);
|
|
491
|
-
}
|
|
492
505
|
}
|
package/src/branch.mjs
CHANGED
|
@@ -82,6 +82,7 @@ export class Branch extends Ref {
|
|
|
82
82
|
* @param {boolean} options.dry do not create a branch and do not commit only create dummy PR
|
|
83
83
|
* @param {boolean} options.skipWithoutCommits do not create a PR if no commits are given
|
|
84
84
|
* @param {boolean} options.bodyFromCommitMessages generate body from commit messages
|
|
85
|
+
* @param {string} [options.body] body of the PR
|
|
85
86
|
* @return {Promise<PullRequest>}
|
|
86
87
|
*/
|
|
87
88
|
async commitIntoPullRequest(commits, options) {
|
package/src/hook.mjs
CHANGED
|
@@ -36,6 +36,11 @@ export class Hook extends BaseObject {
|
|
|
36
36
|
repository._addHook(this);
|
|
37
37
|
}
|
|
38
38
|
|
|
39
|
+
get owner()
|
|
40
|
+
{
|
|
41
|
+
return this.repository;
|
|
42
|
+
}
|
|
43
|
+
|
|
39
44
|
get fullName() {
|
|
40
45
|
return `${this.repository.fullName}/${this.id}`;
|
|
41
46
|
}
|
|
@@ -59,16 +64,4 @@ export class Hook extends BaseObject {
|
|
|
59
64
|
toJSON() {
|
|
60
65
|
return optionJSON(this, { id: this.id, events: [...this.events] });
|
|
61
66
|
}
|
|
62
|
-
|
|
63
|
-
info(...args) {
|
|
64
|
-
return this.repository.info(...args);
|
|
65
|
-
}
|
|
66
|
-
|
|
67
|
-
warn(...args) {
|
|
68
|
-
return this.repository.warn(...args);
|
|
69
|
-
}
|
|
70
|
-
|
|
71
|
-
error(...args) {
|
|
72
|
-
return this.repository.error(...args);
|
|
73
|
-
}
|
|
74
67
|
}
|
package/src/named-object.mjs
CHANGED
package/src/ref.mjs
CHANGED
|
@@ -208,16 +208,4 @@ export class Ref extends NamedObject {
|
|
|
208
208
|
!this.isProtected
|
|
209
209
|
);
|
|
210
210
|
}
|
|
211
|
-
|
|
212
|
-
info(...args) {
|
|
213
|
-
return this.repository.info(...args);
|
|
214
|
-
}
|
|
215
|
-
|
|
216
|
-
warn(...args) {
|
|
217
|
-
return this.repository.warn(...args);
|
|
218
|
-
}
|
|
219
|
-
|
|
220
|
-
error(...args) {
|
|
221
|
-
return this.repository.error(...args);
|
|
222
|
-
}
|
|
223
211
|
}
|
package/src/repository-group.mjs
CHANGED
|
@@ -49,6 +49,11 @@ export class RepositoryGroup extends RepositoryOwner(NamedObject) {
|
|
|
49
49
|
});
|
|
50
50
|
}
|
|
51
51
|
|
|
52
|
+
get owner()
|
|
53
|
+
{
|
|
54
|
+
return this.provider;
|
|
55
|
+
}
|
|
56
|
+
|
|
52
57
|
get isAdmin() {
|
|
53
58
|
return false;
|
|
54
59
|
}
|
|
@@ -77,6 +82,14 @@ export class RepositoryGroup extends RepositoryOwner(NamedObject) {
|
|
|
77
82
|
return this.provider.branchClass;
|
|
78
83
|
}
|
|
79
84
|
|
|
85
|
+
/**
|
|
86
|
+
* By default we use the providers implementation.
|
|
87
|
+
* @return {Class} as defined in the provider
|
|
88
|
+
*/
|
|
89
|
+
get tagClass() {
|
|
90
|
+
return this.provider.tagClass;
|
|
91
|
+
}
|
|
92
|
+
|
|
80
93
|
/**
|
|
81
94
|
* By default we use the providers implementation.
|
|
82
95
|
* @return {Class} as defined in the provider
|
|
@@ -100,16 +113,4 @@ export class RepositoryGroup extends RepositoryOwner(NamedObject) {
|
|
|
100
113
|
get hookClass() {
|
|
101
114
|
return this.provider.hookClass;
|
|
102
115
|
}
|
|
103
|
-
|
|
104
|
-
info(...args) {
|
|
105
|
-
return this.provider.info(...args);
|
|
106
|
-
}
|
|
107
|
-
|
|
108
|
-
warn(...args) {
|
|
109
|
-
return this.provider.warn(...args);
|
|
110
|
-
}
|
|
111
|
-
|
|
112
|
-
error(...args) {
|
|
113
|
-
return this.provider.error(...args);
|
|
114
|
-
}
|
|
115
116
|
}
|
package/src/repository.mjs
CHANGED
|
@@ -42,7 +42,7 @@ export class Repository extends NamedObject {
|
|
|
42
42
|
* URLs of the repository
|
|
43
43
|
* @return {string[]}
|
|
44
44
|
*/
|
|
45
|
-
urls: {
|
|
45
|
+
urls: {},
|
|
46
46
|
|
|
47
47
|
cloneURL: { type: "url" },
|
|
48
48
|
|
|
@@ -229,6 +229,14 @@ export class Repository extends NamedObject {
|
|
|
229
229
|
return false;
|
|
230
230
|
}
|
|
231
231
|
|
|
232
|
+
/**
|
|
233
|
+
* Lookup the default branch.
|
|
234
|
+
* @return {Promise<Branch>} branch named after defaultBranchName
|
|
235
|
+
*/
|
|
236
|
+
get defaultBranch() {
|
|
237
|
+
return this.branch(this.defaultBranchName);
|
|
238
|
+
}
|
|
239
|
+
|
|
232
240
|
/**
|
|
233
241
|
* Lookup branch by name.
|
|
234
242
|
* @param {string} name
|
|
@@ -239,14 +247,6 @@ export class Repository extends NamedObject {
|
|
|
239
247
|
return this._branches.get(name);
|
|
240
248
|
}
|
|
241
249
|
|
|
242
|
-
/**
|
|
243
|
-
* Lookup the default branch.
|
|
244
|
-
* @return {Promise<Branch>} branch named after defaultBranchName
|
|
245
|
-
*/
|
|
246
|
-
get defaultBranch() {
|
|
247
|
-
return this.branch(this.defaultBranchName);
|
|
248
|
-
}
|
|
249
|
-
|
|
250
250
|
/**
|
|
251
251
|
* @return {AsyncIterator<Branch>} of all branches
|
|
252
252
|
*/
|
|
@@ -274,7 +274,7 @@ export class Repository extends NamedObject {
|
|
|
274
274
|
* Internal branch creation does not call repository.initialize()
|
|
275
275
|
* @param {string} name of the new branch
|
|
276
276
|
* @param {Object} options
|
|
277
|
-
* @return {
|
|
277
|
+
* @return {Branch} newly created branch
|
|
278
278
|
*/
|
|
279
279
|
addBranch(name, options) {
|
|
280
280
|
let branch = this._branches.get(name);
|
|
@@ -298,8 +298,14 @@ export class Repository extends NamedObject {
|
|
|
298
298
|
this._branches.delete(name);
|
|
299
299
|
}
|
|
300
300
|
|
|
301
|
-
|
|
302
|
-
|
|
301
|
+
/**
|
|
302
|
+
* Get a Tag.
|
|
303
|
+
* @param {string} name
|
|
304
|
+
* @return {Promise<Tag>}
|
|
305
|
+
*/
|
|
306
|
+
async tag(name) {
|
|
307
|
+
await this.initializeTags();
|
|
308
|
+
return this._tags.get(name);
|
|
303
309
|
}
|
|
304
310
|
|
|
305
311
|
/**
|
|
@@ -315,13 +321,23 @@ export class Repository extends NamedObject {
|
|
|
315
321
|
}
|
|
316
322
|
|
|
317
323
|
/**
|
|
318
|
-
*
|
|
319
|
-
*
|
|
320
|
-
* @
|
|
324
|
+
* Add a new {@link Tag}.
|
|
325
|
+
* Internal tag creation does not call repository.initialize()
|
|
326
|
+
* @param {string} name of the new tag
|
|
327
|
+
* @param {Object} options
|
|
328
|
+
* @return {Tag} newly created tag
|
|
321
329
|
*/
|
|
322
|
-
|
|
323
|
-
|
|
324
|
-
|
|
330
|
+
addTag(name, options) {
|
|
331
|
+
let tag = this._tags.get(name);
|
|
332
|
+
if (tag === undefined) {
|
|
333
|
+
tag = new this.tagClass(this, name, options);
|
|
334
|
+
}
|
|
335
|
+
|
|
336
|
+
return tag;
|
|
337
|
+
}
|
|
338
|
+
|
|
339
|
+
_addTag(tag) {
|
|
340
|
+
this._tags.set(tag.name, tag);
|
|
325
341
|
}
|
|
326
342
|
|
|
327
343
|
/**
|
|
@@ -498,6 +514,14 @@ export class Repository extends NamedObject {
|
|
|
498
514
|
return this.owner.branchClass;
|
|
499
515
|
}
|
|
500
516
|
|
|
517
|
+
/**
|
|
518
|
+
* By default we use the owners implementation.
|
|
519
|
+
* @return {Class} as defined in the owner
|
|
520
|
+
*/
|
|
521
|
+
get tagClass() {
|
|
522
|
+
return this.owner.tagClass;
|
|
523
|
+
}
|
|
524
|
+
|
|
501
525
|
/**
|
|
502
526
|
* By default we use the owners implementation.
|
|
503
527
|
* @return {Class} as defined in the owner
|
|
@@ -529,18 +553,6 @@ export class Repository extends NamedObject {
|
|
|
529
553
|
});
|
|
530
554
|
}
|
|
531
555
|
|
|
532
|
-
info(...args) {
|
|
533
|
-
return this.owner.info(...args);
|
|
534
|
-
}
|
|
535
|
-
|
|
536
|
-
warn(...args) {
|
|
537
|
-
return this.owner.warn(...args);
|
|
538
|
-
}
|
|
539
|
-
|
|
540
|
-
error(...args) {
|
|
541
|
-
return this.owner.error(...args);
|
|
542
|
-
}
|
|
543
|
-
|
|
544
556
|
initialize() {}
|
|
545
557
|
|
|
546
558
|
initializeHooks() {
|