@marshulll/openclaw-wecom 0.1.5 → 0.1.7
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/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
- package/wecom/src/monitor.ts +5 -0
- package/wecom/src/wecom-app.ts +24 -2
- package/wecom/src/wecom-bot.ts +117 -20
|
@@ -0,0 +1,418 @@
|
|
|
1
|
+
type X2jOptions = {
|
|
2
|
+
/**
|
|
3
|
+
* Preserve the order of tags in resulting JS object
|
|
4
|
+
*
|
|
5
|
+
* Defaults to `false`
|
|
6
|
+
*/
|
|
7
|
+
preserveOrder?: boolean;
|
|
8
|
+
|
|
9
|
+
/**
|
|
10
|
+
* Give a prefix to the attribute name in the resulting JS object
|
|
11
|
+
*
|
|
12
|
+
* Defaults to '@_'
|
|
13
|
+
*/
|
|
14
|
+
attributeNamePrefix?: string;
|
|
15
|
+
|
|
16
|
+
/**
|
|
17
|
+
* A name to group all attributes of a tag under, or `false` to disable
|
|
18
|
+
*
|
|
19
|
+
* Defaults to `false`
|
|
20
|
+
*/
|
|
21
|
+
attributesGroupName?: false | string;
|
|
22
|
+
|
|
23
|
+
/**
|
|
24
|
+
* The name of the next node in the resulting JS
|
|
25
|
+
*
|
|
26
|
+
* Defaults to `#text`
|
|
27
|
+
*/
|
|
28
|
+
textNodeName?: string;
|
|
29
|
+
|
|
30
|
+
/**
|
|
31
|
+
* Whether to ignore attributes when parsing
|
|
32
|
+
*
|
|
33
|
+
* When `true` - ignores all the attributes
|
|
34
|
+
*
|
|
35
|
+
* When `false` - parses all the attributes
|
|
36
|
+
*
|
|
37
|
+
* When `Array<string | RegExp>` - filters out attributes that match provided patterns
|
|
38
|
+
*
|
|
39
|
+
* When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
|
|
40
|
+
*
|
|
41
|
+
* Defaults to `true`
|
|
42
|
+
*/
|
|
43
|
+
ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPath: string) => boolean);
|
|
44
|
+
|
|
45
|
+
/**
|
|
46
|
+
* Whether to remove namespace string from tag and attribute names
|
|
47
|
+
*
|
|
48
|
+
* Defaults to `false`
|
|
49
|
+
*/
|
|
50
|
+
removeNSPrefix?: boolean;
|
|
51
|
+
|
|
52
|
+
/**
|
|
53
|
+
* Whether to allow attributes without value
|
|
54
|
+
*
|
|
55
|
+
* Defaults to `false`
|
|
56
|
+
*/
|
|
57
|
+
allowBooleanAttributes?: boolean;
|
|
58
|
+
|
|
59
|
+
/**
|
|
60
|
+
* Whether to parse tag value with `strnum` package
|
|
61
|
+
*
|
|
62
|
+
* Defaults to `true`
|
|
63
|
+
*/
|
|
64
|
+
parseTagValue?: boolean;
|
|
65
|
+
|
|
66
|
+
/**
|
|
67
|
+
* Whether to parse tag value with `strnum` package
|
|
68
|
+
*
|
|
69
|
+
* Defaults to `false`
|
|
70
|
+
*/
|
|
71
|
+
parseAttributeValue?: boolean;
|
|
72
|
+
|
|
73
|
+
/**
|
|
74
|
+
* Whether to remove surrounding whitespace from tag or attribute value
|
|
75
|
+
*
|
|
76
|
+
* Defaults to `true`
|
|
77
|
+
*/
|
|
78
|
+
trimValues?: boolean;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Give a property name to set CDATA values to instead of merging to tag's text value
|
|
82
|
+
*
|
|
83
|
+
* Defaults to `false`
|
|
84
|
+
*/
|
|
85
|
+
cdataPropName?: false | string;
|
|
86
|
+
|
|
87
|
+
/**
|
|
88
|
+
* If set, parse comments and set as this property
|
|
89
|
+
*
|
|
90
|
+
* Defaults to `false`
|
|
91
|
+
*/
|
|
92
|
+
commentPropName?: false | string;
|
|
93
|
+
|
|
94
|
+
/**
|
|
95
|
+
* Control how tag value should be parsed. Called only if tag value is not empty
|
|
96
|
+
*
|
|
97
|
+
* @returns {undefined|null} `undefined` or `null` to set original value.
|
|
98
|
+
* @returns {unknown}
|
|
99
|
+
*
|
|
100
|
+
* 1. Different value or value with different data type to set new value.
|
|
101
|
+
* 2. Same value to set parsed value if `parseTagValue: true`.
|
|
102
|
+
*
|
|
103
|
+
* Defaults to `(tagName, val, jPath, hasAttributes, isLeafNode) => val`
|
|
104
|
+
*/
|
|
105
|
+
tagValueProcessor?: (tagName: string, tagValue: string, jPath: string, hasAttributes: boolean, isLeafNode: boolean) => unknown;
|
|
106
|
+
|
|
107
|
+
/**
|
|
108
|
+
* Control how attribute value should be parsed
|
|
109
|
+
*
|
|
110
|
+
* @param attrName
|
|
111
|
+
* @param attrValue
|
|
112
|
+
* @param jPath
|
|
113
|
+
* @returns {undefined|null} `undefined` or `null` to set original value
|
|
114
|
+
* @returns {unknown}
|
|
115
|
+
*
|
|
116
|
+
* Defaults to `(attrName, val, jPath) => val`
|
|
117
|
+
*/
|
|
118
|
+
attributeValueProcessor?: (attrName: string, attrValue: string, jPath: string) => unknown;
|
|
119
|
+
|
|
120
|
+
/**
|
|
121
|
+
* Options to pass to `strnum` for parsing numbers
|
|
122
|
+
*
|
|
123
|
+
* Defaults to `{ hex: true, leadingZeros: true, eNotation: true }`
|
|
124
|
+
*/
|
|
125
|
+
numberParseOptions?: strnumOptions;
|
|
126
|
+
|
|
127
|
+
/**
|
|
128
|
+
* Nodes to stop parsing at
|
|
129
|
+
*
|
|
130
|
+
* Defaults to `[]`
|
|
131
|
+
*/
|
|
132
|
+
stopNodes?: string[];
|
|
133
|
+
|
|
134
|
+
/**
|
|
135
|
+
* List of tags without closing tags
|
|
136
|
+
*
|
|
137
|
+
* Defaults to `[]`
|
|
138
|
+
*/
|
|
139
|
+
unpairedTags?: string[];
|
|
140
|
+
|
|
141
|
+
/**
|
|
142
|
+
* Whether to always create a text node
|
|
143
|
+
*
|
|
144
|
+
* Defaults to `false`
|
|
145
|
+
*/
|
|
146
|
+
alwaysCreateTextNode?: boolean;
|
|
147
|
+
|
|
148
|
+
/**
|
|
149
|
+
* Determine whether a tag should be parsed as an array
|
|
150
|
+
*
|
|
151
|
+
* @param tagName
|
|
152
|
+
* @param jPath
|
|
153
|
+
* @param isLeafNode
|
|
154
|
+
* @param isAttribute
|
|
155
|
+
* @returns {boolean}
|
|
156
|
+
*
|
|
157
|
+
* Defaults to `() => false`
|
|
158
|
+
*/
|
|
159
|
+
isArray?: (tagName: string, jPath: string, isLeafNode: boolean, isAttribute: boolean) => boolean;
|
|
160
|
+
|
|
161
|
+
/**
|
|
162
|
+
* Whether to process default and DOCTYPE entities
|
|
163
|
+
*
|
|
164
|
+
* Defaults to `true`
|
|
165
|
+
*/
|
|
166
|
+
processEntities?: boolean;
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Whether to process HTML entities
|
|
170
|
+
*
|
|
171
|
+
* Defaults to `false`
|
|
172
|
+
*/
|
|
173
|
+
htmlEntities?: boolean;
|
|
174
|
+
|
|
175
|
+
/**
|
|
176
|
+
* Whether to ignore the declaration tag from output
|
|
177
|
+
*
|
|
178
|
+
* Defaults to `false`
|
|
179
|
+
*/
|
|
180
|
+
ignoreDeclaration?: boolean;
|
|
181
|
+
|
|
182
|
+
/**
|
|
183
|
+
* Whether to ignore Pi tags
|
|
184
|
+
*
|
|
185
|
+
* Defaults to `false`
|
|
186
|
+
*/
|
|
187
|
+
ignorePiTags?: boolean;
|
|
188
|
+
|
|
189
|
+
/**
|
|
190
|
+
* Transform tag names
|
|
191
|
+
*
|
|
192
|
+
* Defaults to `false`
|
|
193
|
+
*/
|
|
194
|
+
transformTagName?: ((tagName: string) => string) | false;
|
|
195
|
+
|
|
196
|
+
/**
|
|
197
|
+
* Transform attribute names
|
|
198
|
+
*
|
|
199
|
+
* Defaults to `false`
|
|
200
|
+
*/
|
|
201
|
+
transformAttributeName?: ((attributeName: string) => string) | false;
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Change the tag name when a different name is returned. Skip the tag from parsed result when false is returned.
|
|
205
|
+
* Modify `attrs` object to control attributes for the given tag.
|
|
206
|
+
*
|
|
207
|
+
* @returns {string} new tag name.
|
|
208
|
+
* @returns false to skip the tag
|
|
209
|
+
*
|
|
210
|
+
* Defaults to `(tagName, jPath, attrs) => tagName`
|
|
211
|
+
*/
|
|
212
|
+
updateTag?: (tagName: string, jPath: string, attrs: {[k: string]: string}) => string | boolean;
|
|
213
|
+
};
|
|
214
|
+
|
|
215
|
+
type strnumOptions = {
|
|
216
|
+
hex: boolean;
|
|
217
|
+
leadingZeros: boolean,
|
|
218
|
+
skipLike?: RegExp,
|
|
219
|
+
eNotation?: boolean
|
|
220
|
+
}
|
|
221
|
+
|
|
222
|
+
type validationOptions = {
|
|
223
|
+
/**
|
|
224
|
+
* Whether to allow attributes without value
|
|
225
|
+
*
|
|
226
|
+
* Defaults to `false`
|
|
227
|
+
*/
|
|
228
|
+
allowBooleanAttributes?: boolean;
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* List of tags without closing tags
|
|
232
|
+
*
|
|
233
|
+
* Defaults to `[]`
|
|
234
|
+
*/
|
|
235
|
+
unpairedTags?: string[];
|
|
236
|
+
};
|
|
237
|
+
|
|
238
|
+
type XmlBuilderOptions = {
|
|
239
|
+
/**
|
|
240
|
+
* Give a prefix to the attribute name in the resulting JS object
|
|
241
|
+
*
|
|
242
|
+
* Defaults to '@_'
|
|
243
|
+
*/
|
|
244
|
+
attributeNamePrefix?: string;
|
|
245
|
+
|
|
246
|
+
/**
|
|
247
|
+
* A name to group all attributes of a tag under, or `false` to disable
|
|
248
|
+
*
|
|
249
|
+
* Defaults to `false`
|
|
250
|
+
*/
|
|
251
|
+
attributesGroupName?: false | string;
|
|
252
|
+
|
|
253
|
+
/**
|
|
254
|
+
* The name of the next node in the resulting JS
|
|
255
|
+
*
|
|
256
|
+
* Defaults to `#text`
|
|
257
|
+
*/
|
|
258
|
+
textNodeName?: string;
|
|
259
|
+
|
|
260
|
+
/**
|
|
261
|
+
* Whether to ignore attributes when building
|
|
262
|
+
*
|
|
263
|
+
* When `true` - ignores all the attributes
|
|
264
|
+
*
|
|
265
|
+
* When `false` - builds all the attributes
|
|
266
|
+
*
|
|
267
|
+
* When `Array<string | RegExp>` - filters out attributes that match provided patterns
|
|
268
|
+
*
|
|
269
|
+
* When `Function` - calls the function for each attribute and filters out those for which the function returned `true`
|
|
270
|
+
*
|
|
271
|
+
* Defaults to `true`
|
|
272
|
+
*/
|
|
273
|
+
ignoreAttributes?: boolean | (string | RegExp)[] | ((attrName: string, jPath: string) => boolean);
|
|
274
|
+
|
|
275
|
+
/**
|
|
276
|
+
* Give a property name to set CDATA values to instead of merging to tag's text value
|
|
277
|
+
*
|
|
278
|
+
* Defaults to `false`
|
|
279
|
+
*/
|
|
280
|
+
cdataPropName?: false | string;
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* If set, parse comments and set as this property
|
|
284
|
+
*
|
|
285
|
+
* Defaults to `false`
|
|
286
|
+
*/
|
|
287
|
+
commentPropName?: false | string;
|
|
288
|
+
|
|
289
|
+
/**
|
|
290
|
+
* Whether to make output pretty instead of single line
|
|
291
|
+
*
|
|
292
|
+
* Defaults to `false`
|
|
293
|
+
*/
|
|
294
|
+
format?: boolean;
|
|
295
|
+
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* If `format` is set to `true`, sets the indent string
|
|
299
|
+
*
|
|
300
|
+
* Defaults to ` `
|
|
301
|
+
*/
|
|
302
|
+
indentBy?: string;
|
|
303
|
+
|
|
304
|
+
/**
|
|
305
|
+
* Give a name to a top-level array
|
|
306
|
+
*
|
|
307
|
+
* Defaults to `undefined`
|
|
308
|
+
*/
|
|
309
|
+
arrayNodeName?: string;
|
|
310
|
+
|
|
311
|
+
/**
|
|
312
|
+
* Create empty tags for tags with no text value
|
|
313
|
+
*
|
|
314
|
+
* Defaults to `false`
|
|
315
|
+
*/
|
|
316
|
+
suppressEmptyNode?: boolean;
|
|
317
|
+
|
|
318
|
+
/**
|
|
319
|
+
* Suppress an unpaired tag
|
|
320
|
+
*
|
|
321
|
+
* Defaults to `true`
|
|
322
|
+
*/
|
|
323
|
+
suppressUnpairedNode?: boolean;
|
|
324
|
+
|
|
325
|
+
/**
|
|
326
|
+
* Don't put a value for boolean attributes
|
|
327
|
+
*
|
|
328
|
+
* Defaults to `true`
|
|
329
|
+
*/
|
|
330
|
+
suppressBooleanAttributes?: boolean;
|
|
331
|
+
|
|
332
|
+
/**
|
|
333
|
+
* Preserve the order of tags in resulting JS object
|
|
334
|
+
*
|
|
335
|
+
* Defaults to `false`
|
|
336
|
+
*/
|
|
337
|
+
preserveOrder?: boolean;
|
|
338
|
+
|
|
339
|
+
/**
|
|
340
|
+
* List of tags without closing tags
|
|
341
|
+
*
|
|
342
|
+
* Defaults to `[]`
|
|
343
|
+
*/
|
|
344
|
+
unpairedTags?: string[];
|
|
345
|
+
|
|
346
|
+
/**
|
|
347
|
+
* Nodes to stop parsing at
|
|
348
|
+
*
|
|
349
|
+
* Defaults to `[]`
|
|
350
|
+
*/
|
|
351
|
+
stopNodes?: string[];
|
|
352
|
+
|
|
353
|
+
/**
|
|
354
|
+
* Control how tag value should be parsed. Called only if tag value is not empty
|
|
355
|
+
*
|
|
356
|
+
* @returns {undefined|null} `undefined` or `null` to set original value.
|
|
357
|
+
* @returns {unknown}
|
|
358
|
+
*
|
|
359
|
+
* 1. Different value or value with different data type to set new value.
|
|
360
|
+
* 2. Same value to set parsed value if `parseTagValue: true`.
|
|
361
|
+
*
|
|
362
|
+
* Defaults to `(tagName, val, jPath, hasAttributes, isLeafNode) => val`
|
|
363
|
+
*/
|
|
364
|
+
tagValueProcessor?: (name: string, value: unknown) => unknown;
|
|
365
|
+
|
|
366
|
+
/**
|
|
367
|
+
* Control how attribute value should be parsed
|
|
368
|
+
*
|
|
369
|
+
* @param attrName
|
|
370
|
+
* @param attrValue
|
|
371
|
+
* @param jPath
|
|
372
|
+
* @returns {undefined|null} `undefined` or `null` to set original value
|
|
373
|
+
* @returns {unknown}
|
|
374
|
+
*
|
|
375
|
+
* Defaults to `(attrName, val, jPath) => val`
|
|
376
|
+
*/
|
|
377
|
+
attributeValueProcessor?: (name: string, value: unknown) => unknown;
|
|
378
|
+
|
|
379
|
+
/**
|
|
380
|
+
* Whether to process default and DOCTYPE entities
|
|
381
|
+
*
|
|
382
|
+
* Defaults to `true`
|
|
383
|
+
*/
|
|
384
|
+
processEntities?: boolean;
|
|
385
|
+
|
|
386
|
+
|
|
387
|
+
oneListGroup?: boolean;
|
|
388
|
+
};
|
|
389
|
+
|
|
390
|
+
type ESchema = string | object | Array<string|object>;
|
|
391
|
+
|
|
392
|
+
type ValidationError = {
|
|
393
|
+
err: {
|
|
394
|
+
code: string;
|
|
395
|
+
msg: string,
|
|
396
|
+
line: number,
|
|
397
|
+
col: number
|
|
398
|
+
};
|
|
399
|
+
};
|
|
400
|
+
|
|
401
|
+
export class XMLParser {
|
|
402
|
+
constructor(options?: X2jOptions);
|
|
403
|
+
parse(xmlData: string | Buffer ,validationOptions?: validationOptions | boolean): any;
|
|
404
|
+
/**
|
|
405
|
+
* Add Entity which is not by default supported by this library
|
|
406
|
+
* @param entityIdentifier {string} Eg: 'ent' for &ent;
|
|
407
|
+
* @param entityValue {string} Eg: '\r'
|
|
408
|
+
*/
|
|
409
|
+
addEntity(entityIdentifier: string, entityValue: string): void;
|
|
410
|
+
}
|
|
411
|
+
|
|
412
|
+
export class XMLValidator{
|
|
413
|
+
static validate( xmlData: string, options?: validationOptions): true | ValidationError;
|
|
414
|
+
}
|
|
415
|
+
export class XMLBuilder {
|
|
416
|
+
constructor(options?: XmlBuilderOptions);
|
|
417
|
+
build(jObj: any): any;
|
|
418
|
+
}
|
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const validator = require('./validator');
|
|
4
|
+
const XMLParser = require('./xmlparser/XMLParser');
|
|
5
|
+
const XMLBuilder = require('./xmlbuilder/json2xml');
|
|
6
|
+
|
|
7
|
+
module.exports = {
|
|
8
|
+
XMLParser: XMLParser,
|
|
9
|
+
XMLValidator: validator,
|
|
10
|
+
XMLBuilder: XMLBuilder
|
|
11
|
+
}
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
function getIgnoreAttributesFn(ignoreAttributes) {
|
|
2
|
+
if (typeof ignoreAttributes === 'function') {
|
|
3
|
+
return ignoreAttributes
|
|
4
|
+
}
|
|
5
|
+
if (Array.isArray(ignoreAttributes)) {
|
|
6
|
+
return (attrName) => {
|
|
7
|
+
for (const pattern of ignoreAttributes) {
|
|
8
|
+
if (typeof pattern === 'string' && attrName === pattern) {
|
|
9
|
+
return true
|
|
10
|
+
}
|
|
11
|
+
if (pattern instanceof RegExp && pattern.test(attrName)) {
|
|
12
|
+
return true
|
|
13
|
+
}
|
|
14
|
+
}
|
|
15
|
+
}
|
|
16
|
+
}
|
|
17
|
+
return () => false
|
|
18
|
+
}
|
|
19
|
+
|
|
20
|
+
module.exports = getIgnoreAttributesFn
|
|
@@ -0,0 +1,72 @@
|
|
|
1
|
+
'use strict';
|
|
2
|
+
|
|
3
|
+
const nameStartChar = ':A-Za-z_\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD';
|
|
4
|
+
const nameChar = nameStartChar + '\\-.\\d\\u00B7\\u0300-\\u036F\\u203F-\\u2040';
|
|
5
|
+
const nameRegexp = '[' + nameStartChar + '][' + nameChar + ']*'
|
|
6
|
+
const regexName = new RegExp('^' + nameRegexp + '$');
|
|
7
|
+
|
|
8
|
+
const getAllMatches = function(string, regex) {
|
|
9
|
+
const matches = [];
|
|
10
|
+
let match = regex.exec(string);
|
|
11
|
+
while (match) {
|
|
12
|
+
const allmatches = [];
|
|
13
|
+
allmatches.startIndex = regex.lastIndex - match[0].length;
|
|
14
|
+
const len = match.length;
|
|
15
|
+
for (let index = 0; index < len; index++) {
|
|
16
|
+
allmatches.push(match[index]);
|
|
17
|
+
}
|
|
18
|
+
matches.push(allmatches);
|
|
19
|
+
match = regex.exec(string);
|
|
20
|
+
}
|
|
21
|
+
return matches;
|
|
22
|
+
};
|
|
23
|
+
|
|
24
|
+
const isName = function(string) {
|
|
25
|
+
const match = regexName.exec(string);
|
|
26
|
+
return !(match === null || typeof match === 'undefined');
|
|
27
|
+
};
|
|
28
|
+
|
|
29
|
+
exports.isExist = function(v) {
|
|
30
|
+
return typeof v !== 'undefined';
|
|
31
|
+
};
|
|
32
|
+
|
|
33
|
+
exports.isEmptyObject = function(obj) {
|
|
34
|
+
return Object.keys(obj).length === 0;
|
|
35
|
+
};
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* Copy all the properties of a into b.
|
|
39
|
+
* @param {*} target
|
|
40
|
+
* @param {*} a
|
|
41
|
+
*/
|
|
42
|
+
exports.merge = function(target, a, arrayMode) {
|
|
43
|
+
if (a) {
|
|
44
|
+
const keys = Object.keys(a); // will return an array of own properties
|
|
45
|
+
const len = keys.length; //don't make it inline
|
|
46
|
+
for (let i = 0; i < len; i++) {
|
|
47
|
+
if (arrayMode === 'strict') {
|
|
48
|
+
target[keys[i]] = [ a[keys[i]] ];
|
|
49
|
+
} else {
|
|
50
|
+
target[keys[i]] = a[keys[i]];
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
}
|
|
54
|
+
};
|
|
55
|
+
/* exports.merge =function (b,a){
|
|
56
|
+
return Object.assign(b,a);
|
|
57
|
+
} */
|
|
58
|
+
|
|
59
|
+
exports.getValue = function(v) {
|
|
60
|
+
if (exports.isExist(v)) {
|
|
61
|
+
return v;
|
|
62
|
+
} else {
|
|
63
|
+
return '';
|
|
64
|
+
}
|
|
65
|
+
};
|
|
66
|
+
|
|
67
|
+
// const fakeCall = function(a) {return a;};
|
|
68
|
+
// const fakeCallNoReturn = function() {};
|
|
69
|
+
|
|
70
|
+
exports.isName = isName;
|
|
71
|
+
exports.getAllMatches = getAllMatches;
|
|
72
|
+
exports.nameRegexp = nameRegexp;
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
modules.export = {
|
|
2
|
+
"<" : "<", //tag start
|
|
3
|
+
">" : ">", //tag end
|
|
4
|
+
"/" : "/", //close tag
|
|
5
|
+
"!" : "!", //comment or docttype
|
|
6
|
+
"!--" : "!--", //comment
|
|
7
|
+
"-->" : "-->", //comment end
|
|
8
|
+
"?" : "?", //pi
|
|
9
|
+
"?>" : "?>", //pi end
|
|
10
|
+
"?xml" : "?xml", //pi end
|
|
11
|
+
"![" : "![", //cdata
|
|
12
|
+
"]]>" : "]]>", //cdata end
|
|
13
|
+
"[" : "[",
|
|
14
|
+
"-" : "-",
|
|
15
|
+
"D" : "D",
|
|
16
|
+
}
|
|
@@ -0,0 +1,107 @@
|
|
|
1
|
+
const ampEntity = { regex: /&(amp|#38|#x26);/g, val : "&"};
|
|
2
|
+
const htmlEntities = {
|
|
3
|
+
"space": { regex: /&(nbsp|#160);/g, val: " " },
|
|
4
|
+
// "lt" : { regex: /&(lt|#60);/g, val: "<" },
|
|
5
|
+
// "gt" : { regex: /&(gt|#62);/g, val: ">" },
|
|
6
|
+
// "amp" : { regex: /&(amp|#38);/g, val: "&" },
|
|
7
|
+
// "quot" : { regex: /&(quot|#34);/g, val: "\"" },
|
|
8
|
+
// "apos" : { regex: /&(apos|#39);/g, val: "'" },
|
|
9
|
+
"cent" : { regex: /&(cent|#162);/g, val: "¢" },
|
|
10
|
+
"pound" : { regex: /&(pound|#163);/g, val: "£" },
|
|
11
|
+
"yen" : { regex: /&(yen|#165);/g, val: "¥" },
|
|
12
|
+
"euro" : { regex: /&(euro|#8364);/g, val: "€" },
|
|
13
|
+
"copyright" : { regex: /&(copy|#169);/g, val: "©" },
|
|
14
|
+
"reg" : { regex: /&(reg|#174);/g, val: "®" },
|
|
15
|
+
"inr" : { regex: /&(inr|#8377);/g, val: "₹" },
|
|
16
|
+
"num_dec": { regex: /&#([0-9]{1,7});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 10)) },
|
|
17
|
+
"num_hex": { regex: /&#x([0-9a-fA-F]{1,6});/g, val : (_, str) => String.fromCharCode(Number.parseInt(str, 16)) },
|
|
18
|
+
};
|
|
19
|
+
|
|
20
|
+
class EntitiesParser{
|
|
21
|
+
constructor(replaceHtmlEntities) {
|
|
22
|
+
this.replaceHtmlEntities = replaceHtmlEntities;
|
|
23
|
+
this.docTypeEntities = {};
|
|
24
|
+
this.lastEntities = {
|
|
25
|
+
"apos" : { regex: /&(apos|#39|#x27);/g, val : "'"},
|
|
26
|
+
"gt" : { regex: /&(gt|#62|#x3E);/g, val : ">"},
|
|
27
|
+
"lt" : { regex: /&(lt|#60|#x3C);/g, val : "<"},
|
|
28
|
+
"quot" : { regex: /&(quot|#34|#x22);/g, val : "\""},
|
|
29
|
+
};
|
|
30
|
+
}
|
|
31
|
+
|
|
32
|
+
addExternalEntities(externalEntities){
|
|
33
|
+
const entKeys = Object.keys(externalEntities);
|
|
34
|
+
for (let i = 0; i < entKeys.length; i++) {
|
|
35
|
+
const ent = entKeys[i];
|
|
36
|
+
this.addExternalEntity(ent,externalEntities[ent])
|
|
37
|
+
}
|
|
38
|
+
}
|
|
39
|
+
addExternalEntity(key,val){
|
|
40
|
+
validateEntityName(key);
|
|
41
|
+
if(val.indexOf("&") !== -1) {
|
|
42
|
+
reportWarning(`Entity ${key} is not added as '&' is found in value;`)
|
|
43
|
+
return;
|
|
44
|
+
}else{
|
|
45
|
+
this.lastEntities[ent] = {
|
|
46
|
+
regex: new RegExp("&"+key+";","g"),
|
|
47
|
+
val : val
|
|
48
|
+
}
|
|
49
|
+
}
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
addDocTypeEntities(entities){
|
|
53
|
+
const entKeys = Object.keys(entities);
|
|
54
|
+
for (let i = 0; i < entKeys.length; i++) {
|
|
55
|
+
const ent = entKeys[i];
|
|
56
|
+
this.docTypeEntities[ent] = {
|
|
57
|
+
regex: new RegExp("&"+ent+";","g"),
|
|
58
|
+
val : entities[ent]
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
parse(val){
|
|
64
|
+
return this.replaceEntitiesValue(val)
|
|
65
|
+
}
|
|
66
|
+
|
|
67
|
+
/**
|
|
68
|
+
* 1. Replace DOCTYPE entities
|
|
69
|
+
* 2. Replace external entities
|
|
70
|
+
* 3. Replace HTML entities if asked
|
|
71
|
+
* @param {string} val
|
|
72
|
+
*/
|
|
73
|
+
replaceEntitiesValue(val){
|
|
74
|
+
if(typeof val === "string" && val.length > 0){
|
|
75
|
+
for(let entityName in this.docTypeEntities){
|
|
76
|
+
const entity = this.docTypeEntities[entityName];
|
|
77
|
+
val = val.replace( entity.regx, entity.val);
|
|
78
|
+
}
|
|
79
|
+
for(let entityName in this.lastEntities){
|
|
80
|
+
const entity = this.lastEntities[entityName];
|
|
81
|
+
val = val.replace( entity.regex, entity.val);
|
|
82
|
+
}
|
|
83
|
+
if(this.replaceHtmlEntities){
|
|
84
|
+
for(let entityName in htmlEntities){
|
|
85
|
+
const entity = htmlEntities[entityName];
|
|
86
|
+
val = val.replace( entity.regex, entity.val);
|
|
87
|
+
}
|
|
88
|
+
}
|
|
89
|
+
val = val.replace( ampEntity.regex, ampEntity.val);
|
|
90
|
+
}
|
|
91
|
+
return val;
|
|
92
|
+
}
|
|
93
|
+
};
|
|
94
|
+
|
|
95
|
+
//an entity name should not contains special characters that may be used in regex
|
|
96
|
+
//Eg !?\\\/[]$%{}^&*()<>
|
|
97
|
+
const specialChar = "!?\\\/[]$%{}^&*()<>|+";
|
|
98
|
+
|
|
99
|
+
function validateEntityName(name){
|
|
100
|
+
for (let i = 0; i < specialChar.length; i++) {
|
|
101
|
+
const ch = specialChar[i];
|
|
102
|
+
if(name.indexOf(ch) !== -1) throw new Error(`Invalid character ${ch} in entity name`);
|
|
103
|
+
}
|
|
104
|
+
return name;
|
|
105
|
+
}
|
|
106
|
+
|
|
107
|
+
module.exports = EntitiesParser;
|
|
@@ -0,0 +1,64 @@
|
|
|
1
|
+
|
|
2
|
+
const JsObjOutputBuilder = require("./OutputBuilders/JsObjBuilder");
|
|
3
|
+
|
|
4
|
+
const defaultOptions = {
|
|
5
|
+
preserveOrder: false,
|
|
6
|
+
removeNSPrefix: false, // remove NS from tag name or attribute name if true
|
|
7
|
+
//ignoreRootElement : false,
|
|
8
|
+
stopNodes: [], //nested tags will not be parsed even for errors
|
|
9
|
+
// isArray: () => false, //User will set it
|
|
10
|
+
htmlEntities: false,
|
|
11
|
+
// skipEmptyListItem: false
|
|
12
|
+
tags:{
|
|
13
|
+
unpaired: [],
|
|
14
|
+
nameFor:{
|
|
15
|
+
cdata: false,
|
|
16
|
+
comment: false,
|
|
17
|
+
text: '#text'
|
|
18
|
+
},
|
|
19
|
+
separateTextProperty: false,
|
|
20
|
+
},
|
|
21
|
+
attributes:{
|
|
22
|
+
ignore: false,
|
|
23
|
+
booleanType: true,
|
|
24
|
+
entities: true,
|
|
25
|
+
},
|
|
26
|
+
|
|
27
|
+
// select: ["img[src]"],
|
|
28
|
+
// stop: ["anim", "[ads]"]
|
|
29
|
+
only: [], // rest tags will be skipped. It will result in flat array
|
|
30
|
+
hierarchy: false, //will be used when a particular tag is set to be parsed.
|
|
31
|
+
skip: [], // will be skipped from parse result. on('skip') will be triggered
|
|
32
|
+
|
|
33
|
+
select: [], // on('select', tag => tag ) will be called if match
|
|
34
|
+
stop: [], //given tagPath will not be parsed. innerXML will be set as string value
|
|
35
|
+
OutputBuilder: new JsObjOutputBuilder(),
|
|
36
|
+
};
|
|
37
|
+
|
|
38
|
+
const buildOptions = function(options) {
|
|
39
|
+
const finalOptions = { ... defaultOptions};
|
|
40
|
+
copyProperties(finalOptions,options)
|
|
41
|
+
return finalOptions;
|
|
42
|
+
};
|
|
43
|
+
|
|
44
|
+
function copyProperties(target, source) {
|
|
45
|
+
for (let key in source) {
|
|
46
|
+
if (source.hasOwnProperty(key)) {
|
|
47
|
+
if (key === 'OutputBuilder') {
|
|
48
|
+
target[key] = source[key];
|
|
49
|
+
}else if (typeof source[key] === 'object' && !Array.isArray(source[key])) {
|
|
50
|
+
// Recursively copy nested properties
|
|
51
|
+
if (typeof target[key] === 'undefined') {
|
|
52
|
+
target[key] = {};
|
|
53
|
+
}
|
|
54
|
+
copyProperties(target[key], source[key]);
|
|
55
|
+
} else {
|
|
56
|
+
// Copy non-nested properties
|
|
57
|
+
target[key] = source[key];
|
|
58
|
+
}
|
|
59
|
+
}
|
|
60
|
+
}
|
|
61
|
+
}
|
|
62
|
+
|
|
63
|
+
exports.buildOptions = buildOptions;
|
|
64
|
+
exports.defaultOptions = defaultOptions;
|