screwdriver-data-schema 23.1.0 → 23.2.1

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/base.js CHANGED
@@ -67,7 +67,7 @@ const SCHEMA_CONFIG_PRE_TEMPLATE_MERGE = Joi.object()
67
67
  .keys({
68
68
  template: Joi.string().regex(Regex.FULL_TEMPLATE_NAME_WITH_NAMESPACE),
69
69
  version: Joi.number().integer().min(1).max(50),
70
- annotations: Annotations.annotations.when('template', { is: Joi.exist(), then: Joi.forbidden() }),
70
+ annotations: Annotations.annotations,
71
71
  jobs: SCHEMA_JOBS.when('template', { is: Joi.exist(), then: Joi.forbidden(), otherwise: Joi.required() }),
72
72
  shared: Joi.when('template', {
73
73
  is: Joi.exist(),
@@ -78,11 +78,11 @@ const SCHEMA_CONFIG_PRE_TEMPLATE_MERGE = Joi.object()
78
78
  }),
79
79
  otherwise: SCHEMA_SHARED
80
80
  }),
81
- cache: SCHEMA_CACHE.when('template', { is: Joi.exist(), then: Joi.forbidden() }),
82
- childPipelines: SCHEMA_CHILD_PIPELINES.when('template', { is: Joi.exist(), then: Joi.forbidden() }),
81
+ cache: SCHEMA_CACHE,
82
+ childPipelines: SCHEMA_CHILD_PIPELINES,
83
83
  stages: SCHEMA_STAGES.when('template', { is: Joi.exist(), then: Joi.forbidden() }),
84
- subscribe: SCHEMA_SUBSCRIBE.when('template', { is: Joi.exist(), then: Joi.forbidden() }),
85
- parameters: Parameters.parameters.default({}).when('template', { is: Joi.exist(), then: Joi.forbidden() })
84
+ subscribe: SCHEMA_SUBSCRIBE,
85
+ parameters: Parameters.parameters.default({})
86
86
  })
87
87
  .unknown(false);
88
88
 
@@ -1,17 +1,20 @@
1
1
  'use strict';
2
2
 
3
3
  const Joi = require('joi');
4
- const JobsSchema = require('./base').jobs;
5
- const Shared = require('./base').shared;
4
+ const BaseSchema = require('./base');
5
+ const Annotations = require('./annotations');
6
6
  const Parameters = require('./parameters');
7
7
  const Template = require('./template');
8
8
  const Regex = require('./regex');
9
9
 
10
10
  const SCHEMA_CONFIG = Joi.object()
11
11
  .keys({
12
- jobs: JobsSchema.required(),
13
- shared: Shared,
14
- parameters: Parameters.parameters.default({})
12
+ jobs: BaseSchema.jobs.required(),
13
+ shared: BaseSchema.shared,
14
+ parameters: Parameters.parameters.default({}),
15
+ annotations: Annotations.annotations,
16
+ cache: BaseSchema.cache,
17
+ subscribe: BaseSchema.subscribe
15
18
  })
16
19
  .unknown(false);
17
20
 
package/models/event.js CHANGED
@@ -32,7 +32,10 @@ const MODEL = {
32
32
  .description('When this event was created')
33
33
  .example('2038-01-19T03:14:08.131Z'),
34
34
  creator: Scm.user.description('Creator of the event'),
35
- meta: Joi.object().default({}).description('Key=>Value information from the event itself'),
35
+ meta: Joi.object()
36
+ .default({})
37
+ .description('Key=>Value information from the event itself')
38
+ .example({ parameters: { nameA: 'value1', jobA: { nameB: 'value2' } } }),
36
39
  pipelineId: Joi.number().integer().positive().description('Identifier of this pipeline').example(123345),
37
40
  sha: Joi.string()
38
41
  .hex()
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "screwdriver-data-schema",
3
- "version": "23.1.0",
3
+ "version": "23.2.1",
4
4
  "description": "Internal Data Schema of Screwdriver",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -31,7 +31,8 @@ const SCHEMA_SCAN = Joi.object().keys({
31
31
  }),
32
32
  search: Joi.object().keys({
33
33
  field: Joi.alternatives().try(Joi.array().items(SCHEMA_SEARCH_FIELD), SCHEMA_SEARCH_FIELD),
34
- keyword: Joi.alternatives().try(Joi.array().items(SCHEMA_SEARCH_KEYWORD), SCHEMA_SEARCH_KEYWORD)
34
+ keyword: Joi.alternatives().try(Joi.array().items(SCHEMA_SEARCH_KEYWORD), SCHEMA_SEARCH_KEYWORD),
35
+ inverse: Joi.boolean().default(false).optional()
35
36
  }),
36
37
  sort: Joi.string().lowercase().valid('ascending', 'descending').default('descending'),
37
38
  sortBy: Joi.string().max(100),