repository-provider 30.1.3 → 30.3.1
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/base-object.mjs +15 -0
- package/src/base-provider.mjs +5 -0
- package/src/branch.mjs +4 -0
- package/src/issue.mjs +1 -1
- package/src/project.mjs +2 -1
- package/src/pull-request.mjs +6 -4
- package/src/repository.mjs +5 -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.1
|
|
3
|
+
"version": "30.3.1",
|
|
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.22",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
41
|
"typescript": "^4.7.2"
|
|
42
42
|
},
|
package/src/application.mjs
CHANGED
package/src/base-object.mjs
CHANGED
|
@@ -5,6 +5,21 @@ 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
|
+
|
|
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
|
+
|
|
8
23
|
/**
|
|
9
24
|
* Attributes definitions
|
|
10
25
|
*/
|
package/src/base-provider.mjs
CHANGED
|
@@ -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
package/src/project.mjs
CHANGED
package/src/pull-request.mjs
CHANGED
|
@@ -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
|
|
package/src/repository.mjs
CHANGED
|
@@ -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
|
package/src/review.mjs
CHANGED