bpmnlint-plugin-camunda-compat 2.21.1 → 2.23.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/LICENSE +20 -20
- package/README.md +39 -39
- package/index.js +237 -224
- package/package.json +53 -53
- package/rules/camunda-cloud/called-element.js +42 -42
- package/rules/camunda-cloud/collapsed-subprocess.js +40 -40
- package/rules/camunda-cloud/connector-properties/config.js +90 -90
- package/rules/camunda-cloud/connector-properties/index.js +47 -47
- package/rules/camunda-cloud/duplicate-execution-listeners.js +33 -0
- package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
- package/rules/camunda-cloud/element-type/config.js +66 -66
- package/rules/camunda-cloud/element-type/index.js +133 -133
- package/rules/camunda-cloud/error-reference.js +71 -71
- package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +48 -48
- package/rules/camunda-cloud/escalation-reference.js +66 -66
- package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
- package/rules/camunda-cloud/executable-process.js +61 -61
- package/rules/camunda-cloud/execution-listener.js +34 -0
- package/rules/camunda-cloud/feel.js +82 -82
- package/rules/camunda-cloud/implementation/config.js +16 -16
- package/rules/camunda-cloud/implementation/index.js +218 -218
- package/rules/camunda-cloud/inclusive-gateway.js +35 -35
- package/rules/camunda-cloud/link-event.js +142 -142
- package/rules/camunda-cloud/loop-characteristics.js +66 -66
- package/rules/camunda-cloud/message-reference.js +60 -60
- package/rules/camunda-cloud/no-binding-type.js +44 -0
- package/rules/camunda-cloud/no-candidate-users.js +38 -38
- package/rules/camunda-cloud/no-execution-listeners.js +21 -0
- package/rules/camunda-cloud/no-expression.js +173 -173
- package/rules/camunda-cloud/no-loop.js +316 -316
- package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
- package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
- package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
- package/rules/camunda-cloud/no-task-schedule.js +18 -18
- package/rules/camunda-cloud/no-template.js +23 -23
- package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
- package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
- package/rules/camunda-cloud/secrets.js +119 -119
- package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
- package/rules/camunda-cloud/signal-reference.js +64 -64
- package/rules/camunda-cloud/start-event-form.js +97 -97
- package/rules/camunda-cloud/subscription.js +65 -65
- package/rules/camunda-cloud/task-schedule.js +67 -67
- package/rules/camunda-cloud/timer/config.js +46 -46
- package/rules/camunda-cloud/timer/index.js +183 -183
- package/rules/camunda-cloud/user-task-definition.js +24 -24
- package/rules/camunda-cloud/user-task-form.js +142 -142
- package/rules/camunda-cloud/wait-for-completion.js +46 -46
- package/rules/camunda-platform/history-time-to-live.js +19 -19
- package/rules/utils/cron.js +95 -95
- package/rules/utils/element.js +533 -484
- package/rules/utils/error-types.js +25 -24
- package/rules/utils/iso8601.js +52 -52
- package/rules/utils/reporter.js +37 -37
- package/rules/utils/rule.js +46 -46
- package/rules/utils/version.js +4 -4
@@ -1,25 +1,26 @@
|
|
1
|
-
module.exports.ERROR_TYPES = Object.freeze({
|
2
|
-
CHILD_ELEMENT_TYPE_NOT_ALLOWED: 'camunda.childElementTypeNotAllowed',
|
3
|
-
CONNECTORS_PROPERTY_VALUE_NOT_ALLOWED: 'camunda.connectors.propertyValueNotAllowed',
|
4
|
-
ELEMENT_COLLAPSED_NOT_ALLOWED: 'camunda.elementCollapsedNotAllowed',
|
5
|
-
ELEMENT_MULTIPLE_NOT_ALLOWED: 'camunda.elementMultipleNotAllowed',
|
6
|
-
ELEMENT_TYPE_NOT_ALLOWED: 'camunda.elementTypeNotAllowed',
|
7
|
-
ELEMENT_PROPERTY_VALUE_DUPLICATED: 'camunda.elementPropertyValueDuplicated',
|
8
|
-
EVENT_BASED_GATEWAY_TARGET_NOT_ALLOWED: 'camunda.eventBasedGatewayTargetNotAllowed',
|
9
|
-
EXPRESSION_NOT_ALLOWED: 'camunda.expressionNotAllowed',
|
10
|
-
EXPRESSION_REQUIRED: 'camunda.expressionRequired',
|
11
|
-
EXPRESSION_VALUE_NOT_ALLOWED: 'camunda.expressionValueNotAllowed',
|
12
|
-
EXTENSION_ELEMENT_NOT_ALLOWED: 'camunda.extensionElementNotAllowed',
|
13
|
-
EXTENSION_ELEMENT_REQUIRED: 'camunda.extensionElementRequired',
|
14
|
-
FEEL_EXPRESSION_INVALID: 'camunda.feelExpressionInvalid',
|
15
|
-
LOOP_NOT_ALLOWED: 'camunda.loopNotAllowed',
|
16
|
-
ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED: 'camunda.attachedToRefElementTypeNotAllowed',
|
17
|
-
PROPERTY_DEPENDENT_REQUIRED: 'camunda.propertyDependentRequired',
|
18
|
-
PROPERTY_NOT_ALLOWED: 'camunda.propertyNotAllowed',
|
19
|
-
PROPERTY_REQUIRED: 'camunda.propertyRequired',
|
20
|
-
PROPERTY_TYPE_NOT_ALLOWED: 'camunda.propertyTypeNotAllowed',
|
21
|
-
PROPERTY_VALUE_DUPLICATED: 'camunda.propertyValueDuplicated',
|
22
|
-
|
23
|
-
|
24
|
-
|
1
|
+
module.exports.ERROR_TYPES = Object.freeze({
|
2
|
+
CHILD_ELEMENT_TYPE_NOT_ALLOWED: 'camunda.childElementTypeNotAllowed',
|
3
|
+
CONNECTORS_PROPERTY_VALUE_NOT_ALLOWED: 'camunda.connectors.propertyValueNotAllowed',
|
4
|
+
ELEMENT_COLLAPSED_NOT_ALLOWED: 'camunda.elementCollapsedNotAllowed',
|
5
|
+
ELEMENT_MULTIPLE_NOT_ALLOWED: 'camunda.elementMultipleNotAllowed',
|
6
|
+
ELEMENT_TYPE_NOT_ALLOWED: 'camunda.elementTypeNotAllowed',
|
7
|
+
ELEMENT_PROPERTY_VALUE_DUPLICATED: 'camunda.elementPropertyValueDuplicated',
|
8
|
+
EVENT_BASED_GATEWAY_TARGET_NOT_ALLOWED: 'camunda.eventBasedGatewayTargetNotAllowed',
|
9
|
+
EXPRESSION_NOT_ALLOWED: 'camunda.expressionNotAllowed',
|
10
|
+
EXPRESSION_REQUIRED: 'camunda.expressionRequired',
|
11
|
+
EXPRESSION_VALUE_NOT_ALLOWED: 'camunda.expressionValueNotAllowed',
|
12
|
+
EXTENSION_ELEMENT_NOT_ALLOWED: 'camunda.extensionElementNotAllowed',
|
13
|
+
EXTENSION_ELEMENT_REQUIRED: 'camunda.extensionElementRequired',
|
14
|
+
FEEL_EXPRESSION_INVALID: 'camunda.feelExpressionInvalid',
|
15
|
+
LOOP_NOT_ALLOWED: 'camunda.loopNotAllowed',
|
16
|
+
ATTACHED_TO_REF_ELEMENT_TYPE_NOT_ALLOWED: 'camunda.attachedToRefElementTypeNotAllowed',
|
17
|
+
PROPERTY_DEPENDENT_REQUIRED: 'camunda.propertyDependentRequired',
|
18
|
+
PROPERTY_NOT_ALLOWED: 'camunda.propertyNotAllowed',
|
19
|
+
PROPERTY_REQUIRED: 'camunda.propertyRequired',
|
20
|
+
PROPERTY_TYPE_NOT_ALLOWED: 'camunda.propertyTypeNotAllowed',
|
21
|
+
PROPERTY_VALUE_DUPLICATED: 'camunda.propertyValueDuplicated',
|
22
|
+
PROPERTY_VALUES_DUPLICATED: 'camunda.propertiesValuesDuplicated',
|
23
|
+
PROPERTY_VALUE_NOT_ALLOWED: 'camunda.propertyValueNotAllowed',
|
24
|
+
PROPERTY_VALUE_REQUIRED: 'camunda.propertyValueRequired',
|
25
|
+
SECRET_EXPRESSION_FORMAT_DEPRECATED: 'camunda.secretExpressionFormatDeprecated'
|
25
26
|
});
|
package/rules/utils/iso8601.js
CHANGED
@@ -1,52 +1,52 @@
|
|
1
|
-
const YEAR = '\\d{4}';
|
2
|
-
const MONTH = '(?<month>0[1-9]|1[0-2])';
|
3
|
-
const DAY = '(0[1-9]|[12][0-9]|3[01])';
|
4
|
-
const DATE = `(?<date>${YEAR}-${MONTH}-${DAY})`;
|
5
|
-
const HOUR = '(0[0-9]|1[0-9]|2[0-3])';
|
6
|
-
const MINUTE = '[0-5][0-9]';
|
7
|
-
const SECOND = '[0-5][0-9]';
|
8
|
-
const ZONE_ID = '(\\[[^\\]]+\\])';
|
9
|
-
const TIMEZONE = `(Z|([+-](0[0-9]|1[0-3]):[0-5][0-9]${ZONE_ID}?))`;
|
10
|
-
|
11
|
-
const ISO_DATE = `${DATE}T${HOUR}:${MINUTE}:${SECOND}${TIMEZONE}`;
|
12
|
-
const ISO_DATE_REGEX = new RegExp(`^${ISO_DATE}$`);
|
13
|
-
const ISO_DURATION = 'P(?!$)(\\d+(\\.\\d+)?[Yy])?(\\d+(\\.\\d+)?[Mm])?(\\d+(\\.\\d+)?[Ww])?(\\d+(\\.\\d+)?[Dd])?(T(?!$)(\\d+(\\.\\d+)?[Hh])?(\\d+(\\.\\d+)?[Mm])?(\\d+(\\.\\d+)?[Ss])?)?$';
|
14
|
-
const ISO_DURATION_REGEX = new RegExp(`^${ISO_DURATION}$`);
|
15
|
-
const ISO_CYCLE = `R(-1|\\d+)?/(${ISO_DATE}/)?${ISO_DURATION}`;
|
16
|
-
const ISO_CYCLE_REGEX = new RegExp(`^${ISO_CYCLE}$`);
|
17
|
-
|
18
|
-
module.exports = {
|
19
|
-
validateCycle,
|
20
|
-
validateDate,
|
21
|
-
validateDuration
|
22
|
-
};
|
23
|
-
|
24
|
-
function validateCycle(value) {
|
25
|
-
return ISO_CYCLE_REGEX.test(value);
|
26
|
-
}
|
27
|
-
|
28
|
-
function validateDate(value) {
|
29
|
-
const result = ISO_DATE_REGEX.exec(value);
|
30
|
-
|
31
|
-
if (!result) {
|
32
|
-
return false;
|
33
|
-
}
|
34
|
-
|
35
|
-
return isDateValid(result);
|
36
|
-
}
|
37
|
-
|
38
|
-
function validateDuration(value) {
|
39
|
-
return ISO_DURATION_REGEX.test(value);
|
40
|
-
}
|
41
|
-
|
42
|
-
function isDateValid(result) {
|
43
|
-
const {
|
44
|
-
date,
|
45
|
-
month
|
46
|
-
} = result.groups;
|
47
|
-
|
48
|
-
const dateParsedMonth = new Date(date).getMonth() + 1;
|
49
|
-
const parsedMonth = Number.parseInt(month, 10);
|
50
|
-
|
51
|
-
return dateParsedMonth === parsedMonth;
|
52
|
-
}
|
1
|
+
const YEAR = '\\d{4}';
|
2
|
+
const MONTH = '(?<month>0[1-9]|1[0-2])';
|
3
|
+
const DAY = '(0[1-9]|[12][0-9]|3[01])';
|
4
|
+
const DATE = `(?<date>${YEAR}-${MONTH}-${DAY})`;
|
5
|
+
const HOUR = '(0[0-9]|1[0-9]|2[0-3])';
|
6
|
+
const MINUTE = '[0-5][0-9]';
|
7
|
+
const SECOND = '[0-5][0-9]';
|
8
|
+
const ZONE_ID = '(\\[[^\\]]+\\])';
|
9
|
+
const TIMEZONE = `(Z|([+-](0[0-9]|1[0-3]):[0-5][0-9]${ZONE_ID}?))`;
|
10
|
+
|
11
|
+
const ISO_DATE = `${DATE}T${HOUR}:${MINUTE}:${SECOND}${TIMEZONE}`;
|
12
|
+
const ISO_DATE_REGEX = new RegExp(`^${ISO_DATE}$`);
|
13
|
+
const ISO_DURATION = 'P(?!$)(\\d+(\\.\\d+)?[Yy])?(\\d+(\\.\\d+)?[Mm])?(\\d+(\\.\\d+)?[Ww])?(\\d+(\\.\\d+)?[Dd])?(T(?!$)(\\d+(\\.\\d+)?[Hh])?(\\d+(\\.\\d+)?[Mm])?(\\d+(\\.\\d+)?[Ss])?)?$';
|
14
|
+
const ISO_DURATION_REGEX = new RegExp(`^${ISO_DURATION}$`);
|
15
|
+
const ISO_CYCLE = `R(-1|\\d+)?/(${ISO_DATE}/)?${ISO_DURATION}`;
|
16
|
+
const ISO_CYCLE_REGEX = new RegExp(`^${ISO_CYCLE}$`);
|
17
|
+
|
18
|
+
module.exports = {
|
19
|
+
validateCycle,
|
20
|
+
validateDate,
|
21
|
+
validateDuration
|
22
|
+
};
|
23
|
+
|
24
|
+
function validateCycle(value) {
|
25
|
+
return ISO_CYCLE_REGEX.test(value);
|
26
|
+
}
|
27
|
+
|
28
|
+
function validateDate(value) {
|
29
|
+
const result = ISO_DATE_REGEX.exec(value);
|
30
|
+
|
31
|
+
if (!result) {
|
32
|
+
return false;
|
33
|
+
}
|
34
|
+
|
35
|
+
return isDateValid(result);
|
36
|
+
}
|
37
|
+
|
38
|
+
function validateDuration(value) {
|
39
|
+
return ISO_DURATION_REGEX.test(value);
|
40
|
+
}
|
41
|
+
|
42
|
+
function isDateValid(result) {
|
43
|
+
const {
|
44
|
+
date,
|
45
|
+
month
|
46
|
+
} = result.groups;
|
47
|
+
|
48
|
+
const dateParsedMonth = new Date(date).getMonth() + 1;
|
49
|
+
const parsedMonth = Number.parseInt(month, 10);
|
50
|
+
|
51
|
+
return dateParsedMonth === parsedMonth;
|
52
|
+
}
|
package/rules/utils/reporter.js
CHANGED
@@ -1,38 +1,38 @@
|
|
1
|
-
const { is } = require('bpmnlint-utils');
|
2
|
-
|
3
|
-
const { isArray } = require('min-dash');
|
4
|
-
|
5
|
-
module.exports.reportErrors = function(node, reporter, errors) {
|
6
|
-
if (!isArray(errors)) {
|
7
|
-
errors = [ errors ];
|
8
|
-
}
|
9
|
-
|
10
|
-
errors.forEach(({ message, ...options }) => {
|
11
|
-
const name = getName(node);
|
12
|
-
|
13
|
-
if (name) {
|
14
|
-
options = {
|
15
|
-
...options,
|
16
|
-
name
|
17
|
-
};
|
18
|
-
}
|
19
|
-
|
20
|
-
reporter.report(node.get('id'), message, options);
|
21
|
-
});
|
22
|
-
};
|
23
|
-
|
24
|
-
function getName(node) {
|
25
|
-
if (is(node, 'bpmn:TextAnnotation')) {
|
26
|
-
return node.get('text');
|
27
|
-
}
|
28
|
-
|
29
|
-
if (is(node, 'bpmn:Group')) {
|
30
|
-
const categoryValueRef = node.get('categoryValueRef');
|
31
|
-
|
32
|
-
return categoryValueRef && categoryValueRef.get('value');
|
33
|
-
}
|
34
|
-
|
35
|
-
return node.get('name');
|
36
|
-
}
|
37
|
-
|
1
|
+
const { is } = require('bpmnlint-utils');
|
2
|
+
|
3
|
+
const { isArray } = require('min-dash');
|
4
|
+
|
5
|
+
module.exports.reportErrors = function(node, reporter, errors) {
|
6
|
+
if (!isArray(errors)) {
|
7
|
+
errors = [ errors ];
|
8
|
+
}
|
9
|
+
|
10
|
+
errors.forEach(({ message, ...options }) => {
|
11
|
+
const name = getName(node);
|
12
|
+
|
13
|
+
if (name) {
|
14
|
+
options = {
|
15
|
+
...options,
|
16
|
+
name
|
17
|
+
};
|
18
|
+
}
|
19
|
+
|
20
|
+
reporter.report(node.get('id'), message, options);
|
21
|
+
});
|
22
|
+
};
|
23
|
+
|
24
|
+
function getName(node) {
|
25
|
+
if (is(node, 'bpmn:TextAnnotation')) {
|
26
|
+
return node.get('text');
|
27
|
+
}
|
28
|
+
|
29
|
+
if (is(node, 'bpmn:Group')) {
|
30
|
+
const categoryValueRef = node.get('categoryValueRef');
|
31
|
+
|
32
|
+
return categoryValueRef && categoryValueRef.get('value');
|
33
|
+
}
|
34
|
+
|
35
|
+
return node.get('name');
|
36
|
+
}
|
37
|
+
|
38
38
|
module.exports.getName = getName;
|
package/rules/utils/rule.js
CHANGED
@@ -1,47 +1,47 @@
|
|
1
|
-
const { is } = require('bpmnlint-utils');
|
2
|
-
|
3
|
-
const { greaterOrEqual } = require('./version');
|
4
|
-
|
5
|
-
function skipInNonExecutableProcess(ruleFactory) {
|
6
|
-
return function(config = {}) {
|
7
|
-
const rule = ruleFactory(config);
|
8
|
-
|
9
|
-
const { version, platform = 'camunda-cloud' } = config;
|
10
|
-
|
11
|
-
function check(node, reporter) {
|
12
|
-
if (platform === 'camunda-cloud' && version && greaterOrEqual(version, '8.2') && isNonExecutableProcess(node)) {
|
13
|
-
return false;
|
14
|
-
}
|
15
|
-
|
16
|
-
if (platform === 'camunda-platform' && isNonExecutableProcess(node)) {
|
17
|
-
return false;
|
18
|
-
}
|
19
|
-
|
20
|
-
return rule.check(node, reporter);
|
21
|
-
}
|
22
|
-
|
23
|
-
return {
|
24
|
-
...rule,
|
25
|
-
check
|
26
|
-
};
|
27
|
-
};
|
28
|
-
}
|
29
|
-
|
30
|
-
module.exports = {
|
31
|
-
skipInNonExecutableProcess
|
32
|
-
};
|
33
|
-
|
34
|
-
function isNonExecutableProcess(node) {
|
35
|
-
let process;
|
36
|
-
|
37
|
-
if (is(node, 'bpmn:Process')) {
|
38
|
-
process = node;
|
39
|
-
}
|
40
|
-
|
41
|
-
if (is(node, 'bpmndi:BPMNPlane')
|
42
|
-
&& is(node.get('bpmnElement'), 'bpmn:Process')) {
|
43
|
-
process = node.get('bpmnElement');
|
44
|
-
}
|
45
|
-
|
46
|
-
return process && !process.get('isExecutable');
|
1
|
+
const { is } = require('bpmnlint-utils');
|
2
|
+
|
3
|
+
const { greaterOrEqual } = require('./version');
|
4
|
+
|
5
|
+
function skipInNonExecutableProcess(ruleFactory) {
|
6
|
+
return function(config = {}) {
|
7
|
+
const rule = ruleFactory(config);
|
8
|
+
|
9
|
+
const { version, platform = 'camunda-cloud' } = config;
|
10
|
+
|
11
|
+
function check(node, reporter) {
|
12
|
+
if (platform === 'camunda-cloud' && version && greaterOrEqual(version, '8.2') && isNonExecutableProcess(node)) {
|
13
|
+
return false;
|
14
|
+
}
|
15
|
+
|
16
|
+
if (platform === 'camunda-platform' && isNonExecutableProcess(node)) {
|
17
|
+
return false;
|
18
|
+
}
|
19
|
+
|
20
|
+
return rule.check(node, reporter);
|
21
|
+
}
|
22
|
+
|
23
|
+
return {
|
24
|
+
...rule,
|
25
|
+
check
|
26
|
+
};
|
27
|
+
};
|
28
|
+
}
|
29
|
+
|
30
|
+
module.exports = {
|
31
|
+
skipInNonExecutableProcess
|
32
|
+
};
|
33
|
+
|
34
|
+
function isNonExecutableProcess(node) {
|
35
|
+
let process;
|
36
|
+
|
37
|
+
if (is(node, 'bpmn:Process')) {
|
38
|
+
process = node;
|
39
|
+
}
|
40
|
+
|
41
|
+
if (is(node, 'bpmndi:BPMNPlane')
|
42
|
+
&& is(node.get('bpmnElement'), 'bpmn:Process')) {
|
43
|
+
process = node.get('bpmnElement');
|
44
|
+
}
|
45
|
+
|
46
|
+
return process && !process.get('isExecutable');
|
47
47
|
}
|
package/rules/utils/version.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
|
-
const cmp = require('semver-compare');
|
2
|
-
|
3
|
-
module.exports.greaterOrEqual = function(a, b) {
|
4
|
-
return cmp(a, b) !== -1;
|
1
|
+
const cmp = require('semver-compare');
|
2
|
+
|
3
|
+
module.exports.greaterOrEqual = function(a, b) {
|
4
|
+
return cmp(a, b) !== -1;
|
5
5
|
};
|