moonflower 1.3.0 → 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/cli/entry.cjs +1 -1
- package/dist/cli/cli.cjs +2 -0
- package/dist/cli/cli.cjs.map +1 -0
- package/dist/cli/cli.d.ts +2 -0
- package/dist/cli/cli.d.ts.map +1 -0
- package/dist/cli/cli.mjs +62 -0
- package/dist/cli/cli.mjs.map +1 -0
- package/dist/cli/prettyprint.cjs +2 -0
- package/dist/cli/prettyprint.cjs.map +1 -0
- package/dist/cli/prettyprint.d.ts +5 -0
- package/dist/cli/prettyprint.d.ts.map +1 -0
- package/dist/cli/prettyprint.mjs +15 -0
- package/dist/cli/prettyprint.mjs.map +1 -0
- package/dist/openapi/initOpenApiEngine.cjs +1 -1
- package/dist/openapi/initOpenApiEngine.cjs.map +1 -1
- package/dist/openapi/initOpenApiEngine.d.ts +7 -2
- package/dist/openapi/initOpenApiEngine.d.ts.map +1 -1
- package/dist/openapi/initOpenApiEngine.mjs +13 -7
- package/dist/openapi/initOpenApiEngine.mjs.map +1 -1
- package/dist/openapi/manager/OpenApiManager.cjs +1 -1
- package/dist/openapi/manager/OpenApiManager.cjs.map +1 -1
- package/dist/openapi/manager/OpenApiManager.d.ts +4 -0
- package/dist/openapi/manager/OpenApiManager.d.ts.map +1 -1
- package/dist/openapi/manager/OpenApiManager.mjs +11 -2
- package/dist/openapi/manager/OpenApiManager.mjs.map +1 -1
- package/dist/openapi/router/OpenApiRouter.cjs +1 -1
- package/dist/openapi/router/OpenApiRouter.cjs.map +1 -1
- package/dist/openapi/router/OpenApiRouter.d.ts.map +1 -1
- package/dist/openapi/router/OpenApiRouter.mjs +9 -6
- package/dist/openapi/router/OpenApiRouter.mjs.map +1 -1
- 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 +4 -4
- package/{cli → src/cli}/cli.ts +26 -6
- package/{cli → src/cli}/prettyprint.ts +2 -2
- package/src/openapi/initOpenApiEngine.ts +48 -6
- package/src/openapi/manager/OpenApiManager.ts +16 -0
- package/src/openapi/router/OpenApiRouter.ts +6 -1
- package/src/test/app.spec.ts +27 -0
- package/vite.config.ts +4 -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,1319 +0,0 @@
|
|
|
1
|
-
import { $ZodCheckStringFormat as de, $ZodCheckNumberFormat as he, $ZodCheckBigIntFormat as ve, $ZodCheck as _e } from "./checks.mjs";
|
|
2
|
-
import { $constructor as l, $ZodAsyncError as D, globalConfig as fe, config as b, $ZodEncodeError as te } from "./core.mjs";
|
|
3
|
-
import { Doc as me } from "./doc.mjs";
|
|
4
|
-
import { safeParse as ze, safeParseAsync as $e, parse as B, parseAsync as K } from "./parse.mjs";
|
|
5
|
-
import { base64url as re, string as ge, guid as Ze, uuid as M, email as we, emoji as be, nanoid as Pe, cuid as ke, cuid2 as Te, ulid as Ie, xid as Se, ksuid as Ee, datetime as Re, date as Oe, time as De, duration as Ne, ipv4 as je, ipv6 as Ue, mac as Ae, cidrv4 as Ce, cidrv6 as Ve, base64 as Fe, e164 as Le, number as oe, boolean as Be, bigint as Ke, undefined as Me, null as xe } from "./regexes.mjs";
|
|
6
|
-
import { defineLazy as v, aborted as k, cached as V, isObject as F, allowsEval as Je, esc as x, cleanRegex as L, prefixIssues as w, isPlainObject as U, finalizeIssue as P, propertyKeyTypes as A, getEnumValues as We, escapeRegex as N, primitiveTypes as ye, issue as Xe, optionalKeys as Ge } from "./util.mjs";
|
|
7
|
-
import { clone as Tt } from "./util.mjs";
|
|
8
|
-
import { version as He } from "./versions.mjs";
|
|
9
|
-
const h = /* @__PURE__ */ l("$ZodType", (e, n) => {
|
|
10
|
-
var t;
|
|
11
|
-
e ?? (e = {}), e._zod.def = n, e._zod.bag = e._zod.bag || {}, e._zod.version = He;
|
|
12
|
-
const o = [...e._zod.def.checks ?? []];
|
|
13
|
-
e._zod.traits.has("$ZodCheck") && o.unshift(e);
|
|
14
|
-
for (const r of o)
|
|
15
|
-
for (const s of r._zod.onattach)
|
|
16
|
-
s(e);
|
|
17
|
-
if (o.length === 0)
|
|
18
|
-
(t = e._zod).deferred ?? (t.deferred = []), e._zod.deferred?.push(() => {
|
|
19
|
-
e._zod.run = e._zod.parse;
|
|
20
|
-
});
|
|
21
|
-
else {
|
|
22
|
-
const r = (i, u, c) => {
|
|
23
|
-
let a = k(i), p;
|
|
24
|
-
for (const d of u) {
|
|
25
|
-
if (d._zod.def.when) {
|
|
26
|
-
if (!d._zod.def.when(i))
|
|
27
|
-
continue;
|
|
28
|
-
} else if (a)
|
|
29
|
-
continue;
|
|
30
|
-
const _ = i.issues.length, f = d._zod.check(i);
|
|
31
|
-
if (f instanceof Promise && c?.async === !1)
|
|
32
|
-
throw new D();
|
|
33
|
-
if (p || f instanceof Promise)
|
|
34
|
-
p = (p ?? Promise.resolve()).then(async () => {
|
|
35
|
-
await f, i.issues.length !== _ && (a || (a = k(i, _)));
|
|
36
|
-
});
|
|
37
|
-
else {
|
|
38
|
-
if (i.issues.length === _)
|
|
39
|
-
continue;
|
|
40
|
-
a || (a = k(i, _));
|
|
41
|
-
}
|
|
42
|
-
}
|
|
43
|
-
return p ? p.then(() => i) : i;
|
|
44
|
-
}, s = (i, u, c) => {
|
|
45
|
-
if (k(i))
|
|
46
|
-
return i.aborted = !0, i;
|
|
47
|
-
const a = r(u, o, c);
|
|
48
|
-
if (a instanceof Promise) {
|
|
49
|
-
if (c.async === !1)
|
|
50
|
-
throw new D();
|
|
51
|
-
return a.then((p) => e._zod.parse(p, c));
|
|
52
|
-
}
|
|
53
|
-
return e._zod.parse(a, c);
|
|
54
|
-
};
|
|
55
|
-
e._zod.run = (i, u) => {
|
|
56
|
-
if (u.skipChecks)
|
|
57
|
-
return e._zod.parse(i, u);
|
|
58
|
-
if (u.direction === "backward") {
|
|
59
|
-
const a = e._zod.parse({ value: i.value, issues: [] }, { ...u, skipChecks: !0 });
|
|
60
|
-
return a instanceof Promise ? a.then((p) => s(p, i, u)) : s(a, i, u);
|
|
61
|
-
}
|
|
62
|
-
const c = e._zod.parse(i, u);
|
|
63
|
-
if (c instanceof Promise) {
|
|
64
|
-
if (u.async === !1)
|
|
65
|
-
throw new D();
|
|
66
|
-
return c.then((a) => r(a, o, u));
|
|
67
|
-
}
|
|
68
|
-
return r(c, o, u);
|
|
69
|
-
};
|
|
70
|
-
}
|
|
71
|
-
v(e, "~standard", () => ({
|
|
72
|
-
validate: (r) => {
|
|
73
|
-
try {
|
|
74
|
-
const s = ze(e, r);
|
|
75
|
-
return s.success ? { value: s.data } : { issues: s.error?.issues };
|
|
76
|
-
} catch {
|
|
77
|
-
return $e(e, r).then((i) => i.success ? { value: i.data } : { issues: i.error?.issues });
|
|
78
|
-
}
|
|
79
|
-
},
|
|
80
|
-
vendor: "zod",
|
|
81
|
-
version: 1
|
|
82
|
-
}));
|
|
83
|
-
}), qe = /* @__PURE__ */ l("$ZodString", (e, n) => {
|
|
84
|
-
h.init(e, n), e._zod.pattern = [...e?._zod.bag?.patterns ?? []].pop() ?? ge(e._zod.bag), e._zod.parse = (t, o) => {
|
|
85
|
-
if (n.coerce)
|
|
86
|
-
try {
|
|
87
|
-
t.value = String(t.value);
|
|
88
|
-
} catch {
|
|
89
|
-
}
|
|
90
|
-
return typeof t.value == "string" || t.issues.push({
|
|
91
|
-
expected: "string",
|
|
92
|
-
code: "invalid_type",
|
|
93
|
-
input: t.value,
|
|
94
|
-
inst: e
|
|
95
|
-
}), t;
|
|
96
|
-
};
|
|
97
|
-
}), m = /* @__PURE__ */ l("$ZodStringFormat", (e, n) => {
|
|
98
|
-
de.init(e, n), qe.init(e, n);
|
|
99
|
-
}), vn = /* @__PURE__ */ l("$ZodGUID", (e, n) => {
|
|
100
|
-
n.pattern ?? (n.pattern = Ze), m.init(e, n);
|
|
101
|
-
}), _n = /* @__PURE__ */ l("$ZodUUID", (e, n) => {
|
|
102
|
-
if (n.version) {
|
|
103
|
-
const o = {
|
|
104
|
-
v1: 1,
|
|
105
|
-
v2: 2,
|
|
106
|
-
v3: 3,
|
|
107
|
-
v4: 4,
|
|
108
|
-
v5: 5,
|
|
109
|
-
v6: 6,
|
|
110
|
-
v7: 7,
|
|
111
|
-
v8: 8
|
|
112
|
-
}[n.version];
|
|
113
|
-
if (o === void 0)
|
|
114
|
-
throw new Error(`Invalid UUID version: "${n.version}"`);
|
|
115
|
-
n.pattern ?? (n.pattern = M(o));
|
|
116
|
-
} else
|
|
117
|
-
n.pattern ?? (n.pattern = M());
|
|
118
|
-
m.init(e, n);
|
|
119
|
-
}), fn = /* @__PURE__ */ l("$ZodEmail", (e, n) => {
|
|
120
|
-
n.pattern ?? (n.pattern = we), m.init(e, n);
|
|
121
|
-
}), mn = /* @__PURE__ */ l("$ZodURL", (e, n) => {
|
|
122
|
-
m.init(e, n), e._zod.check = (t) => {
|
|
123
|
-
try {
|
|
124
|
-
const o = t.value.trim(), r = new URL(o);
|
|
125
|
-
n.hostname && (n.hostname.lastIndex = 0, n.hostname.test(r.hostname) || t.issues.push({
|
|
126
|
-
code: "invalid_format",
|
|
127
|
-
format: "url",
|
|
128
|
-
note: "Invalid hostname",
|
|
129
|
-
pattern: n.hostname.source,
|
|
130
|
-
input: t.value,
|
|
131
|
-
inst: e,
|
|
132
|
-
continue: !n.abort
|
|
133
|
-
})), n.protocol && (n.protocol.lastIndex = 0, n.protocol.test(r.protocol.endsWith(":") ? r.protocol.slice(0, -1) : r.protocol) || t.issues.push({
|
|
134
|
-
code: "invalid_format",
|
|
135
|
-
format: "url",
|
|
136
|
-
note: "Invalid protocol",
|
|
137
|
-
pattern: n.protocol.source,
|
|
138
|
-
input: t.value,
|
|
139
|
-
inst: e,
|
|
140
|
-
continue: !n.abort
|
|
141
|
-
})), n.normalize ? t.value = r.href : t.value = o;
|
|
142
|
-
return;
|
|
143
|
-
} catch {
|
|
144
|
-
t.issues.push({
|
|
145
|
-
code: "invalid_format",
|
|
146
|
-
format: "url",
|
|
147
|
-
input: t.value,
|
|
148
|
-
inst: e,
|
|
149
|
-
continue: !n.abort
|
|
150
|
-
});
|
|
151
|
-
}
|
|
152
|
-
};
|
|
153
|
-
}), zn = /* @__PURE__ */ l("$ZodEmoji", (e, n) => {
|
|
154
|
-
n.pattern ?? (n.pattern = be()), m.init(e, n);
|
|
155
|
-
}), $n = /* @__PURE__ */ l("$ZodNanoID", (e, n) => {
|
|
156
|
-
n.pattern ?? (n.pattern = Pe), m.init(e, n);
|
|
157
|
-
}), gn = /* @__PURE__ */ l("$ZodCUID", (e, n) => {
|
|
158
|
-
n.pattern ?? (n.pattern = ke), m.init(e, n);
|
|
159
|
-
}), Zn = /* @__PURE__ */ l("$ZodCUID2", (e, n) => {
|
|
160
|
-
n.pattern ?? (n.pattern = Te), m.init(e, n);
|
|
161
|
-
}), wn = /* @__PURE__ */ l("$ZodULID", (e, n) => {
|
|
162
|
-
n.pattern ?? (n.pattern = Ie), m.init(e, n);
|
|
163
|
-
}), bn = /* @__PURE__ */ l("$ZodXID", (e, n) => {
|
|
164
|
-
n.pattern ?? (n.pattern = Se), m.init(e, n);
|
|
165
|
-
}), Pn = /* @__PURE__ */ l("$ZodKSUID", (e, n) => {
|
|
166
|
-
n.pattern ?? (n.pattern = Ee), m.init(e, n);
|
|
167
|
-
}), kn = /* @__PURE__ */ l("$ZodISODateTime", (e, n) => {
|
|
168
|
-
n.pattern ?? (n.pattern = Re(n)), m.init(e, n);
|
|
169
|
-
}), Tn = /* @__PURE__ */ l("$ZodISODate", (e, n) => {
|
|
170
|
-
n.pattern ?? (n.pattern = Oe), m.init(e, n);
|
|
171
|
-
}), In = /* @__PURE__ */ l("$ZodISOTime", (e, n) => {
|
|
172
|
-
n.pattern ?? (n.pattern = De(n)), m.init(e, n);
|
|
173
|
-
}), Sn = /* @__PURE__ */ l("$ZodISODuration", (e, n) => {
|
|
174
|
-
n.pattern ?? (n.pattern = Ne), m.init(e, n);
|
|
175
|
-
}), En = /* @__PURE__ */ l("$ZodIPv4", (e, n) => {
|
|
176
|
-
n.pattern ?? (n.pattern = je), m.init(e, n), e._zod.bag.format = "ipv4";
|
|
177
|
-
}), Rn = /* @__PURE__ */ l("$ZodIPv6", (e, n) => {
|
|
178
|
-
n.pattern ?? (n.pattern = Ue), m.init(e, n), e._zod.bag.format = "ipv6", e._zod.check = (t) => {
|
|
179
|
-
try {
|
|
180
|
-
new URL(`http://[${t.value}]`);
|
|
181
|
-
} catch {
|
|
182
|
-
t.issues.push({
|
|
183
|
-
code: "invalid_format",
|
|
184
|
-
format: "ipv6",
|
|
185
|
-
input: t.value,
|
|
186
|
-
inst: e,
|
|
187
|
-
continue: !n.abort
|
|
188
|
-
});
|
|
189
|
-
}
|
|
190
|
-
};
|
|
191
|
-
}), On = /* @__PURE__ */ l("$ZodMAC", (e, n) => {
|
|
192
|
-
n.pattern ?? (n.pattern = Ae(n.delimiter)), m.init(e, n), e._zod.bag.format = "mac";
|
|
193
|
-
}), Dn = /* @__PURE__ */ l("$ZodCIDRv4", (e, n) => {
|
|
194
|
-
n.pattern ?? (n.pattern = Ce), m.init(e, n);
|
|
195
|
-
}), Nn = /* @__PURE__ */ l("$ZodCIDRv6", (e, n) => {
|
|
196
|
-
n.pattern ?? (n.pattern = Ve), m.init(e, n), e._zod.check = (t) => {
|
|
197
|
-
const o = t.value.split("/");
|
|
198
|
-
try {
|
|
199
|
-
if (o.length !== 2)
|
|
200
|
-
throw new Error();
|
|
201
|
-
const [r, s] = o;
|
|
202
|
-
if (!s)
|
|
203
|
-
throw new Error();
|
|
204
|
-
const i = Number(s);
|
|
205
|
-
if (`${i}` !== s)
|
|
206
|
-
throw new Error();
|
|
207
|
-
if (i < 0 || i > 128)
|
|
208
|
-
throw new Error();
|
|
209
|
-
new URL(`http://[${r}]`);
|
|
210
|
-
} catch {
|
|
211
|
-
t.issues.push({
|
|
212
|
-
code: "invalid_format",
|
|
213
|
-
format: "cidrv6",
|
|
214
|
-
input: t.value,
|
|
215
|
-
inst: e,
|
|
216
|
-
continue: !n.abort
|
|
217
|
-
});
|
|
218
|
-
}
|
|
219
|
-
};
|
|
220
|
-
});
|
|
221
|
-
function se(e) {
|
|
222
|
-
if (e === "")
|
|
223
|
-
return !0;
|
|
224
|
-
if (e.length % 4 !== 0)
|
|
225
|
-
return !1;
|
|
226
|
-
try {
|
|
227
|
-
return atob(e), !0;
|
|
228
|
-
} catch {
|
|
229
|
-
return !1;
|
|
230
|
-
}
|
|
231
|
-
}
|
|
232
|
-
const jn = /* @__PURE__ */ l("$ZodBase64", (e, n) => {
|
|
233
|
-
n.pattern ?? (n.pattern = Fe), m.init(e, n), e._zod.bag.contentEncoding = "base64", e._zod.check = (t) => {
|
|
234
|
-
se(t.value) || t.issues.push({
|
|
235
|
-
code: "invalid_format",
|
|
236
|
-
format: "base64",
|
|
237
|
-
input: t.value,
|
|
238
|
-
inst: e,
|
|
239
|
-
continue: !n.abort
|
|
240
|
-
});
|
|
241
|
-
};
|
|
242
|
-
});
|
|
243
|
-
function Qe(e) {
|
|
244
|
-
if (!re.test(e))
|
|
245
|
-
return !1;
|
|
246
|
-
const n = e.replace(/[-_]/g, (o) => o === "-" ? "+" : "/"), t = n.padEnd(Math.ceil(n.length / 4) * 4, "=");
|
|
247
|
-
return se(t);
|
|
248
|
-
}
|
|
249
|
-
const Un = /* @__PURE__ */ l("$ZodBase64URL", (e, n) => {
|
|
250
|
-
n.pattern ?? (n.pattern = re), m.init(e, n), e._zod.bag.contentEncoding = "base64url", e._zod.check = (t) => {
|
|
251
|
-
Qe(t.value) || t.issues.push({
|
|
252
|
-
code: "invalid_format",
|
|
253
|
-
format: "base64url",
|
|
254
|
-
input: t.value,
|
|
255
|
-
inst: e,
|
|
256
|
-
continue: !n.abort
|
|
257
|
-
});
|
|
258
|
-
};
|
|
259
|
-
}), An = /* @__PURE__ */ l("$ZodE164", (e, n) => {
|
|
260
|
-
n.pattern ?? (n.pattern = Le), m.init(e, n);
|
|
261
|
-
});
|
|
262
|
-
function Ye(e, n = null) {
|
|
263
|
-
try {
|
|
264
|
-
const t = e.split(".");
|
|
265
|
-
if (t.length !== 3)
|
|
266
|
-
return !1;
|
|
267
|
-
const [o] = t;
|
|
268
|
-
if (!o)
|
|
269
|
-
return !1;
|
|
270
|
-
const r = JSON.parse(atob(o));
|
|
271
|
-
return !("typ" in r && r?.typ !== "JWT" || !r.alg || n && (!("alg" in r) || r.alg !== n));
|
|
272
|
-
} catch {
|
|
273
|
-
return !1;
|
|
274
|
-
}
|
|
275
|
-
}
|
|
276
|
-
const Cn = /* @__PURE__ */ l("$ZodJWT", (e, n) => {
|
|
277
|
-
m.init(e, n), e._zod.check = (t) => {
|
|
278
|
-
Ye(t.value, n.alg) || t.issues.push({
|
|
279
|
-
code: "invalid_format",
|
|
280
|
-
format: "jwt",
|
|
281
|
-
input: t.value,
|
|
282
|
-
inst: e,
|
|
283
|
-
continue: !n.abort
|
|
284
|
-
});
|
|
285
|
-
};
|
|
286
|
-
}), Vn = /* @__PURE__ */ l("$ZodCustomStringFormat", (e, n) => {
|
|
287
|
-
m.init(e, n), e._zod.check = (t) => {
|
|
288
|
-
n.fn(t.value) || t.issues.push({
|
|
289
|
-
code: "invalid_format",
|
|
290
|
-
format: n.format,
|
|
291
|
-
input: t.value,
|
|
292
|
-
inst: e,
|
|
293
|
-
continue: !n.abort
|
|
294
|
-
});
|
|
295
|
-
};
|
|
296
|
-
}), en = /* @__PURE__ */ l("$ZodNumber", (e, n) => {
|
|
297
|
-
h.init(e, n), e._zod.pattern = e._zod.bag.pattern ?? oe, e._zod.parse = (t, o) => {
|
|
298
|
-
if (n.coerce)
|
|
299
|
-
try {
|
|
300
|
-
t.value = Number(t.value);
|
|
301
|
-
} catch {
|
|
302
|
-
}
|
|
303
|
-
const r = t.value;
|
|
304
|
-
if (typeof r == "number" && !Number.isNaN(r) && Number.isFinite(r))
|
|
305
|
-
return t;
|
|
306
|
-
const s = typeof r == "number" ? Number.isNaN(r) ? "NaN" : Number.isFinite(r) ? void 0 : "Infinity" : void 0;
|
|
307
|
-
return t.issues.push({
|
|
308
|
-
expected: "number",
|
|
309
|
-
code: "invalid_type",
|
|
310
|
-
input: r,
|
|
311
|
-
inst: e,
|
|
312
|
-
...s ? { received: s } : {}
|
|
313
|
-
}), t;
|
|
314
|
-
};
|
|
315
|
-
}), Fn = /* @__PURE__ */ l("$ZodNumberFormat", (e, n) => {
|
|
316
|
-
he.init(e, n), en.init(e, n);
|
|
317
|
-
}), Ln = /* @__PURE__ */ l("$ZodBoolean", (e, n) => {
|
|
318
|
-
h.init(e, n), e._zod.pattern = Be, e._zod.parse = (t, o) => {
|
|
319
|
-
if (n.coerce)
|
|
320
|
-
try {
|
|
321
|
-
t.value = !!t.value;
|
|
322
|
-
} catch {
|
|
323
|
-
}
|
|
324
|
-
const r = t.value;
|
|
325
|
-
return typeof r == "boolean" || t.issues.push({
|
|
326
|
-
expected: "boolean",
|
|
327
|
-
code: "invalid_type",
|
|
328
|
-
input: r,
|
|
329
|
-
inst: e
|
|
330
|
-
}), t;
|
|
331
|
-
};
|
|
332
|
-
}), nn = /* @__PURE__ */ l("$ZodBigInt", (e, n) => {
|
|
333
|
-
h.init(e, n), e._zod.pattern = Ke, e._zod.parse = (t, o) => {
|
|
334
|
-
if (n.coerce)
|
|
335
|
-
try {
|
|
336
|
-
t.value = BigInt(t.value);
|
|
337
|
-
} catch {
|
|
338
|
-
}
|
|
339
|
-
return typeof t.value == "bigint" || t.issues.push({
|
|
340
|
-
expected: "bigint",
|
|
341
|
-
code: "invalid_type",
|
|
342
|
-
input: t.value,
|
|
343
|
-
inst: e
|
|
344
|
-
}), t;
|
|
345
|
-
};
|
|
346
|
-
}), Bn = /* @__PURE__ */ l("$ZodBigIntFormat", (e, n) => {
|
|
347
|
-
ve.init(e, n), nn.init(e, n);
|
|
348
|
-
}), Kn = /* @__PURE__ */ l("$ZodSymbol", (e, n) => {
|
|
349
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
350
|
-
const r = t.value;
|
|
351
|
-
return typeof r == "symbol" || t.issues.push({
|
|
352
|
-
expected: "symbol",
|
|
353
|
-
code: "invalid_type",
|
|
354
|
-
input: r,
|
|
355
|
-
inst: e
|
|
356
|
-
}), t;
|
|
357
|
-
};
|
|
358
|
-
}), Mn = /* @__PURE__ */ l("$ZodUndefined", (e, n) => {
|
|
359
|
-
h.init(e, n), e._zod.pattern = Me, e._zod.values = /* @__PURE__ */ new Set([void 0]), e._zod.optin = "optional", e._zod.optout = "optional", e._zod.parse = (t, o) => {
|
|
360
|
-
const r = t.value;
|
|
361
|
-
return typeof r > "u" || t.issues.push({
|
|
362
|
-
expected: "undefined",
|
|
363
|
-
code: "invalid_type",
|
|
364
|
-
input: r,
|
|
365
|
-
inst: e
|
|
366
|
-
}), t;
|
|
367
|
-
};
|
|
368
|
-
}), xn = /* @__PURE__ */ l("$ZodNull", (e, n) => {
|
|
369
|
-
h.init(e, n), e._zod.pattern = xe, e._zod.values = /* @__PURE__ */ new Set([null]), e._zod.parse = (t, o) => {
|
|
370
|
-
const r = t.value;
|
|
371
|
-
return r === null || t.issues.push({
|
|
372
|
-
expected: "null",
|
|
373
|
-
code: "invalid_type",
|
|
374
|
-
input: r,
|
|
375
|
-
inst: e
|
|
376
|
-
}), t;
|
|
377
|
-
};
|
|
378
|
-
}), Jn = /* @__PURE__ */ l("$ZodAny", (e, n) => {
|
|
379
|
-
h.init(e, n), e._zod.parse = (t) => t;
|
|
380
|
-
}), Wn = /* @__PURE__ */ l("$ZodUnknown", (e, n) => {
|
|
381
|
-
h.init(e, n), e._zod.parse = (t) => t;
|
|
382
|
-
}), yn = /* @__PURE__ */ l("$ZodNever", (e, n) => {
|
|
383
|
-
h.init(e, n), e._zod.parse = (t, o) => (t.issues.push({
|
|
384
|
-
expected: "never",
|
|
385
|
-
code: "invalid_type",
|
|
386
|
-
input: t.value,
|
|
387
|
-
inst: e
|
|
388
|
-
}), t);
|
|
389
|
-
}), Xn = /* @__PURE__ */ l("$ZodVoid", (e, n) => {
|
|
390
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
391
|
-
const r = t.value;
|
|
392
|
-
return typeof r > "u" || t.issues.push({
|
|
393
|
-
expected: "void",
|
|
394
|
-
code: "invalid_type",
|
|
395
|
-
input: r,
|
|
396
|
-
inst: e
|
|
397
|
-
}), t;
|
|
398
|
-
};
|
|
399
|
-
}), Gn = /* @__PURE__ */ l("$ZodDate", (e, n) => {
|
|
400
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
401
|
-
if (n.coerce)
|
|
402
|
-
try {
|
|
403
|
-
t.value = new Date(t.value);
|
|
404
|
-
} catch {
|
|
405
|
-
}
|
|
406
|
-
const r = t.value, s = r instanceof Date;
|
|
407
|
-
return s && !Number.isNaN(r.getTime()) || t.issues.push({
|
|
408
|
-
expected: "date",
|
|
409
|
-
code: "invalid_type",
|
|
410
|
-
input: r,
|
|
411
|
-
...s ? { received: "Invalid Date" } : {},
|
|
412
|
-
inst: e
|
|
413
|
-
}), t;
|
|
414
|
-
};
|
|
415
|
-
});
|
|
416
|
-
function J(e, n, t) {
|
|
417
|
-
e.issues.length && n.issues.push(...w(t, e.issues)), n.value[t] = e.value;
|
|
418
|
-
}
|
|
419
|
-
const Hn = /* @__PURE__ */ l("$ZodArray", (e, n) => {
|
|
420
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
421
|
-
const r = t.value;
|
|
422
|
-
if (!Array.isArray(r))
|
|
423
|
-
return t.issues.push({
|
|
424
|
-
expected: "array",
|
|
425
|
-
code: "invalid_type",
|
|
426
|
-
input: r,
|
|
427
|
-
inst: e
|
|
428
|
-
}), t;
|
|
429
|
-
t.value = Array(r.length);
|
|
430
|
-
const s = [];
|
|
431
|
-
for (let i = 0; i < r.length; i++) {
|
|
432
|
-
const u = r[i], c = n.element._zod.run({
|
|
433
|
-
value: u,
|
|
434
|
-
issues: []
|
|
435
|
-
}, o);
|
|
436
|
-
c instanceof Promise ? s.push(c.then((a) => J(a, t, i))) : J(c, t, i);
|
|
437
|
-
}
|
|
438
|
-
return s.length ? Promise.all(s).then(() => t) : t;
|
|
439
|
-
};
|
|
440
|
-
});
|
|
441
|
-
function j(e, n, t, o, r) {
|
|
442
|
-
if (e.issues.length) {
|
|
443
|
-
if (r && !(t in o))
|
|
444
|
-
return;
|
|
445
|
-
n.issues.push(...w(t, e.issues));
|
|
446
|
-
}
|
|
447
|
-
e.value === void 0 ? t in o && (n.value[t] = void 0) : n.value[t] = e.value;
|
|
448
|
-
}
|
|
449
|
-
function ie(e) {
|
|
450
|
-
const n = Object.keys(e.shape);
|
|
451
|
-
for (const o of n)
|
|
452
|
-
if (!e.shape?.[o]?._zod?.traits?.has("$ZodType"))
|
|
453
|
-
throw new Error(`Invalid element at key "${o}": expected a Zod schema`);
|
|
454
|
-
const t = Ge(e.shape);
|
|
455
|
-
return {
|
|
456
|
-
...e,
|
|
457
|
-
keys: n,
|
|
458
|
-
keySet: new Set(n),
|
|
459
|
-
numKeys: n.length,
|
|
460
|
-
optionalKeys: new Set(t)
|
|
461
|
-
};
|
|
462
|
-
}
|
|
463
|
-
function ue(e, n, t, o, r, s) {
|
|
464
|
-
const i = [], u = r.keySet, c = r.catchall._zod, a = c.def.type, p = c.optout === "optional";
|
|
465
|
-
for (const d in n) {
|
|
466
|
-
if (u.has(d))
|
|
467
|
-
continue;
|
|
468
|
-
if (a === "never") {
|
|
469
|
-
i.push(d);
|
|
470
|
-
continue;
|
|
471
|
-
}
|
|
472
|
-
const _ = c.run({ value: n[d], issues: [] }, o);
|
|
473
|
-
_ instanceof Promise ? e.push(_.then((f) => j(f, t, d, n, p))) : j(_, t, d, n, p);
|
|
474
|
-
}
|
|
475
|
-
return i.length && t.issues.push({
|
|
476
|
-
code: "unrecognized_keys",
|
|
477
|
-
keys: i,
|
|
478
|
-
input: n,
|
|
479
|
-
inst: s
|
|
480
|
-
}), e.length ? Promise.all(e).then(() => t) : t;
|
|
481
|
-
}
|
|
482
|
-
const tn = /* @__PURE__ */ l("$ZodObject", (e, n) => {
|
|
483
|
-
if (h.init(e, n), !Object.getOwnPropertyDescriptor(n, "shape")?.get) {
|
|
484
|
-
const u = n.shape;
|
|
485
|
-
Object.defineProperty(n, "shape", {
|
|
486
|
-
get: () => {
|
|
487
|
-
const c = { ...u };
|
|
488
|
-
return Object.defineProperty(n, "shape", {
|
|
489
|
-
value: c
|
|
490
|
-
}), c;
|
|
491
|
-
}
|
|
492
|
-
});
|
|
493
|
-
}
|
|
494
|
-
const o = V(() => ie(n));
|
|
495
|
-
v(e._zod, "propValues", () => {
|
|
496
|
-
const u = n.shape, c = {};
|
|
497
|
-
for (const a in u) {
|
|
498
|
-
const p = u[a]._zod;
|
|
499
|
-
if (p.values) {
|
|
500
|
-
c[a] ?? (c[a] = /* @__PURE__ */ new Set());
|
|
501
|
-
for (const d of p.values)
|
|
502
|
-
c[a].add(d);
|
|
503
|
-
}
|
|
504
|
-
}
|
|
505
|
-
return c;
|
|
506
|
-
});
|
|
507
|
-
const r = F, s = n.catchall;
|
|
508
|
-
let i;
|
|
509
|
-
e._zod.parse = (u, c) => {
|
|
510
|
-
i ?? (i = o.value);
|
|
511
|
-
const a = u.value;
|
|
512
|
-
if (!r(a))
|
|
513
|
-
return u.issues.push({
|
|
514
|
-
expected: "object",
|
|
515
|
-
code: "invalid_type",
|
|
516
|
-
input: a,
|
|
517
|
-
inst: e
|
|
518
|
-
}), u;
|
|
519
|
-
u.value = {};
|
|
520
|
-
const p = [], d = i.shape;
|
|
521
|
-
for (const _ of i.keys) {
|
|
522
|
-
const f = d[_], $ = f._zod.optout === "optional", T = f._zod.run({ value: a[_], issues: [] }, c);
|
|
523
|
-
T instanceof Promise ? p.push(T.then((I) => j(I, u, _, a, $))) : j(T, u, _, a, $);
|
|
524
|
-
}
|
|
525
|
-
return s ? ue(p, a, u, c, o.value, e) : p.length ? Promise.all(p).then(() => u) : u;
|
|
526
|
-
};
|
|
527
|
-
}), qn = /* @__PURE__ */ l("$ZodObjectJIT", (e, n) => {
|
|
528
|
-
tn.init(e, n);
|
|
529
|
-
const t = e._zod.parse, o = V(() => ie(n)), r = (_) => {
|
|
530
|
-
const f = new me(["shape", "payload", "ctx"]), $ = o.value, T = (Z) => {
|
|
531
|
-
const z = x(Z);
|
|
532
|
-
return `shape[${z}]._zod.run({ value: input[${z}], issues: [] }, ctx)`;
|
|
533
|
-
};
|
|
534
|
-
f.write("const input = payload.value;");
|
|
535
|
-
const I = /* @__PURE__ */ Object.create(null);
|
|
536
|
-
let ae = 0;
|
|
537
|
-
for (const Z of $.keys)
|
|
538
|
-
I[Z] = `key_${ae++}`;
|
|
539
|
-
f.write("const newResult = {};");
|
|
540
|
-
for (const Z of $.keys) {
|
|
541
|
-
const z = I[Z], g = x(Z), pe = _[Z]?._zod?.optout === "optional";
|
|
542
|
-
f.write(`const ${z} = ${T(Z)};`), pe ? f.write(`
|
|
543
|
-
if (${z}.issues.length) {
|
|
544
|
-
if (${g} in input) {
|
|
545
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
546
|
-
...iss,
|
|
547
|
-
path: iss.path ? [${g}, ...iss.path] : [${g}]
|
|
548
|
-
})));
|
|
549
|
-
}
|
|
550
|
-
}
|
|
551
|
-
|
|
552
|
-
if (${z}.value === undefined) {
|
|
553
|
-
if (${g} in input) {
|
|
554
|
-
newResult[${g}] = undefined;
|
|
555
|
-
}
|
|
556
|
-
} else {
|
|
557
|
-
newResult[${g}] = ${z}.value;
|
|
558
|
-
}
|
|
559
|
-
|
|
560
|
-
`) : f.write(`
|
|
561
|
-
if (${z}.issues.length) {
|
|
562
|
-
payload.issues = payload.issues.concat(${z}.issues.map(iss => ({
|
|
563
|
-
...iss,
|
|
564
|
-
path: iss.path ? [${g}, ...iss.path] : [${g}]
|
|
565
|
-
})));
|
|
566
|
-
}
|
|
567
|
-
|
|
568
|
-
if (${z}.value === undefined) {
|
|
569
|
-
if (${g} in input) {
|
|
570
|
-
newResult[${g}] = undefined;
|
|
571
|
-
}
|
|
572
|
-
} else {
|
|
573
|
-
newResult[${g}] = ${z}.value;
|
|
574
|
-
}
|
|
575
|
-
|
|
576
|
-
`);
|
|
577
|
-
}
|
|
578
|
-
f.write("payload.value = newResult;"), f.write("return payload;");
|
|
579
|
-
const le = f.compile();
|
|
580
|
-
return (Z, z) => le(_, Z, z);
|
|
581
|
-
};
|
|
582
|
-
let s;
|
|
583
|
-
const i = F, u = !fe.jitless, a = u && Je.value, p = n.catchall;
|
|
584
|
-
let d;
|
|
585
|
-
e._zod.parse = (_, f) => {
|
|
586
|
-
d ?? (d = o.value);
|
|
587
|
-
const $ = _.value;
|
|
588
|
-
return i($) ? u && a && f?.async === !1 && f.jitless !== !0 ? (s || (s = r(n.shape)), _ = s(_, f), p ? ue([], $, _, f, d, e) : _) : t(_, f) : (_.issues.push({
|
|
589
|
-
expected: "object",
|
|
590
|
-
code: "invalid_type",
|
|
591
|
-
input: $,
|
|
592
|
-
inst: e
|
|
593
|
-
}), _);
|
|
594
|
-
};
|
|
595
|
-
});
|
|
596
|
-
function W(e, n, t, o) {
|
|
597
|
-
for (const s of e)
|
|
598
|
-
if (s.issues.length === 0)
|
|
599
|
-
return n.value = s.value, n;
|
|
600
|
-
const r = e.filter((s) => !k(s));
|
|
601
|
-
return r.length === 1 ? (n.value = r[0].value, r[0]) : (n.issues.push({
|
|
602
|
-
code: "invalid_union",
|
|
603
|
-
input: n.value,
|
|
604
|
-
inst: t,
|
|
605
|
-
errors: e.map((s) => s.issues.map((i) => P(i, o, b())))
|
|
606
|
-
}), n);
|
|
607
|
-
}
|
|
608
|
-
const ce = /* @__PURE__ */ l("$ZodUnion", (e, n) => {
|
|
609
|
-
h.init(e, n), v(e._zod, "optin", () => n.options.some((r) => r._zod.optin === "optional") ? "optional" : void 0), v(e._zod, "optout", () => n.options.some((r) => r._zod.optout === "optional") ? "optional" : void 0), v(e._zod, "values", () => {
|
|
610
|
-
if (n.options.every((r) => r._zod.values))
|
|
611
|
-
return new Set(n.options.flatMap((r) => Array.from(r._zod.values)));
|
|
612
|
-
}), v(e._zod, "pattern", () => {
|
|
613
|
-
if (n.options.every((r) => r._zod.pattern)) {
|
|
614
|
-
const r = n.options.map((s) => s._zod.pattern);
|
|
615
|
-
return new RegExp(`^(${r.map((s) => L(s.source)).join("|")})$`);
|
|
616
|
-
}
|
|
617
|
-
});
|
|
618
|
-
const t = n.options.length === 1, o = n.options[0]._zod.run;
|
|
619
|
-
e._zod.parse = (r, s) => {
|
|
620
|
-
if (t)
|
|
621
|
-
return o(r, s);
|
|
622
|
-
let i = !1;
|
|
623
|
-
const u = [];
|
|
624
|
-
for (const c of n.options) {
|
|
625
|
-
const a = c._zod.run({
|
|
626
|
-
value: r.value,
|
|
627
|
-
issues: []
|
|
628
|
-
}, s);
|
|
629
|
-
if (a instanceof Promise)
|
|
630
|
-
u.push(a), i = !0;
|
|
631
|
-
else {
|
|
632
|
-
if (a.issues.length === 0)
|
|
633
|
-
return a;
|
|
634
|
-
u.push(a);
|
|
635
|
-
}
|
|
636
|
-
}
|
|
637
|
-
return i ? Promise.all(u).then((c) => W(c, r, e, s)) : W(u, r, e, s);
|
|
638
|
-
};
|
|
639
|
-
});
|
|
640
|
-
function y(e, n, t, o) {
|
|
641
|
-
const r = e.filter((s) => s.issues.length === 0);
|
|
642
|
-
return r.length === 1 ? (n.value = r[0].value, n) : (r.length === 0 ? n.issues.push({
|
|
643
|
-
code: "invalid_union",
|
|
644
|
-
input: n.value,
|
|
645
|
-
inst: t,
|
|
646
|
-
errors: e.map((s) => s.issues.map((i) => P(i, o, b())))
|
|
647
|
-
}) : n.issues.push({
|
|
648
|
-
code: "invalid_union",
|
|
649
|
-
input: n.value,
|
|
650
|
-
inst: t,
|
|
651
|
-
errors: [],
|
|
652
|
-
inclusive: !1
|
|
653
|
-
}), n);
|
|
654
|
-
}
|
|
655
|
-
const Qn = /* @__PURE__ */ l("$ZodXor", (e, n) => {
|
|
656
|
-
ce.init(e, n), n.inclusive = !1;
|
|
657
|
-
const t = n.options.length === 1, o = n.options[0]._zod.run;
|
|
658
|
-
e._zod.parse = (r, s) => {
|
|
659
|
-
if (t)
|
|
660
|
-
return o(r, s);
|
|
661
|
-
let i = !1;
|
|
662
|
-
const u = [];
|
|
663
|
-
for (const c of n.options) {
|
|
664
|
-
const a = c._zod.run({
|
|
665
|
-
value: r.value,
|
|
666
|
-
issues: []
|
|
667
|
-
}, s);
|
|
668
|
-
a instanceof Promise ? (u.push(a), i = !0) : u.push(a);
|
|
669
|
-
}
|
|
670
|
-
return i ? Promise.all(u).then((c) => y(c, r, e, s)) : y(u, r, e, s);
|
|
671
|
-
};
|
|
672
|
-
}), Yn = /* @__PURE__ */ l("$ZodDiscriminatedUnion", (e, n) => {
|
|
673
|
-
n.inclusive = !1, ce.init(e, n);
|
|
674
|
-
const t = e._zod.parse;
|
|
675
|
-
v(e._zod, "propValues", () => {
|
|
676
|
-
const r = {};
|
|
677
|
-
for (const s of n.options) {
|
|
678
|
-
const i = s._zod.propValues;
|
|
679
|
-
if (!i || Object.keys(i).length === 0)
|
|
680
|
-
throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(s)}"`);
|
|
681
|
-
for (const [u, c] of Object.entries(i)) {
|
|
682
|
-
r[u] || (r[u] = /* @__PURE__ */ new Set());
|
|
683
|
-
for (const a of c)
|
|
684
|
-
r[u].add(a);
|
|
685
|
-
}
|
|
686
|
-
}
|
|
687
|
-
return r;
|
|
688
|
-
});
|
|
689
|
-
const o = V(() => {
|
|
690
|
-
const r = n.options, s = /* @__PURE__ */ new Map();
|
|
691
|
-
for (const i of r) {
|
|
692
|
-
const u = i._zod.propValues?.[n.discriminator];
|
|
693
|
-
if (!u || u.size === 0)
|
|
694
|
-
throw new Error(`Invalid discriminated union option at index "${n.options.indexOf(i)}"`);
|
|
695
|
-
for (const c of u) {
|
|
696
|
-
if (s.has(c))
|
|
697
|
-
throw new Error(`Duplicate discriminator value "${String(c)}"`);
|
|
698
|
-
s.set(c, i);
|
|
699
|
-
}
|
|
700
|
-
}
|
|
701
|
-
return s;
|
|
702
|
-
});
|
|
703
|
-
e._zod.parse = (r, s) => {
|
|
704
|
-
const i = r.value;
|
|
705
|
-
if (!F(i))
|
|
706
|
-
return r.issues.push({
|
|
707
|
-
code: "invalid_type",
|
|
708
|
-
expected: "object",
|
|
709
|
-
input: i,
|
|
710
|
-
inst: e
|
|
711
|
-
}), r;
|
|
712
|
-
const u = o.value.get(i?.[n.discriminator]);
|
|
713
|
-
return u ? u._zod.run(r, s) : n.unionFallback ? t(r, s) : (r.issues.push({
|
|
714
|
-
code: "invalid_union",
|
|
715
|
-
errors: [],
|
|
716
|
-
note: "No matching discriminator",
|
|
717
|
-
discriminator: n.discriminator,
|
|
718
|
-
input: i,
|
|
719
|
-
path: [n.discriminator],
|
|
720
|
-
inst: e
|
|
721
|
-
}), r);
|
|
722
|
-
};
|
|
723
|
-
}), et = /* @__PURE__ */ l("$ZodIntersection", (e, n) => {
|
|
724
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
725
|
-
const r = t.value, s = n.left._zod.run({ value: r, issues: [] }, o), i = n.right._zod.run({ value: r, issues: [] }, o);
|
|
726
|
-
return s instanceof Promise || i instanceof Promise ? Promise.all([s, i]).then(([c, a]) => X(t, c, a)) : X(t, s, i);
|
|
727
|
-
};
|
|
728
|
-
});
|
|
729
|
-
function C(e, n) {
|
|
730
|
-
if (e === n)
|
|
731
|
-
return { valid: !0, data: e };
|
|
732
|
-
if (e instanceof Date && n instanceof Date && +e == +n)
|
|
733
|
-
return { valid: !0, data: e };
|
|
734
|
-
if (U(e) && U(n)) {
|
|
735
|
-
const t = Object.keys(n), o = Object.keys(e).filter((s) => t.indexOf(s) !== -1), r = { ...e, ...n };
|
|
736
|
-
for (const s of o) {
|
|
737
|
-
const i = C(e[s], n[s]);
|
|
738
|
-
if (!i.valid)
|
|
739
|
-
return {
|
|
740
|
-
valid: !1,
|
|
741
|
-
mergeErrorPath: [s, ...i.mergeErrorPath]
|
|
742
|
-
};
|
|
743
|
-
r[s] = i.data;
|
|
744
|
-
}
|
|
745
|
-
return { valid: !0, data: r };
|
|
746
|
-
}
|
|
747
|
-
if (Array.isArray(e) && Array.isArray(n)) {
|
|
748
|
-
if (e.length !== n.length)
|
|
749
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
750
|
-
const t = [];
|
|
751
|
-
for (let o = 0; o < e.length; o++) {
|
|
752
|
-
const r = e[o], s = n[o], i = C(r, s);
|
|
753
|
-
if (!i.valid)
|
|
754
|
-
return {
|
|
755
|
-
valid: !1,
|
|
756
|
-
mergeErrorPath: [o, ...i.mergeErrorPath]
|
|
757
|
-
};
|
|
758
|
-
t.push(i.data);
|
|
759
|
-
}
|
|
760
|
-
return { valid: !0, data: t };
|
|
761
|
-
}
|
|
762
|
-
return { valid: !1, mergeErrorPath: [] };
|
|
763
|
-
}
|
|
764
|
-
function X(e, n, t) {
|
|
765
|
-
const o = /* @__PURE__ */ new Map();
|
|
766
|
-
let r;
|
|
767
|
-
for (const u of n.issues)
|
|
768
|
-
if (u.code === "unrecognized_keys") {
|
|
769
|
-
r ?? (r = u);
|
|
770
|
-
for (const c of u.keys)
|
|
771
|
-
o.has(c) || o.set(c, {}), o.get(c).l = !0;
|
|
772
|
-
} else
|
|
773
|
-
e.issues.push(u);
|
|
774
|
-
for (const u of t.issues)
|
|
775
|
-
if (u.code === "unrecognized_keys")
|
|
776
|
-
for (const c of u.keys)
|
|
777
|
-
o.has(c) || o.set(c, {}), o.get(c).r = !0;
|
|
778
|
-
else
|
|
779
|
-
e.issues.push(u);
|
|
780
|
-
const s = [...o].filter(([, u]) => u.l && u.r).map(([u]) => u);
|
|
781
|
-
if (s.length && r && e.issues.push({ ...r, keys: s }), k(e))
|
|
782
|
-
return e;
|
|
783
|
-
const i = C(n.value, t.value);
|
|
784
|
-
if (!i.valid)
|
|
785
|
-
throw new Error(`Unmergable intersection. Error path: ${JSON.stringify(i.mergeErrorPath)}`);
|
|
786
|
-
return e.value = i.data, e;
|
|
787
|
-
}
|
|
788
|
-
const rn = /* @__PURE__ */ l("$ZodTuple", (e, n) => {
|
|
789
|
-
h.init(e, n);
|
|
790
|
-
const t = n.items;
|
|
791
|
-
e._zod.parse = (o, r) => {
|
|
792
|
-
const s = o.value;
|
|
793
|
-
if (!Array.isArray(s))
|
|
794
|
-
return o.issues.push({
|
|
795
|
-
input: s,
|
|
796
|
-
inst: e,
|
|
797
|
-
expected: "tuple",
|
|
798
|
-
code: "invalid_type"
|
|
799
|
-
}), o;
|
|
800
|
-
o.value = [];
|
|
801
|
-
const i = [], u = [...t].reverse().findIndex((p) => p._zod.optin !== "optional"), c = u === -1 ? 0 : t.length - u;
|
|
802
|
-
if (!n.rest) {
|
|
803
|
-
const p = s.length > t.length, d = s.length < c - 1;
|
|
804
|
-
if (p || d)
|
|
805
|
-
return o.issues.push({
|
|
806
|
-
...p ? { code: "too_big", maximum: t.length, inclusive: !0 } : { code: "too_small", minimum: t.length },
|
|
807
|
-
input: s,
|
|
808
|
-
inst: e,
|
|
809
|
-
origin: "array"
|
|
810
|
-
}), o;
|
|
811
|
-
}
|
|
812
|
-
let a = -1;
|
|
813
|
-
for (const p of t) {
|
|
814
|
-
if (a++, a >= s.length && a >= c)
|
|
815
|
-
continue;
|
|
816
|
-
const d = p._zod.run({
|
|
817
|
-
value: s[a],
|
|
818
|
-
issues: []
|
|
819
|
-
}, r);
|
|
820
|
-
d instanceof Promise ? i.push(d.then((_) => S(_, o, a))) : S(d, o, a);
|
|
821
|
-
}
|
|
822
|
-
if (n.rest) {
|
|
823
|
-
const p = s.slice(t.length);
|
|
824
|
-
for (const d of p) {
|
|
825
|
-
a++;
|
|
826
|
-
const _ = n.rest._zod.run({
|
|
827
|
-
value: d,
|
|
828
|
-
issues: []
|
|
829
|
-
}, r);
|
|
830
|
-
_ instanceof Promise ? i.push(_.then((f) => S(f, o, a))) : S(_, o, a);
|
|
831
|
-
}
|
|
832
|
-
}
|
|
833
|
-
return i.length ? Promise.all(i).then(() => o) : o;
|
|
834
|
-
};
|
|
835
|
-
});
|
|
836
|
-
function S(e, n, t) {
|
|
837
|
-
e.issues.length && n.issues.push(...w(t, e.issues)), n.value[t] = e.value;
|
|
838
|
-
}
|
|
839
|
-
const nt = /* @__PURE__ */ l("$ZodRecord", (e, n) => {
|
|
840
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
841
|
-
const r = t.value;
|
|
842
|
-
if (!U(r))
|
|
843
|
-
return t.issues.push({
|
|
844
|
-
expected: "record",
|
|
845
|
-
code: "invalid_type",
|
|
846
|
-
input: r,
|
|
847
|
-
inst: e
|
|
848
|
-
}), t;
|
|
849
|
-
const s = [], i = n.keyType._zod.values;
|
|
850
|
-
if (i) {
|
|
851
|
-
t.value = {};
|
|
852
|
-
const u = /* @__PURE__ */ new Set();
|
|
853
|
-
for (const a of i)
|
|
854
|
-
if (typeof a == "string" || typeof a == "number" || typeof a == "symbol") {
|
|
855
|
-
u.add(typeof a == "number" ? a.toString() : a);
|
|
856
|
-
const p = n.valueType._zod.run({ value: r[a], issues: [] }, o);
|
|
857
|
-
p instanceof Promise ? s.push(p.then((d) => {
|
|
858
|
-
d.issues.length && t.issues.push(...w(a, d.issues)), t.value[a] = d.value;
|
|
859
|
-
})) : (p.issues.length && t.issues.push(...w(a, p.issues)), t.value[a] = p.value);
|
|
860
|
-
}
|
|
861
|
-
let c;
|
|
862
|
-
for (const a in r)
|
|
863
|
-
u.has(a) || (c = c ?? [], c.push(a));
|
|
864
|
-
c && c.length > 0 && t.issues.push({
|
|
865
|
-
code: "unrecognized_keys",
|
|
866
|
-
input: r,
|
|
867
|
-
inst: e,
|
|
868
|
-
keys: c
|
|
869
|
-
});
|
|
870
|
-
} else {
|
|
871
|
-
t.value = {};
|
|
872
|
-
for (const u of Reflect.ownKeys(r)) {
|
|
873
|
-
if (u === "__proto__")
|
|
874
|
-
continue;
|
|
875
|
-
let c = n.keyType._zod.run({ value: u, issues: [] }, o);
|
|
876
|
-
if (c instanceof Promise)
|
|
877
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
878
|
-
if (typeof u == "string" && oe.test(u) && c.issues.length) {
|
|
879
|
-
const d = n.keyType._zod.run({ value: Number(u), issues: [] }, o);
|
|
880
|
-
if (d instanceof Promise)
|
|
881
|
-
throw new Error("Async schemas not supported in object keys currently");
|
|
882
|
-
d.issues.length === 0 && (c = d);
|
|
883
|
-
}
|
|
884
|
-
if (c.issues.length) {
|
|
885
|
-
n.mode === "loose" ? t.value[u] = r[u] : t.issues.push({
|
|
886
|
-
code: "invalid_key",
|
|
887
|
-
origin: "record",
|
|
888
|
-
issues: c.issues.map((d) => P(d, o, b())),
|
|
889
|
-
input: u,
|
|
890
|
-
path: [u],
|
|
891
|
-
inst: e
|
|
892
|
-
});
|
|
893
|
-
continue;
|
|
894
|
-
}
|
|
895
|
-
const p = n.valueType._zod.run({ value: r[u], issues: [] }, o);
|
|
896
|
-
p instanceof Promise ? s.push(p.then((d) => {
|
|
897
|
-
d.issues.length && t.issues.push(...w(u, d.issues)), t.value[c.value] = d.value;
|
|
898
|
-
})) : (p.issues.length && t.issues.push(...w(u, p.issues)), t.value[c.value] = p.value);
|
|
899
|
-
}
|
|
900
|
-
}
|
|
901
|
-
return s.length ? Promise.all(s).then(() => t) : t;
|
|
902
|
-
};
|
|
903
|
-
}), tt = /* @__PURE__ */ l("$ZodMap", (e, n) => {
|
|
904
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
905
|
-
const r = t.value;
|
|
906
|
-
if (!(r instanceof Map))
|
|
907
|
-
return t.issues.push({
|
|
908
|
-
expected: "map",
|
|
909
|
-
code: "invalid_type",
|
|
910
|
-
input: r,
|
|
911
|
-
inst: e
|
|
912
|
-
}), t;
|
|
913
|
-
const s = [];
|
|
914
|
-
t.value = /* @__PURE__ */ new Map();
|
|
915
|
-
for (const [i, u] of r) {
|
|
916
|
-
const c = n.keyType._zod.run({ value: i, issues: [] }, o), a = n.valueType._zod.run({ value: u, issues: [] }, o);
|
|
917
|
-
c instanceof Promise || a instanceof Promise ? s.push(Promise.all([c, a]).then(([p, d]) => {
|
|
918
|
-
G(p, d, t, i, r, e, o);
|
|
919
|
-
})) : G(c, a, t, i, r, e, o);
|
|
920
|
-
}
|
|
921
|
-
return s.length ? Promise.all(s).then(() => t) : t;
|
|
922
|
-
};
|
|
923
|
-
});
|
|
924
|
-
function G(e, n, t, o, r, s, i) {
|
|
925
|
-
e.issues.length && (A.has(typeof o) ? t.issues.push(...w(o, e.issues)) : t.issues.push({
|
|
926
|
-
code: "invalid_key",
|
|
927
|
-
origin: "map",
|
|
928
|
-
input: r,
|
|
929
|
-
inst: s,
|
|
930
|
-
issues: e.issues.map((u) => P(u, i, b()))
|
|
931
|
-
})), n.issues.length && (A.has(typeof o) ? t.issues.push(...w(o, n.issues)) : t.issues.push({
|
|
932
|
-
origin: "map",
|
|
933
|
-
code: "invalid_element",
|
|
934
|
-
input: r,
|
|
935
|
-
inst: s,
|
|
936
|
-
key: o,
|
|
937
|
-
issues: n.issues.map((u) => P(u, i, b()))
|
|
938
|
-
})), t.value.set(e.value, n.value);
|
|
939
|
-
}
|
|
940
|
-
const rt = /* @__PURE__ */ l("$ZodSet", (e, n) => {
|
|
941
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
942
|
-
const r = t.value;
|
|
943
|
-
if (!(r instanceof Set))
|
|
944
|
-
return t.issues.push({
|
|
945
|
-
input: r,
|
|
946
|
-
inst: e,
|
|
947
|
-
expected: "set",
|
|
948
|
-
code: "invalid_type"
|
|
949
|
-
}), t;
|
|
950
|
-
const s = [];
|
|
951
|
-
t.value = /* @__PURE__ */ new Set();
|
|
952
|
-
for (const i of r) {
|
|
953
|
-
const u = n.valueType._zod.run({ value: i, issues: [] }, o);
|
|
954
|
-
u instanceof Promise ? s.push(u.then((c) => H(c, t))) : H(u, t);
|
|
955
|
-
}
|
|
956
|
-
return s.length ? Promise.all(s).then(() => t) : t;
|
|
957
|
-
};
|
|
958
|
-
});
|
|
959
|
-
function H(e, n) {
|
|
960
|
-
e.issues.length && n.issues.push(...e.issues), n.value.add(e.value);
|
|
961
|
-
}
|
|
962
|
-
const ot = /* @__PURE__ */ l("$ZodEnum", (e, n) => {
|
|
963
|
-
h.init(e, n);
|
|
964
|
-
const t = We(n.entries), o = new Set(t);
|
|
965
|
-
e._zod.values = o, e._zod.pattern = new RegExp(`^(${t.filter((r) => A.has(typeof r)).map((r) => typeof r == "string" ? N(r) : r.toString()).join("|")})$`), e._zod.parse = (r, s) => {
|
|
966
|
-
const i = r.value;
|
|
967
|
-
return o.has(i) || r.issues.push({
|
|
968
|
-
code: "invalid_value",
|
|
969
|
-
values: t,
|
|
970
|
-
input: i,
|
|
971
|
-
inst: e
|
|
972
|
-
}), r;
|
|
973
|
-
};
|
|
974
|
-
}), st = /* @__PURE__ */ l("$ZodLiteral", (e, n) => {
|
|
975
|
-
if (h.init(e, n), n.values.length === 0)
|
|
976
|
-
throw new Error("Cannot create literal schema with no valid values");
|
|
977
|
-
const t = new Set(n.values);
|
|
978
|
-
e._zod.values = t, e._zod.pattern = new RegExp(`^(${n.values.map((o) => typeof o == "string" ? N(o) : o ? N(o.toString()) : String(o)).join("|")})$`), e._zod.parse = (o, r) => {
|
|
979
|
-
const s = o.value;
|
|
980
|
-
return t.has(s) || o.issues.push({
|
|
981
|
-
code: "invalid_value",
|
|
982
|
-
values: n.values,
|
|
983
|
-
input: s,
|
|
984
|
-
inst: e
|
|
985
|
-
}), o;
|
|
986
|
-
};
|
|
987
|
-
}), it = /* @__PURE__ */ l("$ZodFile", (e, n) => {
|
|
988
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
989
|
-
const r = t.value;
|
|
990
|
-
return r instanceof File || t.issues.push({
|
|
991
|
-
expected: "file",
|
|
992
|
-
code: "invalid_type",
|
|
993
|
-
input: r,
|
|
994
|
-
inst: e
|
|
995
|
-
}), t;
|
|
996
|
-
};
|
|
997
|
-
}), ut = /* @__PURE__ */ l("$ZodTransform", (e, n) => {
|
|
998
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
999
|
-
if (o.direction === "backward")
|
|
1000
|
-
throw new te(e.constructor.name);
|
|
1001
|
-
const r = n.transform(t.value, t);
|
|
1002
|
-
if (o.async)
|
|
1003
|
-
return (r instanceof Promise ? r : Promise.resolve(r)).then((i) => (t.value = i, t));
|
|
1004
|
-
if (r instanceof Promise)
|
|
1005
|
-
throw new D();
|
|
1006
|
-
return t.value = r, t;
|
|
1007
|
-
};
|
|
1008
|
-
});
|
|
1009
|
-
function q(e, n) {
|
|
1010
|
-
return e.issues.length && n === void 0 ? { issues: [], value: void 0 } : e;
|
|
1011
|
-
}
|
|
1012
|
-
const on = /* @__PURE__ */ l("$ZodOptional", (e, n) => {
|
|
1013
|
-
h.init(e, n), e._zod.optin = "optional", e._zod.optout = "optional", v(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, void 0]) : void 0), v(e._zod, "pattern", () => {
|
|
1014
|
-
const t = n.innerType._zod.pattern;
|
|
1015
|
-
return t ? new RegExp(`^(${L(t.source)})?$`) : void 0;
|
|
1016
|
-
}), e._zod.parse = (t, o) => {
|
|
1017
|
-
if (n.innerType._zod.optin === "optional") {
|
|
1018
|
-
const r = n.innerType._zod.run(t, o);
|
|
1019
|
-
return r instanceof Promise ? r.then((s) => q(s, t.value)) : q(r, t.value);
|
|
1020
|
-
}
|
|
1021
|
-
return t.value === void 0 ? t : n.innerType._zod.run(t, o);
|
|
1022
|
-
};
|
|
1023
|
-
}), ct = /* @__PURE__ */ l("$ZodExactOptional", (e, n) => {
|
|
1024
|
-
on.init(e, n), v(e._zod, "values", () => n.innerType._zod.values), v(e._zod, "pattern", () => n.innerType._zod.pattern), e._zod.parse = (t, o) => n.innerType._zod.run(t, o);
|
|
1025
|
-
}), at = /* @__PURE__ */ l("$ZodNullable", (e, n) => {
|
|
1026
|
-
h.init(e, n), v(e._zod, "optin", () => n.innerType._zod.optin), v(e._zod, "optout", () => n.innerType._zod.optout), v(e._zod, "pattern", () => {
|
|
1027
|
-
const t = n.innerType._zod.pattern;
|
|
1028
|
-
return t ? new RegExp(`^(${L(t.source)}|null)$`) : void 0;
|
|
1029
|
-
}), v(e._zod, "values", () => n.innerType._zod.values ? /* @__PURE__ */ new Set([...n.innerType._zod.values, null]) : void 0), e._zod.parse = (t, o) => t.value === null ? t : n.innerType._zod.run(t, o);
|
|
1030
|
-
}), lt = /* @__PURE__ */ l("$ZodDefault", (e, n) => {
|
|
1031
|
-
h.init(e, n), e._zod.optin = "optional", v(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, o) => {
|
|
1032
|
-
if (o.direction === "backward")
|
|
1033
|
-
return n.innerType._zod.run(t, o);
|
|
1034
|
-
if (t.value === void 0)
|
|
1035
|
-
return t.value = n.defaultValue, t;
|
|
1036
|
-
const r = n.innerType._zod.run(t, o);
|
|
1037
|
-
return r instanceof Promise ? r.then((s) => Q(s, n)) : Q(r, n);
|
|
1038
|
-
};
|
|
1039
|
-
});
|
|
1040
|
-
function Q(e, n) {
|
|
1041
|
-
return e.value === void 0 && (e.value = n.defaultValue), e;
|
|
1042
|
-
}
|
|
1043
|
-
const pt = /* @__PURE__ */ l("$ZodPrefault", (e, n) => {
|
|
1044
|
-
h.init(e, n), e._zod.optin = "optional", v(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, o) => (o.direction === "backward" || t.value === void 0 && (t.value = n.defaultValue), n.innerType._zod.run(t, o));
|
|
1045
|
-
}), dt = /* @__PURE__ */ l("$ZodNonOptional", (e, n) => {
|
|
1046
|
-
h.init(e, n), v(e._zod, "values", () => {
|
|
1047
|
-
const t = n.innerType._zod.values;
|
|
1048
|
-
return t ? new Set([...t].filter((o) => o !== void 0)) : void 0;
|
|
1049
|
-
}), e._zod.parse = (t, o) => {
|
|
1050
|
-
const r = n.innerType._zod.run(t, o);
|
|
1051
|
-
return r instanceof Promise ? r.then((s) => Y(s, e)) : Y(r, e);
|
|
1052
|
-
};
|
|
1053
|
-
});
|
|
1054
|
-
function Y(e, n) {
|
|
1055
|
-
return !e.issues.length && e.value === void 0 && e.issues.push({
|
|
1056
|
-
code: "invalid_type",
|
|
1057
|
-
expected: "nonoptional",
|
|
1058
|
-
input: e.value,
|
|
1059
|
-
inst: n
|
|
1060
|
-
}), e;
|
|
1061
|
-
}
|
|
1062
|
-
const ht = /* @__PURE__ */ l("$ZodSuccess", (e, n) => {
|
|
1063
|
-
h.init(e, n), e._zod.parse = (t, o) => {
|
|
1064
|
-
if (o.direction === "backward")
|
|
1065
|
-
throw new te("ZodSuccess");
|
|
1066
|
-
const r = n.innerType._zod.run(t, o);
|
|
1067
|
-
return r instanceof Promise ? r.then((s) => (t.value = s.issues.length === 0, t)) : (t.value = r.issues.length === 0, t);
|
|
1068
|
-
};
|
|
1069
|
-
}), vt = /* @__PURE__ */ l("$ZodCatch", (e, n) => {
|
|
1070
|
-
h.init(e, n), v(e._zod, "optin", () => n.innerType._zod.optin), v(e._zod, "optout", () => n.innerType._zod.optout), v(e._zod, "values", () => n.innerType._zod.values), e._zod.parse = (t, o) => {
|
|
1071
|
-
if (o.direction === "backward")
|
|
1072
|
-
return n.innerType._zod.run(t, o);
|
|
1073
|
-
const r = n.innerType._zod.run(t, o);
|
|
1074
|
-
return r instanceof Promise ? r.then((s) => (t.value = s.value, s.issues.length && (t.value = n.catchValue({
|
|
1075
|
-
...t,
|
|
1076
|
-
error: {
|
|
1077
|
-
issues: s.issues.map((i) => P(i, o, b()))
|
|
1078
|
-
},
|
|
1079
|
-
input: t.value
|
|
1080
|
-
}), t.issues = []), t)) : (t.value = r.value, r.issues.length && (t.value = n.catchValue({
|
|
1081
|
-
...t,
|
|
1082
|
-
error: {
|
|
1083
|
-
issues: r.issues.map((s) => P(s, o, b()))
|
|
1084
|
-
},
|
|
1085
|
-
input: t.value
|
|
1086
|
-
}), t.issues = []), t);
|
|
1087
|
-
};
|
|
1088
|
-
}), _t = /* @__PURE__ */ l("$ZodNaN", (e, n) => {
|
|
1089
|
-
h.init(e, n), e._zod.parse = (t, o) => ((typeof t.value != "number" || !Number.isNaN(t.value)) && t.issues.push({
|
|
1090
|
-
input: t.value,
|
|
1091
|
-
inst: e,
|
|
1092
|
-
expected: "nan",
|
|
1093
|
-
code: "invalid_type"
|
|
1094
|
-
}), t);
|
|
1095
|
-
}), ft = /* @__PURE__ */ l("$ZodPipe", (e, n) => {
|
|
1096
|
-
h.init(e, n), v(e._zod, "values", () => n.in._zod.values), v(e._zod, "optin", () => n.in._zod.optin), v(e._zod, "optout", () => n.out._zod.optout), v(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, o) => {
|
|
1097
|
-
if (o.direction === "backward") {
|
|
1098
|
-
const s = n.out._zod.run(t, o);
|
|
1099
|
-
return s instanceof Promise ? s.then((i) => E(i, n.in, o)) : E(s, n.in, o);
|
|
1100
|
-
}
|
|
1101
|
-
const r = n.in._zod.run(t, o);
|
|
1102
|
-
return r instanceof Promise ? r.then((s) => E(s, n.out, o)) : E(r, n.out, o);
|
|
1103
|
-
};
|
|
1104
|
-
});
|
|
1105
|
-
function E(e, n, t) {
|
|
1106
|
-
return e.issues.length ? (e.aborted = !0, e) : n._zod.run({ value: e.value, issues: e.issues }, t);
|
|
1107
|
-
}
|
|
1108
|
-
const mt = /* @__PURE__ */ l("$ZodCodec", (e, n) => {
|
|
1109
|
-
h.init(e, n), v(e._zod, "values", () => n.in._zod.values), v(e._zod, "optin", () => n.in._zod.optin), v(e._zod, "optout", () => n.out._zod.optout), v(e._zod, "propValues", () => n.in._zod.propValues), e._zod.parse = (t, o) => {
|
|
1110
|
-
if ((o.direction || "forward") === "forward") {
|
|
1111
|
-
const s = n.in._zod.run(t, o);
|
|
1112
|
-
return s instanceof Promise ? s.then((i) => R(i, n, o)) : R(s, n, o);
|
|
1113
|
-
} else {
|
|
1114
|
-
const s = n.out._zod.run(t, o);
|
|
1115
|
-
return s instanceof Promise ? s.then((i) => R(i, n, o)) : R(s, n, o);
|
|
1116
|
-
}
|
|
1117
|
-
};
|
|
1118
|
-
});
|
|
1119
|
-
function R(e, n, t) {
|
|
1120
|
-
if (e.issues.length)
|
|
1121
|
-
return e.aborted = !0, e;
|
|
1122
|
-
if ((t.direction || "forward") === "forward") {
|
|
1123
|
-
const r = n.transform(e.value, e);
|
|
1124
|
-
return r instanceof Promise ? r.then((s) => O(e, s, n.out, t)) : O(e, r, n.out, t);
|
|
1125
|
-
} else {
|
|
1126
|
-
const r = n.reverseTransform(e.value, e);
|
|
1127
|
-
return r instanceof Promise ? r.then((s) => O(e, s, n.in, t)) : O(e, r, n.in, t);
|
|
1128
|
-
}
|
|
1129
|
-
}
|
|
1130
|
-
function O(e, n, t, o) {
|
|
1131
|
-
return e.issues.length ? (e.aborted = !0, e) : t._zod.run({ value: n, issues: e.issues }, o);
|
|
1132
|
-
}
|
|
1133
|
-
const zt = /* @__PURE__ */ l("$ZodReadonly", (e, n) => {
|
|
1134
|
-
h.init(e, n), v(e._zod, "propValues", () => n.innerType._zod.propValues), v(e._zod, "values", () => n.innerType._zod.values), v(e._zod, "optin", () => n.innerType?._zod?.optin), v(e._zod, "optout", () => n.innerType?._zod?.optout), e._zod.parse = (t, o) => {
|
|
1135
|
-
if (o.direction === "backward")
|
|
1136
|
-
return n.innerType._zod.run(t, o);
|
|
1137
|
-
const r = n.innerType._zod.run(t, o);
|
|
1138
|
-
return r instanceof Promise ? r.then(ee) : ee(r);
|
|
1139
|
-
};
|
|
1140
|
-
});
|
|
1141
|
-
function ee(e) {
|
|
1142
|
-
return e.value = Object.freeze(e.value), e;
|
|
1143
|
-
}
|
|
1144
|
-
const $t = /* @__PURE__ */ l("$ZodTemplateLiteral", (e, n) => {
|
|
1145
|
-
h.init(e, n);
|
|
1146
|
-
const t = [];
|
|
1147
|
-
for (const o of n.parts)
|
|
1148
|
-
if (typeof o == "object" && o !== null) {
|
|
1149
|
-
if (!o._zod.pattern)
|
|
1150
|
-
throw new Error(`Invalid template literal part, no pattern found: ${[...o._zod.traits].shift()}`);
|
|
1151
|
-
const r = o._zod.pattern instanceof RegExp ? o._zod.pattern.source : o._zod.pattern;
|
|
1152
|
-
if (!r)
|
|
1153
|
-
throw new Error(`Invalid template literal part: ${o._zod.traits}`);
|
|
1154
|
-
const s = r.startsWith("^") ? 1 : 0, i = r.endsWith("$") ? r.length - 1 : r.length;
|
|
1155
|
-
t.push(r.slice(s, i));
|
|
1156
|
-
} else if (o === null || ye.has(typeof o))
|
|
1157
|
-
t.push(N(`${o}`));
|
|
1158
|
-
else
|
|
1159
|
-
throw new Error(`Invalid template literal part: ${o}`);
|
|
1160
|
-
e._zod.pattern = new RegExp(`^${t.join("")}$`), e._zod.parse = (o, r) => typeof o.value != "string" ? (o.issues.push({
|
|
1161
|
-
input: o.value,
|
|
1162
|
-
inst: e,
|
|
1163
|
-
expected: "string",
|
|
1164
|
-
code: "invalid_type"
|
|
1165
|
-
}), o) : (e._zod.pattern.lastIndex = 0, e._zod.pattern.test(o.value) || o.issues.push({
|
|
1166
|
-
input: o.value,
|
|
1167
|
-
inst: e,
|
|
1168
|
-
code: "invalid_format",
|
|
1169
|
-
format: n.format ?? "template_literal",
|
|
1170
|
-
pattern: e._zod.pattern.source
|
|
1171
|
-
}), o);
|
|
1172
|
-
}), gt = /* @__PURE__ */ l("$ZodFunction", (e, n) => (h.init(e, n), e._def = n, e._zod.def = n, e.implement = (t) => {
|
|
1173
|
-
if (typeof t != "function")
|
|
1174
|
-
throw new Error("implement() must be called with a function");
|
|
1175
|
-
return function(...o) {
|
|
1176
|
-
const r = e._def.input ? B(e._def.input, o) : o, s = Reflect.apply(t, this, r);
|
|
1177
|
-
return e._def.output ? B(e._def.output, s) : s;
|
|
1178
|
-
};
|
|
1179
|
-
}, e.implementAsync = (t) => {
|
|
1180
|
-
if (typeof t != "function")
|
|
1181
|
-
throw new Error("implementAsync() must be called with a function");
|
|
1182
|
-
return async function(...o) {
|
|
1183
|
-
const r = e._def.input ? await K(e._def.input, o) : o, s = await Reflect.apply(t, this, r);
|
|
1184
|
-
return e._def.output ? await K(e._def.output, s) : s;
|
|
1185
|
-
};
|
|
1186
|
-
}, e._zod.parse = (t, o) => typeof t.value != "function" ? (t.issues.push({
|
|
1187
|
-
code: "invalid_type",
|
|
1188
|
-
expected: "function",
|
|
1189
|
-
input: t.value,
|
|
1190
|
-
inst: e
|
|
1191
|
-
}), t) : (e._def.output && e._def.output._zod.def.type === "promise" ? t.value = e.implementAsync(t.value) : t.value = e.implement(t.value), t), e.input = (...t) => {
|
|
1192
|
-
const o = e.constructor;
|
|
1193
|
-
return Array.isArray(t[0]) ? new o({
|
|
1194
|
-
type: "function",
|
|
1195
|
-
input: new rn({
|
|
1196
|
-
type: "tuple",
|
|
1197
|
-
items: t[0],
|
|
1198
|
-
rest: t[1]
|
|
1199
|
-
}),
|
|
1200
|
-
output: e._def.output
|
|
1201
|
-
}) : new o({
|
|
1202
|
-
type: "function",
|
|
1203
|
-
input: t[0],
|
|
1204
|
-
output: e._def.output
|
|
1205
|
-
});
|
|
1206
|
-
}, e.output = (t) => {
|
|
1207
|
-
const o = e.constructor;
|
|
1208
|
-
return new o({
|
|
1209
|
-
type: "function",
|
|
1210
|
-
input: e._def.input,
|
|
1211
|
-
output: t
|
|
1212
|
-
});
|
|
1213
|
-
}, e)), Zt = /* @__PURE__ */ l("$ZodPromise", (e, n) => {
|
|
1214
|
-
h.init(e, n), e._zod.parse = (t, o) => Promise.resolve(t.value).then((r) => n.innerType._zod.run({ value: r, issues: [] }, o));
|
|
1215
|
-
}), wt = /* @__PURE__ */ l("$ZodLazy", (e, n) => {
|
|
1216
|
-
h.init(e, n), v(e._zod, "innerType", () => n.getter()), v(e._zod, "pattern", () => e._zod.innerType?._zod?.pattern), v(e._zod, "propValues", () => e._zod.innerType?._zod?.propValues), v(e._zod, "optin", () => e._zod.innerType?._zod?.optin ?? void 0), v(e._zod, "optout", () => e._zod.innerType?._zod?.optout ?? void 0), e._zod.parse = (t, o) => e._zod.innerType._zod.run(t, o);
|
|
1217
|
-
}), bt = /* @__PURE__ */ l("$ZodCustom", (e, n) => {
|
|
1218
|
-
_e.init(e, n), h.init(e, n), e._zod.parse = (t, o) => t, e._zod.check = (t) => {
|
|
1219
|
-
const o = t.value, r = n.fn(o);
|
|
1220
|
-
if (r instanceof Promise)
|
|
1221
|
-
return r.then((s) => ne(s, t, o, e));
|
|
1222
|
-
ne(r, t, o, e);
|
|
1223
|
-
};
|
|
1224
|
-
});
|
|
1225
|
-
function ne(e, n, t, o) {
|
|
1226
|
-
if (!e) {
|
|
1227
|
-
const r = {
|
|
1228
|
-
code: "custom",
|
|
1229
|
-
input: t,
|
|
1230
|
-
inst: o,
|
|
1231
|
-
// incorporates params.error into issue reporting
|
|
1232
|
-
path: [...o._zod.def.path ?? []],
|
|
1233
|
-
// incorporates params.error into issue reporting
|
|
1234
|
-
continue: !o._zod.def.abort
|
|
1235
|
-
// params: inst._zod.def.params,
|
|
1236
|
-
};
|
|
1237
|
-
o._zod.def.params && (r.params = o._zod.def.params), n.issues.push(Xe(r));
|
|
1238
|
-
}
|
|
1239
|
-
}
|
|
1240
|
-
export {
|
|
1241
|
-
Jn as $ZodAny,
|
|
1242
|
-
Hn as $ZodArray,
|
|
1243
|
-
jn as $ZodBase64,
|
|
1244
|
-
Un as $ZodBase64URL,
|
|
1245
|
-
nn as $ZodBigInt,
|
|
1246
|
-
Bn as $ZodBigIntFormat,
|
|
1247
|
-
Ln as $ZodBoolean,
|
|
1248
|
-
Dn as $ZodCIDRv4,
|
|
1249
|
-
Nn as $ZodCIDRv6,
|
|
1250
|
-
gn as $ZodCUID,
|
|
1251
|
-
Zn as $ZodCUID2,
|
|
1252
|
-
vt as $ZodCatch,
|
|
1253
|
-
mt as $ZodCodec,
|
|
1254
|
-
bt as $ZodCustom,
|
|
1255
|
-
Vn as $ZodCustomStringFormat,
|
|
1256
|
-
Gn as $ZodDate,
|
|
1257
|
-
lt as $ZodDefault,
|
|
1258
|
-
Yn as $ZodDiscriminatedUnion,
|
|
1259
|
-
An as $ZodE164,
|
|
1260
|
-
fn as $ZodEmail,
|
|
1261
|
-
zn as $ZodEmoji,
|
|
1262
|
-
ot as $ZodEnum,
|
|
1263
|
-
ct as $ZodExactOptional,
|
|
1264
|
-
it as $ZodFile,
|
|
1265
|
-
gt as $ZodFunction,
|
|
1266
|
-
vn as $ZodGUID,
|
|
1267
|
-
En as $ZodIPv4,
|
|
1268
|
-
Rn as $ZodIPv6,
|
|
1269
|
-
Tn as $ZodISODate,
|
|
1270
|
-
kn as $ZodISODateTime,
|
|
1271
|
-
Sn as $ZodISODuration,
|
|
1272
|
-
In as $ZodISOTime,
|
|
1273
|
-
et as $ZodIntersection,
|
|
1274
|
-
Cn as $ZodJWT,
|
|
1275
|
-
Pn as $ZodKSUID,
|
|
1276
|
-
wt as $ZodLazy,
|
|
1277
|
-
st as $ZodLiteral,
|
|
1278
|
-
On as $ZodMAC,
|
|
1279
|
-
tt as $ZodMap,
|
|
1280
|
-
_t as $ZodNaN,
|
|
1281
|
-
$n as $ZodNanoID,
|
|
1282
|
-
yn as $ZodNever,
|
|
1283
|
-
dt as $ZodNonOptional,
|
|
1284
|
-
xn as $ZodNull,
|
|
1285
|
-
at as $ZodNullable,
|
|
1286
|
-
en as $ZodNumber,
|
|
1287
|
-
Fn as $ZodNumberFormat,
|
|
1288
|
-
tn as $ZodObject,
|
|
1289
|
-
qn as $ZodObjectJIT,
|
|
1290
|
-
on as $ZodOptional,
|
|
1291
|
-
ft as $ZodPipe,
|
|
1292
|
-
pt as $ZodPrefault,
|
|
1293
|
-
Zt as $ZodPromise,
|
|
1294
|
-
zt as $ZodReadonly,
|
|
1295
|
-
nt as $ZodRecord,
|
|
1296
|
-
rt as $ZodSet,
|
|
1297
|
-
qe as $ZodString,
|
|
1298
|
-
m as $ZodStringFormat,
|
|
1299
|
-
ht as $ZodSuccess,
|
|
1300
|
-
Kn as $ZodSymbol,
|
|
1301
|
-
$t as $ZodTemplateLiteral,
|
|
1302
|
-
ut as $ZodTransform,
|
|
1303
|
-
rn as $ZodTuple,
|
|
1304
|
-
h as $ZodType,
|
|
1305
|
-
wn as $ZodULID,
|
|
1306
|
-
mn as $ZodURL,
|
|
1307
|
-
_n as $ZodUUID,
|
|
1308
|
-
Mn as $ZodUndefined,
|
|
1309
|
-
ce as $ZodUnion,
|
|
1310
|
-
Wn as $ZodUnknown,
|
|
1311
|
-
Xn as $ZodVoid,
|
|
1312
|
-
bn as $ZodXID,
|
|
1313
|
-
Qn as $ZodXor,
|
|
1314
|
-
Tt as clone,
|
|
1315
|
-
se as isValidBase64,
|
|
1316
|
-
Qe as isValidBase64URL,
|
|
1317
|
-
Ye as isValidJWT
|
|
1318
|
-
};
|
|
1319
|
-
//# sourceMappingURL=schemas.mjs.map
|