repository-provider 32.3.17 → 32.3.19
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 +67 -110
- package/package.json +3 -3
- package/src/attribute.mjs +31 -32
- package/src/attributes.mjs +1 -0
- package/src/branch.mjs +4 -0
- package/src/hook.mjs +4 -0
- package/src/multi-group-provider.mjs +1 -1
- package/src/owned-object.mjs +10 -5
- package/src/pull-request.mjs +6 -9
- package/src/ref.mjs +1 -1
- package/src/repository-group.mjs +7 -16
- package/src/repository.mjs +7 -2
- package/src/tag.mjs +4 -0
package/README.md
CHANGED
|
@@ -64,6 +64,12 @@ console.log(await readme.getString());
|
|
|
64
64
|
* [Parameters](#parameters-6)
|
|
65
65
|
* [mapAttributesInverse](#mapattributesinverse)
|
|
66
66
|
* [Parameters](#parameters-7)
|
|
67
|
+
* [description](#description)
|
|
68
|
+
* [id](#id)
|
|
69
|
+
* [uuid](#uuid)
|
|
70
|
+
* [body](#body)
|
|
71
|
+
* [title](#title)
|
|
72
|
+
* [priority](#priority)
|
|
67
73
|
* [BaseObject](#baseobject)
|
|
68
74
|
* [Parameters](#parameters-8)
|
|
69
75
|
* [update](#update)
|
|
@@ -79,9 +85,6 @@ console.log(await readme.getString());
|
|
|
79
85
|
* [attributes](#attributes)
|
|
80
86
|
* [writableAttributes](#writableattributes)
|
|
81
87
|
* [attributeMapping](#attributemapping)
|
|
82
|
-
* [description](#description)
|
|
83
|
-
* [id](#id)
|
|
84
|
-
* [uuid](#uuid)
|
|
85
88
|
* [MessageDestination](#messagedestination)
|
|
86
89
|
* [Properties](#properties-1)
|
|
87
90
|
* [BaseProvider](#baseprovider)
|
|
@@ -135,7 +138,6 @@ console.log(await readme.getString());
|
|
|
135
138
|
* [Parameters](#parameters-25)
|
|
136
139
|
* [initialize](#initialize)
|
|
137
140
|
* [Parameters](#parameters-26)
|
|
138
|
-
* [priority](#priority)
|
|
139
141
|
* [name](#name-1)
|
|
140
142
|
* [messageDestination](#messagedestination-1)
|
|
141
143
|
* [Branch](#branch)
|
|
@@ -217,11 +219,9 @@ console.log(await readme.getString());
|
|
|
217
219
|
* [fullName](#fullname-2)
|
|
218
220
|
* [url](#url-2)
|
|
219
221
|
* [repository](#repository-1)
|
|
220
|
-
* [equals](#equals-4)
|
|
221
|
-
* [Parameters](#parameters-50)
|
|
222
222
|
* [delete](#delete-1)
|
|
223
223
|
* [merge](#merge)
|
|
224
|
-
* [Parameters](#parameters-
|
|
224
|
+
* [Parameters](#parameters-50)
|
|
225
225
|
* [decline](#decline)
|
|
226
226
|
* [reviews](#reviews)
|
|
227
227
|
* [identifier](#identifier-1)
|
|
@@ -229,11 +229,9 @@ console.log(await readme.getString());
|
|
|
229
229
|
* [defaultListStates](#defaultliststates)
|
|
230
230
|
* [validMergeMethods](#validmergemethods)
|
|
231
231
|
* [list](#list-1)
|
|
232
|
-
* [Parameters](#parameters-
|
|
232
|
+
* [Parameters](#parameters-51)
|
|
233
233
|
* [open](#open)
|
|
234
|
-
* [Parameters](#parameters-
|
|
235
|
-
* [title](#title)
|
|
236
|
-
* [body](#body)
|
|
234
|
+
* [Parameters](#parameters-52)
|
|
237
235
|
* [state](#state)
|
|
238
236
|
* [locked](#locked)
|
|
239
237
|
* [merged](#merged)
|
|
@@ -244,12 +242,12 @@ console.log(await readme.getString());
|
|
|
244
242
|
* [ref](#ref-1)
|
|
245
243
|
* [refId](#refid)
|
|
246
244
|
* [entries](#entries)
|
|
247
|
-
* [Parameters](#parameters-
|
|
245
|
+
* [Parameters](#parameters-53)
|
|
248
246
|
* [asyncIterator](#asynciterator)
|
|
249
247
|
* [maybeEntry](#maybeentry)
|
|
250
|
-
* [Parameters](#parameters-
|
|
248
|
+
* [Parameters](#parameters-54)
|
|
251
249
|
* [entry](#entry)
|
|
252
|
-
* [Parameters](#parameters-
|
|
250
|
+
* [Parameters](#parameters-55)
|
|
253
251
|
* [repository](#repository-2)
|
|
254
252
|
* [fullName](#fullname-3)
|
|
255
253
|
* [fullCondensedName](#fullcondensedname-1)
|
|
@@ -263,28 +261,25 @@ console.log(await readme.getString());
|
|
|
263
261
|
* [attributes](#attributes-2)
|
|
264
262
|
* [isProtected](#isprotected-1)
|
|
265
263
|
* [RepositoryGroup](#repositorygroup-1)
|
|
266
|
-
* [Parameters](#parameters-
|
|
264
|
+
* [Parameters](#parameters-56)
|
|
267
265
|
* [Properties](#properties-9)
|
|
268
266
|
* [attributeMapping](#attributemapping-1)
|
|
269
267
|
* [type](#type-1)
|
|
270
|
-
* [url](#url-3)
|
|
271
|
-
* [url](#url-4)
|
|
272
|
-
* [avatarURL](#avatarurl)
|
|
273
268
|
* [RepositoryOwner](#repositoryowner)
|
|
274
|
-
* [Parameters](#parameters-
|
|
269
|
+
* [Parameters](#parameters-57)
|
|
275
270
|
* [Repository](#repository-3)
|
|
276
|
-
* [Parameters](#parameters-
|
|
271
|
+
* [Parameters](#parameters-58)
|
|
277
272
|
* [Properties](#properties-10)
|
|
278
273
|
* [fullName](#fullname-4)
|
|
279
274
|
* [slug](#slug)
|
|
280
275
|
* [entry](#entry-1)
|
|
281
|
-
* [Parameters](#parameters-
|
|
276
|
+
* [Parameters](#parameters-59)
|
|
282
277
|
* [entries](#entries-1)
|
|
283
|
-
* [Parameters](#parameters-
|
|
278
|
+
* [Parameters](#parameters-60)
|
|
284
279
|
* [maybeEntry](#maybeentry-1)
|
|
285
|
-
* [Parameters](#parameters-
|
|
280
|
+
* [Parameters](#parameters-61)
|
|
286
281
|
* [commits](#commits)
|
|
287
|
-
* [Parameters](#parameters-
|
|
282
|
+
* [Parameters](#parameters-62)
|
|
288
283
|
* [cloneURL](#cloneurl)
|
|
289
284
|
* [issuesURL](#issuesurl-1)
|
|
290
285
|
* [homePageURL](#homepageurl-2)
|
|
@@ -295,62 +290,62 @@ console.log(await readme.getString());
|
|
|
295
290
|
* [delete](#delete-2)
|
|
296
291
|
* [defaultBranch](#defaultbranch)
|
|
297
292
|
* [branch](#branch-2)
|
|
298
|
-
* [Parameters](#parameters-
|
|
293
|
+
* [Parameters](#parameters-63)
|
|
299
294
|
* [hasBranches](#hasbranches)
|
|
300
295
|
* [branches](#branches-1)
|
|
301
|
-
* [Parameters](#parameters-
|
|
296
|
+
* [Parameters](#parameters-64)
|
|
302
297
|
* [createBranch](#createbranch-1)
|
|
303
|
-
* [Parameters](#parameters-
|
|
298
|
+
* [Parameters](#parameters-65)
|
|
304
299
|
* [addBranch](#addbranch)
|
|
305
|
-
* [Parameters](#parameters-
|
|
300
|
+
* [Parameters](#parameters-66)
|
|
306
301
|
* [deleteBranch](#deletebranch)
|
|
307
|
-
* [Parameters](#parameters-
|
|
302
|
+
* [Parameters](#parameters-67)
|
|
308
303
|
* [tag](#tag)
|
|
309
|
-
* [Parameters](#parameters-
|
|
304
|
+
* [Parameters](#parameters-68)
|
|
310
305
|
* [tags](#tags-1)
|
|
311
|
-
* [Parameters](#parameters-
|
|
306
|
+
* [Parameters](#parameters-69)
|
|
312
307
|
* [addTag](#addtag)
|
|
313
|
-
* [Parameters](#parameters-
|
|
308
|
+
* [Parameters](#parameters-70)
|
|
314
309
|
* [createPullRequest](#createpullrequest-1)
|
|
315
|
-
* [Parameters](#parameters-
|
|
310
|
+
* [Parameters](#parameters-71)
|
|
316
311
|
* [addPullRequest](#addpullrequest)
|
|
317
|
-
* [Parameters](#parameters-
|
|
312
|
+
* [Parameters](#parameters-72)
|
|
318
313
|
* [pullRequests](#pullrequests-1)
|
|
319
314
|
* [pullRequest](#pullrequest-1)
|
|
320
|
-
* [Parameters](#parameters-
|
|
315
|
+
* [Parameters](#parameters-73)
|
|
321
316
|
* [deletePullRequest](#deletepullrequest)
|
|
322
|
-
* [Parameters](#parameters-
|
|
317
|
+
* [Parameters](#parameters-74)
|
|
323
318
|
* [addHook](#addhook)
|
|
324
|
-
* [Parameters](#parameters-
|
|
319
|
+
* [Parameters](#parameters-75)
|
|
325
320
|
* [createHook](#createhook)
|
|
326
|
-
* [Parameters](#parameters-
|
|
321
|
+
* [Parameters](#parameters-76)
|
|
327
322
|
* [hooks](#hooks-1)
|
|
328
323
|
* [hook](#hook-1)
|
|
329
|
-
* [Parameters](#parameters-
|
|
324
|
+
* [Parameters](#parameters-77)
|
|
330
325
|
* [type](#type-2)
|
|
331
326
|
* [refId](#refid-1)
|
|
332
|
-
* [Parameters](#parameters-
|
|
327
|
+
* [Parameters](#parameters-78)
|
|
333
328
|
* [attributes](#attributes-3)
|
|
334
329
|
* [defaultBranchName](#defaultbranchname)
|
|
335
330
|
* [issuesURL](#issuesurl-2)
|
|
336
331
|
* [Review](#review)
|
|
337
332
|
* [SingleGroupProvider](#singlegroupprovider)
|
|
338
333
|
* [repository](#repository-4)
|
|
339
|
-
* [Parameters](#parameters-
|
|
334
|
+
* [Parameters](#parameters-79)
|
|
340
335
|
* [repositoryGroup](#repositorygroup-2)
|
|
341
|
-
* [Parameters](#parameters-
|
|
336
|
+
* [Parameters](#parameters-80)
|
|
342
337
|
* [repositoryGroups](#repositorygroups-1)
|
|
343
|
-
* [Parameters](#parameters-
|
|
338
|
+
* [Parameters](#parameters-81)
|
|
344
339
|
* [Tag](#tag-1)
|
|
345
340
|
* [refType](#reftype-1)
|
|
346
341
|
* [asArray](#asarray)
|
|
347
|
-
* [Parameters](#parameters-
|
|
342
|
+
* [Parameters](#parameters-82)
|
|
348
343
|
* [stripBaseName](#stripbasename)
|
|
349
|
-
* [Parameters](#parameters-
|
|
344
|
+
* [Parameters](#parameters-83)
|
|
350
345
|
* [stripBaseNames](#stripbasenames)
|
|
351
|
-
* [Parameters](#parameters-
|
|
346
|
+
* [Parameters](#parameters-84)
|
|
352
347
|
* [generateBranchName](#generatebranchname)
|
|
353
|
-
* [Parameters](#parameters-
|
|
348
|
+
* [Parameters](#parameters-85)
|
|
354
349
|
|
|
355
350
|
## Application
|
|
356
351
|
|
|
@@ -486,6 +481,31 @@ Filters out null, undefined and empty strings
|
|
|
486
481
|
|
|
487
482
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** keys renamed after mapping
|
|
488
483
|
|
|
484
|
+
## description
|
|
485
|
+
|
|
486
|
+
The description of the object content.
|
|
487
|
+
|
|
488
|
+
## id
|
|
489
|
+
|
|
490
|
+
Unique id within the provider.
|
|
491
|
+
|
|
492
|
+
## uuid
|
|
493
|
+
|
|
494
|
+
Unique id.
|
|
495
|
+
|
|
496
|
+
## body
|
|
497
|
+
|
|
498
|
+
The description of the pull request.
|
|
499
|
+
|
|
500
|
+
## title
|
|
501
|
+
|
|
502
|
+
The one line description of the pull request.
|
|
503
|
+
|
|
504
|
+
## priority
|
|
505
|
+
|
|
506
|
+
In case there are several providers able to support a given source which one sould be used ?
|
|
507
|
+
this defines the order
|
|
508
|
+
|
|
489
509
|
## BaseObject
|
|
490
510
|
|
|
491
511
|
### Parameters
|
|
@@ -562,24 +582,6 @@ Map attributes between external and internal representation.
|
|
|
562
582
|
|
|
563
583
|
Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
564
584
|
|
|
565
|
-
## description
|
|
566
|
-
|
|
567
|
-
The description of the repository content.
|
|
568
|
-
|
|
569
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
570
|
-
|
|
571
|
-
## id
|
|
572
|
-
|
|
573
|
-
Unique id within the provider.
|
|
574
|
-
|
|
575
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
576
|
-
|
|
577
|
-
## uuid
|
|
578
|
-
|
|
579
|
-
Unique id.
|
|
580
|
-
|
|
581
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
582
|
-
|
|
583
585
|
## MessageDestination
|
|
584
586
|
|
|
585
587
|
Type: [Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)
|
|
@@ -859,11 +861,6 @@ Creates a new provider for a given set of options.
|
|
|
859
861
|
|
|
860
862
|
Returns **[BaseProvider](#baseprovider)** newly created provider or undefined if options are not sufficient to construct a provider
|
|
861
863
|
|
|
862
|
-
## priority
|
|
863
|
-
|
|
864
|
-
In case there are several providers able to support a given source which one sould be used ?
|
|
865
|
-
this defines the order
|
|
866
|
-
|
|
867
864
|
## name
|
|
868
865
|
|
|
869
866
|
Name of the provider.
|
|
@@ -1303,16 +1300,6 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
|
|
|
1303
1300
|
|
|
1304
1301
|
Returns **[Repository](#repository)** destination repository
|
|
1305
1302
|
|
|
1306
|
-
### equals
|
|
1307
|
-
|
|
1308
|
-
Check for equality
|
|
1309
|
-
|
|
1310
|
-
#### Parameters
|
|
1311
|
-
|
|
1312
|
-
* `other` **[PullRequest](#pullrequest)** 
|
|
1313
|
-
|
|
1314
|
-
Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if number and repository are equal
|
|
1315
|
-
|
|
1316
1303
|
### delete
|
|
1317
1304
|
|
|
1318
1305
|
* **See**: [Repository#deletePullRequest](#repositorydeletepullrequest)
|
|
@@ -1387,18 +1374,6 @@ Open a pull request
|
|
|
1387
1374
|
* `destination` **[Branch](#branch)** 
|
|
1388
1375
|
* `options` **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** 
|
|
1389
1376
|
|
|
1390
|
-
## title
|
|
1391
|
-
|
|
1392
|
-
The one line description of the pull request.
|
|
1393
|
-
|
|
1394
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1395
|
-
|
|
1396
|
-
## body
|
|
1397
|
-
|
|
1398
|
-
The description of the pull request.
|
|
1399
|
-
|
|
1400
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1401
|
-
|
|
1402
1377
|
## state
|
|
1403
1378
|
|
|
1404
1379
|
state of the pull request.
|
|
@@ -1589,24 +1564,6 @@ Map attributes between external and internal representation.
|
|
|
1589
1564
|
|
|
1590
1565
|
Type of the repository group either User or Organization.
|
|
1591
1566
|
|
|
1592
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1593
|
-
|
|
1594
|
-
## url
|
|
1595
|
-
|
|
1596
|
-
api url
|
|
1597
|
-
|
|
1598
|
-
## url
|
|
1599
|
-
|
|
1600
|
-
URL of the repository
|
|
1601
|
-
|
|
1602
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1603
|
-
|
|
1604
|
-
## avatarURL
|
|
1605
|
-
|
|
1606
|
-
Avatar.
|
|
1607
|
-
|
|
1608
|
-
Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
|
|
1609
|
-
|
|
1610
1567
|
## RepositoryOwner
|
|
1611
1568
|
|
|
1612
1569
|
Mixin to define a class able to handle a collection of repositories.
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "32.3.
|
|
3
|
+
"version": "32.3.19",
|
|
4
4
|
"publishConfig": {
|
|
5
5
|
"access": "public"
|
|
6
6
|
},
|
|
@@ -31,14 +31,14 @@
|
|
|
31
31
|
"lint:tsc": "tsc --allowJs --checkJs --noEmit -t esnext -m esnext ./src/*.mjs"
|
|
32
32
|
},
|
|
33
33
|
"dependencies": {
|
|
34
|
-
"matching-iterator": "^2.0.
|
|
34
|
+
"matching-iterator": "^2.0.11"
|
|
35
35
|
},
|
|
36
36
|
"devDependencies": {
|
|
37
37
|
"ava": "^5.1.0",
|
|
38
38
|
"browser-ava": "^1.3.13",
|
|
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.27",
|
|
42
42
|
"semantic-release": "^19.0.5",
|
|
43
43
|
"typescript": "^4.9.4"
|
|
44
44
|
},
|
package/src/attribute.mjs
CHANGED
|
@@ -135,6 +135,37 @@ export function defaultValues(attributes, object) {
|
|
|
135
135
|
);
|
|
136
136
|
}
|
|
137
137
|
|
|
138
|
+
/**
|
|
139
|
+
* Split property path into tokens
|
|
140
|
+
* @param {string} string
|
|
141
|
+
* @return {Iterator<string>}
|
|
142
|
+
*/
|
|
143
|
+
function* tokens(string) {
|
|
144
|
+
let identifier = "";
|
|
145
|
+
|
|
146
|
+
for (const c of string) {
|
|
147
|
+
switch (c) {
|
|
148
|
+
case "\t":
|
|
149
|
+
case " ": break;
|
|
150
|
+
case ".":
|
|
151
|
+
case "[":
|
|
152
|
+
case "]":
|
|
153
|
+
if (identifier.length) {
|
|
154
|
+
yield identifier;
|
|
155
|
+
identifier = "";
|
|
156
|
+
}
|
|
157
|
+
yield c;
|
|
158
|
+
break;
|
|
159
|
+
default:
|
|
160
|
+
identifier += c;
|
|
161
|
+
}
|
|
162
|
+
}
|
|
163
|
+
|
|
164
|
+
if (identifier.length) {
|
|
165
|
+
yield identifier;
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
|
|
138
169
|
/**
|
|
139
170
|
* Set Object attribute.
|
|
140
171
|
* The name may be a property path like 'a.b.c'.
|
|
@@ -143,7 +174,6 @@ export function defaultValues(attributes, object) {
|
|
|
143
174
|
* @param {any} value
|
|
144
175
|
*/
|
|
145
176
|
export function setAttribute(object, name, value) {
|
|
146
|
-
|
|
147
177
|
let lastObject = object;
|
|
148
178
|
let lastKey;
|
|
149
179
|
|
|
@@ -169,37 +199,6 @@ export function setAttribute(object, name, value) {
|
|
|
169
199
|
lastObject[lastKey] = value;
|
|
170
200
|
}
|
|
171
201
|
|
|
172
|
-
/**
|
|
173
|
-
* Split property path into tokens
|
|
174
|
-
* @param {string} string
|
|
175
|
-
* @return {Iterator<string>}
|
|
176
|
-
*/
|
|
177
|
-
function* tokens(string) {
|
|
178
|
-
let identifier = "";
|
|
179
|
-
|
|
180
|
-
for (const c of string) {
|
|
181
|
-
switch (c) {
|
|
182
|
-
case "\t":
|
|
183
|
-
case " ": break;
|
|
184
|
-
case ".":
|
|
185
|
-
case "[":
|
|
186
|
-
case "]":
|
|
187
|
-
if (identifier.length) {
|
|
188
|
-
yield identifier;
|
|
189
|
-
identifier = "";
|
|
190
|
-
}
|
|
191
|
-
yield c;
|
|
192
|
-
break;
|
|
193
|
-
default:
|
|
194
|
-
identifier += c;
|
|
195
|
-
}
|
|
196
|
-
}
|
|
197
|
-
|
|
198
|
-
if (identifier.length) {
|
|
199
|
-
yield identifier;
|
|
200
|
-
}
|
|
201
|
-
}
|
|
202
|
-
|
|
203
202
|
/**
|
|
204
203
|
* Deliver attribute value.
|
|
205
204
|
* The name may be a property path like 'a.b.c'.
|
package/src/attributes.mjs
CHANGED
package/src/branch.mjs
CHANGED
package/src/hook.mjs
CHANGED
|
@@ -104,7 +104,7 @@ export class MultiGroupProvider extends BaseProvider {
|
|
|
104
104
|
* @return {RepositoryGroup}
|
|
105
105
|
*/
|
|
106
106
|
addRepositoryGroup(name, options) {
|
|
107
|
-
return this.#repositoryGroups.get(this.normalizeGroupName(name, true)) ||
|
|
107
|
+
return this.#repositoryGroups.get(this.normalizeGroupName(name, true)) || new this.repositoryGroupClass(this, name, options);
|
|
108
108
|
}
|
|
109
109
|
|
|
110
110
|
_addRepositoryGroup(repositoryGroup) {
|
package/src/owned-object.mjs
CHANGED
|
@@ -13,15 +13,20 @@ export class OwnedObject extends NamedObject {
|
|
|
13
13
|
return "_add" + this.name;
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
|
|
17
|
-
|
|
18
|
-
|
|
19
|
-
owner: { value: owner }
|
|
20
|
-
});
|
|
16
|
+
static get deleteMethodName() {
|
|
17
|
+
return "_delete" + this.name;
|
|
18
|
+
}
|
|
21
19
|
|
|
20
|
+
constructor(owner, name, options, additionalProperties) {
|
|
21
|
+
super(name, options, additionalProperties);
|
|
22
|
+
this.owner = owner;
|
|
22
23
|
owner[this.constructor.addMethodName](this);
|
|
23
24
|
}
|
|
24
25
|
|
|
26
|
+
delete() {
|
|
27
|
+
this.owner[this.constructor.deleteMethodName](this);
|
|
28
|
+
}
|
|
29
|
+
|
|
25
30
|
/**
|
|
26
31
|
* Check for equality.
|
|
27
32
|
* @param {OwnedObject} other
|
package/src/pull-request.mjs
CHANGED
|
@@ -31,6 +31,10 @@ export class PullRequest extends OwnedObject {
|
|
|
31
31
|
return "_addPullRequest";
|
|
32
32
|
}
|
|
33
33
|
|
|
34
|
+
static get deleteMethodName() {
|
|
35
|
+
return "_deletePullRequest";
|
|
36
|
+
}
|
|
37
|
+
|
|
34
38
|
static get type() {
|
|
35
39
|
return "pull-request";
|
|
36
40
|
}
|
|
@@ -39,14 +43,6 @@ export class PullRequest extends OwnedObject {
|
|
|
39
43
|
return "pullRequests";
|
|
40
44
|
}
|
|
41
45
|
|
|
42
|
-
/**
|
|
43
|
-
* All valid states
|
|
44
|
-
* @return {Set<string>} valid states
|
|
45
|
-
*/
|
|
46
|
-
static get validStates() {
|
|
47
|
-
return new Set(["OPEN", "MERGED", "CLOSED"]);
|
|
48
|
-
}
|
|
49
|
-
|
|
50
46
|
/**
|
|
51
47
|
* States to list pull request by default
|
|
52
48
|
* @return {Set<string>} states to list by default
|
|
@@ -103,6 +99,7 @@ export class PullRequest extends OwnedObject {
|
|
|
103
99
|
state: {
|
|
104
100
|
...state,
|
|
105
101
|
default: "OPEN",
|
|
102
|
+
values: new Set(["OPEN", "MERGED", "CLOSED"]),
|
|
106
103
|
writable: true
|
|
107
104
|
},
|
|
108
105
|
|
|
@@ -143,7 +140,7 @@ export class PullRequest extends OwnedObject {
|
|
|
143
140
|
state: {
|
|
144
141
|
set(value) {
|
|
145
142
|
value = value.toUpperCase();
|
|
146
|
-
if (this.constructor.
|
|
143
|
+
if (this.constructor.attributes.state.values.has(value)) {
|
|
147
144
|
state = value;
|
|
148
145
|
} else throw new Error(`Invalid Pull Request state ${value}`);
|
|
149
146
|
},
|
package/src/ref.mjs
CHANGED
package/src/repository-group.mjs
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
import { RepositoryOwner } from "./repository-owner.mjs";
|
|
2
2
|
import { OwnedObject } from "./owned-object.mjs";
|
|
3
3
|
import { BaseProvider } from "./base-provider.mjs";
|
|
4
|
-
import { url, boolean_attribute } from "./attributes.mjs";
|
|
4
|
+
import { url, boolean_attribute, type } from "./attributes.mjs";
|
|
5
5
|
|
|
6
6
|
/**
|
|
7
7
|
* Abstract repository collection.
|
|
@@ -23,6 +23,10 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
|
|
|
23
23
|
return "_addRepositoryGroup";
|
|
24
24
|
}
|
|
25
25
|
|
|
26
|
+
static get deleteMethodName() {
|
|
27
|
+
return "_deleteRepositoryGroup";
|
|
28
|
+
}
|
|
29
|
+
|
|
26
30
|
static get type() {
|
|
27
31
|
return "repository-group";
|
|
28
32
|
}
|
|
@@ -37,18 +41,10 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
|
|
|
37
41
|
|
|
38
42
|
/**
|
|
39
43
|
* Type of the repository group either User or Organization.
|
|
40
|
-
* @return {string}
|
|
41
44
|
*/
|
|
42
|
-
type
|
|
43
|
-
|
|
45
|
+
type,
|
|
44
46
|
url,
|
|
45
|
-
|
|
46
|
-
/**
|
|
47
|
-
* Avatar.
|
|
48
|
-
* @return {string}
|
|
49
|
-
*/
|
|
50
|
-
avatarURL: { ...url },
|
|
51
|
-
|
|
47
|
+
avatarURL: url,
|
|
52
48
|
isAdmin: boolean_attribute
|
|
53
49
|
};
|
|
54
50
|
}
|
|
@@ -60,11 +56,6 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
|
|
|
60
56
|
return {};
|
|
61
57
|
}
|
|
62
58
|
|
|
63
|
-
get provider()
|
|
64
|
-
{
|
|
65
|
-
return this.owner;
|
|
66
|
-
}
|
|
67
|
-
|
|
68
59
|
get isAdmin() {
|
|
69
60
|
return false;
|
|
70
61
|
}
|
package/src/repository.mjs
CHANGED
|
@@ -8,13 +8,13 @@ import { url, size, language, boolean_attribute } from "./attributes.mjs";
|
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Abstract repository
|
|
11
|
-
* @param {
|
|
11
|
+
* @param {RepositoryOwner} owner
|
|
12
12
|
* @param {string} name (#branch) will be removed
|
|
13
13
|
* @param {Object} options
|
|
14
14
|
* @param {string} [options.description] human readable description
|
|
15
15
|
* @param {string} [options.id] internal id
|
|
16
16
|
*
|
|
17
|
-
* @property {
|
|
17
|
+
* @property {RepositoryOwner} owner
|
|
18
18
|
* @property {string} name without (#branch)
|
|
19
19
|
* @property {string} [description] from options.description
|
|
20
20
|
* @property {string} [id] from options.id
|
|
@@ -28,6 +28,11 @@ export class Repository extends OwnedObject {
|
|
|
28
28
|
return "_addRepository";
|
|
29
29
|
}
|
|
30
30
|
|
|
31
|
+
static get deleteMethodName()
|
|
32
|
+
{
|
|
33
|
+
return "_deleteRepository";
|
|
34
|
+
}
|
|
35
|
+
|
|
31
36
|
static get collectionName() {
|
|
32
37
|
return "repositories";
|
|
33
38
|
}
|