-
Notifications
You must be signed in to change notification settings - Fork 7
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
feat(zeebe): support
engines
property
`engines` is a new property that allows templates to declare compatibility with other run-time provided engines. Closes #146
- Loading branch information
1 parent
4216f8d
commit 9d157e3
Showing
7 changed files
with
142 additions
and
0 deletions.
There are no files selected for viewing
19 changes: 19 additions & 0 deletions
19
packages/zeebe-element-templates-json-schema/src/defs/engines.json
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,19 @@ | ||
{ | ||
"$id": "#/engines", | ||
"type": "object", | ||
"description": "Defines the compatibility of this element template with different engines. Keys are engine names, values are semantic version ranges.", | ||
"default": {}, | ||
"examples": [ | ||
{ | ||
"camunda": "^8.5" | ||
} | ||
], | ||
"properties": { | ||
"camunda": { | ||
"$id": "#/engines/camunda", | ||
"type": "string", | ||
"description": "A semantic version range that denotes compatible Camunda versions.", | ||
"default": "" | ||
} | ||
} | ||
} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
41 changes: 41 additions & 0 deletions
41
packages/zeebe-element-templates-json-schema/test/fixtures/engines-invalid-version.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
export const template = { | ||
'name': 'Engines Invalid Versions', | ||
'id': 'foo', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'engines': { | ||
'camunda': [ '8.5' ], | ||
}, | ||
'properties': [], | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
dataPath: '/engines/camunda', | ||
keyword: 'type', | ||
message: 'should be string', | ||
params: { | ||
type: 'string' | ||
}, | ||
schemaPath: '#/properties/engines/properties/camunda/type' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { | ||
type: 'array' | ||
}, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { | ||
passingSchemas: null | ||
}, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
39 changes: 39 additions & 0 deletions
39
packages/zeebe-element-templates-json-schema/test/fixtures/engines-invalid.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
export const template = { | ||
'name': 'Engines Invalid', | ||
'id': 'foo', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'engines': '8.5', | ||
'properties': [], | ||
}; | ||
|
||
export const errors = [ | ||
{ | ||
dataPath: '/engines', | ||
keyword: 'type', | ||
message: 'should be object', | ||
params: { | ||
type: 'object' | ||
}, | ||
schemaPath: '#/properties/engines/type' | ||
}, | ||
{ | ||
keyword: 'type', | ||
dataPath: '', | ||
schemaPath: '#/oneOf/1/type', | ||
params: { | ||
type: 'array' | ||
}, | ||
message: 'should be array' | ||
}, | ||
{ | ||
keyword: 'oneOf', | ||
dataPath: '', | ||
schemaPath: '#/oneOf', | ||
params: { | ||
passingSchemas: null | ||
}, | ||
message: 'should match exactly one schema in oneOf' | ||
} | ||
]; |
13 changes: 13 additions & 0 deletions
13
packages/zeebe-element-templates-json-schema/test/fixtures/engines-no-camunda.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
export const template = { | ||
'name': 'Engines Valid', | ||
'id': 'foo', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'engines': { | ||
'other': '^1.3-beta.0' | ||
}, | ||
'properties': [] | ||
}; | ||
|
||
export const errors = null; |
14 changes: 14 additions & 0 deletions
14
packages/zeebe-element-templates-json-schema/test/fixtures/engines.js
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
export const template = { | ||
'name': 'Engines Valid', | ||
'id': 'foo', | ||
'appliesTo': [ | ||
'bpmn:Task' | ||
], | ||
'engines': { | ||
'camunda': '8.5', | ||
'other': '^1.3-beta.0' | ||
}, | ||
'properties': [], | ||
}; | ||
|
||
export const errors = null; |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters