@camunda/element-templates-json-schema 0.7.0 → 0.9.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.
Files changed (2) hide show
  1. package/package.json +2 -2
  2. package/resources/schema.json +223 -91
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/element-templates-json-schema",
3
- "version": "0.7.0",
3
+ "version": "0.9.1",
4
4
  "description": "JSON Schema for (Camunda) Element Templates",
5
5
  "files": [
6
6
  "resources"
@@ -23,5 +23,5 @@
23
23
  "camunda"
24
24
  ],
25
25
  "license": "MIT",
26
- "gitHead": "10f6fcffa13669ff52d15934e1c189acacf1fd8a"
26
+ "gitHead": "5579ae200a7b00b8f73dcaaa9a36d3f8f027af10"
27
27
  }
@@ -2,19 +2,30 @@
2
2
  "$schema": "http://json-schema.org/draft-07/schema",
3
3
  "$id": "http://camunda.org/schema/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"
@@ -321,8 +324,7 @@
321
324
  "binding": {
322
325
  "$id": "#/properties/property/binding",
323
326
  "type": "object",
324
- "title": "property binding",
325
- "description": "A binding to a BPMN 2.0 property",
327
+ "description": "Specifying how the property is mapped to BPMN or Camunda extension elements and attributes.",
326
328
  "required": [
327
329
  "type"
328
330
  ],
@@ -512,13 +514,59 @@
512
514
  ],
513
515
  "errorMessage": "property.binding ${0/type} requires errorRef"
514
516
  }
517
+ },
518
+ {
519
+ "examples": [
520
+ {
521
+ "type": "property",
522
+ "name": "name"
523
+ },
524
+ {
525
+ "type": "camunda:property",
526
+ "name": "property"
527
+ },
528
+ {
529
+ "type": "camunda:inputParameter",
530
+ "name": "input"
531
+ },
532
+ {
533
+ "type": "camunda:outputParameter",
534
+ "source": "output"
535
+ },
536
+ {
537
+ "type": "camunda:in",
538
+ "target": "target"
539
+ },
540
+ {
541
+ "type": "camunda:in:businessKey"
542
+ },
543
+ {
544
+ "type": "camunda:out",
545
+ "source": "output"
546
+ },
547
+ {
548
+ "type": "camunda:executionListener",
549
+ "event": "start"
550
+ },
551
+ {
552
+ "type": "camunda:field",
553
+ "name": "field"
554
+ },
555
+ {
556
+ "type": "camunda:errorEventDefinition",
557
+ "errorRef": "error"
558
+ },
559
+ {
560
+ "type": "camunda:errorEventDefinition",
561
+ "errorRef": "error"
562
+ }
563
+ ]
515
564
  }
516
565
  ],
517
566
  "properties": {
518
567
  "type": {
519
568
  "$id": "#/properties/property/binding/type",
520
569
  "type": "string",
521
- "title": "property binding type",
522
570
  "enum": [
523
571
  "property",
524
572
  "camunda:property",
@@ -532,59 +580,51 @@
532
580
  "camunda:errorEventDefinition"
533
581
  ],
534
582
  "errorMessage": "invalid property.binding type ${0}; must be any of { property, camunda:property, camunda:inputParameter, camunda:outputParameter, camunda:in, camunda:out, camunda:in:businessKey, camunda:executionListener, camunda:field, camunda:errorEventDefinition }",
535
- "description": "The type of the property binding"
583
+ "description": "The type of a property binding."
536
584
  },
537
585
  "name": {
538
586
  "$id": "#/properties/property/binding/name",
539
587
  "type": "string",
540
- "title": "property binding name",
541
- "description": "The name of binding xml property"
588
+ "description": "The name of a property binding."
542
589
  },
543
590
  "event": {
544
591
  "$id": "#/properties/property/binding/event",
545
592
  "type": "string",
546
- "title": "property binding event",
547
- "description": "The event type of an execution listener binding"
593
+ "description": "The event type of a property binding (camunda:executionListener)."
548
594
  },
549
595
  "scriptFormat": {
550
596
  "$id": "#/properties/property/binding/scriptFormat",
551
597
  "type": "string",
552
- "title": "property binding script format",
553
- "description": "The format of a script property binding (camunda:outputParameter, camunda:inputParameter)"
598
+ "description": "The script format of a property binding (camunda:outputParameter, camunda:inputParameter)."
554
599
  },
555
600
  "source": {
556
601
  "$id": "#/properties/property/binding/source",
557
602
  "type": "string",
558
- "title": "property binding source",
559
- "description": "The source value of a property binding (camunda:outputParameter, camunda:out)"
603
+ "description": "The source value of a property binding (camunda:outputParameter, camunda:out)."
560
604
  },
561
605
  "target": {
562
606
  "$id": "#/properties/property/binding/target",
563
607
  "type": "string",
564
- "title": "property binding target",
565
- "description": "The target value to be mapped to (camunda:in)"
608
+ "description": "The target value of a property binding (camunda:in)."
566
609
  },
567
610
  "expression": {
568
611
  "$id": "#/properties/property/binding/expression",
569
612
  "type": "boolean",
570
- "title": "property binding expression",
571
- "description": "True indicates that the control field value is an expression (camunda:in, camunda:field)"
613
+ "description": "Indicates whether the control field value is an expression (camunda:in, camunda:field)."
572
614
  },
573
615
  "variables": {
574
616
  "$id": "#/properties/property/binding/variables",
575
617
  "type": "string",
576
- "title": "property binding variables",
577
618
  "enum": [
578
619
  "all",
579
620
  "local"
580
621
  ],
581
- "description": "Either all or local indicating the variable mapping (camunda:in)"
622
+ "description": "The variable mapping of a property binding (camunda:in)."
582
623
  },
583
624
  "sourceExpression": {
584
625
  "$id": "#/properties/property/binding/sourceExpression",
585
626
  "type": "string",
586
- "title": "property binding source expression",
587
- "description": "The string containing the expression for the source attribute (camunda:out)"
627
+ "description": "The string containing the expression for the source attribute (camunda:out)."
588
628
  }
589
629
  }
