@ardennguyen/zalo-agent-cli 2.5.8 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +23 -2
- package/DISCLAIMER.md +3 -3
- package/LICENSE +2 -3
- package/NOTICE +14 -34
- package/README.md +166 -72
- package/package.json +37 -19
- package/src/commands/account.js +369 -40
- package/src/commands/auto-reply.js +8 -25
- package/src/commands/bank.js +25 -6
- package/src/commands/catalog.js +54 -11
- package/src/commands/cloud.js +459 -0
- package/src/commands/conv.js +470 -287
- package/src/commands/db.js +442 -0
- package/src/commands/fleet.js +449 -41
- package/src/commands/friend.js +198 -45
- package/src/commands/group.js +256 -43
- package/src/commands/label.js +16 -2
- package/src/commands/listen.js +495 -122
- package/src/commands/login.js +313 -117
- package/src/commands/mcp-approver.js +103 -0
- package/src/commands/mcp-webhook.js +13 -5
- package/src/commands/mcp.js +800 -104
- package/src/commands/msg-media.js +187 -0
- package/src/commands/msg-search.js +219 -0
- package/src/commands/msg.js +414 -110
- package/src/commands/oa/calls.js +134 -0
- package/src/commands/oa/content.js +266 -0
- package/src/commands/oa/gmf.js +429 -0
- package/src/commands/oa/messages.js +355 -0
- package/src/commands/oa/users.js +502 -0
- package/src/commands/oa-init.js +122 -123
- package/src/commands/oa-listen.js +374 -150
- package/src/commands/oa.js +83 -598
- package/src/commands/policy.js +224 -0
- package/src/commands/poll.js +3 -0
- package/src/commands/presence.js +175 -0
- package/src/commands/profile.js +45 -94
- package/src/commands/quick-msg.js +26 -0
- package/src/commands/read.js +172 -0
- package/src/commands/reminder.js +34 -4
- package/src/commands/social.js +223 -0
- package/src/commands/sync.js +482 -158
- package/src/commands/write.js +85 -0
- package/src/commands/zbs.js +502 -0
- package/src/core/account-devices.js +76 -0
- package/src/core/account-state.js +167 -0
- package/src/core/account-status.js +355 -0
- package/src/core/accounts.js +11 -4
- package/src/core/admin-api.js +392 -0
- package/src/core/approval.js +271 -0
- package/src/core/auto-reply.js +27 -0
- package/src/core/bank-accounts.js +1 -1
- package/src/core/block-sharing.js +43 -0
- package/src/core/board-pass.js +94 -0
- package/src/core/cached-message.js +78 -8
- package/src/core/cloud-plan.js +285 -0
- package/src/core/cloud-verify.js +305 -0
- package/src/core/confirm-guard.js +808 -0
- package/src/core/contact-names.js +504 -0
- package/src/core/control-events.js +525 -0
- package/src/core/control-replay.js +106 -0
- package/src/core/conversation-actions.js +214 -0
- package/src/core/credentials.js +112 -11
- package/src/core/current-user-names.js +60 -26
- package/src/core/daemon-channel.js +296 -15
- package/src/core/daemon-health.js +110 -7
- package/src/core/daemon-presence.js +455 -0
- package/src/core/daemon-sync.js +58 -18
- package/src/core/data-export.js +610 -0
- package/src/core/db-tools.js +473 -0
- package/src/core/db.js +1327 -83
- package/src/core/deploy-policy.js +560 -0
- package/src/core/device-since.js +123 -0
- package/src/core/e2ee-notice.js +41 -0
- package/src/core/exit-codes.js +7 -0
- package/src/core/export-crypt.js +290 -0
- package/src/core/fleet-controller.js +340 -0
- package/src/core/fleet-purge.js +144 -0
- package/src/core/fleet-qr.js +273 -0
- package/src/core/fleet-serve.js +292 -0
- package/src/core/fleet-supervisor.js +176 -0
- package/src/core/fleet-templates.js +568 -39
- package/src/core/fleet.js +232 -20
- package/src/core/friend-requests.js +80 -16
- package/src/core/friend-search.js +1 -1
- package/src/core/group-admin.js +2 -29
- package/src/core/group-departure.js +233 -0
- package/src/core/group-exit.js +621 -0
- package/src/core/group-members.js +21 -9
- package/src/core/group-settings.js +5 -207
- package/src/core/hidden-chat-actions.js +96 -0
- package/src/core/hidden-chats.js +425 -0
- package/src/core/history-fetch.js +81 -27
- package/src/core/keystore/config.js +163 -0
- package/src/core/keystore/container.js +208 -0
- package/src/core/keystore/index.js +483 -0
- package/src/core/keystore/keyring.js +588 -0
- package/src/core/keystore/kms.js +157 -0
- package/src/core/keystore/media-seal.js +711 -0
- package/src/core/keystore/providers.js +492 -0
- package/src/core/keystore/stores.js +177 -0
- package/src/core/keystore/worker.js +80 -0
- package/src/core/kick-marker.js +61 -0
- package/src/core/last-online.js +236 -0
- package/src/core/list-all.js +280 -0
- package/src/core/listener-lifecycle.js +101 -10
- package/src/core/live-api.js +1 -1
- package/src/core/live-store.js +111 -53
- package/src/core/local-reads.js +16 -0
- package/src/core/logout.js +102 -140
- package/src/core/media-deliver.js +732 -0
- package/src/core/media-route.js +347 -0
- package/src/core/media-store.js +408 -0
- package/src/core/mutual-groups.js +94 -0
- package/src/core/name-refresh.js +135 -0
- package/src/core/oa/calls.js +212 -0
- package/src/core/oa/content.js +390 -0
- package/src/core/oa/gmf.js +537 -0
- package/src/core/oa/messages.js +470 -0
- package/src/core/oa/oauth.js +422 -0
- package/src/core/oa/transport.js +645 -0
- package/src/core/oa/users.js +694 -0
- package/src/core/oa-client.js +49 -415
- package/src/core/overflow-repair.js +221 -0
- package/src/core/policy-layer.js +55 -0
- package/src/core/policy-schema.js +401 -0
- package/src/core/policy-store.js +1058 -0
- package/src/core/presence-config.js +100 -0
- package/src/core/presence-leases.js +211 -0
- package/src/core/presence.js +688 -0
- package/src/core/profile-settings.js +243 -0
- package/src/core/qr-login-flow.js +237 -0
- package/src/core/read-state.js +145 -22
- package/src/core/receipts.js +355 -548
- package/src/core/recent-conversations.js +28 -6
- package/src/core/row-mac.js +405 -0
- package/src/core/search.js +271 -0
- package/src/core/secure-page.js +771 -0
- package/src/core/self-heal.js +493 -34
- package/src/core/session-expiry.js +103 -0
- package/src/core/session-notice.js +249 -0
- package/src/core/social/client.js +296 -0
- package/src/core/social/dpop.js +54 -0
- package/src/core/socket-host.js +437 -0
- package/src/core/sqlite.js +520 -0
- package/src/core/startup-gate.js +49 -5
- package/src/core/storage-quota.js +796 -0
- package/src/core/sync-action.js +180 -0
- package/src/core/sync-v2/auto-sync.js +356 -0
- package/src/core/sync-v2/board.js +130 -92
- package/src/core/sync-v2/conv-state.js +21 -4
- package/src/core/sync-v2/gap-advice.js +2 -3
- package/src/core/sync-v2/index.js +739 -323
- package/src/core/sync-v2/media.js +116 -27
- package/src/core/sync-v2/plan.js +16 -2
- package/src/core/sync-v2/ranges.js +98 -0
- package/src/core/sync-v2/reactions.js +12 -196
- package/src/core/sync-v2/senders.js +32 -14
- package/src/core/sync-v2/zcloud.js +177 -579
- package/src/core/sync.js +23 -21
- package/src/core/test-fake-session.js +87 -0
- package/src/core/typing.js +78 -0
- package/src/core/unknown-acts.js +240 -0
- package/src/core/voice-text.js +171 -0
- package/src/core/webhook-outbox.js +110 -12
- package/src/core/zalo-client.js +147 -188
- package/src/core/zbs/api.js +505 -0
- package/src/core/zbs/image.js +85 -0
- package/src/core/zbs/phone.js +59 -0
- package/src/core/zbs/rsa.js +129 -0
- package/src/core/zbs/template-check.js +449 -0
- package/src/index.js +60 -10
- package/src/mcp/action-tool.js +188 -0
- package/src/mcp/actions-business.js +488 -0
- package/src/mcp/actions-conversation.js +633 -0
- package/src/mcp/actions-media.js +268 -0
- package/src/mcp/actions-profile.js +281 -0
- package/src/mcp/actions-social.js +518 -0
- package/src/mcp/instructions.js +19 -5
- package/src/mcp/mcp-config.js +112 -10
- package/src/mcp/mcp-http-transport.js +162 -25
- package/src/mcp/mcp-server.js +14 -3
- package/src/mcp/mcp-tools.js +1686 -384
- package/src/mcp/message-buffer.js +58 -12
- package/src/mcp/notifier.js +1 -1
- package/src/mcp/official-tool.js +298 -0
- package/src/mcp/sync-jobs.js +7 -1
- package/src/mcp/sync-stages.js +72 -0
- package/src/mcp/thread-name-cache.js +43 -5
- package/src/mcp/tool-presence.js +153 -0
- package/src/mcp/wait-batch.js +27 -0
- package/src/mcp/wait-result.js +19 -21
- package/src/utils/bank-helpers.js +52 -1
- package/src/utils/cli-args.js +12 -12
- package/src/utils/date-range.js +50 -0
- package/src/utils/hidden-access.js +141 -0
- package/src/utils/interrupt.js +37 -0
- package/src/utils/json-input.js +41 -0
- package/src/utils/list-replies.js +60 -0
- package/src/utils/my-documents.js +2 -3
- package/src/utils/output.js +66 -2
- package/src/utils/qr-display.js +14 -8
- package/src/utils/qr-http-server.js +674 -134
- package/src/utils/quote.js +8 -8
- package/src/utils/secret-input.js +57 -0
- package/src/utils/vn-text.js +72 -0
- package/src/zalo/README.md +46 -0
- package/src/zalo/anomaly-store.js +49 -0
- package/src/zalo/api/actions.js +670 -0
- package/src/zalo/api/boards.js +1036 -0
- package/src/zalo/api/business.js +662 -0
- package/src/zalo/api/conversations.js +329 -0
- package/src/zalo/api/groups.js +631 -0
- package/src/zalo/api/messages.js +695 -0
- package/src/zalo/api/people.js +711 -0
- package/src/zalo/api/profile.js +374 -0
- package/src/zalo/api/session.js +45 -0
- package/src/zalo/api/upload.js +976 -0
- package/src/zalo/api.js +117 -0
- package/src/zalo/client.js +206 -0
- package/src/zalo/custom/forward.js +199 -0
- package/src/zalo/custom/gid.js +123 -0
- package/src/zalo/custom/group-history.js +246 -0
- package/src/zalo/custom/group-invite.js +53 -0
- package/src/zalo/custom/group-settings.js +186 -0
- package/src/zalo/custom/group-visibility.js +71 -0
- package/src/zalo/custom/pin.js +220 -0
- package/src/zalo/custom/renewlink.js +115 -0
- package/src/zalo/device-fingerprint.js +33 -0
- package/src/zalo/download-fetch.js +45 -0
- package/src/zalo/enums.js +25 -0
- package/src/zalo/errors.js +195 -0
- package/src/zalo/format/mentions.js +140 -0
- package/src/zalo/format/split-message.js +222 -0
- package/src/zalo/format/urgency.js +29 -0
- package/src/zalo/headers.js +93 -0
- package/src/zalo/index.js +72 -0
- package/src/zalo/kernel/atomic-file.js +217 -0
- package/src/zalo/kernel/bound.js +46 -0
- package/src/zalo/kernel/cipher.js +88 -0
- package/src/zalo/kernel/cookies.js +125 -0
- package/src/zalo/kernel/endpoint.js +211 -0
- package/src/zalo/kernel/http.js +360 -0
- package/src/zalo/kernel/json-ids.js +118 -0
- package/src/zalo/kernel/login-cipher.js +165 -0
- package/src/zalo/kernel/secret-file.js +45 -0
- package/src/zalo/kernel/session.js +261 -0
- package/src/zalo/kernel/zcloud-cipher.js +83 -0
- package/src/zalo/kickout.js +136 -0
- package/src/zalo/listener/dispatch.js +404 -0
- package/src/zalo/listener/frames.js +222 -0
- package/src/zalo/listener/friend-events.js +113 -0
- package/src/zalo/listener/group-events.js +117 -0
- package/src/zalo/listener/keepalive.js +191 -0
- package/src/zalo/listener/listener.js +469 -0
- package/src/zalo/listener/models.js +220 -0
- package/src/zalo/listener/reactions.js +224 -0
- package/src/zalo/listener/socket-tap.js +228 -0
- package/src/zalo/login.js +387 -0
- package/src/zalo/logout.js +192 -0
- package/src/zalo/maintenance.js +183 -0
- package/src/zalo/official-logout.js +254 -0
- package/src/zalo/paging.js +114 -0
- package/src/zalo/profile.js +184 -0
- package/src/zalo/pulls.js +129 -0
- package/src/zalo/qr-image.js +90 -0
- package/src/zalo/qr-login.js +494 -0
- package/src/zalo/queues/control-queue.js +193 -0
- package/src/zalo/queues/offline-queue.js +275 -0
- package/src/zalo/queues/queue-verify.js +306 -0
- package/src/zalo/reads.js +723 -0
- package/src/zalo/receipts.js +550 -0
- package/src/zalo/req-id.js +24 -0
- package/src/zalo/retry.js +343 -0
- package/src/zalo/session-call.js +55 -0
- package/src/zalo/socket.js +762 -0
- package/src/zalo/transfer-sync/assets.js +181 -0
- package/src/zalo/transfer-sync/channel.js +459 -0
- package/src/zalo/transfer-sync/download.js +161 -0
- package/src/zalo/transfer-sync/message-types.js +520 -0
- package/src/zalo/transfer-sync/transfer.js +468 -0
- package/src/zalo/trust-store.js +99 -0
- package/src/zalo/trust-wasm.js +393 -0
- package/src/zalo/upkeep.js +127 -0
- package/src/zalo/web-call.js +103 -0
- package/src/zalo/writes.js +704 -0
- package/src/zalo/zcloud-e2ee.js +214 -0
- package/src/zalo/zcloud.js +802 -0
- package/node_modules/asynckit/LICENSE +0 -21
- package/node_modules/asynckit/README.md +0 -233
- package/node_modules/asynckit/bench.js +0 -76
- package/node_modules/asynckit/index.js +0 -6
- package/node_modules/asynckit/lib/abort.js +0 -29
- package/node_modules/asynckit/lib/async.js +0 -34
- package/node_modules/asynckit/lib/defer.js +0 -26
- package/node_modules/asynckit/lib/iterate.js +0 -75
- package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
- package/node_modules/asynckit/lib/readable_parallel.js +0 -25
- package/node_modules/asynckit/lib/readable_serial.js +0 -25
- package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
- package/node_modules/asynckit/lib/state.js +0 -37
- package/node_modules/asynckit/lib/streamify.js +0 -141
- package/node_modules/asynckit/lib/terminator.js +0 -29
- package/node_modules/asynckit/package.json +0 -63
- package/node_modules/asynckit/parallel.js +0 -43
- package/node_modules/asynckit/serial.js +0 -17
- package/node_modules/asynckit/serialOrdered.js +0 -75
- package/node_modules/asynckit/stream.js +0 -21
- package/node_modules/bignumber.js/CHANGELOG.md +0 -381
- package/node_modules/bignumber.js/LICENCE.md +0 -26
- package/node_modules/bignumber.js/README.md +0 -289
- package/node_modules/bignumber.js/bignumber.d.mts +0 -6
- package/node_modules/bignumber.js/bignumber.d.ts +0 -5
- package/node_modules/bignumber.js/bignumber.js +0 -2922
- package/node_modules/bignumber.js/bignumber.mjs +0 -2907
- package/node_modules/bignumber.js/doc/API.html +0 -2249
- package/node_modules/bignumber.js/package.json +0 -60
- package/node_modules/bignumber.js/types.d.ts +0 -1821
- package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/node_modules/combined-stream/License +0 -19
- package/node_modules/combined-stream/Readme.md +0 -138
- package/node_modules/combined-stream/lib/combined_stream.js +0 -208
- package/node_modules/combined-stream/package.json +0 -25
- package/node_modules/crypto-js/CONTRIBUTING.md +0 -28
- package/node_modules/crypto-js/LICENSE +0 -24
- package/node_modules/crypto-js/README.md +0 -275
- package/node_modules/crypto-js/aes.js +0 -234
- package/node_modules/crypto-js/blowfish.js +0 -471
- package/node_modules/crypto-js/bower.json +0 -39
- package/node_modules/crypto-js/cipher-core.js +0 -895
- package/node_modules/crypto-js/core.js +0 -807
- package/node_modules/crypto-js/crypto-js.js +0 -6657
- package/node_modules/crypto-js/docs/QuickStartGuide.wiki +0 -470
- package/node_modules/crypto-js/enc-base64.js +0 -136
- package/node_modules/crypto-js/enc-base64url.js +0 -148
- package/node_modules/crypto-js/enc-hex.js +0 -18
- package/node_modules/crypto-js/enc-latin1.js +0 -18
- package/node_modules/crypto-js/enc-utf16.js +0 -149
- package/node_modules/crypto-js/enc-utf8.js +0 -18
- package/node_modules/crypto-js/evpkdf.js +0 -134
- package/node_modules/crypto-js/format-hex.js +0 -66
- package/node_modules/crypto-js/format-openssl.js +0 -18
- package/node_modules/crypto-js/hmac-md5.js +0 -18
- package/node_modules/crypto-js/hmac-ripemd160.js +0 -18
- package/node_modules/crypto-js/hmac-sha1.js +0 -18
- package/node_modules/crypto-js/hmac-sha224.js +0 -18
- package/node_modules/crypto-js/hmac-sha256.js +0 -18
- package/node_modules/crypto-js/hmac-sha3.js +0 -18
- package/node_modules/crypto-js/hmac-sha384.js +0 -18
- package/node_modules/crypto-js/hmac-sha512.js +0 -18
- package/node_modules/crypto-js/hmac.js +0 -143
- package/node_modules/crypto-js/index.js +0 -18
- package/node_modules/crypto-js/lib-typedarrays.js +0 -76
- package/node_modules/crypto-js/md5.js +0 -268
- package/node_modules/crypto-js/mode-cfb.js +0 -80
- package/node_modules/crypto-js/mode-ctr-gladman.js +0 -116
- package/node_modules/crypto-js/mode-ctr.js +0 -58
- package/node_modules/crypto-js/mode-ecb.js +0 -40
- package/node_modules/crypto-js/mode-ofb.js +0 -54
- package/node_modules/crypto-js/package.json +0 -42
- package/node_modules/crypto-js/pad-ansix923.js +0 -49
- package/node_modules/crypto-js/pad-iso10126.js +0 -44
- package/node_modules/crypto-js/pad-iso97971.js +0 -40
- package/node_modules/crypto-js/pad-nopadding.js +0 -30
- package/node_modules/crypto-js/pad-pkcs7.js +0 -18
- package/node_modules/crypto-js/pad-zeropadding.js +0 -47
- package/node_modules/crypto-js/pbkdf2.js +0 -145
- package/node_modules/crypto-js/rabbit-legacy.js +0 -190
- package/node_modules/crypto-js/rabbit.js +0 -192
- package/node_modules/crypto-js/rc4.js +0 -139
- package/node_modules/crypto-js/ripemd160.js +0 -267
- package/node_modules/crypto-js/sha1.js +0 -150
- package/node_modules/crypto-js/sha224.js +0 -80
- package/node_modules/crypto-js/sha256.js +0 -199
- package/node_modules/crypto-js/sha3.js +0 -326
- package/node_modules/crypto-js/sha384.js +0 -83
- package/node_modules/crypto-js/sha512.js +0 -326
- package/node_modules/crypto-js/tripledes.js +0 -779
- package/node_modules/crypto-js/x64-core.js +0 -304
- package/node_modules/delayed-stream/.npmignore +0 -1
- package/node_modules/delayed-stream/License +0 -19
- package/node_modules/delayed-stream/Makefile +0 -7
- package/node_modules/delayed-stream/Readme.md +0 -141
- package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
- package/node_modules/delayed-stream/package.json +0 -27
- package/node_modules/dunder-proto/.eslintrc +0 -5
- package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/node_modules/dunder-proto/.nycrc +0 -13
- package/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/node_modules/dunder-proto/LICENSE +0 -21
- package/node_modules/dunder-proto/README.md +0 -54
- package/node_modules/dunder-proto/get.d.ts +0 -5
- package/node_modules/dunder-proto/get.js +0 -30
- package/node_modules/dunder-proto/package.json +0 -76
- package/node_modules/dunder-proto/set.d.ts +0 -5
- package/node_modules/dunder-proto/set.js +0 -35
- package/node_modules/dunder-proto/test/get.js +0 -34
- package/node_modules/dunder-proto/test/index.js +0 -4
- package/node_modules/dunder-proto/test/set.js +0 -50
- package/node_modules/dunder-proto/tsconfig.json +0 -9
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/es-object-atoms/.eslintrc +0 -16
- package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/node_modules/es-object-atoms/CHANGELOG.md +0 -44
- package/node_modules/es-object-atoms/LICENSE +0 -21
- package/node_modules/es-object-atoms/README.md +0 -63
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/node_modules/es-object-atoms/ToObject.js +0 -10
- package/node_modules/es-object-atoms/index.d.ts +0 -3
- package/node_modules/es-object-atoms/index.js +0 -4
- package/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/node_modules/es-object-atoms/isObject.js +0 -6
- package/node_modules/es-object-atoms/package.json +0 -79
- package/node_modules/es-object-atoms/test/index.js +0 -38
- package/node_modules/es-object-atoms/tsconfig.json +0 -7
- package/node_modules/es-set-tostringtag/.eslintrc +0 -13
- package/node_modules/es-set-tostringtag/.nycrc +0 -9
- package/node_modules/es-set-tostringtag/CHANGELOG.md +0 -67
- package/node_modules/es-set-tostringtag/LICENSE +0 -21
- package/node_modules/es-set-tostringtag/README.md +0 -53
- package/node_modules/es-set-tostringtag/index.d.ts +0 -10
- package/node_modules/es-set-tostringtag/index.js +0 -35
- package/node_modules/es-set-tostringtag/package.json +0 -78
- package/node_modules/es-set-tostringtag/test/index.js +0 -85
- package/node_modules/es-set-tostringtag/tsconfig.json +0 -9
- package/node_modules/form-data/CHANGELOG.md +0 -686
- package/node_modules/form-data/License +0 -19
- package/node_modules/form-data/README.md +0 -355
- package/node_modules/form-data/index.d.ts +0 -62
- package/node_modules/form-data/lib/browser.js +0 -4
- package/node_modules/form-data/lib/form_data.js +0 -506
- package/node_modules/form-data/lib/populate.js +0 -10
- package/node_modules/form-data/node_modules/mime-db/HISTORY.md +0 -507
- package/node_modules/form-data/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-db/README.md +0 -100
- package/node_modules/form-data/node_modules/mime-db/db.json +0 -8519
- package/node_modules/form-data/node_modules/mime-db/index.js +0 -12
- package/node_modules/form-data/node_modules/mime-db/package.json +0 -60
- package/node_modules/form-data/node_modules/mime-types/HISTORY.md +0 -397
- package/node_modules/form-data/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-types/README.md +0 -113
- package/node_modules/form-data/node_modules/mime-types/index.js +0 -188
- package/node_modules/form-data/node_modules/mime-types/package.json +0 -44
- package/node_modules/form-data/package.json +0 -82
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/get-intrinsic/.eslintrc +0 -42
- package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/node_modules/get-intrinsic/.nycrc +0 -9
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/node_modules/get-intrinsic/LICENSE +0 -21
- package/node_modules/get-intrinsic/README.md +0 -71
- package/node_modules/get-intrinsic/index.js +0 -378
- package/node_modules/get-intrinsic/package.json +0 -97
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/node_modules/get-proto/.eslintrc +0 -10
- package/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/node_modules/get-proto/.nycrc +0 -9
- package/node_modules/get-proto/CHANGELOG.md +0 -21
- package/node_modules/get-proto/LICENSE +0 -21
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/node_modules/get-proto/README.md +0 -50
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/node_modules/get-proto/index.d.ts +0 -5
- package/node_modules/get-proto/index.js +0 -27
- package/node_modules/get-proto/package.json +0 -81
- package/node_modules/get-proto/test/index.js +0 -68
- package/node_modules/get-proto/tsconfig.json +0 -9
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-symbols/.eslintrc +0 -11
- package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/node_modules/has-symbols/.nycrc +0 -9
- package/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/node_modules/has-symbols/LICENSE +0 -21
- package/node_modules/has-symbols/README.md +0 -46
- package/node_modules/has-symbols/index.d.ts +0 -3
- package/node_modules/has-symbols/index.js +0 -14
- package/node_modules/has-symbols/package.json +0 -111
- package/node_modules/has-symbols/shams.d.ts +0 -3
- package/node_modules/has-symbols/shams.js +0 -45
- package/node_modules/has-symbols/test/index.js +0 -22
- package/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/node_modules/has-symbols/test/tests.js +0 -58
- package/node_modules/has-symbols/tsconfig.json +0 -10
- package/node_modules/has-tostringtag/.eslintrc +0 -5
- package/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
- package/node_modules/has-tostringtag/.nycrc +0 -13
- package/node_modules/has-tostringtag/CHANGELOG.md +0 -42
- package/node_modules/has-tostringtag/LICENSE +0 -21
- package/node_modules/has-tostringtag/README.md +0 -46
- package/node_modules/has-tostringtag/index.d.ts +0 -3
- package/node_modules/has-tostringtag/index.js +0 -8
- package/node_modules/has-tostringtag/package.json +0 -108
- package/node_modules/has-tostringtag/shams.d.ts +0 -3
- package/node_modules/has-tostringtag/shams.js +0 -8
- package/node_modules/has-tostringtag/test/index.js +0 -21
- package/node_modules/has-tostringtag/test/shams/core-js.js +0 -31
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -30
- package/node_modules/has-tostringtag/test/tests.js +0 -15
- package/node_modules/has-tostringtag/tsconfig.json +0 -49
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -58
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/eslint.config.mjs +0 -6
- package/node_modules/hasown/index.d.ts +0 -3
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -91
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/json-bigint/LICENSE +0 -20
- package/node_modules/json-bigint/README.md +0 -240
- package/node_modules/json-bigint/index.js +0 -12
- package/node_modules/json-bigint/lib/parse.js +0 -443
- package/node_modules/json-bigint/lib/stringify.js +0 -384
- package/node_modules/json-bigint/package.json +0 -34
- package/node_modules/math-intrinsics/.eslintrc +0 -16
- package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/node_modules/math-intrinsics/LICENSE +0 -21
- package/node_modules/math-intrinsics/README.md +0 -50
- package/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/node_modules/math-intrinsics/abs.js +0 -4
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/node_modules/math-intrinsics/floor.js +0 -4
- package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/node_modules/math-intrinsics/isFinite.js +0 -12
- package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/isInteger.js +0 -16
- package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/node_modules/math-intrinsics/isNaN.js +0 -6
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/node_modules/math-intrinsics/max.d.ts +0 -1
- package/node_modules/math-intrinsics/max.js +0 -4
- package/node_modules/math-intrinsics/min.d.ts +0 -1
- package/node_modules/math-intrinsics/min.js +0 -4
- package/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/node_modules/math-intrinsics/mod.js +0 -9
- package/node_modules/math-intrinsics/package.json +0 -86
- package/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/node_modules/math-intrinsics/pow.js +0 -4
- package/node_modules/math-intrinsics/round.d.ts +0 -1
- package/node_modules/math-intrinsics/round.js +0 -4
- package/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/node_modules/math-intrinsics/sign.js +0 -11
- package/node_modules/math-intrinsics/test/index.js +0 -192
- package/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/node_modules/pako/LICENSE +0 -21
- package/node_modules/pako/README.md +0 -155
- package/node_modules/pako/dist/pako.es5.js +0 -6760
- package/node_modules/pako/dist/pako.es5.min.js +0 -2
- package/node_modules/pako/dist/pako.esm.mjs +0 -6945
- package/node_modules/pako/dist/pako.js +0 -6964
- package/node_modules/pako/dist/pako.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.es5.js +0 -3953
- package/node_modules/pako/dist/pako_deflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.js +0 -4154
- package/node_modules/pako/dist/pako_deflate.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.es5.js +0 -3272
- package/node_modules/pako/dist/pako_inflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.js +0 -3279
- package/node_modules/pako/dist/pako_inflate.min.js +0 -2
- package/node_modules/pako/index.js +0 -18
- package/node_modules/pako/lib/deflate.js +0 -387
- package/node_modules/pako/lib/inflate.js +0 -456
- package/node_modules/pako/lib/utils/common.js +0 -48
- package/node_modules/pako/lib/utils/strings.js +0 -174
- package/node_modules/pako/lib/zlib/README +0 -59
- package/node_modules/pako/lib/zlib/adler32.js +0 -51
- package/node_modules/pako/lib/zlib/constants.js +0 -68
- package/node_modules/pako/lib/zlib/crc32.js +0 -59
- package/node_modules/pako/lib/zlib/deflate.js +0 -2069
- package/node_modules/pako/lib/zlib/gzheader.js +0 -58
- package/node_modules/pako/lib/zlib/inffast.js +0 -344
- package/node_modules/pako/lib/zlib/inflate.js +0 -1575
- package/node_modules/pako/lib/zlib/inftrees.js +0 -340
- package/node_modules/pako/lib/zlib/messages.js +0 -32
- package/node_modules/pako/lib/zlib/trees.js +0 -1179
- package/node_modules/pako/lib/zlib/zstream.js +0 -47
- package/node_modules/pako/package.json +0 -73
- package/node_modules/semver/LICENSE +0 -15
- package/node_modules/semver/README.md +0 -680
- package/node_modules/semver/bin/semver.js +0 -195
- package/node_modules/semver/classes/comparator.js +0 -143
- package/node_modules/semver/classes/index.js +0 -7
- package/node_modules/semver/classes/range.js +0 -577
- package/node_modules/semver/classes/semver.js +0 -350
- package/node_modules/semver/functions/clean.js +0 -8
- package/node_modules/semver/functions/cmp.js +0 -54
- package/node_modules/semver/functions/coerce.js +0 -62
- package/node_modules/semver/functions/compare-build.js +0 -9
- package/node_modules/semver/functions/compare-loose.js +0 -5
- package/node_modules/semver/functions/compare.js +0 -7
- package/node_modules/semver/functions/diff.js +0 -60
- package/node_modules/semver/functions/eq.js +0 -5
- package/node_modules/semver/functions/gt.js +0 -5
- package/node_modules/semver/functions/gte.js +0 -5
- package/node_modules/semver/functions/inc.js +0 -21
- package/node_modules/semver/functions/lt.js +0 -5
- package/node_modules/semver/functions/lte.js +0 -5
- package/node_modules/semver/functions/major.js +0 -5
- package/node_modules/semver/functions/minor.js +0 -5
- package/node_modules/semver/functions/neq.js +0 -5
- package/node_modules/semver/functions/parse.js +0 -18
- package/node_modules/semver/functions/patch.js +0 -5
- package/node_modules/semver/functions/prerelease.js +0 -8
- package/node_modules/semver/functions/rcompare.js +0 -5
- package/node_modules/semver/functions/rsort.js +0 -5
- package/node_modules/semver/functions/satisfies.js +0 -12
- package/node_modules/semver/functions/sort.js +0 -5
- package/node_modules/semver/functions/truncate.js +0 -48
- package/node_modules/semver/functions/valid.js +0 -8
- package/node_modules/semver/index.js +0 -93
- package/node_modules/semver/internal/constants.js +0 -37
- package/node_modules/semver/internal/debug.js +0 -11
- package/node_modules/semver/internal/identifiers.js +0 -29
- package/node_modules/semver/internal/lrucache.js +0 -42
- package/node_modules/semver/internal/parse-options.js +0 -17
- package/node_modules/semver/internal/re.js +0 -223
- package/node_modules/semver/package.json +0 -78
- package/node_modules/semver/preload.js +0 -4
- package/node_modules/semver/range.bnf +0 -17
- package/node_modules/semver/ranges/gtr.js +0 -6
- package/node_modules/semver/ranges/intersects.js +0 -9
- package/node_modules/semver/ranges/ltr.js +0 -6
- package/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/node_modules/semver/ranges/min-version.js +0 -63
- package/node_modules/semver/ranges/outside.js +0 -82
- package/node_modules/semver/ranges/simplify.js +0 -49
- package/node_modules/semver/ranges/subset.js +0 -249
- package/node_modules/semver/ranges/to-comparators.js +0 -10
- package/node_modules/semver/ranges/valid.js +0 -13
- package/node_modules/spark-md5/LICENSE +0 -13
- package/node_modules/spark-md5/README.md +0 -191
- package/node_modules/spark-md5/package.json +0 -35
- package/node_modules/spark-md5/spark-md5.js +0 -751
- package/node_modules/spark-md5/spark-md5.min.js +0 -1
- package/node_modules/tldts/LICENSE +0 -13
- package/node_modules/tldts/README.md +0 -327
- package/node_modules/tldts/bin/cli.js +0 -21
- package/node_modules/tldts/dist/cjs/index.js +0 -666
- package/node_modules/tldts/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/data/trie.js +0 -14
- package/node_modules/tldts/dist/cjs/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js +0 -67
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/es6/index.js +0 -33
- package/node_modules/tldts/dist/es6/index.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/data/trie.js +0 -11
- package/node_modules/tldts/dist/es6/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/suffix-trie.js +0 -64
- package/node_modules/tldts/dist/es6/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/index.cjs.min.js +0 -2
- package/node_modules/tldts/dist/index.cjs.min.js.map +0 -1
- package/node_modules/tldts/dist/index.esm.min.js +0 -2
- package/node_modules/tldts/dist/index.esm.min.js.map +0 -1
- package/node_modules/tldts/dist/index.umd.min.js +0 -2
- package/node_modules/tldts/dist/index.umd.min.js.map +0 -1
- package/node_modules/tldts/dist/types/index.d.ts +0 -7
- package/node_modules/tldts/dist/types/src/data/trie.d.ts +0 -5
- package/node_modules/tldts/dist/types/src/suffix-trie.d.ts +0 -5
- package/node_modules/tldts/index.ts +0 -62
- package/node_modules/tldts/package.json +0 -91
- package/node_modules/tldts/src/data/trie.ts +0 -14
- package/node_modules/tldts/src/suffix-trie.ts +0 -110
- package/node_modules/tldts-core/LICENSE +0 -13
- package/node_modules/tldts-core/README.md +0 -3
- package/node_modules/tldts-core/dist/cjs/index.js +0 -561
- package/node_modules/tldts-core/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +0 -15
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain.js +0 -83
- package/node_modules/tldts-core/dist/cjs/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +0 -149
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/factory.js +0 -104
- package/node_modules/tldts-core/dist/cjs/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js +0 -72
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +0 -3
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/options.js +0 -22
- package/node_modules/tldts-core/dist/cjs/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js +0 -14
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/es6/index.js +0 -4
- package/node_modules/tldts-core/dist/es6/index.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +0 -12
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain.js +0 -80
- package/node_modules/tldts-core/dist/es6/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js +0 -146
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/factory.js +0 -99
- package/node_modules/tldts-core/dist/es6/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-ip.js +0 -69
- package/node_modules/tldts-core/dist/es6/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-valid.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js +0 -2
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/options.js +0 -19
- package/node_modules/tldts-core/dist/es6/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/subdomain.js +0 -11
- package/node_modules/tldts-core/dist/es6/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/types/index.d.ts +0 -4
- package/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/domain.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/factory.d.ts +0 -28
- package/node_modules/tldts-core/dist/types/src/is-ip.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/is-valid.d.ts +0 -15
- package/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +0 -2
- package/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +0 -9
- package/node_modules/tldts-core/dist/types/src/options.d.ts +0 -10
- package/node_modules/tldts-core/dist/types/src/subdomain.d.ts +0 -4
- package/node_modules/tldts-core/index.ts +0 -10
- package/node_modules/tldts-core/package.json +0 -68
- package/node_modules/tldts-core/src/domain-without-suffix.ts +0 -14
- package/node_modules/tldts-core/src/domain.ts +0 -100
- package/node_modules/tldts-core/src/extract-hostname.ts +0 -170
- package/node_modules/tldts-core/src/factory.ts +0 -160
- package/node_modules/tldts-core/src/is-ip.ts +0 -87
- package/node_modules/tldts-core/src/is-valid.ts +0 -79
- package/node_modules/tldts-core/src/lookup/fast-path.ts +0 -80
- package/node_modules/tldts-core/src/lookup/interface.ts +0 -10
- package/node_modules/tldts-core/src/options.ts +0 -39
- package/node_modules/tldts-core/src/subdomain.ts +0 -11
- package/node_modules/tough-cookie/LICENSE +0 -12
- package/node_modules/tough-cookie/README.md +0 -154
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts +0 -33
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.js +0 -65
- package/node_modules/tough-cookie/dist/cookie/constants.d.ts +0 -54
- package/node_modules/tough-cookie/dist/cookie/constants.js +0 -38
- package/node_modules/tough-cookie/dist/cookie/cookie.d.ts +0 -326
- package/node_modules/tough-cookie/dist/cookie/cookie.js +0 -831
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts +0 -58
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.js +0 -84
- package/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts +0 -621
- package/node_modules/tough-cookie/dist/cookie/cookieJar.js +0 -1000
- package/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts +0 -40
- package/node_modules/tough-cookie/dist/cookie/defaultPath.js +0 -60
- package/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts +0 -38
- package/node_modules/tough-cookie/dist/cookie/domainMatch.js +0 -94
- package/node_modules/tough-cookie/dist/cookie/formatDate.d.ts +0 -15
- package/node_modules/tough-cookie/dist/cookie/formatDate.js +0 -20
- package/node_modules/tough-cookie/dist/cookie/index.d.ts +0 -29
- package/node_modules/tough-cookie/dist/cookie/index.js +0 -54
- package/node_modules/tough-cookie/dist/cookie/parseDate.d.ts +0 -103
- package/node_modules/tough-cookie/dist/cookie/parseDate.js +0 -323
- package/node_modules/tough-cookie/dist/cookie/permutePath.d.ts +0 -14
- package/node_modules/tough-cookie/dist/cookie/permutePath.js +0 -32
- package/node_modules/tough-cookie/dist/getPublicSuffix.d.ts +0 -55
- package/node_modules/tough-cookie/dist/getPublicSuffix.js +0 -71
- package/node_modules/tough-cookie/dist/memstore.d.ts +0 -220
- package/node_modules/tough-cookie/dist/memstore.js +0 -187
- package/node_modules/tough-cookie/dist/pathMatch.d.ts +0 -17
- package/node_modules/tough-cookie/dist/pathMatch.js +0 -40
- package/node_modules/tough-cookie/dist/permuteDomain.d.ts +0 -15
- package/node_modules/tough-cookie/dist/permuteDomain.js +0 -44
- package/node_modules/tough-cookie/dist/store.d.ts +0 -211
- package/node_modules/tough-cookie/dist/store.js +0 -76
- package/node_modules/tough-cookie/dist/utils.d.ts +0 -34
- package/node_modules/tough-cookie/dist/utils.js +0 -99
- package/node_modules/tough-cookie/dist/validators.d.ts +0 -24
- package/node_modules/tough-cookie/dist/validators.js +0 -90
- package/node_modules/tough-cookie/dist/version.d.ts +0 -5
- package/node_modules/tough-cookie/dist/version.js +0 -8
- package/node_modules/tough-cookie/package.json +0 -144
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1407
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
- package/node_modules/zca-js/.prettierrc +0 -5
- package/node_modules/zca-js/CODE_OF_CONDUCT.md +0 -163
- package/node_modules/zca-js/CONTRIBUTING.md +0 -470
- package/node_modules/zca-js/LICENSE +0 -21
- package/node_modules/zca-js/README.md +0 -225
- package/node_modules/zca-js/SECURITY.md +0 -83
- package/node_modules/zca-js/dist/Errors/ZaloApiError.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiError.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.js +0 -7
- package/node_modules/zca-js/dist/Errors/index.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/index.js +0 -4
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/addPollOptions.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/addPollOptions.js +0 -26
- package/node_modules/zca-js/dist/apis/addQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/addQuickMessage.js +0 -60
- package/node_modules/zca-js/dist/apis/addReaction.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/addReaction.js +0 -294
- package/node_modules/zca-js/dist/apis/addUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/addUnreadMark.js +0 -52
- package/node_modules/zca-js/dist/apis/addUserToGroup.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/addUserToGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/blockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/blockViewFeed.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockViewFeed.js +0 -30
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.js +0 -52
- package/node_modules/zca-js/dist/apis/changeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/changeFriendAlias.js +0 -27
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.js +0 -44
- package/node_modules/zca-js/dist/apis/changeGroupName.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupName.js +0 -32
- package/node_modules/zca-js/dist/apis/changeGroupOwner.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupOwner.js +0 -30
- package/node_modules/zca-js/dist/apis/createAutoReply.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/createAutoReply.js +0 -37
- package/node_modules/zca-js/dist/apis/createBankAccount.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/createBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/createCatalog.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createCatalog.js +0 -29
- package/node_modules/zca-js/dist/apis/createGroup.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/createGroup.js +0 -43
- package/node_modules/zca-js/dist/apis/createNote.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createNote.js +0 -47
- package/node_modules/zca-js/dist/apis/createPoll.d.ts +0 -36
- package/node_modules/zca-js/dist/apis/createPoll.js +0 -40
- package/node_modules/zca-js/dist/apis/createProductCatalog.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/createProductCatalog.js +0 -50
- package/node_modules/zca-js/dist/apis/createReminder.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/createReminder.js +0 -63
- package/node_modules/zca-js/dist/apis/custom.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/custom.js +0 -15
- package/node_modules/zca-js/dist/apis/deleteAutoReply.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/deleteAutoReply.js +0 -29
- package/node_modules/zca-js/dist/apis/deleteAvatar.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteAvatar.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteBankAccount.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/deleteBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/deleteCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/deleteCatalog.js +0 -28
- package/node_modules/zca-js/dist/apis/deleteChat.d.ts +0 -19
- package/node_modules/zca-js/dist/apis/deleteChat.js +0 -50
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteMessage.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/deleteMessage.js +0 -52
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.js +0 -31
- package/node_modules/zca-js/dist/apis/disableGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disableGroupLink.js +0 -24
- package/node_modules/zca-js/dist/apis/disperseGroup.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disperseGroup.js +0 -28
- package/node_modules/zca-js/dist/apis/editNote.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/editNote.js +0 -46
- package/node_modules/zca-js/dist/apis/editReminder.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/editReminder.js +0 -61
- package/node_modules/zca-js/dist/apis/enableGroupLink.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/enableGroupLink.js +0 -25
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.js +0 -10
- package/node_modules/zca-js/dist/apis/findUser.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUser.js +0 -42
- package/node_modules/zca-js/dist/apis/findUserByUsername.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUserByUsername.js +0 -27
- package/node_modules/zca-js/dist/apis/forwardMessage.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/forwardMessage.js +0 -114
- package/node_modules/zca-js/dist/apis/getAliasList.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getAliasList.js +0 -27
- package/node_modules/zca-js/dist/apis/getAllFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getAllFriends.js +0 -34
- package/node_modules/zca-js/dist/apis/getAllGroups.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAllGroups.js +0 -10
- package/node_modules/zca-js/dist/apis/getArchivedChatList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getArchivedChatList.js +0 -23
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.js +0 -21
- package/node_modules/zca-js/dist/apis/getAutoReplyList.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getAutoReplyList.js +0 -24
- package/node_modules/zca-js/dist/apis/getAvatarList.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/getAvatarList.js +0 -28
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.js +0 -30
- package/node_modules/zca-js/dist/apis/getBizAccount.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/getBizAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getCatalogList.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getCatalogList.js +0 -32
- package/node_modules/zca-js/dist/apis/getCloseFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getCloseFriends.js +0 -20
- package/node_modules/zca-js/dist/apis/getContext.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getContext.js +0 -4
- package/node_modules/zca-js/dist/apis/getCookie.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getCookie.js +0 -9
- package/node_modules/zca-js/dist/apis/getFriendBoardList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFriendBoardList.js +0 -26
- package/node_modules/zca-js/dist/apis/getFriendOnlines.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getFriendOnlines.js +0 -35
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.d.ts +0 -42
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.js +0 -27
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.js +0 -25
- package/node_modules/zca-js/dist/apis/getFullAvatar.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFullAvatar.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.js +0 -29
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.js +0 -36
- package/node_modules/zca-js/dist/apis/getGroupInfo.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/getGroupInfo.js +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.d.ts +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.js +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.d.ts +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.js +0 -31
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.d.ts +0 -34
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.js +0 -28
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.js +0 -24
- package/node_modules/zca-js/dist/apis/getHiddenConversations.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getHiddenConversations.js +0 -23
- package/node_modules/zca-js/dist/apis/getLabels.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getLabels.js +0 -28
- package/node_modules/zca-js/dist/apis/getListBank.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getListBank.js +0 -20
- package/node_modules/zca-js/dist/apis/getListBankAccount.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getListBankAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getListBoard.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/getListBoard.js +0 -45
- package/node_modules/zca-js/dist/apis/getListDevice.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getListDevice.js +0 -22
- package/node_modules/zca-js/dist/apis/getListReminder.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/getListReminder.js +0 -47
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.js +0 -39
- package/node_modules/zca-js/dist/apis/getMute.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/getMute.js +0 -22
- package/node_modules/zca-js/dist/apis/getOwnId.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getOwnId.js +0 -4
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.js +0 -27
- package/node_modules/zca-js/dist/apis/getPinConversations.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getPinConversations.js +0 -22
- package/node_modules/zca-js/dist/apis/getPollDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getPollDetail.js +0 -30
- package/node_modules/zca-js/dist/apis/getProductCatalogList.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/getProductCatalogList.js +0 -33
- package/node_modules/zca-js/dist/apis/getQR.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/getQR.js +0 -29
- package/node_modules/zca-js/dist/apis/getQuickMessageList.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getQuickMessageList.js +0 -24
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.js +0 -30
- package/node_modules/zca-js/dist/apis/getReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getReminder.js +0 -25
- package/node_modules/zca-js/dist/apis/getReminderResponses.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getReminderResponses.js +0 -24
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.js +0 -24
- package/node_modules/zca-js/dist/apis/getSettings.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getSettings.js +0 -20
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.js +0 -24
- package/node_modules/zca-js/dist/apis/getStickers.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getStickers.js +0 -40
- package/node_modules/zca-js/dist/apis/getStickersDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickersDetail.js +0 -40
- package/node_modules/zca-js/dist/apis/getUnreadMark.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/getUnreadMark.js +0 -30
- package/node_modules/zca-js/dist/apis/getUserInfo.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getUserInfo.js +0 -44
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.js +0 -30
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.js +0 -25
- package/node_modules/zca-js/dist/apis/joinGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupLink.js +0 -27
- package/node_modules/zca-js/dist/apis/keepAlive.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/keepAlive.js +0 -22
- package/node_modules/zca-js/dist/apis/lastOnline.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/lastOnline.js +0 -26
- package/node_modules/zca-js/dist/apis/leaveGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/leaveGroup.js +0 -33
- package/node_modules/zca-js/dist/apis/listen.d.ts +0 -102
- package/node_modules/zca-js/dist/apis/listen.js +0 -425
- package/node_modules/zca-js/dist/apis/lockPoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/lockPoll.js +0 -28
- package/node_modules/zca-js/dist/apis/login.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/login.js +0 -96
- package/node_modules/zca-js/dist/apis/loginQR.d.ts +0 -71
- package/node_modules/zca-js/dist/apis/loginQR.js +0 -376
- package/node_modules/zca-js/dist/apis/logoutV2.js +0 -79
- package/node_modules/zca-js/dist/apis/lostFocus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/lostFocus.js +0 -23
- package/node_modules/zca-js/dist/apis/parseLink.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/parseLink.js +0 -27
- package/node_modules/zca-js/dist/apis/registerCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/registerCatalog.js +0 -27
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/removeFriend.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriend.js +0 -28
- package/node_modules/zca-js/dist/apis/removeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriendAlias.js +0 -24
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/removeQuickMessage.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/removeQuickMessage.js +0 -27
- package/node_modules/zca-js/dist/apis/removeReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/removeReminder.js +0 -40
- package/node_modules/zca-js/dist/apis/removeUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/removeUnreadMark.js +0 -50
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.js +0 -20
- package/node_modules/zca-js/dist/apis/reuseAvatar.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/reuseAvatar.js +0 -26
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.js +0 -38
- package/node_modules/zca-js/dist/apis/scanURL.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/scanURL.js +0 -28
- package/node_modules/zca-js/dist/apis/searchSticker.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/searchSticker.js +0 -28
- package/node_modules/zca-js/dist/apis/sendBankCard.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/sendBankCard.js +0 -53
- package/node_modules/zca-js/dist/apis/sendCard.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendCard.js +0 -75
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.js +0 -55
- package/node_modules/zca-js/dist/apis/sendFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sendFriendRequest.js +0 -39
- package/node_modules/zca-js/dist/apis/sendLink.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendLink.js +0 -78
- package/node_modules/zca-js/dist/apis/sendMessage.d.ts +0 -105
- package/node_modules/zca-js/dist/apis/sendMessage.js +0 -486
- package/node_modules/zca-js/dist/apis/sendReport.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/sendReport.js +0 -53
- package/node_modules/zca-js/dist/apis/sendSeenEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendSeenEvent.js +0 -63
- package/node_modules/zca-js/dist/apis/sendSticker.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendSticker.js +0 -74
- package/node_modules/zca-js/dist/apis/sendTypingEvent.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/sendTypingEvent.js +0 -33
- package/node_modules/zca-js/dist/apis/sendVideo.d.ts +0 -35
- package/node_modules/zca-js/dist/apis/sendVideo.js +0 -134
- package/node_modules/zca-js/dist/apis/sendVoice.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/sendVoice.js +0 -89
- package/node_modules/zca-js/dist/apis/setHiddenConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setHiddenConversations.js +0 -39
- package/node_modules/zca-js/dist/apis/setMute.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/setMute.js +0 -67
- package/node_modules/zca-js/dist/apis/setPinnedConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setPinnedConversations.js +0 -34
- package/node_modules/zca-js/dist/apis/sharePoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sharePoll.js +0 -28
- package/node_modules/zca-js/dist/apis/unblockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/unblockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/undo.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/undo.js +0 -42
- package/node_modules/zca-js/dist/apis/undoFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/undoFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/updateActiveStatus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/updateActiveStatus.js +0 -27
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.js +0 -34
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.js +0 -40
- package/node_modules/zca-js/dist/apis/updateAutoReply.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateAutoReply.js +0 -38
- package/node_modules/zca-js/dist/apis/updateBankAccount.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateBankAccount.js +0 -31
- package/node_modules/zca-js/dist/apis/updateCatalog.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateCatalog.js +0 -30
- package/node_modules/zca-js/dist/apis/updateGroupSettings.d.ts +0 -40
- package/node_modules/zca-js/dist/apis/updateGroupSettings.js +0 -43
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.js +0 -30
- package/node_modules/zca-js/dist/apis/updateLabels.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateLabels.js +0 -34
- package/node_modules/zca-js/dist/apis/updateLang.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/updateLang.js +0 -30
- package/node_modules/zca-js/dist/apis/updateProductCatalog.d.ts +0 -25
- package/node_modules/zca-js/dist/apis/updateProductCatalog.js +0 -51
- package/node_modules/zca-js/dist/apis/updateProfile.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/updateProfile.js +0 -43
- package/node_modules/zca-js/dist/apis/updateProfileBio.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateProfileBio.js +0 -27
- package/node_modules/zca-js/dist/apis/updateQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateQuickMessage.js +0 -61
- package/node_modules/zca-js/dist/apis/updateSettings.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/updateSettings.js +0 -90
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.js +0 -27
- package/node_modules/zca-js/dist/apis/uploadAttachment.d.ts +0 -50
- package/node_modules/zca-js/dist/apis/uploadAttachment.js +0 -197
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.js +0 -50
- package/node_modules/zca-js/dist/apis/votePoll.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/votePoll.js +0 -29
- package/node_modules/zca-js/dist/apis.d.ts +0 -317
- package/node_modules/zca-js/dist/apis.js +0 -319
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiError.cjs +0 -11
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/apis/acceptFriendRequest.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/addPollOptions.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/addQuickMessage.cjs +0 -65
- package/node_modules/zca-js/dist/cjs/apis/addReaction.cjs +0 -308
- package/node_modules/zca-js/dist/cjs/apis/addUnreadMark.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/addUserToGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/blockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/blockViewFeed.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/changeAccountAvatar.cjs +0 -57
- package/node_modules/zca-js/dist/cjs/apis/changeFriendAlias.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/changeGroupAvatar.cjs +0 -49
- package/node_modules/zca-js/dist/cjs/apis/changeGroupName.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/changeGroupOwner.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/createAutoReply.cjs +0 -42
- package/node_modules/zca-js/dist/cjs/apis/createBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/createCatalog.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/createGroup.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/createNote.cjs +0 -52
- package/node_modules/zca-js/dist/cjs/apis/createPoll.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/createProductCatalog.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/createReminder.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/custom.cjs +0 -19
- package/node_modules/zca-js/dist/cjs/apis/deleteAutoReply.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/deleteAvatar.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/deleteCatalog.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/deleteChat.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/deleteGroupInviteBox.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/deleteProductCatalog.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/disableGroupLink.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/disperseGroup.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/editNote.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/editReminder.cjs +0 -75
- package/node_modules/zca-js/dist/cjs/apis/enableGroupLink.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/fetchAccountInfo.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/findUser.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/findUserByUsername.cjs +0 -41
- package/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs +0 -129
- package/node_modules/zca-js/dist/cjs/apis/getAliasList.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getAllFriends.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/getAllGroups.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/getArchivedChatList.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getAutoDeleteChat.cjs +0 -26
- package/node_modules/zca-js/dist/cjs/apis/getAutoReplyList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getAvatarList.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getAvatarUrlProfile.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/getBizAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getCatalogList.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getCloseFriends.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getContext.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getCookie.cjs +0 -14
- package/node_modules/zca-js/dist/cjs/apis/getFriendBoardList.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/getFriendOnlines.cjs +0 -40
- package/node_modules/zca-js/dist/cjs/apis/getFriendRecommendations.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getFriendRequestStatus.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getFullAvatar.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupBlockedMember.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getGroupChatHistory.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/getGroupInfo.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxInfo.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxList.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkDetail.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkInfo.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getGroupMembersInfo.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getHiddenConversations.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getLabels.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getListBank.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getListBankAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getListBoard.cjs +0 -59
- package/node_modules/zca-js/dist/cjs/apis/getListDevice.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getListReminder.cjs +0 -61
- package/node_modules/zca-js/dist/cjs/apis/getMultiUsersByPhones.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/getMute.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getOwnId.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getPendingGroupMembers.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getPinConversations.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getPollDetail.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getProductCatalogList.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/getQR.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getQuickMessageList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getRelatedFriendGroup.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getReminder.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getReminderResponses.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSentFriendRequest.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSettings.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getStickerCategoryDetail.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getStickers.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getStickersDetail.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getUnreadMark.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getUserInfo.cjs +0 -58
- package/node_modules/zca-js/dist/cjs/apis/inviteUserToGroups.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/joinGroupInviteBox.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/joinGroupLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/keepAlive.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/lastOnline.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/leaveGroup.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/listen.cjs +0 -440
- package/node_modules/zca-js/dist/cjs/apis/lockPoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/login.cjs +0 -102
- package/node_modules/zca-js/dist/cjs/apis/loginQR.cjs +0 -368
- package/node_modules/zca-js/dist/cjs/apis/logoutV2.cjs +0 -83
- package/node_modules/zca-js/dist/cjs/apis/lostFocus.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/parseLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/registerCatalog.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/rejectFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeFriend.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeFriendAlias.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/removeGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/removeQuickMessage.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeReminder.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/removeUnreadMark.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/removeUserFromGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/resetHiddenConversPin.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/reuseAvatar.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/reviewPendingMemberRequest.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/scanURL.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/searchSticker.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs +0 -68
- package/node_modules/zca-js/dist/cjs/apis/sendCard.cjs +0 -89
- package/node_modules/zca-js/dist/cjs/apis/sendDeliveredEvent.cjs +0 -69
- package/node_modules/zca-js/dist/cjs/apis/sendFriendRequest.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/sendLink.cjs +0 -92
- package/node_modules/zca-js/dist/cjs/apis/sendMessage.cjs +0 -500
- package/node_modules/zca-js/dist/cjs/apis/sendReport.cjs +0 -67
- package/node_modules/zca-js/dist/cjs/apis/sendSeenEvent.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/sendSticker.cjs +0 -88
- package/node_modules/zca-js/dist/cjs/apis/sendTypingEvent.cjs +0 -47
- package/node_modules/zca-js/dist/cjs/apis/sendVideo.cjs +0 -148
- package/node_modules/zca-js/dist/cjs/apis/sendVoice.cjs +0 -103
- package/node_modules/zca-js/dist/cjs/apis/setHiddenConversations.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/setMute.cjs +0 -81
- package/node_modules/zca-js/dist/cjs/apis/setPinnedConversations.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/sharePoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/unblockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/undo.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/undoFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateActiveStatus.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateArchivedChatList.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateAutoDeleteChat.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/updateAutoReply.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/updateBankAccount.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/updateCatalog.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateGroupSettings.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateHiddenConversPin.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateLabels.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateLang.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateProductCatalog.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/updateProfile.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateProfileBio.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateQuickMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/updateSettings.cjs +0 -95
- package/node_modules/zca-js/dist/cjs/apis/upgradeGroupToCommunity.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/uploadAttachment.cjs +0 -211
- package/node_modules/zca-js/dist/cjs/apis/uploadProductPhoto.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/votePoll.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis.cjs +0 -324
- package/node_modules/zca-js/dist/cjs/context.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/index.cjs +0 -159
- package/node_modules/zca-js/dist/cjs/models/AutoReply.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/Bank.cjs +0 -263
- package/node_modules/zca-js/dist/cjs/models/Board.cjs +0 -8
- package/node_modules/zca-js/dist/cjs/models/DeliveredMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Enum.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/models/FriendEvent.cjs +0 -87
- package/node_modules/zca-js/dist/cjs/models/Group.cjs +0 -13
- package/node_modules/zca-js/dist/cjs/models/GroupEvent.cjs +0 -94
- package/node_modules/zca-js/dist/cjs/models/Message.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/models/Reaction.cjs +0 -74
- package/node_modules/zca-js/dist/cjs/models/Reminder.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/SeenMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Typing.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Undo.cjs +0 -16
- package/node_modules/zca-js/dist/cjs/models/ZBusiness.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/update.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/utils.cjs +0 -703
- package/node_modules/zca-js/dist/cjs/zalo.cjs +0 -112
- package/node_modules/zca-js/dist/context.d.ts +0 -179
- package/node_modules/zca-js/dist/context.js +0 -28
- package/node_modules/zca-js/dist/index.d.ts +0 -166
- package/node_modules/zca-js/dist/index.js +0 -14
- package/node_modules/zca-js/dist/models/Attachment.d.ts +0 -9
- package/node_modules/zca-js/dist/models/Attachment.js +0 -1
- package/node_modules/zca-js/dist/models/AutoReply.d.ts +0 -20
- package/node_modules/zca-js/dist/models/AutoReply.js +0 -7
- package/node_modules/zca-js/dist/models/Bank.d.ts +0 -291
- package/node_modules/zca-js/dist/models/Bank.js +0 -262
- package/node_modules/zca-js/dist/models/Board.d.ts +0 -60
- package/node_modules/zca-js/dist/models/Board.js +0 -6
- package/node_modules/zca-js/dist/models/Catalog.d.ts +0 -16
- package/node_modules/zca-js/dist/models/Catalog.js +0 -1
- package/node_modules/zca-js/dist/models/DeliveredMessage.d.ts +0 -27
- package/node_modules/zca-js/dist/models/DeliveredMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Enum.d.ts +0 -21
- package/node_modules/zca-js/dist/models/Enum.js +0 -25
- package/node_modules/zca-js/dist/models/FriendEvent.d.ts +0 -107
- package/node_modules/zca-js/dist/models/FriendEvent.js +0 -83
- package/node_modules/zca-js/dist/models/Group.d.ts +0 -125
- package/node_modules/zca-js/dist/models/Group.js +0 -11
- package/node_modules/zca-js/dist/models/GroupEvent.d.ts +0 -178
- package/node_modules/zca-js/dist/models/GroupEvent.js +0 -90
- package/node_modules/zca-js/dist/models/Label.d.ts +0 -10
- package/node_modules/zca-js/dist/models/Label.js +0 -1
- package/node_modules/zca-js/dist/models/Message.d.ts +0 -91
- package/node_modules/zca-js/dist/models/Message.js +0 -29
- package/node_modules/zca-js/dist/models/ProductCatalog.d.ts +0 -17
- package/node_modules/zca-js/dist/models/ProductCatalog.js +0 -1
- package/node_modules/zca-js/dist/models/QuickMessage.d.ts +0 -25
- package/node_modules/zca-js/dist/models/QuickMessage.js +0 -1
- package/node_modules/zca-js/dist/models/Reaction.d.ts +0 -85
- package/node_modules/zca-js/dist/models/Reaction.js +0 -70
- package/node_modules/zca-js/dist/models/Reminder.d.ts +0 -51
- package/node_modules/zca-js/dist/models/Reminder.js +0 -7
- package/node_modules/zca-js/dist/models/SeenMessage.d.ts +0 -26
- package/node_modules/zca-js/dist/models/SeenMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Sticker.d.ts +0 -27
- package/node_modules/zca-js/dist/models/Sticker.js +0 -1
- package/node_modules/zca-js/dist/models/Typing.d.ts +0 -24
- package/node_modules/zca-js/dist/models/Typing.js +0 -17
- package/node_modules/zca-js/dist/models/Undo.d.ts +0 -34
- package/node_modules/zca-js/dist/models/Undo.js +0 -12
- package/node_modules/zca-js/dist/models/User.d.ts +0 -70
- package/node_modules/zca-js/dist/models/User.js +0 -1
- package/node_modules/zca-js/dist/models/ZBusiness.d.ts +0 -22
- package/node_modules/zca-js/dist/models/ZBusiness.js +0 -35
- package/node_modules/zca-js/dist/models/index.d.ts +0 -22
- package/node_modules/zca-js/dist/models/index.js +0 -22
- package/node_modules/zca-js/dist/update.d.ts +0 -2
- package/node_modules/zca-js/dist/update.js +0 -29
- package/node_modules/zca-js/dist/utils.d.ts +0 -167
- package/node_modules/zca-js/dist/utils.js +0 -719
- package/node_modules/zca-js/dist/zalo.d.ts +0 -41
- package/node_modules/zca-js/dist/zalo.js +0 -107
- package/node_modules/zca-js/eslint.config.js +0 -21
- package/node_modules/zca-js/index.d.ts +0 -2
- package/node_modules/zca-js/package.json +0 -78
- package/node_modules/zca-js/rollup.config.js +0 -28
- package/patches/zca-js+2.2.0.patch +0 -1445
- package/src/cli.test.js +0 -127
- package/src/core/forward.js +0 -112
- package/src/core/group-history.js +0 -248
- package/src/core/group-invite.js +0 -53
- package/src/core/offline-queue.js +0 -194
- package/src/core/pin.js +0 -222
- package/src/core/socket-tap.js +0 -154
- package/src/core/sync-v2/assets.js +0 -181
- package/src/core/sync-v2/gid.js +0 -106
- package/src/core/sync-v2/keepalive.js +0 -177
- package/src/core/sync-v2/message-types.js +0 -522
- package/src/core/sync-v2/renewlink.js +0 -124
- package/src/core/sync-v2/zcloud-cipher.js +0 -88
- package/src/core/zca-custom.js +0 -78
- package/src/mcp/message-buffer.test.js +0 -360
- package/src/mcp/notifier.test.js +0 -275
- package/src/mcp/thread-filter.test.js +0 -206
- package/src/mcp/thread-name-cache.test.js +0 -142
- package/src/utils/atomic-file.js +0 -209
- package/src/utils/bank-helpers.test.js +0 -66
- package/src/utils/device-fingerprint.js +0 -72
- package/src/utils/mentions.js +0 -140
- package/src/utils/proxy-helpers.test.js +0 -36
- package/src/utils/split-message.js +0 -166
- package/src/utils/urgency.js +0 -29
- /package/src/{core → zalo/custom}/user-info.js +0 -0
- /package/src/{utils → zalo/format}/extract-message-text.js +0 -0
- /package/src/{utils → zalo/format}/markdown.js +0 -0
package/src/commands/listen.js
CHANGED
|
@@ -6,6 +6,9 @@
|
|
|
6
6
|
import { appendFileSync, mkdirSync, existsSync, readFileSync } from "fs";
|
|
7
7
|
import { resolve, join } from "path";
|
|
8
8
|
import { getApi, clearSession } from "../core/zalo-client.js";
|
|
9
|
+
import { attachHiddenChatControls, hiddenEventView } from "../core/hidden-chats.js";
|
|
10
|
+
import { hiddenSetForCli, unlockOrExit } from "../utils/hidden-access.js";
|
|
11
|
+
import { readControls } from "../zalo/queues/control-queue.js";
|
|
9
12
|
import { success, error, info, warning, output } from "../utils/output.js";
|
|
10
13
|
import { resolveWebhookSecret } from "../utils/secrets.js";
|
|
11
14
|
import { parseAccountId, selectDaemonAccount, loginDaemonAccount } from "../core/daemon-account.js";
|
|
@@ -13,6 +16,11 @@ import { updateAccountName } from "../core/accounts.js";
|
|
|
13
16
|
import { CONFIG_DIR, getAccountDir } from "../core/credentials.js";
|
|
14
17
|
import { createStartupGate, resolveStartupSettings } from "../core/startup-gate.js";
|
|
15
18
|
import { acquireLock, releaseLock } from "../core/lock.js";
|
|
19
|
+
import { startMediaMigration } from "../core/media-store.js";
|
|
20
|
+
import { getMediaLinks, linkForCachedMessage, startTempfileSweeper } from "../core/media-deliver.js";
|
|
21
|
+
import { ensureMediaServed } from "../core/media-route.js";
|
|
22
|
+
import { resolveMediaDelivery } from "../core/deploy-policy.js";
|
|
23
|
+
import { scopeOfDir } from "../core/keystore/keyring.js";
|
|
16
24
|
import {
|
|
17
25
|
createStageLock,
|
|
18
26
|
statusViaDaemon,
|
|
@@ -24,11 +32,18 @@ import {
|
|
|
24
32
|
} from "../core/daemon-channel.js";
|
|
25
33
|
import { createSyncRunners } from "../core/daemon-sync.js";
|
|
26
34
|
import { createSocketContext, startEventLoopMonitor } from "../core/daemon-log.js";
|
|
27
|
-
import { setUserInfoLogger } from "../
|
|
28
|
-
import { createSocketTap } from "../
|
|
35
|
+
import { setUserInfoLogger } from "../zalo/custom/user-info.js";
|
|
36
|
+
import { createSocketTap } from "../zalo/listener/socket-tap.js";
|
|
29
37
|
import { createSelfHeal } from "../core/self-heal.js";
|
|
38
|
+
import { createUndecryptableNotice } from "../core/e2ee-notice.js";
|
|
39
|
+
import { createCloudVerifier } from "../core/cloud-verify.js";
|
|
40
|
+
import { attachUnknownActs } from "../core/unknown-acts.js";
|
|
41
|
+
import { attachVoiceText, voiceTextFile } from "../core/voice-text.js";
|
|
30
42
|
import { createReadStateSync, readStateEvent } from "../core/read-state.js";
|
|
31
|
-
import {
|
|
43
|
+
import { attachLastOnline } from "../core/last-online.js";
|
|
44
|
+
import { groupEventNames, nameFor, personLabel, senderNameFields, startDaemonAliases } from "../core/contact-names.js";
|
|
45
|
+
import { CONTROL_EVENT_KINDS, attachControlEvents, describeControlEvent } from "../core/control-events.js";
|
|
46
|
+
import { clearSyncState, initDb, getMessageById, getPendingSyncGaps, getSyncState, setSyncState } from "../core/db.js";
|
|
32
47
|
import {
|
|
33
48
|
storeLiveMessage,
|
|
34
49
|
refreshLiveMessageIdentities,
|
|
@@ -44,19 +59,44 @@ import {
|
|
|
44
59
|
import { downloadSyncedMedia } from "../core/sync-v2/media.js";
|
|
45
60
|
import { SyncManager } from "../core/sync.js";
|
|
46
61
|
import { describeGap } from "../core/sync-v2/gap-advice.js";
|
|
47
|
-
import { createDeliveredReceipts } from "../
|
|
48
|
-
import { envForAccount, resolveWebhookDelivery } from "../mcp/mcp-config.js";
|
|
49
|
-
import {
|
|
62
|
+
import { createDeliveredReceipts } from "../zalo/receipts.js";
|
|
63
|
+
import { envForAccount, resolveWebhookDelivery, resolveWebhookUrl } from "../mcp/mcp-config.js";
|
|
64
|
+
import { servePolicyRequest, startPolicyRuntime, touches } from "../core/policy-store.js";
|
|
65
|
+
import { describeQuotaEvent, startStorageJobs } from "../core/storage-quota.js";
|
|
66
|
+
import { applyGroupExit, describeGroupGone, setGroupGoneSink } from "../core/group-exit.js";
|
|
67
|
+
import { purgeDeadDeliveries, startWebhookDelivery } from "../core/webhook-outbox.js";
|
|
50
68
|
import { createDaemonHealth, describeHealth } from "../core/daemon-health.js";
|
|
69
|
+
import { describeSessionExpiry, sessionExpiryFor } from "../core/session-expiry.js";
|
|
70
|
+
import { describeSessionExpiring, startSessionExpiryWatch } from "../core/session-notice.js";
|
|
71
|
+
import { createSocketHost, EXIT_CODE } from "../core/socket-host.js";
|
|
72
|
+
import {
|
|
73
|
+
alarmingGapCount,
|
|
74
|
+
createGapTracker,
|
|
75
|
+
HEARTBEAT_MS,
|
|
76
|
+
IDLE_GAP_REASON,
|
|
77
|
+
PARKED_AT_KEY,
|
|
78
|
+
startupGapReason,
|
|
79
|
+
} from "../core/listener-lifecycle.js";
|
|
80
|
+
import {
|
|
81
|
+
createDaemonPresence,
|
|
82
|
+
presenceConfigFiles,
|
|
83
|
+
describeSocketPolicy,
|
|
84
|
+
presenceTransport,
|
|
85
|
+
resolveDaemonPresence,
|
|
86
|
+
} from "../core/daemon-presence.js";
|
|
87
|
+
import { createAccountStateTracker, describeAccountState } from "../core/account-state.js";
|
|
88
|
+
import { kickFile } from "../core/kick-marker.js";
|
|
51
89
|
import { DEBUG_MARK, LOG_LEVELS } from "../core/log-sink.js";
|
|
90
|
+
import { deviceSinceOf } from "../core/device-since.js";
|
|
91
|
+
import { describeQueueOverflow } from "../core/overflow-repair.js";
|
|
52
92
|
|
|
53
93
|
const PKG_VERSION = JSON.parse(readFileSync(join(import.meta.dirname, "..", "..", "package.json"), "utf8")).version;
|
|
54
94
|
|
|
55
|
-
/** Thread types matching
|
|
95
|
+
/** Thread types matching the engine's THREAD_TYPE (src/zalo/enums.js) */
|
|
56
96
|
const THREAD_USER = 0;
|
|
57
97
|
const THREAD_GROUP = 1;
|
|
58
98
|
|
|
59
|
-
/** Friend event type → readable label (
|
|
99
|
+
/** Friend event type → readable label (the listener's FRIEND_EVENT_TYPE numbers) */
|
|
60
100
|
const FRIEND_EVENT_LABELS = {
|
|
61
101
|
0: "friend_added",
|
|
62
102
|
1: "friend_removed",
|
|
@@ -69,9 +109,6 @@ const FRIEND_EVENT_LABELS = {
|
|
|
69
109
|
};
|
|
70
110
|
const FRIEND_REQUEST_TYPE = 2;
|
|
71
111
|
|
|
72
|
-
/** Zalo close code for duplicate web session */
|
|
73
|
-
const CLOSE_DUPLICATE = 3000;
|
|
74
|
-
|
|
75
112
|
export function registerListenCommand(program) {
|
|
76
113
|
program
|
|
77
114
|
.command("listen")
|
|
@@ -81,11 +118,11 @@ export function registerListenCommand(program) {
|
|
|
81
118
|
parseAccountId,
|
|
82
119
|
)
|
|
83
120
|
.description(
|
|
84
|
-
"Listen for all Zalo events (messages, friend requests, group events) via one WebSocket.
|
|
121
|
+
"Listen for all Zalo events (messages, friend requests, group events) via one WebSocket. In the foreground it stays connected; with --daemon it follows the presence settings (on-demand by default: parks when idle, wakes on demand).",
|
|
85
122
|
)
|
|
86
123
|
.option(
|
|
87
124
|
"-e, --events <types>",
|
|
88
|
-
"Comma-separated event types: message,friend,group,reaction,read (default), plus the opt-in typing (someone is typing)
|
|
125
|
+
"Comma-separated event types: message,friend,group,reaction,read (default), plus the opt-in typing (someone is typing), upload (Zalo finished processing a video or file you uploaded), catalog (a product catalog changed on another device), reminder (a DM reminder was created, updated or removed on another device), devices (the account's device list changed), online (a user's last-online time, as Zalo pushes it), settings (this account's own settings changed on another device), conversation (a conversation muted or unmuted, archived or back, its auto-delete time or the labels changed on another device) and quick-message (a quick message created, edited or deleted on another device)",
|
|
89
126
|
"message,friend,group,reaction,read",
|
|
90
127
|
)
|
|
91
128
|
.option("-f, --filter <type>", "Message filter: user (DM only), group (groups only), all", "all")
|
|
@@ -103,12 +140,21 @@ export function registerListenCommand(program) {
|
|
|
103
140
|
)
|
|
104
141
|
.option(
|
|
105
142
|
"--no-self-heal",
|
|
106
|
-
"Do not pull what a dropped socket missed from Zalo's offline queue on reconnect (the default does, as Zalo
|
|
143
|
+
"Do not pull what a dropped socket missed from Zalo's offline queue on reconnect (the default does, as Zalo does, on this socket and with no phone tap)",
|
|
107
144
|
)
|
|
108
145
|
.option(
|
|
109
146
|
"--log-level <level>",
|
|
110
147
|
"Log level of daemon.log (and of stderr in the foreground): error, warn, info (default) or debug, which adds a line per HTTP request and per message. Env: ZALO_LOG_LEVEL[_<ownId>]; also ZALO_LOG_FORMAT=json, ZALO_LOG_MAX_SIZE (default 50m) and ZALO_LOG_KEEP (default 3) for rotation",
|
|
111
148
|
)
|
|
149
|
+
.option(
|
|
150
|
+
"--include-hidden",
|
|
151
|
+
"Show events of hidden conversations too: asks for the hidden-chat PIN at start (foreground only)",
|
|
152
|
+
)
|
|
153
|
+
.option(
|
|
154
|
+
"--hidden-contentless",
|
|
155
|
+
"Report an event in a hidden conversation as {event, hidden: true}, with no thread id or content",
|
|
156
|
+
)
|
|
157
|
+
.option("--pin-stdin", "Read the hidden-chat PIN for --include-hidden from standard input")
|
|
112
158
|
.option("-d, --daemon", "Run in the background (logs to <accountDir>/daemon.log)")
|
|
113
159
|
.option("--stop", "Stop the running background daemon for this account")
|
|
114
160
|
.option("--status", "Show background daemon status for this account")
|
|
@@ -184,6 +230,43 @@ export function registerListenCommand(program) {
|
|
|
184
230
|
if (!process.env.ZALO_DAEMON_CHILD)
|
|
185
231
|
for (const w of logging.warnings) console.error(`[listen] [logging] ${w}`);
|
|
186
232
|
|
|
233
|
+
// The PIN is asked in the foreground only: a background daemon has no terminal, and a PIN must never
|
|
234
|
+
// ride on its command line.
|
|
235
|
+
if (opts.includeHidden && opts.daemon) {
|
|
236
|
+
error(
|
|
237
|
+
"--include-hidden asks for the hidden-chat PIN, which a background daemon cannot do. Run " +
|
|
238
|
+
"`listen --include-hidden` in the foreground, or use --hidden-contentless.",
|
|
239
|
+
);
|
|
240
|
+
process.exit(1);
|
|
241
|
+
}
|
|
242
|
+
|
|
243
|
+
// On-demand presence (src/core/daemon-presence.js): a foreground `listen` prints to stdout and is always-on;
|
|
244
|
+
// a background one (`--daemon`) follows the settings. On-demand without the self-heal would lose what
|
|
245
|
+
// arrives while parked, so that pair is refused before anything starts.
|
|
246
|
+
const presenceRole = presenceTransport({
|
|
247
|
+
command: "listen",
|
|
248
|
+
background: Boolean(opts.daemon || process.env.ZALO_DAEMON_CHILD),
|
|
249
|
+
});
|
|
250
|
+
// The settings come from the same layers as `mcp start`: mcp-config.json (`presence`,
|
|
251
|
+
// `accounts.<ownId>.presence`, `<accountDir>/mcp-config.json`) < env < policy. A file a background
|
|
252
|
+
// listener cannot use is refused, as `mcp start` refuses it: the defaults would silently run on-demand.
|
|
253
|
+
const presenceFiles = presenceConfigFiles({ ownId: activeAcc.ownId, accountDir });
|
|
254
|
+
if (presenceFiles.problem && presenceRole !== "stdout") {
|
|
255
|
+
error(`Refusing to start: ${presenceFiles.problem} (its presence settings would be ignored).`);
|
|
256
|
+
process.exit(1);
|
|
257
|
+
}
|
|
258
|
+
const presenceConfig = presenceFiles.config;
|
|
259
|
+
const presenceCheck = resolveDaemonPresence({
|
|
260
|
+
config: presenceConfig,
|
|
261
|
+
ownId: activeAcc.ownId,
|
|
262
|
+
transport: presenceRole,
|
|
263
|
+
selfHeal: opts.selfHeal !== false,
|
|
264
|
+
});
|
|
265
|
+
if (presenceCheck.problem) {
|
|
266
|
+
error(`Refusing to start: ${presenceCheck.problem}`);
|
|
267
|
+
process.exit(1);
|
|
268
|
+
}
|
|
269
|
+
|
|
187
270
|
if (opts.daemon && !process.env.ZALO_DAEMON_CHILD) {
|
|
188
271
|
const spawned = await spawnDaemonProcess({ accountDir, args: process.argv.slice(1) });
|
|
189
272
|
if (!spawned.ok) {
|
|
@@ -255,9 +338,36 @@ export function registerListenCommand(program) {
|
|
|
255
338
|
error(`Pinned account login failed: ${e.message}`);
|
|
256
339
|
process.exit(1);
|
|
257
340
|
}
|
|
341
|
+
// The account's hidden chats (src/core/hidden-chats.js): left out of every event unless --include-hidden
|
|
342
|
+
// (and the PIN, asked now) or --hidden-contentless.
|
|
343
|
+
const listenHidden = await hiddenSetForCli(activeAcc.ownId, getApi());
|
|
344
|
+
if (opts.includeHidden)
|
|
345
|
+
await unlockOrExit(listenHidden, { pinStdin: Boolean(opts.pinStdin), json: jsonMode });
|
|
346
|
+
const listenHiddenMode = opts.includeHidden
|
|
347
|
+
? "include"
|
|
348
|
+
: opts.hiddenContentless
|
|
349
|
+
? "contentless"
|
|
350
|
+
: "exclude";
|
|
351
|
+
// Media links this daemon hands out over its channel (`msg media --deliver link`): capability links on a
|
|
352
|
+
// 127.0.0.1 listener; `listen` has no config file, so the policy is the environment's and the defaults.
|
|
353
|
+
let listenMediaPolicy = resolveMediaDelivery({ accountId: activeAcc.ownId });
|
|
354
|
+
const mediaLinks = getMediaLinks().configure({
|
|
355
|
+
linkAuth: "capability",
|
|
356
|
+
ttlMs: listenMediaPolicy.linkTtlMs,
|
|
357
|
+
rateLimit: listenMediaPolicy.linkRateLimit,
|
|
358
|
+
log: (line) => console.error(line),
|
|
359
|
+
});
|
|
360
|
+
listenHidden.onChange?.((set) => {
|
|
361
|
+
if (listenHiddenMode === "include") return;
|
|
362
|
+
mediaLinks.revokeWhere((l) => l.threadId !== null && set.isHidden(l.threadId), "its chat was hidden");
|
|
363
|
+
});
|
|
258
364
|
try {
|
|
259
365
|
initDb(join(accountDir, "zalo.db"));
|
|
260
366
|
info(`Local database initialized at ${accountDir}/zalo.db`);
|
|
367
|
+
// Media a 2.x install downloaded is sealed in the background, a batch at a time (media-store.js).
|
|
368
|
+
startMediaMigration(activeAcc.ownId, { log: (l) => console.error(`[listen] ${l}`) });
|
|
369
|
+
// Decrypted copies (msg media) expire on time while this daemon runs (src/core/media-deliver.js).
|
|
370
|
+
startTempfileSweeper({ ttlMs: listenMediaPolicy.tempfileTtlMs });
|
|
261
371
|
// Logged in and the cache open: the heavy part of start-up is over.
|
|
262
372
|
gate.leave();
|
|
263
373
|
} catch (err) {
|
|
@@ -266,6 +376,22 @@ export function registerListenCommand(program) {
|
|
|
266
376
|
error(`Failed to initialize local DB: ${err.message}`);
|
|
267
377
|
process.exit(1);
|
|
268
378
|
}
|
|
379
|
+
// The runtime policy (src/core/policy-store.js), as `mcp start` reads it: a file that cannot be used stops
|
|
380
|
+
// the start; a change (`policy set`, a file drop) counts at once.
|
|
381
|
+
let onPolicyChanged = () => {};
|
|
382
|
+
let policyRuntime;
|
|
383
|
+
try {
|
|
384
|
+
policyRuntime = startPolicyRuntime({
|
|
385
|
+
ownId: activeAcc.ownId,
|
|
386
|
+
onChange: (changed) => onPolicyChanged(changed),
|
|
387
|
+
log: (l) => console.error(`[listen] ${l}`),
|
|
388
|
+
});
|
|
389
|
+
info(`Runtime policy: ${policyRuntime.describe()}`);
|
|
390
|
+
} catch (err) {
|
|
391
|
+
releaseLock(accountDir);
|
|
392
|
+
error(`The runtime policy cannot be used: ${err.message}`);
|
|
393
|
+
process.exit(1);
|
|
394
|
+
}
|
|
269
395
|
|
|
270
396
|
// Gap tracking: a small per-account SyncManager shares zalo.db with
|
|
271
397
|
// this listener so a crash, manual close, or WS drop gets its window
|
|
@@ -274,12 +400,6 @@ export function registerListenCommand(program) {
|
|
|
274
400
|
// connected. See reportGap() for why the daemon reports rather than
|
|
275
401
|
// backfilling on its own.
|
|
276
402
|
const syncManager = new SyncManager(getApi(), activeAcc.ownId);
|
|
277
|
-
const HEARTBEAT_MS = 60 * 1000;
|
|
278
|
-
let lastHeartbeatAt = 0;
|
|
279
|
-
// The one place that knows whether the socket is actually up. The
|
|
280
|
-
// `connected`/`disconnected` handlers below own it; everything else
|
|
281
|
-
// reads it. Starts null: nothing is claimed before the first connect.
|
|
282
|
-
let downSince = null;
|
|
283
403
|
// Set by SIGINT before anything is torn down. listener.stop() emits
|
|
284
404
|
// closed(1000), which is indistinguishable from a real drop, so
|
|
285
405
|
// without this the shutdown path runs the RECOVERY path: five
|
|
@@ -288,19 +408,10 @@ export function registerListenCommand(program) {
|
|
|
288
408
|
// daemon-channel.json already deleted. The next listen/mcp/sync then
|
|
289
409
|
// took the free lock and the two sessions flapped over code 3000.
|
|
290
410
|
let stopping = false;
|
|
411
|
+
// markConnected() means "coverage is good up to now"; the shared tracker stamps it on a beat only while
|
|
412
|
+
// the socket is actually up (not down, not parked), so a crash mid-outage keeps its window.
|
|
291
413
|
function heartbeat() {
|
|
292
|
-
|
|
293
|
-
if (now - lastHeartbeatAt < HEARTBEAT_MS) return;
|
|
294
|
-
lastHeartbeatAt = now;
|
|
295
|
-
// markConnected() means "coverage is good up to now". Stamping
|
|
296
|
-
// that on a timer with no liveness check kept advancing
|
|
297
|
-
// lastConnectedAt while the socket was down -- through zca-js's
|
|
298
|
-
// internal retry, the 5s re-login wait and the 30s retry wait --
|
|
299
|
-
// so a crash mid-outage made the NEXT launch compute its
|
|
300
|
-
// startup-gap from a moment we were not actually connected, and
|
|
301
|
-
// the outage vanished.
|
|
302
|
-
if (downSince !== null) return;
|
|
303
|
-
syncManager.markConnected();
|
|
414
|
+
lifecycle.heartbeat();
|
|
304
415
|
}
|
|
305
416
|
|
|
306
417
|
/**
|
|
@@ -310,7 +421,7 @@ export function registerListenCommand(program) {
|
|
|
310
421
|
* How the daemon self-heals
|
|
311
422
|
* -------------------------
|
|
312
423
|
* A window the socket was down for is first RECORDED here, then
|
|
313
|
-
* closed from Zalo's offline queue -- the way Zalo
|
|
424
|
+
* closed from Zalo's offline queue -- the way Zalo closes it on
|
|
314
425
|
* every connect. After each handshake the daemon asks each message
|
|
315
426
|
* queue (510_1, 511_1) for everything after the last message it
|
|
316
427
|
* stored, pages until the server says there is no more, and writes
|
|
@@ -336,7 +447,7 @@ export function registerListenCommand(program) {
|
|
|
336
447
|
* and the daemon never starts it on its own -- only a
|
|
337
448
|
* `zalo-agent sync` someone typed does. (The self-heal this
|
|
338
449
|
* replaces called the retired pullMobileMsg/getCrossDB pair,
|
|
339
|
-
* MEASURED 2026-09-20 to
|
|
450
|
+
* MEASURED 2026-09-20 to be unused by Zalo itself: it
|
|
340
451
|
* announced an attempt, said nothing more, and the gap stayed
|
|
341
452
|
* pending forever.)
|
|
342
453
|
*
|
|
@@ -350,6 +461,11 @@ export function registerListenCommand(program) {
|
|
|
350
461
|
const toTs = Date.now();
|
|
351
462
|
const gapId = syncManager.recordGap(fromTs, toTs, reason);
|
|
352
463
|
if (!gapId) return null; // under recordGap's 1-second floor
|
|
464
|
+
// A parked window (on-demand presence) is planned: one quiet line, the self-heal closes it.
|
|
465
|
+
if (reason === IDLE_GAP_REASON) {
|
|
466
|
+
info(`Parked since ${new Date(fromTs).toISOString()}: catching up from Zalo's offline queue`);
|
|
467
|
+
return gapId;
|
|
468
|
+
}
|
|
353
469
|
let pendingGaps = [];
|
|
354
470
|
try {
|
|
355
471
|
pendingGaps = getPendingSyncGaps();
|
|
@@ -414,8 +530,22 @@ export function registerListenCommand(program) {
|
|
|
414
530
|
// Deliberate restarts stay quiet on their own merits: SIGINT stamps
|
|
415
531
|
// markConnected() on the way out, so a clean stop/start reports the
|
|
416
532
|
// true downtime rather than a heartbeat-rounded guess.
|
|
533
|
+
// The coverage bookkeeping `mcp start` uses (src/core/listener-lifecycle.js): down-ness observed from the
|
|
534
|
+
// listener's own events (first drop wins), a park's close planned, the parked window filed on the wake.
|
|
535
|
+
const lifecycle = createGapTracker({
|
|
536
|
+
syncManager,
|
|
537
|
+
reportGap,
|
|
538
|
+
setState: setSyncState,
|
|
539
|
+
deleteState: clearSyncState,
|
|
540
|
+
});
|
|
417
541
|
const lastConnectedAt = syncManager.getLastConnectedAt();
|
|
418
|
-
|
|
542
|
+
// A stop or crash while parked left lastConnectedAt at the park stamp: that window is a planned one.
|
|
543
|
+
const parkedStamp = Number(getSyncState(PARKED_AT_KEY)) || null;
|
|
544
|
+
const startupReason = parkedStamp
|
|
545
|
+
? startupGapReason({ lastConnectedAt, parkedAt: parkedStamp })
|
|
546
|
+
: "startup-gap";
|
|
547
|
+
if (parkedStamp) clearSyncState(PARKED_AT_KEY);
|
|
548
|
+
if (!reportGap(lastConnectedAt, startupReason)) {
|
|
419
549
|
// Nothing filed -- no prior connection on record, or a gap under
|
|
420
550
|
// the floor. Either way we are caught up as of now.
|
|
421
551
|
syncManager.markConnected();
|
|
@@ -428,8 +558,8 @@ export function registerListenCommand(program) {
|
|
|
428
558
|
const enabledEvents = new Set(opts.events.split(",").map((e) => e.trim()));
|
|
429
559
|
|
|
430
560
|
// Delivered receipts (deliveredv2): what every Zalo client sends when a
|
|
431
|
-
// message arrives --
|
|
432
|
-
// once and shared with `mcp start` through src/
|
|
561
|
+
// message arrives -- for our own echoes too. Built
|
|
562
|
+
// once and shared with `mcp start` through src/zalo/receipts.js, so the
|
|
433
563
|
// two listeners cannot drift apart (AGENTS.md §13). `getApi`, not an
|
|
434
564
|
// api: a re-login replaces it. Seen receipts are never sent from here.
|
|
435
565
|
const deliveredReceipts = createDeliveredReceipts({
|
|
@@ -445,7 +575,7 @@ export function registerListenCommand(program) {
|
|
|
445
575
|
return h > 0 ? `${h}h${m}m` : `${m}m${s % 60}s`;
|
|
446
576
|
}
|
|
447
577
|
|
|
448
|
-
const webhookUrl =
|
|
578
|
+
const webhookUrl = resolveWebhookUrl({ accountId: activeAcc.ownId, flag: opts.webhook });
|
|
449
579
|
const webhookSecret = resolveWebhookSecret({
|
|
450
580
|
flag: cliWebhookSecret,
|
|
451
581
|
env: envForAccount("ZALO_WEBHOOK_SECRET", activeAcc.ownId),
|
|
@@ -458,19 +588,47 @@ export function registerListenCommand(program) {
|
|
|
458
588
|
// written to disk first and delivered from there, so a receiver that is down costs a
|
|
459
589
|
// backlog (zalo-agent mcp webhook status), not events.
|
|
460
590
|
let webhookDelivery = null;
|
|
461
|
-
|
|
591
|
+
/** Start the delivery, or move a running one to the current receiver and settings (a live policy change). */
|
|
592
|
+
const applyWebhook = (url) => {
|
|
462
593
|
const delivery = resolveWebhookDelivery(activeAcc.ownId);
|
|
463
594
|
for (const w of delivery.warnings) warning(w);
|
|
595
|
+
if (!url) {
|
|
596
|
+
webhookDelivery?.stop();
|
|
597
|
+
webhookDelivery = null;
|
|
598
|
+
return;
|
|
599
|
+
}
|
|
600
|
+
if (webhookDelivery) {
|
|
601
|
+
webhookDelivery.reconfigure({ url, batchSize: delivery.batchSize, maxAgeMs: delivery.maxAgeMs });
|
|
602
|
+
return;
|
|
603
|
+
}
|
|
464
604
|
webhookDelivery = startWebhookDelivery({
|
|
465
605
|
accountDir,
|
|
466
606
|
accountId: activeAcc.ownId,
|
|
467
|
-
url
|
|
607
|
+
url,
|
|
468
608
|
secret: webhookSecret,
|
|
469
609
|
batchSize: delivery.batchSize,
|
|
470
610
|
maxAgeMs: delivery.maxAgeMs,
|
|
471
611
|
log: (line) => console.error(`[listen] ${line}`),
|
|
472
612
|
});
|
|
473
|
-
}
|
|
613
|
+
};
|
|
614
|
+
if (webhookUrl) applyWebhook(webhookUrl);
|
|
615
|
+
// A policy change counts at once: the media link limits and the webhook are set up again.
|
|
616
|
+
onPolicyChanged = (changed) => {
|
|
617
|
+
console.error(`[listen] Policy changed: ${changed.join(", ")}`);
|
|
618
|
+
if (touches(changed, ["media"])) {
|
|
619
|
+
listenMediaPolicy = resolveMediaDelivery({ accountId: activeAcc.ownId });
|
|
620
|
+
mediaLinks.configure({
|
|
621
|
+
ttlMs: listenMediaPolicy.linkTtlMs,
|
|
622
|
+
rateLimit: listenMediaPolicy.linkRateLimit,
|
|
623
|
+
});
|
|
624
|
+
startTempfileSweeper({ ttlMs: listenMediaPolicy.tempfileTtlMs });
|
|
625
|
+
}
|
|
626
|
+
if (touches(changed, ["quota", "retention"])) storageJobs.reschedule();
|
|
627
|
+
if (touches(changed, ["webhook", "webhookBatchSize", "webhookMaxAge"]))
|
|
628
|
+
applyWebhook(resolveWebhookUrl({ accountId: activeAcc.ownId, flag: opts.webhook }));
|
|
629
|
+
// presence.*: live (a switch to always-on holds the socket now; one to on-demand starts the idle clock).
|
|
630
|
+
daemonPresence?.applyPolicy(changed);
|
|
631
|
+
};
|
|
474
632
|
|
|
475
633
|
/** Queue an event for the webhook — never blocks event processing */
|
|
476
634
|
function postWebhook(data) {
|
|
@@ -503,6 +661,13 @@ export function registerListenCommand(program) {
|
|
|
503
661
|
|
|
504
662
|
/** Output event as JSON or human-readable, save locally, then post to webhook */
|
|
505
663
|
function emitEvent(data, humanMsg) {
|
|
664
|
+
// Hidden chats, as the flags say: left out (default), contentless, or shown after the PIN.
|
|
665
|
+
const view = hiddenEventView(data, listenHidden, listenHiddenMode, { name: data?.event });
|
|
666
|
+
if (!view) return;
|
|
667
|
+
if (view.hidden) {
|
|
668
|
+
data = view;
|
|
669
|
+
humanMsg = `Something arrived in a hidden conversation (${view.event})`;
|
|
670
|
+
}
|
|
506
671
|
eventCount++;
|
|
507
672
|
if (process.env.ZALO_DAEMON_CHILD === "1") {
|
|
508
673
|
// In daemon.log an event line is a per-message line: debug (it carries the message text).
|
|
@@ -516,6 +681,34 @@ export function registerListenCommand(program) {
|
|
|
516
681
|
postWebhook(data);
|
|
517
682
|
}
|
|
518
683
|
|
|
684
|
+
// Quotas and retention (src/core/storage-quota.js): this daemon holds daemon.lock, so it purges, on its
|
|
685
|
+
// timer and for `db purge` over its channel. A storage_quota event is reported like any other event.
|
|
686
|
+
// group_gone (src/core/group-exit.js): our own exit seen live, a disband found by group info, a
|
|
687
|
+
// keep -> purge switch acted on. Reported like any other event (stdout, webhook, JSONL), never gated.
|
|
688
|
+
setGroupGoneSink((event) => emitEvent(event, describeGroupGone(event)));
|
|
689
|
+
const storageJobs = startStorageJobs({
|
|
690
|
+
ownId: activeAcc.ownId,
|
|
691
|
+
emit: (event) => emitEvent(event, describeQuotaEvent(event)),
|
|
692
|
+
log: (l) => console.error(`[listen] ${l}`),
|
|
693
|
+
purgeOutboxDead: (cutoff) => purgeDeadDeliveries(accountDir, cutoff),
|
|
694
|
+
});
|
|
695
|
+
// account_state (src/core/account-state.js): one word per change, reported like any other event (stdout,
|
|
696
|
+
// webhook, JSONL) and in /status, the same as `mcp start`; detail.presence is the mode presence runs in.
|
|
697
|
+
let daemonPresence = null;
|
|
698
|
+
const accountState = createAccountStateTracker({
|
|
699
|
+
accountId: activeAcc.ownId,
|
|
700
|
+
emit: (event) => emitEvent(event, describeAccountState(event)),
|
|
701
|
+
detail: () => daemonPresence?.detail() ?? { presence: presenceCheck.settings.mode },
|
|
702
|
+
});
|
|
703
|
+
|
|
704
|
+
// session_expiring (src/core/session-notice.js): the saved login ends by itself; once per threshold (14, 7,
|
|
705
|
+
// 3, 1 days, ended), reported like any other event (stdout, webhook, JSONL), the same as `mcp start`.
|
|
706
|
+
const sessionWatch = startSessionExpiryWatch({
|
|
707
|
+
ownId: activeAcc.ownId,
|
|
708
|
+
accountDir,
|
|
709
|
+
emit: (event) => emitEvent(event, describeSessionExpiring(event)),
|
|
710
|
+
});
|
|
711
|
+
|
|
519
712
|
/** Whether --events, --filter or --no-self keep a message off stdout, the webhook and the JSONL. */
|
|
520
713
|
function isMuted(msg) {
|
|
521
714
|
const filteredOut =
|
|
@@ -527,10 +720,19 @@ export function registerListenCommand(program) {
|
|
|
527
720
|
return !enabledEvents.has("message") || filteredOut || (!opts.self && msg.isSelf);
|
|
528
721
|
}
|
|
529
722
|
|
|
723
|
+
/** " (Name, Name)" for a group event's members, alias first; "" when it names none. */
|
|
724
|
+
function groupEventWho(data) {
|
|
725
|
+
const named =
|
|
726
|
+
groupEventNames(data)
|
|
727
|
+
?.updateMembers?.map((m) => m?.dName || m?.id)
|
|
728
|
+
.filter(Boolean) ?? [];
|
|
729
|
+
return named.length ? ` (${named.join(", ")})` : "";
|
|
730
|
+
}
|
|
731
|
+
|
|
530
732
|
/**
|
|
531
733
|
* A message as `listen` reports it: the event object, and its one-line human form.
|
|
532
734
|
*
|
|
533
|
-
* @param {object} msg - the
|
|
735
|
+
* @param {object} msg - the listener's message event
|
|
534
736
|
* @param {object} [extra] - fields to add, e.g. `{catchUp: true}`
|
|
535
737
|
* @returns {{data: object, human: string}}
|
|
536
738
|
*/
|
|
@@ -538,6 +740,7 @@ export function registerListenCommand(program) {
|
|
|
538
740
|
const rawContent = msg.data.content;
|
|
539
741
|
const isText = typeof rawContent === "string";
|
|
540
742
|
const msgType = msg.data.msgType || null;
|
|
743
|
+
const sender = senderNameFields(msg.data.uidFrom, msg.data.dName);
|
|
541
744
|
// Build readable display: show type + title/href for non-text
|
|
542
745
|
let displayContent;
|
|
543
746
|
if (isText) {
|
|
@@ -558,7 +761,10 @@ export function registerListenCommand(program) {
|
|
|
558
761
|
type: msg.type,
|
|
559
762
|
isSelf: msg.isSelf,
|
|
560
763
|
uidFrom: msg.data.uidFrom || null,
|
|
561
|
-
|
|
764
|
+
// The sender as Zalo shows them to this account: the owner's alias first (src/core/contact-names.js);
|
|
765
|
+
// `senderZaloName` is the name the message carried.
|
|
766
|
+
dName: sender.senderName,
|
|
767
|
+
...sender,
|
|
562
768
|
msgType,
|
|
563
769
|
content: rawContent,
|
|
564
770
|
...extra,
|
|
@@ -566,15 +772,16 @@ export function registerListenCommand(program) {
|
|
|
566
772
|
const dir = msg.isSelf ? "→" : "←";
|
|
567
773
|
const typeLabel = msg.type === THREAD_USER ? "DM" : "GR";
|
|
568
774
|
const tag = extra.catchUp ? " [catch-up]" : "";
|
|
775
|
+
const who = !msg.isSelf && sender.senderName ? `${sender.senderName}: ` : "";
|
|
569
776
|
return {
|
|
570
777
|
data,
|
|
571
|
-
human: `${dir} [${typeLabel}]${tag} [${msg.threadId}] ${displayContent} (msgId: ${msg.data.msgId})`,
|
|
778
|
+
human: `${dir} [${typeLabel}]${tag} [${msg.threadId}] ${who}${displayContent} (msgId: ${msg.data.msgId})`,
|
|
572
779
|
};
|
|
573
780
|
}
|
|
574
781
|
|
|
575
782
|
// One stage at a time on this socket -- the lock the daemon
|
|
576
783
|
// channel's routes hold, shared with this daemon's own catch-up --
|
|
577
|
-
// and one raw reader on the socket for the fields
|
|
784
|
+
// and one raw reader on the socket for the fields the listener's events drop.
|
|
578
785
|
// Built once, like the receipter: they outlive every re-login.
|
|
579
786
|
const stageLock = createStageLock();
|
|
580
787
|
// See mcp.js: stage progress, event-loop stalls and refused lookups belong in the log too.
|
|
@@ -588,18 +795,66 @@ export function registerListenCommand(program) {
|
|
|
588
795
|
});
|
|
589
796
|
const socketContext = createSocketContext({ lock: stageLock, monitor: loopMonitor });
|
|
590
797
|
setUserInfoLogger(daemonLog);
|
|
798
|
+
// The owner's aliases, which every line and payload names people by: read at start, on an `alias`
|
|
799
|
+
// control and every 30 minutes, kept in the account's db. Same in `mcp start` (src/core/contact-names.js).
|
|
800
|
+
const daemonAliases = startDaemonAliases({
|
|
801
|
+
getApi,
|
|
802
|
+
log: daemonLog,
|
|
803
|
+
onOwnName: (name) => updateAccountName(activeAcc.ownId, name),
|
|
804
|
+
});
|
|
591
805
|
// Same health object `mcp start` builds (src/core/daemon-health.js): `listen --status` prints it.
|
|
592
806
|
const health = createDaemonHealth({ kind: "listen", accountId: activeAcc.ownId, version: PKG_VERSION });
|
|
593
|
-
|
|
807
|
+
// Planned idle windows (on-demand presence) are not worth a warning; everything else is.
|
|
808
|
+
health.setSource("gaps", () => alarmingGapCount(getPendingSyncGaps()));
|
|
594
809
|
health.setSource("stage", () => stageLock.current());
|
|
810
|
+
health.setSource("accountState", () => accountState.current());
|
|
595
811
|
health.setSource("webhook", () => webhookDelivery?.status() ?? null);
|
|
812
|
+
health.setSource("session", () => sessionExpiryFor(activeAcc.ownId));
|
|
813
|
+
health.setSource("presence", () => daemonPresence?.snapshot() ?? null);
|
|
814
|
+
const sessionLine = describeSessionExpiry(sessionExpiryFor(activeAcc.ownId));
|
|
815
|
+
if (sessionLine) console.error(`[listen] ${sessionLine}`);
|
|
816
|
+
// On-demand presence: when this daemon holds the account's socket (src/core/daemon-presence.js, shared
|
|
817
|
+
// with `mcp start`). Built before the socket host, which it drives through park/wake.
|
|
818
|
+
try {
|
|
819
|
+
daemonPresence = createDaemonPresence({
|
|
820
|
+
ownId: activeAcc.ownId,
|
|
821
|
+
config: presenceConfig,
|
|
822
|
+
transport: presenceRole,
|
|
823
|
+
selfHeal: opts.selfHeal !== false,
|
|
824
|
+
configDir: CONFIG_DIR,
|
|
825
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
826
|
+
getSocketHost: () => socketHost,
|
|
827
|
+
stageLock,
|
|
828
|
+
deliveredReceipts,
|
|
829
|
+
lifecycle,
|
|
830
|
+
health,
|
|
831
|
+
accountState,
|
|
832
|
+
coveredUntil: () => syncManager.getLastConnectedAt(),
|
|
833
|
+
});
|
|
834
|
+
} catch (e) {
|
|
835
|
+
dropLock();
|
|
836
|
+
error(`Refusing to start: ${e.message}`);
|
|
837
|
+
process.exit(1);
|
|
838
|
+
}
|
|
839
|
+
{
|
|
840
|
+
const p = daemonPresence.settings;
|
|
841
|
+
info(
|
|
842
|
+
`Presence: ${p.mode}${daemonPresence.forced ? ` (${daemonPresence.forced})` : ""}` +
|
|
843
|
+
(p.mode === "on-demand"
|
|
844
|
+
? `: parks after ${Math.round(p.idleTimeoutMs / 1000)}s with no demand, ` +
|
|
845
|
+
`never within ${Math.round(p.minConnectedMs / 1000)}s of a connect`
|
|
846
|
+
: ""),
|
|
847
|
+
);
|
|
848
|
+
info(describeSocketPolicy(p, { exitOnSignedOut: daemonPresence.exitOnSignedOut }));
|
|
849
|
+
}
|
|
596
850
|
const socketTap = createSocketTap({ log: (line) => console.error(`[listen] ${line}`) });
|
|
597
851
|
// Read state other devices report -- a conversation read on the
|
|
598
|
-
// phone, an unread mark set or cleared there -- which
|
|
599
|
-
//
|
|
852
|
+
// phone, an unread mark set or cleared there -- which the listener's events
|
|
853
|
+
// drop. Stored always, like reactions; printed only with
|
|
600
854
|
// `--events read`. It rides the tap, which re-arms on every socket.
|
|
601
855
|
createReadStateSync({
|
|
602
856
|
tap: socketTap,
|
|
857
|
+
ownId: activeAcc.ownId,
|
|
603
858
|
log: (line) => console.error(`[listen] ${line}`),
|
|
604
859
|
onChange: (change) => {
|
|
605
860
|
if (!enabledEvents.has("read")) return;
|
|
@@ -607,12 +862,70 @@ export function registerListenCommand(program) {
|
|
|
607
862
|
emitEvent(data, human);
|
|
608
863
|
},
|
|
609
864
|
});
|
|
865
|
+
// The cloud queue, kept current when the server says it may be stale (cmd 621): bounded, read-only,
|
|
866
|
+
// never beside another stage (src/core/cloud-verify.js). Same in `listen` and `mcp start`.
|
|
867
|
+
createCloudVerifier({
|
|
868
|
+
tap: socketTap,
|
|
869
|
+
getApi,
|
|
870
|
+
lock: stageLock,
|
|
871
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
872
|
+
});
|
|
873
|
+
// The control actions the server sends that nobody handles, named once in the account folder
|
|
874
|
+
// (src/core/unknown-acts.js). Same in `listen` and `mcp start`.
|
|
875
|
+
attachUnknownActs({
|
|
876
|
+
tap: socketTap,
|
|
877
|
+
file: join(accountDir, "unknown-acts.json"),
|
|
878
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
879
|
+
});
|
|
880
|
+
// The text of a voice message Zalo transcribed arrives as a control push; it is kept in the account
|
|
881
|
+
// folder for `read run voice-transcript` (src/core/voice-text.js). Same in `listen` and `mcp start`.
|
|
882
|
+
attachVoiceText({
|
|
883
|
+
tap: socketTap,
|
|
884
|
+
file: voiceTextFile(accountDir),
|
|
885
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
886
|
+
});
|
|
887
|
+
// A catalog changed, a DM reminder created, edited or removed, the device list changed, a conversation
|
|
888
|
+
// muted, archived, labeled or its auto-delete changed, a quick message changed, on another device
|
|
889
|
+
// (src/core/control-events.js): the reminder is stored or dropped in the cache whatever --events says;
|
|
890
|
+
// the events are printed only when asked for (`catalog`, `reminder`, `devices`, `settings`,
|
|
891
|
+
// `conversation`, `quick-message`). Same in `mcp start`.
|
|
892
|
+
// Hidden chats hidden, unhidden or their PIN changed or removed on another device (601 `hidden_chat`).
|
|
893
|
+
// Same in `listen` and `mcp start`.
|
|
894
|
+
attachHiddenChatControls({ tap: socketTap, set: listenHidden, getApi, readControls });
|
|
895
|
+
attachControlEvents({
|
|
896
|
+
tap: socketTap,
|
|
897
|
+
ownId: activeAcc.ownId,
|
|
898
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
899
|
+
onEvent: (ev) => {
|
|
900
|
+
const kind = CONTROL_EVENT_KINDS[ev.event];
|
|
901
|
+
if (kind && enabledEvents.has(kind)) emitEvent(ev, describeControlEvent(ev));
|
|
902
|
+
},
|
|
903
|
+
});
|
|
904
|
+
// A user's last-online time as Zalo pushes it (602 online_status): kept in the cache whatever --events
|
|
905
|
+
// says, for `friend last-online --cached`; printed with `--events online`. Same in `mcp start`.
|
|
906
|
+
attachLastOnline({
|
|
907
|
+
tap: socketTap,
|
|
908
|
+
log: (line) => console.error(`[listen] ${line}`),
|
|
909
|
+
onEvent: (ev) => {
|
|
910
|
+
if (!enabledEvents.has("online")) return;
|
|
911
|
+
emitEvent(ev, `Online: ${ev.userId} at ${new Date(ev.lastOnline).toLocaleString()}`);
|
|
912
|
+
},
|
|
913
|
+
});
|
|
914
|
+
// End-to-end encrypted messages this client cannot read: the first is named in the log, the rest counted.
|
|
915
|
+
const undecryptable = createUndecryptableNotice({ log: (line) => console.error(`[listen] ${line}`) });
|
|
610
916
|
const selfHeal = createSelfHeal({
|
|
611
917
|
getApi,
|
|
612
918
|
tap: socketTap,
|
|
613
919
|
lock: stageLock,
|
|
614
920
|
enabled: opts.selfHeal !== false,
|
|
615
921
|
log: (line) => console.error(`[listen] ${line}`),
|
|
922
|
+
// Coverage never spans a device change (src/core/device-since.js): read on each run, so a
|
|
923
|
+
// re-login's new device id counts from the next handshake. Same in `mcp start`.
|
|
924
|
+
deviceSince: () => deviceSinceOf(activeAcc.ownId, getApi()),
|
|
925
|
+
// Zalo dropped part of a queue: reported like any other event (stdout, webhook, JSONL).
|
|
926
|
+
onNotice: (event) => emitEvent(event, describeQueueOverflow(event)),
|
|
927
|
+
// A catch-up finished: on-demand presence ends its start-up and pulse holds. Same in `mcp start`.
|
|
928
|
+
onRun: ({ ms }) => daemonPresence?.noteCatchUpDone({ ms }),
|
|
616
929
|
// A message recovered after a drop reaches stdout, the JSONL and
|
|
617
930
|
// the webhook as a live one would, marked so a consumer can tell.
|
|
618
931
|
onRecovered: (items) => {
|
|
@@ -627,6 +940,7 @@ export function registerListenCommand(program) {
|
|
|
627
940
|
/** Attach ALL handlers (data + lifecycle) to current API listener */
|
|
628
941
|
function attachAllHandlers(api) {
|
|
629
942
|
health.attach(api.listener);
|
|
943
|
+
daemonAliases.attach(api.listener);
|
|
630
944
|
// --- Message events ---
|
|
631
945
|
// Registered unconditionally. --events, --filter and --no-self
|
|
632
946
|
// decide what is PRINTED, forwarded and saved as JSONL -- never
|
|
@@ -639,6 +953,13 @@ export function registerListenCommand(program) {
|
|
|
639
953
|
// connected for.
|
|
640
954
|
{
|
|
641
955
|
api.listener.on("message", async (msg) => {
|
|
956
|
+
// A message Zalo re-sent (534) that is already stored was announced when it was stored;
|
|
957
|
+
// self-heal owns re-pushes, so it is not printed or posted twice.
|
|
958
|
+
if (selfHeal.isRepeatedRepush(msg)) {
|
|
959
|
+
heartbeat();
|
|
960
|
+
return;
|
|
961
|
+
}
|
|
962
|
+
undecryptable.note(msg);
|
|
642
963
|
const mute = isMuted(msg);
|
|
643
964
|
|
|
644
965
|
// A "delete for me" frame rides the message channel but
|
|
@@ -714,7 +1035,7 @@ export function registerListenCommand(program) {
|
|
|
714
1035
|
deliveredReceipts.attach(api.listener);
|
|
715
1036
|
|
|
716
1037
|
// Also after the storing handler, and here for the same reason:
|
|
717
|
-
// the tap reads the envelope fields
|
|
1038
|
+
// the tap reads the envelope fields the listener's events drop, and the
|
|
718
1039
|
// self-heal moves its cursor only past a row already written,
|
|
719
1040
|
// then catches up on every handshake this listener makes.
|
|
720
1041
|
socketTap.attach(api.listener);
|
|
@@ -729,11 +1050,13 @@ export function registerListenCommand(program) {
|
|
|
729
1050
|
threadId: event.threadId,
|
|
730
1051
|
isSelf: event.isSelf,
|
|
731
1052
|
data: event.data,
|
|
1053
|
+
// Alias first, as Zalo shows the person (src/core/contact-names.js).
|
|
1054
|
+
name: nameFor(event.threadId, event.data?.dName ?? event.data?.displayName ?? null),
|
|
732
1055
|
};
|
|
733
1056
|
const humanMsg =
|
|
734
1057
|
event.type === FRIEND_REQUEST_TYPE
|
|
735
|
-
? `Friend request from ${event.data.fromUid}: "${event.data.message || ""}"`
|
|
736
|
-
: `${label} — ${event.threadId}`;
|
|
1058
|
+
? `Friend request from ${personLabel(event.data.fromUid, event.data.dName ?? event.data.displayName)}: "${event.data.message || ""}"`
|
|
1059
|
+
: `${label} — ${personLabel(event.threadId)}`;
|
|
737
1060
|
emitEvent(data, humanMsg);
|
|
738
1061
|
|
|
739
1062
|
// Auto-accept incoming friend requests
|
|
@@ -751,20 +1074,25 @@ export function registerListenCommand(program) {
|
|
|
751
1074
|
// --- Typing and upload events (opt-in) ---
|
|
752
1075
|
// Not in the default --events: typing is constant noise, and upload
|
|
753
1076
|
// only matters to a caller that is uploading. Neither is stored.
|
|
754
|
-
//
|
|
1077
|
+
// the listener also emits `cipher_key`, the session's key material; it is
|
|
755
1078
|
// deliberately never subscribed to, so it can reach no log, file or webhook.
|
|
756
1079
|
if (enabledEvents.has("typing")) {
|
|
757
1080
|
api.listener.on("typing", (t) => {
|
|
758
1081
|
emitEvent(
|
|
759
1082
|
{
|
|
760
1083
|
event: "typing",
|
|
1084
|
+
// "typing", or "fsending": the peer is sending a file. Our own devices' typing never
|
|
1085
|
+
// arrives here (the listener drops it, as Zalo does).
|
|
1086
|
+
action: t.action ?? "typing",
|
|
761
1087
|
threadId: t.threadId,
|
|
762
1088
|
isGroup: t.type === THREAD_GROUP,
|
|
763
1089
|
uid: t.data?.uid ?? null,
|
|
1090
|
+
name: nameFor(t.data?.uid),
|
|
1091
|
+
isSelf: Boolean(t.isSelf),
|
|
764
1092
|
isPC: Boolean(t.data?.isPC),
|
|
765
1093
|
data: t.data,
|
|
766
1094
|
},
|
|
767
|
-
|
|
1095
|
+
`${t.action === "fsending" ? "Sending a file" : "Typing"}: ${personLabel(t.data?.uid)} in ${t.threadId}`,
|
|
768
1096
|
);
|
|
769
1097
|
});
|
|
770
1098
|
}
|
|
@@ -795,9 +1123,21 @@ export function registerListenCommand(program) {
|
|
|
795
1123
|
// is what tells being removed from removing someone else
|
|
796
1124
|
// -- mcp.js passes it too.
|
|
797
1125
|
const gone = storeGroupEvent(event, { ownId: activeAcc.ownId });
|
|
798
|
-
//
|
|
799
|
-
|
|
800
|
-
|
|
1126
|
+
// A gone group's later events are skipped until a join names us (as Zalo does).
|
|
1127
|
+
if (gone.ignored) return;
|
|
1128
|
+
// Our own exit: purge the group's history, or keep it flagged (groups.onLeave, read now). The
|
|
1129
|
+
// group_gone event goes out through the sink set at start.
|
|
1130
|
+
if (gone.gone) {
|
|
1131
|
+
applyGroupExit({
|
|
1132
|
+
ownId: activeAcc.ownId,
|
|
1133
|
+
threadId: gone.threadId,
|
|
1134
|
+
reason: gone.reason,
|
|
1135
|
+
at: gone.at,
|
|
1136
|
+
}).catch((e) => console.error(`[listen] group exit of ${gone.threadId} failed: ${e.message}`));
|
|
1137
|
+
}
|
|
1138
|
+
// The system line itself, as the row a sync would restore (not for an exit: the delete
|
|
1139
|
+
// marker covers it). Stored whatever --events says: output flags never gate storage.
|
|
1140
|
+
const row = gone.gone ? { stored: false } : storeGroupEventRow(event);
|
|
801
1141
|
if (!row.stored && row.reason && row.reason !== "not a system-line event") {
|
|
802
1142
|
console.error(`[listen] group event not stored: ${row.reason}`);
|
|
803
1143
|
}
|
|
@@ -807,9 +1147,10 @@ export function registerListenCommand(program) {
|
|
|
807
1147
|
event: `group_${event.type}`,
|
|
808
1148
|
threadId: event.threadId,
|
|
809
1149
|
isSelf: event.isSelf,
|
|
810
|
-
|
|
1150
|
+
// Members and actor named alias first; the stored system line keeps what Zalo sent.
|
|
1151
|
+
data: groupEventNames(event.data),
|
|
811
1152
|
},
|
|
812
|
-
`Group: ${event.type} — ${event.threadId}`,
|
|
1153
|
+
`Group: ${event.type} — ${event.threadId}${groupEventWho(event.data)}`,
|
|
813
1154
|
);
|
|
814
1155
|
if (board.stale) {
|
|
815
1156
|
emitEvent(
|
|
@@ -817,12 +1158,6 @@ export function registerListenCommand(program) {
|
|
|
817
1158
|
`Board changed in ${board.threadId} (${event.type}) — run sync-boards to refresh`,
|
|
818
1159
|
);
|
|
819
1160
|
}
|
|
820
|
-
if (gone.gone) {
|
|
821
|
-
emitEvent(
|
|
822
|
-
{ event: "thread_gone", threadId: gone.threadId },
|
|
823
|
-
`No longer in ${gone.threadId} — its local history is now orphaned (see \`conv forget\`)`,
|
|
824
|
-
);
|
|
825
|
-
}
|
|
826
1161
|
});
|
|
827
1162
|
|
|
828
1163
|
// --- Reaction events ---
|
|
@@ -852,9 +1187,11 @@ export function registerListenCommand(program) {
|
|
|
852
1187
|
isGroup: reaction.isGroup,
|
|
853
1188
|
removing: r.removing ?? null,
|
|
854
1189
|
changed: r.changed ?? null,
|
|
1190
|
+
// Who reacted, alias first (src/core/contact-names.js).
|
|
1191
|
+
...senderNameFields(reaction.data?.uidFrom, reaction.data?.dName),
|
|
855
1192
|
data: reaction.data,
|
|
856
1193
|
},
|
|
857
|
-
`${what} in ${reaction.threadId}`,
|
|
1194
|
+
`${what} in ${reaction.threadId}${reaction.data?.uidFrom ? ` by ${personLabel(reaction.data.uidFrom, reaction.data.dName)}` : ""}`,
|
|
858
1195
|
);
|
|
859
1196
|
});
|
|
860
1197
|
|
|
@@ -892,89 +1229,98 @@ export function registerListenCommand(program) {
|
|
|
892
1229
|
// Driven by observed socket state, NOT by reconnectCount.
|
|
893
1230
|
// reconnectCount is incremented only in the `closed` handler,
|
|
894
1231
|
// and `closed` never fires for a code on the server's
|
|
895
|
-
// close_and_retry_codes list --
|
|
1232
|
+
// close_and_retry_codes list -- the listener emits `disconnected`,
|
|
896
1233
|
// retries internally, then emits `connected`. Those codes ARE
|
|
897
1234
|
// the recoverable ones, so on the common drop path the old
|
|
898
1235
|
// guard was always false: no gap was filed, and markConnected()
|
|
899
1236
|
// below then asserted coverage over the whole outage. Messages
|
|
900
1237
|
// lost to an ordinary reconnect were lost silently and for
|
|
901
|
-
// good, because `sync` is driven off exactly this advice.
|
|
902
|
-
|
|
903
|
-
|
|
904
|
-
downSince = null;
|
|
905
|
-
}
|
|
906
|
-
syncManager.markConnected();
|
|
1238
|
+
// good, because `sync` is driven off exactly this advice. The tracker files
|
|
1239
|
+
// the outage (reportGap from when it went down) before it claims coverage.
|
|
1240
|
+
lifecycle.noteUp();
|
|
907
1241
|
});
|
|
908
1242
|
|
|
909
1243
|
api.listener.on("disconnected", (code, _reason) => {
|
|
910
1244
|
if (stopping) return;
|
|
1245
|
+
// A park's close (on-demand presence) is planned, like a shutdown's.
|
|
1246
|
+
if (socketHost.isParking() || socketHost.isParked()) return;
|
|
1247
|
+
// After a kick the socket host has already said why it is not reconnecting.
|
|
1248
|
+
if (socketHost.kicked()) return;
|
|
911
1249
|
warning(`Disconnected (code: ${code}). Auto-retrying... (${socketContext.describe()})`);
|
|
912
1250
|
// First drop wins: a flapping socket that emits several
|
|
913
1251
|
// `disconnected` before one `connected` is ONE outage, and the
|
|
914
|
-
// gap must span from the start of it.
|
|
915
|
-
if (
|
|
916
|
-
|
|
1252
|
+
// gap must span from the start of it (the tracker keeps the first).
|
|
1253
|
+
if (!lifecycle.isDown()) reconnectCount++;
|
|
1254
|
+
lifecycle.noteDown();
|
|
917
1255
|
});
|
|
918
1256
|
|
|
919
|
-
|
|
920
|
-
|
|
921
|
-
|
|
922
|
-
|
|
923
|
-
|
|
924
|
-
error("Another Zalo Web session opened. Listener stopped.");
|
|
925
|
-
dropLock();
|
|
926
|
-
process.exit(1);
|
|
927
|
-
}
|
|
928
|
-
reconnectCount++;
|
|
929
|
-
if (downSince === null) downSince = Date.now();
|
|
930
|
-
syncManager.markDisconnected();
|
|
931
|
-
warning(
|
|
932
|
-
`Connection closed (code: ${code}). Re-login in 5s... (uptime: ${uptime()}; ${socketContext.describe()})`,
|
|
933
|
-
);
|
|
934
|
-
await new Promise((r) => setTimeout(r, 5000));
|
|
935
|
-
try {
|
|
936
|
-
clearSession();
|
|
937
|
-
await loginDaemonAccount(activeAcc);
|
|
938
|
-
info("Re-login successful. Restarting listener...");
|
|
939
|
-
// Attach ALL handlers to the NEW api (including lifecycle),
|
|
940
|
-
// and repoint the SyncManager at it so its bookkeeping
|
|
941
|
-
// runs against a live, authenticated client.
|
|
942
|
-
const newApi = getApi();
|
|
943
|
-
syncManager.api = newApi;
|
|
944
|
-
attachAllHandlers(newApi);
|
|
945
|
-
newApi.listener.start({ retryOnClose: true });
|
|
946
|
-
} catch (e) {
|
|
947
|
-
error(`Re-login failed: ${e.message}. Retrying in 30s...`);
|
|
948
|
-
await new Promise((r) => setTimeout(r, 30000));
|
|
949
|
-
try {
|
|
950
|
-
clearSession();
|
|
951
|
-
await loginDaemonAccount(activeAcc);
|
|
952
|
-
const retryApi = getApi();
|
|
953
|
-
syncManager.api = retryApi;
|
|
954
|
-
attachAllHandlers(retryApi);
|
|
955
|
-
retryApi.listener.start({ retryOnClose: true });
|
|
956
|
-
info("Re-login successful on retry.");
|
|
957
|
-
} catch (e2) {
|
|
958
|
-
error(`Re-login retry failed: ${e2.message}. Exiting.`);
|
|
959
|
-
process.exit(1);
|
|
960
|
-
}
|
|
961
|
-
}
|
|
962
|
-
});
|
|
1257
|
+
// There is no `closed` handler on purpose. Keeping this socket alive is the socket
|
|
1258
|
+
// host's job (src/core/socket-host.js, shared with `mcp start`): it retries by Zalo's own
|
|
1259
|
+
// rules, treats a duplicate session as the end, and logs in again only when the session
|
|
1260
|
+
// was refused. The `closed` ladder this replaced reconnected on a duplicate session and
|
|
1261
|
+
// so evicted the other one again and again.
|
|
963
1262
|
|
|
964
1263
|
api.listener.on("error", (_err) => {
|
|
965
1264
|
// WS errors are followed by close/disconnect — don't crash
|
|
966
1265
|
});
|
|
967
1266
|
}
|
|
968
1267
|
|
|
1268
|
+
// The one place that keeps the socket alive, shared with `mcp start`.
|
|
1269
|
+
const socketHost = createSocketHost({
|
|
1270
|
+
log: (level, message) =>
|
|
1271
|
+
level === "error" ? error(message) : level === "warn" ? warning(message) : info(message),
|
|
1272
|
+
// The supervisor's states reach presence, health and account_state through one place.
|
|
1273
|
+
health: { noteSocketState: (state) => daemonPresence.noteSocketState(state) },
|
|
1274
|
+
// On-demand: a kick by another session of this login yields (the daemon stays up, refusing requests
|
|
1275
|
+
// until `presence resume`); a park marks its close as planned before the supervisor stops.
|
|
1276
|
+
yieldOnKick: () => daemonPresence.yieldOnKick(),
|
|
1277
|
+
onParking: () => daemonPresence.onParking(),
|
|
1278
|
+
isStopping: () => stopping,
|
|
1279
|
+
anomalyFile: join(accountDir, "sock-anomaly.json"),
|
|
1280
|
+
kickFile: kickFile(accountDir),
|
|
1281
|
+
relogin: async () => {
|
|
1282
|
+
clearSession();
|
|
1283
|
+
await loginDaemonAccount(activeAcc);
|
|
1284
|
+
const newApi = getApi();
|
|
1285
|
+
// Attach ALL handlers to the NEW api (including lifecycle), and repoint the
|
|
1286
|
+
// SyncManager at it so its bookkeeping runs against a live, authenticated client.
|
|
1287
|
+
syncManager.api = newApi;
|
|
1288
|
+
attachAllHandlers(newApi);
|
|
1289
|
+
return newApi;
|
|
1290
|
+
},
|
|
1291
|
+
onKicked: () => {
|
|
1292
|
+
// Said before the exit: the account is not coming back by itself.
|
|
1293
|
+
accountState.note("kicked", { exitCode: EXIT_CODE.KICKED });
|
|
1294
|
+
mediaLinks.revokeAll("the session ended");
|
|
1295
|
+
dropLock();
|
|
1296
|
+
process.exit(EXIT_CODE.KICKED);
|
|
1297
|
+
},
|
|
1298
|
+
onRevoked: (e) => {
|
|
1299
|
+
mediaLinks.revokeAll("the session ended");
|
|
1300
|
+
error(
|
|
1301
|
+
`Zalo keeps refusing the saved login (${e?.message ?? e}): another browser or device took ` +
|
|
1302
|
+
"the web login. Add the account again by QR (`zalo-agent login`).",
|
|
1303
|
+
);
|
|
1304
|
+
// Signed out: the daemon stays up (status, a QR re-add) and refuses requests; exit 4 only with
|
|
1305
|
+
// ZALO_EXIT_ON_SIGNED_OUT[_<ownId>]=1.
|
|
1306
|
+
if (daemonPresence.signOut(e)) return;
|
|
1307
|
+
accountState.note("login_needed", { exitCode: EXIT_CODE.SESSION_REVOKED });
|
|
1308
|
+
dropLock();
|
|
1309
|
+
process.exit(EXIT_CODE.SESSION_REVOKED);
|
|
1310
|
+
},
|
|
1311
|
+
});
|
|
1312
|
+
|
|
969
1313
|
// --- Initial start ---
|
|
970
1314
|
try {
|
|
971
1315
|
const api = getApi();
|
|
972
1316
|
attachAllHandlers(api);
|
|
973
|
-
|
|
1317
|
+
// The host takes the session; presence opens the socket now (always-on, the start-up catch-up) or
|
|
1318
|
+
// on the first demand.
|
|
1319
|
+
daemonPresence.start(api);
|
|
1320
|
+
daemonAliases.refreshNow("start").catch(() => {});
|
|
974
1321
|
|
|
975
1322
|
info("Listening for Zalo events... Press Ctrl+C to stop.");
|
|
976
1323
|
info(`Events: ${opts.events}`);
|
|
977
|
-
info("Auto-reconnect enabled.");
|
|
978
1324
|
if (opts.filter !== "all") info(`Message filter: ${opts.filter}`);
|
|
979
1325
|
if (webhookUrl) info(`Webhook: ${webhookUrl}${webhookSecret ? " (signed)" : ""}`);
|
|
980
1326
|
if (saveDir) info(`Save dir: ${saveDir} (JSONL per thread)`);
|
|
@@ -1007,15 +1353,23 @@ export function registerListenCommand(program) {
|
|
|
1007
1353
|
//
|
|
1008
1354
|
// `createSyncRunners` is handed `getApi`, not an api: this daemon
|
|
1009
1355
|
// rebuilds one on a duplicate-session close, and a stage bound to
|
|
1010
|
-
// the old object would tap a socket
|
|
1356
|
+
// the old object would tap a socket the listener has already nulled.
|
|
1011
1357
|
let channel = null;
|
|
1012
1358
|
const shutdown = () => {
|
|
1013
1359
|
// First, before anything can emit a close event.
|
|
1014
1360
|
stopping = true;
|
|
1361
|
+
lifecycle.setStopping();
|
|
1015
1362
|
health.noteStopping();
|
|
1363
|
+
daemonPresence?.stop();
|
|
1016
1364
|
channel?.stop();
|
|
1365
|
+
policyRuntime.stop();
|
|
1366
|
+
storageJobs.stop();
|
|
1367
|
+
sessionWatch.stop();
|
|
1017
1368
|
webhookDelivery?.stop();
|
|
1369
|
+
mediaLinks.revokeAll("the daemon stopped");
|
|
1018
1370
|
deliveredReceipts.stop();
|
|
1371
|
+
// The supervisor first, so the close that follows is read as a stop and not as a drop.
|
|
1372
|
+
socketHost.stop().catch(() => {});
|
|
1019
1373
|
try {
|
|
1020
1374
|
getApi().listener.stop();
|
|
1021
1375
|
} catch (e) {
|
|
@@ -1061,6 +1415,25 @@ export function registerListenCommand(program) {
|
|
|
1061
1415
|
lock: stageLock,
|
|
1062
1416
|
onStop: shutdown,
|
|
1063
1417
|
onStatus: () => health.snapshot(),
|
|
1418
|
+
// `policy set|unset`: applied here, so it counts at once (src/core/policy-store.js).
|
|
1419
|
+
onPolicy: servePolicyRequest,
|
|
1420
|
+
// `db purge`: this daemon is the account's one writer, so the purge runs here.
|
|
1421
|
+
onPurge: ({ dryRun }) => ({ report: storageJobs.runNow({ dryRun: dryRun !== false }) }),
|
|
1422
|
+
// `presence status|wake|park|resume`, and the fleet controller's relay.
|
|
1423
|
+
onPresence: (p) => daemonPresence.serve(p),
|
|
1424
|
+
// An upload or a sync stage holds the socket (refused while yielded or signed out).
|
|
1425
|
+
presenceGate: (o) => daemonPresence.admit(o),
|
|
1426
|
+
// `msg media --deliver link`: a link this daemon serves on 127.0.0.1 while it runs.
|
|
1427
|
+
onMediaLink: ({ msgId }) =>
|
|
1428
|
+
linkForCachedMessage({
|
|
1429
|
+
row: getMessageById(msgId),
|
|
1430
|
+
scope: scopeOfDir(accountDir),
|
|
1431
|
+
accountId: activeAcc.ownId,
|
|
1432
|
+
hidden: listenHiddenMode === "include" ? null : listenHidden,
|
|
1433
|
+
links: mediaLinks,
|
|
1434
|
+
ensureServed: ensureMediaServed,
|
|
1435
|
+
policy: listenMediaPolicy,
|
|
1436
|
+
}),
|
|
1064
1437
|
});
|
|
1065
1438
|
info(`Sync & upload channel ready on 127.0.0.1:${channel.port} — this socket is reused for both.`);
|
|
1066
1439
|
info("`zalo-agent sync` will run its socket stages here; it still needs your phone tap.");
|