repository-provider 28.2.1 → 28.3.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "28.2.1",
3
+ "version": "28.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,15 +1,7 @@
1
- import { NamedObject } from "./named-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
4
  *
5
5
  */
6
- export class Application extends NamedObject {
7
-
8
- constructor(owner, name, options) {
9
- super(name, options, {
10
- owner: { value: owner }
11
- });
12
-
13
- owner._addApplication(this);
14
- }
6
+ export class Application extends OwnedObject {
15
7
  }
@@ -15,6 +15,7 @@ import { BaseObject } from "./base-object.mjs";
15
15
  * @property {Function} info
16
16
  * @property {Function} warn
17
17
  * @property {Function} error
18
+ * @property {Function} trace
18
19
  */
19
20
 
20
21
  /**
package/src/index.mjs CHANGED
@@ -1,5 +1,6 @@
1
1
  export * from "./base-object.mjs";
2
2
  export * from "./named-object.mjs";
3
+ export * from "./owned-object.mjs";
3
4
  export * from "./repository-owner.mjs";
4
5
  export * from "./base-provider.mjs";
5
6
  export * from "./single-group-provider.mjs";
package/src/issue.mjs CHANGED
@@ -1,18 +1,9 @@
1
- import { NamedObject } from "./named-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
4
  *
5
5
  */
6
- export class Issue extends NamedObject {
7
-
8
- constructor(owner, name, options) {
9
- super(name, options, {
10
- owner: { value: owner }
11
- });
12
-
13
- owner._addIssue(this);
14
- }
15
-
6
+ export class Issue extends OwnedObject {
16
7
  async *labels() {}
17
8
  async *assignees() {}
18
9
  async assignee() {}
package/src/milestone.mjs CHANGED
@@ -1,8 +1,8 @@
1
- import { NamedObject } from "./named-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
4
  */
5
- export class Milestone extends NamedObject {
5
+ export class Milestone extends OwnedObject {
6
6
  static get attributes() {
7
7
  return {
8
8
  ...super.attributes,
@@ -10,13 +10,5 @@ export class Milestone extends NamedObject {
10
10
  };
11
11
  }
12
12
 
13
- constructor(owner, name, options) {
14
- super(name, options, {
15
- owner: { value: owner }
16
- });
17
-
18
- owner._addMilestone(this);
19
- }
20
-
21
13
  async *issues() {}
22
14
  }
@@ -0,0 +1,23 @@
1
+ import { NamedObject } from "./named-object.mjs";
2
+
3
+ /**
4
+ * Named Object registering itself in the owner.
5
+ */
6
+ export class OwnedObject extends NamedObject {
7
+ /**
8
+ * Method name to be called to register one instance in the owner.
9
+ * sample: Application => _addApplication
10
+ * @return {string}
11
+ */
12
+ static get registerInstanceMethodName() {
13
+ return "_add" + this.name;
14
+ }
15
+
16
+ constructor(owner, name, options) {
17
+ super(name, options, {
18
+ owner: { value: owner }
19
+ });
20
+
21
+ owner[this.constructor.registerInstanceMethodName](this);
22
+ }
23
+ }
package/src/project.mjs CHANGED
@@ -1,13 +1,6 @@
1
- import { NamedObject } from "./named-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
- *
4
+ *
5
5
  */
6
- export class Project extends NamedObject {
7
- constructor(owner, name, options) {
8
- super(name, options, {
9
- owner: { value: owner }
10
- });
11
-
12
- owner._addProject(this);
13
- }}
6
+ export class Project extends OwnedObject {}
package/src/ref.mjs CHANGED
@@ -120,7 +120,7 @@ export class Ref extends NamedObject {
120
120
 
121
121
  /**
122
122
  * Repository fullName and branch name combined.
123
- * But skipping the branch name if it is the default branch
123
+ * But skipping the branch name if it is the default branch.
124
124
  * @return {string} 'user/repo#branch'
125
125
  */
126
126
  get fullCondensedName() {