@ardennguyen/zalo-agent-cli 2.5.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +23 -2
- package/DISCLAIMER.md +3 -3
- package/LICENSE +2 -3
- package/NOTICE +14 -34
- package/README.md +166 -72
- package/package.json +37 -19
- package/src/commands/account.js +369 -40
- package/src/commands/auto-reply.js +8 -25
- package/src/commands/bank.js +25 -6
- package/src/commands/catalog.js +54 -11
- package/src/commands/cloud.js +459 -0
- package/src/commands/conv.js +470 -287
- package/src/commands/db.js +442 -0
- package/src/commands/fleet.js +449 -41
- package/src/commands/friend.js +198 -45
- package/src/commands/group.js +256 -43
- package/src/commands/label.js +16 -2
- package/src/commands/listen.js +495 -122
- package/src/commands/login.js +313 -117
- package/src/commands/mcp-approver.js +103 -0
- package/src/commands/mcp-webhook.js +13 -5
- package/src/commands/mcp.js +800 -104
- package/src/commands/msg-media.js +187 -0
- package/src/commands/msg-search.js +219 -0
- package/src/commands/msg.js +414 -110
- package/src/commands/oa/calls.js +134 -0
- package/src/commands/oa/content.js +266 -0
- package/src/commands/oa/gmf.js +429 -0
- package/src/commands/oa/messages.js +355 -0
- package/src/commands/oa/users.js +502 -0
- package/src/commands/oa-init.js +122 -123
- package/src/commands/oa-listen.js +374 -150
- package/src/commands/oa.js +83 -598
- package/src/commands/policy.js +224 -0
- package/src/commands/poll.js +3 -0
- package/src/commands/presence.js +175 -0
- package/src/commands/profile.js +45 -94
- package/src/commands/quick-msg.js +26 -0
- package/src/commands/read.js +172 -0
- package/src/commands/reminder.js +34 -4
- package/src/commands/social.js +223 -0
- package/src/commands/sync.js +482 -158
- package/src/commands/write.js +85 -0
- package/src/commands/zbs.js +502 -0
- package/src/core/account-devices.js +76 -0
- package/src/core/account-state.js +167 -0
- package/src/core/account-status.js +355 -0
- package/src/core/accounts.js +11 -4
- package/src/core/admin-api.js +392 -0
- package/src/core/approval.js +271 -0
- package/src/core/auto-reply.js +27 -0
- package/src/core/bank-accounts.js +1 -1
- package/src/core/block-sharing.js +43 -0
- package/src/core/board-pass.js +94 -0
- package/src/core/cached-message.js +78 -8
- package/src/core/cloud-plan.js +285 -0
- package/src/core/cloud-verify.js +305 -0
- package/src/core/confirm-guard.js +808 -0
- package/src/core/contact-names.js +504 -0
- package/src/core/control-events.js +525 -0
- package/src/core/control-replay.js +106 -0
- package/src/core/conversation-actions.js +214 -0
- package/src/core/credentials.js +112 -11
- package/src/core/current-user-names.js +60 -26
- package/src/core/daemon-channel.js +296 -15
- package/src/core/daemon-health.js +110 -7
- package/src/core/daemon-presence.js +455 -0
- package/src/core/daemon-sync.js +58 -18
- package/src/core/data-export.js +610 -0
- package/src/core/db-tools.js +473 -0
- package/src/core/db.js +1327 -83
- package/src/core/deploy-policy.js +560 -0
- package/src/core/device-since.js +123 -0
- package/src/core/e2ee-notice.js +41 -0
- package/src/core/exit-codes.js +7 -0
- package/src/core/export-crypt.js +290 -0
- package/src/core/fleet-controller.js +340 -0
- package/src/core/fleet-purge.js +144 -0
- package/src/core/fleet-qr.js +273 -0
- package/src/core/fleet-serve.js +292 -0
- package/src/core/fleet-supervisor.js +176 -0
- package/src/core/fleet-templates.js +568 -39
- package/src/core/fleet.js +232 -20
- package/src/core/friend-requests.js +80 -16
- package/src/core/friend-search.js +1 -1
- package/src/core/group-admin.js +2 -29
- package/src/core/group-departure.js +233 -0
- package/src/core/group-exit.js +621 -0
- package/src/core/group-members.js +21 -9
- package/src/core/group-settings.js +5 -207
- package/src/core/hidden-chat-actions.js +96 -0
- package/src/core/hidden-chats.js +425 -0
- package/src/core/history-fetch.js +81 -27
- package/src/core/keystore/config.js +163 -0
- package/src/core/keystore/container.js +208 -0
- package/src/core/keystore/index.js +483 -0
- package/src/core/keystore/keyring.js +588 -0
- package/src/core/keystore/kms.js +157 -0
- package/src/core/keystore/media-seal.js +711 -0
- package/src/core/keystore/providers.js +492 -0
- package/src/core/keystore/stores.js +177 -0
- package/src/core/keystore/worker.js +80 -0
- package/src/core/kick-marker.js +61 -0
- package/src/core/last-online.js +236 -0
- package/src/core/list-all.js +280 -0
- package/src/core/listener-lifecycle.js +101 -10
- package/src/core/live-api.js +1 -1
- package/src/core/live-store.js +111 -53
- package/src/core/local-reads.js +16 -0
- package/src/core/logout.js +102 -140
- package/src/core/media-deliver.js +732 -0
- package/src/core/media-route.js +347 -0
- package/src/core/media-store.js +408 -0
- package/src/core/mutual-groups.js +94 -0
- package/src/core/name-refresh.js +135 -0
- package/src/core/oa/calls.js +212 -0
- package/src/core/oa/content.js +390 -0
- package/src/core/oa/gmf.js +537 -0
- package/src/core/oa/messages.js +470 -0
- package/src/core/oa/oauth.js +422 -0
- package/src/core/oa/transport.js +645 -0
- package/src/core/oa/users.js +694 -0
- package/src/core/oa-client.js +49 -415
- package/src/core/overflow-repair.js +221 -0
- package/src/core/policy-layer.js +55 -0
- package/src/core/policy-schema.js +401 -0
- package/src/core/policy-store.js +1058 -0
- package/src/core/presence-config.js +100 -0
- package/src/core/presence-leases.js +211 -0
- package/src/core/presence.js +688 -0
- package/src/core/profile-settings.js +243 -0
- package/src/core/qr-login-flow.js +237 -0
- package/src/core/read-state.js +145 -22
- package/src/core/receipts.js +355 -548
- package/src/core/recent-conversations.js +28 -6
- package/src/core/row-mac.js +405 -0
- package/src/core/search.js +271 -0
- package/src/core/secure-page.js +771 -0
- package/src/core/self-heal.js +493 -34
- package/src/core/session-expiry.js +103 -0
- package/src/core/session-notice.js +249 -0
- package/src/core/social/client.js +296 -0
- package/src/core/social/dpop.js +54 -0
- package/src/core/socket-host.js +437 -0
- package/src/core/sqlite.js +520 -0
- package/src/core/startup-gate.js +49 -5
- package/src/core/storage-quota.js +796 -0
- package/src/core/sync-action.js +180 -0
- package/src/core/sync-v2/auto-sync.js +356 -0
- package/src/core/sync-v2/board.js +130 -92
- package/src/core/sync-v2/conv-state.js +21 -4
- package/src/core/sync-v2/gap-advice.js +2 -3
- package/src/core/sync-v2/index.js +739 -323
- package/src/core/sync-v2/media.js +116 -27
- package/src/core/sync-v2/plan.js +16 -2
- package/src/core/sync-v2/ranges.js +98 -0
- package/src/core/sync-v2/reactions.js +12 -196
- package/src/core/sync-v2/senders.js +32 -14
- package/src/core/sync-v2/zcloud.js +177 -579
- package/src/core/sync.js +23 -21
- package/src/core/test-fake-session.js +87 -0
- package/src/core/typing.js +78 -0
- package/src/core/unknown-acts.js +240 -0
- package/src/core/voice-text.js +171 -0
- package/src/core/webhook-outbox.js +110 -12
- package/src/core/zalo-client.js +147 -188
- package/src/core/zbs/api.js +505 -0
- package/src/core/zbs/image.js +85 -0
- package/src/core/zbs/phone.js +59 -0
- package/src/core/zbs/rsa.js +129 -0
- package/src/core/zbs/template-check.js +449 -0
- package/src/index.js +60 -10
- package/src/mcp/action-tool.js +188 -0
- package/src/mcp/actions-business.js +488 -0
- package/src/mcp/actions-conversation.js +633 -0
- package/src/mcp/actions-media.js +268 -0
- package/src/mcp/actions-profile.js +281 -0
- package/src/mcp/actions-social.js +518 -0
- package/src/mcp/instructions.js +19 -5
- package/src/mcp/mcp-config.js +112 -10
- package/src/mcp/mcp-http-transport.js +162 -25
- package/src/mcp/mcp-server.js +14 -3
- package/src/mcp/mcp-tools.js +1686 -384
- package/src/mcp/message-buffer.js +58 -12
- package/src/mcp/notifier.js +1 -1
- package/src/mcp/official-tool.js +298 -0
- package/src/mcp/sync-jobs.js +7 -1
- package/src/mcp/sync-stages.js +72 -0
- package/src/mcp/thread-name-cache.js +43 -5
- package/src/mcp/tool-presence.js +153 -0
- package/src/mcp/wait-batch.js +27 -0
- package/src/mcp/wait-result.js +19 -21
- package/src/utils/bank-helpers.js +52 -1
- package/src/utils/cli-args.js +12 -12
- package/src/utils/date-range.js +50 -0
- package/src/utils/hidden-access.js +141 -0
- package/src/utils/interrupt.js +37 -0
- package/src/utils/json-input.js +41 -0
- package/src/utils/list-replies.js +60 -0
- package/src/utils/my-documents.js +2 -3
- package/src/utils/output.js +66 -2
- package/src/utils/qr-display.js +14 -8
- package/src/utils/qr-http-server.js +674 -134
- package/src/utils/quote.js +8 -8
- package/src/utils/secret-input.js +57 -0
- package/src/utils/vn-text.js +72 -0
- package/src/zalo/README.md +46 -0
- package/src/zalo/anomaly-store.js +49 -0
- package/src/zalo/api/actions.js +670 -0
- package/src/zalo/api/boards.js +1036 -0
- package/src/zalo/api/business.js +662 -0
- package/src/zalo/api/conversations.js +329 -0
- package/src/zalo/api/groups.js +631 -0
- package/src/zalo/api/messages.js +695 -0
- package/src/zalo/api/people.js +711 -0
- package/src/zalo/api/profile.js +374 -0
- package/src/zalo/api/session.js +45 -0
- package/src/zalo/api/upload.js +976 -0
- package/src/zalo/api.js +117 -0
- package/src/zalo/client.js +206 -0
- package/src/zalo/custom/forward.js +199 -0
- package/src/zalo/custom/gid.js +123 -0
- package/src/zalo/custom/group-history.js +246 -0
- package/src/zalo/custom/group-invite.js +53 -0
- package/src/zalo/custom/group-settings.js +186 -0
- package/src/zalo/custom/group-visibility.js +71 -0
- package/src/zalo/custom/pin.js +220 -0
- package/src/zalo/custom/renewlink.js +115 -0
- package/src/zalo/device-fingerprint.js +33 -0
- package/src/zalo/download-fetch.js +45 -0
- package/src/zalo/enums.js +25 -0
- package/src/zalo/errors.js +195 -0
- package/src/zalo/format/mentions.js +140 -0
- package/src/zalo/format/split-message.js +222 -0
- package/src/zalo/format/urgency.js +29 -0
- package/src/zalo/headers.js +93 -0
- package/src/zalo/index.js +72 -0
- package/src/zalo/kernel/atomic-file.js +217 -0
- package/src/zalo/kernel/bound.js +46 -0
- package/src/zalo/kernel/cipher.js +88 -0
- package/src/zalo/kernel/cookies.js +125 -0
- package/src/zalo/kernel/endpoint.js +211 -0
- package/src/zalo/kernel/http.js +360 -0
- package/src/zalo/kernel/json-ids.js +118 -0
- package/src/zalo/kernel/login-cipher.js +165 -0
- package/src/zalo/kernel/secret-file.js +45 -0
- package/src/zalo/kernel/session.js +261 -0
- package/src/zalo/kernel/zcloud-cipher.js +83 -0
- package/src/zalo/kickout.js +136 -0
- package/src/zalo/listener/dispatch.js +404 -0
- package/src/zalo/listener/frames.js +222 -0
- package/src/zalo/listener/friend-events.js +113 -0
- package/src/zalo/listener/group-events.js +117 -0
- package/src/zalo/listener/keepalive.js +191 -0
- package/src/zalo/listener/listener.js +469 -0
- package/src/zalo/listener/models.js +220 -0
- package/src/zalo/listener/reactions.js +224 -0
- package/src/zalo/listener/socket-tap.js +228 -0
- package/src/zalo/login.js +387 -0
- package/src/zalo/logout.js +192 -0
- package/src/zalo/maintenance.js +183 -0
- package/src/zalo/official-logout.js +254 -0
- package/src/zalo/paging.js +114 -0
- package/src/zalo/profile.js +184 -0
- package/src/zalo/pulls.js +129 -0
- package/src/zalo/qr-image.js +90 -0
- package/src/zalo/qr-login.js +494 -0
- package/src/zalo/queues/control-queue.js +193 -0
- package/src/zalo/queues/offline-queue.js +275 -0
- package/src/zalo/queues/queue-verify.js +306 -0
- package/src/zalo/reads.js +723 -0
- package/src/zalo/receipts.js +550 -0
- package/src/zalo/req-id.js +24 -0
- package/src/zalo/retry.js +343 -0
- package/src/zalo/session-call.js +55 -0
- package/src/zalo/socket.js +762 -0
- package/src/zalo/transfer-sync/assets.js +181 -0
- package/src/zalo/transfer-sync/channel.js +459 -0
- package/src/zalo/transfer-sync/download.js +161 -0
- package/src/zalo/transfer-sync/message-types.js +520 -0
- package/src/zalo/transfer-sync/transfer.js +468 -0
- package/src/zalo/trust-store.js +99 -0
- package/src/zalo/trust-wasm.js +393 -0
- package/src/zalo/upkeep.js +127 -0
- package/src/zalo/web-call.js +103 -0
- package/src/zalo/writes.js +704 -0
- package/src/zalo/zcloud-e2ee.js +214 -0
- package/src/zalo/zcloud.js +802 -0
- package/node_modules/asynckit/LICENSE +0 -21
- package/node_modules/asynckit/README.md +0 -233
- package/node_modules/asynckit/bench.js +0 -76
- package/node_modules/asynckit/index.js +0 -6
- package/node_modules/asynckit/lib/abort.js +0 -29
- package/node_modules/asynckit/lib/async.js +0 -34
- package/node_modules/asynckit/lib/defer.js +0 -26
- package/node_modules/asynckit/lib/iterate.js +0 -75
- package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
- package/node_modules/asynckit/lib/readable_parallel.js +0 -25
- package/node_modules/asynckit/lib/readable_serial.js +0 -25
- package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
- package/node_modules/asynckit/lib/state.js +0 -37
- package/node_modules/asynckit/lib/streamify.js +0 -141
- package/node_modules/asynckit/lib/terminator.js +0 -29
- package/node_modules/asynckit/package.json +0 -63
- package/node_modules/asynckit/parallel.js +0 -43
- package/node_modules/asynckit/serial.js +0 -17
- package/node_modules/asynckit/serialOrdered.js +0 -75
- package/node_modules/asynckit/stream.js +0 -21
- package/node_modules/bignumber.js/CHANGELOG.md +0 -381
- package/node_modules/bignumber.js/LICENCE.md +0 -26
- package/node_modules/bignumber.js/README.md +0 -289
- package/node_modules/bignumber.js/bignumber.d.mts +0 -6
- package/node_modules/bignumber.js/bignumber.d.ts +0 -5
- package/node_modules/bignumber.js/bignumber.js +0 -2922
- package/node_modules/bignumber.js/bignumber.mjs +0 -2907
- package/node_modules/bignumber.js/doc/API.html +0 -2249
- package/node_modules/bignumber.js/package.json +0 -60
- package/node_modules/bignumber.js/types.d.ts +0 -1821
- package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/node_modules/combined-stream/License +0 -19
- package/node_modules/combined-stream/Readme.md +0 -138
- package/node_modules/combined-stream/lib/combined_stream.js +0 -208
- package/node_modules/combined-stream/package.json +0 -25
- package/node_modules/crypto-js/CONTRIBUTING.md +0 -28
- package/node_modules/crypto-js/LICENSE +0 -24
- package/node_modules/crypto-js/README.md +0 -275
- package/node_modules/crypto-js/aes.js +0 -234
- package/node_modules/crypto-js/blowfish.js +0 -471
- package/node_modules/crypto-js/bower.json +0 -39
- package/node_modules/crypto-js/cipher-core.js +0 -895
- package/node_modules/crypto-js/core.js +0 -807
- package/node_modules/crypto-js/crypto-js.js +0 -6657
- package/node_modules/crypto-js/docs/QuickStartGuide.wiki +0 -470
- package/node_modules/crypto-js/enc-base64.js +0 -136
- package/node_modules/crypto-js/enc-base64url.js +0 -148
- package/node_modules/crypto-js/enc-hex.js +0 -18
- package/node_modules/crypto-js/enc-latin1.js +0 -18
- package/node_modules/crypto-js/enc-utf16.js +0 -149
- package/node_modules/crypto-js/enc-utf8.js +0 -18
- package/node_modules/crypto-js/evpkdf.js +0 -134
- package/node_modules/crypto-js/format-hex.js +0 -66
- package/node_modules/crypto-js/format-openssl.js +0 -18
- package/node_modules/crypto-js/hmac-md5.js +0 -18
- package/node_modules/crypto-js/hmac-ripemd160.js +0 -18
- package/node_modules/crypto-js/hmac-sha1.js +0 -18
- package/node_modules/crypto-js/hmac-sha224.js +0 -18
- package/node_modules/crypto-js/hmac-sha256.js +0 -18
- package/node_modules/crypto-js/hmac-sha3.js +0 -18
- package/node_modules/crypto-js/hmac-sha384.js +0 -18
- package/node_modules/crypto-js/hmac-sha512.js +0 -18
- package/node_modules/crypto-js/hmac.js +0 -143
- package/node_modules/crypto-js/index.js +0 -18
- package/node_modules/crypto-js/lib-typedarrays.js +0 -76
- package/node_modules/crypto-js/md5.js +0 -268
- package/node_modules/crypto-js/mode-cfb.js +0 -80
- package/node_modules/crypto-js/mode-ctr-gladman.js +0 -116
- package/node_modules/crypto-js/mode-ctr.js +0 -58
- package/node_modules/crypto-js/mode-ecb.js +0 -40
- package/node_modules/crypto-js/mode-ofb.js +0 -54
- package/node_modules/crypto-js/package.json +0 -42
- package/node_modules/crypto-js/pad-ansix923.js +0 -49
- package/node_modules/crypto-js/pad-iso10126.js +0 -44
- package/node_modules/crypto-js/pad-iso97971.js +0 -40
- package/node_modules/crypto-js/pad-nopadding.js +0 -30
- package/node_modules/crypto-js/pad-pkcs7.js +0 -18
- package/node_modules/crypto-js/pad-zeropadding.js +0 -47
- package/node_modules/crypto-js/pbkdf2.js +0 -145
- package/node_modules/crypto-js/rabbit-legacy.js +0 -190
- package/node_modules/crypto-js/rabbit.js +0 -192
- package/node_modules/crypto-js/rc4.js +0 -139
- package/node_modules/crypto-js/ripemd160.js +0 -267
- package/node_modules/crypto-js/sha1.js +0 -150
- package/node_modules/crypto-js/sha224.js +0 -80
- package/node_modules/crypto-js/sha256.js +0 -199
- package/node_modules/crypto-js/sha3.js +0 -326
- package/node_modules/crypto-js/sha384.js +0 -83
- package/node_modules/crypto-js/sha512.js +0 -326
- package/node_modules/crypto-js/tripledes.js +0 -779
- package/node_modules/crypto-js/x64-core.js +0 -304
- package/node_modules/delayed-stream/.npmignore +0 -1
- package/node_modules/delayed-stream/License +0 -19
- package/node_modules/delayed-stream/Makefile +0 -7
- package/node_modules/delayed-stream/Readme.md +0 -141
- package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
- package/node_modules/delayed-stream/package.json +0 -27
- package/node_modules/dunder-proto/.eslintrc +0 -5
- package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/node_modules/dunder-proto/.nycrc +0 -13
- package/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/node_modules/dunder-proto/LICENSE +0 -21
- package/node_modules/dunder-proto/README.md +0 -54
- package/node_modules/dunder-proto/get.d.ts +0 -5
- package/node_modules/dunder-proto/get.js +0 -30
- package/node_modules/dunder-proto/package.json +0 -76
- package/node_modules/dunder-proto/set.d.ts +0 -5
- package/node_modules/dunder-proto/set.js +0 -35
- package/node_modules/dunder-proto/test/get.js +0 -34
- package/node_modules/dunder-proto/test/index.js +0 -4
- package/node_modules/dunder-proto/test/set.js +0 -50
- package/node_modules/dunder-proto/tsconfig.json +0 -9
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/es-object-atoms/.eslintrc +0 -16
- package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/node_modules/es-object-atoms/CHANGELOG.md +0 -44
- package/node_modules/es-object-atoms/LICENSE +0 -21
- package/node_modules/es-object-atoms/README.md +0 -63
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/node_modules/es-object-atoms/ToObject.js +0 -10
- package/node_modules/es-object-atoms/index.d.ts +0 -3
- package/node_modules/es-object-atoms/index.js +0 -4
- package/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/node_modules/es-object-atoms/isObject.js +0 -6
- package/node_modules/es-object-atoms/package.json +0 -79
- package/node_modules/es-object-atoms/test/index.js +0 -38
- package/node_modules/es-object-atoms/tsconfig.json +0 -7
- package/node_modules/es-set-tostringtag/.eslintrc +0 -13
- package/node_modules/es-set-tostringtag/.nycrc +0 -9
- package/node_modules/es-set-tostringtag/CHANGELOG.md +0 -67
- package/node_modules/es-set-tostringtag/LICENSE +0 -21
- package/node_modules/es-set-tostringtag/README.md +0 -53
- package/node_modules/es-set-tostringtag/index.d.ts +0 -10
- package/node_modules/es-set-tostringtag/index.js +0 -35
- package/node_modules/es-set-tostringtag/package.json +0 -78
- package/node_modules/es-set-tostringtag/test/index.js +0 -85
- package/node_modules/es-set-tostringtag/tsconfig.json +0 -9
- package/node_modules/form-data/CHANGELOG.md +0 -686
- package/node_modules/form-data/License +0 -19
- package/node_modules/form-data/README.md +0 -355
- package/node_modules/form-data/index.d.ts +0 -62
- package/node_modules/form-data/lib/browser.js +0 -4
- package/node_modules/form-data/lib/form_data.js +0 -506
- package/node_modules/form-data/lib/populate.js +0 -10
- package/node_modules/form-data/node_modules/mime-db/HISTORY.md +0 -507
- package/node_modules/form-data/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-db/README.md +0 -100
- package/node_modules/form-data/node_modules/mime-db/db.json +0 -8519
- package/node_modules/form-data/node_modules/mime-db/index.js +0 -12
- package/node_modules/form-data/node_modules/mime-db/package.json +0 -60
- package/node_modules/form-data/node_modules/mime-types/HISTORY.md +0 -397
- package/node_modules/form-data/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-types/README.md +0 -113
- package/node_modules/form-data/node_modules/mime-types/index.js +0 -188
- package/node_modules/form-data/node_modules/mime-types/package.json +0 -44
- package/node_modules/form-data/package.json +0 -82
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/get-intrinsic/.eslintrc +0 -42
- package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/node_modules/get-intrinsic/.nycrc +0 -9
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/node_modules/get-intrinsic/LICENSE +0 -21
- package/node_modules/get-intrinsic/README.md +0 -71
- package/node_modules/get-intrinsic/index.js +0 -378
- package/node_modules/get-intrinsic/package.json +0 -97
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/node_modules/get-proto/.eslintrc +0 -10
- package/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/node_modules/get-proto/.nycrc +0 -9
- package/node_modules/get-proto/CHANGELOG.md +0 -21
- package/node_modules/get-proto/LICENSE +0 -21
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/node_modules/get-proto/README.md +0 -50
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/node_modules/get-proto/index.d.ts +0 -5
- package/node_modules/get-proto/index.js +0 -27
- package/node_modules/get-proto/package.json +0 -81
- package/node_modules/get-proto/test/index.js +0 -68
- package/node_modules/get-proto/tsconfig.json +0 -9
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-symbols/.eslintrc +0 -11
- package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/node_modules/has-symbols/.nycrc +0 -9
- package/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/node_modules/has-symbols/LICENSE +0 -21
- package/node_modules/has-symbols/README.md +0 -46
- package/node_modules/has-symbols/index.d.ts +0 -3
- package/node_modules/has-symbols/index.js +0 -14
- package/node_modules/has-symbols/package.json +0 -111
- package/node_modules/has-symbols/shams.d.ts +0 -3
- package/node_modules/has-symbols/shams.js +0 -45
- package/node_modules/has-symbols/test/index.js +0 -22
- package/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/node_modules/has-symbols/test/tests.js +0 -58
- package/node_modules/has-symbols/tsconfig.json +0 -10
- package/node_modules/has-tostringtag/.eslintrc +0 -5
- package/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
- package/node_modules/has-tostringtag/.nycrc +0 -13
- package/node_modules/has-tostringtag/CHANGELOG.md +0 -42
- package/node_modules/has-tostringtag/LICENSE +0 -21
- package/node_modules/has-tostringtag/README.md +0 -46
- package/node_modules/has-tostringtag/index.d.ts +0 -3
- package/node_modules/has-tostringtag/index.js +0 -8
- package/node_modules/has-tostringtag/package.json +0 -108
- package/node_modules/has-tostringtag/shams.d.ts +0 -3
- package/node_modules/has-tostringtag/shams.js +0 -8
- package/node_modules/has-tostringtag/test/index.js +0 -21
- package/node_modules/has-tostringtag/test/shams/core-js.js +0 -31
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -30
- package/node_modules/has-tostringtag/test/tests.js +0 -15
- package/node_modules/has-tostringtag/tsconfig.json +0 -49
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -58
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/eslint.config.mjs +0 -6
- package/node_modules/hasown/index.d.ts +0 -3
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -91
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/json-bigint/LICENSE +0 -20
- package/node_modules/json-bigint/README.md +0 -240
- package/node_modules/json-bigint/index.js +0 -12
- package/node_modules/json-bigint/lib/parse.js +0 -443
- package/node_modules/json-bigint/lib/stringify.js +0 -384
- package/node_modules/json-bigint/package.json +0 -34
- package/node_modules/math-intrinsics/.eslintrc +0 -16
- package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/node_modules/math-intrinsics/LICENSE +0 -21
- package/node_modules/math-intrinsics/README.md +0 -50
- package/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/node_modules/math-intrinsics/abs.js +0 -4
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/node_modules/math-intrinsics/floor.js +0 -4
- package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/node_modules/math-intrinsics/isFinite.js +0 -12
- package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/isInteger.js +0 -16
- package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/node_modules/math-intrinsics/isNaN.js +0 -6
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/node_modules/math-intrinsics/max.d.ts +0 -1
- package/node_modules/math-intrinsics/max.js +0 -4
- package/node_modules/math-intrinsics/min.d.ts +0 -1
- package/node_modules/math-intrinsics/min.js +0 -4
- package/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/node_modules/math-intrinsics/mod.js +0 -9
- package/node_modules/math-intrinsics/package.json +0 -86
- package/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/node_modules/math-intrinsics/pow.js +0 -4
- package/node_modules/math-intrinsics/round.d.ts +0 -1
- package/node_modules/math-intrinsics/round.js +0 -4
- package/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/node_modules/math-intrinsics/sign.js +0 -11
- package/node_modules/math-intrinsics/test/index.js +0 -192
- package/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/node_modules/pako/LICENSE +0 -21
- package/node_modules/pako/README.md +0 -155
- package/node_modules/pako/dist/pako.es5.js +0 -6760
- package/node_modules/pako/dist/pako.es5.min.js +0 -2
- package/node_modules/pako/dist/pako.esm.mjs +0 -6945
- package/node_modules/pako/dist/pako.js +0 -6964
- package/node_modules/pako/dist/pako.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.es5.js +0 -3953
- package/node_modules/pako/dist/pako_deflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.js +0 -4154
- package/node_modules/pako/dist/pako_deflate.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.es5.js +0 -3272
- package/node_modules/pako/dist/pako_inflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.js +0 -3279
- package/node_modules/pako/dist/pako_inflate.min.js +0 -2
- package/node_modules/pako/index.js +0 -18
- package/node_modules/pako/lib/deflate.js +0 -387
- package/node_modules/pako/lib/inflate.js +0 -456
- package/node_modules/pako/lib/utils/common.js +0 -48
- package/node_modules/pako/lib/utils/strings.js +0 -174
- package/node_modules/pako/lib/zlib/README +0 -59
- package/node_modules/pako/lib/zlib/adler32.js +0 -51
- package/node_modules/pako/lib/zlib/constants.js +0 -68
- package/node_modules/pako/lib/zlib/crc32.js +0 -59
- package/node_modules/pako/lib/zlib/deflate.js +0 -2069
- package/node_modules/pako/lib/zlib/gzheader.js +0 -58
- package/node_modules/pako/lib/zlib/inffast.js +0 -344
- package/node_modules/pako/lib/zlib/inflate.js +0 -1575
- package/node_modules/pako/lib/zlib/inftrees.js +0 -340
- package/node_modules/pako/lib/zlib/messages.js +0 -32
- package/node_modules/pako/lib/zlib/trees.js +0 -1179
- package/node_modules/pako/lib/zlib/zstream.js +0 -47
- package/node_modules/pako/package.json +0 -73
- package/node_modules/semver/LICENSE +0 -15
- package/node_modules/semver/README.md +0 -680
- package/node_modules/semver/bin/semver.js +0 -195
- package/node_modules/semver/classes/comparator.js +0 -143
- package/node_modules/semver/classes/index.js +0 -7
- package/node_modules/semver/classes/range.js +0 -577
- package/node_modules/semver/classes/semver.js +0 -350
- package/node_modules/semver/functions/clean.js +0 -8
- package/node_modules/semver/functions/cmp.js +0 -54
- package/node_modules/semver/functions/coerce.js +0 -62
- package/node_modules/semver/functions/compare-build.js +0 -9
- package/node_modules/semver/functions/compare-loose.js +0 -5
- package/node_modules/semver/functions/compare.js +0 -7
- package/node_modules/semver/functions/diff.js +0 -60
- package/node_modules/semver/functions/eq.js +0 -5
- package/node_modules/semver/functions/gt.js +0 -5
- package/node_modules/semver/functions/gte.js +0 -5
- package/node_modules/semver/functions/inc.js +0 -21
- package/node_modules/semver/functions/lt.js +0 -5
- package/node_modules/semver/functions/lte.js +0 -5
- package/node_modules/semver/functions/major.js +0 -5
- package/node_modules/semver/functions/minor.js +0 -5
- package/node_modules/semver/functions/neq.js +0 -5
- package/node_modules/semver/functions/parse.js +0 -18
- package/node_modules/semver/functions/patch.js +0 -5
- package/node_modules/semver/functions/prerelease.js +0 -8
- package/node_modules/semver/functions/rcompare.js +0 -5
- package/node_modules/semver/functions/rsort.js +0 -5
- package/node_modules/semver/functions/satisfies.js +0 -12
- package/node_modules/semver/functions/sort.js +0 -5
- package/node_modules/semver/functions/truncate.js +0 -48
- package/node_modules/semver/functions/valid.js +0 -8
- package/node_modules/semver/index.js +0 -93
- package/node_modules/semver/internal/constants.js +0 -37
- package/node_modules/semver/internal/debug.js +0 -11
- package/node_modules/semver/internal/identifiers.js +0 -29
- package/node_modules/semver/internal/lrucache.js +0 -42
- package/node_modules/semver/internal/parse-options.js +0 -17
- package/node_modules/semver/internal/re.js +0 -223
- package/node_modules/semver/package.json +0 -78
- package/node_modules/semver/preload.js +0 -4
- package/node_modules/semver/range.bnf +0 -17
- package/node_modules/semver/ranges/gtr.js +0 -6
- package/node_modules/semver/ranges/intersects.js +0 -9
- package/node_modules/semver/ranges/ltr.js +0 -6
- package/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/node_modules/semver/ranges/min-version.js +0 -63
- package/node_modules/semver/ranges/outside.js +0 -82
- package/node_modules/semver/ranges/simplify.js +0 -49
- package/node_modules/semver/ranges/subset.js +0 -249
- package/node_modules/semver/ranges/to-comparators.js +0 -10
- package/node_modules/semver/ranges/valid.js +0 -13
- package/node_modules/spark-md5/LICENSE +0 -13
- package/node_modules/spark-md5/README.md +0 -191
- package/node_modules/spark-md5/package.json +0 -35
- package/node_modules/spark-md5/spark-md5.js +0 -751
- package/node_modules/spark-md5/spark-md5.min.js +0 -1
- package/node_modules/tldts/LICENSE +0 -13
- package/node_modules/tldts/README.md +0 -327
- package/node_modules/tldts/bin/cli.js +0 -21
- package/node_modules/tldts/dist/cjs/index.js +0 -666
- package/node_modules/tldts/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/data/trie.js +0 -14
- package/node_modules/tldts/dist/cjs/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js +0 -67
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/es6/index.js +0 -33
- package/node_modules/tldts/dist/es6/index.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/data/trie.js +0 -11
- package/node_modules/tldts/dist/es6/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/suffix-trie.js +0 -64
- package/node_modules/tldts/dist/es6/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/index.cjs.min.js +0 -2
- package/node_modules/tldts/dist/index.cjs.min.js.map +0 -1
- package/node_modules/tldts/dist/index.esm.min.js +0 -2
- package/node_modules/tldts/dist/index.esm.min.js.map +0 -1
- package/node_modules/tldts/dist/index.umd.min.js +0 -2
- package/node_modules/tldts/dist/index.umd.min.js.map +0 -1
- package/node_modules/tldts/dist/types/index.d.ts +0 -7
- package/node_modules/tldts/dist/types/src/data/trie.d.ts +0 -5
- package/node_modules/tldts/dist/types/src/suffix-trie.d.ts +0 -5
- package/node_modules/tldts/index.ts +0 -62
- package/node_modules/tldts/package.json +0 -91
- package/node_modules/tldts/src/data/trie.ts +0 -14
- package/node_modules/tldts/src/suffix-trie.ts +0 -110
- package/node_modules/tldts-core/LICENSE +0 -13
- package/node_modules/tldts-core/README.md +0 -3
- package/node_modules/tldts-core/dist/cjs/index.js +0 -561
- package/node_modules/tldts-core/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +0 -15
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain.js +0 -83
- package/node_modules/tldts-core/dist/cjs/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +0 -149
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/factory.js +0 -104
- package/node_modules/tldts-core/dist/cjs/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js +0 -72
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +0 -3
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/options.js +0 -22
- package/node_modules/tldts-core/dist/cjs/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js +0 -14
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/es6/index.js +0 -4
- package/node_modules/tldts-core/dist/es6/index.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +0 -12
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain.js +0 -80
- package/node_modules/tldts-core/dist/es6/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js +0 -146
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/factory.js +0 -99
- package/node_modules/tldts-core/dist/es6/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-ip.js +0 -69
- package/node_modules/tldts-core/dist/es6/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-valid.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js +0 -2
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/options.js +0 -19
- package/node_modules/tldts-core/dist/es6/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/subdomain.js +0 -11
- package/node_modules/tldts-core/dist/es6/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/types/index.d.ts +0 -4
- package/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/domain.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/factory.d.ts +0 -28
- package/node_modules/tldts-core/dist/types/src/is-ip.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/is-valid.d.ts +0 -15
- package/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +0 -2
- package/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +0 -9
- package/node_modules/tldts-core/dist/types/src/options.d.ts +0 -10
- package/node_modules/tldts-core/dist/types/src/subdomain.d.ts +0 -4
- package/node_modules/tldts-core/index.ts +0 -10
- package/node_modules/tldts-core/package.json +0 -68
- package/node_modules/tldts-core/src/domain-without-suffix.ts +0 -14
- package/node_modules/tldts-core/src/domain.ts +0 -100
- package/node_modules/tldts-core/src/extract-hostname.ts +0 -170
- package/node_modules/tldts-core/src/factory.ts +0 -160
- package/node_modules/tldts-core/src/is-ip.ts +0 -87
- package/node_modules/tldts-core/src/is-valid.ts +0 -79
- package/node_modules/tldts-core/src/lookup/fast-path.ts +0 -80
- package/node_modules/tldts-core/src/lookup/interface.ts +0 -10
- package/node_modules/tldts-core/src/options.ts +0 -39
- package/node_modules/tldts-core/src/subdomain.ts +0 -11
- package/node_modules/tough-cookie/LICENSE +0 -12
- package/node_modules/tough-cookie/README.md +0 -154
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts +0 -33
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.js +0 -65
- package/node_modules/tough-cookie/dist/cookie/constants.d.ts +0 -54
- package/node_modules/tough-cookie/dist/cookie/constants.js +0 -38
- package/node_modules/tough-cookie/dist/cookie/cookie.d.ts +0 -326
- package/node_modules/tough-cookie/dist/cookie/cookie.js +0 -831
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts +0 -58
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.js +0 -84
- package/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts +0 -621
- package/node_modules/tough-cookie/dist/cookie/cookieJar.js +0 -1000
- package/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts +0 -40
- package/node_modules/tough-cookie/dist/cookie/defaultPath.js +0 -60
- package/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts +0 -38
- package/node_modules/tough-cookie/dist/cookie/domainMatch.js +0 -94
- package/node_modules/tough-cookie/dist/cookie/formatDate.d.ts +0 -15
- package/node_modules/tough-cookie/dist/cookie/formatDate.js +0 -20
- package/node_modules/tough-cookie/dist/cookie/index.d.ts +0 -29
- package/node_modules/tough-cookie/dist/cookie/index.js +0 -54
- package/node_modules/tough-cookie/dist/cookie/parseDate.d.ts +0 -103
- package/node_modules/tough-cookie/dist/cookie/parseDate.js +0 -323
- package/node_modules/tough-cookie/dist/cookie/permutePath.d.ts +0 -14
- package/node_modules/tough-cookie/dist/cookie/permutePath.js +0 -32
- package/node_modules/tough-cookie/dist/getPublicSuffix.d.ts +0 -55
- package/node_modules/tough-cookie/dist/getPublicSuffix.js +0 -71
- package/node_modules/tough-cookie/dist/memstore.d.ts +0 -220
- package/node_modules/tough-cookie/dist/memstore.js +0 -187
- package/node_modules/tough-cookie/dist/pathMatch.d.ts +0 -17
- package/node_modules/tough-cookie/dist/pathMatch.js +0 -40
- package/node_modules/tough-cookie/dist/permuteDomain.d.ts +0 -15
- package/node_modules/tough-cookie/dist/permuteDomain.js +0 -44
- package/node_modules/tough-cookie/dist/store.d.ts +0 -211
- package/node_modules/tough-cookie/dist/store.js +0 -76
- package/node_modules/tough-cookie/dist/utils.d.ts +0 -34
- package/node_modules/tough-cookie/dist/utils.js +0 -99
- package/node_modules/tough-cookie/dist/validators.d.ts +0 -24
- package/node_modules/tough-cookie/dist/validators.js +0 -90
- package/node_modules/tough-cookie/dist/version.d.ts +0 -5
- package/node_modules/tough-cookie/dist/version.js +0 -8
- package/node_modules/tough-cookie/package.json +0 -144
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1407
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
- package/node_modules/zca-js/.prettierrc +0 -5
- package/node_modules/zca-js/CODE_OF_CONDUCT.md +0 -163
- package/node_modules/zca-js/CONTRIBUTING.md +0 -470
- package/node_modules/zca-js/LICENSE +0 -21
- package/node_modules/zca-js/README.md +0 -225
- package/node_modules/zca-js/SECURITY.md +0 -83
- package/node_modules/zca-js/dist/Errors/ZaloApiError.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiError.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.js +0 -7
- package/node_modules/zca-js/dist/Errors/index.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/index.js +0 -4
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/addPollOptions.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/addPollOptions.js +0 -26
- package/node_modules/zca-js/dist/apis/addQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/addQuickMessage.js +0 -60
- package/node_modules/zca-js/dist/apis/addReaction.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/addReaction.js +0 -294
- package/node_modules/zca-js/dist/apis/addUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/addUnreadMark.js +0 -52
- package/node_modules/zca-js/dist/apis/addUserToGroup.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/addUserToGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/blockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/blockViewFeed.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockViewFeed.js +0 -30
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.js +0 -52
- package/node_modules/zca-js/dist/apis/changeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/changeFriendAlias.js +0 -27
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.js +0 -44
- package/node_modules/zca-js/dist/apis/changeGroupName.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupName.js +0 -32
- package/node_modules/zca-js/dist/apis/changeGroupOwner.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupOwner.js +0 -30
- package/node_modules/zca-js/dist/apis/createAutoReply.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/createAutoReply.js +0 -37
- package/node_modules/zca-js/dist/apis/createBankAccount.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/createBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/createCatalog.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createCatalog.js +0 -29
- package/node_modules/zca-js/dist/apis/createGroup.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/createGroup.js +0 -43
- package/node_modules/zca-js/dist/apis/createNote.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createNote.js +0 -47
- package/node_modules/zca-js/dist/apis/createPoll.d.ts +0 -36
- package/node_modules/zca-js/dist/apis/createPoll.js +0 -40
- package/node_modules/zca-js/dist/apis/createProductCatalog.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/createProductCatalog.js +0 -50
- package/node_modules/zca-js/dist/apis/createReminder.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/createReminder.js +0 -63
- package/node_modules/zca-js/dist/apis/custom.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/custom.js +0 -15
- package/node_modules/zca-js/dist/apis/deleteAutoReply.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/deleteAutoReply.js +0 -29
- package/node_modules/zca-js/dist/apis/deleteAvatar.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteAvatar.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteBankAccount.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/deleteBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/deleteCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/deleteCatalog.js +0 -28
- package/node_modules/zca-js/dist/apis/deleteChat.d.ts +0 -19
- package/node_modules/zca-js/dist/apis/deleteChat.js +0 -50
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteMessage.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/deleteMessage.js +0 -52
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.js +0 -31
- package/node_modules/zca-js/dist/apis/disableGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disableGroupLink.js +0 -24
- package/node_modules/zca-js/dist/apis/disperseGroup.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disperseGroup.js +0 -28
- package/node_modules/zca-js/dist/apis/editNote.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/editNote.js +0 -46
- package/node_modules/zca-js/dist/apis/editReminder.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/editReminder.js +0 -61
- package/node_modules/zca-js/dist/apis/enableGroupLink.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/enableGroupLink.js +0 -25
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.js +0 -10
- package/node_modules/zca-js/dist/apis/findUser.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUser.js +0 -42
- package/node_modules/zca-js/dist/apis/findUserByUsername.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUserByUsername.js +0 -27
- package/node_modules/zca-js/dist/apis/forwardMessage.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/forwardMessage.js +0 -114
- package/node_modules/zca-js/dist/apis/getAliasList.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getAliasList.js +0 -27
- package/node_modules/zca-js/dist/apis/getAllFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getAllFriends.js +0 -34
- package/node_modules/zca-js/dist/apis/getAllGroups.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAllGroups.js +0 -10
- package/node_modules/zca-js/dist/apis/getArchivedChatList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getArchivedChatList.js +0 -23
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.js +0 -21
- package/node_modules/zca-js/dist/apis/getAutoReplyList.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getAutoReplyList.js +0 -24
- package/node_modules/zca-js/dist/apis/getAvatarList.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/getAvatarList.js +0 -28
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.js +0 -30
- package/node_modules/zca-js/dist/apis/getBizAccount.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/getBizAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getCatalogList.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getCatalogList.js +0 -32
- package/node_modules/zca-js/dist/apis/getCloseFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getCloseFriends.js +0 -20
- package/node_modules/zca-js/dist/apis/getContext.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getContext.js +0 -4
- package/node_modules/zca-js/dist/apis/getCookie.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getCookie.js +0 -9
- package/node_modules/zca-js/dist/apis/getFriendBoardList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFriendBoardList.js +0 -26
- package/node_modules/zca-js/dist/apis/getFriendOnlines.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getFriendOnlines.js +0 -35
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.d.ts +0 -42
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.js +0 -27
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.js +0 -25
- package/node_modules/zca-js/dist/apis/getFullAvatar.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFullAvatar.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.js +0 -29
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.js +0 -36
- package/node_modules/zca-js/dist/apis/getGroupInfo.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/getGroupInfo.js +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.d.ts +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.js +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.d.ts +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.js +0 -31
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.d.ts +0 -34
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.js +0 -28
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.js +0 -24
- package/node_modules/zca-js/dist/apis/getHiddenConversations.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getHiddenConversations.js +0 -23
- package/node_modules/zca-js/dist/apis/getLabels.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getLabels.js +0 -28
- package/node_modules/zca-js/dist/apis/getListBank.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getListBank.js +0 -20
- package/node_modules/zca-js/dist/apis/getListBankAccount.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getListBankAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getListBoard.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/getListBoard.js +0 -45
- package/node_modules/zca-js/dist/apis/getListDevice.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getListDevice.js +0 -22
- package/node_modules/zca-js/dist/apis/getListReminder.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/getListReminder.js +0 -47
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.js +0 -39
- package/node_modules/zca-js/dist/apis/getMute.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/getMute.js +0 -22
- package/node_modules/zca-js/dist/apis/getOwnId.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getOwnId.js +0 -4
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.js +0 -27
- package/node_modules/zca-js/dist/apis/getPinConversations.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getPinConversations.js +0 -22
- package/node_modules/zca-js/dist/apis/getPollDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getPollDetail.js +0 -30
- package/node_modules/zca-js/dist/apis/getProductCatalogList.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/getProductCatalogList.js +0 -33
- package/node_modules/zca-js/dist/apis/getQR.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/getQR.js +0 -29
- package/node_modules/zca-js/dist/apis/getQuickMessageList.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getQuickMessageList.js +0 -24
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.js +0 -30
- package/node_modules/zca-js/dist/apis/getReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getReminder.js +0 -25
- package/node_modules/zca-js/dist/apis/getReminderResponses.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getReminderResponses.js +0 -24
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.js +0 -24
- package/node_modules/zca-js/dist/apis/getSettings.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getSettings.js +0 -20
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.js +0 -24
- package/node_modules/zca-js/dist/apis/getStickers.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getStickers.js +0 -40
- package/node_modules/zca-js/dist/apis/getStickersDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickersDetail.js +0 -40
- package/node_modules/zca-js/dist/apis/getUnreadMark.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/getUnreadMark.js +0 -30
- package/node_modules/zca-js/dist/apis/getUserInfo.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getUserInfo.js +0 -44
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.js +0 -30
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.js +0 -25
- package/node_modules/zca-js/dist/apis/joinGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupLink.js +0 -27
- package/node_modules/zca-js/dist/apis/keepAlive.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/keepAlive.js +0 -22
- package/node_modules/zca-js/dist/apis/lastOnline.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/lastOnline.js +0 -26
- package/node_modules/zca-js/dist/apis/leaveGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/leaveGroup.js +0 -33
- package/node_modules/zca-js/dist/apis/listen.d.ts +0 -102
- package/node_modules/zca-js/dist/apis/listen.js +0 -425
- package/node_modules/zca-js/dist/apis/lockPoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/lockPoll.js +0 -28
- package/node_modules/zca-js/dist/apis/login.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/login.js +0 -96
- package/node_modules/zca-js/dist/apis/loginQR.d.ts +0 -71
- package/node_modules/zca-js/dist/apis/loginQR.js +0 -376
- package/node_modules/zca-js/dist/apis/logoutV2.js +0 -79
- package/node_modules/zca-js/dist/apis/lostFocus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/lostFocus.js +0 -23
- package/node_modules/zca-js/dist/apis/parseLink.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/parseLink.js +0 -27
- package/node_modules/zca-js/dist/apis/registerCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/registerCatalog.js +0 -27
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/removeFriend.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriend.js +0 -28
- package/node_modules/zca-js/dist/apis/removeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriendAlias.js +0 -24
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/removeQuickMessage.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/removeQuickMessage.js +0 -27
- package/node_modules/zca-js/dist/apis/removeReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/removeReminder.js +0 -40
- package/node_modules/zca-js/dist/apis/removeUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/removeUnreadMark.js +0 -50
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.js +0 -20
- package/node_modules/zca-js/dist/apis/reuseAvatar.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/reuseAvatar.js +0 -26
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.js +0 -38
- package/node_modules/zca-js/dist/apis/scanURL.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/scanURL.js +0 -28
- package/node_modules/zca-js/dist/apis/searchSticker.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/searchSticker.js +0 -28
- package/node_modules/zca-js/dist/apis/sendBankCard.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/sendBankCard.js +0 -53
- package/node_modules/zca-js/dist/apis/sendCard.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendCard.js +0 -75
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.js +0 -55
- package/node_modules/zca-js/dist/apis/sendFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sendFriendRequest.js +0 -39
- package/node_modules/zca-js/dist/apis/sendLink.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendLink.js +0 -78
- package/node_modules/zca-js/dist/apis/sendMessage.d.ts +0 -105
- package/node_modules/zca-js/dist/apis/sendMessage.js +0 -486
- package/node_modules/zca-js/dist/apis/sendReport.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/sendReport.js +0 -53
- package/node_modules/zca-js/dist/apis/sendSeenEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendSeenEvent.js +0 -63
- package/node_modules/zca-js/dist/apis/sendSticker.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendSticker.js +0 -74
- package/node_modules/zca-js/dist/apis/sendTypingEvent.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/sendTypingEvent.js +0 -33
- package/node_modules/zca-js/dist/apis/sendVideo.d.ts +0 -35
- package/node_modules/zca-js/dist/apis/sendVideo.js +0 -134
- package/node_modules/zca-js/dist/apis/sendVoice.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/sendVoice.js +0 -89
- package/node_modules/zca-js/dist/apis/setHiddenConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setHiddenConversations.js +0 -39
- package/node_modules/zca-js/dist/apis/setMute.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/setMute.js +0 -67
- package/node_modules/zca-js/dist/apis/setPinnedConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setPinnedConversations.js +0 -34
- package/node_modules/zca-js/dist/apis/sharePoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sharePoll.js +0 -28
- package/node_modules/zca-js/dist/apis/unblockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/unblockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/undo.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/undo.js +0 -42
- package/node_modules/zca-js/dist/apis/undoFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/undoFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/updateActiveStatus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/updateActiveStatus.js +0 -27
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.js +0 -34
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.js +0 -40
- package/node_modules/zca-js/dist/apis/updateAutoReply.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateAutoReply.js +0 -38
- package/node_modules/zca-js/dist/apis/updateBankAccount.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateBankAccount.js +0 -31
- package/node_modules/zca-js/dist/apis/updateCatalog.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateCatalog.js +0 -30
- package/node_modules/zca-js/dist/apis/updateGroupSettings.d.ts +0 -40
- package/node_modules/zca-js/dist/apis/updateGroupSettings.js +0 -43
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.js +0 -30
- package/node_modules/zca-js/dist/apis/updateLabels.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateLabels.js +0 -34
- package/node_modules/zca-js/dist/apis/updateLang.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/updateLang.js +0 -30
- package/node_modules/zca-js/dist/apis/updateProductCatalog.d.ts +0 -25
- package/node_modules/zca-js/dist/apis/updateProductCatalog.js +0 -51
- package/node_modules/zca-js/dist/apis/updateProfile.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/updateProfile.js +0 -43
- package/node_modules/zca-js/dist/apis/updateProfileBio.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateProfileBio.js +0 -27
- package/node_modules/zca-js/dist/apis/updateQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateQuickMessage.js +0 -61
- package/node_modules/zca-js/dist/apis/updateSettings.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/updateSettings.js +0 -90
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.js +0 -27
- package/node_modules/zca-js/dist/apis/uploadAttachment.d.ts +0 -50
- package/node_modules/zca-js/dist/apis/uploadAttachment.js +0 -197
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.js +0 -50
- package/node_modules/zca-js/dist/apis/votePoll.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/votePoll.js +0 -29
- package/node_modules/zca-js/dist/apis.d.ts +0 -317
- package/node_modules/zca-js/dist/apis.js +0 -319
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiError.cjs +0 -11
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/apis/acceptFriendRequest.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/addPollOptions.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/addQuickMessage.cjs +0 -65
- package/node_modules/zca-js/dist/cjs/apis/addReaction.cjs +0 -308
- package/node_modules/zca-js/dist/cjs/apis/addUnreadMark.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/addUserToGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/blockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/blockViewFeed.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/changeAccountAvatar.cjs +0 -57
- package/node_modules/zca-js/dist/cjs/apis/changeFriendAlias.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/changeGroupAvatar.cjs +0 -49
- package/node_modules/zca-js/dist/cjs/apis/changeGroupName.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/changeGroupOwner.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/createAutoReply.cjs +0 -42
- package/node_modules/zca-js/dist/cjs/apis/createBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/createCatalog.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/createGroup.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/createNote.cjs +0 -52
- package/node_modules/zca-js/dist/cjs/apis/createPoll.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/createProductCatalog.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/createReminder.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/custom.cjs +0 -19
- package/node_modules/zca-js/dist/cjs/apis/deleteAutoReply.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/deleteAvatar.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/deleteCatalog.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/deleteChat.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/deleteGroupInviteBox.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/deleteProductCatalog.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/disableGroupLink.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/disperseGroup.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/editNote.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/editReminder.cjs +0 -75
- package/node_modules/zca-js/dist/cjs/apis/enableGroupLink.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/fetchAccountInfo.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/findUser.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/findUserByUsername.cjs +0 -41
- package/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs +0 -129
- package/node_modules/zca-js/dist/cjs/apis/getAliasList.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getAllFriends.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/getAllGroups.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/getArchivedChatList.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getAutoDeleteChat.cjs +0 -26
- package/node_modules/zca-js/dist/cjs/apis/getAutoReplyList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getAvatarList.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getAvatarUrlProfile.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/getBizAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getCatalogList.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getCloseFriends.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getContext.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getCookie.cjs +0 -14
- package/node_modules/zca-js/dist/cjs/apis/getFriendBoardList.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/getFriendOnlines.cjs +0 -40
- package/node_modules/zca-js/dist/cjs/apis/getFriendRecommendations.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getFriendRequestStatus.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getFullAvatar.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupBlockedMember.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getGroupChatHistory.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/getGroupInfo.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxInfo.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxList.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkDetail.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkInfo.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getGroupMembersInfo.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getHiddenConversations.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getLabels.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getListBank.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getListBankAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getListBoard.cjs +0 -59
- package/node_modules/zca-js/dist/cjs/apis/getListDevice.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getListReminder.cjs +0 -61
- package/node_modules/zca-js/dist/cjs/apis/getMultiUsersByPhones.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/getMute.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getOwnId.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getPendingGroupMembers.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getPinConversations.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getPollDetail.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getProductCatalogList.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/getQR.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getQuickMessageList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getRelatedFriendGroup.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getReminder.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getReminderResponses.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSentFriendRequest.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSettings.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getStickerCategoryDetail.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getStickers.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getStickersDetail.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getUnreadMark.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getUserInfo.cjs +0 -58
- package/node_modules/zca-js/dist/cjs/apis/inviteUserToGroups.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/joinGroupInviteBox.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/joinGroupLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/keepAlive.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/lastOnline.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/leaveGroup.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/listen.cjs +0 -440
- package/node_modules/zca-js/dist/cjs/apis/lockPoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/login.cjs +0 -102
- package/node_modules/zca-js/dist/cjs/apis/loginQR.cjs +0 -368
- package/node_modules/zca-js/dist/cjs/apis/logoutV2.cjs +0 -83
- package/node_modules/zca-js/dist/cjs/apis/lostFocus.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/parseLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/registerCatalog.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/rejectFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeFriend.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeFriendAlias.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/removeGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/removeQuickMessage.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeReminder.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/removeUnreadMark.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/removeUserFromGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/resetHiddenConversPin.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/reuseAvatar.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/reviewPendingMemberRequest.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/scanURL.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/searchSticker.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs +0 -68
- package/node_modules/zca-js/dist/cjs/apis/sendCard.cjs +0 -89
- package/node_modules/zca-js/dist/cjs/apis/sendDeliveredEvent.cjs +0 -69
- package/node_modules/zca-js/dist/cjs/apis/sendFriendRequest.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/sendLink.cjs +0 -92
- package/node_modules/zca-js/dist/cjs/apis/sendMessage.cjs +0 -500
- package/node_modules/zca-js/dist/cjs/apis/sendReport.cjs +0 -67
- package/node_modules/zca-js/dist/cjs/apis/sendSeenEvent.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/sendSticker.cjs +0 -88
- package/node_modules/zca-js/dist/cjs/apis/sendTypingEvent.cjs +0 -47
- package/node_modules/zca-js/dist/cjs/apis/sendVideo.cjs +0 -148
- package/node_modules/zca-js/dist/cjs/apis/sendVoice.cjs +0 -103
- package/node_modules/zca-js/dist/cjs/apis/setHiddenConversations.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/setMute.cjs +0 -81
- package/node_modules/zca-js/dist/cjs/apis/setPinnedConversations.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/sharePoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/unblockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/undo.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/undoFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateActiveStatus.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateArchivedChatList.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateAutoDeleteChat.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/updateAutoReply.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/updateBankAccount.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/updateCatalog.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateGroupSettings.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateHiddenConversPin.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateLabels.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateLang.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateProductCatalog.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/updateProfile.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateProfileBio.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateQuickMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/updateSettings.cjs +0 -95
- package/node_modules/zca-js/dist/cjs/apis/upgradeGroupToCommunity.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/uploadAttachment.cjs +0 -211
- package/node_modules/zca-js/dist/cjs/apis/uploadProductPhoto.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/votePoll.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis.cjs +0 -324
- package/node_modules/zca-js/dist/cjs/context.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/index.cjs +0 -159
- package/node_modules/zca-js/dist/cjs/models/AutoReply.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/Bank.cjs +0 -263
- package/node_modules/zca-js/dist/cjs/models/Board.cjs +0 -8
- package/node_modules/zca-js/dist/cjs/models/DeliveredMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Enum.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/models/FriendEvent.cjs +0 -87
- package/node_modules/zca-js/dist/cjs/models/Group.cjs +0 -13
- package/node_modules/zca-js/dist/cjs/models/GroupEvent.cjs +0 -94
- package/node_modules/zca-js/dist/cjs/models/Message.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/models/Reaction.cjs +0 -74
- package/node_modules/zca-js/dist/cjs/models/Reminder.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/SeenMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Typing.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Undo.cjs +0 -16
- package/node_modules/zca-js/dist/cjs/models/ZBusiness.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/update.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/utils.cjs +0 -703
- package/node_modules/zca-js/dist/cjs/zalo.cjs +0 -112
- package/node_modules/zca-js/dist/context.d.ts +0 -179
- package/node_modules/zca-js/dist/context.js +0 -28
- package/node_modules/zca-js/dist/index.d.ts +0 -166
- package/node_modules/zca-js/dist/index.js +0 -14
- package/node_modules/zca-js/dist/models/Attachment.d.ts +0 -9
- package/node_modules/zca-js/dist/models/Attachment.js +0 -1
- package/node_modules/zca-js/dist/models/AutoReply.d.ts +0 -20
- package/node_modules/zca-js/dist/models/AutoReply.js +0 -7
- package/node_modules/zca-js/dist/models/Bank.d.ts +0 -291
- package/node_modules/zca-js/dist/models/Bank.js +0 -262
- package/node_modules/zca-js/dist/models/Board.d.ts +0 -60
- package/node_modules/zca-js/dist/models/Board.js +0 -6
- package/node_modules/zca-js/dist/models/Catalog.d.ts +0 -16
- package/node_modules/zca-js/dist/models/Catalog.js +0 -1
- package/node_modules/zca-js/dist/models/DeliveredMessage.d.ts +0 -27
- package/node_modules/zca-js/dist/models/DeliveredMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Enum.d.ts +0 -21
- package/node_modules/zca-js/dist/models/Enum.js +0 -25
- package/node_modules/zca-js/dist/models/FriendEvent.d.ts +0 -107
- package/node_modules/zca-js/dist/models/FriendEvent.js +0 -83
- package/node_modules/zca-js/dist/models/Group.d.ts +0 -125
- package/node_modules/zca-js/dist/models/Group.js +0 -11
- package/node_modules/zca-js/dist/models/GroupEvent.d.ts +0 -178
- package/node_modules/zca-js/dist/models/GroupEvent.js +0 -90
- package/node_modules/zca-js/dist/models/Label.d.ts +0 -10
- package/node_modules/zca-js/dist/models/Label.js +0 -1
- package/node_modules/zca-js/dist/models/Message.d.ts +0 -91
- package/node_modules/zca-js/dist/models/Message.js +0 -29
- package/node_modules/zca-js/dist/models/ProductCatalog.d.ts +0 -17
- package/node_modules/zca-js/dist/models/ProductCatalog.js +0 -1
- package/node_modules/zca-js/dist/models/QuickMessage.d.ts +0 -25
- package/node_modules/zca-js/dist/models/QuickMessage.js +0 -1
- package/node_modules/zca-js/dist/models/Reaction.d.ts +0 -85
- package/node_modules/zca-js/dist/models/Reaction.js +0 -70
- package/node_modules/zca-js/dist/models/Reminder.d.ts +0 -51
- package/node_modules/zca-js/dist/models/Reminder.js +0 -7
- package/node_modules/zca-js/dist/models/SeenMessage.d.ts +0 -26
- package/node_modules/zca-js/dist/models/SeenMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Sticker.d.ts +0 -27
- package/node_modules/zca-js/dist/models/Sticker.js +0 -1
- package/node_modules/zca-js/dist/models/Typing.d.ts +0 -24
- package/node_modules/zca-js/dist/models/Typing.js +0 -17
- package/node_modules/zca-js/dist/models/Undo.d.ts +0 -34
- package/node_modules/zca-js/dist/models/Undo.js +0 -12
- package/node_modules/zca-js/dist/models/User.d.ts +0 -70
- package/node_modules/zca-js/dist/models/User.js +0 -1
- package/node_modules/zca-js/dist/models/ZBusiness.d.ts +0 -22
- package/node_modules/zca-js/dist/models/ZBusiness.js +0 -35
- package/node_modules/zca-js/dist/models/index.d.ts +0 -22
- package/node_modules/zca-js/dist/models/index.js +0 -22
- package/node_modules/zca-js/dist/update.d.ts +0 -2
- package/node_modules/zca-js/dist/update.js +0 -29
- package/node_modules/zca-js/dist/utils.d.ts +0 -167
- package/node_modules/zca-js/dist/utils.js +0 -719
- package/node_modules/zca-js/dist/zalo.d.ts +0 -41
- package/node_modules/zca-js/dist/zalo.js +0 -107
- package/node_modules/zca-js/eslint.config.js +0 -21
- package/node_modules/zca-js/index.d.ts +0 -2
- package/node_modules/zca-js/package.json +0 -78
- package/node_modules/zca-js/rollup.config.js +0 -28
- package/patches/zca-js+2.2.0.patch +0 -1445
- package/src/cli.test.js +0 -127
- package/src/core/forward.js +0 -112
- package/src/core/group-history.js +0 -248
- package/src/core/group-invite.js +0 -53
- package/src/core/offline-queue.js +0 -194
- package/src/core/pin.js +0 -222
- package/src/core/socket-tap.js +0 -154
- package/src/core/sync-v2/assets.js +0 -181
- package/src/core/sync-v2/gid.js +0 -106
- package/src/core/sync-v2/keepalive.js +0 -177
- package/src/core/sync-v2/message-types.js +0 -522
- package/src/core/sync-v2/renewlink.js +0 -124
- package/src/core/sync-v2/zcloud-cipher.js +0 -88
- package/src/core/zca-custom.js +0 -78
- package/src/mcp/message-buffer.test.js +0 -360
- package/src/mcp/notifier.test.js +0 -275
- package/src/mcp/thread-filter.test.js +0 -206
- package/src/mcp/thread-name-cache.test.js +0 -142
- package/src/utils/atomic-file.js +0 -209
- package/src/utils/bank-helpers.test.js +0 -66
- package/src/utils/device-fingerprint.js +0 -72
- package/src/utils/mentions.js +0 -140
- package/src/utils/proxy-helpers.test.js +0 -36
- package/src/utils/split-message.js +0 -166
- package/src/utils/urgency.js +0 -29
- /package/src/{core → zalo/custom}/user-info.js +0 -0
- /package/src/{utils → zalo/format}/extract-message-text.js +0 -0
- /package/src/{utils → zalo/format}/markdown.js +0 -0
|
@@ -0,0 +1,802 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* zCloud ("Cloud của tôi") and the per-conversation media store.
|
|
3
|
+
*
|
|
4
|
+
* This is the SECOND place Zalo keeps media, and it is reached by a completely
|
|
5
|
+
* different route from transfer-sync-v2. The sync stream (cmd 590/601) carries
|
|
6
|
+
* message rows with CDN references; none of it knows about the cloud. The
|
|
7
|
+
* cloud has its own boot event and its own REST surface, authenticated
|
|
8
|
+
* differently from every other Zalo endpoint:
|
|
9
|
+
*
|
|
10
|
+
* cmd 621 `mycloudMedia` -- "your cloud index may be stale, go verify"
|
|
11
|
+
* Zalo throttles acting on this to once per 30 minutes.
|
|
12
|
+
*
|
|
13
|
+
* GET {auth}/api/getCloudViewerKey (12741) -- {viewer_key, enk}, no params
|
|
14
|
+
* GET {zcloud}/cloudmedia/queue/pc/verify (12740) -- the cloud queue, paged by lastNoiseId
|
|
15
|
+
* GET {zcloud}/cloudmedia/downloadurls/pc/v1 (12743) -- noiseId -> signed URL, 100 per call
|
|
16
|
+
* GET {zcloud}/cloudmedia/info/pc/v2/usage (12749) -- plan, quota, usage
|
|
17
|
+
* GET {zcloud}/cloudmedia/info/pc/v1/cloud-settings (12756) -- per-file limit, opt-in
|
|
18
|
+
*
|
|
19
|
+
* {auth} is https://wpa.chat.zalo.me, the host the login talks to. {zcloud}
|
|
20
|
+
* is the service map's `zcloud` entry, falling back to https://zcld.chat.zalo.me
|
|
21
|
+
* exactly as Zalo does. "verify_v2" (12761, chosen when the plan
|
|
22
|
+
* is zcloud) is the same path; the client strips the command id before sending,
|
|
23
|
+
* so it never reaches the wire.
|
|
24
|
+
*
|
|
25
|
+
* HOW zCLOUD SIGNS IN — the handshake `sync-cloud` used to skip, which is why it
|
|
26
|
+
* failed with "Invalid CloudViewerKey" (-205, the client's INVALID_VIEWERKEY):
|
|
27
|
+
*
|
|
28
|
+
* 1. The account's {viewer_key, enk}: from ctx.loginInfo.zcloud when it carries
|
|
29
|
+
* both, otherwise from getCloudViewerKey (a session-encrypted reply).
|
|
30
|
+
* 2. viewer_key travels as the HTTP header `cloud-viewer-key` on every call.
|
|
31
|
+
* 3. `params` is encrypted with enk, not the session key (./kernel/zcloud-cipher.js).
|
|
32
|
+
* Replies are {error_code, data}; 0 and -904 are success and `data` is the
|
|
33
|
+
* payload itself, encrypted with enk.
|
|
34
|
+
* 4. -205 / -1 mean the key is stale. Zalo drops its key on those codes and
|
|
35
|
+
* fails that request (the next call fetches a new one). Here the cached key is dropped too,
|
|
36
|
+
* and a key that was not fetched for this very request is fetched once through
|
|
37
|
+
* getCloudViewerKey and the GET repeated once: one extra request, so that a stale key from
|
|
38
|
+
* the login does not fail the first call of a run.
|
|
39
|
+
* 5. Other failures follow Zalo's retry rules: server code 112, a dropped connection,
|
|
40
|
+
* an unreadable reply and an HTTP 4xx/5xx are retried after 0, 5, 5 and 10 s (a 4xx/5xx
|
|
41
|
+
* also moves to the service map's next zCloud domain); -201 and anything else fail at once.
|
|
42
|
+
*
|
|
43
|
+
* zCLOUD IS A PARTIAL SOURCE. It can confirm that an item is in the cloud; it
|
|
44
|
+
* can never show that an item does not exist. It only ever holds what fit under
|
|
45
|
+
* the quota and the per-file limit, for opted-in services, from the opt-in date
|
|
46
|
+
* onward — and never disappearing (TTL) messages or disallowed types or
|
|
47
|
+
* conversations (the client records those reasons as ttl_message, not_allow_types,
|
|
48
|
+
* not_allow_convs). Everything else exists only on the local-cache path, which
|
|
49
|
+
* for this CLI is the phone-backed transfer-sync-v2 restore and zalo.db. So:
|
|
50
|
+
* only queue entries whose action is `add` are recorded as cloud items (`remove`,
|
|
51
|
+
* `del_thread` and `reset_cloud` are applied to the index, so a recall or a cleared
|
|
52
|
+
* conversation takes its items out; `temp` and `duplicate` change nothing), a walk is
|
|
53
|
+
* `complete` only when the server says it has nothing more, and a lookup miss is
|
|
54
|
+
* reported as inconclusive ({@link lookupCloudBackup}).
|
|
55
|
+
*
|
|
56
|
+
* THE E2EE BOUNDARY. Each item's `encryptInfo` (its per-item key and media
|
|
57
|
+
* metadata) is end-to-end encrypted per client: the per-item key is wrapped for a
|
|
58
|
+
* key that comes from the owner's own cloud PIN, which this client never holds. It
|
|
59
|
+
* is stored exactly as received and never decrypted here; the routing fields in
|
|
60
|
+
* `msgInfo` (ids, timestamps, types) and the version numbers in `encryptInfo` are
|
|
61
|
+
* plain and are the only ones read. Acquiring that key, and with it downloading and
|
|
62
|
+
* decrypting blobs, is out of scope for this client (decision D8 of the 3.0 plan).
|
|
63
|
+
*
|
|
64
|
+
* The request shapes are unit-tested, but this module's tests do not talk to
|
|
65
|
+
* the live server.
|
|
66
|
+
*/
|
|
67
|
+
import { boundUtils } from "./kernel/bound.js";
|
|
68
|
+
import { decryptZCloud, encodeZCloudParams } from "./kernel/zcloud-cipher.js";
|
|
69
|
+
import { createDownloadFetch } from "./download-fetch.js";
|
|
70
|
+
import { cloudBlobRequest } from "./zcloud-e2ee.js";
|
|
71
|
+
|
|
72
|
+
/** Where the viewer key is issued: the auth domain, the session's login host. */
|
|
73
|
+
const AUTH_DOMAIN = "https://wpa.chat.zalo.me";
|
|
74
|
+
/** The fallback when the service map lacks `zcloud`. */
|
|
75
|
+
const ZCLOUD_DOMAIN = "https://zcld.chat.zalo.me";
|
|
76
|
+
|
|
77
|
+
const PATH = {
|
|
78
|
+
viewerKey: "/api/getCloudViewerKey",
|
|
79
|
+
familyViewerKey: "/api/getFamilyViewerKey",
|
|
80
|
+
verify: "/cloudmedia/queue/pc/verify",
|
|
81
|
+
downloadUrls: "/cloudmedia/downloadurls/pc/v1",
|
|
82
|
+
usage: "/cloudmedia/info/pc/v2/usage",
|
|
83
|
+
myCloudUsage: "/cloudmedia/info/pc/v1/usage-mycloud",
|
|
84
|
+
familyUsage: "/cloudmedia/info/pc/v1/family-usage",
|
|
85
|
+
settings: "/cloudmedia/info/pc/v1/cloud-settings",
|
|
86
|
+
subscription: "/zalocloud/cloudinfopcweb/v1/info",
|
|
87
|
+
};
|
|
88
|
+
|
|
89
|
+
/** Reply codes the client accepts as success. */
|
|
90
|
+
const OK_CODES = new Set([0, -904]);
|
|
91
|
+
/** cloud_viewer_expired, invalid_cloud_viewer_key: the codes that reload the key. */
|
|
92
|
+
const VIEWER_KEY_ERRORS = new Set([-1, -205]);
|
|
93
|
+
/**
|
|
94
|
+
* The one server code that is retried (the rest of the retry list is transport: timeouts, no network, bad
|
|
95
|
+
* data). Every other code fails at once, -201 (over the limit) among them.
|
|
96
|
+
*/
|
|
97
|
+
const RETRY_ERROR_CODES = new Set([112]);
|
|
98
|
+
/** Waits before each retry (0, 5, 5, 10 s). */
|
|
99
|
+
let retryDelaysMs = [0, 5000, 5000, 10000];
|
|
100
|
+
|
|
101
|
+
/**
|
|
102
|
+
* Change how long zCloud calls wait between retries (tests set zeros).
|
|
103
|
+
*
|
|
104
|
+
* @param {{delaysMs?: number[]}} opts
|
|
105
|
+
*/
|
|
106
|
+
export function configureZCloudRetry({ delaysMs } = {}) {
|
|
107
|
+
if (Array.isArray(delaysMs)) retryDelaysMs = delaysMs;
|
|
108
|
+
}
|
|
109
|
+
/** Download URLs are asked for this many noise ids at a time. */
|
|
110
|
+
const DOWNLOAD_URL_BATCH = 100;
|
|
111
|
+
/** verify `loadType`: oldest_to_newest, what a full walk sends. */
|
|
112
|
+
export const LOAD_OLDEST_TO_NEWEST = 1;
|
|
113
|
+
/**
|
|
114
|
+
* verify `tracking_source`, a telemetry tag (Unknown 0, Start_session 1, Need_Verify_CMD 2, Re_login 3,
|
|
115
|
+
* Client 4). Every observed walk page sends 2, the walk the cmd 621 notice asks for.
|
|
116
|
+
*/
|
|
117
|
+
const TRACKING_NEED_VERIFY = 2;
|
|
118
|
+
/** msgInfo.destType for a group; users are 3, pages 5. */
|
|
119
|
+
const DEST_TYPE_GROUP = 6;
|
|
120
|
+
/** Queue entry actions. Only `add` says an item is in the cloud. */
|
|
121
|
+
export const ACTION = { 1: "add", 2: "remove", 3: "del_thread", 4: "temp", 5: "reset_cloud", 6: "duplicate" };
|
|
122
|
+
/** usage.plan values. */
|
|
123
|
+
const PLAN = { [-1]: "free", 0: "zcloud", 69: "free_after_grace_period", 100: "grace_period" };
|
|
124
|
+
|
|
125
|
+
/** A zCloud or viewer-key failure, carrying the server's error_code when there is one. */
|
|
126
|
+
export class ZCloudError extends Error {
|
|
127
|
+
/**
|
|
128
|
+
* @param {string} message - never contains key material
|
|
129
|
+
* @param {number|null} [code] - Zalo error_code or HTTP status
|
|
130
|
+
* @param {{http?: boolean, transient?: boolean, payload?: any}} [extra] - http: `code` is an HTTP status;
|
|
131
|
+
* transient: worth retrying; payload: the decrypted body of an error reply, when it had one
|
|
132
|
+
*/
|
|
133
|
+
constructor(message, code = null, extra = {}) {
|
|
134
|
+
super(message);
|
|
135
|
+
this.name = "ZCloudError";
|
|
136
|
+
this.code = code;
|
|
137
|
+
this.http = !!extra.http;
|
|
138
|
+
this.transient = !!extra.transient;
|
|
139
|
+
if (extra.payload !== undefined) this.payload = extra.payload;
|
|
140
|
+
}
|
|
141
|
+
}
|
|
142
|
+
|
|
143
|
+
/** The zCloud media domains, in the service map's order, with the fallback when it names none. */
|
|
144
|
+
function cloudDomains(api) {
|
|
145
|
+
const v = api?.zpwServiceMap?.zcloud;
|
|
146
|
+
const urls = (Array.isArray(v) ? v : [v]).filter(Boolean).map((u) => String(u).replace(/\/+$/, ""));
|
|
147
|
+
return urls.length ? urls : [ZCLOUD_DOMAIN];
|
|
148
|
+
}
|
|
149
|
+
|
|
150
|
+
/** Run `fn(ctx, utils)` with the session's bound request helpers (src/zalo/kernel/bound.js). */
|
|
151
|
+
async function withSession(api, fn) {
|
|
152
|
+
return fn(api.getContext(), boundUtils(api));
|
|
153
|
+
}
|
|
154
|
+
|
|
155
|
+
// ── the viewer key ──────────────────────────────────────────────────────────
|
|
156
|
+
|
|
157
|
+
/** Resolved keys, per session context. Never logged, never persisted. */
|
|
158
|
+
const keyCache = new WeakMap();
|
|
159
|
+
/** Sessions whose login-info key the server has refused once; they fetch their key instead. */
|
|
160
|
+
const loginKeyRefused = new WeakSet();
|
|
161
|
+
|
|
162
|
+
/** A usable {viewer_key, enk} pair, or null. */
|
|
163
|
+
function keyPair(obj, source) {
|
|
164
|
+
const viewerKey = obj?.viewer_key;
|
|
165
|
+
const enk = obj?.enk;
|
|
166
|
+
if (typeof viewerKey !== "string" || !viewerKey || typeof enk !== "string" || !enk) return null;
|
|
167
|
+
return { viewerKey, enk, source };
|
|
168
|
+
}
|
|
169
|
+
|
|
170
|
+
/**
|
|
171
|
+
* Fetch the account's zCloud viewer key pair from the auth domain.
|
|
172
|
+
*
|
|
173
|
+
* `GET https://wpa.chat.zalo.me/api/getCloudViewerKey?zpw_ver&zpw_type`, no
|
|
174
|
+
* params, answered in the ordinary session envelope. The result also replaces
|
|
175
|
+
* the key this session uses for later zCloud calls.
|
|
176
|
+
*
|
|
177
|
+
* @param {object} api - logged-in session
|
|
178
|
+
* @returns {Promise<{viewerKey: string, enk: string, source: "getCloudViewerKey"}>}
|
|
179
|
+
* @throws {ZCloudError} when the call fails or yields no key (no subscription)
|
|
180
|
+
*/
|
|
181
|
+
export async function getCloudViewerKey(api) {
|
|
182
|
+
const key = await fetchViewerKey(api, PATH.viewerKey, "getCloudViewerKey");
|
|
183
|
+
keyCache.set(api.getContext(), key);
|
|
184
|
+
return key;
|
|
185
|
+
}
|
|
186
|
+
|
|
187
|
+
/** The family plan's viewer key, kept apart from the account's own: `GET /api/getFamilyViewerKey`, same envelope. */
|
|
188
|
+
const familyKeyCache = new WeakMap();
|
|
189
|
+
|
|
190
|
+
/**
|
|
191
|
+
* Fetch the family plan's zCloud viewer key pair. A read; it replaces only the family key kept for this session.
|
|
192
|
+
*
|
|
193
|
+
* @param {object} api - logged-in session
|
|
194
|
+
* @returns {Promise<{viewerKey: string, enk: string, source: "getFamilyViewerKey"}>}
|
|
195
|
+
* @throws {ZCloudError} when the call fails or yields no key (no family plan)
|
|
196
|
+
*/
|
|
197
|
+
export async function getFamilyViewerKey(api) {
|
|
198
|
+
const key = await fetchViewerKey(api, PATH.familyViewerKey, "getFamilyViewerKey");
|
|
199
|
+
familyKeyCache.set(api.getContext(), key);
|
|
200
|
+
return key;
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/** One session-encrypted key request to the auth domain. */
|
|
204
|
+
async function fetchViewerKey(api, path, source) {
|
|
205
|
+
let data;
|
|
206
|
+
try {
|
|
207
|
+
data = await withSession(api, async (_ctx, utils) => {
|
|
208
|
+
const resp = await utils.request(utils.makeURL(`${AUTH_DOMAIN}${path}`), { method: "GET" });
|
|
209
|
+
return utils.resolve(resp);
|
|
210
|
+
});
|
|
211
|
+
} catch (e) {
|
|
212
|
+
throw new ZCloudError(`${source} failed: ${e?.message || e}`, e?.code ?? null);
|
|
213
|
+
}
|
|
214
|
+
if (typeof data === "string") {
|
|
215
|
+
try {
|
|
216
|
+
data = JSON.parse(data);
|
|
217
|
+
} catch {
|
|
218
|
+
data = null;
|
|
219
|
+
}
|
|
220
|
+
}
|
|
221
|
+
const key = keyPair(data, source);
|
|
222
|
+
if (!key) {
|
|
223
|
+
throw new ZCloudError(
|
|
224
|
+
"Zalo returned no zCloud viewer key for this account (no zCloud subscription, or it has lapsed)",
|
|
225
|
+
);
|
|
226
|
+
}
|
|
227
|
+
return key;
|
|
228
|
+
}
|
|
229
|
+
|
|
230
|
+
/**
|
|
231
|
+
* The key pair to use now: this session's cached one, else the login info's
|
|
232
|
+
* `zcloud` field, else a fresh getCloudViewerKey.
|
|
233
|
+
*
|
|
234
|
+
* @returns {Promise<{key: object, fetched: boolean}>} fetched: true when this call went to the network
|
|
235
|
+
*/
|
|
236
|
+
async function resolveCloudKey(api) {
|
|
237
|
+
const ctx = api.getContext();
|
|
238
|
+
const cached = keyCache.get(ctx);
|
|
239
|
+
if (cached) return { key: cached, fetched: false };
|
|
240
|
+
// The login's key is only ever tried until the server has refused a key: after that it is known stale.
|
|
241
|
+
const fromLogin = loginKeyRefused.has(ctx) ? null : keyPair(ctx?.loginInfo?.zcloud, "loginInfo");
|
|
242
|
+
if (fromLogin) {
|
|
243
|
+
keyCache.set(ctx, fromLogin);
|
|
244
|
+
return { key: fromLogin, fetched: false };
|
|
245
|
+
}
|
|
246
|
+
return { key: await getCloudViewerKey(api), fetched: true };
|
|
247
|
+
}
|
|
248
|
+
|
|
249
|
+
// ── the zCloud transport ────────────────────────────────────────────────────
|
|
250
|
+
|
|
251
|
+
/** Unwrap a zCloud reply: accept 0 / -904, decrypt `data` with enk. */
|
|
252
|
+
async function decodeZCloudReply(resp, enk) {
|
|
253
|
+
if (!resp?.ok) {
|
|
254
|
+
throw new ZCloudError(`zCloud request failed with HTTP ${resp?.status}`, resp?.status ?? null, {
|
|
255
|
+
http: true,
|
|
256
|
+
transient: true,
|
|
257
|
+
});
|
|
258
|
+
}
|
|
259
|
+
let body;
|
|
260
|
+
try {
|
|
261
|
+
body = await resp.json();
|
|
262
|
+
} catch {
|
|
263
|
+
throw new ZCloudError("zCloud reply is not JSON", null, { transient: true });
|
|
264
|
+
}
|
|
265
|
+
const code = Number(body?.error_code);
|
|
266
|
+
if (!OK_CODES.has(code)) {
|
|
267
|
+
const msg = body?.error_message || "no message";
|
|
268
|
+
// An error reply can carry its own detail, encrypted like any other payload.
|
|
269
|
+
let payload;
|
|
270
|
+
if (body?.data) {
|
|
271
|
+
try {
|
|
272
|
+
payload = JSON.parse(decryptZCloud(body.data, enk));
|
|
273
|
+
} catch {
|
|
274
|
+
payload = undefined;
|
|
275
|
+
}
|
|
276
|
+
}
|
|
277
|
+
throw new ZCloudError(`zCloud error ${body?.error_code}: ${msg}`, Number.isFinite(code) ? code : null, {
|
|
278
|
+
transient: RETRY_ERROR_CODES.has(code),
|
|
279
|
+
payload,
|
|
280
|
+
});
|
|
281
|
+
}
|
|
282
|
+
if (body.data === undefined || body.data === null || body.data === "") return null;
|
|
283
|
+
let text;
|
|
284
|
+
try {
|
|
285
|
+
text = decryptZCloud(body.data, enk);
|
|
286
|
+
} catch (e) {
|
|
287
|
+
throw new ZCloudError(`zCloud reply could not be decrypted with the viewer key's enk (${e.message})`, null, {
|
|
288
|
+
transient: true,
|
|
289
|
+
});
|
|
290
|
+
}
|
|
291
|
+
try {
|
|
292
|
+
return JSON.parse(text);
|
|
293
|
+
} catch {
|
|
294
|
+
throw new ZCloudError("zCloud reply decrypted to something that is not JSON", null, { transient: true });
|
|
295
|
+
}
|
|
296
|
+
}
|
|
297
|
+
|
|
298
|
+
/** One GET to zCloud with a given key pair, exactly as the server expects it. */
|
|
299
|
+
function sendZCloud(api, path, params, key, base) {
|
|
300
|
+
return withSession(api, async (_ctx, utils) => {
|
|
301
|
+
let url = utils.makeURL(`${base}${path}`);
|
|
302
|
+
if (params) url += `¶ms=${encodeZCloudParams(params, key.enk)}`;
|
|
303
|
+
const resp = await utils.request(url, { method: "GET", headers: { "cloud-viewer-key": key.viewerKey } });
|
|
304
|
+
return decodeZCloudReply(resp, key.enk);
|
|
305
|
+
});
|
|
306
|
+
}
|
|
307
|
+
|
|
308
|
+
const sleep = (ms) => new Promise((resolve) => setTimeout(resolve, ms));
|
|
309
|
+
|
|
310
|
+
/**
|
|
311
|
+
* GET a zCloud endpoint.
|
|
312
|
+
*
|
|
313
|
+
* - A stale viewer key (-1 / -205) is dropped from the cache. A key that was not fetched for this very request is
|
|
314
|
+
* then fetched once and the call repeated (the repeat is a GET, so it costs
|
|
315
|
+
* nothing but one request).
|
|
316
|
+
* - Transient failures are retried after 0, 5, 5 and 10 s: server code 112, a dropped or unreachable connection, a
|
|
317
|
+
* reply that is not valid data, and an HTTP 4xx/5xx, which also moves to the next zCloud domain of the service map.
|
|
318
|
+
* - Server code -201 fails at once, and so does everything else.
|
|
319
|
+
*
|
|
320
|
+
* @param {object} api
|
|
321
|
+
* @param {string} path
|
|
322
|
+
* @param {object|null} [params] - encrypted into `params` with enk; omitted when null
|
|
323
|
+
* @returns {Promise<any>} the decrypted payload
|
|
324
|
+
*/
|
|
325
|
+
async function zcloudGet(api, path, params = null) {
|
|
326
|
+
const ctx = api.getContext();
|
|
327
|
+
let { key, fetched } = await resolveCloudKey(api);
|
|
328
|
+
const bases = cloudDomains(api);
|
|
329
|
+
let base = 0;
|
|
330
|
+
for (let retry = 0; ; retry++) {
|
|
331
|
+
try {
|
|
332
|
+
return await sendZCloud(api, path, params, key, bases[base % bases.length]);
|
|
333
|
+
} catch (e) {
|
|
334
|
+
if (e instanceof ZCloudError && !e.http && VIEWER_KEY_ERRORS.has(e.code)) {
|
|
335
|
+
keyCache.delete(ctx);
|
|
336
|
+
loginKeyRefused.add(ctx);
|
|
337
|
+
if (fetched) throw e;
|
|
338
|
+
try {
|
|
339
|
+
key = await getCloudViewerKey(api);
|
|
340
|
+
} catch (refreshErr) {
|
|
341
|
+
throw new ZCloudError(
|
|
342
|
+
`${e.message}; refreshing the viewer key failed: ${refreshErr.message}`,
|
|
343
|
+
e.code,
|
|
344
|
+
);
|
|
345
|
+
}
|
|
346
|
+
fetched = true;
|
|
347
|
+
retry--;
|
|
348
|
+
continue;
|
|
349
|
+
}
|
|
350
|
+
// Anything that is not a ZCloudError never reached a reply: the connection dropped or timed out.
|
|
351
|
+
const transient = !(e instanceof ZCloudError) || e.transient;
|
|
352
|
+
if (!transient || retry >= retryDelaysMs.length) throw e;
|
|
353
|
+
if (e instanceof ZCloudError && e.http) base++;
|
|
354
|
+
if (retryDelaysMs[retry] > 0) await sleep(retryDelaysMs[retry]);
|
|
355
|
+
}
|
|
356
|
+
}
|
|
357
|
+
}
|
|
358
|
+
|
|
359
|
+
// ── endpoints ───────────────────────────────────────────────────────────────
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* One page of the zCloud queue.
|
|
363
|
+
*
|
|
364
|
+
* @param {object} api
|
|
365
|
+
* @param {object} [page]
|
|
366
|
+
* @param {string} [page.lastNoiseId=""] - cursor; "" starts from the top
|
|
367
|
+
* @param {number} [page.loadType=1] - 1 oldest_to_newest, 0 newest_to_oldest
|
|
368
|
+
* @param {string[]} [page.listNoiseIds=[]]
|
|
369
|
+
* @param {number} [page.trackingSource=2] - telemetry tag; 2 Need_Verify_CMD
|
|
370
|
+
* @returns {Promise<{mediaItems?: object[], lastNoiseId?: string, hasMore?: number|boolean}|null>}
|
|
371
|
+
*/
|
|
372
|
+
export async function verifyCloudQueue(api, page = {}) {
|
|
373
|
+
const {
|
|
374
|
+
lastNoiseId = "",
|
|
375
|
+
loadType = LOAD_OLDEST_TO_NEWEST,
|
|
376
|
+
listNoiseIds = [],
|
|
377
|
+
trackingSource = TRACKING_NEED_VERIFY,
|
|
378
|
+
} = page;
|
|
379
|
+
return zcloudGet(api, PATH.verify, {
|
|
380
|
+
lastNoiseId: String(lastNoiseId ?? ""),
|
|
381
|
+
loadType,
|
|
382
|
+
listNoiseIds,
|
|
383
|
+
tracking_source: trackingSource,
|
|
384
|
+
});
|
|
385
|
+
}
|
|
386
|
+
|
|
387
|
+
/** How long a resolved download URL is reused (an in-memory cache). */
|
|
388
|
+
let urlCacheMs = 60_000;
|
|
389
|
+
/** Ids asked for within this window share requests (a microbatch). */
|
|
390
|
+
let urlWindowMs = 500;
|
|
391
|
+
/** This many callers waiting end the window early; so does a full request's worth of ids. */
|
|
392
|
+
const URL_FLUSH_AT = 50;
|
|
393
|
+
|
|
394
|
+
/**
|
|
395
|
+
* Change the download-URL cache and batching windows (tests use short ones).
|
|
396
|
+
*
|
|
397
|
+
* @param {{cacheMs?: number, windowMs?: number}} opts
|
|
398
|
+
*/
|
|
399
|
+
export function configureZCloudDownloads({ cacheMs, windowMs } = {}) {
|
|
400
|
+
if (Number.isFinite(cacheMs)) urlCacheMs = cacheMs;
|
|
401
|
+
if (Number.isFinite(windowMs)) urlWindowMs = windowMs;
|
|
402
|
+
}
|
|
403
|
+
|
|
404
|
+
/** Per session: resolved URLs `Map<noiseId, {url, at}>`, and the ids waiting for the next request. */
|
|
405
|
+
const urlCaches = new WeakMap();
|
|
406
|
+
const urlQueues = new WeakMap();
|
|
407
|
+
|
|
408
|
+
/** Send the waiting ids, 100 to a request, and settle everyone who asked for them. */
|
|
409
|
+
async function flushDownloadUrls(api, queue) {
|
|
410
|
+
if (queue.timer) clearTimeout(queue.timer);
|
|
411
|
+
queue.timer = null;
|
|
412
|
+
const waiting = [...queue.waiting];
|
|
413
|
+
queue.waiting = new Map();
|
|
414
|
+
queue.callers = 0;
|
|
415
|
+
const cache = urlCaches.get(api.getContext());
|
|
416
|
+
for (let i = 0; i < waiting.length; i += DOWNLOAD_URL_BATCH) {
|
|
417
|
+
const chunk = waiting.slice(i, i + DOWNLOAD_URL_BATCH);
|
|
418
|
+
let map = {};
|
|
419
|
+
try {
|
|
420
|
+
map =
|
|
421
|
+
(await zcloudGet(api, PATH.downloadUrls, { list_noise_ids: chunk.map(([id]) => id) }))?.download_urls ||
|
|
422
|
+
{};
|
|
423
|
+
} catch (e) {
|
|
424
|
+
for (const [, askers] of chunk) for (const a of askers) a.reject(e);
|
|
425
|
+
continue;
|
|
426
|
+
}
|
|
427
|
+
for (const [id, askers] of chunk) {
|
|
428
|
+
const url = typeof map[id] === "string" && map[id] ? map[id] : null;
|
|
429
|
+
if (url) cache.set(id, { url, at: Date.now() });
|
|
430
|
+
for (const a of askers) a.resolve(url);
|
|
431
|
+
}
|
|
432
|
+
}
|
|
433
|
+
}
|
|
434
|
+
|
|
435
|
+
/** Ask for these ids' URLs; resolves to one answer per id, in order: the URL, or null when Zalo has none. */
|
|
436
|
+
function queueDownloadUrls(api, ids) {
|
|
437
|
+
const ctx = api.getContext();
|
|
438
|
+
let queue = urlQueues.get(ctx);
|
|
439
|
+
if (!queue) urlQueues.set(ctx, (queue = { waiting: new Map(), callers: 0, timer: null }));
|
|
440
|
+
const asked = ids.map(
|
|
441
|
+
(id) =>
|
|
442
|
+
new Promise((resolve, reject) => {
|
|
443
|
+
const askers = queue.waiting.get(id) || [];
|
|
444
|
+
askers.push({ resolve, reject });
|
|
445
|
+
queue.waiting.set(id, askers);
|
|
446
|
+
}),
|
|
447
|
+
);
|
|
448
|
+
queue.callers++;
|
|
449
|
+
if (urlWindowMs <= 0 || queue.callers >= URL_FLUSH_AT || queue.waiting.size >= DOWNLOAD_URL_BATCH) {
|
|
450
|
+
void flushDownloadUrls(api, queue);
|
|
451
|
+
} else if (!queue.timer) {
|
|
452
|
+
queue.timer = setTimeout(() => void flushDownloadUrls(api, queue), urlWindowMs);
|
|
453
|
+
}
|
|
454
|
+
return Promise.all(asked);
|
|
455
|
+
}
|
|
456
|
+
|
|
457
|
+
/**
|
|
458
|
+
* Turn cloud noiseIds into signed download URLs.
|
|
459
|
+
*
|
|
460
|
+
* Calls made close together share requests (a 500 ms window, ended early by 50 waiting ids; 100 ids to a request),
|
|
461
|
+
* and a URL is reused for 60 s. The blob behind a URL is end-to-end encrypted per client;
|
|
462
|
+
* nothing here downloads or decrypts it. An id with no URL is `unresolved` — the client's NOT_FOUND_DOWNLOAD_URL —
|
|
463
|
+
* which is not evidence the media is gone elsewhere.
|
|
464
|
+
*
|
|
465
|
+
* @param {object} api
|
|
466
|
+
* @param {string|string[]} noiseIds
|
|
467
|
+
* @returns {Promise<{urls: Record<string, string>, unresolved: string[]}|null>} null when given no ids
|
|
468
|
+
*/
|
|
469
|
+
export async function fetchCloudDownloadUrl(api, noiseIds) {
|
|
470
|
+
const ids = [...new Set((Array.isArray(noiseIds) ? noiseIds : [noiseIds]).filter(Boolean).map(String))];
|
|
471
|
+
if (!ids.length) return null;
|
|
472
|
+
const ctx = api.getContext();
|
|
473
|
+
let cache = urlCaches.get(ctx);
|
|
474
|
+
if (!cache) urlCaches.set(ctx, (cache = new Map()));
|
|
475
|
+
const urls = {};
|
|
476
|
+
const now = Date.now();
|
|
477
|
+
const missing = [];
|
|
478
|
+
for (const id of ids) {
|
|
479
|
+
const hit = cache.get(id);
|
|
480
|
+
if (hit && now - hit.at < urlCacheMs) urls[id] = hit.url;
|
|
481
|
+
else missing.push(id);
|
|
482
|
+
}
|
|
483
|
+
const answers = missing.length ? await queueDownloadUrls(api, missing) : [];
|
|
484
|
+
missing.forEach((id, k) => {
|
|
485
|
+
if (answers[k]) urls[id] = answers[k];
|
|
486
|
+
});
|
|
487
|
+
return { urls, unresolved: ids.filter((id) => !urls[id]) };
|
|
488
|
+
}
|
|
489
|
+
|
|
490
|
+
/**
|
|
491
|
+
* Download one cloud item's blob the way the server expects (zcloud-e2ee.js, ZP-10): its signed URL from
|
|
492
|
+
* `downloadurls`, `?zcloudurl=true` (and a trailing `&` when the item has a key), the `cloud-viewer-key` header,
|
|
493
|
+
* no cookie, in the account's own identity and proxy. Unverified live: the bare URL answered 404 before.
|
|
494
|
+
*
|
|
495
|
+
* The bytes are the blob as stored: encrypted when `encrypted` is true, opened with the account's cloud key
|
|
496
|
+
* (zcloud-e2ee.js `decryptCloudBlob`), which this client never holds on its own.
|
|
497
|
+
*
|
|
498
|
+
* @param {object} api
|
|
499
|
+
* @param {{noiseId: string, encryptInfo?: object|null, cloudConversation?: boolean}} item
|
|
500
|
+
* @param {{fetch?: typeof fetch}} [opts] - the transport (tests); the account's download fetch otherwise
|
|
501
|
+
* @returns {Promise<{bytes: Buffer, encrypted: boolean, wrappedKey: string|null, algoVersion: string|null,
|
|
502
|
+
* contentType: string|null}>}
|
|
503
|
+
* @throws {ZCloudError} for no URL, a viewer key that cannot be had, or an HTTP failure (`.http`, the status as
|
|
504
|
+
* `.code`)
|
|
505
|
+
*/
|
|
506
|
+
export async function fetchCloudBlob(api, item, opts = {}) {
|
|
507
|
+
const noiseId = String(item?.noiseId ?? "");
|
|
508
|
+
if (!noiseId) throw new ZCloudError("the item has no noiseId");
|
|
509
|
+
const found = await fetchCloudDownloadUrl(api, noiseId);
|
|
510
|
+
const downloadUrl = found?.urls?.[noiseId];
|
|
511
|
+
if (!downloadUrl) throw new ZCloudError("Zalo gave no download URL for this item (NOT_FOUND_DOWNLOAD_URL)");
|
|
512
|
+
const { key } = await resolveCloudKey(api);
|
|
513
|
+
const req = cloudBlobRequest({
|
|
514
|
+
downloadUrl,
|
|
515
|
+
encryptInfo: item.encryptInfo ?? null,
|
|
516
|
+
viewerKey: key.viewerKey,
|
|
517
|
+
cloudConversation: Boolean(item.cloudConversation),
|
|
518
|
+
});
|
|
519
|
+
const fetchFn = opts.fetch ?? createDownloadFetch(api);
|
|
520
|
+
const res = await fetchFn(req.url, { method: "GET", headers: req.headers });
|
|
521
|
+
if (!res?.ok) {
|
|
522
|
+
throw new ZCloudError(`zCloud download failed with HTTP ${res?.status}`, res?.status ?? null, { http: true });
|
|
523
|
+
}
|
|
524
|
+
return {
|
|
525
|
+
bytes: Buffer.from(await res.arrayBuffer()),
|
|
526
|
+
encrypted: req.encrypted,
|
|
527
|
+
wrappedKey: req.wrappedKey,
|
|
528
|
+
algoVersion: req.algoVersion,
|
|
529
|
+
contentType: res.headers?.get?.("content-type") ?? null,
|
|
530
|
+
};
|
|
531
|
+
}
|
|
532
|
+
|
|
533
|
+
/**
|
|
534
|
+
* The account's zCloud usage: `{plan, quota, usage, service_usage}` in bytes.
|
|
535
|
+
*
|
|
536
|
+
* @param {object} api
|
|
537
|
+
* @returns {Promise<object|null>}
|
|
538
|
+
*/
|
|
539
|
+
export async function getCloudUsage(api) {
|
|
540
|
+
return zcloudGet(api, PATH.usage);
|
|
541
|
+
}
|
|
542
|
+
|
|
543
|
+
/**
|
|
544
|
+
* What the account's own cloud uses (`usage-mycloud`), a read. Zalo asks for it at startup.
|
|
545
|
+
*
|
|
546
|
+
* @param {object} api
|
|
547
|
+
* @returns {Promise<object|null>}
|
|
548
|
+
*/
|
|
549
|
+
export async function getMyCloudUsage(api) {
|
|
550
|
+
return zcloudGet(api, PATH.myCloudUsage);
|
|
551
|
+
}
|
|
552
|
+
|
|
553
|
+
/**
|
|
554
|
+
* What the family plan uses (`family-usage`), a read. Zalo asks for it at startup and shows nothing when it
|
|
555
|
+
* fails; a caller here gets the error.
|
|
556
|
+
*
|
|
557
|
+
* @param {object} api
|
|
558
|
+
* @returns {Promise<object|null>}
|
|
559
|
+
*/
|
|
560
|
+
export async function getFamilyUsage(api) {
|
|
561
|
+
return zcloudGet(api, PATH.familyUsage);
|
|
562
|
+
}
|
|
563
|
+
|
|
564
|
+
/**
|
|
565
|
+
* The zCloud subscription (`cloudinfopcweb`, command 12754): package, billing gateway, status and expiry, and the
|
|
566
|
+
* migration state. Zalo asks for it only on a paid plan; a free account gets an empty or refused answer.
|
|
567
|
+
*
|
|
568
|
+
* @param {object} api
|
|
569
|
+
* @returns {Promise<object|null>}
|
|
570
|
+
*/
|
|
571
|
+
export async function getCloudSubscription(api) {
|
|
572
|
+
return zcloudGet(api, PATH.subscription);
|
|
573
|
+
}
|
|
574
|
+
|
|
575
|
+
/**
|
|
576
|
+
* The account's zCloud settings: per-file size limits, `enable_offload`, `opt_in`.
|
|
577
|
+
*
|
|
578
|
+
* @param {object} api
|
|
579
|
+
* @returns {Promise<object|null>}
|
|
580
|
+
*/
|
|
581
|
+
export async function getCloudSettings(api) {
|
|
582
|
+
return zcloudGet(api, PATH.settings);
|
|
583
|
+
}
|
|
584
|
+
|
|
585
|
+
const finiteOrNull = (v) =>
|
|
586
|
+
v === null || v === undefined || v === "" || !Number.isFinite(Number(v)) ? null : Number(v);
|
|
587
|
+
|
|
588
|
+
/**
|
|
589
|
+
* Reduce the usage and settings replies to what the CLI reports.
|
|
590
|
+
*
|
|
591
|
+
* The two `...PerFileLimitRaw` values are the settings' numbers as sent: Zalo's own apps do not read them, so their
|
|
592
|
+
* unit is not defined anywhere (live: 100 on a free account, probably megabytes; 2147483640 on a paid one, a
|
|
593
|
+
* "no practical limit" number). They are not bytes.
|
|
594
|
+
*
|
|
595
|
+
* Over-quota is `usage > quota`, the client's own rule. `opt_in` is read as a
|
|
596
|
+
* bit set over the client's service enum (media 1, mycloud 2, backup 4).
|
|
597
|
+
*
|
|
598
|
+
* @param {object} [usage] - getCloudUsage() reply
|
|
599
|
+
* @param {object} [settings] - getCloudSettings() reply
|
|
600
|
+
* @returns {{plan: string|null, planCode: number|null, quotaBytes: number|null, usageBytes: number|null,
|
|
601
|
+
* freeBytes: number|null, overQuota: boolean|null, serviceUsage: object|null, perFileLimitRaw: number|null,
|
|
602
|
+
* myCloudPerFileLimitRaw: number|null, optIn: {media: boolean, mycloud: boolean, backup: boolean}|null}}
|
|
603
|
+
*/
|
|
604
|
+
export function summarizeCloudQuota(usage = {}, settings = {}) {
|
|
605
|
+
const quota = finiteOrNull(usage?.quota);
|
|
606
|
+
const used = finiteOrNull(usage?.usage);
|
|
607
|
+
const planCode = finiteOrNull(usage?.plan);
|
|
608
|
+
const optIn = finiteOrNull(settings?.opt_in);
|
|
609
|
+
const both = quota !== null && used !== null;
|
|
610
|
+
return {
|
|
611
|
+
plan: planCode === null ? null : (PLAN[planCode] ?? `unknown(${planCode})`),
|
|
612
|
+
planCode,
|
|
613
|
+
quotaBytes: quota,
|
|
614
|
+
usageBytes: used,
|
|
615
|
+
freeBytes: both ? Math.max(0, quota - used) : null,
|
|
616
|
+
overQuota: both ? used > quota : null,
|
|
617
|
+
serviceUsage: usage?.service_usage ?? null,
|
|
618
|
+
perFileLimitRaw: finiteOrNull(settings?.cloud_media_file_size_limit),
|
|
619
|
+
myCloudPerFileLimitRaw: finiteOrNull(settings?.my_cloud_file_size_limit),
|
|
620
|
+
optIn: optIn === null ? null : { media: !!(optIn & 1), mycloud: !!(optIn & 2), backup: !!(optIn & 4) },
|
|
621
|
+
};
|
|
622
|
+
}
|
|
623
|
+
|
|
624
|
+
/**
|
|
625
|
+
* Quota, usage and the per-file limit, read from zCloud.
|
|
626
|
+
*
|
|
627
|
+
* @param {object} api
|
|
628
|
+
* @returns {Promise<ReturnType<typeof summarizeCloudQuota>>}
|
|
629
|
+
*/
|
|
630
|
+
export async function getCloudQuota(api) {
|
|
631
|
+
// Sequential on purpose: two concurrent first calls would each fetch a key.
|
|
632
|
+
const usage = await getCloudUsage(api);
|
|
633
|
+
const settings = await getCloudSettings(api);
|
|
634
|
+
return summarizeCloudQuota(usage, settings);
|
|
635
|
+
}
|
|
636
|
+
|
|
637
|
+
// ── the cloud index ─────────────────────────────────────────────────────────
|
|
638
|
+
|
|
639
|
+
/**
|
|
640
|
+
* The conversation an item belongs to, derived the way Zalo does: a group
|
|
641
|
+
* item belongs to destId; a DM to whichever
|
|
642
|
+
* side is not the account itself.
|
|
643
|
+
*/
|
|
644
|
+
export function conversationOf(msg, ownId) {
|
|
645
|
+
if (msg?.destId === undefined || msg?.destId === null) return null;
|
|
646
|
+
const dest = String(msg.destId);
|
|
647
|
+
if (Number(msg.destType) === DEST_TYPE_GROUP) return dest;
|
|
648
|
+
if (ownId && dest === String(ownId) && msg.srcId !== undefined && msg.srcId !== null) return String(msg.srcId);
|
|
649
|
+
return dest;
|
|
650
|
+
}
|
|
651
|
+
|
|
652
|
+
/** Zalo's id for a message as the queue keys it: `cliMsgId_conversation_sender`, a 0 standing for the account. */
|
|
653
|
+
function zKeyOf(cliMsgId, conversation, sender, ownId) {
|
|
654
|
+
const own = ownId ? String(ownId) : "";
|
|
655
|
+
const s = String(sender) === "0" ? own : String(sender);
|
|
656
|
+
const c = String(conversation) === "0" ? own : String(conversation);
|
|
657
|
+
return `${cliMsgId}_${c}_${s}`;
|
|
658
|
+
}
|
|
659
|
+
|
|
660
|
+
/**
|
|
661
|
+
* The key Zalo gives a queue item, in this database's conversation spelling (a
|
|
662
|
+
* group's id without Zalo's `g` prefix). Null when the item names no client message id.
|
|
663
|
+
*
|
|
664
|
+
* @param {object} item
|
|
665
|
+
* @param {string|null} [ownId]
|
|
666
|
+
* @returns {string|null}
|
|
667
|
+
*/
|
|
668
|
+
export function cloudKeyOf(item, ownId = null) {
|
|
669
|
+
const msg = item?.msgInfo;
|
|
670
|
+
if (!msg || msg.cliMsgId === undefined || msg.cliMsgId === null || msg.cliMsgId === "") return null;
|
|
671
|
+
const conv = conversationOf(msg, ownId);
|
|
672
|
+
if (conv === null || msg.srcId === undefined || msg.srcId === null) return null;
|
|
673
|
+
return zKeyOf(msg.cliMsgId, conv, msg.srcId, ownId);
|
|
674
|
+
}
|
|
675
|
+
|
|
676
|
+
/** Delete-message types in an `orgMsgs` entry that name a group (TYPE_DELETE_CHAT_GROUP and its _CONVERSATION twin). */
|
|
677
|
+
const DELETE_GROUP_TYPES = new Set([3, 4]);
|
|
678
|
+
|
|
679
|
+
/**
|
|
680
|
+
* The messages a `remove` entry removes from the cloud, as keys (getZCloudKeyFromDelItem). The entry's
|
|
681
|
+
* `msgInfo.extInfo.orgMsgs` lists them as `{type, uidTo, uidFrom, clientDelMsgId}`.
|
|
682
|
+
*
|
|
683
|
+
* @param {object} item
|
|
684
|
+
* @param {string|null} [ownId]
|
|
685
|
+
* @returns {string[]}
|
|
686
|
+
*/
|
|
687
|
+
export function removalKeysOf(item, ownId = null) {
|
|
688
|
+
const keys = [];
|
|
689
|
+
for (const org of item?.msgInfo?.extInfo?.orgMsgs || []) {
|
|
690
|
+
if (!org || org.clientDelMsgId === undefined || org.clientDelMsgId === null) continue;
|
|
691
|
+
const { type, uidTo, uidFrom, clientDelMsgId } = org;
|
|
692
|
+
let to = String(uidTo);
|
|
693
|
+
if (!DELETE_GROUP_TYPES.has(Number(type)) && ownId && to === String(ownId)) to = String(uidFrom);
|
|
694
|
+
keys.push(zKeyOf(clientDelMsgId, to, uidFrom, ownId));
|
|
695
|
+
}
|
|
696
|
+
return keys;
|
|
697
|
+
}
|
|
698
|
+
|
|
699
|
+
/**
|
|
700
|
+
* Which conversation a `del_thread` entry cleared, and when (getDelThreadCondition): the first `orgMsgs` entry's
|
|
701
|
+
* `uidTo`, or the group for a `group.leave`; the cut is the entry's client timestamp.
|
|
702
|
+
*
|
|
703
|
+
* @param {object} item
|
|
704
|
+
* @returns {{threadId: string|null, deletedAt: number}}
|
|
705
|
+
*/
|
|
706
|
+
export function threadClearOf(item) {
|
|
707
|
+
const msg = item?.msgInfo || {};
|
|
708
|
+
const org =
|
|
709
|
+
msg.msgType === "group.leave" ? { uidTo: msg.destId, clientDelMsgId: msg.ts } : msg.extInfo?.orgMsgs?.[0];
|
|
710
|
+
const threadId = org?.uidTo === undefined || org?.uidTo === null ? null : String(org.uidTo);
|
|
711
|
+
return { threadId, deletedAt: Number(item?.cliTs || org?.clientDelMsgId || item?.ts || 0) };
|
|
712
|
+
}
|
|
713
|
+
|
|
714
|
+
/**
|
|
715
|
+
* Normalize one cloud-queue item into a `cloud_items` row.
|
|
716
|
+
*
|
|
717
|
+
* The live item shape is `{noiseId, action, msgInfo: {cliMsgId, glbMsgId,
|
|
718
|
+
* msgType, srcId, destId, destType, ts, …}, mediaInfo: {mediaSize}, encryptInfo,
|
|
719
|
+
* ts}`. Older envelopes are still read from the places they were seen.
|
|
720
|
+
* `encryptInfo` is end-to-end encrypted and is kept opaque.
|
|
721
|
+
*
|
|
722
|
+
* @param {object} item
|
|
723
|
+
* @param {string|null} [ownId] - the logged-in account, to resolve a DM's conversation
|
|
724
|
+
* @returns {object|null}
|
|
725
|
+
*/
|
|
726
|
+
export function normalizeCloudItem(item, ownId = null) {
|
|
727
|
+
const noiseId = item?.noiseId ?? item?.zKey ?? item?.id;
|
|
728
|
+
if (!noiseId) return null;
|
|
729
|
+
// The blob's key and versions are the item's top-level encryptInfo. `mediaInfo.mediaExtInfo.encryptInfo` wraps a
|
|
730
|
+
// different key (the one for the file-name and thumbnail metadata) and is kept only in raw_data, verbatim.
|
|
731
|
+
const enc = item.encryptInfo || {};
|
|
732
|
+
const media = item.mediaInfo || {};
|
|
733
|
+
const msg = item.msgInfo || {};
|
|
734
|
+
return {
|
|
735
|
+
zKey: cloudKeyOf(item, ownId),
|
|
736
|
+
keyVersion: enc.keyVersion ?? null,
|
|
737
|
+
algoVersion: enc.algoVersion ?? null,
|
|
738
|
+
noiseId: String(noiseId),
|
|
739
|
+
threadId: conversationOf(msg, ownId) ?? msg.toUid ?? msg.convId ?? item.threadId ?? null,
|
|
740
|
+
msgId: msg.glbMsgId ?? msg.msgId ?? item.msgId ?? null,
|
|
741
|
+
msgType: msg.msgType ?? item.msgType ?? null,
|
|
742
|
+
mediaType: media.mediaType ?? item.mediaType ?? null,
|
|
743
|
+
cloudUrl: enc.cloudUrl ?? item.cloudUrl ?? null,
|
|
744
|
+
encryptKey: enc.encryptKey ?? null,
|
|
745
|
+
checksum: media.checksum ?? item.checksum ?? null,
|
|
746
|
+
mediaSize: media.mediaSize ?? item.mediaSize ?? null,
|
|
747
|
+
timestamp: msg.ts ?? msg.timestamp ?? item.ts ?? null,
|
|
748
|
+
raw_data: item,
|
|
749
|
+
};
|
|
750
|
+
}
|
|
751
|
+
|
|
752
|
+
/** Cloud listings arrive under one of several keys; the verify queue uses `mediaItems`. */
|
|
753
|
+
export function itemsOf(resp) {
|
|
754
|
+
if (Array.isArray(resp)) return resp;
|
|
755
|
+
for (const k of ["mediaItems", "items", "list", "data", "medias", "queue"]) {
|
|
756
|
+
const v = resp?.[k];
|
|
757
|
+
if (Array.isArray(v)) return v;
|
|
758
|
+
}
|
|
759
|
+
for (const k of ["mediaItems", "items", "list", "medias"]) {
|
|
760
|
+
const v = resp?.data?.[k];
|
|
761
|
+
if (Array.isArray(v)) return v;
|
|
762
|
+
}
|
|
763
|
+
return [];
|
|
764
|
+
}
|
|
765
|
+
|
|
766
|
+
/** The paging cursor a listing hands back for the next call. */
|
|
767
|
+
export function nextCursor(resp, items) {
|
|
768
|
+
const d = resp?.data ?? resp;
|
|
769
|
+
return (
|
|
770
|
+
d?.lastNoiseId ??
|
|
771
|
+
d?.nextNoiseId ??
|
|
772
|
+
d?.last_id ??
|
|
773
|
+
d?.lastId ??
|
|
774
|
+
(items.length ? (items[items.length - 1]?.noiseId ?? items[items.length - 1]?.id) : null) ??
|
|
775
|
+
null
|
|
776
|
+
);
|
|
777
|
+
}
|
|
778
|
+
|
|
779
|
+
/** The verify reply's `hasMore`, or null when the reply carries none. */
|
|
780
|
+
export function moreFlag(resp) {
|
|
781
|
+
const v = resp?.hasMore ?? resp?.data?.hasMore;
|
|
782
|
+
if (v === undefined || v === null) return null;
|
|
783
|
+
return v === true || Number(v) > 0;
|
|
784
|
+
}
|
|
785
|
+
|
|
786
|
+
/** The logged-in account's id, when the api can say. */
|
|
787
|
+
export function ownIdOf(api) {
|
|
788
|
+
try {
|
|
789
|
+
return api?.getOwnId?.() || api?.getContext?.()?.uid || null;
|
|
790
|
+
} catch {
|
|
791
|
+
return null;
|
|
792
|
+
}
|
|
793
|
+
}
|
|
794
|
+
|
|
795
|
+
/** The account's self chat ("Cloud của tôi"), the one conversation a reset spares; its id is not always the own id. */
|
|
796
|
+
export function selfChatIdOf(api, ownId) {
|
|
797
|
+
try {
|
|
798
|
+
return api?.getContext?.()?.loginInfo?.send2me_id || ownId || null;
|
|
799
|
+
} catch {
|
|
800
|
+
return ownId || null;
|
|
801
|
+
}
|
|
802
|
+
}
|