@platecms/delta-validation 1.7.0 → 1.9.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/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@platecms/delta-validation",
3
- "version": "1.7.0",
3
+ "version": "1.9.0",
4
4
  "description": "This package contains the validation system for Plate.",
5
5
  "license": "UNLICENSED",
6
6
  "publishConfig": {
@@ -17,9 +17,9 @@
17
17
  "src/**/*"
18
18
  ],
19
19
  "peerDependencies": {
20
- "@platecms/delta-cast": "1.7.0",
21
- "@platecms/delta-plate-resource-notation": "1.7.0",
22
- "@platecms/delta-types": "1.7.0",
20
+ "@platecms/delta-cast": "1.9.0",
21
+ "@platecms/delta-plate-resource-notation": "1.9.0",
22
+ "@platecms/delta-types": "1.9.0",
23
23
  "class-transformer": "0.5.1",
24
24
  "reflect-metadata": "0.2.2",
25
25
  "tslib": "2.8.1"
@@ -9,7 +9,7 @@ export class ValidationErrorDetails<TRuleInstance extends RuleInstance<unknown>>
9
9
  public readonly validationRule: TRuleInstance;
10
10
 
11
11
  public constructor(message: string, validationRule: TRuleInstance) {
12
- this.message = message;
12
+ this.message = validationRule.message ?? message;
13
13
  this.validationRule = validationRule;
14
14
  }
15
15
  }
@@ -6,4 +6,5 @@ export interface RuleInstance<TRuleSettings> {
6
6
  prn?: PRN;
7
7
  settings: TRuleSettings;
8
8
  ruleType: RuleType;
9
+ message?: string;
9
10
  }
@@ -15,11 +15,14 @@ export abstract class BaseValidationRule<TSettings> implements RuleInstance<TSet
15
15
 
16
16
  public readonly settings: TSettings;
17
17
 
18
+ public readonly message?: string;
19
+
18
20
  public abstract readonly ruleType: RuleType;
19
21
 
20
- public constructor(prn: PRN, settings: TSettings) {
22
+ public constructor(prn: PRN, settings: TSettings, message?: string) {
21
23
  this.prn = prn;
22
24
  this.settings = settings;
25
+ this.message = message;
23
26
  }
24
27
 
25
28
  /**