@camunda/element-templates-json-schema-shared 0.3.0 → 0.4.0-alpha.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/element-templates-json-schema-shared",
3
- "version": "0.3.0",
3
+ "version": "0.4.0-alpha.1",
4
4
  "description": "Shared schema definitions used within element-templates-json-schema",
5
5
  "files": [
6
6
  "src"
@@ -16,5 +16,5 @@
16
16
  "camunda"
17
17
  ],
18
18
  "license": "MIT",
19
- "gitHead": "00ac9b421ae95098729fbf72f99988690f0800ea"
19
+ "gitHead": "978d4f0535684456d2a5878658aa12744d237df7"
20
20
  }
@@ -0,0 +1,151 @@
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
+ ]
@@ -3,7 +3,7 @@
3
3
  "description": "List of properties of the element template.",
4
4
  "allOf": [
5
5
  { "$ref": "examples.json#/properties" }
6
- ],
6
+ ],
7
7
  "items": {
8
8
  "type": "object",
9
9
  "default": {},
@@ -22,12 +22,15 @@
22
22
  "then": {
23
23
  "required": [
24
24
  "choices"
25
- ],
26
- "errorMessage": "must provide choices=[] with \"Dropdown\" type"
25
+ ]
27
26
  }
28
27
  }
29
28
  ],
30
29
  "properties": {
30
+ "id": {
31
+ "type": "string",
32
+ "description": "Unique identifier of the property."
33
+ },
31
34
  "value": {
32
35
  "$id": "#/properties/property/value",
33
36
  "type": [
@@ -80,8 +83,7 @@
80
83
  "required": [
81
84
  "value",
82
85
  "name"
83
- ],
84
- "errorMessage": "{ name, value } must be specified for \"Dropdown\" choices"
86
+ ]
85
87
  }
86
88
  },
87
89
  "constraints": {
@@ -138,6 +140,9 @@
138
140
  "$id": "#/properties/property/group",
139
141
  "type": "string",
140
142
  "description": "The custom group of a control field."
143
+ },
144
+ "condition": {
145
+ "$ref": "condition.json"
141
146
  }
142
147
  }
143
148
  }
@@ -40,9 +40,6 @@
40
40
  "$id": "#/appliesTo/items",
41
41
  "type": "string",
42
42
  "pattern": "^[\\w\\d]+:[\\w\\d]+$",
43
- "errorMessage": {
44
- "pattern": "invalid item for \"appliesTo\", should contain namespaced property, example: \"bpmn:Task\""
45
- },
46
43
  "allOf": [
47
44
  {
48
45
  "$ref": "examples.json#/appliesTo"
@@ -55,14 +52,14 @@
55
52
  "type": "object",
56
53
  "description": "The BPMN type the element will be transformed into.",
57
54
  "default": {},
55
+ "required": [
56
+ "value"
57
+ ],
58
58
  "properties": {
59
59
  "value": {
60
60
  "$id": "#/elementType/value",
61
61
  "type": "string",
62
62
  "pattern": "^[\\w\\d]+:[\\w\\d]+$",
63
- "errorMessage": {
64
- "pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
65
- },
66
63
  "allOf": [
67
64
  {
68
65
  "$ref": "examples.json#/elementType"
@@ -86,20 +83,9 @@
86
83
  "$ref": "groups.json"
87
84
  },
88
85
  "documentationRef": {
89
- "$id": "#/documentaionRef",
86
+ "$id": "#/documentationRef",
90
87
  "type": "string",
91
- "pattern": "^(https|http)://.*",
92
- "errorMessage": {
93
- "pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
94
- }
95
- }
96
- },
97
- "errorMessage": {
98
- "required": {
99
- "name": "missing template name",
100
- "id": "missing template id",
101
- "appliesTo": "missing appliesTo=[]",
102
- "properties": "missing properties=[]"
88
+ "pattern": "^(https|http)://.*"
103
89
  }
104
90
  }
105
91
  }
@@ -0,0 +1,58 @@
1
+ {
2
+ "$id": "#/condition",
3
+ "type": "object",
4
+ "description": "Condition to activate the binding.",
5
+ "allOf": [
6
+ {
7
+ "$ref": "examples.json#/condition"
8
+ }
9
+ ],
10
+ "required": [
11
+ "property"
12
+ ],
13
+ "properties": {
14
+ "type": {
15
+ "$id": "#/condition/type",
16
+ "const": "simple",
17
+ "description": "The type of the condition.",
18
+ "default": "simple"
19
+ },
20
+ "property": {
21
+ "$id": "#/condition/property",
22
+ "type": "string",
23
+ "description": "The id of the property to check."
24
+ }
25
+ },
26
+ "oneOf": [
27
+ {
28
+ "properties": {
29
+ "equals": {
30
+ "type": [
31
+ "string",
32
+ "number",
33
+ "boolean"
34
+ ]
35
+ }
36
+ },
37
+ "required": [
38
+ "equals"
39
+ ]
40
+ },
41
+ {
42
+ "properties": {
43
+ "oneOf": {
44
+ "type": "array",
45
+ "items": {
46
+ "type": [
47
+ "string",
48
+ "number"
49
+ ]
50
+ }
51
+ }
52
+ },
53
+ "required": [
54
+ "oneOf"
55
+ ]
56
+ }
57
+ ]
58
+ }
@@ -44,5 +44,19 @@
44
44
  "bpmn:ExclusiveGateway",
45
45
  "bpmn:ParallelGateway"
46
46
  ]
47
+ },
48
+ "condition": {
49
+ "examples": [
50
+ {
51
+ "type": "simple",
52
+ "property": "httpMethod",
53
+ "equals": "GET"
54
+ },
55
+ {
56
+ "type": "simple",
57
+ "property": "httpMethod",
58
+ "oneOf": [ "POST", "PUT", "DELETE" ]
59
+ }
60
+ ]
47
61
  }
48
62
  }
@@ -15,12 +15,6 @@
15
15
  "id",
16
16
  "label"
17
17
  ],
18
- "errorMessage": {
19
- "required": {
20
- "id": "missing id for group \"${0#}\"",
21
- "label": "missing label for group \"${0#}\""
22
- }
23
- },
24
18
  "properties": {
25
19
  "id": {
26
20
  "$id": "#/groups/group/id",