@spotlightjs/spotlight 4.7.1 → 4.8.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/_virtual/_commonjsHelpers.js +1 -3
- package/dist/_virtual/_commonjsHelpers.js.map +1 -1
- package/dist/_virtual/_sentry-release-injection-file.js +2 -2
- package/dist/_virtual/additionalItems.js +13 -0
- package/dist/_virtual/additionalItems.js.map +1 -0
- package/dist/_virtual/additionalProperties.js +13 -0
- package/dist/_virtual/additionalProperties.js.map +1 -0
- package/dist/_virtual/{cache.js → ajv.js} +4 -4
- package/dist/_virtual/ajv.js.map +1 -0
- package/dist/_virtual/{uri.all.js → allOf.js} +4 -4
- package/dist/_virtual/allOf.js.map +1 -0
- package/dist/_virtual/anyOf.js +13 -0
- package/dist/_virtual/anyOf.js.map +1 -0
- package/dist/_virtual/applicability.js +13 -0
- package/dist/_virtual/applicability.js.map +1 -0
- package/dist/_virtual/boolSchema.js +13 -0
- package/dist/_virtual/boolSchema.js.map +1 -0
- package/dist/_virtual/code.js +13 -0
- package/dist/_virtual/code.js.map +1 -0
- package/dist/_virtual/code2.js +13 -0
- package/dist/_virtual/code2.js.map +1 -0
- package/dist/_virtual/const.js +13 -0
- package/dist/_virtual/const.js.map +1 -0
- package/dist/_virtual/contains.js +13 -0
- package/dist/_virtual/contains.js.map +1 -0
- package/dist/_virtual/core.js +13 -0
- package/dist/_virtual/core.js.map +1 -0
- package/dist/_virtual/dataType.js +13 -0
- package/dist/_virtual/dataType.js.map +1 -0
- package/dist/_virtual/defaults.js +13 -0
- package/dist/_virtual/defaults.js.map +1 -0
- package/dist/_virtual/dependencies.js +13 -0
- package/dist/_virtual/dependencies.js.map +1 -0
- package/dist/_virtual/draft7.js +13 -0
- package/dist/_virtual/draft7.js.map +1 -0
- package/dist/_virtual/enum.js +13 -0
- package/dist/_virtual/enum.js.map +1 -0
- package/dist/_virtual/equal.js +13 -0
- package/dist/_virtual/equal.js.map +1 -0
- package/dist/_virtual/errors.js +13 -0
- package/dist/_virtual/errors.js.map +1 -0
- package/dist/_virtual/format.js +13 -0
- package/dist/_virtual/format.js.map +1 -0
- package/dist/_virtual/formats.js +13 -0
- package/dist/_virtual/formats.js.map +1 -0
- package/dist/_virtual/id.js +13 -0
- package/dist/_virtual/id.js.map +1 -0
- package/dist/_virtual/if.js +13 -0
- package/dist/_virtual/if.js.map +1 -0
- package/dist/_virtual/index.js +3 -3
- package/dist/_virtual/index10.js +13 -0
- package/dist/_virtual/index10.js.map +1 -0
- package/dist/_virtual/index11.js +13 -0
- package/dist/_virtual/index11.js.map +1 -0
- package/dist/_virtual/index2.js +13 -0
- package/dist/_virtual/index2.js.map +1 -0
- package/dist/_virtual/index3.js +13 -0
- package/dist/_virtual/index3.js.map +1 -0
- package/dist/_virtual/index4.js +13 -0
- package/dist/_virtual/index4.js.map +1 -0
- package/dist/_virtual/index5.js +13 -0
- package/dist/_virtual/index5.js.map +1 -0
- package/dist/_virtual/index6.js +13 -0
- package/dist/_virtual/index6.js.map +1 -0
- package/dist/_virtual/index7.js +13 -0
- package/dist/_virtual/index7.js.map +1 -0
- package/dist/_virtual/index8.js +13 -0
- package/dist/_virtual/index8.js.map +1 -0
- package/dist/_virtual/index9.js +13 -0
- package/dist/_virtual/index9.js.map +1 -0
- package/dist/_virtual/items.js +13 -0
- package/dist/_virtual/items.js.map +1 -0
- package/dist/_virtual/items2020.js +13 -0
- package/dist/_virtual/items2020.js.map +1 -0
- package/dist/_virtual/keyword.js +13 -0
- package/dist/_virtual/keyword.js.map +1 -0
- package/dist/_virtual/limit.js +13 -0
- package/dist/_virtual/limit.js.map +1 -0
- package/dist/_virtual/limitItems.js +13 -0
- package/dist/_virtual/limitItems.js.map +1 -0
- package/dist/_virtual/limitLength.js +13 -0
- package/dist/_virtual/limitLength.js.map +1 -0
- package/dist/_virtual/limitNumber.js +13 -0
- package/dist/_virtual/limitNumber.js.map +1 -0
- package/dist/_virtual/limitProperties.js +13 -0
- package/dist/_virtual/limitProperties.js.map +1 -0
- package/dist/_virtual/metadata.js +13 -0
- package/dist/_virtual/metadata.js.map +1 -0
- package/dist/_virtual/multipleOf.js +13 -0
- package/dist/_virtual/multipleOf.js.map +1 -0
- package/dist/_virtual/names.js +13 -0
- package/dist/_virtual/names.js.map +1 -0
- package/dist/_virtual/not.js +13 -0
- package/dist/_virtual/not.js.map +1 -0
- package/dist/_virtual/oneOf.js +13 -0
- package/dist/_virtual/oneOf.js.map +1 -0
- package/dist/_virtual/pattern.js +13 -0
- package/dist/_virtual/pattern.js.map +1 -0
- package/dist/_virtual/patternProperties.js +13 -0
- package/dist/_virtual/patternProperties.js.map +1 -0
- package/dist/_virtual/prefixItems.js +13 -0
- package/dist/_virtual/prefixItems.js.map +1 -0
- package/dist/_virtual/properties.js +13 -0
- package/dist/_virtual/properties.js.map +1 -0
- package/dist/_virtual/propertyNames.js +13 -0
- package/dist/_virtual/propertyNames.js.map +1 -0
- package/dist/_virtual/ref.js +13 -0
- package/dist/_virtual/ref.js.map +1 -0
- package/dist/_virtual/ref_error.js +13 -0
- package/dist/_virtual/ref_error.js.map +1 -0
- package/dist/_virtual/required.js +13 -0
- package/dist/_virtual/required.js.map +1 -0
- package/dist/_virtual/resolve.js +13 -0
- package/dist/_virtual/resolve.js.map +1 -0
- package/dist/_virtual/rules.js +13 -0
- package/dist/_virtual/rules.js.map +1 -0
- package/dist/_virtual/scope.js +13 -0
- package/dist/_virtual/scope.js.map +1 -0
- package/dist/_virtual/subschema.js +13 -0
- package/dist/_virtual/subschema.js.map +1 -0
- package/dist/_virtual/thenElse.js +13 -0
- package/dist/_virtual/thenElse.js.map +1 -0
- package/dist/_virtual/types.js +13 -0
- package/dist/_virtual/types.js.map +1 -0
- package/dist/_virtual/ucs2length.js +13 -0
- package/dist/_virtual/ucs2length.js.map +1 -0
- package/dist/_virtual/uniqueItems.js +13 -0
- package/dist/_virtual/uniqueItems.js.map +1 -0
- package/dist/_virtual/uri.js +13 -0
- package/dist/_virtual/uri.js.map +1 -0
- package/dist/_virtual/util.js +13 -0
- package/dist/_virtual/util.js.map +1 -0
- package/dist/_virtual/validation_error.js +13 -0
- package/dist/_virtual/validation_error.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +454 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js +166 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/client.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js +44 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/helpers.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js +15 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/interfaces.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js +25 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/mcp-server.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js +82 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/experimental/tasks/server.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +27 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +400 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +1 -0
- package/dist/node_modules/.pnpm/{@modelcontextprotocol_sdk@1.16.0 → @modelcontextprotocol_sdk@1.24.3_zod@4.1.13}/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js +284 -97
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +1 -0
- package/dist/node_modules/.pnpm/{@modelcontextprotocol_sdk@1.16.0 → @modelcontextprotocol_sdk@1.24.3_zod@4.1.13}/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js +176 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-compat.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js +59 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/server/zod-json-schema-compat.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +968 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +1 -0
- package/dist/node_modules/.pnpm/{@modelcontextprotocol_sdk@1.16.0 → @modelcontextprotocol_sdk@1.24.3_zod@4.1.13}/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js +1 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js +70 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/toolNameValidation.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +1623 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +1 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js +79 -0
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.24.3_zod@4.1.13/node_modules/@modelcontextprotocol/sdk/dist/esm/validation/ajv-provider.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js +209 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/formats.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js +59 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js +81 -0
- package/dist/node_modules/.pnpm/ajv-formats@3.0.1_ajv@8.17.1/node_modules/ajv-formats/dist/limit.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js +95 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/ajv.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js +160 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/code.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js +730 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js +153 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/codegen/scope.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js +134 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js +243 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js +45 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/names.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js +23 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/ref_error.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js +167 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/resolve.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js +38 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/rules.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js +178 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/util.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js +30 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/applicability.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js +64 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/boolSchema.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js +201 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/dataType.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js +48 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/defaults.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js +536 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js +133 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/keyword.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js +94 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/compile/validate/subschema.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js +638 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/core.js.map +1 -0
- package/dist/node_modules/.pnpm/{ajv@6.12.6/node_modules/ajv/lib → ajv@8.17.1/node_modules/ajv/dist}/refs/data.json.js +4 -7
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/refs/data.json.js.map +1 -0
- package/dist/node_modules/.pnpm/{ajv@6.12.6/node_modules/ajv/lib → ajv@8.17.1/node_modules/ajv/dist}/refs/json-schema-draft-07.json.js +3 -3
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/equal.js.map +1 -0
- package/dist/node_modules/.pnpm/{ajv@6.12.6/node_modules/ajv/lib/compile → ajv@8.17.1/node_modules/ajv/dist/runtime}/ucs2length.js +13 -8
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/ucs2length.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js +16 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/uri.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js +20 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/runtime/validation_error.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js +61 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js +118 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/additionalProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js +33 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/allOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js +23 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/anyOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js +102 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/contains.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js +106 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/dependencies.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js +77 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/if.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js +84 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js +67 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js +47 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/items2020.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js +37 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/not.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js +66 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/oneOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js +84 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/patternProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js +23 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/prefixItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js +70 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/properties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js +51 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/propertyNames.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js +24 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/applicator/thenElse.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js +146 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/code.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js +19 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/id.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js +29 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js +138 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/core/ref.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js +119 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js +21 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/discriminator/types.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js +36 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/draft7.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js +96 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/format.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js +17 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/format/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js +30 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/metadata.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js +39 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/const.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js +59 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/enum.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js +62 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/index.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js +35 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitItems.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js +42 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitLength.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js +38 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitNumber.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js +35 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/limitProperties.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js +34 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/multipleOf.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js +36 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/pattern.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js +92 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/required.js.map +1 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js +79 -0
- package/dist/node_modules/.pnpm/ajv@8.17.1/node_modules/ajv/dist/vocabularies/validation/uniqueItems.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/index.js +267 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/index.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/schemes.js +152 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/schemes.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/scopedChars.js +40 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/scopedChars.js.map +1 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/utils.js +236 -0
- package/dist/node_modules/.pnpm/fast-uri@3.0.2/node_modules/fast-uri/lib/utils.js.map +1 -0
- package/dist/node_modules/.pnpm/{json-schema-traverse@0.4.1 → json-schema-traverse@1.0.0}/node_modules/json-schema-traverse/index.js +7 -3
- package/dist/node_modules/.pnpm/json-schema-traverse@1.0.0/node_modules/json-schema-traverse/index.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Options.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +1 -0
- package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/array.js +2 -2
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +1 -0
- package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/record.js +2 -2
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +1 -0
- package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/selectParser.js +2 -2
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +1 -0
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.25.0_zod@4.1.13/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/ZodError.js +126 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/ZodError.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/errors.js +18 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/errorUtil.js +17 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/errorUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/parseUtil.js +130 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/parseUtil.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/util.js +147 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/helpers/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/locales/en.js +114 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/locales/en.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/types.js +3169 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v3/types.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/errors.js +53 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/iso.js +52 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/iso.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/parse.js +38 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/parse.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/schemas.js +686 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/classic/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/api.js +542 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/api.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js +414 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/checks.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/core.js +82 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/core.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/doc.js +46 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/doc.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/errors.js +81 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/errors.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/parse.js +108 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/parse.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/regexes.js +94 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/regexes.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/registries.js +63 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/registries.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js +1391 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/schemas.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/to-json-schema.js +782 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/to-json-schema.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js +419 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/util.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/versions.js +17 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/core/versions.js.map +1 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/mini/schemas.js +61 -0
- package/dist/node_modules/.pnpm/zod@4.1.13/node_modules/zod/v4/mini/schemas.js.map +1 -0
- package/dist/sentry-config.js +2 -2
- package/dist/server/cli/help.js +3 -1
- package/dist/server/cli/help.js.map +1 -1
- package/dist/server/cli/mcp.js +3 -3
- package/dist/server/cli/run.d.ts +1 -1
- package/dist/server/cli/run.js +25 -16
- package/dist/server/cli/run.js.map +1 -1
- package/dist/server/cli/server.d.ts +1 -1
- package/dist/server/cli/server.js +9 -3
- package/dist/server/cli/server.js.map +1 -1
- package/dist/server/cli.d.ts +1 -0
- package/dist/server/cli.js +10 -4
- package/dist/server/cli.js.map +1 -1
- package/dist/server/formatters/human/utils.js +9 -4
- package/dist/server/formatters/human/utils.js.map +1 -1
- package/dist/server/formatters/md/errors.d.ts +1 -1
- package/dist/server/formatters/md/errors.js.map +1 -1
- package/dist/server/formatters/md/event.d.ts +1 -1
- package/dist/server/formatters/md/event.js.map +1 -1
- package/dist/server/formatters/schema.d.ts +39 -39
- package/dist/server/mcp/mcp.d.ts +1 -1
- package/dist/server/mcp/mcp.js +14 -13
- package/dist/server/mcp/mcp.js.map +1 -1
- package/dist/server/routes/clear.js +2 -1
- package/dist/server/routes/clear.js.map +1 -1
- package/dist/server/routes/stream/index.js +3 -2
- package/dist/server/routes/stream/index.js.map +1 -1
- package/dist/server/types/cli.d.ts +1 -0
- package/dist/server/utils/docker-compose.d.ts +24 -0
- package/dist/server/utils/docker-compose.js +142 -37
- package/dist/server/utils/docker-compose.js.map +1 -1
- package/dist/server/utils/extras.d.ts +2 -0
- package/dist/server/utils/extras.js +29 -2
- package/dist/server/utils/extras.js.map +1 -1
- package/dist/ui/assets/index.js +64 -64
- package/dist/ui/assets/index.js.map +1 -1
- package/dist/ui/assets/instrumentation.js +2 -2
- package/dist/ui/assets/main.css +1 -1
- package/dist/ui/assets/main.js +1 -1
- package/package.json +12 -9
- package/dist/_virtual/cache.js.map +0 -1
- package/dist/_virtual/uri.all.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js +0 -241
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/client/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js +0 -64
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/completable.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js +0 -196
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/index.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/mcp.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/server/stdio.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js +0 -391
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/protocol.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/shared/stdio.js.map +0 -1
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js +0 -1045
- package/dist/node_modules/.pnpm/@modelcontextprotocol_sdk@1.16.0/node_modules/@modelcontextprotocol/sdk/dist/esm/types.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js +0 -365
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/ajv.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js +0 -30
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/cache.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js +0 -74
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/async.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js +0 -37
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/error_classes.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js +0 -119
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/formats.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js +0 -288
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/index.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js +0 -228
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/resolve.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js +0 -101
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/rules.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js +0 -19
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/schema_obj.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/ucs2length.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js +0 -192
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/compile/util.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js +0 -57
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/data.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js +0 -48
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/definition_schema.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js +0 -160
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limit.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js +0 -90
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitItems.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js +0 -95
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitLength.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js +0 -90
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/_limitProperties.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js +0 -52
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/allOf.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js +0 -83
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/anyOf.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js +0 -26
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/comment.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js +0 -63
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/const.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js +0 -88
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/contains.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js +0 -230
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/custom.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js +0 -171
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/dependencies.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js +0 -72
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/enum.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js +0 -157
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/format.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js +0 -110
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/if.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js +0 -67
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/index.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js +0 -147
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/items.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js +0 -90
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/multipleOf.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js +0 -95
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/not.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js +0 -81
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/oneOf.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js +0 -85
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/pattern.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js +0 -322
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/properties.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js +0 -84
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/propertyNames.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js +0 -134
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/ref.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/required.js +0 -263
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/required.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js +0 -95
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/uniqueItems.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js +0 -464
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/dotjs/validate.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js +0 -108
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/keyword.js.map +0 -1
- package/dist/node_modules/.pnpm/ajv@6.12.6/node_modules/ajv/lib/refs/data.json.js.map +0 -1
- package/dist/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js +0 -62
- package/dist/node_modules/.pnpm/fast-json-stable-stringify@2.1.0/node_modules/fast-json-stable-stringify/index.js.map +0 -1
- package/dist/node_modules/.pnpm/json-schema-traverse@0.4.1/node_modules/json-schema-traverse/index.js.map +0 -1
- package/dist/node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js +0 -1035
- package/dist/node_modules/.pnpm/uri-js@4.4.1/node_modules/uri-js/dist/es5/uri.all.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Options.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/Refs.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/errorMessages.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parseDef.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/any.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/array.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/date.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/default.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/map.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/never.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/null.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/number.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/object.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/record.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/set.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/string.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/union.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/selectParser.js.map +0 -1
- package/dist/node_modules/.pnpm/zod-to-json-schema@3.24.6_zod@3.25.76/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js.map +0 -1
- /package/dist/node_modules/.pnpm/{ajv@6.12.6/node_modules/ajv/lib → ajv@8.17.1/node_modules/ajv/dist}/refs/json-schema-draft-07.json.js.map +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/Options.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/Refs.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/errorMessages.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/getRelativePath.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parseDef.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/any.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/bigint.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/boolean.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/branded.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/catch.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/date.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/default.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/effects.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/enum.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/intersection.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/literal.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/map.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/nativeEnum.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/never.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/null.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/nullable.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/number.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/object.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/optional.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/pipeline.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/promise.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/readonly.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/set.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/string.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/tuple.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/undefined.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/union.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/parsers/unknown.js +0 -0
- /package/dist/node_modules/.pnpm/{zod-to-json-schema@3.24.6_zod@3.25.76 → zod-to-json-schema@3.25.0_zod@4.1.13}/node_modules/zod-to-json-schema/dist/esm/zodToJsonSchema.js +0 -0
|
@@ -0,0 +1,3169 @@
|
|
|
1
|
+
;
|
|
2
|
+
!function() {
|
|
3
|
+
try {
|
|
4
|
+
var e = "undefined" != typeof window ? window : "undefined" != typeof global ? global : "undefined" != typeof globalThis ? globalThis : "undefined" != typeof self ? self : {}, n = new e.Error().stack;
|
|
5
|
+
n && (e._sentryDebugIds = e._sentryDebugIds || {}, e._sentryDebugIds[n] = "b9c25655-1041-40bb-bc15-30b0ee004383", e._sentryDebugIdIdentifier = "sentry-dbid-b9c25655-1041-40bb-bc15-30b0ee004383");
|
|
6
|
+
} catch (e2) {
|
|
7
|
+
}
|
|
8
|
+
}();
|
|
9
|
+
import { ZodError, ZodIssueCode } from "./ZodError.js";
|
|
10
|
+
import { util, ZodParsedType, getParsedType } from "./helpers/util.js";
|
|
11
|
+
import { errorUtil } from "./helpers/errorUtil.js";
|
|
12
|
+
import { addIssueToContext, INVALID, ParseStatus, isAsync, isValid, OK, DIRTY, isAborted, isDirty } from "./helpers/parseUtil.js";
|
|
13
|
+
class ParseInputLazyPath {
|
|
14
|
+
constructor(parent, value, path, key) {
|
|
15
|
+
this._cachedPath = [];
|
|
16
|
+
this.parent = parent;
|
|
17
|
+
this.data = value;
|
|
18
|
+
this._path = path;
|
|
19
|
+
this._key = key;
|
|
20
|
+
}
|
|
21
|
+
get path() {
|
|
22
|
+
if (!this._cachedPath.length) {
|
|
23
|
+
if (Array.isArray(this._key)) {
|
|
24
|
+
this._cachedPath.push(...this._path, ...this._key);
|
|
25
|
+
} else {
|
|
26
|
+
this._cachedPath.push(...this._path, this._key);
|
|
27
|
+
}
|
|
28
|
+
}
|
|
29
|
+
return this._cachedPath;
|
|
30
|
+
}
|
|
31
|
+
}
|
|
32
|
+
const handleResult = (ctx, result) => {
|
|
33
|
+
if (isValid(result)) {
|
|
34
|
+
return { success: true, data: result.value };
|
|
35
|
+
} else {
|
|
36
|
+
if (!ctx.common.issues.length) {
|
|
37
|
+
throw new Error("Validation failed but no issues detected.");
|
|
38
|
+
}
|
|
39
|
+
return {
|
|
40
|
+
success: false,
|
|
41
|
+
get error() {
|
|
42
|
+
if (this._error)
|
|
43
|
+
return this._error;
|
|
44
|
+
const error = new ZodError(ctx.common.issues);
|
|
45
|
+
this._error = error;
|
|
46
|
+
return this._error;
|
|
47
|
+
}
|
|
48
|
+
};
|
|
49
|
+
}
|
|
50
|
+
};
|
|
51
|
+
function processCreateParams(params) {
|
|
52
|
+
if (!params)
|
|
53
|
+
return {};
|
|
54
|
+
const { errorMap, invalid_type_error, required_error, description } = params;
|
|
55
|
+
if (errorMap && (invalid_type_error || required_error)) {
|
|
56
|
+
throw new Error(`Can't use "invalid_type_error" or "required_error" in conjunction with custom error map.`);
|
|
57
|
+
}
|
|
58
|
+
if (errorMap)
|
|
59
|
+
return { errorMap, description };
|
|
60
|
+
const customMap = (iss, ctx) => {
|
|
61
|
+
const { message } = params;
|
|
62
|
+
if (iss.code === "invalid_enum_value") {
|
|
63
|
+
return { message: message ?? ctx.defaultError };
|
|
64
|
+
}
|
|
65
|
+
if (typeof ctx.data === "undefined") {
|
|
66
|
+
return { message: message ?? required_error ?? ctx.defaultError };
|
|
67
|
+
}
|
|
68
|
+
if (iss.code !== "invalid_type")
|
|
69
|
+
return { message: ctx.defaultError };
|
|
70
|
+
return { message: message ?? invalid_type_error ?? ctx.defaultError };
|
|
71
|
+
};
|
|
72
|
+
return { errorMap: customMap, description };
|
|
73
|
+
}
|
|
74
|
+
class ZodType {
|
|
75
|
+
get description() {
|
|
76
|
+
return this._def.description;
|
|
77
|
+
}
|
|
78
|
+
_getType(input) {
|
|
79
|
+
return getParsedType(input.data);
|
|
80
|
+
}
|
|
81
|
+
_getOrReturnCtx(input, ctx) {
|
|
82
|
+
return ctx || {
|
|
83
|
+
common: input.parent.common,
|
|
84
|
+
data: input.data,
|
|
85
|
+
parsedType: getParsedType(input.data),
|
|
86
|
+
schemaErrorMap: this._def.errorMap,
|
|
87
|
+
path: input.path,
|
|
88
|
+
parent: input.parent
|
|
89
|
+
};
|
|
90
|
+
}
|
|
91
|
+
_processInputParams(input) {
|
|
92
|
+
return {
|
|
93
|
+
status: new ParseStatus(),
|
|
94
|
+
ctx: {
|
|
95
|
+
common: input.parent.common,
|
|
96
|
+
data: input.data,
|
|
97
|
+
parsedType: getParsedType(input.data),
|
|
98
|
+
schemaErrorMap: this._def.errorMap,
|
|
99
|
+
path: input.path,
|
|
100
|
+
parent: input.parent
|
|
101
|
+
}
|
|
102
|
+
};
|
|
103
|
+
}
|
|
104
|
+
_parseSync(input) {
|
|
105
|
+
const result = this._parse(input);
|
|
106
|
+
if (isAsync(result)) {
|
|
107
|
+
throw new Error("Synchronous parse encountered promise.");
|
|
108
|
+
}
|
|
109
|
+
return result;
|
|
110
|
+
}
|
|
111
|
+
_parseAsync(input) {
|
|
112
|
+
const result = this._parse(input);
|
|
113
|
+
return Promise.resolve(result);
|
|
114
|
+
}
|
|
115
|
+
parse(data, params) {
|
|
116
|
+
const result = this.safeParse(data, params);
|
|
117
|
+
if (result.success)
|
|
118
|
+
return result.data;
|
|
119
|
+
throw result.error;
|
|
120
|
+
}
|
|
121
|
+
safeParse(data, params) {
|
|
122
|
+
const ctx = {
|
|
123
|
+
common: {
|
|
124
|
+
issues: [],
|
|
125
|
+
async: params?.async ?? false,
|
|
126
|
+
contextualErrorMap: params?.errorMap
|
|
127
|
+
},
|
|
128
|
+
path: params?.path || [],
|
|
129
|
+
schemaErrorMap: this._def.errorMap,
|
|
130
|
+
parent: null,
|
|
131
|
+
data,
|
|
132
|
+
parsedType: getParsedType(data)
|
|
133
|
+
};
|
|
134
|
+
const result = this._parseSync({ data, path: ctx.path, parent: ctx });
|
|
135
|
+
return handleResult(ctx, result);
|
|
136
|
+
}
|
|
137
|
+
"~validate"(data) {
|
|
138
|
+
const ctx = {
|
|
139
|
+
common: {
|
|
140
|
+
issues: [],
|
|
141
|
+
async: !!this["~standard"].async
|
|
142
|
+
},
|
|
143
|
+
path: [],
|
|
144
|
+
schemaErrorMap: this._def.errorMap,
|
|
145
|
+
parent: null,
|
|
146
|
+
data,
|
|
147
|
+
parsedType: getParsedType(data)
|
|
148
|
+
};
|
|
149
|
+
if (!this["~standard"].async) {
|
|
150
|
+
try {
|
|
151
|
+
const result = this._parseSync({ data, path: [], parent: ctx });
|
|
152
|
+
return isValid(result) ? {
|
|
153
|
+
value: result.value
|
|
154
|
+
} : {
|
|
155
|
+
issues: ctx.common.issues
|
|
156
|
+
};
|
|
157
|
+
} catch (err) {
|
|
158
|
+
if (err?.message?.toLowerCase()?.includes("encountered")) {
|
|
159
|
+
this["~standard"].async = true;
|
|
160
|
+
}
|
|
161
|
+
ctx.common = {
|
|
162
|
+
issues: [],
|
|
163
|
+
async: true
|
|
164
|
+
};
|
|
165
|
+
}
|
|
166
|
+
}
|
|
167
|
+
return this._parseAsync({ data, path: [], parent: ctx }).then((result) => isValid(result) ? {
|
|
168
|
+
value: result.value
|
|
169
|
+
} : {
|
|
170
|
+
issues: ctx.common.issues
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
async parseAsync(data, params) {
|
|
174
|
+
const result = await this.safeParseAsync(data, params);
|
|
175
|
+
if (result.success)
|
|
176
|
+
return result.data;
|
|
177
|
+
throw result.error;
|
|
178
|
+
}
|
|
179
|
+
async safeParseAsync(data, params) {
|
|
180
|
+
const ctx = {
|
|
181
|
+
common: {
|
|
182
|
+
issues: [],
|
|
183
|
+
contextualErrorMap: params?.errorMap,
|
|
184
|
+
async: true
|
|
185
|
+
},
|
|
186
|
+
path: params?.path || [],
|
|
187
|
+
schemaErrorMap: this._def.errorMap,
|
|
188
|
+
parent: null,
|
|
189
|
+
data,
|
|
190
|
+
parsedType: getParsedType(data)
|
|
191
|
+
};
|
|
192
|
+
const maybeAsyncResult = this._parse({ data, path: ctx.path, parent: ctx });
|
|
193
|
+
const result = await (isAsync(maybeAsyncResult) ? maybeAsyncResult : Promise.resolve(maybeAsyncResult));
|
|
194
|
+
return handleResult(ctx, result);
|
|
195
|
+
}
|
|
196
|
+
refine(check, message) {
|
|
197
|
+
const getIssueProperties = (val) => {
|
|
198
|
+
if (typeof message === "string" || typeof message === "undefined") {
|
|
199
|
+
return { message };
|
|
200
|
+
} else if (typeof message === "function") {
|
|
201
|
+
return message(val);
|
|
202
|
+
} else {
|
|
203
|
+
return message;
|
|
204
|
+
}
|
|
205
|
+
};
|
|
206
|
+
return this._refinement((val, ctx) => {
|
|
207
|
+
const result = check(val);
|
|
208
|
+
const setError = () => ctx.addIssue({
|
|
209
|
+
code: ZodIssueCode.custom,
|
|
210
|
+
...getIssueProperties(val)
|
|
211
|
+
});
|
|
212
|
+
if (typeof Promise !== "undefined" && result instanceof Promise) {
|
|
213
|
+
return result.then((data) => {
|
|
214
|
+
if (!data) {
|
|
215
|
+
setError();
|
|
216
|
+
return false;
|
|
217
|
+
} else {
|
|
218
|
+
return true;
|
|
219
|
+
}
|
|
220
|
+
});
|
|
221
|
+
}
|
|
222
|
+
if (!result) {
|
|
223
|
+
setError();
|
|
224
|
+
return false;
|
|
225
|
+
} else {
|
|
226
|
+
return true;
|
|
227
|
+
}
|
|
228
|
+
});
|
|
229
|
+
}
|
|
230
|
+
refinement(check, refinementData) {
|
|
231
|
+
return this._refinement((val, ctx) => {
|
|
232
|
+
if (!check(val)) {
|
|
233
|
+
ctx.addIssue(typeof refinementData === "function" ? refinementData(val, ctx) : refinementData);
|
|
234
|
+
return false;
|
|
235
|
+
} else {
|
|
236
|
+
return true;
|
|
237
|
+
}
|
|
238
|
+
});
|
|
239
|
+
}
|
|
240
|
+
_refinement(refinement) {
|
|
241
|
+
return new ZodEffects({
|
|
242
|
+
schema: this,
|
|
243
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
244
|
+
effect: { type: "refinement", refinement }
|
|
245
|
+
});
|
|
246
|
+
}
|
|
247
|
+
superRefine(refinement) {
|
|
248
|
+
return this._refinement(refinement);
|
|
249
|
+
}
|
|
250
|
+
constructor(def) {
|
|
251
|
+
this.spa = this.safeParseAsync;
|
|
252
|
+
this._def = def;
|
|
253
|
+
this.parse = this.parse.bind(this);
|
|
254
|
+
this.safeParse = this.safeParse.bind(this);
|
|
255
|
+
this.parseAsync = this.parseAsync.bind(this);
|
|
256
|
+
this.safeParseAsync = this.safeParseAsync.bind(this);
|
|
257
|
+
this.spa = this.spa.bind(this);
|
|
258
|
+
this.refine = this.refine.bind(this);
|
|
259
|
+
this.refinement = this.refinement.bind(this);
|
|
260
|
+
this.superRefine = this.superRefine.bind(this);
|
|
261
|
+
this.optional = this.optional.bind(this);
|
|
262
|
+
this.nullable = this.nullable.bind(this);
|
|
263
|
+
this.nullish = this.nullish.bind(this);
|
|
264
|
+
this.array = this.array.bind(this);
|
|
265
|
+
this.promise = this.promise.bind(this);
|
|
266
|
+
this.or = this.or.bind(this);
|
|
267
|
+
this.and = this.and.bind(this);
|
|
268
|
+
this.transform = this.transform.bind(this);
|
|
269
|
+
this.brand = this.brand.bind(this);
|
|
270
|
+
this.default = this.default.bind(this);
|
|
271
|
+
this.catch = this.catch.bind(this);
|
|
272
|
+
this.describe = this.describe.bind(this);
|
|
273
|
+
this.pipe = this.pipe.bind(this);
|
|
274
|
+
this.readonly = this.readonly.bind(this);
|
|
275
|
+
this.isNullable = this.isNullable.bind(this);
|
|
276
|
+
this.isOptional = this.isOptional.bind(this);
|
|
277
|
+
this["~standard"] = {
|
|
278
|
+
version: 1,
|
|
279
|
+
vendor: "zod",
|
|
280
|
+
validate: (data) => this["~validate"](data)
|
|
281
|
+
};
|
|
282
|
+
}
|
|
283
|
+
optional() {
|
|
284
|
+
return ZodOptional.create(this, this._def);
|
|
285
|
+
}
|
|
286
|
+
nullable() {
|
|
287
|
+
return ZodNullable.create(this, this._def);
|
|
288
|
+
}
|
|
289
|
+
nullish() {
|
|
290
|
+
return this.nullable().optional();
|
|
291
|
+
}
|
|
292
|
+
array() {
|
|
293
|
+
return ZodArray.create(this);
|
|
294
|
+
}
|
|
295
|
+
promise() {
|
|
296
|
+
return ZodPromise.create(this, this._def);
|
|
297
|
+
}
|
|
298
|
+
or(option) {
|
|
299
|
+
return ZodUnion.create([this, option], this._def);
|
|
300
|
+
}
|
|
301
|
+
and(incoming) {
|
|
302
|
+
return ZodIntersection.create(this, incoming, this._def);
|
|
303
|
+
}
|
|
304
|
+
transform(transform) {
|
|
305
|
+
return new ZodEffects({
|
|
306
|
+
...processCreateParams(this._def),
|
|
307
|
+
schema: this,
|
|
308
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
309
|
+
effect: { type: "transform", transform }
|
|
310
|
+
});
|
|
311
|
+
}
|
|
312
|
+
default(def) {
|
|
313
|
+
const defaultValueFunc = typeof def === "function" ? def : () => def;
|
|
314
|
+
return new ZodDefault({
|
|
315
|
+
...processCreateParams(this._def),
|
|
316
|
+
innerType: this,
|
|
317
|
+
defaultValue: defaultValueFunc,
|
|
318
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault
|
|
319
|
+
});
|
|
320
|
+
}
|
|
321
|
+
brand() {
|
|
322
|
+
return new ZodBranded({
|
|
323
|
+
typeName: ZodFirstPartyTypeKind.ZodBranded,
|
|
324
|
+
type: this,
|
|
325
|
+
...processCreateParams(this._def)
|
|
326
|
+
});
|
|
327
|
+
}
|
|
328
|
+
catch(def) {
|
|
329
|
+
const catchValueFunc = typeof def === "function" ? def : () => def;
|
|
330
|
+
return new ZodCatch({
|
|
331
|
+
...processCreateParams(this._def),
|
|
332
|
+
innerType: this,
|
|
333
|
+
catchValue: catchValueFunc,
|
|
334
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch
|
|
335
|
+
});
|
|
336
|
+
}
|
|
337
|
+
describe(description) {
|
|
338
|
+
const This = this.constructor;
|
|
339
|
+
return new This({
|
|
340
|
+
...this._def,
|
|
341
|
+
description
|
|
342
|
+
});
|
|
343
|
+
}
|
|
344
|
+
pipe(target) {
|
|
345
|
+
return ZodPipeline.create(this, target);
|
|
346
|
+
}
|
|
347
|
+
readonly() {
|
|
348
|
+
return ZodReadonly.create(this);
|
|
349
|
+
}
|
|
350
|
+
isOptional() {
|
|
351
|
+
return this.safeParse(void 0).success;
|
|
352
|
+
}
|
|
353
|
+
isNullable() {
|
|
354
|
+
return this.safeParse(null).success;
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
const cuidRegex = /^c[^\s-]{8,}$/i;
|
|
358
|
+
const cuid2Regex = /^[0-9a-z]+$/;
|
|
359
|
+
const ulidRegex = /^[0-9A-HJKMNP-TV-Z]{26}$/i;
|
|
360
|
+
const uuidRegex = /^[0-9a-fA-F]{8}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{4}\b-[0-9a-fA-F]{12}$/i;
|
|
361
|
+
const nanoidRegex = /^[a-z0-9_-]{21}$/i;
|
|
362
|
+
const jwtRegex = /^[A-Za-z0-9-_]+\.[A-Za-z0-9-_]+\.[A-Za-z0-9-_]*$/;
|
|
363
|
+
const durationRegex = /^[-+]?P(?!$)(?:(?:[-+]?\d+Y)|(?:[-+]?\d+[.,]\d+Y$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:(?:[-+]?\d+W)|(?:[-+]?\d+[.,]\d+W$))?(?:(?:[-+]?\d+D)|(?:[-+]?\d+[.,]\d+D$))?(?:T(?=[\d+-])(?:(?:[-+]?\d+H)|(?:[-+]?\d+[.,]\d+H$))?(?:(?:[-+]?\d+M)|(?:[-+]?\d+[.,]\d+M$))?(?:[-+]?\d+(?:[.,]\d+)?S)?)??$/;
|
|
364
|
+
const emailRegex = /^(?!\.)(?!.*\.\.)([A-Z0-9_'+\-\.]*)[A-Z0-9_+-]@([A-Z0-9][A-Z0-9\-]*\.)+[A-Z]{2,}$/i;
|
|
365
|
+
const _emojiRegex = `^(\\p{Extended_Pictographic}|\\p{Emoji_Component})+$`;
|
|
366
|
+
let emojiRegex;
|
|
367
|
+
const ipv4Regex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])$/;
|
|
368
|
+
const ipv4CidrRegex = /^(?:(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\.){3}(?:25[0-5]|2[0-4][0-9]|1[0-9][0-9]|[1-9][0-9]|[0-9])\/(3[0-2]|[12]?[0-9])$/;
|
|
369
|
+
const ipv6Regex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))$/;
|
|
370
|
+
const ipv6CidrRegex = /^(([0-9a-fA-F]{1,4}:){7,7}[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,7}:|([0-9a-fA-F]{1,4}:){1,6}:[0-9a-fA-F]{1,4}|([0-9a-fA-F]{1,4}:){1,5}(:[0-9a-fA-F]{1,4}){1,2}|([0-9a-fA-F]{1,4}:){1,4}(:[0-9a-fA-F]{1,4}){1,3}|([0-9a-fA-F]{1,4}:){1,3}(:[0-9a-fA-F]{1,4}){1,4}|([0-9a-fA-F]{1,4}:){1,2}(:[0-9a-fA-F]{1,4}){1,5}|[0-9a-fA-F]{1,4}:((:[0-9a-fA-F]{1,4}){1,6})|:((:[0-9a-fA-F]{1,4}){1,7}|:)|fe80:(:[0-9a-fA-F]{0,4}){0,4}%[0-9a-zA-Z]{1,}|::(ffff(:0{1,4}){0,1}:){0,1}((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])|([0-9a-fA-F]{1,4}:){1,4}:((25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9])\.){3,3}(25[0-5]|(2[0-4]|1{0,1}[0-9]){0,1}[0-9]))\/(12[0-8]|1[01][0-9]|[1-9]?[0-9])$/;
|
|
371
|
+
const base64Regex = /^([0-9a-zA-Z+/]{4})*(([0-9a-zA-Z+/]{2}==)|([0-9a-zA-Z+/]{3}=))?$/;
|
|
372
|
+
const base64urlRegex = /^([0-9a-zA-Z-_]{4})*(([0-9a-zA-Z-_]{2}(==)?)|([0-9a-zA-Z-_]{3}(=)?))?$/;
|
|
373
|
+
const dateRegexSource = `((\\d\\d[2468][048]|\\d\\d[13579][26]|\\d\\d0[48]|[02468][048]00|[13579][26]00)-02-29|\\d{4}-((0[13578]|1[02])-(0[1-9]|[12]\\d|3[01])|(0[469]|11)-(0[1-9]|[12]\\d|30)|(02)-(0[1-9]|1\\d|2[0-8])))`;
|
|
374
|
+
const dateRegex = new RegExp(`^${dateRegexSource}$`);
|
|
375
|
+
function timeRegexSource(args) {
|
|
376
|
+
let secondsRegexSource = `[0-5]\\d`;
|
|
377
|
+
if (args.precision) {
|
|
378
|
+
secondsRegexSource = `${secondsRegexSource}\\.\\d{${args.precision}}`;
|
|
379
|
+
} else if (args.precision == null) {
|
|
380
|
+
secondsRegexSource = `${secondsRegexSource}(\\.\\d+)?`;
|
|
381
|
+
}
|
|
382
|
+
const secondsQuantifier = args.precision ? "+" : "?";
|
|
383
|
+
return `([01]\\d|2[0-3]):[0-5]\\d(:${secondsRegexSource})${secondsQuantifier}`;
|
|
384
|
+
}
|
|
385
|
+
function timeRegex(args) {
|
|
386
|
+
return new RegExp(`^${timeRegexSource(args)}$`);
|
|
387
|
+
}
|
|
388
|
+
function datetimeRegex(args) {
|
|
389
|
+
let regex = `${dateRegexSource}T${timeRegexSource(args)}`;
|
|
390
|
+
const opts = [];
|
|
391
|
+
opts.push(args.local ? `Z?` : `Z`);
|
|
392
|
+
if (args.offset)
|
|
393
|
+
opts.push(`([+-]\\d{2}:?\\d{2})`);
|
|
394
|
+
regex = `${regex}(${opts.join("|")})`;
|
|
395
|
+
return new RegExp(`^${regex}$`);
|
|
396
|
+
}
|
|
397
|
+
function isValidIP(ip, version) {
|
|
398
|
+
if ((version === "v4" || !version) && ipv4Regex.test(ip)) {
|
|
399
|
+
return true;
|
|
400
|
+
}
|
|
401
|
+
if ((version === "v6" || !version) && ipv6Regex.test(ip)) {
|
|
402
|
+
return true;
|
|
403
|
+
}
|
|
404
|
+
return false;
|
|
405
|
+
}
|
|
406
|
+
function isValidJWT(jwt, alg) {
|
|
407
|
+
if (!jwtRegex.test(jwt))
|
|
408
|
+
return false;
|
|
409
|
+
try {
|
|
410
|
+
const [header] = jwt.split(".");
|
|
411
|
+
if (!header)
|
|
412
|
+
return false;
|
|
413
|
+
const base64 = header.replace(/-/g, "+").replace(/_/g, "/").padEnd(header.length + (4 - header.length % 4) % 4, "=");
|
|
414
|
+
const decoded = JSON.parse(atob(base64));
|
|
415
|
+
if (typeof decoded !== "object" || decoded === null)
|
|
416
|
+
return false;
|
|
417
|
+
if ("typ" in decoded && decoded?.typ !== "JWT")
|
|
418
|
+
return false;
|
|
419
|
+
if (!decoded.alg)
|
|
420
|
+
return false;
|
|
421
|
+
if (alg && decoded.alg !== alg)
|
|
422
|
+
return false;
|
|
423
|
+
return true;
|
|
424
|
+
} catch {
|
|
425
|
+
return false;
|
|
426
|
+
}
|
|
427
|
+
}
|
|
428
|
+
function isValidCidr(ip, version) {
|
|
429
|
+
if ((version === "v4" || !version) && ipv4CidrRegex.test(ip)) {
|
|
430
|
+
return true;
|
|
431
|
+
}
|
|
432
|
+
if ((version === "v6" || !version) && ipv6CidrRegex.test(ip)) {
|
|
433
|
+
return true;
|
|
434
|
+
}
|
|
435
|
+
return false;
|
|
436
|
+
}
|
|
437
|
+
class ZodString extends ZodType {
|
|
438
|
+
_parse(input) {
|
|
439
|
+
if (this._def.coerce) {
|
|
440
|
+
input.data = String(input.data);
|
|
441
|
+
}
|
|
442
|
+
const parsedType = this._getType(input);
|
|
443
|
+
if (parsedType !== ZodParsedType.string) {
|
|
444
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
445
|
+
addIssueToContext(ctx2, {
|
|
446
|
+
code: ZodIssueCode.invalid_type,
|
|
447
|
+
expected: ZodParsedType.string,
|
|
448
|
+
received: ctx2.parsedType
|
|
449
|
+
});
|
|
450
|
+
return INVALID;
|
|
451
|
+
}
|
|
452
|
+
const status = new ParseStatus();
|
|
453
|
+
let ctx = void 0;
|
|
454
|
+
for (const check of this._def.checks) {
|
|
455
|
+
if (check.kind === "min") {
|
|
456
|
+
if (input.data.length < check.value) {
|
|
457
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
458
|
+
addIssueToContext(ctx, {
|
|
459
|
+
code: ZodIssueCode.too_small,
|
|
460
|
+
minimum: check.value,
|
|
461
|
+
type: "string",
|
|
462
|
+
inclusive: true,
|
|
463
|
+
exact: false,
|
|
464
|
+
message: check.message
|
|
465
|
+
});
|
|
466
|
+
status.dirty();
|
|
467
|
+
}
|
|
468
|
+
} else if (check.kind === "max") {
|
|
469
|
+
if (input.data.length > check.value) {
|
|
470
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
471
|
+
addIssueToContext(ctx, {
|
|
472
|
+
code: ZodIssueCode.too_big,
|
|
473
|
+
maximum: check.value,
|
|
474
|
+
type: "string",
|
|
475
|
+
inclusive: true,
|
|
476
|
+
exact: false,
|
|
477
|
+
message: check.message
|
|
478
|
+
});
|
|
479
|
+
status.dirty();
|
|
480
|
+
}
|
|
481
|
+
} else if (check.kind === "length") {
|
|
482
|
+
const tooBig = input.data.length > check.value;
|
|
483
|
+
const tooSmall = input.data.length < check.value;
|
|
484
|
+
if (tooBig || tooSmall) {
|
|
485
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
486
|
+
if (tooBig) {
|
|
487
|
+
addIssueToContext(ctx, {
|
|
488
|
+
code: ZodIssueCode.too_big,
|
|
489
|
+
maximum: check.value,
|
|
490
|
+
type: "string",
|
|
491
|
+
inclusive: true,
|
|
492
|
+
exact: true,
|
|
493
|
+
message: check.message
|
|
494
|
+
});
|
|
495
|
+
} else if (tooSmall) {
|
|
496
|
+
addIssueToContext(ctx, {
|
|
497
|
+
code: ZodIssueCode.too_small,
|
|
498
|
+
minimum: check.value,
|
|
499
|
+
type: "string",
|
|
500
|
+
inclusive: true,
|
|
501
|
+
exact: true,
|
|
502
|
+
message: check.message
|
|
503
|
+
});
|
|
504
|
+
}
|
|
505
|
+
status.dirty();
|
|
506
|
+
}
|
|
507
|
+
} else if (check.kind === "email") {
|
|
508
|
+
if (!emailRegex.test(input.data)) {
|
|
509
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
510
|
+
addIssueToContext(ctx, {
|
|
511
|
+
validation: "email",
|
|
512
|
+
code: ZodIssueCode.invalid_string,
|
|
513
|
+
message: check.message
|
|
514
|
+
});
|
|
515
|
+
status.dirty();
|
|
516
|
+
}
|
|
517
|
+
} else if (check.kind === "emoji") {
|
|
518
|
+
if (!emojiRegex) {
|
|
519
|
+
emojiRegex = new RegExp(_emojiRegex, "u");
|
|
520
|
+
}
|
|
521
|
+
if (!emojiRegex.test(input.data)) {
|
|
522
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
523
|
+
addIssueToContext(ctx, {
|
|
524
|
+
validation: "emoji",
|
|
525
|
+
code: ZodIssueCode.invalid_string,
|
|
526
|
+
message: check.message
|
|
527
|
+
});
|
|
528
|
+
status.dirty();
|
|
529
|
+
}
|
|
530
|
+
} else if (check.kind === "uuid") {
|
|
531
|
+
if (!uuidRegex.test(input.data)) {
|
|
532
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
533
|
+
addIssueToContext(ctx, {
|
|
534
|
+
validation: "uuid",
|
|
535
|
+
code: ZodIssueCode.invalid_string,
|
|
536
|
+
message: check.message
|
|
537
|
+
});
|
|
538
|
+
status.dirty();
|
|
539
|
+
}
|
|
540
|
+
} else if (check.kind === "nanoid") {
|
|
541
|
+
if (!nanoidRegex.test(input.data)) {
|
|
542
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
543
|
+
addIssueToContext(ctx, {
|
|
544
|
+
validation: "nanoid",
|
|
545
|
+
code: ZodIssueCode.invalid_string,
|
|
546
|
+
message: check.message
|
|
547
|
+
});
|
|
548
|
+
status.dirty();
|
|
549
|
+
}
|
|
550
|
+
} else if (check.kind === "cuid") {
|
|
551
|
+
if (!cuidRegex.test(input.data)) {
|
|
552
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
553
|
+
addIssueToContext(ctx, {
|
|
554
|
+
validation: "cuid",
|
|
555
|
+
code: ZodIssueCode.invalid_string,
|
|
556
|
+
message: check.message
|
|
557
|
+
});
|
|
558
|
+
status.dirty();
|
|
559
|
+
}
|
|
560
|
+
} else if (check.kind === "cuid2") {
|
|
561
|
+
if (!cuid2Regex.test(input.data)) {
|
|
562
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
563
|
+
addIssueToContext(ctx, {
|
|
564
|
+
validation: "cuid2",
|
|
565
|
+
code: ZodIssueCode.invalid_string,
|
|
566
|
+
message: check.message
|
|
567
|
+
});
|
|
568
|
+
status.dirty();
|
|
569
|
+
}
|
|
570
|
+
} else if (check.kind === "ulid") {
|
|
571
|
+
if (!ulidRegex.test(input.data)) {
|
|
572
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
573
|
+
addIssueToContext(ctx, {
|
|
574
|
+
validation: "ulid",
|
|
575
|
+
code: ZodIssueCode.invalid_string,
|
|
576
|
+
message: check.message
|
|
577
|
+
});
|
|
578
|
+
status.dirty();
|
|
579
|
+
}
|
|
580
|
+
} else if (check.kind === "url") {
|
|
581
|
+
try {
|
|
582
|
+
new URL(input.data);
|
|
583
|
+
} catch {
|
|
584
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
585
|
+
addIssueToContext(ctx, {
|
|
586
|
+
validation: "url",
|
|
587
|
+
code: ZodIssueCode.invalid_string,
|
|
588
|
+
message: check.message
|
|
589
|
+
});
|
|
590
|
+
status.dirty();
|
|
591
|
+
}
|
|
592
|
+
} else if (check.kind === "regex") {
|
|
593
|
+
check.regex.lastIndex = 0;
|
|
594
|
+
const testResult = check.regex.test(input.data);
|
|
595
|
+
if (!testResult) {
|
|
596
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
597
|
+
addIssueToContext(ctx, {
|
|
598
|
+
validation: "regex",
|
|
599
|
+
code: ZodIssueCode.invalid_string,
|
|
600
|
+
message: check.message
|
|
601
|
+
});
|
|
602
|
+
status.dirty();
|
|
603
|
+
}
|
|
604
|
+
} else if (check.kind === "trim") {
|
|
605
|
+
input.data = input.data.trim();
|
|
606
|
+
} else if (check.kind === "includes") {
|
|
607
|
+
if (!input.data.includes(check.value, check.position)) {
|
|
608
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
609
|
+
addIssueToContext(ctx, {
|
|
610
|
+
code: ZodIssueCode.invalid_string,
|
|
611
|
+
validation: { includes: check.value, position: check.position },
|
|
612
|
+
message: check.message
|
|
613
|
+
});
|
|
614
|
+
status.dirty();
|
|
615
|
+
}
|
|
616
|
+
} else if (check.kind === "toLowerCase") {
|
|
617
|
+
input.data = input.data.toLowerCase();
|
|
618
|
+
} else if (check.kind === "toUpperCase") {
|
|
619
|
+
input.data = input.data.toUpperCase();
|
|
620
|
+
} else if (check.kind === "startsWith") {
|
|
621
|
+
if (!input.data.startsWith(check.value)) {
|
|
622
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
623
|
+
addIssueToContext(ctx, {
|
|
624
|
+
code: ZodIssueCode.invalid_string,
|
|
625
|
+
validation: { startsWith: check.value },
|
|
626
|
+
message: check.message
|
|
627
|
+
});
|
|
628
|
+
status.dirty();
|
|
629
|
+
}
|
|
630
|
+
} else if (check.kind === "endsWith") {
|
|
631
|
+
if (!input.data.endsWith(check.value)) {
|
|
632
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
633
|
+
addIssueToContext(ctx, {
|
|
634
|
+
code: ZodIssueCode.invalid_string,
|
|
635
|
+
validation: { endsWith: check.value },
|
|
636
|
+
message: check.message
|
|
637
|
+
});
|
|
638
|
+
status.dirty();
|
|
639
|
+
}
|
|
640
|
+
} else if (check.kind === "datetime") {
|
|
641
|
+
const regex = datetimeRegex(check);
|
|
642
|
+
if (!regex.test(input.data)) {
|
|
643
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
644
|
+
addIssueToContext(ctx, {
|
|
645
|
+
code: ZodIssueCode.invalid_string,
|
|
646
|
+
validation: "datetime",
|
|
647
|
+
message: check.message
|
|
648
|
+
});
|
|
649
|
+
status.dirty();
|
|
650
|
+
}
|
|
651
|
+
} else if (check.kind === "date") {
|
|
652
|
+
const regex = dateRegex;
|
|
653
|
+
if (!regex.test(input.data)) {
|
|
654
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
655
|
+
addIssueToContext(ctx, {
|
|
656
|
+
code: ZodIssueCode.invalid_string,
|
|
657
|
+
validation: "date",
|
|
658
|
+
message: check.message
|
|
659
|
+
});
|
|
660
|
+
status.dirty();
|
|
661
|
+
}
|
|
662
|
+
} else if (check.kind === "time") {
|
|
663
|
+
const regex = timeRegex(check);
|
|
664
|
+
if (!regex.test(input.data)) {
|
|
665
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
666
|
+
addIssueToContext(ctx, {
|
|
667
|
+
code: ZodIssueCode.invalid_string,
|
|
668
|
+
validation: "time",
|
|
669
|
+
message: check.message
|
|
670
|
+
});
|
|
671
|
+
status.dirty();
|
|
672
|
+
}
|
|
673
|
+
} else if (check.kind === "duration") {
|
|
674
|
+
if (!durationRegex.test(input.data)) {
|
|
675
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
676
|
+
addIssueToContext(ctx, {
|
|
677
|
+
validation: "duration",
|
|
678
|
+
code: ZodIssueCode.invalid_string,
|
|
679
|
+
message: check.message
|
|
680
|
+
});
|
|
681
|
+
status.dirty();
|
|
682
|
+
}
|
|
683
|
+
} else if (check.kind === "ip") {
|
|
684
|
+
if (!isValidIP(input.data, check.version)) {
|
|
685
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
686
|
+
addIssueToContext(ctx, {
|
|
687
|
+
validation: "ip",
|
|
688
|
+
code: ZodIssueCode.invalid_string,
|
|
689
|
+
message: check.message
|
|
690
|
+
});
|
|
691
|
+
status.dirty();
|
|
692
|
+
}
|
|
693
|
+
} else if (check.kind === "jwt") {
|
|
694
|
+
if (!isValidJWT(input.data, check.alg)) {
|
|
695
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
696
|
+
addIssueToContext(ctx, {
|
|
697
|
+
validation: "jwt",
|
|
698
|
+
code: ZodIssueCode.invalid_string,
|
|
699
|
+
message: check.message
|
|
700
|
+
});
|
|
701
|
+
status.dirty();
|
|
702
|
+
}
|
|
703
|
+
} else if (check.kind === "cidr") {
|
|
704
|
+
if (!isValidCidr(input.data, check.version)) {
|
|
705
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
706
|
+
addIssueToContext(ctx, {
|
|
707
|
+
validation: "cidr",
|
|
708
|
+
code: ZodIssueCode.invalid_string,
|
|
709
|
+
message: check.message
|
|
710
|
+
});
|
|
711
|
+
status.dirty();
|
|
712
|
+
}
|
|
713
|
+
} else if (check.kind === "base64") {
|
|
714
|
+
if (!base64Regex.test(input.data)) {
|
|
715
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
716
|
+
addIssueToContext(ctx, {
|
|
717
|
+
validation: "base64",
|
|
718
|
+
code: ZodIssueCode.invalid_string,
|
|
719
|
+
message: check.message
|
|
720
|
+
});
|
|
721
|
+
status.dirty();
|
|
722
|
+
}
|
|
723
|
+
} else if (check.kind === "base64url") {
|
|
724
|
+
if (!base64urlRegex.test(input.data)) {
|
|
725
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
726
|
+
addIssueToContext(ctx, {
|
|
727
|
+
validation: "base64url",
|
|
728
|
+
code: ZodIssueCode.invalid_string,
|
|
729
|
+
message: check.message
|
|
730
|
+
});
|
|
731
|
+
status.dirty();
|
|
732
|
+
}
|
|
733
|
+
} else {
|
|
734
|
+
util.assertNever(check);
|
|
735
|
+
}
|
|
736
|
+
}
|
|
737
|
+
return { status: status.value, value: input.data };
|
|
738
|
+
}
|
|
739
|
+
_regex(regex, validation, message) {
|
|
740
|
+
return this.refinement((data) => regex.test(data), {
|
|
741
|
+
validation,
|
|
742
|
+
code: ZodIssueCode.invalid_string,
|
|
743
|
+
...errorUtil.errToObj(message)
|
|
744
|
+
});
|
|
745
|
+
}
|
|
746
|
+
_addCheck(check) {
|
|
747
|
+
return new ZodString({
|
|
748
|
+
...this._def,
|
|
749
|
+
checks: [...this._def.checks, check]
|
|
750
|
+
});
|
|
751
|
+
}
|
|
752
|
+
email(message) {
|
|
753
|
+
return this._addCheck({ kind: "email", ...errorUtil.errToObj(message) });
|
|
754
|
+
}
|
|
755
|
+
url(message) {
|
|
756
|
+
return this._addCheck({ kind: "url", ...errorUtil.errToObj(message) });
|
|
757
|
+
}
|
|
758
|
+
emoji(message) {
|
|
759
|
+
return this._addCheck({ kind: "emoji", ...errorUtil.errToObj(message) });
|
|
760
|
+
}
|
|
761
|
+
uuid(message) {
|
|
762
|
+
return this._addCheck({ kind: "uuid", ...errorUtil.errToObj(message) });
|
|
763
|
+
}
|
|
764
|
+
nanoid(message) {
|
|
765
|
+
return this._addCheck({ kind: "nanoid", ...errorUtil.errToObj(message) });
|
|
766
|
+
}
|
|
767
|
+
cuid(message) {
|
|
768
|
+
return this._addCheck({ kind: "cuid", ...errorUtil.errToObj(message) });
|
|
769
|
+
}
|
|
770
|
+
cuid2(message) {
|
|
771
|
+
return this._addCheck({ kind: "cuid2", ...errorUtil.errToObj(message) });
|
|
772
|
+
}
|
|
773
|
+
ulid(message) {
|
|
774
|
+
return this._addCheck({ kind: "ulid", ...errorUtil.errToObj(message) });
|
|
775
|
+
}
|
|
776
|
+
base64(message) {
|
|
777
|
+
return this._addCheck({ kind: "base64", ...errorUtil.errToObj(message) });
|
|
778
|
+
}
|
|
779
|
+
base64url(message) {
|
|
780
|
+
return this._addCheck({
|
|
781
|
+
kind: "base64url",
|
|
782
|
+
...errorUtil.errToObj(message)
|
|
783
|
+
});
|
|
784
|
+
}
|
|
785
|
+
jwt(options) {
|
|
786
|
+
return this._addCheck({ kind: "jwt", ...errorUtil.errToObj(options) });
|
|
787
|
+
}
|
|
788
|
+
ip(options) {
|
|
789
|
+
return this._addCheck({ kind: "ip", ...errorUtil.errToObj(options) });
|
|
790
|
+
}
|
|
791
|
+
cidr(options) {
|
|
792
|
+
return this._addCheck({ kind: "cidr", ...errorUtil.errToObj(options) });
|
|
793
|
+
}
|
|
794
|
+
datetime(options) {
|
|
795
|
+
if (typeof options === "string") {
|
|
796
|
+
return this._addCheck({
|
|
797
|
+
kind: "datetime",
|
|
798
|
+
precision: null,
|
|
799
|
+
offset: false,
|
|
800
|
+
local: false,
|
|
801
|
+
message: options
|
|
802
|
+
});
|
|
803
|
+
}
|
|
804
|
+
return this._addCheck({
|
|
805
|
+
kind: "datetime",
|
|
806
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
807
|
+
offset: options?.offset ?? false,
|
|
808
|
+
local: options?.local ?? false,
|
|
809
|
+
...errorUtil.errToObj(options?.message)
|
|
810
|
+
});
|
|
811
|
+
}
|
|
812
|
+
date(message) {
|
|
813
|
+
return this._addCheck({ kind: "date", message });
|
|
814
|
+
}
|
|
815
|
+
time(options) {
|
|
816
|
+
if (typeof options === "string") {
|
|
817
|
+
return this._addCheck({
|
|
818
|
+
kind: "time",
|
|
819
|
+
precision: null,
|
|
820
|
+
message: options
|
|
821
|
+
});
|
|
822
|
+
}
|
|
823
|
+
return this._addCheck({
|
|
824
|
+
kind: "time",
|
|
825
|
+
precision: typeof options?.precision === "undefined" ? null : options?.precision,
|
|
826
|
+
...errorUtil.errToObj(options?.message)
|
|
827
|
+
});
|
|
828
|
+
}
|
|
829
|
+
duration(message) {
|
|
830
|
+
return this._addCheck({ kind: "duration", ...errorUtil.errToObj(message) });
|
|
831
|
+
}
|
|
832
|
+
regex(regex, message) {
|
|
833
|
+
return this._addCheck({
|
|
834
|
+
kind: "regex",
|
|
835
|
+
regex,
|
|
836
|
+
...errorUtil.errToObj(message)
|
|
837
|
+
});
|
|
838
|
+
}
|
|
839
|
+
includes(value, options) {
|
|
840
|
+
return this._addCheck({
|
|
841
|
+
kind: "includes",
|
|
842
|
+
value,
|
|
843
|
+
position: options?.position,
|
|
844
|
+
...errorUtil.errToObj(options?.message)
|
|
845
|
+
});
|
|
846
|
+
}
|
|
847
|
+
startsWith(value, message) {
|
|
848
|
+
return this._addCheck({
|
|
849
|
+
kind: "startsWith",
|
|
850
|
+
value,
|
|
851
|
+
...errorUtil.errToObj(message)
|
|
852
|
+
});
|
|
853
|
+
}
|
|
854
|
+
endsWith(value, message) {
|
|
855
|
+
return this._addCheck({
|
|
856
|
+
kind: "endsWith",
|
|
857
|
+
value,
|
|
858
|
+
...errorUtil.errToObj(message)
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
min(minLength, message) {
|
|
862
|
+
return this._addCheck({
|
|
863
|
+
kind: "min",
|
|
864
|
+
value: minLength,
|
|
865
|
+
...errorUtil.errToObj(message)
|
|
866
|
+
});
|
|
867
|
+
}
|
|
868
|
+
max(maxLength, message) {
|
|
869
|
+
return this._addCheck({
|
|
870
|
+
kind: "max",
|
|
871
|
+
value: maxLength,
|
|
872
|
+
...errorUtil.errToObj(message)
|
|
873
|
+
});
|
|
874
|
+
}
|
|
875
|
+
length(len, message) {
|
|
876
|
+
return this._addCheck({
|
|
877
|
+
kind: "length",
|
|
878
|
+
value: len,
|
|
879
|
+
...errorUtil.errToObj(message)
|
|
880
|
+
});
|
|
881
|
+
}
|
|
882
|
+
/**
|
|
883
|
+
* Equivalent to `.min(1)`
|
|
884
|
+
*/
|
|
885
|
+
nonempty(message) {
|
|
886
|
+
return this.min(1, errorUtil.errToObj(message));
|
|
887
|
+
}
|
|
888
|
+
trim() {
|
|
889
|
+
return new ZodString({
|
|
890
|
+
...this._def,
|
|
891
|
+
checks: [...this._def.checks, { kind: "trim" }]
|
|
892
|
+
});
|
|
893
|
+
}
|
|
894
|
+
toLowerCase() {
|
|
895
|
+
return new ZodString({
|
|
896
|
+
...this._def,
|
|
897
|
+
checks: [...this._def.checks, { kind: "toLowerCase" }]
|
|
898
|
+
});
|
|
899
|
+
}
|
|
900
|
+
toUpperCase() {
|
|
901
|
+
return new ZodString({
|
|
902
|
+
...this._def,
|
|
903
|
+
checks: [...this._def.checks, { kind: "toUpperCase" }]
|
|
904
|
+
});
|
|
905
|
+
}
|
|
906
|
+
get isDatetime() {
|
|
907
|
+
return !!this._def.checks.find((ch) => ch.kind === "datetime");
|
|
908
|
+
}
|
|
909
|
+
get isDate() {
|
|
910
|
+
return !!this._def.checks.find((ch) => ch.kind === "date");
|
|
911
|
+
}
|
|
912
|
+
get isTime() {
|
|
913
|
+
return !!this._def.checks.find((ch) => ch.kind === "time");
|
|
914
|
+
}
|
|
915
|
+
get isDuration() {
|
|
916
|
+
return !!this._def.checks.find((ch) => ch.kind === "duration");
|
|
917
|
+
}
|
|
918
|
+
get isEmail() {
|
|
919
|
+
return !!this._def.checks.find((ch) => ch.kind === "email");
|
|
920
|
+
}
|
|
921
|
+
get isURL() {
|
|
922
|
+
return !!this._def.checks.find((ch) => ch.kind === "url");
|
|
923
|
+
}
|
|
924
|
+
get isEmoji() {
|
|
925
|
+
return !!this._def.checks.find((ch) => ch.kind === "emoji");
|
|
926
|
+
}
|
|
927
|
+
get isUUID() {
|
|
928
|
+
return !!this._def.checks.find((ch) => ch.kind === "uuid");
|
|
929
|
+
}
|
|
930
|
+
get isNANOID() {
|
|
931
|
+
return !!this._def.checks.find((ch) => ch.kind === "nanoid");
|
|
932
|
+
}
|
|
933
|
+
get isCUID() {
|
|
934
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid");
|
|
935
|
+
}
|
|
936
|
+
get isCUID2() {
|
|
937
|
+
return !!this._def.checks.find((ch) => ch.kind === "cuid2");
|
|
938
|
+
}
|
|
939
|
+
get isULID() {
|
|
940
|
+
return !!this._def.checks.find((ch) => ch.kind === "ulid");
|
|
941
|
+
}
|
|
942
|
+
get isIP() {
|
|
943
|
+
return !!this._def.checks.find((ch) => ch.kind === "ip");
|
|
944
|
+
}
|
|
945
|
+
get isCIDR() {
|
|
946
|
+
return !!this._def.checks.find((ch) => ch.kind === "cidr");
|
|
947
|
+
}
|
|
948
|
+
get isBase64() {
|
|
949
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64");
|
|
950
|
+
}
|
|
951
|
+
get isBase64url() {
|
|
952
|
+
return !!this._def.checks.find((ch) => ch.kind === "base64url");
|
|
953
|
+
}
|
|
954
|
+
get minLength() {
|
|
955
|
+
let min = null;
|
|
956
|
+
for (const ch of this._def.checks) {
|
|
957
|
+
if (ch.kind === "min") {
|
|
958
|
+
if (min === null || ch.value > min)
|
|
959
|
+
min = ch.value;
|
|
960
|
+
}
|
|
961
|
+
}
|
|
962
|
+
return min;
|
|
963
|
+
}
|
|
964
|
+
get maxLength() {
|
|
965
|
+
let max = null;
|
|
966
|
+
for (const ch of this._def.checks) {
|
|
967
|
+
if (ch.kind === "max") {
|
|
968
|
+
if (max === null || ch.value < max)
|
|
969
|
+
max = ch.value;
|
|
970
|
+
}
|
|
971
|
+
}
|
|
972
|
+
return max;
|
|
973
|
+
}
|
|
974
|
+
}
|
|
975
|
+
ZodString.create = (params) => {
|
|
976
|
+
return new ZodString({
|
|
977
|
+
checks: [],
|
|
978
|
+
typeName: ZodFirstPartyTypeKind.ZodString,
|
|
979
|
+
coerce: params?.coerce ?? false,
|
|
980
|
+
...processCreateParams(params)
|
|
981
|
+
});
|
|
982
|
+
};
|
|
983
|
+
function floatSafeRemainder(val, step) {
|
|
984
|
+
const valDecCount = (val.toString().split(".")[1] || "").length;
|
|
985
|
+
const stepDecCount = (step.toString().split(".")[1] || "").length;
|
|
986
|
+
const decCount = valDecCount > stepDecCount ? valDecCount : stepDecCount;
|
|
987
|
+
const valInt = Number.parseInt(val.toFixed(decCount).replace(".", ""));
|
|
988
|
+
const stepInt = Number.parseInt(step.toFixed(decCount).replace(".", ""));
|
|
989
|
+
return valInt % stepInt / 10 ** decCount;
|
|
990
|
+
}
|
|
991
|
+
class ZodNumber extends ZodType {
|
|
992
|
+
constructor() {
|
|
993
|
+
super(...arguments);
|
|
994
|
+
this.min = this.gte;
|
|
995
|
+
this.max = this.lte;
|
|
996
|
+
this.step = this.multipleOf;
|
|
997
|
+
}
|
|
998
|
+
_parse(input) {
|
|
999
|
+
if (this._def.coerce) {
|
|
1000
|
+
input.data = Number(input.data);
|
|
1001
|
+
}
|
|
1002
|
+
const parsedType = this._getType(input);
|
|
1003
|
+
if (parsedType !== ZodParsedType.number) {
|
|
1004
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
1005
|
+
addIssueToContext(ctx2, {
|
|
1006
|
+
code: ZodIssueCode.invalid_type,
|
|
1007
|
+
expected: ZodParsedType.number,
|
|
1008
|
+
received: ctx2.parsedType
|
|
1009
|
+
});
|
|
1010
|
+
return INVALID;
|
|
1011
|
+
}
|
|
1012
|
+
let ctx = void 0;
|
|
1013
|
+
const status = new ParseStatus();
|
|
1014
|
+
for (const check of this._def.checks) {
|
|
1015
|
+
if (check.kind === "int") {
|
|
1016
|
+
if (!util.isInteger(input.data)) {
|
|
1017
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1018
|
+
addIssueToContext(ctx, {
|
|
1019
|
+
code: ZodIssueCode.invalid_type,
|
|
1020
|
+
expected: "integer",
|
|
1021
|
+
received: "float",
|
|
1022
|
+
message: check.message
|
|
1023
|
+
});
|
|
1024
|
+
status.dirty();
|
|
1025
|
+
}
|
|
1026
|
+
} else if (check.kind === "min") {
|
|
1027
|
+
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
|
1028
|
+
if (tooSmall) {
|
|
1029
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1030
|
+
addIssueToContext(ctx, {
|
|
1031
|
+
code: ZodIssueCode.too_small,
|
|
1032
|
+
minimum: check.value,
|
|
1033
|
+
type: "number",
|
|
1034
|
+
inclusive: check.inclusive,
|
|
1035
|
+
exact: false,
|
|
1036
|
+
message: check.message
|
|
1037
|
+
});
|
|
1038
|
+
status.dirty();
|
|
1039
|
+
}
|
|
1040
|
+
} else if (check.kind === "max") {
|
|
1041
|
+
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
|
1042
|
+
if (tooBig) {
|
|
1043
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1044
|
+
addIssueToContext(ctx, {
|
|
1045
|
+
code: ZodIssueCode.too_big,
|
|
1046
|
+
maximum: check.value,
|
|
1047
|
+
type: "number",
|
|
1048
|
+
inclusive: check.inclusive,
|
|
1049
|
+
exact: false,
|
|
1050
|
+
message: check.message
|
|
1051
|
+
});
|
|
1052
|
+
status.dirty();
|
|
1053
|
+
}
|
|
1054
|
+
} else if (check.kind === "multipleOf") {
|
|
1055
|
+
if (floatSafeRemainder(input.data, check.value) !== 0) {
|
|
1056
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1057
|
+
addIssueToContext(ctx, {
|
|
1058
|
+
code: ZodIssueCode.not_multiple_of,
|
|
1059
|
+
multipleOf: check.value,
|
|
1060
|
+
message: check.message
|
|
1061
|
+
});
|
|
1062
|
+
status.dirty();
|
|
1063
|
+
}
|
|
1064
|
+
} else if (check.kind === "finite") {
|
|
1065
|
+
if (!Number.isFinite(input.data)) {
|
|
1066
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1067
|
+
addIssueToContext(ctx, {
|
|
1068
|
+
code: ZodIssueCode.not_finite,
|
|
1069
|
+
message: check.message
|
|
1070
|
+
});
|
|
1071
|
+
status.dirty();
|
|
1072
|
+
}
|
|
1073
|
+
} else {
|
|
1074
|
+
util.assertNever(check);
|
|
1075
|
+
}
|
|
1076
|
+
}
|
|
1077
|
+
return { status: status.value, value: input.data };
|
|
1078
|
+
}
|
|
1079
|
+
gte(value, message) {
|
|
1080
|
+
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
1081
|
+
}
|
|
1082
|
+
gt(value, message) {
|
|
1083
|
+
return this.setLimit("min", value, false, errorUtil.toString(message));
|
|
1084
|
+
}
|
|
1085
|
+
lte(value, message) {
|
|
1086
|
+
return this.setLimit("max", value, true, errorUtil.toString(message));
|
|
1087
|
+
}
|
|
1088
|
+
lt(value, message) {
|
|
1089
|
+
return this.setLimit("max", value, false, errorUtil.toString(message));
|
|
1090
|
+
}
|
|
1091
|
+
setLimit(kind, value, inclusive, message) {
|
|
1092
|
+
return new ZodNumber({
|
|
1093
|
+
...this._def,
|
|
1094
|
+
checks: [
|
|
1095
|
+
...this._def.checks,
|
|
1096
|
+
{
|
|
1097
|
+
kind,
|
|
1098
|
+
value,
|
|
1099
|
+
inclusive,
|
|
1100
|
+
message: errorUtil.toString(message)
|
|
1101
|
+
}
|
|
1102
|
+
]
|
|
1103
|
+
});
|
|
1104
|
+
}
|
|
1105
|
+
_addCheck(check) {
|
|
1106
|
+
return new ZodNumber({
|
|
1107
|
+
...this._def,
|
|
1108
|
+
checks: [...this._def.checks, check]
|
|
1109
|
+
});
|
|
1110
|
+
}
|
|
1111
|
+
int(message) {
|
|
1112
|
+
return this._addCheck({
|
|
1113
|
+
kind: "int",
|
|
1114
|
+
message: errorUtil.toString(message)
|
|
1115
|
+
});
|
|
1116
|
+
}
|
|
1117
|
+
positive(message) {
|
|
1118
|
+
return this._addCheck({
|
|
1119
|
+
kind: "min",
|
|
1120
|
+
value: 0,
|
|
1121
|
+
inclusive: false,
|
|
1122
|
+
message: errorUtil.toString(message)
|
|
1123
|
+
});
|
|
1124
|
+
}
|
|
1125
|
+
negative(message) {
|
|
1126
|
+
return this._addCheck({
|
|
1127
|
+
kind: "max",
|
|
1128
|
+
value: 0,
|
|
1129
|
+
inclusive: false,
|
|
1130
|
+
message: errorUtil.toString(message)
|
|
1131
|
+
});
|
|
1132
|
+
}
|
|
1133
|
+
nonpositive(message) {
|
|
1134
|
+
return this._addCheck({
|
|
1135
|
+
kind: "max",
|
|
1136
|
+
value: 0,
|
|
1137
|
+
inclusive: true,
|
|
1138
|
+
message: errorUtil.toString(message)
|
|
1139
|
+
});
|
|
1140
|
+
}
|
|
1141
|
+
nonnegative(message) {
|
|
1142
|
+
return this._addCheck({
|
|
1143
|
+
kind: "min",
|
|
1144
|
+
value: 0,
|
|
1145
|
+
inclusive: true,
|
|
1146
|
+
message: errorUtil.toString(message)
|
|
1147
|
+
});
|
|
1148
|
+
}
|
|
1149
|
+
multipleOf(value, message) {
|
|
1150
|
+
return this._addCheck({
|
|
1151
|
+
kind: "multipleOf",
|
|
1152
|
+
value,
|
|
1153
|
+
message: errorUtil.toString(message)
|
|
1154
|
+
});
|
|
1155
|
+
}
|
|
1156
|
+
finite(message) {
|
|
1157
|
+
return this._addCheck({
|
|
1158
|
+
kind: "finite",
|
|
1159
|
+
message: errorUtil.toString(message)
|
|
1160
|
+
});
|
|
1161
|
+
}
|
|
1162
|
+
safe(message) {
|
|
1163
|
+
return this._addCheck({
|
|
1164
|
+
kind: "min",
|
|
1165
|
+
inclusive: true,
|
|
1166
|
+
value: Number.MIN_SAFE_INTEGER,
|
|
1167
|
+
message: errorUtil.toString(message)
|
|
1168
|
+
})._addCheck({
|
|
1169
|
+
kind: "max",
|
|
1170
|
+
inclusive: true,
|
|
1171
|
+
value: Number.MAX_SAFE_INTEGER,
|
|
1172
|
+
message: errorUtil.toString(message)
|
|
1173
|
+
});
|
|
1174
|
+
}
|
|
1175
|
+
get minValue() {
|
|
1176
|
+
let min = null;
|
|
1177
|
+
for (const ch of this._def.checks) {
|
|
1178
|
+
if (ch.kind === "min") {
|
|
1179
|
+
if (min === null || ch.value > min)
|
|
1180
|
+
min = ch.value;
|
|
1181
|
+
}
|
|
1182
|
+
}
|
|
1183
|
+
return min;
|
|
1184
|
+
}
|
|
1185
|
+
get maxValue() {
|
|
1186
|
+
let max = null;
|
|
1187
|
+
for (const ch of this._def.checks) {
|
|
1188
|
+
if (ch.kind === "max") {
|
|
1189
|
+
if (max === null || ch.value < max)
|
|
1190
|
+
max = ch.value;
|
|
1191
|
+
}
|
|
1192
|
+
}
|
|
1193
|
+
return max;
|
|
1194
|
+
}
|
|
1195
|
+
get isInt() {
|
|
1196
|
+
return !!this._def.checks.find((ch) => ch.kind === "int" || ch.kind === "multipleOf" && util.isInteger(ch.value));
|
|
1197
|
+
}
|
|
1198
|
+
get isFinite() {
|
|
1199
|
+
let max = null;
|
|
1200
|
+
let min = null;
|
|
1201
|
+
for (const ch of this._def.checks) {
|
|
1202
|
+
if (ch.kind === "finite" || ch.kind === "int" || ch.kind === "multipleOf") {
|
|
1203
|
+
return true;
|
|
1204
|
+
} else if (ch.kind === "min") {
|
|
1205
|
+
if (min === null || ch.value > min)
|
|
1206
|
+
min = ch.value;
|
|
1207
|
+
} else if (ch.kind === "max") {
|
|
1208
|
+
if (max === null || ch.value < max)
|
|
1209
|
+
max = ch.value;
|
|
1210
|
+
}
|
|
1211
|
+
}
|
|
1212
|
+
return Number.isFinite(min) && Number.isFinite(max);
|
|
1213
|
+
}
|
|
1214
|
+
}
|
|
1215
|
+
ZodNumber.create = (params) => {
|
|
1216
|
+
return new ZodNumber({
|
|
1217
|
+
checks: [],
|
|
1218
|
+
typeName: ZodFirstPartyTypeKind.ZodNumber,
|
|
1219
|
+
coerce: params?.coerce || false,
|
|
1220
|
+
...processCreateParams(params)
|
|
1221
|
+
});
|
|
1222
|
+
};
|
|
1223
|
+
class ZodBigInt extends ZodType {
|
|
1224
|
+
constructor() {
|
|
1225
|
+
super(...arguments);
|
|
1226
|
+
this.min = this.gte;
|
|
1227
|
+
this.max = this.lte;
|
|
1228
|
+
}
|
|
1229
|
+
_parse(input) {
|
|
1230
|
+
if (this._def.coerce) {
|
|
1231
|
+
try {
|
|
1232
|
+
input.data = BigInt(input.data);
|
|
1233
|
+
} catch {
|
|
1234
|
+
return this._getInvalidInput(input);
|
|
1235
|
+
}
|
|
1236
|
+
}
|
|
1237
|
+
const parsedType = this._getType(input);
|
|
1238
|
+
if (parsedType !== ZodParsedType.bigint) {
|
|
1239
|
+
return this._getInvalidInput(input);
|
|
1240
|
+
}
|
|
1241
|
+
let ctx = void 0;
|
|
1242
|
+
const status = new ParseStatus();
|
|
1243
|
+
for (const check of this._def.checks) {
|
|
1244
|
+
if (check.kind === "min") {
|
|
1245
|
+
const tooSmall = check.inclusive ? input.data < check.value : input.data <= check.value;
|
|
1246
|
+
if (tooSmall) {
|
|
1247
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1248
|
+
addIssueToContext(ctx, {
|
|
1249
|
+
code: ZodIssueCode.too_small,
|
|
1250
|
+
type: "bigint",
|
|
1251
|
+
minimum: check.value,
|
|
1252
|
+
inclusive: check.inclusive,
|
|
1253
|
+
message: check.message
|
|
1254
|
+
});
|
|
1255
|
+
status.dirty();
|
|
1256
|
+
}
|
|
1257
|
+
} else if (check.kind === "max") {
|
|
1258
|
+
const tooBig = check.inclusive ? input.data > check.value : input.data >= check.value;
|
|
1259
|
+
if (tooBig) {
|
|
1260
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1261
|
+
addIssueToContext(ctx, {
|
|
1262
|
+
code: ZodIssueCode.too_big,
|
|
1263
|
+
type: "bigint",
|
|
1264
|
+
maximum: check.value,
|
|
1265
|
+
inclusive: check.inclusive,
|
|
1266
|
+
message: check.message
|
|
1267
|
+
});
|
|
1268
|
+
status.dirty();
|
|
1269
|
+
}
|
|
1270
|
+
} else if (check.kind === "multipleOf") {
|
|
1271
|
+
if (input.data % check.value !== BigInt(0)) {
|
|
1272
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1273
|
+
addIssueToContext(ctx, {
|
|
1274
|
+
code: ZodIssueCode.not_multiple_of,
|
|
1275
|
+
multipleOf: check.value,
|
|
1276
|
+
message: check.message
|
|
1277
|
+
});
|
|
1278
|
+
status.dirty();
|
|
1279
|
+
}
|
|
1280
|
+
} else {
|
|
1281
|
+
util.assertNever(check);
|
|
1282
|
+
}
|
|
1283
|
+
}
|
|
1284
|
+
return { status: status.value, value: input.data };
|
|
1285
|
+
}
|
|
1286
|
+
_getInvalidInput(input) {
|
|
1287
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1288
|
+
addIssueToContext(ctx, {
|
|
1289
|
+
code: ZodIssueCode.invalid_type,
|
|
1290
|
+
expected: ZodParsedType.bigint,
|
|
1291
|
+
received: ctx.parsedType
|
|
1292
|
+
});
|
|
1293
|
+
return INVALID;
|
|
1294
|
+
}
|
|
1295
|
+
gte(value, message) {
|
|
1296
|
+
return this.setLimit("min", value, true, errorUtil.toString(message));
|
|
1297
|
+
}
|
|
1298
|
+
gt(value, message) {
|
|
1299
|
+
return this.setLimit("min", value, false, errorUtil.toString(message));
|
|
1300
|
+
}
|
|
1301
|
+
lte(value, message) {
|
|
1302
|
+
return this.setLimit("max", value, true, errorUtil.toString(message));
|
|
1303
|
+
}
|
|
1304
|
+
lt(value, message) {
|
|
1305
|
+
return this.setLimit("max", value, false, errorUtil.toString(message));
|
|
1306
|
+
}
|
|
1307
|
+
setLimit(kind, value, inclusive, message) {
|
|
1308
|
+
return new ZodBigInt({
|
|
1309
|
+
...this._def,
|
|
1310
|
+
checks: [
|
|
1311
|
+
...this._def.checks,
|
|
1312
|
+
{
|
|
1313
|
+
kind,
|
|
1314
|
+
value,
|
|
1315
|
+
inclusive,
|
|
1316
|
+
message: errorUtil.toString(message)
|
|
1317
|
+
}
|
|
1318
|
+
]
|
|
1319
|
+
});
|
|
1320
|
+
}
|
|
1321
|
+
_addCheck(check) {
|
|
1322
|
+
return new ZodBigInt({
|
|
1323
|
+
...this._def,
|
|
1324
|
+
checks: [...this._def.checks, check]
|
|
1325
|
+
});
|
|
1326
|
+
}
|
|
1327
|
+
positive(message) {
|
|
1328
|
+
return this._addCheck({
|
|
1329
|
+
kind: "min",
|
|
1330
|
+
value: BigInt(0),
|
|
1331
|
+
inclusive: false,
|
|
1332
|
+
message: errorUtil.toString(message)
|
|
1333
|
+
});
|
|
1334
|
+
}
|
|
1335
|
+
negative(message) {
|
|
1336
|
+
return this._addCheck({
|
|
1337
|
+
kind: "max",
|
|
1338
|
+
value: BigInt(0),
|
|
1339
|
+
inclusive: false,
|
|
1340
|
+
message: errorUtil.toString(message)
|
|
1341
|
+
});
|
|
1342
|
+
}
|
|
1343
|
+
nonpositive(message) {
|
|
1344
|
+
return this._addCheck({
|
|
1345
|
+
kind: "max",
|
|
1346
|
+
value: BigInt(0),
|
|
1347
|
+
inclusive: true,
|
|
1348
|
+
message: errorUtil.toString(message)
|
|
1349
|
+
});
|
|
1350
|
+
}
|
|
1351
|
+
nonnegative(message) {
|
|
1352
|
+
return this._addCheck({
|
|
1353
|
+
kind: "min",
|
|
1354
|
+
value: BigInt(0),
|
|
1355
|
+
inclusive: true,
|
|
1356
|
+
message: errorUtil.toString(message)
|
|
1357
|
+
});
|
|
1358
|
+
}
|
|
1359
|
+
multipleOf(value, message) {
|
|
1360
|
+
return this._addCheck({
|
|
1361
|
+
kind: "multipleOf",
|
|
1362
|
+
value,
|
|
1363
|
+
message: errorUtil.toString(message)
|
|
1364
|
+
});
|
|
1365
|
+
}
|
|
1366
|
+
get minValue() {
|
|
1367
|
+
let min = null;
|
|
1368
|
+
for (const ch of this._def.checks) {
|
|
1369
|
+
if (ch.kind === "min") {
|
|
1370
|
+
if (min === null || ch.value > min)
|
|
1371
|
+
min = ch.value;
|
|
1372
|
+
}
|
|
1373
|
+
}
|
|
1374
|
+
return min;
|
|
1375
|
+
}
|
|
1376
|
+
get maxValue() {
|
|
1377
|
+
let max = null;
|
|
1378
|
+
for (const ch of this._def.checks) {
|
|
1379
|
+
if (ch.kind === "max") {
|
|
1380
|
+
if (max === null || ch.value < max)
|
|
1381
|
+
max = ch.value;
|
|
1382
|
+
}
|
|
1383
|
+
}
|
|
1384
|
+
return max;
|
|
1385
|
+
}
|
|
1386
|
+
}
|
|
1387
|
+
ZodBigInt.create = (params) => {
|
|
1388
|
+
return new ZodBigInt({
|
|
1389
|
+
checks: [],
|
|
1390
|
+
typeName: ZodFirstPartyTypeKind.ZodBigInt,
|
|
1391
|
+
coerce: params?.coerce ?? false,
|
|
1392
|
+
...processCreateParams(params)
|
|
1393
|
+
});
|
|
1394
|
+
};
|
|
1395
|
+
class ZodBoolean extends ZodType {
|
|
1396
|
+
_parse(input) {
|
|
1397
|
+
if (this._def.coerce) {
|
|
1398
|
+
input.data = Boolean(input.data);
|
|
1399
|
+
}
|
|
1400
|
+
const parsedType = this._getType(input);
|
|
1401
|
+
if (parsedType !== ZodParsedType.boolean) {
|
|
1402
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1403
|
+
addIssueToContext(ctx, {
|
|
1404
|
+
code: ZodIssueCode.invalid_type,
|
|
1405
|
+
expected: ZodParsedType.boolean,
|
|
1406
|
+
received: ctx.parsedType
|
|
1407
|
+
});
|
|
1408
|
+
return INVALID;
|
|
1409
|
+
}
|
|
1410
|
+
return OK(input.data);
|
|
1411
|
+
}
|
|
1412
|
+
}
|
|
1413
|
+
ZodBoolean.create = (params) => {
|
|
1414
|
+
return new ZodBoolean({
|
|
1415
|
+
typeName: ZodFirstPartyTypeKind.ZodBoolean,
|
|
1416
|
+
coerce: params?.coerce || false,
|
|
1417
|
+
...processCreateParams(params)
|
|
1418
|
+
});
|
|
1419
|
+
};
|
|
1420
|
+
class ZodDate extends ZodType {
|
|
1421
|
+
_parse(input) {
|
|
1422
|
+
if (this._def.coerce) {
|
|
1423
|
+
input.data = new Date(input.data);
|
|
1424
|
+
}
|
|
1425
|
+
const parsedType = this._getType(input);
|
|
1426
|
+
if (parsedType !== ZodParsedType.date) {
|
|
1427
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
1428
|
+
addIssueToContext(ctx2, {
|
|
1429
|
+
code: ZodIssueCode.invalid_type,
|
|
1430
|
+
expected: ZodParsedType.date,
|
|
1431
|
+
received: ctx2.parsedType
|
|
1432
|
+
});
|
|
1433
|
+
return INVALID;
|
|
1434
|
+
}
|
|
1435
|
+
if (Number.isNaN(input.data.getTime())) {
|
|
1436
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
1437
|
+
addIssueToContext(ctx2, {
|
|
1438
|
+
code: ZodIssueCode.invalid_date
|
|
1439
|
+
});
|
|
1440
|
+
return INVALID;
|
|
1441
|
+
}
|
|
1442
|
+
const status = new ParseStatus();
|
|
1443
|
+
let ctx = void 0;
|
|
1444
|
+
for (const check of this._def.checks) {
|
|
1445
|
+
if (check.kind === "min") {
|
|
1446
|
+
if (input.data.getTime() < check.value) {
|
|
1447
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1448
|
+
addIssueToContext(ctx, {
|
|
1449
|
+
code: ZodIssueCode.too_small,
|
|
1450
|
+
message: check.message,
|
|
1451
|
+
inclusive: true,
|
|
1452
|
+
exact: false,
|
|
1453
|
+
minimum: check.value,
|
|
1454
|
+
type: "date"
|
|
1455
|
+
});
|
|
1456
|
+
status.dirty();
|
|
1457
|
+
}
|
|
1458
|
+
} else if (check.kind === "max") {
|
|
1459
|
+
if (input.data.getTime() > check.value) {
|
|
1460
|
+
ctx = this._getOrReturnCtx(input, ctx);
|
|
1461
|
+
addIssueToContext(ctx, {
|
|
1462
|
+
code: ZodIssueCode.too_big,
|
|
1463
|
+
message: check.message,
|
|
1464
|
+
inclusive: true,
|
|
1465
|
+
exact: false,
|
|
1466
|
+
maximum: check.value,
|
|
1467
|
+
type: "date"
|
|
1468
|
+
});
|
|
1469
|
+
status.dirty();
|
|
1470
|
+
}
|
|
1471
|
+
} else {
|
|
1472
|
+
util.assertNever(check);
|
|
1473
|
+
}
|
|
1474
|
+
}
|
|
1475
|
+
return {
|
|
1476
|
+
status: status.value,
|
|
1477
|
+
value: new Date(input.data.getTime())
|
|
1478
|
+
};
|
|
1479
|
+
}
|
|
1480
|
+
_addCheck(check) {
|
|
1481
|
+
return new ZodDate({
|
|
1482
|
+
...this._def,
|
|
1483
|
+
checks: [...this._def.checks, check]
|
|
1484
|
+
});
|
|
1485
|
+
}
|
|
1486
|
+
min(minDate, message) {
|
|
1487
|
+
return this._addCheck({
|
|
1488
|
+
kind: "min",
|
|
1489
|
+
value: minDate.getTime(),
|
|
1490
|
+
message: errorUtil.toString(message)
|
|
1491
|
+
});
|
|
1492
|
+
}
|
|
1493
|
+
max(maxDate, message) {
|
|
1494
|
+
return this._addCheck({
|
|
1495
|
+
kind: "max",
|
|
1496
|
+
value: maxDate.getTime(),
|
|
1497
|
+
message: errorUtil.toString(message)
|
|
1498
|
+
});
|
|
1499
|
+
}
|
|
1500
|
+
get minDate() {
|
|
1501
|
+
let min = null;
|
|
1502
|
+
for (const ch of this._def.checks) {
|
|
1503
|
+
if (ch.kind === "min") {
|
|
1504
|
+
if (min === null || ch.value > min)
|
|
1505
|
+
min = ch.value;
|
|
1506
|
+
}
|
|
1507
|
+
}
|
|
1508
|
+
return min != null ? new Date(min) : null;
|
|
1509
|
+
}
|
|
1510
|
+
get maxDate() {
|
|
1511
|
+
let max = null;
|
|
1512
|
+
for (const ch of this._def.checks) {
|
|
1513
|
+
if (ch.kind === "max") {
|
|
1514
|
+
if (max === null || ch.value < max)
|
|
1515
|
+
max = ch.value;
|
|
1516
|
+
}
|
|
1517
|
+
}
|
|
1518
|
+
return max != null ? new Date(max) : null;
|
|
1519
|
+
}
|
|
1520
|
+
}
|
|
1521
|
+
ZodDate.create = (params) => {
|
|
1522
|
+
return new ZodDate({
|
|
1523
|
+
checks: [],
|
|
1524
|
+
coerce: params?.coerce || false,
|
|
1525
|
+
typeName: ZodFirstPartyTypeKind.ZodDate,
|
|
1526
|
+
...processCreateParams(params)
|
|
1527
|
+
});
|
|
1528
|
+
};
|
|
1529
|
+
class ZodSymbol extends ZodType {
|
|
1530
|
+
_parse(input) {
|
|
1531
|
+
const parsedType = this._getType(input);
|
|
1532
|
+
if (parsedType !== ZodParsedType.symbol) {
|
|
1533
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1534
|
+
addIssueToContext(ctx, {
|
|
1535
|
+
code: ZodIssueCode.invalid_type,
|
|
1536
|
+
expected: ZodParsedType.symbol,
|
|
1537
|
+
received: ctx.parsedType
|
|
1538
|
+
});
|
|
1539
|
+
return INVALID;
|
|
1540
|
+
}
|
|
1541
|
+
return OK(input.data);
|
|
1542
|
+
}
|
|
1543
|
+
}
|
|
1544
|
+
ZodSymbol.create = (params) => {
|
|
1545
|
+
return new ZodSymbol({
|
|
1546
|
+
typeName: ZodFirstPartyTypeKind.ZodSymbol,
|
|
1547
|
+
...processCreateParams(params)
|
|
1548
|
+
});
|
|
1549
|
+
};
|
|
1550
|
+
class ZodUndefined extends ZodType {
|
|
1551
|
+
_parse(input) {
|
|
1552
|
+
const parsedType = this._getType(input);
|
|
1553
|
+
if (parsedType !== ZodParsedType.undefined) {
|
|
1554
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1555
|
+
addIssueToContext(ctx, {
|
|
1556
|
+
code: ZodIssueCode.invalid_type,
|
|
1557
|
+
expected: ZodParsedType.undefined,
|
|
1558
|
+
received: ctx.parsedType
|
|
1559
|
+
});
|
|
1560
|
+
return INVALID;
|
|
1561
|
+
}
|
|
1562
|
+
return OK(input.data);
|
|
1563
|
+
}
|
|
1564
|
+
}
|
|
1565
|
+
ZodUndefined.create = (params) => {
|
|
1566
|
+
return new ZodUndefined({
|
|
1567
|
+
typeName: ZodFirstPartyTypeKind.ZodUndefined,
|
|
1568
|
+
...processCreateParams(params)
|
|
1569
|
+
});
|
|
1570
|
+
};
|
|
1571
|
+
class ZodNull extends ZodType {
|
|
1572
|
+
_parse(input) {
|
|
1573
|
+
const parsedType = this._getType(input);
|
|
1574
|
+
if (parsedType !== ZodParsedType.null) {
|
|
1575
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1576
|
+
addIssueToContext(ctx, {
|
|
1577
|
+
code: ZodIssueCode.invalid_type,
|
|
1578
|
+
expected: ZodParsedType.null,
|
|
1579
|
+
received: ctx.parsedType
|
|
1580
|
+
});
|
|
1581
|
+
return INVALID;
|
|
1582
|
+
}
|
|
1583
|
+
return OK(input.data);
|
|
1584
|
+
}
|
|
1585
|
+
}
|
|
1586
|
+
ZodNull.create = (params) => {
|
|
1587
|
+
return new ZodNull({
|
|
1588
|
+
typeName: ZodFirstPartyTypeKind.ZodNull,
|
|
1589
|
+
...processCreateParams(params)
|
|
1590
|
+
});
|
|
1591
|
+
};
|
|
1592
|
+
class ZodAny extends ZodType {
|
|
1593
|
+
constructor() {
|
|
1594
|
+
super(...arguments);
|
|
1595
|
+
this._any = true;
|
|
1596
|
+
}
|
|
1597
|
+
_parse(input) {
|
|
1598
|
+
return OK(input.data);
|
|
1599
|
+
}
|
|
1600
|
+
}
|
|
1601
|
+
ZodAny.create = (params) => {
|
|
1602
|
+
return new ZodAny({
|
|
1603
|
+
typeName: ZodFirstPartyTypeKind.ZodAny,
|
|
1604
|
+
...processCreateParams(params)
|
|
1605
|
+
});
|
|
1606
|
+
};
|
|
1607
|
+
class ZodUnknown extends ZodType {
|
|
1608
|
+
constructor() {
|
|
1609
|
+
super(...arguments);
|
|
1610
|
+
this._unknown = true;
|
|
1611
|
+
}
|
|
1612
|
+
_parse(input) {
|
|
1613
|
+
return OK(input.data);
|
|
1614
|
+
}
|
|
1615
|
+
}
|
|
1616
|
+
ZodUnknown.create = (params) => {
|
|
1617
|
+
return new ZodUnknown({
|
|
1618
|
+
typeName: ZodFirstPartyTypeKind.ZodUnknown,
|
|
1619
|
+
...processCreateParams(params)
|
|
1620
|
+
});
|
|
1621
|
+
};
|
|
1622
|
+
class ZodNever extends ZodType {
|
|
1623
|
+
_parse(input) {
|
|
1624
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1625
|
+
addIssueToContext(ctx, {
|
|
1626
|
+
code: ZodIssueCode.invalid_type,
|
|
1627
|
+
expected: ZodParsedType.never,
|
|
1628
|
+
received: ctx.parsedType
|
|
1629
|
+
});
|
|
1630
|
+
return INVALID;
|
|
1631
|
+
}
|
|
1632
|
+
}
|
|
1633
|
+
ZodNever.create = (params) => {
|
|
1634
|
+
return new ZodNever({
|
|
1635
|
+
typeName: ZodFirstPartyTypeKind.ZodNever,
|
|
1636
|
+
...processCreateParams(params)
|
|
1637
|
+
});
|
|
1638
|
+
};
|
|
1639
|
+
class ZodVoid extends ZodType {
|
|
1640
|
+
_parse(input) {
|
|
1641
|
+
const parsedType = this._getType(input);
|
|
1642
|
+
if (parsedType !== ZodParsedType.undefined) {
|
|
1643
|
+
const ctx = this._getOrReturnCtx(input);
|
|
1644
|
+
addIssueToContext(ctx, {
|
|
1645
|
+
code: ZodIssueCode.invalid_type,
|
|
1646
|
+
expected: ZodParsedType.void,
|
|
1647
|
+
received: ctx.parsedType
|
|
1648
|
+
});
|
|
1649
|
+
return INVALID;
|
|
1650
|
+
}
|
|
1651
|
+
return OK(input.data);
|
|
1652
|
+
}
|
|
1653
|
+
}
|
|
1654
|
+
ZodVoid.create = (params) => {
|
|
1655
|
+
return new ZodVoid({
|
|
1656
|
+
typeName: ZodFirstPartyTypeKind.ZodVoid,
|
|
1657
|
+
...processCreateParams(params)
|
|
1658
|
+
});
|
|
1659
|
+
};
|
|
1660
|
+
class ZodArray extends ZodType {
|
|
1661
|
+
_parse(input) {
|
|
1662
|
+
const { ctx, status } = this._processInputParams(input);
|
|
1663
|
+
const def = this._def;
|
|
1664
|
+
if (ctx.parsedType !== ZodParsedType.array) {
|
|
1665
|
+
addIssueToContext(ctx, {
|
|
1666
|
+
code: ZodIssueCode.invalid_type,
|
|
1667
|
+
expected: ZodParsedType.array,
|
|
1668
|
+
received: ctx.parsedType
|
|
1669
|
+
});
|
|
1670
|
+
return INVALID;
|
|
1671
|
+
}
|
|
1672
|
+
if (def.exactLength !== null) {
|
|
1673
|
+
const tooBig = ctx.data.length > def.exactLength.value;
|
|
1674
|
+
const tooSmall = ctx.data.length < def.exactLength.value;
|
|
1675
|
+
if (tooBig || tooSmall) {
|
|
1676
|
+
addIssueToContext(ctx, {
|
|
1677
|
+
code: tooBig ? ZodIssueCode.too_big : ZodIssueCode.too_small,
|
|
1678
|
+
minimum: tooSmall ? def.exactLength.value : void 0,
|
|
1679
|
+
maximum: tooBig ? def.exactLength.value : void 0,
|
|
1680
|
+
type: "array",
|
|
1681
|
+
inclusive: true,
|
|
1682
|
+
exact: true,
|
|
1683
|
+
message: def.exactLength.message
|
|
1684
|
+
});
|
|
1685
|
+
status.dirty();
|
|
1686
|
+
}
|
|
1687
|
+
}
|
|
1688
|
+
if (def.minLength !== null) {
|
|
1689
|
+
if (ctx.data.length < def.minLength.value) {
|
|
1690
|
+
addIssueToContext(ctx, {
|
|
1691
|
+
code: ZodIssueCode.too_small,
|
|
1692
|
+
minimum: def.minLength.value,
|
|
1693
|
+
type: "array",
|
|
1694
|
+
inclusive: true,
|
|
1695
|
+
exact: false,
|
|
1696
|
+
message: def.minLength.message
|
|
1697
|
+
});
|
|
1698
|
+
status.dirty();
|
|
1699
|
+
}
|
|
1700
|
+
}
|
|
1701
|
+
if (def.maxLength !== null) {
|
|
1702
|
+
if (ctx.data.length > def.maxLength.value) {
|
|
1703
|
+
addIssueToContext(ctx, {
|
|
1704
|
+
code: ZodIssueCode.too_big,
|
|
1705
|
+
maximum: def.maxLength.value,
|
|
1706
|
+
type: "array",
|
|
1707
|
+
inclusive: true,
|
|
1708
|
+
exact: false,
|
|
1709
|
+
message: def.maxLength.message
|
|
1710
|
+
});
|
|
1711
|
+
status.dirty();
|
|
1712
|
+
}
|
|
1713
|
+
}
|
|
1714
|
+
if (ctx.common.async) {
|
|
1715
|
+
return Promise.all([...ctx.data].map((item, i) => {
|
|
1716
|
+
return def.type._parseAsync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
1717
|
+
})).then((result2) => {
|
|
1718
|
+
return ParseStatus.mergeArray(status, result2);
|
|
1719
|
+
});
|
|
1720
|
+
}
|
|
1721
|
+
const result = [...ctx.data].map((item, i) => {
|
|
1722
|
+
return def.type._parseSync(new ParseInputLazyPath(ctx, item, ctx.path, i));
|
|
1723
|
+
});
|
|
1724
|
+
return ParseStatus.mergeArray(status, result);
|
|
1725
|
+
}
|
|
1726
|
+
get element() {
|
|
1727
|
+
return this._def.type;
|
|
1728
|
+
}
|
|
1729
|
+
min(minLength, message) {
|
|
1730
|
+
return new ZodArray({
|
|
1731
|
+
...this._def,
|
|
1732
|
+
minLength: { value: minLength, message: errorUtil.toString(message) }
|
|
1733
|
+
});
|
|
1734
|
+
}
|
|
1735
|
+
max(maxLength, message) {
|
|
1736
|
+
return new ZodArray({
|
|
1737
|
+
...this._def,
|
|
1738
|
+
maxLength: { value: maxLength, message: errorUtil.toString(message) }
|
|
1739
|
+
});
|
|
1740
|
+
}
|
|
1741
|
+
length(len, message) {
|
|
1742
|
+
return new ZodArray({
|
|
1743
|
+
...this._def,
|
|
1744
|
+
exactLength: { value: len, message: errorUtil.toString(message) }
|
|
1745
|
+
});
|
|
1746
|
+
}
|
|
1747
|
+
nonempty(message) {
|
|
1748
|
+
return this.min(1, message);
|
|
1749
|
+
}
|
|
1750
|
+
}
|
|
1751
|
+
ZodArray.create = (schema, params) => {
|
|
1752
|
+
return new ZodArray({
|
|
1753
|
+
type: schema,
|
|
1754
|
+
minLength: null,
|
|
1755
|
+
maxLength: null,
|
|
1756
|
+
exactLength: null,
|
|
1757
|
+
typeName: ZodFirstPartyTypeKind.ZodArray,
|
|
1758
|
+
...processCreateParams(params)
|
|
1759
|
+
});
|
|
1760
|
+
};
|
|
1761
|
+
function deepPartialify(schema) {
|
|
1762
|
+
if (schema instanceof ZodObject) {
|
|
1763
|
+
const newShape = {};
|
|
1764
|
+
for (const key in schema.shape) {
|
|
1765
|
+
const fieldSchema = schema.shape[key];
|
|
1766
|
+
newShape[key] = ZodOptional.create(deepPartialify(fieldSchema));
|
|
1767
|
+
}
|
|
1768
|
+
return new ZodObject({
|
|
1769
|
+
...schema._def,
|
|
1770
|
+
shape: () => newShape
|
|
1771
|
+
});
|
|
1772
|
+
} else if (schema instanceof ZodArray) {
|
|
1773
|
+
return new ZodArray({
|
|
1774
|
+
...schema._def,
|
|
1775
|
+
type: deepPartialify(schema.element)
|
|
1776
|
+
});
|
|
1777
|
+
} else if (schema instanceof ZodOptional) {
|
|
1778
|
+
return ZodOptional.create(deepPartialify(schema.unwrap()));
|
|
1779
|
+
} else if (schema instanceof ZodNullable) {
|
|
1780
|
+
return ZodNullable.create(deepPartialify(schema.unwrap()));
|
|
1781
|
+
} else if (schema instanceof ZodTuple) {
|
|
1782
|
+
return ZodTuple.create(schema.items.map((item) => deepPartialify(item)));
|
|
1783
|
+
} else {
|
|
1784
|
+
return schema;
|
|
1785
|
+
}
|
|
1786
|
+
}
|
|
1787
|
+
class ZodObject extends ZodType {
|
|
1788
|
+
constructor() {
|
|
1789
|
+
super(...arguments);
|
|
1790
|
+
this._cached = null;
|
|
1791
|
+
this.nonstrict = this.passthrough;
|
|
1792
|
+
this.augment = this.extend;
|
|
1793
|
+
}
|
|
1794
|
+
_getCached() {
|
|
1795
|
+
if (this._cached !== null)
|
|
1796
|
+
return this._cached;
|
|
1797
|
+
const shape = this._def.shape();
|
|
1798
|
+
const keys = util.objectKeys(shape);
|
|
1799
|
+
this._cached = { shape, keys };
|
|
1800
|
+
return this._cached;
|
|
1801
|
+
}
|
|
1802
|
+
_parse(input) {
|
|
1803
|
+
const parsedType = this._getType(input);
|
|
1804
|
+
if (parsedType !== ZodParsedType.object) {
|
|
1805
|
+
const ctx2 = this._getOrReturnCtx(input);
|
|
1806
|
+
addIssueToContext(ctx2, {
|
|
1807
|
+
code: ZodIssueCode.invalid_type,
|
|
1808
|
+
expected: ZodParsedType.object,
|
|
1809
|
+
received: ctx2.parsedType
|
|
1810
|
+
});
|
|
1811
|
+
return INVALID;
|
|
1812
|
+
}
|
|
1813
|
+
const { status, ctx } = this._processInputParams(input);
|
|
1814
|
+
const { shape, keys: shapeKeys } = this._getCached();
|
|
1815
|
+
const extraKeys = [];
|
|
1816
|
+
if (!(this._def.catchall instanceof ZodNever && this._def.unknownKeys === "strip")) {
|
|
1817
|
+
for (const key in ctx.data) {
|
|
1818
|
+
if (!shapeKeys.includes(key)) {
|
|
1819
|
+
extraKeys.push(key);
|
|
1820
|
+
}
|
|
1821
|
+
}
|
|
1822
|
+
}
|
|
1823
|
+
const pairs = [];
|
|
1824
|
+
for (const key of shapeKeys) {
|
|
1825
|
+
const keyValidator = shape[key];
|
|
1826
|
+
const value = ctx.data[key];
|
|
1827
|
+
pairs.push({
|
|
1828
|
+
key: { status: "valid", value: key },
|
|
1829
|
+
value: keyValidator._parse(new ParseInputLazyPath(ctx, value, ctx.path, key)),
|
|
1830
|
+
alwaysSet: key in ctx.data
|
|
1831
|
+
});
|
|
1832
|
+
}
|
|
1833
|
+
if (this._def.catchall instanceof ZodNever) {
|
|
1834
|
+
const unknownKeys = this._def.unknownKeys;
|
|
1835
|
+
if (unknownKeys === "passthrough") {
|
|
1836
|
+
for (const key of extraKeys) {
|
|
1837
|
+
pairs.push({
|
|
1838
|
+
key: { status: "valid", value: key },
|
|
1839
|
+
value: { status: "valid", value: ctx.data[key] }
|
|
1840
|
+
});
|
|
1841
|
+
}
|
|
1842
|
+
} else if (unknownKeys === "strict") {
|
|
1843
|
+
if (extraKeys.length > 0) {
|
|
1844
|
+
addIssueToContext(ctx, {
|
|
1845
|
+
code: ZodIssueCode.unrecognized_keys,
|
|
1846
|
+
keys: extraKeys
|
|
1847
|
+
});
|
|
1848
|
+
status.dirty();
|
|
1849
|
+
}
|
|
1850
|
+
} else if (unknownKeys === "strip") ;
|
|
1851
|
+
else {
|
|
1852
|
+
throw new Error(`Internal ZodObject error: invalid unknownKeys value.`);
|
|
1853
|
+
}
|
|
1854
|
+
} else {
|
|
1855
|
+
const catchall = this._def.catchall;
|
|
1856
|
+
for (const key of extraKeys) {
|
|
1857
|
+
const value = ctx.data[key];
|
|
1858
|
+
pairs.push({
|
|
1859
|
+
key: { status: "valid", value: key },
|
|
1860
|
+
value: catchall._parse(
|
|
1861
|
+
new ParseInputLazyPath(ctx, value, ctx.path, key)
|
|
1862
|
+
//, ctx.child(key), value, getParsedType(value)
|
|
1863
|
+
),
|
|
1864
|
+
alwaysSet: key in ctx.data
|
|
1865
|
+
});
|
|
1866
|
+
}
|
|
1867
|
+
}
|
|
1868
|
+
if (ctx.common.async) {
|
|
1869
|
+
return Promise.resolve().then(async () => {
|
|
1870
|
+
const syncPairs = [];
|
|
1871
|
+
for (const pair of pairs) {
|
|
1872
|
+
const key = await pair.key;
|
|
1873
|
+
const value = await pair.value;
|
|
1874
|
+
syncPairs.push({
|
|
1875
|
+
key,
|
|
1876
|
+
value,
|
|
1877
|
+
alwaysSet: pair.alwaysSet
|
|
1878
|
+
});
|
|
1879
|
+
}
|
|
1880
|
+
return syncPairs;
|
|
1881
|
+
}).then((syncPairs) => {
|
|
1882
|
+
return ParseStatus.mergeObjectSync(status, syncPairs);
|
|
1883
|
+
});
|
|
1884
|
+
} else {
|
|
1885
|
+
return ParseStatus.mergeObjectSync(status, pairs);
|
|
1886
|
+
}
|
|
1887
|
+
}
|
|
1888
|
+
get shape() {
|
|
1889
|
+
return this._def.shape();
|
|
1890
|
+
}
|
|
1891
|
+
strict(message) {
|
|
1892
|
+
errorUtil.errToObj;
|
|
1893
|
+
return new ZodObject({
|
|
1894
|
+
...this._def,
|
|
1895
|
+
unknownKeys: "strict",
|
|
1896
|
+
...message !== void 0 ? {
|
|
1897
|
+
errorMap: (issue, ctx) => {
|
|
1898
|
+
const defaultError = this._def.errorMap?.(issue, ctx).message ?? ctx.defaultError;
|
|
1899
|
+
if (issue.code === "unrecognized_keys")
|
|
1900
|
+
return {
|
|
1901
|
+
message: errorUtil.errToObj(message).message ?? defaultError
|
|
1902
|
+
};
|
|
1903
|
+
return {
|
|
1904
|
+
message: defaultError
|
|
1905
|
+
};
|
|
1906
|
+
}
|
|
1907
|
+
} : {}
|
|
1908
|
+
});
|
|
1909
|
+
}
|
|
1910
|
+
strip() {
|
|
1911
|
+
return new ZodObject({
|
|
1912
|
+
...this._def,
|
|
1913
|
+
unknownKeys: "strip"
|
|
1914
|
+
});
|
|
1915
|
+
}
|
|
1916
|
+
passthrough() {
|
|
1917
|
+
return new ZodObject({
|
|
1918
|
+
...this._def,
|
|
1919
|
+
unknownKeys: "passthrough"
|
|
1920
|
+
});
|
|
1921
|
+
}
|
|
1922
|
+
// const AugmentFactory =
|
|
1923
|
+
// <Def extends ZodObjectDef>(def: Def) =>
|
|
1924
|
+
// <Augmentation extends ZodRawShape>(
|
|
1925
|
+
// augmentation: Augmentation
|
|
1926
|
+
// ): ZodObject<
|
|
1927
|
+
// extendShape<ReturnType<Def["shape"]>, Augmentation>,
|
|
1928
|
+
// Def["unknownKeys"],
|
|
1929
|
+
// Def["catchall"]
|
|
1930
|
+
// > => {
|
|
1931
|
+
// return new ZodObject({
|
|
1932
|
+
// ...def,
|
|
1933
|
+
// shape: () => ({
|
|
1934
|
+
// ...def.shape(),
|
|
1935
|
+
// ...augmentation,
|
|
1936
|
+
// }),
|
|
1937
|
+
// }) as any;
|
|
1938
|
+
// };
|
|
1939
|
+
extend(augmentation) {
|
|
1940
|
+
return new ZodObject({
|
|
1941
|
+
...this._def,
|
|
1942
|
+
shape: () => ({
|
|
1943
|
+
...this._def.shape(),
|
|
1944
|
+
...augmentation
|
|
1945
|
+
})
|
|
1946
|
+
});
|
|
1947
|
+
}
|
|
1948
|
+
/**
|
|
1949
|
+
* Prior to zod@1.0.12 there was a bug in the
|
|
1950
|
+
* inferred type of merged objects. Please
|
|
1951
|
+
* upgrade if you are experiencing issues.
|
|
1952
|
+
*/
|
|
1953
|
+
merge(merging) {
|
|
1954
|
+
const merged = new ZodObject({
|
|
1955
|
+
unknownKeys: merging._def.unknownKeys,
|
|
1956
|
+
catchall: merging._def.catchall,
|
|
1957
|
+
shape: () => ({
|
|
1958
|
+
...this._def.shape(),
|
|
1959
|
+
...merging._def.shape()
|
|
1960
|
+
}),
|
|
1961
|
+
typeName: ZodFirstPartyTypeKind.ZodObject
|
|
1962
|
+
});
|
|
1963
|
+
return merged;
|
|
1964
|
+
}
|
|
1965
|
+
// merge<
|
|
1966
|
+
// Incoming extends AnyZodObject,
|
|
1967
|
+
// Augmentation extends Incoming["shape"],
|
|
1968
|
+
// NewOutput extends {
|
|
1969
|
+
// [k in keyof Augmentation | keyof Output]: k extends keyof Augmentation
|
|
1970
|
+
// ? Augmentation[k]["_output"]
|
|
1971
|
+
// : k extends keyof Output
|
|
1972
|
+
// ? Output[k]
|
|
1973
|
+
// : never;
|
|
1974
|
+
// },
|
|
1975
|
+
// NewInput extends {
|
|
1976
|
+
// [k in keyof Augmentation | keyof Input]: k extends keyof Augmentation
|
|
1977
|
+
// ? Augmentation[k]["_input"]
|
|
1978
|
+
// : k extends keyof Input
|
|
1979
|
+
// ? Input[k]
|
|
1980
|
+
// : never;
|
|
1981
|
+
// }
|
|
1982
|
+
// >(
|
|
1983
|
+
// merging: Incoming
|
|
1984
|
+
// ): ZodObject<
|
|
1985
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
1986
|
+
// Incoming["_def"]["unknownKeys"],
|
|
1987
|
+
// Incoming["_def"]["catchall"],
|
|
1988
|
+
// NewOutput,
|
|
1989
|
+
// NewInput
|
|
1990
|
+
// > {
|
|
1991
|
+
// const merged: any = new ZodObject({
|
|
1992
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
1993
|
+
// catchall: merging._def.catchall,
|
|
1994
|
+
// shape: () =>
|
|
1995
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
1996
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
1997
|
+
// }) as any;
|
|
1998
|
+
// return merged;
|
|
1999
|
+
// }
|
|
2000
|
+
setKey(key, schema) {
|
|
2001
|
+
return this.augment({ [key]: schema });
|
|
2002
|
+
}
|
|
2003
|
+
// merge<Incoming extends AnyZodObject>(
|
|
2004
|
+
// merging: Incoming
|
|
2005
|
+
// ): //ZodObject<T & Incoming["_shape"], UnknownKeys, Catchall> = (merging) => {
|
|
2006
|
+
// ZodObject<
|
|
2007
|
+
// extendShape<T, ReturnType<Incoming["_def"]["shape"]>>,
|
|
2008
|
+
// Incoming["_def"]["unknownKeys"],
|
|
2009
|
+
// Incoming["_def"]["catchall"]
|
|
2010
|
+
// > {
|
|
2011
|
+
// // const mergedShape = objectUtil.mergeShapes(
|
|
2012
|
+
// // this._def.shape(),
|
|
2013
|
+
// // merging._def.shape()
|
|
2014
|
+
// // );
|
|
2015
|
+
// const merged: any = new ZodObject({
|
|
2016
|
+
// unknownKeys: merging._def.unknownKeys,
|
|
2017
|
+
// catchall: merging._def.catchall,
|
|
2018
|
+
// shape: () =>
|
|
2019
|
+
// objectUtil.mergeShapes(this._def.shape(), merging._def.shape()),
|
|
2020
|
+
// typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2021
|
+
// }) as any;
|
|
2022
|
+
// return merged;
|
|
2023
|
+
// }
|
|
2024
|
+
catchall(index) {
|
|
2025
|
+
return new ZodObject({
|
|
2026
|
+
...this._def,
|
|
2027
|
+
catchall: index
|
|
2028
|
+
});
|
|
2029
|
+
}
|
|
2030
|
+
pick(mask) {
|
|
2031
|
+
const shape = {};
|
|
2032
|
+
for (const key of util.objectKeys(mask)) {
|
|
2033
|
+
if (mask[key] && this.shape[key]) {
|
|
2034
|
+
shape[key] = this.shape[key];
|
|
2035
|
+
}
|
|
2036
|
+
}
|
|
2037
|
+
return new ZodObject({
|
|
2038
|
+
...this._def,
|
|
2039
|
+
shape: () => shape
|
|
2040
|
+
});
|
|
2041
|
+
}
|
|
2042
|
+
omit(mask) {
|
|
2043
|
+
const shape = {};
|
|
2044
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2045
|
+
if (!mask[key]) {
|
|
2046
|
+
shape[key] = this.shape[key];
|
|
2047
|
+
}
|
|
2048
|
+
}
|
|
2049
|
+
return new ZodObject({
|
|
2050
|
+
...this._def,
|
|
2051
|
+
shape: () => shape
|
|
2052
|
+
});
|
|
2053
|
+
}
|
|
2054
|
+
/**
|
|
2055
|
+
* @deprecated
|
|
2056
|
+
*/
|
|
2057
|
+
deepPartial() {
|
|
2058
|
+
return deepPartialify(this);
|
|
2059
|
+
}
|
|
2060
|
+
partial(mask) {
|
|
2061
|
+
const newShape = {};
|
|
2062
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2063
|
+
const fieldSchema = this.shape[key];
|
|
2064
|
+
if (mask && !mask[key]) {
|
|
2065
|
+
newShape[key] = fieldSchema;
|
|
2066
|
+
} else {
|
|
2067
|
+
newShape[key] = fieldSchema.optional();
|
|
2068
|
+
}
|
|
2069
|
+
}
|
|
2070
|
+
return new ZodObject({
|
|
2071
|
+
...this._def,
|
|
2072
|
+
shape: () => newShape
|
|
2073
|
+
});
|
|
2074
|
+
}
|
|
2075
|
+
required(mask) {
|
|
2076
|
+
const newShape = {};
|
|
2077
|
+
for (const key of util.objectKeys(this.shape)) {
|
|
2078
|
+
if (mask && !mask[key]) {
|
|
2079
|
+
newShape[key] = this.shape[key];
|
|
2080
|
+
} else {
|
|
2081
|
+
const fieldSchema = this.shape[key];
|
|
2082
|
+
let newField = fieldSchema;
|
|
2083
|
+
while (newField instanceof ZodOptional) {
|
|
2084
|
+
newField = newField._def.innerType;
|
|
2085
|
+
}
|
|
2086
|
+
newShape[key] = newField;
|
|
2087
|
+
}
|
|
2088
|
+
}
|
|
2089
|
+
return new ZodObject({
|
|
2090
|
+
...this._def,
|
|
2091
|
+
shape: () => newShape
|
|
2092
|
+
});
|
|
2093
|
+
}
|
|
2094
|
+
keyof() {
|
|
2095
|
+
return createZodEnum(util.objectKeys(this.shape));
|
|
2096
|
+
}
|
|
2097
|
+
}
|
|
2098
|
+
ZodObject.create = (shape, params) => {
|
|
2099
|
+
return new ZodObject({
|
|
2100
|
+
shape: () => shape,
|
|
2101
|
+
unknownKeys: "strip",
|
|
2102
|
+
catchall: ZodNever.create(),
|
|
2103
|
+
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2104
|
+
...processCreateParams(params)
|
|
2105
|
+
});
|
|
2106
|
+
};
|
|
2107
|
+
ZodObject.strictCreate = (shape, params) => {
|
|
2108
|
+
return new ZodObject({
|
|
2109
|
+
shape: () => shape,
|
|
2110
|
+
unknownKeys: "strict",
|
|
2111
|
+
catchall: ZodNever.create(),
|
|
2112
|
+
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2113
|
+
...processCreateParams(params)
|
|
2114
|
+
});
|
|
2115
|
+
};
|
|
2116
|
+
ZodObject.lazycreate = (shape, params) => {
|
|
2117
|
+
return new ZodObject({
|
|
2118
|
+
shape,
|
|
2119
|
+
unknownKeys: "strip",
|
|
2120
|
+
catchall: ZodNever.create(),
|
|
2121
|
+
typeName: ZodFirstPartyTypeKind.ZodObject,
|
|
2122
|
+
...processCreateParams(params)
|
|
2123
|
+
});
|
|
2124
|
+
};
|
|
2125
|
+
class ZodUnion extends ZodType {
|
|
2126
|
+
_parse(input) {
|
|
2127
|
+
const { ctx } = this._processInputParams(input);
|
|
2128
|
+
const options = this._def.options;
|
|
2129
|
+
function handleResults(results) {
|
|
2130
|
+
for (const result of results) {
|
|
2131
|
+
if (result.result.status === "valid") {
|
|
2132
|
+
return result.result;
|
|
2133
|
+
}
|
|
2134
|
+
}
|
|
2135
|
+
for (const result of results) {
|
|
2136
|
+
if (result.result.status === "dirty") {
|
|
2137
|
+
ctx.common.issues.push(...result.ctx.common.issues);
|
|
2138
|
+
return result.result;
|
|
2139
|
+
}
|
|
2140
|
+
}
|
|
2141
|
+
const unionErrors = results.map((result) => new ZodError(result.ctx.common.issues));
|
|
2142
|
+
addIssueToContext(ctx, {
|
|
2143
|
+
code: ZodIssueCode.invalid_union,
|
|
2144
|
+
unionErrors
|
|
2145
|
+
});
|
|
2146
|
+
return INVALID;
|
|
2147
|
+
}
|
|
2148
|
+
if (ctx.common.async) {
|
|
2149
|
+
return Promise.all(options.map(async (option) => {
|
|
2150
|
+
const childCtx = {
|
|
2151
|
+
...ctx,
|
|
2152
|
+
common: {
|
|
2153
|
+
...ctx.common,
|
|
2154
|
+
issues: []
|
|
2155
|
+
},
|
|
2156
|
+
parent: null
|
|
2157
|
+
};
|
|
2158
|
+
return {
|
|
2159
|
+
result: await option._parseAsync({
|
|
2160
|
+
data: ctx.data,
|
|
2161
|
+
path: ctx.path,
|
|
2162
|
+
parent: childCtx
|
|
2163
|
+
}),
|
|
2164
|
+
ctx: childCtx
|
|
2165
|
+
};
|
|
2166
|
+
})).then(handleResults);
|
|
2167
|
+
} else {
|
|
2168
|
+
let dirty = void 0;
|
|
2169
|
+
const issues = [];
|
|
2170
|
+
for (const option of options) {
|
|
2171
|
+
const childCtx = {
|
|
2172
|
+
...ctx,
|
|
2173
|
+
common: {
|
|
2174
|
+
...ctx.common,
|
|
2175
|
+
issues: []
|
|
2176
|
+
},
|
|
2177
|
+
parent: null
|
|
2178
|
+
};
|
|
2179
|
+
const result = option._parseSync({
|
|
2180
|
+
data: ctx.data,
|
|
2181
|
+
path: ctx.path,
|
|
2182
|
+
parent: childCtx
|
|
2183
|
+
});
|
|
2184
|
+
if (result.status === "valid") {
|
|
2185
|
+
return result;
|
|
2186
|
+
} else if (result.status === "dirty" && !dirty) {
|
|
2187
|
+
dirty = { result, ctx: childCtx };
|
|
2188
|
+
}
|
|
2189
|
+
if (childCtx.common.issues.length) {
|
|
2190
|
+
issues.push(childCtx.common.issues);
|
|
2191
|
+
}
|
|
2192
|
+
}
|
|
2193
|
+
if (dirty) {
|
|
2194
|
+
ctx.common.issues.push(...dirty.ctx.common.issues);
|
|
2195
|
+
return dirty.result;
|
|
2196
|
+
}
|
|
2197
|
+
const unionErrors = issues.map((issues2) => new ZodError(issues2));
|
|
2198
|
+
addIssueToContext(ctx, {
|
|
2199
|
+
code: ZodIssueCode.invalid_union,
|
|
2200
|
+
unionErrors
|
|
2201
|
+
});
|
|
2202
|
+
return INVALID;
|
|
2203
|
+
}
|
|
2204
|
+
}
|
|
2205
|
+
get options() {
|
|
2206
|
+
return this._def.options;
|
|
2207
|
+
}
|
|
2208
|
+
}
|
|
2209
|
+
ZodUnion.create = (types, params) => {
|
|
2210
|
+
return new ZodUnion({
|
|
2211
|
+
options: types,
|
|
2212
|
+
typeName: ZodFirstPartyTypeKind.ZodUnion,
|
|
2213
|
+
...processCreateParams(params)
|
|
2214
|
+
});
|
|
2215
|
+
};
|
|
2216
|
+
function mergeValues(a, b) {
|
|
2217
|
+
const aType = getParsedType(a);
|
|
2218
|
+
const bType = getParsedType(b);
|
|
2219
|
+
if (a === b) {
|
|
2220
|
+
return { valid: true, data: a };
|
|
2221
|
+
} else if (aType === ZodParsedType.object && bType === ZodParsedType.object) {
|
|
2222
|
+
const bKeys = util.objectKeys(b);
|
|
2223
|
+
const sharedKeys = util.objectKeys(a).filter((key) => bKeys.indexOf(key) !== -1);
|
|
2224
|
+
const newObj = { ...a, ...b };
|
|
2225
|
+
for (const key of sharedKeys) {
|
|
2226
|
+
const sharedValue = mergeValues(a[key], b[key]);
|
|
2227
|
+
if (!sharedValue.valid) {
|
|
2228
|
+
return { valid: false };
|
|
2229
|
+
}
|
|
2230
|
+
newObj[key] = sharedValue.data;
|
|
2231
|
+
}
|
|
2232
|
+
return { valid: true, data: newObj };
|
|
2233
|
+
} else if (aType === ZodParsedType.array && bType === ZodParsedType.array) {
|
|
2234
|
+
if (a.length !== b.length) {
|
|
2235
|
+
return { valid: false };
|
|
2236
|
+
}
|
|
2237
|
+
const newArray = [];
|
|
2238
|
+
for (let index = 0; index < a.length; index++) {
|
|
2239
|
+
const itemA = a[index];
|
|
2240
|
+
const itemB = b[index];
|
|
2241
|
+
const sharedValue = mergeValues(itemA, itemB);
|
|
2242
|
+
if (!sharedValue.valid) {
|
|
2243
|
+
return { valid: false };
|
|
2244
|
+
}
|
|
2245
|
+
newArray.push(sharedValue.data);
|
|
2246
|
+
}
|
|
2247
|
+
return { valid: true, data: newArray };
|
|
2248
|
+
} else if (aType === ZodParsedType.date && bType === ZodParsedType.date && +a === +b) {
|
|
2249
|
+
return { valid: true, data: a };
|
|
2250
|
+
} else {
|
|
2251
|
+
return { valid: false };
|
|
2252
|
+
}
|
|
2253
|
+
}
|
|
2254
|
+
class ZodIntersection extends ZodType {
|
|
2255
|
+
_parse(input) {
|
|
2256
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2257
|
+
const handleParsed = (parsedLeft, parsedRight) => {
|
|
2258
|
+
if (isAborted(parsedLeft) || isAborted(parsedRight)) {
|
|
2259
|
+
return INVALID;
|
|
2260
|
+
}
|
|
2261
|
+
const merged = mergeValues(parsedLeft.value, parsedRight.value);
|
|
2262
|
+
if (!merged.valid) {
|
|
2263
|
+
addIssueToContext(ctx, {
|
|
2264
|
+
code: ZodIssueCode.invalid_intersection_types
|
|
2265
|
+
});
|
|
2266
|
+
return INVALID;
|
|
2267
|
+
}
|
|
2268
|
+
if (isDirty(parsedLeft) || isDirty(parsedRight)) {
|
|
2269
|
+
status.dirty();
|
|
2270
|
+
}
|
|
2271
|
+
return { status: status.value, value: merged.data };
|
|
2272
|
+
};
|
|
2273
|
+
if (ctx.common.async) {
|
|
2274
|
+
return Promise.all([
|
|
2275
|
+
this._def.left._parseAsync({
|
|
2276
|
+
data: ctx.data,
|
|
2277
|
+
path: ctx.path,
|
|
2278
|
+
parent: ctx
|
|
2279
|
+
}),
|
|
2280
|
+
this._def.right._parseAsync({
|
|
2281
|
+
data: ctx.data,
|
|
2282
|
+
path: ctx.path,
|
|
2283
|
+
parent: ctx
|
|
2284
|
+
})
|
|
2285
|
+
]).then(([left, right]) => handleParsed(left, right));
|
|
2286
|
+
} else {
|
|
2287
|
+
return handleParsed(this._def.left._parseSync({
|
|
2288
|
+
data: ctx.data,
|
|
2289
|
+
path: ctx.path,
|
|
2290
|
+
parent: ctx
|
|
2291
|
+
}), this._def.right._parseSync({
|
|
2292
|
+
data: ctx.data,
|
|
2293
|
+
path: ctx.path,
|
|
2294
|
+
parent: ctx
|
|
2295
|
+
}));
|
|
2296
|
+
}
|
|
2297
|
+
}
|
|
2298
|
+
}
|
|
2299
|
+
ZodIntersection.create = (left, right, params) => {
|
|
2300
|
+
return new ZodIntersection({
|
|
2301
|
+
left,
|
|
2302
|
+
right,
|
|
2303
|
+
typeName: ZodFirstPartyTypeKind.ZodIntersection,
|
|
2304
|
+
...processCreateParams(params)
|
|
2305
|
+
});
|
|
2306
|
+
};
|
|
2307
|
+
class ZodTuple extends ZodType {
|
|
2308
|
+
_parse(input) {
|
|
2309
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2310
|
+
if (ctx.parsedType !== ZodParsedType.array) {
|
|
2311
|
+
addIssueToContext(ctx, {
|
|
2312
|
+
code: ZodIssueCode.invalid_type,
|
|
2313
|
+
expected: ZodParsedType.array,
|
|
2314
|
+
received: ctx.parsedType
|
|
2315
|
+
});
|
|
2316
|
+
return INVALID;
|
|
2317
|
+
}
|
|
2318
|
+
if (ctx.data.length < this._def.items.length) {
|
|
2319
|
+
addIssueToContext(ctx, {
|
|
2320
|
+
code: ZodIssueCode.too_small,
|
|
2321
|
+
minimum: this._def.items.length,
|
|
2322
|
+
inclusive: true,
|
|
2323
|
+
exact: false,
|
|
2324
|
+
type: "array"
|
|
2325
|
+
});
|
|
2326
|
+
return INVALID;
|
|
2327
|
+
}
|
|
2328
|
+
const rest = this._def.rest;
|
|
2329
|
+
if (!rest && ctx.data.length > this._def.items.length) {
|
|
2330
|
+
addIssueToContext(ctx, {
|
|
2331
|
+
code: ZodIssueCode.too_big,
|
|
2332
|
+
maximum: this._def.items.length,
|
|
2333
|
+
inclusive: true,
|
|
2334
|
+
exact: false,
|
|
2335
|
+
type: "array"
|
|
2336
|
+
});
|
|
2337
|
+
status.dirty();
|
|
2338
|
+
}
|
|
2339
|
+
const items = [...ctx.data].map((item, itemIndex) => {
|
|
2340
|
+
const schema = this._def.items[itemIndex] || this._def.rest;
|
|
2341
|
+
if (!schema)
|
|
2342
|
+
return null;
|
|
2343
|
+
return schema._parse(new ParseInputLazyPath(ctx, item, ctx.path, itemIndex));
|
|
2344
|
+
}).filter((x) => !!x);
|
|
2345
|
+
if (ctx.common.async) {
|
|
2346
|
+
return Promise.all(items).then((results) => {
|
|
2347
|
+
return ParseStatus.mergeArray(status, results);
|
|
2348
|
+
});
|
|
2349
|
+
} else {
|
|
2350
|
+
return ParseStatus.mergeArray(status, items);
|
|
2351
|
+
}
|
|
2352
|
+
}
|
|
2353
|
+
get items() {
|
|
2354
|
+
return this._def.items;
|
|
2355
|
+
}
|
|
2356
|
+
rest(rest) {
|
|
2357
|
+
return new ZodTuple({
|
|
2358
|
+
...this._def,
|
|
2359
|
+
rest
|
|
2360
|
+
});
|
|
2361
|
+
}
|
|
2362
|
+
}
|
|
2363
|
+
ZodTuple.create = (schemas, params) => {
|
|
2364
|
+
if (!Array.isArray(schemas)) {
|
|
2365
|
+
throw new Error("You must pass an array of schemas to z.tuple([ ... ])");
|
|
2366
|
+
}
|
|
2367
|
+
return new ZodTuple({
|
|
2368
|
+
items: schemas,
|
|
2369
|
+
typeName: ZodFirstPartyTypeKind.ZodTuple,
|
|
2370
|
+
rest: null,
|
|
2371
|
+
...processCreateParams(params)
|
|
2372
|
+
});
|
|
2373
|
+
};
|
|
2374
|
+
class ZodMap extends ZodType {
|
|
2375
|
+
get keySchema() {
|
|
2376
|
+
return this._def.keyType;
|
|
2377
|
+
}
|
|
2378
|
+
get valueSchema() {
|
|
2379
|
+
return this._def.valueType;
|
|
2380
|
+
}
|
|
2381
|
+
_parse(input) {
|
|
2382
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2383
|
+
if (ctx.parsedType !== ZodParsedType.map) {
|
|
2384
|
+
addIssueToContext(ctx, {
|
|
2385
|
+
code: ZodIssueCode.invalid_type,
|
|
2386
|
+
expected: ZodParsedType.map,
|
|
2387
|
+
received: ctx.parsedType
|
|
2388
|
+
});
|
|
2389
|
+
return INVALID;
|
|
2390
|
+
}
|
|
2391
|
+
const keyType = this._def.keyType;
|
|
2392
|
+
const valueType = this._def.valueType;
|
|
2393
|
+
const pairs = [...ctx.data.entries()].map(([key, value], index) => {
|
|
2394
|
+
return {
|
|
2395
|
+
key: keyType._parse(new ParseInputLazyPath(ctx, key, ctx.path, [index, "key"])),
|
|
2396
|
+
value: valueType._parse(new ParseInputLazyPath(ctx, value, ctx.path, [index, "value"]))
|
|
2397
|
+
};
|
|
2398
|
+
});
|
|
2399
|
+
if (ctx.common.async) {
|
|
2400
|
+
const finalMap = /* @__PURE__ */ new Map();
|
|
2401
|
+
return Promise.resolve().then(async () => {
|
|
2402
|
+
for (const pair of pairs) {
|
|
2403
|
+
const key = await pair.key;
|
|
2404
|
+
const value = await pair.value;
|
|
2405
|
+
if (key.status === "aborted" || value.status === "aborted") {
|
|
2406
|
+
return INVALID;
|
|
2407
|
+
}
|
|
2408
|
+
if (key.status === "dirty" || value.status === "dirty") {
|
|
2409
|
+
status.dirty();
|
|
2410
|
+
}
|
|
2411
|
+
finalMap.set(key.value, value.value);
|
|
2412
|
+
}
|
|
2413
|
+
return { status: status.value, value: finalMap };
|
|
2414
|
+
});
|
|
2415
|
+
} else {
|
|
2416
|
+
const finalMap = /* @__PURE__ */ new Map();
|
|
2417
|
+
for (const pair of pairs) {
|
|
2418
|
+
const key = pair.key;
|
|
2419
|
+
const value = pair.value;
|
|
2420
|
+
if (key.status === "aborted" || value.status === "aborted") {
|
|
2421
|
+
return INVALID;
|
|
2422
|
+
}
|
|
2423
|
+
if (key.status === "dirty" || value.status === "dirty") {
|
|
2424
|
+
status.dirty();
|
|
2425
|
+
}
|
|
2426
|
+
finalMap.set(key.value, value.value);
|
|
2427
|
+
}
|
|
2428
|
+
return { status: status.value, value: finalMap };
|
|
2429
|
+
}
|
|
2430
|
+
}
|
|
2431
|
+
}
|
|
2432
|
+
ZodMap.create = (keyType, valueType, params) => {
|
|
2433
|
+
return new ZodMap({
|
|
2434
|
+
valueType,
|
|
2435
|
+
keyType,
|
|
2436
|
+
typeName: ZodFirstPartyTypeKind.ZodMap,
|
|
2437
|
+
...processCreateParams(params)
|
|
2438
|
+
});
|
|
2439
|
+
};
|
|
2440
|
+
class ZodSet extends ZodType {
|
|
2441
|
+
_parse(input) {
|
|
2442
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2443
|
+
if (ctx.parsedType !== ZodParsedType.set) {
|
|
2444
|
+
addIssueToContext(ctx, {
|
|
2445
|
+
code: ZodIssueCode.invalid_type,
|
|
2446
|
+
expected: ZodParsedType.set,
|
|
2447
|
+
received: ctx.parsedType
|
|
2448
|
+
});
|
|
2449
|
+
return INVALID;
|
|
2450
|
+
}
|
|
2451
|
+
const def = this._def;
|
|
2452
|
+
if (def.minSize !== null) {
|
|
2453
|
+
if (ctx.data.size < def.minSize.value) {
|
|
2454
|
+
addIssueToContext(ctx, {
|
|
2455
|
+
code: ZodIssueCode.too_small,
|
|
2456
|
+
minimum: def.minSize.value,
|
|
2457
|
+
type: "set",
|
|
2458
|
+
inclusive: true,
|
|
2459
|
+
exact: false,
|
|
2460
|
+
message: def.minSize.message
|
|
2461
|
+
});
|
|
2462
|
+
status.dirty();
|
|
2463
|
+
}
|
|
2464
|
+
}
|
|
2465
|
+
if (def.maxSize !== null) {
|
|
2466
|
+
if (ctx.data.size > def.maxSize.value) {
|
|
2467
|
+
addIssueToContext(ctx, {
|
|
2468
|
+
code: ZodIssueCode.too_big,
|
|
2469
|
+
maximum: def.maxSize.value,
|
|
2470
|
+
type: "set",
|
|
2471
|
+
inclusive: true,
|
|
2472
|
+
exact: false,
|
|
2473
|
+
message: def.maxSize.message
|
|
2474
|
+
});
|
|
2475
|
+
status.dirty();
|
|
2476
|
+
}
|
|
2477
|
+
}
|
|
2478
|
+
const valueType = this._def.valueType;
|
|
2479
|
+
function finalizeSet(elements2) {
|
|
2480
|
+
const parsedSet = /* @__PURE__ */ new Set();
|
|
2481
|
+
for (const element of elements2) {
|
|
2482
|
+
if (element.status === "aborted")
|
|
2483
|
+
return INVALID;
|
|
2484
|
+
if (element.status === "dirty")
|
|
2485
|
+
status.dirty();
|
|
2486
|
+
parsedSet.add(element.value);
|
|
2487
|
+
}
|
|
2488
|
+
return { status: status.value, value: parsedSet };
|
|
2489
|
+
}
|
|
2490
|
+
const elements = [...ctx.data.values()].map((item, i) => valueType._parse(new ParseInputLazyPath(ctx, item, ctx.path, i)));
|
|
2491
|
+
if (ctx.common.async) {
|
|
2492
|
+
return Promise.all(elements).then((elements2) => finalizeSet(elements2));
|
|
2493
|
+
} else {
|
|
2494
|
+
return finalizeSet(elements);
|
|
2495
|
+
}
|
|
2496
|
+
}
|
|
2497
|
+
min(minSize, message) {
|
|
2498
|
+
return new ZodSet({
|
|
2499
|
+
...this._def,
|
|
2500
|
+
minSize: { value: minSize, message: errorUtil.toString(message) }
|
|
2501
|
+
});
|
|
2502
|
+
}
|
|
2503
|
+
max(maxSize, message) {
|
|
2504
|
+
return new ZodSet({
|
|
2505
|
+
...this._def,
|
|
2506
|
+
maxSize: { value: maxSize, message: errorUtil.toString(message) }
|
|
2507
|
+
});
|
|
2508
|
+
}
|
|
2509
|
+
size(size, message) {
|
|
2510
|
+
return this.min(size, message).max(size, message);
|
|
2511
|
+
}
|
|
2512
|
+
nonempty(message) {
|
|
2513
|
+
return this.min(1, message);
|
|
2514
|
+
}
|
|
2515
|
+
}
|
|
2516
|
+
ZodSet.create = (valueType, params) => {
|
|
2517
|
+
return new ZodSet({
|
|
2518
|
+
valueType,
|
|
2519
|
+
minSize: null,
|
|
2520
|
+
maxSize: null,
|
|
2521
|
+
typeName: ZodFirstPartyTypeKind.ZodSet,
|
|
2522
|
+
...processCreateParams(params)
|
|
2523
|
+
});
|
|
2524
|
+
};
|
|
2525
|
+
class ZodLazy extends ZodType {
|
|
2526
|
+
get schema() {
|
|
2527
|
+
return this._def.getter();
|
|
2528
|
+
}
|
|
2529
|
+
_parse(input) {
|
|
2530
|
+
const { ctx } = this._processInputParams(input);
|
|
2531
|
+
const lazySchema = this._def.getter();
|
|
2532
|
+
return lazySchema._parse({ data: ctx.data, path: ctx.path, parent: ctx });
|
|
2533
|
+
}
|
|
2534
|
+
}
|
|
2535
|
+
ZodLazy.create = (getter, params) => {
|
|
2536
|
+
return new ZodLazy({
|
|
2537
|
+
getter,
|
|
2538
|
+
typeName: ZodFirstPartyTypeKind.ZodLazy,
|
|
2539
|
+
...processCreateParams(params)
|
|
2540
|
+
});
|
|
2541
|
+
};
|
|
2542
|
+
class ZodLiteral extends ZodType {
|
|
2543
|
+
_parse(input) {
|
|
2544
|
+
if (input.data !== this._def.value) {
|
|
2545
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2546
|
+
addIssueToContext(ctx, {
|
|
2547
|
+
received: ctx.data,
|
|
2548
|
+
code: ZodIssueCode.invalid_literal,
|
|
2549
|
+
expected: this._def.value
|
|
2550
|
+
});
|
|
2551
|
+
return INVALID;
|
|
2552
|
+
}
|
|
2553
|
+
return { status: "valid", value: input.data };
|
|
2554
|
+
}
|
|
2555
|
+
get value() {
|
|
2556
|
+
return this._def.value;
|
|
2557
|
+
}
|
|
2558
|
+
}
|
|
2559
|
+
ZodLiteral.create = (value, params) => {
|
|
2560
|
+
return new ZodLiteral({
|
|
2561
|
+
value,
|
|
2562
|
+
typeName: ZodFirstPartyTypeKind.ZodLiteral,
|
|
2563
|
+
...processCreateParams(params)
|
|
2564
|
+
});
|
|
2565
|
+
};
|
|
2566
|
+
function createZodEnum(values, params) {
|
|
2567
|
+
return new ZodEnum({
|
|
2568
|
+
values,
|
|
2569
|
+
typeName: ZodFirstPartyTypeKind.ZodEnum,
|
|
2570
|
+
...processCreateParams(params)
|
|
2571
|
+
});
|
|
2572
|
+
}
|
|
2573
|
+
class ZodEnum extends ZodType {
|
|
2574
|
+
_parse(input) {
|
|
2575
|
+
if (typeof input.data !== "string") {
|
|
2576
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2577
|
+
const expectedValues = this._def.values;
|
|
2578
|
+
addIssueToContext(ctx, {
|
|
2579
|
+
expected: util.joinValues(expectedValues),
|
|
2580
|
+
received: ctx.parsedType,
|
|
2581
|
+
code: ZodIssueCode.invalid_type
|
|
2582
|
+
});
|
|
2583
|
+
return INVALID;
|
|
2584
|
+
}
|
|
2585
|
+
if (!this._cache) {
|
|
2586
|
+
this._cache = new Set(this._def.values);
|
|
2587
|
+
}
|
|
2588
|
+
if (!this._cache.has(input.data)) {
|
|
2589
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2590
|
+
const expectedValues = this._def.values;
|
|
2591
|
+
addIssueToContext(ctx, {
|
|
2592
|
+
received: ctx.data,
|
|
2593
|
+
code: ZodIssueCode.invalid_enum_value,
|
|
2594
|
+
options: expectedValues
|
|
2595
|
+
});
|
|
2596
|
+
return INVALID;
|
|
2597
|
+
}
|
|
2598
|
+
return OK(input.data);
|
|
2599
|
+
}
|
|
2600
|
+
get options() {
|
|
2601
|
+
return this._def.values;
|
|
2602
|
+
}
|
|
2603
|
+
get enum() {
|
|
2604
|
+
const enumValues = {};
|
|
2605
|
+
for (const val of this._def.values) {
|
|
2606
|
+
enumValues[val] = val;
|
|
2607
|
+
}
|
|
2608
|
+
return enumValues;
|
|
2609
|
+
}
|
|
2610
|
+
get Values() {
|
|
2611
|
+
const enumValues = {};
|
|
2612
|
+
for (const val of this._def.values) {
|
|
2613
|
+
enumValues[val] = val;
|
|
2614
|
+
}
|
|
2615
|
+
return enumValues;
|
|
2616
|
+
}
|
|
2617
|
+
get Enum() {
|
|
2618
|
+
const enumValues = {};
|
|
2619
|
+
for (const val of this._def.values) {
|
|
2620
|
+
enumValues[val] = val;
|
|
2621
|
+
}
|
|
2622
|
+
return enumValues;
|
|
2623
|
+
}
|
|
2624
|
+
extract(values, newDef = this._def) {
|
|
2625
|
+
return ZodEnum.create(values, {
|
|
2626
|
+
...this._def,
|
|
2627
|
+
...newDef
|
|
2628
|
+
});
|
|
2629
|
+
}
|
|
2630
|
+
exclude(values, newDef = this._def) {
|
|
2631
|
+
return ZodEnum.create(this.options.filter((opt) => !values.includes(opt)), {
|
|
2632
|
+
...this._def,
|
|
2633
|
+
...newDef
|
|
2634
|
+
});
|
|
2635
|
+
}
|
|
2636
|
+
}
|
|
2637
|
+
ZodEnum.create = createZodEnum;
|
|
2638
|
+
class ZodNativeEnum extends ZodType {
|
|
2639
|
+
_parse(input) {
|
|
2640
|
+
const nativeEnumValues = util.getValidEnumValues(this._def.values);
|
|
2641
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2642
|
+
if (ctx.parsedType !== ZodParsedType.string && ctx.parsedType !== ZodParsedType.number) {
|
|
2643
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
|
2644
|
+
addIssueToContext(ctx, {
|
|
2645
|
+
expected: util.joinValues(expectedValues),
|
|
2646
|
+
received: ctx.parsedType,
|
|
2647
|
+
code: ZodIssueCode.invalid_type
|
|
2648
|
+
});
|
|
2649
|
+
return INVALID;
|
|
2650
|
+
}
|
|
2651
|
+
if (!this._cache) {
|
|
2652
|
+
this._cache = new Set(util.getValidEnumValues(this._def.values));
|
|
2653
|
+
}
|
|
2654
|
+
if (!this._cache.has(input.data)) {
|
|
2655
|
+
const expectedValues = util.objectValues(nativeEnumValues);
|
|
2656
|
+
addIssueToContext(ctx, {
|
|
2657
|
+
received: ctx.data,
|
|
2658
|
+
code: ZodIssueCode.invalid_enum_value,
|
|
2659
|
+
options: expectedValues
|
|
2660
|
+
});
|
|
2661
|
+
return INVALID;
|
|
2662
|
+
}
|
|
2663
|
+
return OK(input.data);
|
|
2664
|
+
}
|
|
2665
|
+
get enum() {
|
|
2666
|
+
return this._def.values;
|
|
2667
|
+
}
|
|
2668
|
+
}
|
|
2669
|
+
ZodNativeEnum.create = (values, params) => {
|
|
2670
|
+
return new ZodNativeEnum({
|
|
2671
|
+
values,
|
|
2672
|
+
typeName: ZodFirstPartyTypeKind.ZodNativeEnum,
|
|
2673
|
+
...processCreateParams(params)
|
|
2674
|
+
});
|
|
2675
|
+
};
|
|
2676
|
+
class ZodPromise extends ZodType {
|
|
2677
|
+
unwrap() {
|
|
2678
|
+
return this._def.type;
|
|
2679
|
+
}
|
|
2680
|
+
_parse(input) {
|
|
2681
|
+
const { ctx } = this._processInputParams(input);
|
|
2682
|
+
if (ctx.parsedType !== ZodParsedType.promise && ctx.common.async === false) {
|
|
2683
|
+
addIssueToContext(ctx, {
|
|
2684
|
+
code: ZodIssueCode.invalid_type,
|
|
2685
|
+
expected: ZodParsedType.promise,
|
|
2686
|
+
received: ctx.parsedType
|
|
2687
|
+
});
|
|
2688
|
+
return INVALID;
|
|
2689
|
+
}
|
|
2690
|
+
const promisified = ctx.parsedType === ZodParsedType.promise ? ctx.data : Promise.resolve(ctx.data);
|
|
2691
|
+
return OK(promisified.then((data) => {
|
|
2692
|
+
return this._def.type.parseAsync(data, {
|
|
2693
|
+
path: ctx.path,
|
|
2694
|
+
errorMap: ctx.common.contextualErrorMap
|
|
2695
|
+
});
|
|
2696
|
+
}));
|
|
2697
|
+
}
|
|
2698
|
+
}
|
|
2699
|
+
ZodPromise.create = (schema, params) => {
|
|
2700
|
+
return new ZodPromise({
|
|
2701
|
+
type: schema,
|
|
2702
|
+
typeName: ZodFirstPartyTypeKind.ZodPromise,
|
|
2703
|
+
...processCreateParams(params)
|
|
2704
|
+
});
|
|
2705
|
+
};
|
|
2706
|
+
class ZodEffects extends ZodType {
|
|
2707
|
+
innerType() {
|
|
2708
|
+
return this._def.schema;
|
|
2709
|
+
}
|
|
2710
|
+
sourceType() {
|
|
2711
|
+
return this._def.schema._def.typeName === ZodFirstPartyTypeKind.ZodEffects ? this._def.schema.sourceType() : this._def.schema;
|
|
2712
|
+
}
|
|
2713
|
+
_parse(input) {
|
|
2714
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2715
|
+
const effect = this._def.effect || null;
|
|
2716
|
+
const checkCtx = {
|
|
2717
|
+
addIssue: (arg) => {
|
|
2718
|
+
addIssueToContext(ctx, arg);
|
|
2719
|
+
if (arg.fatal) {
|
|
2720
|
+
status.abort();
|
|
2721
|
+
} else {
|
|
2722
|
+
status.dirty();
|
|
2723
|
+
}
|
|
2724
|
+
},
|
|
2725
|
+
get path() {
|
|
2726
|
+
return ctx.path;
|
|
2727
|
+
}
|
|
2728
|
+
};
|
|
2729
|
+
checkCtx.addIssue = checkCtx.addIssue.bind(checkCtx);
|
|
2730
|
+
if (effect.type === "preprocess") {
|
|
2731
|
+
const processed = effect.transform(ctx.data, checkCtx);
|
|
2732
|
+
if (ctx.common.async) {
|
|
2733
|
+
return Promise.resolve(processed).then(async (processed2) => {
|
|
2734
|
+
if (status.value === "aborted")
|
|
2735
|
+
return INVALID;
|
|
2736
|
+
const result = await this._def.schema._parseAsync({
|
|
2737
|
+
data: processed2,
|
|
2738
|
+
path: ctx.path,
|
|
2739
|
+
parent: ctx
|
|
2740
|
+
});
|
|
2741
|
+
if (result.status === "aborted")
|
|
2742
|
+
return INVALID;
|
|
2743
|
+
if (result.status === "dirty")
|
|
2744
|
+
return DIRTY(result.value);
|
|
2745
|
+
if (status.value === "dirty")
|
|
2746
|
+
return DIRTY(result.value);
|
|
2747
|
+
return result;
|
|
2748
|
+
});
|
|
2749
|
+
} else {
|
|
2750
|
+
if (status.value === "aborted")
|
|
2751
|
+
return INVALID;
|
|
2752
|
+
const result = this._def.schema._parseSync({
|
|
2753
|
+
data: processed,
|
|
2754
|
+
path: ctx.path,
|
|
2755
|
+
parent: ctx
|
|
2756
|
+
});
|
|
2757
|
+
if (result.status === "aborted")
|
|
2758
|
+
return INVALID;
|
|
2759
|
+
if (result.status === "dirty")
|
|
2760
|
+
return DIRTY(result.value);
|
|
2761
|
+
if (status.value === "dirty")
|
|
2762
|
+
return DIRTY(result.value);
|
|
2763
|
+
return result;
|
|
2764
|
+
}
|
|
2765
|
+
}
|
|
2766
|
+
if (effect.type === "refinement") {
|
|
2767
|
+
const executeRefinement = (acc) => {
|
|
2768
|
+
const result = effect.refinement(acc, checkCtx);
|
|
2769
|
+
if (ctx.common.async) {
|
|
2770
|
+
return Promise.resolve(result);
|
|
2771
|
+
}
|
|
2772
|
+
if (result instanceof Promise) {
|
|
2773
|
+
throw new Error("Async refinement encountered during synchronous parse operation. Use .parseAsync instead.");
|
|
2774
|
+
}
|
|
2775
|
+
return acc;
|
|
2776
|
+
};
|
|
2777
|
+
if (ctx.common.async === false) {
|
|
2778
|
+
const inner = this._def.schema._parseSync({
|
|
2779
|
+
data: ctx.data,
|
|
2780
|
+
path: ctx.path,
|
|
2781
|
+
parent: ctx
|
|
2782
|
+
});
|
|
2783
|
+
if (inner.status === "aborted")
|
|
2784
|
+
return INVALID;
|
|
2785
|
+
if (inner.status === "dirty")
|
|
2786
|
+
status.dirty();
|
|
2787
|
+
executeRefinement(inner.value);
|
|
2788
|
+
return { status: status.value, value: inner.value };
|
|
2789
|
+
} else {
|
|
2790
|
+
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((inner) => {
|
|
2791
|
+
if (inner.status === "aborted")
|
|
2792
|
+
return INVALID;
|
|
2793
|
+
if (inner.status === "dirty")
|
|
2794
|
+
status.dirty();
|
|
2795
|
+
return executeRefinement(inner.value).then(() => {
|
|
2796
|
+
return { status: status.value, value: inner.value };
|
|
2797
|
+
});
|
|
2798
|
+
});
|
|
2799
|
+
}
|
|
2800
|
+
}
|
|
2801
|
+
if (effect.type === "transform") {
|
|
2802
|
+
if (ctx.common.async === false) {
|
|
2803
|
+
const base = this._def.schema._parseSync({
|
|
2804
|
+
data: ctx.data,
|
|
2805
|
+
path: ctx.path,
|
|
2806
|
+
parent: ctx
|
|
2807
|
+
});
|
|
2808
|
+
if (!isValid(base))
|
|
2809
|
+
return INVALID;
|
|
2810
|
+
const result = effect.transform(base.value, checkCtx);
|
|
2811
|
+
if (result instanceof Promise) {
|
|
2812
|
+
throw new Error(`Asynchronous transform encountered during synchronous parse operation. Use .parseAsync instead.`);
|
|
2813
|
+
}
|
|
2814
|
+
return { status: status.value, value: result };
|
|
2815
|
+
} else {
|
|
2816
|
+
return this._def.schema._parseAsync({ data: ctx.data, path: ctx.path, parent: ctx }).then((base) => {
|
|
2817
|
+
if (!isValid(base))
|
|
2818
|
+
return INVALID;
|
|
2819
|
+
return Promise.resolve(effect.transform(base.value, checkCtx)).then((result) => ({
|
|
2820
|
+
status: status.value,
|
|
2821
|
+
value: result
|
|
2822
|
+
}));
|
|
2823
|
+
});
|
|
2824
|
+
}
|
|
2825
|
+
}
|
|
2826
|
+
util.assertNever(effect);
|
|
2827
|
+
}
|
|
2828
|
+
}
|
|
2829
|
+
ZodEffects.create = (schema, effect, params) => {
|
|
2830
|
+
return new ZodEffects({
|
|
2831
|
+
schema,
|
|
2832
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
2833
|
+
effect,
|
|
2834
|
+
...processCreateParams(params)
|
|
2835
|
+
});
|
|
2836
|
+
};
|
|
2837
|
+
ZodEffects.createWithPreprocess = (preprocess, schema, params) => {
|
|
2838
|
+
return new ZodEffects({
|
|
2839
|
+
schema,
|
|
2840
|
+
effect: { type: "preprocess", transform: preprocess },
|
|
2841
|
+
typeName: ZodFirstPartyTypeKind.ZodEffects,
|
|
2842
|
+
...processCreateParams(params)
|
|
2843
|
+
});
|
|
2844
|
+
};
|
|
2845
|
+
class ZodOptional extends ZodType {
|
|
2846
|
+
_parse(input) {
|
|
2847
|
+
const parsedType = this._getType(input);
|
|
2848
|
+
if (parsedType === ZodParsedType.undefined) {
|
|
2849
|
+
return OK(void 0);
|
|
2850
|
+
}
|
|
2851
|
+
return this._def.innerType._parse(input);
|
|
2852
|
+
}
|
|
2853
|
+
unwrap() {
|
|
2854
|
+
return this._def.innerType;
|
|
2855
|
+
}
|
|
2856
|
+
}
|
|
2857
|
+
ZodOptional.create = (type, params) => {
|
|
2858
|
+
return new ZodOptional({
|
|
2859
|
+
innerType: type,
|
|
2860
|
+
typeName: ZodFirstPartyTypeKind.ZodOptional,
|
|
2861
|
+
...processCreateParams(params)
|
|
2862
|
+
});
|
|
2863
|
+
};
|
|
2864
|
+
class ZodNullable extends ZodType {
|
|
2865
|
+
_parse(input) {
|
|
2866
|
+
const parsedType = this._getType(input);
|
|
2867
|
+
if (parsedType === ZodParsedType.null) {
|
|
2868
|
+
return OK(null);
|
|
2869
|
+
}
|
|
2870
|
+
return this._def.innerType._parse(input);
|
|
2871
|
+
}
|
|
2872
|
+
unwrap() {
|
|
2873
|
+
return this._def.innerType;
|
|
2874
|
+
}
|
|
2875
|
+
}
|
|
2876
|
+
ZodNullable.create = (type, params) => {
|
|
2877
|
+
return new ZodNullable({
|
|
2878
|
+
innerType: type,
|
|
2879
|
+
typeName: ZodFirstPartyTypeKind.ZodNullable,
|
|
2880
|
+
...processCreateParams(params)
|
|
2881
|
+
});
|
|
2882
|
+
};
|
|
2883
|
+
class ZodDefault extends ZodType {
|
|
2884
|
+
_parse(input) {
|
|
2885
|
+
const { ctx } = this._processInputParams(input);
|
|
2886
|
+
let data = ctx.data;
|
|
2887
|
+
if (ctx.parsedType === ZodParsedType.undefined) {
|
|
2888
|
+
data = this._def.defaultValue();
|
|
2889
|
+
}
|
|
2890
|
+
return this._def.innerType._parse({
|
|
2891
|
+
data,
|
|
2892
|
+
path: ctx.path,
|
|
2893
|
+
parent: ctx
|
|
2894
|
+
});
|
|
2895
|
+
}
|
|
2896
|
+
removeDefault() {
|
|
2897
|
+
return this._def.innerType;
|
|
2898
|
+
}
|
|
2899
|
+
}
|
|
2900
|
+
ZodDefault.create = (type, params) => {
|
|
2901
|
+
return new ZodDefault({
|
|
2902
|
+
innerType: type,
|
|
2903
|
+
typeName: ZodFirstPartyTypeKind.ZodDefault,
|
|
2904
|
+
defaultValue: typeof params.default === "function" ? params.default : () => params.default,
|
|
2905
|
+
...processCreateParams(params)
|
|
2906
|
+
});
|
|
2907
|
+
};
|
|
2908
|
+
class ZodCatch extends ZodType {
|
|
2909
|
+
_parse(input) {
|
|
2910
|
+
const { ctx } = this._processInputParams(input);
|
|
2911
|
+
const newCtx = {
|
|
2912
|
+
...ctx,
|
|
2913
|
+
common: {
|
|
2914
|
+
...ctx.common,
|
|
2915
|
+
issues: []
|
|
2916
|
+
}
|
|
2917
|
+
};
|
|
2918
|
+
const result = this._def.innerType._parse({
|
|
2919
|
+
data: newCtx.data,
|
|
2920
|
+
path: newCtx.path,
|
|
2921
|
+
parent: {
|
|
2922
|
+
...newCtx
|
|
2923
|
+
}
|
|
2924
|
+
});
|
|
2925
|
+
if (isAsync(result)) {
|
|
2926
|
+
return result.then((result2) => {
|
|
2927
|
+
return {
|
|
2928
|
+
status: "valid",
|
|
2929
|
+
value: result2.status === "valid" ? result2.value : this._def.catchValue({
|
|
2930
|
+
get error() {
|
|
2931
|
+
return new ZodError(newCtx.common.issues);
|
|
2932
|
+
},
|
|
2933
|
+
input: newCtx.data
|
|
2934
|
+
})
|
|
2935
|
+
};
|
|
2936
|
+
});
|
|
2937
|
+
} else {
|
|
2938
|
+
return {
|
|
2939
|
+
status: "valid",
|
|
2940
|
+
value: result.status === "valid" ? result.value : this._def.catchValue({
|
|
2941
|
+
get error() {
|
|
2942
|
+
return new ZodError(newCtx.common.issues);
|
|
2943
|
+
},
|
|
2944
|
+
input: newCtx.data
|
|
2945
|
+
})
|
|
2946
|
+
};
|
|
2947
|
+
}
|
|
2948
|
+
}
|
|
2949
|
+
removeCatch() {
|
|
2950
|
+
return this._def.innerType;
|
|
2951
|
+
}
|
|
2952
|
+
}
|
|
2953
|
+
ZodCatch.create = (type, params) => {
|
|
2954
|
+
return new ZodCatch({
|
|
2955
|
+
innerType: type,
|
|
2956
|
+
typeName: ZodFirstPartyTypeKind.ZodCatch,
|
|
2957
|
+
catchValue: typeof params.catch === "function" ? params.catch : () => params.catch,
|
|
2958
|
+
...processCreateParams(params)
|
|
2959
|
+
});
|
|
2960
|
+
};
|
|
2961
|
+
class ZodNaN extends ZodType {
|
|
2962
|
+
_parse(input) {
|
|
2963
|
+
const parsedType = this._getType(input);
|
|
2964
|
+
if (parsedType !== ZodParsedType.nan) {
|
|
2965
|
+
const ctx = this._getOrReturnCtx(input);
|
|
2966
|
+
addIssueToContext(ctx, {
|
|
2967
|
+
code: ZodIssueCode.invalid_type,
|
|
2968
|
+
expected: ZodParsedType.nan,
|
|
2969
|
+
received: ctx.parsedType
|
|
2970
|
+
});
|
|
2971
|
+
return INVALID;
|
|
2972
|
+
}
|
|
2973
|
+
return { status: "valid", value: input.data };
|
|
2974
|
+
}
|
|
2975
|
+
}
|
|
2976
|
+
ZodNaN.create = (params) => {
|
|
2977
|
+
return new ZodNaN({
|
|
2978
|
+
typeName: ZodFirstPartyTypeKind.ZodNaN,
|
|
2979
|
+
...processCreateParams(params)
|
|
2980
|
+
});
|
|
2981
|
+
};
|
|
2982
|
+
class ZodBranded extends ZodType {
|
|
2983
|
+
_parse(input) {
|
|
2984
|
+
const { ctx } = this._processInputParams(input);
|
|
2985
|
+
const data = ctx.data;
|
|
2986
|
+
return this._def.type._parse({
|
|
2987
|
+
data,
|
|
2988
|
+
path: ctx.path,
|
|
2989
|
+
parent: ctx
|
|
2990
|
+
});
|
|
2991
|
+
}
|
|
2992
|
+
unwrap() {
|
|
2993
|
+
return this._def.type;
|
|
2994
|
+
}
|
|
2995
|
+
}
|
|
2996
|
+
class ZodPipeline extends ZodType {
|
|
2997
|
+
_parse(input) {
|
|
2998
|
+
const { status, ctx } = this._processInputParams(input);
|
|
2999
|
+
if (ctx.common.async) {
|
|
3000
|
+
const handleAsync = async () => {
|
|
3001
|
+
const inResult = await this._def.in._parseAsync({
|
|
3002
|
+
data: ctx.data,
|
|
3003
|
+
path: ctx.path,
|
|
3004
|
+
parent: ctx
|
|
3005
|
+
});
|
|
3006
|
+
if (inResult.status === "aborted")
|
|
3007
|
+
return INVALID;
|
|
3008
|
+
if (inResult.status === "dirty") {
|
|
3009
|
+
status.dirty();
|
|
3010
|
+
return DIRTY(inResult.value);
|
|
3011
|
+
} else {
|
|
3012
|
+
return this._def.out._parseAsync({
|
|
3013
|
+
data: inResult.value,
|
|
3014
|
+
path: ctx.path,
|
|
3015
|
+
parent: ctx
|
|
3016
|
+
});
|
|
3017
|
+
}
|
|
3018
|
+
};
|
|
3019
|
+
return handleAsync();
|
|
3020
|
+
} else {
|
|
3021
|
+
const inResult = this._def.in._parseSync({
|
|
3022
|
+
data: ctx.data,
|
|
3023
|
+
path: ctx.path,
|
|
3024
|
+
parent: ctx
|
|
3025
|
+
});
|
|
3026
|
+
if (inResult.status === "aborted")
|
|
3027
|
+
return INVALID;
|
|
3028
|
+
if (inResult.status === "dirty") {
|
|
3029
|
+
status.dirty();
|
|
3030
|
+
return {
|
|
3031
|
+
status: "dirty",
|
|
3032
|
+
value: inResult.value
|
|
3033
|
+
};
|
|
3034
|
+
} else {
|
|
3035
|
+
return this._def.out._parseSync({
|
|
3036
|
+
data: inResult.value,
|
|
3037
|
+
path: ctx.path,
|
|
3038
|
+
parent: ctx
|
|
3039
|
+
});
|
|
3040
|
+
}
|
|
3041
|
+
}
|
|
3042
|
+
}
|
|
3043
|
+
static create(a, b) {
|
|
3044
|
+
return new ZodPipeline({
|
|
3045
|
+
in: a,
|
|
3046
|
+
out: b,
|
|
3047
|
+
typeName: ZodFirstPartyTypeKind.ZodPipeline
|
|
3048
|
+
});
|
|
3049
|
+
}
|
|
3050
|
+
}
|
|
3051
|
+
class ZodReadonly extends ZodType {
|
|
3052
|
+
_parse(input) {
|
|
3053
|
+
const result = this._def.innerType._parse(input);
|
|
3054
|
+
const freeze = (data) => {
|
|
3055
|
+
if (isValid(data)) {
|
|
3056
|
+
data.value = Object.freeze(data.value);
|
|
3057
|
+
}
|
|
3058
|
+
return data;
|
|
3059
|
+
};
|
|
3060
|
+
return isAsync(result) ? result.then((data) => freeze(data)) : freeze(result);
|
|
3061
|
+
}
|
|
3062
|
+
unwrap() {
|
|
3063
|
+
return this._def.innerType;
|
|
3064
|
+
}
|
|
3065
|
+
}
|
|
3066
|
+
ZodReadonly.create = (type, params) => {
|
|
3067
|
+
return new ZodReadonly({
|
|
3068
|
+
innerType: type,
|
|
3069
|
+
typeName: ZodFirstPartyTypeKind.ZodReadonly,
|
|
3070
|
+
...processCreateParams(params)
|
|
3071
|
+
});
|
|
3072
|
+
};
|
|
3073
|
+
var ZodFirstPartyTypeKind;
|
|
3074
|
+
(function(ZodFirstPartyTypeKind2) {
|
|
3075
|
+
ZodFirstPartyTypeKind2["ZodString"] = "ZodString";
|
|
3076
|
+
ZodFirstPartyTypeKind2["ZodNumber"] = "ZodNumber";
|
|
3077
|
+
ZodFirstPartyTypeKind2["ZodNaN"] = "ZodNaN";
|
|
3078
|
+
ZodFirstPartyTypeKind2["ZodBigInt"] = "ZodBigInt";
|
|
3079
|
+
ZodFirstPartyTypeKind2["ZodBoolean"] = "ZodBoolean";
|
|
3080
|
+
ZodFirstPartyTypeKind2["ZodDate"] = "ZodDate";
|
|
3081
|
+
ZodFirstPartyTypeKind2["ZodSymbol"] = "ZodSymbol";
|
|
3082
|
+
ZodFirstPartyTypeKind2["ZodUndefined"] = "ZodUndefined";
|
|
3083
|
+
ZodFirstPartyTypeKind2["ZodNull"] = "ZodNull";
|
|
3084
|
+
ZodFirstPartyTypeKind2["ZodAny"] = "ZodAny";
|
|
3085
|
+
ZodFirstPartyTypeKind2["ZodUnknown"] = "ZodUnknown";
|
|
3086
|
+
ZodFirstPartyTypeKind2["ZodNever"] = "ZodNever";
|
|
3087
|
+
ZodFirstPartyTypeKind2["ZodVoid"] = "ZodVoid";
|
|
3088
|
+
ZodFirstPartyTypeKind2["ZodArray"] = "ZodArray";
|
|
3089
|
+
ZodFirstPartyTypeKind2["ZodObject"] = "ZodObject";
|
|
3090
|
+
ZodFirstPartyTypeKind2["ZodUnion"] = "ZodUnion";
|
|
3091
|
+
ZodFirstPartyTypeKind2["ZodDiscriminatedUnion"] = "ZodDiscriminatedUnion";
|
|
3092
|
+
ZodFirstPartyTypeKind2["ZodIntersection"] = "ZodIntersection";
|
|
3093
|
+
ZodFirstPartyTypeKind2["ZodTuple"] = "ZodTuple";
|
|
3094
|
+
ZodFirstPartyTypeKind2["ZodRecord"] = "ZodRecord";
|
|
3095
|
+
ZodFirstPartyTypeKind2["ZodMap"] = "ZodMap";
|
|
3096
|
+
ZodFirstPartyTypeKind2["ZodSet"] = "ZodSet";
|
|
3097
|
+
ZodFirstPartyTypeKind2["ZodFunction"] = "ZodFunction";
|
|
3098
|
+
ZodFirstPartyTypeKind2["ZodLazy"] = "ZodLazy";
|
|
3099
|
+
ZodFirstPartyTypeKind2["ZodLiteral"] = "ZodLiteral";
|
|
3100
|
+
ZodFirstPartyTypeKind2["ZodEnum"] = "ZodEnum";
|
|
3101
|
+
ZodFirstPartyTypeKind2["ZodEffects"] = "ZodEffects";
|
|
3102
|
+
ZodFirstPartyTypeKind2["ZodNativeEnum"] = "ZodNativeEnum";
|
|
3103
|
+
ZodFirstPartyTypeKind2["ZodOptional"] = "ZodOptional";
|
|
3104
|
+
ZodFirstPartyTypeKind2["ZodNullable"] = "ZodNullable";
|
|
3105
|
+
ZodFirstPartyTypeKind2["ZodDefault"] = "ZodDefault";
|
|
3106
|
+
ZodFirstPartyTypeKind2["ZodCatch"] = "ZodCatch";
|
|
3107
|
+
ZodFirstPartyTypeKind2["ZodPromise"] = "ZodPromise";
|
|
3108
|
+
ZodFirstPartyTypeKind2["ZodBranded"] = "ZodBranded";
|
|
3109
|
+
ZodFirstPartyTypeKind2["ZodPipeline"] = "ZodPipeline";
|
|
3110
|
+
ZodFirstPartyTypeKind2["ZodReadonly"] = "ZodReadonly";
|
|
3111
|
+
})(ZodFirstPartyTypeKind || (ZodFirstPartyTypeKind = {}));
|
|
3112
|
+
const stringType = ZodString.create;
|
|
3113
|
+
const numberType = ZodNumber.create;
|
|
3114
|
+
ZodNever.create;
|
|
3115
|
+
ZodArray.create;
|
|
3116
|
+
const objectType = ZodObject.create;
|
|
3117
|
+
const unionType = ZodUnion.create;
|
|
3118
|
+
ZodIntersection.create;
|
|
3119
|
+
ZodTuple.create;
|
|
3120
|
+
ZodEnum.create;
|
|
3121
|
+
ZodPromise.create;
|
|
3122
|
+
ZodOptional.create;
|
|
3123
|
+
ZodNullable.create;
|
|
3124
|
+
export {
|
|
3125
|
+
ZodType as Schema,
|
|
3126
|
+
ZodAny,
|
|
3127
|
+
ZodArray,
|
|
3128
|
+
ZodBigInt,
|
|
3129
|
+
ZodBoolean,
|
|
3130
|
+
ZodBranded,
|
|
3131
|
+
ZodCatch,
|
|
3132
|
+
ZodDate,
|
|
3133
|
+
ZodDefault,
|
|
3134
|
+
ZodEffects,
|
|
3135
|
+
ZodEnum,
|
|
3136
|
+
ZodFirstPartyTypeKind,
|
|
3137
|
+
ZodIntersection,
|
|
3138
|
+
ZodLazy,
|
|
3139
|
+
ZodLiteral,
|
|
3140
|
+
ZodMap,
|
|
3141
|
+
ZodNaN,
|
|
3142
|
+
ZodNativeEnum,
|
|
3143
|
+
ZodNever,
|
|
3144
|
+
ZodNull,
|
|
3145
|
+
ZodNullable,
|
|
3146
|
+
ZodNumber,
|
|
3147
|
+
ZodObject,
|
|
3148
|
+
ZodOptional,
|
|
3149
|
+
ZodPipeline,
|
|
3150
|
+
ZodPromise,
|
|
3151
|
+
ZodReadonly,
|
|
3152
|
+
ZodType as ZodSchema,
|
|
3153
|
+
ZodSet,
|
|
3154
|
+
ZodString,
|
|
3155
|
+
ZodSymbol,
|
|
3156
|
+
ZodEffects as ZodTransformer,
|
|
3157
|
+
ZodTuple,
|
|
3158
|
+
ZodType,
|
|
3159
|
+
ZodUndefined,
|
|
3160
|
+
ZodUnion,
|
|
3161
|
+
ZodUnknown,
|
|
3162
|
+
ZodVoid,
|
|
3163
|
+
datetimeRegex,
|
|
3164
|
+
numberType as number,
|
|
3165
|
+
objectType as object,
|
|
3166
|
+
stringType as string,
|
|
3167
|
+
unionType as union
|
|
3168
|
+
};
|
|
3169
|
+
//# sourceMappingURL=types.js.map
|