@ardennguyen/zalo-agent-cli 1.0.7 → 2.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/DISCLAIMER.md +2 -2
- package/README.md +146 -69
- package/node_modules/asynckit/LICENSE +21 -0
- package/node_modules/asynckit/README.md +233 -0
- package/node_modules/asynckit/bench.js +76 -0
- package/node_modules/asynckit/index.js +6 -0
- package/node_modules/asynckit/lib/abort.js +29 -0
- package/node_modules/asynckit/lib/async.js +34 -0
- package/node_modules/asynckit/lib/defer.js +26 -0
- package/node_modules/asynckit/lib/iterate.js +75 -0
- package/node_modules/asynckit/lib/readable_asynckit.js +91 -0
- package/node_modules/asynckit/lib/readable_parallel.js +25 -0
- package/node_modules/asynckit/lib/readable_serial.js +25 -0
- package/node_modules/asynckit/lib/readable_serial_ordered.js +29 -0
- package/node_modules/asynckit/lib/state.js +37 -0
- package/node_modules/asynckit/lib/streamify.js +141 -0
- package/node_modules/asynckit/lib/terminator.js +29 -0
- package/node_modules/asynckit/package.json +63 -0
- package/node_modules/asynckit/parallel.js +43 -0
- package/node_modules/asynckit/serial.js +17 -0
- package/node_modules/asynckit/serialOrdered.js +75 -0
- package/node_modules/asynckit/stream.js +21 -0
- package/node_modules/bignumber.js/CHANGELOG.md +381 -0
- package/node_modules/bignumber.js/LICENCE.md +26 -0
- package/node_modules/bignumber.js/README.md +289 -0
- package/node_modules/bignumber.js/bignumber.d.mts +6 -0
- package/node_modules/bignumber.js/bignumber.d.ts +5 -0
- package/node_modules/bignumber.js/bignumber.js +2922 -0
- package/node_modules/bignumber.js/bignumber.mjs +2907 -0
- package/node_modules/bignumber.js/doc/API.html +2249 -0
- package/node_modules/bignumber.js/package.json +60 -0
- package/node_modules/bignumber.js/types.d.ts +1821 -0
- package/node_modules/call-bind-apply-helpers/.eslintrc +17 -0
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +12 -0
- package/node_modules/call-bind-apply-helpers/.nycrc +9 -0
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +30 -0
- package/node_modules/call-bind-apply-helpers/LICENSE +21 -0
- package/node_modules/call-bind-apply-helpers/README.md +62 -0
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/actualApply.js +10 -0
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +19 -0
- package/node_modules/call-bind-apply-helpers/applyBind.js +10 -0
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +1 -0
- package/node_modules/call-bind-apply-helpers/functionCall.js +4 -0
- package/node_modules/call-bind-apply-helpers/index.d.ts +64 -0
- package/node_modules/call-bind-apply-helpers/index.js +15 -0
- package/node_modules/call-bind-apply-helpers/package.json +85 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +3 -0
- package/node_modules/call-bind-apply-helpers/reflectApply.js +4 -0
- package/node_modules/call-bind-apply-helpers/test/index.js +63 -0
- package/node_modules/call-bind-apply-helpers/tsconfig.json +9 -0
- package/node_modules/combined-stream/License +19 -0
- package/node_modules/combined-stream/Readme.md +138 -0
- package/node_modules/combined-stream/lib/combined_stream.js +208 -0
- package/node_modules/combined-stream/package.json +25 -0
- package/node_modules/crypto-js/CONTRIBUTING.md +28 -0
- package/node_modules/crypto-js/LICENSE +24 -0
- package/node_modules/crypto-js/README.md +275 -0
- package/node_modules/crypto-js/aes.js +234 -0
- package/node_modules/crypto-js/blowfish.js +471 -0
- package/node_modules/crypto-js/bower.json +39 -0
- package/node_modules/crypto-js/cipher-core.js +895 -0
- package/node_modules/crypto-js/core.js +807 -0
- package/node_modules/crypto-js/crypto-js.js +6657 -0
- package/node_modules/crypto-js/docs/QuickStartGuide.wiki +470 -0
- package/node_modules/crypto-js/enc-base64.js +136 -0
- package/node_modules/crypto-js/enc-base64url.js +148 -0
- package/node_modules/crypto-js/enc-hex.js +18 -0
- package/node_modules/crypto-js/enc-latin1.js +18 -0
- package/node_modules/crypto-js/enc-utf16.js +149 -0
- package/node_modules/crypto-js/enc-utf8.js +18 -0
- package/node_modules/crypto-js/evpkdf.js +134 -0
- package/node_modules/crypto-js/format-hex.js +66 -0
- package/node_modules/crypto-js/format-openssl.js +18 -0
- package/node_modules/crypto-js/hmac-md5.js +18 -0
- package/node_modules/crypto-js/hmac-ripemd160.js +18 -0
- package/node_modules/crypto-js/hmac-sha1.js +18 -0
- package/node_modules/crypto-js/hmac-sha224.js +18 -0
- package/node_modules/crypto-js/hmac-sha256.js +18 -0
- package/node_modules/crypto-js/hmac-sha3.js +18 -0
- package/node_modules/crypto-js/hmac-sha384.js +18 -0
- package/node_modules/crypto-js/hmac-sha512.js +18 -0
- package/node_modules/crypto-js/hmac.js +143 -0
- package/node_modules/crypto-js/index.js +18 -0
- package/node_modules/crypto-js/lib-typedarrays.js +76 -0
- package/node_modules/crypto-js/md5.js +268 -0
- package/node_modules/crypto-js/mode-cfb.js +80 -0
- package/node_modules/crypto-js/mode-ctr-gladman.js +116 -0
- package/node_modules/crypto-js/mode-ctr.js +58 -0
- package/node_modules/crypto-js/mode-ecb.js +40 -0
- package/node_modules/crypto-js/mode-ofb.js +54 -0
- package/node_modules/crypto-js/package.json +42 -0
- package/node_modules/crypto-js/pad-ansix923.js +49 -0
- package/node_modules/crypto-js/pad-iso10126.js +44 -0
- package/node_modules/crypto-js/pad-iso97971.js +40 -0
- package/node_modules/crypto-js/pad-nopadding.js +30 -0
- package/node_modules/crypto-js/pad-pkcs7.js +18 -0
- package/node_modules/crypto-js/pad-zeropadding.js +47 -0
- package/node_modules/crypto-js/pbkdf2.js +145 -0
- package/node_modules/crypto-js/rabbit-legacy.js +190 -0
- package/node_modules/crypto-js/rabbit.js +192 -0
- package/node_modules/crypto-js/rc4.js +139 -0
- package/node_modules/crypto-js/ripemd160.js +267 -0
- package/node_modules/crypto-js/sha1.js +150 -0
- package/node_modules/crypto-js/sha224.js +80 -0
- package/node_modules/crypto-js/sha256.js +199 -0
- package/node_modules/crypto-js/sha3.js +326 -0
- package/node_modules/crypto-js/sha384.js +83 -0
- package/node_modules/crypto-js/sha512.js +326 -0
- package/node_modules/crypto-js/tripledes.js +779 -0
- package/node_modules/crypto-js/x64-core.js +304 -0
- package/node_modules/delayed-stream/.npmignore +1 -0
- package/node_modules/delayed-stream/License +19 -0
- package/node_modules/delayed-stream/Makefile +7 -0
- package/node_modules/delayed-stream/Readme.md +141 -0
- package/node_modules/delayed-stream/lib/delayed_stream.js +107 -0
- package/node_modules/delayed-stream/package.json +27 -0
- package/node_modules/dunder-proto/.eslintrc +5 -0
- package/node_modules/dunder-proto/.github/FUNDING.yml +12 -0
- package/node_modules/dunder-proto/.nycrc +13 -0
- package/node_modules/dunder-proto/CHANGELOG.md +24 -0
- package/node_modules/dunder-proto/LICENSE +21 -0
- package/node_modules/dunder-proto/README.md +54 -0
- package/node_modules/dunder-proto/get.d.ts +5 -0
- package/node_modules/dunder-proto/get.js +30 -0
- package/node_modules/dunder-proto/package.json +76 -0
- package/node_modules/dunder-proto/set.d.ts +5 -0
- package/node_modules/dunder-proto/set.js +35 -0
- package/node_modules/dunder-proto/test/get.js +34 -0
- package/node_modules/dunder-proto/test/index.js +4 -0
- package/node_modules/dunder-proto/test/set.js +50 -0
- package/node_modules/dunder-proto/tsconfig.json +9 -0
- package/node_modules/es-define-property/.eslintrc +13 -0
- package/node_modules/es-define-property/.github/FUNDING.yml +12 -0
- package/node_modules/es-define-property/.nycrc +9 -0
- package/node_modules/es-define-property/CHANGELOG.md +29 -0
- package/node_modules/es-define-property/LICENSE +21 -0
- package/node_modules/es-define-property/README.md +49 -0
- package/node_modules/es-define-property/index.d.ts +3 -0
- package/node_modules/es-define-property/index.js +14 -0
- package/node_modules/es-define-property/package.json +81 -0
- package/node_modules/es-define-property/test/index.js +56 -0
- package/node_modules/es-define-property/tsconfig.json +10 -0
- package/node_modules/es-errors/.eslintrc +5 -0
- package/node_modules/es-errors/.github/FUNDING.yml +12 -0
- package/node_modules/es-errors/CHANGELOG.md +40 -0
- package/node_modules/es-errors/LICENSE +21 -0
- package/node_modules/es-errors/README.md +55 -0
- package/node_modules/es-errors/eval.d.ts +3 -0
- package/node_modules/es-errors/eval.js +4 -0
- package/node_modules/es-errors/index.d.ts +3 -0
- package/node_modules/es-errors/index.js +4 -0
- package/node_modules/es-errors/package.json +80 -0
- package/node_modules/es-errors/range.d.ts +3 -0
- package/node_modules/es-errors/range.js +4 -0
- package/node_modules/es-errors/ref.d.ts +3 -0
- package/node_modules/es-errors/ref.js +4 -0
- package/node_modules/es-errors/syntax.d.ts +3 -0
- package/node_modules/es-errors/syntax.js +4 -0
- package/node_modules/es-errors/test/index.js +19 -0
- package/node_modules/es-errors/tsconfig.json +49 -0
- package/node_modules/es-errors/type.d.ts +3 -0
- package/node_modules/es-errors/type.js +4 -0
- package/node_modules/es-errors/uri.d.ts +3 -0
- package/node_modules/es-errors/uri.js +4 -0
- package/node_modules/es-object-atoms/.eslintrc +16 -0
- package/node_modules/es-object-atoms/.github/FUNDING.yml +12 -0
- package/node_modules/es-object-atoms/CHANGELOG.md +44 -0
- package/node_modules/es-object-atoms/LICENSE +21 -0
- package/node_modules/es-object-atoms/README.md +63 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +3 -0
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +11 -0
- package/node_modules/es-object-atoms/ToObject.d.ts +7 -0
- package/node_modules/es-object-atoms/ToObject.js +10 -0
- package/node_modules/es-object-atoms/index.d.ts +3 -0
- package/node_modules/es-object-atoms/index.js +4 -0
- package/node_modules/es-object-atoms/isObject.d.ts +3 -0
- package/node_modules/es-object-atoms/isObject.js +6 -0
- package/node_modules/es-object-atoms/package.json +79 -0
- package/node_modules/es-object-atoms/test/index.js +38 -0
- package/node_modules/es-object-atoms/tsconfig.json +7 -0
- package/node_modules/es-set-tostringtag/.eslintrc +13 -0
- package/node_modules/es-set-tostringtag/.nycrc +9 -0
- package/node_modules/es-set-tostringtag/CHANGELOG.md +67 -0
- package/node_modules/es-set-tostringtag/LICENSE +21 -0
- package/node_modules/es-set-tostringtag/README.md +53 -0
- package/node_modules/es-set-tostringtag/index.d.ts +10 -0
- package/node_modules/es-set-tostringtag/index.js +35 -0
- package/node_modules/es-set-tostringtag/package.json +78 -0
- package/node_modules/es-set-tostringtag/test/index.js +85 -0
- package/node_modules/es-set-tostringtag/tsconfig.json +9 -0
- package/node_modules/form-data/CHANGELOG.md +686 -0
- package/node_modules/form-data/License +19 -0
- package/node_modules/form-data/README.md +355 -0
- package/node_modules/form-data/index.d.ts +62 -0
- package/node_modules/form-data/lib/browser.js +4 -0
- package/node_modules/form-data/lib/form_data.js +506 -0
- package/node_modules/form-data/lib/populate.js +10 -0
- package/node_modules/form-data/node_modules/mime-db/HISTORY.md +507 -0
- package/node_modules/form-data/node_modules/mime-db/LICENSE +23 -0
- package/node_modules/form-data/node_modules/mime-db/README.md +100 -0
- package/node_modules/form-data/node_modules/mime-db/db.json +8519 -0
- package/node_modules/form-data/node_modules/mime-db/index.js +12 -0
- package/node_modules/form-data/node_modules/mime-db/package.json +60 -0
- package/node_modules/form-data/node_modules/mime-types/HISTORY.md +397 -0
- package/node_modules/form-data/node_modules/mime-types/LICENSE +23 -0
- package/node_modules/form-data/node_modules/mime-types/README.md +113 -0
- package/node_modules/form-data/node_modules/mime-types/index.js +188 -0
- package/node_modules/form-data/node_modules/mime-types/package.json +44 -0
- package/node_modules/form-data/package.json +82 -0
- package/node_modules/function-bind/.eslintrc +21 -0
- package/node_modules/function-bind/.github/FUNDING.yml +12 -0
- package/node_modules/function-bind/.github/SECURITY.md +3 -0
- package/node_modules/function-bind/.nycrc +13 -0
- package/node_modules/function-bind/CHANGELOG.md +136 -0
- package/node_modules/function-bind/LICENSE +20 -0
- package/node_modules/function-bind/README.md +46 -0
- package/node_modules/function-bind/implementation.js +84 -0
- package/node_modules/function-bind/index.js +5 -0
- package/node_modules/function-bind/package.json +87 -0
- package/node_modules/function-bind/test/.eslintrc +9 -0
- package/node_modules/function-bind/test/index.js +252 -0
- package/node_modules/get-intrinsic/.eslintrc +42 -0
- package/node_modules/get-intrinsic/.github/FUNDING.yml +12 -0
- package/node_modules/get-intrinsic/.nycrc +9 -0
- package/node_modules/get-intrinsic/CHANGELOG.md +186 -0
- package/node_modules/get-intrinsic/LICENSE +21 -0
- package/node_modules/get-intrinsic/README.md +71 -0
- package/node_modules/get-intrinsic/index.js +378 -0
- package/node_modules/get-intrinsic/package.json +97 -0
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +274 -0
- package/node_modules/get-proto/.eslintrc +10 -0
- package/node_modules/get-proto/.github/FUNDING.yml +12 -0
- package/node_modules/get-proto/.nycrc +9 -0
- package/node_modules/get-proto/CHANGELOG.md +21 -0
- package/node_modules/get-proto/LICENSE +21 -0
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +5 -0
- package/node_modules/get-proto/Object.getPrototypeOf.js +6 -0
- package/node_modules/get-proto/README.md +50 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +3 -0
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +4 -0
- package/node_modules/get-proto/index.d.ts +5 -0
- package/node_modules/get-proto/index.js +27 -0
- package/node_modules/get-proto/package.json +81 -0
- package/node_modules/get-proto/test/index.js +68 -0
- package/node_modules/get-proto/tsconfig.json +9 -0
- package/node_modules/gopd/.eslintrc +16 -0
- package/node_modules/gopd/.github/FUNDING.yml +12 -0
- package/node_modules/gopd/CHANGELOG.md +45 -0
- package/node_modules/gopd/LICENSE +21 -0
- package/node_modules/gopd/README.md +40 -0
- package/node_modules/gopd/gOPD.d.ts +1 -0
- package/node_modules/gopd/gOPD.js +4 -0
- package/node_modules/gopd/index.d.ts +5 -0
- package/node_modules/gopd/index.js +15 -0
- package/node_modules/gopd/package.json +77 -0
- package/node_modules/gopd/test/index.js +36 -0
- package/node_modules/gopd/tsconfig.json +9 -0
- package/node_modules/has-symbols/.eslintrc +11 -0
- package/node_modules/has-symbols/.github/FUNDING.yml +12 -0
- package/node_modules/has-symbols/.nycrc +9 -0
- package/node_modules/has-symbols/CHANGELOG.md +91 -0
- package/node_modules/has-symbols/LICENSE +21 -0
- package/node_modules/has-symbols/README.md +46 -0
- package/node_modules/has-symbols/index.d.ts +3 -0
- package/node_modules/has-symbols/index.js +14 -0
- package/node_modules/has-symbols/package.json +111 -0
- package/node_modules/has-symbols/shams.d.ts +3 -0
- package/node_modules/has-symbols/shams.js +45 -0
- package/node_modules/has-symbols/test/index.js +22 -0
- package/node_modules/has-symbols/test/shams/core-js.js +29 -0
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +29 -0
- package/node_modules/has-symbols/test/tests.js +58 -0
- package/node_modules/has-symbols/tsconfig.json +10 -0
- package/node_modules/has-tostringtag/.eslintrc +5 -0
- package/node_modules/has-tostringtag/.github/FUNDING.yml +12 -0
- package/node_modules/has-tostringtag/.nycrc +13 -0
- package/node_modules/has-tostringtag/CHANGELOG.md +42 -0
- package/node_modules/has-tostringtag/LICENSE +21 -0
- package/node_modules/has-tostringtag/README.md +46 -0
- package/node_modules/has-tostringtag/index.d.ts +3 -0
- package/node_modules/has-tostringtag/index.js +8 -0
- package/node_modules/has-tostringtag/package.json +108 -0
- package/node_modules/has-tostringtag/shams.d.ts +3 -0
- package/node_modules/has-tostringtag/shams.js +8 -0
- package/node_modules/has-tostringtag/test/index.js +21 -0
- package/node_modules/has-tostringtag/test/shams/core-js.js +31 -0
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +30 -0
- package/node_modules/has-tostringtag/test/tests.js +15 -0
- package/node_modules/has-tostringtag/tsconfig.json +49 -0
- package/node_modules/hasown/.github/FUNDING.yml +12 -0
- package/node_modules/hasown/.nycrc +13 -0
- package/node_modules/hasown/CHANGELOG.md +58 -0
- package/node_modules/hasown/LICENSE +21 -0
- package/node_modules/hasown/README.md +40 -0
- package/node_modules/hasown/eslint.config.mjs +6 -0
- package/node_modules/hasown/index.d.ts +3 -0
- package/node_modules/hasown/index.js +8 -0
- package/node_modules/hasown/package.json +91 -0
- package/node_modules/hasown/tsconfig.json +6 -0
- package/node_modules/json-bigint/LICENSE +20 -0
- package/node_modules/json-bigint/README.md +240 -0
- package/node_modules/json-bigint/index.js +12 -0
- package/node_modules/json-bigint/lib/parse.js +443 -0
- package/node_modules/json-bigint/lib/stringify.js +384 -0
- package/node_modules/json-bigint/package.json +34 -0
- package/node_modules/math-intrinsics/.eslintrc +16 -0
- package/node_modules/math-intrinsics/.github/FUNDING.yml +12 -0
- package/node_modules/math-intrinsics/CHANGELOG.md +24 -0
- package/node_modules/math-intrinsics/LICENSE +21 -0
- package/node_modules/math-intrinsics/README.md +50 -0
- package/node_modules/math-intrinsics/abs.d.ts +1 -0
- package/node_modules/math-intrinsics/abs.js +4 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +4 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +5 -0
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +3 -0
- package/node_modules/math-intrinsics/constants/maxValue.js +5 -0
- package/node_modules/math-intrinsics/floor.d.ts +1 -0
- package/node_modules/math-intrinsics/floor.js +4 -0
- package/node_modules/math-intrinsics/isFinite.d.ts +3 -0
- package/node_modules/math-intrinsics/isFinite.js +12 -0
- package/node_modules/math-intrinsics/isInteger.d.ts +3 -0
- package/node_modules/math-intrinsics/isInteger.js +16 -0
- package/node_modules/math-intrinsics/isNaN.d.ts +1 -0
- package/node_modules/math-intrinsics/isNaN.js +6 -0
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +3 -0
- package/node_modules/math-intrinsics/isNegativeZero.js +6 -0
- package/node_modules/math-intrinsics/max.d.ts +1 -0
- package/node_modules/math-intrinsics/max.js +4 -0
- package/node_modules/math-intrinsics/min.d.ts +1 -0
- package/node_modules/math-intrinsics/min.js +4 -0
- package/node_modules/math-intrinsics/mod.d.ts +3 -0
- package/node_modules/math-intrinsics/mod.js +9 -0
- package/node_modules/math-intrinsics/package.json +86 -0
- package/node_modules/math-intrinsics/pow.d.ts +1 -0
- package/node_modules/math-intrinsics/pow.js +4 -0
- package/node_modules/math-intrinsics/round.d.ts +1 -0
- package/node_modules/math-intrinsics/round.js +4 -0
- package/node_modules/math-intrinsics/sign.d.ts +3 -0
- package/node_modules/math-intrinsics/sign.js +11 -0
- package/node_modules/math-intrinsics/test/index.js +192 -0
- package/node_modules/math-intrinsics/tsconfig.json +3 -0
- package/node_modules/pako/LICENSE +21 -0
- package/node_modules/pako/README.md +155 -0
- package/node_modules/pako/dist/pako.es5.js +6760 -0
- package/node_modules/pako/dist/pako.es5.min.js +2 -0
- package/node_modules/pako/dist/pako.esm.mjs +6945 -0
- package/node_modules/pako/dist/pako.js +6964 -0
- package/node_modules/pako/dist/pako.min.js +2 -0
- package/node_modules/pako/dist/pako_deflate.es5.js +3953 -0
- package/node_modules/pako/dist/pako_deflate.es5.min.js +2 -0
- package/node_modules/pako/dist/pako_deflate.js +4154 -0
- package/node_modules/pako/dist/pako_deflate.min.js +2 -0
- package/node_modules/pako/dist/pako_inflate.es5.js +3272 -0
- package/node_modules/pako/dist/pako_inflate.es5.min.js +2 -0
- package/node_modules/pako/dist/pako_inflate.js +3279 -0
- package/node_modules/pako/dist/pako_inflate.min.js +2 -0
- package/node_modules/pako/index.js +18 -0
- package/node_modules/pako/lib/deflate.js +387 -0
- package/node_modules/pako/lib/inflate.js +456 -0
- package/node_modules/pako/lib/utils/common.js +48 -0
- package/node_modules/pako/lib/utils/strings.js +174 -0
- package/node_modules/pako/lib/zlib/README +59 -0
- package/node_modules/pako/lib/zlib/adler32.js +51 -0
- package/node_modules/pako/lib/zlib/constants.js +68 -0
- package/node_modules/pako/lib/zlib/crc32.js +59 -0
- package/node_modules/pako/lib/zlib/deflate.js +2069 -0
- package/node_modules/pako/lib/zlib/gzheader.js +58 -0
- package/node_modules/pako/lib/zlib/inffast.js +344 -0
- package/node_modules/pako/lib/zlib/inflate.js +1575 -0
- package/node_modules/pako/lib/zlib/inftrees.js +340 -0
- package/node_modules/pako/lib/zlib/messages.js +32 -0
- package/node_modules/pako/lib/zlib/trees.js +1179 -0
- package/node_modules/pako/lib/zlib/zstream.js +47 -0
- package/node_modules/pako/package.json +73 -0
- package/node_modules/semver/LICENSE +15 -0
- package/node_modules/semver/README.md +680 -0
- package/node_modules/semver/bin/semver.js +195 -0
- package/node_modules/semver/classes/comparator.js +143 -0
- package/node_modules/semver/classes/index.js +7 -0
- package/node_modules/semver/classes/range.js +577 -0
- package/node_modules/semver/classes/semver.js +350 -0
- package/node_modules/semver/functions/clean.js +8 -0
- package/node_modules/semver/functions/cmp.js +54 -0
- package/node_modules/semver/functions/coerce.js +62 -0
- package/node_modules/semver/functions/compare-build.js +9 -0
- package/node_modules/semver/functions/compare-loose.js +5 -0
- package/node_modules/semver/functions/compare.js +7 -0
- package/node_modules/semver/functions/diff.js +60 -0
- package/node_modules/semver/functions/eq.js +5 -0
- package/node_modules/semver/functions/gt.js +5 -0
- package/node_modules/semver/functions/gte.js +5 -0
- package/node_modules/semver/functions/inc.js +21 -0
- package/node_modules/semver/functions/lt.js +5 -0
- package/node_modules/semver/functions/lte.js +5 -0
- package/node_modules/semver/functions/major.js +5 -0
- package/node_modules/semver/functions/minor.js +5 -0
- package/node_modules/semver/functions/neq.js +5 -0
- package/node_modules/semver/functions/parse.js +18 -0
- package/node_modules/semver/functions/patch.js +5 -0
- package/node_modules/semver/functions/prerelease.js +8 -0
- package/node_modules/semver/functions/rcompare.js +5 -0
- package/node_modules/semver/functions/rsort.js +5 -0
- package/node_modules/semver/functions/satisfies.js +12 -0
- package/node_modules/semver/functions/sort.js +5 -0
- package/node_modules/semver/functions/truncate.js +48 -0
- package/node_modules/semver/functions/valid.js +8 -0
- package/node_modules/semver/index.js +93 -0
- package/node_modules/semver/internal/constants.js +37 -0
- package/node_modules/semver/internal/debug.js +11 -0
- package/node_modules/semver/internal/identifiers.js +29 -0
- package/node_modules/semver/internal/lrucache.js +42 -0
- package/node_modules/semver/internal/parse-options.js +17 -0
- package/node_modules/semver/internal/re.js +223 -0
- package/node_modules/semver/package.json +78 -0
- package/node_modules/semver/preload.js +4 -0
- package/node_modules/semver/range.bnf +17 -0
- package/node_modules/semver/ranges/gtr.js +6 -0
- package/node_modules/semver/ranges/intersects.js +9 -0
- package/node_modules/semver/ranges/ltr.js +6 -0
- package/node_modules/semver/ranges/max-satisfying.js +27 -0
- package/node_modules/semver/ranges/min-satisfying.js +26 -0
- package/node_modules/semver/ranges/min-version.js +63 -0
- package/node_modules/semver/ranges/outside.js +82 -0
- package/node_modules/semver/ranges/simplify.js +49 -0
- package/node_modules/semver/ranges/subset.js +249 -0
- package/node_modules/semver/ranges/to-comparators.js +10 -0
- package/node_modules/semver/ranges/valid.js +13 -0
- package/node_modules/spark-md5/LICENSE +13 -0
- package/node_modules/spark-md5/README.md +191 -0
- package/node_modules/spark-md5/package.json +35 -0
- package/node_modules/spark-md5/spark-md5.js +751 -0
- package/node_modules/spark-md5/spark-md5.min.js +1 -0
- package/node_modules/tldts/LICENSE +13 -0
- package/node_modules/tldts/README.md +327 -0
- package/node_modules/tldts/bin/cli.js +21 -0
- package/node_modules/tldts/dist/cjs/index.js +666 -0
- package/node_modules/tldts/dist/cjs/index.js.map +1 -0
- package/node_modules/tldts/dist/cjs/src/data/trie.js +14 -0
- package/node_modules/tldts/dist/cjs/src/data/trie.js.map +1 -0
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js +67 -0
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +1 -0
- package/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/node_modules/tldts/dist/es6/index.js +33 -0
- package/node_modules/tldts/dist/es6/index.js.map +1 -0
- package/node_modules/tldts/dist/es6/src/data/trie.js +11 -0
- package/node_modules/tldts/dist/es6/src/data/trie.js.map +1 -0
- package/node_modules/tldts/dist/es6/src/suffix-trie.js +64 -0
- package/node_modules/tldts/dist/es6/src/suffix-trie.js.map +1 -0
- package/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
- package/node_modules/tldts/dist/index.cjs.min.js +2 -0
- package/node_modules/tldts/dist/index.cjs.min.js.map +1 -0
- package/node_modules/tldts/dist/index.esm.min.js +2 -0
- package/node_modules/tldts/dist/index.esm.min.js.map +1 -0
- package/node_modules/tldts/dist/index.umd.min.js +2 -0
- package/node_modules/tldts/dist/index.umd.min.js.map +1 -0
- package/node_modules/tldts/dist/types/index.d.ts +7 -0
- package/node_modules/tldts/dist/types/src/data/trie.d.ts +5 -0
- package/node_modules/tldts/dist/types/src/suffix-trie.d.ts +5 -0
- package/node_modules/tldts/index.ts +62 -0
- package/node_modules/tldts/package.json +91 -0
- package/node_modules/tldts/src/data/trie.ts +14 -0
- package/node_modules/tldts/src/suffix-trie.ts +110 -0
- package/node_modules/tldts-core/LICENSE +13 -0
- package/node_modules/tldts-core/README.md +3 -0
- package/node_modules/tldts-core/dist/cjs/index.js +561 -0
- package/node_modules/tldts-core/dist/cjs/index.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +15 -0
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/domain.js +83 -0
- package/node_modules/tldts-core/dist/cjs/src/domain.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +149 -0
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/factory.js +104 -0
- package/node_modules/tldts-core/dist/cjs/src/factory.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js +72 -0
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js +69 -0
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +69 -0
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +3 -0
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/options.js +22 -0
- package/node_modules/tldts-core/dist/cjs/src/options.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js +14 -0
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +1 -0
- package/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +1 -0
- package/node_modules/tldts-core/dist/es6/index.js +4 -0
- package/node_modules/tldts-core/dist/es6/index.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +12 -0
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/domain.js +80 -0
- package/node_modules/tldts-core/dist/es6/src/domain.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js +146 -0
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/factory.js +99 -0
- package/node_modules/tldts-core/dist/es6/src/factory.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/is-ip.js +69 -0
- package/node_modules/tldts-core/dist/es6/src/is-ip.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/is-valid.js +66 -0
- package/node_modules/tldts-core/dist/es6/src/is-valid.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +66 -0
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js +2 -0
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/options.js +19 -0
- package/node_modules/tldts-core/dist/es6/src/options.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/src/subdomain.js +11 -0
- package/node_modules/tldts-core/dist/es6/src/subdomain.js.map +1 -0
- package/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +1 -0
- package/node_modules/tldts-core/dist/types/index.d.ts +4 -0
- package/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +6 -0
- package/node_modules/tldts-core/dist/types/src/domain.d.ts +5 -0
- package/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +5 -0
- package/node_modules/tldts-core/dist/types/src/factory.d.ts +28 -0
- package/node_modules/tldts-core/dist/types/src/is-ip.d.ts +6 -0
- package/node_modules/tldts-core/dist/types/src/is-valid.d.ts +15 -0
- package/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +2 -0
- package/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +9 -0
- package/node_modules/tldts-core/dist/types/src/options.d.ts +10 -0
- package/node_modules/tldts-core/dist/types/src/subdomain.d.ts +4 -0
- package/node_modules/tldts-core/index.ts +10 -0
- package/node_modules/tldts-core/package.json +68 -0
- package/node_modules/tldts-core/src/domain-without-suffix.ts +14 -0
- package/node_modules/tldts-core/src/domain.ts +100 -0
- package/node_modules/tldts-core/src/extract-hostname.ts +170 -0
- package/node_modules/tldts-core/src/factory.ts +160 -0
- package/node_modules/tldts-core/src/is-ip.ts +87 -0
- package/node_modules/tldts-core/src/is-valid.ts +79 -0
- package/node_modules/tldts-core/src/lookup/fast-path.ts +80 -0
- package/node_modules/tldts-core/src/lookup/interface.ts +10 -0
- package/node_modules/tldts-core/src/options.ts +39 -0
- package/node_modules/tldts-core/src/subdomain.ts +11 -0
- package/node_modules/tough-cookie/LICENSE +12 -0
- package/node_modules/tough-cookie/README.md +154 -0
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts +33 -0
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.js +65 -0
- package/node_modules/tough-cookie/dist/cookie/constants.d.ts +54 -0
- package/node_modules/tough-cookie/dist/cookie/constants.js +38 -0
- package/node_modules/tough-cookie/dist/cookie/cookie.d.ts +326 -0
- package/node_modules/tough-cookie/dist/cookie/cookie.js +831 -0
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts +58 -0
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.js +84 -0
- package/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts +621 -0
- package/node_modules/tough-cookie/dist/cookie/cookieJar.js +1000 -0
- package/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts +40 -0
- package/node_modules/tough-cookie/dist/cookie/defaultPath.js +60 -0
- package/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts +38 -0
- package/node_modules/tough-cookie/dist/cookie/domainMatch.js +94 -0
- package/node_modules/tough-cookie/dist/cookie/formatDate.d.ts +15 -0
- package/node_modules/tough-cookie/dist/cookie/formatDate.js +20 -0
- package/node_modules/tough-cookie/dist/cookie/index.d.ts +29 -0
- package/node_modules/tough-cookie/dist/cookie/index.js +54 -0
- package/node_modules/tough-cookie/dist/cookie/parseDate.d.ts +103 -0
- package/node_modules/tough-cookie/dist/cookie/parseDate.js +323 -0
- package/node_modules/tough-cookie/dist/cookie/permutePath.d.ts +14 -0
- package/node_modules/tough-cookie/dist/cookie/permutePath.js +32 -0
- package/node_modules/tough-cookie/dist/getPublicSuffix.d.ts +55 -0
- package/node_modules/tough-cookie/dist/getPublicSuffix.js +71 -0
- package/node_modules/tough-cookie/dist/memstore.d.ts +220 -0
- package/node_modules/tough-cookie/dist/memstore.js +187 -0
- package/node_modules/tough-cookie/dist/pathMatch.d.ts +17 -0
- package/node_modules/tough-cookie/dist/pathMatch.js +40 -0
- package/node_modules/tough-cookie/dist/permuteDomain.d.ts +15 -0
- package/node_modules/tough-cookie/dist/permuteDomain.js +44 -0
- package/node_modules/tough-cookie/dist/store.d.ts +211 -0
- package/node_modules/tough-cookie/dist/store.js +76 -0
- package/node_modules/tough-cookie/dist/utils.d.ts +34 -0
- package/node_modules/tough-cookie/dist/utils.js +99 -0
- package/node_modules/tough-cookie/dist/validators.d.ts +24 -0
- package/node_modules/tough-cookie/dist/validators.js +90 -0
- package/node_modules/tough-cookie/dist/version.d.ts +5 -0
- package/node_modules/tough-cookie/dist/version.js +8 -0
- package/node_modules/tough-cookie/package.json +144 -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 +530 -0
- package/node_modules/ws/lib/receiver.js +743 -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 +562 -0
- package/node_modules/ws/lib/websocket.js +1407 -0
- package/node_modules/ws/package.json +74 -0
- package/node_modules/ws/wrapper.mjs +21 -0
- package/node_modules/zca-js/.prettierrc +5 -0
- package/node_modules/zca-js/CODE_OF_CONDUCT.md +163 -0
- package/node_modules/zca-js/CONTRIBUTING.md +470 -0
- package/node_modules/zca-js/LICENSE +21 -0
- package/node_modules/zca-js/README.md +225 -0
- package/node_modules/zca-js/SECURITY.md +83 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiError.d.ts +4 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiError.js +7 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.d.ts +4 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.js +7 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.d.ts +4 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.js +7 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +4 -0
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.js +7 -0
- package/node_modules/zca-js/dist/Errors/index.d.ts +4 -0
- package/node_modules/zca-js/dist/Errors/index.js +4 -0
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.js +28 -0
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.js +28 -0
- package/node_modules/zca-js/dist/apis/addGroupDeputy.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/addGroupDeputy.js +30 -0
- package/node_modules/zca-js/dist/apis/addPollOptions.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/addPollOptions.js +26 -0
- package/node_modules/zca-js/dist/apis/addQuickMessage.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/addQuickMessage.js +60 -0
- package/node_modules/zca-js/dist/apis/addReaction.d.ts +18 -0
- package/node_modules/zca-js/dist/apis/addReaction.js +294 -0
- package/node_modules/zca-js/dist/apis/addUnreadMark.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/addUnreadMark.js +52 -0
- package/node_modules/zca-js/dist/apis/addUserToGroup.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/addUserToGroup.js +34 -0
- package/node_modules/zca-js/dist/apis/blockUser.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/blockUser.js +28 -0
- package/node_modules/zca-js/dist/apis/blockViewFeed.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/blockViewFeed.js +30 -0
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.js +52 -0
- package/node_modules/zca-js/dist/apis/changeFriendAlias.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/changeFriendAlias.js +27 -0
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.js +44 -0
- package/node_modules/zca-js/dist/apis/changeGroupName.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/changeGroupName.js +32 -0
- package/node_modules/zca-js/dist/apis/changeGroupOwner.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/changeGroupOwner.js +30 -0
- package/node_modules/zca-js/dist/apis/createAutoReply.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/createAutoReply.js +37 -0
- package/node_modules/zca-js/dist/apis/createBankAccount.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/createBankAccount.js +32 -0
- package/node_modules/zca-js/dist/apis/createCatalog.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/createCatalog.js +29 -0
- package/node_modules/zca-js/dist/apis/createGroup.d.ts +28 -0
- package/node_modules/zca-js/dist/apis/createGroup.js +43 -0
- package/node_modules/zca-js/dist/apis/createNote.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/createNote.js +47 -0
- package/node_modules/zca-js/dist/apis/createPoll.d.ts +36 -0
- package/node_modules/zca-js/dist/apis/createPoll.js +40 -0
- package/node_modules/zca-js/dist/apis/createProductCatalog.d.ts +23 -0
- package/node_modules/zca-js/dist/apis/createProductCatalog.js +50 -0
- package/node_modules/zca-js/dist/apis/createReminder.d.ts +12 -0
- package/node_modules/zca-js/dist/apis/createReminder.js +63 -0
- package/node_modules/zca-js/dist/apis/custom.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/custom.js +15 -0
- package/node_modules/zca-js/dist/apis/deleteAutoReply.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/deleteAutoReply.js +29 -0
- package/node_modules/zca-js/dist/apis/deleteAvatar.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/deleteAvatar.js +27 -0
- package/node_modules/zca-js/dist/apis/deleteBankAccount.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/deleteBankAccount.js +32 -0
- package/node_modules/zca-js/dist/apis/deleteCatalog.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/deleteCatalog.js +28 -0
- package/node_modules/zca-js/dist/apis/deleteChat.d.ts +19 -0
- package/node_modules/zca-js/dist/apis/deleteChat.js +50 -0
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.js +27 -0
- package/node_modules/zca-js/dist/apis/deleteMessage.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/deleteMessage.js +52 -0
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.js +31 -0
- package/node_modules/zca-js/dist/apis/deleteSnapshotMobileMsg.js +18 -0
- package/node_modules/zca-js/dist/apis/disableGroupLink.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/disableGroupLink.js +24 -0
- package/node_modules/zca-js/dist/apis/disperseGroup.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/disperseGroup.js +28 -0
- package/node_modules/zca-js/dist/apis/editNote.d.ts +17 -0
- package/node_modules/zca-js/dist/apis/editNote.js +46 -0
- package/node_modules/zca-js/dist/apis/editReminder.d.ts +13 -0
- package/node_modules/zca-js/dist/apis/editReminder.js +61 -0
- package/node_modules/zca-js/dist/apis/enableGroupLink.d.ts +6 -0
- package/node_modules/zca-js/dist/apis/enableGroupLink.js +25 -0
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.js +10 -0
- package/node_modules/zca-js/dist/apis/findUser.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/findUser.js +42 -0
- package/node_modules/zca-js/dist/apis/findUserByUsername.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/findUserByUsername.js +27 -0
- package/node_modules/zca-js/dist/apis/forwardMessage.d.ts +24 -0
- package/node_modules/zca-js/dist/apis/forwardMessage.js +114 -0
- package/node_modules/zca-js/dist/apis/getAliasList.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/getAliasList.js +27 -0
- package/node_modules/zca-js/dist/apis/getAllFriends.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getAllFriends.js +34 -0
- package/node_modules/zca-js/dist/apis/getAllGroups.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/getAllGroups.js +10 -0
- package/node_modules/zca-js/dist/apis/getArchivedChatList.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getArchivedChatList.js +23 -0
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.js +21 -0
- package/node_modules/zca-js/dist/apis/getAutoReplyList.d.ts +6 -0
- package/node_modules/zca-js/dist/apis/getAutoReplyList.js +24 -0
- package/node_modules/zca-js/dist/apis/getAvatarList.d.ts +12 -0
- package/node_modules/zca-js/dist/apis/getAvatarList.js +28 -0
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.js +30 -0
- package/node_modules/zca-js/dist/apis/getBizAccount.d.ts +24 -0
- package/node_modules/zca-js/dist/apis/getBizAccount.js +27 -0
- package/node_modules/zca-js/dist/apis/getCatalogList.d.ts +18 -0
- package/node_modules/zca-js/dist/apis/getCatalogList.js +32 -0
- package/node_modules/zca-js/dist/apis/getCloseFriends.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getCloseFriends.js +20 -0
- package/node_modules/zca-js/dist/apis/getContext.d.ts +1 -0
- package/node_modules/zca-js/dist/apis/getContext.js +4 -0
- package/node_modules/zca-js/dist/apis/getCookie.d.ts +1 -0
- package/node_modules/zca-js/dist/apis/getCookie.js +9 -0
- package/node_modules/zca-js/dist/apis/getCrossDB.js +18 -0
- package/node_modules/zca-js/dist/apis/getFriendBoardList.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getFriendBoardList.js +26 -0
- package/node_modules/zca-js/dist/apis/getFriendOnlines.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/getFriendOnlines.js +35 -0
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.d.ts +42 -0
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.js +27 -0
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.js +25 -0
- package/node_modules/zca-js/dist/apis/getFullAvatar.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getFullAvatar.js +25 -0
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.d.ts +23 -0
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.js +29 -0
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.js +36 -0
- package/node_modules/zca-js/dist/apis/getGroupInfo.d.ts +16 -0
- package/node_modules/zca-js/dist/apis/getGroupInfo.js +32 -0
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.d.ts +32 -0
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.js +38 -0
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.d.ts +38 -0
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.js +31 -0
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.js +25 -0
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.d.ts +34 -0
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.js +28 -0
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.d.ts +17 -0
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.js +24 -0
- package/node_modules/zca-js/dist/apis/getHiddenConversations.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/getHiddenConversations.js +23 -0
- package/node_modules/zca-js/dist/apis/getLabels.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/getLabels.js +28 -0
- package/node_modules/zca-js/dist/apis/getListBank.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getListBank.js +20 -0
- package/node_modules/zca-js/dist/apis/getListBankAccount.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/getListBankAccount.js +27 -0
- package/node_modules/zca-js/dist/apis/getListBoard.d.ts +21 -0
- package/node_modules/zca-js/dist/apis/getListBoard.js +45 -0
- package/node_modules/zca-js/dist/apis/getListDevice.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/getListDevice.js +22 -0
- package/node_modules/zca-js/dist/apis/getListReminder.d.ts +28 -0
- package/node_modules/zca-js/dist/apis/getListReminder.js +47 -0
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.js +39 -0
- package/node_modules/zca-js/dist/apis/getMute.d.ts +13 -0
- package/node_modules/zca-js/dist/apis/getMute.js +22 -0
- package/node_modules/zca-js/dist/apis/getOwnId.d.ts +1 -0
- package/node_modules/zca-js/dist/apis/getOwnId.js +4 -0
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.js +27 -0
- package/node_modules/zca-js/dist/apis/getPinConversations.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getPinConversations.js +22 -0
- package/node_modules/zca-js/dist/apis/getPollDetail.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getPollDetail.js +30 -0
- package/node_modules/zca-js/dist/apis/getProductCatalogList.d.ts +20 -0
- package/node_modules/zca-js/dist/apis/getProductCatalogList.js +33 -0
- package/node_modules/zca-js/dist/apis/getQR.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/getQR.js +29 -0
- package/node_modules/zca-js/dist/apis/getQuickMessageList.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/getQuickMessageList.js +24 -0
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.d.ts +6 -0
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.js +30 -0
- package/node_modules/zca-js/dist/apis/getReminder.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getReminder.js +25 -0
- package/node_modules/zca-js/dist/apis/getReminderResponses.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/getReminderResponses.js +24 -0
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.d.ts +18 -0
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.js +24 -0
- package/node_modules/zca-js/dist/apis/getSettings.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getSettings.js +20 -0
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.js +24 -0
- package/node_modules/zca-js/dist/apis/getStickers.d.ts +1 -0
- package/node_modules/zca-js/dist/apis/getStickers.js +40 -0
- package/node_modules/zca-js/dist/apis/getStickersDetail.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/getStickersDetail.js +40 -0
- package/node_modules/zca-js/dist/apis/getUnreadMark.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/getUnreadMark.js +30 -0
- package/node_modules/zca-js/dist/apis/getUserInfo.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/getUserInfo.js +44 -0
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.js +30 -0
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.js +25 -0
- package/node_modules/zca-js/dist/apis/joinGroupLink.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/joinGroupLink.js +27 -0
- package/node_modules/zca-js/dist/apis/keepAlive.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/keepAlive.js +22 -0
- package/node_modules/zca-js/dist/apis/lastOnline.d.ts +7 -0
- package/node_modules/zca-js/dist/apis/lastOnline.js +26 -0
- package/node_modules/zca-js/dist/apis/leaveGroup.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/leaveGroup.js +33 -0
- package/node_modules/zca-js/dist/apis/listen.d.ts +102 -0
- package/node_modules/zca-js/dist/apis/listen.js +425 -0
- package/node_modules/zca-js/dist/apis/lockPoll.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/lockPoll.js +28 -0
- package/node_modules/zca-js/dist/apis/login.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/login.js +96 -0
- package/node_modules/zca-js/dist/apis/loginQR.d.ts +71 -0
- package/node_modules/zca-js/dist/apis/loginQR.js +376 -0
- package/node_modules/zca-js/dist/apis/logoutV2.js +79 -0
- package/node_modules/zca-js/dist/apis/lostFocus.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/lostFocus.js +23 -0
- package/node_modules/zca-js/dist/apis/parseLink.d.ts +21 -0
- package/node_modules/zca-js/dist/apis/parseLink.js +27 -0
- package/node_modules/zca-js/dist/apis/pullMobileMsg.js +22 -0
- package/node_modules/zca-js/dist/apis/registerCatalog.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/registerCatalog.js +27 -0
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.js +27 -0
- package/node_modules/zca-js/dist/apis/removeFriend.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/removeFriend.js +28 -0
- package/node_modules/zca-js/dist/apis/removeFriendAlias.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/removeFriendAlias.js +24 -0
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.js +28 -0
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.js +30 -0
- package/node_modules/zca-js/dist/apis/removeQuickMessage.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/removeQuickMessage.js +27 -0
- package/node_modules/zca-js/dist/apis/removeReminder.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/removeReminder.js +40 -0
- package/node_modules/zca-js/dist/apis/removeUnreadMark.d.ts +8 -0
- package/node_modules/zca-js/dist/apis/removeUnreadMark.js +50 -0
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.js +34 -0
- package/node_modules/zca-js/dist/apis/requestSyncMessage.js +18 -0
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.js +20 -0
- package/node_modules/zca-js/dist/apis/reuseAvatar.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/reuseAvatar.js +26 -0
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.js +38 -0
- package/node_modules/zca-js/dist/apis/scanURL.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/scanURL.js +28 -0
- package/node_modules/zca-js/dist/apis/searchSticker.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/searchSticker.js +28 -0
- package/node_modules/zca-js/dist/apis/sendBankCard.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/sendBankCard.js +53 -0
- package/node_modules/zca-js/dist/apis/sendCard.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/sendCard.js +75 -0
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.d.ts +16 -0
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.js +55 -0
- package/node_modules/zca-js/dist/apis/sendFriendRequest.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/sendFriendRequest.js +39 -0
- package/node_modules/zca-js/dist/apis/sendLink.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/sendLink.js +78 -0
- package/node_modules/zca-js/dist/apis/sendMessage.d.ts +105 -0
- package/node_modules/zca-js/dist/apis/sendMessage.js +486 -0
- package/node_modules/zca-js/dist/apis/sendReport.d.ts +17 -0
- package/node_modules/zca-js/dist/apis/sendReport.js +53 -0
- package/node_modules/zca-js/dist/apis/sendSeenEvent.d.ts +16 -0
- package/node_modules/zca-js/dist/apis/sendSeenEvent.js +63 -0
- package/node_modules/zca-js/dist/apis/sendSticker.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/sendSticker.js +74 -0
- package/node_modules/zca-js/dist/apis/sendTypingEvent.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/sendTypingEvent.js +33 -0
- package/node_modules/zca-js/dist/apis/sendVideo.d.ts +35 -0
- package/node_modules/zca-js/dist/apis/sendVideo.js +134 -0
- package/node_modules/zca-js/dist/apis/sendVoice.d.ts +12 -0
- package/node_modules/zca-js/dist/apis/sendVoice.js +89 -0
- package/node_modules/zca-js/dist/apis/setHiddenConversations.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/setHiddenConversations.js +39 -0
- package/node_modules/zca-js/dist/apis/setMute.d.ts +20 -0
- package/node_modules/zca-js/dist/apis/setMute.js +67 -0
- package/node_modules/zca-js/dist/apis/setPinnedConversations.d.ts +3 -0
- package/node_modules/zca-js/dist/apis/setPinnedConversations.js +34 -0
- package/node_modules/zca-js/dist/apis/sharePoll.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/sharePoll.js +28 -0
- package/node_modules/zca-js/dist/apis/unblockUser.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/unblockUser.js +28 -0
- package/node_modules/zca-js/dist/apis/undo.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/undo.js +42 -0
- package/node_modules/zca-js/dist/apis/undoFriendRequest.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/undoFriendRequest.js +27 -0
- package/node_modules/zca-js/dist/apis/updateActiveStatus.d.ts +4 -0
- package/node_modules/zca-js/dist/apis/updateActiveStatus.js +27 -0
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.d.ts +10 -0
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.js +34 -0
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.js +40 -0
- package/node_modules/zca-js/dist/apis/updateAutoReply.d.ts +15 -0
- package/node_modules/zca-js/dist/apis/updateAutoReply.js +38 -0
- package/node_modules/zca-js/dist/apis/updateBankAccount.d.ts +9 -0
- package/node_modules/zca-js/dist/apis/updateBankAccount.js +31 -0
- package/node_modules/zca-js/dist/apis/updateCatalog.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/updateCatalog.js +30 -0
- package/node_modules/zca-js/dist/apis/updateGroupSettings.d.ts +40 -0
- package/node_modules/zca-js/dist/apis/updateGroupSettings.js +43 -0
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.js +30 -0
- package/node_modules/zca-js/dist/apis/updateLabels.d.ts +15 -0
- package/node_modules/zca-js/dist/apis/updateLabels.js +34 -0
- package/node_modules/zca-js/dist/apis/updateLang.d.ts +6 -0
- package/node_modules/zca-js/dist/apis/updateLang.js +30 -0
- package/node_modules/zca-js/dist/apis/updateProductCatalog.d.ts +25 -0
- package/node_modules/zca-js/dist/apis/updateProductCatalog.js +51 -0
- package/node_modules/zca-js/dist/apis/updateProfile.d.ts +20 -0
- package/node_modules/zca-js/dist/apis/updateProfile.js +43 -0
- package/node_modules/zca-js/dist/apis/updateProfileBio.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/updateProfileBio.js +27 -0
- package/node_modules/zca-js/dist/apis/updateQuickMessage.d.ts +11 -0
- package/node_modules/zca-js/dist/apis/updateQuickMessage.js +61 -0
- package/node_modules/zca-js/dist/apis/updateSettings.d.ts +16 -0
- package/node_modules/zca-js/dist/apis/updateSettings.js +90 -0
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.d.ts +2 -0
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.js +27 -0
- package/node_modules/zca-js/dist/apis/uploadAttachment.d.ts +50 -0
- package/node_modules/zca-js/dist/apis/uploadAttachment.js +197 -0
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.d.ts +14 -0
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.js +50 -0
- package/node_modules/zca-js/dist/apis/votePoll.d.ts +5 -0
- package/node_modules/zca-js/dist/apis/votePoll.js +29 -0
- package/node_modules/zca-js/dist/apis.d.ts +317 -0
- package/node_modules/zca-js/dist/apis.js +327 -0
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiError.cjs +11 -0
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +12 -0
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +12 -0
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +12 -0
- package/node_modules/zca-js/dist/cjs/apis/acceptFriendRequest.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/addGroupBlockedMember.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/addGroupDeputy.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/addPollOptions.cjs +31 -0
- package/node_modules/zca-js/dist/cjs/apis/addQuickMessage.cjs +65 -0
- package/node_modules/zca-js/dist/cjs/apis/addReaction.cjs +308 -0
- package/node_modules/zca-js/dist/cjs/apis/addUnreadMark.cjs +66 -0
- package/node_modules/zca-js/dist/cjs/apis/addUserToGroup.cjs +39 -0
- package/node_modules/zca-js/dist/cjs/apis/blockUser.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/blockViewFeed.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/changeAccountAvatar.cjs +57 -0
- package/node_modules/zca-js/dist/cjs/apis/changeFriendAlias.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/changeGroupAvatar.cjs +49 -0
- package/node_modules/zca-js/dist/cjs/apis/changeGroupName.cjs +37 -0
- package/node_modules/zca-js/dist/cjs/apis/changeGroupOwner.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/createAutoReply.cjs +42 -0
- package/node_modules/zca-js/dist/cjs/apis/createBankAccount.cjs +37 -0
- package/node_modules/zca-js/dist/cjs/apis/createCatalog.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/apis/createGroup.cjs +48 -0
- package/node_modules/zca-js/dist/cjs/apis/createNote.cjs +52 -0
- package/node_modules/zca-js/dist/cjs/apis/createPoll.cjs +45 -0
- package/node_modules/zca-js/dist/cjs/apis/createProductCatalog.cjs +55 -0
- package/node_modules/zca-js/dist/cjs/apis/createReminder.cjs +77 -0
- package/node_modules/zca-js/dist/cjs/apis/custom.cjs +19 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteAutoReply.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteAvatar.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteBankAccount.cjs +37 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteCatalog.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteChat.cjs +64 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteGroupInviteBox.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteMessage.cjs +66 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteProductCatalog.cjs +36 -0
- package/node_modules/zca-js/dist/cjs/apis/deleteSnapshotMobileMsg.cjs +22 -0
- package/node_modules/zca-js/dist/cjs/apis/disableGroupLink.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/disperseGroup.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/editNote.cjs +51 -0
- package/node_modules/zca-js/dist/cjs/apis/editReminder.cjs +75 -0
- package/node_modules/zca-js/dist/cjs/apis/enableGroupLink.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/fetchAccountInfo.cjs +15 -0
- package/node_modules/zca-js/dist/cjs/apis/findUser.cjs +56 -0
- package/node_modules/zca-js/dist/cjs/apis/findUserByUsername.cjs +41 -0
- package/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs +129 -0
- package/node_modules/zca-js/dist/cjs/apis/getAliasList.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/getAllFriends.cjs +48 -0
- package/node_modules/zca-js/dist/cjs/apis/getAllGroups.cjs +15 -0
- package/node_modules/zca-js/dist/cjs/apis/getArchivedChatList.cjs +28 -0
- package/node_modules/zca-js/dist/cjs/apis/getAutoDeleteChat.cjs +26 -0
- package/node_modules/zca-js/dist/cjs/apis/getAutoReplyList.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getAvatarList.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/getAvatarUrlProfile.cjs +44 -0
- package/node_modules/zca-js/dist/cjs/apis/getBizAccount.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/getCatalogList.cjs +37 -0
- package/node_modules/zca-js/dist/cjs/apis/getCloseFriends.cjs +25 -0
- package/node_modules/zca-js/dist/cjs/apis/getContext.cjs +9 -0
- package/node_modules/zca-js/dist/cjs/apis/getCookie.cjs +14 -0
- package/node_modules/zca-js/dist/cjs/apis/getCrossDB.cjs +22 -0
- package/node_modules/zca-js/dist/cjs/apis/getFriendBoardList.cjs +31 -0
- package/node_modules/zca-js/dist/cjs/apis/getFriendOnlines.cjs +40 -0
- package/node_modules/zca-js/dist/cjs/apis/getFriendRecommendations.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/getFriendRequestStatus.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/getFullAvatar.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupBlockedMember.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupChatHistory.cjs +51 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupInfo.cjs +37 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxInfo.cjs +43 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxList.cjs +36 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkDetail.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkInfo.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/getGroupMembersInfo.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getHiddenConversations.cjs +28 -0
- package/node_modules/zca-js/dist/cjs/apis/getLabels.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/getListBank.cjs +25 -0
- package/node_modules/zca-js/dist/cjs/apis/getListBankAccount.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/getListBoard.cjs +59 -0
- package/node_modules/zca-js/dist/cjs/apis/getListDevice.cjs +27 -0
- package/node_modules/zca-js/dist/cjs/apis/getListReminder.cjs +61 -0
- package/node_modules/zca-js/dist/cjs/apis/getMultiUsersByPhones.cjs +53 -0
- package/node_modules/zca-js/dist/cjs/apis/getMute.cjs +27 -0
- package/node_modules/zca-js/dist/cjs/apis/getOwnId.cjs +9 -0
- package/node_modules/zca-js/dist/cjs/apis/getPendingGroupMembers.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/getPinConversations.cjs +27 -0
- package/node_modules/zca-js/dist/cjs/apis/getPollDetail.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/getProductCatalogList.cjs +38 -0
- package/node_modules/zca-js/dist/cjs/apis/getQR.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/apis/getQuickMessageList.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getRelatedFriendGroup.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/getReminder.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/getReminderResponses.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getSentFriendRequest.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getSettings.cjs +25 -0
- package/node_modules/zca-js/dist/cjs/apis/getStickerCategoryDetail.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/getStickers.cjs +45 -0
- package/node_modules/zca-js/dist/cjs/apis/getStickersDetail.cjs +45 -0
- package/node_modules/zca-js/dist/cjs/apis/getUnreadMark.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/getUserInfo.cjs +58 -0
- package/node_modules/zca-js/dist/cjs/apis/inviteUserToGroups.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/joinGroupInviteBox.cjs +30 -0
- package/node_modules/zca-js/dist/cjs/apis/joinGroupLink.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/keepAlive.cjs +27 -0
- package/node_modules/zca-js/dist/cjs/apis/lastOnline.cjs +31 -0
- package/node_modules/zca-js/dist/cjs/apis/leaveGroup.cjs +38 -0
- package/node_modules/zca-js/dist/cjs/apis/listen.cjs +440 -0
- package/node_modules/zca-js/dist/cjs/apis/lockPoll.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/login.cjs +102 -0
- package/node_modules/zca-js/dist/cjs/apis/loginQR.cjs +368 -0
- package/node_modules/zca-js/dist/cjs/apis/logoutV2.cjs +83 -0
- package/node_modules/zca-js/dist/cjs/apis/lostFocus.cjs +28 -0
- package/node_modules/zca-js/dist/cjs/apis/parseLink.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/pullMobileMsg.cjs +26 -0
- package/node_modules/zca-js/dist/cjs/apis/registerCatalog.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/rejectFriendRequest.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/removeFriend.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/removeFriendAlias.cjs +29 -0
- package/node_modules/zca-js/dist/cjs/apis/removeGroupBlockedMember.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/removeGroupDeputy.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/removeQuickMessage.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/removeReminder.cjs +54 -0
- package/node_modules/zca-js/dist/cjs/apis/removeUnreadMark.cjs +64 -0
- package/node_modules/zca-js/dist/cjs/apis/removeUserFromGroup.cjs +39 -0
- package/node_modules/zca-js/dist/cjs/apis/requestSyncMessage.cjs +22 -0
- package/node_modules/zca-js/dist/cjs/apis/resetHiddenConversPin.cjs +25 -0
- package/node_modules/zca-js/dist/cjs/apis/reuseAvatar.cjs +31 -0
- package/node_modules/zca-js/dist/cjs/apis/reviewPendingMemberRequest.cjs +43 -0
- package/node_modules/zca-js/dist/cjs/apis/scanURL.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/searchSticker.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs +68 -0
- package/node_modules/zca-js/dist/cjs/apis/sendCard.cjs +89 -0
- package/node_modules/zca-js/dist/cjs/apis/sendDeliveredEvent.cjs +69 -0
- package/node_modules/zca-js/dist/cjs/apis/sendFriendRequest.cjs +44 -0
- package/node_modules/zca-js/dist/cjs/apis/sendLink.cjs +92 -0
- package/node_modules/zca-js/dist/cjs/apis/sendMessage.cjs +500 -0
- package/node_modules/zca-js/dist/cjs/apis/sendReport.cjs +67 -0
- package/node_modules/zca-js/dist/cjs/apis/sendSeenEvent.cjs +77 -0
- package/node_modules/zca-js/dist/cjs/apis/sendSticker.cjs +88 -0
- package/node_modules/zca-js/dist/cjs/apis/sendTypingEvent.cjs +47 -0
- package/node_modules/zca-js/dist/cjs/apis/sendVideo.cjs +148 -0
- package/node_modules/zca-js/dist/cjs/apis/sendVoice.cjs +103 -0
- package/node_modules/zca-js/dist/cjs/apis/setHiddenConversations.cjs +53 -0
- package/node_modules/zca-js/dist/cjs/apis/setMute.cjs +81 -0
- package/node_modules/zca-js/dist/cjs/apis/setPinnedConversations.cjs +48 -0
- package/node_modules/zca-js/dist/cjs/apis/sharePoll.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/unblockUser.cjs +33 -0
- package/node_modules/zca-js/dist/cjs/apis/undo.cjs +56 -0
- package/node_modules/zca-js/dist/cjs/apis/undoFriendRequest.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/updateActiveStatus.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/updateArchivedChatList.cjs +39 -0
- package/node_modules/zca-js/dist/cjs/apis/updateAutoDeleteChat.cjs +54 -0
- package/node_modules/zca-js/dist/cjs/apis/updateAutoReply.cjs +43 -0
- package/node_modules/zca-js/dist/cjs/apis/updateBankAccount.cjs +36 -0
- package/node_modules/zca-js/dist/cjs/apis/updateCatalog.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/updateGroupSettings.cjs +48 -0
- package/node_modules/zca-js/dist/cjs/apis/updateHiddenConversPin.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/updateLabels.cjs +39 -0
- package/node_modules/zca-js/dist/cjs/apis/updateLang.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/apis/updateProductCatalog.cjs +56 -0
- package/node_modules/zca-js/dist/cjs/apis/updateProfile.cjs +48 -0
- package/node_modules/zca-js/dist/cjs/apis/updateProfileBio.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/updateQuickMessage.cjs +66 -0
- package/node_modules/zca-js/dist/cjs/apis/updateSettings.cjs +95 -0
- package/node_modules/zca-js/dist/cjs/apis/upgradeGroupToCommunity.cjs +32 -0
- package/node_modules/zca-js/dist/cjs/apis/uploadAttachment.cjs +211 -0
- package/node_modules/zca-js/dist/cjs/apis/uploadProductPhoto.cjs +55 -0
- package/node_modules/zca-js/dist/cjs/apis/votePoll.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/apis.cjs +332 -0
- package/node_modules/zca-js/dist/cjs/context.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/index.cjs +159 -0
- package/node_modules/zca-js/dist/cjs/models/AutoReply.cjs +9 -0
- package/node_modules/zca-js/dist/cjs/models/Bank.cjs +263 -0
- package/node_modules/zca-js/dist/cjs/models/Board.cjs +8 -0
- package/node_modules/zca-js/dist/cjs/models/DeliveredMessage.cjs +23 -0
- package/node_modules/zca-js/dist/cjs/models/Enum.cjs +27 -0
- package/node_modules/zca-js/dist/cjs/models/FriendEvent.cjs +87 -0
- package/node_modules/zca-js/dist/cjs/models/Group.cjs +13 -0
- package/node_modules/zca-js/dist/cjs/models/GroupEvent.cjs +94 -0
- package/node_modules/zca-js/dist/cjs/models/Message.cjs +35 -0
- package/node_modules/zca-js/dist/cjs/models/Reaction.cjs +74 -0
- package/node_modules/zca-js/dist/cjs/models/Reminder.cjs +9 -0
- package/node_modules/zca-js/dist/cjs/models/SeenMessage.cjs +23 -0
- package/node_modules/zca-js/dist/cjs/models/Typing.cjs +23 -0
- package/node_modules/zca-js/dist/cjs/models/Undo.cjs +16 -0
- package/node_modules/zca-js/dist/cjs/models/ZBusiness.cjs +39 -0
- package/node_modules/zca-js/dist/cjs/update.cjs +34 -0
- package/node_modules/zca-js/dist/cjs/utils.cjs +703 -0
- package/node_modules/zca-js/dist/cjs/zalo.cjs +112 -0
- package/node_modules/zca-js/dist/context.d.ts +179 -0
- package/node_modules/zca-js/dist/context.js +28 -0
- package/node_modules/zca-js/dist/index.d.ts +166 -0
- package/node_modules/zca-js/dist/index.js +14 -0
- package/node_modules/zca-js/dist/models/Attachment.d.ts +9 -0
- package/node_modules/zca-js/dist/models/Attachment.js +1 -0
- package/node_modules/zca-js/dist/models/AutoReply.d.ts +20 -0
- package/node_modules/zca-js/dist/models/AutoReply.js +7 -0
- package/node_modules/zca-js/dist/models/Bank.d.ts +291 -0
- package/node_modules/zca-js/dist/models/Bank.js +262 -0
- package/node_modules/zca-js/dist/models/Board.d.ts +60 -0
- package/node_modules/zca-js/dist/models/Board.js +6 -0
- package/node_modules/zca-js/dist/models/Catalog.d.ts +16 -0
- package/node_modules/zca-js/dist/models/Catalog.js +1 -0
- package/node_modules/zca-js/dist/models/DeliveredMessage.d.ts +27 -0
- package/node_modules/zca-js/dist/models/DeliveredMessage.js +17 -0
- package/node_modules/zca-js/dist/models/Enum.d.ts +21 -0
- package/node_modules/zca-js/dist/models/Enum.js +25 -0
- package/node_modules/zca-js/dist/models/FriendEvent.d.ts +107 -0
- package/node_modules/zca-js/dist/models/FriendEvent.js +83 -0
- package/node_modules/zca-js/dist/models/Group.d.ts +125 -0
- package/node_modules/zca-js/dist/models/Group.js +11 -0
- package/node_modules/zca-js/dist/models/GroupEvent.d.ts +178 -0
- package/node_modules/zca-js/dist/models/GroupEvent.js +90 -0
- package/node_modules/zca-js/dist/models/Label.d.ts +10 -0
- package/node_modules/zca-js/dist/models/Label.js +1 -0
- package/node_modules/zca-js/dist/models/Message.d.ts +91 -0
- package/node_modules/zca-js/dist/models/Message.js +29 -0
- package/node_modules/zca-js/dist/models/ProductCatalog.d.ts +17 -0
- package/node_modules/zca-js/dist/models/ProductCatalog.js +1 -0
- package/node_modules/zca-js/dist/models/QuickMessage.d.ts +25 -0
- package/node_modules/zca-js/dist/models/QuickMessage.js +1 -0
- package/node_modules/zca-js/dist/models/Reaction.d.ts +85 -0
- package/node_modules/zca-js/dist/models/Reaction.js +70 -0
- package/node_modules/zca-js/dist/models/Reminder.d.ts +51 -0
- package/node_modules/zca-js/dist/models/Reminder.js +7 -0
- package/node_modules/zca-js/dist/models/SeenMessage.d.ts +26 -0
- package/node_modules/zca-js/dist/models/SeenMessage.js +17 -0
- package/node_modules/zca-js/dist/models/Sticker.d.ts +27 -0
- package/node_modules/zca-js/dist/models/Sticker.js +1 -0
- package/node_modules/zca-js/dist/models/Typing.d.ts +24 -0
- package/node_modules/zca-js/dist/models/Typing.js +17 -0
- package/node_modules/zca-js/dist/models/Undo.d.ts +34 -0
- package/node_modules/zca-js/dist/models/Undo.js +12 -0
- package/node_modules/zca-js/dist/models/User.d.ts +70 -0
- package/node_modules/zca-js/dist/models/User.js +1 -0
- package/node_modules/zca-js/dist/models/ZBusiness.d.ts +22 -0
- package/node_modules/zca-js/dist/models/ZBusiness.js +35 -0
- package/node_modules/zca-js/dist/models/index.d.ts +22 -0
- package/node_modules/zca-js/dist/models/index.js +22 -0
- package/node_modules/zca-js/dist/update.d.ts +2 -0
- package/node_modules/zca-js/dist/update.js +29 -0
- package/node_modules/zca-js/dist/utils.d.ts +167 -0
- package/node_modules/zca-js/dist/utils.js +719 -0
- package/node_modules/zca-js/dist/zalo.d.ts +41 -0
- package/node_modules/zca-js/dist/zalo.js +107 -0
- package/node_modules/zca-js/eslint.config.js +21 -0
- package/node_modules/zca-js/index.d.ts +2 -0
- package/node_modules/zca-js/package.json +78 -0
- package/node_modules/zca-js/rollup.config.js +28 -0
- package/package.json +79 -62
- package/patches/zca-js+2.2.0.patch +1677 -0
- package/src/cli.test.js +34 -5
- package/src/commands/account.js +98 -5
- package/src/commands/auto-reply.js +30 -10
- package/src/commands/catalog.js +5 -4
- package/src/commands/conv.js +551 -14
- package/src/commands/friend.js +19 -7
- package/src/commands/group.js +82 -31
- package/src/commands/listen.js +607 -65
- package/src/commands/login.js +179 -20
- package/src/commands/mcp.js +392 -41
- package/src/commands/msg.js +1278 -139
- package/src/commands/oa-listen.js +130 -20
- package/src/commands/oa.js +26 -5
- package/src/commands/poll.js +7 -2
- package/src/commands/profile.js +3 -2
- package/src/commands/sync.js +2052 -0
- package/src/core/accounts.js +69 -6
- package/src/core/cached-message.js +200 -0
- package/src/core/coverage.js +90 -0
- package/src/core/daemon-channel.js +638 -0
- package/src/core/daemon-sync.js +181 -0
- package/src/core/db.js +1610 -0
- package/src/core/forward.js +112 -0
- package/src/core/group-history.js +248 -0
- package/src/core/group-members.js +68 -0
- package/src/core/group-settings.js +250 -0
- package/src/core/history-fetch.js +208 -0
- package/src/core/listener-lifecycle.js +90 -0
- package/src/core/live-api.js +47 -0
- package/src/core/live-store.js +733 -0
- package/src/core/lock.js +129 -0
- package/src/core/logout.js +289 -0
- package/src/core/offline-queue.js +194 -0
- package/src/core/pin.js +222 -0
- package/src/core/read-state.js +318 -0
- package/src/core/receipts.js +679 -0
- package/src/core/recent-conversations.js +30 -0
- package/src/core/self-heal.js +522 -0
- package/src/core/socket-tap.js +154 -0
- package/src/core/sync-v2/assets.js +181 -0
- package/src/core/sync-v2/board.js +338 -0
- package/src/core/sync-v2/conv-state.js +152 -0
- package/src/core/sync-v2/gap-advice.js +110 -0
- package/src/core/sync-v2/gid.js +103 -0
- package/src/core/sync-v2/index.js +1208 -0
- package/src/core/sync-v2/keepalive.js +177 -0
- package/src/core/sync-v2/media.js +704 -0
- package/src/core/sync-v2/message-types.js +522 -0
- package/src/core/sync-v2/plan.js +95 -0
- package/src/core/sync-v2/reactions.js +236 -0
- package/src/core/sync-v2/renewlink.js +124 -0
- package/src/core/sync-v2/zcloud-cipher.js +88 -0
- package/src/core/sync-v2/zcloud.js +675 -0
- package/src/core/sync.js +540 -0
- package/src/core/zalo-client.js +179 -61
- package/src/core/zca-custom.js +78 -0
- package/src/index.js +14 -3
- package/src/mcp/mcp-config.js +40 -3
- package/src/mcp/mcp-http-transport.js +11 -2
- package/src/mcp/mcp-server.js +4 -2
- package/src/mcp/mcp-tools.js +837 -97
- package/src/mcp/message-buffer.js +38 -8
- package/src/mcp/message-buffer.test.js +67 -15
- package/src/mcp/notifier.js +17 -1
- package/src/mcp/notifier.test.js +6 -0
- package/src/utils/bank-helpers.js +8 -3
- package/src/utils/device-fingerprint.js +72 -0
- package/src/utils/mentions.js +140 -0
- package/src/utils/my-documents.js +95 -0
- package/src/utils/open-file.js +49 -0
- package/src/utils/output.js +75 -4
- package/src/utils/parse-options.js +56 -0
- package/src/utils/qr-http-server.js +44 -7
- package/src/utils/quote.js +203 -0
- package/src/utils/thread-type.js +72 -0
- package/src/utils/update-check.js +42 -1
- package/src/utils/urgency.js +29 -0
- package/src/mcp/media-downloader.js +0 -191
- package/src/mcp/media-downloader.test.js +0 -45
- package/src/utils/qr-display.test.js +0 -97
|
@@ -0,0 +1,733 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Persist live socket events — shared by `listen` and by a running mobile sync.
|
|
3
|
+
*
|
|
4
|
+
* Zalo Web does not freeze while a transfer sync runs: the same WebSocket keeps
|
|
5
|
+
* delivering new messages, reactions and recalls, and the app writes them to its
|
|
6
|
+
* local store alongside the batches arriving from the phone. Our sync used to
|
|
7
|
+
* subscribe only to cmd 601 and ignore everything else on that socket, so any
|
|
8
|
+
* message that landed during a run — and a full-history run takes many minutes —
|
|
9
|
+
* was simply lost, leaving a hole exactly where the sync was meant to guarantee
|
|
10
|
+
* completeness.
|
|
11
|
+
*
|
|
12
|
+
* Both paths now funnel through here, so a message stored during a sync is
|
|
13
|
+
* byte-for-byte the same row the listener would have written.
|
|
14
|
+
*/
|
|
15
|
+
import fs from "node:fs";
|
|
16
|
+
import {
|
|
17
|
+
insertMessage,
|
|
18
|
+
insertMessageIfAbsent,
|
|
19
|
+
getThreadDeleteMarker,
|
|
20
|
+
runInTransaction,
|
|
21
|
+
upsertThread,
|
|
22
|
+
upsertReaction,
|
|
23
|
+
markMessageRecalled,
|
|
24
|
+
markThreadGone,
|
|
25
|
+
markThreadBack,
|
|
26
|
+
setSyncState,
|
|
27
|
+
setMessageStatus,
|
|
28
|
+
findMessageByClientId,
|
|
29
|
+
hasSyncedGroupEventNear,
|
|
30
|
+
LIVE_GROUP_EVENT_PREFIX,
|
|
31
|
+
} from "./db.js";
|
|
32
|
+
import { classifyLiveMessage } from "./sync-v2/message-types.js";
|
|
33
|
+
|
|
34
|
+
/** zca-js ThreadType.User */
|
|
35
|
+
const THREAD_USER = 0;
|
|
36
|
+
|
|
37
|
+
/**
|
|
38
|
+
* What a live message can honestly tell us about its conversation's name.
|
|
39
|
+
*
|
|
40
|
+
* `dName` on a message is the SENDER's display name, not the conversation's
|
|
41
|
+
* title. The two only coincide in one case: a 1-1 message written by the
|
|
42
|
+
* contact the 1-1 is with, where the thread id IS that contact's id.
|
|
43
|
+
*
|
|
44
|
+
* A group has exactly one name and no message carries it, so a group message
|
|
45
|
+
* contributes nothing here -- it must come from `getGroupInfo` (the sync) or
|
|
46
|
+
* the MCP thread-name cache. Returning "" lets {@link upsertThread} keep
|
|
47
|
+
* whatever is already known instead of renaming the group after its sender.
|
|
48
|
+
*
|
|
49
|
+
* @param {object} msg - the zca-js message event
|
|
50
|
+
* @returns {string} a usable conversation name, or ""
|
|
51
|
+
*/
|
|
52
|
+
function nameFromLiveMessage(msg) {
|
|
53
|
+
if (msg?.type !== THREAD_USER) return "";
|
|
54
|
+
const from = msg?.data?.uidFrom;
|
|
55
|
+
if (from === undefined || from === null) return "";
|
|
56
|
+
// Our own outgoing 1-1 message carries OUR name, not the contact's.
|
|
57
|
+
if (String(from) !== String(msg.threadId)) return "";
|
|
58
|
+
return String(msg.data.dName || "");
|
|
59
|
+
}
|
|
60
|
+
|
|
61
|
+
/**
|
|
62
|
+
* Live msgTypes that are not messages at all but instructions to remove one.
|
|
63
|
+
*
|
|
64
|
+
* Zalo delivers the two kinds of removal on two different channels:
|
|
65
|
+
*
|
|
66
|
+
* "Thu hoi" (recall for everyone) -> the `undo` event, because its content
|
|
67
|
+
* is an OBJECT carrying `deleteMsg`.
|
|
68
|
+
* "Xoa o phia toi" (delete for me) -> an ordinary `message` event with
|
|
69
|
+
* msgType "chat.delete", because its
|
|
70
|
+
* content is an ARRAY, so zca-js's
|
|
71
|
+
* `deleteMsg` check cannot match it.
|
|
72
|
+
*
|
|
73
|
+
* The second one therefore arrives here, in the message path, and must never
|
|
74
|
+
* be stored as a message: it is keyed by its own notification id, so inserting
|
|
75
|
+
* it created a phantom row that exists nowhere in Zalo while the message it
|
|
76
|
+
* removes stayed fully readable.
|
|
77
|
+
*/
|
|
78
|
+
const REMOVAL_MSG_TYPES = new Set(["chat.delete", "chat.undo"]);
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* Is this `message` event actually an instruction to remove a message?
|
|
82
|
+
*
|
|
83
|
+
* Exported so a consumer can branch BEFORE rendering it: emitting a `message`
|
|
84
|
+
* webhook event for a deletion frame is the same category of mistake as
|
|
85
|
+
* storing one, and a receiver routing on `event` would act on a message that
|
|
86
|
+
* does not exist.
|
|
87
|
+
*
|
|
88
|
+
* @param {object} data - the event's `data` payload
|
|
89
|
+
* @returns {boolean}
|
|
90
|
+
*/
|
|
91
|
+
export function isRemovalMessage(data) {
|
|
92
|
+
return REMOVAL_MSG_TYPES.has(data?.msgType);
|
|
93
|
+
}
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* Delete a media file a removed message had already pulled down.
|
|
97
|
+
*
|
|
98
|
+
* The file only exists because we fetched it, and the phone strips every CDN
|
|
99
|
+
* reference from a removed message (its attachments survive as `kind: "meta"`
|
|
100
|
+
* with no url), so Zalo itself keeps no way to serve it again. Keeping our copy
|
|
101
|
+
* would mean holding the one thing the sender withdrew.
|
|
102
|
+
*
|
|
103
|
+
* @param {string|null} localPath
|
|
104
|
+
* @returns {boolean} true when a file was removed
|
|
105
|
+
*/
|
|
106
|
+
function dropMediaFile(localPath) {
|
|
107
|
+
if (!localPath) return false;
|
|
108
|
+
try {
|
|
109
|
+
fs.rmSync(localPath, { force: true });
|
|
110
|
+
return true;
|
|
111
|
+
} catch (e) {
|
|
112
|
+
console.error(`[live-store] could not remove media of a deleted message: ${e.message}`);
|
|
113
|
+
return false;
|
|
114
|
+
}
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* Apply a removal to the message it names, wherever the id came from.
|
|
119
|
+
*
|
|
120
|
+
* @param {object} target - {msgId} or {cliMsgId}; msgId wins when both are given
|
|
121
|
+
* @param {"recall"|"delete-for-me"} reason
|
|
122
|
+
* @param {number} at - epoch ms
|
|
123
|
+
* @returns {{stored: boolean, msgId?: string, reason?: string, mediaRemoved?: boolean}}
|
|
124
|
+
*/
|
|
125
|
+
function applyRemoval(target, reason, at) {
|
|
126
|
+
let msgId = target.msgId === undefined || target.msgId === null ? null : String(target.msgId);
|
|
127
|
+
// A zero globalMsgId means "not supplied", not "message zero".
|
|
128
|
+
if (msgId === "0" || msgId === "") msgId = null;
|
|
129
|
+
|
|
130
|
+
if (!msgId && target.cliMsgId) {
|
|
131
|
+
const row = findMessageByClientId(target.cliMsgId);
|
|
132
|
+
if (row) msgId = String(row.msgId);
|
|
133
|
+
}
|
|
134
|
+
if (!msgId) return { stored: false, reason: "removal names no message we hold" };
|
|
135
|
+
|
|
136
|
+
const res = markMessageRecalled(msgId, at, { reason });
|
|
137
|
+
if (!res.changes) {
|
|
138
|
+
// Not an error worth failing on: Zalo can name a message older than
|
|
139
|
+
// anything this cache ever saw.
|
|
140
|
+
return { stored: false, msgId, reason: `no cached message ${msgId}` };
|
|
141
|
+
}
|
|
142
|
+
return { stored: true, msgId, reason, mediaRemoved: dropMediaFile(res.localPath) };
|
|
143
|
+
}
|
|
144
|
+
|
|
145
|
+
/**
|
|
146
|
+
* Store one live message event.
|
|
147
|
+
*
|
|
148
|
+
* @param {object} msg - the zca-js message event (`{threadId, type, data, isSelf}`)
|
|
149
|
+
* @param {object} [opts]
|
|
150
|
+
* @param {string} [opts.threadName] - authoritative conversation name, when the
|
|
151
|
+
* caller has one (the MCP server's thread-name cache does). Supplying it
|
|
152
|
+
* replaces a weaker stored name; without it the write can only fill a blank.
|
|
153
|
+
* @param {(info: object, msg: object) => void} [opts.onStored] - called after a successful write
|
|
154
|
+
* @returns {{stored: boolean, info?: object, reason?: string}}
|
|
155
|
+
*/
|
|
156
|
+
export function storeLiveMessage(msg, opts = {}) {
|
|
157
|
+
const data = msg?.data;
|
|
158
|
+
if (!data || data.msgId === undefined || data.msgId === null) return { stored: false, reason: "no msgId" };
|
|
159
|
+
|
|
160
|
+
// A "delete for me" frame rides the message channel but is not a message.
|
|
161
|
+
if (REMOVAL_MSG_TYPES.has(data.msgType)) {
|
|
162
|
+
const removal = storeLiveDelete(msg);
|
|
163
|
+
return { stored: removal.stored, removal, info: null };
|
|
164
|
+
}
|
|
165
|
+
|
|
166
|
+
const info = classifyLiveMessage(data);
|
|
167
|
+
const authoritative = typeof opts.threadName === "string" && opts.threadName !== "";
|
|
168
|
+
const threadId = String(msg.threadId);
|
|
169
|
+
const timestamp = data.ts ? Number(data.ts) : Date.now();
|
|
170
|
+
try {
|
|
171
|
+
upsertThread({
|
|
172
|
+
threadId,
|
|
173
|
+
type: msg.type === THREAD_USER ? "dm" : "group",
|
|
174
|
+
name: authoritative ? opts.threadName : nameFromLiveMessage(msg),
|
|
175
|
+
lastUpdate: timestamp,
|
|
176
|
+
nameHint: !authoritative,
|
|
177
|
+
});
|
|
178
|
+
insertMessage({
|
|
179
|
+
msgId: String(data.msgId),
|
|
180
|
+
threadId,
|
|
181
|
+
senderId: String(data.uidFrom || ""),
|
|
182
|
+
senderName: String(data.dName || ""),
|
|
183
|
+
text: info.text || "",
|
|
184
|
+
timestamp,
|
|
185
|
+
type: info.type,
|
|
186
|
+
raw_data: info.raw,
|
|
187
|
+
has_attachment: info.hasAttachment,
|
|
188
|
+
// NOT data.status. The live `status` field is an undocumented
|
|
189
|
+
// enum (zca-js declares only `status: number`) and is not Sync2's
|
|
190
|
+
// MessageStatus, which this column holds: four of the owner's own
|
|
191
|
+
// successfully-sent messages arrived carrying 1, which that column
|
|
192
|
+
// defines as "failed". Delivery state comes from the mobile sync
|
|
193
|
+
// and from the delivered/seen receipt events instead.
|
|
194
|
+
});
|
|
195
|
+
} catch (e) {
|
|
196
|
+
return { stored: false, reason: e.message };
|
|
197
|
+
}
|
|
198
|
+
// A message is a sighting: the account is in this conversation. It clears
|
|
199
|
+
// a gone marker set before it -- a group rejoined, a deleted DM the contact
|
|
200
|
+
// wrote to again -- so prune-orphans stops treating the conversation as one
|
|
201
|
+
// the account no longer has. An older message (a backlog replay, a late
|
|
202
|
+
// delivery) leaves the marker alone.
|
|
203
|
+
try {
|
|
204
|
+
markThreadBack(threadId, timestamp);
|
|
205
|
+
} catch {
|
|
206
|
+
/* the row is stored; getOrphanThreads still sees it as newer than the marker */
|
|
207
|
+
}
|
|
208
|
+
if (typeof opts.onStored === "function") opts.onStored(info, msg);
|
|
209
|
+
return { stored: true, info };
|
|
210
|
+
}
|
|
211
|
+
|
|
212
|
+
/**
|
|
213
|
+
* Store one message a history fetch returned -- only if it is not stored yet.
|
|
214
|
+
*
|
|
215
|
+
* `msg history` reads Zalo's cloud-message store (groups) or scans the
|
|
216
|
+
* socket's old-message queue, and writes what it found through here. Zalo Web
|
|
217
|
+
* writes the history it fetches too -- into the same table as live messages,
|
|
218
|
+
* through the same writer -- but only rows it does not already hold, and
|
|
219
|
+
* never replacing one (findMsgsAddDb, then ZStorage.setMessage with
|
|
220
|
+
* replace:false). So a msgId already in zalo.db is left exactly as it is, and
|
|
221
|
+
* whatever the listener, the media downloader, a receipt or a recall put on
|
|
222
|
+
* it stays. That is the whole difference from {@link storeLiveMessage}, whose
|
|
223
|
+
* upsert replaces the text, type, raw_data (st/at/cmd included), timestamp
|
|
224
|
+
* and has_attachment.
|
|
225
|
+
*
|
|
226
|
+
* A new row gets the listener's normalization -- same classifier, same
|
|
227
|
+
* columns, same thread update -- with `raw_data.src` "history" where the
|
|
228
|
+
* listener writes "listen", as the phone restore writes "sync-v2". Zalo Web's
|
|
229
|
+
* other two guards are mirrored:
|
|
230
|
+
*
|
|
231
|
+
* - removal frames ("chat.delete", "chat.undo") and rows without content
|
|
232
|
+
* are never written, and a removal is never APPLIED from history:
|
|
233
|
+
* tombstones come from the listener and the sync;
|
|
234
|
+
* - nothing from before the conversation's delete marker comes back
|
|
235
|
+
* (threads.deleteMarkerAt, set by `conv delete` and by our own leave,
|
|
236
|
+
* removal or block -- and kept when the account comes back, unlike the
|
|
237
|
+
* gone marker, so a deleted DM's old messages stay deleted after the
|
|
238
|
+
* contact writes again).
|
|
239
|
+
*
|
|
240
|
+
* @param {object} msg - `{threadId, type, data}`, the listener's frame shape
|
|
241
|
+
* @param {object} [opts]
|
|
242
|
+
* @param {string} [opts.src="history"] - the provenance written to `raw_data.src`:
|
|
243
|
+
* "history" for `msg history`'s fetch, "offline" for the daemon's catch-up
|
|
244
|
+
* from Zalo's offline queue (./self-heal.js). The rule is the same for both.
|
|
245
|
+
* @returns {{stored: boolean, info?: object, reason?: string}} `stored` is true only for a new row
|
|
246
|
+
*/
|
|
247
|
+
export function storeHistoryMessage(msg, opts = {}) {
|
|
248
|
+
const data = msg?.data;
|
|
249
|
+
if (!data || data.msgId === undefined || data.msgId === null || data.msgId === "") {
|
|
250
|
+
return { stored: false, reason: "no msgId" };
|
|
251
|
+
}
|
|
252
|
+
if (REMOVAL_MSG_TYPES.has(data.msgType)) return { stored: false, reason: "a removal; history never applies one" };
|
|
253
|
+
if (!data.content) return { stored: false, reason: "no content" };
|
|
254
|
+
// A history row with no time would land at "now", the one place it
|
|
255
|
+
// certainly does not belong.
|
|
256
|
+
const timestamp = Number(data.ts);
|
|
257
|
+
if (!Number.isFinite(timestamp) || timestamp <= 0) return { stored: false, reason: "no timestamp" };
|
|
258
|
+
const threadId = String(msg.threadId);
|
|
259
|
+
|
|
260
|
+
try {
|
|
261
|
+
const cutoff = getThreadDeleteMarker(threadId);
|
|
262
|
+
if (cutoff !== null && timestamp <= cutoff) {
|
|
263
|
+
return { stored: false, reason: "from before the conversation's delete marker" };
|
|
264
|
+
}
|
|
265
|
+
const info = classifyLiveMessage(data);
|
|
266
|
+
const inserted = runInTransaction(() => {
|
|
267
|
+
const res = insertMessageIfAbsent({
|
|
268
|
+
msgId: String(data.msgId),
|
|
269
|
+
threadId,
|
|
270
|
+
senderId: String(data.uidFrom || ""),
|
|
271
|
+
senderName: String(data.dName || ""),
|
|
272
|
+
text: info.text || "",
|
|
273
|
+
timestamp,
|
|
274
|
+
type: info.type,
|
|
275
|
+
raw_data: { ...info.raw, src: opts.src || "history" },
|
|
276
|
+
has_attachment: info.hasAttachment,
|
|
277
|
+
});
|
|
278
|
+
if (!res.changes) return false;
|
|
279
|
+
// Only for a row actually written: a skipped one touches nothing.
|
|
280
|
+
upsertThread({
|
|
281
|
+
threadId,
|
|
282
|
+
type: msg.type === THREAD_USER ? "dm" : "group",
|
|
283
|
+
name: nameFromLiveMessage(msg),
|
|
284
|
+
lastUpdate: timestamp,
|
|
285
|
+
nameHint: true,
|
|
286
|
+
});
|
|
287
|
+
return true;
|
|
288
|
+
});
|
|
289
|
+
return inserted ? { stored: true, info } : { stored: false, reason: "already stored" };
|
|
290
|
+
} catch (e) {
|
|
291
|
+
return { stored: false, reason: e.message };
|
|
292
|
+
}
|
|
293
|
+
}
|
|
294
|
+
|
|
295
|
+
/**
|
|
296
|
+
* A reaction event's content, whichever form it arrives in.
|
|
297
|
+
*
|
|
298
|
+
* @param {object|string|undefined} content
|
|
299
|
+
* @returns {object}
|
|
300
|
+
*/
|
|
301
|
+
function parseContent(content) {
|
|
302
|
+
if (typeof content !== "string") return content || {};
|
|
303
|
+
try {
|
|
304
|
+
return JSON.parse(content) || {};
|
|
305
|
+
} catch {
|
|
306
|
+
return {};
|
|
307
|
+
}
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* Store one reaction.
|
|
312
|
+
*
|
|
313
|
+
* The Sync2 protobuf has no reaction field, so a transfer sync never restores
|
|
314
|
+
* one. That does not make them unrecoverable: Zalo serves the reaction backlog
|
|
315
|
+
* over the socket on cmd 610/611, which `sync-reactions` drains through this
|
|
316
|
+
* same writer.
|
|
317
|
+
*
|
|
318
|
+
* @param {object} reaction - the zca-js reaction event
|
|
319
|
+
* @returns {{stored: boolean, reason?: string}}
|
|
320
|
+
*/
|
|
321
|
+
/**
|
|
322
|
+
* Store one reaction event against the message it names.
|
|
323
|
+
*
|
|
324
|
+
* @param {object} reaction - a zca-js reaction (live, cmd 612) or a retrieved one (cmd 610/611)
|
|
325
|
+
* @param {{source?: string}} [opts] - where it came from, recorded on the row;
|
|
326
|
+
* the backlog drain passes "backlog" so a retrieved reaction is not
|
|
327
|
+
* indistinguishable from one seen live
|
|
328
|
+
* @returns {{stored: boolean, reason?: string, count?: number, changed?: number}}
|
|
329
|
+
*/
|
|
330
|
+
export function storeLiveReaction(reaction, opts = {}) {
|
|
331
|
+
const d = reaction?.data || {};
|
|
332
|
+
// zca-js parses `content` for a LIVE reaction (cmd 612) but hands it over
|
|
333
|
+
// as a raw JSON string for a retrieved one (cmd 610/611 -> old_reactions).
|
|
334
|
+
// Reading `.rMsg` off the string finds nothing and silently stores no
|
|
335
|
+
// reaction, so one writer has to accept both.
|
|
336
|
+
const c = parseContent(d.content);
|
|
337
|
+
const userId = d.uidFrom ?? reaction?.uidFrom;
|
|
338
|
+
if (userId === undefined || userId === null) return { stored: false, reason: "reaction names no user" };
|
|
339
|
+
|
|
340
|
+
// The reacted-to message is named inside content, in `rMsg`, exactly as the
|
|
341
|
+
// recall target is: `gMsgID` is the server id and `cMsgID` the client one.
|
|
342
|
+
// Reading the event's own top-level `msgId` stored the REACTION
|
|
343
|
+
// notification's id instead, so every reaction landed on a row that does
|
|
344
|
+
// not exist and getReactions({msgId}) for the real message found nothing.
|
|
345
|
+
// Measured on six live reactions: six rows under six notification ids,
|
|
346
|
+
// where the correct result is one row per (message, person, icon) -- Zalo
|
|
347
|
+
// accumulates, so three icons on one message are three reactions, all
|
|
348
|
+
// displayed.
|
|
349
|
+
const targets = Array.isArray(c.rMsg) ? c.rMsg : [];
|
|
350
|
+
if (!targets.length) return { stored: false, reason: "reaction names no message" };
|
|
351
|
+
|
|
352
|
+
const icon = c.rIcon ?? d.rIcon ?? d.icon ?? "";
|
|
353
|
+
// 0 is a real reaction type (HAHA), so it must not be coerced away -- and a
|
|
354
|
+
// missing type must not become 0, which `Number(null)` would make it.
|
|
355
|
+
const rTypeRaw = c.rType ?? d.rType;
|
|
356
|
+
const rType =
|
|
357
|
+
rTypeRaw === null || rTypeRaw === undefined || rTypeRaw === "" || !Number.isFinite(Number(rTypeRaw))
|
|
358
|
+
? null
|
|
359
|
+
: Number(rTypeRaw);
|
|
360
|
+
const ts = Number(d.ts) || Date.now();
|
|
361
|
+
|
|
362
|
+
// Report what actually CHANGED, not merely that we tried. Three bugs in
|
|
363
|
+
// this family hid behind a success flag that was set unconditionally: a
|
|
364
|
+
// removal that deleted nothing and an add that wrote to a non-existent id
|
|
365
|
+
// both looked identical to a working one in the logs.
|
|
366
|
+
let stored = 0;
|
|
367
|
+
let changed = 0;
|
|
368
|
+
const removing = !icon;
|
|
369
|
+
for (const t of targets) {
|
|
370
|
+
let msgId = t?.gMsgID === undefined || t?.gMsgID === null ? null : String(t.gMsgID);
|
|
371
|
+
if (msgId === "0" || msgId === "") msgId = null;
|
|
372
|
+
if (!msgId && t?.cMsgID) {
|
|
373
|
+
const row = findMessageByClientId(t.cMsgID);
|
|
374
|
+
if (row) msgId = String(row.msgId);
|
|
375
|
+
}
|
|
376
|
+
if (!msgId) continue;
|
|
377
|
+
try {
|
|
378
|
+
const res = upsertReaction({
|
|
379
|
+
msgId,
|
|
380
|
+
threadId: reaction?.threadId === undefined ? null : String(reaction.threadId),
|
|
381
|
+
userId: String(userId),
|
|
382
|
+
// An empty icon is how a removal is signalled; upsertReaction
|
|
383
|
+
// deletes rather than storing a blank.
|
|
384
|
+
icon,
|
|
385
|
+
rType,
|
|
386
|
+
timestamp: ts,
|
|
387
|
+
source: opts.source,
|
|
388
|
+
});
|
|
389
|
+
stored++;
|
|
390
|
+
changed += res?.changes ?? 0;
|
|
391
|
+
} catch (e) {
|
|
392
|
+
return { stored: false, reason: e.message };
|
|
393
|
+
}
|
|
394
|
+
}
|
|
395
|
+
if (!stored) return { stored: false, reason: "reaction target not resolvable" };
|
|
396
|
+
return { stored: true, count: stored, changed, removing, icon, msgIds: targets.map((t) => t?.gMsgID) };
|
|
397
|
+
}
|
|
398
|
+
|
|
399
|
+
/**
|
|
400
|
+
* Apply a recall to the message it withdraws.
|
|
401
|
+
*
|
|
402
|
+
* "Thu hồi" removes a message for everyone. Keeping its text readable in a
|
|
403
|
+
* local cache retains something the sender took back, so the row is marked
|
|
404
|
+
* rather than left intact — and rather than deleted, so the conversation still
|
|
405
|
+
* shows that something was said and when.
|
|
406
|
+
*
|
|
407
|
+
* @param {object} undo - the zca-js undo event
|
|
408
|
+
* @returns {{stored: boolean, msgId?: string, reason?: string}}
|
|
409
|
+
*/
|
|
410
|
+
export function storeLiveUndo(undo) {
|
|
411
|
+
const d = undo?.data || {};
|
|
412
|
+
// The recalled message is named INSIDE content. The event's own top-level
|
|
413
|
+
// msgId identifies the notification (zca-js models/Undo.d.ts: TUndo has no
|
|
414
|
+
// globalMsgId, TUndoContent does), so reading it from there tombstoned the
|
|
415
|
+
// notification's id -- a row that does not exist -- and every live recall
|
|
416
|
+
// silently updated nothing while reporting success.
|
|
417
|
+
const c = d.content || {};
|
|
418
|
+
try {
|
|
419
|
+
return applyRemoval({ msgId: c.globalMsgId, cliMsgId: c.cliMsgId }, "recall", Number(d.ts) || Date.now());
|
|
420
|
+
} catch (e) {
|
|
421
|
+
return { stored: false, reason: e.message };
|
|
422
|
+
}
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* Apply a "delete for me" (Xoa o phia toi) to the message it removes.
|
|
427
|
+
*
|
|
428
|
+
* Zalo names the target twice: `globalDelMsgId` when the deleting client knew
|
|
429
|
+
* the server id, and `clientDelMsgId` always. Both shapes were captured live
|
|
430
|
+
* (one frame carried globalDelMsgId 0 with only the client id, the next carried
|
|
431
|
+
* a real global id), so both have to be handled.
|
|
432
|
+
*
|
|
433
|
+
* The phone ships no flag distinguishing this from a recall -- every removal
|
|
434
|
+
* reaches the sync as msgType 36 -- so the distinction is recorded locally in
|
|
435
|
+
* the tombstone's `removedAs`.
|
|
436
|
+
*
|
|
437
|
+
* @param {object} msg - the zca-js message event with msgType "chat.delete"
|
|
438
|
+
* @returns {{stored: boolean, msgId?: string, reason?: string, mediaRemoved?: boolean}}
|
|
439
|
+
*/
|
|
440
|
+
export function storeLiveDelete(msg) {
|
|
441
|
+
const d = msg?.data || {};
|
|
442
|
+
const entry = Array.isArray(d.content) ? d.content[0] : d.content;
|
|
443
|
+
if (!entry || typeof entry !== "object") return { stored: false, reason: "delete frame carried no target" };
|
|
444
|
+
try {
|
|
445
|
+
return applyRemoval(
|
|
446
|
+
{ msgId: entry.globalDelMsgId, cliMsgId: entry.clientDelMsgId },
|
|
447
|
+
"delete-for-me",
|
|
448
|
+
Number(d.ts) || Date.now(),
|
|
449
|
+
);
|
|
450
|
+
} catch (e) {
|
|
451
|
+
return { stored: false, reason: e.message };
|
|
452
|
+
}
|
|
453
|
+
}
|
|
454
|
+
|
|
455
|
+
/**
|
|
456
|
+
* Subscribe a zca-js listener so live traffic keeps being stored.
|
|
457
|
+
*
|
|
458
|
+
* Used by the mobile sync, which holds the socket for minutes at a time and
|
|
459
|
+
* would otherwise drop everything arriving on it.
|
|
460
|
+
*
|
|
461
|
+
* @param {object} listener - `api.listener`
|
|
462
|
+
* @param {(what: string, detail: object) => void} [onEvent]
|
|
463
|
+
* @returns {() => void} detach
|
|
464
|
+
*/
|
|
465
|
+
export function attachLiveStore(listener, onEvent = () => {}) {
|
|
466
|
+
const onMessage = (msg) => {
|
|
467
|
+
const r = storeLiveMessage(msg);
|
|
468
|
+
if (r.stored) onEvent("message", { threadId: msg.threadId, type: r.info.type });
|
|
469
|
+
};
|
|
470
|
+
const onReaction = (re) => {
|
|
471
|
+
if (storeLiveReaction(re).stored) onEvent("reaction", { threadId: re?.threadId });
|
|
472
|
+
};
|
|
473
|
+
const onUndo = (u) => {
|
|
474
|
+
const r = storeLiveUndo(u);
|
|
475
|
+
if (r.stored) onEvent("undo", { msgId: r.msgId });
|
|
476
|
+
};
|
|
477
|
+
|
|
478
|
+
listener.on("message", onMessage);
|
|
479
|
+
listener.on("reaction", onReaction);
|
|
480
|
+
listener.on("undo", onUndo);
|
|
481
|
+
|
|
482
|
+
return () => {
|
|
483
|
+
for (const [ev, fn] of [
|
|
484
|
+
["message", onMessage],
|
|
485
|
+
["reaction", onReaction],
|
|
486
|
+
["undo", onUndo],
|
|
487
|
+
]) {
|
|
488
|
+
try {
|
|
489
|
+
listener.removeListener(ev, fn);
|
|
490
|
+
} catch {
|
|
491
|
+
/* an already-torn-down listener is fine */
|
|
492
|
+
}
|
|
493
|
+
}
|
|
494
|
+
};
|
|
495
|
+
}
|
|
496
|
+
|
|
497
|
+
/**
|
|
498
|
+
* Group events that can mean the conversation stopped being ours.
|
|
499
|
+
*
|
|
500
|
+
* zca-js has no distinct "dispersed" event -- a disperse surfaces as the
|
|
501
|
+
* members leaving -- so these are the signals available. Which member one is
|
|
502
|
+
* about is the whole question; see {@link departureOf}.
|
|
503
|
+
*/
|
|
504
|
+
const GONE_EVENTS = new Set(["leave", "remove_member", "block_member"]);
|
|
505
|
+
|
|
506
|
+
/**
|
|
507
|
+
* The server time a group event carries, or null.
|
|
508
|
+
*
|
|
509
|
+
* The same field storeGroupEventRow stamps the system line with, and on the
|
|
510
|
+
* clock message timestamps use -- so a message can be ordered against the
|
|
511
|
+
* departure it follows or precedes.
|
|
512
|
+
*
|
|
513
|
+
* @param {object} event
|
|
514
|
+
* @returns {number|null} epoch ms
|
|
515
|
+
*/
|
|
516
|
+
function groupEventTime(event) {
|
|
517
|
+
const d = event?.data || {};
|
|
518
|
+
const t = Number(d.time) || Number(d.ts);
|
|
519
|
+
return Number.isFinite(t) && t > 0 ? t : null;
|
|
520
|
+
}
|
|
521
|
+
|
|
522
|
+
/**
|
|
523
|
+
* Is this group event our own departure?
|
|
524
|
+
*
|
|
525
|
+
* zca-js sets `isSelf` when we are among the members the event is about OR
|
|
526
|
+
* when we are the one who did it (`sourceId`). For a leave those coincide. For
|
|
527
|
+
* a removal or block they do not: an admin removing someone else gets isSelf
|
|
528
|
+
* too, and reading that as our departure flagged the admin's own group gone,
|
|
529
|
+
* so `prune-orphans` deleted the media of a group they still run. Only
|
|
530
|
+
* `updateMembers` says who went, and reading it needs our own id.
|
|
531
|
+
*
|
|
532
|
+
* @param {object} event - the zca-js group event
|
|
533
|
+
* @param {string|undefined} ownId - the account's own uid
|
|
534
|
+
* @returns {"ours"|"not-ours"|"unknown"} unknown: a removal or block with
|
|
535
|
+
* isSelf set and no ownId to say whether we were removed or did the removing
|
|
536
|
+
*/
|
|
537
|
+
function departureOf(event, ownId) {
|
|
538
|
+
const type = String(event?.type || "").toLowerCase();
|
|
539
|
+
if (!GONE_EVENTS.has(type)) return "not-ours";
|
|
540
|
+
if (!event?.isSelf) return "not-ours";
|
|
541
|
+
if (type === "leave") return "ours";
|
|
542
|
+
if (!ownId) return "unknown";
|
|
543
|
+
const members = Array.isArray(event?.data?.updateMembers) ? event.data.updateMembers : [];
|
|
544
|
+
return members.some((m) => String(m?.id ?? m) === String(ownId)) ? "ours" : "not-ours";
|
|
545
|
+
}
|
|
546
|
+
|
|
547
|
+
/**
|
|
548
|
+
* Note a group event: mark the thread gone when it says we are out, and clear
|
|
549
|
+
* that mark when it shows we are back.
|
|
550
|
+
*
|
|
551
|
+
* Nothing is deleted here. Being removed from a group is not permission to
|
|
552
|
+
* destroy the local copy of it — the thread is flagged so it shows up as an
|
|
553
|
+
* orphan, and removing it stays an explicit decision (`conv forget`).
|
|
554
|
+
*
|
|
555
|
+
* Every other event about the group, dated after we left, is a sighting. Zalo
|
|
556
|
+
* pushes a group's events only to its members, so receiving one -- the join
|
|
557
|
+
* that re-added us, or whatever the listener sees first if it missed that --
|
|
558
|
+
* means the group is ours again, and `prune-orphans` must not delete its media.
|
|
559
|
+
* An event with no time of its own cannot be ordered against the departure
|
|
560
|
+
* and is not used.
|
|
561
|
+
*
|
|
562
|
+
* `listen` and `mcp start` must both pass `ownId`: without it a removal cannot
|
|
563
|
+
* be told from one we performed, and it is left alone rather than guessed.
|
|
564
|
+
*
|
|
565
|
+
* @param {object} event - the zca-js group event
|
|
566
|
+
* @param {{ownId?: string}} [opts]
|
|
567
|
+
* @returns {{gone: boolean, back: boolean, threadId?: string}}
|
|
568
|
+
*/
|
|
569
|
+
export function storeGroupEvent(event, opts = {}) {
|
|
570
|
+
const threadId = event?.threadId;
|
|
571
|
+
if (threadId === undefined || threadId === null) return { gone: false, back: false };
|
|
572
|
+
const id = String(threadId);
|
|
573
|
+
const departure = departureOf(event, opts.ownId);
|
|
574
|
+
const at = groupEventTime(event);
|
|
575
|
+
try {
|
|
576
|
+
if (departure === "ours") {
|
|
577
|
+
markThreadGone(id, at ?? Date.now());
|
|
578
|
+
return { gone: true, back: false, threadId: id };
|
|
579
|
+
}
|
|
580
|
+
if (departure === "not-ours" && at !== null && markThreadBack(id, at).changes) {
|
|
581
|
+
return { gone: false, back: true, threadId: id };
|
|
582
|
+
}
|
|
583
|
+
} catch {
|
|
584
|
+
return { gone: false, back: false };
|
|
585
|
+
}
|
|
586
|
+
return { gone: false, back: false };
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Group events that appear as a system line in the conversation.
|
|
591
|
+
*
|
|
592
|
+
* A mobile sync restores each of these as a `group_event` row (msgType 20),
|
|
593
|
+
* while the listener used to keep nothing but a board-stale flag or a leftAt
|
|
594
|
+
* marker -- so a live cache was poorer than a synced one by every rename,
|
|
595
|
+
* join, leave and pin. Measured live: a rename arrives as `update`; the sync
|
|
596
|
+
* side of the same events was confirmed for renames and for unpinned notes.
|
|
597
|
+
*
|
|
598
|
+
* Polls and reminders are deliberately absent: those arrive live as their own
|
|
599
|
+
* message frames (group.poll, chat.ecard), so a row here would write them twice.
|
|
600
|
+
*/
|
|
601
|
+
const SYSTEM_LINE_EVENTS = new Set([
|
|
602
|
+
"join",
|
|
603
|
+
"leave",
|
|
604
|
+
"remove_member",
|
|
605
|
+
"block_member",
|
|
606
|
+
"add_admin",
|
|
607
|
+
"remove_admin",
|
|
608
|
+
"update",
|
|
609
|
+
"update_setting",
|
|
610
|
+
"update_avatar",
|
|
611
|
+
"new_link",
|
|
612
|
+
"new_pin_topic",
|
|
613
|
+
"update_pin_topic",
|
|
614
|
+
"unpin_topic",
|
|
615
|
+
]);
|
|
616
|
+
|
|
617
|
+
/**
|
|
618
|
+
* Store a live group event as the `group_event` row a sync would store.
|
|
619
|
+
*
|
|
620
|
+
* Written under a `ge:` id, because the event carries no message id (see
|
|
621
|
+
* LIVE_GROUP_EVENT_PREFIX); a later sync of the same event replaces this row
|
|
622
|
+
* with its own. The whole event payload is kept in raw_data, so nothing the
|
|
623
|
+
* socket delivered is thrown away.
|
|
624
|
+
*
|
|
625
|
+
* @param {object} event - the zca-js group event
|
|
626
|
+
* @returns {{stored: boolean, msgId?: string, reason?: string}}
|
|
627
|
+
*/
|
|
628
|
+
export function storeGroupEventRow(event) {
|
|
629
|
+
const type = String(event?.type || "").toLowerCase();
|
|
630
|
+
if (!SYSTEM_LINE_EVENTS.has(type)) return { stored: false, reason: "not a system-line event" };
|
|
631
|
+
const threadId = event?.threadId;
|
|
632
|
+
if (threadId === undefined || threadId === null) return { stored: false, reason: "no thread" };
|
|
633
|
+
const d = event?.data || {};
|
|
634
|
+
const ts = Number(d.time) || Number(d.ts) || Date.now();
|
|
635
|
+
try {
|
|
636
|
+
// A sync that ran after the event already holds the richer row.
|
|
637
|
+
if (hasSyncedGroupEventNear(String(threadId), ts)) return { stored: false, reason: "already synced" };
|
|
638
|
+
const msgId = `${LIVE_GROUP_EVENT_PREFIX}${threadId}:${ts}:${type}`;
|
|
639
|
+
upsertThread({ threadId: String(threadId), type: "group", name: "", lastUpdate: ts, nameHint: true });
|
|
640
|
+
insertMessage({
|
|
641
|
+
msgId,
|
|
642
|
+
threadId: String(threadId),
|
|
643
|
+
senderId: String(d.sourceId || d.actorId || d.creatorId || ""),
|
|
644
|
+
senderName: "",
|
|
645
|
+
// The sync's text is the phone's localized sentence, which the event
|
|
646
|
+
// does not carry. Say what happened rather than invent the wording.
|
|
647
|
+
text: type === "update" && d.groupName ? `[group_event update: ${d.groupName}]` : `[group_event ${type}]`,
|
|
648
|
+
timestamp: ts,
|
|
649
|
+
type: "group_event",
|
|
650
|
+
raw_data: {
|
|
651
|
+
src: "listen",
|
|
652
|
+
msgType: `group.${type}`,
|
|
653
|
+
groupEvent: { type, isSelf: Boolean(event.isSelf), data: d },
|
|
654
|
+
},
|
|
655
|
+
has_attachment: false,
|
|
656
|
+
});
|
|
657
|
+
return { stored: true, msgId };
|
|
658
|
+
} catch (e) {
|
|
659
|
+
return { stored: false, reason: e.message };
|
|
660
|
+
}
|
|
661
|
+
}
|
|
662
|
+
|
|
663
|
+
/**
|
|
664
|
+
* Group events that change a board: notes, pinned messages, polls, reminders.
|
|
665
|
+
*
|
|
666
|
+
* These carry only a delta, and applying one correctly means knowing the board
|
|
667
|
+
* item's full current shape — which the event does not supply. Rather than
|
|
668
|
+
* guess and write a half-populated row, the thread is flagged as having a stale
|
|
669
|
+
* board so the next `sync-boards` refetches it authoritatively. Recording the
|
|
670
|
+
* need is cheap; inventing the data is not.
|
|
671
|
+
*/
|
|
672
|
+
const BOARD_EVENTS = new Set([
|
|
673
|
+
"new_pin_topic",
|
|
674
|
+
"update_pin_topic",
|
|
675
|
+
"reorder_pin_topic",
|
|
676
|
+
"unpin_topic",
|
|
677
|
+
"update_board",
|
|
678
|
+
"remove_board",
|
|
679
|
+
"update_topic",
|
|
680
|
+
"remove_topic",
|
|
681
|
+
"remind_topic",
|
|
682
|
+
"accept_remind",
|
|
683
|
+
"reject_remind",
|
|
684
|
+
]);
|
|
685
|
+
|
|
686
|
+
/**
|
|
687
|
+
* Note that a conversation's board changed.
|
|
688
|
+
*
|
|
689
|
+
* @param {object} event - the zca-js group event
|
|
690
|
+
* @returns {{stale: boolean, threadId?: string}}
|
|
691
|
+
*/
|
|
692
|
+
export function noteBoardChange(event) {
|
|
693
|
+
const type = String(event?.type || "").toLowerCase();
|
|
694
|
+
if (!BOARD_EVENTS.has(type)) return { stale: false };
|
|
695
|
+
const threadId = event?.threadId;
|
|
696
|
+
if (threadId === undefined || threadId === null) return { stale: false };
|
|
697
|
+
try {
|
|
698
|
+
// A key per thread, so `sync-boards` can refresh only what moved rather
|
|
699
|
+
// than walking every conversation again.
|
|
700
|
+
setSyncState(`boardStale:${threadId}`, String(Date.now()));
|
|
701
|
+
} catch {
|
|
702
|
+
return { stale: false };
|
|
703
|
+
}
|
|
704
|
+
return { stale: true, threadId: String(threadId) };
|
|
705
|
+
}
|
|
706
|
+
|
|
707
|
+
/**
|
|
708
|
+
* Apply a seen/delivered receipt to the messages it covers.
|
|
709
|
+
*
|
|
710
|
+
* The mobile sync carries msgStatus per message, so a restore establishes
|
|
711
|
+
* delivery state — but it then goes stale, because nothing was tracking the
|
|
712
|
+
* receipts that arrive afterwards. These events are the live half of the same
|
|
713
|
+
* field, not UI noise.
|
|
714
|
+
*
|
|
715
|
+
* @param {Array<object>|object} payload - zca-js seen/delivered event
|
|
716
|
+
* @param {number} status - Sync2 MessageStatus (4 received, 5 seen)
|
|
717
|
+
* @returns {{updated: number}}
|
|
718
|
+
*/
|
|
719
|
+
export function storeReceipts(payload, status) {
|
|
720
|
+
const list = Array.isArray(payload) ? payload : payload ? [payload] : [];
|
|
721
|
+
let updated = 0;
|
|
722
|
+
for (const entry of list) {
|
|
723
|
+
const d = entry?.data || entry || {};
|
|
724
|
+
const msgId = d.msgId ?? d.globalMsgId;
|
|
725
|
+
if (msgId === undefined || msgId === null) continue;
|
|
726
|
+
try {
|
|
727
|
+
updated += setMessageStatus(String(msgId), status).changes || 0;
|
|
728
|
+
} catch {
|
|
729
|
+
/* one bad receipt must not stop the rest */
|
|
730
|
+
}
|
|
731
|
+
}
|
|
732
|
+
return { updated };
|
|
733
|
+
}
|