repository-provider 30.1.2 → 30.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": "30.1.2",
3
+ "version": "30.3.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -1,7 +1,7 @@
1
1
  import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
- *
4
+ *
5
5
  */
6
6
  export class Application extends OwnedObject {
7
7
  }
@@ -5,6 +5,14 @@ import { definePropertiesFromOptions, mapAttributes } from "./attribute.mjs";
5
5
  * @param {Object} additionalProperties
6
6
  */
7
7
  export class BaseObject {
8
+
9
+ /**
10
+ * @return {string} type we represent
11
+ */
12
+ static get type() {
13
+ return this.name.toLocaleLowerCase();
14
+ }
15
+
8
16
  /**
9
17
  * Attributes definitions
10
18
  */
@@ -22,6 +22,11 @@ import { BaseObject } from "./base-object.mjs";
22
22
  * @property {MessageDestination} messageDestination
23
23
  */
24
24
  export class BaseProvider extends BaseObject {
25
+
26
+ static get type() {
27
+ return "provider";
28
+ }
29
+
25
30
  /**
26
31
  * @return {string} identifier for environment options
27
32
  */
package/src/branch.mjs CHANGED
@@ -20,6 +20,10 @@ export class Branch extends Ref {
20
20
  static get addMethodName() {
21
21
  return "_addBranch";
22
22
  }
23
+
24
+ static get collectionName() {
25
+ return "branches";
26
+ }
23
27
 
24
28
  constructor(owner, name = owner.defaultBranchName, options) {
25
29
  super(owner, name, options);
package/src/issue.mjs CHANGED
@@ -1,7 +1,7 @@
1
1
  import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
- *
4
+ *
5
5
  */
6
6
  export class Issue extends OwnedObject {
7
7
  async *labels() {}
@@ -13,6 +13,13 @@ export class OwnedObject extends NamedObject {
13
13
  return "_add" + this.name;
14
14
  }
15
15
 
16
+ /**
17
+ * @return {string} name of the collection holding ous in the owner
18
+ */
19
+ static get collectionName() {
20
+ return this.name.toLocaleLowerCase() + "s";
21
+ }
22
+
16
23
  constructor(owner, name, options, additionalProperties) {
17
24
  super(name, options, {
18
25
  ...additionalProperties,
package/src/project.mjs CHANGED
@@ -3,4 +3,5 @@ import { OwnedObject } from "./owned-object.mjs";
3
3
  /**
4
4
  *
5
5
  */
6
- export class Project extends OwnedObject {}
6
+ export class Project extends OwnedObject {
7
+ }
@@ -27,11 +27,14 @@ import { BaseProvider } from "./base-provider.mjs";
27
27
  * @property {string} url
28
28
  */
29
29
  export class PullRequest extends OwnedObject {
30
-
31
30
  static get addMethodName() {
32
31
  return "_addPullRequest";
33
32
  }
34
33
 
34
+ static get collectionName() {
35
+ return "pullRequests";
36
+ }
37
+
35
38
  /**
36
39
  * All valid states
37
40
  * @return {Set<string>} valid states
@@ -176,8 +179,7 @@ export class PullRequest extends OwnedObject {
176
179
  });
177
180
  }
178
181
 
179
- get destination()
180
- {
182
+ get destination() {
181
183
  return this.owner;
182
184
  }
183
185
 
@@ -193,7 +195,7 @@ export class PullRequest extends OwnedObject {
193
195
  * URL of the pull request.
194
196
  * @return {string} url
195
197
  */
196
- get url() {
198
+ get url() {
197
199
  return `${this.provider.url}${this.repository.fullName}/pull/${this.name}`;
198
200
  }
199
201
 
@@ -25,9 +25,14 @@ import { BaseProvider } from "./base-provider.mjs";
25
25
  * @property {Map<string,Milestone>} milestones
26
26
  */
27
27
  export class Repository extends OwnedObject {
28
+
28
29
  static get addMethodName() {
29
30
  return "_addRepository";
30
31
  }
32
+
33
+ static get collectionName() {
34
+ return "repositories";
35
+ }
31
36
 
32
37
  /**
33
38
  * options
@@ -491,7 +496,6 @@ export class Repository extends OwnedObject {
491
496
  return optionJSON(this, {
492
497
  name: this.name,
493
498
  fullName: this.fullName,
494
- urls: this.urls
495
499
  });
496
500
  }
497
501
 
package/src/review.mjs CHANGED
@@ -1,7 +1,7 @@
1
- import { BaseObject } from "./base-object.mjs";
1
+ import { OwnedObject } from "./owned-object.mjs";
2
2
 
3
3
  /**
4
- *
4
+ *
5
5
  */
6
- export class Review extends BaseObject {
6
+ export class Review extends OwnedObject {
7
7
  }