repository-provider 30.3.3 → 31.0.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/base-object.mjs +4 -0
- package/src/named-object.mjs +13 -1
- package/src/pull-request.mjs +2 -3
- package/src/repository.mjs +3 -27
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "repository-provider",
|
|
3
|
-
"version": "
|
|
3
|
+
"version": "31.0.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.25",
|
|
40
40
|
"semantic-release": "^19.0.2",
|
|
41
41
|
"typescript": "^4.7.2"
|
|
42
42
|
},
|
package/src/base-object.mjs
CHANGED
package/src/named-object.mjs
CHANGED
|
@@ -10,6 +10,18 @@ import { BaseObject } from "./base-object.mjs";
|
|
|
10
10
|
* @property {string} name
|
|
11
11
|
*/
|
|
12
12
|
export class NamedObject extends BaseObject {
|
|
13
|
+
/**
|
|
14
|
+
* options
|
|
15
|
+
*/
|
|
16
|
+
static get attributes() {
|
|
17
|
+
return {
|
|
18
|
+
...super.attributes,
|
|
19
|
+
name: {
|
|
20
|
+
type: "string"
|
|
21
|
+
}
|
|
22
|
+
};
|
|
23
|
+
}
|
|
24
|
+
|
|
13
25
|
constructor(name, options, additionalProperties) {
|
|
14
26
|
super(options, {
|
|
15
27
|
name: { value: name },
|
|
@@ -35,7 +47,7 @@ export class NamedObject extends BaseObject {
|
|
|
35
47
|
get fullName() {
|
|
36
48
|
return this.owner ? this.owner.name + "/" + this.name : this.name;
|
|
37
49
|
}
|
|
38
|
-
|
|
50
|
+
|
|
39
51
|
/**
|
|
40
52
|
* Provided name and all defined attributes.
|
|
41
53
|
*/
|
package/src/pull-request.mjs
CHANGED
|
@@ -280,7 +280,7 @@ export class PullRequest extends OwnedObject {
|
|
|
280
280
|
...Object.keys(this.constructor.attributes)
|
|
281
281
|
.filter(
|
|
282
282
|
k =>
|
|
283
|
-
k !== "id" && k !== "title" && k !== "body" && k !== "url" && this[k] !== undefined
|
|
283
|
+
k !== "id" && k !== "title" && k !== "body" && k !== "url" && k !== "name" && this[k] !== undefined
|
|
284
284
|
)
|
|
285
285
|
.map(k => [k, this[k]])
|
|
286
286
|
]
|
|
@@ -291,8 +291,7 @@ export class PullRequest extends OwnedObject {
|
|
|
291
291
|
toJSON() {
|
|
292
292
|
return optionJSON(this, {
|
|
293
293
|
source: this.source,
|
|
294
|
-
destination: this.owner
|
|
295
|
-
name: this.name
|
|
294
|
+
destination: this.owner
|
|
296
295
|
});
|
|
297
296
|
}
|
|
298
297
|
|
package/src/repository.mjs
CHANGED
|
@@ -48,10 +48,10 @@ export class Repository extends OwnedObject {
|
|
|
48
48
|
defaultBranchName: { type: "string", default: "master" },
|
|
49
49
|
|
|
50
50
|
/**
|
|
51
|
-
*
|
|
52
|
-
* @return {string
|
|
51
|
+
* URL of the repository
|
|
52
|
+
* @return {string}
|
|
53
53
|
*/
|
|
54
|
-
|
|
54
|
+
url: { type: "url" },
|
|
55
55
|
|
|
56
56
|
cloneURL: { type: "url" },
|
|
57
57
|
|
|
@@ -134,22 +134,6 @@ export class Repository extends OwnedObject {
|
|
|
134
134
|
*/
|
|
135
135
|
async *commits(options) {}
|
|
136
136
|
|
|
137
|
-
/**
|
|
138
|
-
* Urls to access the repo.
|
|
139
|
-
* @return {string[]}
|
|
140
|
-
*/
|
|
141
|
-
get urls() {
|
|
142
|
-
return [];
|
|
143
|
-
}
|
|
144
|
-
|
|
145
|
-
/**
|
|
146
|
-
* Preffered url to access the repo.
|
|
147
|
-
* @return {string}
|
|
148
|
-
*/
|
|
149
|
-
get url() {
|
|
150
|
-
return this.urls[0];
|
|
151
|
-
}
|
|
152
|
-
|
|
153
137
|
/**
|
|
154
138
|
* The url used for cloning the repo.
|
|
155
139
|
* @return {string}
|
|
@@ -174,14 +158,6 @@ export class Repository extends OwnedObject {
|
|
|
174
158
|
return undefined;
|
|
175
159
|
}
|
|
176
160
|
|
|
177
|
-
/**
|
|
178
|
-
* Name without owner.
|
|
179
|
-
* @return {string} name
|
|
180
|
-
*/
|
|
181
|
-
get condensedName() {
|
|
182
|
-
return this.name;
|
|
183
|
-
}
|
|
184
|
-
|
|
185
161
|
/**
|
|
186
162
|
* By default we are not archived.
|
|
187
163
|
* @return {boolean} false
|