@camunda/element-templates-json-schema-shared 0.3.1 → 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/CHANGELOG.md +32 -0
- package/package.json +2 -3
- package/src/base-error-messages.json +151 -0
- package/src/defs/base-properties.json +10 -5
- package/src/defs/base.json +2 -24
- package/src/defs/condition.json +58 -0
- package/src/defs/examples.json +14 -0
- package/src/defs/groups.json +0 -6
package/CHANGELOG.md
ADDED
|
@@ -0,0 +1,32 @@
|
|
|
1
|
+
# Changelog
|
|
2
|
+
|
|
3
|
+
All notable changes to [@camunda/element-templates-json-schema-shared](https://github.com/camunda/element-templates-json-schema/packages/element-templates-json-schema-shared) 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
|
+
## 0.4.0-alpha.1
|
|
10
|
+
|
|
11
|
+
* `FEAT`: separate custom error messages from schema ([#57](https://github.com/camunda/element-templates-json-schema/pull/57))
|
|
12
|
+
|
|
13
|
+
## 0.4.0-alpha.0
|
|
14
|
+
|
|
15
|
+
* `FEAT`: allow to set condition for property ([#54](https://github.com/camunda/element-templates-json-schema/issues/54))
|
|
16
|
+
|
|
17
|
+
## 0.3.1
|
|
18
|
+
|
|
19
|
+
* `FIX`: require `value` for element type property ([#53](https://github.com/camunda/element-templates-json-schema/pull/53))
|
|
20
|
+
|
|
21
|
+
## 0.3.0
|
|
22
|
+
|
|
23
|
+
* `FEAT`: add `elementType` property ([#48](https://github.com/camunda/element-templates-json-schema/pull/48))
|
|
24
|
+
* `FEAT`: add `documentationRef` property ([#47](https://github.com/camunda/element-templates-json-schema/pull/47))
|
|
25
|
+
|
|
26
|
+
## 0.2.0
|
|
27
|
+
|
|
28
|
+
* `FEAT`: provide better editor annotations ([#45](https://github.com/camunda/element-templates-json-schema/pull/45))
|
|
29
|
+
|
|
30
|
+
## 0.1.0
|
|
31
|
+
|
|
32
|
+
* `FEAT`: initial version :tada:
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/element-templates-json-schema-shared",
|
|
3
|
-
"version": "0.
|
|
3
|
+
"version": "0.4.0",
|
|
4
4
|
"description": "Shared schema definitions used within element-templates-json-schema",
|
|
5
5
|
"files": [
|
|
6
6
|
"src"
|
|
@@ -15,6 +15,5 @@
|
|
|
15
15
|
"element-templates",
|
|
16
16
|
"camunda"
|
|
17
17
|
],
|
|
18
|
-
"license": "MIT"
|
|
19
|
-
"gitHead": "5579ae200a7b00b8f73dcaaa9a36d3f8f027af10"
|
|
18
|
+
"license": "MIT"
|
|
20
19
|
}
|
|
@@ -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
|
}
|
package/src/defs/base.json
CHANGED
|
@@ -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"
|
|
@@ -58,19 +55,11 @@
|
|
|
58
55
|
"required": [
|
|
59
56
|
"value"
|
|
60
57
|
],
|
|
61
|
-
"errorMessage": {
|
|
62
|
-
"required": {
|
|
63
|
-
"value": "missing elementType value"
|
|
64
|
-
}
|
|
65
|
-
},
|
|
66
58
|
"properties": {
|
|
67
59
|
"value": {
|
|
68
60
|
"$id": "#/elementType/value",
|
|
69
61
|
"type": "string",
|
|
70
62
|
"pattern": "^[\\w\\d]+:[\\w\\d]+$",
|
|
71
|
-
"errorMessage": {
|
|
72
|
-
"pattern": "invalid item for \"elementType\", should contain namespaced property, example: \"bpmn:Task\""
|
|
73
|
-
},
|
|
74
63
|
"allOf": [
|
|
75
64
|
{
|
|
76
65
|
"$ref": "examples.json#/elementType"
|
|
@@ -94,20 +83,9 @@
|
|
|
94
83
|
"$ref": "groups.json"
|
|
95
84
|
},
|
|
96
85
|
"documentationRef": {
|
|
97
|
-
"$id": "#/
|
|
86
|
+
"$id": "#/documentationRef",
|
|
98
87
|
"type": "string",
|
|
99
|
-
"pattern": "^(https|http)://.*"
|
|
100
|
-
"errorMessage": {
|
|
101
|
-
"pattern": "Malformed documentation URL, must match \"^(https|http)://.*\""
|
|
102
|
-
}
|
|
103
|
-
}
|
|
104
|
-
},
|
|
105
|
-
"errorMessage": {
|
|
106
|
-
"required": {
|
|
107
|
-
"name": "missing template name",
|
|
108
|
-
"id": "missing template id",
|
|
109
|
-
"appliesTo": "missing appliesTo=[]",
|
|
110
|
-
"properties": "missing properties=[]"
|
|
88
|
+
"pattern": "^(https|http)://.*"
|
|
111
89
|
}
|
|
112
90
|
}
|
|
113
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
|
+
}
|
package/src/defs/examples.json
CHANGED
|
@@ -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
|
}
|
package/src/defs/groups.json
CHANGED