@camunda/linting 0.13.0 → 0.14.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/lib/Linter.js CHANGED
@@ -1,4 +1,4 @@
1
- import BpmnModdle from 'bpmn-moddle/dist/index';
1
+ import BpmnModdle from 'bpmn-moddle';
2
2
 
3
3
  import { Linter as BpmnLinter } from 'bpmnlint';
4
4
  import StaticResolver from 'bpmnlint/lib/resolver/static-resolver';
@@ -115,6 +115,10 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
115
115
  return getExpressionValueNotAllowedErrorMessage(report);
116
116
  }
117
117
 
118
+ if (type === ERROR_TYPES.EXPRESSION_NOT_ALLOWED) {
119
+ return getExpressionNotAllowedErrorMessage(report);
120
+ }
121
+
118
122
  return message;
119
123
  }
120
124
 
@@ -317,6 +321,10 @@ function getPropertyNotAllowedErrorMessage(report, executionPlatform, executionP
317
321
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with more than one incoming <Sequence Flow> is not supported by ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }`;
318
322
  }
319
323
 
324
+ if (is(node, 'zeebe:AssignmentDefinition') && property === 'candidateUsers') {
325
+ return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with defined <Candidate users>`, executionPlatform, executionPlatformVersion, allowedVersion);
326
+ }
327
+
320
328
  return message;
321
329
  }
322
330
 
