repository-provider 32.4.0 → 32.4.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 +1 -1
- package/src/attributes.mjs +29 -12
- package/src/base-provider.mjs +3 -2
- package/src/hook.mjs +8 -3
- package/src/named-object.mjs +2 -9
- package/src/owned-object.mjs +7 -0
- package/src/pull-request.mjs +3 -10
- package/src/ref.mjs +2 -1
- package/src/repository.mjs +3 -3
package/package.json
CHANGED
package/src/attributes.mjs
CHANGED
|
@@ -1,10 +1,28 @@
|
|
|
1
1
|
export const boolean_attribute = {
|
|
2
2
|
type: "boolean",
|
|
3
3
|
default: false,
|
|
4
|
+
mandatory: false,
|
|
4
5
|
writable: true
|
|
5
6
|
};
|
|
6
7
|
|
|
8
|
+
export const boolean_read_only_attribute = {
|
|
9
|
+
type: "boolean",
|
|
10
|
+
default: false,
|
|
11
|
+
mandatory: false
|
|
12
|
+
};
|
|
13
|
+
|
|
7
14
|
export const uuid_attiribute = { isKey: true, type: "string" };
|
|
15
|
+
export const empty_attiribute = { type: "boolean" };
|
|
16
|
+
export const secret_attribute = {
|
|
17
|
+
type: "string",
|
|
18
|
+
private: true,
|
|
19
|
+
writable: true
|
|
20
|
+
};
|
|
21
|
+
export const size_attribute = { type: "integer", mandatory: false };
|
|
22
|
+
export const name_attribute = {
|
|
23
|
+
type: "string",
|
|
24
|
+
isKey: true
|
|
25
|
+
};
|
|
8
26
|
|
|
9
27
|
export const url = { description: "home of the object", type: "url" };
|
|
10
28
|
|
|
@@ -14,24 +32,17 @@ export const url = { description: "home of the object", type: "url" };
|
|
|
14
32
|
export const description = {
|
|
15
33
|
type: "string",
|
|
16
34
|
description: "human readable description",
|
|
35
|
+
mandatory: false,
|
|
17
36
|
writable: true
|
|
18
37
|
};
|
|
19
38
|
|
|
20
|
-
export const name = {
|
|
21
|
-
type: "string",
|
|
22
|
-
isKey: true
|
|
23
|
-
};
|
|
24
|
-
|
|
25
39
|
/**
|
|
26
40
|
* Unique id within the provider.
|
|
27
41
|
*/
|
|
28
42
|
export const id = { isKey: true, type: "string" };
|
|
29
43
|
|
|
30
|
-
|
|
31
44
|
export const state = { type: "string" };
|
|
32
45
|
|
|
33
|
-
export const secret = { type: "string", private: true, writable: true };
|
|
34
|
-
|
|
35
46
|
/**
|
|
36
47
|
* The description of the pull request.
|
|
37
48
|
*/
|
|
@@ -43,7 +54,8 @@ export const body = { type: "string", writable: true };
|
|
|
43
54
|
export const title = {
|
|
44
55
|
type: "string",
|
|
45
56
|
description: "human readable title",
|
|
46
|
-
writable: true
|
|
57
|
+
writable: true,
|
|
58
|
+
mandatory: false
|
|
47
59
|
};
|
|
48
60
|
|
|
49
61
|
/**
|
|
@@ -53,10 +65,15 @@ export const title = {
|
|
|
53
65
|
export const priority = {
|
|
54
66
|
type: "number",
|
|
55
67
|
default: 0,
|
|
56
|
-
writable: true
|
|
68
|
+
writable: true,
|
|
69
|
+
mandatory: false
|
|
57
70
|
};
|
|
58
71
|
|
|
59
|
-
export const active = {
|
|
60
|
-
|
|
72
|
+
export const active = {
|
|
73
|
+
type: "boolean",
|
|
74
|
+
default: true,
|
|
75
|
+
mandatory: false,
|
|
76
|
+
writable: true
|
|
77
|
+
};
|
|
61
78
|
export const language = { type: "string" };
|
|
62
79
|
export const type = { type: "string" };
|
package/src/base-provider.mjs
CHANGED
|
@@ -8,7 +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,
|
|
11
|
+
import { url, name_attribute, description, priority } from "./attributes.mjs";
|
|
12
12
|
|
|
13
13
|
/**
|
|
14
14
|
* @typedef {Object} MessageDestination
|
|
@@ -105,7 +105,7 @@ export class BaseProvider extends BaseObject {
|
|
|
105
105
|
* Name of the provider.
|
|
106
106
|
*/
|
|
107
107
|
name: {
|
|
108
|
-
...
|
|
108
|
+
...name_attribute,
|
|
109
109
|
env: ["{{instanceIdentifier}}NAME"]
|
|
110
110
|
},
|
|
111
111
|
|
|
@@ -115,6 +115,7 @@ export class BaseProvider extends BaseObject {
|
|
|
115
115
|
messageDestination: {
|
|
116
116
|
type: "object",
|
|
117
117
|
default: console,
|
|
118
|
+
mandatory: false,
|
|
118
119
|
writable: true,
|
|
119
120
|
private: true
|
|
120
121
|
}
|
package/src/hook.mjs
CHANGED
|
@@ -1,5 +1,10 @@
|
|
|
1
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
2
|
-
import {
|
|
2
|
+
import {
|
|
3
|
+
secret_attribute,
|
|
4
|
+
boolean_attribute,
|
|
5
|
+
active,
|
|
6
|
+
url
|
|
7
|
+
} from "./attributes.mjs";
|
|
3
8
|
|
|
4
9
|
/**
|
|
5
10
|
* Repository hook.
|
|
@@ -9,7 +14,7 @@ export class Hook extends OwnedObject {
|
|
|
9
14
|
return {
|
|
10
15
|
...super.attributes,
|
|
11
16
|
active,
|
|
12
|
-
secret,
|
|
17
|
+
secret: secret_attribute,
|
|
13
18
|
url: { ...url, description: "target url", writable: true },
|
|
14
19
|
content_type: { type: "string", default: "json", writable: true },
|
|
15
20
|
insecure_ssl: boolean_attribute,
|
|
@@ -22,6 +27,6 @@ export class Hook extends OwnedObject {
|
|
|
22
27
|
}
|
|
23
28
|
|
|
24
29
|
static get delteteMethodName() {
|
|
25
|
-
|
|
30
|
+
return "_deleteHook";
|
|
26
31
|
}
|
|
27
32
|
}
|
package/src/named-object.mjs
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
import { optionJSON } from "./attribute.mjs";
|
|
2
2
|
import { BaseObject } from "./base-object.mjs";
|
|
3
|
-
import {
|
|
3
|
+
import { name_attribute, url, description, id } from "./attributes.mjs";
|
|
4
4
|
|
|
5
5
|
/**
|
|
6
6
|
* Object with a name.
|
|
@@ -16,7 +16,7 @@ export class NamedObject extends BaseObject {
|
|
|
16
16
|
*/
|
|
17
17
|
static get attributes() {
|
|
18
18
|
return {
|
|
19
|
-
name,
|
|
19
|
+
name: name_attribute,
|
|
20
20
|
id,
|
|
21
21
|
description,
|
|
22
22
|
|
|
@@ -48,13 +48,6 @@ export class NamedObject extends BaseObject {
|
|
|
48
48
|
);
|
|
49
49
|
}
|
|
50
50
|
|
|
51
|
-
/**
|
|
52
|
-
* @return {string} name with owner name
|
|
53
|
-
*/
|
|
54
|
-
get fullName() {
|
|
55
|
-
return this.owner ? this.owner.name + "/" + this.name : this.name;
|
|
56
|
-
}
|
|
57
|
-
|
|
58
51
|
/**
|
|
59
52
|
* Provided name and all defined attributes.
|
|
60
53
|
*/
|
package/src/owned-object.mjs
CHANGED
|
@@ -63,6 +63,13 @@ export class OwnedObject extends NamedObject {
|
|
|
63
63
|
return `${this.provider.name}:${this.fullCondensedName}`;
|
|
64
64
|
}
|
|
65
65
|
|
|
66
|
+
/**
|
|
67
|
+
* @return {string} name with owner name
|
|
68
|
+
*/
|
|
69
|
+
get fullName() {
|
|
70
|
+
return this.owner.name + "/" + this.name;
|
|
71
|
+
}
|
|
72
|
+
|
|
66
73
|
/**
|
|
67
74
|
* Forwarded to the owner.
|
|
68
75
|
* @param {...any} args
|
package/src/pull-request.mjs
CHANGED
|
@@ -3,7 +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, body, title, boolean_attribute } from "./attributes.mjs";
|
|
6
|
+
import { url, state, body, title, boolean_attribute, boolean_read_only_attribute, empty_attiribute } from "./attributes.mjs";
|
|
7
7
|
|
|
8
8
|
/**
|
|
9
9
|
* Abstract pull request.
|
|
@@ -120,15 +120,8 @@ export class PullRequest extends OwnedObject {
|
|
|
120
120
|
* @return {boolean}
|
|
121
121
|
*/
|
|
122
122
|
draft: boolean_attribute,
|
|
123
|
-
|
|
124
|
-
|
|
125
|
-
type: "boolean",
|
|
126
|
-
default: false
|
|
127
|
-
},
|
|
128
|
-
|
|
129
|
-
empty: {
|
|
130
|
-
type: "boolean"
|
|
131
|
-
}
|
|
123
|
+
dry: boolean_attribute,
|
|
124
|
+
empty: empty_attiribute
|
|
132
125
|
};
|
|
133
126
|
}
|
|
134
127
|
|
package/src/ref.mjs
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { OwnedObject } from "./owned-object.mjs";
|
|
2
|
+
import { boolean_read_only_attribute } from "./attributes.mjs";
|
|
2
3
|
|
|
3
4
|
/**
|
|
4
5
|
* @typedef {Object} ContentEntry
|
|
@@ -21,7 +22,7 @@ export class Ref extends OwnedObject {
|
|
|
21
22
|
* Can the ref be modified.
|
|
22
23
|
* @return {string}
|
|
23
24
|
*/
|
|
24
|
-
isProtected:
|
|
25
|
+
isProtected: boolean_read_only_attribute
|
|
25
26
|
};
|
|
26
27
|
}
|
|
27
28
|
|
package/src/repository.mjs
CHANGED
|
@@ -4,7 +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,
|
|
7
|
+
import { url, size_attribute, language, boolean_attribute, boolean_read_only_attribute } from "./attributes.mjs";
|
|
8
8
|
|
|
9
9
|
/**
|
|
10
10
|
* Abstract repository
|
|
@@ -44,7 +44,7 @@ export class Repository extends OwnedObject {
|
|
|
44
44
|
return {
|
|
45
45
|
...super.attributes,
|
|
46
46
|
url,
|
|
47
|
-
|
|
47
|
+
size_attribute,
|
|
48
48
|
language,
|
|
49
49
|
|
|
50
50
|
/**
|
|
@@ -64,7 +64,7 @@ export class Repository extends OwnedObject {
|
|
|
64
64
|
isLocked: boolean_attribute,
|
|
65
65
|
isDisabled: boolean_attribute,
|
|
66
66
|
isTemplate: boolean_attribute,
|
|
67
|
-
isFork:
|
|
67
|
+
isFork: boolean_read_only_attribute
|
|
68
68
|
};
|
|
69
69
|
}
|
|
70
70
|
|