590
630
  }
@@ -607,71 +647,119 @@
607
647
  "name": {
608
648
  "$id": "#/name",
609
649
  "type": "string",
610
- "title": "element template name",
611
- "description": "The name of the element template"
650
+ "description": "The name of the element template."
612
651
  },
613
652
  "id": {
614
653
  "$id": "#/id",
615
654
  "type": "string",
616
- "title": "element template id",
617
- "description": "The identifier of the element template"
655
+ "description": "The identifier of the element template."
618
656
  },
619
657
  "description": {
620
658
  "$id": "#/description",
621
659
  "type": "string",
622
- "title": "element template description",
623
- "description": "The description of the element template"
660
+ "description": "The description of the element template."
624
661
  },
625
662
  "version": {
626
663
  "$id": "#/version",
627
664
  "type": "number",
628
- "title": "element template version",
629
- "description": "The version of the element template"
665
+ "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."
630
666
  },
631
667
  "isDefault": {
632
668
  "$id": "#/isDefault",
633
669
  "type": "boolean",
634
- "title": "element template is default",
635
- "description": "Indicates whether the element template is a default template"
670
+ "description": "Indicates whether the element template is a default template."
636
671
  },
637
672
  "appliesTo": {
638
673
  "$id": "#/appliesTo",
639
674
  "type": "array",
640
- "title": "element template applies to",
641
- "description": "The definition for which element types the element template can be applied",
675
+ "description": "List of BPMN types the template can be applied to.",
642
676
  "default": [],
643
677
  "items": {
644
678
  "$id": "#/appliesTo/items",
645
679
  "type": "string",
646
- "pattern": "^(.*?:)",
680
+ "pattern": "^[\\w\\d]+:[\\w\\d]+$",
647
681
  "errorMessage": {
648
682
  "pattern": "invalid item for \"appliesTo\", should contain namespaced property, example: \"bpmn:Task\""
683
+ },
684
+ "allOf": [
685
+ {
686
+ "examples": [
687
+ "bpmn:Task",
688
+ "bpmn:ServiceTask",
689
+ "bpmn:SequenceFlow",
690
+ "bpmn:Process",
691
+ "bpmn:StartEvent",
692
+ "bpmn:Gateway"
693
+ ]
694
+ }
695
+ ]
696
+ }
697
+ },
698
+ "elementType": {
699
+ "$id": "#/elementType",
700
+ "type": "object",
701
+ "description": "The BPMN type the element will be transformed into.",
702
+ "default": {},
703
+ "required": [
704
+ "value"
705
+ ],
706
+ "errorMessage": {
707
+ "required": {
708
+ "value": "missing elementType value"
709
+ }
710
+ },
711
+ "properties": {
712
+ "value": {
713
+ "$id": "#/elementType/value",
714
+ "type": "string",
715
+ "pattern": "^[\\w\\d]+:[\\w\\d]+$",
716
+ "errorMessage": {
717
+ "pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
718
+ },
719
+ "allOf": [
720
+ {
721
+ "examples": [
722
+ "bpmn:ServiceTask",
723
+ "bpmn:UserTask",
724
+ "bpmn:StartEvent",
725
+ "bpmn:ExclusiveGateway",
726
+ "bpmn:ParallelGateway"
727
+ ]
728
+ }
729
+ ]
649
730
  }
650
731
  }
651
732
  },
