repository-provider 28.3.6 → 28.3.9

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 CHANGED
@@ -2,12 +2,12 @@
2
2
  [![License](https://img.shields.io/badge/License-BSD%203--Clause-blue.svg)](https://opensource.org/licenses/BSD-3-Clause)
3
3
  [![minified size](https://badgen.net/bundlephobia/min/repository-provider)](https://bundlephobia.com/result?p=repository-provider)
4
4
  [![downloads](http://img.shields.io/npm/dm/repository-provider.svg?style=flat-square)](https://npmjs.org/package/repository-provider)
5
- [![GitHub Issues](https://img.shields.io/github/issues/arlac77/repository-provider.svg?style=flat-square)](https://github.com/arlac77/repository-provider/issues)
6
- [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Farlac77%2Frepository-provider%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/arlac77/repository-provider/goto)
5
+ [![GitHub Issues](https://img.shields.io/github/issues/repository-provider/repository-provider.svg?style=flat-square)](https://github.com/repository-provider/repository-provider/issues)
6
+ [![Build Status](https://img.shields.io/endpoint.svg?url=https%3A%2F%2Factions-badge.atrox.dev%2Frepository-provider%2Frepository-provider%2Fbadge\&style=flat)](https://actions-badge.atrox.dev/repository-provider/repository-provider/goto)
7
7
  [![Styled with prettier](https://img.shields.io/badge/styled_with-prettier-ff69b4.svg)](https://github.com/prettier/prettier)
8
8
  [![Commitizen friendly](https://img.shields.io/badge/commitizen-friendly-brightgreen.svg)](http://commitizen.github.io/cz-cli/)
9
- [![Known Vulnerabilities](https://snyk.io/test/github/arlac77/repository-provider/badge.svg)](https://snyk.io/test/github/arlac77/repository-provider)
10
- [![Coverage Status](https://coveralls.io/repos/arlac77/repository-provider/badge.svg)](https://coveralls.io/github/arlac77/repository-provider)
9
+ [![Known Vulnerabilities](https://snyk.io/test/github/repository-provider/repository-provider/badge.svg)](https://snyk.io/test/github/repository-provider/repository-provider)
10
+ [![Coverage Status](https://coveralls.io/repos/repository-provider/repository-provider/badge.svg)](https://coveralls.io/github/repository-provider/repository-provider)
11
11
 
12
12
  # repository-provider
13
13
 
@@ -65,6 +65,8 @@ console.log(await readme.getString());
65
65
  * [BaseObject](#baseobject)
66
66
  * [Parameters](#parameters-7)
67
67
  * [update](#update)
68
+ * [toString](#tostring)
69
+ * [isWritable](#iswritable)
68
70
  * [equals](#equals)
69
71
  * [Parameters](#parameters-8)
70
72
  * [provider](#provider)
@@ -152,6 +154,7 @@ console.log(await readme.getString());
152
154
  * [Properties](#properties-3)
153
155
  * [url](#url-1)
154
156
  * [refType](#reftype)
157
+ * [isWritable](#iswritable-1)
155
158
  * [isDefault](#isdefault)
156
159
  * [delete](#delete)
157
160
  * [commit](#commit)
@@ -195,7 +198,6 @@ console.log(await readme.getString());
195
198
  * [Parameters](#parameters-46)
196
199
  * [displayName](#displayname)
197
200
  * [fullName](#fullname-1)
198
- * [toString](#tostring)
199
201
  * [toJSON](#tojson-2)
200
202
  * [OwnedObject](#ownedobject)
201
203
  * [Parameters](#parameters-47)
@@ -256,7 +258,6 @@ console.log(await readme.getString());
256
258
  * [isArchived](#isarchived)
257
259
  * [isDisabled](#isdisabled)
258
260
  * [isProtected](#isprotected)
259
- * [isWritable](#iswritable)
260
261
  * [attributes](#attributes-1)
261
262
  * [isProtected](#isprotected-1)
262
263
  * [RepositoryGroup](#repositorygroup-1)
@@ -345,7 +346,6 @@ console.log(await readme.getString());
345
346
  * [Tag](#tag-1)
346
347
  * [Parameters](#parameters-85)
347
348
  * [refType](#reftype-1)
348
- * [isWritable](#iswritable-1)
349
349
  * [asArray](#asarray)
350
350
  * [Parameters](#parameters-86)
351
351
  * [stripBaseName](#stripbasename)
@@ -490,6 +490,16 @@ Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
490
490
 
491
491
  Save object attributes in the backing store.
492
492
 
493
+ ### toString
494
+
495
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
496
+
497
+ ### isWritable
498
+
499
+ By default cannot be written to.
500
+
501
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
502
+
493
503
  ### equals
494
504
 
495
505
  Check for equality
@@ -944,6 +954,10 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
944
954
 
945
955
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** heades
946
956
 
957
+ ### isWritable
958
+
959
+ Returns **any** true if not [isArchived](isArchived) and [isDisabled](isDisabled) and [isLocked](isLocked)
960
+
947
961
  ### isDefault
948
962
 
949
963
  Are we the default branch.
@@ -1174,10 +1188,6 @@ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/G
1174
1188
 
1175
1189
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name with owner name
1176
1190
 
1177
- ### toString
1178
-
1179
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
1180
-
1181
1191
  ### toJSON
1182
1192
 
1183
1193
  Provide name and all defined attributes.
@@ -1528,10 +1538,6 @@ Forwarded from the repository
1528
1538
 
1529
1539
  Returns **any** false
1530
1540
 
1531
- ### isWritable
1532
-
1533
- Returns **any** true if not [isArchived](isArchived) and [isDisabled](isDisabled) and [isLocked](isLocked)
1534
-
1535
1541
  ### attributes
1536
1542
 
1537
1543
  options
@@ -2012,12 +2018,6 @@ Tag refs
2012
2018
 
2013
2019
  Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** tags
2014
2020
 
2015
- ### isWritable
2016
-
2017
- Tags cannot be written to.
2018
-
2019
- Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
2020
-
2021
2021
  ## asArray
2022
2022
 
2023
2023
  Convert scalar into an array.
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "28.3.6",
3
+ "version": "28.3.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -81,6 +81,33 @@ export class BaseObject {
81
81
  */
82
82
  async update() {}
83
83
 
84
+ /**
85
+ * @return {string} name
86
+ */
87
+ toString() {
88
+ return this.name;
89
+ }
90
+
91
+ /**
92
+ * Beautified name use for human displaying only.
93
+ * @return {string} human readable name
94
+ */
95
+ get displayName() {
96
+ return this.name;
97
+ }
98
+
99
+ /**
100
+ * Complete name in the hierachy.
101
+ * @return {string}
102
+ */
103
+ get fullName() {
104
+ return this.name;
105
+ }
106
+
107
+ /**
108
+ * By default cannot be written to.
109
+ * @return {boolean} false
110
+ */
84
111
  get isWritable() {
85
112
  return false;
86
113
  }
@@ -405,14 +405,6 @@ export class BaseProvider extends BaseObject {
405
405
  return this.constructor.name;
406
406
  }
407
407
 
408
- /**
409
- * @return {string} name
410
- */
411
- get fullName()
412
- {
413
- return this.name;
414
- }
415
-
416
408
  /**
417
409
  * We are our own provider.
418
410
  * @return {BaseProvider} this
@@ -428,10 +420,6 @@ export class BaseProvider extends BaseObject {
428
420
  return "/";
429
421
  }
430
422
 
431
- toString() {
432
- return this.name;
433
- }
434
-
435
423
  /**
436
424
  * List all defined entries from attributes.
437
425
  * return {object}
package/src/branch.mjs CHANGED
@@ -16,9 +16,13 @@ import { Commit } from "./commit.mjs";
16
16
  * @property {string} name
17
17
  */
18
18
  export class Branch extends Ref {
19
+
20
+ static get registerInstanceMethodName() {
21
+ return "_addBranch";
22
+ }
23
+
19
24
  constructor(repository, name = repository.defaultBranchName, options) {
20
25
  super(repository, name, options);
21
- repository._addBranch(this);
22
26
  }
23
27
 
24
28
  /**
@@ -38,6 +42,19 @@ export class Branch extends Ref {
38
42
  return "heads";
39
43
  }
40
44
 
45
+ /**
46
+ *
47
+ * @return true if not {@link isArchived} and {@link isDisabled} and {@link isLocked}
48
+ */
49
+ get isWritable() {
50
+ return (
51
+ !this.isArchived &&
52
+ !this.isDisabled &&
53
+ !this.isLocked &&
54
+ !this.isProtected
55
+ );
56
+ }
57
+
41
58
  /**
42
59
  * Are we the default branch.
43
60
  * @return {boolean} true if name matches the repository default branch
@@ -29,29 +29,13 @@ export class NamedObject extends BaseObject {
29
29
  this.provider.equals(other.provider)
30
30
  );
31
31
  }
32
-
33
- /**
34
- * Beautified name use for human displaying only.
35
- * @return {string} human readable name
36
- */
37
- get displayName() {
38
- return this.name;
39
- }
40
-
41
32
  /**
42
33
  * @return {string} name with owner name
43
34
  */
44
35
  get fullName() {
45
36
  return this.owner.name + "/" + this.name;
46
37
  }
47
-
48
- /**
49
- * @return {string} name
50
- */
51
- toString() {
52
- return this.name;
53
- }
54
-
38
+
55
39
  /**
56
40
  * Provide name and all defined attributes.
57
41
  */
package/src/ref.mjs CHANGED
@@ -1,4 +1,4 @@
1
- import { NamedObject } from "./named-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
4
  * @typedef {Object} ContentEntry
@@ -9,7 +9,7 @@ import { NamedObject } from "./named-object.mjs";
9
9
  /**
10
10
  * Base for Branch and Tag
11
11
  */
12
- export class Ref extends NamedObject {
12
+ export class Ref extends OwnedObject {
13
13
  /**
14
14
  * options
15
15
  */
@@ -25,10 +25,6 @@ export class Ref extends NamedObject {
25
25
  };
26
26
  }
27
27
 
28
- constructor(repository, name, options) {
29
- super(name, options, { repository: { value: repository } });
30
- }
31
-
32
28
  /**
33
29
  * Check for equality.
34
30
  * @param {Ref} other
@@ -102,8 +98,8 @@ export class Ref extends NamedObject {
102
98
  * @see {@link Repository#owner}
103
99
  * @return {string}
104
100
  */
105
- get owner() {
106
- return this.repository;
101
+ get repository() {
102
+ return this.owner;
107
103
  }
108
104
 
109
105
  get slug() {
@@ -191,17 +187,4 @@ export class Ref extends NamedObject {
191
187
  get isProtected() {
192
188
  return false;
193
189
  }
194
-
195
- /**
196
- *
197
- * @return true if not {@link isArchived} and {@link isDisabled} and {@link isLocked}
198
- */
199
- get isWritable() {
200
- return (
201
- !this.isArchived &&
202
- !this.isDisabled &&
203
- !this.isLocked &&
204
- !this.isProtected
205
- );
206
- }
207
190
  }
package/src/tag.mjs CHANGED
@@ -4,9 +4,9 @@ import { Ref } from "./ref.mjs";
4
4
  * Tag refs
5
5
  */
6
6
  export class Tag extends Ref {
7
- constructor(repository, name, options) {
8
- super(repository, name, options);
9
- repository._addTag(this);
7
+
8
+ static get registerInstanceMethodName() {
9
+ return "_addTag";
10
10
  }
11
11
 
12
12
  /**
@@ -15,13 +15,4 @@ export class Tag extends Ref {
15
15
  get refType() {
16
16
  return "tags";
17
17
  }
18
-
19
- /**
20
- * Tags cannot be written to.
21
- * @return {boolean} false
22
- */
23
- get isWritable()
24
- {
25
- return false;
26
- }
27
18
  }