repository-provider 32.7.4 → 32.7.6

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
@@ -258,6 +258,7 @@ console.log(await readme.getString());
258
258
  * [isArchived](#isarchived)
259
259
  * [isDisabled](#isdisabled)
260
260
  * [isProtected](#isprotected)
261
+ * [isDefault](#isdefault-1)
261
262
  * [attributes](#attributes-1)
262
263
  * [isProtected](#isprotected-1)
263
264
  * [RepositoryGroup](#repositorygroup-1)
@@ -1527,6 +1528,12 @@ Forwarded from the repository
1527
1528
 
1528
1529
  Returns **any** false
1529
1530
 
1531
+ ### isDefault
1532
+
1533
+ Are we the default ref.
1534
+
1535
+ Returns **[boolean](https://developer.mozilla.org/docs/Web/JavaScript/Reference/Global_Objects/Boolean)** false
1536
+
1530
1537
  ### attributes
1531
1538
 
1532
1539
  options
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "repository-provider",
3
- "version": "32.7.4",
3
+ "version": "32.7.6",
4
4
  "publishConfig": {
5
5
  "access": "public"
6
6
  },
@@ -34,7 +34,7 @@
34
34
  },
35
35
  "devDependencies": {
36
36
  "ava": "^5.2.0",
37
- "browser-ava": "^1.3.37",
37
+ "browser-ava": "^1.3.38",
38
38
  "c8": "^7.13.0",
39
39
  "documentation": "^14.0.1",
40
40
  "repository-provider-test-support": "^2.3.2",
package/src/hook.mjs CHANGED
@@ -11,6 +11,9 @@ import {
11
11
  * Repository hook.
12
12
  */
13
13
  export class Hook extends OwnedObject {
14
+
15
+ static defaultEvents = new Set(["*"]);
16
+
14
17
  static get attributes() {
15
18
  return {
16
19
  ...super.attributes,
@@ -19,7 +22,7 @@ export class Hook extends OwnedObject {
19
22
  url: { ...url_attribute, description: "target url", writable: true },
20
23
  content_type: { ...default_attribute, default: "json", writable: true },
21
24
  insecure_ssl: boolean_attribute,
22
- events: { type: "set", default: new Set(["*"]) }
25
+ events: { type: "set", default: this.defaultEvents }
23
26
  };
24
27
  }
25
28
 
@@ -54,17 +54,18 @@ export class PullRequest extends OwnedObject {
54
54
  * States to list pull request by default
55
55
  * @return {Set<string>} states to list by default
56
56
  */
57
- static get defaultListStates() {
58
- return new Set(["OPEN"]);
59
- }
57
+ static defaultListStates = new Set(["OPEN"]);
60
58
 
59
+ /**
60
+ * possible states
61
+ */
62
+ static states = new Set(["OPEN", "MERGED", "CLOSED"]);
63
+
61
64
  /**
62
65
  * All valid merge methods
63
- * @return {Set<string>} valid merge methods
66
+ * @return {Set<string>} valid merge methods.
64
67
  */
65
- static get validMergeMethods() {
66
- return new Set(/*["MERGE", "SQUASH", "REBASE"]*/);
67
- }
68
+ static validMergeMethods =new Set(/*["MERGE", "SQUASH", "REBASE"]*/);
68
69
 
69
70
  /**
70
71
  * List all pull request for a given repo.
@@ -106,7 +107,7 @@ export class PullRequest extends OwnedObject {
106
107
  state: {
107
108
  ...state_attribute,
108
109
  default: "OPEN",
109
- values: new Set(["OPEN", "MERGED", "CLOSED"])
110
+ values: this.states
110
111
  },
111
112
 
112
113
  /**
package/src/ref.mjs CHANGED
@@ -4,7 +4,7 @@ import { name_attribute, boolean_attribute } from "./attributes.mjs";
4
4
  /**
5
5
  * @typedef {Object} ContentEntry
6
6
  * @property {string} name
7
- *
7
+ *
8
8
  */
9
9
 
10
10
  /**
@@ -174,4 +174,12 @@ export class Ref extends OwnedObject {
174
174
  get isProtected() {
175
175
  return false;
176
176
  }
177
+
178
+ /**
179
+ * Are we the default ref.
180
+ * @return {boolean} false
181
+ */
182
+ get isDefault() {
183
+ return false;
184
+ }
177
185
  }