moonflower 1.3.1 → 1.3.2
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/validators/validateMissingParams.cjs +1 -1
- package/dist/validators/validateMissingParams.cjs.map +1 -1
- package/dist/validators/validateMissingParams.mjs +8 -8
- package/dist/validators/validateParam.cjs +1 -1
- package/dist/validators/validateParam.cjs.map +1 -1
- package/dist/validators/validateParam.mjs +16 -17
- package/dist/validators/validateParam.mjs.map +1 -1
- package/package.json +1 -1
- package/vite.config.ts +1 -0
- package/dist/node_modules/zod/index.cjs +0 -2
- package/dist/node_modules/zod/index.cjs.map +0 -1
- package/dist/node_modules/zod/index.mjs +0 -6
- package/dist/node_modules/zod/index.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/checks.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/checks.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/checks.mjs +0 -34
- package/dist/node_modules/zod/v4/classic/checks.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/coerce.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/coerce.mjs +0 -26
- package/dist/node_modules/zod/v4/classic/coerce.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/compat.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/compat.mjs +0 -35
- package/dist/node_modules/zod/v4/classic/compat.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/errors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/errors.mjs +0 -41
- package/dist/node_modules/zod/v4/classic/errors.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/external.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/external.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/external.mjs +0 -260
- package/dist/node_modules/zod/v4/classic/external.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/from-json-schema.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/from-json-schema.mjs +0 -287
- package/dist/node_modules/zod/v4/classic/from-json-schema.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/iso.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/iso.mjs +0 -40
- package/dist/node_modules/zod/v4/classic/iso.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/parse.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/parse.mjs +0 -19
- package/dist/node_modules/zod/v4/classic/parse.mjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.cjs +0 -2
- package/dist/node_modules/zod/v4/classic/schemas.cjs.map +0 -1
- package/dist/node_modules/zod/v4/classic/schemas.mjs +0 -912
- package/dist/node_modules/zod/v4/classic/schemas.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/api.cjs +0 -2
- package/dist/node_modules/zod/v4/core/api.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/api.mjs +0 -1110
- package/dist/node_modules/zod/v4/core/api.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.cjs +0 -2
- package/dist/node_modules/zod/v4/core/checks.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/checks.mjs +0 -421
- package/dist/node_modules/zod/v4/core/checks.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/core.cjs +0 -2
- package/dist/node_modules/zod/v4/core/core.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/core.mjs +0 -62
- package/dist/node_modules/zod/v4/core/core.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.cjs +0 -4
- package/dist/node_modules/zod/v4/core/doc.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/doc.mjs +0 -27
- package/dist/node_modules/zod/v4/core/doc.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.cjs +0 -3
- package/dist/node_modules/zod/v4/core/errors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/errors.mjs +0 -89
- package/dist/node_modules/zod/v4/core/errors.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/index.cjs +0 -2
- package/dist/node_modules/zod/v4/core/index.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/index.mjs +0 -293
- package/dist/node_modules/zod/v4/core/index.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-generator.cjs +0 -2
- package/dist/node_modules/zod/v4/core/json-schema-generator.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-generator.mjs +0 -66
- package/dist/node_modules/zod/v4/core/json-schema-generator.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs +0 -2
- package/dist/node_modules/zod/v4/core/json-schema-processors.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema-processors.mjs +0 -346
- package/dist/node_modules/zod/v4/core/json-schema-processors.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema.cjs +0 -2
- package/dist/node_modules/zod/v4/core/json-schema.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/json-schema.mjs +0 -2
- package/dist/node_modules/zod/v4/core/json-schema.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.cjs +0 -2
- package/dist/node_modules/zod/v4/core/parse.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/parse.mjs +0 -75
- package/dist/node_modules/zod/v4/core/parse.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.cjs +0 -2
- package/dist/node_modules/zod/v4/core/regexes.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/regexes.mjs +0 -94
- package/dist/node_modules/zod/v4/core/regexes.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.cjs +0 -2
- package/dist/node_modules/zod/v4/core/registries.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/registries.mjs +0 -44
- package/dist/node_modules/zod/v4/core/registries.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.cjs +0 -36
- package/dist/node_modules/zod/v4/core/schemas.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/schemas.mjs +0 -1319
- package/dist/node_modules/zod/v4/core/schemas.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs +0 -4
- package/dist/node_modules/zod/v4/core/to-json-schema.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/to-json-schema.mjs +0 -244
- package/dist/node_modules/zod/v4/core/to-json-schema.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/util.cjs +0 -2
- package/dist/node_modules/zod/v4/core/util.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/util.mjs +0 -523
- package/dist/node_modules/zod/v4/core/util.mjs.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.cjs +0 -2
- package/dist/node_modules/zod/v4/core/versions.cjs.map +0 -1
- package/dist/node_modules/zod/v4/core/versions.mjs +0 -9
- package/dist/node_modules/zod/v4/core/versions.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ar.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ar.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ar.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/ar.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/az.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/az.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/az.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/az.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/be.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/be.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/be.mjs +0 -129
- package/dist/node_modules/zod/v4/locales/be.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/bg.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/bg.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/bg.mjs +0 -98
- package/dist/node_modules/zod/v4/locales/bg.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ca.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ca.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ca.mjs +0 -88
- package/dist/node_modules/zod/v4/locales/ca.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/cs.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/cs.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/cs.mjs +0 -91
- package/dist/node_modules/zod/v4/locales/cs.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/da.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/da.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/da.mjs +0 -94
- package/dist/node_modules/zod/v4/locales/da.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/de.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/de.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/de.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/de.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/en.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/en.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/en.mjs +0 -91
- package/dist/node_modules/zod/v4/locales/en.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/eo.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/eo.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/eo.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/eo.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/es.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/es.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/es.mjs +0 -111
- package/dist/node_modules/zod/v4/locales/es.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fa.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/fa.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fa.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/fa.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fi.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/fi.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fi.mjs +0 -91
- package/dist/node_modules/zod/v4/locales/fi.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fr-CA.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/fr-CA.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fr-CA.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/fr-CA.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fr.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/fr.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/fr.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/fr.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/he.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/he.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/he.mjs +0 -152
- package/dist/node_modules/zod/v4/locales/he.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/hu.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/hu.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/hu.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/hu.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/hy.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/hy.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/hy.mjs +0 -130
- package/dist/node_modules/zod/v4/locales/hy.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/id.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/id.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/id.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/id.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/index.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/index.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/index.mjs +0 -101
- package/dist/node_modules/zod/v4/locales/index.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/is.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/is.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/is.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/is.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/it.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/it.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/it.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/it.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ja.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ja.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ja.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/ja.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ka.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ka.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ka.mjs +0 -92
- package/dist/node_modules/zod/v4/locales/ka.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/kh.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/kh.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/kh.mjs +0 -8
- package/dist/node_modules/zod/v4/locales/kh.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/km.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/km.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/km.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/km.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ko.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ko.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ko.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/ko.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/lt.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/lt.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/lt.mjs +0 -178
- package/dist/node_modules/zod/v4/locales/lt.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/mk.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/mk.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/mk.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/mk.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ms.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ms.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ms.mjs +0 -88
- package/dist/node_modules/zod/v4/locales/ms.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/nl.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/nl.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/nl.mjs +0 -88
- package/dist/node_modules/zod/v4/locales/nl.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/no.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/no.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/no.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/no.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ota.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ota.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ota.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/ota.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/pl.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/pl.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/pl.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/pl.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ps.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ps.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ps.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/ps.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/pt.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/pt.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/pt.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/pt.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ru.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ru.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ru.mjs +0 -129
- package/dist/node_modules/zod/v4/locales/ru.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/sl.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/sl.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/sl.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/sl.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/sv.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/sv.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/sv.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/sv.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ta.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ta.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ta.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/ta.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/th.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/th.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/th.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/th.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/tr.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/tr.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/tr.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/tr.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ua.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ua.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ua.mjs +0 -8
- package/dist/node_modules/zod/v4/locales/ua.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/uk.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/uk.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/uk.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/uk.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ur.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/ur.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/ur.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/ur.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/uz.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/uz.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/uz.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/uz.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/vi.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/vi.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/vi.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/vi.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/yo.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/yo.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/yo.mjs +0 -89
- package/dist/node_modules/zod/v4/locales/yo.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/zh-CN.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/zh-CN.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/zh-CN.mjs +0 -90
- package/dist/node_modules/zod/v4/locales/zh-CN.mjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/zh-TW.cjs +0 -2
- package/dist/node_modules/zod/v4/locales/zh-TW.cjs.map +0 -1
- package/dist/node_modules/zod/v4/locales/zh-TW.mjs +0 -87
- package/dist/node_modules/zod/v4/locales/zh-TW.mjs.map +0 -1
|
@@ -1,260 +0,0 @@
|
|
|
1
|
-
import * as r from "../core/index.mjs";
|
|
2
|
-
import { ZodAny as Z, ZodArray as c, ZodBase64 as u, ZodBase64URL as f, ZodBigInt as g, ZodBigIntFormat as x, ZodBoolean as _, ZodCIDRv4 as y, ZodCIDRv6 as v, ZodCUID as h, ZodCUID2 as I, ZodCatch as S, ZodCodec as b, ZodCustom as D, ZodCustomStringFormat as E, ZodDate as U, ZodDefault as O, ZodDiscriminatedUnion as C, ZodE164 as L, ZodEmail as N, ZodEmoji as R, ZodEnum as z, ZodExactOptional as w, ZodFile as A, ZodFunction as P, ZodGUID as T, ZodIPv4 as j, ZodIPv6 as F, ZodIntersection as k, ZodJWT as B, ZodKSUID as W, ZodLazy as M, ZodLiteral as $, ZodMAC as J, ZodMap as K, ZodNaN as V, ZodNanoID as X, ZodNever as G, ZodNonOptional as q, ZodNull as H, ZodNullable as Q, ZodNumber as Y, ZodNumberFormat as oo, ZodObject as eo, ZodOptional as ro, ZodPipe as to, ZodPrefault as ao, ZodPromise as io, ZodReadonly as no, ZodRecord as so, ZodSet as mo, ZodString as lo, ZodStringFormat as po, ZodSuccess as Zo, ZodSymbol as co, ZodTemplateLiteral as uo, ZodTransform as fo, ZodTuple as go, ZodType as xo, ZodULID as _o, ZodURL as yo, ZodUUID as vo, ZodUndefined as ho, ZodUnion as Io, ZodUnknown as So, ZodVoid as bo, ZodXID as Do, ZodXor as Eo, _ZodString as Uo, _default as Oo, _function as Co, any as Lo, array as No, base64 as Ro, base64url as zo, bigint as wo, boolean as Ao, catch as Po, check as To, cidrv4 as jo, cidrv6 as Fo, codec as ko, cuid as Bo, cuid2 as Wo, custom as Mo, date as $o, describe as Jo, discriminatedUnion as Ko, e164 as Vo, email as Xo, emoji as Go, enum as qo, exactOptional as Ho, file as Qo, float32 as Yo, float64 as oe, _function as ee, guid as re, hash as te, hex as ae, hostname as ie, httpUrl as ne, instanceof as de, int as se, int32 as me, int64 as le, intersection as pe, ipv4 as Ze, ipv6 as ce, json as ue, jwt as fe, keyof as ge, ksuid as xe, lazy as _e, literal as ye, looseObject as ve, looseRecord as he, mac as Ie, map as Se, meta as be, nan as De, nanoid as Ee, nativeEnum as Ue, never as Oe, nonoptional as Ce, null as Le, nullable as Ne, nullish as Re, number as ze, object as we, optional as Ae, partialRecord as Pe, pipe as Te, prefault as je, preprocess as Fe, promise as ke, readonly as Be, record as We, refine as Me, set as $e, strictObject as Je, string as Ke, stringFormat as Ve, stringbool as Xe, success as Ge, superRefine as qe, symbol as He, templateLiteral as Qe, transform as Ye, tuple as or, uint32 as er, uint64 as rr, ulid as tr, undefined as ar, union as ir, unknown as nr, url as dr, uuid as sr, uuidv4 as mr, uuidv6 as lr, uuidv7 as pr, void as Zr, xid as cr, xor as ur } from "./schemas.mjs";
|
|
3
|
-
import { ZodError as gr, ZodRealError as xr } from "./errors.mjs";
|
|
4
|
-
import { decode as yr, decodeAsync as vr, encode as hr, encodeAsync as Ir, parse as Sr, parseAsync as br, safeDecode as Dr, safeDecodeAsync as Er, safeEncode as Ur, safeEncodeAsync as Or, safeParse as Cr, safeParseAsync as Lr } from "./parse.mjs";
|
|
5
|
-
import { ZodFirstPartyTypeKind as Rr, ZodIssueCode as zr, getErrorMap as wr, setErrorMap as Ar } from "./compat.mjs";
|
|
6
|
-
import o from "../locales/en.mjs";
|
|
7
|
-
import { toJSONSchema as Tr } from "../core/json-schema-processors.mjs";
|
|
8
|
-
import { fromJSONSchema as Fr } from "./from-json-schema.mjs";
|
|
9
|
-
import * as a from "../locales/index.mjs";
|
|
10
|
-
import * as i from "./iso.mjs";
|
|
11
|
-
import { ZodISODate as Br, ZodISODateTime as Wr, ZodISODuration as Mr, ZodISOTime as $r } from "./iso.mjs";
|
|
12
|
-
import * as n from "./coerce.mjs";
|
|
13
|
-
import { config as e } from "../core/core.mjs";
|
|
14
|
-
import { $brand as Kr, NEVER as Vr } from "../core/core.mjs";
|
|
15
|
-
import { $input as Gr, $output as qr, globalRegistry as Hr, registry as Qr } from "../core/registries.mjs";
|
|
16
|
-
import * as s from "../core/util.mjs";
|
|
17
|
-
import { clone as ot } from "../core/util.mjs";
|
|
18
|
-
import * as m from "../core/regexes.mjs";
|
|
19
|
-
import { flattenError as rt, formatError as tt, prettifyError as at, treeifyError as it } from "../core/errors.mjs";
|
|
20
|
-
import { TimePrecision as dt, _endsWith as st, _gt as mt, _gte as lt, _includes as pt, _length as Zt, _lowercase as ct, _lt as ut, _lte as ft, _maxLength as gt, _maxSize as xt, _mime as _t, _minLength as yt, _minSize as vt, _multipleOf as ht, _negative as It, _nonnegative as St, _nonpositive as bt, _normalize as Dt, _overwrite as Et, _positive as Ut, _property as Ot, _regex as Ct, _size as Lt, _slugify as Nt, _startsWith as Rt, _toLowerCase as zt, _toUpperCase as wt, _trim as At, _uppercase as Pt } from "../core/api.mjs";
|
|
21
|
-
e(o());
|
|
22
|
-
export {
|
|
23
|
-
Kr as $brand,
|
|
24
|
-
Gr as $input,
|
|
25
|
-
qr as $output,
|
|
26
|
-
Vr as NEVER,
|
|
27
|
-
dt as TimePrecision,
|
|
28
|
-
Z as ZodAny,
|
|
29
|
-
c as ZodArray,
|
|
30
|
-
u as ZodBase64,
|
|
31
|
-
f as ZodBase64URL,
|
|
32
|
-
g as ZodBigInt,
|
|
33
|
-
x as ZodBigIntFormat,
|
|
34
|
-
_ as ZodBoolean,
|
|
35
|
-
y as ZodCIDRv4,
|
|
36
|
-
v as ZodCIDRv6,
|
|
37
|
-
h as ZodCUID,
|
|
38
|
-
I as ZodCUID2,
|
|
39
|
-
S as ZodCatch,
|
|
40
|
-
b as ZodCodec,
|
|
41
|
-
D as ZodCustom,
|
|
42
|
-
E as ZodCustomStringFormat,
|
|
43
|
-
U as ZodDate,
|
|
44
|
-
O as ZodDefault,
|
|
45
|
-
C as ZodDiscriminatedUnion,
|
|
46
|
-
L as ZodE164,
|
|
47
|
-
N as ZodEmail,
|
|
48
|
-
R as ZodEmoji,
|
|
49
|
-
z as ZodEnum,
|
|
50
|
-
gr as ZodError,
|
|
51
|
-
w as ZodExactOptional,
|
|
52
|
-
A as ZodFile,
|
|
53
|
-
Rr as ZodFirstPartyTypeKind,
|
|
54
|
-
P as ZodFunction,
|
|
55
|
-
T as ZodGUID,
|
|
56
|
-
j as ZodIPv4,
|
|
57
|
-
F as ZodIPv6,
|
|
58
|
-
Br as ZodISODate,
|
|
59
|
-
Wr as ZodISODateTime,
|
|
60
|
-
Mr as ZodISODuration,
|
|
61
|
-
$r as ZodISOTime,
|
|
62
|
-
k as ZodIntersection,
|
|
63
|
-
zr as ZodIssueCode,
|
|
64
|
-
B as ZodJWT,
|
|
65
|
-
W as ZodKSUID,
|
|
66
|
-
M as ZodLazy,
|
|
67
|
-
$ as ZodLiteral,
|
|
68
|
-
J as ZodMAC,
|
|
69
|
-
K as ZodMap,
|
|
70
|
-
V as ZodNaN,
|
|
71
|
-
X as ZodNanoID,
|
|
72
|
-
G as ZodNever,
|
|
73
|
-
q as ZodNonOptional,
|
|
74
|
-
H as ZodNull,
|
|
75
|
-
Q as ZodNullable,
|
|
76
|
-
Y as ZodNumber,
|
|
77
|
-
oo as ZodNumberFormat,
|
|
78
|
-
eo as ZodObject,
|
|
79
|
-
ro as ZodOptional,
|
|
80
|
-
to as ZodPipe,
|
|
81
|
-
ao as ZodPrefault,
|
|
82
|
-
io as ZodPromise,
|
|
83
|
-
no as ZodReadonly,
|
|
84
|
-
xr as ZodRealError,
|
|
85
|
-
so as ZodRecord,
|
|
86
|
-
mo as ZodSet,
|
|
87
|
-
lo as ZodString,
|
|
88
|
-
po as ZodStringFormat,
|
|
89
|
-
Zo as ZodSuccess,
|
|
90
|
-
co as ZodSymbol,
|
|
91
|
-
uo as ZodTemplateLiteral,
|
|
92
|
-
fo as ZodTransform,
|
|
93
|
-
go as ZodTuple,
|
|
94
|
-
xo as ZodType,
|
|
95
|
-
_o as ZodULID,
|
|
96
|
-
yo as ZodURL,
|
|
97
|
-
vo as ZodUUID,
|
|
98
|
-
ho as ZodUndefined,
|
|
99
|
-
Io as ZodUnion,
|
|
100
|
-
So as ZodUnknown,
|
|
101
|
-
bo as ZodVoid,
|
|
102
|
-
Do as ZodXID,
|
|
103
|
-
Eo as ZodXor,
|
|
104
|
-
Uo as _ZodString,
|
|
105
|
-
Oo as _default,
|
|
106
|
-
Co as _function,
|
|
107
|
-
Lo as any,
|
|
108
|
-
No as array,
|
|
109
|
-
Ro as base64,
|
|
110
|
-
zo as base64url,
|
|
111
|
-
wo as bigint,
|
|
112
|
-
Ao as boolean,
|
|
113
|
-
Po as catch,
|
|
114
|
-
To as check,
|
|
115
|
-
jo as cidrv4,
|
|
116
|
-
Fo as cidrv6,
|
|
117
|
-
ot as clone,
|
|
118
|
-
ko as codec,
|
|
119
|
-
n as coerce,
|
|
120
|
-
e as config,
|
|
121
|
-
r as core,
|
|
122
|
-
Bo as cuid,
|
|
123
|
-
Wo as cuid2,
|
|
124
|
-
Mo as custom,
|
|
125
|
-
$o as date,
|
|
126
|
-
yr as decode,
|
|
127
|
-
vr as decodeAsync,
|
|
128
|
-
Jo as describe,
|
|
129
|
-
Ko as discriminatedUnion,
|
|
130
|
-
Vo as e164,
|
|
131
|
-
Xo as email,
|
|
132
|
-
Go as emoji,
|
|
133
|
-
hr as encode,
|
|
134
|
-
Ir as encodeAsync,
|
|
135
|
-
st as endsWith,
|
|
136
|
-
qo as enum,
|
|
137
|
-
Ho as exactOptional,
|
|
138
|
-
Qo as file,
|
|
139
|
-
rt as flattenError,
|
|
140
|
-
Yo as float32,
|
|
141
|
-
oe as float64,
|
|
142
|
-
tt as formatError,
|
|
143
|
-
Fr as fromJSONSchema,
|
|
144
|
-
ee as function,
|
|
145
|
-
wr as getErrorMap,
|
|
146
|
-
Hr as globalRegistry,
|
|
147
|
-
mt as gt,
|
|
148
|
-
lt as gte,
|
|
149
|
-
re as guid,
|
|
150
|
-
te as hash,
|
|
151
|
-
ae as hex,
|
|
152
|
-
ie as hostname,
|
|
153
|
-
ne as httpUrl,
|
|
154
|
-
pt as includes,
|
|
155
|
-
de as instanceof,
|
|
156
|
-
se as int,
|
|
157
|
-
me as int32,
|
|
158
|
-
le as int64,
|
|
159
|
-
pe as intersection,
|
|
160
|
-
Ze as ipv4,
|
|
161
|
-
ce as ipv6,
|
|
162
|
-
i as iso,
|
|
163
|
-
ue as json,
|
|
164
|
-
fe as jwt,
|
|
165
|
-
ge as keyof,
|
|
166
|
-
xe as ksuid,
|
|
167
|
-
_e as lazy,
|
|
168
|
-
Zt as length,
|
|
169
|
-
ye as literal,
|
|
170
|
-
a as locales,
|
|
171
|
-
ve as looseObject,
|
|
172
|
-
he as looseRecord,
|
|
173
|
-
ct as lowercase,
|
|
174
|
-
ut as lt,
|
|
175
|
-
ft as lte,
|
|
176
|
-
Ie as mac,
|
|
177
|
-
Se as map,
|
|
178
|
-
gt as maxLength,
|
|
179
|
-
xt as maxSize,
|
|
180
|
-
be as meta,
|
|
181
|
-
_t as mime,
|
|
182
|
-
yt as minLength,
|
|
183
|
-
vt as minSize,
|
|
184
|
-
ht as multipleOf,
|
|
185
|
-
De as nan,
|
|
186
|
-
Ee as nanoid,
|
|
187
|
-
Ue as nativeEnum,
|
|
188
|
-
It as negative,
|
|
189
|
-
Oe as never,
|
|
190
|
-
St as nonnegative,
|
|
191
|
-
Ce as nonoptional,
|
|
192
|
-
bt as nonpositive,
|
|
193
|
-
Dt as normalize,
|
|
194
|
-
Le as null,
|
|
195
|
-
Ne as nullable,
|
|
196
|
-
Re as nullish,
|
|
197
|
-
ze as number,
|
|
198
|
-
we as object,
|
|
199
|
-
Ae as optional,
|
|
200
|
-
Et as overwrite,
|
|
201
|
-
Sr as parse,
|
|
202
|
-
br as parseAsync,
|
|
203
|
-
Pe as partialRecord,
|
|
204
|
-
Te as pipe,
|
|
205
|
-
Ut as positive,
|
|
206
|
-
je as prefault,
|
|
207
|
-
Fe as preprocess,
|
|
208
|
-
at as prettifyError,
|
|
209
|
-
ke as promise,
|
|
210
|
-
Ot as property,
|
|
211
|
-
Be as readonly,
|
|
212
|
-
We as record,
|
|
213
|
-
Me as refine,
|
|
214
|
-
Ct as regex,
|
|
215
|
-
m as regexes,
|
|
216
|
-
Qr as registry,
|
|
217
|
-
Dr as safeDecode,
|
|
218
|
-
Er as safeDecodeAsync,
|
|
219
|
-
Ur as safeEncode,
|
|
220
|
-
Or as safeEncodeAsync,
|
|
221
|
-
Cr as safeParse,
|
|
222
|
-
Lr as safeParseAsync,
|
|
223
|
-
$e as set,
|
|
224
|
-
Ar as setErrorMap,
|
|
225
|
-
Lt as size,
|
|
226
|
-
Nt as slugify,
|
|
227
|
-
Rt as startsWith,
|
|
228
|
-
Je as strictObject,
|
|
229
|
-
Ke as string,
|
|
230
|
-
Ve as stringFormat,
|
|
231
|
-
Xe as stringbool,
|
|
232
|
-
Ge as success,
|
|
233
|
-
qe as superRefine,
|
|
234
|
-
He as symbol,
|
|
235
|
-
Qe as templateLiteral,
|
|
236
|
-
Tr as toJSONSchema,
|
|
237
|
-
zt as toLowerCase,
|
|
238
|
-
wt as toUpperCase,
|
|
239
|
-
Ye as transform,
|
|
240
|
-
it as treeifyError,
|
|
241
|
-
At as trim,
|
|
242
|
-
or as tuple,
|
|
243
|
-
er as uint32,
|
|
244
|
-
rr as uint64,
|
|
245
|
-
tr as ulid,
|
|
246
|
-
ar as undefined,
|
|
247
|
-
ir as union,
|
|
248
|
-
nr as unknown,
|
|
249
|
-
Pt as uppercase,
|
|
250
|
-
dr as url,
|
|
251
|
-
s as util,
|
|
252
|
-
sr as uuid,
|
|
253
|
-
mr as uuidv4,
|
|
254
|
-
lr as uuidv6,
|
|
255
|
-
pr as uuidv7,
|
|
256
|
-
Zr as void,
|
|
257
|
-
cr as xid,
|
|
258
|
-
ur as xor
|
|
259
|
-
};
|
|
260
|
-
//# sourceMappingURL=external.mjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"external.mjs","sources":["../../../../../node_modules/zod/v4/classic/external.js"],"sourcesContent":["export * as core from \"../core/index.js\";\nexport * from \"./schemas.js\";\nexport * from \"./checks.js\";\nexport * from \"./errors.js\";\nexport * from \"./parse.js\";\nexport * from \"./compat.js\";\n// zod-specified\nimport { config } from \"../core/index.js\";\nimport en from \"../locales/en.js\";\nconfig(en());\nexport { globalRegistry, registry, config, $output, $input, $brand, clone, regexes, treeifyError, prettifyError, formatError, flattenError, TimePrecision, util, NEVER, } from \"../core/index.js\";\nexport { toJSONSchema } from \"../core/json-schema-processors.js\";\nexport { fromJSONSchema } from \"./from-json-schema.js\";\nexport * as locales from \"../locales/index.js\";\n// iso\n// must be exported from top-level\n// https://github.com/colinhacks/zod/issues/4491\nexport { ZodISODateTime, ZodISODate, ZodISOTime, ZodISODuration } from \"./iso.js\";\nexport * as iso from \"./iso.js\";\nexport * as coerce from \"./coerce.js\";\n"],"names":["config","en"],"mappings":";;;;;;;;;;;;;;;;;;;;AASAA,EAAOC,EAAE,CAAE;","x_google_ignoreList":[0]}
|
|
@@ -1,2 +0,0 @@
|
|
|
1
|
-
"use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const k=require("../core/registries.cjs"),v=require("./checks.cjs"),S=require("./iso.cjs"),O=require("./schemas.cjs"),n={...O,...v,iso:S},h=new Set(["$schema","$ref","$defs","definitions","$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor","type","enum","const","anyOf","oneOf","allOf","not","properties","required","additionalProperties","patternProperties","propertyNames","minProperties","maxProperties","items","prefixItems","additionalItems","minItems","maxItems","uniqueItems","contains","minContains","maxContains","minLength","maxLength","pattern","format","minimum","maximum","exclusiveMinimum","exclusiveMaximum","multipleOf","description","default","contentEncoding","contentMediaType","contentSchema","unevaluatedItems","unevaluatedProperties","if","then","else","dependentSchemas","dependentRequired","nullable","readOnly"]);function w(e,o){const s=e.$schema;return s==="https://json-schema.org/draft/2020-12/schema"?"draft-2020-12":s==="http://json-schema.org/draft-07/schema#"?"draft-7":s==="http://json-schema.org/draft-04/schema#"?"draft-4":o??"draft-2020-12"}function I(e,o){if(!e.startsWith("#"))throw new Error("External $ref is not supported, only local refs (#/...) are allowed");const s=e.slice(1).split("/").filter(Boolean);if(s.length===0)return o.rootSchema;const i=o.version==="draft-2020-12"?"$defs":"definitions";if(s[0]===i){const t=s[1];if(!t||!o.defs[t])throw new Error(`Reference not found: ${e}`);return o.defs[t]}throw new Error(`Reference not found: ${e}`)}function b(e,o){if(e.not!==void 0){if(typeof e.not=="object"&&Object.keys(e.not).length===0)return n.never();throw new Error("not is not supported in Zod (except { not: {} } for never)")}if(e.unevaluatedItems!==void 0)throw new Error("unevaluatedItems is not supported");if(e.unevaluatedProperties!==void 0)throw new Error("unevaluatedProperties is not supported");if(e.if!==void 0||e.then!==void 0||e.else!==void 0)throw new Error("Conditional schemas (if/then/else) are not supported");if(e.dependentSchemas!==void 0||e.dependentRequired!==void 0)throw new Error("dependentSchemas and dependentRequired are not supported");if(e.$ref){const t=e.$ref;if(o.refs.has(t))return o.refs.get(t);if(o.processing.has(t))return n.lazy(()=>{if(!o.refs.has(t))throw new Error(`Circular reference not resolved: ${t}`);return o.refs.get(t)});o.processing.add(t);const r=I(t,o),l=a(r,o);return o.refs.set(t,l),o.processing.delete(t),l}if(e.enum!==void 0){const t=e.enum;if(o.version==="openapi-3.0"&&e.nullable===!0&&t.length===1&&t[0]===null)return n.null();if(t.length===0)return n.never();if(t.length===1)return n.literal(t[0]);if(t.every(l=>typeof l=="string"))return n.enum(t);const r=t.map(l=>n.literal(l));return r.length<2?r[0]:n.union([r[0],r[1],...r.slice(2)])}if(e.const!==void 0)return n.literal(e.const);const s=e.type;if(Array.isArray(s)){const t=s.map(r=>{const l={...e,type:r};return b(l,o)});return t.length===0?n.never():t.length===1?t[0]:n.union(t)}if(!s)return n.any();let i;switch(s){case"string":{let t=n.string();if(e.format){const r=e.format;r==="email"?t=t.check(n.email()):r==="uri"||r==="uri-reference"?t=t.check(n.url()):r==="uuid"||r==="guid"?t=t.check(n.uuid()):r==="date-time"?t=t.check(n.iso.datetime()):r==="date"?t=t.check(n.iso.date()):r==="time"?t=t.check(n.iso.time()):r==="duration"?t=t.check(n.iso.duration()):r==="ipv4"?t=t.check(n.ipv4()):r==="ipv6"?t=t.check(n.ipv6()):r==="mac"?t=t.check(n.mac()):r==="cidr"?t=t.check(n.cidrv4()):r==="cidr-v6"?t=t.check(n.cidrv6()):r==="base64"?t=t.check(n.base64()):r==="base64url"?t=t.check(n.base64url()):r==="e164"?t=t.check(n.e164()):r==="jwt"?t=t.check(n.jwt()):r==="emoji"?t=t.check(n.emoji()):r==="nanoid"?t=t.check(n.nanoid()):r==="cuid"?t=t.check(n.cuid()):r==="cuid2"?t=t.check(n.cuid2()):r==="ulid"?t=t.check(n.ulid()):r==="xid"?t=t.check(n.xid()):r==="ksuid"&&(t=t.check(n.ksuid()))}typeof e.minLength=="number"&&(t=t.min(e.minLength)),typeof e.maxLength=="number"&&(t=t.max(e.maxLength)),e.pattern&&(t=t.regex(new RegExp(e.pattern))),i=t;break}case"number":case"integer":{let t=s==="integer"?n.number().int():n.number();typeof e.minimum=="number"&&(t=t.min(e.minimum)),typeof e.maximum=="number"&&(t=t.max(e.maximum)),typeof e.exclusiveMinimum=="number"?t=t.gt(e.exclusiveMinimum):e.exclusiveMinimum===!0&&typeof e.minimum=="number"&&(t=t.gt(e.minimum)),typeof e.exclusiveMaximum=="number"?t=t.lt(e.exclusiveMaximum):e.exclusiveMaximum===!0&&typeof e.maximum=="number"&&(t=t.lt(e.maximum)),typeof e.multipleOf=="number"&&(t=t.multipleOf(e.multipleOf)),i=t;break}case"boolean":{i=n.boolean();break}case"null":{i=n.null();break}case"object":{const t={},r=e.properties||{},l=new Set(e.required||[]);for(const[u,d]of Object.entries(r)){const c=a(d,o);t[u]=l.has(u)?c:c.optional()}if(e.propertyNames){const u=a(e.propertyNames,o),d=e.additionalProperties&&typeof e.additionalProperties=="object"?a(e.additionalProperties,o):n.any();if(Object.keys(t).length===0){i=n.record(u,d);break}const c=n.object(t).passthrough(),p=n.looseRecord(u,d);i=n.intersection(c,p);break}if(e.patternProperties){const u=e.patternProperties,d=Object.keys(u),c=[];for(const m of d){const y=a(u[m],o),g=n.string().regex(new RegExp(m));c.push(n.looseRecord(g,y))}const p=[];if(Object.keys(t).length>0&&p.push(n.object(t).passthrough()),p.push(...c),p.length===0)i=n.object({}).passthrough();else if(p.length===1)i=p[0];else{let m=n.intersection(p[0],p[1]);for(let y=2;y<p.length;y++)m=n.intersection(m,p[y]);i=m}break}const f=n.object(t);e.additionalProperties===!1?i=f.strict():typeof e.additionalProperties=="object"?i=f.catchall(a(e.additionalProperties,o)):i=f.passthrough();break}case"array":{const t=e.prefixItems,r=e.items;if(t&&Array.isArray(t)){const l=t.map(u=>a(u,o)),f=r&&typeof r=="object"&&!Array.isArray(r)?a(r,o):void 0;f?i=n.tuple(l).rest(f):i=n.tuple(l),typeof e.minItems=="number"&&(i=i.check(n.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(n.maxLength(e.maxItems)))}else if(Array.isArray(r)){const l=r.map(u=>a(u,o)),f=e.additionalItems&&typeof e.additionalItems=="object"?a(e.additionalItems,o):void 0;f?i=n.tuple(l).rest(f):i=n.tuple(l),typeof e.minItems=="number"&&(i=i.check(n.minLength(e.minItems))),typeof e.maxItems=="number"&&(i=i.check(n.maxLength(e.maxItems)))}else if(r!==void 0){const l=a(r,o);let f=n.array(l);typeof e.minItems=="number"&&(f=f.min(e.minItems)),typeof e.maxItems=="number"&&(f=f.max(e.maxItems)),i=f}else i=n.array(n.any());break}default:throw new Error(`Unsupported type: ${s}`)}return e.description&&(i=i.describe(e.description)),e.default!==void 0&&(i=i.default(e.default)),i}function a(e,o){if(typeof e=="boolean")return e?n.any():n.never();let s=b(e,o);const i=e.type||e.enum!==void 0||e.const!==void 0;if(e.anyOf&&Array.isArray(e.anyOf)){const f=e.anyOf.map(d=>a(d,o)),u=n.union(f);s=i?n.intersection(s,u):u}if(e.oneOf&&Array.isArray(e.oneOf)){const f=e.oneOf.map(d=>a(d,o)),u=n.xor(f);s=i?n.intersection(s,u):u}if(e.allOf&&Array.isArray(e.allOf))if(e.allOf.length===0)s=i?s:n.any();else{let f=i?s:a(e.allOf[0],o);const u=i?0:1;for(let d=u;d<e.allOf.length;d++)f=n.intersection(f,a(e.allOf[d],o));s=f}e.nullable===!0&&o.version==="openapi-3.0"&&(s=n.nullable(s)),e.readOnly===!0&&(s=n.readonly(s));const t={},r=["$id","id","$comment","$anchor","$vocabulary","$dynamicRef","$dynamicAnchor"];for(const f of r)f in e&&(t[f]=e[f]);const l=["contentEncoding","contentMediaType","contentSchema"];for(const f of l)f in e&&(t[f]=e[f]);for(const f of Object.keys(e))h.has(f)||(t[f]=e[f]);return Object.keys(t).length>0&&o.registry.add(s,t),s}function j(e,o){if(typeof e=="boolean")return e?n.any():n.never();const s=w(e,o?.defaultTarget),i=e.$defs||e.definitions||{},t={version:s,defs:i,refs:new Map,processing:new Set,rootSchema:e,registry:o?.registry??k.globalRegistry};return a(e,t)}exports.fromJSONSchema=j;
|
|
2
|
-
//# sourceMappingURL=from-json-schema.cjs.map
|
|
@@ -1 +0,0 @@
|
|
|
1
|
-
{"version":3,"file":"from-json-schema.cjs","sources":["../../../../../node_modules/zod/v4/classic/from-json-schema.js"],"sourcesContent":["import { globalRegistry } from \"../core/registries.js\";\nimport * as _checks from \"./checks.js\";\nimport * as _iso from \"./iso.js\";\nimport * as _schemas from \"./schemas.js\";\n// Local z object to avoid circular dependency with ../index.js\nconst z = {\n ..._schemas,\n ..._checks,\n iso: _iso,\n};\n// Keys that are recognized and handled by the conversion logic\nconst RECOGNIZED_KEYS = new Set([\n // Schema identification\n \"$schema\",\n \"$ref\",\n \"$defs\",\n \"definitions\",\n // Core schema keywords\n \"$id\",\n \"id\",\n \"$comment\",\n \"$anchor\",\n \"$vocabulary\",\n \"$dynamicRef\",\n \"$dynamicAnchor\",\n // Type\n \"type\",\n \"enum\",\n \"const\",\n // Composition\n \"anyOf\",\n \"oneOf\",\n \"allOf\",\n \"not\",\n // Object\n \"properties\",\n \"required\",\n \"additionalProperties\",\n \"patternProperties\",\n \"propertyNames\",\n \"minProperties\",\n \"maxProperties\",\n // Array\n \"items\",\n \"prefixItems\",\n \"additionalItems\",\n \"minItems\",\n \"maxItems\",\n \"uniqueItems\",\n \"contains\",\n \"minContains\",\n \"maxContains\",\n // String\n \"minLength\",\n \"maxLength\",\n \"pattern\",\n \"format\",\n // Number\n \"minimum\",\n \"maximum\",\n \"exclusiveMinimum\",\n \"exclusiveMaximum\",\n \"multipleOf\",\n // Already handled metadata\n \"description\",\n \"default\",\n // Content\n \"contentEncoding\",\n \"contentMediaType\",\n \"contentSchema\",\n // Unsupported (error-throwing)\n \"unevaluatedItems\",\n \"unevaluatedProperties\",\n \"if\",\n \"then\",\n \"else\",\n \"dependentSchemas\",\n \"dependentRequired\",\n // OpenAPI\n \"nullable\",\n \"readOnly\",\n]);\nfunction detectVersion(schema, defaultTarget) {\n const $schema = schema.$schema;\n if ($schema === \"https://json-schema.org/draft/2020-12/schema\") {\n return \"draft-2020-12\";\n }\n if ($schema === \"http://json-schema.org/draft-07/schema#\") {\n return \"draft-7\";\n }\n if ($schema === \"http://json-schema.org/draft-04/schema#\") {\n return \"draft-4\";\n }\n // Use defaultTarget if provided, otherwise default to draft-2020-12\n return defaultTarget ?? \"draft-2020-12\";\n}\nfunction resolveRef(ref, ctx) {\n if (!ref.startsWith(\"#\")) {\n throw new Error(\"External $ref is not supported, only local refs (#/...) are allowed\");\n }\n const path = ref.slice(1).split(\"/\").filter(Boolean);\n // Handle root reference \"#\"\n if (path.length === 0) {\n return ctx.rootSchema;\n }\n const defsKey = ctx.version === \"draft-2020-12\" ? \"$defs\" : \"definitions\";\n if (path[0] === defsKey) {\n const key = path[1];\n if (!key || !ctx.defs[key]) {\n throw new Error(`Reference not found: ${ref}`);\n }\n return ctx.defs[key];\n }\n throw new Error(`Reference not found: ${ref}`);\n}\nfunction convertBaseSchema(schema, ctx) {\n // Handle unsupported features\n if (schema.not !== undefined) {\n // Special case: { not: {} } represents never\n if (typeof schema.not === \"object\" && Object.keys(schema.not).length === 0) {\n return z.never();\n }\n throw new Error(\"not is not supported in Zod (except { not: {} } for never)\");\n }\n if (schema.unevaluatedItems !== undefined) {\n throw new Error(\"unevaluatedItems is not supported\");\n }\n if (schema.unevaluatedProperties !== undefined) {\n throw new Error(\"unevaluatedProperties is not supported\");\n }\n if (schema.if !== undefined || schema.then !== undefined || schema.else !== undefined) {\n throw new Error(\"Conditional schemas (if/then/else) are not supported\");\n }\n if (schema.dependentSchemas !== undefined || schema.dependentRequired !== undefined) {\n throw new Error(\"dependentSchemas and dependentRequired are not supported\");\n }\n // Handle $ref\n if (schema.$ref) {\n const refPath = schema.$ref;\n if (ctx.refs.has(refPath)) {\n return ctx.refs.get(refPath);\n }\n if (ctx.processing.has(refPath)) {\n // Circular reference - use lazy\n return z.lazy(() => {\n if (!ctx.refs.has(refPath)) {\n throw new Error(`Circular reference not resolved: ${refPath}`);\n }\n return ctx.refs.get(refPath);\n });\n }\n ctx.processing.add(refPath);\n const resolved = resolveRef(refPath, ctx);\n const zodSchema = convertSchema(resolved, ctx);\n ctx.refs.set(refPath, zodSchema);\n ctx.processing.delete(refPath);\n return zodSchema;\n }\n // Handle enum\n if (schema.enum !== undefined) {\n const enumValues = schema.enum;\n // Special case: OpenAPI 3.0 null representation { type: \"string\", nullable: true, enum: [null] }\n if (ctx.version === \"openapi-3.0\" &&\n schema.nullable === true &&\n enumValues.length === 1 &&\n enumValues[0] === null) {\n return z.null();\n }\n if (enumValues.length === 0) {\n return z.never();\n }\n if (enumValues.length === 1) {\n return z.literal(enumValues[0]);\n }\n // Check if all values are strings\n if (enumValues.every((v) => typeof v === \"string\")) {\n return z.enum(enumValues);\n }\n // Mixed types - use union of literals\n const literalSchemas = enumValues.map((v) => z.literal(v));\n if (literalSchemas.length < 2) {\n return literalSchemas[0];\n }\n return z.union([literalSchemas[0], literalSchemas[1], ...literalSchemas.slice(2)]);\n }\n // Handle const\n if (schema.const !== undefined) {\n return z.literal(schema.const);\n }\n // Handle type\n const type = schema.type;\n if (Array.isArray(type)) {\n // Expand type array into anyOf union\n const typeSchemas = type.map((t) => {\n const typeSchema = { ...schema, type: t };\n return convertBaseSchema(typeSchema, ctx);\n });\n if (typeSchemas.length === 0) {\n return z.never();\n }\n if (typeSchemas.length === 1) {\n return typeSchemas[0];\n }\n return z.union(typeSchemas);\n }\n if (!type) {\n // No type specified - empty schema (any)\n return z.any();\n }\n let zodSchema;\n switch (type) {\n case \"string\": {\n let stringSchema = z.string();\n // Apply format using .check() with Zod format functions\n if (schema.format) {\n const format = schema.format;\n // Map common formats to Zod check functions\n if (format === \"email\") {\n stringSchema = stringSchema.check(z.email());\n }\n else if (format === \"uri\" || format === \"uri-reference\") {\n stringSchema = stringSchema.check(z.url());\n }\n else if (format === \"uuid\" || format === \"guid\") {\n stringSchema = stringSchema.check(z.uuid());\n }\n else if (format === \"date-time\") {\n stringSchema = stringSchema.check(z.iso.datetime());\n }\n else if (format === \"date\") {\n stringSchema = stringSchema.check(z.iso.date());\n }\n else if (format === \"time\") {\n stringSchema = stringSchema.check(z.iso.time());\n }\n else if (format === \"duration\") {\n stringSchema = stringSchema.check(z.iso.duration());\n }\n else if (format === \"ipv4\") {\n stringSchema = stringSchema.check(z.ipv4());\n }\n else if (format === \"ipv6\") {\n stringSchema = stringSchema.check(z.ipv6());\n }\n else if (format === \"mac\") {\n stringSchema = stringSchema.check(z.mac());\n }\n else if (format === \"cidr\") {\n stringSchema = stringSchema.check(z.cidrv4());\n }\n else if (format === \"cidr-v6\") {\n stringSchema = stringSchema.check(z.cidrv6());\n }\n else if (format === \"base64\") {\n stringSchema = stringSchema.check(z.base64());\n }\n else if (format === \"base64url\") {\n stringSchema = stringSchema.check(z.base64url());\n }\n else if (format === \"e164\") {\n stringSchema = stringSchema.check(z.e164());\n }\n else if (format === \"jwt\") {\n stringSchema = stringSchema.check(z.jwt());\n }\n else if (format === \"emoji\") {\n stringSchema = stringSchema.check(z.emoji());\n }\n else if (format === \"nanoid\") {\n stringSchema = stringSchema.check(z.nanoid());\n }\n else if (format === \"cuid\") {\n stringSchema = stringSchema.check(z.cuid());\n }\n else if (format === \"cuid2\") {\n stringSchema = stringSchema.check(z.cuid2());\n }\n else if (format === \"ulid\") {\n stringSchema = stringSchema.check(z.ulid());\n }\n else if (format === \"xid\") {\n stringSchema = stringSchema.check(z.xid());\n }\n else if (format === \"ksuid\") {\n stringSchema = stringSchema.check(z.ksuid());\n }\n // Note: json-string format is not currently supported by Zod\n // Custom formats are ignored - keep as plain string\n }\n // Apply constraints\n if (typeof schema.minLength === \"number\") {\n stringSchema = stringSchema.min(schema.minLength);\n }\n if (typeof schema.maxLength === \"number\") {\n stringSchema = stringSchema.max(schema.maxLength);\n }\n if (schema.pattern) {\n // JSON Schema patterns are not implicitly anchored (match anywhere in string)\n stringSchema = stringSchema.regex(new RegExp(schema.pattern));\n }\n zodSchema = stringSchema;\n break;\n }\n case \"number\":\n case \"integer\": {\n let numberSchema = type === \"integer\" ? z.number().int() : z.number();\n // Apply constraints\n if (typeof schema.minimum === \"number\") {\n numberSchema = numberSchema.min(schema.minimum);\n }\n if (typeof schema.maximum === \"number\") {\n numberSchema = numberSchema.max(schema.maximum);\n }\n if (typeof schema.exclusiveMinimum === \"number\") {\n numberSchema = numberSchema.gt(schema.exclusiveMinimum);\n }\n else if (schema.exclusiveMinimum === true && typeof schema.minimum === \"number\") {\n numberSchema = numberSchema.gt(schema.minimum);\n }\n if (typeof schema.exclusiveMaximum === \"number\") {\n numberSchema = numberSchema.lt(schema.exclusiveMaximum);\n }\n else if (schema.exclusiveMaximum === true && typeof schema.maximum === \"number\") {\n numberSchema = numberSchema.lt(schema.maximum);\n }\n if (typeof schema.multipleOf === \"number\") {\n numberSchema = numberSchema.multipleOf(schema.multipleOf);\n }\n zodSchema = numberSchema;\n break;\n }\n case \"boolean\": {\n zodSchema = z.boolean();\n break;\n }\n case \"null\": {\n zodSchema = z.null();\n break;\n }\n case \"object\": {\n const shape = {};\n const properties = schema.properties || {};\n const requiredSet = new Set(schema.required || []);\n // Convert properties - mark optional ones\n for (const [key, propSchema] of Object.entries(properties)) {\n const propZodSchema = convertSchema(propSchema, ctx);\n // If not in required array, make it optional\n shape[key] = requiredSet.has(key) ? propZodSchema : propZodSchema.optional();\n }\n // Handle propertyNames\n if (schema.propertyNames) {\n const keySchema = convertSchema(schema.propertyNames, ctx);\n const valueSchema = schema.additionalProperties && typeof schema.additionalProperties === \"object\"\n ? convertSchema(schema.additionalProperties, ctx)\n : z.any();\n // Case A: No properties (pure record)\n if (Object.keys(shape).length === 0) {\n zodSchema = z.record(keySchema, valueSchema);\n break;\n }\n // Case B: With properties (intersection of object and looseRecord)\n const objectSchema = z.object(shape).passthrough();\n const recordSchema = z.looseRecord(keySchema, valueSchema);\n zodSchema = z.intersection(objectSchema, recordSchema);\n break;\n }\n // Handle patternProperties\n if (schema.patternProperties) {\n // patternProperties: keys matching pattern must satisfy corresponding schema\n // Use loose records so non-matching keys pass through\n const patternProps = schema.patternProperties;\n const patternKeys = Object.keys(patternProps);\n const looseRecords = [];\n for (const pattern of patternKeys) {\n const patternValue = convertSchema(patternProps[pattern], ctx);\n const keySchema = z.string().regex(new RegExp(pattern));\n looseRecords.push(z.looseRecord(keySchema, patternValue));\n }\n // Build intersection: object schema + all pattern property records\n const schemasToIntersect = [];\n if (Object.keys(shape).length > 0) {\n // Use passthrough so patternProperties can validate additional keys\n schemasToIntersect.push(z.object(shape).passthrough());\n }\n schemasToIntersect.push(...looseRecords);\n if (schemasToIntersect.length === 0) {\n zodSchema = z.object({}).passthrough();\n }\n else if (schemasToIntersect.length === 1) {\n zodSchema = schemasToIntersect[0];\n }\n else {\n // Chain intersections: (A & B) & C & D ...\n let result = z.intersection(schemasToIntersect[0], schemasToIntersect[1]);\n for (let i = 2; i < schemasToIntersect.length; i++) {\n result = z.intersection(result, schemasToIntersect[i]);\n }\n zodSchema = result;\n }\n break;\n }\n // Handle additionalProperties\n // In JSON Schema, additionalProperties defaults to true (allow any extra properties)\n // In Zod, objects strip unknown keys by default, so we need to handle this explicitly\n const objectSchema = z.object(shape);\n if (schema.additionalProperties === false) {\n // Strict mode - no extra properties allowed\n zodSchema = objectSchema.strict();\n }\n else if (typeof schema.additionalProperties === \"object\") {\n // Extra properties must match the specified schema\n zodSchema = objectSchema.catchall(convertSchema(schema.additionalProperties, ctx));\n }\n else {\n // additionalProperties is true or undefined - allow any extra properties (passthrough)\n zodSchema = objectSchema.passthrough();\n }\n break;\n }\n case \"array\": {\n // TODO: uniqueItems is not supported\n // TODO: contains/minContains/maxContains are not supported\n // Check if this is a tuple (prefixItems or items as array)\n const prefixItems = schema.prefixItems;\n const items = schema.items;\n if (prefixItems && Array.isArray(prefixItems)) {\n // Tuple with prefixItems (draft-2020-12)\n const tupleItems = prefixItems.map((item) => convertSchema(item, ctx));\n const rest = items && typeof items === \"object\" && !Array.isArray(items)\n ? convertSchema(items, ctx)\n : undefined;\n if (rest) {\n zodSchema = z.tuple(tupleItems).rest(rest);\n }\n else {\n zodSchema = z.tuple(tupleItems);\n }\n // Apply minItems/maxItems constraints to tuples\n if (typeof schema.minItems === \"number\") {\n zodSchema = zodSchema.check(z.minLength(schema.minItems));\n }\n if (typeof schema.maxItems === \"number\") {\n zodSchema = zodSchema.check(z.maxLength(schema.maxItems));\n }\n }\n else if (Array.isArray(items)) {\n // Tuple with items array (draft-7)\n const tupleItems = items.map((item) => convertSchema(item, ctx));\n const rest = schema.additionalItems && typeof schema.additionalItems === \"object\"\n ? convertSchema(schema.additionalItems, ctx)\n : undefined; // additionalItems: false means no rest, handled by default tuple behavior\n if (rest) {\n zodSchema = z.tuple(tupleItems).rest(rest);\n }\n else {\n zodSchema = z.tuple(tupleItems);\n }\n // Apply minItems/maxItems constraints to tuples\n if (typeof schema.minItems === \"number\") {\n zodSchema = zodSchema.check(z.minLength(schema.minItems));\n }\n if (typeof schema.maxItems === \"number\") {\n zodSchema = zodSchema.check(z.maxLength(schema.maxItems));\n }\n }\n else if (items !== undefined) {\n // Regular array\n const element = convertSchema(items, ctx);\n let arraySchema = z.array(element);\n // Apply constraints\n if (typeof schema.minItems === \"number\") {\n arraySchema = arraySchema.min(schema.minItems);\n }\n if (typeof schema.maxItems === \"number\") {\n arraySchema = arraySchema.max(schema.maxItems);\n }\n zodSchema = arraySchema;\n }\n else {\n // No items specified - array of any\n zodSchema = z.array(z.any());\n }\n break;\n }\n default:\n throw new Error(`Unsupported type: ${type}`);\n }\n // Apply metadata\n if (schema.description) {\n zodSchema = zodSchema.describe(schema.description);\n }\n if (schema.default !== undefined) {\n zodSchema = zodSchema.default(schema.default);\n }\n return zodSchema;\n}\nfunction convertSchema(schema, ctx) {\n if (typeof schema === \"boolean\") {\n return schema ? z.any() : z.never();\n }\n // Convert base schema first (ignoring composition keywords)\n let baseSchema = convertBaseSchema(schema, ctx);\n const hasExplicitType = schema.type || schema.enum !== undefined || schema.const !== undefined;\n // Process composition keywords LAST (they can appear together)\n // Handle anyOf - wrap base schema with union\n if (schema.anyOf && Array.isArray(schema.anyOf)) {\n const options = schema.anyOf.map((s) => convertSchema(s, ctx));\n const anyOfUnion = z.union(options);\n baseSchema = hasExplicitType ? z.intersection(baseSchema, anyOfUnion) : anyOfUnion;\n }\n // Handle oneOf - exclusive union (exactly one must match)\n if (schema.oneOf && Array.isArray(schema.oneOf)) {\n const options = schema.oneOf.map((s) => convertSchema(s, ctx));\n const oneOfUnion = z.xor(options);\n baseSchema = hasExplicitType ? z.intersection(baseSchema, oneOfUnion) : oneOfUnion;\n }\n // Handle allOf - wrap base schema with intersection\n if (schema.allOf && Array.isArray(schema.allOf)) {\n if (schema.allOf.length === 0) {\n baseSchema = hasExplicitType ? baseSchema : z.any();\n }\n else {\n let result = hasExplicitType ? baseSchema : convertSchema(schema.allOf[0], ctx);\n const startIdx = hasExplicitType ? 0 : 1;\n for (let i = startIdx; i < schema.allOf.length; i++) {\n result = z.intersection(result, convertSchema(schema.allOf[i], ctx));\n }\n baseSchema = result;\n }\n }\n // Handle nullable (OpenAPI 3.0)\n if (schema.nullable === true && ctx.version === \"openapi-3.0\") {\n baseSchema = z.nullable(baseSchema);\n }\n // Handle readOnly\n if (schema.readOnly === true) {\n baseSchema = z.readonly(baseSchema);\n }\n // Collect metadata: core schema keywords and unrecognized keys\n const extraMeta = {};\n // Core schema keywords that should be captured as metadata\n const coreMetadataKeys = [\"$id\", \"id\", \"$comment\", \"$anchor\", \"$vocabulary\", \"$dynamicRef\", \"$dynamicAnchor\"];\n for (const key of coreMetadataKeys) {\n if (key in schema) {\n extraMeta[key] = schema[key];\n }\n }\n // Content keywords - store as metadata\n const contentMetadataKeys = [\"contentEncoding\", \"contentMediaType\", \"contentSchema\"];\n for (const key of contentMetadataKeys) {\n if (key in schema) {\n extraMeta[key] = schema[key];\n }\n }\n // Unrecognized keys (custom metadata)\n for (const key of Object.keys(schema)) {\n if (!RECOGNIZED_KEYS.has(key)) {\n extraMeta[key] = schema[key];\n }\n }\n if (Object.keys(extraMeta).length > 0) {\n ctx.registry.add(baseSchema, extraMeta);\n }\n return baseSchema;\n}\n/**\n * Converts a JSON Schema to a Zod schema. This function should be considered semi-experimental. It's behavior is liable to change. */\nexport function fromJSONSchema(schema, params) {\n // Handle boolean schemas\n if (typeof schema === \"boolean\") {\n return schema ? z.any() : z.never();\n }\n const version = detectVersion(schema, params?.defaultTarget);\n const defs = (schema.$defs || schema.definitions || {});\n const ctx = {\n version,\n defs,\n refs: new Map(),\n processing: new Set(),\n rootSchema: schema,\n registry: params?.registry ?? globalRegistry,\n };\n return convertSchema(schema, ctx);\n}\n"],"names":["z","_schemas","_checks","_iso","RECOGNIZED_KEYS","detectVersion","schema","defaultTarget","$schema","resolveRef","ref","ctx","path","defsKey","key","convertBaseSchema","refPath","resolved","zodSchema","convertSchema","enumValues","v","literalSchemas","type","typeSchemas","t","typeSchema","stringSchema","format","numberSchema","shape","properties","requiredSet","propSchema","propZodSchema","keySchema","valueSchema","objectSchema","recordSchema","patternProps","patternKeys","looseRecords","pattern","patternValue","schemasToIntersect","result","i","prefixItems","items","tupleItems","item","rest","element","arraySchema","baseSchema","hasExplicitType","options","s","anyOfUnion","oneOfUnion","startIdx","extraMeta","coreMetadataKeys","contentMetadataKeys","fromJSONSchema","params","version","defs","globalRegistry"],"mappings":"sMAKMA,EAAI,CACN,GAAGC,EACH,GAAGC,EACH,IAAKC,CACT,EAEMC,EAAkB,IAAI,IAAI,CAE5B,UACA,OACA,QACA,cAEA,MACA,KACA,WACA,UACA,cACA,cACA,iBAEA,OACA,OACA,QAEA,QACA,QACA,QACA,MAEA,aACA,WACA,uBACA,oBACA,gBACA,gBACA,gBAEA,QACA,cACA,kBACA,WACA,WACA,cACA,WACA,cACA,cAEA,YACA,YACA,UACA,SAEA,UACA,UACA,mBACA,mBACA,aAEA,cACA,UAEA,kBACA,mBACA,gBAEA,mBACA,wBACA,KACA,OACA,OACA,mBACA,oBAEA,WACA,UACJ,CAAC,EACD,SAASC,EAAcC,EAAQC,EAAe,CAC1C,MAAMC,EAAUF,EAAO,QACvB,OAAIE,IAAY,+CACL,gBAEPA,IAAY,0CACL,UAEPA,IAAY,0CACL,UAGJD,GAAiB,eAC5B,CACA,SAASE,EAAWC,EAAKC,EAAK,CAC1B,GAAI,CAACD,EAAI,WAAW,GAAG,EACnB,MAAM,IAAI,MAAM,qEAAqE,EAEzF,MAAME,EAAOF,EAAI,MAAM,CAAC,EAAE,MAAM,GAAG,EAAE,OAAO,OAAO,EAEnD,GAAIE,EAAK,SAAW,EAChB,OAAOD,EAAI,WAEf,MAAME,EAAUF,EAAI,UAAY,gBAAkB,QAAU,cAC5D,GAAIC,EAAK,CAAC,IAAMC,EAAS,CACrB,MAAMC,EAAMF,EAAK,CAAC,EAClB,GAAI,CAACE,GAAO,CAACH,EAAI,KAAKG,CAAG,EACrB,MAAM,IAA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,CAAG,EAAIR,EAAOQ,CAAG,GAInC,UAAWA,KAAO,OAAO,KAAKR,CAAM,EAC3BF,EAAgB,IAAIU,CAAG,IACxB+C,EAAU/C,CAAG,EAAIR,EAAOQ,CAAG,GAGnC,OAAI,OAAO,KAAK+C,CAAS,EAAE,OAAS,GAChClD,EAAI,SAAS,IAAI2C,EAAYO,CAAS,EAEnCP,CACX,CAGO,SAASU,EAAe1D,EAAQ2D,EAAQ,CAE3C,GAAI,OAAO3D,GAAW,UAClB,OAAOA,EAASN,EAAE,IAAG,EAAKA,EAAE,MAAO,EAEvC,MAAMkE,EAAU7D,EAAcC,EAAQ2D,GAAQ,aAAa,EACrDE,EAAQ7D,EAAO,OAASA,EAAO,aAAe,CAAA,EAC9CK,EAAM,CACR,QAAAuD,EACA,KAAAC,EACA,KAAM,IAAI,IACV,WAAY,IAAI,IAChB,WAAY7D,EACZ,SAAU2D,GAAQ,UAAYG,EAAc,cAC/C,EACD,OAAOjD,EAAcb,EAAQK,CAAG,CACpC","x_google_ignoreList":[0]}
|
|
@@ -1,287 +0,0 @@
|
|
|
1
|
-
import { globalRegistry as k } from "../core/registries.mjs";
|
|
2
|
-
import * as v from "./checks.mjs";
|
|
3
|
-
import * as S from "./iso.mjs";
|
|
4
|
-
import * as O from "./schemas.mjs";
|
|
5
|
-
const n = {
|
|
6
|
-
...O,
|
|
7
|
-
...v,
|
|
8
|
-
iso: S
|
|
9
|
-
}, h = /* @__PURE__ */ new Set([
|
|
10
|
-
// Schema identification
|
|
11
|
-
"$schema",
|
|
12
|
-
"$ref",
|
|
13
|
-
"$defs",
|
|
14
|
-
"definitions",
|
|
15
|
-
// Core schema keywords
|
|
16
|
-
"$id",
|
|
17
|
-
"id",
|
|
18
|
-
"$comment",
|
|
19
|
-
"$anchor",
|
|
20
|
-
"$vocabulary",
|
|
21
|
-
"$dynamicRef",
|
|
22
|
-
"$dynamicAnchor",
|
|
23
|
-
// Type
|
|
24
|
-
"type",
|
|
25
|
-
"enum",
|
|
26
|
-
"const",
|
|
27
|
-
// Composition
|
|
28
|
-
"anyOf",
|
|
29
|
-
"oneOf",
|
|
30
|
-
"allOf",
|
|
31
|
-
"not",
|
|
32
|
-
// Object
|
|
33
|
-
"properties",
|
|
34
|
-
"required",
|
|
35
|
-
"additionalProperties",
|
|
36
|
-
"patternProperties",
|
|
37
|
-
"propertyNames",
|
|
38
|
-
"minProperties",
|
|
39
|
-
"maxProperties",
|
|
40
|
-
// Array
|
|
41
|
-
"items",
|
|
42
|
-
"prefixItems",
|
|
43
|
-
"additionalItems",
|
|
44
|
-
"minItems",
|
|
45
|
-
"maxItems",
|
|
46
|
-
"uniqueItems",
|
|
47
|
-
"contains",
|
|
48
|
-
"minContains",
|
|
49
|
-
"maxContains",
|
|
50
|
-
// String
|
|
51
|
-
"minLength",
|
|
52
|
-
"maxLength",
|
|
53
|
-
"pattern",
|
|
54
|
-
"format",
|
|
55
|
-
// Number
|
|
56
|
-
"minimum",
|
|
57
|
-
"maximum",
|
|
58
|
-
"exclusiveMinimum",
|
|
59
|
-
"exclusiveMaximum",
|
|
60
|
-
"multipleOf",
|
|
61
|
-
// Already handled metadata
|
|
62
|
-
"description",
|
|
63
|
-
"default",
|
|
64
|
-
// Content
|
|
65
|
-
"contentEncoding",
|
|
66
|
-
"contentMediaType",
|
|
67
|
-
"contentSchema",
|
|
68
|
-
// Unsupported (error-throwing)
|
|
69
|
-
"unevaluatedItems",
|
|
70
|
-
"unevaluatedProperties",
|
|
71
|
-
"if",
|
|
72
|
-
"then",
|
|
73
|
-
"else",
|
|
74
|
-
"dependentSchemas",
|
|
75
|
-
"dependentRequired",
|
|
76
|
-
// OpenAPI
|
|
77
|
-
"nullable",
|
|
78
|
-
"readOnly"
|
|
79
|
-
]);
|
|
80
|
-
function w(e, o) {
|
|
81
|
-
const s = e.$schema;
|
|
82
|
-
return s === "https://json-schema.org/draft/2020-12/schema" ? "draft-2020-12" : s === "http://json-schema.org/draft-07/schema#" ? "draft-7" : s === "http://json-schema.org/draft-04/schema#" ? "draft-4" : o ?? "draft-2020-12";
|
|
83
|
-
}
|
|
84
|
-
function I(e, o) {
|
|
85
|
-
if (!e.startsWith("#"))
|
|
86
|
-
throw new Error("External $ref is not supported, only local refs (#/...) are allowed");
|
|
87
|
-
const s = e.slice(1).split("/").filter(Boolean);
|
|
88
|
-
if (s.length === 0)
|
|
89
|
-
return o.rootSchema;
|
|
90
|
-
const i = o.version === "draft-2020-12" ? "$defs" : "definitions";
|
|
91
|
-
if (s[0] === i) {
|
|
92
|
-
const t = s[1];
|
|
93
|
-
if (!t || !o.defs[t])
|
|
94
|
-
throw new Error(`Reference not found: ${e}`);
|
|
95
|
-
return o.defs[t];
|
|
96
|
-
}
|
|
97
|
-
throw new Error(`Reference not found: ${e}`);
|
|
98
|
-
}
|
|
99
|
-
function b(e, o) {
|
|
100
|
-
if (e.not !== void 0) {
|
|
101
|
-
if (typeof e.not == "object" && Object.keys(e.not).length === 0)
|
|
102
|
-
return n.never();
|
|
103
|
-
throw new Error("not is not supported in Zod (except { not: {} } for never)");
|
|
104
|
-
}
|
|
105
|
-
if (e.unevaluatedItems !== void 0)
|
|
106
|
-
throw new Error("unevaluatedItems is not supported");
|
|
107
|
-
if (e.unevaluatedProperties !== void 0)
|
|
108
|
-
throw new Error("unevaluatedProperties is not supported");
|
|
109
|
-
if (e.if !== void 0 || e.then !== void 0 || e.else !== void 0)
|
|
110
|
-
throw new Error("Conditional schemas (if/then/else) are not supported");
|
|
111
|
-
if (e.dependentSchemas !== void 0 || e.dependentRequired !== void 0)
|
|
112
|
-
throw new Error("dependentSchemas and dependentRequired are not supported");
|
|
113
|
-
if (e.$ref) {
|
|
114
|
-
const t = e.$ref;
|
|
115
|
-
if (o.refs.has(t))
|
|
116
|
-
return o.refs.get(t);
|
|
117
|
-
if (o.processing.has(t))
|
|
118
|
-
return n.lazy(() => {
|
|
119
|
-
if (!o.refs.has(t))
|
|
120
|
-
throw new Error(`Circular reference not resolved: ${t}`);
|
|
121
|
-
return o.refs.get(t);
|
|
122
|
-
});
|
|
123
|
-
o.processing.add(t);
|
|
124
|
-
const r = I(t, o), l = a(r, o);
|
|
125
|
-
return o.refs.set(t, l), o.processing.delete(t), l;
|
|
126
|
-
}
|
|
127
|
-
if (e.enum !== void 0) {
|
|
128
|
-
const t = e.enum;
|
|
129
|
-
if (o.version === "openapi-3.0" && e.nullable === !0 && t.length === 1 && t[0] === null)
|
|
130
|
-
return n.null();
|
|
131
|
-
if (t.length === 0)
|
|
132
|
-
return n.never();
|
|
133
|
-
if (t.length === 1)
|
|
134
|
-
return n.literal(t[0]);
|
|
135
|
-
if (t.every((l) => typeof l == "string"))
|
|
136
|
-
return n.enum(t);
|
|
137
|
-
const r = t.map((l) => n.literal(l));
|
|
138
|
-
return r.length < 2 ? r[0] : n.union([r[0], r[1], ...r.slice(2)]);
|
|
139
|
-
}
|
|
140
|
-
if (e.const !== void 0)
|
|
141
|
-
return n.literal(e.const);
|
|
142
|
-
const s = e.type;
|
|
143
|
-
if (Array.isArray(s)) {
|
|
144
|
-
const t = s.map((r) => {
|
|
145
|
-
const l = { ...e, type: r };
|
|
146
|
-
return b(l, o);
|
|
147
|
-
});
|
|
148
|
-
return t.length === 0 ? n.never() : t.length === 1 ? t[0] : n.union(t);
|
|
149
|
-
}
|
|
150
|
-
if (!s)
|
|
151
|
-
return n.any();
|
|
152
|
-
let i;
|
|
153
|
-
switch (s) {
|
|
154
|
-
case "string": {
|
|
155
|
-
let t = n.string();
|
|
156
|
-
if (e.format) {
|
|
157
|
-
const r = e.format;
|
|
158
|
-
r === "email" ? t = t.check(n.email()) : r === "uri" || r === "uri-reference" ? t = t.check(n.url()) : r === "uuid" || r === "guid" ? t = t.check(n.uuid()) : r === "date-time" ? t = t.check(n.iso.datetime()) : r === "date" ? t = t.check(n.iso.date()) : r === "time" ? t = t.check(n.iso.time()) : r === "duration" ? t = t.check(n.iso.duration()) : r === "ipv4" ? t = t.check(n.ipv4()) : r === "ipv6" ? t = t.check(n.ipv6()) : r === "mac" ? t = t.check(n.mac()) : r === "cidr" ? t = t.check(n.cidrv4()) : r === "cidr-v6" ? t = t.check(n.cidrv6()) : r === "base64" ? t = t.check(n.base64()) : r === "base64url" ? t = t.check(n.base64url()) : r === "e164" ? t = t.check(n.e164()) : r === "jwt" ? t = t.check(n.jwt()) : r === "emoji" ? t = t.check(n.emoji()) : r === "nanoid" ? t = t.check(n.nanoid()) : r === "cuid" ? t = t.check(n.cuid()) : r === "cuid2" ? t = t.check(n.cuid2()) : r === "ulid" ? t = t.check(n.ulid()) : r === "xid" ? t = t.check(n.xid()) : r === "ksuid" && (t = t.check(n.ksuid()));
|
|
159
|
-
}
|
|
160
|
-
typeof e.minLength == "number" && (t = t.min(e.minLength)), typeof e.maxLength == "number" && (t = t.max(e.maxLength)), e.pattern && (t = t.regex(new RegExp(e.pattern))), i = t;
|
|
161
|
-
break;
|
|
162
|
-
}
|
|
163
|
-
case "number":
|
|
164
|
-
case "integer": {
|
|
165
|
-
let t = s === "integer" ? n.number().int() : n.number();
|
|
166
|
-
typeof e.minimum == "number" && (t = t.min(e.minimum)), typeof e.maximum == "number" && (t = t.max(e.maximum)), typeof e.exclusiveMinimum == "number" ? t = t.gt(e.exclusiveMinimum) : e.exclusiveMinimum === !0 && typeof e.minimum == "number" && (t = t.gt(e.minimum)), typeof e.exclusiveMaximum == "number" ? t = t.lt(e.exclusiveMaximum) : e.exclusiveMaximum === !0 && typeof e.maximum == "number" && (t = t.lt(e.maximum)), typeof e.multipleOf == "number" && (t = t.multipleOf(e.multipleOf)), i = t;
|
|
167
|
-
break;
|
|
168
|
-
}
|
|
169
|
-
case "boolean": {
|
|
170
|
-
i = n.boolean();
|
|
171
|
-
break;
|
|
172
|
-
}
|
|
173
|
-
case "null": {
|
|
174
|
-
i = n.null();
|
|
175
|
-
break;
|
|
176
|
-
}
|
|
177
|
-
case "object": {
|
|
178
|
-
const t = {}, r = e.properties || {}, l = new Set(e.required || []);
|
|
179
|
-
for (const [u, d] of Object.entries(r)) {
|
|
180
|
-
const c = a(d, o);
|
|
181
|
-
t[u] = l.has(u) ? c : c.optional();
|
|
182
|
-
}
|
|
183
|
-
if (e.propertyNames) {
|
|
184
|
-
const u = a(e.propertyNames, o), d = e.additionalProperties && typeof e.additionalProperties == "object" ? a(e.additionalProperties, o) : n.any();
|
|
185
|
-
if (Object.keys(t).length === 0) {
|
|
186
|
-
i = n.record(u, d);
|
|
187
|
-
break;
|
|
188
|
-
}
|
|
189
|
-
const c = n.object(t).passthrough(), p = n.looseRecord(u, d);
|
|
190
|
-
i = n.intersection(c, p);
|
|
191
|
-
break;
|
|
192
|
-
}
|
|
193
|
-
if (e.patternProperties) {
|
|
194
|
-
const u = e.patternProperties, d = Object.keys(u), c = [];
|
|
195
|
-
for (const m of d) {
|
|
196
|
-
const y = a(u[m], o), g = n.string().regex(new RegExp(m));
|
|
197
|
-
c.push(n.looseRecord(g, y));
|
|
198
|
-
}
|
|
199
|
-
const p = [];
|
|
200
|
-
if (Object.keys(t).length > 0 && p.push(n.object(t).passthrough()), p.push(...c), p.length === 0)
|
|
201
|
-
i = n.object({}).passthrough();
|
|
202
|
-
else if (p.length === 1)
|
|
203
|
-
i = p[0];
|
|
204
|
-
else {
|
|
205
|
-
let m = n.intersection(p[0], p[1]);
|
|
206
|
-
for (let y = 2; y < p.length; y++)
|
|
207
|
-
m = n.intersection(m, p[y]);
|
|
208
|
-
i = m;
|
|
209
|
-
}
|
|
210
|
-
break;
|
|
211
|
-
}
|
|
212
|
-
const f = n.object(t);
|
|
213
|
-
e.additionalProperties === !1 ? i = f.strict() : typeof e.additionalProperties == "object" ? i = f.catchall(a(e.additionalProperties, o)) : i = f.passthrough();
|
|
214
|
-
break;
|
|
215
|
-
}
|
|
216
|
-
case "array": {
|
|
217
|
-
const t = e.prefixItems, r = e.items;
|
|
218
|
-
if (t && Array.isArray(t)) {
|
|
219
|
-
const l = t.map((u) => a(u, o)), f = r && typeof r == "object" && !Array.isArray(r) ? a(r, o) : void 0;
|
|
220
|
-
f ? i = n.tuple(l).rest(f) : i = n.tuple(l), typeof e.minItems == "number" && (i = i.check(n.minLength(e.minItems))), typeof e.maxItems == "number" && (i = i.check(n.maxLength(e.maxItems)));
|
|
221
|
-
} else if (Array.isArray(r)) {
|
|
222
|
-
const l = r.map((u) => a(u, o)), f = e.additionalItems && typeof e.additionalItems == "object" ? a(e.additionalItems, o) : void 0;
|
|
223
|
-
f ? i = n.tuple(l).rest(f) : i = n.tuple(l), typeof e.minItems == "number" && (i = i.check(n.minLength(e.minItems))), typeof e.maxItems == "number" && (i = i.check(n.maxLength(e.maxItems)));
|
|
224
|
-
} else if (r !== void 0) {
|
|
225
|
-
const l = a(r, o);
|
|
226
|
-
let f = n.array(l);
|
|
227
|
-
typeof e.minItems == "number" && (f = f.min(e.minItems)), typeof e.maxItems == "number" && (f = f.max(e.maxItems)), i = f;
|
|
228
|
-
} else
|
|
229
|
-
i = n.array(n.any());
|
|
230
|
-
break;
|
|
231
|
-
}
|
|
232
|
-
default:
|
|
233
|
-
throw new Error(`Unsupported type: ${s}`);
|
|
234
|
-
}
|
|
235
|
-
return e.description && (i = i.describe(e.description)), e.default !== void 0 && (i = i.default(e.default)), i;
|
|
236
|
-
}
|
|
237
|
-
function a(e, o) {
|
|
238
|
-
if (typeof e == "boolean")
|
|
239
|
-
return e ? n.any() : n.never();
|
|
240
|
-
let s = b(e, o);
|
|
241
|
-
const i = e.type || e.enum !== void 0 || e.const !== void 0;
|
|
242
|
-
if (e.anyOf && Array.isArray(e.anyOf)) {
|
|
243
|
-
const f = e.anyOf.map((d) => a(d, o)), u = n.union(f);
|
|
244
|
-
s = i ? n.intersection(s, u) : u;
|
|
245
|
-
}
|
|
246
|
-
if (e.oneOf && Array.isArray(e.oneOf)) {
|
|
247
|
-
const f = e.oneOf.map((d) => a(d, o)), u = n.xor(f);
|
|
248
|
-
s = i ? n.intersection(s, u) : u;
|
|
249
|
-
}
|
|
250
|
-
if (e.allOf && Array.isArray(e.allOf))
|
|
251
|
-
if (e.allOf.length === 0)
|
|
252
|
-
s = i ? s : n.any();
|
|
253
|
-
else {
|
|
254
|
-
let f = i ? s : a(e.allOf[0], o);
|
|
255
|
-
const u = i ? 0 : 1;
|
|
256
|
-
for (let d = u; d < e.allOf.length; d++)
|
|
257
|
-
f = n.intersection(f, a(e.allOf[d], o));
|
|
258
|
-
s = f;
|
|
259
|
-
}
|
|
260
|
-
e.nullable === !0 && o.version === "openapi-3.0" && (s = n.nullable(s)), e.readOnly === !0 && (s = n.readonly(s));
|
|
261
|
-
const t = {}, r = ["$id", "id", "$comment", "$anchor", "$vocabulary", "$dynamicRef", "$dynamicAnchor"];
|
|
262
|
-
for (const f of r)
|
|
263
|
-
f in e && (t[f] = e[f]);
|
|
264
|
-
const l = ["contentEncoding", "contentMediaType", "contentSchema"];
|
|
265
|
-
for (const f of l)
|
|
266
|
-
f in e && (t[f] = e[f]);
|
|
267
|
-
for (const f of Object.keys(e))
|
|
268
|
-
h.has(f) || (t[f] = e[f]);
|
|
269
|
-
return Object.keys(t).length > 0 && o.registry.add(s, t), s;
|
|
270
|
-
}
|
|
271
|
-
function $(e, o) {
|
|
272
|
-
if (typeof e == "boolean")
|
|
273
|
-
return e ? n.any() : n.never();
|
|
274
|
-
const s = w(e, o?.defaultTarget), i = e.$defs || e.definitions || {}, t = {
|
|
275
|
-
version: s,
|
|
276
|
-
defs: i,
|
|
277
|
-
refs: /* @__PURE__ */ new Map(),
|
|
278
|
-
processing: /* @__PURE__ */ new Set(),
|
|
279
|
-
rootSchema: e,
|
|
280
|
-
registry: o?.registry ?? k
|
|
281
|
-
};
|
|
282
|
-
return a(e, t);
|
|
283
|
-
}
|
|
284
|
-
export {
|
|
285
|
-
$ as fromJSONSchema
|
|
286
|
-
};
|
|
287
|
-
//# sourceMappingURL=from-json-schema.mjs.map
|