repository-provider 32.3.9 → 32.3.11
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 +1 -1
- package/src/attributes.mjs +35 -0
- package/src/base-object.mjs +4 -21
- package/src/base-provider.mjs +4 -6
- package/src/hook.mjs +3 -2
- package/src/milestone.mjs +2 -1
- package/src/named-object.mjs +2 -4
- package/src/pull-request.mjs +3 -4
- package/src/repository-group.mjs +3 -5
- package/src/repository.mjs +4 -3
package/package.json
CHANGED
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
export const url = { description: "home of the object", type: "url" };
|
|
2
|
+
|
|
3
|
+
|
|
4
|
+
/**
|
|
5
|
+
* The description of the object content.
|
|
6
|
+
* @return {string}
|
|
7
|
+
*/
|
|
8
|
+
export const description = {
|
|
9
|
+
type: "string",
|
|
10
|
+
description: "human readable description",
|
|
11
|
+
writable: true
|
|
12
|
+
};
|
|
13
|
+
|
|
14
|
+
export const name = {
|
|
15
|
+
type: "string",
|
|
16
|
+
isKey: true
|
|
17
|
+
};
|
|
18
|
+
|
|
19
|
+
/**
|
|
20
|
+
* Unique id within the provider.
|
|
21
|
+
* @return {string}
|
|
22
|
+
*/
|
|
23
|
+
export const id = { isKey: true, type: "string" };
|
|
24
|
+
|
|
25
|
+
/**
|
|
26
|
+
* Unique id.
|
|
27
|
+
* @return {string}
|
|
28
|
+
*/
|
|
29
|
+
export const uuid = { isKey: true, type: "string" };
|
|
30
|
+
|
|
31
|
+
|
|
32
|
+
export const state = { type: "string" };
|
|
33
|
+
|
|
34
|
+
export const secret = { type: "string", private: true, writable: true };
|
|
35
|
+
|
package/src/base-object.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { definePropertiesFromOptions, mapAttributes } from "./attribute.mjs";
|
|
2
|
+
import { description, id, uuid } from "./attributes.mjs";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @param {Object} options
|
|
@@ -29,27 +30,9 @@ export class BaseObject {
|
|
|
29
30
|
*/
|
|
30
31
|
static get attributes() {
|
|
31
32
|
return {
|
|
32
|
-
|
|
33
|
-
|
|
34
|
-
|
|
35
|
-
*/
|
|
36
|
-
description: {
|
|
37
|
-
type: "string",
|
|
38
|
-
description: "human readable description",
|
|
39
|
-
writable: true
|
|
40
|
-
},
|
|
41
|
-
|
|
42
|
-
/**
|
|
43
|
-
* Unique id within the provider.
|
|
44
|
-
* @return {string}
|
|
45
|
-
*/
|
|
46
|
-
id: { isKey: true, type: "string" },
|
|
47
|
-
|
|
48
|
-
/**
|
|
49
|
-
* Unique id.
|
|
50
|
-
* @return {string}
|
|
51
|
-
*/
|
|
52
|
-
uuid: { isKey: true, type: "string" }
|
|
33
|
+
description,
|
|
34
|
+
id,
|
|
35
|
+
uuid
|
|
53
36
|
};
|
|
54
37
|
}
|
|
55
38
|
|
package/src/base-provider.mjs
CHANGED
|
@@ -8,6 +8,7 @@ import { Hook } from "./hook.mjs";
|
|
|
8
8
|
import { Project } from "./project.mjs";
|
|
9
9
|
import { Milestone } from "./milestone.mjs";
|
|
10
10
|
import { BaseObject } from "./base-object.mjs";
|
|
11
|
+
import { url, name } from "./attributes.mjs";
|
|
11
12
|
|
|
12
13
|
/**
|
|
13
14
|
* @typedef {Object} MessageDestination
|
|
@@ -111,15 +112,12 @@ export class BaseProvider extends BaseObject {
|
|
|
111
112
|
* Name of the provider.
|
|
112
113
|
*/
|
|
113
114
|
name: {
|
|
114
|
-
|
|
115
|
+
...name,
|
|
115
116
|
env: ["{{instanceIdentifier}}NAME"]
|
|
116
117
|
},
|
|
117
118
|
|
|
118
|
-
url
|
|
119
|
-
|
|
120
|
-
type: "string"
|
|
121
|
-
},
|
|
122
|
-
|
|
119
|
+
url,
|
|
120
|
+
|
|
123
121
|
/**
|
|
124
122
|
* To forward info/warn and error messages to
|
|
125
123
|
*/
|
package/src/hook.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
2
|
+
import { secret, url } from "./attributes.mjs";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* Repository hook.
|
|
@@ -7,8 +8,8 @@ export class Hook extends OwnedObject {
|
|
|
7
8
|
static get attributes() {
|
|
8
9
|
return {
|
|
9
10
|
...super.attributes,
|
|
10
|
-
url: {
|
|
11
|
-
secret
|
|
11
|
+
url: { ...url, description: "target url", writable: true },
|
|
12
|
+
secret,
|
|
12
13
|
content_type: { type: "string", default: "json", writable: true },
|
|
13
14
|
insecure_ssl: { type: "boolean", default: false },
|
|
14
15
|
active: { type: "boolean", default: true, writable: true },
|
package/src/milestone.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
2
|
+
import { state } from "./attributes.mjs";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
*/
|
|
@@ -6,7 +7,7 @@ export class Milestone extends OwnedObject {
|
|
|
6
7
|
static get attributes() {
|
|
7
8
|
return {
|
|
8
9
|
...super.attributes,
|
|
9
|
-
state
|
|
10
|
+
state
|
|
10
11
|
};
|
|
11
12
|
}
|
|
12
13
|
|
package/src/named-object.mjs
CHANGED
|
@@ -1,5 +1,6 @@
|
|
|
1
1
|
import { optionJSON } from "./attribute.mjs";
|
|
2
2
|
import { BaseObject } from "./base-object.mjs";
|
|
3
|
+
import { name } from "./attributes.mjs";
|
|
3
4
|
|
|
4
5
|
/**
|
|
5
6
|
* Object with a name.
|
|
@@ -16,10 +17,7 @@ export class NamedObject extends BaseObject {
|
|
|
16
17
|
static get attributes() {
|
|
17
18
|
return {
|
|
18
19
|
...super.attributes,
|
|
19
|
-
name
|
|
20
|
-
type: "string",
|
|
21
|
-
isKey: true
|
|
22
|
-
},
|
|
20
|
+
name,
|
|
23
21
|
|
|
24
22
|
/**
|
|
25
23
|
* The url of home page.
|
package/src/pull-request.mjs
CHANGED
|
@@ -3,6 +3,7 @@ import { OwnedObject } from "./owned-object.mjs";
|
|
|
3
3
|
import { Branch } from "./branch.mjs";
|
|
4
4
|
import { Repository } from "./repository.mjs";
|
|
5
5
|
import { Review } from "./review.mjs";
|
|
6
|
+
import { url, state } from "./attributes.mjs";
|
|
6
7
|
|
|
7
8
|
/**
|
|
8
9
|
* Abstract pull request.
|
|
@@ -108,8 +109,8 @@ export class PullRequest extends OwnedObject {
|
|
|
108
109
|
* @return {string}
|
|
109
110
|
*/
|
|
110
111
|
state: {
|
|
112
|
+
...state,
|
|
111
113
|
default: "OPEN",
|
|
112
|
-
type: "string",
|
|
113
114
|
writable: true
|
|
114
115
|
},
|
|
115
116
|
|
|
@@ -151,9 +152,7 @@ export class PullRequest extends OwnedObject {
|
|
|
151
152
|
type: "boolean"
|
|
152
153
|
},
|
|
153
154
|
|
|
154
|
-
url
|
|
155
|
-
type: "url"
|
|
156
|
-
}
|
|
155
|
+
url
|
|
157
156
|
};
|
|
158
157
|
}
|
|
159
158
|
|
package/src/repository-group.mjs
CHANGED
|
@@ -1,6 +1,7 @@
|
|
|
1
1
|
import { RepositoryOwner } from "./repository-owner.mjs";
|
|
2
2
|
import { OwnedObject } from "./owned-object.mjs";
|
|
3
3
|
import { BaseProvider } from "./base-provider.mjs";
|
|
4
|
+
import { url } from "./attributes.mjs";
|
|
4
5
|
|
|
5
6
|
/**
|
|
6
7
|
* Abstract repository collection.
|
|
@@ -40,16 +41,13 @@ export class RepositoryGroup extends RepositoryOwner(OwnedObject) {
|
|
|
40
41
|
*/
|
|
41
42
|
type: { type: "string" },
|
|
42
43
|
|
|
43
|
-
|
|
44
|
-
* api url
|
|
45
|
-
*/
|
|
46
|
-
url: { type: "url" },
|
|
44
|
+
url,
|
|
47
45
|
|
|
48
46
|
/**
|
|
49
47
|
* Avatar.
|
|
50
48
|
* @return {string}
|
|
51
49
|
*/
|
|
52
|
-
avatarURL: {
|
|
50
|
+
avatarURL: { ...url },
|
|
53
51
|
|
|
54
52
|
isAdmin: { type: "boolean", default: false }
|
|
55
53
|
};
|
package/src/repository.mjs
CHANGED
|
@@ -4,6 +4,7 @@ import { Hook } from "./hook.mjs";
|
|
|
4
4
|
import { Tag } from "./tag.mjs";
|
|
5
5
|
import { Branch } from "./branch.mjs";
|
|
6
6
|
import { PullRequest } from "./pull-request.mjs";
|
|
7
|
+
import { url } from "./attributes.mjs";
|
|
7
8
|
|
|
8
9
|
/**
|
|
9
10
|
* Abstract repository
|
|
@@ -49,15 +50,15 @@ export class Repository extends OwnedObject {
|
|
|
49
50
|
* URL of the repository
|
|
50
51
|
* @return {string}
|
|
51
52
|
*/
|
|
52
|
-
url
|
|
53
|
+
url,
|
|
53
54
|
|
|
54
|
-
cloneURL: {
|
|
55
|
+
cloneURL: { ...url },
|
|
55
56
|
|
|
56
57
|
/**
|
|
57
58
|
* The url of issue tracking system.
|
|
58
59
|
* @return {string}
|
|
59
60
|
*/
|
|
60
|
-
issuesURL: {
|
|
61
|
+
issuesURL: { ...url },
|
|
61
62
|
size: { type: "integer" },
|
|
62
63
|
language: { type: "string" },
|
|
63
64
|
isArchived: { type: "boolean", default: false, writable: true },
|