@openclaw/qqbot 2026.5.20-beta.2 → 2026.5.22
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/@eshaz/web-worker/LICENSE +201 -0
- package/node_modules/@eshaz/web-worker/README.md +134 -0
- package/node_modules/@eshaz/web-worker/browser.js +17 -0
- package/node_modules/@eshaz/web-worker/cjs/browser.js +16 -0
- package/node_modules/@eshaz/web-worker/cjs/node.js +219 -0
- package/node_modules/@eshaz/web-worker/index.d.ts +4 -0
- package/node_modules/@eshaz/web-worker/node.js +223 -0
- package/node_modules/@eshaz/web-worker/package.json +54 -0
- package/node_modules/@tencent-connect/qqbot-connector/README.md +138 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/index.d.ts +2 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/index.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qqbot-session.d.ts +35 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qqbot-session.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qr-connect.d.ts +83 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/cjs/qr-connect.js +3 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/index.d.ts +2 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/index.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qqbot-session.d.ts +35 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qqbot-session.js +1 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qr-connect.d.ts +83 -0
- package/node_modules/@tencent-connect/qqbot-connector/dist/esm/qr-connect.js +3 -0
- package/node_modules/@tencent-connect/qqbot-connector/package.json +62 -0
- package/node_modules/@wasm-audio-decoders/common/index.js +5 -0
- package/node_modules/@wasm-audio-decoders/common/package.json +36 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderCommon.js +231 -0
- package/node_modules/@wasm-audio-decoders/common/src/WASMAudioDecoderWorker.js +129 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/README +67 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/build_puff.js +31 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.c +863 -0
- package/node_modules/@wasm-audio-decoders/common/src/puff/puff.h +35 -0
- package/node_modules/@wasm-audio-decoders/common/src/utilities.js +3 -0
- package/node_modules/@wasm-audio-decoders/common/types.d.ts +7 -0
- package/node_modules/mpg123-decoder/README.md +265 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js +185 -0
- package/node_modules/mpg123-decoder/dist/mpg123-decoder.min.js.map +1 -0
- package/node_modules/mpg123-decoder/index.js +8 -0
- package/node_modules/mpg123-decoder/package.json +58 -0
- package/node_modules/mpg123-decoder/src/EmscriptenWasm.js +464 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoder.js +200 -0
- package/node_modules/mpg123-decoder/src/MPEGDecoderWebWorker.js +21 -0
- package/node_modules/mpg123-decoder/types.d.ts +30 -0
- package/node_modules/qrcode-terminal/.travis.yml +3 -0
- package/node_modules/qrcode-terminal/LICENSE +222 -0
- package/node_modules/qrcode-terminal/README.md +82 -0
- package/node_modules/qrcode-terminal/bin/qrcode-terminal.js +101 -0
- package/node_modules/qrcode-terminal/example/basic.js +2 -0
- package/node_modules/qrcode-terminal/example/basic.png +0 -0
- package/node_modules/qrcode-terminal/example/callback.js +4 -0
- package/node_modules/qrcode-terminal/example/small-qrcode.js +6 -0
- package/node_modules/qrcode-terminal/lib/main.js +100 -0
- package/node_modules/qrcode-terminal/package.json +37 -0
- package/node_modules/qrcode-terminal/test/main.js +63 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QR8bitByte.js +22 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRBitBuffer.js +38 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRErrorCorrectLevel.js +7 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMaskPattern.js +10 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMath.js +44 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRMode.js +6 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRPolynomial.js +66 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRRSBlock.js +298 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/QRUtil.js +272 -0
- package/node_modules/qrcode-terminal/vendor/QRCode/index.js +462 -0
- package/node_modules/silk-wasm/LICENSE +21 -0
- package/node_modules/silk-wasm/README.md +85 -0
- package/node_modules/silk-wasm/lib/index.cjs +16 -0
- package/node_modules/silk-wasm/lib/index.d.ts +70 -0
- package/node_modules/silk-wasm/lib/index.mjs +16 -0
- package/node_modules/silk-wasm/lib/silk.wasm +0 -0
- package/node_modules/silk-wasm/lib/utils.d.ts +4 -0
- package/node_modules/silk-wasm/package.json +39 -0
- package/node_modules/simple-yenc/.github/FUNDING.yml +1 -0
- package/node_modules/simple-yenc/.prettierignore +1 -0
- package/node_modules/simple-yenc/LICENSE +7 -0
- package/node_modules/simple-yenc/README.md +163 -0
- package/node_modules/simple-yenc/dist/esm.js +1 -0
- package/node_modules/simple-yenc/dist/index.js +1 -0
- package/node_modules/simple-yenc/package.json +50 -0
- package/node_modules/simple-yenc/rollup.config.js +27 -0
- package/node_modules/simple-yenc/src/simple-yenc.js +302 -0
- package/node_modules/ws/LICENSE +20 -0
- package/node_modules/ws/README.md +548 -0
- package/node_modules/ws/browser.js +8 -0
- package/node_modules/ws/index.js +22 -0
- package/node_modules/ws/lib/buffer-util.js +131 -0
- package/node_modules/ws/lib/constants.js +19 -0
- package/node_modules/ws/lib/event-target.js +292 -0
- package/node_modules/ws/lib/extension.js +203 -0
- package/node_modules/ws/lib/limiter.js +55 -0
- package/node_modules/ws/lib/permessage-deflate.js +528 -0
- package/node_modules/ws/lib/receiver.js +706 -0
- package/node_modules/ws/lib/sender.js +607 -0
- package/node_modules/ws/lib/stream.js +161 -0
- package/node_modules/ws/lib/subprotocol.js +62 -0
- package/node_modules/ws/lib/validation.js +152 -0
- package/node_modules/ws/lib/websocket-server.js +554 -0
- package/node_modules/ws/lib/websocket.js +1393 -0
- package/node_modules/ws/package.json +70 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/zod/LICENSE +21 -0
- package/node_modules/zod/README.md +191 -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/locales/index.cjs +17 -0
- package/node_modules/zod/locales/index.d.cts +1 -0
- package/node_modules/zod/locales/index.d.ts +1 -0
- package/node_modules/zod/locales/index.js +1 -0
- package/node_modules/zod/locales/package.json +7 -0
- package/node_modules/zod/mini/index.cjs +32 -0
- package/node_modules/zod/mini/index.d.cts +3 -0
- package/node_modules/zod/mini/index.d.ts +3 -0
- package/node_modules/zod/mini/index.js +3 -0
- package/node_modules/zod/mini/package.json +7 -0
- package/node_modules/zod/package.json +135 -0
- package/node_modules/zod/src/index.ts +4 -0
- package/node_modules/zod/src/locales/index.ts +1 -0
- package/node_modules/zod/src/mini/index.ts +3 -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 +70 -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 +261 -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 +24 -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 +5138 -0
- package/node_modules/zod/src/v4/classic/checks.ts +32 -0
- package/node_modules/zod/src/v4/classic/coerce.ts +27 -0
- package/node_modules/zod/src/v4/classic/compat.ts +70 -0
- package/node_modules/zod/src/v4/classic/errors.ts +82 -0
- package/node_modules/zod/src/v4/classic/external.ts +52 -0
- package/node_modules/zod/src/v4/classic/from-json-schema.ts +659 -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 +82 -0
- package/node_modules/zod/src/v4/classic/schemas.ts +2672 -0
- package/node_modules/zod/src/v4/classic/tests/anyunknown.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/apply.test.ts +59 -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 +216 -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 +106 -0
- package/node_modules/zod/src/v4/classic/tests/catch.test.ts +326 -0
- package/node_modules/zod/src/v4/classic/tests/coalesce.test.ts +20 -0
- package/node_modules/zod/src/v4/classic/tests/codec-examples.test.ts +573 -0
- package/node_modules/zod/src/v4/classic/tests/codec.test.ts +703 -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 +374 -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 +62 -0
- package/node_modules/zod/src/v4/classic/tests/datetime.test.ts +302 -0
- package/node_modules/zod/src/v4/classic/tests/default.test.ts +409 -0
- package/node_modules/zod/src/v4/classic/tests/describe-meta-checks.test.ts +27 -0
- package/node_modules/zod/src/v4/classic/tests/description.test.ts +32 -0
- package/node_modules/zod/src/v4/classic/tests/detached-methods.test.ts +197 -0
- package/node_modules/zod/src/v4/classic/tests/discriminated-unions.test.ts +694 -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 +807 -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 +96 -0
- package/node_modules/zod/src/v4/classic/tests/firstparty.test.ts +179 -0
- package/node_modules/zod/src/v4/classic/tests/fix-json-issue.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/from-json-schema.test.ts +895 -0
- package/node_modules/zod/src/v4/classic/tests/function.test.ts +360 -0
- package/node_modules/zod/src/v4/classic/tests/generics.test.ts +72 -0
- package/node_modules/zod/src/v4/classic/tests/global-config.test.ts +39 -0
- package/node_modules/zod/src/v4/classic/tests/hash.test.ts +68 -0
- package/node_modules/zod/src/v4/classic/tests/index.test.ts +939 -0
- package/node_modules/zod/src/v4/classic/tests/instanceof.test.ts +60 -0
- package/node_modules/zod/src/v4/classic/tests/intersection.test.ts +198 -0
- package/node_modules/zod/src/v4/classic/tests/jitless-allows-eval.test.ts +46 -0
- package/node_modules/zod/src/v4/classic/tests/json.test.ts +109 -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 +117 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ka.test.ts +29 -0
- package/node_modules/zod/src/v4/classic/tests/locales_ro.test.ts +24 -0
- package/node_modules/zod/src/v4/classic/tests/map.test.ts +330 -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 +101 -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 +325 -0
- package/node_modules/zod/src/v4/classic/tests/object.test.ts +717 -0
- package/node_modules/zod/src/v4/classic/tests/optional.test.ts +333 -0
- package/node_modules/zod/src/v4/classic/tests/partial.test.ts +450 -0
- package/node_modules/zod/src/v4/classic/tests/pickomit.test.ts +211 -0
- package/node_modules/zod/src/v4/classic/tests/pipe.test.ts +101 -0
- package/node_modules/zod/src/v4/classic/tests/prefault.test.ts +74 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess-types.test.ts +26 -0
- package/node_modules/zod/src/v4/classic/tests/preprocess.test.ts +351 -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 +717 -0
- package/node_modules/zod/src/v4/classic/tests/recursive-types.test.ts +631 -0
- package/node_modules/zod/src/v4/classic/tests/refine.test.ts +633 -0
- package/node_modules/zod/src/v4/classic/tests/registries.test.ts +243 -0
- package/node_modules/zod/src/v4/classic/tests/set.test.ts +181 -0
- package/node_modules/zod/src/v4/classic/tests/standard-schema.test.ts +134 -0
- package/node_modules/zod/src/v4/classic/tests/string-formats.test.ts +125 -0
- package/node_modules/zod/src/v4/classic/tests/string.test.ts +1224 -0
- package/node_modules/zod/src/v4/classic/tests/stringbool.test.ts +106 -0
- package/node_modules/zod/src/v4/classic/tests/template-literal.test.ts +771 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema-methods.test.ts +438 -0
- package/node_modules/zod/src/v4/classic/tests/to-json-schema.test.ts +3125 -0
- package/node_modules/zod/src/v4/classic/tests/transform.test.ts +378 -0
- package/node_modules/zod/src/v4/classic/tests/tuple.test.ts +496 -0
- package/node_modules/zod/src/v4/classic/tests/union.test.ts +273 -0
- package/node_modules/zod/src/v4/classic/tests/url.test.ts +13 -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 +1823 -0
- package/node_modules/zod/src/v4/core/checks.ts +1293 -0
- package/node_modules/zod/src/v4/core/config.ts +15 -0
- package/node_modules/zod/src/v4/core/core.ts +153 -0
- package/node_modules/zod/src/v4/core/doc.ts +44 -0
- package/node_modules/zod/src/v4/core/errors.ts +455 -0
- package/node_modules/zod/src/v4/core/index.ts +16 -0
- package/node_modules/zod/src/v4/core/json-schema-generator.ts +126 -0
- package/node_modules/zod/src/v4/core/json-schema-processors.ts +666 -0
- package/node_modules/zod/src/v4/core/json-schema.ts +147 -0
- package/node_modules/zod/src/v4/core/parse.ts +195 -0
- package/node_modules/zod/src/v4/core/regexes.ts +190 -0
- package/node_modules/zod/src/v4/core/registries.ts +105 -0
- package/node_modules/zod/src/v4/core/schemas.ts +4730 -0
- package/node_modules/zod/src/v4/core/standard-schema.ts +159 -0
- package/node_modules/zod/src/v4/core/tests/extend.test.ts +59 -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/el.test.ts +215 -0
- package/node_modules/zod/src/v4/core/tests/locales/en.test.ts +22 -0
- package/node_modules/zod/src/v4/core/tests/locales/es.test.ts +181 -0
- package/node_modules/zod/src/v4/core/tests/locales/fr.test.ts +72 -0
- package/node_modules/zod/src/v4/core/tests/locales/he.test.ts +379 -0
- package/node_modules/zod/src/v4/core/tests/locales/hr.test.ts +163 -0
- package/node_modules/zod/src/v4/core/tests/locales/nl.test.ts +46 -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/tests/locales/uz.test.ts +105 -0
- package/node_modules/zod/src/v4/core/tests/record-constructor.test.ts +125 -0
- package/node_modules/zod/src/v4/core/tests/recursive-tuples.test.ts +45 -0
- package/node_modules/zod/src/v4/core/to-json-schema.ts +622 -0
- package/node_modules/zod/src/v4/core/util.ts +983 -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 +115 -0
- package/node_modules/zod/src/v4/locales/az.ts +111 -0
- package/node_modules/zod/src/v4/locales/be.ts +176 -0
- package/node_modules/zod/src/v4/locales/bg.ts +128 -0
- package/node_modules/zod/src/v4/locales/ca.ts +116 -0
- package/node_modules/zod/src/v4/locales/cs.ts +118 -0
- package/node_modules/zod/src/v4/locales/da.ts +123 -0
- package/node_modules/zod/src/v4/locales/de.ts +116 -0
- package/node_modules/zod/src/v4/locales/el.ts +121 -0
- package/node_modules/zod/src/v4/locales/en.ts +123 -0
- package/node_modules/zod/src/v4/locales/eo.ts +118 -0
- package/node_modules/zod/src/v4/locales/es.ts +141 -0
- package/node_modules/zod/src/v4/locales/fa.ts +126 -0
- package/node_modules/zod/src/v4/locales/fi.ts +121 -0
- package/node_modules/zod/src/v4/locales/fr-CA.ts +116 -0
- package/node_modules/zod/src/v4/locales/fr.ts +132 -0
- package/node_modules/zod/src/v4/locales/he.ts +246 -0
- package/node_modules/zod/src/v4/locales/hr.ts +131 -0
- package/node_modules/zod/src/v4/locales/hu.ts +117 -0
- package/node_modules/zod/src/v4/locales/hy.ts +164 -0
- package/node_modules/zod/src/v4/locales/id.ts +115 -0
- package/node_modules/zod/src/v4/locales/index.ts +52 -0
- package/node_modules/zod/src/v4/locales/is.ts +119 -0
- package/node_modules/zod/src/v4/locales/it.ts +116 -0
- package/node_modules/zod/src/v4/locales/ja.ts +114 -0
- package/node_modules/zod/src/v4/locales/ka.ts +123 -0
- package/node_modules/zod/src/v4/locales/kh.ts +7 -0
- package/node_modules/zod/src/v4/locales/km.ts +119 -0
- package/node_modules/zod/src/v4/locales/ko.ts +121 -0
- package/node_modules/zod/src/v4/locales/lt.ts +239 -0
- package/node_modules/zod/src/v4/locales/mk.ts +118 -0
- package/node_modules/zod/src/v4/locales/ms.ts +115 -0
- package/node_modules/zod/src/v4/locales/nl.ts +121 -0
- package/node_modules/zod/src/v4/locales/no.ts +116 -0
- package/node_modules/zod/src/v4/locales/ota.ts +117 -0
- package/node_modules/zod/src/v4/locales/pl.ts +118 -0
- package/node_modules/zod/src/v4/locales/ps.ts +126 -0
- package/node_modules/zod/src/v4/locales/pt.ts +116 -0
- package/node_modules/zod/src/v4/locales/ro.ts +129 -0
- package/node_modules/zod/src/v4/locales/ru.ts +176 -0
- package/node_modules/zod/src/v4/locales/sl.ts +118 -0
- package/node_modules/zod/src/v4/locales/sv.ts +119 -0
- package/node_modules/zod/src/v4/locales/ta.ts +118 -0
- package/node_modules/zod/src/v4/locales/th.ts +119 -0
- package/node_modules/zod/src/v4/locales/tr.ts +111 -0
- package/node_modules/zod/src/v4/locales/ua.ts +7 -0
- package/node_modules/zod/src/v4/locales/uk.ts +117 -0
- package/node_modules/zod/src/v4/locales/ur.ts +119 -0
- package/node_modules/zod/src/v4/locales/uz.ts +117 -0
- package/node_modules/zod/src/v4/locales/vi.ts +117 -0
- package/node_modules/zod/src/v4/locales/yo.ts +124 -0
- package/node_modules/zod/src/v4/locales/zh-CN.ts +116 -0
- package/node_modules/zod/src/v4/locales/zh-TW.ts +115 -0
- package/node_modules/zod/src/v4/mini/checks.ts +32 -0
- package/node_modules/zod/src/v4/mini/coerce.ts +27 -0
- package/node_modules/zod/src/v4/mini/external.ts +41 -0
- package/node_modules/zod/src/v4/mini/index.ts +3 -0
- package/node_modules/zod/src/v4/mini/iso.ts +66 -0
- package/node_modules/zod/src/v4/mini/parse.ts +14 -0
- package/node_modules/zod/src/v4/mini/schemas.ts +1947 -0
- package/node_modules/zod/src/v4/mini/tests/apply.test.ts +24 -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 +94 -0
- package/node_modules/zod/src/v4/mini/tests/checks.test.ts +144 -0
- package/node_modules/zod/src/v4/mini/tests/codec.test.ts +548 -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 +5 -0
- package/node_modules/zod/src/v4/mini/tests/index.test.ts +993 -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 +227 -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 +325 -0
- package/node_modules/zod/src/v4/mini/tests/standard-schema.test.ts +50 -0
- package/node_modules/zod/src/v4/mini/tests/string.test.ts +352 -0
- package/node_modules/zod/src/v4-mini/index.ts +3 -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 +112 -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/package.json +7 -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 +3777 -0
- package/node_modules/zod/v3/types.d.cts +1034 -0
- package/node_modules/zod/v3/types.d.ts +1034 -0
- package/node_modules/zod/v3/types.js +3695 -0
- package/node_modules/zod/v4/classic/checks.cjs +33 -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 +61 -0
- package/node_modules/zod/v4/classic/compat.d.cts +50 -0
- package/node_modules/zod/v4/classic/compat.d.ts +50 -0
- package/node_modules/zod/v4/classic/compat.js +31 -0
- package/node_modules/zod/v4/classic/errors.cjs +74 -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 +48 -0
- package/node_modules/zod/v4/classic/external.cjs +73 -0
- package/node_modules/zod/v4/classic/external.d.cts +16 -0
- package/node_modules/zod/v4/classic/external.d.ts +16 -0
- package/node_modules/zod/v4/classic/external.js +20 -0
- package/node_modules/zod/v4/classic/from-json-schema.cjs +625 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.cts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.d.ts +12 -0
- package/node_modules/zod/v4/classic/from-json-schema.js +599 -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/package.json +7 -0
- package/node_modules/zod/v4/classic/parse.cjs +41 -0
- package/node_modules/zod/v4/classic/parse.d.cts +31 -0
- package/node_modules/zod/v4/classic/parse.d.ts +31 -0
- package/node_modules/zod/v4/classic/parse.js +15 -0
- package/node_modules/zod/v4/classic/schemas.cjs +1511 -0
- package/node_modules/zod/v4/classic/schemas.d.cts +767 -0
- package/node_modules/zod/v4/classic/schemas.d.ts +767 -0
- package/node_modules/zod/v4/classic/schemas.js +1395 -0
- package/node_modules/zod/v4/core/api.cjs +1227 -0
- package/node_modules/zod/v4/core/api.d.cts +325 -0
- package/node_modules/zod/v4/core/api.d.ts +325 -0
- package/node_modules/zod/v4/core/api.js +1087 -0
- package/node_modules/zod/v4/core/checks.cjs +601 -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 +575 -0
- package/node_modules/zod/v4/core/core.cjs +85 -0
- package/node_modules/zod/v4/core/core.d.cts +70 -0
- package/node_modules/zod/v4/core/core.d.ts +70 -0
- package/node_modules/zod/v4/core/core.js +78 -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 +216 -0
- package/node_modules/zod/v4/core/errors.d.cts +221 -0
- package/node_modules/zod/v4/core/errors.d.ts +221 -0
- package/node_modules/zod/v4/core/errors.js +185 -0
- package/node_modules/zod/v4/core/index.cjs +47 -0
- package/node_modules/zod/v4/core/index.d.cts +16 -0
- package/node_modules/zod/v4/core/index.d.ts +16 -0
- package/node_modules/zod/v4/core/index.js +16 -0
- package/node_modules/zod/v4/core/json-schema-generator.cjs +99 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.cts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.d.ts +65 -0
- package/node_modules/zod/v4/core/json-schema-generator.js +95 -0
- package/node_modules/zod/v4/core/json-schema-processors.cjs +644 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.cts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.d.ts +49 -0
- package/node_modules/zod/v4/core/json-schema-processors.js +601 -0
- package/node_modules/zod/v4/core/json-schema.cjs +2 -0
- package/node_modules/zod/v4/core/json-schema.d.cts +88 -0
- package/node_modules/zod/v4/core/json-schema.d.ts +88 -0
- package/node_modules/zod/v4/core/json-schema.js +1 -0
- package/node_modules/zod/v4/core/package.json +7 -0
- package/node_modules/zod/v4/core/parse.cjs +131 -0
- package/node_modules/zod/v4/core/parse.d.cts +49 -0
- package/node_modules/zod/v4/core/parse.d.ts +49 -0
- package/node_modules/zod/v4/core/parse.js +93 -0
- package/node_modules/zod/v4/core/regexes.cjs +172 -0
- package/node_modules/zod/v4/core/regexes.d.cts +85 -0
- package/node_modules/zod/v4/core/regexes.d.ts +85 -0
- package/node_modules/zod/v4/core/regexes.js +139 -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 +2270 -0
- package/node_modules/zod/v4/core/schemas.d.cts +1184 -0
- package/node_modules/zod/v4/core/schemas.d.ts +1184 -0
- package/node_modules/zod/v4/core/schemas.js +2239 -0
- package/node_modules/zod/v4/core/standard-schema.cjs +2 -0
- package/node_modules/zod/v4/core/standard-schema.d.cts +126 -0
- package/node_modules/zod/v4/core/standard-schema.d.ts +126 -0
- package/node_modules/zod/v4/core/standard-schema.js +1 -0
- package/node_modules/zod/v4/core/to-json-schema.cjs +457 -0
- package/node_modules/zod/v4/core/to-json-schema.d.cts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.d.ts +114 -0
- package/node_modules/zod/v4/core/to-json-schema.js +448 -0
- package/node_modules/zod/v4/core/util.cjs +734 -0
- package/node_modules/zod/v4/core/util.d.cts +200 -0
- package/node_modules/zod/v4/core/util.d.ts +200 -0
- package/node_modules/zod/v4/core/util.js +674 -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 +133 -0
- package/node_modules/zod/v4/locales/ar.d.cts +5 -0
- package/node_modules/zod/v4/locales/ar.d.ts +4 -0
- package/node_modules/zod/v4/locales/ar.js +106 -0
- package/node_modules/zod/v4/locales/az.cjs +132 -0
- package/node_modules/zod/v4/locales/az.d.cts +5 -0
- package/node_modules/zod/v4/locales/az.d.ts +4 -0
- package/node_modules/zod/v4/locales/az.js +105 -0
- package/node_modules/zod/v4/locales/be.cjs +183 -0
- package/node_modules/zod/v4/locales/be.d.cts +5 -0
- package/node_modules/zod/v4/locales/be.d.ts +4 -0
- package/node_modules/zod/v4/locales/be.js +156 -0
- package/node_modules/zod/v4/locales/bg.cjs +147 -0
- package/node_modules/zod/v4/locales/bg.d.cts +5 -0
- package/node_modules/zod/v4/locales/bg.d.ts +4 -0
- package/node_modules/zod/v4/locales/bg.js +120 -0
- package/node_modules/zod/v4/locales/ca.cjs +134 -0
- package/node_modules/zod/v4/locales/ca.d.cts +5 -0
- package/node_modules/zod/v4/locales/ca.d.ts +4 -0
- package/node_modules/zod/v4/locales/ca.js +107 -0
- package/node_modules/zod/v4/locales/cs.cjs +138 -0
- package/node_modules/zod/v4/locales/cs.d.cts +5 -0
- package/node_modules/zod/v4/locales/cs.d.ts +4 -0
- package/node_modules/zod/v4/locales/cs.js +111 -0
- package/node_modules/zod/v4/locales/da.cjs +142 -0
- package/node_modules/zod/v4/locales/da.d.cts +5 -0
- package/node_modules/zod/v4/locales/da.d.ts +4 -0
- package/node_modules/zod/v4/locales/da.js +115 -0
- package/node_modules/zod/v4/locales/de.cjs +135 -0
- package/node_modules/zod/v4/locales/de.d.cts +5 -0
- package/node_modules/zod/v4/locales/de.d.ts +4 -0
- package/node_modules/zod/v4/locales/de.js +108 -0
- package/node_modules/zod/v4/locales/el.cjs +136 -0
- package/node_modules/zod/v4/locales/el.d.cts +5 -0
- package/node_modules/zod/v4/locales/el.d.ts +4 -0
- package/node_modules/zod/v4/locales/el.js +109 -0
- package/node_modules/zod/v4/locales/en.cjs +140 -0
- package/node_modules/zod/v4/locales/en.d.cts +5 -0
- package/node_modules/zod/v4/locales/en.d.ts +4 -0
- package/node_modules/zod/v4/locales/en.js +113 -0
- package/node_modules/zod/v4/locales/eo.cjs +136 -0
- package/node_modules/zod/v4/locales/eo.d.cts +5 -0
- package/node_modules/zod/v4/locales/eo.d.ts +4 -0
- package/node_modules/zod/v4/locales/eo.js +109 -0
- package/node_modules/zod/v4/locales/es.cjs +159 -0
- package/node_modules/zod/v4/locales/es.d.cts +5 -0
- package/node_modules/zod/v4/locales/es.d.ts +4 -0
- package/node_modules/zod/v4/locales/es.js +132 -0
- package/node_modules/zod/v4/locales/fa.cjs +141 -0
- package/node_modules/zod/v4/locales/fa.d.cts +5 -0
- package/node_modules/zod/v4/locales/fa.d.ts +4 -0
- package/node_modules/zod/v4/locales/fa.js +114 -0
- package/node_modules/zod/v4/locales/fi.cjs +139 -0
- package/node_modules/zod/v4/locales/fi.d.cts +5 -0
- package/node_modules/zod/v4/locales/fi.d.ts +4 -0
- package/node_modules/zod/v4/locales/fi.js +112 -0
- package/node_modules/zod/v4/locales/fr-CA.cjs +134 -0
- package/node_modules/zod/v4/locales/fr-CA.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr-CA.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr-CA.js +107 -0
- package/node_modules/zod/v4/locales/fr.cjs +152 -0
- package/node_modules/zod/v4/locales/fr.d.cts +5 -0
- package/node_modules/zod/v4/locales/fr.d.ts +4 -0
- package/node_modules/zod/v4/locales/fr.js +125 -0
- package/node_modules/zod/v4/locales/he.cjs +241 -0
- package/node_modules/zod/v4/locales/he.d.cts +5 -0
- package/node_modules/zod/v4/locales/he.d.ts +4 -0
- package/node_modules/zod/v4/locales/he.js +214 -0
- package/node_modules/zod/v4/locales/hr.cjs +149 -0
- package/node_modules/zod/v4/locales/hr.d.cts +5 -0
- package/node_modules/zod/v4/locales/hr.d.ts +4 -0
- package/node_modules/zod/v4/locales/hr.js +122 -0
- package/node_modules/zod/v4/locales/hu.cjs +135 -0
- package/node_modules/zod/v4/locales/hu.d.cts +5 -0
- package/node_modules/zod/v4/locales/hu.d.ts +4 -0
- package/node_modules/zod/v4/locales/hu.js +108 -0
- package/node_modules/zod/v4/locales/hy.cjs +174 -0
- package/node_modules/zod/v4/locales/hy.d.cts +5 -0
- package/node_modules/zod/v4/locales/hy.d.ts +4 -0
- package/node_modules/zod/v4/locales/hy.js +147 -0
- package/node_modules/zod/v4/locales/id.cjs +133 -0
- package/node_modules/zod/v4/locales/id.d.cts +5 -0
- package/node_modules/zod/v4/locales/id.d.ts +4 -0
- package/node_modules/zod/v4/locales/id.js +106 -0
- package/node_modules/zod/v4/locales/index.cjs +111 -0
- package/node_modules/zod/v4/locales/index.d.cts +52 -0
- package/node_modules/zod/v4/locales/index.d.ts +52 -0
- package/node_modules/zod/v4/locales/index.js +52 -0
- package/node_modules/zod/v4/locales/is.cjs +136 -0
- package/node_modules/zod/v4/locales/is.d.cts +5 -0
- package/node_modules/zod/v4/locales/is.d.ts +4 -0
- package/node_modules/zod/v4/locales/is.js +109 -0
- package/node_modules/zod/v4/locales/it.cjs +135 -0
- package/node_modules/zod/v4/locales/it.d.cts +5 -0
- package/node_modules/zod/v4/locales/it.d.ts +4 -0
- package/node_modules/zod/v4/locales/it.js +108 -0
- package/node_modules/zod/v4/locales/ja.cjs +134 -0
- package/node_modules/zod/v4/locales/ja.d.cts +5 -0
- package/node_modules/zod/v4/locales/ja.d.ts +4 -0
- package/node_modules/zod/v4/locales/ja.js +107 -0
- package/node_modules/zod/v4/locales/ka.cjs +139 -0
- package/node_modules/zod/v4/locales/ka.d.cts +5 -0
- package/node_modules/zod/v4/locales/ka.d.ts +4 -0
- package/node_modules/zod/v4/locales/ka.js +112 -0
- package/node_modules/zod/v4/locales/kh.cjs +12 -0
- package/node_modules/zod/v4/locales/kh.d.cts +5 -0
- package/node_modules/zod/v4/locales/kh.d.ts +5 -0
- package/node_modules/zod/v4/locales/kh.js +5 -0
- package/node_modules/zod/v4/locales/km.cjs +137 -0
- package/node_modules/zod/v4/locales/km.d.cts +5 -0
- package/node_modules/zod/v4/locales/km.d.ts +4 -0
- package/node_modules/zod/v4/locales/km.js +110 -0
- package/node_modules/zod/v4/locales/ko.cjs +138 -0
- package/node_modules/zod/v4/locales/ko.d.cts +5 -0
- package/node_modules/zod/v4/locales/ko.d.ts +4 -0
- package/node_modules/zod/v4/locales/ko.js +111 -0
- package/node_modules/zod/v4/locales/lt.cjs +230 -0
- package/node_modules/zod/v4/locales/lt.d.cts +5 -0
- package/node_modules/zod/v4/locales/lt.d.ts +4 -0
- package/node_modules/zod/v4/locales/lt.js +203 -0
- package/node_modules/zod/v4/locales/mk.cjs +136 -0
- package/node_modules/zod/v4/locales/mk.d.cts +5 -0
- package/node_modules/zod/v4/locales/mk.d.ts +4 -0
- package/node_modules/zod/v4/locales/mk.js +109 -0
- package/node_modules/zod/v4/locales/ms.cjs +134 -0
- package/node_modules/zod/v4/locales/ms.d.cts +5 -0
- package/node_modules/zod/v4/locales/ms.d.ts +4 -0
- package/node_modules/zod/v4/locales/ms.js +107 -0
- package/node_modules/zod/v4/locales/nl.cjs +137 -0
- package/node_modules/zod/v4/locales/nl.d.cts +5 -0
- package/node_modules/zod/v4/locales/nl.d.ts +4 -0
- package/node_modules/zod/v4/locales/nl.js +110 -0
- package/node_modules/zod/v4/locales/no.cjs +135 -0
- package/node_modules/zod/v4/locales/no.d.cts +5 -0
- package/node_modules/zod/v4/locales/no.d.ts +4 -0
- package/node_modules/zod/v4/locales/no.js +108 -0
- package/node_modules/zod/v4/locales/ota.cjs +136 -0
- package/node_modules/zod/v4/locales/ota.d.cts +5 -0
- package/node_modules/zod/v4/locales/ota.d.ts +4 -0
- package/node_modules/zod/v4/locales/ota.js +109 -0
- package/node_modules/zod/v4/locales/package.json +7 -0
- package/node_modules/zod/v4/locales/pl.cjs +136 -0
- package/node_modules/zod/v4/locales/pl.d.cts +5 -0
- package/node_modules/zod/v4/locales/pl.d.ts +4 -0
- package/node_modules/zod/v4/locales/pl.js +109 -0
- package/node_modules/zod/v4/locales/ps.cjs +141 -0
- package/node_modules/zod/v4/locales/ps.d.cts +5 -0
- package/node_modules/zod/v4/locales/ps.d.ts +4 -0
- package/node_modules/zod/v4/locales/ps.js +114 -0
- package/node_modules/zod/v4/locales/pt.cjs +135 -0
- package/node_modules/zod/v4/locales/pt.d.cts +5 -0
- package/node_modules/zod/v4/locales/pt.d.ts +4 -0
- package/node_modules/zod/v4/locales/pt.js +108 -0
- package/node_modules/zod/v4/locales/ro.cjs +146 -0
- package/node_modules/zod/v4/locales/ro.d.cts +5 -0
- package/node_modules/zod/v4/locales/ro.d.ts +4 -0
- package/node_modules/zod/v4/locales/ro.js +119 -0
- package/node_modules/zod/v4/locales/ru.cjs +183 -0
- package/node_modules/zod/v4/locales/ru.d.cts +5 -0
- package/node_modules/zod/v4/locales/ru.d.ts +4 -0
- package/node_modules/zod/v4/locales/ru.js +156 -0
- package/node_modules/zod/v4/locales/sl.cjs +136 -0
- package/node_modules/zod/v4/locales/sl.d.cts +5 -0
- package/node_modules/zod/v4/locales/sl.d.ts +4 -0
- package/node_modules/zod/v4/locales/sl.js +109 -0
- package/node_modules/zod/v4/locales/sv.cjs +137 -0
- package/node_modules/zod/v4/locales/sv.d.cts +5 -0
- package/node_modules/zod/v4/locales/sv.d.ts +4 -0
- package/node_modules/zod/v4/locales/sv.js +110 -0
- package/node_modules/zod/v4/locales/ta.cjs +137 -0
- package/node_modules/zod/v4/locales/ta.d.cts +5 -0
- package/node_modules/zod/v4/locales/ta.d.ts +4 -0
- package/node_modules/zod/v4/locales/ta.js +110 -0
- package/node_modules/zod/v4/locales/th.cjs +137 -0
- package/node_modules/zod/v4/locales/th.d.cts +5 -0
- package/node_modules/zod/v4/locales/th.d.ts +4 -0
- package/node_modules/zod/v4/locales/th.js +110 -0
- package/node_modules/zod/v4/locales/tr.cjs +132 -0
- package/node_modules/zod/v4/locales/tr.d.cts +5 -0
- package/node_modules/zod/v4/locales/tr.d.ts +4 -0
- package/node_modules/zod/v4/locales/tr.js +105 -0
- package/node_modules/zod/v4/locales/ua.cjs +12 -0
- package/node_modules/zod/v4/locales/ua.d.cts +5 -0
- package/node_modules/zod/v4/locales/ua.d.ts +5 -0
- package/node_modules/zod/v4/locales/ua.js +5 -0
- package/node_modules/zod/v4/locales/uk.cjs +135 -0
- package/node_modules/zod/v4/locales/uk.d.cts +5 -0
- package/node_modules/zod/v4/locales/uk.d.ts +4 -0
- package/node_modules/zod/v4/locales/uk.js +108 -0
- package/node_modules/zod/v4/locales/ur.cjs +137 -0
- package/node_modules/zod/v4/locales/ur.d.cts +5 -0
- package/node_modules/zod/v4/locales/ur.d.ts +4 -0
- package/node_modules/zod/v4/locales/ur.js +110 -0
- package/node_modules/zod/v4/locales/uz.cjs +137 -0
- package/node_modules/zod/v4/locales/uz.d.cts +5 -0
- package/node_modules/zod/v4/locales/uz.d.ts +4 -0
- package/node_modules/zod/v4/locales/uz.js +110 -0
- package/node_modules/zod/v4/locales/vi.cjs +135 -0
- package/node_modules/zod/v4/locales/vi.d.cts +5 -0
- package/node_modules/zod/v4/locales/vi.d.ts +4 -0
- package/node_modules/zod/v4/locales/vi.js +108 -0
- package/node_modules/zod/v4/locales/yo.cjs +134 -0
- package/node_modules/zod/v4/locales/yo.d.cts +5 -0
- package/node_modules/zod/v4/locales/yo.d.ts +4 -0
- package/node_modules/zod/v4/locales/yo.js +107 -0
- package/node_modules/zod/v4/locales/zh-CN.cjs +136 -0
- package/node_modules/zod/v4/locales/zh-CN.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-CN.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-CN.js +109 -0
- package/node_modules/zod/v4/locales/zh-TW.cjs +134 -0
- package/node_modules/zod/v4/locales/zh-TW.d.cts +5 -0
- package/node_modules/zod/v4/locales/zh-TW.d.ts +4 -0
- package/node_modules/zod/v4/locales/zh-TW.js +107 -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 +52 -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 +22 -0
- package/node_modules/zod/v4/mini/external.cjs +63 -0
- package/node_modules/zod/v4/mini/external.d.cts +13 -0
- package/node_modules/zod/v4/mini/external.d.ts +13 -0
- package/node_modules/zod/v4/mini/external.js +14 -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 +64 -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 +34 -0
- package/node_modules/zod/v4/mini/package.json +7 -0
- package/node_modules/zod/v4/mini/parse.cjs +16 -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 +1083 -0
- package/node_modules/zod/v4/mini/schemas.d.cts +445 -0
- package/node_modules/zod/v4/mini/schemas.d.ts +445 -0
- package/node_modules/zod/v4/mini/schemas.js +961 -0
- package/node_modules/zod/v4/package.json +7 -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/package.json +7 -0
- package/npm-shrinkwrap.json +125 -0
- package/package.json +12 -9
|
@@ -0,0 +1,223 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Copyright 2020 Google LLC
|
|
3
|
+
*
|
|
4
|
+
* Licensed under the Apache License, Version 2.0 (the "License");
|
|
5
|
+
* you may not use this file except in compliance with the License.
|
|
6
|
+
* You may obtain a copy of the License at
|
|
7
|
+
*
|
|
8
|
+
* http://www.apache.org/licenses/LICENSE-2.0
|
|
9
|
+
*
|
|
10
|
+
* Unless required by applicable law or agreed to in writing, software
|
|
11
|
+
* distributed under the License is distributed on an "AS IS" BASIS,
|
|
12
|
+
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
13
|
+
* See the License for the specific language governing permissions and
|
|
14
|
+
* limitations under the License.
|
|
15
|
+
*/
|
|
16
|
+
|
|
17
|
+
import URL from 'url';
|
|
18
|
+
import VM from 'vm';
|
|
19
|
+
import threads from 'worker_threads';
|
|
20
|
+
|
|
21
|
+
const WORKER = Symbol.for('worker');
|
|
22
|
+
const EVENTS = Symbol.for('events');
|
|
23
|
+
|
|
24
|
+
class EventTarget {
|
|
25
|
+
constructor() {
|
|
26
|
+
Object.defineProperty(this, EVENTS, {
|
|
27
|
+
value: new Map()
|
|
28
|
+
});
|
|
29
|
+
}
|
|
30
|
+
dispatchEvent(event) {
|
|
31
|
+
event.target = event.currentTarget = this;
|
|
32
|
+
if (this['on'+event.type]) {
|
|
33
|
+
try {
|
|
34
|
+
this['on'+event.type](event);
|
|
35
|
+
}
|
|
36
|
+
catch (err) {
|
|
37
|
+
console.error(err);
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
const list = this[EVENTS].get(event.type);
|
|
41
|
+
if (list == null) return;
|
|
42
|
+
list.forEach(handler => {
|
|
43
|
+
try {
|
|
44
|
+
handler.call(this, event);
|
|
45
|
+
}
|
|
46
|
+
catch (err) {
|
|
47
|
+
console.error(err);
|
|
48
|
+
}
|
|
49
|
+
});
|
|
50
|
+
}
|
|
51
|
+
addEventListener(type, fn) {
|
|
52
|
+
let events = this[EVENTS].get(type);
|
|
53
|
+
if (!events) this[EVENTS].set(type, events = []);
|
|
54
|
+
events.push(fn);
|
|
55
|
+
}
|
|
56
|
+
removeEventListener(type, fn) {
|
|
57
|
+
let events = this[EVENTS].get(type);
|
|
58
|
+
if (events) {
|
|
59
|
+
const index = events.indexOf(fn);
|
|
60
|
+
if (index !== -1) events.splice(index, 1);
|
|
61
|
+
}
|
|
62
|
+
}
|
|
63
|
+
}
|
|
64
|
+
|
|
65
|
+
function Event(type, target) {
|
|
66
|
+
this.type = type;
|
|
67
|
+
this.timeStamp = Date.now();
|
|
68
|
+
this.target = this.currentTarget = this.data = null;
|
|
69
|
+
}
|
|
70
|
+
|
|
71
|
+
// this module is used self-referentially on both sides of the
|
|
72
|
+
// thread boundary, but behaves differently in each context.
|
|
73
|
+
export default threads.isMainThread ? mainThread() : workerThread();
|
|
74
|
+
|
|
75
|
+
const baseUrl = URL.pathToFileURL(process.cwd() + '/');
|
|
76
|
+
|
|
77
|
+
function mainThread() {
|
|
78
|
+
|
|
79
|
+
/**
|
|
80
|
+
* A web-compatible Worker implementation atop Node's worker_threads.
|
|
81
|
+
* - uses DOM-style events (Event.data, Event.type, etc)
|
|
82
|
+
* - supports event handler properties (worker.onmessage)
|
|
83
|
+
* - Worker() constructor accepts a module URL
|
|
84
|
+
* - accepts the {type:'module'} option
|
|
85
|
+
* - emulates WorkerGlobalScope within the worker
|
|
86
|
+
* @param {string} url The URL or module specifier to load
|
|
87
|
+
* @param {object} [options] Worker construction options
|
|
88
|
+
* @param {string} [options.name] Available as `self.name` within the Worker
|
|
89
|
+
* @param {string} [options.type="classic"] Pass "module" to create a Module Worker.
|
|
90
|
+
*/
|
|
91
|
+
class Worker extends EventTarget {
|
|
92
|
+
constructor(url, options) {
|
|
93
|
+
super();
|
|
94
|
+
const { name, type } = options || {};
|
|
95
|
+
url += '';
|
|
96
|
+
let mod;
|
|
97
|
+
if (/^data:/.test(url)) {
|
|
98
|
+
mod = url;
|
|
99
|
+
}
|
|
100
|
+
else {
|
|
101
|
+
mod = URL.fileURLToPath(new URL.URL(url, baseUrl));
|
|
102
|
+
}
|
|
103
|
+
const worker = new threads.Worker(
|
|
104
|
+
__filename,
|
|
105
|
+
{ workerData: { mod, name, type } }
|
|
106
|
+
);
|
|
107
|
+
Object.defineProperty(this, WORKER, {
|
|
108
|
+
value: worker
|
|
109
|
+
});
|
|
110
|
+
worker.on('message', data => {
|
|
111
|
+
const event = new Event('message');
|
|
112
|
+
event.data = data;
|
|
113
|
+
this.dispatchEvent(event);
|
|
114
|
+
});
|
|
115
|
+
worker.on('error', error => {
|
|
116
|
+
error.type = 'error';
|
|
117
|
+
this.dispatchEvent(error);
|
|
118
|
+
});
|
|
119
|
+
worker.on('exit', () => {
|
|
120
|
+
this.dispatchEvent(new Event('close'));
|
|
121
|
+
});
|
|
122
|
+
}
|
|
123
|
+
postMessage(data, transferList) {
|
|
124
|
+
this[WORKER].postMessage(data, transferList);
|
|
125
|
+
}
|
|
126
|
+
terminate() {
|
|
127
|
+
this[WORKER].terminate();
|
|
128
|
+
}
|
|
129
|
+
}
|
|
130
|
+
Worker.prototype.onmessage = Worker.prototype.onerror = Worker.prototype.onclose = null;
|
|
131
|
+
return Worker;
|
|
132
|
+
}
|
|
133
|
+
|
|
134
|
+
function workerThread() {
|
|
135
|
+
let { mod, name, type } = threads.workerData || {};
|
|
136
|
+
if (!mod) return mainThread();
|
|
137
|
+
|
|
138
|
+
// turn global into a mock WorkerGlobalScope
|
|
139
|
+
const self = global.self = global;
|
|
140
|
+
|
|
141
|
+
// enqueue messages to dispatch after modules are loaded
|
|
142
|
+
let q = [];
|
|
143
|
+
function flush() {
|
|
144
|
+
const buffered = q;
|
|
145
|
+
q = null;
|
|
146
|
+
buffered.forEach(event => { self.dispatchEvent(event); });
|
|
147
|
+
}
|
|
148
|
+
threads.parentPort.on('message', data => {
|
|
149
|
+
const event = new Event('message');
|
|
150
|
+
event.data = data;
|
|
151
|
+
if (q == null) self.dispatchEvent(event);
|
|
152
|
+
else q.push(event);
|
|
153
|
+
});
|
|
154
|
+
threads.parentPort.on('error', err => {
|
|
155
|
+
err.type = 'Error';
|
|
156
|
+
self.dispatchEvent(err);
|
|
157
|
+
});
|
|
158
|
+
|
|
159
|
+
class WorkerGlobalScope extends EventTarget {
|
|
160
|
+
postMessage(data, transferList) {
|
|
161
|
+
threads.parentPort.postMessage(data, transferList);
|
|
162
|
+
}
|
|
163
|
+
// Emulates https://developer.mozilla.org/en-US/docs/Web/API/DedicatedWorkerGlobalScope/close
|
|
164
|
+
close() {
|
|
165
|
+
process.exit();
|
|
166
|
+
}
|
|
167
|
+
}
|
|
168
|
+
let proto = Object.getPrototypeOf(global);
|
|
169
|
+
delete proto.constructor;
|
|
170
|
+
Object.defineProperties(WorkerGlobalScope.prototype, proto);
|
|
171
|
+
proto = Object.setPrototypeOf(global, new WorkerGlobalScope());
|
|
172
|
+
['postMessage', 'addEventListener', 'removeEventListener', 'dispatchEvent'].forEach(fn => {
|
|
173
|
+
proto[fn] = proto[fn].bind(global);
|
|
174
|
+
});
|
|
175
|
+
global.name = name;
|
|
176
|
+
|
|
177
|
+
const isDataUrl = /^data:/.test(mod);
|
|
178
|
+
if (type === 'module') {
|
|
179
|
+
import(mod)
|
|
180
|
+
.catch(err => {
|
|
181
|
+
if (isDataUrl && err.message === 'Not supported') {
|
|
182
|
+
console.warn('Worker(): Importing data: URLs requires Node 12.10+. Falling back to classic worker.');
|
|
183
|
+
return evaluateDataUrl(mod, name);
|
|
184
|
+
}
|
|
185
|
+
console.error(err);
|
|
186
|
+
})
|
|
187
|
+
.then(flush);
|
|
188
|
+
}
|
|
189
|
+
else {
|
|
190
|
+
try {
|
|
191
|
+
if (/^data:/.test(mod)) {
|
|
192
|
+
evaluateDataUrl(mod, name);
|
|
193
|
+
}
|
|
194
|
+
else {
|
|
195
|
+
require(mod);
|
|
196
|
+
}
|
|
197
|
+
}
|
|
198
|
+
catch (err) {
|
|
199
|
+
console.error(err);
|
|
200
|
+
}
|
|
201
|
+
Promise.resolve().then(flush);
|
|
202
|
+
}
|
|
203
|
+
}
|
|
204
|
+
|
|
205
|
+
function evaluateDataUrl(url, name) {
|
|
206
|
+
const { data } = parseDataUrl(url);
|
|
207
|
+
return VM.runInThisContext(data, {
|
|
208
|
+
filename: 'worker.<'+(name || 'data:')+'>'
|
|
209
|
+
});
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
function parseDataUrl(url) {
|
|
213
|
+
let [m, type, encoding, data] = url.match(/^data: *([^;,]*)(?: *; *([^,]*))? *,(.*)$/) || [];
|
|
214
|
+
if (!m) throw Error('Invalid Data URL.');
|
|
215
|
+
if (encoding) switch (encoding.toLowerCase()) {
|
|
216
|
+
case 'base64':
|
|
217
|
+
data = Buffer.from(data, 'base64').toString();
|
|
218
|
+
break;
|
|
219
|
+
default:
|
|
220
|
+
throw Error('Unknown Data URL encoding "' + encoding + '"');
|
|
221
|
+
}
|
|
222
|
+
return { type, data };
|
|
223
|
+
}
|
|
@@ -0,0 +1,54 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@eshaz/web-worker",
|
|
3
|
+
"version": "1.2.2",
|
|
4
|
+
"description": "Consistent Web Workers in browser and Node.",
|
|
5
|
+
"main": "./cjs/node.js",
|
|
6
|
+
"browser": "./cjs/browser.js",
|
|
7
|
+
"types": "index.d.ts",
|
|
8
|
+
"files": [
|
|
9
|
+
"cjs",
|
|
10
|
+
"browser.js",
|
|
11
|
+
"node.js",
|
|
12
|
+
"index.d.ts"
|
|
13
|
+
],
|
|
14
|
+
"scripts": {
|
|
15
|
+
"prepare": "babel node.js browser.js -d cjs",
|
|
16
|
+
"test": "eslint '*.js' test && node --experimental-modules ./node_modules/.bin/ava"
|
|
17
|
+
},
|
|
18
|
+
"babel": {
|
|
19
|
+
"plugins": [
|
|
20
|
+
"@babel/plugin-syntax-dynamic-import",
|
|
21
|
+
"babel-plugin-commonjs-lite"
|
|
22
|
+
]
|
|
23
|
+
},
|
|
24
|
+
"repository": "https://github.com/eshaz/web-worker",
|
|
25
|
+
"keywords": [
|
|
26
|
+
"worker",
|
|
27
|
+
"worker_threads",
|
|
28
|
+
"webworker",
|
|
29
|
+
"web worker",
|
|
30
|
+
"web-worker",
|
|
31
|
+
"threads"
|
|
32
|
+
],
|
|
33
|
+
"authors": [],
|
|
34
|
+
"license": "Apache-2.0",
|
|
35
|
+
"homepage": "https://github.com/eshaz/web-worker",
|
|
36
|
+
"eslintConfig": {
|
|
37
|
+
"extends": "developit",
|
|
38
|
+
"rules": {
|
|
39
|
+
"no-console": 0
|
|
40
|
+
}
|
|
41
|
+
},
|
|
42
|
+
"devDependencies": {
|
|
43
|
+
"@babel/cli": "^7.7.7",
|
|
44
|
+
"@babel/core": "^7.7.7",
|
|
45
|
+
"@babel/plugin-syntax-dynamic-import": "^7.7.4",
|
|
46
|
+
"@babel/plugin-transform-modules-commonjs": "^7.7.5",
|
|
47
|
+
"@babel/preset-env": "^7.7.7",
|
|
48
|
+
"ava": "^2.4.0",
|
|
49
|
+
"babel-plugin-commonjs-lite": "gist:3e38560d5bed35da1fd708d635e4acb3",
|
|
50
|
+
"eslint": "^6.8.0",
|
|
51
|
+
"eslint-config-developit": "^1.1.1",
|
|
52
|
+
"eslint-plugin-compat": "^4.1.4"
|
|
53
|
+
}
|
|
54
|
+
}
|
|
@@ -0,0 +1,138 @@
|
|
|
1
|
+
# QQBot Connector
|
|
2
|
+
|
|
3
|
+
[](https://www.npmjs.com/package/@tencent-connect/qqbot-connector)
|
|
4
|
+
|
|
5
|
+
QQ 机器人扫码连接 SDK,在控制台展示二维码,用户使用手机 QQ 扫码后自动获取机器人的 AppID 与 AppSecret。
|
|
6
|
+
|
|
7
|
+
默认情况下扫码页面会将接入方统一显示为"第三方机器人"。如需在扫码页面展示你的平台名称,或有其他商务合作需求,请通过邮件与我们联系:qq_bot_api@tencent.com。
|
|
8
|
+
|
|
9
|
+
## 系统要求
|
|
10
|
+
|
|
11
|
+
- Node.js >= 18.0.0
|
|
12
|
+
|
|
13
|
+
## 安装
|
|
14
|
+
|
|
15
|
+
```bash
|
|
16
|
+
npm install @tencent-connect/qqbot-connector
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## 快速开始
|
|
20
|
+
|
|
21
|
+
### Promise 风格
|
|
22
|
+
|
|
23
|
+
始终在控制台打印二维码,扫码后返回凭据:
|
|
24
|
+
|
|
25
|
+
```ts
|
|
26
|
+
import { qrConnect } from '@tencent-connect/qqbot-connector';
|
|
27
|
+
|
|
28
|
+
try {
|
|
29
|
+
const [{ appId, appSecret }] = await qrConnect();
|
|
30
|
+
console.log('绑定成功!');
|
|
31
|
+
console.log('AppID:', appId);
|
|
32
|
+
console.log('AppSecret:', appSecret);
|
|
33
|
+
} catch (err) {
|
|
34
|
+
console.error('绑定失败:', err.message);
|
|
35
|
+
}
|
|
36
|
+
```
|
|
37
|
+
|
|
38
|
+
### 回调风格
|
|
39
|
+
|
|
40
|
+
通过 `displayQrCodeToConsole` 控制是否在控制台打印二维码,`onQrDisplayed` 始终会在轮询开始前回调二维码 URL:
|
|
41
|
+
|
|
42
|
+
```ts
|
|
43
|
+
import { startQrConnect } from '@tencent-connect/qqbot-connector';
|
|
44
|
+
|
|
45
|
+
// 不打印二维码到控制台,通过 onQrDisplayed 自行处理 URL
|
|
46
|
+
const stop = startQrConnect({
|
|
47
|
+
onSuccess([{ appId, appSecret }]) {
|
|
48
|
+
console.log('绑定成功!');
|
|
49
|
+
console.log('AppID:', appId);
|
|
50
|
+
console.log('AppSecret:', appSecret);
|
|
51
|
+
},
|
|
52
|
+
onFailure(err) {
|
|
53
|
+
console.error('绑定失败:', err.message);
|
|
54
|
+
},
|
|
55
|
+
onQrDisplayed(url) {
|
|
56
|
+
// 始终回调,可自行生成二维码图片、发送给用户等
|
|
57
|
+
console.log('二维码链接:', url);
|
|
58
|
+
},
|
|
59
|
+
onQrExpired() {
|
|
60
|
+
console.log('二维码已过期,正在刷新…');
|
|
61
|
+
},
|
|
62
|
+
}, {
|
|
63
|
+
displayQrCodeToConsole: false,
|
|
64
|
+
});
|
|
65
|
+
|
|
66
|
+
// 需要取消时调用 stop()
|
|
67
|
+
// stop();
|
|
68
|
+
```
|
|
69
|
+
|
|
70
|
+
## API
|
|
71
|
+
|
|
72
|
+
### `qrConnect(options?): Promise<QrConnectCredentials[]>`
|
|
73
|
+
|
|
74
|
+
在控制台展示二维码并等待扫码,返回 Promise。
|
|
75
|
+
|
|
76
|
+
此模式下始终在控制台打印二维码(`displayQrCodeToConsole` 固定为 `true`,不可关闭)。如需自行处理二维码 URL 而不打印,请使用回调风格的 `startQrConnect`。
|
|
77
|
+
|
|
78
|
+
**参数:**
|
|
79
|
+
|
|
80
|
+
| 名称 | 类型 | 默认值 | 说明 |
|
|
81
|
+
|------|------|--------|------|
|
|
82
|
+
| `options.source` | `string` | `''` | 接入平台标识,留空则显示为"第三方机器人" |
|
|
83
|
+
| `options.signal` | `AbortSignal` | — | 外部取消信号 |
|
|
84
|
+
|
|
85
|
+
**返回值:**
|
|
86
|
+
|
|
87
|
+
```ts
|
|
88
|
+
interface QrConnectCredentials {
|
|
89
|
+
appId: string;
|
|
90
|
+
appSecret: string;
|
|
91
|
+
}
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
> **注意:** 绑定成功后返回的凭据类型是 `QrConnectCredentials[]` 数组。目前扫码仅支持绑定单个 QQ 机器人(数组长度为 1),未来可能会拓展支持同时绑定多个 QQ 机器人,建议业务侧提前做好对数组的遍历处理,以便后续平滑升级。
|
|
95
|
+
|
|
96
|
+
### `startQrConnect(callbacks, options?): () => void`
|
|
97
|
+
|
|
98
|
+
轮询等待扫码结果(回调风格)。返回一个 `stop` 函数,调用后可中止流程。
|
|
99
|
+
|
|
100
|
+
二维码过期后会自动刷新并重新轮询,直到用户扫码成功或主动取消。无论 `displayQrCodeToConsole` 为何值,`onQrDisplayed` 都会在轮询开始前回调二维码 URL,供业务自行展示。
|
|
101
|
+
|
|
102
|
+
**callbacks:**
|
|
103
|
+
|
|
104
|
+
| 名称 | 类型 | 说明 |
|
|
105
|
+
|------|------|------|
|
|
106
|
+
| `onSuccess` | `(credentials: QrConnectCredentials[]) => void` | 扫码成功回调 |
|
|
107
|
+
| `onFailure` | `(error: Error) => void` | 失败或取消回调 |
|
|
108
|
+
| `onQrDisplayed?` | `(url: string) => void` | 二维码 URL 就绪,轮询开始前始终触发 |
|
|
109
|
+
| `onQrExpired?` | `() => void` | 二维码已过期,即将刷新(可选) |
|
|
110
|
+
|
|
111
|
+
**options:**
|
|
112
|
+
|
|
113
|
+
| 名称 | 类型 | 默认值 | 说明 |
|
|
114
|
+
|------|------|--------|------|
|
|
115
|
+
| `options.displayQrCodeToConsole` | `boolean` | `true` | 是否在控制台打印二维码 |
|
|
116
|
+
| `options.source` | `string` | `''` | 接入平台标识,留空则显示为"第三方机器人" |
|
|
117
|
+
| `options.signal` | `AbortSignal` | — | 外部取消信号 |
|
|
118
|
+
|
|
119
|
+
### 取消支持
|
|
120
|
+
|
|
121
|
+
两种取消方式:
|
|
122
|
+
|
|
123
|
+
```ts
|
|
124
|
+
// 方式一:使用返回的 stop 函数
|
|
125
|
+
const stop = startQrConnect({ ... });
|
|
126
|
+
stop();
|
|
127
|
+
|
|
128
|
+
// 方式二:使用 AbortController
|
|
129
|
+
const ac = new AbortController();
|
|
130
|
+
qrConnect({ signal: ac.signal }).catch(console.error);
|
|
131
|
+
ac.abort();
|
|
132
|
+
```
|
|
133
|
+
|
|
134
|
+
## 协助与反馈
|
|
135
|
+
|
|
136
|
+
如在使用过程中遇到问题,欢迎前往以下地址查阅已有议题或提交新问题:
|
|
137
|
+
|
|
138
|
+
https://github.com/tencent-connect/openclaw-qqbot/issues
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";Object.defineProperty(exports,"__esModule",{value:!0}),exports.qrConnect=exports.startQrConnect=void 0;var e=require("./qr-connect.js");Object.defineProperty(exports,"startQrConnect",{enumerable:!0,get:function(){return e.startQrConnect}}),Object.defineProperty(exports,"qrConnect",{enumerable:!0,get:function(){return e.qrConnect}});
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 调用 q.qq.com 的 create_bind_task / poll_bind_result 接口,
|
|
3
|
+
* 用于生成添加机器人的二维码链接并轮询扫码结果。
|
|
4
|
+
*
|
|
5
|
+
* --env test 时 API 域名切换为 test.q.qq.com,二维码 URL 始终使用 q.qq.com。
|
|
6
|
+
*/
|
|
7
|
+
export type QQBotEnv = 'production' | 'test';
|
|
8
|
+
export declare function getQQBotHost(env?: QQBotEnv): string;
|
|
9
|
+
export declare function generateBindKey(): string;
|
|
10
|
+
export interface BindTaskResult {
|
|
11
|
+
taskId: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
14
|
+
export declare enum BindStatus {
|
|
15
|
+
NONE = 0,
|
|
16
|
+
PENDING = 1,
|
|
17
|
+
COMPLETED = 2,
|
|
18
|
+
EXPIRED = 3
|
|
19
|
+
}
|
|
20
|
+
export interface PollBindResultOk {
|
|
21
|
+
status: BindStatus;
|
|
22
|
+
botAppId: string;
|
|
23
|
+
botEncryptSecret: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 使用 AES-256-GCM 解密 base64 编码的密文。
|
|
27
|
+
* key 为 createBindTask 时生成的 base64 密钥(32 字节)。
|
|
28
|
+
*
|
|
29
|
+
* 密文格式: IV(12 bytes) + ciphertext(N bytes) + AuthTag(16 bytes)
|
|
30
|
+
*/
|
|
31
|
+
export declare function decryptSecret(encryptedBase64: string, keyBase64: string): string;
|
|
32
|
+
export declare function createBindTask(env?: QQBotEnv, timeoutMs?: number): Promise<BindTaskResult>;
|
|
33
|
+
export declare function pollBindResult(taskId: string, env?: QQBotEnv, timeoutMs?: number): Promise<PollBindResultOk>;
|
|
34
|
+
export declare function buildConnectUrl(taskId: string, source?: string): string;
|
|
35
|
+
//# sourceMappingURL=qqbot-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
"use strict";var l=exports&&exports.__importDefault||function(t){return t&&t.__esModule?t:{default:t}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.BindStatus=void 0,exports.getQQBotHost=u,exports.generateBindKey=h,exports.decryptSecret=g,exports.createBindTask=E,exports.pollBindResult=w,exports.buildConnectUrl=k;const _=l(require("node:crypto")),m=l(require("node:https")),b={production:"q.qq.com",test:"test.q.qq.com"};function u(t="production"){return b[t]}function h(){return _.default.randomBytes(32).toString("base64")}var p;(function(t){t[t.NONE=0]="NONE",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED",t[t.EXPIRED=3]="EXPIRED"})(p||(exports.BindStatus=p={}));function g(t,r){const a=Buffer.from(r,"base64"),o=Buffer.from(t,"base64"),n=o.subarray(0,12),e=o.subarray(o.length-16),c=o.subarray(12,o.length-16),s=_.default.createDecipheriv("aes-256-gcm",a,n);return s.setAuthTag(e),Buffer.concat([s.update(c),s.final()]).toString("utf8")}function y(t,r,a){return new Promise((o,n)=>{const e=JSON.stringify(r),c=new URL(t),s=m.default.request({hostname:c.hostname,path:c.pathname+c.search,method:"POST",timeout:a,headers:{"Content-Type":"application/json",Accept:"application/json","Content-Length":Buffer.byteLength(e)}},i=>{if(i.statusCode!==200){i.resume(),n(new Error(`HTTP ${i.statusCode} from ${t}`));return}let f="";i.on("data",d=>{f+=d}),i.on("end",()=>{try{o(JSON.parse(f))}catch(d){n(d)}})});s.on("error",n),s.on("timeout",()=>{s.destroy(),n(new Error(`timeout fetching ${t}`))}),s.end(e)})}async function E(t="production",r=1e4){const o=`https://${u(t)}/lite/create_bind_task`,n=h(),e=await y(o,{key:n},r);if(e.retcode!==0)throw new Error(e.msg??"create_bind_task failed");if(!e.data?.task_id)throw new Error("create_bind_task: missing task_id");return{taskId:e.data.task_id,key:n}}async function w(t,r="production",a=1e4){const n=`https://${u(r)}/lite/poll_bind_result`,e=await y(n,{task_id:t},a);if(e.retcode!==0)throw new Error(e.msg??"poll_bind_result failed");return{status:e.data?.status??p.NONE,botAppId:String(e.data?.bot_appid??""),botEncryptSecret:e.data?.bot_encrypt_secret??""}}function k(t,r=""){return`https://${u("production")}/qqbot/openclaw/connect.html?task_id=${encodeURIComponent(t)}&source=${encodeURIComponent(r)}&_wv=2`}
|
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* QR Code Connect — 核心对外接口
|
|
3
|
+
*
|
|
4
|
+
* 支持两种使用模式:
|
|
5
|
+
* 1. Promise 风格:始终在控制台打印二维码,等待扫码后 resolve
|
|
6
|
+
* 2. 回调风格:可通过 displayQrCodeToConsole 控制是否在控制台打印二维码,
|
|
7
|
+
* 无论是否打印,onQrDisplayed 都会在轮询开始前回调二维码 URL
|
|
8
|
+
*/
|
|
9
|
+
export interface QrConnectCredentials {
|
|
10
|
+
appId: string;
|
|
11
|
+
appSecret: string;
|
|
12
|
+
}
|
|
13
|
+
export interface QrConnectCallbacks {
|
|
14
|
+
/** 扫码成功,返回凭据 */
|
|
15
|
+
onSuccess: (credentials: QrConnectCredentials[]) => void;
|
|
16
|
+
/** 流程失败或被取消 */
|
|
17
|
+
onFailure: (error: Error) => void;
|
|
18
|
+
/** 二维码 URL 就绪,在轮询开始前始终触发 */
|
|
19
|
+
onQrDisplayed?: (url: string) => void;
|
|
20
|
+
/** 二维码已过期,即将刷新(可选回调) */
|
|
21
|
+
onQrExpired?: () => void;
|
|
22
|
+
}
|
|
23
|
+
export interface QrConnectOptions {
|
|
24
|
+
/**
|
|
25
|
+
* 是否在控制台打印二维码,默认 true。
|
|
26
|
+
* 在 Promise 风格(qrConnect)下此参数始终为 true,不可关闭。
|
|
27
|
+
*/
|
|
28
|
+
displayQrCodeToConsole?: boolean;
|
|
29
|
+
/**
|
|
30
|
+
* AbortSignal,支持外部取消。
|
|
31
|
+
* 传入后可通过 AbortController.abort() 中止扫码轮询流程。
|
|
32
|
+
*/
|
|
33
|
+
signal?: AbortSignal;
|
|
34
|
+
/** 调用来源标识,会拼接到二维码 URL 中 */
|
|
35
|
+
source?: string;
|
|
36
|
+
}
|
|
37
|
+
/**
|
|
38
|
+
* 轮询等待扫码结果(回调风格)。
|
|
39
|
+
*
|
|
40
|
+
* 可通过 `options.displayQrCodeToConsole` 控制是否在控制台打印二维码(默认 true)。
|
|
41
|
+
* 无论是否打印,`onQrDisplayed` 都会在轮询开始前回调二维码 URL。
|
|
42
|
+
*
|
|
43
|
+
* @returns 一个 dispose 函数,调用后可中止轮询流程
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const stop = startQrConnect({
|
|
48
|
+
* onSuccess([{ appId, appSecret }]) {
|
|
49
|
+
* console.log('成功', appId, appSecret);
|
|
50
|
+
* },
|
|
51
|
+
* onFailure(err) {
|
|
52
|
+
* console.error('失败', err.message);
|
|
53
|
+
* },
|
|
54
|
+
* onQrDisplayed(url) {
|
|
55
|
+
* // 自行处理二维码 URL,例如生成图片发送给用户
|
|
56
|
+
* },
|
|
57
|
+
* });
|
|
58
|
+
*
|
|
59
|
+
* // 需要取消时:
|
|
60
|
+
* stop();
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
export declare function startQrConnect(callbacks: QrConnectCallbacks, options?: QrConnectOptions): () => void;
|
|
64
|
+
/**
|
|
65
|
+
* 在控制台展示二维码并轮询等待扫码结果(Promise 风格)。
|
|
66
|
+
*
|
|
67
|
+
* 始终在控制台打印二维码(displayQrCodeToConsole 固定为 true)。
|
|
68
|
+
* 如果需要自行处理二维码 URL(不打印),请使用 {@link startQrConnect} 回调风格。
|
|
69
|
+
*
|
|
70
|
+
* @returns Promise 解析为 `QrConnectCredentials[]` 或 reject Error
|
|
71
|
+
*
|
|
72
|
+
* @example
|
|
73
|
+
* ```ts
|
|
74
|
+
* try {
|
|
75
|
+
* const [{ appId, appSecret }] = await qrConnect();
|
|
76
|
+
* console.log('成功', appId, appSecret);
|
|
77
|
+
* } catch (err) {
|
|
78
|
+
* console.error('失败', err.message);
|
|
79
|
+
* }
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
82
|
+
export declare function qrConnect(options?: Omit<QrConnectOptions, 'displayQrCodeToConsole'>): Promise<QrConnectCredentials[]>;
|
|
83
|
+
//# sourceMappingURL=qr-connect.d.ts.map
|
|
@@ -0,0 +1,3 @@
|
|
|
1
|
+
"use strict";var f=exports&&exports.__importDefault||function(e){return e&&e.__esModule?e:{default:e}};Object.defineProperty(exports,"__esModule",{value:!0}),exports.startQrConnect=E,exports.qrConnect=S;const w=f(require("qrcode-terminal")),a=require("./qqbot-session.js"),d=2e3;function b(e){return new Promise(t=>{w.default.generate(e,{small:!0},r=>{t(r)})})}function p(e,t){return new Promise((r,n)=>{if(t?.aborted){n(new DOMException("Aborted","AbortError"));return}const c=setTimeout(r,e);t?.addEventListener("abort",()=>{clearTimeout(c),n(new DOMException("Aborted","AbortError"))},{once:!0})})}async function _(e,t,r){for(;!r?.aborted;){let n;try{n=await(0,a.pollBindResult)(e)}catch{await p(d,r);continue}if(n.status===a.BindStatus.COMPLETED){const c=(0,a.decryptSecret)(n.botEncryptSecret,t);return{outcome:"scanned",appId:n.botAppId,appSecret:c}}if(n.status===a.BindStatus.EXPIRED)return{outcome:"expired"};await p(d,r)}throw new DOMException("Aborted","AbortError")}function E(e,t){const r=new AbortController,n=t?.signal?AbortSignal.any([r.signal,t.signal]):r.signal;return(async()=>{const o=t?.displayQrCodeToConsole??!0;for(;;){if(n.aborted)throw new DOMException("Aborted","AbortError");let s;try{s=await(0,a.createBindTask)()}catch(i){throw new Error(`\u83B7\u53D6\u7ED1\u5B9A\u4EFB\u52A1\u5931\u8D25: ${i instanceof Error?i.message:String(i)}`,{cause:i})}const l=(0,a.buildConnectUrl)(s.taskId,t?.source);if(o){const i=await b(l);console.log(i),console.log(`\u8BF7\u4F7F\u7528\u624B\u673A QQ \u626B\u63CF\u4E0A\u65B9\u4E8C\u7EF4\u7801\uFF0C\u5B8C\u6210\u673A\u5668\u4EBA\u7ED1\u5B9A\u3002
|
|
2
|
+
`)}e.onQrDisplayed?.(l);const u=await _(s.taskId,s.key,n);if(u.outcome==="scanned"){e.onSuccess([{appId:u.appId,appSecret:u.appSecret}]);return}e.onQrExpired?.(),o&&console.log(`\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u6B63\u5728\u5237\u65B0\u2026
|
|
3
|
+
`)}})().catch(o=>{if(o instanceof DOMException&&o.name==="AbortError"){e.onFailure(new Error("\u5DF2\u53D6\u6D88"));return}e.onFailure(o instanceof Error?o:new Error(String(o)))}),()=>r.abort()}function S(e){return new Promise((t,r)=>{E({onSuccess:t,onFailure:r},{...e,displayQrCodeToConsole:!0})})}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import{startQrConnect as t,qrConnect as n}from"./qr-connect.js";export{n as qrConnect,t as startQrConnect};
|
|
@@ -0,0 +1,35 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 调用 q.qq.com 的 create_bind_task / poll_bind_result 接口,
|
|
3
|
+
* 用于生成添加机器人的二维码链接并轮询扫码结果。
|
|
4
|
+
*
|
|
5
|
+
* --env test 时 API 域名切换为 test.q.qq.com,二维码 URL 始终使用 q.qq.com。
|
|
6
|
+
*/
|
|
7
|
+
export type QQBotEnv = 'production' | 'test';
|
|
8
|
+
export declare function getQQBotHost(env?: QQBotEnv): string;
|
|
9
|
+
export declare function generateBindKey(): string;
|
|
10
|
+
export interface BindTaskResult {
|
|
11
|
+
taskId: string;
|
|
12
|
+
key: string;
|
|
13
|
+
}
|
|
14
|
+
export declare enum BindStatus {
|
|
15
|
+
NONE = 0,
|
|
16
|
+
PENDING = 1,
|
|
17
|
+
COMPLETED = 2,
|
|
18
|
+
EXPIRED = 3
|
|
19
|
+
}
|
|
20
|
+
export interface PollBindResultOk {
|
|
21
|
+
status: BindStatus;
|
|
22
|
+
botAppId: string;
|
|
23
|
+
botEncryptSecret: string;
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* 使用 AES-256-GCM 解密 base64 编码的密文。
|
|
27
|
+
* key 为 createBindTask 时生成的 base64 密钥(32 字节)。
|
|
28
|
+
*
|
|
29
|
+
* 密文格式: IV(12 bytes) + ciphertext(N bytes) + AuthTag(16 bytes)
|
|
30
|
+
*/
|
|
31
|
+
export declare function decryptSecret(encryptedBase64: string, keyBase64: string): string;
|
|
32
|
+
export declare function createBindTask(env?: QQBotEnv, timeoutMs?: number): Promise<BindTaskResult>;
|
|
33
|
+
export declare function pollBindResult(taskId: string, env?: QQBotEnv, timeoutMs?: number): Promise<PollBindResultOk>;
|
|
34
|
+
export declare function buildConnectUrl(taskId: string, source?: string): string;
|
|
35
|
+
//# sourceMappingURL=qqbot-session.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
import m from"node:crypto";import _ from"node:https";const E={production:"q.qq.com",test:"test.q.qq.com"};function u(t="production"){return E[t]}function l(){return m.randomBytes(32).toString("base64")}var d;(function(t){t[t.NONE=0]="NONE",t[t.PENDING=1]="PENDING",t[t.COMPLETED=2]="COMPLETED",t[t.EXPIRED=3]="EXPIRED"})(d||(d={}));function b(t,r){const a=Buffer.from(r,"base64"),n=Buffer.from(t,"base64"),e=n.subarray(0,12),i=n.subarray(n.length-16),s=n.subarray(12,n.length-16),o=m.createDecipheriv("aes-256-gcm",a,e);return o.setAuthTag(i),Buffer.concat([o.update(s),o.final()]).toString("utf8")}function h(t,r,a){return new Promise((n,e)=>{const i=JSON.stringify(r),s=new URL(t),o=_.request({hostname:s.hostname,path:s.pathname+s.search,method:"POST",timeout:a,headers:{"Content-Type":"application/json",Accept:"application/json","Content-Length":Buffer.byteLength(i)}},c=>{if(c.statusCode!==200){c.resume(),e(new Error(`HTTP ${c.statusCode} from ${t}`));return}let f="";c.on("data",p=>{f+=p}),c.on("end",()=>{try{n(JSON.parse(f))}catch(p){e(p)}})});o.on("error",e),o.on("timeout",()=>{o.destroy(),e(new Error(`timeout fetching ${t}`))}),o.end(i)})}async function y(t="production",r=1e4){const a=`https://${u(t)}/lite/create_bind_task`,n=l(),e=await h(a,{key:n},r);if(e.retcode!==0)throw new Error(e.msg??"create_bind_task failed");if(!e.data?.task_id)throw new Error("create_bind_task: missing task_id");return{taskId:e.data.task_id,key:n}}async function g(t,r="production",a=1e4){const n=`https://${u(r)}/lite/poll_bind_result`,e=await h(n,{task_id:t},a);if(e.retcode!==0)throw new Error(e.msg??"poll_bind_result failed");return{status:e.data?.status??d.NONE,botAppId:String(e.data?.bot_appid??""),botEncryptSecret:e.data?.bot_encrypt_secret??""}}function w(t,r=""){return`https://${u("production")}/qqbot/openclaw/connect.html?task_id=${encodeURIComponent(t)}&source=${encodeURIComponent(r)}&_wv=2`}export{d as BindStatus,w as buildConnectUrl,y as createBindTask,b as decryptSecret,l as generateBindKey,u as getQQBotHost,g as pollBindResult};
|