@activepieces/pieces-common 0.2.34 → 0.2.36
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,11 +1,11 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@activepieces/pieces-common",
|
|
3
|
-
"version": "0.2.
|
|
3
|
+
"version": "0.2.36",
|
|
4
4
|
"type": "commonjs",
|
|
5
5
|
"dependencies": {
|
|
6
6
|
"@anthropic-ai/sdk": "0.27.3",
|
|
7
7
|
"@sinclair/typebox": "0.33.18",
|
|
8
|
-
"axios": "1.7.
|
|
8
|
+
"axios": "1.7.8",
|
|
9
9
|
"axios-retry": "4.4.1",
|
|
10
10
|
"deepmerge": "4.3.1",
|
|
11
11
|
"mime-types": "2.1.35",
|
|
@@ -14,8 +14,8 @@
|
|
|
14
14
|
"replicate": "0.34.1",
|
|
15
15
|
"semver": "7.6.0",
|
|
16
16
|
"zod": "3.23.8",
|
|
17
|
-
"@activepieces/pieces-framework": "0.7.
|
|
18
|
-
"@activepieces/shared": "0.10.
|
|
17
|
+
"@activepieces/pieces-framework": "0.7.41",
|
|
18
|
+
"@activepieces/shared": "0.10.131",
|
|
19
19
|
"tslib": "1.14.1"
|
|
20
20
|
},
|
|
21
21
|
"overrides": {
|
|
@@ -1,4 +1,4 @@
|
|
|
1
1
|
import { z } from "zod";
|
|
2
2
|
export declare const propsValidation: {
|
|
3
|
-
validateZod<T extends Record<string, unknown>>(props: T, schema: Partial<Record<keyof T, z.ZodType>>): void
|
|
3
|
+
validateZod<T extends Record<string, unknown>>(props: T, schema: Partial<Record<keyof T, z.ZodType>>): Promise<void>;
|
|
4
4
|
};
|
|
@@ -1,23 +1,26 @@
|
|
|
1
1
|
"use strict";
|
|
2
2
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
3
3
|
exports.propsValidation = void 0;
|
|
4
|
+
const tslib_1 = require("tslib");
|
|
4
5
|
const zod_1 = require("zod");
|
|
5
6
|
exports.propsValidation = {
|
|
6
7
|
validateZod(props, schema) {
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
catch (error) {
|
|
12
|
-
if (error instanceof zod_1.z.ZodError) {
|
|
13
|
-
const errors = error.errors.reduce((acc, err) => {
|
|
14
|
-
const path = err.path.join('.');
|
|
15
|
-
return Object.assign(Object.assign({}, acc), { [path]: err.message });
|
|
16
|
-
}, {});
|
|
17
|
-
throw new Error(JSON.stringify({ errors }, null, 2));
|
|
8
|
+
return tslib_1.__awaiter(this, void 0, void 0, function* () {
|
|
9
|
+
const schemaObj = zod_1.z.object(Object.entries(schema).reduce((acc, [key, value]) => (Object.assign(Object.assign({}, acc), { [key]: value })), {}));
|
|
10
|
+
try {
|
|
11
|
+
yield schemaObj.parseAsync(props);
|
|
18
12
|
}
|
|
19
|
-
|
|
20
|
-
|
|
13
|
+
catch (error) {
|
|
14
|
+
if (error instanceof zod_1.z.ZodError) {
|
|
15
|
+
const errors = error.errors.reduce((acc, err) => {
|
|
16
|
+
const path = err.path.join('.');
|
|
17
|
+
return Object.assign(Object.assign({}, acc), { [path]: err.message });
|
|
18
|
+
}, {});
|
|
19
|
+
throw new Error(JSON.stringify({ errors }, null, 2));
|
|
20
|
+
}
|
|
21
|
+
throw error;
|
|
22
|
+
}
|
|
23
|
+
});
|
|
21
24
|
}
|
|
22
25
|
};
|
|
23
26
|
//# sourceMappingURL=index.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/common/src/lib/validation/index.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"index.js","sourceRoot":"","sources":["../../../../../../../../packages/pieces/community/common/src/lib/validation/index.ts"],"names":[],"mappings":";;;;AAAA,6BAAuB;AAEV,QAAA,eAAe,GAAG;IACrB,WAAW,CAAoC,KAAQ,EAAE,MAA2C;;YACtG,MAAM,SAAS,GAAG,OAAC,CAAC,MAAM,CACtB,MAAM,CAAC,OAAO,CAAC,MAAM,CAAC,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,CAAC,GAAG,EAAE,KAAK,CAAC,EAAE,EAAE,CAAC,iCAC9C,GAAG,KACN,CAAC,GAAG,CAAC,EAAE,KAAK,IACd,EAAE,EAAE,CAAC,CACV,CAAA;YAED,IAAI,CAAC;gBACD,MAAM,SAAS,CAAC,UAAU,CAAC,KAAK,CAAC,CAAA;YACrC,CAAC;YAAC,OAAO,KAAK,EAAE,CAAC;gBACb,IAAI,KAAK,YAAY,OAAC,CAAC,QAAQ,EAAE,CAAC;oBAC9B,MAAM,MAAM,GAAG,KAAK,CAAC,MAAM,CAAC,MAAM,CAAC,CAAC,GAAG,EAAE,GAAG,EAAE,EAAE;wBAC5C,MAAM,IAAI,GAAG,GAAG,CAAC,IAAI,CAAC,IAAI,CAAC,GAAG,CAAC,CAAA;wBAC/B,uCACO,GAAG,KACN,CAAC,IAAI,CAAC,EAAE,GAAG,CAAC,OAAO,IACtB;oBACL,CAAC,EAAE,EAAE,CAAC,CAAA;oBACN,MAAM,IAAI,KAAK,CAAC,IAAI,CAAC,SAAS,CAAC,EAAE,MAAM,EAAE,EAAE,IAAI,EAAE,CAAC,CAAC,CAAC,CAAA;gBACxD,CAAC;gBACD,MAAM,KAAK,CAAA;YACf,CAAC;QACL,CAAC;KAAA;CACJ,CAAA"}
|