repository-provider 30.1.1 → 30.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "30.1.1",
3
+ "version": "30.2.0",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -36,7 +36,7 @@
36
36
  "ava": "^4.2.0",
37
37
  "c8": "^7.11.3",
38
38
  "documentation": "^13.2.5",
39
- "repository-provider-test-support": "^2.1.20",
39
+ "repository-provider-test-support": "^2.1.21",
40
40
  "semantic-release": "^19.0.2",
41
41
  "typescript": "^4.7.2"
42
42
  },
@@ -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
  */
@@ -209,9 +209,7 @@ export class PullRequest extends OwnedObject {
209
209
  * @return {Repository} destination repository
210
210
  */
211
211
  get repository() {
212
- return this.owner === undefined
213
- ? undefined
214
- : this.owner.repository;
212
+ return this.owner && this.owner.repository;
215
213
  }
216
214
 
217
215
  /**
@@ -236,9 +234,7 @@ export class PullRequest extends OwnedObject {
236
234
  * @return {Promise}
237
235
  */
238
236
  async delete() {
239
- return this.owner === undefined
240
- ? undefined
241
- : this.owner.deletePullRequest(this.name);
237
+ return this.owner && this.owner.deletePullRequest(this.name);
242
238
  }
243
239
 
244
240
  /**
@@ -25,6 +25,7 @@ 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
  }
@@ -491,7 +492,6 @@ export class Repository extends OwnedObject {
491
492
  return optionJSON(this, {
492
493
  name: this.name,
493
494
  fullName: this.fullName,
494
- urls: this.urls
495
495
  });
496
496
  }
497
497