bpmnlint-plugin-camunda-compat 2.35.0 → 2.36.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 (64) hide show
  1. package/LICENSE +20 -20
  2. package/README.md +39 -39
  3. package/index.js +286 -286
  4. package/package.json +53 -53
  5. package/rules/camunda-cloud/ad-hoc-sub-process.js +60 -60
  6. package/rules/camunda-cloud/called-element.js +44 -44
  7. package/rules/camunda-cloud/collapsed-subprocess.js +40 -40
  8. package/rules/camunda-cloud/connector-properties/config.js +90 -90
  9. package/rules/camunda-cloud/connector-properties/index.js +47 -47
  10. package/rules/camunda-cloud/duplicate-execution-listeners.js +33 -33
  11. package/rules/camunda-cloud/duplicate-task-headers.js +58 -58
  12. package/rules/camunda-cloud/element-type/config.js +67 -67
  13. package/rules/camunda-cloud/element-type/index.js +135 -135
  14. package/rules/camunda-cloud/error-reference.js +72 -72
  15. package/rules/camunda-cloud/escalation-boundary-event-attached-to-ref.js +47 -47
  16. package/rules/camunda-cloud/escalation-reference.js +67 -67
  17. package/rules/camunda-cloud/event-based-gateway-target.js +38 -38
  18. package/rules/camunda-cloud/executable-process.js +61 -61
  19. package/rules/camunda-cloud/execution-listener.js +33 -33
  20. package/rules/camunda-cloud/feel.js +86 -86
  21. package/rules/camunda-cloud/implementation/config.js +19 -19
  22. package/rules/camunda-cloud/implementation/index.js +218 -218
  23. package/rules/camunda-cloud/inclusive-gateway.js +35 -35
  24. package/rules/camunda-cloud/link-event.js +142 -142
  25. package/rules/camunda-cloud/loop-characteristics.js +66 -66
  26. package/rules/camunda-cloud/message-reference.js +61 -61
  27. package/rules/camunda-cloud/no-binding-type.js +43 -43
  28. package/rules/camunda-cloud/no-candidate-users.js +38 -38
  29. package/rules/camunda-cloud/no-execution-listeners.js +21 -21
  30. package/rules/camunda-cloud/no-expression.js +173 -173
  31. package/rules/camunda-cloud/no-loop.js +316 -316
  32. package/rules/camunda-cloud/no-multiple-none-start-events.js +41 -41
  33. package/rules/camunda-cloud/no-priority-definition.js +18 -18
  34. package/rules/camunda-cloud/no-propagate-all-parent-variables.js +44 -44
  35. package/rules/camunda-cloud/no-signal-event-sub-process.js +45 -45
  36. package/rules/camunda-cloud/no-task-listeners.js +21 -21
  37. package/rules/camunda-cloud/no-task-schedule.js +18 -18
  38. package/rules/camunda-cloud/no-template.js +23 -23
  39. package/rules/camunda-cloud/no-version-tag.js +24 -24
  40. package/rules/camunda-cloud/no-zeebe-properties.js +18 -18
  41. package/rules/camunda-cloud/no-zeebe-user-task.js +27 -27
  42. package/rules/camunda-cloud/priority-definition.js +61 -61
  43. package/rules/camunda-cloud/secrets.js +119 -119
  44. package/rules/camunda-cloud/sequence-flow-condition.js +56 -56
  45. package/rules/camunda-cloud/signal-reference.js +64 -64
  46. package/rules/camunda-cloud/start-event-form.js +97 -97
  47. package/rules/camunda-cloud/subscription.js +65 -65
  48. package/rules/camunda-cloud/task-listener.js +39 -39
  49. package/rules/camunda-cloud/task-schedule.js +67 -67
  50. package/rules/camunda-cloud/timer/config.js +46 -46
  51. package/rules/camunda-cloud/timer/index.js +183 -183
  52. package/rules/camunda-cloud/user-task-definition.js +24 -24
  53. package/rules/camunda-cloud/user-task-form.js +142 -142
  54. package/rules/camunda-cloud/wait-for-completion.js +46 -46
  55. package/rules/camunda-cloud/zeebe-user-task.js +30 -30
  56. package/rules/camunda-platform/history-time-to-live.js +24 -21
  57. package/rules/helper.js +38 -38
  58. package/rules/utils/cron.js +95 -95
  59. package/rules/utils/element.js +533 -533
  60. package/rules/utils/error-types.js +26 -26
  61. package/rules/utils/iso8601.js +52 -52
  62. package/rules/utils/reporter.js +37 -37
  63. package/rules/utils/rule.js +46 -46
  64. package/rules/utils/version.js +4 -4
