@activepieces/pieces-framework 0.6.17 → 0.6.18
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 +3 -2
- package/src/lib/validators/errors.d.ts +6 -0
- package/src/lib/validators/errors.js +6 -0
- package/src/lib/validators/errors.js.map +1 -1
- package/src/lib/validators/types.d.ts +1 -1
- package/src/lib/validators/types.js.map +1 -1
- package/src/lib/validators/validators.d.ts +10 -3
- package/src/lib/validators/validators.js +153 -35
- package/src/lib/validators/validators.js.map +1 -1
package/package.json
CHANGED
|
@@ -1,15 +1,16 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-framework",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.18",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@sinclair/typebox": "^0.26.3",
|
|
7
7
|
"axios": "1.4.0",
|
|
8
8
|
"dayjs": "^1.11.8",
|
|
9
9
|
"is-base64": "^1.1.0",
|
|
10
|
+
"lodash": "4.17.21",
|
|
10
11
|
"nanoid": "^3.3.4",
|
|
11
12
|
"semver": "7.5.4",
|
|
12
|
-
"@activepieces/shared": "0.8.
|
|
13
|
+
"@activepieces/shared": "0.8.3",
|
|
13
14
|
"tslib": "2.6.1"
|
|
14
15
|
},
|
|
15
16
|
"main": "./src/index.js",
|
|
@@ -4,14 +4,20 @@ export declare enum ErrorMessages {
|
|
|
4
4
|
ISO_DATE = "Expected ISO string, but found value: {userInput}",
|
|
5
5
|
FILE = "Expected file url or base64 with mimeType, but found value: {userInput}",
|
|
6
6
|
NUMBER = "Expected number, but found value: {userInput}",
|
|
7
|
+
WHOLE_NUMBER = "Expected whole number, but found value: {userInput}",
|
|
7
8
|
MAX_LENGTH = "The value: {userInput} may not be greater than {length} characters",
|
|
8
9
|
MIN_LENGTH = "The value: {userInput} must be at least {length} characters",
|
|
9
10
|
MAX = "The value: {userInput} must be {max} or less",
|
|
10
11
|
MIN = "The value: {userInput} must be {min} or more",
|
|
12
|
+
MIN_DATE = "The date {userInput} must be after {min}",
|
|
13
|
+
MAX_DATE = "The date {userInput} must be before {max}",
|
|
11
14
|
IN_RANGE = "The value: {userInput} must be at least {min} and less than or equal {max}",
|
|
15
|
+
IN_DATE_RANGE = "The date {userInput} must be between {min} and {max}",
|
|
12
16
|
URL = "The value: {userInput} is not a valid URL",
|
|
13
17
|
REGEX = "The value: {userInput} format is invalid",
|
|
18
|
+
PROHIBIT_REGEX = "The value: {userInput} is not allowed",
|
|
14
19
|
IMAGE = "The {property} value must be an image",
|
|
15
20
|
ONE_OF = "The {userInput} is not a valid value, valid choices are: {choices}",
|
|
21
|
+
REQUIRE_KEYS = "The following keys are required: {keys}",
|
|
16
22
|
SIZE = "The {property} size must be less than 0:{size}KB"
|
|
17
23
|
}
|
|
@@ -8,15 +8,21 @@ var ErrorMessages;
|
|
|
8
8
|
ErrorMessages["ISO_DATE"] = "Expected ISO string, but found value: {userInput}";
|
|
9
9
|
ErrorMessages["FILE"] = "Expected file url or base64 with mimeType, but found value: {userInput}";
|
|
10
10
|
ErrorMessages["NUMBER"] = "Expected number, but found value: {userInput}";
|
|
11
|
+
ErrorMessages["WHOLE_NUMBER"] = "Expected whole number, but found value: {userInput}";
|
|
11
12
|
ErrorMessages["MAX_LENGTH"] = "The value: {userInput} may not be greater than {length} characters";
|
|
12
13
|
ErrorMessages["MIN_LENGTH"] = "The value: {userInput} must be at least {length} characters";
|
|
13
14
|
ErrorMessages["MAX"] = "The value: {userInput} must be {max} or less";
|
|
14
15
|
ErrorMessages["MIN"] = "The value: {userInput} must be {min} or more";
|
|
16
|
+
ErrorMessages["MIN_DATE"] = "The date {userInput} must be after {min}";
|
|
17
|
+
ErrorMessages["MAX_DATE"] = "The date {userInput} must be before {max}";
|
|
15
18
|
ErrorMessages["IN_RANGE"] = "The value: {userInput} must be at least {min} and less than or equal {max}";
|
|
19
|
+
ErrorMessages["IN_DATE_RANGE"] = "The date {userInput} must be between {min} and {max}";
|
|
16
20
|
ErrorMessages["URL"] = "The value: {userInput} is not a valid URL";
|
|
17
21
|
ErrorMessages["REGEX"] = "The value: {userInput} format is invalid";
|
|
22
|
+
ErrorMessages["PROHIBIT_REGEX"] = "The value: {userInput} is not allowed";
|
|
18
23
|
ErrorMessages["IMAGE"] = "The {property} value must be an image";
|
|
19
24
|
ErrorMessages["ONE_OF"] = "The {userInput} is not a valid value, valid choices are: {choices}";
|
|
25
|
+
ErrorMessages["REQUIRE_KEYS"] = "The following keys are required: {keys}";
|
|
20
26
|
ErrorMessages["SIZE"] = "The {property} size must be less than 0:{size}KB";
|
|
21
27
|
})(ErrorMessages || (exports.ErrorMessages = ErrorMessages = {}));
|
|
22
28
|
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/errors.ts"],"names":[],"mappings":";;;AAAA,IAAY,
|
|
1
|
+
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/errors.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAsBX;AAtBD,WAAY,aAAa;IACvB,0EAAyD,CAAA;IACzD,4DAA2C,CAAA;IAC3C,+EAA8D,CAAA;IAC9D,iGAAgF,CAAA;IAChF,yEAAwD,CAAA;IACxD,qFAAoE,CAAA;IACpE,kGAAiF,CAAA;IACjF,2FAA0E,CAAA;IAC1E,qEAAoD,CAAA;IACpD,qEAAoD,CAAA;IACpD,sEAAqD,CAAA;IACrD,uEAAsD,CAAA;IACtD,wGAAuF,CAAA;IACvF,uFAAsE,CAAA;IACtE,kEAAiD,CAAA;IACjD,mEAAkD,CAAA;IAClD,yEAAwD,CAAA;IACxD,gEAA+C,CAAA;IAC/C,8FAA6E,CAAA;IAC7E,yEAAwD,CAAA;IACxD,0EAAyD,CAAA;AAC3D,CAAC,EAtBW,aAAa,6BAAb,aAAa,QAsBxB"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import { PieceProperty } from
|
|
1
|
+
import { PieceProperty } from '../property';
|
|
2
2
|
export type ValidationErrors = Record<string, string[] | Record<string, string[]>>;
|
|
3
3
|
export type ValidatorFn = (property: PieceProperty, processedValue: any, userInput: any) => string | null;
|
|
4
4
|
export declare enum ValidationInputType {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/types.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/types.ts"],"names":[],"mappings":";;;AAaA,IAAY,mBASX;AATD,WAAY,mBAAmB;IAC7B,wCAAiB,CAAA;IACjB,wCAAiB,CAAA;IACjB,oCAAa,CAAA;IACb,kCAAW,CAAA;IACX,8CAAuB,CAAA;IACvB,wCAAiB,CAAA;IACjB,sCAAe,CAAA;IACf,oCAAa,CAAA;AACf,CAAC,EATW,mBAAmB,mCAAnB,mBAAmB,QAS9B"}
|
|
@@ -1,19 +1,26 @@
|
|
|
1
1
|
import { ErrorMessages } from './errors';
|
|
2
|
-
import { ValidationErrors, TypedValidatorFn, ValidationInputType } from
|
|
3
|
-
import { formatErrorMessage } from
|
|
2
|
+
import { ValidationErrors, TypedValidatorFn, ValidationInputType } from './types';
|
|
3
|
+
import { formatErrorMessage } from './utils';
|
|
4
|
+
import { OpUnitType } from 'dayjs';
|
|
4
5
|
declare class Validators {
|
|
5
6
|
static pattern(regex: string | RegExp): TypedValidatorFn<ValidationInputType.STRING>;
|
|
7
|
+
static prohibitPattern(regex: string | RegExp): TypedValidatorFn<ValidationInputType.STRING>;
|
|
6
8
|
static maxLength(max: number): TypedValidatorFn<ValidationInputType.STRING>;
|
|
7
9
|
static minLength(min: number): TypedValidatorFn<ValidationInputType.STRING>;
|
|
8
10
|
static minValue(min: number): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
9
11
|
static maxValue(max: number): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
12
|
+
static minDate(min: string, unit?: OpUnitType, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.DATE_TIME>;
|
|
13
|
+
static maxDate(max: string, unit?: OpUnitType, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.DATE_TIME>;
|
|
10
14
|
static inRange(min: number, max: number): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
15
|
+
static inDateRange(min: string, max: string, unit?: OpUnitType, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.DATE_TIME>;
|
|
11
16
|
static number: TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
17
|
+
static integer: TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
12
18
|
static image: TypedValidatorFn<ValidationInputType.FILE>;
|
|
13
19
|
static email: TypedValidatorFn<ValidationInputType.STRING>;
|
|
14
20
|
static url: TypedValidatorFn<ValidationInputType.STRING>;
|
|
15
21
|
static datetimeIso: TypedValidatorFn<ValidationInputType.DATE_TIME>;
|
|
16
22
|
static file: TypedValidatorFn<ValidationInputType.FILE>;
|
|
17
23
|
static oneOf(values: unknown[]): TypedValidatorFn<any>;
|
|
24
|
+
static requireKeys(values: string[]): TypedValidatorFn<ValidationInputType.OBJECT>;
|
|
18
25
|
}
|
|
19
|
-
export { Validators, ErrorMessages, ValidationErrors, formatErrorMessage
|
|
26
|
+
export { Validators, ErrorMessages, ValidationErrors, formatErrorMessage };
|
|
@@ -1,59 +1,80 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.formatErrorMessage = exports.ErrorMessages = exports.Validators = void 0;
|
|
4
|
-
const
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
5
|
+
const lodash_1 = require("lodash");
|
|
5
6
|
const errors_1 = require("./errors");
|
|
6
7
|
Object.defineProperty(exports, "ErrorMessages", { enumerable: true, get: function () { return errors_1.ErrorMessages; } });
|
|
7
8
|
const types_1 = require("./types");
|
|
8
9
|
const utils_1 = require("./utils");
|
|
9
10
|
Object.defineProperty(exports, "formatErrorMessage", { enumerable: true, get: function () { return utils_1.formatErrorMessage; } });
|
|
11
|
+
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
10
12
|
class Validators {
|
|
11
13
|
static pattern(regex) {
|
|
12
14
|
return {
|
|
13
15
|
type: types_1.ValidationInputType.STRING,
|
|
14
16
|
fn: (property, processedValue, userInput) => {
|
|
15
|
-
if ((0,
|
|
17
|
+
if ((0, lodash_1.isEmpty)(processedValue))
|
|
16
18
|
return null;
|
|
17
19
|
if (typeof regex === 'string') {
|
|
18
20
|
regex = new RegExp(regex);
|
|
19
21
|
}
|
|
20
22
|
return regex.test(String(processedValue))
|
|
21
23
|
? null
|
|
22
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.REGEX, {
|
|
23
|
-
|
|
24
|
+
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.REGEX, {
|
|
25
|
+
property: property === null || property === void 0 ? void 0 : property.displayName,
|
|
26
|
+
});
|
|
27
|
+
},
|
|
28
|
+
};
|
|
29
|
+
}
|
|
30
|
+
static prohibitPattern(regex) {
|
|
31
|
+
return {
|
|
32
|
+
type: types_1.ValidationInputType.STRING,
|
|
33
|
+
fn: (property, processedValue, userInput) => {
|
|
34
|
+
const patternValidator = Validators.pattern(regex);
|
|
35
|
+
const patternError = patternValidator.fn(property, processedValue, userInput);
|
|
36
|
+
return patternError
|
|
37
|
+
? null
|
|
38
|
+
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.PROHIBIT_REGEX, {
|
|
39
|
+
property: property.displayName,
|
|
40
|
+
});
|
|
41
|
+
},
|
|
24
42
|
};
|
|
25
43
|
}
|
|
26
|
-
;
|
|
27
44
|
static maxLength(max) {
|
|
28
45
|
return {
|
|
29
46
|
type: types_1.ValidationInputType.STRING,
|
|
30
47
|
fn: (property, processedValue, userInput) => {
|
|
31
|
-
if ((0,
|
|
48
|
+
if ((0, lodash_1.isEmpty)(processedValue))
|
|
32
49
|
return null;
|
|
33
50
|
const isValid = processedValue.length <= max;
|
|
34
51
|
if (!isValid) {
|
|
35
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX_LENGTH, {
|
|
52
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX_LENGTH, {
|
|
53
|
+
userInput,
|
|
54
|
+
length: max.toString(),
|
|
55
|
+
});
|
|
36
56
|
}
|
|
37
57
|
return null;
|
|
38
|
-
}
|
|
58
|
+
},
|
|
39
59
|
};
|
|
40
60
|
}
|
|
41
|
-
;
|
|
42
61
|
static minLength(min) {
|
|
43
62
|
return {
|
|
44
63
|
type: types_1.ValidationInputType.STRING,
|
|
45
64
|
fn: (property, processedValue, userInput) => {
|
|
46
|
-
if ((0,
|
|
65
|
+
if ((0, lodash_1.isEmpty)(processedValue))
|
|
47
66
|
return null;
|
|
48
67
|
const isValid = processedValue.length >= min;
|
|
49
68
|
if (!isValid) {
|
|
50
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN_LENGTH, {
|
|
69
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN_LENGTH, {
|
|
70
|
+
userInput,
|
|
71
|
+
length: min.toString(),
|
|
72
|
+
});
|
|
51
73
|
}
|
|
52
74
|
return null;
|
|
53
|
-
}
|
|
75
|
+
},
|
|
54
76
|
};
|
|
55
77
|
}
|
|
56
|
-
;
|
|
57
78
|
static minValue(min) {
|
|
58
79
|
return {
|
|
59
80
|
type: types_1.ValidationInputType.NUMBER,
|
|
@@ -62,10 +83,9 @@ class Validators {
|
|
|
62
83
|
if (isValid)
|
|
63
84
|
return null;
|
|
64
85
|
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN, { userInput, min });
|
|
65
|
-
}
|
|
86
|
+
},
|
|
66
87
|
};
|
|
67
88
|
}
|
|
68
|
-
;
|
|
69
89
|
static maxValue(max) {
|
|
70
90
|
return {
|
|
71
91
|
type: types_1.ValidationInputType.NUMBER,
|
|
@@ -74,24 +94,93 @@ class Validators {
|
|
|
74
94
|
if (isValid)
|
|
75
95
|
return null;
|
|
76
96
|
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX, { userInput, max });
|
|
77
|
-
}
|
|
97
|
+
},
|
|
98
|
+
};
|
|
99
|
+
}
|
|
100
|
+
static minDate(min, unit = 'day', includeBounds = false) {
|
|
101
|
+
return {
|
|
102
|
+
type: types_1.ValidationInputType.DATE_TIME,
|
|
103
|
+
fn: (property, processedValue, userInput) => {
|
|
104
|
+
const dateValue = (0, dayjs_1.default)(processedValue);
|
|
105
|
+
const minDate = (0, dayjs_1.default)(min);
|
|
106
|
+
if (!minDate.isValid())
|
|
107
|
+
return null;
|
|
108
|
+
const isValid = includeBounds
|
|
109
|
+
? dateValue.isAfter(minDate, unit)
|
|
110
|
+
: dateValue.isSame(minDate, unit) && dateValue.isAfter(minDate, unit);
|
|
111
|
+
if (isValid)
|
|
112
|
+
return null;
|
|
113
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN_DATE, {
|
|
114
|
+
userInput: dateValue.toISOString(),
|
|
115
|
+
min: minDate.toISOString(),
|
|
116
|
+
});
|
|
117
|
+
},
|
|
118
|
+
};
|
|
119
|
+
}
|
|
120
|
+
static maxDate(max, unit = 'day', includeBounds = false) {
|
|
121
|
+
return {
|
|
122
|
+
type: types_1.ValidationInputType.DATE_TIME,
|
|
123
|
+
fn: (property, processedValue, userInput) => {
|
|
124
|
+
const dateValue = (0, dayjs_1.default)(processedValue);
|
|
125
|
+
const maxDate = (0, dayjs_1.default)(max);
|
|
126
|
+
if (!maxDate.isValid())
|
|
127
|
+
return null;
|
|
128
|
+
const isValid = includeBounds
|
|
129
|
+
? dateValue.isBefore(maxDate, unit)
|
|
130
|
+
: dateValue.isSame(maxDate, unit) &&
|
|
131
|
+
dateValue.isBefore(maxDate, unit);
|
|
132
|
+
if (isValid)
|
|
133
|
+
return null;
|
|
134
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX_DATE, {
|
|
135
|
+
userInput: dateValue.toISOString(),
|
|
136
|
+
max: maxDate.toISOString(),
|
|
137
|
+
});
|
|
138
|
+
},
|
|
78
139
|
};
|
|
79
140
|
}
|
|
80
|
-
;
|
|
81
141
|
static inRange(min, max) {
|
|
82
142
|
return {
|
|
83
143
|
type: types_1.ValidationInputType.NUMBER,
|
|
84
144
|
fn: (property, processedValue, userInput) => {
|
|
85
145
|
const numericValue = Number(processedValue);
|
|
86
|
-
const isValid =
|
|
87
|
-
|
|
146
|
+
const isValid = numericValue <= max && numericValue >= min;
|
|
147
|
+
if (isValid)
|
|
148
|
+
return null;
|
|
149
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IN_RANGE, {
|
|
150
|
+
userInput,
|
|
151
|
+
min,
|
|
152
|
+
max,
|
|
153
|
+
});
|
|
154
|
+
},
|
|
155
|
+
};
|
|
156
|
+
}
|
|
157
|
+
static inDateRange(min, max, unit = 'day', includeBounds = false) {
|
|
158
|
+
return {
|
|
159
|
+
type: types_1.ValidationInputType.DATE_TIME,
|
|
160
|
+
fn: (property, processedValue) => {
|
|
161
|
+
const dateValue = (0, dayjs_1.default)(processedValue);
|
|
162
|
+
const minDate = (0, dayjs_1.default)(min);
|
|
163
|
+
const maxDate = (0, dayjs_1.default)(max);
|
|
164
|
+
const validRanges = minDate.isValid() && maxDate.isValid();
|
|
165
|
+
if (!validRanges)
|
|
166
|
+
return null;
|
|
167
|
+
const isValid = includeBounds
|
|
168
|
+
? (dateValue.isBefore(maxDate, unit) ||
|
|
169
|
+
dateValue.isSame(maxDate, unit)) &&
|
|
170
|
+
(dateValue.isAfter(minDate, unit) ||
|
|
171
|
+
dateValue.isSame(minDate, unit))
|
|
172
|
+
: dateValue.isBefore(maxDate, unit) &&
|
|
173
|
+
dateValue.isAfter(minDate, unit);
|
|
88
174
|
if (isValid)
|
|
89
175
|
return null;
|
|
90
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IN_RANGE, {
|
|
91
|
-
|
|
176
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IN_RANGE, {
|
|
177
|
+
userInput: dateValue.toISOString(),
|
|
178
|
+
min: minDate.toISOString(),
|
|
179
|
+
max: maxDate.toISOString(),
|
|
180
|
+
});
|
|
181
|
+
},
|
|
92
182
|
};
|
|
93
183
|
}
|
|
94
|
-
;
|
|
95
184
|
static oneOf(values) {
|
|
96
185
|
return {
|
|
97
186
|
type: types_1.ValidationInputType.ANY,
|
|
@@ -99,10 +188,30 @@ class Validators {
|
|
|
99
188
|
if (Array.isArray(values)) {
|
|
100
189
|
return values.includes(processedValue)
|
|
101
190
|
? null
|
|
102
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.ONE_OF, {
|
|
191
|
+
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.ONE_OF, {
|
|
192
|
+
userInput,
|
|
193
|
+
choices: values,
|
|
194
|
+
});
|
|
195
|
+
}
|
|
196
|
+
return null;
|
|
197
|
+
},
|
|
198
|
+
};
|
|
199
|
+
}
|
|
200
|
+
static requireKeys(values) {
|
|
201
|
+
return {
|
|
202
|
+
type: types_1.ValidationInputType.OBJECT,
|
|
203
|
+
fn: (property, processedValue, userInput) => {
|
|
204
|
+
if (Array.isArray(values)) {
|
|
205
|
+
const missingKeys = values.filter((key) => !processedValue[key]);
|
|
206
|
+
return missingKeys.length
|
|
207
|
+
? (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.REQUIRE_KEYS, {
|
|
208
|
+
userInput,
|
|
209
|
+
keys: missingKeys.join(', '),
|
|
210
|
+
})
|
|
211
|
+
: null;
|
|
103
212
|
}
|
|
104
213
|
return null;
|
|
105
|
-
}
|
|
214
|
+
},
|
|
106
215
|
};
|
|
107
216
|
}
|
|
108
217
|
}
|
|
@@ -114,7 +223,16 @@ Validators.number = {
|
|
|
114
223
|
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.NUMBER, { userInput });
|
|
115
224
|
}
|
|
116
225
|
return null;
|
|
117
|
-
}
|
|
226
|
+
},
|
|
227
|
+
};
|
|
228
|
+
Validators.integer = {
|
|
229
|
+
type: types_1.ValidationInputType.NUMBER,
|
|
230
|
+
fn: (property, processedValue, userInput) => {
|
|
231
|
+
if ((0, lodash_1.isInteger)(processedValue)) {
|
|
232
|
+
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.WHOLE_NUMBER, { userInput });
|
|
233
|
+
}
|
|
234
|
+
return null;
|
|
235
|
+
},
|
|
118
236
|
};
|
|
119
237
|
Validators.image = {
|
|
120
238
|
type: types_1.ValidationInputType.FILE,
|
|
@@ -123,21 +241,21 @@ Validators.image = {
|
|
|
123
241
|
return regex.test(processedValue.name)
|
|
124
242
|
? null
|
|
125
243
|
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IMAGE, { property: property });
|
|
126
|
-
}
|
|
244
|
+
},
|
|
127
245
|
};
|
|
128
246
|
Validators.email = {
|
|
129
247
|
type: types_1.ValidationInputType.STRING,
|
|
130
248
|
fn: (property, processedValue, userInput) => {
|
|
131
249
|
const pattern = new RegExp('^(([^<>()\\[\\].,;:\\s@"]+(\\.[^<>()\\[\\].,;:\\s@"]+)*)|(".+"))@((\\[[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}\\.[0-9]{1,3}])|(([a-zA-Z-0-9]+\\.)+[a-zA-Z]{2,}))$');
|
|
132
|
-
if ((0,
|
|
250
|
+
if ((0, lodash_1.isEmpty)(processedValue)) {
|
|
133
251
|
return null;
|
|
134
252
|
}
|
|
135
|
-
if ((0,
|
|
253
|
+
if ((0, lodash_1.isEmpty)(processedValue))
|
|
136
254
|
return null;
|
|
137
255
|
return pattern.test(String(processedValue))
|
|
138
256
|
? null
|
|
139
257
|
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.EMAIL, { userInput });
|
|
140
|
-
}
|
|
258
|
+
},
|
|
141
259
|
};
|
|
142
260
|
Validators.url = {
|
|
143
261
|
type: types_1.ValidationInputType.STRING,
|
|
@@ -149,29 +267,29 @@ Validators.url = {
|
|
|
149
267
|
'(\\?[;&a-zA-Z\\d%_.~+=-]*)?' + // query string
|
|
150
268
|
'(\\#[-a-zA-Z\\d_]*)?$' // fragment locator
|
|
151
269
|
);
|
|
152
|
-
if ((0,
|
|
270
|
+
if ((0, lodash_1.isEmpty)(processedValue))
|
|
153
271
|
return null;
|
|
154
272
|
return pattern.test(String(processedValue))
|
|
155
273
|
? null
|
|
156
274
|
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.URL, { userInput });
|
|
157
|
-
}
|
|
275
|
+
},
|
|
158
276
|
};
|
|
159
277
|
Validators.datetimeIso = {
|
|
160
278
|
type: types_1.ValidationInputType.DATE_TIME,
|
|
161
279
|
fn: (property, processedValue, userInput) => {
|
|
162
|
-
if (property.required && (0,
|
|
280
|
+
if (property.required && (0, lodash_1.isNil)(processedValue)) {
|
|
163
281
|
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.ISO_DATE, { userInput });
|
|
164
282
|
}
|
|
165
283
|
return null;
|
|
166
|
-
}
|
|
284
|
+
},
|
|
167
285
|
};
|
|
168
286
|
Validators.file = {
|
|
169
287
|
type: types_1.ValidationInputType.FILE,
|
|
170
288
|
fn: (property, processedValue, userInput) => {
|
|
171
|
-
if (property.required && (0,
|
|
289
|
+
if (property.required && (0, lodash_1.isNil)(processedValue)) {
|
|
172
290
|
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.FILE, { userInput });
|
|
173
291
|
}
|
|
174
292
|
return null;
|
|
175
|
-
}
|
|
293
|
+
},
|
|
176
294
|
};
|
|
177
295
|
//# sourceMappingURL=validators.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/validators.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/validators.ts"],"names":[],"mappings":";;;;AAAA,mCAAmD;AACnD,qCAAyC;AA+VpB,8FA/VZ,sBAAa,OA+VY;AA9VlC,mCAIiB;AACjB,mCAA6C;AAyVS,mGAzV7C,0BAAkB,OAyV6C;AAxVxE,0DAA0C;AAE1C,MAAM,UAAU;IACd,MAAM,CAAC,OAAO,CACZ,KAAsB;QAEtB,OAAO;YACL,IAAI,EAAE,2BAAmB,CAAC,MAAM;YAChC,EAAE,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE;gBAC1C,IAAI,IAAA,gBAAO,EAAC,cAAc,CAAC;oBAAE,OAAO,IAAI,CAAC;gBAEzC,IAAI,OAAO,KAAK,KAAK,QAAQ,EAAE;oBAC7B,KAAK,GAAG,IAAI,MAAM,CAAC,KAAK,CAAC,CAAC;iBAC3B;gBAED,OAAO,KAAK,CAAC,IAAI,CAAC,MAAM,CAAC,cAAc,CAAC,CAAC;oBACvC,CAAC,CAAC,IAAI;oBACN,CAAC,CAAC,IAAA,0BAAkB,EAAC,sBAAa,CAAC,KAAK,EAAE;wBACtC,QAAQ,EAAE,QAAQ,aAAR,QAAQ,uBAAR,QAAQ,CAAE,WAAW;qBAChC,CAAC,CAAC;YACT,CAAC;SACF,CAAC;IACJ,CAAC;IAED,MAAM,CAAC,eAAe,CACpB,KAAsB;QAEtB,OAAO;YACL,IAAI,EAAE,2BAAmB,CAAC,MAAM;YAChC,EAAE,EAAE,CAAC,QAAQ,EAAE,cAAc,EAAE,SAAS,EAAE,EAAE;gBAC1C,MAAM,gBAAgB,GAAG,UAAU,CAAC,OAAO,CAAC,KAAK,CAAC,CAAC;gBACnD,MAAM,YAAY,GAAG,gBAAgB,CAAC,EAAE,CACtC,QAAQ,EACR,cAAc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