@ardennguyen/zalo-agent-cli 2.5.9 → 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 -222
- 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
package/src/commands/sync.js
CHANGED
|
@@ -5,45 +5,46 @@ import { getAccountDir } from "../core/credentials.js";
|
|
|
5
5
|
import { acquireLock, releaseLock, checkLock } from "../core/lock.js";
|
|
6
6
|
import { error, info, success, warning, output } from "../utils/output.js";
|
|
7
7
|
import { parseIntAtLeast, parseIntOption } from "../utils/parse-options.js";
|
|
8
|
+
import { whileInterruptible } from "../utils/interrupt.js";
|
|
8
9
|
import { SyncManager } from "../core/sync.js";
|
|
9
10
|
import { SyncV2, resolveSyncWindow, FULL_HISTORY_FROM } from "../core/sync-v2/index.js";
|
|
11
|
+
import { CONFIRM_WAIT_MS } from "../zalo/transfer-sync/transfer.js";
|
|
10
12
|
import {
|
|
11
13
|
downloadSyncedMedia,
|
|
12
14
|
pruneDownloadedMedia,
|
|
13
15
|
describeDownloadReasons,
|
|
14
16
|
DOWNLOADABLE_KINDS,
|
|
15
17
|
} from "../core/sync-v2/media.js";
|
|
16
|
-
import {
|
|
18
|
+
import { runBoardPass } from "../core/board-pass.js";
|
|
17
19
|
import { drainReactions, placeUnresolvedReactions } from "../core/sync-v2/reactions.js";
|
|
20
|
+
import { getCloudSettings, getCloudUsage, getMyCloudUsage, summarizeCloudQuota } from "../zalo/zcloud.js";
|
|
18
21
|
import { syncCloudIndex } from "../core/sync-v2/zcloud.js";
|
|
19
22
|
import { syncConvState } from "../core/sync-v2/conv-state.js";
|
|
20
23
|
import { planSyncRun } from "../core/sync-v2/plan.js";
|
|
21
|
-
import { startKeepAlive } from "../
|
|
22
|
-
import { getSyncChannel, syncViaDaemon } from "../core/daemon-channel.js";
|
|
24
|
+
import { pingPayload, startKeepAlive } from "../zalo/listener/keepalive.js";
|
|
25
|
+
import { cancelViaDaemon, getSyncChannel, syncViaDaemon } from "../core/daemon-channel.js";
|
|
23
26
|
import { attachLiveStore } from "../core/live-store.js";
|
|
24
27
|
import {
|
|
25
28
|
initDb,
|
|
26
|
-
getRecentThreads,
|
|
27
29
|
getThreadNames,
|
|
28
30
|
countPendingAttachments,
|
|
29
31
|
getSyncState,
|
|
30
32
|
setSyncState,
|
|
31
|
-
clearSyncState,
|
|
32
33
|
getOrphanThreads,
|
|
33
34
|
recordConversationList,
|
|
34
35
|
} from "../core/db.js";
|
|
35
36
|
|
|
36
|
-
/** Zalo close code for a duplicate web session (Zalo
|
|
37
|
+
/** Zalo close code for a duplicate web session (Zalo is open in a browser elsewhere). */
|
|
37
38
|
const CLOSE_DUPLICATE = 3000;
|
|
38
39
|
|
|
39
40
|
/**
|
|
40
41
|
* Reaction-drain budget for the unified run.
|
|
41
42
|
*
|
|
42
43
|
* Named because the daemon path has to ask for exactly the same thing: the
|
|
43
|
-
* stage runs in another process there, and a page
|
|
44
|
+
* stage runs in another process there, and a page bound that differed between
|
|
44
45
|
* the two would make the same command truncate in one setup and not the other.
|
|
45
46
|
*/
|
|
46
|
-
const DRAIN_PAGES =
|
|
47
|
+
const DRAIN_PAGES = undefined; // no page cap: until the server says no more, or its cursor stops moving
|
|
47
48
|
const DRAIN_WAIT_MS = 15000;
|
|
48
49
|
|
|
49
50
|
/**
|
|
@@ -81,9 +82,9 @@ export function registerSyncCommands(program) {
|
|
|
81
82
|
.option("--from <date>", "Restore messages from this date onward (YYYY-MM-DD); overrides --days")
|
|
82
83
|
.option(
|
|
83
84
|
"-w, --wait <seconds>",
|
|
84
|
-
"How long to wait for the phone confirmation (floored at
|
|
85
|
+
"How long to wait for the phone confirmation (floored at 600, as Zalo's own clients wait)",
|
|
85
86
|
parseIntOption,
|
|
86
|
-
|
|
87
|
+
600,
|
|
87
88
|
)
|
|
88
89
|
.option("--no-messages", "Skip the message restore (no phone prompt)")
|
|
89
90
|
.option("--no-reactions", "Skip the reaction backlog")
|
|
@@ -91,6 +92,11 @@ export function registerSyncCommands(program) {
|
|
|
91
92
|
.option("--no-boards", "Skip notes, pinned messages, polls and reminders")
|
|
92
93
|
.option("--no-cloud", "Skip the zCloud index")
|
|
93
94
|
.option("--no-media", "Skip downloading attachments")
|
|
95
|
+
.option(
|
|
96
|
+
"--media-limit <n>",
|
|
97
|
+
"Download at most this many attachments in this run, two at a time; the rest wait for `sync-media`. Default: all of them",
|
|
98
|
+
parseIntAtLeast(1),
|
|
99
|
+
)
|
|
94
100
|
.option(
|
|
95
101
|
"--no-removals",
|
|
96
102
|
"Do not apply un-react entries from the reaction backlog (see sync-reactions --no-removals)",
|
|
@@ -102,12 +108,16 @@ export function registerSyncCommands(program) {
|
|
|
102
108
|
"more sync sessions. The server rejects a batch of more than 30",
|
|
103
109
|
parseIntAtLeast(1),
|
|
104
110
|
)
|
|
111
|
+
.option(
|
|
112
|
+
"--full-resync",
|
|
113
|
+
"Ask the phone for every conversation in full, ignoring what earlier runs settled (by default a run asks only for conversations an earlier run did not finish, or that have new messages since)",
|
|
114
|
+
)
|
|
105
115
|
.option("--plan", "Print which stages would run, in what order and why, then exit. Sends nothing")
|
|
106
116
|
.action(async (opts) => {
|
|
107
117
|
// Only the message restore carries a window; accepting one with the
|
|
108
118
|
// restore switched off would silently mean nothing.
|
|
109
|
-
if ((opts.days !== undefined || opts.from !== undefined) && opts.messages === false) {
|
|
110
|
-
error("--days/--from apply to the message restore, which --no-messages switches off.");
|
|
119
|
+
if ((opts.days !== undefined || opts.from !== undefined || opts.fullResync) && opts.messages === false) {
|
|
120
|
+
error("--days/--from/--full-resync apply to the message restore, which --no-messages switches off.");
|
|
111
121
|
process.exit(1);
|
|
112
122
|
}
|
|
113
123
|
await runUnifiedSync(requireAccount(), opts, Boolean(program.opts().json));
|
|
@@ -119,7 +129,7 @@ export function registerSyncCommands(program) {
|
|
|
119
129
|
"Restore message history from your phone into the local cache (zalo.db). " +
|
|
120
130
|
"This IS the real phone-backed restore (transfer-sync-v2) by default: it sends one " +
|
|
121
131
|
"sync request your phone confirms, then decrypts and stores your history. " +
|
|
122
|
-
"--socket asks for the
|
|
132
|
+
"--socket asks for the older server backfill instead.",
|
|
123
133
|
)
|
|
124
134
|
.option(
|
|
125
135
|
"-t, --transfer",
|
|
@@ -127,11 +137,11 @@ export function registerSyncCommands(program) {
|
|
|
127
137
|
)
|
|
128
138
|
.option(
|
|
129
139
|
"--socket",
|
|
130
|
-
"Ask for the old best-effort server socket backfill (cmd 510/511) instead of the phone-backed restore.
|
|
140
|
+
"Ask for the old best-effort server socket backfill (cmd 510/511) instead of the phone-backed restore. Zalo answers it empty, so it is a cheap probe, not a data path",
|
|
131
141
|
)
|
|
132
142
|
.option(
|
|
133
143
|
"-F, --force",
|
|
134
|
-
"Skip the 'already synced recently' shortcut and sync anyway. By default a sync is skipped when a successful one completed within the last hour and no gap is pending —
|
|
144
|
+
"Skip the 'already synced recently' shortcut and sync anyway. By default a sync is skipped when a successful one completed within the last hour and no gap is pending — as Zalo does, re-syncing only when something seems to be missing",
|
|
135
145
|
)
|
|
136
146
|
.option(
|
|
137
147
|
"-d, --days <n>",
|
|
@@ -160,6 +170,10 @@ export function registerSyncCommands(program) {
|
|
|
160
170
|
"drops, at the cost of more sync sessions. The server rejects a batch of more than 30",
|
|
161
171
|
parseIntAtLeast(1),
|
|
162
172
|
)
|
|
173
|
+
.option(
|
|
174
|
+
"--full-resync",
|
|
175
|
+
"Ask the phone for every conversation in full, ignoring what earlier runs settled (by default a run asks only for conversations an earlier run did not finish, or that have new messages since)",
|
|
176
|
+
)
|
|
163
177
|
.action(async (opts) => {
|
|
164
178
|
// --days is a property of the cmd 590 query the phone answers, so
|
|
165
179
|
// it only means anything on the transfer path. Say so instead of
|
|
@@ -173,6 +187,7 @@ export function registerSyncCommands(program) {
|
|
|
173
187
|
[opts.from !== undefined, "--from"],
|
|
174
188
|
[opts.days !== undefined, "--days"],
|
|
175
189
|
[opts.shardSize !== undefined, "--shard-size"],
|
|
190
|
+
[opts.fullResync, "--full-resync"],
|
|
176
191
|
]
|
|
177
192
|
.filter(([passed]) => passed)
|
|
178
193
|
.map(([, flag]) => flag);
|
|
@@ -208,9 +223,18 @@ export function registerSyncCommands(program) {
|
|
|
208
223
|
"-k, --kind <kinds>",
|
|
209
224
|
`Comma-separated kinds to fetch (${[...DOWNLOADABLE_KINDS].join(", ")}). Default: all of them`,
|
|
210
225
|
)
|
|
211
|
-
.option(
|
|
226
|
+
.option(
|
|
227
|
+
"-n, --limit <n>",
|
|
228
|
+
"Consider at most this many messages (default: every one still missing its file)",
|
|
229
|
+
parseIntAtLeast(1),
|
|
230
|
+
)
|
|
212
231
|
.option("-d, --days <n>", "Only attachments from the last N days", parseIntAtLeast(1))
|
|
213
|
-
.option("-c, --concurrency <n>", "Parallel downloads", parseIntAtLeast(1),
|
|
232
|
+
.option("-c, --concurrency <n>", "Parallel downloads", parseIntAtLeast(1), 2)
|
|
233
|
+
.option(
|
|
234
|
+
"--media-limit <n>",
|
|
235
|
+
"Download at most this many attachments in this run; the rest stay pending for the next run. Default: all of them",
|
|
236
|
+
parseIntAtLeast(1),
|
|
237
|
+
)
|
|
214
238
|
.option("-m, --max-size <mb>", "Skip attachments larger than this many MB", parseIntAtLeast(1))
|
|
215
239
|
.option(
|
|
216
240
|
"--timeout <seconds>",
|
|
@@ -274,11 +298,15 @@ export function registerSyncCommands(program) {
|
|
|
274
298
|
.description(
|
|
275
299
|
"Retrieve existing reactions from Zalo's servers into the local cache. Reactions are the one " +
|
|
276
300
|
"thing a transfer sync cannot restore — the Sync2 payload has no reaction field — but they " +
|
|
277
|
-
"ARE served over the socket (cmd 610 for 1-1, 611 for groups), which is how Zalo
|
|
301
|
+
"ARE served over the socket (cmd 610 for 1-1, 611 for groups), which is how Zalo shows " +
|
|
278
302
|
"them after a fresh login. Needs no phone confirmation",
|
|
279
303
|
)
|
|
280
304
|
.option("-w, --wait <seconds>", "Per-page deadline", parseIntAtLeast(1), 15)
|
|
281
|
-
.option(
|
|
305
|
+
.option(
|
|
306
|
+
"-p, --pages <n>",
|
|
307
|
+
"Stop after this many pages per thread type (default: until the server says no more)",
|
|
308
|
+
parseIntAtLeast(1),
|
|
309
|
+
)
|
|
282
310
|
.option(
|
|
283
311
|
"--no-removals",
|
|
284
312
|
"Do not apply un-react entries from the backlog. The default DOES apply them, because the " +
|
|
@@ -297,7 +325,11 @@ export function registerSyncCommands(program) {
|
|
|
297
325
|
"they need this separate pass. Needs no phone confirmation",
|
|
298
326
|
)
|
|
299
327
|
.option("-T, --thread <threadId>", "Only this conversation")
|
|
300
|
-
.option(
|
|
328
|
+
.option(
|
|
329
|
+
"-n, --limit <n>",
|
|
330
|
+
"Visit at most this many threads, most recent first (default: every thread)",
|
|
331
|
+
parseIntAtLeast(1),
|
|
332
|
+
)
|
|
301
333
|
.option("-c, --concurrency <n>", "Threads fetched in parallel", parseIntAtLeast(1), 3)
|
|
302
334
|
.option("--no-reminders", "Skip reminders")
|
|
303
335
|
.option("--no-boards", "Skip notes/pinned messages/polls")
|
|
@@ -309,17 +341,36 @@ export function registerSyncCommands(program) {
|
|
|
309
341
|
.command("sync-cloud")
|
|
310
342
|
.description(
|
|
311
343
|
"Walk the zCloud ('Cloud của tôi') media index and record it locally — the same " +
|
|
312
|
-
"reconciliation Zalo
|
|
344
|
+
"reconciliation Zalo runs when it receives a cloud verify event. Records where " +
|
|
313
345
|
"each backup lives; it does not download or decrypt cloud blobs",
|
|
314
346
|
)
|
|
315
|
-
.option(
|
|
316
|
-
|
|
317
|
-
|
|
347
|
+
.option(
|
|
348
|
+
"-p, --pages <n>",
|
|
349
|
+
"Stop after this many pages (default: until the server says the walk is done)",
|
|
350
|
+
parseIntAtLeast(1),
|
|
351
|
+
)
|
|
352
|
+
.option("-s, --page-size <n>", "Items per page (Zalo uses 300)", parseIntAtLeast(1), 300)
|
|
353
|
+
.option("-r, --resume <noiseId>", "Resume from this cursor instead of the saved one")
|
|
354
|
+
.option(
|
|
355
|
+
"--full",
|
|
356
|
+
"Walk from the top and, once the server says it is done, delete every local item no page listed " +
|
|
357
|
+
"(corrects an index the incremental walks left stale)",
|
|
358
|
+
)
|
|
318
359
|
.action(async (opts) => {
|
|
319
360
|
await runCloudSync(requireAccount(), opts);
|
|
320
361
|
});
|
|
321
362
|
}
|
|
322
363
|
|
|
364
|
+
/**
|
|
365
|
+
* Whether stdout is reserved for one JSON value (`--json`; set by src/index.js). The single-stage commands below
|
|
366
|
+
* print their human lines either way -- in JSON mode those go to stderr -- and then their result through
|
|
367
|
+
* `output()`, which prints only in JSON mode when given no human formatter of its own.
|
|
368
|
+
*/
|
|
369
|
+
const jsonMode = () => Boolean(process.env.ZALO_JSON_MODE);
|
|
370
|
+
|
|
371
|
+
/** Print `data` as the command's JSON result; a no-op in human mode, whose lines are already out. */
|
|
372
|
+
const jsonResult = (data) => output(data, jsonMode(), () => {});
|
|
373
|
+
|
|
323
374
|
/** The active account, or exit with the same message every command uses. */
|
|
324
375
|
function requireAccount() {
|
|
325
376
|
const acc = getActive();
|
|
@@ -371,6 +422,7 @@ async function runMediaDownload(activeAcc, opts) {
|
|
|
371
422
|
if (!pending) {
|
|
372
423
|
success("No attachments waiting to be downloaded.");
|
|
373
424
|
info("Run `zalo-agent sync-mobile --transfer` first if you have not synced yet.");
|
|
425
|
+
jsonResult({ pending: 0, considered: 0, downloaded: 0, ...(opts.dryRun && { dryRun: true }) });
|
|
374
426
|
process.exit(0);
|
|
375
427
|
}
|
|
376
428
|
info(`${pending} attachment(s) not yet downloaded.`);
|
|
@@ -394,6 +446,7 @@ async function runMediaDownload(activeAcc, opts) {
|
|
|
394
446
|
limit: opts.limit,
|
|
395
447
|
since,
|
|
396
448
|
concurrency: opts.concurrency,
|
|
449
|
+
maxFiles: opts.mediaLimit,
|
|
397
450
|
maxBytes: opts.maxSize ? opts.maxSize * MB : undefined,
|
|
398
451
|
timeoutMs: (opts.timeout || 60) * 1000,
|
|
399
452
|
thumbs: Boolean(opts.thumbs),
|
|
@@ -412,12 +465,24 @@ async function runMediaDownload(activeAcc, opts) {
|
|
|
412
465
|
|
|
413
466
|
if (opts.dryRun) {
|
|
414
467
|
success(`Dry run: ${stats.considered} attachment(s) would be fetched.`);
|
|
468
|
+
jsonResult({ dryRun: true, pending, ...stats });
|
|
415
469
|
process.exit(0);
|
|
416
470
|
}
|
|
417
471
|
success(`Downloaded ${stats.downloaded}/${stats.considered} attachment(s) (${formatBytes(stats.bytes)}).`);
|
|
472
|
+
if (stats.deferred) {
|
|
473
|
+
info(
|
|
474
|
+
`${stats.deferred} more attachment(s) are waiting (this run was capped at ${opts.mediaLimit}); run it again to continue.`,
|
|
475
|
+
);
|
|
476
|
+
}
|
|
418
477
|
if (stats.renewed) info(`Renewed ${stats.renewed} expired link(s).`);
|
|
419
478
|
if (stats.expired) {
|
|
420
479
|
warning(`${stats.expired} link(s) are gone (HTTP 404/410 or a lapsed signature).`);
|
|
480
|
+
if (stats.cloudBacked) {
|
|
481
|
+
info(
|
|
482
|
+
`${stats.cloudBacked} of the files that are gone are listed in your zCloud index: the cloud holds a copy ` +
|
|
483
|
+
"this tool cannot open (it is end-to-end encrypted under the account's cloud key, which this tool never holds).",
|
|
484
|
+
);
|
|
485
|
+
}
|
|
421
486
|
info("Zalo only keeps media for a limited time; past that the file exists only on the sending device.");
|
|
422
487
|
}
|
|
423
488
|
if (stats.throttled) {
|
|
@@ -449,6 +514,7 @@ async function runMediaDownload(activeAcc, opts) {
|
|
|
449
514
|
warning(`${other} attachment(s) failed for other reasons.`);
|
|
450
515
|
for (const f of stats.failures.slice(0, 5)) info(` ${f.msgId}: ${f.reason}`);
|
|
451
516
|
}
|
|
517
|
+
jsonResult({ pending, ...stats });
|
|
452
518
|
process.exit(0);
|
|
453
519
|
}
|
|
454
520
|
|
|
@@ -465,6 +531,7 @@ async function runPruneOrphans(activeAcc, opts) {
|
|
|
465
531
|
info(
|
|
466
532
|
"Orphans come from leave/removal events, `conv delete`, and the conversation list a full-history sync returns.",
|
|
467
533
|
);
|
|
534
|
+
jsonResult({ orphans: [], deleted: 0, bytes: 0, ...(opts.dryRun && { dryRun: true }) });
|
|
468
535
|
process.exit(0);
|
|
469
536
|
}
|
|
470
537
|
|
|
@@ -494,6 +561,7 @@ async function runPruneOrphans(activeAcc, opts) {
|
|
|
494
561
|
if (total.missing)
|
|
495
562
|
info(`${total.missing} row(s) point at files already gone; a real run clears those pointers.`);
|
|
496
563
|
info("Message text is kept. Use `conv forget --orphans` to remove that too.");
|
|
564
|
+
jsonResult({ dryRun: true, orphans: orphanList(orphans), ...total });
|
|
497
565
|
process.exit(0);
|
|
498
566
|
}
|
|
499
567
|
|
|
@@ -506,9 +574,13 @@ async function runPruneOrphans(activeAcc, opts) {
|
|
|
506
574
|
for (const f of total.failures.slice(0, 5)) info(` ${f.msgId}: ${f.reason}`);
|
|
507
575
|
}
|
|
508
576
|
info("Their message text is still here — `conv forget --orphans` removes that too.");
|
|
577
|
+
jsonResult({ orphans: orphanList(orphans), ...total });
|
|
509
578
|
process.exit(0);
|
|
510
579
|
}
|
|
511
580
|
|
|
581
|
+
/** The orphaned conversations a prune covered, as its JSON result lists them. */
|
|
582
|
+
const orphanList = (orphans) => orphans.map((t) => ({ threadId: t.threadId, name: t.name || "", files: t.files }));
|
|
583
|
+
|
|
512
584
|
/** Delete downloaded media older than N days. Never removes message rows. */
|
|
513
585
|
async function runMediaPrune(activeAcc, opts) {
|
|
514
586
|
const accountDir = getAccountDir(activeAcc.ownId);
|
|
@@ -533,14 +605,17 @@ async function runMediaPrune(activeAcc, opts) {
|
|
|
533
605
|
});
|
|
534
606
|
|
|
535
607
|
const cutoff = stats.all ? "any date" : new Date(stats.cutoff).toISOString().slice(0, 10);
|
|
608
|
+
const result = { scope, cutoff, ...(opts.dryRun && { dryRun: true }), ...stats };
|
|
536
609
|
if (!stats.considered) {
|
|
537
610
|
success(`Nothing to prune — no downloaded media matched ${scope}.`);
|
|
611
|
+
jsonResult(result);
|
|
538
612
|
process.exit(0);
|
|
539
613
|
}
|
|
540
614
|
if (opts.dryRun) {
|
|
541
615
|
success(`Dry run: ${stats.considered} file(s), ${formatBytes(stats.bytes)} — ${scope}.`);
|
|
542
616
|
info("Message text is untouched; pruned files can be re-downloaded while their links live.");
|
|
543
617
|
info("Re-run without --dry-run to delete them.");
|
|
618
|
+
jsonResult(result);
|
|
544
619
|
process.exit(0);
|
|
545
620
|
}
|
|
546
621
|
success(`Deleted ${stats.deleted} file(s), reclaiming ${formatBytes(stats.bytes)} (${scope}, before ${cutoff}).`);
|
|
@@ -555,6 +630,7 @@ async function runMediaPrune(activeAcc, opts) {
|
|
|
555
630
|
"Message history is unchanged. These attachments are not fetched again on their own; " +
|
|
556
631
|
"`zalo-agent sync-media --include-pruned` re-downloads them while their links still work.",
|
|
557
632
|
);
|
|
633
|
+
jsonResult(result);
|
|
558
634
|
process.exit(0);
|
|
559
635
|
}
|
|
560
636
|
|
|
@@ -576,6 +652,7 @@ async function runBoardSync(activeAcc, opts) {
|
|
|
576
652
|
warning(opts.thread ? `Thread ${opts.thread} is not in the local cache.` : "No threads in the local cache.");
|
|
577
653
|
info("Run `zalo-agent sync-mobile --transfer` first.");
|
|
578
654
|
}
|
|
655
|
+
jsonResult(r);
|
|
579
656
|
process.exit(0);
|
|
580
657
|
}
|
|
581
658
|
|
|
@@ -588,48 +665,26 @@ async function runBoardSync(activeAcc, opts) {
|
|
|
588
665
|
* @returns {Promise<{status: "ok"|"skipped", reason?: string, stats?: object}>}
|
|
589
666
|
*/
|
|
590
667
|
async function boardPass(api, opts) {
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
threadId: String(t.threadId),
|
|
594
|
-
type: t.type,
|
|
595
|
-
name: t.name,
|
|
596
|
-
}));
|
|
597
|
-
if (!threads.length) {
|
|
598
|
-
return {
|
|
599
|
-
status: "skipped",
|
|
600
|
-
reason: opts.thread ? `thread ${opts.thread} is not in the local cache` : "no threads in the local cache",
|
|
601
|
-
};
|
|
602
|
-
}
|
|
603
|
-
|
|
604
|
-
// A live board event flags its thread; those go first so a quick run after
|
|
605
|
-
// seeing "Board changed" refreshes the thing that actually moved.
|
|
606
|
-
const stale = threads.filter((t) => getSyncState(`boardStale:${t.threadId}`));
|
|
607
|
-
if (stale.length && !opts.thread) {
|
|
608
|
-
info(`${stale.length} thread(s) had a board change since the last pass — doing those first.`);
|
|
609
|
-
const rest = threads.filter((t) => !getSyncState(`boardStale:${t.threadId}`));
|
|
610
|
-
threads.length = 0;
|
|
611
|
-
threads.push(...stale, ...rest);
|
|
612
|
-
}
|
|
613
|
-
|
|
614
|
-
info(`Checking ${threads.length} thread(s) — one request each, so this is paced deliberately.`);
|
|
668
|
+
// The pass itself (which threads, stale-first order, the per-thread flag, the 221 stop and resume) is the one the
|
|
669
|
+
// MCP server runs too (src/core/board-pass.js); this only prints.
|
|
615
670
|
let last = 0;
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
reminders: opts.reminders !== false,
|
|
621
|
-
concurrency: opts.concurrency,
|
|
671
|
+
let announced = false;
|
|
672
|
+
const r = await runBoardPass(api, {
|
|
673
|
+
...opts,
|
|
674
|
+
onNote: (m) => info(`${m}.`),
|
|
622
675
|
onProgress: (p) => {
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
676
|
+
if (!announced) {
|
|
677
|
+
announced = true;
|
|
678
|
+
info(`Checking ${p.total} thread(s) — paced deliberately, at most 3 at a time.`);
|
|
679
|
+
}
|
|
627
680
|
if (p.done === p.total || p.done - last >= 25) {
|
|
628
681
|
last = p.done;
|
|
629
682
|
info(` ${p.done}/${p.total} threads`);
|
|
630
683
|
}
|
|
631
684
|
},
|
|
632
685
|
});
|
|
686
|
+
if (r.status !== "ok") return r;
|
|
687
|
+
const stats = r.stats;
|
|
633
688
|
|
|
634
689
|
success(
|
|
635
690
|
`Stored ${stats.boardItems} board item(s) and ${stats.reminders} reminder(s) from ${stats.threads} thread(s).`,
|
|
@@ -638,7 +693,9 @@ async function boardPass(api, opts) {
|
|
|
638
693
|
warning(`${stats.failed} request(s) failed (left groups and blocked peers are expected here).`);
|
|
639
694
|
for (const f of stats.failures.slice(0, 5)) info(` ${f.threadId} (${f.what}): ${f.reason}`);
|
|
640
695
|
}
|
|
641
|
-
|
|
696
|
+
if (stats.stalled) info(`${stats.stalled} board(s) ended early: the server repeated a page (cursor did not move).`);
|
|
697
|
+
if (r.note) warning(r.note);
|
|
698
|
+
return r;
|
|
642
699
|
}
|
|
643
700
|
|
|
644
701
|
/**
|
|
@@ -646,7 +703,7 @@ async function boardPass(api, opts) {
|
|
|
646
703
|
*
|
|
647
704
|
* Reactions were long documented here as unrecoverable, which conflated two
|
|
648
705
|
* things: the transfer-sync payload genuinely has no reaction field, but the
|
|
649
|
-
* socket serves them on cmd 610/611 and Zalo
|
|
706
|
+
* socket serves them on cmd 610/611 and Zalo asks for both on every
|
|
650
707
|
* connect. Measured on a real account, one request pair returned 28 direct and
|
|
651
708
|
* 50 group reactions while the local cache held one row.
|
|
652
709
|
*
|
|
@@ -682,7 +739,7 @@ async function runReactionSync(activeAcc, opts) {
|
|
|
682
739
|
error(`Failed: ${daemonStageError(r)}`);
|
|
683
740
|
process.exit(1);
|
|
684
741
|
}
|
|
685
|
-
reportReactionStage(r.result, r.result.placed || 0, r.result.unresolvedLeft || 0, opts.pages);
|
|
742
|
+
jsonResult(reportReactionStage(r.result, r.result.placed || 0, r.result.unresolvedLeft || 0, opts.pages));
|
|
686
743
|
process.exit(0);
|
|
687
744
|
}
|
|
688
745
|
|
|
@@ -706,13 +763,19 @@ async function runReactionSync(activeAcc, opts) {
|
|
|
706
763
|
if (!connected.ok) {
|
|
707
764
|
if (connected.reason === "duplicate") {
|
|
708
765
|
error("Zalo closed this connection: another web session is already open on this account.");
|
|
709
|
-
info("Zalo allows one web session per account. Sign out of Zalo
|
|
766
|
+
info("Zalo allows one web session per account. Sign out of Zalo in your browser, then run this again.");
|
|
710
767
|
} else {
|
|
711
768
|
error(`Could not open a connection: ${connected.reason}`);
|
|
712
769
|
}
|
|
713
770
|
} else {
|
|
714
771
|
const stats = await drainPass(api, { waitMs, pages: opts.pages, removals: opts.removals });
|
|
715
772
|
reportReactionDrain(stats, opts);
|
|
773
|
+
// The shape the daemon path prints (reportReactionStage), without its retry pass.
|
|
774
|
+
jsonResult({
|
|
775
|
+
status: stats.truncated || stats.stalled ? "partial" : "ok",
|
|
776
|
+
reason: `${stats.stored} stored`,
|
|
777
|
+
stats: { received: stats.received, stored: stats.stored },
|
|
778
|
+
});
|
|
716
779
|
exitCode = 0;
|
|
717
780
|
}
|
|
718
781
|
} catch (err) {
|
|
@@ -786,7 +849,7 @@ function reportReactionStage(stats, placed, left, pages = DRAIN_PAGES) {
|
|
|
786
849
|
reportReactionDrain(stats, { pages });
|
|
787
850
|
if (placed) info(`Placed ${placed} reaction(s) whose message is now stored.`);
|
|
788
851
|
return {
|
|
789
|
-
status: stats.truncated ? "partial" : "ok",
|
|
852
|
+
status: stats.truncated || stats.stalled ? "partial" : "ok",
|
|
790
853
|
reason: `${stats.stored + placed} stored`,
|
|
791
854
|
stats: { received: stats.received, stored: stats.stored + placed, unresolved: left },
|
|
792
855
|
};
|
|
@@ -830,7 +893,7 @@ function reportReactionDrain(stats, opts) {
|
|
|
830
893
|
if (stats.received === 0) {
|
|
831
894
|
warning("The server returned no reactions.");
|
|
832
895
|
info(
|
|
833
|
-
"That is a caught-up queue, not a missing feature: this channel is what Zalo
|
|
896
|
+
"That is a caught-up queue, not a missing feature: this channel is what Zalo itself " +
|
|
834
897
|
"asks on every connect. Reactions arriving from now on are captured by `zalo-agent listen`.",
|
|
835
898
|
);
|
|
836
899
|
return;
|
|
@@ -846,7 +909,10 @@ function reportReactionDrain(stats, opts) {
|
|
|
846
909
|
);
|
|
847
910
|
}
|
|
848
911
|
if (stats.truncated) {
|
|
849
|
-
warning(`Stopped at the ${opts.pages}-page
|
|
912
|
+
warning(`Stopped at the ${opts.pages}-page bound you asked for; re-run without --pages for the rest.`);
|
|
913
|
+
}
|
|
914
|
+
if (stats.stalled) {
|
|
915
|
+
warning("Stopped early: the server said more follows but its cursor did not advance.");
|
|
850
916
|
}
|
|
851
917
|
}
|
|
852
918
|
|
|
@@ -863,7 +929,24 @@ async function runCloudSync(activeAcc, opts) {
|
|
|
863
929
|
process.exit(1);
|
|
864
930
|
}
|
|
865
931
|
|
|
866
|
-
const
|
|
932
|
+
const route = routeCloudWalk(accountDir);
|
|
933
|
+
if (route.via === "skip") {
|
|
934
|
+
error(`Not walking the cloud queue: ${route.reason}.`);
|
|
935
|
+
process.exit(1);
|
|
936
|
+
}
|
|
937
|
+
if (route.via === "daemon") info("A listen/mcp daemon holds this account — walking the cloud queue in it.");
|
|
938
|
+
let r;
|
|
939
|
+
try {
|
|
940
|
+
r = await cloudPass(api, { ...opts, walk: route.walk });
|
|
941
|
+
} catch (err) {
|
|
942
|
+
error(`Failed: ${err.message}`);
|
|
943
|
+
process.exit(1);
|
|
944
|
+
}
|
|
945
|
+
if (r.status === "skipped") {
|
|
946
|
+
info("Pass --full to walk the queue anyway.");
|
|
947
|
+
jsonResult(r);
|
|
948
|
+
process.exit(0);
|
|
949
|
+
}
|
|
867
950
|
if (r.status === "unavailable") {
|
|
868
951
|
error("Could not read the cloud index.");
|
|
869
952
|
for (const f of r.stats.failures.slice(0, 3)) info(` ${f.reason}`);
|
|
@@ -872,38 +955,169 @@ async function runCloudSync(activeAcc, opts) {
|
|
|
872
955
|
}
|
|
873
956
|
if (r.stats.lastNoiseId && !r.stats.complete) info(`Resume cursor: ${r.stats.lastNoiseId}`);
|
|
874
957
|
info("Cloud blobs are stored encrypted; this pass records where they live, it does not download them.");
|
|
958
|
+
jsonResult(r);
|
|
875
959
|
process.exit(0);
|
|
876
960
|
}
|
|
877
961
|
|
|
962
|
+
/**
|
|
963
|
+
* What the account's zCloud plan is, read in the order and with the calls Zalo makes at start-up: the settings, then
|
|
964
|
+
* `usage-mycloud`, which carries the plan; the full `v2/usage` only when that plan is not the free one (-1), as
|
|
965
|
+
* Zalo does. A free account therefore never asks for `v2/usage`. Null when the plan could not be read.
|
|
966
|
+
*
|
|
967
|
+
* @param {object} api
|
|
968
|
+
* @param {{settings?: () => Promise<object>, myCloud?: () => Promise<object>, usage?: () => Promise<object>}} [opts]
|
|
969
|
+
* test seams: the settings, `usage-mycloud` and `v2/usage` reads
|
|
970
|
+
* @returns {Promise<ReturnType<typeof summarizeCloudQuota>|null>}
|
|
971
|
+
*/
|
|
972
|
+
export async function readCloudPlan(api, opts = {}) {
|
|
973
|
+
try {
|
|
974
|
+
let settings = {};
|
|
975
|
+
try {
|
|
976
|
+
settings = (await (opts.settings ? opts.settings() : getCloudSettings(api))) ?? {};
|
|
977
|
+
} catch {
|
|
978
|
+
/* the settings add the opt-in and file limits; the plan stands without them */
|
|
979
|
+
}
|
|
980
|
+
let mine = null;
|
|
981
|
+
try {
|
|
982
|
+
mine = (await (opts.myCloud ? opts.myCloud() : getMyCloudUsage(api))) ?? null;
|
|
983
|
+
} catch {
|
|
984
|
+
/* the plan can still come from v2/usage */
|
|
985
|
+
}
|
|
986
|
+
const free = mine !== null && Number(mine.plan) === -1;
|
|
987
|
+
const usage = free ? mine : await (opts.usage ? opts.usage() : getCloudUsage(api));
|
|
988
|
+
return summarizeCloudQuota(usage ?? {}, settings);
|
|
989
|
+
} catch {
|
|
990
|
+
return null;
|
|
991
|
+
}
|
|
992
|
+
}
|
|
993
|
+
|
|
994
|
+
/**
|
|
995
|
+
* One line that says what the plan is.
|
|
996
|
+
*
|
|
997
|
+
* @param {NonNullable<Awaited<ReturnType<typeof readCloudPlan>>>} plan
|
|
998
|
+
* @returns {string}
|
|
999
|
+
*/
|
|
1000
|
+
export function describeCloudPlan(plan) {
|
|
1001
|
+
if (plan.planCode === -1 && !plan.usageBytes) {
|
|
1002
|
+
return "zCloud: no plan on this account (free), so the cloud holds nothing to index.";
|
|
1003
|
+
}
|
|
1004
|
+
const used = plan.usageBytes === null ? "?" : formatBytes(plan.usageBytes);
|
|
1005
|
+
const quota = plan.quotaBytes === null ? "?" : formatBytes(plan.quotaBytes);
|
|
1006
|
+
return `zCloud: ${plan.plan ?? "unknown plan"}, ${used} of ${quota} used.`;
|
|
1007
|
+
}
|
|
1008
|
+
|
|
1009
|
+
/**
|
|
1010
|
+
* Where a cloud walk may run (D31, ZP-09). The daemon walks the same queue on its own when the server sends cmd 621,
|
|
1011
|
+
* under its stage lock, and two walkers at once can write the saved place out of order or sweep what the other just
|
|
1012
|
+
* recorded. So with a daemon up the walk runs in it, through its channel; a process that holds the account but cannot
|
|
1013
|
+
* run the walk (a daemon older than the route, or another `sync` holding the lock) means no walk here.
|
|
1014
|
+
*
|
|
1015
|
+
* @param {object} args
|
|
1016
|
+
* @param {boolean} args.locked - whether another live process holds `daemon.lock`
|
|
1017
|
+
* @param {object|null} args.chan - the daemon's channel when it runs the `cloud` stage (`getSyncChannel(dir, "cloud")`)
|
|
1018
|
+
* @returns {{via: "local"|"daemon"|"skip", reason: string}}
|
|
1019
|
+
*/
|
|
1020
|
+
export function cloudWalkRoute({ locked, chan }) {
|
|
1021
|
+
if (chan) return { via: "daemon", reason: "" };
|
|
1022
|
+
if (locked) {
|
|
1023
|
+
return {
|
|
1024
|
+
via: "skip",
|
|
1025
|
+
reason:
|
|
1026
|
+
"another process holds this account (a listen/mcp daemon that cannot run the cloud walk, or another " +
|
|
1027
|
+
"sync), and it may walk the cloud queue itself; restart the daemon to pick the capability up",
|
|
1028
|
+
};
|
|
1029
|
+
}
|
|
1030
|
+
return { via: "local", reason: "" };
|
|
1031
|
+
}
|
|
1032
|
+
|
|
1033
|
+
/**
|
|
1034
|
+
* The `walk` that runs a cloud walk in the daemon, for {@link cloudPass}. A daemon that did not run it throws, with
|
|
1035
|
+
* the reason the other daemon stages give.
|
|
1036
|
+
*
|
|
1037
|
+
* @param {string} accountDir
|
|
1038
|
+
* @returns {(params: object) => Promise<object>}
|
|
1039
|
+
*/
|
|
1040
|
+
function daemonCloudWalk(accountDir) {
|
|
1041
|
+
return async ({ onProgress, ...params }) => {
|
|
1042
|
+
const r = await syncViaDaemon(accountDir, { stage: "cloud", params, onEvent: onProgress });
|
|
1043
|
+
if (!r?.ok) throw new Error(daemonStageError(r));
|
|
1044
|
+
return r.result;
|
|
1045
|
+
};
|
|
1046
|
+
}
|
|
1047
|
+
|
|
1048
|
+
/**
|
|
1049
|
+
* {@link cloudWalkRoute} for this account, with the `walk` it implies.
|
|
1050
|
+
*
|
|
1051
|
+
* @param {string} accountDir
|
|
1052
|
+
* @returns {{via: "local"|"daemon"|"skip", reason: string, walk?: (params: object) => Promise<object>}}
|
|
1053
|
+
*/
|
|
1054
|
+
function routeCloudWalk(accountDir) {
|
|
1055
|
+
const route = cloudWalkRoute({
|
|
1056
|
+
locked: checkLock(accountDir).locked,
|
|
1057
|
+
chan: getSyncChannel(accountDir, "cloud"),
|
|
1058
|
+
});
|
|
1059
|
+
return route.via === "daemon" ? { ...route, walk: daemonCloudWalk(accountDir) } : route;
|
|
1060
|
+
}
|
|
1061
|
+
|
|
878
1062
|
/**
|
|
879
1063
|
* One walk of the zCloud index. Exit-free.
|
|
880
1064
|
*
|
|
881
|
-
* The cursor
|
|
882
|
-
*
|
|
883
|
-
*
|
|
884
|
-
*
|
|
1065
|
+
* The cursor is saved after every page and kept when the walk is complete, as Zalo keeps its last noise id: the
|
|
1066
|
+
* next walk starts there and reads only what is new (a killed or capped walk carries on from its last page, not from
|
|
1067
|
+
* the top). `full` ignores the saved place, walks from the top and sweeps what no page listed; an explicit `resume`
|
|
1068
|
+
* wins over the saved place.
|
|
1069
|
+
*
|
|
1070
|
+
* The walk itself runs where {@link cloudWalkRoute} says: here, or in the running daemon (`walk`), which also walks
|
|
1071
|
+
* this queue on its own and must not do it beside us.
|
|
885
1072
|
*
|
|
886
1073
|
* @param {object} api
|
|
887
|
-
* @param {{resume?: string, pageSize?: number, pages?: number
|
|
888
|
-
*
|
|
1074
|
+
* @param {{resume?: string, full?: boolean, pageSize?: number, pages?: number,
|
|
1075
|
+
* walk?: (params: {resume: string, full: boolean, pageSize?: number, maxPages?: number,
|
|
1076
|
+
* onProgress: (p: object) => void}) => Promise<object>,
|
|
1077
|
+
* verify?: (params: object) => Promise<object>, usage?: () => Promise<object>, myCloud?: () => Promise<object>,
|
|
1078
|
+
* settings?: () => Promise<object>}} opts - `walk` runs the walk elsewhere (the daemon) and returns its stats;
|
|
1079
|
+
* `verify`, `usage`, `myCloud` and `settings` replace the network calls (tests)
|
|
1080
|
+
* @returns {Promise<{status: "ok"|"unavailable"|"skipped", plan: object|null, stats: object}>} `skipped`: the account
|
|
1081
|
+
* has no zCloud plan and nothing in the cloud, so no page was asked for (a `full` or `resume` walk is never skipped)
|
|
889
1082
|
*/
|
|
890
|
-
async function cloudPass(api, opts) {
|
|
1083
|
+
export async function cloudPass(api, opts) {
|
|
1084
|
+
// The plan first: an account without zCloud has nothing in the cloud to index, and says so here instead of
|
|
1085
|
+
// walking an empty queue and leaving the person to wonder. A failed read is not a verdict: the walk goes on.
|
|
1086
|
+
const plan = await readCloudPlan(api, opts);
|
|
1087
|
+
if (plan) info(describeCloudPlan(plan));
|
|
1088
|
+
if (plan && plan.planCode === -1 && !plan.usageBytes && !opts.full && !opts.resume) {
|
|
1089
|
+
return { status: "skipped", plan, stats: { items: 0, pages: 0, failures: [], complete: true } };
|
|
1090
|
+
}
|
|
891
1091
|
const saved = getSyncState("cloudCursor");
|
|
892
1092
|
const resume = opts.resume || saved || "";
|
|
893
|
-
if (!opts.resume && saved) info("
|
|
894
|
-
info("Walking the zCloud media index…");
|
|
895
|
-
const
|
|
896
|
-
|
|
897
|
-
|
|
898
|
-
|
|
899
|
-
|
|
900
|
-
|
|
901
|
-
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
|
|
905
|
-
|
|
906
|
-
|
|
1093
|
+
if (!opts.full && !opts.resume && saved) info("Reading the cloud queue from where the last walk stopped.");
|
|
1094
|
+
info(opts.full ? "Walking the whole zCloud queue…" : "Walking the zCloud media index…");
|
|
1095
|
+
const onProgress = (p) => info(` page ${p.page}: ${p.items} item(s) so far`);
|
|
1096
|
+
const stats = opts.walk
|
|
1097
|
+
? await opts.walk({
|
|
1098
|
+
resume: opts.resume || "",
|
|
1099
|
+
full: !!opts.full,
|
|
1100
|
+
pageSize: opts.pageSize,
|
|
1101
|
+
maxPages: opts.pages,
|
|
1102
|
+
onProgress,
|
|
1103
|
+
})
|
|
1104
|
+
: await syncCloudIndex({
|
|
1105
|
+
api,
|
|
1106
|
+
lastNoiseId: resume,
|
|
1107
|
+
full: !!opts.full,
|
|
1108
|
+
verify: opts.verify,
|
|
1109
|
+
pageSize: opts.pageSize,
|
|
1110
|
+
maxPages: opts.pages,
|
|
1111
|
+
onProgress,
|
|
1112
|
+
onPage: (p) => setSyncState("cloudCursor", p.cursor),
|
|
1113
|
+
});
|
|
1114
|
+
if (stats.failed && !stats.items && !stats.removed) return { status: "unavailable", plan, stats };
|
|
1115
|
+
const bits = [`Recorded ${stats.items} cloud item(s) across ${stats.pages} page(s)`];
|
|
1116
|
+
if (stats.removed) bits.push(`removed ${stats.removed} the cloud no longer holds`);
|
|
1117
|
+
if (stats.swept) bits.push(`swept ${stats.swept} no page listed`);
|
|
1118
|
+
success(`${bits.join(", ")}.`);
|
|
1119
|
+
if (stats.stalled) warning("Stopped early: zCloud said more follows but its cursor did not advance.");
|
|
1120
|
+
return { status: "ok", plan, stats };
|
|
907
1121
|
}
|
|
908
1122
|
|
|
909
1123
|
/** Human-readable byte count for the download summary. */
|
|
@@ -920,16 +1134,26 @@ function formatBytes(n) {
|
|
|
920
1134
|
}
|
|
921
1135
|
|
|
922
1136
|
/**
|
|
923
|
-
* Open the listener socket and resolve once
|
|
1137
|
+
* Open the listener socket and resolve once the server's hello has been processed (or on close/error/timeout).
|
|
924
1138
|
*
|
|
925
1139
|
* @param {object} api
|
|
926
1140
|
* @param {number} waitMs
|
|
927
1141
|
* @returns {Promise<{ok: boolean, reason?: string}>}
|
|
928
1142
|
*/
|
|
929
|
-
function connectListener(api, waitMs) {
|
|
1143
|
+
export function connectListener(api, waitMs) {
|
|
930
1144
|
return new Promise((res) => {
|
|
931
1145
|
let settled = false;
|
|
932
|
-
|
|
1146
|
+
// Zalo sends nothing until the server's hello (cmd 1/1, which carries the key) has been processed, and
|
|
1147
|
+
// then pings at once before anything else. "Open" is therefore not "connected": a reconnect
|
|
1148
|
+
// that asked for sessions 1 ms ahead of the hello was closed again within seconds.
|
|
1149
|
+
const onHello = () => {
|
|
1150
|
+
try {
|
|
1151
|
+
api.listener.sendWs(pingPayload());
|
|
1152
|
+
} catch {
|
|
1153
|
+
/* a socket that cannot take a ping is reported by the close that follows */
|
|
1154
|
+
}
|
|
1155
|
+
done({ ok: true });
|
|
1156
|
+
};
|
|
933
1157
|
const onClosed = (code) =>
|
|
934
1158
|
done({ ok: false, reason: code === CLOSE_DUPLICATE ? "duplicate" : `closed (${code})` });
|
|
935
1159
|
const onError = (e) => done({ ok: false, reason: e && e.message ? e.message : "socket error" });
|
|
@@ -942,19 +1166,47 @@ function connectListener(api, waitMs) {
|
|
|
942
1166
|
if (settled) return;
|
|
943
1167
|
settled = true;
|
|
944
1168
|
clearTimeout(timer);
|
|
945
|
-
api.listener.removeListener("
|
|
1169
|
+
api.listener.removeListener("cipher_key", onHello);
|
|
946
1170
|
api.listener.removeListener("closed", onClosed);
|
|
947
1171
|
api.listener.removeListener("error", onError);
|
|
948
1172
|
res(v);
|
|
949
1173
|
};
|
|
950
1174
|
const timer = setTimeout(() => done({ ok: false, reason: "timeout" }), waitMs);
|
|
951
|
-
api.listener.on("
|
|
1175
|
+
api.listener.on("cipher_key", onHello);
|
|
952
1176
|
api.listener.on("closed", onClosed);
|
|
953
1177
|
api.listener.on("error", onError);
|
|
954
1178
|
api.listener.start({ retryOnClose: false });
|
|
955
1179
|
});
|
|
956
1180
|
}
|
|
957
1181
|
|
|
1182
|
+
/** What Ctrl+C says while a restore lets go of the sessions it opened on the phone. */
|
|
1183
|
+
function stoppingNotice() {
|
|
1184
|
+
warning("Stopping: releasing the sync on your phone. Press Ctrl+C again to quit at once.");
|
|
1185
|
+
}
|
|
1186
|
+
|
|
1187
|
+
/**
|
|
1188
|
+
* Run the message restore on the daemon's socket, and let Ctrl+C stop it there: the first press asks the daemon
|
|
1189
|
+
* to cancel (it keeps what arrived and releases the sessions on the phone), a second quits at once and leaves the
|
|
1190
|
+
* cancel to finish by itself.
|
|
1191
|
+
*
|
|
1192
|
+
* @param {string} accountDir
|
|
1193
|
+
* @param {object} req - as for syncViaDaemon
|
|
1194
|
+
* @param {{proc?: object}} [opts] - the process, replaceable in a test
|
|
1195
|
+
* @returns {Promise<object|null>} syncViaDaemon's answer
|
|
1196
|
+
*/
|
|
1197
|
+
export function restoreViaDaemon(accountDir, req, { proc = process } = {}) {
|
|
1198
|
+
return whileInterruptible(
|
|
1199
|
+
(signal) => {
|
|
1200
|
+
signal.addEventListener("abort", () => void cancelViaDaemon(accountDir), { once: true });
|
|
1201
|
+
return syncViaDaemon(accountDir, req);
|
|
1202
|
+
},
|
|
1203
|
+
{ onStop: stoppingNotice, proc },
|
|
1204
|
+
);
|
|
1205
|
+
}
|
|
1206
|
+
|
|
1207
|
+
/** The shortest pause Zalo puts before retrying a socket that closed abnormally (its table: 2, 3, 5, 8 s). */
|
|
1208
|
+
export const RECONNECT_DELAY_MS = 2000;
|
|
1209
|
+
|
|
958
1210
|
/**
|
|
959
1211
|
* Re-open the socket after it dropped mid-stage.
|
|
960
1212
|
*
|
|
@@ -962,17 +1214,20 @@ function connectListener(api, waitMs) {
|
|
|
962
1214
|
* stops the listener itself, so the decision to reconnect is the caller's. A
|
|
963
1215
|
* 1006 is NOT in the server's own `close_and_retry_codes`
|
|
964
1216
|
* (`settings.features.socket`, measured: 5008 5007 3003 3000 5014 4002 5015
|
|
965
|
-
* 5017 5016), so
|
|
1217
|
+
* 5017 5016), so the supervisor will never retry one for us -- without this, a dropped
|
|
966
1218
|
* wire ends the run and the phone confirmation it already spent is gone.
|
|
967
1219
|
*
|
|
968
1220
|
* @param {object} api
|
|
969
1221
|
* @param {number} [waitMs=30000]
|
|
1222
|
+
* @param {number} [delayMs=RECONNECT_DELAY_MS] - how long to wait before opening the new socket
|
|
970
1223
|
* @returns {Promise<boolean>} true once a live socket is back
|
|
971
1224
|
*/
|
|
972
|
-
async function reconnectListener(api, waitMs = 30000) {
|
|
973
|
-
//
|
|
1225
|
+
export async function reconnectListener(api, waitMs = 30000, delayMs = RECONNECT_DELAY_MS) {
|
|
1226
|
+
// The listener nulls `ws` on close and refuses to start again while it is set,
|
|
974
1227
|
// so a socket still hanging around has to be put down first.
|
|
975
1228
|
if (api?.listener?.ws) await closeListener(api);
|
|
1229
|
+
// Zalo's first retry after a 1006 comes after 2 s (then 3, 5, 8); this one came after 0.5 s.
|
|
1230
|
+
if (delayMs > 0) await new Promise((r) => setTimeout(r, delayMs));
|
|
976
1231
|
const r = await connectListener(api, waitMs);
|
|
977
1232
|
return r.ok === true;
|
|
978
1233
|
}
|
|
@@ -1016,7 +1271,7 @@ async function runTransferSync(activeAcc, opts) {
|
|
|
1016
1271
|
}
|
|
1017
1272
|
|
|
1018
1273
|
// Transfer sync needs time for the phone confirmation; use a generous window.
|
|
1019
|
-
const waitMs = Math.max(
|
|
1274
|
+
const waitMs = Math.max(CONFIRM_WAIT_MS / 1000, Number(opts.wait) || 0) * 1000;
|
|
1020
1275
|
let exitCode = 1;
|
|
1021
1276
|
|
|
1022
1277
|
// A running daemon holds the account's one web session and can run the
|
|
@@ -1035,9 +1290,15 @@ async function runTransferSync(activeAcc, opts) {
|
|
|
1035
1290
|
if (win.clamped) info("(--days reaches past the oldest history this sync can request.)");
|
|
1036
1291
|
warning("This sends ONE sync request to your phone — confirm the 'ĐỒNG BỘ NGAY' prompt when it appears.");
|
|
1037
1292
|
const startedAt = Date.now();
|
|
1038
|
-
const r = await
|
|
1293
|
+
const r = await restoreViaDaemon(accountDir, {
|
|
1039
1294
|
stage: "messages",
|
|
1040
|
-
params: {
|
|
1295
|
+
params: {
|
|
1296
|
+
days: opts.days ?? null,
|
|
1297
|
+
from: opts.from,
|
|
1298
|
+
shardSize: opts.shardSize,
|
|
1299
|
+
fullResync: Boolean(opts.fullResync),
|
|
1300
|
+
waitMs,
|
|
1301
|
+
},
|
|
1041
1302
|
onEvent: ({ phase, detail }) => {
|
|
1042
1303
|
if (phase === "confirm") warning(detail);
|
|
1043
1304
|
else if (detail) info(` ${detail}`);
|
|
@@ -1067,7 +1328,9 @@ async function runTransferSync(activeAcc, opts) {
|
|
|
1067
1328
|
if (!connected.ok) {
|
|
1068
1329
|
if (connected.reason === "duplicate") {
|
|
1069
1330
|
error("Zalo closed this connection: another web session is already open on this account.");
|
|
1070
|
-
info(
|
|
1331
|
+
info(
|
|
1332
|
+
"Zalo allows one web session per account. Sign out of Zalo in your browser, then run this again.",
|
|
1333
|
+
);
|
|
1071
1334
|
} else {
|
|
1072
1335
|
error(`Could not open a connection: ${connected.reason}`);
|
|
1073
1336
|
}
|
|
@@ -1081,21 +1344,27 @@ async function runTransferSync(activeAcc, opts) {
|
|
|
1081
1344
|
);
|
|
1082
1345
|
const sv = new SyncV2(api, activeAcc.ownId);
|
|
1083
1346
|
const startedAt = Date.now();
|
|
1084
|
-
const res = await
|
|
1085
|
-
|
|
1086
|
-
|
|
1087
|
-
|
|
1088
|
-
|
|
1089
|
-
|
|
1090
|
-
|
|
1091
|
-
|
|
1092
|
-
|
|
1093
|
-
|
|
1094
|
-
|
|
1095
|
-
|
|
1096
|
-
|
|
1097
|
-
|
|
1098
|
-
|
|
1347
|
+
const res = await whileInterruptible(
|
|
1348
|
+
(signal) =>
|
|
1349
|
+
sv.restore({
|
|
1350
|
+
days: opts.days,
|
|
1351
|
+
from: opts.from,
|
|
1352
|
+
shardSize: opts.shardSize,
|
|
1353
|
+
fullResync: Boolean(opts.fullResync),
|
|
1354
|
+
waitMs,
|
|
1355
|
+
signal,
|
|
1356
|
+
// This command owns the socket for the whole run, so it owns
|
|
1357
|
+
// the heartbeat too -- see runUnifiedSync for why.
|
|
1358
|
+
keepAlive: false,
|
|
1359
|
+
reconnect: () => reconnectListener(api),
|
|
1360
|
+
onSelfName: (name) => updateAccountName(activeAcc.ownId, name),
|
|
1361
|
+
onStatus: ({ phase, detail }) => {
|
|
1362
|
+
if (phase === "confirm") warning(detail);
|
|
1363
|
+
else if (detail) info(` ${detail}`);
|
|
1364
|
+
},
|
|
1365
|
+
}),
|
|
1366
|
+
{ onStop: stoppingNotice },
|
|
1367
|
+
);
|
|
1099
1368
|
reportRestore(res, win, { startedAt, keep: ownThreadIds(api, activeAcc.ownId) });
|
|
1100
1369
|
exitCode = 0;
|
|
1101
1370
|
}
|
|
@@ -1122,7 +1391,7 @@ async function runTransferSync(activeAcc, opts) {
|
|
|
1122
1391
|
// a successful restore into a failed run -- the messages are already safe.
|
|
1123
1392
|
if (exitCode === 0 && !opts.messagesOnly) {
|
|
1124
1393
|
try {
|
|
1125
|
-
await fetchMediaAfterRestore(accountDir, api, win.from);
|
|
1394
|
+
await fetchMediaAfterRestore(accountDir, api, win.from, { limit: opts.mediaLimit });
|
|
1126
1395
|
} catch (err) {
|
|
1127
1396
|
warning(`Media download stopped: ${err.message}`);
|
|
1128
1397
|
info("The messages are stored. Run `zalo-agent sync-media` to retry the files.");
|
|
@@ -1243,7 +1512,7 @@ function recordRestoreList(res, win, ctx) {
|
|
|
1243
1512
|
* @param {{startedAt?: number, keep?: string[]}} [ctx] - see recordRestoreList
|
|
1244
1513
|
* @returns {{status: "ok"|"partial"|"unconfirmed", reason: string}}
|
|
1245
1514
|
*/
|
|
1246
|
-
function reportRestore(res, win, ctx = {}) {
|
|
1515
|
+
export function reportRestore(res, win, ctx = {}) {
|
|
1247
1516
|
// Before the early returns: a thread IN a partial list is still present.
|
|
1248
1517
|
let list = null;
|
|
1249
1518
|
try {
|
|
@@ -1258,6 +1527,11 @@ function reportRestore(res, win, ctx = {}) {
|
|
|
1258
1527
|
if (win.days) info("Pass a larger --days, or drop --days for full history.");
|
|
1259
1528
|
return { status: "ok", reason: "phone confirmed: nothing missed in this window" };
|
|
1260
1529
|
}
|
|
1530
|
+
if (res.reason === "cancelled") {
|
|
1531
|
+
warning(`Cancelled: ${res.messagesSaved} message(s) from ${res.conversations} conversation(s) were stored.`);
|
|
1532
|
+
info("The sync was released on your phone. Run it again to fetch the rest.");
|
|
1533
|
+
return { status: "partial", reason: "cancelled by you" };
|
|
1534
|
+
}
|
|
1261
1535
|
if (res.reason === "partial" || res.reason === "socket-lost") {
|
|
1262
1536
|
const how =
|
|
1263
1537
|
res.reason === "socket-lost"
|
|
@@ -1268,7 +1542,7 @@ function reportRestore(res, win, ctx = {}) {
|
|
|
1268
1542
|
if (res.rowErrors) {
|
|
1269
1543
|
warning(
|
|
1270
1544
|
`${res.rowErrors} message(s) could not be written to the local cache (${res.firstRowError ?? "unknown error"}). ` +
|
|
1271
|
-
"
|
|
1545
|
+
"Their conversations are not marked as restored, so the next run asks for them again.",
|
|
1272
1546
|
);
|
|
1273
1547
|
}
|
|
1274
1548
|
warning(
|
|
@@ -1338,12 +1612,18 @@ function reportRestore(res, win, ctx = {}) {
|
|
|
1338
1612
|
*
|
|
1339
1613
|
* @param {string} accountDir
|
|
1340
1614
|
* @param {object|null} api - needed only to renew expired links
|
|
1615
|
+
* @param {number} [since] - epoch ms; only media inside the window this run covered
|
|
1616
|
+
* @param {{limit?: number}} [cap] - `limit`: download at most this many files in this run (`--media-limit`)
|
|
1341
1617
|
*/
|
|
1342
|
-
async function fetchMediaAfterRestore(accountDir, api, since) {
|
|
1618
|
+
async function fetchMediaAfterRestore(accountDir, api, since, { limit } = {}) {
|
|
1343
1619
|
const pending = countPendingAttachments();
|
|
1344
1620
|
if (!pending) return null;
|
|
1345
1621
|
|
|
1346
|
-
|
|
1622
|
+
const capped = Number.isFinite(limit) && limit > 0 && limit < pending;
|
|
1623
|
+
info(
|
|
1624
|
+
`Downloading ${capped ? `up to ${limit} of ${pending}` : pending} attachment(s) — no phone confirmation needed. ` +
|
|
1625
|
+
"Ctrl-C is safe; it resumes.",
|
|
1626
|
+
);
|
|
1347
1627
|
let last = 0;
|
|
1348
1628
|
// Tallied here rather than read off the result: the result does not exist
|
|
1349
1629
|
// until the whole download resolves, so progress lines would all read 0 B.
|
|
@@ -1358,7 +1638,9 @@ async function fetchMediaAfterRestore(accountDir, api, since) {
|
|
|
1358
1638
|
// an unscoped fetch re-downloads exactly what was just deleted.
|
|
1359
1639
|
since: Number.isFinite(since) && since > 0 ? since : undefined,
|
|
1360
1640
|
includePruned: false,
|
|
1361
|
-
|
|
1641
|
+
// Two at a time, as Zalo fetches: a burst is what the CDN answers with 403 and 429.
|
|
1642
|
+
concurrency: 2,
|
|
1643
|
+
maxFiles: limit,
|
|
1362
1644
|
threadNames: getThreadNames(),
|
|
1363
1645
|
onProgress: (p) => {
|
|
1364
1646
|
if (p.phase !== "saved") return;
|
|
@@ -1370,9 +1652,20 @@ async function fetchMediaAfterRestore(accountDir, api, since) {
|
|
|
1370
1652
|
},
|
|
1371
1653
|
});
|
|
1372
1654
|
success(`Downloaded ${stats.downloaded}/${stats.considered} file(s) (${formatBytes(stats.bytes)}).`);
|
|
1655
|
+
if (stats.deferred) {
|
|
1656
|
+
info(
|
|
1657
|
+
`${stats.deferred} more file(s) are waiting (this run was capped at ${limit}); run \`zalo-agent sync-media\` to continue.`,
|
|
1658
|
+
);
|
|
1659
|
+
}
|
|
1373
1660
|
if (stats.renewed) info(`Renewed ${stats.renewed} expired link(s).`);
|
|
1374
1661
|
if (stats.expired) {
|
|
1375
1662
|
warning(`${stats.expired} link(s) are gone and could not be renewed.`);
|
|
1663
|
+
if (stats.cloudBacked) {
|
|
1664
|
+
info(
|
|
1665
|
+
`${stats.cloudBacked} of the files that are gone are listed in your zCloud index: the cloud holds a copy ` +
|
|
1666
|
+
"this tool cannot open (it is end-to-end encrypted under the account's cloud key, which this tool never holds).",
|
|
1667
|
+
);
|
|
1668
|
+
}
|
|
1376
1669
|
info("Zalo keeps media for a limited time; past that the file exists only on the sending device.");
|
|
1377
1670
|
}
|
|
1378
1671
|
if (stats.throttled) {
|
|
@@ -1446,6 +1739,7 @@ function printPlan(plan, win, jsonMode) {
|
|
|
1446
1739
|
window: win.label,
|
|
1447
1740
|
openSocket: plan.openSocket,
|
|
1448
1741
|
viaDaemon: plan.viaDaemon,
|
|
1742
|
+
cloudViaDaemon: Boolean(plan.cloudViaDaemon),
|
|
1449
1743
|
stages: plan.stages.map((s) => ({
|
|
1450
1744
|
stage: s.name,
|
|
1451
1745
|
transport: s.transport,
|
|
@@ -1464,6 +1758,10 @@ function printPlan(plan, win, jsonMode) {
|
|
|
1464
1758
|
} else {
|
|
1465
1759
|
info(plan.openSocket ? "Opens the WebSocket once, for the socket stages." : "Opens no WebSocket.");
|
|
1466
1760
|
}
|
|
1761
|
+
if (plan.cloudViaDaemon) {
|
|
1762
|
+
info("The zCloud walk runs in the running daemon (it walks the same queue on its own; two walkers");
|
|
1763
|
+
info("would write its saved place out of order).");
|
|
1764
|
+
}
|
|
1467
1765
|
for (const s of plan.stages) {
|
|
1468
1766
|
const tag = s.run ? (s.phone ? "RUN (wakes your phone)" : "RUN") : "skip";
|
|
1469
1767
|
// The transport column says HOW; this says WHOSE socket.
|
|
@@ -1481,7 +1779,7 @@ function printPlan(plan, win, jsonMode) {
|
|
|
1481
1779
|
* of the messages and conversations, and they were split across five
|
|
1482
1780
|
* commands -- two of which each opened their own socket and took their own
|
|
1483
1781
|
* lock, so a full refresh meant running five things in the right order and
|
|
1484
|
-
* evicting Zalo
|
|
1782
|
+
* evicting a browser Zalo session twice. This runs them as stages of one process: one lock,
|
|
1485
1783
|
* one socket window shared by the socket stages, then the REST stages, and one
|
|
1486
1784
|
* exit code at the end. The five commands remain for targeted re-runs.
|
|
1487
1785
|
*
|
|
@@ -1541,6 +1839,10 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1541
1839
|
freshness,
|
|
1542
1840
|
lockOk: !checkLock(accountDir).locked,
|
|
1543
1841
|
daemonChannel: Boolean(chan),
|
|
1842
|
+
cloudRoute: cloudWalkRoute({
|
|
1843
|
+
locked: checkLock(accountDir).locked,
|
|
1844
|
+
chan: getSyncChannel(accountDir, "cloud"),
|
|
1845
|
+
}),
|
|
1544
1846
|
}),
|
|
1545
1847
|
win,
|
|
1546
1848
|
jsonMode,
|
|
@@ -1584,13 +1886,14 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1584
1886
|
// the owner's phone can supply the history.
|
|
1585
1887
|
warning("This sends ONE sync request to your phone — confirm the 'ĐỒNG BỘ NGAY' prompt when it appears.");
|
|
1586
1888
|
const startedAt = Date.now();
|
|
1587
|
-
const r = await
|
|
1889
|
+
const r = await restoreViaDaemon(accountDir, {
|
|
1588
1890
|
stage: "messages",
|
|
1589
1891
|
params: {
|
|
1590
1892
|
days: opts.days ?? null,
|
|
1591
1893
|
from: opts.from,
|
|
1592
1894
|
shardSize: opts.shardSize,
|
|
1593
|
-
|
|
1895
|
+
fullResync: Boolean(opts.fullResync),
|
|
1896
|
+
waitMs: Math.max(CONFIRM_WAIT_MS / 1000, Number(opts.wait) || 0) * 1000,
|
|
1594
1897
|
},
|
|
1595
1898
|
onEvent: ({ phase, detail }) => {
|
|
1596
1899
|
if (phase === "confirm") warning(detail);
|
|
@@ -1639,10 +1942,10 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1639
1942
|
// ONE heartbeat for the whole socket window, covering every socket
|
|
1640
1943
|
// stage and the gaps between them.
|
|
1641
1944
|
//
|
|
1642
|
-
// The socket is not unpinged without this --
|
|
1945
|
+
// The socket is not unpinged without this -- the listener sends Zalo's
|
|
1643
1946
|
// `cmd 2/1` ping on the interval the server hands out at login, which
|
|
1644
|
-
// this account's login reports as 180000 ms, the same value
|
|
1645
|
-
//
|
|
1947
|
+
// this account's login reports as 180000 ms, the same value Zalo's own
|
|
1948
|
+
// sessions use. The problem is that 180 s is the entire width
|
|
1646
1949
|
// of the phone wait: the restore sends nothing and receives nothing for
|
|
1647
1950
|
// minutes, so the flow can sit silent right up against the server's own
|
|
1648
1951
|
// liveness bound with no margin, and one late ping means six minutes of
|
|
@@ -1659,7 +1962,7 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1659
1962
|
if (!connected.ok) {
|
|
1660
1963
|
const why =
|
|
1661
1964
|
connected.reason === "duplicate"
|
|
1662
|
-
? "another web session is open on this account (sign out of Zalo
|
|
1965
|
+
? "another web session is open on this account (sign out of Zalo in your browser)"
|
|
1663
1966
|
: `could not open a connection: ${connected.reason}`;
|
|
1664
1967
|
warning(`Socket stages skipped — ${why}.`);
|
|
1665
1968
|
for (const n of ["messages", "reactions"]) if (runs(n)) record(n, "failed", why);
|
|
@@ -1670,7 +1973,7 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1670
1973
|
// The restore runs FIRST and ALONE, exactly as `sync-mobile
|
|
1671
1974
|
// --transfer` runs it -- its own live-store tap included. The
|
|
1672
1975
|
// first version drained the reaction backlog concurrently, as
|
|
1673
|
-
// Zalo
|
|
1976
|
+
// Zalo does on connect, and the restore then lost its socket
|
|
1674
1977
|
// (close 1006) at batch 0 of 5 on both live attempts, right after
|
|
1675
1978
|
// the phone confirmed. The same window on the same account
|
|
1676
1979
|
// restored 11,324 messages through the old command minutes later.
|
|
@@ -1684,20 +1987,26 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1684
1987
|
);
|
|
1685
1988
|
try {
|
|
1686
1989
|
const startedAt = Date.now();
|
|
1687
|
-
const res = await
|
|
1688
|
-
|
|
1689
|
-
|
|
1690
|
-
|
|
1691
|
-
|
|
1692
|
-
|
|
1693
|
-
|
|
1694
|
-
|
|
1695
|
-
|
|
1696
|
-
|
|
1697
|
-
|
|
1698
|
-
|
|
1699
|
-
|
|
1700
|
-
|
|
1990
|
+
const res = await whileInterruptible(
|
|
1991
|
+
(signal) =>
|
|
1992
|
+
new SyncV2(api, activeAcc.ownId).restore({
|
|
1993
|
+
days: opts.days,
|
|
1994
|
+
from: opts.from,
|
|
1995
|
+
shardSize: opts.shardSize,
|
|
1996
|
+
fullResync: Boolean(opts.fullResync),
|
|
1997
|
+
waitMs: Math.max(CONFIRM_WAIT_MS / 1000, Number(opts.wait) || 0) * 1000,
|
|
1998
|
+
signal,
|
|
1999
|
+
// The window-level heartbeat above covers this stage.
|
|
2000
|
+
keepAlive: false,
|
|
2001
|
+
reconnect: () => reconnectListener(api),
|
|
2002
|
+
onSelfName: (name) => updateAccountName(activeAcc.ownId, name),
|
|
2003
|
+
onStatus: ({ phase, detail }) => {
|
|
2004
|
+
if (phase === "confirm") warning(detail);
|
|
2005
|
+
else if (detail) info(` ${detail}`);
|
|
2006
|
+
},
|
|
2007
|
+
}),
|
|
2008
|
+
{ onStop: stoppingNotice },
|
|
2009
|
+
);
|
|
1701
2010
|
const r = reportRestore(res, win, { startedAt, keep: ownThreadIds(api, activeAcc.ownId) });
|
|
1702
2011
|
record("messages", r.status, r.reason, {
|
|
1703
2012
|
conversations: res.conversations,
|
|
@@ -1789,14 +2098,21 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1789
2098
|
|
|
1790
2099
|
if (runs("boards")) {
|
|
1791
2100
|
try {
|
|
1792
|
-
const r = await boardPass(api, {
|
|
2101
|
+
const r = await boardPass(api, { concurrency: 3, boards: true, reminders: true });
|
|
1793
2102
|
if (r.status === "skipped") record("boards", "skipped", r.reason);
|
|
1794
2103
|
else {
|
|
1795
|
-
record(
|
|
1796
|
-
|
|
1797
|
-
|
|
1798
|
-
|
|
1799
|
-
|
|
2104
|
+
record(
|
|
2105
|
+
"boards",
|
|
2106
|
+
r.stats.failed || r.stats.stoppedBy ? "partial" : "ok",
|
|
2107
|
+
r.note || `${r.stats.failed} request(s) failed`,
|
|
2108
|
+
{
|
|
2109
|
+
boardItems: r.stats.boardItems,
|
|
2110
|
+
reminders: r.stats.reminders,
|
|
2111
|
+
threads: r.stats.threads,
|
|
2112
|
+
...(r.stats.stoppedBy && { stoppedBy: r.stats.stoppedBy, left: r.stats.left }),
|
|
2113
|
+
...(r.stats.stalled && { stalled: r.stats.stalled }),
|
|
2114
|
+
},
|
|
2115
|
+
);
|
|
1800
2116
|
}
|
|
1801
2117
|
} catch (err) {
|
|
1802
2118
|
warning(`Boards failed: ${err.message}`);
|
|
@@ -1804,10 +2120,17 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1804
2120
|
}
|
|
1805
2121
|
}
|
|
1806
2122
|
|
|
1807
|
-
|
|
2123
|
+
const cloudRoute = runs("cloud") ? routeCloudWalk(accountDir) : null;
|
|
2124
|
+
if (cloudRoute?.via === "skip") {
|
|
2125
|
+
info(`zCloud index skipped: ${cloudRoute.reason}.`);
|
|
2126
|
+
record("cloud", "skipped", cloudRoute.reason);
|
|
2127
|
+
} else if (cloudRoute) {
|
|
1808
2128
|
try {
|
|
1809
|
-
|
|
1810
|
-
|
|
2129
|
+
if (cloudRoute.via === "daemon") info("Walking the zCloud index in the running daemon.");
|
|
2130
|
+
const r = await cloudPass(api, { pageSize: 300, walk: cloudRoute.walk });
|
|
2131
|
+
if (r.status === "skipped") {
|
|
2132
|
+
record("cloud", "skipped", "no zCloud plan on this account", { plan: r.plan?.plan ?? null });
|
|
2133
|
+
} else if (r.status === "unavailable") {
|
|
1811
2134
|
// Not a failure: an account without zCloud answers exactly like
|
|
1812
2135
|
// this, and `sync` must not exit 1 on every such account.
|
|
1813
2136
|
info("zCloud index unavailable (zCloud off, or the endpoint changed).");
|
|
@@ -1831,13 +2154,14 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1831
2154
|
if (runs("media")) {
|
|
1832
2155
|
try {
|
|
1833
2156
|
const since = Number(getSyncState("lastSyncOkFrom"));
|
|
1834
|
-
const m = await fetchMediaAfterRestore(accountDir, api, since);
|
|
2157
|
+
const m = await fetchMediaAfterRestore(accountDir, api, since, { limit: opts.mediaLimit });
|
|
1835
2158
|
if (!m) record("media", "ok", "nothing waiting to download");
|
|
1836
2159
|
else {
|
|
1837
2160
|
const short = m.expired || m.throttled || m.unknown || m.abortedEarly;
|
|
1838
2161
|
record("media", short ? "partial" : "ok", "", {
|
|
1839
2162
|
downloaded: m.downloaded,
|
|
1840
2163
|
considered: m.considered,
|
|
2164
|
+
deferred: m.deferred,
|
|
1841
2165
|
expired: m.expired,
|
|
1842
2166
|
throttled: m.throttled,
|
|
1843
2167
|
unknown: m.unknown,
|
|
@@ -1873,13 +2197,13 @@ async function runUnifiedSync(activeAcc, opts, jsonMode) {
|
|
|
1873
2197
|
*
|
|
1874
2198
|
* HONEST STATUS, measured 2026-09-20: on the account this was developed
|
|
1875
2199
|
* against, Zalo answers both commands with an EMPTY set — including when given
|
|
1876
|
-
* the exact `lastId` anchors Zalo
|
|
2200
|
+
* the exact `lastId` anchors Zalo itself sends. Zalo gets the same
|
|
1877
2201
|
* empty answer and then falls back to `transfer-sync-v2` (socket cmd 590/591,
|
|
1878
2202
|
* libsignal-encrypted), which is the only path observed carrying real data and
|
|
1879
2203
|
* is NOT implemented here.
|
|
1880
2204
|
*
|
|
1881
2205
|
* DO NOT read "no phone contact" as a feature. The phone IS the data source:
|
|
1882
|
-
* the account owner confirmed that a real Zalo
|
|
2206
|
+
* the account owner confirmed that a real Zalo sync makes their phone show
|
|
1883
2207
|
* a request notification, which means cmd 590 causes the server to wake the
|
|
1884
2208
|
* phone, and the phone encrypts the payload that comes back as cmd 601. A run
|
|
1885
2209
|
* of this command that leaves the phone silent has not synced anything.
|
|
@@ -1897,9 +2221,9 @@ async function runSocketBackfill(activeAcc, opts) {
|
|
|
1897
2221
|
|
|
1898
2222
|
// Build the SyncManager first so we can consult the local sync-freshness
|
|
1899
2223
|
// marker BEFORE touching the network. A redundant run should neither open
|
|
1900
|
-
// a socket (which would evict a live Zalo
|
|
2224
|
+
// a socket (which would evict a live browser Zalo session) nor, once the
|
|
1901
2225
|
// transfer-sync path lands, wake the owner's phone — the same debounce Zalo
|
|
1902
|
-
//
|
|
2226
|
+
// applies to its own "Đồng bộ tin nhắn".
|
|
1903
2227
|
let api;
|
|
1904
2228
|
let syncManager;
|
|
1905
2229
|
try {
|
|
@@ -1951,7 +2275,7 @@ async function runSocketBackfill(activeAcc, opts) {
|
|
|
1951
2275
|
if (!connected.ok) {
|
|
1952
2276
|
if (connected.reason === "duplicate") {
|
|
1953
2277
|
error("Zalo closed this connection: another web session is already open on this account.");
|
|
1954
|
-
info("Zalo allows one web session per account. Sign out of Zalo
|
|
2278
|
+
info("Zalo allows one web session per account. Sign out of Zalo in your browser, then run this again.");
|
|
1955
2279
|
} else {
|
|
1956
2280
|
error(`Could not open a connection: ${connected.reason}`);
|
|
1957
2281
|
}
|
|
@@ -1968,7 +2292,7 @@ async function runSocketBackfill(activeAcc, opts) {
|
|
|
1968
2292
|
if (res.total === 0) {
|
|
1969
2293
|
warning("No history returned — and your phone was never asked.");
|
|
1970
2294
|
info(
|
|
1971
|
-
"A real Zalo sync notifies your phone, because the phone is the data source: Zalo
|
|
2295
|
+
"A real Zalo sync notifies your phone, because the phone is the data source: Zalo sends " +
|
|
1972
2296
|
"socket cmd 590, the server wakes the phone, the phone encrypts and uploads, and the payload " +
|
|
1973
2297
|
"comes back as cmd 601. That handshake (transfer-sync-v2) is what `--transfer` runs; this " +
|
|
1974
2298
|
"default path does not, so the absence of a notification on your phone means no real sync took place.",
|