repository-provider 30.2.0 → 30.3.2

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.2.0",
3
+ "version": "30.3.2",
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.21",
39
+ "repository-provider-test-support": "^2.1.23",
40
40
  "semantic-release": "^19.0.2",
41
41
  "typescript": "^4.7.2"
42
42
  },
@@ -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
  }
package/src/attribute.mjs CHANGED
@@ -193,17 +193,19 @@ export function optionJSON(
193
193
  initial = {},
194
194
  attributes = object.constructor.attributes
195
195
  ) {
196
- return attributes ? Object.keys(attributes).reduce((a, c) => {
197
- const value = object[c];
198
- if (value !== undefined && !(value instanceof Function)) {
199
- if (value instanceof Set) {
200
- a[c] = [...value];
201
- } else {
202
- a[c] = value;
203
- }
204
- }
205
- return a;
206
- }, initial) : initial;
196
+ return attributes
197
+ ? Object.keys(attributes).reduce((a, c) => {
198
+ const value = object[c];
199
+ if (value !== undefined && !(value instanceof Function)) {
200
+ if (value instanceof Set) {
201
+ a[c] = [...value];
202
+ } else {
203
+ a[c] = value;
204
+ }
205
+ }
206
+ return a;
207
+ }, initial)
208
+ : initial;
207
209
  }
208
210
 
209
211
  /**
@@ -13,6 +13,13 @@ export class BaseObject {
13
13
  return this.name.toLocaleLowerCase();
14
14
  }
15
15
 
16
+ /**
17
+ * @return {string} name of the collection holding us in the owner
18
+ */
19
+ static get collectionName() {
20
+ return this.type.toLocaleLowerCase() + "s";
21
+ }
22
+
16
23
  /**
17
24
  * Attributes definitions
18
25
  */
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() {}
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,18 @@ 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 type() {
35
+ return "pull-request";
36
+ }
37
+
38
+ static get collectionName() {
39
+ return "pullRequests";
40
+ }
41
+
35
42
  /**
36
43
  * All valid states
37
44
  * @return {Set<string>} valid states
@@ -176,8 +183,7 @@ export class PullRequest extends OwnedObject {
176
183
  });
177
184
  }
178
185
 
179
- get destination()
180
- {
186
+ get destination() {
181
187
  return this.owner;
182
188
  }
183
189
 
@@ -193,7 +199,7 @@ export class PullRequest extends OwnedObject {
193
199
  * URL of the pull request.
194
200
  * @return {string} url
195
201
  */
196
- get url() {
202
+ get url() {
197
203
  return `${this.provider.url}${this.repository.fullName}/pull/${this.name}`;
198
204
  }
199
205
 
@@ -29,6 +29,10 @@ export class Repository extends OwnedObject {
29
29
  static get addMethodName() {
30
30
  return "_addRepository";
31
31
  }
32
+
33
+ static get collectionName() {
34
+ return "repositories";
35
+ }
32
36
 
33
37
  /**
34
38
  * options
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
  }