@mastra/schema-compat 1.3.16-alpha.0 → 1.3.16
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/dist/_types/@internal_ai-sdk-v5/dist/index.d.ts +206 -873
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +851 -1176
- package/dist/{esm-CWlHuVIx.js → esm-DA8owk0L.js} +60 -70
- package/dist/{esm-CWlHuVIx.js.map → esm-DA8owk0L.js.map} +1 -1
- package/dist/{esm-CkNCkZSB.cjs → esm-zrVJTTxY.cjs} +60 -70
- package/dist/{esm-CkNCkZSB.cjs.map → esm-zrVJTTxY.cjs.map} +1 -1
- package/dist/index.cjs +146 -153
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +146 -153
- package/dist/index.js.map +1 -1
- package/dist/{json-schema-R8yfooPa.js → json-schema-DcMkkbbI.js} +55 -46
- package/dist/{json-schema-R8yfooPa.js.map → json-schema-DcMkkbbI.js.map} +1 -1
- package/dist/{json-schema-VSnKq6-P.cjs → json-schema-Dh7B27IP.cjs} +55 -46
- package/dist/{json-schema-VSnKq6-P.cjs.map → json-schema-Dh7B27IP.cjs.map} +1 -1
- package/dist/{json-schema-traverse-DbuWNYgg.cjs → json-schema-traverse-CKLDTw5l.cjs} +3 -3
- package/dist/{json-schema-traverse-DbuWNYgg.cjs.map → json-schema-traverse-CKLDTw5l.cjs.map} +1 -1
- package/dist/{json-schema-traverse-B35mHRM8.js → json-schema-traverse-Jrimn_T_.js} +3 -3
- package/dist/{json-schema-traverse-B35mHRM8.js.map → json-schema-traverse-Jrimn_T_.js.map} +1 -1
- package/dist/json-to-zod.cjs +84 -72
- package/dist/json-to-zod.cjs.map +1 -1
- package/dist/json-to-zod.js +84 -72
- package/dist/json-to-zod.js.map +1 -1
- package/dist/{schema-IhrnbMI3.cjs → schema-BXSe2bgB.cjs} +3 -3
- package/dist/schema-BXSe2bgB.cjs.map +1 -0
- package/dist/{schema-e0VHpMt0.js → schema-CzbEIyhE.js} +2 -2
- package/dist/{schema-e0VHpMt0.js.map → schema-CzbEIyhE.js.map} +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.js +1 -2
- package/dist/standard-schema/adapters/ai-sdk.cjs +1 -5
- package/dist/standard-schema/adapters/ai-sdk.cjs.map +1 -1
- package/dist/standard-schema/adapters/ai-sdk.js +1 -5
- package/dist/standard-schema/adapters/ai-sdk.js.map +1 -1
- package/dist/standard-schema/adapters/json-schema.cjs +1 -1
- package/dist/standard-schema/adapters/json-schema.js +1 -2
- package/dist/standard-schema/adapters/zod-v3.cjs +2 -2
- package/dist/standard-schema/adapters/zod-v3.js +2 -2
- package/dist/zod-to-json.cjs +5 -3
- package/dist/zod-to-json.cjs.map +1 -1
- package/dist/zod-to-json.js +5 -3
- package/dist/zod-to-json.js.map +1 -1
- package/package.json +14 -15
- package/dist/schema-IhrnbMI3.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
const require_json_schema_traverse$1 = require("./json-schema-traverse-
|
|
1
|
+
const require_json_schema_traverse$1 = require("./json-schema-traverse-CKLDTw5l.cjs");
|
|
2
2
|
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/ajv/8.20.0/030cdf17be110aa8137679eb877279b0c80ee1367e93a2fc22ecf4c20a1be629/node_modules/ajv/dist/compile/codegen/code.js
|
|
3
3
|
var require_code$1 = /* @__PURE__ */ require_json_schema_traverse$1.__commonJSMin(((exports) => {
|
|
4
4
|
Object.defineProperty(exports, "__esModule", { value: true });
|
|
@@ -1941,10 +1941,12 @@ var require_resolve = /* @__PURE__ */ require_json_schema_traverse$1.__commonJSM
|
|
|
1941
1941
|
let schOrRef = this.refs[ref];
|
|
1942
1942
|
if (typeof schOrRef == "string") schOrRef = this.refs[schOrRef];
|
|
1943
1943
|
if (typeof schOrRef == "object") checkAmbiguosRef(sch, schOrRef.schema, ref);
|
|
1944
|
-
else if (ref !== normalizeId(fullPath))
|
|
1945
|
-
|
|
1946
|
-
|
|
1947
|
-
|
|
1944
|
+
else if (ref !== normalizeId(fullPath)) {
|
|
1945
|
+
if (ref[0] === "#") {
|
|
1946
|
+
checkAmbiguosRef(sch, localRefs[ref], ref);
|
|
1947
|
+
localRefs[ref] = sch;
|
|
1948
|
+
} else this.refs[ref] = fullPath;
|
|
1949
|
+
}
|
|
1948
1950
|
return ref;
|
|
1949
1951
|
}
|
|
1950
1952
|
function addAnchor(anchor) {
|
|
@@ -2870,15 +2872,16 @@ var require_utils = /* @__PURE__ */ require_json_schema_traverse$1.__commonJSMin
|
|
|
2870
2872
|
let nextSlash = -1;
|
|
2871
2873
|
let len = 0;
|
|
2872
2874
|
while (len = input.length) {
|
|
2873
|
-
if (len === 1)
|
|
2874
|
-
|
|
2875
|
-
|
|
2876
|
-
|
|
2877
|
-
|
|
2878
|
-
|
|
2879
|
-
|
|
2880
|
-
|
|
2881
|
-
|
|
2875
|
+
if (len === 1) {
|
|
2876
|
+
if (input === ".") break;
|
|
2877
|
+
else if (input === "/") {
|
|
2878
|
+
output.push("/");
|
|
2879
|
+
break;
|
|
2880
|
+
} else {
|
|
2881
|
+
output.push(input);
|
|
2882
|
+
break;
|
|
2883
|
+
}
|
|
2884
|
+
} else if (len === 2) {
|
|
2882
2885
|
if (input[0] === ".") {
|
|
2883
2886
|
if (input[1] === ".") break;
|
|
2884
2887
|
else if (input[1] === "/") {
|
|
@@ -3567,8 +3570,10 @@ var require_fast_uri = /* @__PURE__ */ require_json_schema_traverse$1.__commonJS
|
|
|
3567
3570
|
if (schemeHandler && schemeHandler.serialize) schemeHandler.serialize(component, options);
|
|
3568
3571
|
const hasAuthority = component.userinfo !== void 0 || component.host !== void 0 || component.port !== void 0;
|
|
3569
3572
|
const pathNoScheme = !options.skipEscape && component.scheme === void 0 && !hasAuthority;
|
|
3570
|
-
if (component.path !== void 0)
|
|
3571
|
-
|
|
3573
|
+
if (component.path !== void 0) {
|
|
3574
|
+
if (!options.skipEscape) component.path = serializePathEncoding(component.path, pathNoScheme);
|
|
3575
|
+
else component.path = normalizePercentEncoding(component.path);
|
|
3576
|
+
}
|
|
3572
3577
|
if (options.reference !== "suffix" && component.scheme) {
|
|
3573
3578
|
component.scheme = decodeValidScheme(component.scheme);
|
|
3574
3579
|
uriTokens.push(component.scheme, ":");
|
|
@@ -3678,8 +3683,10 @@ var require_fast_uri = /* @__PURE__ */ require_json_schema_traverse$1.__commonJS
|
|
|
3678
3683
|
let malformedIPLiteral = false;
|
|
3679
3684
|
let malformedScheme = false;
|
|
3680
3685
|
let isIP = false;
|
|
3681
|
-
if (options.reference === "suffix")
|
|
3682
|
-
|
|
3686
|
+
if (options.reference === "suffix") {
|
|
3687
|
+
if (options.scheme) uri = options.scheme + ":" + uri;
|
|
3688
|
+
else uri = "//" + uri;
|
|
3689
|
+
}
|
|
3683
3690
|
const authorityMatch = uri.match(AUTHORITY_PREFIX);
|
|
3684
3691
|
if (authorityMatch !== null && authorityMatch[1].indexOf("\\") !== -1) {
|
|
3685
3692
|
parsed.error = "URI authority must not contain a literal backslash.";
|
|
@@ -3724,18 +3731,20 @@ var require_fast_uri = /* @__PURE__ */ require_json_schema_traverse$1.__commonJS
|
|
|
3724
3731
|
parsed.error = parsed.error || parseError;
|
|
3725
3732
|
malformedAuthorityOrPort = true;
|
|
3726
3733
|
}
|
|
3727
|
-
if (parsed.host)
|
|
3728
|
-
|
|
3729
|
-
|
|
3730
|
-
|
|
3731
|
-
|
|
3732
|
-
|
|
3733
|
-
|
|
3734
|
-
|
|
3735
|
-
|
|
3736
|
-
|
|
3737
|
-
|
|
3738
|
-
|
|
3734
|
+
if (parsed.host) {
|
|
3735
|
+
if (isIPv4(parsed.host) === false) {
|
|
3736
|
+
const bracketedIPLiteral = isIPLiteral(parsed.host);
|
|
3737
|
+
const hasIPLiteralBracket = parsed.host.indexOf("[") !== -1 || parsed.host.indexOf("]") !== -1;
|
|
3738
|
+
const ipv6result = normalizeIPv6(parsed.host);
|
|
3739
|
+
isIP = ipv6result.isIPV6 || ipv6result.isIPVFuture === true;
|
|
3740
|
+
malformedIPLiteral = hasIPLiteralBracket && (!bracketedIPLiteral || ipv6result.error === true);
|
|
3741
|
+
parsed.host = isIP ? ipv6result.host : ipv6result.host.toLowerCase();
|
|
3742
|
+
if (malformedIPLiteral) {
|
|
3743
|
+
parsed.error = parsed.error || "URI host is malformed.";
|
|
3744
|
+
malformedAuthorityOrPort = true;
|
|
3745
|
+
}
|
|
3746
|
+
} else isIP = true;
|
|
3747
|
+
}
|
|
3739
3748
|
if (parsed.scheme === void 0 && parsed.userinfo === void 0 && parsed.host === void 0 && parsed.port === void 0 && parsed.query === void 0 && !parsed.path) parsed.reference = "same-document";
|
|
3740
3749
|
else if (parsed.scheme === void 0) parsed.reference = "relative";
|
|
3741
3750
|
else if (parsed.fragment === void 0) parsed.reference = "absolute";
|
|
@@ -4502,17 +4511,21 @@ var require_ref = /* @__PURE__ */ require_json_schema_traverse$1.__commonJSMin((
|
|
|
4502
4511
|
var _a;
|
|
4503
4512
|
if (!it.opts.unevaluated) return;
|
|
4504
4513
|
const schEvaluated = (_a = sch === null || sch === void 0 ? void 0 : sch.validate) === null || _a === void 0 ? void 0 : _a.evaluated;
|
|
4505
|
-
if (it.props !== true)
|
|
4506
|
-
if (schEvaluated
|
|
4507
|
-
|
|
4508
|
-
|
|
4509
|
-
|
|
4514
|
+
if (it.props !== true) {
|
|
4515
|
+
if (schEvaluated && !schEvaluated.dynamicProps) {
|
|
4516
|
+
if (schEvaluated.props !== void 0) it.props = util_1.mergeEvaluated.props(gen, schEvaluated.props, it.props);
|
|
4517
|
+
} else {
|
|
4518
|
+
const props = gen.var("props", (0, codegen_1._)`${source}.evaluated.props`);
|
|
4519
|
+
it.props = util_1.mergeEvaluated.props(gen, props, it.props, codegen_1.Name);
|
|
4520
|
+
}
|
|
4510
4521
|
}
|
|
4511
|
-
if (it.items !== true)
|
|
4512
|
-
if (schEvaluated
|
|
4513
|
-
|
|
4514
|
-
|
|
4515
|
-
|
|
4522
|
+
if (it.items !== true) {
|
|
4523
|
+
if (schEvaluated && !schEvaluated.dynamicItems) {
|
|
4524
|
+
if (schEvaluated.items !== void 0) it.items = util_1.mergeEvaluated.items(gen, schEvaluated.items, it.items);
|
|
4525
|
+
} else {
|
|
4526
|
+
const items = gen.var("items", (0, codegen_1._)`${source}.evaluated.items`);
|
|
4527
|
+
it.items = util_1.mergeEvaluated.items(gen, items, it.items, codegen_1.Name);
|
|
4528
|
+
}
|
|
4516
4529
|
}
|
|
4517
4530
|
}
|
|
4518
4531
|
}
|
|
@@ -7042,11 +7055,7 @@ var JsonSchemaWrapper = class {
|
|
|
7042
7055
|
case "draft-07":
|
|
7043
7056
|
clonedSchema.$schema = "http://json-schema.org/draft-07/schema#";
|
|
7044
7057
|
break;
|
|
7045
|
-
case "draft-2020-12":
|
|
7046
|
-
clonedSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
7047
|
-
break;
|
|
7048
|
-
case "openapi-3.0": break;
|
|
7049
|
-
default: break;
|
|
7058
|
+
case "draft-2020-12": clonedSchema.$schema = "https://json-schema.org/draft/2020-12/schema";
|
|
7050
7059
|
}
|
|
7051
7060
|
if (options?.libraryOptions?.override) {
|
|
7052
7061
|
const override = options.libraryOptions.override;
|
|
@@ -7140,4 +7149,4 @@ Object.defineProperty(exports, "toStandardSchema", {
|
|
|
7140
7149
|
}
|
|
7141
7150
|
});
|
|
7142
7151
|
|
|
7143
|
-
//# sourceMappingURL=json-schema-
|
|
7152
|
+
//# sourceMappingURL=json-schema-Dh7B27IP.cjs.map
|