bpmnlint-plugin-camunda-compat 2.23.0 → 2.24.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.
Files changed (58) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +39 -39
  3. package/index.js +242 -237
  4. package/package.json +53 -53
  5. package/rules/camunda-cloud/called-element.js +42 -42
  6. package/rules/camunda-cloud/collapsed-subprocess.js +40 -40
  7. package/rules/camunda-cloud/connector-properties/config.js +90 -90
  8. package/rules/camunda-cloud/connector-properties/index.js +47 -47
  9. package/rules/camunda-cloud/duplicate-execution-listeners.js +33 -33
  10. package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
  11. package/rules/camunda-cloud/element-type/config.js +66 -66
  12. package/rules/camunda-cloud/element-type/index.js +133 -133
  13. package/rules/camunda-cloud/error-reference.js +71 -71
  14. package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +48 -48
  15. package/rules/camunda-cloud/escalation-reference.js +66 -66
  16. package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
  17. package/rules/camunda-cloud/executable-process.js +61 -61
  18. package/rules/camunda-cloud/execution-listener.js +34 -34
  19. package/rules/camunda-cloud/feel.js +82 -82
  20. package/rules/camunda-cloud/implementation/config.js +16 -16
  21. package/rules/camunda-cloud/implementation/index.js +218 -218
  22. package/rules/camunda-cloud/inclusive-gateway.js +35 -35
  23. package/rules/camunda-cloud/link-event.js +142 -142
  24. package/rules/camunda-cloud/loop-characteristics.js +66 -66
  25. package/rules/camunda-cloud/message-reference.js +60 -60
  26. package/rules/camunda-cloud/no-binding-type.js +43 -43
  27. package/rules/camunda-cloud/no-candidate-users.js +38 -38
  28. package/rules/camunda-cloud/no-execution-listeners.js +21 -21
  29. package/rules/camunda-cloud/no-expression.js +173 -173
  30. package/rules/camunda-cloud/no-loop.js +316 -316
  31. package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
  32. package/rules/camunda-cloud/no-priority-definition.js +19 -0
  33. package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
  34. package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
  35. package/rules/camunda-cloud/no-task-schedule.js +18 -18
  36. package/rules/camunda-cloud/no-template.js +23 -23
  37. package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
  38. package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
  39. package/rules/camunda-cloud/priority-definition.js +62 -0
  40. package/rules/camunda-cloud/secrets.js +119 -119
  41. package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
  42. package/rules/camunda-cloud/signal-reference.js +64 -64
  43. package/rules/camunda-cloud/start-event-form.js +97 -97
  44. package/rules/camunda-cloud/subscription.js +65 -65
  45. package/rules/camunda-cloud/task-schedule.js +67 -67
  46. package/rules/camunda-cloud/timer/config.js +46 -46
  47. package/rules/camunda-cloud/timer/index.js +183 -183
  48. package/rules/camunda-cloud/user-task-definition.js +24 -24
  49. package/rules/camunda-cloud/user-task-form.js +142 -142
  50. package/rules/camunda-cloud/wait-for-completion.js +46 -46
  51. package/rules/camunda-platform/history-time-to-live.js +19 -19
  52. package/rules/utils/cron.js +95 -95
  53. package/rules/utils/element.js +533 -533
  54. package/rules/utils/error-types.js +25 -25
  55. package/rules/utils/iso8601.js +52 -52
  56. package/rules/utils/reporter.js +37 -37
  57. package/rules/utils/rule.js +46 -46
  58. package/rules/utils/version.js +4 -4
