repository-provider 32.4.7 → 32.4.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
@@ -64,11 +64,11 @@ 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
- * [body](#body)
70
- * [title](#title)
71
- * [priority](#priority)
67
+ * [description\_attribute](#description_attribute)
68
+ * [id\_attribute](#id_attribute)
69
+ * [body\_attribute](#body_attribute)
70
+ * [title\_attribute](#title_attribute)
71
+ * [priority\_attribute](#priority_attribute)
72
72
  * [BaseObject](#baseobject)
73
73
  * [Parameters](#parameters-8)
74
74
  * [update](#update)
@@ -185,7 +185,6 @@ console.log(await readme.getString());
185
185
  * [Parameters](#parameters-41)
186
186
  * [toJSON](#tojson-1)
187
187
  * [attributes](#attributes-1)
188
- * [homePageURL](#homepageurl)
189
188
  * [OwnedObject](#ownedobject)
190
189
  * [Parameters](#parameters-42)
191
190
  * [delete](#delete-1)
@@ -252,7 +251,7 @@ console.log(await readme.getString());
252
251
  * [fullCondensedName](#fullcondensedname-1)
253
252
  * [toString](#tostring-1)
254
253
  * [issuesURL](#issuesurl)
255
- * [homePageURL](#homepageurl-1)
254
+ * [homePageURL](#homepageurl)
256
255
  * [isLocked](#islocked)
257
256
  * [isArchived](#isarchived)
258
257
  * [isDisabled](#isdisabled)
@@ -264,6 +263,7 @@ console.log(await readme.getString());
264
263
  * [Properties](#properties-9)
265
264
  * [attributeMapping](#attributemapping-1)
266
265
  * [type](#type-1)
266
+ * [homePageURL](#homepageurl-1)
267
267
  * [RepositoryOwner](#repositoryowner)
268
268
  * [Parameters](#parameters-57)
269
269
  * [Repository](#repository-3)
@@ -480,23 +480,23 @@ Filters out null, undefined and empty strings
480
480
 
481
481
  Returns **[Object](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Object)** keys renamed after mapping
482
482
 
483
- ## description
483
+ ## description\_attribute
484
484
 
485
485
  The description of the object content.
486
486
 
487
- ## id
487
+ ## id\_attribute
488
488
 
489
489
  Unique id within the provider.
490
490
 
491
- ## body
491
+ ## body\_attribute
492
492
 
493
493
  The description of the pull request.
494
494
 
495
- ## title
495
+ ## title\_attribute
496
496
 
497
497
  The one line description of the pull request.
498
498
 
499
- ## priority
499
+ ## priority\_attribute
500
500
 
501
501
  In case there are several providers able to support a given source which one sould be used ?
502
502
  this defines the order
@@ -1113,12 +1113,6 @@ Provided name and all defined attributes.
1113
1113
 
1114
1114
  options
1115
1115
 
1116
- ## homePageURL
1117
-
1118
- The url of home page.
1119
-
1120
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
1121
-
1122
1116
  ## OwnedObject
1123
1117
 
1124
1118
  **Extends NamedObject**
@@ -1559,6 +1553,12 @@ Map attributes between external and internal representation.
1559
1553
 
1560
1554
  Type of the repository group either User or Organization.
1561
1555
 
1556
+ ## homePageURL
1557
+
1558
+ The url of home page.
1559
+
1560
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** 
1561
+
1562
1562
  ## RepositoryOwner
1563
1563
 
1564
1564
  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.4.7",
3
+ "version": "32.4.9",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -35,7 +35,7 @@
35
35
  },
36
36
  "devDependencies": {
37
37
  "ava": "^5.1.0",
38
- "browser-ava": "^1.3.13",
38
+ "browser-ava": "^1.3.14",
39
39
  "c8": "^7.12.0",
40
40
  "documentation": "^14.0.1",
41
41
  "repository-provider-test-support": "^2.2.30",
@@ -30,8 +30,8 @@ export class BaseObject {
30
30
  */
31
31
  static get attributes() {
32
32
  return {
33
- description: description_attribute,
34
- id: id_attribute
33
+ id: id_attribute,
34
+ description: description_attribute
35
35
  };
36
36
  }
37
37
 
@@ -18,13 +18,7 @@ export class NamedObject extends BaseObject {
18
18
  return {
19
19
  name: name_attribute,
20
20
  id: id_attribute,
21
- description: description_attribute,
22
-
23
- /**
24
- * The url of home page.
25
- * @return {string}
26
- */
27
- homePageURL: { ...url_attribute, writable: true }
21
+ description: description_attribute
28
22
  };
29
23
  }
30
24
 
@@ -13,6 +13,11 @@ export class OwnedObject extends NamedObject {
13
13
  return "_add" + this.name;
14
14
  }
15
15
 
16
+ /**
17
+ * Method name to be called to unregister one instance in the owner.
18
+ * sample: Application => _deleteApplication
19
+ * @return {string}
20
+ */
16
21
  static get deleteMethodName() {
17
22
  return "_delete" + this.name;
18
23
  }
package/src/ref.mjs CHANGED
@@ -1,5 +1,5 @@
1
1
  import { OwnedObject } from "./owned-object.mjs";
2
- import { boolean_read_only_attribute } from "./attributes.mjs";
2
+ import { boolean_attribute } from "./attributes.mjs";
3
3
 
4
4
  /**
5
5
  * @typedef {Object} ContentEntry
@@ -22,7 +22,7 @@ export class Ref extends OwnedObject {
22
22
  * Can the ref be modified.
23
23
  * @return {string}
24
24
  */
25
- isProtected: boolean_read_only_attribute
25
+ isProtected: boolean_attribute
26
26
  };
27
27
  }
28
28
 
@@ -48,7 +48,12 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
48
48
  type: type_attribute,
49
49
  url: url_attribute,
50
50
  avatarURL: url_attribute,
51
- isAdmin: boolean_attribute
51
+ isAdmin: boolean_attribute,
52
+ /**
53
+ * The url of home page.
54
+ * @return {string}
55
+ */
56
+ homePageURL: { ...url_attribute, writable: true }
52
57
  };
53
58
  }
54
59
 
@@ -42,13 +42,10 @@ export function RepositoryOwner(base) {
42
42
  * @return {Promise<Repository>}
43
43
  */
44
44
  async repository(name) {
45
- if (name === undefined) {
46
- return undefined;
45
+ if (name !== undefined) {
46
+ await this.initializeRepositories();
47
+ return this.#repositories.get(this.normalizeRepositoryName(name, true));
47
48
  }
48
-
49
- await this.initializeRepositories();
50
-
51
- return this.#repositories.get(this.normalizeRepositoryName(name, true));
52
49
  }
53
50
 
54
51
  /**
@@ -162,7 +159,7 @@ export function RepositoryOwner(base) {
162
159
  * @return {Promise<Repository>} newly created repository
163
160
  */
164
161
  addRepository(name, options) {
165
- return this.#repositories.get(this.normalizeRepositoryName(name, true)) || new this.repositoryClass(this, name, options);
162
+ return this.#repositories.get(this.normalizeRepositoryName(name, true)) || new this.repositoryClass(this, name, options);
166
163
  }
167
164
 
168
165
  _addRepository(repository)