@marshulll/openclaw-wecom 0.1.6 → 0.1.8
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/README.en.md +3 -0
- package/README.md +3 -0
- package/README.zh.md +3 -0
- package/docs/INSTALL.md +3 -0
- package/node_modules/fast-xml-parser/CHANGELOG.md +606 -0
- package/node_modules/fast-xml-parser/LICENSE +21 -0
- package/node_modules/fast-xml-parser/README.md +237 -0
- package/node_modules/fast-xml-parser/package.json +72 -0
- package/node_modules/fast-xml-parser/src/cli/cli.js +93 -0
- package/node_modules/fast-xml-parser/src/cli/man.js +12 -0
- package/node_modules/fast-xml-parser/src/cli/read.js +92 -0
- package/node_modules/fast-xml-parser/src/fxp.d.ts +418 -0
- package/node_modules/fast-xml-parser/src/fxp.js +11 -0
- package/node_modules/fast-xml-parser/src/ignoreAttributes.js +20 -0
- package/node_modules/fast-xml-parser/src/util.js +72 -0
- package/node_modules/fast-xml-parser/src/v5/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/OptionsBuilder.js +64 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/BaseOutputBuilder.js +71 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsMinArrBuilder.js +102 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/JsObjBuilder.js +156 -0
- package/node_modules/fast-xml-parser/src/v5/OutputBuilders/ParserOptionsBuilder.js +99 -0
- package/node_modules/fast-xml-parser/src/v5/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v5/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v5/TagPathMatcher.js +15 -0
- package/node_modules/fast-xml-parser/src/v5/XMLParser.js +85 -0
- package/node_modules/fast-xml-parser/src/v5/Xml2JsParser.js +237 -0
- package/node_modules/fast-xml-parser/src/v5/XmlPartReader.js +216 -0
- package/node_modules/fast-xml-parser/src/v5/XmlSpecialTagsReader.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/BufferSource.js +118 -0
- package/node_modules/fast-xml-parser/src/v5/inputSource/StringSource.js +123 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/EntitiesParser.js +107 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParser.js +23 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/booleanParserExt.js +20 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/currency.js +40 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/join.js +14 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/number.js +16 -0
- package/node_modules/fast-xml-parser/src/v5/valueParsers/trim.js +8 -0
- package/node_modules/fast-xml-parser/src/v6/CharsSymbol.js +16 -0
- package/node_modules/fast-xml-parser/src/v6/EntitiesParser.js +104 -0
- package/node_modules/fast-xml-parser/src/v6/OptionsBuilder.js +61 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/BaseOutputBuilder.js +69 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsArrBuilder.js +103 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsMinArrBuilder.js +100 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/JsObjBuilder.js +154 -0
- package/node_modules/fast-xml-parser/src/v6/OutputBuilders/ParserOptionsBuilder.js +94 -0
- package/node_modules/fast-xml-parser/src/v6/Report.js +0 -0
- package/node_modules/fast-xml-parser/src/v6/TagPath.js +81 -0
- package/node_modules/fast-xml-parser/src/v6/TagPathMatcher.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/XMLParser.js +83 -0
- package/node_modules/fast-xml-parser/src/v6/Xml2JsParser.js +235 -0
- package/node_modules/fast-xml-parser/src/v6/XmlPartReader.js +210 -0
- package/node_modules/fast-xml-parser/src/v6/XmlSpecialTagsReader.js +111 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/BufferSource.js +116 -0
- package/node_modules/fast-xml-parser/src/v6/inputSource/StringSource.js +121 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/EntitiesParser.js +105 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParser.js +22 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/booleanParserExt.js +19 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/currency.js +38 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/join.js +13 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/number.js +14 -0
- package/node_modules/fast-xml-parser/src/v6/valueParsers/trim.js +6 -0
- package/node_modules/fast-xml-parser/src/validator.js +425 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/json2xml.js +286 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/orderedJs2Xml.js +135 -0
- package/node_modules/fast-xml-parser/src/xmlbuilder/prettifyJs2Xml.js +0 -0
- package/node_modules/fast-xml-parser/src/xmlparser/DocTypeReader.js +153 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OptionsBuilder.js +48 -0
- package/node_modules/fast-xml-parser/src/xmlparser/OrderedObjParser.js +606 -0
- package/node_modules/fast-xml-parser/src/xmlparser/XMLParser.js +58 -0
- package/node_modules/fast-xml-parser/src/xmlparser/node2json.js +113 -0
- package/node_modules/fast-xml-parser/src/xmlparser/xmlNode.js +25 -0
- package/node_modules/strnum/.vscode/launch.json +25 -0
- package/node_modules/strnum/CHANGELOG.md +22 -0
- package/node_modules/strnum/LICENSE +21 -0
- package/node_modules/strnum/README.md +97 -0
- package/node_modules/strnum/package.json +30 -0
- package/node_modules/strnum/strnum.js +111 -0
- package/node_modules/strnum/strnum.test.js +165 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +208 -0
- package/node_modules/zod/index.cjs +33 -0
- package/node_modules/zod/index.d.cts +4 -0
- package/node_modules/zod/index.d.ts +4 -0
- package/node_modules/zod/index.js +4 -0
- package/node_modules/zod/package.json +118 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/v3/ZodError.ts +330 -0
- package/node_modules/zod/src/v3/benchmarks/datetime.ts +58 -0
- package/node_modules/zod/src/v3/benchmarks/discriminatedUnion.ts +80 -0
- package/node_modules/zod/src/v3/benchmarks/index.ts +59 -0
- package/node_modules/zod/src/v3/benchmarks/ipv4.ts +57 -0
- package/node_modules/zod/src/v3/benchmarks/object.ts +69 -0
- package/node_modules/zod/src/v3/benchmarks/primitives.ts +162 -0
- package/node_modules/zod/src/v3/benchmarks/realworld.ts +63 -0
- package/node_modules/zod/src/v3/benchmarks/string.ts +55 -0
- package/node_modules/zod/src/v3/benchmarks/union.ts +80 -0
- package/node_modules/zod/src/v3/errors.ts +13 -0
- package/node_modules/zod/src/v3/external.ts +6 -0
- package/node_modules/zod/src/v3/helpers/enumUtil.ts +17 -0
- package/node_modules/zod/src/v3/helpers/errorUtil.ts +8 -0
- package/node_modules/zod/src/v3/helpers/parseUtil.ts +176 -0
- package/node_modules/zod/src/v3/helpers/partialUtil.ts +34 -0
- package/node_modules/zod/src/v3/helpers/typeAliases.ts +2 -0
- package/node_modules/zod/src/v3/helpers/util.ts +224 -0
- package/node_modules/zod/src/v3/index.ts +4 -0
- package/node_modules/zod/src/v3/locales/en.ts +124 -0
- package/node_modules/zod/src/v3/standard-schema.ts +113 -0
- package/node_modules/zod/src/v3/tests/Mocker.ts +54 -0
- package/node_modules/zod/src/v3/tests/all-errors.test.ts +157 -0
- package/node_modules/zod/src/v3/tests/anyunknown.test.ts +28 -0
- package/node_modules/zod/src/v3/tests/array.test.ts +71 -0
- package/node_modules/zod/src/v3/tests/async-parsing.test.ts +388 -0
- package/node_modules/zod/src/v3/tests/async-refinements.test.ts +46 -0
- package/node_modules/zod/src/v3/tests/base.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/bigint.test.ts +55 -0
- package/node_modules/zod/src/v3/tests/branded.test.ts +53 -0
- package/node_modules/zod/src/v3/tests/catch.test.ts +220 -0
- package/node_modules/zod/src/v3/tests/coerce.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/complex.test.ts +56 -0
- package/node_modules/zod/src/v3/tests/custom.test.ts +31 -0
- package/node_modules/zod/src/v3/tests/date.test.ts +32 -0
- package/node_modules/zod/src/v3/tests/deepmasking.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/default.test.ts +112 -0
- package/node_modules/zod/src/v3/tests/description.test.ts +33 -0
- package/node_modules/zod/src/v3/tests/discriminated-unions.test.ts +315 -0
- package/node_modules/zod/src/v3/tests/enum.test.ts +80 -0
- package/node_modules/zod/src/v3/tests/error.test.ts +551 -0
- package/node_modules/zod/src/v3/tests/firstparty.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/firstpartyschematypes.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/function.test.ts +257 -0
- package/node_modules/zod/src/v3/tests/generics.test.ts +48 -0
- package/node_modules/zod/src/v3/tests/instanceof.test.ts +37 -0
- package/node_modules/zod/src/v3/tests/intersection.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/language-server.source.ts +76 -0
- package/node_modules/zod/src/v3/tests/language-server.test.ts +207 -0
- package/node_modules/zod/src/v3/tests/literal.test.ts +36 -0
- package/node_modules/zod/src/v3/tests/map.test.ts +110 -0
- package/node_modules/zod/src/v3/tests/masking.test.ts +4 -0
- package/node_modules/zod/src/v3/tests/mocker.test.ts +19 -0
- package/node_modules/zod/src/v3/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v3/tests/nativeEnum.test.ts +87 -0
- package/node_modules/zod/src/v3/tests/nullable.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/number.test.ts +176 -0
- package/node_modules/zod/src/v3/tests/object-augmentation.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object-in-es5-env.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/object.test.ts +434 -0
- package/node_modules/zod/src/v3/tests/optional.test.ts +42 -0
- package/node_modules/zod/src/v3/tests/parseUtil.test.ts +23 -0
- package/node_modules/zod/src/v3/tests/parser.test.ts +41 -0
- package/node_modules/zod/src/v3/tests/partials.test.ts +243 -0
- package/node_modules/zod/src/v3/tests/pickomit.test.ts +111 -0
- package/node_modules/zod/src/v3/tests/pipeline.test.ts +29 -0
- package/node_modules/zod/src/v3/tests/preprocess.test.ts +186 -0
- package/node_modules/zod/src/v3/tests/primitive.test.ts +440 -0
- package/node_modules/zod/src/v3/tests/promise.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/readonly.test.ts +194 -0
- package/node_modules/zod/src/v3/tests/record.test.ts +171 -0
- package/node_modules/zod/src/v3/tests/recursive.test.ts +197 -0
- package/node_modules/zod/src/v3/tests/refine.test.ts +313 -0
- package/node_modules/zod/src/v3/tests/safeparse.test.ts +27 -0
- package/node_modules/zod/src/v3/tests/set.test.ts +142 -0
- package/node_modules/zod/src/v3/tests/standard-schema.test.ts +83 -0
- package/node_modules/zod/src/v3/tests/string.test.ts +916 -0
- package/node_modules/zod/src/v3/tests/transformer.test.ts +233 -0
- package/node_modules/zod/src/v3/tests/tuple.test.ts +90 -0
- package/node_modules/zod/src/v3/tests/unions.test.ts +57 -0
- package/node_modules/zod/src/v3/tests/validations.test.ts +133 -0
- package/node_modules/zod/src/v3/tests/void.test.ts +15 -0
- package/node_modules/zod/src/v3/types.ts +5136 -0
- package/node_modules/zod/src/v4/classic/checks.ts +30 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +66 -0
- package/node_modules/zod/src/v4/classic/errors.ts +75 -0
- package/node_modules/zod/src/v4/classic/external.ts +50 -0
- package/node_modules/zod/src/v4/classic/index.ts +5 -0
- package/node_modules/zod/src/v4/classic/iso.ts +90 -0
- package/node_modules/zod/src/v4/classic/parse.ts +33 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2054 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/array.test.ts +264 -0
- package/node_modules/zod/src/v4/classic/tests/assignability.test.ts +210 -0
- package/node_modules/zod/src/v4/classic/tests/async-parsing.test.ts +381 -0
- package/node_modules/zod/src/v4/classic/tests/async-refinements.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/base.test.ts +7 -0
- package/node_modules/zod/src/v4/classic/tests/bigint.test.ts +54 -0
- package/node_modules/zod/src/v4/classic/tests/brand.test.ts +63 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/coerce.test.ts +160 -0
- package/node_modules/zod/src/v4/classic/tests/continuability.test.ts +352 -0
- package/node_modules/zod/src/v4/classic/tests/custom.test.ts +40 -0
- package/node_modules/zod/src/v4/classic/tests/date.test.ts +31 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +296 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +313 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +619 -0
- package/node_modules/zod/src/v4/classic/tests/enum.test.ts +285 -0
- package/node_modules/zod/src/v4/classic/tests/error-utils.test.ts +527 -0
- package/node_modules/zod/src/v4/classic/tests/error.test.ts +711 -0
- package/node_modules/zod/src/v4/classic/tests/file.test.ts +91 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +268 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +829 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +34 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +171 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +108 -0
- package/node_modules/zod/src/v4/classic/tests/lazy.test.ts +227 -0
- package/node_modules/zod/src/v4/classic/tests/literal.test.ts +92 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +196 -0
- package/node_modules/zod/src/v4/classic/tests/nan.test.ts +21 -0
- package/node_modules/zod/src/v4/classic/tests/nested-refine.test.ts +168 -0
- package/node_modules/zod/src/v4/classic/tests/nonoptional.test.ts +86 -0
- package/node_modules/zod/src/v4/classic/tests/nullable.test.ts +22 -0
- package/node_modules/zod/src/v4/classic/tests/number.test.ts +247 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +563 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +123 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +147 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +127 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +37 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +298 -0
- package/node_modules/zod/src/v4/classic/tests/primitive.test.ts +175 -0
- package/node_modules/zod/src/v4/classic/tests/promise.test.ts +81 -0
- package/node_modules/zod/src/v4/classic/tests/prototypes.test.ts +23 -0
- package/node_modules/zod/src/v4/classic/tests/readonly.test.ts +252 -0
- package/node_modules/zod/src/v4/classic/tests/record.test.ts +342 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +356 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +532 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +204 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +57 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +109 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +881 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +66 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +758 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +2314 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +250 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +163 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +94 -0
- package/node_modules/zod/src/v4/classic/tests/validations.test.ts +283 -0
- package/node_modules/zod/src/v4/classic/tests/void.test.ts +12 -0
- package/node_modules/zod/src/v4/core/api.ts +1594 -0
- package/node_modules/zod/src/v4/core/checks.ts +1283 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +134 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +424 -0
- package/node_modules/zod/src/v4/core/function.ts +176 -0
- package/node_modules/zod/src/v4/core/index.ts +15 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +143 -0
- package/node_modules/zod/src/v4/core/parse.ts +94 -0
- package/node_modules/zod/src/v4/core/regexes.ts +135 -0
- package/node_modules/zod/src/v4/core/registries.ts +96 -0
- package/node_modules/zod/src/v4/core/schemas.ts +3842 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +64 -0
- package/node_modules/zod/src/v4/core/tests/index.test.ts +46 -0
- package/node_modules/zod/src/v4/core/tests/locales/be.test.ts +124 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/ru.test.ts +128 -0
- package/node_modules/zod/src/v4/core/tests/locales/tr.test.ts +69 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +977 -0
- package/node_modules/zod/src/v4/core/util.ts +775 -0
- package/node_modules/zod/src/v4/core/versions.ts +5 -0
- package/node_modules/zod/src/v4/core/zsf.ts +323 -0
- package/node_modules/zod/src/v4/index.ts +4 -0
- package/node_modules/zod/src/v4/locales/ar.ts +125 -0
- package/node_modules/zod/src/v4/locales/az.ts +121 -0
- package/node_modules/zod/src/v4/locales/be.ts +184 -0
- package/node_modules/zod/src/v4/locales/ca.ts +127 -0
- package/node_modules/zod/src/v4/locales/cs.ts +142 -0
- package/node_modules/zod/src/v4/locales/de.ts +124 -0
- package/node_modules/zod/src/v4/locales/en.ts +127 -0
- package/node_modules/zod/src/v4/locales/eo.ts +125 -0
- package/node_modules/zod/src/v4/locales/es.ts +125 -0
- package/node_modules/zod/src/v4/locales/fa.ts +134 -0
- package/node_modules/zod/src/v4/locales/fi.ts +131 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +126 -0
- package/node_modules/zod/src/v4/locales/fr.ts +124 -0
- package/node_modules/zod/src/v4/locales/he.ts +125 -0
- package/node_modules/zod/src/v4/locales/hu.ts +126 -0
- package/node_modules/zod/src/v4/locales/id.ts +125 -0
- package/node_modules/zod/src/v4/locales/index.ts +39 -0
- package/node_modules/zod/src/v4/locales/it.ts +125 -0
- package/node_modules/zod/src/v4/locales/ja.ts +122 -0
- package/node_modules/zod/src/v4/locales/kh.ts +126 -0
- package/node_modules/zod/src/v4/locales/ko.ts +131 -0
- package/node_modules/zod/src/v4/locales/mk.ts +127 -0
- package/node_modules/zod/src/v4/locales/ms.ts +124 -0
- package/node_modules/zod/src/v4/locales/nl.ts +126 -0
- package/node_modules/zod/src/v4/locales/no.ts +124 -0
- package/node_modules/zod/src/v4/locales/ota.ts +125 -0
- package/node_modules/zod/src/v4/locales/pl.ts +126 -0
- package/node_modules/zod/src/v4/locales/ps.ts +133 -0
- package/node_modules/zod/src/v4/locales/pt.ts +123 -0
- package/node_modules/zod/src/v4/locales/ru.ts +184 -0
- package/node_modules/zod/src/v4/locales/sl.ts +126 -0
- package/node_modules/zod/src/v4/locales/sv.ts +127 -0
- package/node_modules/zod/src/v4/locales/ta.ts +125 -0
- package/node_modules/zod/src/v4/locales/th.ts +126 -0
- package/node_modules/zod/src/v4/locales/tr.ts +121 -0
- package/node_modules/zod/src/v4/locales/ua.ts +126 -0
- package/node_modules/zod/src/v4/locales/ur.ts +126 -0
- package/node_modules/zod/src/v4/locales/vi.ts +125 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +123 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +125 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +22 -0
- package/node_modules/zod/src/v4/mini/external.ts +40 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +62 -0
- package/node_modules/zod/src/v4/mini/parse.ts +1 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1579 -0
- package/node_modules/zod/src/v4/mini/tests/assignability.test.ts +129 -0
- package/node_modules/zod/src/v4/mini/tests/brand.test.ts +51 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/computed.test.ts +36 -0
- package/node_modules/zod/src/v4/mini/tests/error.test.ts +22 -0
- package/node_modules/zod/src/v4/mini/tests/functions.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +871 -0
- package/node_modules/zod/src/v4/mini/tests/number.test.ts +95 -0
- package/node_modules/zod/src/v4/mini/tests/object.test.ts +185 -0
- package/node_modules/zod/src/v4/mini/tests/prototypes.test.ts +43 -0
- package/node_modules/zod/src/v4/mini/tests/recursive-types.test.ts +275 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +299 -0
- package/node_modules/zod/src/v4-mini/index.ts +1 -0
- package/node_modules/zod/v3/ZodError.cjs +138 -0
- package/node_modules/zod/v3/ZodError.d.cts +164 -0
- package/node_modules/zod/v3/ZodError.d.ts +164 -0
- package/node_modules/zod/v3/ZodError.js +133 -0
- package/node_modules/zod/v3/errors.cjs +17 -0
- package/node_modules/zod/v3/errors.d.cts +5 -0
- package/node_modules/zod/v3/errors.d.ts +5 -0
- package/node_modules/zod/v3/errors.js +9 -0
- package/node_modules/zod/v3/external.cjs +22 -0
- package/node_modules/zod/v3/external.d.cts +6 -0
- package/node_modules/zod/v3/external.d.ts +6 -0
- package/node_modules/zod/v3/external.js +6 -0
- package/node_modules/zod/v3/helpers/enumUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/enumUtil.js +1 -0
- package/node_modules/zod/v3/helpers/errorUtil.cjs +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.cts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.d.ts +9 -0
- package/node_modules/zod/v3/helpers/errorUtil.js +6 -0
- package/node_modules/zod/v3/helpers/parseUtil.cjs +124 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.cts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.d.ts +78 -0
- package/node_modules/zod/v3/helpers/parseUtil.js +109 -0
- package/node_modules/zod/v3/helpers/partialUtil.cjs +2 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.cts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.d.ts +8 -0
- package/node_modules/zod/v3/helpers/partialUtil.js +1 -0
- package/node_modules/zod/v3/helpers/typeAliases.cjs +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.cts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.d.ts +2 -0
- package/node_modules/zod/v3/helpers/typeAliases.js +1 -0
- package/node_modules/zod/v3/helpers/util.cjs +137 -0
- package/node_modules/zod/v3/helpers/util.d.cts +85 -0
- package/node_modules/zod/v3/helpers/util.d.ts +85 -0
- package/node_modules/zod/v3/helpers/util.js +133 -0
- package/node_modules/zod/v3/index.cjs +33 -0
- package/node_modules/zod/v3/index.d.cts +4 -0
- package/node_modules/zod/v3/index.d.ts +4 -0
- package/node_modules/zod/v3/index.js +4 -0
- package/node_modules/zod/v3/locales/en.cjs +111 -0
- package/node_modules/zod/v3/locales/en.d.cts +3 -0
- package/node_modules/zod/v3/locales/en.d.ts +3 -0
- package/node_modules/zod/v3/locales/en.js +109 -0
- package/node_modules/zod/v3/standard-schema.cjs +2 -0
- package/node_modules/zod/v3/standard-schema.d.cts +102 -0
- package/node_modules/zod/v3/standard-schema.d.ts +102 -0
- package/node_modules/zod/v3/standard-schema.js +1 -0
- package/node_modules/zod/v3/types.cjs +3775 -0
- package/node_modules/zod/v3/types.d.cts +1031 -0
- package/node_modules/zod/v3/types.d.ts +1031 -0
- package/node_modules/zod/v3/types.js +3693 -0
- package/node_modules/zod/v4/classic/checks.cjs +32 -0
- package/node_modules/zod/v4/classic/checks.d.cts +1 -0
- package/node_modules/zod/v4/classic/checks.d.ts +1 -0
- package/node_modules/zod/v4/classic/checks.js +1 -0
- package/node_modules/zod/v4/classic/coerce.cjs +47 -0
- package/node_modules/zod/v4/classic/coerce.d.cts +17 -0
- package/node_modules/zod/v4/classic/coerce.d.ts +17 -0
- package/node_modules/zod/v4/classic/coerce.js +17 -0
- package/node_modules/zod/v4/classic/compat.cjs +57 -0
- package/node_modules/zod/v4/classic/compat.d.cts +46 -0
- package/node_modules/zod/v4/classic/compat.d.ts +46 -0
- package/node_modules/zod/v4/classic/compat.js +27 -0
- package/node_modules/zod/v4/classic/errors.cjs +67 -0
- package/node_modules/zod/v4/classic/errors.d.cts +30 -0
- package/node_modules/zod/v4/classic/errors.d.ts +30 -0
- package/node_modules/zod/v4/classic/errors.js +41 -0
- package/node_modules/zod/v4/classic/external.cjs +70 -0
- package/node_modules/zod/v4/classic/external.d.cts +13 -0
- package/node_modules/zod/v4/classic/external.d.ts +13 -0
- package/node_modules/zod/v4/classic/external.js +18 -0
- package/node_modules/zod/v4/classic/index.cjs +33 -0
- package/node_modules/zod/v4/classic/index.d.cts +4 -0
- package/node_modules/zod/v4/classic/index.d.ts +4 -0
- package/node_modules/zod/v4/classic/index.js +4 -0
- package/node_modules/zod/v4/classic/iso.cjs +60 -0
- package/node_modules/zod/v4/classic/iso.d.cts +22 -0
- package/node_modules/zod/v4/classic/iso.d.ts +22 -0
- package/node_modules/zod/v4/classic/iso.js +30 -0
- package/node_modules/zod/v4/classic/parse.cjs +32 -0
- package/node_modules/zod/v4/classic/parse.d.cts +23 -0
- package/node_modules/zod/v4/classic/parse.d.ts +23 -0
- package/node_modules/zod/v4/classic/parse.js +6 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1109 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +630 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +630 -0
- package/node_modules/zod/v4/classic/schemas.js +1006 -0
- package/node_modules/zod/v4/core/api.cjs +1039 -0
- package/node_modules/zod/v4/core/api.d.cts +284 -0
- package/node_modules/zod/v4/core/api.d.ts +284 -0
- package/node_modules/zod/v4/core/api.js +906 -0
- package/node_modules/zod/v4/core/checks.cjs +591 -0
- package/node_modules/zod/v4/core/checks.d.cts +278 -0
- package/node_modules/zod/v4/core/checks.d.ts +278 -0
- package/node_modules/zod/v4/core/checks.js +565 -0
- package/node_modules/zod/v4/core/core.cjs +67 -0
- package/node_modules/zod/v4/core/core.d.cts +49 -0
- package/node_modules/zod/v4/core/core.d.ts +49 -0
- package/node_modules/zod/v4/core/core.js +61 -0
- package/node_modules/zod/v4/core/doc.cjs +39 -0
- package/node_modules/zod/v4/core/doc.d.cts +14 -0
- package/node_modules/zod/v4/core/doc.d.ts +14 -0
- package/node_modules/zod/v4/core/doc.js +35 -0
- package/node_modules/zod/v4/core/errors.cjs +226 -0
- package/node_modules/zod/v4/core/errors.d.cts +208 -0
- package/node_modules/zod/v4/core/errors.d.ts +208 -0
- package/node_modules/zod/v4/core/errors.js +195 -0
- package/node_modules/zod/v4/core/function.cjs +102 -0
- package/node_modules/zod/v4/core/function.d.cts +52 -0
- package/node_modules/zod/v4/core/function.d.ts +52 -0
- package/node_modules/zod/v4/core/function.js +75 -0
- package/node_modules/zod/v4/core/index.cjs +44 -0
- package/node_modules/zod/v4/core/index.d.cts +15 -0
- package/node_modules/zod/v4/core/index.d.ts +15 -0
- package/node_modules/zod/v4/core/index.js +15 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +87 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +87 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/parse.cjs +87 -0
- package/node_modules/zod/v4/core/parse.d.cts +25 -0
- package/node_modules/zod/v4/core/parse.d.ts +25 -0
- package/node_modules/zod/v4/core/parse.js +57 -0
- package/node_modules/zod/v4/core/regexes.cjs +103 -0
- package/node_modules/zod/v4/core/regexes.d.cts +62 -0
- package/node_modules/zod/v4/core/regexes.d.ts +62 -0
- package/node_modules/zod/v4/core/regexes.js +95 -0
- package/node_modules/zod/v4/core/registries.cjs +56 -0
- package/node_modules/zod/v4/core/registries.d.cts +35 -0
- package/node_modules/zod/v4/core/registries.d.ts +35 -0
- package/node_modules/zod/v4/core/registries.js +51 -0
- package/node_modules/zod/v4/core/schemas.cjs +1748 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1041 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1041 -0
- package/node_modules/zod/v4/core/schemas.js +1717 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +55 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +55 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +854 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/to-json-schema.js +849 -0
- package/node_modules/zod/v4/core/util.cjs +539 -0
- package/node_modules/zod/v4/core/util.d.cts +183 -0
- package/node_modules/zod/v4/core/util.d.ts +183 -0
- package/node_modules/zod/v4/core/util.js +493 -0
- package/node_modules/zod/v4/core/versions.cjs +8 -0
- package/node_modules/zod/v4/core/versions.d.cts +5 -0
- package/node_modules/zod/v4/core/versions.d.ts +5 -0
- package/node_modules/zod/v4/core/versions.js +5 -0
- package/node_modules/zod/v4/index.cjs +22 -0
- package/node_modules/zod/v4/index.d.cts +3 -0
- package/node_modules/zod/v4/index.d.ts +3 -0
- package/node_modules/zod/v4/index.js +3 -0
- package/node_modules/zod/v4/locales/ar.cjs +142 -0
- package/node_modules/zod/v4/locales/ar.d.cts +4 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +116 -0
- package/node_modules/zod/v4/locales/az.cjs +141 -0
- package/node_modules/zod/v4/locales/az.d.cts +4 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +115 -0
- package/node_modules/zod/v4/locales/be.cjs +190 -0
- package/node_modules/zod/v4/locales/be.d.cts +4 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +164 -0
- package/node_modules/zod/v4/locales/ca.cjs +144 -0
- package/node_modules/zod/v4/locales/ca.d.cts +4 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +118 -0
- package/node_modules/zod/v4/locales/cs.cjs +161 -0
- package/node_modules/zod/v4/locales/cs.d.cts +4 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +135 -0
- package/node_modules/zod/v4/locales/de.cjs +142 -0
- package/node_modules/zod/v4/locales/de.d.cts +4 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +116 -0
- package/node_modules/zod/v4/locales/en.cjs +145 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +5 -0
- package/node_modules/zod/v4/locales/en.js +117 -0
- package/node_modules/zod/v4/locales/eo.cjs +144 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +5 -0
- package/node_modules/zod/v4/locales/eo.js +116 -0
- package/node_modules/zod/v4/locales/es.cjs +143 -0
- package/node_modules/zod/v4/locales/es.d.cts +4 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +117 -0
- package/node_modules/zod/v4/locales/fa.cjs +148 -0
- package/node_modules/zod/v4/locales/fa.d.cts +4 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +122 -0
- package/node_modules/zod/v4/locales/fi.cjs +148 -0
- package/node_modules/zod/v4/locales/fi.d.cts +4 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +122 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +143 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +117 -0
- package/node_modules/zod/v4/locales/fr.cjs +142 -0
- package/node_modules/zod/v4/locales/fr.d.cts +4 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +116 -0
- package/node_modules/zod/v4/locales/he.cjs +143 -0
- package/node_modules/zod/v4/locales/he.d.cts +4 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +117 -0
- package/node_modules/zod/v4/locales/hu.cjs +143 -0
- package/node_modules/zod/v4/locales/hu.d.cts +4 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +117 -0
- package/node_modules/zod/v4/locales/id.cjs +142 -0
- package/node_modules/zod/v4/locales/id.d.cts +4 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +116 -0
- package/node_modules/zod/v4/locales/index.cjs +84 -0
- package/node_modules/zod/v4/locales/index.d.cts +39 -0
- package/node_modules/zod/v4/locales/index.d.ts +39 -0
- package/node_modules/zod/v4/locales/index.js +39 -0
- package/node_modules/zod/v4/locales/it.cjs +143 -0
- package/node_modules/zod/v4/locales/it.d.cts +4 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +117 -0
- package/node_modules/zod/v4/locales/ja.cjs +141 -0
- package/node_modules/zod/v4/locales/ja.d.cts +4 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +115 -0
- package/node_modules/zod/v4/locales/kh.cjs +143 -0
- package/node_modules/zod/v4/locales/kh.d.cts +4 -0
- package/node_modules/zod/v4/locales/kh.d.ts +4 -0
- package/node_modules/zod/v4/locales/kh.js +117 -0
- package/node_modules/zod/v4/locales/ko.cjs +147 -0
- package/node_modules/zod/v4/locales/ko.d.cts +4 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +121 -0
- package/node_modules/zod/v4/locales/mk.cjs +144 -0
- package/node_modules/zod/v4/locales/mk.d.cts +4 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +118 -0
- package/node_modules/zod/v4/locales/ms.cjs +142 -0
- package/node_modules/zod/v4/locales/ms.d.cts +4 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +116 -0
- package/node_modules/zod/v4/locales/nl.cjs +143 -0
- package/node_modules/zod/v4/locales/nl.d.cts +4 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +117 -0
- package/node_modules/zod/v4/locales/no.cjs +142 -0
- package/node_modules/zod/v4/locales/no.d.cts +4 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +116 -0
- package/node_modules/zod/v4/locales/ota.cjs +143 -0
- package/node_modules/zod/v4/locales/ota.d.cts +4 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +117 -0
- package/node_modules/zod/v4/locales/pl.cjs +143 -0
- package/node_modules/zod/v4/locales/pl.d.cts +4 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +117 -0
- package/node_modules/zod/v4/locales/ps.cjs +148 -0
- package/node_modules/zod/v4/locales/ps.d.cts +4 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +122 -0
- package/node_modules/zod/v4/locales/pt.cjs +142 -0
- package/node_modules/zod/v4/locales/pt.d.cts +4 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +116 -0
- package/node_modules/zod/v4/locales/ru.cjs +190 -0
- package/node_modules/zod/v4/locales/ru.d.cts +4 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +164 -0
- package/node_modules/zod/v4/locales/sl.cjs +143 -0
- package/node_modules/zod/v4/locales/sl.d.cts +4 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +117 -0
- package/node_modules/zod/v4/locales/sv.cjs +144 -0
- package/node_modules/zod/v4/locales/sv.d.cts +4 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +118 -0
- package/node_modules/zod/v4/locales/ta.cjs +143 -0
- package/node_modules/zod/v4/locales/ta.d.cts +4 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +117 -0
- package/node_modules/zod/v4/locales/th.cjs +143 -0
- package/node_modules/zod/v4/locales/th.d.cts +4 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +117 -0
- package/node_modules/zod/v4/locales/tr.cjs +143 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +5 -0
- package/node_modules/zod/v4/locales/tr.js +115 -0
- package/node_modules/zod/v4/locales/ua.cjs +143 -0
- package/node_modules/zod/v4/locales/ua.d.cts +4 -0
- package/node_modules/zod/v4/locales/ua.d.ts +4 -0
- package/node_modules/zod/v4/locales/ua.js +117 -0
- package/node_modules/zod/v4/locales/ur.cjs +143 -0
- package/node_modules/zod/v4/locales/ur.d.cts +4 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +117 -0
- package/node_modules/zod/v4/locales/vi.cjs +142 -0
- package/node_modules/zod/v4/locales/vi.d.cts +4 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +116 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +142 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +116 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +143 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +117 -0
- package/node_modules/zod/v4/mini/checks.cjs +34 -0
- package/node_modules/zod/v4/mini/checks.d.cts +1 -0
- package/node_modules/zod/v4/mini/checks.d.ts +1 -0
- package/node_modules/zod/v4/mini/checks.js +1 -0
- package/node_modules/zod/v4/mini/coerce.cjs +47 -0
- package/node_modules/zod/v4/mini/coerce.d.cts +7 -0
- package/node_modules/zod/v4/mini/coerce.d.ts +7 -0
- package/node_modules/zod/v4/mini/coerce.js +17 -0
- package/node_modules/zod/v4/mini/external.cjs +62 -0
- package/node_modules/zod/v4/mini/external.d.cts +11 -0
- package/node_modules/zod/v4/mini/external.d.ts +11 -0
- package/node_modules/zod/v4/mini/external.js +13 -0
- package/node_modules/zod/v4/mini/index.cjs +32 -0
- package/node_modules/zod/v4/mini/index.d.cts +3 -0
- package/node_modules/zod/v4/mini/index.d.ts +3 -0
- package/node_modules/zod/v4/mini/index.js +3 -0
- package/node_modules/zod/v4/mini/iso.cjs +60 -0
- package/node_modules/zod/v4/mini/iso.d.cts +22 -0
- package/node_modules/zod/v4/mini/iso.d.ts +22 -0
- package/node_modules/zod/v4/mini/iso.js +30 -0
- package/node_modules/zod/v4/mini/parse.cjs +8 -0
- package/node_modules/zod/v4/mini/parse.d.cts +1 -0
- package/node_modules/zod/v4/mini/parse.d.ts +1 -0
- package/node_modules/zod/v4/mini/parse.js +1 -0
- package/node_modules/zod/v4/mini/schemas.cjs +839 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +356 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +356 -0
- package/node_modules/zod/v4/mini/schemas.js +732 -0
- package/node_modules/zod/v4-mini/index.cjs +17 -0
- package/node_modules/zod/v4-mini/index.d.cts +1 -0
- package/node_modules/zod/v4-mini/index.d.ts +1 -0
- package/node_modules/zod/v4-mini/index.js +1 -0
- package/package.json +5 -1
|
@@ -0,0 +1,606 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
///@ts-check
|
|
3
|
+
|
|
4
|
+
const util = require('../util');
|
|
5
|
+
const xmlNode = require('./xmlNode');
|
|
6
|
+
const readDocType = require("./DocTypeReader");
|
|
7
|
+
const toNumber = require("strnum");
|
|
8
|
+
const getIgnoreAttributesFn = require('../ignoreAttributes')
|
|
9
|
+
|
|
10
|
+
// const regx =
|
|
11
|
+
// '<((!\\[CDATA\\[([\\s\\S]*?)(]]>))|((NAME:)?(NAME))([^>]*)>|((\\/)(NAME)\\s*>))([^<]*)'
|
|
12
|
+
// .replace(/NAME/g, util.nameRegexp);
|
|
13
|
+
|
|
14
|
+
//const tagsRegx = new RegExp("<(\\/?[\\w:\\-\._]+)([^>]*)>(\\s*"+cdataRegx+")*([^<]+)?","g");
|
|
15
|
+
//const tagsRegx = new RegExp("<(\\/?)((\\w*:)?([\\w:\\-\._]+))([^>]*)>([^<]*)("+cdataRegx+"([^<]*))*([^<]+)?","g");
|
|
16
|
+
|
|
17
|
+
class OrderedObjParser{
|
|
18
|
+
constructor(options){
|
|
19
|
+
this.options = options;
|
|
20
|
+
this.currentNode = null;
|
|
21
|
+
this.tagsNodeStack = [];
|
|
22
|
+
this.docTypeEntities = {};
|
|
23
|
+
this.lastEntities = {
|
|
24
|
+
"apos" : { regex: /&(apos|#39|#x27);/g, val : "'"},
|
|
25
|
+
"gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"},
|
|
26
|
+
"lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"},
|
|
27
|
+
"quot" : { regex: /&(quot|#34|#x22);/g, val : "\""},
|
|
28
|
+
};
|
|
29
|
+
this.ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"};
|
|
30
|
+
this.htmlEntities = {
|
|
31
|
+
"space": { regex: /&(nbsp|#160);/g, val: " " },
|
|
32
|
+
// "lt" : { regex: /&(lt|#60);/g, val: "<" },
|
|
33
|
+
// "gt" : { regex: /&(gt|#62);/g, val: ">" },
|
|
34
|
+
// "amp" : { regex: /&(amp|#38);/g, val: "&" },
|
|
35
|
+
// "quot" : { regex: /&(quot|#34);/g, val: "\"" },
|
|
36
|
+
// "apos" : { regex: /&(apos|#39);/g, val: "'" },
|
|
37
|
+
"cent" : { regex: /&(cent|#162);/g, val: "¢" },
|
|
38
|
+
"pound" : { regex: /&(pound|#163);/g, val: "£" },
|
|
39
|
+
"yen" : { regex: /&(yen|#165);/g, val: "¥" },
|
|
40
|
+
"euro" : { regex: /&(euro|#8364);/g, val: "€" },
|
|
41
|
+
"copyright" : { regex: /&(copy|#169);/g, val: "©" },
|
|
42
|
+
"reg" : { regex: /&(reg|#174);/g, val: "®" },
|
|
43
|
+
"inr" : { regex: /&(inr|#8377);/g, val: "₹" },
|
|
44
|
+
"num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },
|
|
45
|
+
"num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 16)) },
|
|
46
|
+
};
|
|
47
|
+
this.addExternalEntities = addExternalEntities;
|
|
48
|
+
this.parseXml = parseXml;
|
|
49
|
+
this.parseTextData = parseTextData;
|
|
50
|
+
this.resolveNameSpace = resolveNameSpace;
|
|
51
|
+
this.buildAttributesMap = buildAttributesMap;
|
|
52
|
+
this.isItStopNode = isItStopNode;
|
|
53
|
+
this.replaceEntitiesValue = replaceEntitiesValue;
|
|
54
|
+
this.readStopNodeData = readStopNodeData;
|
|
55
|
+
this.saveTextToParentTag = saveTextToParentTag;
|
|
56
|
+
this.addChild = addChild;
|
|
57
|
+
this.ignoreAttributesFn = getIgnoreAttributesFn(this.options.ignoreAttributes)
|
|
58
|
+
}
|
|
59
|
+
|
|
60
|
+
}
|
|
61
|
+
|
|
62
|
+
function addExternalEntities(externalEntities){
|
|
63
|
+
const entKeys = Object.keys(externalEntities);
|
|
64
|
+
for (let i = 0; i < entKeys.length; i++) {
|
|
65
|
+
const ent = entKeys[i];
|
|
66
|
+
this.lastEntities[ent] = {
|
|
67
|
+
regex: new RegExp("&"+ent+";","g"),
|
|
68
|
+
val : externalEntities[ent]
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
}
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* @param {string} val
|
|
75
|
+
* @param {string} tagName
|
|
76
|
+
* @param {string} jPath
|
|
77
|
+
* @param {boolean} dontTrim
|
|
78
|
+
* @param {boolean} hasAttributes
|
|
79
|
+
* @param {boolean} isLeafNode
|
|
80
|
+
* @param {boolean} escapeEntities
|
|
81
|
+
*/
|
|
82
|
+
function parseTextData(val, tagName, jPath, dontTrim, hasAttributes, isLeafNode, escapeEntities) {
|
|
83
|
+
if (val !== undefined) {
|
|
84
|
+
if (this.options.trimValues && !dontTrim) {
|
|
85
|
+
val = val.trim();
|
|
86
|
+
}
|
|
87
|
+
if(val.length > 0){
|
|
88
|
+
if(!escapeEntities) val = this.replaceEntitiesValue(val);
|
|
89
|
+
|
|
90
|
+
const newval = this.options.tagValueProcessor(tagName, val, jPath, hasAttributes, isLeafNode);
|
|
91
|
+
if(newval === null || newval === undefined){
|
|
92
|
+
//don't parse
|
|
93
|
+
return val;
|
|
94
|
+
}else if(typeof newval !== typeof val || newval !== val){
|
|
95
|
+
//overwrite
|
|
96
|
+
return newval;
|
|
97
|
+
}else if(this.options.trimValues){
|
|
98
|
+
return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
|
|
99
|
+
}else{
|
|
100
|
+
const trimmedVal = val.trim();
|
|
101
|
+
if(trimmedVal === val){
|
|
102
|
+
return parseValue(val, this.options.parseTagValue, this.options.numberParseOptions);
|
|
103
|
+
}else{
|
|
104
|
+
return val;
|
|
105
|
+
}
|
|
106
|
+
}
|
|
107
|
+
}
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
|
|
111
|
+
function resolveNameSpace(tagname) {
|
|
112
|
+
if (this.options.removeNSPrefix) {
|
|
113
|
+
const tags = tagname.split(':');
|
|
114
|
+
const prefix = tagname.charAt(0) === '/' ? '/' : '';
|
|
115
|
+
if (tags[0] === 'xmlns') {
|
|
116
|
+
return '';
|
|
117
|
+
}
|
|
118
|
+
if (tags.length === 2) {
|
|
119
|
+
tagname = prefix + tags[1];
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
return tagname;
|
|
123
|
+
}
|
|
124
|
+
|
|
125
|
+
//TODO: change regex to capture NS
|
|
126
|
+
//const attrsRegx = new RegExp("([\\w\\-\\.\\:]+)\\s*=\\s*(['\"])((.|\n)*?)\\2","gm");
|
|
127
|
+
const attrsRegx = new RegExp('([^\\s=]+)\\s*(=\\s*([\'"])([\\s\\S]*?)\\3)?', 'gm');
|
|
128
|
+
|
|
129
|
+
function buildAttributesMap(attrStr, jPath, tagName) {
|
|
130
|
+
if (this.options.ignoreAttributes !== true && typeof attrStr === 'string') {
|
|
131
|
+
// attrStr = attrStr.replace(/\r?\n/g, ' ');
|
|
132
|
+
//attrStr = attrStr || attrStr.trim();
|
|
133
|
+
|
|
134
|
+
const matches = util.getAllMatches(attrStr, attrsRegx);
|
|
135
|
+
const len = matches.length; //don't make it inline
|
|
136
|
+
const attrs = {};
|
|
137
|
+
for (let i = 0; i < len; i++) {
|
|
138
|
+
const attrName = this.resolveNameSpace(matches[i][1]);
|
|
139
|
+
if (this.ignoreAttributesFn(attrName, jPath)) {
|
|
140
|
+
continue
|
|
141
|
+
}
|
|
142
|
+
let oldVal = matches[i][4];
|
|
143
|
+
let aName = this.options.attributeNamePrefix + attrName;
|
|
144
|
+
if (attrName.length) {
|
|
145
|
+
if (this.options.transformAttributeName) {
|
|
146
|
+
aName = this.options.transformAttributeName(aName);
|
|
147
|
+
}
|
|
148
|
+
if(aName === "__proto__") aName = "#__proto__";
|
|
149
|
+
if (oldVal !== undefined) {
|
|
150
|
+
if (this.options.trimValues) {
|
|
151
|
+
oldVal = oldVal.trim();
|
|
152
|
+
}
|
|
153
|
+
oldVal = this.replaceEntitiesValue(oldVal);
|
|
154
|
+
const newVal = this.options.attributeValueProcessor(attrName, oldVal, jPath);
|
|
155
|
+
if(newVal === null || newVal === undefined){
|
|
156
|
+
//don't parse
|
|
157
|
+
attrs[aName] = oldVal;
|
|
158
|
+
}else if(typeof newVal !== typeof oldVal || newVal !== oldVal){
|
|
159
|
+
//overwrite
|
|
160
|
+
attrs[aName] = newVal;
|
|
161
|
+
}else{
|
|
162
|
+
//parse
|
|
163
|
+
attrs[aName] = parseValue(
|
|
164
|
+
oldVal,
|
|
165
|
+
this.options.parseAttributeValue,
|
|
166
|
+
this.options.numberParseOptions
|
|
167
|
+
);
|
|
168
|
+
}
|
|
169
|
+
} else if (this.options.allowBooleanAttributes) {
|
|
170
|
+
attrs[aName] = true;
|
|
171
|
+
}
|
|
172
|
+
}
|
|
173
|
+
}
|
|
174
|
+
if (!Object.keys(attrs).length) {
|
|
175
|
+
return;
|
|
176
|
+
}
|
|
177
|
+
if (this.options.attributesGroupName) {
|
|
178
|
+
const attrCollection = {};
|
|
179
|
+
attrCollection[this.options.attributesGroupName] = attrs;
|
|
180
|
+
return attrCollection;
|
|
181
|
+
}
|
|
182
|
+
return attrs
|
|
183
|
+
}
|
|
184
|
+
}
|
|
185
|
+
|
|
186
|
+
const parseXml = function(xmlData) {
|
|
187
|
+
xmlData = xmlData.replace(/\r\n?/g, "\n"); //TODO: remove this line
|
|
188
|
+
const xmlObj = new xmlNode('!xml');
|
|
189
|
+
let currentNode = xmlObj;
|
|
190
|
+
let textData = "";
|
|
191
|
+
let jPath = "";
|
|
192
|
+
for(let i=0; i< xmlData.length; i++){//for each char in XML data
|
|
193
|
+
const ch = xmlData[i];
|
|
194
|
+
if(ch === '<'){
|
|
195
|
+
// const nextIndex = i+1;
|
|
196
|
+
// const _2ndChar = xmlData[nextIndex];
|
|
197
|
+
if( xmlData[i+1] === '/') {//Closing Tag
|
|
198
|
+
const closeIndex = findClosingIndex(xmlData, ">", i, "Closing Tag is not closed.")
|
|
199
|
+
let tagName = xmlData.substring(i+2,closeIndex).trim();
|
|
200
|
+
|
|
201
|
+
if(this.options.removeNSPrefix){
|
|
202
|
+
const colonIndex = tagName.indexOf(":");
|
|
203
|
+
if(colonIndex !== -1){
|
|
204
|
+
tagName = tagName.substr(colonIndex+1);
|
|
205
|
+
}
|
|
206
|
+
}
|
|
207
|
+
|
|
208
|
+
if(this.options.transformTagName) {
|
|
209
|
+
tagName = this.options.transformTagName(tagName);
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
if(currentNode){
|
|
213
|
+
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
214
|
+
}
|
|
215
|
+
|
|
216
|
+
//check if last tag of nested tag was unpaired tag
|
|
217
|
+
const lastTagName = jPath.substring(jPath.lastIndexOf(".")+1);
|
|
218
|
+
if(tagName && this.options.unpairedTags.indexOf(tagName) !== -1 ){
|
|
219
|
+
throw new Error(`Unpaired tag can not be used as closing tag: </${tagName}>`);
|
|
220
|
+
}
|
|
221
|
+
let propIndex = 0
|
|
222
|
+
if(lastTagName && this.options.unpairedTags.indexOf(lastTagName) !== -1 ){
|
|
223
|
+
propIndex = jPath.lastIndexOf('.', jPath.lastIndexOf('.')-1)
|
|
224
|
+
this.tagsNodeStack.pop();
|
|
225
|
+
}else{
|
|
226
|
+
propIndex = jPath.lastIndexOf(".");
|
|
227
|
+
}
|
|
228
|
+
jPath = jPath.substring(0, propIndex);
|
|
229
|
+
|
|
230
|
+
currentNode = this.tagsNodeStack.pop();//avoid recursion, set the parent tag scope
|
|
231
|
+
textData = "";
|
|
232
|
+
i = closeIndex;
|
|
233
|
+
} else if( xmlData[i+1] === '?') {
|
|
234
|
+
|
|
235
|
+
let tagData = readTagExp(xmlData,i, false, "?>");
|
|
236
|
+
if(!tagData) throw new Error("Pi Tag is not closed.");
|
|
237
|
+
|
|
238
|
+
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
239
|
+
if( (this.options.ignoreDeclaration && tagData.tagName === "?xml") || this.options.ignorePiTags){
|
|
240
|
+
|
|
241
|
+
}else{
|
|
242
|
+
|
|
243
|
+
const childNode = new xmlNode(tagData.tagName);
|
|
244
|
+
childNode.add(this.options.textNodeName, "");
|
|
245
|
+
|
|
246
|
+
if(tagData.tagName !== tagData.tagExp && tagData.attrExpPresent){
|
|
247
|
+
childNode[":@"] = this.buildAttributesMap(tagData.tagExp, jPath, tagData.tagName);
|
|
248
|
+
}
|
|
249
|
+
this.addChild(currentNode, childNode, jPath)
|
|
250
|
+
|
|
251
|
+
}
|
|
252
|
+
|
|
253
|
+
|
|
254
|
+
i = tagData.closeIndex + 1;
|
|
255
|
+
} else if(xmlData.substr(i + 1, 3) === '!--') {
|
|
256
|
+
const endIndex = findClosingIndex(xmlData, "-->", i+4, "Comment is not closed.")
|
|
257
|
+
if(this.options.commentPropName){
|
|
258
|
+
const comment = xmlData.substring(i + 4, endIndex - 2);
|
|
259
|
+
|
|
260
|
+
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
261
|
+
|
|
262
|
+
currentNode.add(this.options.commentPropName, [ { [this.options.textNodeName] : comment } ]);
|
|
263
|
+
}
|
|
264
|
+
i = endIndex;
|
|
265
|
+
} else if( xmlData.substr(i + 1, 2) === '!D') {
|
|
266
|
+
const result = readDocType(xmlData, i);
|
|
267
|
+
this.docTypeEntities = result.entities;
|
|
268
|
+
i = result.i;
|
|
269
|
+
}else if(xmlData.substr(i + 1, 2) === '![') {
|
|
270
|
+
const closeIndex = findClosingIndex(xmlData, "]]>", i, "CDATA is not closed.") - 2;
|
|
271
|
+
const tagExp = xmlData.substring(i + 9,closeIndex);
|
|
272
|
+
|
|
273
|
+
textData = this.saveTextToParentTag(textData, currentNode, jPath);
|
|
274
|
+
|
|
275
|
+
let val = this.parseTextData(tagExp, currentNode.tagname, jPath, true, false, true, true);
|
|
276
|
+
if(val == undefined) val = "";
|
|
277
|
+
|
|
278
|
+
//cdata should be set even if it is 0 length string
|
|
279
|
+
if(this.options.cdataPropName){
|
|
280
|
+
currentNode.add(this.options.cdataPropName, [ { [this.options.textNodeName] : tagExp } ]);
|
|
281
|
+
}else{
|
|
282
|
+
currentNode.add(this.options.textNodeName, val);
|
|
283
|
+
}
|
|
284
|
+
|
|
285
|
+
i = closeIndex + 2;
|
|
286
|
+
}else {//Opening tag
|
|
287
|
+
let result = readTagExp(xmlData,i, this.options.removeNSPrefix);
|
|
288
|
+
let tagName= result.tagName;
|
|
289
|
+
const rawTagName = result.rawTagName;
|
|
290
|
+
let tagExp = result.tagExp;
|
|
291
|
+
let attrExpPresent = result.attrExpPresent;
|
|
292
|
+
let closeIndex = result.closeIndex;
|
|
293
|
+
|
|
294
|
+
if (this.options.transformTagName) {
|
|
295
|
+
tagName = this.options.transformTagName(tagName);
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
//save text as child node
|
|
299
|
+
if (currentNode && textData) {
|
|
300
|
+
if(currentNode.tagname !== '!xml'){
|
|
301
|
+
//when nested tag is found
|
|
302
|
+
textData = this.saveTextToParentTag(textData, currentNode, jPath, false);
|
|
303
|
+
}
|
|
304
|
+
}
|
|
305
|
+
|
|
306
|
+
//check if last tag was unpaired tag
|
|
307
|
+
const lastTag = currentNode;
|
|
308
|
+
if(lastTag && this.options.unpairedTags.indexOf(lastTag.tagname) !== -1 ){
|
|
309
|
+
currentNode = this.tagsNodeStack.pop();
|
|
310
|
+
jPath = jPath.substring(0, jPath.lastIndexOf("."));
|
|
311
|
+
}
|
|
312
|
+
if(tagName !== xmlObj.tagname){
|
|
313
|
+
jPath += jPath ? "." + tagName : tagName;
|
|
314
|
+
}
|
|
315
|
+
if (this.isItStopNode(this.options.stopNodes, jPath, tagName)) {
|
|
316
|
+
let tagContent = "";
|
|
317
|
+
//self-closing tag
|
|
318
|
+
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
|
|
319
|
+
if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
|
|
320
|
+
tagName = tagName.substr(0, tagName.length - 1);
|
|
321
|
+
jPath = jPath.substr(0, jPath.length - 1);
|
|
322
|
+
tagExp = tagName;
|
|
323
|
+
}else{
|
|
324
|
+
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
325
|
+
}
|
|
326
|
+
i = result.closeIndex;
|
|
327
|
+
}
|
|
328
|
+
//unpaired tag
|
|
329
|
+
else if(this.options.unpairedTags.indexOf(tagName) !== -1){
|
|
330
|
+
|
|
331
|
+
i = result.closeIndex;
|
|
332
|
+
}
|
|
333
|
+
//normal tag
|
|
334
|
+
else{
|
|
335
|
+
//read until closing tag is found
|
|
336
|
+
const result = this.readStopNodeData(xmlData, rawTagName, closeIndex + 1);
|
|
337
|
+
if(!result) throw new Error(`Unexpected end of ${rawTagName}`);
|
|
338
|
+
i = result.i;
|
|
339
|
+
tagContent = result.tagContent;
|
|
340
|
+
}
|
|
341
|
+
|
|
342
|
+
const childNode = new xmlNode(tagName);
|
|
343
|
+
if(tagName !== tagExp && attrExpPresent){
|
|
344
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
345
|
+
}
|
|
346
|
+
if(tagContent) {
|
|
347
|
+
tagContent = this.parseTextData(tagContent, tagName, jPath, true, attrExpPresent, true, true);
|
|
348
|
+
}
|
|
349
|
+
|
|
350
|
+
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
351
|
+
childNode.add(this.options.textNodeName, tagContent);
|
|
352
|
+
|
|
353
|
+
this.addChild(currentNode, childNode, jPath)
|
|
354
|
+
}else{
|
|
355
|
+
//selfClosing tag
|
|
356
|
+
if(tagExp.length > 0 && tagExp.lastIndexOf("/") === tagExp.length - 1){
|
|
357
|
+
if(tagName[tagName.length - 1] === "/"){ //remove trailing '/'
|
|
358
|
+
tagName = tagName.substr(0, tagName.length - 1);
|
|
359
|
+
jPath = jPath.substr(0, jPath.length - 1);
|
|
360
|
+
tagExp = tagName;
|
|
361
|
+
}else{
|
|
362
|
+
tagExp = tagExp.substr(0, tagExp.length - 1);
|
|
363
|
+
}
|
|
364
|
+
|
|
365
|
+
if(this.options.transformTagName) {
|
|
366
|
+
tagName = this.options.transformTagName(tagName);
|
|
367
|
+
}
|
|
368
|
+
|
|
369
|
+
const childNode = new xmlNode(tagName);
|
|
370
|
+
if(tagName !== tagExp && attrExpPresent){
|
|
371
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
372
|
+
}
|
|
373
|
+
this.addChild(currentNode, childNode, jPath)
|
|
374
|
+
jPath = jPath.substr(0, jPath.lastIndexOf("."));
|
|
375
|
+
}
|
|
376
|
+
//opening tag
|
|
377
|
+
else{
|
|
378
|
+
const childNode = new xmlNode( tagName);
|
|
379
|
+
this.tagsNodeStack.push(currentNode);
|
|
380
|
+
|
|
381
|
+
if(tagName !== tagExp && attrExpPresent){
|
|
382
|
+
childNode[":@"] = this.buildAttributesMap(tagExp, jPath, tagName);
|
|
383
|
+
}
|
|
384
|
+
this.addChild(currentNode, childNode, jPath)
|
|
385
|
+
currentNode = childNode;
|
|
386
|
+
}
|
|
387
|
+
textData = "";
|
|
388
|
+
i = closeIndex;
|
|
389
|
+
}
|
|
390
|
+
}
|
|
391
|
+
}else{
|
|
392
|
+
textData += xmlData[i];
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
return xmlObj.child;
|
|
396
|
+
}
|
|
397
|
+
|
|
398
|
+
function addChild(currentNode, childNode, jPath){
|
|
399
|
+
const result = this.options.updateTag(childNode.tagname, jPath, childNode[":@"])
|
|
400
|
+
if(result === false){
|
|
401
|
+
}else if(typeof result === "string"){
|
|
402
|
+
childNode.tagname = result
|
|
403
|
+
currentNode.addChild(childNode);
|
|
404
|
+
}else{
|
|
405
|
+
currentNode.addChild(childNode);
|
|
406
|
+
}
|
|
407
|
+
}
|
|
408
|
+
|
|
409
|
+
const replaceEntitiesValue = function(val){
|
|
410
|
+
|
|
411
|
+
if(this.options.processEntities){
|
|
412
|
+
for(let entityName in this.docTypeEntities){
|
|
413
|
+
const entity = this.docTypeEntities[entityName];
|
|
414
|
+
val = val.replace( entity.regx, entity.val);
|
|
415
|
+
}
|
|
416
|
+
for(let entityName in this.lastEntities){
|
|
417
|
+
const entity = this.lastEntities[entityName];
|
|
418
|
+
val = val.replace( entity.regex, entity.val);
|
|
419
|
+
}
|
|
420
|
+
if(this.options.htmlEntities){
|
|
421
|
+
for(let entityName in this.htmlEntities){
|
|
422
|
+
const entity = this.htmlEntities[entityName];
|
|
423
|
+
val = val.replace( entity.regex, entity.val);
|
|
424
|
+
}
|
|
425
|
+
}
|
|
426
|
+
val = val.replace( this.ampEntity.regex, this.ampEntity.val);
|
|
427
|
+
}
|
|
428
|
+
return val;
|
|
429
|
+
}
|
|
430
|
+
function saveTextToParentTag(textData, currentNode, jPath, isLeafNode) {
|
|
431
|
+
if (textData) { //store previously collected data as textNode
|
|
432
|
+
if(isLeafNode === undefined) isLeafNode = currentNode.child.length === 0
|
|
433
|
+
|
|
434
|
+
textData = this.parseTextData(textData,
|
|
435
|
+
currentNode.tagname,
|
|
436
|
+
jPath,
|
|
437
|
+
false,
|
|
438
|
+
currentNode[":@"] ? Object.keys(currentNode[":@"]).length !== 0 : false,
|
|
439
|
+
isLeafNode);
|
|
440
|
+
|
|
441
|
+
if (textData !== undefined && textData !== "")
|
|
442
|
+
currentNode.add(this.options.textNodeName, textData);
|
|
443
|
+
textData = "";
|
|
444
|
+
}
|
|
445
|
+
return textData;
|
|
446
|
+
}
|
|
447
|
+
|
|
448
|
+
//TODO: use jPath to simplify the logic
|
|
449
|
+
/**
|
|
450
|
+
*
|
|
451
|
+
* @param {string[]} stopNodes
|
|
452
|
+
* @param {string} jPath
|
|
453
|
+
* @param {string} currentTagName
|
|
454
|
+
*/
|
|
455
|
+
function isItStopNode(stopNodes, jPath, currentTagName){
|
|
456
|
+
const allNodesExp = "*." + currentTagName;
|
|
457
|
+
for (const stopNodePath in stopNodes) {
|
|
458
|
+
const stopNodeExp = stopNodes[stopNodePath];
|
|
459
|
+
if( allNodesExp === stopNodeExp || jPath === stopNodeExp ) return true;
|
|
460
|
+
}
|
|
461
|
+
return false;
|
|
462
|
+
}
|
|
463
|
+
|
|
464
|
+
/**
|
|
465
|
+
* Returns the tag Expression and where it is ending handling single-double quotes situation
|
|
466
|
+
* @param {string} xmlData
|
|
467
|
+
* @param {number} i starting index
|
|
468
|
+
* @returns
|
|
469
|
+
*/
|
|
470
|
+
function tagExpWithClosingIndex(xmlData, i, closingChar = ">"){
|
|
471
|
+
let attrBoundary;
|
|
472
|
+
let tagExp = "";
|
|
473
|
+
for (let index = i; index < xmlData.length; index++) {
|
|
474
|
+
let ch = xmlData[index];
|
|
475
|
+
if (attrBoundary) {
|
|
476
|
+
if (ch === attrBoundary) attrBoundary = "";//reset
|
|
477
|
+
} else if (ch === '"' || ch === "'") {
|
|
478
|
+
attrBoundary = ch;
|
|
479
|
+
} else if (ch === closingChar[0]) {
|
|
480
|
+
if(closingChar[1]){
|
|
481
|
+
if(xmlData[index + 1] === closingChar[1]){
|
|
482
|
+
return {
|
|
483
|
+
data: tagExp,
|
|
484
|
+
index: index
|
|
485
|
+
}
|
|
486
|
+
}
|
|
487
|
+
}else{
|
|
488
|
+
return {
|
|
489
|
+
data: tagExp,
|
|
490
|
+
index: index
|
|
491
|
+
}
|
|
492
|
+
}
|
|
493
|
+
} else if (ch === '\t') {
|
|
494
|
+
ch = " "
|
|
495
|
+
}
|
|
496
|
+
tagExp += ch;
|
|
497
|
+
}
|
|
498
|
+
}
|
|
499
|
+
|
|
500
|
+
function findClosingIndex(xmlData, str, i, errMsg){
|
|
501
|
+
const closingIndex = xmlData.indexOf(str, i);
|
|
502
|
+
if(closingIndex === -1){
|
|
503
|
+
throw new Error(errMsg)
|
|
504
|
+
}else{
|
|
505
|
+
return closingIndex + str.length - 1;
|
|
506
|
+
}
|
|
507
|
+
}
|
|
508
|
+
|
|
509
|
+
function readTagExp(xmlData,i, removeNSPrefix, closingChar = ">"){
|
|
510
|
+
const result = tagExpWithClosingIndex(xmlData, i+1, closingChar);
|
|
511
|
+
if(!result) return;
|
|
512
|
+
let tagExp = result.data;
|
|
513
|
+
const closeIndex = result.index;
|
|
514
|
+
const separatorIndex = tagExp.search(/\s/);
|
|
515
|
+
let tagName = tagExp;
|
|
516
|
+
let attrExpPresent = true;
|
|
517
|
+
if(separatorIndex !== -1){//separate tag name and attributes expression
|
|
518
|
+
tagName = tagExp.substring(0, separatorIndex);
|
|
519
|
+
tagExp = tagExp.substring(separatorIndex + 1).trimStart();
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
const rawTagName = tagName;
|
|
523
|
+
if(removeNSPrefix){
|
|
524
|
+
const colonIndex = tagName.indexOf(":");
|
|
525
|
+
if(colonIndex !== -1){
|
|
526
|
+
tagName = tagName.substr(colonIndex+1);
|
|
527
|
+
attrExpPresent = tagName !== result.data.substr(colonIndex + 1);
|
|
528
|
+
}
|
|
529
|
+
}
|
|
530
|
+
|
|
531
|
+
return {
|
|
532
|
+
tagName: tagName,
|
|
533
|
+
tagExp: tagExp,
|
|
534
|
+
closeIndex: closeIndex,
|
|
535
|
+
attrExpPresent: attrExpPresent,
|
|
536
|
+
rawTagName: rawTagName,
|
|
537
|
+
}
|
|
538
|
+
}
|
|
539
|
+
/**
|
|
540
|
+
* find paired tag for a stop node
|
|
541
|
+
* @param {string} xmlData
|
|
542
|
+
* @param {string} tagName
|
|
543
|
+
* @param {number} i
|
|
544
|
+
*/
|
|
545
|
+
function readStopNodeData(xmlData, tagName, i){
|
|
546
|
+
const startIndex = i;
|
|
547
|
+
// Starting at 1 since we already have an open tag
|
|
548
|
+
let openTagCount = 1;
|
|
549
|
+
|
|
550
|
+
for (; i < xmlData.length; i++) {
|
|
551
|
+
if( xmlData[i] === "<"){
|
|
552
|
+
if (xmlData[i+1] === "/") {//close tag
|
|
553
|
+
const closeIndex = findClosingIndex(xmlData, ">", i, `${tagName} is not closed`);
|
|
554
|
+
let closeTagName = xmlData.substring(i+2,closeIndex).trim();
|
|
555
|
+
if(closeTagName === tagName){
|
|
556
|
+
openTagCount--;
|
|
557
|
+
if (openTagCount === 0) {
|
|
558
|
+
return {
|
|
559
|
+
tagContent: xmlData.substring(startIndex, i),
|
|
560
|
+
i : closeIndex
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
}
|
|
564
|
+
i=closeIndex;
|
|
565
|
+
} else if(xmlData[i+1] === '?') {
|
|
566
|
+
const closeIndex = findClosingIndex(xmlData, "?>", i+1, "StopNode is not closed.")
|
|
567
|
+
i=closeIndex;
|
|
568
|
+
} else if(xmlData.substr(i + 1, 3) === '!--') {
|
|
569
|
+
const closeIndex = findClosingIndex(xmlData, "-->", i+3, "StopNode is not closed.")
|
|
570
|
+
i=closeIndex;
|
|
571
|
+
} else if(xmlData.substr(i + 1, 2) === '![') {
|
|
572
|
+
const closeIndex = findClosingIndex(xmlData, "]]>", i, "StopNode is not closed.") - 2;
|
|
573
|
+
i=closeIndex;
|
|
574
|
+
} else {
|
|
575
|
+
const tagData = readTagExp(xmlData, i, '>')
|
|
576
|
+
|
|
577
|
+
if (tagData) {
|
|
578
|
+
const openTagName = tagData && tagData.tagName;
|
|
579
|
+
if (openTagName === tagName && tagData.tagExp[tagData.tagExp.length-1] !== "/") {
|
|
580
|
+
openTagCount++;
|
|
581
|
+
}
|
|
582
|
+
i=tagData.closeIndex;
|
|
583
|
+
}
|
|
584
|
+
}
|
|
585
|
+
}
|
|
586
|
+
}//end for loop
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
function parseValue(val, shouldParse, options) {
|
|
590
|
+
if (shouldParse && typeof val === 'string') {
|
|
591
|
+
//console.log(options)
|
|
592
|
+
const newval = val.trim();
|
|
593
|
+
if(newval === 'true' ) return true;
|
|
594
|
+
else if(newval === 'false' ) return false;
|
|
595
|
+
else return toNumber(val, options);
|
|
596
|
+
} else {
|
|
597
|
+
if (util.isExist(val)) {
|
|
598
|
+
return val;
|
|
599
|
+
} else {
|
|
600
|
+
return '';
|
|
601
|
+
}
|
|
602
|
+
}
|
|
603
|
+
}
|
|
604
|
+
|
|
605
|
+
|
|
606
|
+
module.exports = OrderedObjParser;
|
|
@@ -0,0 +1,58 @@
|
|
|
1
|
+
const { buildOptions} = require("./OptionsBuilder");
|
|
2
|
+
const OrderedObjParser = require("./OrderedObjParser");
|
|
3
|
+
const { prettify} = require("./node2json");
|
|
4
|
+
const validator = require('../validator');
|
|
5
|
+
|
|
6
|
+
class XMLParser{
|
|
7
|
+
|
|
8
|
+
constructor(options){
|
|
9
|
+
this.externalEntities = {};
|
|
10
|
+
this.options = buildOptions(options);
|
|
11
|
+
|
|
12
|
+
}
|
|
13
|
+
/**
|
|
14
|
+
* Parse XML dats to JS object
|
|
15
|
+
* @param {string|Buffer} xmlData
|
|
16
|
+
* @param {boolean|Object} validationOption
|
|
17
|
+
*/
|
|
18
|
+
parse(xmlData,validationOption){
|
|
19
|
+
if(typeof xmlData === "string"){
|
|
20
|
+
}else if( xmlData.toString){
|
|
21
|
+
xmlData = xmlData.toString();
|
|
22
|
+
}else{
|
|
23
|
+
throw new Error("XML data is accepted in String or Bytes[] form.")
|
|
24
|
+
}
|
|
25
|
+
if( validationOption){
|
|
26
|
+
if(validationOption === true) validationOption = {}; //validate with default options
|
|
27
|
+
|
|
28
|
+
const result = validator.validate(xmlData, validationOption);
|
|
29
|
+
if (result !== true) {
|
|
30
|
+
throw Error( `${result.err.msg}:${result.err.line}:${result.err.col}` )
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const orderedObjParser = new OrderedObjParser(this.options);
|
|
34
|
+
orderedObjParser.addExternalEntities(this.externalEntities);
|
|
35
|
+
const orderedResult = orderedObjParser.parseXml(xmlData);
|
|
36
|
+
if(this.options.preserveOrder || orderedResult === undefined) return orderedResult;
|
|
37
|
+
else return prettify(orderedResult, this.options);
|
|
38
|
+
}
|
|
39
|
+
|
|
40
|
+
/**
|
|
41
|
+
* Add Entity which is not by default supported by this library
|
|
42
|
+
* @param {string} key
|
|
43
|
+
* @param {string} value
|
|
44
|
+
*/
|
|
45
|
+
addEntity(key, value){
|
|
46
|
+
if(value.indexOf("&") !== -1){
|
|
47
|
+
throw new Error("Entity value can't have '&'")
|
|
48
|
+
}else if(key.indexOf("&") !== -1 || key.indexOf(";") !== -1){
|
|
49
|
+
throw new Error("An entity must be set without '&' and ';'. Eg. use '#xD' for '
'")
|
|
50
|
+
}else if(value === "&"){
|
|
51
|
+
throw new Error("An entity with value '&' is not permitted");
|
|
52
|
+
}else{
|
|
53
|
+
this.externalEntities[key] = value;
|
|
54
|
+
}
|
|
55
|
+
}
|
|
56
|
+
}
|
|
57
|
+
|
|
58
|
+
module.exports = XMLParser;
|