screwdriver-data-schema 23.8.0 → 23.10.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.
|
@@ -6,7 +6,6 @@ const Annotations = require('./annotations');
|
|
|
6
6
|
const Parameters = require('./parameters');
|
|
7
7
|
const Template = require('./template');
|
|
8
8
|
const Regex = require('./regex');
|
|
9
|
-
const WorkflowGraph = require('./workflowGraph');
|
|
10
9
|
|
|
11
10
|
const SCHEMA_CONFIG = Joi.object()
|
|
12
11
|
.keys({
|
|
@@ -16,8 +15,7 @@ const SCHEMA_CONFIG = Joi.object()
|
|
|
16
15
|
annotations: Annotations.annotations,
|
|
17
16
|
cache: BaseSchema.cache,
|
|
18
17
|
subscribe: BaseSchema.subscribe,
|
|
19
|
-
stages: BaseSchema.stages
|
|
20
|
-
workflowGraph: WorkflowGraph.workflowGraph
|
|
18
|
+
stages: BaseSchema.stages
|
|
21
19
|
})
|
|
22
20
|
.unknown(false);
|
|
23
21
|
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
|
|
4
|
+
const table = `${prefix}pipelineTemplateVersions`;
|
|
5
|
+
|
|
6
|
+
module.exports = {
|
|
7
|
+
async up(queryInterface, Sequelize) {
|
|
8
|
+
await queryInterface.sequelize.transaction(async transaction => {
|
|
9
|
+
await queryInterface.addColumn(
|
|
10
|
+
table,
|
|
11
|
+
'workflowGraph',
|
|
12
|
+
{
|
|
13
|
+
type: Sequelize.TEXT,
|
|
14
|
+
defaultValue: '{"nodes": [],"edges":[]}',
|
|
15
|
+
allowNull: false
|
|
16
|
+
},
|
|
17
|
+
{ transaction }
|
|
18
|
+
);
|
|
19
|
+
});
|
|
20
|
+
}
|
|
21
|
+
};
|
|
@@ -4,6 +4,7 @@ const Joi = require('joi');
|
|
|
4
4
|
const mutate = require('../lib/mutate');
|
|
5
5
|
const pipelineTemplateVersions = require('../config/pipelineTemplate');
|
|
6
6
|
const JobTemplateConfig = require('../config/template');
|
|
7
|
+
const WorkflowGraph = require('../config/workflowGraph');
|
|
7
8
|
const templateId = require('./templateMeta').base.extract('id');
|
|
8
9
|
|
|
9
10
|
const MODEL = {
|
|
@@ -17,6 +18,10 @@ const MODEL = {
|
|
|
17
18
|
.max(32)
|
|
18
19
|
.description('When this template was created')
|
|
19
20
|
.example('2038-01-19T03:14:08.131Z')
|
|
21
|
+
.required(),
|
|
22
|
+
workflowGraph: WorkflowGraph.workflowGraph
|
|
23
|
+
.description('Graph representation of the workflow')
|
|
24
|
+
.default('{"nodes": [],"edges":[]}')
|
|
20
25
|
.required()
|
|
21
26
|
};
|
|
22
27
|
|
|
@@ -43,9 +48,9 @@ module.exports = {
|
|
|
43
48
|
* @property get
|
|
44
49
|
* @type {Joi}
|
|
45
50
|
*/
|
|
46
|
-
get: Joi.object(
|
|
47
|
-
'
|
|
48
|
-
),
|
|
51
|
+
get: Joi.object(
|
|
52
|
+
mutate(MODEL, ['id', 'templateId', 'version'], ['description', 'config', 'createTime', 'workflowGraph'])
|
|
53
|
+
).label('Get Template'),
|
|
49
54
|
|
|
50
55
|
/**
|
|
51
56
|
* List of fields that determine a unique row
|