repository-provider 29.1.5 → 29.2.0

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
@@ -202,7 +202,7 @@ console.log(await readme.getString());
202
202
  * [Parameters](#parameters-46)
203
203
  * [equals](#equals-3)
204
204
  * [Parameters](#parameters-47)
205
- * [registerInstanceMethodName](#registerinstancemethodname)
205
+ * [addMethodName](#addmethodname)
206
206
  * [Project](#project)
207
207
  * [PullRequest](#pullrequest)
208
208
  * [Parameters](#parameters-48)
@@ -327,7 +327,6 @@ console.log(await readme.getString());
327
327
  * [type](#type-1)
328
328
  * [refId](#refid-1)
329
329
  * [Parameters](#parameters-79)
330
- * [toString](#tostring-2)
331
330
  * [toJSON](#tojson-3)
332
331
  * [attributes](#attributes-2)
333
332
  * [defaultBranchName](#defaultbranchname)
@@ -489,7 +488,7 @@ Save object attributes in the backing store.
489
488
 
490
489
  ### toString
491
490
 
492
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** name
491
+ Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)** fullName
493
492
 
494
493
  ### displayName
495
494
 
@@ -1211,7 +1210,7 @@ Check for equality.
1211
1210
 
1212
1211
  Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** true if receiver and owner are equal
1213
1212
 
1214
- ### registerInstanceMethodName
1213
+ ### addMethodName
1215
1214
 
1216
1215
  Method name to be called to register one instance in the owner.
1217
1216
  sample: Application => \_addApplication
@@ -1921,12 +1920,6 @@ Get sha of a ref.
1921
1920
 
1922
1921
  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
1923
1922
 
1924
- ### toString
1925
-
1926
- full name.
1927
-
1928
- Returns **[string](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/String)**
1929
-
1930
1923
  ### toJSON
1931
1924
 
1932
1925
  Provide name and all defined attributes
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "29.1.5",
3
+ "version": "29.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -82,10 +82,10 @@ export class BaseObject {
82
82
  async update() {}
83
83
 
84
84
  /**
85
- * @return {string} name
85
+ * @return {string} fullName
86
86
  */
87
87
  toString() {
88
- return this.name;
88
+ return this.fullName;
89
89
  }
90
90
 
91
91
  /**
package/src/branch.mjs CHANGED
@@ -17,7 +17,7 @@ import { Commit } from "./commit.mjs";
17
17
  */
18
18
  export class Branch extends Ref {
19
19
 
20
- static get registerInstanceMethodName() {
20
+ static get addMethodName() {
21
21
  return "_addBranch";
22
22
  }
23
23
 
package/src/hook.mjs CHANGED
@@ -17,7 +17,7 @@ export class Hook extends OwnedObject {
17
17
  };
18
18
  }
19
19
 
20
- static get registerInstanceMethodName() {
20
+ static get addMethodName() {
21
21
  return "_addHook";
22
22
  }
23
23
 
@@ -33,7 +33,7 @@ export class NamedObject extends BaseObject {
33
33
  * @return {string} name with owner name
34
34
  */
35
35
  get fullName() {
36
- return this.owner.name + "/" + this.name;
36
+ return this.owner ? this.owner.name + "/" + this.name : this.name;
37
37
  }
38
38
 
39
39
  /**
@@ -9,7 +9,7 @@ export class OwnedObject extends NamedObject {
9
9
  * sample: Application => _addApplication
10
10
  * @return {string}
11
11
  */
12
- static get registerInstanceMethodName() {
12
+ static get addMethodName() {
13
13
  return "_add" + this.name;
14
14
  }
15
15
 
@@ -19,7 +19,7 @@ export class OwnedObject extends NamedObject {
19
19
  owner: { value: owner }
20
20
  });
21
21
 
22
- owner[this.constructor.registerInstanceMethodName](this);
22
+ owner[this.constructor.addMethodName](this);
23
23
  }
24
24
 
25
25
  /**
@@ -28,7 +28,7 @@ import { BaseProvider } from "./base-provider.mjs";
28
28
  */
29
29
  export class PullRequest extends OwnedObject {
30
30
 
31
- static get registerInstanceMethodName() {
31
+ static get addMethodName() {
32
32
  return "_addPullRequest";
33
33
  }
34
34
 
@@ -18,7 +18,7 @@ import { BaseProvider } from "./base-provider.mjs";
18
18
 
19
19
  export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
20
20
 
21
- static get registerInstanceMethodName() {
21
+ static get addMethodName() {
22
22
  return "_addRepositoryGroup";
23
23
  }
24
24
 
@@ -26,7 +26,7 @@ import { BaseProvider } from "./base-provider.mjs";
26
26
  */
27
27
  export class Repository extends OwnedObject {
28
28
 
29
- static get registerInstanceMethodName() {
29
+ static get addMethodName() {
30
30
  return "_addRepository";
31
31
  }
32
32
 
@@ -69,6 +69,7 @@ export class Repository extends OwnedObject {
69
69
  #branches = new Map();
70
70
  #tags = new Map();
71
71
  #projects = new Map();
72
+ #applications = new Map();
72
73
  #milestones = new Map();
73
74
  #pullRequests = new Map();
74
75
  #hooks = [];
@@ -461,6 +462,14 @@ export class Repository extends OwnedObject {
461
462
  return this.#projects.get(name);
462
463
  }
463
464
 
465
+ _addApplication(application) {
466
+ this.#applications.set(application.name, application);
467
+ }
468
+
469
+ async application(name) {
470
+ return this.#applications.get(name);
471
+ }
472
+
464
473
  /**
465
474
  * Get type of the repository.
466
475
  * @return {string} 'git'
@@ -477,14 +486,6 @@ export class Repository extends OwnedObject {
477
486
  async refId(ref) {
478
487
  }
479
488
 
480
- /**
481
- * full name.
482
- * @returns {string}
483
- */
484
- toString() {
485
- return this.fullName;
486
- }
487
-
488
489
  /**
489
490
  * Provide name and all defined attributes
490
491
  */
package/src/tag.mjs CHANGED
@@ -5,7 +5,7 @@ import { Ref } from "./ref.mjs";
5
5
  */
6
6
  export class Tag extends Ref {
7
7
 
8
- static get registerInstanceMethodName() {
8
+ static get addMethodName() {
9
9
  return "_addTag";
10
10
  }
11
11