@mastra/schema-compat 0.10.4 → 0.10.5
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/.turbo/turbo-build.log +6 -6
- package/CHANGELOG.md +12 -0
- package/dist/index.cjs +2 -2
- package/dist/index.js +2 -2
- package/package.json +3 -3
- package/src/schema-compatibility.ts +2 -2
package/.turbo/turbo-build.log
CHANGED
|
@@ -1,23 +1,23 @@
|
|
|
1
1
|
|
|
2
|
-
> @mastra/schema-compat@0.10.
|
|
2
|
+
> @mastra/schema-compat@0.10.5-alpha.0 build /home/runner/work/mastra/mastra/packages/schema-compat
|
|
3
3
|
> tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting
|
|
4
4
|
|
|
5
5
|
[34mCLI[39m Building entry: src/index.ts
|
|
6
6
|
[34mCLI[39m Using tsconfig: tsconfig.json
|
|
7
7
|
[34mCLI[39m tsup v8.5.0
|
|
8
8
|
[34mTSC[39m Build start
|
|
9
|
-
[32mTSC[39m ⚡️ Build success in
|
|
9
|
+
[32mTSC[39m ⚡️ Build success in 2195ms
|
|
10
10
|
[34mDTS[39m Build start
|
|
11
|
-
[34mCLI[39m Target: es2022
|
|
12
11
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
13
12
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.ts[39m
|
|
14
13
|
Analysis will use the bundled TypeScript version 5.8.3
|
|
15
14
|
[36mWriting package typings: /home/runner/work/mastra/mastra/packages/schema-compat/dist/_tsup-dts-rollup.d.cts[39m
|
|
16
|
-
[32mDTS[39m ⚡️ Build success in
|
|
15
|
+
[32mDTS[39m ⚡️ Build success in 1946ms
|
|
16
|
+
[34mCLI[39m Target: es2022
|
|
17
17
|
[34mCLI[39m Cleaning output folder
|
|
18
18
|
[34mESM[39m Build start
|
|
19
19
|
[34mCJS[39m Build start
|
|
20
20
|
[32mESM[39m [1mdist/index.js [22m[32m21.14 KB[39m
|
|
21
|
-
[32mESM[39m ⚡️ Build success in
|
|
21
|
+
[32mESM[39m ⚡️ Build success in 140ms
|
|
22
22
|
[32mCJS[39m [1mdist/index.cjs [22m[32m21.76 KB[39m
|
|
23
|
-
[32mCJS[39m ⚡️ Build success in
|
|
23
|
+
[32mCJS[39m ⚡️ Build success in 139ms
|
package/CHANGELOG.md
CHANGED
|
@@ -1,5 +1,17 @@
|
|
|
1
1
|
# @mastra/schema-compat
|
|
2
2
|
|
|
3
|
+
## 0.10.5
|
|
4
|
+
|
|
5
|
+
### Patch Changes
|
|
6
|
+
|
|
7
|
+
- 4da943f: Fix Cannot read properties of undefined (reading 'typeName') in schema compat check
|
|
8
|
+
|
|
9
|
+
## 0.10.5-alpha.0
|
|
10
|
+
|
|
11
|
+
### Patch Changes
|
|
12
|
+
|
|
13
|
+
- 4da943f: Fix Cannot read properties of undefined (reading 'typeName') in schema compat check
|
|
14
|
+
|
|
3
15
|
## 0.10.4
|
|
4
16
|
|
|
5
17
|
### Patch Changes
|
package/dist/index.cjs
CHANGED
|
@@ -162,8 +162,8 @@ var SchemaCompatLayer = class {
|
|
|
162
162
|
* @throws Error if the type is in the unsupported list
|
|
163
163
|
*/
|
|
164
164
|
defaultUnsupportedZodTypeHandler(value, throwOnTypes = UNSUPPORTED_ZOD_TYPES) {
|
|
165
|
-
if (throwOnTypes.includes(value._def
|
|
166
|
-
throw new Error(`${this.model.modelId} does not support zod type: ${value._def
|
|
165
|
+
if (throwOnTypes.includes(value._def?.typeName)) {
|
|
166
|
+
throw new Error(`${this.model.modelId} does not support zod type: ${value._def?.typeName}`);
|
|
167
167
|
}
|
|
168
168
|
return value;
|
|
169
169
|
}
|
package/dist/index.js
CHANGED
|
@@ -160,8 +160,8 @@ var SchemaCompatLayer = class {
|
|
|
160
160
|
* @throws Error if the type is in the unsupported list
|
|
161
161
|
*/
|
|
162
162
|
defaultUnsupportedZodTypeHandler(value, throwOnTypes = UNSUPPORTED_ZOD_TYPES) {
|
|
163
|
-
if (throwOnTypes.includes(value._def
|
|
164
|
-
throw new Error(`${this.model.modelId} does not support zod type: ${value._def
|
|
163
|
+
if (throwOnTypes.includes(value._def?.typeName)) {
|
|
164
|
+
throw new Error(`${this.model.modelId} does not support zod type: ${value._def?.typeName}`);
|
|
165
165
|
}
|
|
166
166
|
return value;
|
|
167
167
|
}
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@mastra/schema-compat",
|
|
3
|
-
"version": "0.10.
|
|
3
|
+
"version": "0.10.5",
|
|
4
4
|
"description": "Tool schema compatibility layer for Mastra.ai",
|
|
5
5
|
"type": "module",
|
|
6
6
|
"main": "dist/index.js",
|
|
@@ -40,12 +40,12 @@
|
|
|
40
40
|
"@types/json-schema": "^7.0.15",
|
|
41
41
|
"@types/node": "^20.19.0",
|
|
42
42
|
"ai": "4.3.16",
|
|
43
|
-
"eslint": "^9.
|
|
43
|
+
"eslint": "^9.30.1",
|
|
44
44
|
"tsup": "^8.5.0",
|
|
45
45
|
"typescript": "^5.8.3",
|
|
46
46
|
"vitest": "^3.2.4",
|
|
47
47
|
"zod": "^3.25.67",
|
|
48
|
-
"@internal/lint": "0.0.
|
|
48
|
+
"@internal/lint": "0.0.20"
|
|
49
49
|
},
|
|
50
50
|
"scripts": {
|
|
51
51
|
"build": "tsup src/index.ts --format esm,cjs --experimental-dts --clean --treeshake=smallest --splitting",
|
|
@@ -300,8 +300,8 @@ export abstract class SchemaCompatLayer {
|
|
|
300
300
|
value: z.ZodTypeAny,
|
|
301
301
|
throwOnTypes: readonly UnsupportedZodType[] = UNSUPPORTED_ZOD_TYPES,
|
|
302
302
|
): ShapeValue<T> {
|
|
303
|
-
if (throwOnTypes.includes(value._def
|
|
304
|
-
throw new Error(`${this.model.modelId} does not support zod type: ${value._def
|
|
303
|
+
if (throwOnTypes.includes(value._def?.typeName as UnsupportedZodType)) {
|
|
304
|
+
throw new Error(`${this.model.modelId} does not support zod type: ${value._def?.typeName}`);
|
|
305
305
|
}
|
|
306
306
|
return value as ShapeValue<T>;
|
|
307
307
|
}
|