@camunda/linting 3.16.0 → 3.18.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/compiled-config.js +29 -19
- package/lib/utils/error-messages.js +29 -3
- package/lib/utils/properties-panel.js +28 -4
- package/package.json +5 -5
package/lib/compiled-config.js
CHANGED
|
@@ -54,6 +54,7 @@ const rules = {
|
|
|
54
54
|
"camunda-compat/no-task-schedule": "error",
|
|
55
55
|
"camunda-compat/no-template": "error",
|
|
56
56
|
"camunda-compat/no-zeebe-properties": "error",
|
|
57
|
+
"camunda-compat/no-zeebe-user-task": "error",
|
|
57
58
|
"camunda-compat/secrets": "warn",
|
|
58
59
|
"camunda-compat/sequence-flow-condition": "error",
|
|
59
60
|
"camunda-compat/signal-reference": "error",
|
|
@@ -62,7 +63,8 @@ const rules = {
|
|
|
62
63
|
"camunda-compat/task-schedule": "error",
|
|
63
64
|
"camunda-compat/timer": "error",
|
|
64
65
|
"camunda-compat/user-task-definition": "warn",
|
|
65
|
-
"camunda-compat/user-task-form": "error"
|
|
66
|
+
"camunda-compat/user-task-form": "error",
|
|
67
|
+
"camunda-compat/wait-for-completion": "error"
|
|
66
68
|
};
|
|
67
69
|
|
|
68
70
|
const config = {
|
|
@@ -178,38 +180,46 @@ import rule_24 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe
|
|
|
178
180
|
|
|
179
181
|
cache['bpmnlint-plugin-camunda-compat/no-zeebe-properties'] = rule_24;
|
|
180
182
|
|
|
181
|
-
import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
183
|
+
import rule_25 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/no-zeebe-user-task';
|
|
182
184
|
|
|
183
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
185
|
+
cache['bpmnlint-plugin-camunda-compat/no-zeebe-user-task'] = rule_25;
|
|
184
186
|
|
|
185
|
-
import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
187
|
+
import rule_26 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/secrets';
|
|
186
188
|
|
|
187
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
189
|
+
cache['bpmnlint-plugin-camunda-compat/secrets'] = rule_26;
|
|
188
190
|
|
|
189
|
-
import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
191
|
+
import rule_27 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/sequence-flow-condition';
|
|
190
192
|
|
|
191
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
193
|
+
cache['bpmnlint-plugin-camunda-compat/sequence-flow-condition'] = rule_27;
|
|
192
194
|
|
|
193
|
-
import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
195
|
+
import rule_28 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/signal-reference';
|
|
194
196
|
|
|
195
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
197
|
+
cache['bpmnlint-plugin-camunda-compat/signal-reference'] = rule_28;
|
|
196
198
|
|
|
197
|
-
import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
199
|
+
import rule_29 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/start-event-form';
|
|
198
200
|
|
|
199
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
201
|
+
cache['bpmnlint-plugin-camunda-compat/start-event-form'] = rule_29;
|
|
200
202
|
|
|
201
|
-
import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
203
|
+
import rule_30 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/subscription';
|
|
202
204
|
|
|
203
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
205
|
+
cache['bpmnlint-plugin-camunda-compat/subscription'] = rule_30;
|
|
204
206
|
|
|
205
|
-
import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
207
|
+
import rule_31 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/task-schedule';
|
|
206
208
|
|
|
207
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
209
|
+
cache['bpmnlint-plugin-camunda-compat/task-schedule'] = rule_31;
|
|
208
210
|
|
|
209
|
-
import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/
|
|
211
|
+
import rule_32 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/timer';
|
|
210
212
|
|
|
211
|
-
cache['bpmnlint-plugin-camunda-compat/
|
|
213
|
+
cache['bpmnlint-plugin-camunda-compat/timer'] = rule_32;
|
|
212
214
|
|
|
213
|
-
import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-
|
|
215
|
+
import rule_33 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-definition';
|
|
214
216
|
|
|
215
|
-
cache['bpmnlint-plugin-camunda-compat/user-task-
|
|
217
|
+
cache['bpmnlint-plugin-camunda-compat/user-task-definition'] = rule_33;
|
|
218
|
+
|
|
219
|
+
import rule_34 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/user-task-form';
|
|
220
|
+
|
|
221
|
+
cache['bpmnlint-plugin-camunda-compat/user-task-form'] = rule_34;
|
|
222
|
+
|
|
223
|
+
import rule_35 from 'bpmnlint-plugin-camunda-compat/rules/camunda-cloud/wait-for-completion';
|
|
224
|
+
|
|
225
|
+
cache['bpmnlint-plugin-camunda-compat/wait-for-completion'] = rule_35;
|
|
@@ -126,7 +126,7 @@ export function getErrorMessage(report, executionPlatform, executionPlatformVers
|
|
|
126
126
|
}
|
|
127
127
|
|
|
128
128
|
if (type === ERROR_TYPES.PROPERTY_VALUE_REQUIRED) {
|
|
129
|
-
return getPropertyValueRequiredErrorMessage(report);
|
|
129
|
+
return getPropertyValueRequiredErrorMessage(report, executionPlatform, executionPlatformVersion);
|
|
130
130
|
}
|
|
131
131
|
|
|
132
132
|
if (type === ERROR_TYPES.EXPRESSION_REQUIRED) {
|
|
@@ -228,13 +228,14 @@ function getPropertyValueDuplicatedErrorMessage(report) {
|
|
|
228
228
|
return message;
|
|
229
229
|
}
|
|
230
230
|
|
|
231
|
-
function getPropertyValueRequiredErrorMessage(report) {
|
|
231
|
+
function getPropertyValueRequiredErrorMessage(report, executionPlatform, executionPlatformVersion) {
|
|
232
232
|
const {
|
|
233
233
|
data,
|
|
234
234
|
message
|
|
235
235
|
} = report;
|
|
236
236
|
|
|
237
237
|
const {
|
|
238
|
+
allowedVersion,
|
|
238
239
|
node,
|
|
239
240
|
property,
|
|
240
241
|
parentNode
|
|
@@ -248,6 +249,12 @@ function getPropertyValueRequiredErrorMessage(report) {
|
|
|
248
249
|
}
|
|
249
250
|
}
|
|
250
251
|
|
|
252
|
+
const typeString = getTypeString(parentNode || node);
|
|
253
|
+
|
|
254
|
+
if (is(node, 'bpmn:CompensateEventDefinition') && property === 'waitForCompletion') {
|
|
255
|
+
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Wait for completion> disabled`, executionPlatform, executionPlatformVersion, allowedVersion);
|
|
256
|
+
}
|
|
257
|
+
|
|
251
258
|
return message;
|
|
252
259
|
}
|
|
253
260
|
|
|
@@ -274,6 +281,10 @@ function getExtensionElementNotAllowedErrorMessage(report, executionPlatform, ex
|
|
|
274
281
|
return getSupportedMessage(`${ getIndefiniteArticle(typeString) } <${ typeString }> with <Extension properties>`, executionPlatform, executionPlatformVersion, allowedVersion);
|
|
275
282
|
}
|
|
276
283
|
|
|
284
|
+
if (is(extensionElement, 'zeebe:UserTask')) {
|
|
285
|
+
return getSupportedMessage('A <User Task> with <Implementation: Zeebe user task>', executionPlatform, executionPlatformVersion, allowedVersion);
|
|
286
|
+
}
|
|
287
|
+
|
|
277
288
|
if (is(node, 'bpmn:ScriptTask') && is(extensionElement, 'zeebe:Script')) {
|
|
278
289
|
return getSupportedMessage('A <Script Task> with <Implementation: FEEL expression>', executionPlatform, executionPlatformVersion, allowedVersion);
|
|
279
290
|
}
|
|
@@ -500,6 +511,15 @@ function getPropertyRequiredErrorMessage(report, executionPlatform, executionPla
|
|
|
500
511
|
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Custom form key> must have a defined <Form key>`;
|
|
501
512
|
}
|
|
502
513
|
|
|
514
|
+
// Zeebe User Task
|
|
515
|
+
if (is(node, 'zeebe:FormDefinition') && isZeebeUserTask(parentNode)) {
|
|
516
|
+
if (isEmptyString(node.get('externalReference'))) {
|
|
517
|
+
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: External reference> must have a defined <External reference>`;
|
|
518
|
+
} else if (isEmptyString(node.get('formId'))) {
|
|
519
|
+
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Camunda Form> must have a defined <Form ID>`;
|
|
520
|
+
}
|
|
521
|
+
}
|
|
522
|
+
|
|
503
523
|
if (is(node, 'zeebe:FormDefinition') && isArray(requiredProperty) && requiredProperty.includes('formId') && isEmptyString(node.get('formId'))) {
|
|
504
524
|
return `${ getIndefiniteArticle(typeString) } <${ typeString }> with <Form type: Camunda form (linked)> must have a defined <Form ID>`;
|
|
505
525
|
}
|
|
@@ -693,4 +713,10 @@ function getLoopNotAllowedErrorMessage(report) {
|
|
|
693
713
|
|
|
694
714
|
function isEmptyString(value) {
|
|
695
715
|
return isString(value) && value.trim() === '';
|
|
696
|
-
}
|
|
716
|
+
}
|
|
717
|
+
|
|
718
|
+
function isZeebeUserTask(node) {
|
|
719
|
+
return node.get('extensionElements').get('values').some(extensionElement => {
|
|
720
|
+
return is(extensionElement, 'zeebe:UserTask');
|
|
721
|
+
});
|
|
722
|
+
}
|
|
@@ -168,10 +168,14 @@ export function getEntryIds(report) {
|
|
|
168
168
|
requiredProperty
|
|
169
169
|
} = data;
|
|
170
170
|
|
|
171
|
-
if (isArray(requiredProperty)
|
|
172
|
-
|
|
173
|
-
|
|
174
|
-
|
|
171
|
+
if (isArray(requiredProperty)) {
|
|
172
|
+
if (requiredProperty.includes('formKey') && isEmptyString(node.get('formKey'))) {
|
|
173
|
+
return [ 'customFormKey' ];
|
|
174
|
+
} else if (requiredProperty.includes('formId') && isEmptyString(node.get('formId'))) {
|
|
175
|
+
return [ 'formId' ];
|
|
176
|
+
} else if (requiredProperty.includes('externalReference') && isEmptyString(node.get('externalReference'))) {
|
|
177
|
+
return [ 'externalReference' ];
|
|
178
|
+
}
|
|
175
179
|
}
|
|
176
180
|
}
|
|
177
181
|
|
|
@@ -205,6 +209,10 @@ export function getEntryIds(report) {
|
|
|
205
209
|
});
|
|
206
210
|
}
|
|
207
211
|
|
|
212
|
+
if (isExtensionElementNotAllowedError(data, 'zeebe:UserTask')) {
|
|
213
|
+
return [ 'userTaskImplementation' ];
|
|
214
|
+
}
|
|
215
|
+
|
|
208
216
|
if (isExtensionElementNotAllowedError(data, 'zeebe:FormDefinition', 'bpmn:StartEvent')) {
|
|
209
217
|
return [ 'formType' ];
|
|
210
218
|
}
|
|
@@ -304,6 +312,10 @@ export function getEntryIds(report) {
|
|
|
304
312
|
return [ 'linkName' ];
|
|
305
313
|
}
|
|
306
314
|
|
|
315
|
+
if (isPropertyError(data, 'waitForCompletion', 'bpmn:CompensateEventDefinition')) {
|
|
316
|
+
return [ 'waitForCompletion' ];
|
|
317
|
+
}
|
|
318
|
+
|
|
307
319
|
return [];
|
|
308
320
|
}
|
|
309
321
|
|
|
@@ -424,6 +436,10 @@ export function getErrorMessage(id, report) {
|
|
|
424
436
|
}
|
|
425
437
|
}
|
|
426
438
|
|
|
439
|
+
if (id === 'externalReference') {
|
|
440
|
+
return 'External reference must be defined.';
|
|
441
|
+
}
|
|
442
|
+
|
|
427
443
|
if (id === 'formConfiguration') {
|
|
428
444
|
return 'Form JSON configuration must be defined.';
|
|
429
445
|
}
|
|
@@ -436,6 +452,10 @@ export function getErrorMessage(id, report) {
|
|
|
436
452
|
return 'Not supported.';
|
|
437
453
|
}
|
|
438
454
|
|
|
455
|
+
if (id === 'userTaskImplementation') {
|
|
456
|
+
return 'Supported only in Camunda 8.5 or newer.';
|
|
457
|
+
}
|
|
458
|
+
|
|
439
459
|
if (id === 'conditionExpression') {
|
|
440
460
|
return 'Condition expression must be defined.';
|
|
441
461
|
}
|
|
@@ -499,6 +519,10 @@ export function getErrorMessage(id, report) {
|
|
|
499
519
|
return 'Must be defined.';
|
|
500
520
|
}
|
|
501
521
|
}
|
|
522
|
+
|
|
523
|
+
if (id === 'waitForCompletion') {
|
|
524
|
+
return 'Must wait for completion.';
|
|
525
|
+
}
|
|
502
526
|
}
|
|
503
527
|
|
|
504
528
|
function isExtensionElementNotAllowedError(data, extensionElement, type) {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@camunda/linting",
|
|
3
|
-
"version": "3.
|
|
3
|
+
"version": "3.18.0",
|
|
4
4
|
"description": "Linting for Camunda",
|
|
5
5
|
"main": "index.js",
|
|
6
6
|
"scripts": {
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@bpmn-io/diagram-js-ui": "^0.2.2",
|
|
33
33
|
"bpmn-moddle": "^8.1.0",
|
|
34
34
|
"bpmnlint": "^10.2.0",
|
|
35
|
-
"bpmnlint-plugin-camunda-compat": "^2.
|
|
35
|
+
"bpmnlint-plugin-camunda-compat": "^2.18.0",
|
|
36
36
|
"bpmnlint-utils": "^1.0.2",
|
|
37
37
|
"camunda-bpmn-moddle": "^7.0.1",
|
|
38
38
|
"clsx": "^2.0.0",
|
|
@@ -40,13 +40,13 @@
|
|
|
40
40
|
"min-dom": "^4.1.0",
|
|
41
41
|
"modeler-moddle": "^0.2.0",
|
|
42
42
|
"semver-compare": "^1.0.0",
|
|
43
|
-
"zeebe-bpmn-moddle": "^1.
|
|
43
|
+
"zeebe-bpmn-moddle": "^1.1.0"
|
|
44
44
|
},
|
|
45
45
|
"devDependencies": {
|
|
46
46
|
"bpmn-js": "^16.5.0",
|
|
47
47
|
"bpmn-js-element-templates": "^1.13.1",
|
|
48
|
-
"bpmn-js-properties-panel": "^5.
|
|
49
|
-
"camunda-bpmn-js-behaviors": "^1.
|
|
48
|
+
"bpmn-js-properties-panel": "^5.13.0",
|
|
49
|
+
"camunda-bpmn-js-behaviors": "^1.3.0",
|
|
50
50
|
"chai": "^4.4.1",
|
|
51
51
|
"cross-env": "^7.0.3",
|
|
52
52
|
"eslint": "^8.56.0",
|