@@ -363,6 +371,10 @@ function getPropertyRequiredErrorMessage(report) {
363
371
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Error Reference> must have a defined <Error code>`;
364
372
  }
365
373
 
374
+ if (is(node, 'bpmn:Escalation') && requiredProperty === 'escalationCode') {
375
+ return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Escalation Reference> must have a defined <Escalation code>`;
376
+ }
377
+
366
378
  if (is(node, 'zeebe:LoopCharacteristics') && requiredProperty === 'inputCollection') {
367
379
  return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Multi-instance marker> must have a defined <Input collection>`;
368
380
  }
@@ -463,4 +475,22 @@ function getSupportedMessage(prefix, executionPlatform, executionPlatformVersion
463
475
  }
464
476
 
465
477
  return `${ prefix } is not supported by ${ getExecutionPlatformLabel(executionPlatform, executionPlatformVersion) }`;
466
- }
478
+ }
479
+
480
+ function getExpressionNotAllowedErrorMessage(report) {
481
+ const {
482
+ data
483
+ } = report;
484
+
485
+ const {
486
+ node,
487
+ parentNode,
488
+ property
489
+ } = data;
490
+
491
+ if (is(node, 'bpmn:Escalation') && property === 'escalationCode' && is(parentNode, 'bpmn:CatchEvent')) {
492
+ return 'Escalation code used in a catch event must be a static value';
493
+ } else if (is(node, 'bpmn:Error') && property === 'errorCode' && is(parentNode, 'bpmn:CatchEvent')) {
494
+ return 'Error code used in a catch event must be a static value';
495
+ }
496
+ }
@@ -68,6 +68,10 @@ export function getEntryIds(report) {
68
68
  return [ 'errorRef' ];
69
69
  }
70
70
 
71
+ if (isPropertyError(data, 'escalationRef')) {
72
+ return [ 'escalationRef' ];
73
+ }
74
+
71
75
  if (isPropertyError(data, 'messageRef')) {
72
76
  return [ 'messageRef' ];
73
77
  }
@@ -88,6 +92,10 @@ export function getEntryIds(report) {
88
92
  return [ 'errorCode' ];
89
93
  }
90
94
 
95
+ if (isPropertyError(data, 'escalationCode', 'bpmn:Escalation')) {
96
+ return [ 'escalationCode' ];
97
+ }
98
+
91
99
  if (isPropertyError(data, 'name', 'bpmn:Message')) {
92
100
  return [ 'messageName' ];
93
101
  }
@@ -205,6 +213,10 @@ export function getEntryIds(report) {
205
213
  return [ `multiInstance-${getPropertyName(data)}` ];
206
214
  }
207
215
 
216
+ if (isPropertyError(data, 'candidateUsers', 'zeebe:AssignmentDefinition')) {
217
+ return [ 'assignmentDefinitionCandidateUsers' ];
218
+ }
219
+
208
220
  return [];
209
221
  }
210
222
 
@@ -238,6 +250,10 @@ export function getErrorMessage(id, report) {
238
250
  return 'Global error reference must be defined.';
239
251
  }
240
252
 
253
+ if (id === 'escalationRef') {
254
+ return 'Global escalation reference must be defined.';
255
+ }
256
+
241
257
  if (id === 'messageRef') {
242
258
  return 'Global message reference must be defined.';
243
259
  }
@@ -258,6 +274,10 @@ export function getErrorMessage(id, report) {
258
274
  return 'Code must be defined.';
259
275
  }
260
276
 
277
+ if (id === 'escalationCode' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
278
+ return 'Code must be defined.';
279
+ }
280
+
261
281
  if (id === 'messageName') {
262
282
  return 'Name must be defined.';
263
283
  }
@@ -330,6 +350,10 @@ export function getErrorMessage(id, report) {
330
350
  return 'Must be an expression, or an ISO 8601 interval.';
331
351
  }
332
352
  }
353
+
354
+ if (id === 'assignmentDefinitionCandidateUsers') {
355
+ return 'Not supported.';
356
+ }
333
357
  }
334
358
 
335
359
  function isExtensionElementNotAllowedError(data, extensionElement, type) {
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "0.13.0",
3
+ "version": "0.14.0",
4
4
  "description": "Linting for Camunda Platform",
5
5
  "main": "index.js",
6
6
  "scripts": {
@@ -25,35 +25,35 @@
25
25
  },
26
26
  "license": "MIT",
27
27
  "dependencies": {
28
- "bpmn-moddle": "^7.1.3",
28
+ "bpmn-moddle": "^8.0.0",
29
29
  "bpmnlint": "^8.0.0",
30
- "bpmnlint-plugin-camunda-compat": "^0.18.0",
30
+ "bpmnlint-plugin-camunda-compat": "^0.20.0",
31
31
  "bpmnlint-utils": "^1.0.2",
32
32
  "min-dash": "^4.0.0",
33
- "min-dom": "^4.0.1",
33
+ "min-dom": "^4.1.0",
34
34
  "zeebe-bpmn-moddle": "^0.17.0"
35
35
  },
36
36
  "devDependencies": {
37
37
  "bpmn-js": "^11.1.1",
38
- "bpmn-js-properties-panel": "^1.15.0",
39
- "chai": "^4.3.6",
38
+ "bpmn-js-properties-panel": "^1.15.1",
39
+ "chai": "^4.3.7",
40
40
  "cross-env": "^7.0.3",
41
- "eslint": "^8.23.1",
42
- "eslint-plugin-bpmn-io": "^0.16.0",
43
- "karma": "^6.4.0",
41
+ "eslint": "^8.32.0",
42
+ "eslint-plugin-bpmn-io": "^1.0.0",
43
+ "karma": "^6.4.1",
44
44
  "karma-chrome-launcher": "^3.1.1",
45
45
  "karma-debug-launcher": "0.0.5",
46
46
  "karma-env-preprocessor": "^0.1.1",
47
47
  "karma-mocha": "^2.0.1",
48
48
  "karma-sinon-chai": "^2.0.2",
49
49
  "karma-webpack": "^5.0.0",
50
- "mocha": "^10.0.0",
50
+ "mocha": "^10.2.0",
51
51
  "mocha-test-container-support": "^0.2.0",
52
52
  "modeler-moddle": "^0.2.0",
53
- "puppeteer": "^16.2.0",
54
- "sinon": "^14.0.0",
53
+ "puppeteer": "^19.5.2",
54
+ "sinon": "^15.0.1",
55
55
  "sinon-chai": "^3.7.0",
56
- "webpack": "^5.74.0"
56
+ "webpack": "^5.75.0"
57
57
  },
58
58
  "peerDependencies": {
59
59
  "bpmn-js-properties-panel": ">= 1.10.0"