@openclaw/qqbot 2026.5.20 → 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,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
|
+
import d from"qrcode-terminal";import{BindStatus as i,buildConnectUrl as w,createBindTask as b,decryptSecret as f,pollBindResult as A}from"./qqbot-session.js";const l=2e3;function F(o){return new Promise(r=>{d.generate(o,{small:!0},t=>{r(t)})})}function E(o,r){return new Promise((t,n)=>{if(r?.aborted){n(new DOMException("Aborted","AbortError"));return}const e=setTimeout(t,o);r?.addEventListener("abort",()=>{clearTimeout(e),n(new DOMException("Aborted","AbortError"))},{once:!0})})}async function m(o,r,t){for(;!t?.aborted;){let n;try{n=await A(o)}catch{await E(l,t);continue}if(n.status===i.COMPLETED){const e=f(n.botEncryptSecret,r);return{outcome:"scanned",appId:n.botAppId,appSecret:e}}if(n.status===i.EXPIRED)return{outcome:"expired"};await E(l,t)}throw new DOMException("Aborted","AbortError")}function p(o,r){const t=new AbortController,n=r?.signal?AbortSignal.any([t.signal,r.signal]):t.signal;return(async()=>{const e=r?.displayQrCodeToConsole??!0;for(;;){if(n.aborted)throw new DOMException("Aborted","AbortError");let a;try{a=await b()}catch(u){throw new Error(`\u83B7\u53D6\u7ED1\u5B9A\u4EFB\u52A1\u5931\u8D25: ${u instanceof Error?u.message:String(u)}`,{cause:u})}const s=w(a.taskId,r?.source);if(e){const u=await F(s);console.log(u),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
|
+
`)}o.onQrDisplayed?.(s);const c=await m(a.taskId,a.key,n);if(c.outcome==="scanned"){o.onSuccess([{appId:c.appId,appSecret:c.appSecret}]);return}o.onQrExpired?.(),e&&console.log(`\u4E8C\u7EF4\u7801\u5DF2\u8FC7\u671F\uFF0C\u6B63\u5728\u5237\u65B0\u2026
|
|
3
|
+
`)}})().catch(e=>{if(e instanceof DOMException&&e.name==="AbortError"){o.onFailure(new Error("\u5DF2\u53D6\u6D88"));return}o.onFailure(e instanceof Error?e:new Error(String(e)))}),()=>t.abort()}function C(o){return new Promise((r,t)=>{p({onSuccess:r,onFailure:t},{...o,displayQrCodeToConsole:!0})})}export{C as qrConnect,p as startQrConnect};
|
|
@@ -0,0 +1,62 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@tencent-connect/qqbot-connector",
|
|
3
|
+
"version": "1.1.0",
|
|
4
|
+
"description": "QQ Bot Connector SDK - 扫码连接 QQ 机器人,获取 AppID 与 AppSecret",
|
|
5
|
+
"publishConfig": {
|
|
6
|
+
"access": "public"
|
|
7
|
+
},
|
|
8
|
+
"license": "UNLICENSED",
|
|
9
|
+
"author": "",
|
|
10
|
+
"type": "module",
|
|
11
|
+
"main": "./dist/cjs/index.js",
|
|
12
|
+
"module": "./dist/esm/index.js",
|
|
13
|
+
"types": "./dist/esm/index.d.ts",
|
|
14
|
+
"exports": {
|
|
15
|
+
".": {
|
|
16
|
+
"types": "./dist/esm/index.d.ts",
|
|
17
|
+
"import": "./dist/esm/index.js",
|
|
18
|
+
"require": "./dist/cjs/index.js"
|
|
19
|
+
}
|
|
20
|
+
},
|
|
21
|
+
"files": [
|
|
22
|
+
"dist/**/*.js",
|
|
23
|
+
"dist/**/*.d.ts"
|
|
24
|
+
],
|
|
25
|
+
"scripts": {
|
|
26
|
+
"build": "tsc -b && tsc -p tsconfig.cjs.json && node scripts/fix-cjs.js && node scripts/obfuscate.js",
|
|
27
|
+
"typecheck": "tsc --noEmit",
|
|
28
|
+
"commitlint": "commitlint",
|
|
29
|
+
"prepack": "npm run build",
|
|
30
|
+
"posttest": "npm run lint",
|
|
31
|
+
"lint": "eslint .",
|
|
32
|
+
"ci:prepare-test-pkg": "node scripts/prepare-test-pkg.js",
|
|
33
|
+
"test": "vitest run",
|
|
34
|
+
"test:watch": "vitest",
|
|
35
|
+
"test:coverage": "vitest run --coverage",
|
|
36
|
+
"semantic-release": "semantic-release"
|
|
37
|
+
},
|
|
38
|
+
"dependencies": {
|
|
39
|
+
"qrcode-terminal": "^0.12"
|
|
40
|
+
},
|
|
41
|
+
"devDependencies": {
|
|
42
|
+
"@commitlint/cli": "^20.5.0",
|
|
43
|
+
"@commitlint/config-conventional": "^20.5.0",
|
|
44
|
+
"@eslint/js": "^10.0.1",
|
|
45
|
+
"@semantic-release/changelog": "^6.0.3",
|
|
46
|
+
"@semantic-release/exec": "^7.1.0",
|
|
47
|
+
"@semantic-release/git": "^10.0.1",
|
|
48
|
+
"@types/node": "^22",
|
|
49
|
+
"@types/qrcode-terminal": "^0.12.2",
|
|
50
|
+
"@vitest/coverage-v8": "^4.1.2",
|
|
51
|
+
"esbuild": "^0.28.0",
|
|
52
|
+
"eslint": "^10.1.0",
|
|
53
|
+
"globals": "^17.4.0",
|
|
54
|
+
"semantic-release": "^25.0.3",
|
|
55
|
+
"typescript": "^5",
|
|
56
|
+
"typescript-eslint": "^8.57.2",
|
|
57
|
+
"vitest": "^4.1.2"
|
|
58
|
+
},
|
|
59
|
+
"engines": {
|
|
60
|
+
"node": ">=18.0.0"
|
|
61
|
+
}
|
|
62
|
+
}
|
|
@@ -0,0 +1,36 @@
|
|
|
1
|
+
{
|
|
2
|
+
"name": "@wasm-audio-decoders/common",
|
|
3
|
+
"version": "9.0.7",
|
|
4
|
+
"description": "Web Assembly Audio Decoders Common",
|
|
5
|
+
"module": "index.js",
|
|
6
|
+
"main": "index.js",
|
|
7
|
+
"exports": {
|
|
8
|
+
"types": "./types.d.ts",
|
|
9
|
+
"default": "./index.js"
|
|
10
|
+
},
|
|
11
|
+
"types": "types.d.ts",
|
|
12
|
+
"sideEffects": false,
|
|
13
|
+
"files": [
|
|
14
|
+
"index.js",
|
|
15
|
+
"types.d.ts",
|
|
16
|
+
"src/*"
|
|
17
|
+
],
|
|
18
|
+
"repository": {
|
|
19
|
+
"type": "git",
|
|
20
|
+
"url": "git+https://github.com/eshaz/wasm-audio-decoders.git"
|
|
21
|
+
},
|
|
22
|
+
"type": "module",
|
|
23
|
+
"author": {
|
|
24
|
+
"name": "Ethan Halsall",
|
|
25
|
+
"email": "ethanhalsall@pm.me"
|
|
26
|
+
},
|
|
27
|
+
"license": "MIT",
|
|
28
|
+
"bugs": {
|
|
29
|
+
"url": "https://github.com/eshaz/wasm-audio-decoders/issues"
|
|
30
|
+
},
|
|
31
|
+
"homepage": "https://github.com/eshaz/wasm-audio-decoders/tree/master/src/common",
|
|
32
|
+
"dependencies": {
|
|
33
|
+
"@eshaz/web-worker": "1.2.2",
|
|
34
|
+
"simple-yenc": "^1.0.4"
|
|
35
|
+
}
|
|
36
|
+
}
|
|
@@ -0,0 +1,231 @@
|
|
|
1
|
+
import { decode } from "simple-yenc";
|
|
2
|
+
|
|
3
|
+
export default function WASMAudioDecoderCommon() {
|
|
4
|
+
// setup static methods
|
|
5
|
+
const uint8Array = Uint8Array;
|
|
6
|
+
const float32Array = Float32Array;
|
|
7
|
+
|
|
8
|
+
if (!WASMAudioDecoderCommon.modules) {
|
|
9
|
+
Object.defineProperties(WASMAudioDecoderCommon, {
|
|
10
|
+
modules: {
|
|
11
|
+
value: new WeakMap(),
|
|
12
|
+
},
|
|
13
|
+
|
|
14
|
+
setModule: {
|
|
15
|
+
value(Ref, module) {
|
|
16
|
+
WASMAudioDecoderCommon.modules.set(Ref, Promise.resolve(module));
|
|
17
|
+
},
|
|
18
|
+
},
|
|
19
|
+
|
|
20
|
+
getModule: {
|
|
21
|
+
value(Ref, wasmString) {
|
|
22
|
+
let module = WASMAudioDecoderCommon.modules.get(Ref);
|
|
23
|
+
|
|
24
|
+
if (!module) {
|
|
25
|
+
if (!wasmString) {
|
|
26
|
+
wasmString = Ref.wasm;
|
|
27
|
+
module = WASMAudioDecoderCommon.inflateDynEncodeString(
|
|
28
|
+
wasmString,
|
|
29
|
+
).then((data) => WebAssembly.compile(data));
|
|
30
|
+
} else {
|
|
31
|
+
module = WebAssembly.compile(decode(wasmString));
|
|
32
|
+
}
|
|
33
|
+
|
|
34
|
+
WASMAudioDecoderCommon.modules.set(Ref, module);
|
|
35
|
+
}
|
|
36
|
+
|
|
37
|
+
return module;
|
|
38
|
+
},
|
|
39
|
+
},
|
|
40
|
+
|
|
41
|
+
concatFloat32: {
|
|
42
|
+
value(buffers, length) {
|
|
43
|
+
let ret = new float32Array(length),
|
|
44
|
+
i = 0,
|
|
45
|
+
offset = 0;
|
|
46
|
+
|
|
47
|
+
while (i < buffers.length) {
|
|
48
|
+
ret.set(buffers[i], offset);
|
|
49
|
+
offset += buffers[i++].length;
|
|
50
|
+
}
|
|
51
|
+
|
|
52
|
+
return ret;
|
|
53
|
+
},
|
|
54
|
+
},
|
|
55
|
+
|
|
56
|
+
getDecodedAudio: {
|
|
57
|
+
value: (errors, channelData, samplesDecoded, sampleRate, bitDepth) => ({
|
|
58
|
+
errors,
|
|
59
|
+
channelData,
|
|
60
|
+
samplesDecoded,
|
|
61
|
+
sampleRate,
|
|
62
|
+
bitDepth,
|
|
63
|
+
}),
|
|
64
|
+
},
|
|
65
|
+
|
|
66
|
+
getDecodedAudioMultiChannel: {
|
|
67
|
+
value(
|
|
68
|
+
errors,
|
|
69
|
+
input,
|
|
70
|
+
channelsDecoded,
|
|
71
|
+
samplesDecoded,
|
|
72
|
+
sampleRate,
|
|
73
|
+
bitDepth,
|
|
74
|
+
) {
|
|
75
|
+
let channelData = [],
|
|
76
|
+
i,
|
|
77
|
+
j;
|
|
78
|
+
|
|
79
|
+
for (i = 0; i < channelsDecoded; i++) {
|
|
80
|
+
const channel = [];
|
|
81
|
+
for (j = 0; j < input.length; ) channel.push(input[j++][i] || []);
|
|
82
|
+
channelData.push(
|
|
83
|
+
WASMAudioDecoderCommon.concatFloat32(channel, samplesDecoded),
|
|
84
|
+
);
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
return WASMAudioDecoderCommon.getDecodedAudio(
|
|
88
|
+
errors,
|
|
89
|
+
channelData,
|
|
90
|
+
samplesDecoded,
|
|
91
|
+
sampleRate,
|
|
92
|
+
bitDepth,
|
|
93
|
+
);
|
|
94
|
+
},
|
|
95
|
+
},
|
|
96
|
+
|
|
97
|
+
/*
|
|
98
|
+
******************
|
|
99
|
+
* Compression Code
|
|
100
|
+
******************
|
|
101
|
+
*/
|
|
102
|
+
|
|
103
|
+
inflateDynEncodeString: {
|
|
104
|
+
value(source) {
|
|
105
|
+
source = decode(source);
|
|
106
|
+
|
|
107
|
+
return new Promise((resolve) => {
|
|
108
|
+
// prettier-ignore
|
|
109
|
+
const puffString = String.raw`dynEncode012804c7886d()((()>+*§§)§,§§§§)§+§§§)§+.-()(*)-+)(.7*§)i¸¸,3§(i¸¸,3/G+.¡*(,(,3+)2å:-),§H(P*DI*H(P*@I++hH)H*r,hH(H(P*<J,i)^*<H,H(P*4U((I-H(H*i0J,^*DH+H-H*I+H,I*4)33H(H*H)^*DH(H+H)^*@H+i§H)i§3æ*).§K(iHI/+§H,iHn,§H+i(H+i(rCJ0I,H*I-+hH,,hH(H-V)(i)J.H.W)(i)c)(H,i)I,H-i*I-4)33i(I.*hH(V)(H+n5(H(i*I-i(I,i)I.+hH,i*J+iHn,hi(I-i*I,+hH,H/H-c)(H,iFn,hi(I,+hH,H0n5-H*V)(J(,hH/H(i)J(H(V)(J(i)c)(H)H(i)H,c)(3H*i*I*H,i)I,4(3(-H(H,W)(H-I-H,i*I,4)3(3(3H,H-I1H+I,H.i)H1V)(J.i(v5(33H.-H(H,i(c)(H,i*I,4)333)-§i*I*+§H*iHn,hi73H,H(i)8(H+J+H)P*(H*V)(J-r,§H)P*,H.i)H+H,i)V)(-H*i*I*H+i)I+H-H.I.H,H-i)I,4)333Ã+)-§iø7i(^*(iü7I,*h+hH+iDn,h*hilI+i)I,+hH+,hH+iô7H,c)(i)H+i´8W)(H,I,H+i*I+4)-+hH(H)8*J-i(p5.*h*h*hH-i')u,hH(P*(J+,hH(P*0J,H(P*,n50H+H,H-b((3H(P*0i)I.4)3H-i¨*n5*H-iÅ*s,hi73H-i)J+V)&+I,H(H+V)æ,8(I.H(H*8*J-i(p51H-i)J+i¸7V)(H(H+iø7V)(8(J/H(P*0J+s,hi73H+H,H.J,I.H(P*(m5(H.H(P*,s5.+hH,m5*H(P*(J.H+H.H+H/U((b((H(H(P*0i)J+^*0H,i)I,4(3(3H(H.^*03H-i¨*o5)33i(73(3(3-H,H+i)c)(H,i*I,H+i)I+4)33i)I-3H-3!2)0§K(i2J,L(H,H(^*(H,H*^*4H,i(^*0H,i(^*DH,j(_*<H,H)P*(^*,H,H+P*(^*8*h*h+hH,i)8(I3i§I**h*h*h*h*h*h*hH,i*8(6+(),03H,j(_*@i*I-H,P*<J.i,J(H,P*8J/s50H,H.i+J0^*<i¦I*H.H,P*4J1J.U(*H.U((J2i')o5/H.U()I.H,H(^*<H0H1U((H.i0J.i§i0i')o5/H/H.H2J*H(J.q50H,P*0J/H*I-H,P*(J0,hH,P*,H-q,hi)I-423+hH*m5+H/H0H(H1U((b((H/i)I/H(i)I(H*i)I*4(3(3H,H.^*<H,H-^*04*3iØ1U((5+i(I(i¨7i1^*(i$6iè1^*(i°7iè6^*(i¬7iÈ6^*(+hH(iÈ*n,hiÈ*I(+hH(i¨,n,hi¨,I(+hH(iØ,n,hiØ,I(+hH(iè,o,hH,i-H(i0c)(H(i*I(4)33iè1i1H,i-iÈ*8)Bi(I(+hH(ido,hH,i-H(i-c)(H(i*I(4)33iÈ6iè6H,i-iF8)BiØ1i)b((41-H,i-H(i/c)(H(i*I(4)3(3(-H,i-H(i1c)(H(i*I(4)3(3(-H,i-H(i0c)(H(i*I(4)3(3(3H,H/^*0H,H(^*<3i(I*4*3H,H,i¸)^*TH,H,iø-^*PH,H,iX^*LH,H,i(^*HH,i-8(I(H,i-8(I-i¥I*H,i,8(I.H(iErH-iEr5)H(i©*I1H-i)I0i(i;H.i,J(i(H(i(rCJ(J*H*i;sCI*i¨1I-H(I/+hH/,hH,i-H-V)(i)H,i+8(c)(H/i)I/H-i*I-H*i)I*4)-H(i)i¨1I/+hH(H*o,hH,i-H/V)(i)i(c)(H/i*I/H(i)I(4)33i¤I*H,iø-H,i¸)H,i-i;8)5+H0H1I2i(I-+hH-H2p,hH,H,iP8*J*i(p5-H*i7u,hH,i-H-i)H*c)(H-i)I-4*3i(I/i+I.i+I(*h*h*hH*i86*(*)3H-m,hi£I*403H-i)H,W)-I/i*I(4)3i3I.i/I(3H2H,H(8(H.J(H-J.p,hi¢I*4.3H,i-H-i)I*+hH(,hH*H/c)(H*i*I*H(i)I(4)-H.I-4+3(3(33H,W)1m,hiI*4,3H,iø-H,i¸)H,i-H18)J(,hi¡I*H(i(p5,H1H,V)ú-H,V)ø-o5,3H,i(H,iXH,i-H1i)H08)J(,hi I*H(i(p5,H0H,V)H,V)o5,3H,H,iPH,iH8+I*4+3(3(3H,i$6i¬78+I*3H*H3m5(3i)I-H*i(r5)3H)H,P*0^*(H+H,P*<^*(H*I-3H,i2L(H-33Á)+(i¨03b+(,(-(.(/(0(1(2(3(5(7(9(;(?(C(G(K(S([(c(k({(((«(Ë(ë((*)(iø03O)()()()(*(*(*(*(+(+(+(+(,(,(,(,(-(-(-(-(i¨13M8(9(:(((0(/(1(.(2(-(3(,(4(+(5(*(6()(7(T7*S7US0U `;
|
|
110
|
+
|
|
111
|
+
WASMAudioDecoderCommon.getModule(WASMAudioDecoderCommon, puffString)
|
|
112
|
+
.then((wasm) => WebAssembly.instantiate(wasm, {}))
|
|
113
|
+
.then(({ exports }) => {
|
|
114
|
+
// required for minifiers that mangle the __heap_base property
|
|
115
|
+
const instanceExports = new Map(Object.entries(exports));
|
|
116
|
+
|
|
117
|
+
const puff = instanceExports.get("puff");
|
|
118
|
+
const memory = instanceExports.get("memory")["buffer"];
|
|
119
|
+
const dataArray = new uint8Array(memory);
|
|
120
|
+
const heapView = new DataView(memory);
|
|
121
|
+
|
|
122
|
+
let heapPos = instanceExports.get("__heap_base");
|
|
123
|
+
|
|
124
|
+
// source length
|
|
125
|
+
const sourceLength = source.length;
|
|
126
|
+
const sourceLengthPtr = heapPos;
|
|
127
|
+
heapPos += 4;
|
|
128
|
+
heapView.setInt32(sourceLengthPtr, sourceLength, true);
|
|
129
|
+
|
|
130
|
+
// source data
|
|
131
|
+
const sourcePtr = heapPos;
|
|
132
|
+
heapPos += sourceLength;
|
|
133
|
+
dataArray.set(source, sourcePtr);
|
|
134
|
+
|
|
135
|
+
// destination length
|
|
136
|
+
const destLengthPtr = heapPos;
|
|
137
|
+
heapPos += 4;
|
|
138
|
+
heapView.setInt32(
|
|
139
|
+
destLengthPtr,
|
|
140
|
+
dataArray.byteLength - heapPos,
|
|
141
|
+
true,
|
|
142
|
+
);
|
|
143
|
+
|
|
144
|
+
// destination data fills in the rest of the heap
|
|
145
|
+
puff(heapPos, destLengthPtr, sourcePtr, sourceLengthPtr);
|
|
146
|
+
|
|
147
|
+
resolve(
|
|
148
|
+
dataArray.slice(
|
|
149
|
+
heapPos,
|
|
150
|
+
heapPos + heapView.getInt32(destLengthPtr, true),
|
|
151
|
+
),
|
|
152
|
+
);
|
|
153
|
+
});
|
|
154
|
+
});
|
|
155
|
+
},
|
|
156
|
+
},
|
|
157
|
+
});
|
|
158
|
+
}
|
|
159
|
+
|
|
160
|
+
Object.defineProperty(this, "wasm", {
|
|
161
|
+
enumerable: true,
|
|
162
|
+
get: () => this._wasm,
|
|
163
|
+
});
|
|
164
|
+
|
|
165
|
+
this.getOutputChannels = (outputData, channelsDecoded, samplesDecoded) => {
|
|
166
|
+
let output = [],
|
|
167
|
+
i = 0;
|
|
168
|
+
|
|
169
|
+
while (i < channelsDecoded)
|
|
170
|
+
output.push(
|
|
171
|
+
outputData.slice(
|
|
172
|
+
i * samplesDecoded,
|
|
173
|
+
i++ * samplesDecoded + samplesDecoded,
|
|
174
|
+
),
|
|
175
|
+
);
|
|
176
|
+
|
|
177
|
+
return output;
|
|
178
|
+
};
|
|
179
|
+
|
|
180
|
+
this.allocateTypedArray = (len, TypedArray, setPointer = true) => {
|
|
181
|
+
const ptr = this._wasm.malloc(TypedArray.BYTES_PER_ELEMENT * len);
|
|
182
|
+
if (setPointer) this._pointers.add(ptr);
|
|
183
|
+
|
|
184
|
+
return {
|
|
185
|
+
ptr: ptr,
|
|
186
|
+
len: len,
|
|
187
|
+
buf: new TypedArray(this._wasm.HEAP, ptr, len),
|
|
188
|
+
};
|
|
189
|
+
};
|
|
190
|
+
|
|
191
|
+
this.free = () => {
|
|
192
|
+
this._pointers.forEach((ptr) => {
|
|
193
|
+
this._wasm.free(ptr);
|
|
194
|
+
});
|
|
195
|
+
this._pointers.clear();
|
|
196
|
+
};
|
|
197
|
+
|
|
198
|
+
this.codeToString = (ptr) => {
|
|
199
|
+
const characters = [],
|
|
200
|
+
heap = new Uint8Array(this._wasm.HEAP);
|
|
201
|
+
for (let character = heap[ptr]; character !== 0; character = heap[++ptr])
|
|
202
|
+
characters.push(character);
|
|
203
|
+
|
|
204
|
+
return String.fromCharCode.apply(null, characters);
|
|
205
|
+
};
|
|
206
|
+
|
|
207
|
+
this.addError = (
|
|
208
|
+
errors,
|
|
209
|
+
message,
|
|
210
|
+
frameLength,
|
|
211
|
+
frameNumber,
|
|
212
|
+
inputBytes,
|
|
213
|
+
outputSamples,
|
|
214
|
+
) => {
|
|
215
|
+
errors.push({
|
|
216
|
+
message: message,
|
|
217
|
+
frameLength: frameLength,
|
|
218
|
+
frameNumber: frameNumber,
|
|
219
|
+
inputBytes: inputBytes,
|
|
220
|
+
outputSamples: outputSamples,
|
|
221
|
+
});
|
|
222
|
+
};
|
|
223
|
+
|
|
224
|
+
this.instantiate = (_EmscriptenWASM, _module) => {
|
|
225
|
+
if (_module) WASMAudioDecoderCommon.setModule(_EmscriptenWASM, _module);
|
|
226
|
+
this._wasm = new _EmscriptenWASM(WASMAudioDecoderCommon).instantiate();
|
|
227
|
+
this._pointers = new Set();
|
|
228
|
+
|
|
229
|
+
return this._wasm.ready.then(() => this);
|
|
230
|
+
};
|
|
231
|
+
}
|
|
@@ -0,0 +1,129 @@
|
|
|
1
|
+
import NodeWorker from "@eshaz/web-worker";
|
|
2
|
+
import WASMAudioDecoderCommon from "./WASMAudioDecoderCommon.js";
|
|
3
|
+
|
|
4
|
+
const getWorker = () => globalThis.Worker || NodeWorker;
|
|
5
|
+
|
|
6
|
+
export default class WASMAudioDecoderWorker extends getWorker() {
|
|
7
|
+
constructor(options, name, Decoder, EmscriptenWASM) {
|
|
8
|
+
if (!WASMAudioDecoderCommon.modules) new WASMAudioDecoderCommon();
|
|
9
|
+
|
|
10
|
+
let source = WASMAudioDecoderCommon.modules.get(Decoder);
|
|
11
|
+
|
|
12
|
+
if (!source) {
|
|
13
|
+
let type = "text/javascript",
|
|
14
|
+
isNode,
|
|
15
|
+
webworkerSourceCode =
|
|
16
|
+
"'use strict';" +
|
|
17
|
+
// dependencies need to be manually resolved when stringifying this function
|
|
18
|
+
`(${((_Decoder, _WASMAudioDecoderCommon, _EmscriptenWASM) => {
|
|
19
|
+
// We're in a Web Worker
|
|
20
|
+
|
|
21
|
+
// setup Promise that will be resolved once the WebAssembly Module is received
|
|
22
|
+
let decoder,
|
|
23
|
+
moduleResolve,
|
|
24
|
+
modulePromise = new Promise((resolve) => {
|
|
25
|
+
moduleResolve = resolve;
|
|
26
|
+
});
|
|
27
|
+
|
|
28
|
+
self.onmessage = ({ data: { id, command, data } }) => {
|
|
29
|
+
let messagePromise = modulePromise,
|
|
30
|
+
messagePayload = { id },
|
|
31
|
+
transferList;
|
|
32
|
+
|
|
33
|
+
if (command === "init") {
|
|
34
|
+
Object.defineProperties(_Decoder, {
|
|
35
|
+
WASMAudioDecoderCommon: { value: _WASMAudioDecoderCommon },
|
|
36
|
+
EmscriptenWASM: { value: _EmscriptenWASM },
|
|
37
|
+
module: { value: data.module },
|
|
38
|
+
isWebWorker: { value: true },
|
|
39
|
+
});
|
|
40
|
+
|
|
41
|
+
decoder = new _Decoder(data.options);
|
|
42
|
+
moduleResolve();
|
|
43
|
+
} else if (command === "free") {
|
|
44
|
+
decoder.free();
|
|
45
|
+
} else if (command === "ready") {
|
|
46
|
+
messagePromise = messagePromise.then(() => decoder.ready);
|
|
47
|
+
} else if (command === "reset") {
|
|
48
|
+
messagePromise = messagePromise.then(() => decoder.reset());
|
|
49
|
+
} else {
|
|
50
|
+
// "decode":
|
|
51
|
+
// "decodeFrame":
|
|
52
|
+
// "decodeFrames":
|
|
53
|
+
Object.assign(
|
|
54
|
+
messagePayload,
|
|
55
|
+
decoder[command](
|
|
56
|
+
// detach buffers
|
|
57
|
+
Array.isArray(data)
|
|
58
|
+
? data.map((data) => new Uint8Array(data))
|
|
59
|
+
: new Uint8Array(data),
|
|
60
|
+
),
|
|
61
|
+
);
|
|
62
|
+
// The "transferList" parameter transfers ownership of channel data to main thread,
|
|
63
|
+
// which avoids copying memory.
|
|
64
|
+
transferList = messagePayload.channelData
|
|
65
|
+
? messagePayload.channelData.map((channel) => channel.buffer)
|
|
66
|
+
: [];
|
|
67
|
+
}
|
|
68
|
+
|
|
69
|
+
messagePromise.then(() =>
|
|
70
|
+
self.postMessage(messagePayload, transferList),
|
|
71
|
+
);
|
|
72
|
+
};
|
|
73
|
+
}).toString()})(${Decoder}, ${WASMAudioDecoderCommon}, ${EmscriptenWASM})`;
|
|
74
|
+
|
|
75
|
+
try {
|
|
76
|
+
isNode = typeof process.versions.node !== "undefined";
|
|
77
|
+
} catch {}
|
|
78
|
+
|
|
79
|
+
source = isNode
|
|
80
|
+
? `data:${type};base64,${Buffer.from(webworkerSourceCode).toString(
|
|
81
|
+
"base64",
|
|
82
|
+
)}`
|
|
83
|
+
: URL.createObjectURL(new Blob([webworkerSourceCode], { type }));
|
|
84
|
+
|
|
85
|
+
WASMAudioDecoderCommon.modules.set(Decoder, source);
|
|
86
|
+
}
|
|
87
|
+
|
|
88
|
+
super(source, { name });
|
|
89
|
+
|
|
90
|
+
this._id = Number.MIN_SAFE_INTEGER;
|
|
91
|
+
this._enqueuedOperations = new Map();
|
|
92
|
+
|
|
93
|
+
this.onmessage = ({ data }) => {
|
|
94
|
+
const { id, ...rest } = data;
|
|
95
|
+
this._enqueuedOperations.get(id)(rest);
|
|
96
|
+
this._enqueuedOperations.delete(id);
|
|
97
|
+
};
|
|
98
|
+
|
|
99
|
+
new EmscriptenWASM(WASMAudioDecoderCommon).getModule().then((module) => {
|
|
100
|
+
this.postToDecoder("init", { module, options });
|
|
101
|
+
});
|
|
102
|
+
}
|
|
103
|
+
|
|
104
|
+
async postToDecoder(command, data) {
|
|
105
|
+
return new Promise((resolve) => {
|
|
106
|
+
this.postMessage({
|
|
107
|
+
command,
|
|
108
|
+
id: this._id,
|
|
109
|
+
data,
|
|
110
|
+
});
|
|
111
|
+
|
|
112
|
+
this._enqueuedOperations.set(this._id++, resolve);
|
|
113
|
+
});
|
|
114
|
+
}
|
|
115
|
+
|
|
116
|
+
get ready() {
|
|
117
|
+
return this.postToDecoder("ready");
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
async free() {
|
|
121
|
+
await this.postToDecoder("free").finally(() => {
|
|
122
|
+
this.terminate();
|
|
123
|
+
});
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
async reset() {
|
|
127
|
+
await this.postToDecoder("reset");
|
|
128
|
+
}
|
|
129
|
+
}
|
|
@@ -0,0 +1,67 @@
|
|
|
1
|
+
This copy of puff has been altered from the original to be inlined into this library.
|
|
2
|
+
|
|
3
|
+
See the original code for puff here: https://github.com/madler/zlib/tree/master/contrib/puff
|
|
4
|
+
|
|
5
|
+
Puff -- A Simple Inflate
|
|
6
|
+
3 Mar 2003
|
|
7
|
+
Mark Adler
|
|
8
|
+
madler@alumni.caltech.edu
|
|
9
|
+
|
|
10
|
+
What this is --
|
|
11
|
+
|
|
12
|
+
puff.c provides the routine puff() to decompress the deflate data format. It
|
|
13
|
+
does so more slowly than zlib, but the code is about one-fifth the size of the
|
|
14
|
+
inflate code in zlib, and written to be very easy to read.
|
|
15
|
+
|
|
16
|
+
Why I wrote this --
|
|
17
|
+
|
|
18
|
+
puff.c was written to document the deflate format unambiguously, by virtue of
|
|
19
|
+
being working C code. It is meant to supplement RFC 1951, which formally
|
|
20
|
+
describes the deflate format. I have received many questions on details of the
|
|
21
|
+
deflate format, and I hope that reading this code will answer those questions.
|
|
22
|
+
puff.c is heavily commented with details of the deflate format, especially
|
|
23
|
+
those little nooks and cranies of the format that might not be obvious from a
|
|
24
|
+
specification.
|
|
25
|
+
|
|
26
|
+
puff.c may also be useful in applications where code size or memory usage is a
|
|
27
|
+
very limited resource, and speed is not as important.
|
|
28
|
+
|
|
29
|
+
How to use it --
|
|
30
|
+
|
|
31
|
+
Well, most likely you should just be reading puff.c and using zlib for actual
|
|
32
|
+
applications, but if you must ...
|
|
33
|
+
|
|
34
|
+
Include puff.h in your code, which provides this prototype:
|
|
35
|
+
|
|
36
|
+
int puff(unsigned char *dest, /* pointer to destination pointer */
|
|
37
|
+
unsigned long *destlen, /* amount of output space */
|
|
38
|
+
unsigned char *source, /* pointer to source data pointer */
|
|
39
|
+
unsigned long *sourcelen); /* amount of input available */
|
|
40
|
+
|
|
41
|
+
Then you can call puff() to decompress a deflate stream that is in memory in
|
|
42
|
+
its entirety at source, to a sufficiently sized block of memory for the
|
|
43
|
+
decompressed data at dest. puff() is the only external symbol in puff.c The
|
|
44
|
+
only C library functions that puff.c needs are setjmp() and longjmp(), which
|
|
45
|
+
are used to simplify error checking in the code to improve readabilty. puff.c
|
|
46
|
+
does no memory allocation, and uses less than 2K bytes off of the stack.
|
|
47
|
+
|
|
48
|
+
If destlen is not enough space for the uncompressed data, then inflate will
|
|
49
|
+
return an error without writing more than destlen bytes. Note that this means
|
|
50
|
+
that in order to decompress the deflate data successfully, you need to know
|
|
51
|
+
the size of the uncompressed data ahead of time.
|
|
52
|
+
|
|
53
|
+
If needed, puff() can determine the size of the uncompressed data with no
|
|
54
|
+
output space. This is done by passing dest equal to (unsigned char *)0. Then
|
|
55
|
+
the initial value of *destlen is ignored and *destlen is set to the length of
|
|
56
|
+
the uncompressed data. So if the size of the uncompressed data is not known,
|
|
57
|
+
then two passes of puff() can be used--first to determine the size, and second
|
|
58
|
+
to do the actual inflation after allocating the appropriate memory. Not
|
|
59
|
+
pretty, but it works. (This is one of the reasons you should be using zlib.)
|
|
60
|
+
|
|
61
|
+
The deflate format is self-terminating. If the deflate stream does not end
|
|
62
|
+
in *sourcelen bytes, puff() will return an error without reading at or past
|
|
63
|
+
endsource.
|
|
64
|
+
|
|
65
|
+
On return, *sourcelen is updated to the amount of input data consumed, and
|
|
66
|
+
*destlen is updated to the size of the uncompressed data. See the comments
|
|
67
|
+
in puff.c for the possible return codes for puff().
|
|
@@ -0,0 +1,31 @@
|
|
|
1
|
+
import fs from "fs";
|
|
2
|
+
import { dynamicEncode } from "simple-yenc";
|
|
3
|
+
|
|
4
|
+
const puffWasmPath = "src/common/src/puff/Puff.wasm";
|
|
5
|
+
const wasmCommonPath = "src/common/src/WASMAudioDecoderCommon.js";
|
|
6
|
+
|
|
7
|
+
const puffWasm = fs.readFileSync(puffWasmPath);
|
|
8
|
+
|
|
9
|
+
const puffEncoded = dynamicEncode(puffWasm, "`");
|
|
10
|
+
|
|
11
|
+
const wasmCommon = fs.readFileSync(wasmCommonPath).toString();
|
|
12
|
+
|
|
13
|
+
const puffString = wasmCommon.match(/const puffString = String.raw`.*`;/s)[0];
|
|
14
|
+
|
|
15
|
+
const wasmStartIdx = wasmCommon.indexOf(puffString);
|
|
16
|
+
const wasmEndIdx = wasmStartIdx + puffString.length;
|
|
17
|
+
|
|
18
|
+
// Concatenate the strings as buffers to preserve extended ascii
|
|
19
|
+
const wasmCommonWithPuff = Buffer.concat(
|
|
20
|
+
[
|
|
21
|
+
wasmCommon.substring(0, wasmStartIdx),
|
|
22
|
+
"const puffString = String.raw`",
|
|
23
|
+
puffEncoded,
|
|
24
|
+
"`;",
|
|
25
|
+
wasmCommon.substring(wasmEndIdx),
|
|
26
|
+
].map((string) => Buffer.from(string, { encoding: "binary" })),
|
|
27
|
+
);
|
|
28
|
+
|
|
29
|
+
fs.writeFileSync(wasmCommonPath, wasmCommonWithPuff, { encoding: "binary" });
|
|
30
|
+
|
|
31
|
+
console.log(puffWasm.length);
|