repository-provider 31.2.8 → 32.0.1

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
Files changed (3) hide show
  1. package/README.md +33 -43
  2. package/package.json +2 -2
  3. package/src/ref.mjs +12 -6
package/README.md CHANGED
@@ -240,14 +240,13 @@ console.log(await readme.getString());
240
240
  * [Ref](#ref)
241
241
  * [ref](#ref-1)
242
242
  * [refId](#refid)
243
- * [Parameters](#parameters-52)
244
243
  * [entries](#entries)
245
- * [Parameters](#parameters-53)
244
+ * [Parameters](#parameters-52)
246
245
  * [asyncIterator](#asynciterator)
247
246
  * [maybeEntry](#maybeentry)
248
- * [Parameters](#parameters-54)
247
+ * [Parameters](#parameters-53)
249
248
  * [entry](#entry)
250
- * [Parameters](#parameters-55)
249
+ * [Parameters](#parameters-54)
251
250
  * [repository](#repository-2)
252
251
  * [fullName](#fullname-3)
253
252
  * [fullCondensedName](#fullcondensedname-1)
@@ -261,7 +260,7 @@ console.log(await readme.getString());
261
260
  * [attributes](#attributes-2)
262
261
  * [isProtected](#isprotected-1)
263
262
  * [RepositoryGroup](#repositorygroup-1)
264
- * [Parameters](#parameters-56)
263
+ * [Parameters](#parameters-55)
265
264
  * [Properties](#properties-9)
266
265
  * [attributeMapping](#attributemapping-1)
267
266
  * [type](#type-1)
@@ -269,20 +268,20 @@ console.log(await readme.getString());
269
268
  * [url](#url-4)
270
269
  * [avatarURL](#avatarurl)
271
270
  * [RepositoryOwner](#repositoryowner)
272
- * [Parameters](#parameters-57)
271
+ * [Parameters](#parameters-56)
273
272
  * [Repository](#repository-3)
274
- * [Parameters](#parameters-58)
273
+ * [Parameters](#parameters-57)
275
274
  * [Properties](#properties-10)
276
275
  * [fullName](#fullname-4)
277
276
  * [slug](#slug)
278
277
  * [entry](#entry-1)
279
- * [Parameters](#parameters-59)
278
+ * [Parameters](#parameters-58)
280
279
  * [entries](#entries-1)
281
- * [Parameters](#parameters-60)
280
+ * [Parameters](#parameters-59)
282
281
  * [maybeEntry](#maybeentry-1)
283
- * [Parameters](#parameters-61)
282
+ * [Parameters](#parameters-60)
284
283
  * [commits](#commits)
285
- * [Parameters](#parameters-62)
284
+ * [Parameters](#parameters-61)
286
285
  * [cloneURL](#cloneurl)
287
286
  * [issuesURL](#issuesurl-1)
288
287
  * [homePageURL](#homepageurl-2)
@@ -293,63 +292,62 @@ console.log(await readme.getString());
293
292
  * [delete](#delete-2)
294
293
  * [defaultBranch](#defaultbranch)
295
294
  * [branch](#branch-2)
296
- * [Parameters](#parameters-63)
295
+ * [Parameters](#parameters-62)
297
296
  * [hasBranches](#hasbranches)
298
297
  * [branches](#branches-1)
299
- * [Parameters](#parameters-64)
298
+ * [Parameters](#parameters-63)
300
299
  * [createBranch](#createbranch-1)
301
- * [Parameters](#parameters-65)
300
+ * [Parameters](#parameters-64)
302
301
  * [addBranch](#addbranch)
303
- * [Parameters](#parameters-66)
302
+ * [Parameters](#parameters-65)
304
303
  * [deleteBranch](#deletebranch)
305
- * [Parameters](#parameters-67)
304
+ * [Parameters](#parameters-66)
306
305
  * [tag](#tag)
307
- * [Parameters](#parameters-68)
306
+ * [Parameters](#parameters-67)
308
307
  * [tags](#tags-1)
309
- * [Parameters](#parameters-69)
308
+ * [Parameters](#parameters-68)
310
309
  * [addTag](#addtag)
311
- * [Parameters](#parameters-70)
310
+ * [Parameters](#parameters-69)
312
311
  * [createPullRequest](#createpullrequest-1)
313
- * [Parameters](#parameters-71)
312
+ * [Parameters](#parameters-70)
314
313
  * [addPullRequest](#addpullrequest)
315
- * [Parameters](#parameters-72)
314
+ * [Parameters](#parameters-71)
316
315
  * [pullRequests](#pullrequests-1)
317
316
  * [pullRequest](#pullrequest-1)
318
- * [Parameters](#parameters-73)
317
+ * [Parameters](#parameters-72)
319
318
  * [deletePullRequest](#deletepullrequest)
320
- * [Parameters](#parameters-74)
319
+ * [Parameters](#parameters-73)
321
320
  * [addHook](#addhook)
322
- * [Parameters](#parameters-75)
321
+ * [Parameters](#parameters-74)
323
322
  * [createHook](#createhook)
324
- * [Parameters](#parameters-76)
323
+ * [Parameters](#parameters-75)
325
324
  * [hooks](#hooks-1)
326
325
  * [hook](#hook-1)
327
- * [Parameters](#parameters-77)
326
+ * [Parameters](#parameters-76)
328
327
  * [type](#type-2)
329
328
  * [refId](#refid-1)
330
- * [Parameters](#parameters-78)
331
- * [toJSON](#tojson-2)
329
+ * [Parameters](#parameters-77)
332
330
  * [attributes](#attributes-3)
333
331
  * [defaultBranchName](#defaultbranchname)
334
332
  * [issuesURL](#issuesurl-2)
335
333
  * [Review](#review)
336
334
  * [SingleGroupProvider](#singlegroupprovider)
337
335
  * [repository](#repository-4)
338
- * [Parameters](#parameters-79)
336
+ * [Parameters](#parameters-78)
339
337
  * [repositoryGroup](#repositorygroup-2)
340
- * [Parameters](#parameters-80)
338
+ * [Parameters](#parameters-79)
341
339
  * [repositoryGroups](#repositorygroups-1)
342
- * [Parameters](#parameters-81)
340
+ * [Parameters](#parameters-80)
343
341
  * [Tag](#tag-1)
344
342
  * [refType](#reftype-1)
345
343
  * [asArray](#asarray)
346
- * [Parameters](#parameters-82)
344
+ * [Parameters](#parameters-81)
347
345
  * [stripBaseName](#stripbasename)
348
- * [Parameters](#parameters-83)
346
+ * [Parameters](#parameters-82)
349
347
  * [stripBaseNames](#stripbasenames)
350
- * [Parameters](#parameters-84)
348
+ * [Parameters](#parameters-83)
351
349
  * [generateBranchName](#generatebranchname)
352
- * [Parameters](#parameters-85)
350
+ * [Parameters](#parameters-84)
353
351
 
354
352
  ## Application
355
353
 
@@ -1431,10 +1429,6 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
1431
1429
 
1432
1430
  Get sha of a ref.
1433
1431
 
1434
- #### Parameters
1435
-
1436
- * `ref` **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** (optional, default `this.ref`)
1437
-
1438
1432
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** sha of the ref
1439
1433
 
1440
1434
  ### entries
@@ -1920,10 +1914,6 @@ Get sha of a ref.
1920
1914
 
1921
1915
  Returns **[Promise](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Promise)<[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)>** sha of the ref
1922
1916
 
1923
- ### toJSON
1924
-
1925
- Provide name and all defined attributes
1926
-
1927
1917
  ### attributes
1928
1918
 
1929
1919
  options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "31.2.8",
3
+ "version": "32.0.1",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,7 +36,7 @@
36
36
  "ava": "^4.3.0",
37
37
  "c8": "^7.11.3",
38
38
  "documentation": "^13.2.5",
39
- "repository-provider-test-support": "^2.2.5",
39
+ "repository-provider-test-support": "^2.2.8",
40
40
  "semantic-release": "^19.0.3",
41
41
  "typescript": "^4.7.4"
42
42
  },
package/src/ref.mjs CHANGED
@@ -18,10 +18,17 @@ export class Ref extends OwnedObject {
18
18
  ...super.attributes,
19
19
 
20
20
  /**
21
- * Can the branch be modified.
21
+ * Can the ref be modified.
22
22
  * @return {string}
23
23
  */
24
- isProtected: { type: "boolean" }
24
+ isProtected: { type: "boolean", default: false }
25
+ };
26
+ }
27
+
28
+ static get attributeMapping() {
29
+ return {
30
+ ...super.attributeMapping,
31
+ protected: "isProtected"
25
32
  };
26
33
  }
27
34
 
@@ -38,12 +45,11 @@ export class Ref extends OwnedObject {
38
45
  }
39
46
 
40
47
  /**
41
- * Get sha of a ref.
42
- * @param {string} ref
48
+ * Get sha of our ref.
43
49
  * @return {Promise<string>} sha of the ref
44
50
  */
45
- async refId(ref = this.ref) {
46
- return this.owner.refId(ref);
51
+ get refId() {
52
+ return this.owner.refId(this.ref);
47
53
  }
48
54
 
49
55
  /**