@mastra/schema-compat 1.3.16 → 1.3.17-alpha.0
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 +65 -13
- package/dist/_types/@internal_ai-v6/dist/index.d.ts +110 -35
- package/dist/{esm-DA8owk0L.js → esm-BG70JlG8.js} +39 -77
- package/dist/{esm-DA8owk0L.js.map → esm-BG70JlG8.js.map} +1 -1
- package/dist/{esm-zrVJTTxY.cjs → esm-BQeGF7AD.cjs} +39 -77
- package/dist/{esm-zrVJTTxY.cjs.map → esm-BQeGF7AD.cjs.map} +1 -1
- package/dist/index.cjs +18 -34
- package/dist/index.cjs.map +1 -1
- package/dist/index.js +18 -34
- package/dist/index.js.map +1 -1
- package/dist/{json-schema-Dh7B27IP.cjs → json-schema-7oyknwMS.cjs} +189 -204
- package/dist/json-schema-7oyknwMS.cjs.map +1 -0
- package/dist/{json-schema-DcMkkbbI.js → json-schema-BdCwqjfN.js} +189 -204
- package/dist/json-schema-BdCwqjfN.js.map +1 -0
- package/dist/{json-schema-traverse-Jrimn_T_.js → json-schema-traverse-D0CId4oM.js} +3 -5
- package/dist/{json-schema-traverse-Jrimn_T_.js.map → json-schema-traverse-D0CId4oM.js.map} +1 -1
- package/dist/{json-schema-traverse-CKLDTw5l.cjs → json-schema-traverse-evfp8uQX.cjs} +3 -5
- package/dist/{json-schema-traverse-CKLDTw5l.cjs.map → json-schema-traverse-evfp8uQX.cjs.map} +1 -1
- package/dist/json-to-zod.cjs +70 -71
- package/dist/json-to-zod.cjs.map +1 -1
- package/dist/json-to-zod.d.ts.map +1 -1
- package/dist/json-to-zod.js +70 -71
- package/dist/json-to-zod.js.map +1 -1
- package/dist/{schema-CzbEIyhE.js → schema-Bf12g7KC.js} +4 -6
- package/dist/{schema-CzbEIyhE.js.map → schema-Bf12g7KC.js.map} +1 -1
- package/dist/{schema-BXSe2bgB.cjs → schema-D2ab1-Dc.cjs} +5 -7
- package/dist/{schema-BXSe2bgB.cjs.map → schema-D2ab1-Dc.cjs.map} +1 -1
- package/dist/schema.cjs +1 -1
- package/dist/schema.js +1 -1
- package/dist/standard-schema/adapters/ai-sdk.cjs +1 -2
- package/dist/standard-schema/adapters/ai-sdk.js +1 -2
- package/dist/standard-schema/adapters/json-schema.cjs +1 -1
- package/dist/standard-schema/adapters/json-schema.js +1 -1
- package/dist/standard-schema/adapters/zod-v3.cjs +3 -4
- package/dist/standard-schema/adapters/zod-v3.cjs.map +1 -1
- package/dist/standard-schema/adapters/zod-v3.js +3 -4
- package/dist/standard-schema/adapters/zod-v3.js.map +1 -1
- package/dist/zod-to-json.cjs +2 -3
- package/dist/zod-to-json.js +2 -3
- package/package.json +18 -18
- package/dist/json-schema-DcMkkbbI.js.map +0 -1
- package/dist/json-schema-Dh7B27IP.cjs.map +0 -1
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,8 +20,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js
|
|
23
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js
|
|
25
24
|
var require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
26
25
|
var traverse = module.exports = function(schema, opts, cb) {
|
|
27
26
|
if (typeof opts == "function") {
|
|
@@ -95,7 +94,6 @@ var require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
95
94
|
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
96
95
|
}
|
|
97
96
|
}));
|
|
98
|
-
//#endregion
|
|
99
97
|
export { __commonJSMin as n, __toESM as r, require_json_schema_traverse as t };
|
|
100
98
|
|
|
101
|
-
//# sourceMappingURL=json-schema-traverse-
|
|
99
|
+
//# sourceMappingURL=json-schema-traverse-D0CId4oM.js.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-traverse-
|
|
1
|
+
{"version":3,"file":"json-schema-traverse-D0CId4oM.js","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js"],"sourcesContent":["'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAEA,IAAI,WAAW,OAAO,UAAU,SAAU,QAAQ,MAAM,IAAI;EAE1D,IAAI,OAAO,QAAQ,YAAY;GAC7B,KAAK;GACL,OAAO,CAAC;EACV;EAEA,KAAK,KAAK,MAAM;EAChB,IAAI,MAAO,OAAO,MAAM,aAAc,KAAK,GAAG,OAAO,WAAW,CAAC;EACjE,IAAI,OAAO,GAAG,QAAQ,WAAW,CAAC;EAElC,UAAU,MAAM,KAAK,MAAM,QAAQ,IAAI,MAAM;CAC/C;CAGA,SAAS,WAAW;EAClB,iBAAiB;EACjB,OAAO;EACP,UAAU;EACV,sBAAsB;EACtB,eAAe;EACf,KAAK;EACL,IAAI;EACJ,MAAM;EACN,MAAM;CACR;CAEA,SAAS,gBAAgB;EACvB,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;CACT;CAEA,SAAS,gBAAgB;EACvB,OAAO;EACP,aAAa;EACb,YAAY;EACZ,mBAAmB;EACnB,cAAc;CAChB;CAEA,SAAS,eAAe;EACtB,SAAS;EACT,MAAM;EACN,OAAO;EACP,UAAU;EACV,SAAS;EACT,SAAS;EACT,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,WAAW;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,aAAa;EACb,eAAe;EACf,eAAe;CACjB;CAGA,SAAS,UAAU,MAAM,KAAK,MAAM,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,UAAU;EACrH,IAAI,UAAU,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM,GAAG;GACjE,IAAI,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,QAAQ;GACrF,KAAK,IAAI,OAAO,QAAQ;IACtB,IAAI,MAAM,OAAO;IACjB,IAAI,MAAM,QAAQ,GAAG,GACf;SAAA,OAAO,SAAS,eAClB,KAAK,IAAI,IAAE,GAAG,IAAE,IAAI,QAAQ,KAC1B,UAAU,MAAM,KAAK,MAAM,IAAI,IAAI,UAAU,MAAM,MAAM,MAAM,GAAG,YAAY,SAAS,KAAK,QAAQ,CAAC;IAAA,OAEpG,IAAI,OAAO,SAAS,eACrB;SAAA,OAAO,OAAO,OAAO,UACvB,KAAK,IAAI,QAAQ,KACf,UAAU,MAAM,KAAK,MAAM,IAAI,OAAO,UAAU,MAAM,MAAM,MAAM,cAAc,IAAI,GAAG,YAAY,SAAS,KAAK,QAAQ,IAAI;IAAA,OAE5H,IAAI,OAAO,SAAS,YAAa,KAAK,WAAW,EAAE,OAAO,SAAS,eACxE,UAAU,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,KAAK,YAAY,SAAS,KAAK,MAAM;GAEzF;GACA,KAAK,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,QAAQ;EACxF;CACF;CAGA,SAAS,cAAc,KAAK;EAC1B,OAAO,IAAI,QAAQ,MAAM,IAAI,CAAC,CAAC,QAAQ,OAAO,IAAI;CACpD"}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
|
|
1
|
+
// \0rolldown/runtime.js
|
|
2
2
|
var __create = Object.create;
|
|
3
3
|
var __defProp = Object.defineProperty;
|
|
4
4
|
var __getOwnPropDesc = Object.getOwnPropertyDescriptor;
|
|
@@ -20,8 +20,7 @@ var __toESM = (mod, isNodeMode, target) => (target = mod != null ? __create(__ge
|
|
|
20
20
|
value: mod,
|
|
21
21
|
enumerable: true
|
|
22
22
|
}) : target, mod));
|
|
23
|
-
|
|
24
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js
|
|
23
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js
|
|
25
24
|
var require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, module) => {
|
|
26
25
|
var traverse = module.exports = function(schema, opts, cb) {
|
|
27
26
|
if (typeof opts == "function") {
|
|
@@ -95,7 +94,6 @@ var require_json_schema_traverse = /* @__PURE__ */ __commonJSMin(((exports, modu
|
|
|
95
94
|
return str.replace(/~/g, "~0").replace(/\//g, "~1");
|
|
96
95
|
}
|
|
97
96
|
}));
|
|
98
|
-
//#endregion
|
|
99
97
|
Object.defineProperty(exports, "__commonJSMin", {
|
|
100
98
|
enumerable: true,
|
|
101
99
|
get: function() {
|
|
@@ -115,4 +113,4 @@ Object.defineProperty(exports, "require_json_schema_traverse", {
|
|
|
115
113
|
}
|
|
116
114
|
});
|
|
117
115
|
|
|
118
|
-
//# sourceMappingURL=json-schema-traverse-
|
|
116
|
+
//# sourceMappingURL=json-schema-traverse-evfp8uQX.cjs.map
|
package/dist/{json-schema-traverse-CKLDTw5l.cjs.map → json-schema-traverse-evfp8uQX.cjs.map}
RENAMED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"json-schema-traverse-
|
|
1
|
+
{"version":3,"file":"json-schema-traverse-evfp8uQX.cjs","names":[],"sources":["../../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-traverse/1.0.0/57629b43e2af2bb885dfbbc8334b79bda8a7cd4a9b7fff008a3a0a2e53fb18be/node_modules/json-schema-traverse/index.js"],"sourcesContent":["'use strict';\n\nvar traverse = module.exports = function (schema, opts, cb) {\n // Legacy support for v0.3.1 and earlier.\n if (typeof opts == 'function') {\n cb = opts;\n opts = {};\n }\n\n cb = opts.cb || cb;\n var pre = (typeof cb == 'function') ? cb : cb.pre || function() {};\n var post = cb.post || function() {};\n\n _traverse(opts, pre, post, schema, '', schema);\n};\n\n\ntraverse.keywords = {\n additionalItems: true,\n items: true,\n contains: true,\n additionalProperties: true,\n propertyNames: true,\n not: true,\n if: true,\n then: true,\n else: true\n};\n\ntraverse.arrayKeywords = {\n items: true,\n allOf: true,\n anyOf: true,\n oneOf: true\n};\n\ntraverse.propsKeywords = {\n $defs: true,\n definitions: true,\n properties: true,\n patternProperties: true,\n dependencies: true\n};\n\ntraverse.skipKeywords = {\n default: true,\n enum: true,\n const: true,\n required: true,\n maximum: true,\n minimum: true,\n exclusiveMaximum: true,\n exclusiveMinimum: true,\n multipleOf: true,\n maxLength: true,\n minLength: true,\n pattern: true,\n format: true,\n maxItems: true,\n minItems: true,\n uniqueItems: true,\n maxProperties: true,\n minProperties: true\n};\n\n\nfunction _traverse(opts, pre, post, schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex) {\n if (schema && typeof schema == 'object' && !Array.isArray(schema)) {\n pre(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n for (var key in schema) {\n var sch = schema[key];\n if (Array.isArray(sch)) {\n if (key in traverse.arrayKeywords) {\n for (var i=0; i<sch.length; i++)\n _traverse(opts, pre, post, sch[i], jsonPtr + '/' + key + '/' + i, rootSchema, jsonPtr, key, schema, i);\n }\n } else if (key in traverse.propsKeywords) {\n if (sch && typeof sch == 'object') {\n for (var prop in sch)\n _traverse(opts, pre, post, sch[prop], jsonPtr + '/' + key + '/' + escapeJsonPtr(prop), rootSchema, jsonPtr, key, schema, prop);\n }\n } else if (key in traverse.keywords || (opts.allKeys && !(key in traverse.skipKeywords))) {\n _traverse(opts, pre, post, sch, jsonPtr + '/' + key, rootSchema, jsonPtr, key, schema);\n }\n }\n post(schema, jsonPtr, rootSchema, parentJsonPtr, parentKeyword, parentSchema, keyIndex);\n }\n}\n\n\nfunction escapeJsonPtr(str) {\n return str.replace(/~/g, '~0').replace(/\\//g, '~1');\n}\n"],"ignoreList":[0],"mappings":";;;;;;;;;;;;;;;;;;;;;;;;CAEA,IAAI,WAAW,OAAO,UAAU,SAAU,QAAQ,MAAM,IAAI;EAE1D,IAAI,OAAO,QAAQ,YAAY;GAC7B,KAAK;GACL,OAAO,CAAC;EACV;EAEA,KAAK,KAAK,MAAM;EAChB,IAAI,MAAO,OAAO,MAAM,aAAc,KAAK,GAAG,OAAO,WAAW,CAAC;EACjE,IAAI,OAAO,GAAG,QAAQ,WAAW,CAAC;EAElC,UAAU,MAAM,KAAK,MAAM,QAAQ,IAAI,MAAM;CAC/C;CAGA,SAAS,WAAW;EAClB,iBAAiB;EACjB,OAAO;EACP,UAAU;EACV,sBAAsB;EACtB,eAAe;EACf,KAAK;EACL,IAAI;EACJ,MAAM;EACN,MAAM;CACR;CAEA,SAAS,gBAAgB;EACvB,OAAO;EACP,OAAO;EACP,OAAO;EACP,OAAO;CACT;CAEA,SAAS,gBAAgB;EACvB,OAAO;EACP,aAAa;EACb,YAAY;EACZ,mBAAmB;EACnB,cAAc;CAChB;CAEA,SAAS,eAAe;EACtB,SAAS;EACT,MAAM;EACN,OAAO;EACP,UAAU;EACV,SAAS;EACT,SAAS;EACT,kBAAkB;EAClB,kBAAkB;EAClB,YAAY;EACZ,WAAW;EACX,WAAW;EACX,SAAS;EACT,QAAQ;EACR,UAAU;EACV,UAAU;EACV,aAAa;EACb,eAAe;EACf,eAAe;CACjB;CAGA,SAAS,UAAU,MAAM,KAAK,MAAM,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,UAAU;EACrH,IAAI,UAAU,OAAO,UAAU,YAAY,CAAC,MAAM,QAAQ,MAAM,GAAG;GACjE,IAAI,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,QAAQ;GACrF,KAAK,IAAI,OAAO,QAAQ;IACtB,IAAI,MAAM,OAAO;IACjB,IAAI,MAAM,QAAQ,GAAG,GACf;SAAA,OAAO,SAAS,eAClB,KAAK,IAAI,IAAE,GAAG,IAAE,IAAI,QAAQ,KAC1B,UAAU,MAAM,KAAK,MAAM,IAAI,IAAI,UAAU,MAAM,MAAM,MAAM,GAAG,YAAY,SAAS,KAAK,QAAQ,CAAC;IAAA,OAEpG,IAAI,OAAO,SAAS,eACrB;SAAA,OAAO,OAAO,OAAO,UACvB,KAAK,IAAI,QAAQ,KACf,UAAU,MAAM,KAAK,MAAM,IAAI,OAAO,UAAU,MAAM,MAAM,MAAM,cAAc,IAAI,GAAG,YAAY,SAAS,KAAK,QAAQ,IAAI;IAAA,OAE5H,IAAI,OAAO,SAAS,YAAa,KAAK,WAAW,EAAE,OAAO,SAAS,eACxE,UAAU,MAAM,KAAK,MAAM,KAAK,UAAU,MAAM,KAAK,YAAY,SAAS,KAAK,MAAM;GAEzF;GACA,KAAK,QAAQ,SAAS,YAAY,eAAe,eAAe,cAAc,QAAQ;EACxF;CACF;CAGA,SAAS,cAAc,KAAK;EAC1B,OAAO,IAAI,QAAQ,MAAM,IAAI,CAAC,CAAC,QAAQ,OAAO,IAAI;CACpD"}
|
package/dist/json-to-zod.cjs
CHANGED
|
@@ -1,5 +1,5 @@
|
|
|
1
1
|
Object.defineProperty(exports, Symbol.toStringTag, { value: "Module" });
|
|
2
|
-
|
|
2
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseAnyOf.js
|
|
3
3
|
const parseAnyOf = (schema, refs) => {
|
|
4
4
|
return schema.anyOf.length ? schema.anyOf.length === 1 ? parseSchema(schema.anyOf[0], {
|
|
5
5
|
...refs,
|
|
@@ -17,18 +17,15 @@ const parseAnyOf = (schema, refs) => {
|
|
|
17
17
|
]
|
|
18
18
|
})).join(", ")}])` : `z.any()`;
|
|
19
19
|
};
|
|
20
|
-
|
|
21
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseBoolean.js
|
|
20
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseBoolean.js
|
|
22
21
|
const parseBoolean = (_schema) => {
|
|
23
22
|
return "z.boolean()";
|
|
24
23
|
};
|
|
25
|
-
|
|
26
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseDefault.js
|
|
24
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseDefault.js
|
|
27
25
|
const parseDefault = (_schema) => {
|
|
28
26
|
return "z.any()";
|
|
29
27
|
};
|
|
30
|
-
|
|
31
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseMultipleType.js
|
|
28
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseMultipleType.js
|
|
32
29
|
const parseMultipleType = (schema, refs) => {
|
|
33
30
|
return `z.union([${schema.type.map((type) => parseSchema({
|
|
34
31
|
...schema,
|
|
@@ -38,26 +35,22 @@ const parseMultipleType = (schema, refs) => {
|
|
|
38
35
|
withoutDefaults: true
|
|
39
36
|
})).join(", ")}])`;
|
|
40
37
|
};
|
|
41
|
-
|
|
42
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseNot.js
|
|
38
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseNot.js
|
|
43
39
|
const parseNot = (schema, refs) => {
|
|
44
40
|
return `z.any().refine((value) => !${parseSchema(schema.not, {
|
|
45
41
|
...refs,
|
|
46
42
|
path: [...refs.path, "not"]
|
|
47
43
|
})}.safeParse(value).success, "Invalid input: Should NOT be valid against schema")`;
|
|
48
44
|
};
|
|
49
|
-
|
|
50
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseNull.js
|
|
45
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseNull.js
|
|
51
46
|
const parseNull = (_schema) => {
|
|
52
47
|
return "z.null()";
|
|
53
48
|
};
|
|
54
|
-
|
|
55
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/utils/half.js
|
|
49
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/utils/half.js
|
|
56
50
|
const half = (arr) => {
|
|
57
51
|
return [arr.slice(0, arr.length / 2), arr.slice(arr.length / 2)];
|
|
58
52
|
};
|
|
59
|
-
|
|
60
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseAllOf.js
|
|
53
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseAllOf.js
|
|
61
54
|
const originalIndex = Symbol("Original index");
|
|
62
55
|
const ensureOriginalIndex = (arr) => {
|
|
63
56
|
let newArr = [];
|
|
@@ -92,9 +85,8 @@ function parseAllOf(schema, refs) {
|
|
|
92
85
|
return `z.intersection(${parseAllOf({ allOf: left }, refs)}, ${parseAllOf({ allOf: right }, refs)})`;
|
|
93
86
|
}
|
|
94
87
|
}
|
|
95
|
-
|
|
96
|
-
|
|
97
|
-
function withMessage(schema, key, get) {
|
|
88
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/utils/withMessage.js
|
|
89
|
+
function withMessage(schema, key, get, fallbackMessage) {
|
|
98
90
|
const value = schema[key];
|
|
99
91
|
let r = "";
|
|
100
92
|
if (value !== void 0) {
|
|
@@ -107,14 +99,14 @@ function withMessage(schema, key, get) {
|
|
|
107
99
|
const prefix = got.length === 3 ? got[1] : "";
|
|
108
100
|
const closer = got.length === 3 ? got[2] : got[1];
|
|
109
101
|
r += opener;
|
|
110
|
-
|
|
102
|
+
const message = schema.errorMessage?.[key] ?? fallbackMessage;
|
|
103
|
+
if (message !== void 0) r += prefix + JSON.stringify(message);
|
|
111
104
|
r += closer;
|
|
112
105
|
}
|
|
113
106
|
}
|
|
114
107
|
return r;
|
|
115
108
|
}
|
|
116
|
-
|
|
117
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseArray.js
|
|
109
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseArray.js
|
|
118
110
|
const parseArray = (schema, refs) => {
|
|
119
111
|
if (Array.isArray(schema.items)) return `z.tuple([${schema.items.map((v, i) => parseSchema(v, {
|
|
120
112
|
...refs,
|
|
@@ -139,27 +131,24 @@ const parseArray = (schema, refs) => {
|
|
|
139
131
|
")"
|
|
140
132
|
]);
|
|
141
133
|
if (schema.uniqueItems === true) r += withMessage(schema, "uniqueItems", () => [
|
|
142
|
-
".
|
|
143
|
-
"",
|
|
134
|
+
".refine((arr) => arr.every((item, i) => arr.indexOf(item) == i)",
|
|
135
|
+
", ",
|
|
144
136
|
")"
|
|
145
|
-
]);
|
|
137
|
+
], "All items must be unique!");
|
|
146
138
|
return r;
|
|
147
139
|
};
|
|
148
|
-
|
|
149
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseConst.js
|
|
140
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseConst.js
|
|
150
141
|
const parseConst = (schema) => {
|
|
151
142
|
return `z.literal(${JSON.stringify(schema.const)})`;
|
|
152
143
|
};
|
|
153
|
-
|
|
154
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseEnum.js
|
|
144
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseEnum.js
|
|
155
145
|
const parseEnum = (schema) => {
|
|
156
146
|
if (schema.enum.length === 0) return "z.never()";
|
|
157
147
|
else if (schema.enum.length === 1) return `z.literal(${JSON.stringify(schema.enum[0])})`;
|
|
158
148
|
else if (schema.enum.every((x) => typeof x === "string")) return `z.enum([${schema.enum.map((x) => JSON.stringify(x))}])`;
|
|
159
149
|
else return `z.union([${schema.enum.map((x) => `z.literal(${JSON.stringify(x)})`).join(", ")}])`;
|
|
160
150
|
};
|
|
161
|
-
|
|
162
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseIfThenElse.js
|
|
151
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseIfThenElse.js
|
|
163
152
|
const parseIfThenElse = (schema, refs) => {
|
|
164
153
|
const $if = parseSchema(schema.if, {
|
|
165
154
|
...refs,
|
|
@@ -182,8 +171,7 @@ const parseIfThenElse = (schema, refs) => {
|
|
|
182
171
|
}
|
|
183
172
|
})`;
|
|
184
173
|
};
|
|
185
|
-
|
|
186
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseNumber.js
|
|
174
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseNumber.js
|
|
187
175
|
const parseNumber = (schema) => {
|
|
188
176
|
let r = "z.number()";
|
|
189
177
|
if (schema.type === "integer") r += withMessage(schema, "type", () => [".int(", ")"]);
|
|
@@ -235,9 +223,9 @@ const parseNumber = (schema) => {
|
|
|
235
223
|
]);
|
|
236
224
|
return r;
|
|
237
225
|
};
|
|
238
|
-
|
|
239
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseOneOf.js
|
|
226
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseOneOf.js
|
|
240
227
|
const parseOneOf = (schema, refs) => {
|
|
228
|
+
let is3 = refs.zodVersion === 3;
|
|
241
229
|
return schema.oneOf.length ? schema.oneOf.length === 1 ? parseSchema(schema.oneOf[0], {
|
|
242
230
|
...refs,
|
|
243
231
|
path: [
|
|
@@ -254,26 +242,38 @@ const parseOneOf = (schema, refs) => {
|
|
|
254
242
|
i
|
|
255
243
|
]
|
|
256
244
|
})).join(", ")}];
|
|
257
|
-
const errors = schemas.reduce<
|
|
258
|
-
|
|
245
|
+
const { errors, failed } = schemas.reduce<{
|
|
246
|
+
errors: z.${is3 ? "ZodError" : "core.$ZodIssue"}[];
|
|
247
|
+
failed: number;
|
|
248
|
+
}>(
|
|
249
|
+
({ errors, failed }, schema) =>
|
|
259
250
|
((result) =>
|
|
260
|
-
result.error
|
|
251
|
+
result.error
|
|
252
|
+
? {
|
|
253
|
+
errors: [...errors, ${is3 ? "result.error" : "...result.error.issues"}],
|
|
254
|
+
failed: failed + 1,
|
|
255
|
+
}
|
|
256
|
+
: { errors, failed })(
|
|
261
257
|
schema.safeParse(x),
|
|
262
258
|
),
|
|
263
|
-
[],
|
|
259
|
+
{ errors: [], failed: 0 },
|
|
264
260
|
);
|
|
265
|
-
|
|
266
|
-
|
|
267
|
-
|
|
261
|
+
const passed = schemas.length - failed;
|
|
262
|
+
if (passed !== 1) {
|
|
263
|
+
ctx.addIssue(errors.length ? {
|
|
264
|
+
path: ${is3 ? "ctx.path" : "[]"},
|
|
268
265
|
code: "invalid_union",
|
|
269
|
-
unionErrors: errors,
|
|
270
|
-
message: "Invalid input: Should pass single schema",
|
|
266
|
+
${is3 ? "unionErrors: errors" : "errors: [errors]"},
|
|
267
|
+
message: "Invalid input: Should pass single schema. Passed " + passed,
|
|
268
|
+
} : {
|
|
269
|
+
path: ${is3 ? "ctx.path" : "[]"},
|
|
270
|
+
code: "custom",${is3 ? "" : "\n errors: [errors],"}
|
|
271
|
+
message: "Invalid input: Should pass single schema. Passed " + passed,
|
|
271
272
|
});
|
|
272
273
|
}
|
|
273
274
|
})` : "z.any()";
|
|
274
275
|
};
|
|
275
|
-
|
|
276
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/utils/jsdocs.js
|
|
276
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/utils/jsdocs.js
|
|
277
277
|
const expandJsdocs = (jsdocs) => {
|
|
278
278
|
const lines = jsdocs.split("\n");
|
|
279
279
|
return `/**${lines.length === 1 ? lines[0] : `\n${lines.map((x) => `* ${x}`).join("\n")}\n`}*/\n`;
|
|
@@ -283,8 +283,15 @@ const addJsdocs = (schema, parsed) => {
|
|
|
283
283
|
if (!description) return parsed;
|
|
284
284
|
return `\n${expandJsdocs(description)}${parsed}`;
|
|
285
285
|
};
|
|
286
|
-
|
|
287
|
-
|
|
286
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseObject.js
|
|
287
|
+
function emitRecord(valueSchema, refs) {
|
|
288
|
+
if (refs.zodVersion === 3) return `z.record(${valueSchema})`;
|
|
289
|
+
return `z.record(z.string(), ${valueSchema})`;
|
|
290
|
+
}
|
|
291
|
+
function emitErrorPath(refs) {
|
|
292
|
+
if (refs.zodVersion === 3) return `path: [...ctx.path, key]`;
|
|
293
|
+
return `path: [key]`;
|
|
294
|
+
}
|
|
288
295
|
function parseObject(objectSchema, refs) {
|
|
289
296
|
let properties = void 0;
|
|
290
297
|
if (objectSchema.properties) {
|
|
@@ -330,9 +337,9 @@ function parseObject(objectSchema, refs) {
|
|
|
330
337
|
if (additionalProperties) patternProperties += `.catchall(z.union([${[...Object.values(parsedPatternProperties), additionalProperties].join(", ")}]))`;
|
|
331
338
|
else if (Object.keys(parsedPatternProperties).length > 1) patternProperties += `.catchall(z.union([${Object.values(parsedPatternProperties).join(", ")}]))`;
|
|
332
339
|
else patternProperties += `.catchall(${Object.values(parsedPatternProperties)})`;
|
|
333
|
-
} else if (additionalProperties) patternProperties += `z.
|
|
334
|
-
else if (Object.keys(parsedPatternProperties).length > 1) patternProperties += `z.
|
|
335
|
-
else patternProperties +=
|
|
340
|
+
} else if (additionalProperties) patternProperties += emitRecord(`z.union([${[...Object.values(parsedPatternProperties), additionalProperties].join(", ")}])`, refs);
|
|
341
|
+
else if (Object.keys(parsedPatternProperties).length > 1) patternProperties += emitRecord(`z.union([${Object.values(parsedPatternProperties).join(", ")}])`, refs);
|
|
342
|
+
else patternProperties += emitRecord(`${Object.values(parsedPatternProperties)}`, refs);
|
|
336
343
|
patternProperties += ".superRefine((value, ctx) => {\n";
|
|
337
344
|
patternProperties += "for (const key in value) {\n";
|
|
338
345
|
if (additionalProperties) {
|
|
@@ -345,7 +352,7 @@ function parseObject(objectSchema, refs) {
|
|
|
345
352
|
patternProperties += "const result = " + parsedPatternProperties[key] + ".safeParse(value[key])\n";
|
|
346
353
|
patternProperties += "if (!result.success) {\n";
|
|
347
354
|
patternProperties += `ctx.addIssue({
|
|
348
|
-
|
|
355
|
+
${emitErrorPath(refs)},
|
|
349
356
|
code: 'custom',
|
|
350
357
|
message: \`Invalid input: Key matching regex /\${key}/ must match schema\`,
|
|
351
358
|
params: {
|
|
@@ -360,7 +367,7 @@ function parseObject(objectSchema, refs) {
|
|
|
360
367
|
patternProperties += "const result = " + additionalProperties + ".safeParse(value[key])\n";
|
|
361
368
|
patternProperties += "if (!result.success) {\n";
|
|
362
369
|
patternProperties += `ctx.addIssue({
|
|
363
|
-
|
|
370
|
+
${emitErrorPath(refs)},
|
|
364
371
|
code: 'custom',
|
|
365
372
|
message: \`Invalid input: must match catchall schema\`,
|
|
366
373
|
params: {
|
|
@@ -373,7 +380,7 @@ function parseObject(objectSchema, refs) {
|
|
|
373
380
|
patternProperties += "}\n";
|
|
374
381
|
patternProperties += "})";
|
|
375
382
|
}
|
|
376
|
-
let output = properties ? patternProperties ? properties + patternProperties : additionalProperties ? additionalProperties === "z.never()" ? properties + ".strict()" : properties + `.catchall(${additionalProperties})` : properties : patternProperties ? patternProperties : additionalProperties ?
|
|
383
|
+
let output = properties ? patternProperties ? properties + patternProperties : additionalProperties ? additionalProperties === "z.never()" ? properties + ".strict()" : properties + `.catchall(${additionalProperties})` : properties : patternProperties ? patternProperties : additionalProperties ? emitRecord(additionalProperties, refs) : emitRecord("z.any()", refs);
|
|
377
384
|
if (its.an.anyOf(objectSchema)) output += `.and(${parseAnyOf({
|
|
378
385
|
...objectSchema,
|
|
379
386
|
anyOf: objectSchema.anyOf.map((x) => typeof x === "object" && !x.type && (x.properties || x.additionalProperties || x.patternProperties) ? {
|
|
@@ -397,8 +404,7 @@ function parseObject(objectSchema, refs) {
|
|
|
397
404
|
}, refs)})`;
|
|
398
405
|
return output;
|
|
399
406
|
}
|
|
400
|
-
|
|
401
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseString.js
|
|
407
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseString.js
|
|
402
408
|
const parseString = (schema) => {
|
|
403
409
|
let r = "z.string()";
|
|
404
410
|
r += withMessage(schema, "format", ({ value }) => {
|
|
@@ -465,8 +471,7 @@ const parseString = (schema) => {
|
|
|
465
471
|
}
|
|
466
472
|
return r;
|
|
467
473
|
};
|
|
468
|
-
|
|
469
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseSimpleDiscriminatedOneOf.js
|
|
474
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseSimpleDiscriminatedOneOf.js
|
|
470
475
|
const parseSimpleDiscriminatedOneOf = (schema, refs) => {
|
|
471
476
|
return schema.oneOf.length ? schema.oneOf.length === 1 ? parseSchema(schema.oneOf[0], {
|
|
472
477
|
...refs,
|
|
@@ -484,22 +489,19 @@ const parseSimpleDiscriminatedOneOf = (schema, refs) => {
|
|
|
484
489
|
]
|
|
485
490
|
})).join(", ")}])` : "z.any()";
|
|
486
491
|
};
|
|
487
|
-
|
|
488
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/utils/omit.js
|
|
492
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/utils/omit.js
|
|
489
493
|
const omit = (obj, ...keys) => Object.keys(obj).reduce((acc, key) => {
|
|
490
494
|
if (!keys.includes(key)) acc[key] = obj[key];
|
|
491
495
|
return acc;
|
|
492
496
|
}, {});
|
|
493
|
-
|
|
494
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseNullable.js
|
|
497
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseNullable.js
|
|
495
498
|
/**
|
|
496
499
|
* For compatibility with open api 3.0 nullable
|
|
497
500
|
*/
|
|
498
501
|
const parseNullable = (schema, refs) => {
|
|
499
502
|
return `${parseSchema(omit(schema, "nullable"), refs, true)}.nullable()`;
|
|
500
503
|
};
|
|
501
|
-
|
|
502
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/parsers/parseSchema.js
|
|
504
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/parsers/parseSchema.js
|
|
503
505
|
const parseSchema = (schema, refs = {
|
|
504
506
|
seen: /* @__PURE__ */ new Map(),
|
|
505
507
|
path: []
|
|
@@ -588,15 +590,15 @@ const its = {
|
|
|
588
590
|
oneOf: (x) => x.oneOf !== void 0
|
|
589
591
|
}
|
|
590
592
|
};
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
const jsonSchemaToZod$1 = (schema, { module, name, type, noImport, ...rest } = {}) => {
|
|
593
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/jsonSchemaToZod.js
|
|
594
|
+
const jsonSchemaToZod$1 = (schema, { module, name, type, noImport, zodVersion = 4, ...rest } = {}) => {
|
|
594
595
|
if (type && (!name || module !== "esm")) throw new Error("Option `type` requires `name` to be set and `module` to be `esm`");
|
|
595
596
|
let result = parseSchema(schema, {
|
|
596
597
|
module,
|
|
597
598
|
name,
|
|
598
599
|
path: [],
|
|
599
600
|
seen: /* @__PURE__ */ new Map(),
|
|
601
|
+
zodVersion,
|
|
600
602
|
...rest
|
|
601
603
|
});
|
|
602
604
|
const jsdocs = rest.withJsdocs && typeof schema !== "boolean" && schema.description ? expandJsdocs(schema.description) : "";
|
|
@@ -620,11 +622,9 @@ ${result}`;
|
|
|
620
622
|
}
|
|
621
623
|
return result;
|
|
622
624
|
};
|
|
623
|
-
|
|
624
|
-
//#region ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.7.0/a13e04d716ba0ad807c80424b9ecc2fa744903d957ce250899a6422d8d845e4a/node_modules/json-schema-to-zod/dist/esm/index.js
|
|
625
|
+
// ../../../../../setup-pnpm/node_modules/.bin/store/v11/links/@/json-schema-to-zod/2.8.1/c100d4d307044bc24116b6230c3615807364a7e5d169923ae0cf63fb170f8f2b/node_modules/json-schema-to-zod/dist/esm/index.js
|
|
625
626
|
var esm_default = jsonSchemaToZod$1;
|
|
626
|
-
|
|
627
|
-
//#region src/json-to-zod.ts
|
|
627
|
+
// src/json-to-zod.ts
|
|
628
628
|
function parseObject$1(objectSchema, refs) {
|
|
629
629
|
let properties = void 0;
|
|
630
630
|
if (objectSchema.properties) {
|
|
@@ -821,7 +821,6 @@ function jsonSchemaToZod(schema, options = {}) {
|
|
|
821
821
|
parserOverride
|
|
822
822
|
}).replace(/\.reduce<[^>]+>/g, ".reduce");
|
|
823
823
|
}
|
|
824
|
-
//#endregion
|
|
825
824
|
exports.addJsdocs = addJsdocs;
|
|
826
825
|
exports.expandJsdocs = expandJsdocs;
|
|
827
826
|
exports.half = half;
|