@camunda/zeebe-element-templates-json-schema 0.5.0-alpha.0 → 0.6.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/zeebe-element-templates-json-schema",
3
- "version": "0.5.0-alpha.0",
3
+ "version": "0.6.0",
4
4
  "description": "JSON Schema for (Zeebe) Element Templates",
5
5
  "files": [
6
6
  "resources"
@@ -9,7 +9,9 @@
9
9
  "test": "mocha -r esm --reporter=spec --recursive test/spec",
10
10
  "dev": "npm run test -- --watch",
11
11
  "all": "run-s build test",
12
- "build": "node ../../tasks/generate-schema.js --input=./src/schema.json --output=./resources/schema.json",
12
+ "build": "run-s build:error-messages build:schema",
13
+ "build:error-messages": "node ../../tasks/generate-error-messages.js --input=./src/error-messages.json --output=./resources/error-messages.json",
14
+ "build:schema": "node ../../tasks/generate-schema.js --input=./src/schema.json --output=./resources/schema.json",
13
15
  "prepare": "run-s build"
14
16
  },
15
17
  "repository": {
@@ -23,5 +25,5 @@
23
25
  "camunda"
24
26
  ],
25
27
  "license": "MIT",
26
- "gitHead": "457a27772193578b941bae05d6af0f96841e5485"
28
+ "gitHead": "92ee15b12a90b2ac8c9cc81108efc759d79b8f07"
27
29
  }