@@ -1,95 +1,95 @@
1
- const MACROS = [
2
- '@yearly',
3
- '@annually',
4
- '@monthly',
5
- '@weekly',
6
- '@daily',
7
- '@midnight',
8
- '@hourly'
9
- ];
10
- const MACRO_REGEX = new RegExp(`^(${ MACROS.join('|') })$`);
11
-
12
- function validateMacro(text) {
13
- return MACRO_REGEX.test(text);
14
- }
15
-
16
- const ASTERISK = '\\*';
17
- const QUESTION_MARK = '\\?';
18
- const COMMA = ',';
19
-
20
- const SECOND = '([0-5]?[0-9])';
21
- const MINUTE = '([0-5]?[0-9])';
22
- const HOUR = '([01]?[0-9]|2[0-3])';
23
- const DAY_OF_MONTH = or(`L(-${ or('[0-2]?[0-9]', '3[0-1]') })?`, '[0-2]?[0-9]', '3[0-1]', dayOfMonthSuffix(or('L', '[0-2]?[0-9]', '3[0-1]')));
24
-
25
- const MONTHS = [
26
- 'JAN',
27
- 'FEB',
28
- 'MAR',
29
- 'APR',
30
- 'MAY',
31
- 'JUN',
32
- 'JUL',
33
- 'AUG',
34
- 'SEP',
35
- 'OCT',
36
- 'NOV',
37
- 'DEC'
38
- ];
39
- const MONTH = or('[0]?[1-9]', '1[0-2]', ...MONTHS);
40
-
41
- const WEEK_DAYS = [
42
- 'MON',
43
- 'TUE',
44
- 'WED',
45
- 'THU',
46
- 'FRI',
47
- 'SAT',
48
- 'SUN'
49
- ];
50
- const DAY_OF_WEEK = or('[0-7]', ...WEEK_DAYS);
51
-
52
- const SECOND_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(SECOND), optionalRange(SECOND))));
53
- const MINUTE_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(MINUTE), optionalRange(MINUTE))));
54
- const HOUR_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(HOUR), optionalRange(HOUR))));
55
- const DAY_OF_MONTH_REGEX = or(ASTERISK, QUESTION_MARK, commaSeparated(optionalRange(DAY_OF_MONTH)));
56
- const MONTH_REGEX = or(ASTERISK, commaSeparated(optionalRange(MONTH)));
57
- const DAY_OF_WEEK_REGEX = or(ASTERISK, QUESTION_MARK, commaSeparated(or(optionalRange(DAY_OF_WEEK), dayOfWeekSuffix(DAY_OF_WEEK))));
58
-
59
- const CRON_REGEX = new RegExp(`^${ SECOND_REGEX } ${ MINUTE_REGEX } ${ HOUR_REGEX } ${ DAY_OF_MONTH_REGEX } ${ MONTH_REGEX } ${ DAY_OF_WEEK_REGEX }$`, 'i');
60
-
61
- function validateCron(value) {
62
- return CRON_REGEX.test(value);
63
- }
64
-
65
- module.exports.validateCronExpression = function(value) {
66
- return validateMacro(value) || validateCron(value);
67
- };
68
-
69
-
70
-
71
- // helper //////////////
72
-
73
- function or(...patterns) {
74
- return `(${patterns.join('|')})`;
75
- }
76
-
77
- function optionalRange(pattern) {
78
- return `${pattern}(-${pattern})?`;
79
- }
80
-
81
- function commaSeparated(pattern) {
82
- return `${pattern}(${COMMA}${pattern})*`;
83
- }
84
-
85
- function interval(pattern) {
86
- return `${pattern}/\\d+`;
87
- }
88
-
89
- function dayOfMonthSuffix(pattern) {
90
- return `${pattern}W`;
91
- }
92
-
93
- function dayOfWeekSuffix(pattern) {
94
- return `${pattern}(#[1-5]|L)`;
95
- }
1
+ const MACROS = [
2
+ '@yearly',
3
+ '@annually',
4
+ '@monthly',
5
+ '@weekly',
6
+ '@daily',
7
+ '@midnight',
8
+ '@hourly'
9
+ ];
10
+ const MACRO_REGEX = new RegExp(`^(${ MACROS.join('|') })$`);
11
+
12
+ function validateMacro(text) {
13
+ return MACRO_REGEX.test(text);
14
+ }
15
+
16
+ const ASTERISK = '\\*';
17
+ const QUESTION_MARK = '\\?';
18
+ const COMMA = ',';
19
+
20
+ const SECOND = '([0-5]?[0-9])';
21
+ const MINUTE = '([0-5]?[0-9])';
22
+ const HOUR = '([01]?[0-9]|2[0-3])';
23
+ const DAY_OF_MONTH = or(`L(-${ or('[0-2]?[0-9]', '3[0-1]') })?`, '[0-2]?[0-9]', '3[0-1]', dayOfMonthSuffix(or('L', '[0-2]?[0-9]', '3[0-1]')));
24
+
25
+ const MONTHS = [
26
+ 'JAN',
27
+ 'FEB',
28
+ 'MAR',
29
+ 'APR',
30
+ 'MAY',
31
+ 'JUN',
32
+ 'JUL',
33
+ 'AUG',
34
+ 'SEP',
35
+ 'OCT',
36
+ 'NOV',
37
+ 'DEC'
38
+ ];
39
+ const MONTH = or('[0]?[1-9]', '1[0-2]', ...MONTHS);
40
+
41
+ const WEEK_DAYS = [
42
+ 'MON',
43
+ 'TUE',
44
+ 'WED',
45
+ 'THU',
46
+ 'FRI',
47
+ 'SAT',
48
+ 'SUN'
49
+ ];
50
+ const DAY_OF_WEEK = or('[0-7]', ...WEEK_DAYS);
51
+
52
+ const SECOND_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(SECOND), optionalRange(SECOND))));
53
+ const MINUTE_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(MINUTE), optionalRange(MINUTE))));
54
+ const HOUR_REGEX = or(ASTERISK, interval(ASTERISK), commaSeparated(or(interval(HOUR), optionalRange(HOUR))));
55
+ const DAY_OF_MONTH_REGEX = or(ASTERISK, QUESTION_MARK, commaSeparated(optionalRange(DAY_OF_MONTH)));
56
+ const MONTH_REGEX = or(ASTERISK, commaSeparated(optionalRange(MONTH)));
57
+ const DAY_OF_WEEK_REGEX = or(ASTERISK, QUESTION_MARK, commaSeparated(or(optionalRange(DAY_OF_WEEK), dayOfWeekSuffix(DAY_OF_WEEK))));
58
+
59
+ const CRON_REGEX = new RegExp(`^${ SECOND_REGEX } ${ MINUTE_REGEX } ${ HOUR_REGEX } ${ DAY_OF_MONTH_REGEX } ${ MONTH_REGEX } ${ DAY_OF_WEEK_REGEX }$`, 'i');
60
+
61
+ function validateCron(value) {
62
+ return CRON_REGEX.test(value);
63
+ }
64
+
65
+ module.exports.validateCronExpression = function(value) {
66
+ return validateMacro(value) || validateCron(value);
67
+ };
68
+
69
+
70
+
71
+ // helper //////////////
72
+
73
+ function or(...patterns) {
74
+ return `(${patterns.join('|')})`;
75
+ }
76
+
77
+ function optionalRange(pattern) {
78
+ return `${pattern}(-${pattern})?`;
79
+ }
80
+
81
+ function commaSeparated(pattern) {
82
+ return `${pattern}(${COMMA}${pattern})*`;
83
+ }
84
+
85
+ function interval(pattern) {
86
+ return `${pattern}/\\d+`;
87
+ }
88
+
89
+ function dayOfMonthSuffix(pattern) {
90
+ return `${pattern}W`;
91
+ }
92
+
93
+ function dayOfWeekSuffix(pattern) {
94
+ return `${pattern}(#[1-5]|L)`;
95
+ }