@@ -1,66 +1,66 @@
1
- const {
2
- is,
3
- isAny
4
- } = require('bpmnlint-utils');
5
-
6
- const {
7
- findExtensionElement,
8
- getEventDefinition,
9
- hasExtensionElement,
10
- hasProperties
11
- } = require('../utils/element');
12
-
13
- const { reportErrors } = require('../utils/reporter');
14
-
15
- const { skipInNonExecutableProcess } = require('../utils/rule');
16
-
17
- module.exports = skipInNonExecutableProcess(function() {
18
- function check(node, reporter) {
19
- if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent', 'bpmn:ReceiveTask' ])
20
- || (is(node, 'bpmn:StartEvent') && !is(node.$parent, 'bpmn:SubProcess'))) {
21
- return;
22
- }
23
-
24
- let eventDefinitionOrReceiveTask = node;
25
-
26
- if (!is(node, 'bpmn:ReceiveTask')) {
27
- const eventDefinition = getEventDefinition(node);
28
-
29
- if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
30
- return;
31
- }
32
-
33
- eventDefinitionOrReceiveTask = eventDefinition;
34
- }
35
-
36
- const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
37
-
38
- if (!messageRef) {
39
- return;
40
- }
41
-
42
- let errors = hasExtensionElement(messageRef, 'zeebe:Subscription', node);
43
-
44
- if (errors && errors.length) {
45
- reportErrors(node, reporter, errors);
46
-
47
- return;
48
- }
49
-
50
- const subscription = findExtensionElement(messageRef, 'zeebe:Subscription');
51
-
52
- errors = hasProperties(subscription, {
53
- correlationKey: {
54
- required: true
55
- }
56
- }, node);
57
-
58
- if (errors && errors.length) {
59
- reportErrors(node, reporter, errors);
60
- }
61
- }
62
-
63
- return {
64
- check
65
- };
1
+ const {
2
+ is,
3
+ isAny
4
+ } = require('bpmnlint-utils');
5
+
6
+ const {
7
+ findExtensionElement,
8
+ getEventDefinition,
9
+ hasExtensionElement,
10
+ hasProperties
11
+ } = require('../utils/element');
12
+
13
+ const { reportErrors } = require('../utils/reporter');
14
+
15
+ const { skipInNonExecutableProcess } = require('../utils/rule');
16
+
17
+ module.exports = skipInNonExecutableProcess(function() {
18
+ function check(node, reporter) {
19
+ if (!isAny(node, [ 'bpmn:CatchEvent', 'bpmn:ThrowEvent', 'bpmn:ReceiveTask' ])
20
+ || (is(node, 'bpmn:StartEvent') && !is(node.$parent, 'bpmn:SubProcess'))) {
21
+ return;
22
+ }
23
+
24
+ let eventDefinitionOrReceiveTask = node;
25
+
26
+ if (!is(node, 'bpmn:ReceiveTask')) {
27
+ const eventDefinition = getEventDefinition(node);
28
+
29
+ if (!eventDefinition || !is(eventDefinition, 'bpmn:MessageEventDefinition')) {
30
+ return;
31
+ }
32
+
33
+ eventDefinitionOrReceiveTask = eventDefinition;
34
+ }
35
+
36
+ const messageRef = eventDefinitionOrReceiveTask.get('messageRef');
37
+
38
+ if (!messageRef) {
39
+ return;
40
+ }
41
+
42
+ let errors = hasExtensionElement(messageRef, 'zeebe:Subscription', node);
43
+
44
+ if (errors && errors.length) {
45
+ reportErrors(node, reporter, errors);
46
+
47
+ return;
48
+ }
49
+
50
+ const subscription = findExtensionElement(messageRef, 'zeebe:Subscription');
51
+
52
+ errors = hasProperties(subscription, {
53
+ correlationKey: {
54
+ required: true
55
+ }
56
+ }, node);
57
+
58
+ if (errors && errors.length) {
59
+ reportErrors(node, reporter, errors);
60
+ }
61
+ }
62
+
63
+ return {
64
+ check
65
+ };
66
66
  });
