repository-provider 28.3.8 → 28.3.11

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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "28.3.8",
3
+ "version": "28.3.11",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -88,6 +88,22 @@ export class BaseObject {
88
88
  return this.name;
89
89
  }
90
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
+
91
107
  /**
92
108
  * By default cannot be written to.
93
109
  * @return {boolean} false
@@ -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
@@ -29,15 +29,6 @@ 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
  */
@@ -5,9 +5,9 @@ import { NamedObject } from "./named-object.mjs";
5
5
  */
6
6
  export class OwnedObject extends NamedObject {
7
7
  /**
8
- * Method name to be called to register one instance in the owner.
8
+ * Method name to be called to register one instance in the owner.
9
9
  * sample: Application => _addApplication
10
- * @return {string}
10
+ * @return {string}
11
11
  */
12
12
  static get registerInstanceMethodName() {
13
13
  return "_add" + this.name;
@@ -21,4 +21,13 @@ export class OwnedObject extends NamedObject {
21
21
 
22
22
  owner[this.constructor.registerInstanceMethodName](this);
23
23
  }
24
+
25
+ /**
26
+ * Check for equality.
27
+ * @param {OwnedObject} other
28
+ * @return {boolean} true if receiver and owner are equal
29
+ */
30
+ equals(other) {
31
+ return super.equals(other) && this.owner.equals(other.owner);
32
+ }
24
33
  }
package/src/ref.mjs CHANGED
@@ -25,15 +25,6 @@ export class Ref extends OwnedObject {
25
25
  };
26
26
  }
27
27
 
28
- /**
29
- * Check for equality.
30
- * @param {Ref} other
31
- * @return {boolean} true if name and repository are equal
32
- */
33
- equals(other) {
34
- return super.equals(other) && this.repository.equals(other.repository);
35
- }
36
-
37
28
  get refType() {
38
29
  return "unknown";
39
30
  }
@@ -153,11 +153,16 @@ export function RepositoryOwner(base) {
153
153
  let repository = this._repositories.get(normalizedName);
154
154
  if (repository === undefined) {
155
155
  repository = new this.repositoryClass(this, name, options);
156
- this._repositories.set(normalizedName, repository);
157
156
  }
158
157
  return repository;
159
158
  }
160
159
 
160
+ _addRepository(repository)
161
+ {
162
+ const normalizedName = this.normalizeRepositoryName(repository.name, true);
163
+ this._repositories.set(normalizedName, repository);
164
+ }
165
+
161
166
  /**
162
167
  * Delete a repository.
163
168
  * @param {string} name
@@ -1,6 +1,6 @@
1
1
  import { matcher } from "matching-iterator";
2
2
  import { optionJSON } from "./attribute.mjs";
3
- import { NamedObject } from "./named-object.mjs";
3
+ import { OwnedObject } from "./owned-object.mjs";
4
4
  import { Hook } from "./hook.mjs";
5
5
  import { Tag } from "./tag.mjs";
6
6
  import { Branch } from "./branch.mjs";
@@ -24,7 +24,12 @@ import { BaseProvider } from "./base-provider.mjs";
24
24
  * @property {Map<string,PullRequest>} pullRequests
25
25
  * @property {Map<string,Milestone>} milestones
26
26
  */
27
- export class Repository extends NamedObject {
27
+ export class Repository extends OwnedObject {
28
+
29
+ static get registerInstanceMethodName() {
30
+ return "_addRepository";
31
+ }
32
+
28
33
  /**
29
34
  * options
30
35
  */
@@ -62,8 +67,7 @@ export class Repository extends NamedObject {
62
67
  }
63
68
 
64
69
  constructor(owner, name, options) {
65
- super(owner.normalizeRepositoryName(name, false), options, {
66
- owner: { value: owner },
70
+ super(owner, owner.normalizeRepositoryName(name, false), options, {
67
71
  _branches: { value: new Map() },
68
72
  _tags: { value: new Map() },
69
73
  _pullRequests: { value: new Map() },