screwdriver-data-schema 22.6.0 → 22.7.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.
@@ -0,0 +1,6 @@
1
+ trailingComma: "none"
2
+ printWidth: 100
3
+ singleQuote: true
4
+ tabWidth: 4
5
+ arrowParens: "avoid"
6
+ htmlWhitespaceSensitivity: "strict"
package/api/index.js CHANGED
@@ -9,12 +9,14 @@ const status = require('./status');
9
9
  const templateValidator = require('./templateValidator');
10
10
  const validator = require('./validator');
11
11
  const versions = require('./versions');
12
+ const pipelineUsage = require('./pipelineUsage');
12
13
 
13
14
  module.exports = {
14
15
  auth,
15
16
  commandValidator,
16
17
  loglines,
17
18
  pagination,
19
+ pipelineUsage,
18
20
  stats,
19
21
  status,
20
22
  templateValidator,
@@ -0,0 +1,17 @@
1
+ 'use strict';
2
+
3
+ const Joi = require('joi');
4
+ const pipelineSchema = require('../models/pipeline').base;
5
+ const eventSchema = require('../models/event').base;
6
+
7
+ module.exports = {
8
+ get: Joi.array().items(
9
+ Joi.object({
10
+ id: pipelineSchema.extract('id').required(),
11
+ name: pipelineSchema.extract('name').required(),
12
+ scmRepo: pipelineSchema.extract('scmRepo').required(),
13
+ lastRun: Joi.alternatives().try(eventSchema.extract('createTime'), Joi.allow(null)),
14
+ admins: pipelineSchema.extract('admins').required()
15
+ })
16
+ )
17
+ };
@@ -0,0 +1,20 @@
1
+ 'use strict';
2
+
3
+ const prefix = process.env.DATASTORE_SEQUELIZE_PREFIX || '';
4
+ const table = `${prefix}templateTags`;
5
+
6
+ module.exports = {
7
+ // eslint-disable-next-line no-unused-vars
8
+ async up(queryInterface, Sequelize) {
9
+ await queryInterface.sequelize.transaction(async transaction => {
10
+ await queryInterface.removeConstraint(table, `${table}_namespace_name_tag_key`, { transaction });
11
+
12
+ await queryInterface.addConstraint(table, {
13
+ name: `${table}_namespace_name_tag_templateType_key`,
14
+ fields: ['name', 'tag', 'namespace', 'templateType'],
15
+ type: 'unique',
16
+ transaction
17
+ });
18
+ });
19
+ }
20
+ };
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "22.6.0",
3
+ "version": "22.7.0",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {