@camunda/zeebe-element-templates-json-schema 0.1.0 → 0.4.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.1.0",
3
+ "version": "0.4.0",
4
4
  "description": "JSON Schema for (Zeebe) Element Templates",
5
5
  "files": [
6
6
  "resources"
@@ -9,7 +9,8 @@
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": "node ../../tasks/generate-schema.js --input=./src/schema.json --output=./resources/schema.json",
13
+ "prepare": "run-s build"
13
14
  },
14
15
  "repository": {
15
16
  "type": "git",
@@ -21,5 +22,6 @@
21
22
  "element-templates",
22
23
  "camunda"
23
24
  ],
24
- "license": "MIT"
25
+ "license": "MIT",
26
+ "gitHead": "4ee5662a548fd2d7f5fde8cab530e394593ea737"
25
27
  }
@@ -2,19 +2,30 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "http://camunda.org/schema/zeebe-element-templates/1.0",
4
4
  "title": "Element Template Schema",
5
- "description": "A single element template configuration or an array of element template configurations",
6
5
  "definitions": {
7
6
  "properties": {
8
7
  "allOf": [
9
8
  {
10
9
  "type": "array",
11
- "title": "element template properties",
12
- "description": "The properties of the element template",
13
- "default": [],
10
+ "description": "List of properties of the element template.",
11
+ "allOf": [
12
+ {
13
+ "examples": [
14
+ [
15
+ {
16
+ "label": "Name",
17
+ "type": "String",
18
+ "binding": {
19
+ "type": "property",
20
+ "name": "name"
21
+ }
22
+ }
23
+ ]
24
+ ]
25
+ }
26
+ ],
14
27
  "items": {
15
28
  "type": "object",
16
- "title": "element template property",
17
- "description": "A property defined for the element template",
18
29
  "default": {},
19
30
  "allOf": [
20
31
  {
@@ -43,53 +54,47 @@
43
54
  "string",
44
55
  "boolean"
45
56
  ],
46
- "title": "property value",
47
- "description": "The value of the control field for the property"
57
+ "description": "The value of a control field."
48
58
  },
49
59
  "description": {
50
60
  "$id": "#/properties/property/description",
51
61
  "type": "string",
52
- "title": "property description",
53
- "description": "The description of the control field"
62
+ "description": "The description of a control field."
54
63
  },
55
64
  "label": {
56
65
  "$id": "#/properties/property/label",
57
66
  "type": "string",
58
- "title": "property label",
59
- "description": "The label of the control field for the property"
67
+ "description": "The label of a control field."
60
68
  },
61
69
  "type": {
62
70
  "$id": "#/properties/property/type",
63
71
  "type": "string",
64
- "title": "property type",
65
- "description": "The type of the control field"
72
+ "description": "The type of a control field."
66
73
  },
67
74
  "editable": {
68
75
  "$id": "#/properties/property/editable",
69
76
  "type": "boolean",
70
- "title": "property editable",
71
- "description": "Indicates whether the property is editable or not"
77
+ "description": "Indicates whether a control field is editable or not."
72
78
  },
73
79
  "choices": {
74
80
  "$id": "#/properties/property/choices",
75
81
  "type": "array",
76
- "title": "property choices",
77
- "description": "The choices for dropdown properties",
82
+ "description": "The choices for dropdown fields.",
83
+ "default": [],
78
84
  "items": {
79
85
  "$id": "#/properties/property/choices/item",
80
86
  "type": "object",
87
+ "default": {},
81
88
  "properties": {
82
89
  "name": {
83
90
  "$id": "#/properties/property/choices/item/name",
84
91
  "type": "string",
85
- "title": "choice name",
86
- "description": "The name of the choice"
92
+ "description": "The name of a choice."
87
93
  },
88
94
  "value": {
89
95
  "$id": "#/properties/property/choices/item/value",
90
96
  "type": "string",
91
- "title": "choice value",
92
- "description": "The value of the choice"
97
+ "description": "The value of a choice."
93
98
  }
94
99
  },
95
100
  "required": [
@@ -102,46 +107,49 @@
102
107
  "constraints": {
103
108
  "$id": "#/properties/property/constraints",
104
109
  "type": "object",
105
- "title": "property constraints",
106
- "description": "The validation constraints",
110
+ "description": "The validation constraints of a control field.",
111
+ "allOf": [
112
+ {
113
+ "examples": [
114
+ {
115
+ "notEmpty": true
116
+ }
117
+ ]
118
+ }
119
+ ],
107
120
  "properties": {
108
121
  "notEmpty": {
109
122
  "$id": "#/properties/property/constraints/notEmpty",
110
123
  "type": "boolean",
111
- "title": "property constraints not empty",
112
- "description": "The control field must not be empty"
124
+ "description": "The control field must not be empty."
113
125
  },
114
126
  "minLength": {
115
127
  "$id": "#/properties/property/constraints/minLength",
116
128
  "type": "number",
117
- "title": "property constraints min length",
118
- "description": "The minimal length for the control field value"
129
+ "description": "The minimal length of a control field value."
119
130
  },
120
131
  "maxLength": {
121
132
  "$id": "#/properties/property/constraints/maxLength",
122
133
  "type": "number",
123
- "title": "property constraints max length",
124
- "description": "The maximal length for the control field value"
134
+ "description": "The maximal length for a control field value."
125
135
  },
126
136
  "pattern": {
127
137
  "$id": "#/properties/property/constraints/pattern",
128
- "title": "property constraints pattern",
129
- "description": "A regular expression pattern for the constraints",
138
+ "description": "A regular expression pattern for a constraint.",
130
139
  "oneOf": [
131
140
  {
132
141
  "type": "object",
142
+ "default": {},
133
143
  "properties": {
134
144
  "value": {
135
145
  "$id": "#/properties/property/constraints/pattern/value",
136
146
  "type": "string",
137
- "title": "property constraints pattern value",
138
- "description": "The regular expression of the pattern constraint"
147
+ "description": "The regular expression of a pattern."
139
148
  },
140
149
  "message": {
141
150
  "$id": "#/properties/property/constraints/pattern/message",
142
151
  "type": "string",
143
- "title": "property constraints pattern message",
144
- "description": "The validation message of the pattern constraint"
152
+ "description": "The validation message of a pattern."
145
153
  }
146
154
  }
147
155
  },
@@ -155,8 +163,7 @@
155
163
  "group": {
156
164
  "$id": "#/properties/property/group",
157
165
  "type": "string",
158
- "title": "property group",
159
- "description": "The custom group of the control field for the property"
166
+ "description": "The custom group of a control field."
160
167
  }
161
168
  }
162
169
  }
@@ -164,13 +171,9 @@
164
171
  {
165
172
  "$schema": "http://json-schema.org/draft-07/schema",
166
173
  "type": "array",
167
- "title": "element template properties",
168
- "description": "The properties of the element template",
169
- "default": [],
174
+ "description": "List of properties of the element template.",
170
175
  "items": {
171
176
  "type": "object",
172
- "title": "element template property",
173
- "description": "A property defined for the element template",
174
177
  "default": {},
175
178
  "required": [
176
179
  "binding"
@@ -307,14 +310,41 @@
307
310
  }
308
311
  }
309
312
  }
313
+ },
314
+ {
315
+ "if": {
316
+ "properties": {
317
+ "feel": {
318
+ "not": {
319
+ "const": null
320
+ }
321
+ }
322
+ },
323
+ "required": [
324
+ "feel"
325
+ ]
326
+ },
327
+ "then": {
328
+ "properties": {
329
+ "type": {
330
+ "enum": [
331
+ "String",
332
+ "Text"
333
+ ],
334
+ "errorMessage": "feel is only supported for \"String\" and \"Text\" type"
335
+ }
336
+ },
337
+ "required": [
338
+ "type"
339
+ ]
340
+ }
310
341
  }
311
342
  ],
312
343
  "properties": {
313
344
  "binding": {
314
345
  "$id": "#/properties/property/binding",
315
346
  "type": "object",
316
- "title": "property binding",
317
- "description": "A binding to a BPMN 2.0 property",
347
+ "description": "Specifying how the property is mapped to BPMN or Zeebe extension elements and attributes.",
318
348
  "required": [
319
349
  "type"
320
350
  ],
@@ -375,13 +405,36 @@
375
405
  ],
376
406
  "errorMessage": "property.binding ${0/type} requires key"
377
407
  }
408
+ },
409
+ {
410
+ "examples": [
411
+ {
412
+ "type": "property",
413
+ "name": "name"
414
+ },
415
+ {
416
+ "type": "zeebe:input",
417
+ "name": "input"
418
+ },
419
+ {
420
+ "type": "zeebe:output",
421
+ "source": "output"
422
+ },
423
+ {
424
+ "type": "zeebe:taskDefinition:type"
425
+ },
426
+ {
427
+ "type": "zeebe:taskHeader",
428
+ "key": "key"
429
+ }
430
+ ]
378
431
  }
379
432
  ],
380
433
  "properties": {
381
434
  "type": {
382
435
  "$id": "#/properties/property/binding/type",
383
436
  "type": "string",
384
- "title": "property binding type",
437
+ "description": "The type of a property binding.",
385
438
  "enum": [
386
439
  "property",
387
440
  "zeebe:taskDefinition:type",
@@ -389,34 +442,40 @@
389
442
  "zeebe:output",
390
443
  "zeebe:taskHeader"
391
444
  ],
392
- "errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:taskHeader }",
393
- "description": "The type of the property binding"
445
+ "errorMessage": "invalid property.binding type ${0}; must be any of { property, zeebe:taskDefinition:type, zeebe:input, zeebe:output, zeebe:taskHeader }"
394
446
  },
395
447
  "name": {
396
448
  "$id": "#/properties/property/binding/name",
397
449
  "type": "string",
398
- "title": "property binding name",
399
- "description": "The name of binding xml property"
450
+ "description": "The name of a property binding."
400
451
  },
401
452
  "source": {
402
453
  "$id": "#/properties/property/binding/source",
403
454
  "type": "string",
404
- "title": "property binding source",
405
- "description": "The source value of a property binding (zeebe:output)"
455
+ "description": "The source value of a property binding (zeebe:output)."
406
456
  },
407
457
  "key": {
408
458
  "$id": "#/properties/property/binding/key",
409
459
  "type": "string",
410
- "title": "property binding key",
411
- "description": "The key value of a property binding (zeebe:taskHeader)"
460
+ "description": "The key value of a property binding (zeebe:taskHeader)."
412
461
  }
413
462
  }
414
463
  },
415
464
  "optional": {
416
465
  "$id": "#/optional",
417
466
  "type": "boolean",
418
- "title": "element template optional",
419
- "description": "Indicates whether a property is optional"
467
+ "description": "Indicates whether a property is optional. Optional bindings do not persist empty values in the underlying BPMN 2.0 XML."
468
+ },
469
+ "feel": {
470
+ "$id": "#/properties/property/feel",
471
+ "type": "string",
472
+ "default": null,
473
+ "description": "Indicates whether the property can be a feel expression",
474
+ "enum": [
475
+ null,
476
+ "optional",
477
+ "required"
478
+ ]
420
479
  }
421
480
  }
422
481
  }
@@ -437,71 +496,111 @@
437
496
  "name": {
438
497
  "$id": "#/name",
439
498
  "type": "string",
440
- "title": "element template name",
441
- "description": "The name of the element template"
499
+ "description": "The name of the element template."
442
500
  },
443
501
  "id": {
444
502
  "$id": "#/id",
445
503
  "type": "string",
446
- "title": "element template id",
447
- "description": "The identifier of the element template"
504
+ "description": "The identifier of the element template."
448
505
  },
449
506
  "description": {
450
507
  "$id": "#/description",
451
508
  "type": "string",
452
- "title": "element template description",
453
- "description": "The description of the element template"
509
+ "description": "The description of the element template."
454
510
  },
455
511
  "version": {
456
512
  "$id": "#/version",
457
513
  "type": "number",
458
- "title": "element template version",
459
- "description": "The version of the element template"
514
+ "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."
460
515
  },
461
516
  "isDefault": {
462
517
  "$id": "#/isDefault",
463
518
  "type": "boolean",
464
- "title": "element template is default",
465
- "description": "Indicates whether the element template is a default template"
519
+ "description": "Indicates whether the element template is a default template."
466
520
  },
467
521
  "appliesTo": {
468
522
  "$id": "#/appliesTo",
469
523
  "type": "array",
470
- "title": "element template applies to",
471
- "description": "The definition for which element types the element template can be applied",
524
+ "description": "List of BPMN types the template can be applied to.",
472
525
  "default": [],
473
526
  "items": {
474
527
  "$id": "#/appliesTo/items",
475
528
  "type": "string",
476
- "pattern": "^(.*?:)",
529
+ "pattern": "^[\\w\\d]+:[\\w\\d]+$",
477
530
  "errorMessage": {
478
531
  "pattern": "invalid item for \"appliesTo\", should contain namespaced property, example: \"bpmn:Task\""
532
+ },
533
+ "allOf": [
534
+ {
535
+ "examples": [
536
+ "bpmn:Task",
537
+ "bpmn:ServiceTask",
538
+ "bpmn:SequenceFlow",
539
+ "bpmn:Process",
540
+ "bpmn:StartEvent",
541
+ "bpmn:Gateway"
542
+ ]
543
+ }
544
+ ]
545
+ }
546
+ },
547
+ "elementType": {
548
+ "$id": "#/elementType",
549
+ "type": "object",
550
+ "description": "The BPMN type the element will be transformed into.",
551
+ "default": {},
552
+ "properties": {
553
+ "value": {
554
+ "$id": "#/elementType/value",
555
+ "type": "string",
556
+ "pattern": "^[\\w\\d]+:[\\w\\d]+$",
557
+ "errorMessage": {
558
+ "pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
559
+ },
560
+ "allOf": [
561
+ {
562
+ "examples": [
563
+ "bpmn:ServiceTask",
564
+ "bpmn:UserTask",
565
+ "bpmn:StartEvent",
566
+ "bpmn:ExclusiveGateway",
567
+ "bpmn:ParallelGateway"
568
+ ]
569
+ }
570
+ ]
479
571
  }
480
572
  }
481
573
  },
482
574
  "metadata": {
483
575
  "$id": "#/metadata",
484
576
  "type": "object",
485
- "title": "element template metadata",
486
- "description": "Some metadata for further configuration"
577
+ "description": "Some custom properties for further configuration.",
578
+ "default": {}
487
579
  },
488
580
  "entriesVisible": {
489
581
  "$id": "#/entriesVisible",
490
582
  "type": "boolean",
491
- "title": "element template entries visible",
492
- "description": "Select whether non-template entries are visible in the properties panel"
583
+ "description": "Select whether non-template entries are visible in the properties panel."
493
584
  },
494
585
  "groups": {
495
586
  "$id": "#/groups",
496
587
  "type": "array",
497
- "title": "element template properties groups",
498
- "description": "The custom defined groups of the element template",
499
- "default": [],
588
+ "description": "Custom fields can be ordered together via groups.",
589
+ "allOf": [
590
+ {
591
+ "examples": [
592
+ [
593
+ {
594
+ "id": "group-1",
595
+ "label": "My Group"
596
+ }
597
+ ]
598
+ ]
599
+ }
600
+ ],
500
601
  "items": {
501
602
  "$id": "#/groups/group",
502
603
  "type": "object",
503
- "title": "element template group",
504
- "description": "A custom defined group for the element template",
505
604
  "default": {},
506
605
  "required": [
507
606
  "id",
@@ -517,17 +616,23 @@
517
616
  "id": {
518
617
  "$id": "#/groups/group/id",
519
618
  "type": "string",
520
- "title": "group id",
521
619
  "description": "The id of the custom group"
522
620
  },
523
621
  "label": {
524
622
  "$id": "#/groups/group/label",
525
623
  "type": "string",
526
- "title": "group label",
527
624
  "description": "The label of the custom group"
528
625
  }
529
626
  }
530
627
  }
628
+ },
629
+ "documentationRef": {
630
+ "$id": "#/documentaionRef",
631
+ "type": "string",
632
+ "pattern": "^(https|http)://.*",
633
+ "errorMessage": {
634
+ "pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
635
+ }
531
636
  }
532
637
  },
533
638
  "errorMessage": {
@@ -544,16 +649,43 @@
544
649
  "properties": {
545
650
  "$ref": "#/definitions/properties",
546
651
  "$id": "#/properties"
652
+ },
653
+ "icon": {
654
+ "$id": "#/icon",
655
+ "type": "object",
656
+ "description": "Custom icon to be shown on the element",
657
+ "default": {},
658
+ "properties": {
659
+ "contents": {
660
+ "$id": "#/icon/contents",
661
+ "type": "string",
662
+ "description": "The URL of an icon.",
663
+ "pattern": "^(https?|data):.*",
664
+ "errorMessage": {
665
+ "pattern": "Malformed icon source, must be a valid HTTP(s) or data URL"
666
+ }
667
+ }
668
+ },
669
+ "required": [
670
+ "contents"
671
+ ],
672
+ "errorMessage": {
673
+ "required": {
674
+ "contents": "missing icon contents"
675
+ }
676
+ }
547
677
  }
548
678
  }
549
679
  }
550
680
  },
551
681
  "oneOf": [
552
682
  {
683
+ "description": "An element template configuration.",
553
684
  "$ref": "#/definitions/template"
554
685
  },
555
686
  {
556
687
  "type": "array",
688
+ "description": "A list of element template configurations.",
557
689
  "items": {
558
690
  "$ref": "#/definitions/template"
559
691
  }
package/CHANGELOG.md DELETED
@@ -1,12 +0,0 @@
1
- # Changelog
2
-
3
- All notable changes to [@camunda/zeebe-element-templates-json-schema](https://github.com/camunda/element-templates-json-schema/packages/zeebe-element-templates-json-schema) are documented here. We use [semantic versioning](http://semver.org/) for releases.
4
-
5
- ## Unreleased
6
-
7
- ___Note:__ Yet to be released changes appear here._
8
-
9
-
10
- ## 0.1.0
11
-
12
- * `FEAT`: initial version :tada: