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 +2 -2
- package/src/application.mjs +1 -1
- package/src/attribute.mjs +13 -11
- package/src/base-object.mjs +7 -0
- package/src/branch.mjs +4 -0
- package/src/issue.mjs +1 -1
- package/src/project.mjs +2 -1
- package/src/pull-request.mjs +10 -4
- package/src/repository.mjs +4 -0
- package/src/review.mjs +3 -3
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "30.2
|
|
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.
|
|
39
|
+
"repository-provider-test-support": "^2.1.23",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
41
|
"typescript": "^4.7.2"
|
|
42
42
|
},
|
package/src/application.mjs
CHANGED
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
|
|
197
|
-
|
|
198
|
-
|
|
199
|
-
|
|
200
|
-
|
|
201
|
-
|
|
202
|
-
|
|
203
|
-
|
|
204
|
-
|
|
205
|
-
|
|
206
|
-
|
|
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
|
/**
|
package/src/base-object.mjs
CHANGED
|
@@ -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
package/src/project.mjs
CHANGED
package/src/pull-request.mjs
CHANGED
|
@@ -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
|
|
package/src/repository.mjs
CHANGED
package/src/review.mjs
CHANGED