652
733
  "metadata": {
653
734
  "$id": "#/metadata",
654
735
  "type": "object",
655
- "title": "element template metadata",
656
- "description": "Some metadata for further configuration"
736
+ "description": "Some custom properties for further configuration.",
737
+ "default": {}
657
738
  },
658
739
  "entriesVisible": {
659
740
  "$id": "#/entriesVisible",
660
741
  "type": "boolean",
661
- "title": "element template entries visible",
662
- "description": "Select whether non-template entries are visible in the properties panel"
742
+ "description": "Select whether non-template entries are visible in the properties panel."
663
743
  },
664
744
  "groups": {
665
745
  "$id": "#/groups",
666
746
  "type": "array",
667
- "title": "element template properties groups",
668
- "description": "The custom defined groups of the element template",
669
- "default": [],
747
+ "description": "Custom fields can be ordered together via groups.",
748
+ "allOf": [
749
+ {
750
+ "examples": [
751
+ [
752
+ {
753
+ "id": "group-1",
754
+ "label": "My Group"
755
+ }
756
+ ]
757
+ ]
758
+ }
759
+ ],
670
760
  "items": {
671
761
  "$id": "#/groups/group",
672
762
  "type": "object",
673
- "title": "element template group",
674
- "description": "A custom defined group for the element template",
675
763
  "default": {},
676
764
  "required": [
677
765
  "id",
@@ -687,17 +775,23 @@
687
775
  "id": {
688
776
  "$id": "#/groups/group/id",
689
777
  "type": "string",
690
- "title": "group id",
691
778
  "description": "The id of the custom group"
692
779
  },
693
780
  "label": {
694
781
  "$id": "#/groups/group/label",
695
782
  "type": "string",
696
- "title": "group label",
697
783
  "description": "The label of the custom group"
698
784
  }
699
785
  }
700
786
  }
787
+ },
788
+ "documentationRef": {
789
+ "$id": "#/documentaionRef",
790
+ "type": "string",
791
+ "pattern": "^(https|http)://.*",
792
+ "errorMessage": {
793
+ "pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
794
+ }
701
795
  }
702
796
  },
703
797
  "errorMessage": {
@@ -718,17 +812,51 @@
718
812
  "scopes": {
719
813
  "$id": "#/scopes",
720
814
  "type": "array",
721
- "title": "element template scope",
722
- "description": "Special scoped bindings that allow you to configure nested elements",
815
+ "description": "Special scoped bindings that allow you to configure nested elements.",
816
+ "allOf": [
817
+ {
818
+ "examples": [
819
+ [
820
+ {
821
+ "type": "bpmn:Error",
822
+ "id": "Error_1",
823
+ "properties": [
824
+ {
825
+ "value": "error-code",
826
+ "binding": {
827
+ "type": "property",
828
+ "name": "errorCode"
829
+ }
830
+ },
831
+ {
832
+ "value": "error-message",
833
+ "binding": {
834
+ "type": "property",
835
+ "name": "camunda:errorMessage"
836
+ }
837
+ },
838
+ {
839
+ "value": "error-name",
840
+ "binding": {
841
+ "type": "property",
842
+ "name": "name"
843
+ }
844
+ }
845
+ ]
846
+ }
847
+ ]
848
+ ]
849
+ }
850
+ ],
723
851
  "items": {
724
852
  "$id": "#/scopes/item",
725
853
  "type": "object",
726
- "title": "element template scope item",
727
- "description": "Scoped binding to configure nested elements",
854
+ "default": {},
728
855
  "properties": {
729
856
  "type": {
730
857
  "$id": "#scopes/item/type",
731
858
  "type": "string",
859
+ "description": "The type of a scope.",
732
860
  "enum": [
733
861
  "camunda:Connector",
734
862
  "bpmn:Error"
@@ -737,6 +865,8 @@
737
865
  },
738
866
  "properties": {
739
867
  "$id": "#/scopes/properties",
868
+ "description": "List of properties of a scope.",
869
+ "default": [],
740
870
  "allOf": [
741
871
  {
742
872
  "$ref": "#/definitions/properties/allOf/0"
@@ -786,10 +916,12 @@
786
916
  },
787
917
  "oneOf": [
788
918
  {
919
+ "description": "An element template configuration.",
789
920
  "$ref": "#/definitions/template"
790
921
  },
791
922
  {
792
923
  "type": "array",
924
+ "description": "A list of element template configurations.",
793
925
  "items": {
794
926
  "$ref": "#/definitions/template"
795
927
  }