@@ -0,0 +1,314 @@
1
+ [
2
+ {
3
+ "path": [
4
+ "definitions",
5
+ "properties",
6
+ "allOf",
7
+ 0,
8
+ "items",
9
+ "allOf",
10
+ 0,
11
+ "then"
12
+ ],
13
+ "errorMessage": "must provide choices=[] with \"Dropdown\" type"
14
+ },
15
+ {
16
+ "path": [
17
+ "definitions",
18
+ "properties",
19
+ "allOf",
20
+ 0,
21
+ "items",
22
+ "properties",
23
+ "choices",
24
+ "items"
25
+ ],
26
+ "errorMessage": {
27
+ "required": "{ name, value } must be specified for \"Dropdown\" choices"
28
+ }
29
+ },
30
+ {
31
+ "path": [
32
+ "definitions",
33
+ "properties",
34
+ "allOf",
35
+ 1,
36
+ "items",
37
+ "properties",
38
+ "binding",
39
+ "allOf",
40
+ 0,
41
+ "then"
42
+ ],
43
+ "errorMessage": "property.binding ${0/type} requires name"
44
+ },
45
+ {
46
+ "path": [
47
+ "definitions",
48
+ "template",
49
+ "allOf",
50
+ 0,
51
+ "properties",
52
+ "appliesTo",
53
+ "items"
54
+ ],
55
+ "errorMessage": {
56
+ "pattern": "invalid item for \"appliesTo\", should contain namespaced property, example: \"bpmn:Task\""
57
+ }
58
+ },
59
+ {
60
+ "path": [
61
+ "definitions",
62
+ "template",
63
+ "allOf",
64
+ 0,
65
+ "properties",
66
+ "elementType"
67
+ ],
68
+ "errorMessage": {
69
+ "required": {
70
+ "value": "missing elementType value"
71
+ }
72
+ }
73
+ },
74
+ {
75
+ "path": [
76
+ "definitions",
77
+ "template",
78
+ "allOf",
79
+ 0,
80
+ "properties",
81
+ "elementType",
82
+ "properties",
83
+ "value"
84
+ ],
85
+ "errorMessage": {
86
+ "pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
87
+ }
88
+ },
89
+ {
90
+ "path": [
91
+ "definitions",
92
+ "template",
93
+ "allOf",
94
+ "0",
95
+ "properties",
96
+ "groups",
97
+ "items"
98
+ ],
99
+ "errorMessage": {
100
+ "required": {
101
+ "id": "missing id for group \"${0#}\"",
102
+ "label": "missing label for group \"${0#}\""
103
+ }
104
+ }
105
+ },
106
+ {
107
+ "path": [
108
+ "definitions",
109
+ "template",
110
+ "allOf",
111
+ 0,
112
+ "properties",
113
+ "documentationRef"
114
+ ],
115
+ "errorMessage": {
116
+ "pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
117
+ }
118
+ },
119
+ {
120
+ "path": [
121
+ "definitions",
122
+ "template",
123
+ "allOf",
124
+ 0
125
+ ],
126
+ "errorMessage": {
127
+ "required": {
128
+ "name": "missing template name",
129
+ "id": "missing template id",
130
+ "appliesTo": "missing appliesTo=[]",
131
+ "properties": "missing properties=[]"
132
+ }
133
+ }
134
+ },
135
+ {
136
+ "path": [
137
+ "definitions",
138
+ "properties",
139
+ "allOf",
140
+ 0,
141
+ "items",
142
+ "properties",
143
+ "condition"
144
+ ],
145
+ "errorMessage": {
146
+ "required": {
147
+ "property": "missing property name for condition"
148
+ }
149
+ }
150
+ },
151
+ {
152
+ "path": [
153
+ "definitions",
154
+ "properties",
155
+ "allOf",
156
+ 1,
157
+ "items"
158
+ ],
159
+ "errorMessage": {
160
+ "required": {
161
+ "binding": "missing binding for property \"${0#}\""
162
+ }
163
+ }
164
+ },
165
+ {
166
+ "path": [
167
+ "definitions",
168
+ "properties",
169
+ "allOf",
170
+ 1,
171
+ "items",
172
+ "allOf",
173
+ 0,
174
+ "then",
175
+ "properties",
176
+ "type"
177
+ ],
178
+ "errorMessage": "invalid property type ${0} for binding type \"property\"; must be any of { String, Text, Hidden, Dropdown, Boolean }"
179
+ },
180
+ {
181
+ "path": [
182
+ "definitions",
183
+ "properties",
184
+ "allOf",
185
+ 1,
186
+ "items",
187
+ "allOf",
188
+ 1,
189
+ "then",
190
+ "properties",
191
+ "type"
192
+ ],
193
+ "errorMessage": "invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Text, Hidden, Dropdown }"
194
+ },
195
+ {
196
+ "path": [
197
+ "definitions",
198
+ "properties",
199
+ "allOf",
200
+ 1,
201
+ "items",
202
+ "allOf",
203
+ 2,
204
+ "then",
205
+ "properties",
206
+ "binding",
207
+ "properties",
208
+ "type"
209
+ ],
210
+ "errorMessage": "optional is not supported for binding type ${0}; must be any of { zeebe:input, zeebe:output, zeebe:property }"
211
+ },
212
+ {
213
+ "path": [
214
+ "definitions",
215
+ "properties",
216
+ "allOf",
217
+ 1,
218
+ "items",
219
+ "allOf",
220
+ 3,
221
+ "then",
222
+ "properties",
223
+ "constraints",
224
+ "properties",
225
+ "notEmpty"
226
+ ],
227
+ "errorMessage": "optional is not allowed for truthy \"notEmpty\" constraint"
228
+ },
229
+ {
230
+ "path": [
231
+ "definitions",
232
+ "properties",
233
+ "allOf",
234
+ 1,
235
+ "items",
236
+ "allOf",
237
+ 4,
238
+ "then",
239
+ "properties",
240
+ "type"
241
+ ],
242
+ "errorMessage": "feel is only supported for \"String\" and \"Text\" type"
243
+ },
244
+ {
245
+ "path": [
246
+ "definitions",
247
+ "properties",
248
+ "allOf",
249
+ 1,
250
+ "items",
251
+ "properties",
252
+ "binding",
253
+ "allOf",
254
+ 1,
255
+ "then"
256
+ ],
257
+ "errorMessage": "property.binding ${0/type} requires source"
258
+ },
259
+ {
260
+ "path": [
261
+ "definitions",
262
+ "properties",
263
+ "allOf",
264
+ 1,
265
+ "items",
266
+ "properties",
267
+ "binding",
268
+ "allOf",
269
+ 2,
270
+ "then"
271
+ ],
272
+ "errorMessage": "property.binding ${0/type} requires key"
273
+ },
274
+ {
275
+ "path": [
276
+ "definitions",
277
+ "properties",
278
+ "allOf",
279
+ 1,
280
+ "items",
281
+ "properties",
282
+ "binding",
283
+ "properties",
284
+ "type"
285
+ ],
286
+ "errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:property, zeebe:taskHeader }"
287
+ },
288
+ {
289
+ "path": [
290
+ "definitions",
291
+ "template",
292
+ "properties",
293
+ "icon",
294
+ "properties",
295
+ "contents"
296
+ ],
297
+ "errorMessage": {
298
+ "pattern": "Malformed icon source, must be a valid HTTP(s) or data URL"
299
+ }
300
+ },
301
+ {
302
+ "path": [
303
+ "definitions",
304
+ "template",
305
+ "properties",
306
+ "icon"
307
+ ],
308
+ "errorMessage": {
309
+ "required": {
310
+ "contents": "missing icon contents"
311
+ }
312
+ }
313
+ }
314
+ ]
@@ -42,8 +42,7 @@
42
42
  "then": {
43
43
  "required": [
44
44
  "choices"
45
- ],
46
- "errorMessage": "must provide choices=[] with \"Dropdown\" type"
45
+ ]
47
46
  }
48
47
  }
49
48
  ],
@@ -104,8 +103,7 @@
104
103
  "required": [
105
104
  "value",
106
105
  "name"
107
- ],
108
- "errorMessage": "{ name, value } must be specified for \"Dropdown\" choices"
106
+ ]
109
107
  }
110
108
  },
111
109
  "constraints": {
@@ -196,11 +194,6 @@
196
194
  "required": [
197
195
  "property"
198
196
  ],
199
- "errorMessage": {
200
- "required": {
201
- "property": "missing property name for condition"
202
- }
203
- },
204
197
  "properties": {
205
198
  "type": {
206
199
  "$id": "#/condition/type",
@@ -260,11 +253,6 @@
260
253
  "required": [
261
254
  "binding"
262
255
  ],
263
- "errorMessage": {
264
- "required": {
265
- "binding": "missing binding for property \"${0#}\""
266
- }
267
- },
268
256
  "allOf": [
269
257
  {
270
258
  "if": {
@@ -293,8 +281,7 @@
293
281
  "Hidden",
294
282
  "Dropdown",
295
283
  "Boolean"
296
- ],
297
- "errorMessage": "invalid property type ${0} for binding type \"property\"; must be any of { String, Text, Hidden, Dropdown, Boolean }"
284
+ ]
298
285
  }
299
286
  }
300
287
  }
@@ -308,6 +295,7 @@
308
295
  "enum": [
309
296
  "zeebe:input",
310
297
  "zeebe:output",
298
+ "zeebe:property",
311
299
  "zeebe:taskHeader",
312
300
  "zeebe:taskDefinition:type"
313
301
  ]
@@ -330,8 +318,7 @@
330
318
  "Text",
331
319
  "Hidden",
332
320
  "Dropdown"
333
- ],
334
- "errorMessage": "invalid property type ${0} for binding type ${1/binding/type}; must be any of { String, Text, Hidden, Dropdown }"
321
+ ]
335
322
  }
336
323
  }
337
324
  }
@@ -354,9 +341,9 @@
354
341
  "type": {
355
342
  "enum": [
356
343
  "zeebe:input",
357
- "zeebe:output"
358
- ],
359
- "errorMessage": "optional is not supported for binding type ${0}; must be any of { zeebe:input, zeebe:output }"
344
+ "zeebe:output",
345
+ "zeebe:property"
346
+ ]
360
347
  }
361
348
  },
362
349
  "required": [
@@ -382,8 +369,7 @@
382
369
  "constraints": {
383
370
  "properties": {
384
371
  "notEmpty": {
385
- "const": false,
386
- "errorMessage": "optional is not allowed for truthy \"notEmpty\" constraint"
372
+ "const": false
387
373
  }
388
374
  },
389
375
  "required": [
@@ -412,8 +398,7 @@
412
398
  "enum": [
413
399
  "String",
414
400
  "Text"
415
- ],
416
- "errorMessage": "feel is only supported for \"String\" and \"Text\" type"
401
+ ]
417
402
  }
418
403
  },
419
404
  "required": [
@@ -437,6 +422,7 @@
437
422
  "type": {
438
423
  "enum": [
439
424
  "property",
425
+ "zeebe:property",
440
426
  "zeebe:input"
441
427
  ]
442
428
  }
@@ -448,8 +434,7 @@
448
434
  "then": {
449
435
  "required": [
450
436
  "name"
451
- ],
452
- "errorMessage": "property.binding ${0/type} requires name"
437
+ ]
453
438
  }
454
439
  },
455
440
  {
@@ -466,8 +451,7 @@
466
451
  "then": {
467
452
  "required": [
468
453
  "source"
469
- ],
470
- "errorMessage": "property.binding ${0/type} requires source"
454
+ ]
471
455
  }
472
456
  },
473
457
  {
@@ -484,8 +468,7 @@
484
468
  "then": {
485
469
  "required": [
486
470
  "key"
487
- ],
488
- "errorMessage": "property.binding ${0/type} requires key"
471
+ ]
489
472
  }
490
473
  },
491
474
  {
@@ -502,6 +485,10 @@
502
485
  "type": "zeebe:output",
503
486
  "source": "output"
504
487
  },
488
+ {
489
+ "type": "zeebe:property",
490
+ "name": "property"
491
+ },
505
492
  {
506
493
  "type": "zeebe:taskDefinition:type"
507
494
  },
@@ -522,9 +509,9 @@
522
509
  "zeebe:taskDefinition:type",
523
510
  "zeebe:input",
524
511
  "zeebe:output",
512
+ "zeebe:property",
525
513
  "zeebe:taskHeader"
526
- ],
527
- "errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:taskHeader }"
514
+ ]
528
515
  },
529
516
  "name": {
530
517
  "$id": "#/properties/property/binding/name",
@@ -592,7 +579,7 @@
592
579
  },
593
580
  "version": {
594
581
  "$id": "#/version",
595
- "type": "number",
582
+ "type": "integer",
596
583
  "description": "Optional version of the template. If you add a version to a template it will be considered unique based on its ID and version. Two templates can have the same ID if their version is different."
597
584
  },
598
585
  "isDefault": {
@@ -609,9 +596,6 @@
609
596
  "$id": "#/appliesTo/items",
610
597
  "type": "string",
611
598
  "pattern": "^[\\w\\d]+:[\\w\\d]+$",
612
- "errorMessage": {
613
- "pattern": "invalid item for \"appliesTo\", should contain namespaced property, example: \"bpmn:Task\""
614
- },
615
599
  "allOf": [
616
600
  {
617
601
  "examples": [
@@ -634,19 +618,11 @@
634
618
  "required": [
635
619
  "value"
636
620
  ],
637
- "errorMessage": {
638
- "required": {
639
- "value": "missing elementType value"
640
- }
641
- },
642
621
  "properties": {
643
622
  "value": {
644
623
  "$id": "#/elementType/value",
645
624
  "type": "string",
646
625
  "pattern": "^[\\w\\d]+:[\\w\\d]+$",
647
- "errorMessage": {
648
- "pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
649
- },
650
626
  "allOf": [
651
627
  {
652
628
  "examples": [
@@ -696,12 +672,6 @@
696
672
  "id",
697
673
  "label"
698
674
  ],
699
- "errorMessage": {
700
- "required": {
701
- "id": "missing id for group \"${0#}\"",
702
- "label": "missing label for group \"${0#}\""
703
- }
704
- },
705
675
  "properties": {
706
676
  "id": {
707
677
  "$id": "#/groups/group/id",
@@ -717,20 +687,9 @@
717
687
  }
718
688
  },
719
689
  "documentationRef": {
720
- "$id": "#/documentaionRef",
690
+ "$id": "#/documentationRef",
721
691
  "type": "string",
722
- "pattern": "^(https|http)://.*",
723
- "errorMessage": {
724
- "pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
725
- }
726
- }
727
- },
728
- "errorMessage": {
729
- "required": {
730
- "name": "missing template name",
731
- "id": "missing template id",
732
- "appliesTo": "missing appliesTo=[]",
733
- "properties": "missing properties=[]"
692
+ "pattern": "^(https|http)://.*"
734
693
  }
735
694
  }
736
695
  }
@@ -750,20 +709,12 @@
750
709
  "$id": "#/icon/contents",
751
710
  "type": "string",
752
711
  "description": "The URL of an icon.",
753
- "pattern": "^(https?|data):.*",
754
- "errorMessage": {
755
- "pattern": "Malformed icon source, must be a valid HTTP(s) or data URL"
756
- }
712
+ "pattern": "^(https?|data):.*"
757
713
  }
758
714
  },
759
715
  "required": [
760
716
  "contents"
761
- ],
762
- "errorMessage": {
763
- "required": {
764
- "contents": "missing icon contents"
765
- }
766
- }
717
+ ]
767
718
  }
768
719
  }
769
720
  }