screwdriver-data-schema 22.7.1 → 22.9.0
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/config/compatibilities.js +20 -0
- package/models/command.js +6 -2
- package/models/pipeline.js +15 -1
- package/models/template.js +6 -2
- package/package.json +1 -1
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const Joi = require('joi');
|
|
4
|
+
|
|
5
|
+
const compatibilities = Joi.object({
|
|
6
|
+
clouds: Joi.array()
|
|
7
|
+
.items(Joi.string())
|
|
8
|
+
.description('A list of cloud that template supports')
|
|
9
|
+
.example(['aws', 'gcp', 'azure'])
|
|
10
|
+
.optional(),
|
|
11
|
+
architectures: Joi.array()
|
|
12
|
+
.items(Joi.string())
|
|
13
|
+
.description('A list of architectures that template supports')
|
|
14
|
+
.example(['x86', 'x86_64', 'arm64'])
|
|
15
|
+
.optional()
|
|
16
|
+
});
|
|
17
|
+
|
|
18
|
+
module.exports = {
|
|
19
|
+
compatibilities
|
|
20
|
+
};
|
package/models/command.js
CHANGED
|
@@ -4,6 +4,9 @@ const Joi = require('joi');
|
|
|
4
4
|
const mutate = require('../lib/mutate');
|
|
5
5
|
const Command = require('../config/command');
|
|
6
6
|
const pipelineId = require('./pipeline').base.extract('id');
|
|
7
|
+
const Compatibilities = require('../config/compatibilities');
|
|
8
|
+
|
|
9
|
+
const { compatibilities } = Compatibilities;
|
|
7
10
|
|
|
8
11
|
const MODEL = {
|
|
9
12
|
id: Joi.number().integer().positive().description('Identifier of this command').example(123345),
|
|
@@ -24,7 +27,8 @@ const MODEL = {
|
|
|
24
27
|
.example('2038-01-19T03:14:08.131Z'),
|
|
25
28
|
usage: Command.usage,
|
|
26
29
|
trusted: Joi.boolean().description('Mark whether command is trusted'),
|
|
27
|
-
latest: Joi.boolean().description('Whether this is latest version')
|
|
30
|
+
latest: Joi.boolean().description('Whether this is latest version'),
|
|
31
|
+
compatibilities
|
|
28
32
|
};
|
|
29
33
|
|
|
30
34
|
module.exports = {
|
|
@@ -54,7 +58,7 @@ module.exports = {
|
|
|
54
58
|
mutate(
|
|
55
59
|
MODEL,
|
|
56
60
|
['id', 'namespace', 'name', 'version', 'description', 'maintainer', 'format', 'pipelineId'],
|
|
57
|
-
['habitat', 'docker', 'binary', 'createTime', 'usage', 'trusted', 'latest']
|
|
61
|
+
['habitat', 'docker', 'binary', 'createTime', 'usage', 'trusted', 'latest', 'compatibilities']
|
|
58
62
|
)
|
|
59
63
|
).label('Get Command'),
|
|
60
64
|
|
package/models/pipeline.js
CHANGED
|
@@ -11,6 +11,13 @@ const Parameters = require('../config/parameters');
|
|
|
11
11
|
const mutate = require('../lib/mutate');
|
|
12
12
|
|
|
13
13
|
const STATES = ['ACTIVE', 'INACTIVE'];
|
|
14
|
+
const BADGE = Joi.object({
|
|
15
|
+
name: Joi.string().max(128).description('The dashboard name for a badge').example('screwdriver/ui'),
|
|
16
|
+
uri: Joi.string()
|
|
17
|
+
.max(500)
|
|
18
|
+
.description('Unique identifier for the badge application dashboard')
|
|
19
|
+
.example('https://sonar.screwdriver.cd/dashboard?id=112233')
|
|
20
|
+
});
|
|
14
21
|
|
|
15
22
|
const CREATE_MODEL = {
|
|
16
23
|
checkoutUrl: Joi.string()
|
|
@@ -90,7 +97,14 @@ const MODEL = {
|
|
|
90
97
|
actions: Joi.array().items(Joi.string())
|
|
91
98
|
})
|
|
92
99
|
)
|
|
93
|
-
.description('List of subscribed scm urls paired with actions')
|
|
100
|
+
.description('List of subscribed scm urls paired with actions'),
|
|
101
|
+
|
|
102
|
+
badges: Joi.object({
|
|
103
|
+
sonar: BADGE
|
|
104
|
+
})
|
|
105
|
+
.description('A list of badges that pipline has')
|
|
106
|
+
.example(`{ sonar: { name: 'dashboard', uri: 'http://sonar.com/sample1' } }`)
|
|
107
|
+
.optional()
|
|
94
108
|
};
|
|
95
109
|
|
|
96
110
|
const UPDATE_MODEL = { ...CREATE_MODEL, settings: MODEL.settings };
|
package/models/template.js
CHANGED
|
@@ -4,6 +4,9 @@ const Joi = require('joi');
|
|
|
4
4
|
const mutate = require('../lib/mutate');
|
|
5
5
|
const Template = require('../config/template');
|
|
6
6
|
const pipelineId = require('./pipeline').base.extract('id');
|
|
7
|
+
const Compatibilities = require('../config/compatibilities');
|
|
8
|
+
|
|
9
|
+
const { compatibilities } = Compatibilities;
|
|
7
10
|
|
|
8
11
|
const MODEL = {
|
|
9
12
|
id: Joi.number().integer().positive().description('Identifier of this template').example(123345),
|
|
@@ -22,7 +25,8 @@ const MODEL = {
|
|
|
22
25
|
.description('When this template was created')
|
|
23
26
|
.example('2038-01-19T03:14:08.131Z'),
|
|
24
27
|
trusted: Joi.boolean().description('Mark whether template is trusted'),
|
|
25
|
-
latest: Joi.boolean().description('Whether this is latest version')
|
|
28
|
+
latest: Joi.boolean().description('Whether this is latest version'),
|
|
29
|
+
compatibilities
|
|
26
30
|
};
|
|
27
31
|
|
|
28
32
|
const CREATE_MODEL = { ...MODEL, config: Template.configNoDupSteps };
|
|
@@ -54,7 +58,7 @@ module.exports = {
|
|
|
54
58
|
mutate(
|
|
55
59
|
MODEL,
|
|
56
60
|
['id', 'labels', 'name', 'version', 'description', 'maintainer', 'pipelineId'],
|
|
57
|
-
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest']
|
|
61
|
+
['config', 'namespace', 'images', 'createTime', 'trusted', 'latest', 'compatibilities']
|
|
58
62
|
)
|
|
59
63
|
).label('Get Template'),
|
|
60
64
|
|