@planning-inspectorate/dynamic-forms 3.14.0 → 3.14.1
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 +1 -1
- package/src/validator/address-validator.js +1 -1
- package/src/validator/base-validator.js +1 -1
- package/src/validator/conditional-required-validator.js +1 -1
- package/src/validator/cross-question-validator.js +1 -1
- package/src/validator/date-period-validator.js +1 -5
- package/src/validator/date-time-validator.js +1 -5
- package/src/validator/date-validator.js +1 -5
- package/src/validator/required-validator.js +1 -5
- package/src/validator/unit-option-entry-validator.js +1 -5
- package/types/src/validator/address-validator.d.ts +2 -2
- package/types/src/validator/address-validator.d.ts.map +1 -1
- package/types/src/validator/base-validator.d.ts +4 -2
- package/types/src/validator/base-validator.d.ts.map +1 -1
- package/types/src/validator/conditional-required-validator.d.ts +2 -2
- package/types/src/validator/conditional-required-validator.d.ts.map +1 -1
- package/types/src/validator/cross-question-validator.d.ts +2 -2
- package/types/src/validator/cross-question-validator.d.ts.map +1 -1
- package/types/src/validator/date-period-validator.d.ts +2 -6
- package/types/src/validator/date-period-validator.d.ts.map +1 -1
- package/types/src/validator/date-time-validator.d.ts +2 -6
- package/types/src/validator/date-time-validator.d.ts.map +1 -1
- package/types/src/validator/date-validator.d.ts +2 -6
- package/types/src/validator/date-validator.d.ts.map +1 -1
- package/types/src/validator/required-validator.d.ts +2 -6
- package/types/src/validator/required-validator.d.ts.map +1 -1
- package/types/src/validator/unit-option-entry-validator.d.ts +2 -6
- package/types/src/validator/unit-option-entry-validator.d.ts.map +1 -1
package/package.json
CHANGED
|
@@ -41,7 +41,7 @@ export class AddressValidator extends BaseValidator {
|
|
|
41
41
|
|
|
42
42
|
/**
|
|
43
43
|
* validates response body using questionObj fieldname
|
|
44
|
-
* @param {Question} questionObj
|
|
44
|
+
* @param {import('../questions/question.js').Question} questionObj
|
|
45
45
|
*/
|
|
46
46
|
validate(questionObj) {
|
|
47
47
|
const fieldName = questionObj.fieldName;
|
|
@@ -18,7 +18,7 @@ export class BaseValidator {
|
|
|
18
18
|
* Validates response body against field validators.
|
|
19
19
|
* Subclasses must override this method.
|
|
20
20
|
* @abstract
|
|
21
|
-
* @param {
|
|
21
|
+
* @param {{fieldName: string}} questionObj - The question object containing the fieldName to validate.
|
|
22
22
|
* @param {import('../journey/journey-response.js').JourneyResponse} [journeyResponse] - The current journey response (optional).
|
|
23
23
|
* @returns {import('express-validator').ValidationChain | import('express-validator').ValidationChain[]}
|
|
24
24
|
*/
|
|
@@ -31,7 +31,7 @@ export class ConditionalRequiredValidator extends BaseValidator {
|
|
|
31
31
|
|
|
32
32
|
/**
|
|
33
33
|
* validates the response body, checking the questionObj's fieldname
|
|
34
|
-
* @param {
|
|
34
|
+
* @param {import('../questions/options-question.js').OptionsQuestion} questionObj
|
|
35
35
|
*/
|
|
36
36
|
validate(questionObj) {
|
|
37
37
|
return questionObj.options.reduce((schema, option) => {
|
|
@@ -37,7 +37,7 @@ export class CrossQuestionValidator extends BaseValidator {
|
|
|
37
37
|
|
|
38
38
|
/**
|
|
39
39
|
* Validates response body against individual field validators.
|
|
40
|
-
* @param {import('../questions/question
|
|
40
|
+
* @param {import('../questions/question.js').Question} questionObj - The question object containing the fieldName to validate.
|
|
41
41
|
* @param {import('../journey/journey-response.js').JourneyResponse} [journeyResponse={}] - The current journey response, used to access saved answers for validation.
|
|
42
42
|
* @returns {import('express-validator').ValidationChain[]}
|
|
43
43
|
*/
|
|
@@ -6,10 +6,6 @@ import { enGB } from 'date-fns/locale';
|
|
|
6
6
|
import BaseValidator from './base-validator.js';
|
|
7
7
|
import { parseDateInput, startOfDay } from '../lib/date-utils.js';
|
|
8
8
|
|
|
9
|
-
/**
|
|
10
|
-
* @typedef {import('../components/date/question.js')} DateQuestion
|
|
11
|
-
*/
|
|
12
|
-
|
|
13
9
|
/**
|
|
14
10
|
* @typedef {Object} DateValidationSettings
|
|
15
11
|
* @property {Boolean} ensureFuture
|
|
@@ -64,7 +60,7 @@ export class DatePeriodValidator extends BaseValidator {
|
|
|
64
60
|
|
|
65
61
|
/**
|
|
66
62
|
* validates the response body, checking the values sent for the date are valid
|
|
67
|
-
* @param {DateQuestion} questionObj
|
|
63
|
+
* @param {import('../components/date/question.js').DateQuestion} questionObj
|
|
68
64
|
*/
|
|
69
65
|
validate(questionObj) {
|
|
70
66
|
const fieldName = questionObj.fieldName;
|
|
@@ -1,10 +1,6 @@
|
|
|
1
1
|
import { body } from 'express-validator';
|
|
2
2
|
import DateValidator from './date-validator.js';
|
|
3
3
|
|
|
4
|
-
/**
|
|
5
|
-
* @typedef {import('./question.js')} DateTimeQuestion
|
|
6
|
-
*/
|
|
7
|
-
|
|
8
4
|
/**
|
|
9
5
|
* enforces a user has entered a valid date
|
|
10
6
|
* @class
|
|
@@ -32,7 +28,7 @@ export class DateTimeValidator extends DateValidator {
|
|
|
32
28
|
|
|
33
29
|
/**
|
|
34
30
|
* validates the response body, checking the values sent for the date are valid
|
|
35
|
-
* @param {DateTimeQuestion} questionObj
|
|
31
|
+
* @param {import('../components/date-time/question.js').DateTimeQuestion} questionObj
|
|
36
32
|
*/
|
|
37
33
|
validate(questionObj) {
|
|
38
34
|
const fieldName = questionObj.fieldName;
|
|
@@ -5,10 +5,6 @@ import { enGB } from 'date-fns/locale';
|
|
|
5
5
|
import BaseValidator from './base-validator.js';
|
|
6
6
|
import { endOfDay, parseDateInput, startOfDay } from '../lib/date-utils.js';
|
|
7
7
|
|
|
8
|
-
/**
|
|
9
|
-
* @typedef {import('../components/date/question.js')} DateQuestion
|
|
10
|
-
*/
|
|
11
|
-
|
|
12
8
|
/**
|
|
13
9
|
* @typedef {Object} DateValidationSettings
|
|
14
10
|
* @property {Boolean} [ensureFuture]
|
|
@@ -69,7 +65,7 @@ export class DateValidator extends BaseValidator {
|
|
|
69
65
|
|
|
70
66
|
/**
|
|
71
67
|
* validates the response body, checking the values sent for the date are valid
|
|
72
|
-
* @param {DateQuestion} questionObj
|
|
68
|
+
* @param {import('../components/date/question.js').DateQuestion} questionObj
|
|
73
69
|
*/
|
|
74
70
|
validate(questionObj) {
|
|
75
71
|
const fieldName = questionObj.fieldName;
|
|
@@ -2,10 +2,6 @@ import { body } from 'express-validator';
|
|
|
2
2
|
|
|
3
3
|
import BaseValidator from './base-validator.js';
|
|
4
4
|
|
|
5
|
-
/**
|
|
6
|
-
* @typedef {import('../questions/question.js')} Question
|
|
7
|
-
*/
|
|
8
|
-
|
|
9
5
|
/**
|
|
10
6
|
* enforces a field is not empty
|
|
11
7
|
* @class
|
|
@@ -30,7 +26,7 @@ export class RequiredValidator extends BaseValidator {
|
|
|
30
26
|
|
|
31
27
|
/**
|
|
32
28
|
* validates the response body, checking the questionObj's fieldname
|
|
33
|
-
* @param {Question} questionObj
|
|
29
|
+
* @param {import('../questions/question.js').Question} questionObj
|
|
34
30
|
*/
|
|
35
31
|
validate(questionObj) {
|
|
36
32
|
return body(questionObj.fieldName).notEmpty().withMessage(this.errorMessage);
|
|
@@ -3,10 +3,6 @@ import { body } from 'express-validator';
|
|
|
3
3
|
import BaseValidator from './base-validator.js';
|
|
4
4
|
import { toArray } from '#src/lib/utils.js';
|
|
5
5
|
|
|
6
|
-
/**
|
|
7
|
-
* @typedef {import('../questions/question.js')} Question
|
|
8
|
-
*/
|
|
9
|
-
|
|
10
6
|
/**
|
|
11
7
|
* enforces a field is not empty when condition is satisfied
|
|
12
8
|
* @class
|
|
@@ -34,7 +30,7 @@ export class UnitOptionEntryValidator extends BaseValidator {
|
|
|
34
30
|
|
|
35
31
|
/**
|
|
36
32
|
* validates the response body, checking the questionObj's fieldname
|
|
37
|
-
* @param {
|
|
33
|
+
* @param {import('../components/unit-option-entry/question.js').UnitOptionEntryQuestion} questionObj
|
|
38
34
|
*/
|
|
39
35
|
validate(questionObj) {
|
|
40
36
|
return questionObj.options.reduce((schema, option) => {
|
|
@@ -37,9 +37,9 @@ export class AddressValidator extends BaseValidator {
|
|
|
37
37
|
} | undefined;
|
|
38
38
|
/**
|
|
39
39
|
* validates response body using questionObj fieldname
|
|
40
|
-
* @param {Question} questionObj
|
|
40
|
+
* @param {import('../questions/question.js').Question} questionObj
|
|
41
41
|
*/
|
|
42
|
-
validate(questionObj: Question): import("express-validator").ValidationChain[];
|
|
42
|
+
validate(questionObj: import("../questions/question.js").Question): import("express-validator").ValidationChain[];
|
|
43
43
|
#private;
|
|
44
44
|
}
|
|
45
45
|
export default AddressValidator;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"address-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/address-validator.js"],"names":[],"mappings":"AAIO,4EAQN;AAGD,oCAAqC,GAAG,CAAC;AACzC,oCAAqC,CAAC,CAAC;AACvC,oCAAqC,GAAG,CAAC;AACzC,oCAAqC,CAAC,CAAC;AACvC,gCAAiC,GAAG,CAAC;AACrC,gCAAiC,CAAC,CAAC;AACnC,8BAA+B,GAAG,CAAC;AACnC,8BAA+B,CAAC,CAAC;AACjC,gCAAiC,CAAC,CAAC;AACnC,gCAAiC,CAAC,CAAC;AAEnC;;;GAGG;AACH;IACC;;;;OAIG;IACH,mBAFG;QAAqH,cAAc;0BAA5G,OAAO;0BAAgB,OAAO;sBAAY,OAAO;oBAAU,OAAO;sBAAY,OAAO;;KAAwB,EAKtI;IADA;sBAJyB,OAAO;sBAAgB,OAAO;kBAAY,OAAO;gBAAU,OAAO;kBAAY,OAAO;kBAIpE;IAG3C;;;OAGG;IACH,sBAFW,QAAQ,
|
|
1
|
+
{"version":3,"file":"address-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/address-validator.js"],"names":[],"mappings":"AAIO,4EAQN;AAGD,oCAAqC,GAAG,CAAC;AACzC,oCAAqC,CAAC,CAAC;AACvC,oCAAqC,GAAG,CAAC;AACzC,oCAAqC,CAAC,CAAC;AACvC,gCAAiC,GAAG,CAAC;AACrC,gCAAiC,CAAC,CAAC;AACnC,8BAA+B,GAAG,CAAC;AACnC,8BAA+B,CAAC,CAAC;AACjC,gCAAiC,CAAC,CAAC;AACnC,gCAAiC,CAAC,CAAC;AAEnC;;;GAGG;AACH;IACC;;;;OAIG;IACH,mBAFG;QAAqH,cAAc;0BAA5G,OAAO;0BAAgB,OAAO;sBAAY,OAAO;oBAAU,OAAO;sBAAY,OAAO;;KAAwB,EAKtI;IADA;sBAJyB,OAAO;sBAAgB,OAAO;kBAAY,OAAO;gBAAU,OAAO;kBAAY,OAAO;kBAIpE;IAG3C;;;OAGG;IACH,sBAFW,OAAO,0BAA0B,EAAE,QAAQ,iDAYrD;;CAqGD;;0BA1JyB,qBAAqB"}
|
|
@@ -11,11 +11,13 @@ export class BaseValidator {
|
|
|
11
11
|
* Validates response body against field validators.
|
|
12
12
|
* Subclasses must override this method.
|
|
13
13
|
* @abstract
|
|
14
|
-
* @param {
|
|
14
|
+
* @param {{fieldName: string}} questionObj - The question object containing the fieldName to validate.
|
|
15
15
|
* @param {import('../journey/journey-response.js').JourneyResponse} [journeyResponse] - The current journey response (optional).
|
|
16
16
|
* @returns {import('express-validator').ValidationChain | import('express-validator').ValidationChain[]}
|
|
17
17
|
*/
|
|
18
|
-
validate(questionObj:
|
|
18
|
+
validate(questionObj: {
|
|
19
|
+
fieldName: string;
|
|
20
|
+
}, journeyResponse?: import("../journey/journey-response.js").JourneyResponse): import("express-validator").ValidationChain | import("express-validator").ValidationChain[];
|
|
19
21
|
/**
|
|
20
22
|
* Should the question that this validator is configured with be treated as a required question?
|
|
21
23
|
*
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"base-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/base-validator.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;IACC;;OAEG;IACH,cAFU,MAAM,CAEH;IAQb;;;;;;;OAOG;IAEH,sBALW,
|
|
1
|
+
{"version":3,"file":"base-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/base-validator.js"],"names":[],"mappings":"AAAA;;;GAGG;AACH;IACC;;OAEG;IACH,cAFU,MAAM,CAEH;IAQb;;;;;;;OAOG;IAEH,sBALW;QAAC,SAAS,EAAE,MAAM,CAAA;KAAC,oBACnB,OAAO,gCAAgC,EAAE,eAAe,GACtD,OAAO,mBAAmB,EAAE,eAAe,GAAG,OAAO,mBAAmB,EAAE,eAAe,EAAE,CAKvG;IAED;;;;;OAKG;IACH,sBAEC;CACD"}
|
|
@@ -13,9 +13,9 @@ export class ConditionalRequiredValidator extends BaseValidator {
|
|
|
13
13
|
constructor(errorMessage?: string);
|
|
14
14
|
/**
|
|
15
15
|
* validates the response body, checking the questionObj's fieldname
|
|
16
|
-
* @param {
|
|
16
|
+
* @param {import('../questions/options-question.js').OptionsQuestion} questionObj
|
|
17
17
|
*/
|
|
18
|
-
validate(questionObj:
|
|
18
|
+
validate(questionObj: import("../questions/options-question.js").OptionsQuestion): never[];
|
|
19
19
|
getConditionalFieldName(questionObj: any, option: any): string;
|
|
20
20
|
isValueIncluded(questionObj: any, value: any): import("express-validator").ValidationChain;
|
|
21
21
|
}
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"conditional-required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/conditional-required-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IAMC;;;OAGG;IACH,2BAFW,MAAM,EAQhB;IAED;;;OAGG;IACH,sBAFW,
|
|
1
|
+
{"version":3,"file":"conditional-required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/conditional-required-validator.js"],"names":[],"mappings":"AAKA;;GAEG;AAEH;;;GAGG;AACH;IAMC;;;OAGG;IACH,2BAFW,MAAM,EAQhB;IAED;;;OAGG;IACH,sBAFW,OAAO,kCAAkC,EAAE,eAAe,WAcpE;IAED,+DAEC;IAED,2FAKC;CACD;;;0BAzDyB,qBAAqB"}
|
|
@@ -23,11 +23,11 @@ export class CrossQuestionValidator extends BaseValidator {
|
|
|
23
23
|
useBodyValues: boolean;
|
|
24
24
|
/**
|
|
25
25
|
* Validates response body against individual field validators.
|
|
26
|
-
* @param {import('../questions/question
|
|
26
|
+
* @param {import('../questions/question.js').Question} questionObj - The question object containing the fieldName to validate.
|
|
27
27
|
* @param {import('../journey/journey-response.js').JourneyResponse} [journeyResponse={}] - The current journey response, used to access saved answers for validation.
|
|
28
28
|
* @returns {import('express-validator').ValidationChain[]}
|
|
29
29
|
*/
|
|
30
|
-
validate(questionObj: import("../questions/question
|
|
30
|
+
validate(questionObj: import("../questions/question.js").Question, journeyResponse?: import("../journey/journey-response.js").JourneyResponse): import("express-validator").ValidationChain[];
|
|
31
31
|
}
|
|
32
32
|
export default CrossQuestionValidator;
|
|
33
33
|
import BaseValidator from './base-validator.js';
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"cross-question-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/cross-question-validator.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAQC;;;;;;;OAOG;IACH,yEANG;QAAuB,mBAAmB,EAAlC,MAAM;QACyE,kBAAkB,EAAjG,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,KAAK,OAAO,CAAC,GAAE,IAAI;QACrD,aAAa;KACtC,EAgBF;IA5BD,qBAAqB;IACrB,qBADW,MAAM,CACG;IACpB,+EAA+E;IAC/E,oBADW,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,KAAK,OAAO,CAAC,CACxD;IACnB,sBAAsB;IACtB,eADW,OAAO,CACJ;IAyBd;;;;;OAKG;IACH,sBAJW,OAAO,
|
|
1
|
+
{"version":3,"file":"cross-question-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/cross-question-validator.js"],"names":[],"mappings":"AAGA;;GAEG;AACH;IAQC;;;;;;;OAOG;IACH,yEANG;QAAuB,mBAAmB,EAAlC,MAAM;QACyE,kBAAkB,EAAjG,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,KAAK,OAAO,CAAC,GAAE,IAAI;QACrD,aAAa;KACtC,EAgBF;IA5BD,qBAAqB;IACrB,qBADW,MAAM,CACG;IACpB,+EAA+E;IAC/E,oBADW,CAAC,CAAC,aAAa,EAAE,OAAO,EAAE,gBAAgB,EAAE,OAAO,KAAK,OAAO,CAAC,CACxD;IACnB,sBAAsB;IACtB,eADW,OAAO,CACJ;IAyBd;;;;;OAKG;IACH,sBAJW,OAAO,0BAA0B,EAAE,QAAQ,oBAC3C,OAAO,gCAAgC,EAAE,eAAe,GACtD,OAAO,mBAAmB,EAAE,eAAe,EAAE,CAqBzD;CACD;;0BA/DyB,qBAAqB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../components/date/question.js')} DateQuestion
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* @typedef {Object} DateValidationSettings
|
|
6
3
|
* @property {Boolean} ensureFuture
|
|
@@ -34,9 +31,9 @@ export class DatePeriodValidator extends BaseValidator {
|
|
|
34
31
|
pastDateErrorMessage: any;
|
|
35
32
|
/**
|
|
36
33
|
* validates the response body, checking the values sent for the date are valid
|
|
37
|
-
* @param {DateQuestion} questionObj
|
|
34
|
+
* @param {import('../components/date/question.js').DateQuestion} questionObj
|
|
38
35
|
*/
|
|
39
|
-
validate(questionObj: DateQuestion): import("express-validator").ValidationChain[];
|
|
36
|
+
validate(questionObj: import("../components/date/question.js").DateQuestion): import("express-validator").ValidationChain[];
|
|
40
37
|
rulesForNotEmptyInput({ dayInput, monthInput, yearInput }: {
|
|
41
38
|
dayInput: any;
|
|
42
39
|
monthInput: any;
|
|
@@ -55,7 +52,6 @@ export class DatePeriodValidator extends BaseValidator {
|
|
|
55
52
|
#private;
|
|
56
53
|
}
|
|
57
54
|
export default DatePeriodValidator;
|
|
58
|
-
export type DateQuestion = typeof import("../components/date/question.js");
|
|
59
55
|
export type DateValidationSettings = {
|
|
60
56
|
ensureFuture: boolean;
|
|
61
57
|
ensurePast: boolean;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-period-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-period-validator.js"],"names":[],"mappings":"AAQA
|
|
1
|
+
{"version":3,"file":"date-period-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-period-validator.js"],"names":[],"mappings":"AAQA;;;;GAIG;AAEH;;;GAGG;AACH;IAIC;;;;;OAKG;IACH,wBAJW,MAAM,2BACN,sBAAsB,kBACtB,MAAM,EAgChB;IAvCD,qCAAqC;IACrC,wBADW,sBAAsB,CACV;IAoBtB,uBAAmG;IACnG,uBAAmG;IACnG,yBAAyG;IACzG,wBAAsG;IACtG,4BAAkH;IAClH,2BAA+G;IAC/G,6BACuF;IACvF,6BACuF;IACvF,8BACyF;IACzF,6BACuF;IACvF,4BAAkH;IAClH,0BAA4G;IAK7G;;;OAGG;IACH,sBAFW,OAAO,gCAAgC,EAAE,YAAY,iDAsB/D;IAED;;;;sDAuCC;IAED;;;;sDAwBC;IAED;;;;sDAuBC;;CA6BD;;;;;;0BAxMyB,qBAAqB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('./question.js')} DateTimeQuestion
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* enforces a user has entered a valid date
|
|
6
3
|
* @class
|
|
@@ -17,11 +14,10 @@ export class DateTimeValidator extends DateValidator {
|
|
|
17
14
|
timeInputLabel: string;
|
|
18
15
|
/**
|
|
19
16
|
* validates the response body, checking the values sent for the date are valid
|
|
20
|
-
* @param {DateTimeQuestion} questionObj
|
|
17
|
+
* @param {import('../components/date-time/question.js').DateTimeQuestion} questionObj
|
|
21
18
|
*/
|
|
22
|
-
validate(questionObj: DateTimeQuestion): import("express-validator").ValidationChain[];
|
|
19
|
+
validate(questionObj: import("../components/date-time/question.js").DateTimeQuestion): import("express-validator").ValidationChain[];
|
|
23
20
|
}
|
|
24
21
|
export default DateTimeValidator;
|
|
25
|
-
export type DateTimeQuestion = any;
|
|
26
22
|
import DateValidator from './date-validator.js';
|
|
27
23
|
//# sourceMappingURL=date-time-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-time-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-time-validator.js"],"names":[],"mappings":"AAGA
|
|
1
|
+
{"version":3,"file":"date-time-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-time-validator.js"],"names":[],"mappings":"AAGA;;;GAGG;AACH;IACC;;;;;;OAMG;IACH,4BALW,MAAM,mBACN,MAAM,2BACN,sBAAsB,sBACtB,MAAM,EAahB;IADA,uBAAoC;IAGrC;;;OAGG;IACH,sBAFW,OAAO,qCAAqC,EAAE,gBAAgB,iDAsCxE;CACD;;0BApEyB,qBAAqB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../components/date/question.js')} DateQuestion
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* @typedef {Object} DateValidationSettings
|
|
6
3
|
* @property {Boolean} [ensureFuture]
|
|
@@ -35,13 +32,12 @@ export class DateValidator extends BaseValidator {
|
|
|
35
32
|
pastDateErrorMessage: any;
|
|
36
33
|
/**
|
|
37
34
|
* validates the response body, checking the values sent for the date are valid
|
|
38
|
-
* @param {DateQuestion} questionObj
|
|
35
|
+
* @param {import('../components/date/question.js').DateQuestion} questionObj
|
|
39
36
|
*/
|
|
40
|
-
validate(questionObj: DateQuestion): import("express-validator").ValidationChain[];
|
|
37
|
+
validate(questionObj: import("../components/date/question.js").DateQuestion): import("express-validator").ValidationChain[];
|
|
41
38
|
#private;
|
|
42
39
|
}
|
|
43
40
|
export default DateValidator;
|
|
44
|
-
export type DateQuestion = typeof import("../components/date/question.js");
|
|
45
41
|
export type DateValidationSettings = {
|
|
46
42
|
ensureFuture?: boolean | undefined;
|
|
47
43
|
ensurePast?: boolean | undefined;
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"date-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-validator.js"],"names":[],"mappings":"AAOA
|
|
1
|
+
{"version":3,"file":"date-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/date-validator.js"],"names":[],"mappings":"AAOA;;;;;GAKG;AAEH;;;GAGG;AACH;IAIC;;;;;OAKG;IACH,wBAJW,MAAM,2BACN,sBAAsB,kBACtB,MAAM,EAiChB;IAxCD,qCAAqC;IACrC,wBADW,sBAAsB,CACV;IAqBtB,uBAAmG;IACnG,uBAAmG;IACnG,yBAAyG;IACzG,wBAAsG;IACtG,4BAAkH;IAClH,2BAA+G;IAC/G,6BACuF;IACvF,6BACuF;IACvF,8BACyF;IACzF,6BACuF;IACvF,4BAAkH;IAClH,0BAA4G;IAS7G;;;OAGG;IACH,sBAFW,OAAO,gCAAgC,EAAE,YAAY,iDA0H/D;;CA6BD;;;;;;;0BAtNyB,qBAAqB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../questions/question.js')} Question
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* enforces a field is not empty
|
|
6
3
|
* @class
|
|
@@ -13,11 +10,10 @@ export class RequiredValidator extends BaseValidator {
|
|
|
13
10
|
constructor(errorMessage?: string);
|
|
14
11
|
/**
|
|
15
12
|
* validates the response body, checking the questionObj's fieldname
|
|
16
|
-
* @param {Question} questionObj
|
|
13
|
+
* @param {import('../questions/question.js').Question} questionObj
|
|
17
14
|
*/
|
|
18
|
-
validate(questionObj: Question): import("express-validator").ValidationChain;
|
|
15
|
+
validate(questionObj: import("../questions/question.js").Question): import("express-validator").ValidationChain;
|
|
19
16
|
}
|
|
20
17
|
export default RequiredValidator;
|
|
21
|
-
export type Question = typeof import("../questions/question.js");
|
|
22
18
|
import BaseValidator from './base-validator.js';
|
|
23
19
|
//# sourceMappingURL=required-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/required-validator.js"],"names":[],"mappings":"AAIA
|
|
1
|
+
{"version":3,"file":"required-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/required-validator.js"],"names":[],"mappings":"AAIA;;;GAGG;AACH;IAMC;;;OAGG;IACH,2BAFW,MAAM,EAQhB;IAED;;;OAGG;IACH,sBAFW,OAAO,0BAA0B,EAAE,QAAQ,+CAIrD;CAKD;;0BAnCyB,qBAAqB"}
|
|
@@ -1,6 +1,3 @@
|
|
|
1
|
-
/**
|
|
2
|
-
* @typedef {import('../questions/question.js')} Question
|
|
3
|
-
*/
|
|
4
1
|
/**
|
|
5
2
|
* enforces a field is not empty when condition is satisfied
|
|
6
3
|
* @class
|
|
@@ -30,12 +27,11 @@ export class UnitOptionEntryValidator extends BaseValidator {
|
|
|
30
27
|
regexMessage: string;
|
|
31
28
|
/**
|
|
32
29
|
* validates the response body, checking the questionObj's fieldname
|
|
33
|
-
* @param {
|
|
30
|
+
* @param {import('../components/unit-option-entry/question.js').UnitOptionEntryQuestion} questionObj
|
|
34
31
|
*/
|
|
35
|
-
validate(questionObj:
|
|
32
|
+
validate(questionObj: import("../components/unit-option-entry/question.js").UnitOptionEntryQuestion): never[];
|
|
36
33
|
isValueIncluded(questionObj: any, value: any): import("express-validator").ValidationChain;
|
|
37
34
|
}
|
|
38
35
|
export default UnitOptionEntryValidator;
|
|
39
|
-
export type Question = typeof import("../questions/question.js");
|
|
40
36
|
import BaseValidator from './base-validator.js';
|
|
41
37
|
//# sourceMappingURL=unit-option-entry-validator.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"unit-option-entry-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/unit-option-entry-validator.js"],"names":[],"mappings":"AAKA
|
|
1
|
+
{"version":3,"file":"unit-option-entry-validator.d.ts","sourceRoot":"","sources":["../../../src/validator/unit-option-entry-validator.js"],"names":[],"mappings":"AAKA;;;GAGG;AACH;IACC;;;;;;;;OAQG;IAEH,oEARG;QAAwB,YAAY;QACZ,IAAI;QACJ,GAAG;QACH,GAAG;QACJ,KAAK;QACJ,YAAY;KAAC,EAWvC;IALA,aAA2B;IAC3B,wBAAc;IACd,wBAAc;IACd,WAAkB;IAClB,qBAA0D;IAG3D;;;OAGG;IACH,sBAFW,OAAO,6CAA6C,EAAE,uBAAuB,WA4CvF;IAED,2FAKC;CACD;;0BAlFyB,qBAAqB"}
|