@activepieces/pieces-framework 0.6.5 → 0.6.6
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 -5
- package/src/lib/index.d.ts +0 -2
- package/src/lib/index.js +0 -2
- package/src/lib/index.js.map +1 -1
- package/src/lib/property/base-prop.d.ts +12 -18
- package/src/lib/property/basic-auth-prop.d.ts +1 -2
- package/src/lib/property/custom-auth-prop.d.ts +1 -2
- package/src/lib/property/dropdown-prop.d.ts +4 -5
- package/src/lib/property/dynamic-prop.d.ts +1 -2
- package/src/lib/property/oauth2-prop.d.ts +1 -2
- package/src/lib/property/oauth2-prop.js.map +1 -1
- package/src/lib/property/property.d.ts +1 -1
- package/src/lib/property/property.js +3 -5
- package/src/lib/property/property.js.map +1 -1
- package/src/lib/processors/processors.d.ts +0 -7
- package/src/lib/processors/processors.js +0 -90
- package/src/lib/processors/processors.js.map +0 -1
- package/src/lib/processors/types.d.ts +0 -7
- package/src/lib/processors/types.js +0 -3
- package/src/lib/processors/types.js.map +0 -1
- package/src/lib/validators/errors.d.ts +0 -17
- package/src/lib/validators/errors.js +0 -22
- package/src/lib/validators/errors.js.map +0 -1
- package/src/lib/validators/types.d.ts +0 -17
- package/src/lib/validators/types.js +0 -15
- package/src/lib/validators/types.js.map +0 -1
- package/src/lib/validators/utils.d.ts +0 -1
- package/src/lib/validators/utils.js +0 -12
- package/src/lib/validators/utils.js.map +0 -1
- package/src/lib/validators/validators.d.ts +0 -19
- package/src/lib/validators/validators.js +0 -177
- package/src/lib/validators/validators.js.map +0 -1
package/package.json
CHANGED
|
@@ -1,13 +1,9 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-framework",
|
|
3
|
-
"version": "0.6.
|
|
3
|
+
"version": "0.6.6",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@sinclair/typebox": "^0.26.3",
|
|
7
|
-
"axios": "1.4.0",
|
|
8
|
-
"dayjs": "^1.11.8",
|
|
9
|
-
"is-base64": "^1.1.0",
|
|
10
|
-
"lodash": "4.17.21",
|
|
11
7
|
"nanoid": "^3.3.4",
|
|
12
8
|
"semver": "7.5.3",
|
|
13
9
|
"@activepieces/shared": "0.5.10",
|
package/src/lib/index.d.ts
CHANGED
package/src/lib/index.js
CHANGED
|
@@ -7,6 +7,4 @@ tslib_1.__exportStar(require("./trigger/trigger"), exports);
|
|
|
7
7
|
tslib_1.__exportStar(require("./context"), exports);
|
|
8
8
|
tslib_1.__exportStar(require("./piece"), exports);
|
|
9
9
|
tslib_1.__exportStar(require("./piece-metadata"), exports);
|
|
10
|
-
tslib_1.__exportStar(require("./validators/validators"), exports);
|
|
11
|
-
tslib_1.__exportStar(require("./processors/processors"), exports);
|
|
12
10
|
//# sourceMappingURL=index.js.map
|
package/src/lib/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,qDAA0B;AAC1B,4DAAiC;AACjC,oDAAyB;AACzB,kDAAuB;AACvB,2DAAgC
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../packages/pieces/framework/src/lib/index.ts"],"names":[],"mappings":";;;AAAA,0DAA+B;AAC/B,qDAA0B;AAC1B,4DAAiC;AACjC,oDAAyB;AACzB,kDAAuB;AACvB,2DAAgC"}
|
|
@@ -1,5 +1,3 @@
|
|
|
1
|
-
import { ProcessorFn } from "../processors/types";
|
|
2
|
-
import { TypedValidatorFn, ValidationInputType } from "../validators/types";
|
|
3
1
|
import { PropertyType } from "./property";
|
|
4
2
|
export type BasePropertySchema = {
|
|
5
3
|
displayName: string;
|
|
@@ -20,30 +18,26 @@ export type BasePieceAuthSchema<AuthValueSchema> = BasePropertySchema & {
|
|
|
20
18
|
export type MarkDownPropertySchema = {
|
|
21
19
|
value: string;
|
|
22
20
|
};
|
|
23
|
-
export type TPropertyValue<T, U extends PropertyType,
|
|
21
|
+
export type TPropertyValue<T, U extends PropertyType, REQUIRED extends boolean> = {
|
|
24
22
|
valueSchema: T;
|
|
25
23
|
type: U;
|
|
26
24
|
required: REQUIRED;
|
|
27
|
-
defaultProcessors?: ProcessorFn[];
|
|
28
|
-
processors?: ProcessorFn[];
|
|
29
|
-
validators?: TypedValidatorFn<VALIDATION_INPUT>[];
|
|
30
|
-
defaultValidators?: TypedValidatorFn<VALIDATION_INPUT>[];
|
|
31
25
|
defaultValue?: U extends PropertyType.ARRAY ? unknown[] : U extends PropertyType.JSON ? object : U extends PropertyType.CHECKBOX ? boolean : U extends PropertyType.LONG_TEXT ? string : U extends PropertyType.SHORT_TEXT ? string : U extends PropertyType.NUMBER ? number : U extends PropertyType.DROPDOWN ? unknown : U extends PropertyType.MULTI_SELECT_DROPDOWN ? unknown[] : U extends PropertyType.STATIC_MULTI_SELECT_DROPDOWN ? unknown[] : U extends PropertyType.STATIC_DROPDOWN ? unknown : U extends PropertyType.DATE_TIME ? string : U extends PropertyType.FILE ? ApFile : unknown;
|
|
32
26
|
};
|
|
33
|
-
export type ShortTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.SHORT_TEXT,
|
|
34
|
-
export type LongTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.LONG_TEXT,
|
|
35
|
-
export type MarkDownProperty = BasePropertySchema & TPropertyValue<never, PropertyType.MARKDOWN,
|
|
36
|
-
export type SecretTextProperty<R extends boolean> = BasePieceAuthSchema<string> & TPropertyValue<string, PropertyType.SECRET_TEXT,
|
|
37
|
-
export type CheckboxProperty<R extends boolean> = BasePropertySchema & TPropertyValue<boolean, PropertyType.CHECKBOX,
|
|
38
|
-
export type NumberProperty<R extends boolean> = BasePropertySchema & TPropertyValue<number, PropertyType.NUMBER,
|
|
39
|
-
export type ArrayProperty<R extends boolean> = BasePropertySchema & TPropertyValue<unknown[], PropertyType.ARRAY,
|
|
40
|
-
export type ObjectProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.OBJECT,
|
|
41
|
-
export type JsonProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.JSON,
|
|
42
|
-
export type DateTimeProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.DATE_TIME,
|
|
27
|
+
export type ShortTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.SHORT_TEXT, R>;
|
|
28
|
+
export type LongTextProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.LONG_TEXT, R>;
|
|
29
|
+
export type MarkDownProperty = BasePropertySchema & TPropertyValue<never, PropertyType.MARKDOWN, true>;
|
|
30
|
+
export type SecretTextProperty<R extends boolean> = BasePieceAuthSchema<string> & TPropertyValue<string, PropertyType.SECRET_TEXT, R>;
|
|
31
|
+
export type CheckboxProperty<R extends boolean> = BasePropertySchema & TPropertyValue<boolean, PropertyType.CHECKBOX, R>;
|
|
32
|
+
export type NumberProperty<R extends boolean> = BasePropertySchema & TPropertyValue<number, PropertyType.NUMBER, R>;
|
|
33
|
+
export type ArrayProperty<R extends boolean> = BasePropertySchema & TPropertyValue<unknown[], PropertyType.ARRAY, R>;
|
|
34
|
+
export type ObjectProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.OBJECT, R>;
|
|
35
|
+
export type JsonProperty<R extends boolean> = BasePropertySchema & TPropertyValue<Record<string, unknown>, PropertyType.JSON, R>;
|
|
36
|
+
export type DateTimeProperty<R extends boolean> = BasePropertySchema & TPropertyValue<string, PropertyType.DATE_TIME, R>;
|
|
43
37
|
export type ApFile = {
|
|
44
38
|
filename?: string;
|
|
45
39
|
extension?: string;
|
|
46
40
|
base64: string;
|
|
47
41
|
};
|
|
48
|
-
export type FileProperty<R extends boolean> = BasePropertySchema & TPropertyValue<ApFile, PropertyType.FILE,
|
|
42
|
+
export type FileProperty<R extends boolean> = BasePropertySchema & TPropertyValue<ApFile, PropertyType.FILE, R>;
|
|
49
43
|
export {};
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PropertyType } from "./property";
|
|
2
2
|
import { BasePieceAuthSchema, TPropertyValue } from "./base-prop";
|
|
3
|
-
import { ValidationInputType } from "../validators/types";
|
|
4
3
|
export type BasicAuthPropertyValue = {
|
|
5
4
|
username: string;
|
|
6
5
|
password: string;
|
|
@@ -15,4 +14,4 @@ export type BasicAuthPropertySchema = BasePieceAuthSchema<BasicAuthPropertyValue
|
|
|
15
14
|
description?: string;
|
|
16
15
|
};
|
|
17
16
|
};
|
|
18
|
-
export type BasicAuthProperty<R extends boolean> = BasicAuthPropertySchema & TPropertyValue<BasicAuthPropertyValue, PropertyType.BASIC_AUTH,
|
|
17
|
+
export type BasicAuthProperty<R extends boolean> = BasicAuthPropertySchema & TPropertyValue<BasicAuthPropertyValue, PropertyType.BASIC_AUTH, R>;
|
|
@@ -2,7 +2,6 @@ import { PropertyType } from "./property";
|
|
|
2
2
|
import { BasePieceAuthSchema, CheckboxProperty, LongTextProperty, NumberProperty, SecretTextProperty, ShortTextProperty, TPropertyValue } from "./base-prop";
|
|
3
3
|
import { StaticDropdownProperty } from "./dropdown-prop";
|
|
4
4
|
import { StaticPropsValue } from "./property";
|
|
5
|
-
import { ValidationInputType } from "../validators/types";
|
|
6
5
|
export interface CustomAuthProps {
|
|
7
6
|
[name: string]: ShortTextProperty<boolean> | LongTextProperty<boolean> | SecretTextProperty<boolean> | NumberProperty<boolean> | StaticDropdownProperty<unknown, boolean> | CheckboxProperty<boolean>;
|
|
8
7
|
}
|
|
@@ -10,4 +9,4 @@ export type CustomAuthPropertyValue<T extends CustomAuthProps> = StaticPropsValu
|
|
|
10
9
|
export type CustomAuthPropertySchema<T extends CustomAuthProps> = BasePieceAuthSchema<CustomAuthPropertyValue<T>> & {
|
|
11
10
|
props: T;
|
|
12
11
|
};
|
|
13
|
-
export type CustomAuthProperty<R extends boolean, T extends CustomAuthProps> = CustomAuthPropertySchema<T> & TPropertyValue<CustomAuthPropertyValue<T>, PropertyType.CUSTOM_AUTH,
|
|
12
|
+
export type CustomAuthProperty<R extends boolean, T extends CustomAuthProps> = CustomAuthPropertySchema<T> & TPropertyValue<CustomAuthPropertyValue<T>, PropertyType.CUSTOM_AUTH, R>;
|
|
@@ -1,6 +1,5 @@
|
|
|
1
1
|
import { PropertyType } from "./property";
|
|
2
2
|
import { BasePropertySchema, TPropertyValue } from "./base-prop";
|
|
3
|
-
import { ValidationInputType } from "../validators/types";
|
|
4
3
|
export type DropdownState<T> = {
|
|
5
4
|
disabled?: boolean;
|
|
6
5
|
placeholder?: string;
|
|
@@ -14,14 +13,14 @@ export type DynamicDropdownOptions<T> = (propsValue: Record<string, unknown>) =>
|
|
|
14
13
|
export type DropdownProperty<T, R extends boolean> = BasePropertySchema & {
|
|
15
14
|
refreshers: string[];
|
|
16
15
|
options: DynamicDropdownOptions<T>;
|
|
17
|
-
} & TPropertyValue<T, PropertyType.DROPDOWN,
|
|
16
|
+
} & TPropertyValue<T, PropertyType.DROPDOWN, R>;
|
|
18
17
|
export type StaticDropdownProperty<T, R extends boolean> = BasePropertySchema & {
|
|
19
18
|
options: DropdownState<T>;
|
|
20
|
-
} & TPropertyValue<T, PropertyType.STATIC_DROPDOWN,
|
|
19
|
+
} & TPropertyValue<T, PropertyType.STATIC_DROPDOWN, R>;
|
|
21
20
|
export type MultiSelectDropdownProperty<T, R extends boolean> = BasePropertySchema & {
|
|
22
21
|
refreshers: string[];
|
|
23
22
|
options: DynamicDropdownOptions<T>;
|
|
24
|
-
} & TPropertyValue<T[], PropertyType.MULTI_SELECT_DROPDOWN,
|
|
23
|
+
} & TPropertyValue<T[], PropertyType.MULTI_SELECT_DROPDOWN, R>;
|
|
25
24
|
export type StaticMultiSelectDropdownProperty<T, R extends boolean> = BasePropertySchema & {
|
|
26
25
|
options: DropdownState<T>;
|
|
27
|
-
} & TPropertyValue<T[], PropertyType.STATIC_MULTI_SELECT_DROPDOWN,
|
|
26
|
+
} & TPropertyValue<T[], PropertyType.STATIC_MULTI_SELECT_DROPDOWN, R>;
|
|
@@ -1,12 +1,11 @@
|
|
|
1
1
|
import { PropertyType } from "./property";
|
|
2
2
|
import { BasePropertySchema, ShortTextProperty, TPropertyValue } from "./base-prop";
|
|
3
3
|
import { StaticDropdownProperty, StaticMultiSelectDropdownProperty } from "./dropdown-prop";
|
|
4
|
-
import { ValidationInputType } from "../validators/types";
|
|
5
4
|
type DynamicProp = ShortTextProperty<boolean> | StaticDropdownProperty<any, boolean> | StaticMultiSelectDropdownProperty<any, boolean>;
|
|
6
5
|
export type DynamicPropsValue = Record<string, DynamicProp['valueSchema']>;
|
|
7
6
|
export type DynamicPropsSchema = BasePropertySchema & {
|
|
8
7
|
props: (propsValue: Record<string, DynamicPropsValue>) => Promise<Record<string, DynamicProp>>;
|
|
9
8
|
refreshers: string[];
|
|
10
9
|
};
|
|
11
|
-
export type DynamicProperties<R extends boolean> = DynamicPropsSchema & TPropertyValue<DynamicPropsValue, PropertyType.DYNAMIC,
|
|
10
|
+
export type DynamicProperties<R extends boolean> = DynamicPropsSchema & TPropertyValue<DynamicPropsValue, PropertyType.DYNAMIC, R>;
|
|
12
11
|
export {};
|
|
@@ -2,7 +2,6 @@ import { PropertyType } from "./property";
|
|
|
2
2
|
import { BasePieceAuthSchema, SecretTextProperty, ShortTextProperty, TPropertyValue } from "./base-prop";
|
|
3
3
|
import { StaticDropdownProperty } from "./dropdown-prop";
|
|
4
4
|
import { StaticPropsValue } from "./property";
|
|
5
|
-
import { ValidationInputType } from "../validators/types";
|
|
6
5
|
type OAuthProp = ShortTextProperty<true> | SecretTextProperty<true> | StaticDropdownProperty<any, true>;
|
|
7
6
|
export interface OAuth2Props {
|
|
8
7
|
[name: string]: ShortTextProperty<boolean> | SecretTextProperty<boolean> | StaticDropdownProperty<unknown, boolean>;
|
|
@@ -22,7 +21,7 @@ export type OAuth2PropertyValue<T extends OAuth2Props = any> = {
|
|
|
22
21
|
props?: OAuthPropsValue<T>;
|
|
23
22
|
data: Record<string, any>;
|
|
24
23
|
};
|
|
25
|
-
export type OAuth2Property<R extends boolean, T extends OAuth2Props> = OAuth2PropertySchema & TPropertyValue<OAuth2PropertyValue<T>, PropertyType.OAUTH2,
|
|
24
|
+
export type OAuth2Property<R extends boolean, T extends OAuth2Props> = OAuth2PropertySchema & TPropertyValue<OAuth2PropertyValue<T>, PropertyType.OAUTH2, R>;
|
|
26
25
|
export declare enum OAuth2AuthorizationMethod {
|
|
27
26
|
HEADER = "HEADER",
|
|
28
27
|
BODY = "BODY"
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"oauth2-prop.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/property/oauth2-prop.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"oauth2-prop.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/property/oauth2-prop.ts"],"names":[],"mappings":";;;AAoCA,IAAY,yBAGX;AAHD,WAAY,yBAAyB;IACpC,8CAAiB,CAAA;IACjB,0CAAa,CAAA;AACd,CAAC,EAHW,yBAAyB,yCAAzB,yBAAyB,QAGpC"}
|
|
@@ -64,5 +64,5 @@ export declare const PieceAuth: {
|
|
|
64
64
|
OAuth2<R_3 extends boolean, T_1 extends OAuth2Props>(request: Properties<OAuth2Property<R_3, T_1>>): R_3 extends true ? OAuth2Property<true, T_1> : OAuth2Property<false, T_1>;
|
|
65
65
|
None(): undefined;
|
|
66
66
|
};
|
|
67
|
-
type Properties<T> = Omit<T, "valueSchema" | "type"
|
|
67
|
+
type Properties<T> = Omit<T, "valueSchema" | "type">;
|
|
68
68
|
export {};
|
|
@@ -1,8 +1,6 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.PieceAuth = exports.Property = exports.PropertyType = void 0;
|
|
4
|
-
const processors_1 = require("../processors/processors");
|
|
5
|
-
const validators_1 = require("../validators/validators");
|
|
6
4
|
var PropertyType;
|
|
7
5
|
(function (PropertyType) {
|
|
8
6
|
PropertyType["SHORT_TEXT"] = "SHORT_TEXT";
|
|
@@ -39,7 +37,7 @@ exports.Property = {
|
|
|
39
37
|
return { displayName: 'Markdown', required: true, description: request.value, type: PropertyType.MARKDOWN, valueSchema: undefined };
|
|
40
38
|
},
|
|
41
39
|
Number(request) {
|
|
42
|
-
return Object.assign(Object.assign({}, request), {
|
|
40
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.NUMBER });
|
|
43
41
|
},
|
|
44
42
|
Json(request) {
|
|
45
43
|
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.JSON });
|
|
@@ -66,10 +64,10 @@ exports.Property = {
|
|
|
66
64
|
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.STATIC_MULTI_SELECT_DROPDOWN });
|
|
67
65
|
},
|
|
68
66
|
DateTime(request) {
|
|
69
|
-
return Object.assign(Object.assign({}, request), {
|
|
67
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.DATE_TIME });
|
|
70
68
|
},
|
|
71
69
|
File(request) {
|
|
72
|
-
return Object.assign(Object.assign({}, request), {
|
|
70
|
+
return Object.assign(Object.assign({}, request), { valueSchema: undefined, type: PropertyType.FILE });
|
|
73
71
|
},
|
|
74
72
|
};
|
|
75
73
|
exports.PieceAuth = {
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/property/property.ts"],"names":[],"mappings":";;;
|
|
1
|
+
{"version":3,"file":"property.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/property/property.ts"],"names":[],"mappings":";;;AAoBA,IAAY,YAoBX;AApBD,WAAY,YAAY;IACvB,yCAAyB,CAAA;IACzB,uCAAuB,C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AC3D,OAAO,gCAAK,OAAO,KAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,IAAI,GAA0E,CAAC;IAChJ,CAAC;CACD,CAAC;AAEW,QAAA,SAAS,GAAG;IACxB,UAAU,CAAoB,OAA0C;QACvE,OAAO,gCAAK,OAAO,KAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,WAAW,GAAsF,CAAC;IACnK,CAAC;IACD,SAAS,CAAoB,OAAyC;QACrE,OAAO,gCAAK,OAAO,KAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,UAAU,GAAoF,CAAC;IAChK,CAAC;IACD,UAAU,CAA+C,OAA6C;QAErG,OAAO,gCAAK,OAAO,KAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,WAAW,GAA4F,CAAC;IACzK,CAAC;IACD,MAAM,CAA2C,OAAyC;QACzF,OAAO,gCAAK,OAAO,KAAE,WAAW,EAAE,SAAS,EAAE,IAAI,EAAE,YAAY,CAAC,MAAM,GAAoF,CAAC;IAC5J,CAAC;IACD,IAAI;QACH,OAAO,SAAS,CAAC;IAClB,CAAC;CACD,CAAC"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { ApFile } from "../property";
|
|
2
|
-
import { ProcessorFn } from "./types";
|
|
3
|
-
export declare class Processors {
|
|
4
|
-
static number: ProcessorFn<string | number | undefined | null, number | null | undefined>;
|
|
5
|
-
static datetime: ProcessorFn<number | string | undefined | null, string | undefined>;
|
|
6
|
-
static file: ProcessorFn<unknown, Promise<ApFile | null>>;
|
|
7
|
-
}
|
|
@@ -1,90 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
var _a;
|
|
3
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
4
|
-
exports.Processors = void 0;
|
|
5
|
-
const tslib_1 = require("tslib");
|
|
6
|
-
const lodash_1 = require("lodash");
|
|
7
|
-
const dayjs_1 = tslib_1.__importDefault(require("dayjs"));
|
|
8
|
-
const timezone_1 = tslib_1.__importDefault(require("dayjs/plugin/timezone"));
|
|
9
|
-
const utc_1 = tslib_1.__importDefault(require("dayjs/plugin/utc"));
|
|
10
|
-
const is_base64_1 = tslib_1.__importDefault(require("is-base64"));
|
|
11
|
-
const axios_1 = tslib_1.__importDefault(require("axios"));
|
|
12
|
-
class Processors {
|
|
13
|
-
}
|
|
14
|
-
exports.Processors = Processors;
|
|
15
|
-
_a = Processors;
|
|
16
|
-
Processors.number = (property, value) => {
|
|
17
|
-
if ((0, lodash_1.isNil)(value)) {
|
|
18
|
-
return value;
|
|
19
|
-
}
|
|
20
|
-
if (value === '') {
|
|
21
|
-
return NaN;
|
|
22
|
-
}
|
|
23
|
-
return Number(value);
|
|
24
|
-
};
|
|
25
|
-
Processors.datetime = (property, value) => {
|
|
26
|
-
dayjs_1.default.extend(utc_1.default);
|
|
27
|
-
dayjs_1.default.extend(timezone_1.default);
|
|
28
|
-
const dateTimeString = value;
|
|
29
|
-
try {
|
|
30
|
-
if (!dateTimeString)
|
|
31
|
-
throw Error('Undefined input');
|
|
32
|
-
return dayjs_1.default.tz(dateTimeString, 'UTC').toISOString();
|
|
33
|
-
}
|
|
34
|
-
catch (error) {
|
|
35
|
-
console.error(error);
|
|
36
|
-
return undefined;
|
|
37
|
-
}
|
|
38
|
-
};
|
|
39
|
-
Processors.file = (property, urlOrBase64) => tslib_1.__awaiter(void 0, void 0, void 0, function* () {
|
|
40
|
-
// convertUrlOrBase64ToFile
|
|
41
|
-
if ((0, lodash_1.isNil)(urlOrBase64) || !(0, lodash_1.isString)(urlOrBase64)) {
|
|
42
|
-
return null;
|
|
43
|
-
}
|
|
44
|
-
// Get the file from the URL
|
|
45
|
-
try {
|
|
46
|
-
// Check if the string is a Base64 string
|
|
47
|
-
if ((0, is_base64_1.default)(urlOrBase64, { allowMime: true })) {
|
|
48
|
-
const matches = urlOrBase64.match(/^data:([A-Za-z-+/]+);base64,(.+)$/);
|
|
49
|
-
let base64 = urlOrBase64;
|
|
50
|
-
let contentType = null;
|
|
51
|
-
if (matches && (matches === null || matches === void 0 ? void 0 : matches.length) === 3) {
|
|
52
|
-
contentType = matches[1];
|
|
53
|
-
base64 = matches[2];
|
|
54
|
-
// You need to provide how you decide filename and extension in case of base64 string
|
|
55
|
-
const filename = 'unknown';
|
|
56
|
-
const extension = contentType.split('/')[1];
|
|
57
|
-
return {
|
|
58
|
-
filename: filename + "." + extension,
|
|
59
|
-
extension,
|
|
60
|
-
base64,
|
|
61
|
-
};
|
|
62
|
-
}
|
|
63
|
-
}
|
|
64
|
-
const response = yield axios_1.default.head(urlOrBase64);
|
|
65
|
-
const contentType = response.headers['content-type'];
|
|
66
|
-
// Check if content type is file
|
|
67
|
-
if (!contentType || !(contentType.startsWith('application/') || contentType.startsWith("image") || contentType === 'application/octet-stream')) {
|
|
68
|
-
return null;
|
|
69
|
-
}
|
|
70
|
-
const fileResponse = yield axios_1.default.get(urlOrBase64, {
|
|
71
|
-
responseType: 'arraybuffer',
|
|
72
|
-
});
|
|
73
|
-
// Get filename and extension
|
|
74
|
-
const filename = urlOrBase64.substring(urlOrBase64.lastIndexOf('/') + 1);
|
|
75
|
-
const extension = filename.split('.').pop();
|
|
76
|
-
// Convert file data to base64
|
|
77
|
-
const base64 = Buffer.from(fileResponse.data, 'binary').toString('base64');
|
|
78
|
-
// Return the ApFile object
|
|
79
|
-
return {
|
|
80
|
-
filename,
|
|
81
|
-
extension,
|
|
82
|
-
base64,
|
|
83
|
-
};
|
|
84
|
-
}
|
|
85
|
-
catch (e) {
|
|
86
|
-
console.error(e);
|
|
87
|
-
return null;
|
|
88
|
-
}
|
|
89
|
-
});
|
|
90
|
-
//# sourceMappingURL=processors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"processors.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/processors/processors.ts"],"names":[],"mappings":";;;;;AAAA,mCAAyC;AA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AAM,MAAM,GAAG,MAAM,CAAC,IAAI,CAAC,YAAY,CAAC,IAAI,EAAE,QAAQ,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;QAE3E,2BAA2B;QAC3B,OAAO;YACL,QAAQ;YACR,SAAS;YACT,MAAM;SACP,CAAC;KACH;IAAC,OAAO,CAAC,EAAE;QACV,OAAO,CAAC,KAAK,CAAC,CAAC,CAAC,CAAC;QACjB,OAAO,IAAI,CAAC;KACb;AACH,CAAC,CAAA,AAxDU,CAwDT"}
|
|
@@ -1,7 +0,0 @@
|
|
|
1
|
-
import { PieceProperty } from "../property";
|
|
2
|
-
import { Processors } from "./processors";
|
|
3
|
-
export type ProcessorFn<INPUT = any, OUTPUT = any> = (property: PieceProperty, value: INPUT) => OUTPUT;
|
|
4
|
-
export type NumberProcessors = typeof Processors.number;
|
|
5
|
-
export type DateTimeProcessors = typeof Processors.datetime;
|
|
6
|
-
export type FileProcessors = typeof Processors.file;
|
|
7
|
-
export type AnyProcessors = NumberProcessors | DateTimeProcessors | FileProcessors;
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/processors/types.ts"],"names":[],"mappings":""}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
export declare enum ErrorMessages {
|
|
2
|
-
REQUIRED = "Expected value, but found value: {userInput}",
|
|
3
|
-
EMAIL = "Invalid Email format: {userInput}",
|
|
4
|
-
ISO_DATE = "Expected ISO string, but found value: {userInput}",
|
|
5
|
-
FILE = "Expected file url or base64 with mimeType, but found value: {userInput}",
|
|
6
|
-
NUMBER = "Expected number, but found value: {userInput}",
|
|
7
|
-
MAX_LENGTH = "The value: {userInput} may not be greater than {length} characters",
|
|
8
|
-
MIN_LENGTH = "The value: {userInput} must be at least {length} characters",
|
|
9
|
-
MAX = "The value: {userInput} must be {max} or less",
|
|
10
|
-
MIN = "The value: {userInput} must be {min} or more",
|
|
11
|
-
IN_RANGE = "The value: {userInput} must be at least {min} and less than or equal {max}",
|
|
12
|
-
URL = "The value: {userInput} is not a valid URL",
|
|
13
|
-
REGEX = "The value: {userInput} format is invalid",
|
|
14
|
-
IMAGE = "The {property} value must be an image",
|
|
15
|
-
ONE_OF = "The {userInput} is not a valid value, valid choices are: {choices}",
|
|
16
|
-
SIZE = "The {property} size must be less than 0:{size}KB"
|
|
17
|
-
}
|
|
@@ -1,22 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ErrorMessages = void 0;
|
|
4
|
-
var ErrorMessages;
|
|
5
|
-
(function (ErrorMessages) {
|
|
6
|
-
ErrorMessages["REQUIRED"] = "Expected value, but found value: {userInput}";
|
|
7
|
-
ErrorMessages["EMAIL"] = "Invalid Email format: {userInput}";
|
|
8
|
-
ErrorMessages["ISO_DATE"] = "Expected ISO string, but found value: {userInput}";
|
|
9
|
-
ErrorMessages["FILE"] = "Expected file url or base64 with mimeType, but found value: {userInput}";
|
|
10
|
-
ErrorMessages["NUMBER"] = "Expected number, but found value: {userInput}";
|
|
11
|
-
ErrorMessages["MAX_LENGTH"] = "The value: {userInput} may not be greater than {length} characters";
|
|
12
|
-
ErrorMessages["MIN_LENGTH"] = "The value: {userInput} must be at least {length} characters";
|
|
13
|
-
ErrorMessages["MAX"] = "The value: {userInput} must be {max} or less";
|
|
14
|
-
ErrorMessages["MIN"] = "The value: {userInput} must be {min} or more";
|
|
15
|
-
ErrorMessages["IN_RANGE"] = "The value: {userInput} must be at least {min} and less than or equal {max}";
|
|
16
|
-
ErrorMessages["URL"] = "The value: {userInput} is not a valid URL";
|
|
17
|
-
ErrorMessages["REGEX"] = "The value: {userInput} format is invalid";
|
|
18
|
-
ErrorMessages["IMAGE"] = "The {property} value must be an image";
|
|
19
|
-
ErrorMessages["ONE_OF"] = "The {userInput} is not a valid value, valid choices are: {choices}";
|
|
20
|
-
ErrorMessages["SIZE"] = "The {property} size must be less than 0:{size}KB";
|
|
21
|
-
})(ErrorMessages || (exports.ErrorMessages = ErrorMessages = {}));
|
|
22
|
-
//# sourceMappingURL=errors.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"errors.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/errors.ts"],"names":[],"mappings":";;;AAAA,IAAY,aAgBX;AAhBD,WAAY,aAAa;IACvB,0EAAyD,CAAA;IACzD,4DAA2C,CAAA;IAC3C,+EAA8D,CAAA;IAC9D,iGAAgF,CAAA;IAChF,yEAAwD,CAAA;IACxD,kGAAiF,CAAA;IACjF,2FAA0E,CAAA;IAC1E,qEAAoD,CAAA;IACpD,qEAAoD,CAAA;IACpD,wGAAuF,CAAA;IACvF,kEAAiD,CAAA;IACjD,mEAAkD,CAAA;IAClD,gEAA+C,CAAA;IAC/C,8FAA6E,CAAA;IAC7E,0EAAyD,CAAA;AAC3D,CAAC,EAhBW,aAAa,6BAAb,aAAa,QAgBxB"}
|
|
@@ -1,17 +0,0 @@
|
|
|
1
|
-
import { PieceProperty } from "../property";
|
|
2
|
-
export type ValidationErrors = Record<string, string[] | Record<string, string[]>>;
|
|
3
|
-
export type ValidatorFn = (property: PieceProperty, processedValue: any, userInput: any) => string | null;
|
|
4
|
-
export declare enum ValidationInputType {
|
|
5
|
-
NUMBER = "NUMBER",
|
|
6
|
-
STRING = "STRING",
|
|
7
|
-
FILE = "FILE",
|
|
8
|
-
ANY = "ANY",
|
|
9
|
-
DATE_TIME = "DATE_TIME",
|
|
10
|
-
OBJECT = "OBJECT",
|
|
11
|
-
ARRAY = "ARRAY",
|
|
12
|
-
JSON = "JSON"
|
|
13
|
-
}
|
|
14
|
-
export type TypedValidatorFn<T extends ValidationInputType> = {
|
|
15
|
-
type: T;
|
|
16
|
-
fn: ValidatorFn;
|
|
17
|
-
};
|
|
@@ -1,15 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.ValidationInputType = void 0;
|
|
4
|
-
var ValidationInputType;
|
|
5
|
-
(function (ValidationInputType) {
|
|
6
|
-
ValidationInputType["NUMBER"] = "NUMBER";
|
|
7
|
-
ValidationInputType["STRING"] = "STRING";
|
|
8
|
-
ValidationInputType["FILE"] = "FILE";
|
|
9
|
-
ValidationInputType["ANY"] = "ANY";
|
|
10
|
-
ValidationInputType["DATE_TIME"] = "DATE_TIME";
|
|
11
|
-
ValidationInputType["OBJECT"] = "OBJECT";
|
|
12
|
-
ValidationInputType["ARRAY"] = "ARRAY";
|
|
13
|
-
ValidationInputType["JSON"] = "JSON";
|
|
14
|
-
})(ValidationInputType || (exports.ValidationInputType = ValidationInputType = {}));
|
|
15
|
-
//# sourceMappingURL=types.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/types.ts"],"names":[],"mappings":";;;AAUA,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 +0,0 @@
|
|
|
1
|
-
export declare function formatErrorMessage(errorMessage: string, tokens: Record<string, any>): string;
|
|
@@ -1,12 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatErrorMessage = void 0;
|
|
4
|
-
function formatErrorMessage(errorMessage, tokens) {
|
|
5
|
-
let formattedMessage = errorMessage;
|
|
6
|
-
for (const key in tokens) {
|
|
7
|
-
formattedMessage = formattedMessage.replace(`{${key}}`, tokens[key]);
|
|
8
|
-
}
|
|
9
|
-
return formattedMessage;
|
|
10
|
-
}
|
|
11
|
-
exports.formatErrorMessage = formatErrorMessage;
|
|
12
|
-
//# sourceMappingURL=utils.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"utils.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/utils.ts"],"names":[],"mappings":";;;AAAA,SAAgB,kBAAkB,CAAC,YAAoB,EAAE,MAA2B;IAClF,IAAI,gBAAgB,GAAG,YAAY,CAAC;IACpC,KAAK,MAAM,GAAG,IAAI,MAAM,EAAE;QACxB,gBAAgB,GAAG,gBAAgB,CAAC,OAAO,CAAC,IAAI,GAAG,GAAG,EAAE,MAAM,CAAC,GAAG,CAAC,CAAC,CAAC;KACtE;IACD,OAAO,gBAAgB,CAAC;AAC1B,CAAC;AAND,gDAMC"}
|
|
@@ -1,19 +0,0 @@
|
|
|
1
|
-
import { ErrorMessages } from './errors';
|
|
2
|
-
import { ValidationErrors, TypedValidatorFn, ValidationInputType } from "./types";
|
|
3
|
-
import { formatErrorMessage } from "./utils";
|
|
4
|
-
declare class Validators {
|
|
5
|
-
static pattern(regex: string | RegExp): TypedValidatorFn<ValidationInputType.STRING>;
|
|
6
|
-
static maxLength(max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.STRING>;
|
|
7
|
-
static minLength(min: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.STRING>;
|
|
8
|
-
static minValue(min: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
9
|
-
static maxValue(max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
10
|
-
static inRange(min: number, max: number, includeBounds?: boolean): TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
11
|
-
static number: TypedValidatorFn<ValidationInputType.NUMBER>;
|
|
12
|
-
static image: TypedValidatorFn<ValidationInputType.FILE>;
|
|
13
|
-
static email: TypedValidatorFn<ValidationInputType.STRING>;
|
|
14
|
-
static url: TypedValidatorFn<ValidationInputType.STRING>;
|
|
15
|
-
static datetimeIso: TypedValidatorFn<ValidationInputType.DATE_TIME>;
|
|
16
|
-
static file: TypedValidatorFn<ValidationInputType.FILE>;
|
|
17
|
-
static oneOf(values: unknown[]): TypedValidatorFn<any>;
|
|
18
|
-
}
|
|
19
|
-
export { Validators, ErrorMessages, ValidationErrors, formatErrorMessage, };
|
|
@@ -1,177 +0,0 @@
|
|
|
1
|
-
"use strict";
|
|
2
|
-
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
|
-
exports.formatErrorMessage = exports.ErrorMessages = exports.Validators = void 0;
|
|
4
|
-
const lodash_1 = require("lodash");
|
|
5
|
-
const errors_1 = require("./errors");
|
|
6
|
-
Object.defineProperty(exports, "ErrorMessages", { enumerable: true, get: function () { return errors_1.ErrorMessages; } });
|
|
7
|
-
const types_1 = require("./types");
|
|
8
|
-
const utils_1 = require("./utils");
|
|
9
|
-
Object.defineProperty(exports, "formatErrorMessage", { enumerable: true, get: function () { return utils_1.formatErrorMessage; } });
|
|
10
|
-
class Validators {
|
|
11
|
-
static pattern(regex) {
|
|
12
|
-
return {
|
|
13
|
-
type: types_1.ValidationInputType.STRING,
|
|
14
|
-
fn: (property, processedValue, userInput) => {
|
|
15
|
-
if ((0, lodash_1.isEmpty)(processedValue))
|
|
16
|
-
return null;
|
|
17
|
-
if (typeof regex === 'string') {
|
|
18
|
-
regex = new RegExp(regex);
|
|
19
|
-
}
|
|
20
|
-
return regex.test(String(processedValue))
|
|
21
|
-
? null
|
|
22
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.REGEX, { property: property.displayName });
|
|
23
|
-
}
|
|
24
|
-
};
|
|
25
|
-
}
|
|
26
|
-
;
|
|
27
|
-
static maxLength(max, includeBounds = false) {
|
|
28
|
-
return {
|
|
29
|
-
type: types_1.ValidationInputType.STRING,
|
|
30
|
-
fn: (property, processedValue, userInput) => {
|
|
31
|
-
if ((0, lodash_1.isEmpty)(processedValue))
|
|
32
|
-
return null;
|
|
33
|
-
const isValid = includeBounds ? processedValue.length < max : processedValue.length <= max;
|
|
34
|
-
if (!isValid) {
|
|
35
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX_LENGTH, { userInput, length: max.toString() });
|
|
36
|
-
}
|
|
37
|
-
return null;
|
|
38
|
-
}
|
|
39
|
-
};
|
|
40
|
-
}
|
|
41
|
-
;
|
|
42
|
-
static minLength(min, includeBounds = false) {
|
|
43
|
-
return {
|
|
44
|
-
type: types_1.ValidationInputType.STRING,
|
|
45
|
-
fn: (property, processedValue, userInput) => {
|
|
46
|
-
if ((0, lodash_1.isEmpty)(processedValue))
|
|
47
|
-
return null;
|
|
48
|
-
const isValid = includeBounds ? processedValue.length > min : processedValue.length >= min;
|
|
49
|
-
if (!isValid) {
|
|
50
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN_LENGTH, { userInput, length: min.toString() });
|
|
51
|
-
}
|
|
52
|
-
return null;
|
|
53
|
-
}
|
|
54
|
-
};
|
|
55
|
-
}
|
|
56
|
-
;
|
|
57
|
-
static minValue(min, includeBounds = false) {
|
|
58
|
-
return {
|
|
59
|
-
type: types_1.ValidationInputType.NUMBER,
|
|
60
|
-
fn: (property, processedValue, userInput) => {
|
|
61
|
-
const isValid = includeBounds ? Number(processedValue) > min : processedValue.length >= min;
|
|
62
|
-
if (isValid)
|
|
63
|
-
return null;
|
|
64
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MIN, { userInput, min });
|
|
65
|
-
}
|
|
66
|
-
};
|
|
67
|
-
}
|
|
68
|
-
;
|
|
69
|
-
static maxValue(max, includeBounds = false) {
|
|
70
|
-
return {
|
|
71
|
-
type: types_1.ValidationInputType.NUMBER,
|
|
72
|
-
fn: (property, processedValue, userInput) => {
|
|
73
|
-
const isValid = includeBounds ? Number(processedValue) < max : processedValue.length <= max;
|
|
74
|
-
if (isValid)
|
|
75
|
-
return null;
|
|
76
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.MAX, { userInput, max });
|
|
77
|
-
}
|
|
78
|
-
};
|
|
79
|
-
}
|
|
80
|
-
;
|
|
81
|
-
static inRange(min, max, includeBounds = false) {
|
|
82
|
-
return {
|
|
83
|
-
type: types_1.ValidationInputType.NUMBER,
|
|
84
|
-
fn: (property, processedValue, userInput) => {
|
|
85
|
-
const numericValue = Number(processedValue);
|
|
86
|
-
const isValid = (includeBounds ? numericValue <= max : numericValue < max) &&
|
|
87
|
-
(includeBounds ? numericValue >= min : numericValue > min);
|
|
88
|
-
if (isValid)
|
|
89
|
-
return null;
|
|
90
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IN_RANGE, { userInput, min, max });
|
|
91
|
-
}
|
|
92
|
-
};
|
|
93
|
-
}
|
|
94
|
-
;
|
|
95
|
-
static oneOf(values) {
|
|
96
|
-
return {
|
|
97
|
-
type: types_1.ValidationInputType.ANY,
|
|
98
|
-
fn: (property, processedValue, userInput) => {
|
|
99
|
-
if (Array.isArray(values)) {
|
|
100
|
-
return values.includes(processedValue)
|
|
101
|
-
? null
|
|
102
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.ONE_OF, { userInput, choices: values });
|
|
103
|
-
}
|
|
104
|
-
return null;
|
|
105
|
-
}
|
|
106
|
-
};
|
|
107
|
-
}
|
|
108
|
-
}
|
|
109
|
-
exports.Validators = Validators;
|
|
110
|
-
Validators.number = {
|
|
111
|
-
type: types_1.ValidationInputType.NUMBER,
|
|
112
|
-
fn: (property, processedValue, userInput) => {
|
|
113
|
-
if (isNaN(processedValue)) {
|
|
114
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.NUMBER, { userInput });
|
|
115
|
-
}
|
|
116
|
-
return null;
|
|
117
|
-
}
|
|
118
|
-
};
|
|
119
|
-
Validators.image = {
|
|
120
|
-
type: types_1.ValidationInputType.FILE,
|
|
121
|
-
fn: (property, processedValue, userInput) => {
|
|
122
|
-
const regex = /\.(jpg|svg|jpeg|png|bmp|gif|webp)$/i;
|
|
123
|
-
return regex.test(processedValue.name)
|
|
124
|
-
? null
|
|
125
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.IMAGE, { property: property.displayName });
|
|
126
|
-
}
|
|
127
|
-
};
|
|
128
|
-
Validators.email = {
|
|
129
|
-
type: types_1.ValidationInputType.STRING,
|
|
130
|
-
fn: (property, processedValue, userInput) => {
|
|
131
|
-
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, lodash_1.isEmpty)(processedValue)) {
|
|
133
|
-
return null;
|
|
134
|
-
}
|
|
135
|
-
if ((0, lodash_1.isEmpty)(processedValue))
|
|
136
|
-
return null;
|
|
137
|
-
return pattern.test(String(processedValue))
|
|
138
|
-
? null
|
|
139
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.EMAIL, { userInput });
|
|
140
|
-
}
|
|
141
|
-
};
|
|
142
|
-
Validators.url = {
|
|
143
|
-
type: types_1.ValidationInputType.STRING,
|
|
144
|
-
fn: (property, processedValue, userInput) => {
|
|
145
|
-
const pattern = new RegExp('^((https?|ftp|file)://)?' + // protocol
|
|
146
|
-
'((([a-zA-Z\\d]([a-zA-Z\\d-]*[a-zA-Z\\d])*)\\.)+[a-zA-Z]{2,}|' + // domain name
|
|
147
|
-
'((\\d{1,3}\\.){3}\\d{1,3}))' + // OR ip (v4) address
|
|
148
|
-
'(\\:\\d+)?(\\/[-a-zA-Z\\d%_.~+]*)*' + // port and path
|
|
149
|
-
'(\\?[;&a-zA-Z\\d%_.~+=-]*)?' + // query string
|
|
150
|
-
'(\\#[-a-zA-Z\\d_]*)?$' // fragment locator
|
|
151
|
-
);
|
|
152
|
-
if ((0, lodash_1.isEmpty)(processedValue))
|
|
153
|
-
return null;
|
|
154
|
-
return pattern.test(String(processedValue))
|
|
155
|
-
? null
|
|
156
|
-
: (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.URL, { userInput });
|
|
157
|
-
}
|
|
158
|
-
};
|
|
159
|
-
Validators.datetimeIso = {
|
|
160
|
-
type: types_1.ValidationInputType.DATE_TIME,
|
|
161
|
-
fn: (property, processedValue, userInput) => {
|
|
162
|
-
if (property.required && (0, lodash_1.isNil)(processedValue)) {
|
|
163
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.ISO_DATE, { userInput });
|
|
164
|
-
}
|
|
165
|
-
return null;
|
|
166
|
-
}
|
|
167
|
-
};
|
|
168
|
-
Validators.file = {
|
|
169
|
-
type: types_1.ValidationInputType.FILE,
|
|
170
|
-
fn: (property, processedValue, userInput) => {
|
|
171
|
-
if (property.required && (0, lodash_1.isNil)(processedValue)) {
|
|
172
|
-
return (0, utils_1.formatErrorMessage)(errors_1.ErrorMessages.FILE, { userInput });
|
|
173
|
-
}
|
|
174
|
-
return null;
|
|
175
|
-
}
|
|
176
|
-
};
|
|
177
|
-
//# sourceMappingURL=validators.js.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"validators.js","sourceRoot":"","sources":["../../../../../../../packages/pieces/framework/src/lib/validators/validators.ts"],"names":[],"mappings":";;;AAAA,mCAAwC;AACxC,qCAAyC;AAiMvC,8FAjMO,sBAAa,OAiMP;AAhMf,mCAAkF;AAClF,mCAA6C;AAiM3C,mGAjMO,0BAAkB,OAiMP;AA/LpB,MAAM,UAAU;IAEd,MAAM,CAAC,OAAO,CAAC,KAAsB;QACnC,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;o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