@ardennguyen/zalo-agent-cli 1.0.7 → 2.1.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/LICENSE +456 -21
- package/NOTICE +127 -0
- package/README.md +169 -70
- 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 +80 -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 +624 -68
- package/src/commands/login.js +179 -20
- package/src/commands/mcp.js +422 -44
- package/src/commands/msg.js +1288 -140
- 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/current-user-names.js +104 -0
- package/src/core/daemon-account.js +61 -0
- package/src/core/daemon-channel.js +638 -0
- package/src/core/daemon-sync.js +181 -0
- package/src/core/db.js +1625 -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 +106 -0
- package/src/core/sync-v2/index.js +1259 -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/senders.js +61 -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 +15 -3
- package/src/mcp/mcp-config.js +40 -3
- package/src/mcp/mcp-http-transport.js +12 -2
- package/src/mcp/mcp-server.js +5 -2
- package/src/mcp/mcp-tools.js +969 -99
- 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/mcp/sync-jobs.js +82 -0
- package/src/mcp/thread-name-cache.js +14 -1
- package/src/mcp/thread-name-cache.test.js +4 -1
- 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,1000 @@
|
|
|
1
|
+
"use strict";
|
|
2
|
+
var __createBinding = (this && this.__createBinding) || (Object.create ? (function(o, m, k, k2) {
|
|
3
|
+
if (k2 === undefined) k2 = k;
|
|
4
|
+
var desc = Object.getOwnPropertyDescriptor(m, k);
|
|
5
|
+
if (!desc || ("get" in desc ? !m.__esModule : desc.writable || desc.configurable)) {
|
|
6
|
+
desc = { enumerable: true, get: function() { return m[k]; } };
|
|
7
|
+
}
|
|
8
|
+
Object.defineProperty(o, k2, desc);
|
|
9
|
+
}) : (function(o, m, k, k2) {
|
|
10
|
+
if (k2 === undefined) k2 = k;
|
|
11
|
+
o[k2] = m[k];
|
|
12
|
+
}));
|
|
13
|
+
var __setModuleDefault = (this && this.__setModuleDefault) || (Object.create ? (function(o, v) {
|
|
14
|
+
Object.defineProperty(o, "default", { enumerable: true, value: v });
|
|
15
|
+
}) : function(o, v) {
|
|
16
|
+
o["default"] = v;
|
|
17
|
+
});
|
|
18
|
+
var __importStar = (this && this.__importStar) || function (mod) {
|
|
19
|
+
if (mod && mod.__esModule) return mod;
|
|
20
|
+
var result = {};
|
|
21
|
+
if (mod != null) for (var k in mod) if (k !== "default" && Object.prototype.hasOwnProperty.call(mod, k)) __createBinding(result, mod, k);
|
|
22
|
+
__setModuleDefault(result, mod);
|
|
23
|
+
return result;
|
|
24
|
+
};
|
|
25
|
+
Object.defineProperty(exports, "__esModule", { value: true });
|
|
26
|
+
exports.CookieJar = void 0;
|
|
27
|
+
const getPublicSuffix_1 = require("../getPublicSuffix");
|
|
28
|
+
const validators = __importStar(require("../validators"));
|
|
29
|
+
const validators_1 = require("../validators");
|
|
30
|
+
const store_1 = require("../store");
|
|
31
|
+
const memstore_1 = require("../memstore");
|
|
32
|
+
const pathMatch_1 = require("../pathMatch");
|
|
33
|
+
const cookie_1 = require("./cookie");
|
|
34
|
+
const utils_1 = require("../utils");
|
|
35
|
+
const canonicalDomain_1 = require("./canonicalDomain");
|
|
36
|
+
const constants_1 = require("./constants");
|
|
37
|
+
const defaultPath_1 = require("./defaultPath");
|
|
38
|
+
const domainMatch_1 = require("./domainMatch");
|
|
39
|
+
const cookieCompare_1 = require("./cookieCompare");
|
|
40
|
+
const version_1 = require("../version");
|
|
41
|
+
const defaultSetCookieOptions = {
|
|
42
|
+
loose: false,
|
|
43
|
+
sameSiteContext: undefined,
|
|
44
|
+
ignoreError: false,
|
|
45
|
+
http: true,
|
|
46
|
+
};
|
|
47
|
+
const defaultGetCookieOptions = {
|
|
48
|
+
http: true,
|
|
49
|
+
expire: true,
|
|
50
|
+
allPaths: false,
|
|
51
|
+
sameSiteContext: undefined,
|
|
52
|
+
sort: undefined,
|
|
53
|
+
};
|
|
54
|
+
const SAME_SITE_CONTEXT_VAL_ERR = 'Invalid sameSiteContext option for getCookies(); expected one of "strict", "lax", or "none"';
|
|
55
|
+
function getCookieContext(url) {
|
|
56
|
+
if (url &&
|
|
57
|
+
typeof url === 'object' &&
|
|
58
|
+
'hostname' in url &&
|
|
59
|
+
typeof url.hostname === 'string' &&
|
|
60
|
+
'pathname' in url &&
|
|
61
|
+
typeof url.pathname === 'string' &&
|
|
62
|
+
'protocol' in url &&
|
|
63
|
+
typeof url.protocol === 'string') {
|
|
64
|
+
return {
|
|
65
|
+
hostname: url.hostname,
|
|
66
|
+
pathname: url.pathname,
|
|
67
|
+
protocol: url.protocol,
|
|
68
|
+
};
|
|
69
|
+
}
|
|
70
|
+
else if (typeof url === 'string') {
|
|
71
|
+
try {
|
|
72
|
+
return new URL(decodeURI(url));
|
|
73
|
+
}
|
|
74
|
+
catch {
|
|
75
|
+
return new URL(url);
|
|
76
|
+
}
|
|
77
|
+
}
|
|
78
|
+
else {
|
|
79
|
+
throw new validators_1.ParameterError('`url` argument is not a string or URL.');
|
|
80
|
+
}
|
|
81
|
+
}
|
|
82
|
+
function checkSameSiteContext(value) {
|
|
83
|
+
const context = String(value).toLowerCase();
|
|
84
|
+
if (context === 'none' || context === 'lax' || context === 'strict') {
|
|
85
|
+
return context;
|
|
86
|
+
}
|
|
87
|
+
else {
|
|
88
|
+
return undefined;
|
|
89
|
+
}
|
|
90
|
+
}
|
|
91
|
+
/**
|
|
92
|
+
* If the cookie-name begins with a case-sensitive match for the
|
|
93
|
+
* string "__Secure-", abort these steps and ignore the cookie
|
|
94
|
+
* entirely unless the cookie's secure-only-flag is true.
|
|
95
|
+
* @param cookie
|
|
96
|
+
* @returns boolean
|
|
97
|
+
*/
|
|
98
|
+
function isSecurePrefixConditionMet(cookie) {
|
|
99
|
+
const startsWithSecurePrefix = typeof cookie.key === 'string' && cookie.key.startsWith('__Secure-');
|
|
100
|
+
return !startsWithSecurePrefix || cookie.secure;
|
|
101
|
+
}
|
|
102
|
+
/**
|
|
103
|
+
* If the cookie-name begins with a case-sensitive match for the
|
|
104
|
+
* string "__Host-", abort these steps and ignore the cookie
|
|
105
|
+
* entirely unless the cookie meets all the following criteria:
|
|
106
|
+
* 1. The cookie's secure-only-flag is true.
|
|
107
|
+
* 2. The cookie's host-only-flag is true.
|
|
108
|
+
* 3. The cookie-attribute-list contains an attribute with an
|
|
109
|
+
* attribute-name of "Path", and the cookie's path is "/".
|
|
110
|
+
* @param cookie
|
|
111
|
+
* @returns boolean
|
|
112
|
+
*/
|
|
113
|
+
function isHostPrefixConditionMet(cookie) {
|
|
114
|
+
const startsWithHostPrefix = typeof cookie.key === 'string' && cookie.key.startsWith('__Host-');
|
|
115
|
+
return (!startsWithHostPrefix ||
|
|
116
|
+
Boolean(cookie.secure &&
|
|
117
|
+
cookie.hostOnly &&
|
|
118
|
+
cookie.path != null &&
|
|
119
|
+
cookie.path === '/'));
|
|
120
|
+
}
|
|
121
|
+
function getNormalizedPrefixSecurity(prefixSecurity) {
|
|
122
|
+
const normalizedPrefixSecurity = prefixSecurity.toLowerCase();
|
|
123
|
+
/* The three supported options */
|
|
124
|
+
switch (normalizedPrefixSecurity) {
|
|
125
|
+
case constants_1.PrefixSecurityEnum.STRICT:
|
|
126
|
+
case constants_1.PrefixSecurityEnum.SILENT:
|
|
127
|
+
case constants_1.PrefixSecurityEnum.DISABLED:
|
|
128
|
+
return normalizedPrefixSecurity;
|
|
129
|
+
default:
|
|
130
|
+
return constants_1.PrefixSecurityEnum.SILENT;
|
|
131
|
+
}
|
|
132
|
+
}
|
|
133
|
+
/**
|
|
134
|
+
* A CookieJar is for storage and retrieval of {@link Cookie} objects as defined in
|
|
135
|
+
* {@link https://www.rfc-editor.org/rfc/rfc6265.html#section-5.3 | RFC6265 - Section 5.3}.
|
|
136
|
+
*
|
|
137
|
+
* It also supports a pluggable persistence layer via {@link Store}.
|
|
138
|
+
* @public
|
|
139
|
+
*/
|
|
140
|
+
class CookieJar {
|
|
141
|
+
/**
|
|
142
|
+
* Creates a new `CookieJar` instance.
|
|
143
|
+
*
|
|
144
|
+
* @remarks
|
|
145
|
+
* - If a custom store is not passed to the constructor, an in-memory store ({@link MemoryCookieStore} will be created and used.
|
|
146
|
+
* - If a boolean value is passed as the `options` parameter, this is equivalent to passing `{ rejectPublicSuffixes: <value> }`
|
|
147
|
+
*
|
|
148
|
+
* @param store - a custom {@link Store} implementation (defaults to {@link MemoryCookieStore})
|
|
149
|
+
* @param options - configures how cookies are processed by the cookie jar
|
|
150
|
+
*/
|
|
151
|
+
constructor(store, options) {
|
|
152
|
+
if (typeof options === 'boolean') {
|
|
153
|
+
options = { rejectPublicSuffixes: options };
|
|
154
|
+
}
|
|
155
|
+
this.rejectPublicSuffixes = options?.rejectPublicSuffixes ?? true;
|
|
156
|
+
this.enableLooseMode = options?.looseMode ?? false;
|
|
157
|
+
this.allowSpecialUseDomain = options?.allowSpecialUseDomain ?? true;
|
|
158
|
+
this.prefixSecurity = getNormalizedPrefixSecurity(options?.prefixSecurity ?? 'silent');
|
|
159
|
+
this.store = store ?? new memstore_1.MemoryCookieStore();
|
|
160
|
+
}
|
|
161
|
+
callSync(fn) {
|
|
162
|
+
if (!this.store.synchronous) {
|
|
163
|
+
throw new Error('CookieJar store is not synchronous; use async API instead.');
|
|
164
|
+
}
|
|
165
|
+
let syncErr = null;
|
|
166
|
+
let syncResult = undefined;
|
|
167
|
+
try {
|
|
168
|
+
fn.call(this, (error, result) => {
|
|
169
|
+
syncErr = error;
|
|
170
|
+
syncResult = result;
|
|
171
|
+
});
|
|
172
|
+
}
|
|
173
|
+
catch (err) {
|
|
174
|
+
syncErr = err;
|
|
175
|
+
}
|
|
176
|
+
if (syncErr)
|
|
177
|
+
throw syncErr;
|
|
178
|
+
return syncResult;
|
|
179
|
+
}
|
|
180
|
+
/**
|
|
181
|
+
* @internal No doc because this is the overload implementation
|
|
182
|
+
*/
|
|
183
|
+
setCookie(cookie, url, options, callback) {
|
|
184
|
+
if (typeof options === 'function') {
|
|
185
|
+
callback = options;
|
|
186
|
+
options = undefined;
|
|
187
|
+
}
|
|
188
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
189
|
+
const cb = promiseCallback.callback;
|
|
190
|
+
let context;
|
|
191
|
+
try {
|
|
192
|
+
if (typeof url === 'string') {
|
|
193
|
+
validators.validate(validators.isNonEmptyString(url), callback, (0, utils_1.safeToString)(options));
|
|
194
|
+
}
|
|
195
|
+
context = getCookieContext(url);
|
|
196
|
+
if (typeof url === 'function') {
|
|
197
|
+
return promiseCallback.reject(new Error('No URL was specified'));
|
|
198
|
+
}
|
|
199
|
+
if (typeof options === 'function') {
|
|
200
|
+
options = defaultSetCookieOptions;
|
|
201
|
+
}
|
|
202
|
+
validators.validate(typeof cb === 'function', cb);
|
|
203
|
+
if (!validators.isNonEmptyString(cookie) &&
|
|
204
|
+
!validators.isObject(cookie) &&
|
|
205
|
+
cookie instanceof String &&
|
|
206
|
+
cookie.length == 0) {
|
|
207
|
+
return promiseCallback.resolve(undefined);
|
|
208
|
+
}
|
|
209
|
+
}
|
|
210
|
+
catch (err) {
|
|
211
|
+
return promiseCallback.reject(err);
|
|
212
|
+
}
|
|
213
|
+
const host = (0, canonicalDomain_1.canonicalDomain)(context.hostname) ?? null;
|
|
214
|
+
const loose = options?.loose || this.enableLooseMode;
|
|
215
|
+
let sameSiteContext = null;
|
|
216
|
+
if (options?.sameSiteContext) {
|
|
217
|
+
sameSiteContext = checkSameSiteContext(options.sameSiteContext);
|
|
218
|
+
if (!sameSiteContext) {
|
|
219
|
+
return promiseCallback.reject(new Error(SAME_SITE_CONTEXT_VAL_ERR));
|
|
220
|
+
}
|
|
221
|
+
}
|
|
222
|
+
// S5.3 step 1
|
|
223
|
+
if (typeof cookie === 'string' || cookie instanceof String) {
|
|
224
|
+
const parsedCookie = cookie_1.Cookie.parse(cookie.toString(), { loose: loose });
|
|
225
|
+
if (!parsedCookie) {
|
|
226
|
+
const err = new Error('Cookie failed to parse');
|
|
227
|
+
return options?.ignoreError
|
|
228
|
+
? promiseCallback.resolve(undefined)
|
|
229
|
+
: promiseCallback.reject(err);
|
|
230
|
+
}
|
|
231
|
+
cookie = parsedCookie;
|
|
232
|
+
}
|
|
233
|
+
else if (!(cookie instanceof cookie_1.Cookie)) {
|
|
234
|
+
// If you're seeing this error, and are passing in a Cookie object,
|
|
235
|
+
// it *might* be a Cookie object from another loaded version of tough-cookie.
|
|
236
|
+
const err = new Error('First argument to setCookie must be a Cookie object or string');
|
|
237
|
+
return options?.ignoreError
|
|
238
|
+
? promiseCallback.resolve(undefined)
|
|
239
|
+
: promiseCallback.reject(err);
|
|
240
|
+
}
|
|
241
|
+
// S5.3 step 2
|
|
242
|
+
const now = options?.now || new Date(); // will assign later to save effort in the face of errors
|
|
243
|
+
// S5.3 step 3: NOOP; persistent-flag and expiry-time is handled by getCookie()
|
|
244
|
+
// S5.3 step 4: NOOP; domain is null by default
|
|
245
|
+
// S5.3 step 5: public suffixes
|
|
246
|
+
if (this.rejectPublicSuffixes && cookie.domain) {
|
|
247
|
+
try {
|
|
248
|
+
const cdomain = cookie.cdomain();
|
|
249
|
+
const suffix = typeof cdomain === 'string'
|
|
250
|
+
? (0, getPublicSuffix_1.getPublicSuffix)(cdomain, {
|
|
251
|
+
allowSpecialUseDomain: this.allowSpecialUseDomain,
|
|
252
|
+
ignoreError: options?.ignoreError,
|
|
253
|
+
})
|
|
254
|
+
: null;
|
|
255
|
+
if (suffix == null && !constants_1.IP_V6_REGEX_OBJECT.test(cookie.domain)) {
|
|
256
|
+
// e.g. "com"
|
|
257
|
+
const err = new Error('Cookie has domain set to a public suffix');
|
|
258
|
+
return options?.ignoreError
|
|
259
|
+
? promiseCallback.resolve(undefined)
|
|
260
|
+
: promiseCallback.reject(err);
|
|
261
|
+
}
|
|
262
|
+
// Using `any` here rather than `unknown` to avoid a type assertion, at the cost of needing
|
|
263
|
+
// to disable eslint directives. It's easier to have this one spot of technically incorrect
|
|
264
|
+
// types, rather than having to deal with _all_ callback errors being `unknown`.
|
|
265
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
|
266
|
+
}
|
|
267
|
+
catch (err) {
|
|
268
|
+
return options?.ignoreError
|
|
269
|
+
? promiseCallback.resolve(undefined)
|
|
270
|
+
: // eslint-disable-next-line @typescript-eslint/no-unsafe-argument
|
|
271
|
+
promiseCallback.reject(err);
|
|
272
|
+
}
|
|
273
|
+
}
|
|
274
|
+
// S5.3 step 6:
|
|
275
|
+
if (cookie.domain) {
|
|
276
|
+
if (!(0, domainMatch_1.domainMatch)(host ?? undefined, cookie.cdomain() ?? undefined, false)) {
|
|
277
|
+
const err = new Error(`Cookie not in this host's domain. Cookie:${cookie.cdomain() ?? 'null'} Request:${host ?? 'null'}`);
|
|
278
|
+
return options?.ignoreError
|
|
279
|
+
? promiseCallback.resolve(undefined)
|
|
280
|
+
: promiseCallback.reject(err);
|
|
281
|
+
}
|
|
282
|
+
if (cookie.hostOnly == null) {
|
|
283
|
+
// don't reset if already set
|
|
284
|
+
cookie.hostOnly = false;
|
|
285
|
+
}
|
|
286
|
+
}
|
|
287
|
+
else {
|
|
288
|
+
cookie.hostOnly = true;
|
|
289
|
+
cookie.domain = host;
|
|
290
|
+
}
|
|
291
|
+
//S5.2.4 If the attribute-value is empty or if the first character of the
|
|
292
|
+
//attribute-value is not %x2F ("/"):
|
|
293
|
+
//Let cookie-path be the default-path.
|
|
294
|
+
if (!cookie.path || cookie.path[0] !== '/') {
|
|
295
|
+
cookie.path = (0, defaultPath_1.defaultPath)(context.pathname);
|
|
296
|
+
cookie.pathIsDefault = true;
|
|
297
|
+
}
|
|
298
|
+
// S5.3 step 8: NOOP; secure attribute
|
|
299
|
+
// S5.3 step 9: NOOP; httpOnly attribute
|
|
300
|
+
// S5.3 step 10
|
|
301
|
+
if (options?.http === false && cookie.httpOnly) {
|
|
302
|
+
const err = new Error("Cookie is HttpOnly and this isn't an HTTP API");
|
|
303
|
+
return options.ignoreError
|
|
304
|
+
? promiseCallback.resolve(undefined)
|
|
305
|
+
: promiseCallback.reject(err);
|
|
306
|
+
}
|
|
307
|
+
// 6252bis-02 S5.4 Step 13 & 14:
|
|
308
|
+
if (cookie.sameSite !== 'none' &&
|
|
309
|
+
cookie.sameSite !== undefined &&
|
|
310
|
+
sameSiteContext) {
|
|
311
|
+
// "If the cookie's "same-site-flag" is not "None", and the cookie
|
|
312
|
+
// is being set from a context whose "site for cookies" is not an
|
|
313
|
+
// exact match for request-uri's host's registered domain, then
|
|
314
|
+
// abort these steps and ignore the newly created cookie entirely."
|
|
315
|
+
if (sameSiteContext === 'none') {
|
|
316
|
+
const err = new Error('Cookie is SameSite but this is a cross-origin request');
|
|
317
|
+
return options?.ignoreError
|
|
318
|
+
? promiseCallback.resolve(undefined)
|
|
319
|
+
: promiseCallback.reject(err);
|
|
320
|
+
}
|
|
321
|
+
}
|
|
322
|
+
/* 6265bis-02 S5.4 Steps 15 & 16 */
|
|
323
|
+
const ignoreErrorForPrefixSecurity = this.prefixSecurity === constants_1.PrefixSecurityEnum.SILENT;
|
|
324
|
+
const prefixSecurityDisabled = this.prefixSecurity === constants_1.PrefixSecurityEnum.DISABLED;
|
|
325
|
+
/* If prefix checking is not disabled ...*/
|
|
326
|
+
if (!prefixSecurityDisabled) {
|
|
327
|
+
let errorFound = false;
|
|
328
|
+
let errorMsg;
|
|
329
|
+
/* Check secure prefix condition */
|
|
330
|
+
if (!isSecurePrefixConditionMet(cookie)) {
|
|
331
|
+
errorFound = true;
|
|
332
|
+
errorMsg = 'Cookie has __Secure prefix but Secure attribute is not set';
|
|
333
|
+
}
|
|
334
|
+
else if (!isHostPrefixConditionMet(cookie)) {
|
|
335
|
+
/* Check host prefix condition */
|
|
336
|
+
errorFound = true;
|
|
337
|
+
errorMsg =
|
|
338
|
+
"Cookie has __Host prefix but either Secure or HostOnly attribute is not set or Path is not '/'";
|
|
339
|
+
}
|
|
340
|
+
if (errorFound) {
|
|
341
|
+
return options?.ignoreError || ignoreErrorForPrefixSecurity
|
|
342
|
+
? promiseCallback.resolve(undefined)
|
|
343
|
+
: promiseCallback.reject(new Error(errorMsg));
|
|
344
|
+
}
|
|
345
|
+
}
|
|
346
|
+
const store = this.store;
|
|
347
|
+
// TODO: It feels weird to be manipulating the store as a side effect of a method.
|
|
348
|
+
// We should either do it in the constructor or not at all.
|
|
349
|
+
// eslint-disable-next-line @typescript-eslint/no-unnecessary-condition
|
|
350
|
+
if (!store.updateCookie) {
|
|
351
|
+
store.updateCookie = async function (_oldCookie, newCookie, cb) {
|
|
352
|
+
return this.putCookie(newCookie).then(() => cb?.(null), (error) => cb?.(error));
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
const withCookie = function withCookie(err, oldCookie) {
|
|
356
|
+
if (err) {
|
|
357
|
+
cb(err);
|
|
358
|
+
return;
|
|
359
|
+
}
|
|
360
|
+
const next = function (err) {
|
|
361
|
+
if (err) {
|
|
362
|
+
cb(err);
|
|
363
|
+
}
|
|
364
|
+
else if (typeof cookie === 'string') {
|
|
365
|
+
cb(null, undefined);
|
|
366
|
+
}
|
|
367
|
+
else {
|
|
368
|
+
cb(null, cookie);
|
|
369
|
+
}
|
|
370
|
+
};
|
|
371
|
+
if (oldCookie) {
|
|
372
|
+
// S5.3 step 11 - "If the cookie store contains a cookie with the same name,
|
|
373
|
+
// domain, and path as the newly created cookie:"
|
|
374
|
+
if (options &&
|
|
375
|
+
'http' in options &&
|
|
376
|
+
options.http === false &&
|
|
377
|
+
oldCookie.httpOnly) {
|
|
378
|
+
// step 11.2
|
|
379
|
+
err = new Error("old Cookie is HttpOnly and this isn't an HTTP API");
|
|
380
|
+
if (options.ignoreError)
|
|
381
|
+
cb(null, undefined);
|
|
382
|
+
else
|
|
383
|
+
cb(err);
|
|
384
|
+
return;
|
|
385
|
+
}
|
|
386
|
+
if (cookie instanceof cookie_1.Cookie) {
|
|
387
|
+
cookie.creation = oldCookie.creation;
|
|
388
|
+
// step 11.3
|
|
389
|
+
cookie.creationIndex = oldCookie.creationIndex;
|
|
390
|
+
// preserve tie-breaker
|
|
391
|
+
cookie.lastAccessed = now;
|
|
392
|
+
// Step 11.4 (delete cookie) is implied by just setting the new one:
|
|
393
|
+
store.updateCookie(oldCookie, cookie, next); // step 12
|
|
394
|
+
}
|
|
395
|
+
}
|
|
396
|
+
else {
|
|
397
|
+
if (cookie instanceof cookie_1.Cookie) {
|
|
398
|
+
cookie.creation = cookie.lastAccessed = now;
|
|
399
|
+
store.putCookie(cookie, next); // step 12
|
|
400
|
+
}
|
|
401
|
+
}
|
|
402
|
+
};
|
|
403
|
+
// TODO: Refactor to avoid using a callback
|
|
404
|
+
store.findCookie(cookie.domain, cookie.path, cookie.key, withCookie);
|
|
405
|
+
return promiseCallback.promise;
|
|
406
|
+
}
|
|
407
|
+
/**
|
|
408
|
+
* Synchronously attempt to set the {@link Cookie} in the {@link CookieJar}.
|
|
409
|
+
*
|
|
410
|
+
* <strong>Note:</strong> Only works if the configured {@link Store} is also synchronous.
|
|
411
|
+
*
|
|
412
|
+
* @remarks
|
|
413
|
+
* - If successfully persisted, the {@link Cookie} will have updated
|
|
414
|
+
* {@link Cookie.creation}, {@link Cookie.lastAccessed} and {@link Cookie.hostOnly}
|
|
415
|
+
* properties.
|
|
416
|
+
*
|
|
417
|
+
* - As per the RFC, the {@link Cookie.hostOnly} flag is set if there was no `Domain={value}`
|
|
418
|
+
* atttribute on the cookie string. The {@link Cookie.domain} property is set to the
|
|
419
|
+
* fully-qualified hostname of `currentUrl` in this case. Matching this cookie requires an
|
|
420
|
+
* exact hostname match (not a {@link domainMatch} as per usual)
|
|
421
|
+
*
|
|
422
|
+
* @param cookie - The cookie object or cookie string to store. A string value will be parsed into a cookie using {@link Cookie.parse}.
|
|
423
|
+
* @param url - The domain to store the cookie with.
|
|
424
|
+
* @param options - Configuration settings to use when storing the cookie.
|
|
425
|
+
* @public
|
|
426
|
+
*/
|
|
427
|
+
setCookieSync(cookie, url, options) {
|
|
428
|
+
const setCookieFn = options
|
|
429
|
+
? this.setCookie.bind(this, cookie, url, options)
|
|
430
|
+
: this.setCookie.bind(this, cookie, url);
|
|
431
|
+
return this.callSync(setCookieFn);
|
|
432
|
+
}
|
|
433
|
+
/**
|
|
434
|
+
* @internal No doc because this is the overload implementation
|
|
435
|
+
*/
|
|
436
|
+
getCookies(url, options, callback) {
|
|
437
|
+
// RFC6365 S5.4
|
|
438
|
+
if (typeof options === 'function') {
|
|
439
|
+
callback = options;
|
|
440
|
+
options = defaultGetCookieOptions;
|
|
441
|
+
}
|
|
442
|
+
else if (options === undefined) {
|
|
443
|
+
options = defaultGetCookieOptions;
|
|
444
|
+
}
|
|
445
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
446
|
+
const cb = promiseCallback.callback;
|
|
447
|
+
let context;
|
|
448
|
+
try {
|
|
449
|
+
if (typeof url === 'string') {
|
|
450
|
+
validators.validate(validators.isNonEmptyString(url), cb, url);
|
|
451
|
+
}
|
|
452
|
+
context = getCookieContext(url);
|
|
453
|
+
validators.validate(validators.isObject(options), cb, (0, utils_1.safeToString)(options));
|
|
454
|
+
validators.validate(typeof cb === 'function', cb);
|
|
455
|
+
}
|
|
456
|
+
catch (parameterError) {
|
|
457
|
+
return promiseCallback.reject(parameterError);
|
|
458
|
+
}
|
|
459
|
+
const host = (0, canonicalDomain_1.canonicalDomain)(context.hostname);
|
|
460
|
+
const path = context.pathname || '/';
|
|
461
|
+
const secure = context.protocol &&
|
|
462
|
+
(context.protocol == 'https:' || context.protocol == 'wss:');
|
|
463
|
+
let sameSiteLevel = 0;
|
|
464
|
+
if (options.sameSiteContext) {
|
|
465
|
+
const sameSiteContext = checkSameSiteContext(options.sameSiteContext);
|
|
466
|
+
if (sameSiteContext == null) {
|
|
467
|
+
return promiseCallback.reject(new Error(SAME_SITE_CONTEXT_VAL_ERR));
|
|
468
|
+
}
|
|
469
|
+
sameSiteLevel = cookie_1.Cookie.sameSiteLevel[sameSiteContext];
|
|
470
|
+
if (!sameSiteLevel) {
|
|
471
|
+
return promiseCallback.reject(new Error(SAME_SITE_CONTEXT_VAL_ERR));
|
|
472
|
+
}
|
|
473
|
+
}
|
|
474
|
+
const http = options.http ?? true;
|
|
475
|
+
const now = Date.now();
|
|
476
|
+
const expireCheck = options.expire ?? true;
|
|
477
|
+
const allPaths = options.allPaths ?? false;
|
|
478
|
+
const store = this.store;
|
|
479
|
+
function matchingCookie(c) {
|
|
480
|
+
// "Either:
|
|
481
|
+
// The cookie's host-only-flag is true and the canonicalized
|
|
482
|
+
// request-host is identical to the cookie's domain.
|
|
483
|
+
// Or:
|
|
484
|
+
// The cookie's host-only-flag is false and the canonicalized
|
|
485
|
+
// request-host domain-matches the cookie's domain."
|
|
486
|
+
if (c.hostOnly) {
|
|
487
|
+
if (c.domain != host) {
|
|
488
|
+
return false;
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
else {
|
|
492
|
+
if (!(0, domainMatch_1.domainMatch)(host ?? undefined, c.domain ?? undefined, false)) {
|
|
493
|
+
return false;
|
|
494
|
+
}
|
|
495
|
+
}
|
|
496
|
+
// "The request-uri's path path-matches the cookie's path."
|
|
497
|
+
if (!allPaths && typeof c.path === 'string' && !(0, pathMatch_1.pathMatch)(path, c.path)) {
|
|
498
|
+
return false;
|
|
499
|
+
}
|
|
500
|
+
// "If the cookie's secure-only-flag is true, then the request-uri's
|
|
501
|
+
// scheme must denote a "secure" protocol"
|
|
502
|
+
if (c.secure && !secure) {
|
|
503
|
+
return false;
|
|
504
|
+
}
|
|
505
|
+
// "If the cookie's http-only-flag is true, then exclude the cookie if the
|
|
506
|
+
// cookie-string is being generated for a "non-HTTP" API"
|
|
507
|
+
if (c.httpOnly && !http) {
|
|
508
|
+
return false;
|
|
509
|
+
}
|
|
510
|
+
// RFC6265bis-02 S5.3.7
|
|
511
|
+
if (sameSiteLevel) {
|
|
512
|
+
let cookieLevel;
|
|
513
|
+
if (c.sameSite === 'lax') {
|
|
514
|
+
cookieLevel = cookie_1.Cookie.sameSiteLevel.lax;
|
|
515
|
+
}
|
|
516
|
+
else if (c.sameSite === 'strict') {
|
|
517
|
+
cookieLevel = cookie_1.Cookie.sameSiteLevel.strict;
|
|
518
|
+
}
|
|
519
|
+
else {
|
|
520
|
+
cookieLevel = cookie_1.Cookie.sameSiteLevel.none;
|
|
521
|
+
}
|
|
522
|
+
if (cookieLevel > sameSiteLevel) {
|
|
523
|
+
// only allow cookies at or below the request level
|
|
524
|
+
return false;
|
|
525
|
+
}
|
|
526
|
+
}
|
|
527
|
+
// deferred from S5.3
|
|
528
|
+
// non-RFC: allow retention of expired cookies by choice
|
|
529
|
+
const expiryTime = c.expiryTime();
|
|
530
|
+
if (expireCheck && expiryTime != undefined && expiryTime <= now) {
|
|
531
|
+
store.removeCookie(c.domain, c.path, c.key, () => { }); // result ignored
|
|
532
|
+
return false;
|
|
533
|
+
}
|
|
534
|
+
return true;
|
|
535
|
+
}
|
|
536
|
+
store.findCookies(host, allPaths ? null : path, this.allowSpecialUseDomain, (err, cookies) => {
|
|
537
|
+
if (err) {
|
|
538
|
+
cb(err);
|
|
539
|
+
return;
|
|
540
|
+
}
|
|
541
|
+
if (cookies == null) {
|
|
542
|
+
cb(null, []);
|
|
543
|
+
return;
|
|
544
|
+
}
|
|
545
|
+
cookies = cookies.filter(matchingCookie);
|
|
546
|
+
// sorting of S5.4 part 2
|
|
547
|
+
if ('sort' in options && options.sort !== false) {
|
|
548
|
+
cookies = cookies.sort(cookieCompare_1.cookieCompare);
|
|
549
|
+
}
|
|
550
|
+
// S5.4 part 3
|
|
551
|
+
const now = new Date();
|
|
552
|
+
for (const cookie of cookies) {
|
|
553
|
+
cookie.lastAccessed = now;
|
|
554
|
+
}
|
|
555
|
+
// TODO persist lastAccessed
|
|
556
|
+
cb(null, cookies);
|
|
557
|
+
});
|
|
558
|
+
return promiseCallback.promise;
|
|
559
|
+
}
|
|
560
|
+
/**
|
|
561
|
+
* Synchronously retrieve the list of cookies that can be sent in a Cookie header for the
|
|
562
|
+
* current URL.
|
|
563
|
+
*
|
|
564
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
565
|
+
*
|
|
566
|
+
* @remarks
|
|
567
|
+
* - The array of cookies returned will be sorted according to {@link cookieCompare}.
|
|
568
|
+
*
|
|
569
|
+
* - The {@link Cookie.lastAccessed} property will be updated on all returned cookies.
|
|
570
|
+
*
|
|
571
|
+
* @param url - The domain to store the cookie with.
|
|
572
|
+
* @param options - Configuration settings to use when retrieving the cookies.
|
|
573
|
+
*/
|
|
574
|
+
getCookiesSync(url, options) {
|
|
575
|
+
return this.callSync(this.getCookies.bind(this, url, options)) ?? [];
|
|
576
|
+
}
|
|
577
|
+
/**
|
|
578
|
+
* @internal No doc because this is the overload implementation
|
|
579
|
+
*/
|
|
580
|
+
getCookieString(url, options, callback) {
|
|
581
|
+
if (typeof options === 'function') {
|
|
582
|
+
callback = options;
|
|
583
|
+
options = undefined;
|
|
584
|
+
}
|
|
585
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
586
|
+
const next = function (err, cookies) {
|
|
587
|
+
if (err) {
|
|
588
|
+
promiseCallback.callback(err);
|
|
589
|
+
}
|
|
590
|
+
else {
|
|
591
|
+
promiseCallback.callback(null, cookies
|
|
592
|
+
?.sort(cookieCompare_1.cookieCompare)
|
|
593
|
+
.map((c) => c.cookieString())
|
|
594
|
+
.join('; '));
|
|
595
|
+
}
|
|
596
|
+
};
|
|
597
|
+
this.getCookies(url, options, next);
|
|
598
|
+
return promiseCallback.promise;
|
|
599
|
+
}
|
|
600
|
+
/**
|
|
601
|
+
* Synchronous version of `.getCookieString()`. Accepts the same options as `.getCookies()` but returns a string suitable for a
|
|
602
|
+
* `Cookie` header rather than an Array.
|
|
603
|
+
*
|
|
604
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
605
|
+
*
|
|
606
|
+
* @param url - The domain to store the cookie with.
|
|
607
|
+
* @param options - Configuration settings to use when retrieving the cookies.
|
|
608
|
+
*/
|
|
609
|
+
getCookieStringSync(url, options) {
|
|
610
|
+
return (this.callSync(options
|
|
611
|
+
? this.getCookieString.bind(this, url, options)
|
|
612
|
+
: this.getCookieString.bind(this, url)) ?? '');
|
|
613
|
+
}
|
|
614
|
+
/**
|
|
615
|
+
* @internal No doc because this is the overload implementation
|
|
616
|
+
*/
|
|
617
|
+
getSetCookieStrings(url, options, callback) {
|
|
618
|
+
if (typeof options === 'function') {
|
|
619
|
+
callback = options;
|
|
620
|
+
options = undefined;
|
|
621
|
+
}
|
|
622
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
623
|
+
const next = function (err, cookies) {
|
|
624
|
+
if (err) {
|
|
625
|
+
promiseCallback.callback(err);
|
|
626
|
+
}
|
|
627
|
+
else {
|
|
628
|
+
promiseCallback.callback(null, cookies?.map((c) => {
|
|
629
|
+
return c.toString();
|
|
630
|
+
}));
|
|
631
|
+
}
|
|
632
|
+
};
|
|
633
|
+
this.getCookies(url, options, next);
|
|
634
|
+
return promiseCallback.promise;
|
|
635
|
+
}
|
|
636
|
+
/**
|
|
637
|
+
* Synchronous version of `.getSetCookieStrings()`. Returns an array of strings suitable for `Set-Cookie` headers.
|
|
638
|
+
* Accepts the same options as `.getCookies()`.
|
|
639
|
+
*
|
|
640
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
641
|
+
*
|
|
642
|
+
* @param url - The domain to store the cookie with.
|
|
643
|
+
* @param options - Configuration settings to use when retrieving the cookies.
|
|
644
|
+
*/
|
|
645
|
+
getSetCookieStringsSync(url, options = {}) {
|
|
646
|
+
return (this.callSync(this.getSetCookieStrings.bind(this, url, options)) ?? []);
|
|
647
|
+
}
|
|
648
|
+
/**
|
|
649
|
+
* @internal No doc because this is the overload implementation
|
|
650
|
+
*/
|
|
651
|
+
serialize(callback) {
|
|
652
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
653
|
+
let type = this.store.constructor.name;
|
|
654
|
+
if (validators.isObject(type)) {
|
|
655
|
+
type = null;
|
|
656
|
+
}
|
|
657
|
+
// update README.md "Serialization Format" if you change this, please!
|
|
658
|
+
const serialized = {
|
|
659
|
+
// The version of tough-cookie that serialized this jar. Generally a good
|
|
660
|
+
// practice since future versions can make data import decisions based on
|
|
661
|
+
// known past behavior. When/if this matters, use `semver`.
|
|
662
|
+
version: `tough-cookie@${version_1.version}`,
|
|
663
|
+
// add the store type, to make humans happy:
|
|
664
|
+
storeType: type,
|
|
665
|
+
// CookieJar configuration:
|
|
666
|
+
rejectPublicSuffixes: this.rejectPublicSuffixes,
|
|
667
|
+
enableLooseMode: this.enableLooseMode,
|
|
668
|
+
allowSpecialUseDomain: this.allowSpecialUseDomain,
|
|
669
|
+
prefixSecurity: getNormalizedPrefixSecurity(this.prefixSecurity),
|
|
670
|
+
// this gets filled from getAllCookies:
|
|
671
|
+
cookies: [],
|
|
672
|
+
};
|
|
673
|
+
if (typeof this.store.getAllCookies !== 'function') {
|
|
674
|
+
return promiseCallback.reject(new Error('store does not support getAllCookies and cannot be serialized'));
|
|
675
|
+
}
|
|
676
|
+
this.store.getAllCookies((err, cookies) => {
|
|
677
|
+
if (err) {
|
|
678
|
+
promiseCallback.callback(err);
|
|
679
|
+
return;
|
|
680
|
+
}
|
|
681
|
+
if (cookies == null) {
|
|
682
|
+
promiseCallback.callback(null, serialized);
|
|
683
|
+
return;
|
|
684
|
+
}
|
|
685
|
+
serialized.cookies = cookies.map((cookie) => {
|
|
686
|
+
// convert to serialized 'raw' cookies
|
|
687
|
+
const serializedCookie = cookie.toJSON();
|
|
688
|
+
// Remove the index so new ones get assigned during deserialization
|
|
689
|
+
delete serializedCookie.creationIndex;
|
|
690
|
+
return serializedCookie;
|
|
691
|
+
});
|
|
692
|
+
promiseCallback.callback(null, serialized);
|
|
693
|
+
});
|
|
694
|
+
return promiseCallback.promise;
|
|
695
|
+
}
|
|
696
|
+
/**
|
|
697
|
+
* Serialize the CookieJar if the underlying store supports `.getAllCookies`.
|
|
698
|
+
*
|
|
699
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
700
|
+
*/
|
|
701
|
+
serializeSync() {
|
|
702
|
+
return this.callSync((callback) => {
|
|
703
|
+
this.serialize(callback);
|
|
704
|
+
});
|
|
705
|
+
}
|
|
706
|
+
/**
|
|
707
|
+
* Alias of {@link CookieJar.serializeSync}. Allows the cookie to be serialized
|
|
708
|
+
* with `JSON.stringify(cookieJar)`.
|
|
709
|
+
*/
|
|
710
|
+
toJSON() {
|
|
711
|
+
return this.serializeSync();
|
|
712
|
+
}
|
|
713
|
+
/**
|
|
714
|
+
* Use the class method CookieJar.deserialize instead of calling this directly
|
|
715
|
+
* @internal
|
|
716
|
+
*/
|
|
717
|
+
_importCookies(serialized, callback) {
|
|
718
|
+
let cookies = undefined;
|
|
719
|
+
if (serialized &&
|
|
720
|
+
typeof serialized === 'object' &&
|
|
721
|
+
(0, utils_1.inOperator)('cookies', serialized) &&
|
|
722
|
+
Array.isArray(serialized.cookies)) {
|
|
723
|
+
cookies = serialized.cookies;
|
|
724
|
+
}
|
|
725
|
+
if (!cookies) {
|
|
726
|
+
callback(new Error('serialized jar has no cookies array'), undefined);
|
|
727
|
+
return;
|
|
728
|
+
}
|
|
729
|
+
cookies = cookies.slice(); // do not modify the original
|
|
730
|
+
const putNext = (err) => {
|
|
731
|
+
if (err) {
|
|
732
|
+
callback(err, undefined);
|
|
733
|
+
return;
|
|
734
|
+
}
|
|
735
|
+
if (Array.isArray(cookies)) {
|
|
736
|
+
if (!cookies.length) {
|
|
737
|
+
callback(err, this);
|
|
738
|
+
return;
|
|
739
|
+
}
|
|
740
|
+
let cookie;
|
|
741
|
+
try {
|
|
742
|
+
cookie = cookie_1.Cookie.fromJSON(cookies.shift());
|
|
743
|
+
}
|
|
744
|
+
catch (e) {
|
|
745
|
+
callback(e instanceof Error ? e : new Error(), undefined);
|
|
746
|
+
return;
|
|
747
|
+
}
|
|
748
|
+
if (cookie === undefined) {
|
|
749
|
+
putNext(null); // skip this cookie
|
|
750
|
+
return;
|
|
751
|
+
}
|
|
752
|
+
this.store.putCookie(cookie, putNext);
|
|
753
|
+
}
|
|
754
|
+
};
|
|
755
|
+
putNext(null);
|
|
756
|
+
}
|
|
757
|
+
/**
|
|
758
|
+
* @internal
|
|
759
|
+
*/
|
|
760
|
+
_importCookiesSync(serialized) {
|
|
761
|
+
this.callSync(this._importCookies.bind(this, serialized));
|
|
762
|
+
}
|
|
763
|
+
/**
|
|
764
|
+
* @internal No doc because this is the overload implementation
|
|
765
|
+
*/
|
|
766
|
+
clone(newStore, callback) {
|
|
767
|
+
if (typeof newStore === 'function') {
|
|
768
|
+
callback = newStore;
|
|
769
|
+
newStore = undefined;
|
|
770
|
+
}
|
|
771
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
772
|
+
const cb = promiseCallback.callback;
|
|
773
|
+
this.serialize((err, serialized) => {
|
|
774
|
+
if (err) {
|
|
775
|
+
return promiseCallback.reject(err);
|
|
776
|
+
}
|
|
777
|
+
return CookieJar.deserialize(serialized ?? '', newStore, cb);
|
|
778
|
+
});
|
|
779
|
+
return promiseCallback.promise;
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* @internal
|
|
783
|
+
*/
|
|
784
|
+
_cloneSync(newStore) {
|
|
785
|
+
const cloneFn = newStore && typeof newStore !== 'function'
|
|
786
|
+
? this.clone.bind(this, newStore)
|
|
787
|
+
: this.clone.bind(this);
|
|
788
|
+
return this.callSync((callback) => {
|
|
789
|
+
cloneFn(callback);
|
|
790
|
+
});
|
|
791
|
+
}
|
|
792
|
+
/**
|
|
793
|
+
* Produces a deep clone of this CookieJar. Modifications to the original do
|
|
794
|
+
* not affect the clone, and vice versa.
|
|
795
|
+
*
|
|
796
|
+
* <strong>Note</strong>: Only works if both the configured Store and destination
|
|
797
|
+
* Store are synchronous.
|
|
798
|
+
*
|
|
799
|
+
* @remarks
|
|
800
|
+
* - When no {@link Store} is provided, a new {@link MemoryCookieStore} will be used.
|
|
801
|
+
*
|
|
802
|
+
* - Transferring between store types is supported so long as the source
|
|
803
|
+
* implements `.getAllCookies()` and the destination implements `.putCookie()`.
|
|
804
|
+
*
|
|
805
|
+
* @param newStore - The target {@link Store} to clone cookies into.
|
|
806
|
+
*/
|
|
807
|
+
cloneSync(newStore) {
|
|
808
|
+
if (!newStore) {
|
|
809
|
+
return this._cloneSync();
|
|
810
|
+
}
|
|
811
|
+
if (!newStore.synchronous) {
|
|
812
|
+
throw new Error('CookieJar clone destination store is not synchronous; use async API instead.');
|
|
813
|
+
}
|
|
814
|
+
return this._cloneSync(newStore);
|
|
815
|
+
}
|
|
816
|
+
/**
|
|
817
|
+
* @internal No doc because this is the overload implementation
|
|
818
|
+
*/
|
|
819
|
+
removeAllCookies(callback) {
|
|
820
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
821
|
+
const cb = promiseCallback.callback;
|
|
822
|
+
const store = this.store;
|
|
823
|
+
// Check that the store implements its own removeAllCookies(). The default
|
|
824
|
+
// implementation in Store will immediately call the callback with a "not
|
|
825
|
+
// implemented" Error.
|
|
826
|
+
if (typeof store.removeAllCookies === 'function' &&
|
|
827
|
+
store.removeAllCookies !== store_1.Store.prototype.removeAllCookies) {
|
|
828
|
+
// `Callback<undefined>` and `ErrorCallback` are *technically* incompatible, but for the
|
|
829
|
+
// standard implementation `cb = (err, result) => {}`, they're essentially the same.
|
|
830
|
+
store.removeAllCookies(cb);
|
|
831
|
+
return promiseCallback.promise;
|
|
832
|
+
}
|
|
833
|
+
store.getAllCookies((err, cookies) => {
|
|
834
|
+
if (err) {
|
|
835
|
+
cb(err);
|
|
836
|
+
return;
|
|
837
|
+
}
|
|
838
|
+
if (!cookies) {
|
|
839
|
+
cookies = [];
|
|
840
|
+
}
|
|
841
|
+
if (cookies.length === 0) {
|
|
842
|
+
cb(null, undefined);
|
|
843
|
+
return;
|
|
844
|
+
}
|
|
845
|
+
let completedCount = 0;
|
|
846
|
+
const removeErrors = [];
|
|
847
|
+
// TODO: Refactor to avoid using callback
|
|
848
|
+
const removeCookieCb = function removeCookieCb(removeErr) {
|
|
849
|
+
if (removeErr) {
|
|
850
|
+
removeErrors.push(removeErr);
|
|
851
|
+
}
|
|
852
|
+
completedCount++;
|
|
853
|
+
if (completedCount === cookies.length) {
|
|
854
|
+
if (removeErrors[0])
|
|
855
|
+
cb(removeErrors[0]);
|
|
856
|
+
else
|
|
857
|
+
cb(null, undefined);
|
|
858
|
+
return;
|
|
859
|
+
}
|
|
860
|
+
};
|
|
861
|
+
cookies.forEach((cookie) => {
|
|
862
|
+
store.removeCookie(cookie.domain, cookie.path, cookie.key, removeCookieCb);
|
|
863
|
+
});
|
|
864
|
+
});
|
|
865
|
+
return promiseCallback.promise;
|
|
866
|
+
}
|
|
867
|
+
/**
|
|
868
|
+
* Removes all cookies from the CookieJar.
|
|
869
|
+
*
|
|
870
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
871
|
+
*
|
|
872
|
+
* @remarks
|
|
873
|
+
* - This is a new backwards-compatible feature of tough-cookie version 2.5,
|
|
874
|
+
* so not all Stores will implement it efficiently. For Stores that do not
|
|
875
|
+
* implement `removeAllCookies`, the fallback is to call `removeCookie` after
|
|
876
|
+
* `getAllCookies`.
|
|
877
|
+
*
|
|
878
|
+
* - If `getAllCookies` fails or isn't implemented in the Store, an error is returned.
|
|
879
|
+
*
|
|
880
|
+
* - If one or more of the `removeCookie` calls fail, only the first error is returned.
|
|
881
|
+
*/
|
|
882
|
+
removeAllCookiesSync() {
|
|
883
|
+
this.callSync((callback) => {
|
|
884
|
+
// `Callback<undefined>` and `ErrorCallback` are *technically* incompatible, but for the
|
|
885
|
+
// standard implementation `cb = (err, result) => {}`, they're essentially the same.
|
|
886
|
+
this.removeAllCookies(callback);
|
|
887
|
+
});
|
|
888
|
+
}
|
|
889
|
+
/**
|
|
890
|
+
* @internal No doc because this is the overload implementation
|
|
891
|
+
*/
|
|
892
|
+
static deserialize(strOrObj, store, callback) {
|
|
893
|
+
if (typeof store === 'function') {
|
|
894
|
+
callback = store;
|
|
895
|
+
store = undefined;
|
|
896
|
+
}
|
|
897
|
+
const promiseCallback = (0, utils_1.createPromiseCallback)(callback);
|
|
898
|
+
let serialized;
|
|
899
|
+
if (typeof strOrObj === 'string') {
|
|
900
|
+
try {
|
|
901
|
+
serialized = JSON.parse(strOrObj);
|
|
902
|
+
}
|
|
903
|
+
catch (e) {
|
|
904
|
+
return promiseCallback.reject(e instanceof Error ? e : new Error());
|
|
905
|
+
}
|
|
906
|
+
}
|
|
907
|
+
else {
|
|
908
|
+
serialized = strOrObj;
|
|
909
|
+
}
|
|
910
|
+
const readSerializedProperty = (property) => {
|
|
911
|
+
return serialized &&
|
|
912
|
+
typeof serialized === 'object' &&
|
|
913
|
+
(0, utils_1.inOperator)(property, serialized)
|
|
914
|
+
? serialized[property]
|
|
915
|
+
: undefined;
|
|
916
|
+
};
|
|
917
|
+
const readSerializedBoolean = (property) => {
|
|
918
|
+
const value = readSerializedProperty(property);
|
|
919
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
920
|
+
};
|
|
921
|
+
const readSerializedString = (property) => {
|
|
922
|
+
const value = readSerializedProperty(property);
|
|
923
|
+
return typeof value === 'string' ? value : undefined;
|
|
924
|
+
};
|
|
925
|
+
const jar = new CookieJar(store, {
|
|
926
|
+
rejectPublicSuffixes: readSerializedBoolean('rejectPublicSuffixes'),
|
|
927
|
+
looseMode: readSerializedBoolean('enableLooseMode'),
|
|
928
|
+
allowSpecialUseDomain: readSerializedBoolean('allowSpecialUseDomain'),
|
|
929
|
+
prefixSecurity: getNormalizedPrefixSecurity(readSerializedString('prefixSecurity') ?? 'silent'),
|
|
930
|
+
});
|
|
931
|
+
jar._importCookies(serialized, (err) => {
|
|
932
|
+
if (err) {
|
|
933
|
+
promiseCallback.callback(err);
|
|
934
|
+
return;
|
|
935
|
+
}
|
|
936
|
+
promiseCallback.callback(null, jar);
|
|
937
|
+
});
|
|
938
|
+
return promiseCallback.promise;
|
|
939
|
+
}
|
|
940
|
+
/**
|
|
941
|
+
* A new CookieJar is created and the serialized {@link Cookie} values are added to
|
|
942
|
+
* the underlying store. Each {@link Cookie} is added via `store.putCookie(...)` in
|
|
943
|
+
* the order in which they appear in the serialization.
|
|
944
|
+
*
|
|
945
|
+
* <strong>Note</strong>: Only works if the configured Store is also synchronous.
|
|
946
|
+
*
|
|
947
|
+
* @remarks
|
|
948
|
+
* - When no {@link Store} is provided, a new {@link MemoryCookieStore} will be used.
|
|
949
|
+
*
|
|
950
|
+
* - As a convenience, if `strOrObj` is a string, it is passed through `JSON.parse` first.
|
|
951
|
+
*
|
|
952
|
+
* @param strOrObj - A JSON string or object representing the deserialized cookies.
|
|
953
|
+
* @param store - The underlying store to persist the deserialized cookies into.
|
|
954
|
+
*/
|
|
955
|
+
static deserializeSync(strOrObj, store) {
|
|
956
|
+
const serialized = typeof strOrObj === 'string' ? JSON.parse(strOrObj) : strOrObj;
|
|
957
|
+
const readSerializedProperty = (property) => {
|
|
958
|
+
return serialized &&
|
|
959
|
+
typeof serialized === 'object' &&
|
|
960
|
+
(0, utils_1.inOperator)(property, serialized)
|
|
961
|
+
? serialized[property]
|
|
962
|
+
: undefined;
|
|
963
|
+
};
|
|
964
|
+
const readSerializedBoolean = (property) => {
|
|
965
|
+
const value = readSerializedProperty(property);
|
|
966
|
+
return typeof value === 'boolean' ? value : undefined;
|
|
967
|
+
};
|
|
968
|
+
const readSerializedString = (property) => {
|
|
969
|
+
const value = readSerializedProperty(property);
|
|
970
|
+
return typeof value === 'string' ? value : undefined;
|
|
971
|
+
};
|
|
972
|
+
const jar = new CookieJar(store, {
|
|
973
|
+
rejectPublicSuffixes: readSerializedBoolean('rejectPublicSuffixes'),
|
|
974
|
+
looseMode: readSerializedBoolean('enableLooseMode'),
|
|
975
|
+
allowSpecialUseDomain: readSerializedBoolean('allowSpecialUseDomain'),
|
|
976
|
+
prefixSecurity: getNormalizedPrefixSecurity(readSerializedString('prefixSecurity') ?? 'silent'),
|
|
977
|
+
});
|
|
978
|
+
// catch this mistake early:
|
|
979
|
+
if (!jar.store.synchronous) {
|
|
980
|
+
throw new Error('CookieJar store is not synchronous; use async API instead.');
|
|
981
|
+
}
|
|
982
|
+
jar._importCookiesSync(serialized);
|
|
983
|
+
return jar;
|
|
984
|
+
}
|
|
985
|
+
/**
|
|
986
|
+
* Alias of {@link CookieJar.deserializeSync}.
|
|
987
|
+
*
|
|
988
|
+
* @remarks
|
|
989
|
+
* - When no {@link Store} is provided, a new {@link MemoryCookieStore} will be used.
|
|
990
|
+
*
|
|
991
|
+
* - As a convenience, if `strOrObj` is a string, it is passed through `JSON.parse` first.
|
|
992
|
+
*
|
|
993
|
+
* @param jsonString - A JSON string or object representing the deserialized cookies.
|
|
994
|
+
* @param store - The underlying store to persist the deserialized cookies into.
|
|
995
|
+
*/
|
|
996
|
+
static fromJSON(jsonString, store) {
|
|
997
|
+
return CookieJar.deserializeSync(jsonString, store);
|
|
998
|
+
}
|
|
999
|
+
}
|
|
1000
|
+
exports.CookieJar = CookieJar;
|