@@ -1,68 +1,68 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- const { isDefined } = require('min-dash');
4
-
5
- const {
6
- findExtensionElement,
7
- hasExpression
8
- } = require('../utils/element');
9
-
10
- const { validateDate: validateISO8601Date } = require('../utils/iso8601');
11
-
12
- const { reportErrors } = require('../utils/reporter');
13
-
14
- const { skipInNonExecutableProcess } = require('../utils/rule');
15
-
16
- module.exports = skipInNonExecutableProcess(function() {
17
- function check(node, reporter) {
18
- if (!is(node, 'bpmn:UserTask')) {
19
- return;
20
- }
21
-
22
- const taskSchedule = findExtensionElement(node, 'zeebe:TaskSchedule');
23
-
24
- if (!taskSchedule) {
25
- return;
26
- }
27
-
28
- const dueDate = taskSchedule.get('dueDate');
29
-
30
- let errors = [];
31
-
32
- if (isDefined(dueDate)) {
33
- errors = [
34
- ...errors,
35
- ...hasExpression(taskSchedule, 'dueDate', {
36
- allowed: date => isValidDate(date)
37
- }, node)
38
- ];
39
- }
40
-
41
- const followUpDate = taskSchedule.get('followUpDate');
42
-
43
- if (isDefined(followUpDate)) {
44
- errors = [
45
- ...errors,
46
- ...hasExpression(taskSchedule, 'followUpDate', {
47
- allowed: date => isValidDate(date)
48
- }, node)
49
- ];
50
- }
51
-
52
- if (errors.length) {
53
- reportErrors(node, reporter, errors);
54
- }
55
- }
56
-
57
- return {
58
- check
59
- };
60
- });
61
-
62
- function isValidDate(value) {
63
- return isExpression(value) || validateISO8601Date(value);
64
- }
65
-
66
- function isExpression(value) {
67
- return value.startsWith('=');
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ const { isDefined } = require('min-dash');
4
+
5
+ const {
6
+ findExtensionElement,
7
+ hasExpression
8
+ } = require('../utils/element');
9
+
10
+ const { validateDate: validateISO8601Date } = require('../utils/iso8601');
11
+
12
+ const { reportErrors } = require('../utils/reporter');
13
+
14
+ const { skipInNonExecutableProcess } = require('../utils/rule');
15
+
16
+ module.exports = skipInNonExecutableProcess(function() {
17
+ function check(node, reporter) {
18
+ if (!is(node, 'bpmn:UserTask')) {
19
+ return;
20
+ }
21
+
22
+ const taskSchedule = findExtensionElement(node, 'zeebe:TaskSchedule');
23
+
24
+ if (!taskSchedule) {
25
+ return;
26
+ }
27
+
28
+ const dueDate = taskSchedule.get('dueDate');
29
+
30
+ let errors = [];
31
+
32
+ if (isDefined(dueDate)) {
33
+ errors = [
34
+ ...errors,
35
+ ...hasExpression(taskSchedule, 'dueDate', {
36
+ allowed: date => isValidDate(date)
37
+ }, node)
38
+ ];
39
+ }
40
+
41
+ const followUpDate = taskSchedule.get('followUpDate');
42
+
43
+ if (isDefined(followUpDate)) {
44
+ errors = [
45
+ ...errors,
46
+ ...hasExpression(taskSchedule, 'followUpDate', {
47
+ allowed: date => isValidDate(date)
48
+ }, node)
49
+ ];
50
+ }
51
+
52
+ if (errors.length) {
53
+ reportErrors(node, reporter, errors);
54
+ }
55
+ }
56
+
57
+ return {
58
+ check
59
+ };
60
+ });
61
+
62
+ function isValidDate(value) {
63
+ return isExpression(value) || validateISO8601Date(value);
64
+ }
65
+
66
+ function isExpression(value) {
67
+ return value.startsWith('=');
68
68
  }
@@ -1,47 +1,47 @@
1
- const { is } = require('bpmnlint-utils');
2
-
3
- module.exports = {
4
- expressionType: {
5
- 'cron': '8.1',
6
- 'iso8601': '1.0'
7
- },
8
- elementType: {
9
- 'bpmn:StartEvent': {
10
- 'timeCycle': (isInterrupting, parent) => {
11
- if (!isInterrupting || !isEventSubProcess(parent)) {
12
- return '1.0';
13
- }
14
-
15
- return null;
16
- },
17
- 'timeDate': () => '1.0',
18
- 'timeDuration': (_, parent) => {
19
- if (isEventSubProcess(parent)) {
20
- return '1.0';
21
- }
22
-
23
- return null;
24
- }
25
- },
26
- 'bpmn:BoundaryEvent': {
27
- 'timeCycle': (cancelActivity) => {
28
- if (!cancelActivity) {
29
- return '1.0';
30
- }
31
-
32
- return null;
33
- },
34
- 'timeDate': () => '8.3',
35
- 'timeDuration': () => '1.0'
36
- },
37
- 'bpmn:IntermediateCatchEvent': {
38
- 'timeCycle': () => null,
39
- 'timeDate': () => '8.3',
40
- 'timeDuration': () => '1.0'
41
- }
42
- }
43
- };
44
-
45
- function isEventSubProcess(element) {
46
- return is(element, 'bpmn:SubProcess') && element.get('triggeredByEvent') === true;
1
+ const { is } = require('bpmnlint-utils');
2
+
3
+ module.exports = {
4
+ expressionType: {
5
+ 'cron': '8.1',
6
+ 'iso8601': '1.0'
7
+ },
8
+ elementType: {
9
+ 'bpmn:StartEvent': {
10
+ 'timeCycle': (isInterrupting, parent) => {
11
+ if (!isInterrupting || !isEventSubProcess(parent)) {
12
+ return '1.0';
13
+ }
14
+
15
+ return null;
16
+ },
17
+ 'timeDate': () => '1.0',
18
+ 'timeDuration': (_, parent) => {
19
+ if (isEventSubProcess(parent)) {
20
+ return '1.0';
21
+ }
22
+
23
+ return null;
24
+ }
25
+ },
26
+ 'bpmn:BoundaryEvent': {
27
+ 'timeCycle': (cancelActivity) => {
28
+ if (!cancelActivity) {
29
+ return '1.0';
30
+ }
31
+
32
+ return null;
33
+ },
34
+ 'timeDate': () => '8.3',
35
+ 'timeDuration': () => '1.0'
36
+ },
37
+ 'bpmn:IntermediateCatchEvent': {
38
+ 'timeCycle': () => null,
39
+ 'timeDate': () => '8.3',
40
+ 'timeDuration': () => '1.0'
41
+ }
42
+ }
43
+ };
44
+
45
+ function isEventSubProcess(element) {
46
+ return is(element, 'bpmn:SubProcess') && element.get('triggeredByEvent') === true;
47
47
  }