@camunda/linting 3.20.0 → 3.21.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.
@@ -325,12 +325,17 @@ export function getErrorMessage(id, report) {
325
325
  executionPlatformVersion
326
326
  } = report;
327
327
 
328
+ const {
329
+ type,
330
+ allowedVersion
331
+ } = data;
332
+
328
333
  // adjust FEEL message
329
- if (data.type === ERROR_TYPES.FEEL_EXPRESSION_INVALID) {
334
+ if (type === ERROR_TYPES.FEEL_EXPRESSION_INVALID) {
330
335
  return 'Unparsable FEEL expression.';
331
336
  }
332
337
 
333
- if (data.type === ERROR_TYPES.EXPRESSION_NOT_ALLOWED) {
338
+ if (type === ERROR_TYPES.EXPRESSION_NOT_ALLOWED) {
334
339
  return 'Cannot be an expression.';
335
340
  }
336
341
 
@@ -376,11 +381,11 @@ export function getErrorMessage(id, report) {
376
381
  return 'Result variable must be defined.';
377
382
  }
378
383
 
379
- if (id === 'errorCode' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
384
+ if (id === 'errorCode' && type === ERROR_TYPES.PROPERTY_REQUIRED) {
380
385
  return 'Code must be defined.';
381
386
  }
382
387
 
383
- if (id === 'escalationCode' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
388
+ if (id === 'escalationCode' && type === ERROR_TYPES.PROPERTY_REQUIRED) {
384
389
  return 'Code must be defined.';
385
390
  }
386
391
 
@@ -412,7 +417,7 @@ export function getErrorMessage(id, report) {
412
417
  return 'Type must be defined.';
413
418
  }
414
419
 
415
- if (id === 'timerEventDefinitionType' && data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
420
+ if (id === 'timerEventDefinitionType' && type === ERROR_TYPES.PROPERTY_REQUIRED) {
416
421
  return 'Type must be defined.';
417
422
  }
418
423
 
@@ -420,7 +425,7 @@ export function getErrorMessage(id, report) {
420
425
  && [
421
426
  ERROR_TYPES.EXTENSION_ELEMENT_REQUIRED,
422
427
  ERROR_TYPES.PROPERTY_REQUIRED
423
- ].includes(data.type)) {
428
+ ].includes(type)) {
424
429
  return 'Subscription correlation key must be defined.';
425
430
  }
426
431
 
@@ -429,10 +434,10 @@ export function getErrorMessage(id, report) {
429
434
  }
430
435
 
431
436
  if (id === 'formId') {
432
- if (data.type === ERROR_TYPES.PROPERTY_REQUIRED) {
437
+ if (type === ERROR_TYPES.PROPERTY_REQUIRED) {
433
438
  return 'Form ID must be defined.';
434
- } else if (data.type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
435
- return 'Form ID not supported.';
439
+ } else if (type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
440
+ return getNotSupportedMessage('Form ID', allowedVersion);
436
441
  }
437
442
  }
438
443
 
@@ -449,7 +454,7 @@ export function getErrorMessage(id, report) {
449
454
  }
450
455
 
451
456
  if (/^.+-extensionProperty-[0-9]+-name$/.test(id)) {
452
- return 'Not supported.';
457
+ return getNotSupportedMessage('', allowedVersion);
453
458
  }
454
459
 
455
460
  if (id === 'userTaskImplementation') {
@@ -460,12 +465,12 @@ export function getErrorMessage(id, report) {
460
465
  return 'Condition expression must be defined.';
461
466
  }
462
467
 
463
- if (id === 'timerEventDefinitionType' && data.type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
464
- return 'Type not supported.';
468
+ if (id === 'timerEventDefinitionType' && type === ERROR_TYPES.PROPERTY_NOT_ALLOWED) {
469
+ return getNotSupportedMessage('Type', allowedVersion);
465
470
  }
466
471
 
467
472
  if (id === 'timerEventDefinitionValue') {
468
- if (data.type === ERROR_TYPES.EXPRESSION_REQUIRED) {
473
+ if (type === ERROR_TYPES.EXPRESSION_REQUIRED) {
469
474
  return 'Value must be defined.';
470
475
  }
471
476
 
@@ -489,31 +494,31 @@ export function getErrorMessage(id, report) {
489
494
  }
490
495
 
491
496
  if (id === 'assignmentDefinitionCandidateUsers') {
492
- return 'Not supported.';
497
+ return getNotSupportedMessage('', allowedVersion);
493
498
  }
494
499
 
495
500
  if (id === 'taskScheduleDueDate') {
496
- if (data.type === ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED) {
497
- return 'Not supported.';
501
+ if (type === ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED) {
502
+ return getNotSupportedMessage('', allowedVersion);
498
503
  } else {
499
504
  return 'Must be an ISO 8601 date.';
500
505
  }
501
506
  }
502
507
 
503
508
  if (id === 'taskScheduleFollowUpDate') {
504
- if (data.type === ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED) {
505
- return 'Not supported.';
509
+ if (type === ERROR_TYPES.EXTENSION_ELEMENT_NOT_ALLOWED) {
510
+ return getNotSupportedMessage('', allowedVersion);
506
511
  } else {
507
512
  return 'Must be an ISO 8601 date.';
508
513
  }
509
514
  }
510
515
 
511
516
  if (id === 'propagateAllParentVariables') {
512
- return 'Not supported.';
517
+ return getNotSupportedMessage('', allowedVersion);
513
518
  }
514
519
 
515
520
  if (id === 'linkName') {
516
- if (data.type === ERROR_TYPES.ELEMENT_PROPERTY_VALUE_DUPLICATED) {
521
+ if (type === ERROR_TYPES.ELEMENT_PROPERTY_VALUE_DUPLICATED) {
517
522
  return 'Must be unique.';
518
523
  } else {
519
524
  return 'Must be defined.';
@@ -599,4 +604,15 @@ function getBusinessObject(element) {
599
604
 
600
605
  function isEmptyString(value) {
601
606
  return isString(value) && value.trim() === '';
607
+ }
608
+
609
+ function getNotSupportedMessage(property, allowedVersion) {
610
+
611
+ if (allowedVersion) {
612
+ return property ?
613
+ `${ property } is only supported by Camunda ${ allowedVersion } or newer.` :
614
+ `Only supported by Camunda ${ allowedVersion } or newer.`;
615
+ }
616
+
617
+ return property ? `${ property } is not supported.` : 'Not supported.';
602
618
  }
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@camunda/linting",
3
- "version": "3.20.0",
3
+ "version": "3.21.0",
4
4
  "description": "Linting for Camunda",
5
5
  "main": "index.js",
6
6
  "scripts": {