@ardennguyen/zalo-agent-cli 2.5.9 → 3.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/.env.example +23 -2
- package/DISCLAIMER.md +3 -3
- package/LICENSE +2 -3
- package/NOTICE +14 -34
- package/README.md +166 -72
- package/package.json +37 -19
- package/src/commands/account.js +369 -40
- package/src/commands/auto-reply.js +8 -25
- package/src/commands/bank.js +25 -6
- package/src/commands/catalog.js +54 -11
- package/src/commands/cloud.js +459 -0
- package/src/commands/conv.js +470 -287
- package/src/commands/db.js +442 -0
- package/src/commands/fleet.js +449 -41
- package/src/commands/friend.js +198 -45
- package/src/commands/group.js +256 -43
- package/src/commands/label.js +16 -2
- package/src/commands/listen.js +495 -122
- package/src/commands/login.js +313 -117
- package/src/commands/mcp-approver.js +103 -0
- package/src/commands/mcp-webhook.js +13 -5
- package/src/commands/mcp.js +800 -104
- package/src/commands/msg-media.js +187 -0
- package/src/commands/msg-search.js +219 -0
- package/src/commands/msg.js +414 -110
- package/src/commands/oa/calls.js +134 -0
- package/src/commands/oa/content.js +266 -0
- package/src/commands/oa/gmf.js +429 -0
- package/src/commands/oa/messages.js +355 -0
- package/src/commands/oa/users.js +502 -0
- package/src/commands/oa-init.js +122 -123
- package/src/commands/oa-listen.js +374 -150
- package/src/commands/oa.js +83 -598
- package/src/commands/policy.js +224 -0
- package/src/commands/poll.js +3 -0
- package/src/commands/presence.js +175 -0
- package/src/commands/profile.js +45 -94
- package/src/commands/quick-msg.js +26 -0
- package/src/commands/read.js +172 -0
- package/src/commands/reminder.js +34 -4
- package/src/commands/social.js +223 -0
- package/src/commands/sync.js +482 -158
- package/src/commands/write.js +85 -0
- package/src/commands/zbs.js +502 -0
- package/src/core/account-devices.js +76 -0
- package/src/core/account-state.js +167 -0
- package/src/core/account-status.js +355 -0
- package/src/core/accounts.js +11 -4
- package/src/core/admin-api.js +392 -0
- package/src/core/approval.js +271 -0
- package/src/core/auto-reply.js +27 -0
- package/src/core/bank-accounts.js +1 -1
- package/src/core/block-sharing.js +43 -0
- package/src/core/board-pass.js +94 -0
- package/src/core/cached-message.js +78 -8
- package/src/core/cloud-plan.js +285 -0
- package/src/core/cloud-verify.js +305 -0
- package/src/core/confirm-guard.js +808 -0
- package/src/core/contact-names.js +504 -0
- package/src/core/control-events.js +525 -0
- package/src/core/control-replay.js +106 -0
- package/src/core/conversation-actions.js +214 -0
- package/src/core/credentials.js +112 -11
- package/src/core/current-user-names.js +60 -26
- package/src/core/daemon-channel.js +296 -15
- package/src/core/daemon-health.js +110 -7
- package/src/core/daemon-presence.js +455 -0
- package/src/core/daemon-sync.js +58 -18
- package/src/core/data-export.js +610 -0
- package/src/core/db-tools.js +473 -0
- package/src/core/db.js +1327 -83
- package/src/core/deploy-policy.js +560 -0
- package/src/core/device-since.js +123 -0
- package/src/core/e2ee-notice.js +41 -0
- package/src/core/exit-codes.js +7 -0
- package/src/core/export-crypt.js +290 -0
- package/src/core/fleet-controller.js +340 -0
- package/src/core/fleet-purge.js +144 -0
- package/src/core/fleet-qr.js +273 -0
- package/src/core/fleet-serve.js +292 -0
- package/src/core/fleet-supervisor.js +176 -0
- package/src/core/fleet-templates.js +568 -39
- package/src/core/fleet.js +232 -20
- package/src/core/friend-requests.js +80 -16
- package/src/core/friend-search.js +1 -1
- package/src/core/group-admin.js +2 -29
- package/src/core/group-departure.js +233 -0
- package/src/core/group-exit.js +621 -0
- package/src/core/group-members.js +21 -9
- package/src/core/group-settings.js +5 -207
- package/src/core/hidden-chat-actions.js +96 -0
- package/src/core/hidden-chats.js +425 -0
- package/src/core/history-fetch.js +81 -27
- package/src/core/keystore/config.js +163 -0
- package/src/core/keystore/container.js +208 -0
- package/src/core/keystore/index.js +483 -0
- package/src/core/keystore/keyring.js +588 -0
- package/src/core/keystore/kms.js +157 -0
- package/src/core/keystore/media-seal.js +711 -0
- package/src/core/keystore/providers.js +492 -0
- package/src/core/keystore/stores.js +177 -0
- package/src/core/keystore/worker.js +80 -0
- package/src/core/kick-marker.js +61 -0
- package/src/core/last-online.js +236 -0
- package/src/core/list-all.js +280 -0
- package/src/core/listener-lifecycle.js +101 -10
- package/src/core/live-api.js +1 -1
- package/src/core/live-store.js +111 -53
- package/src/core/local-reads.js +16 -0
- package/src/core/logout.js +102 -140
- package/src/core/media-deliver.js +732 -0
- package/src/core/media-route.js +347 -0
- package/src/core/media-store.js +408 -0
- package/src/core/mutual-groups.js +94 -0
- package/src/core/name-refresh.js +135 -0
- package/src/core/oa/calls.js +212 -0
- package/src/core/oa/content.js +390 -0
- package/src/core/oa/gmf.js +537 -0
- package/src/core/oa/messages.js +470 -0
- package/src/core/oa/oauth.js +422 -0
- package/src/core/oa/transport.js +645 -0
- package/src/core/oa/users.js +694 -0
- package/src/core/oa-client.js +49 -415
- package/src/core/overflow-repair.js +221 -0
- package/src/core/policy-layer.js +55 -0
- package/src/core/policy-schema.js +401 -0
- package/src/core/policy-store.js +1058 -0
- package/src/core/presence-config.js +100 -0
- package/src/core/presence-leases.js +211 -0
- package/src/core/presence.js +688 -0
- package/src/core/profile-settings.js +243 -0
- package/src/core/qr-login-flow.js +237 -0
- package/src/core/read-state.js +145 -22
- package/src/core/receipts.js +355 -548
- package/src/core/recent-conversations.js +28 -6
- package/src/core/row-mac.js +405 -0
- package/src/core/search.js +271 -0
- package/src/core/secure-page.js +771 -0
- package/src/core/self-heal.js +493 -34
- package/src/core/session-expiry.js +103 -0
- package/src/core/session-notice.js +249 -0
- package/src/core/social/client.js +296 -0
- package/src/core/social/dpop.js +54 -0
- package/src/core/socket-host.js +437 -0
- package/src/core/sqlite.js +520 -0
- package/src/core/startup-gate.js +49 -5
- package/src/core/storage-quota.js +796 -0
- package/src/core/sync-action.js +180 -0
- package/src/core/sync-v2/auto-sync.js +356 -0
- package/src/core/sync-v2/board.js +130 -92
- package/src/core/sync-v2/conv-state.js +21 -4
- package/src/core/sync-v2/gap-advice.js +2 -3
- package/src/core/sync-v2/index.js +739 -323
- package/src/core/sync-v2/media.js +116 -27
- package/src/core/sync-v2/plan.js +16 -2
- package/src/core/sync-v2/ranges.js +98 -0
- package/src/core/sync-v2/reactions.js +12 -196
- package/src/core/sync-v2/senders.js +32 -14
- package/src/core/sync-v2/zcloud.js +177 -579
- package/src/core/sync.js +23 -21
- package/src/core/test-fake-session.js +87 -0
- package/src/core/typing.js +78 -0
- package/src/core/unknown-acts.js +240 -0
- package/src/core/voice-text.js +171 -0
- package/src/core/webhook-outbox.js +110 -12
- package/src/core/zalo-client.js +147 -188
- package/src/core/zbs/api.js +505 -0
- package/src/core/zbs/image.js +85 -0
- package/src/core/zbs/phone.js +59 -0
- package/src/core/zbs/rsa.js +129 -0
- package/src/core/zbs/template-check.js +449 -0
- package/src/index.js +60 -10
- package/src/mcp/action-tool.js +188 -0
- package/src/mcp/actions-business.js +488 -0
- package/src/mcp/actions-conversation.js +633 -0
- package/src/mcp/actions-media.js +268 -0
- package/src/mcp/actions-profile.js +281 -0
- package/src/mcp/actions-social.js +518 -0
- package/src/mcp/instructions.js +19 -5
- package/src/mcp/mcp-config.js +112 -10
- package/src/mcp/mcp-http-transport.js +162 -25
- package/src/mcp/mcp-server.js +14 -3
- package/src/mcp/mcp-tools.js +1686 -384
- package/src/mcp/message-buffer.js +58 -12
- package/src/mcp/notifier.js +1 -1
- package/src/mcp/official-tool.js +298 -0
- package/src/mcp/sync-jobs.js +7 -1
- package/src/mcp/sync-stages.js +72 -0
- package/src/mcp/thread-name-cache.js +43 -5
- package/src/mcp/tool-presence.js +153 -0
- package/src/mcp/wait-batch.js +27 -0
- package/src/mcp/wait-result.js +19 -21
- package/src/utils/bank-helpers.js +52 -1
- package/src/utils/cli-args.js +12 -12
- package/src/utils/date-range.js +50 -0
- package/src/utils/hidden-access.js +141 -0
- package/src/utils/interrupt.js +37 -0
- package/src/utils/json-input.js +41 -0
- package/src/utils/list-replies.js +60 -0
- package/src/utils/my-documents.js +2 -3
- package/src/utils/output.js +66 -2
- package/src/utils/qr-display.js +14 -8
- package/src/utils/qr-http-server.js +674 -134
- package/src/utils/quote.js +8 -8
- package/src/utils/secret-input.js +57 -0
- package/src/utils/vn-text.js +72 -0
- package/src/zalo/README.md +46 -0
- package/src/zalo/anomaly-store.js +49 -0
- package/src/zalo/api/actions.js +670 -0
- package/src/zalo/api/boards.js +1036 -0
- package/src/zalo/api/business.js +662 -0
- package/src/zalo/api/conversations.js +329 -0
- package/src/zalo/api/groups.js +631 -0
- package/src/zalo/api/messages.js +695 -0
- package/src/zalo/api/people.js +711 -0
- package/src/zalo/api/profile.js +374 -0
- package/src/zalo/api/session.js +45 -0
- package/src/zalo/api/upload.js +976 -0
- package/src/zalo/api.js +117 -0
- package/src/zalo/client.js +206 -0
- package/src/zalo/custom/forward.js +199 -0
- package/src/zalo/custom/gid.js +123 -0
- package/src/zalo/custom/group-history.js +246 -0
- package/src/zalo/custom/group-invite.js +53 -0
- package/src/zalo/custom/group-settings.js +186 -0
- package/src/zalo/custom/group-visibility.js +71 -0
- package/src/zalo/custom/pin.js +220 -0
- package/src/zalo/custom/renewlink.js +115 -0
- package/src/zalo/device-fingerprint.js +33 -0
- package/src/zalo/download-fetch.js +45 -0
- package/src/zalo/enums.js +25 -0
- package/src/zalo/errors.js +195 -0
- package/src/zalo/format/mentions.js +140 -0
- package/src/zalo/format/split-message.js +222 -0
- package/src/zalo/format/urgency.js +29 -0
- package/src/zalo/headers.js +93 -0
- package/src/zalo/index.js +72 -0
- package/src/zalo/kernel/atomic-file.js +217 -0
- package/src/zalo/kernel/bound.js +46 -0
- package/src/zalo/kernel/cipher.js +88 -0
- package/src/zalo/kernel/cookies.js +125 -0
- package/src/zalo/kernel/endpoint.js +211 -0
- package/src/zalo/kernel/http.js +360 -0
- package/src/zalo/kernel/json-ids.js +118 -0
- package/src/zalo/kernel/login-cipher.js +165 -0
- package/src/zalo/kernel/secret-file.js +45 -0
- package/src/zalo/kernel/session.js +261 -0
- package/src/zalo/kernel/zcloud-cipher.js +83 -0
- package/src/zalo/kickout.js +136 -0
- package/src/zalo/listener/dispatch.js +404 -0
- package/src/zalo/listener/frames.js +222 -0
- package/src/zalo/listener/friend-events.js +113 -0
- package/src/zalo/listener/group-events.js +117 -0
- package/src/zalo/listener/keepalive.js +191 -0
- package/src/zalo/listener/listener.js +469 -0
- package/src/zalo/listener/models.js +220 -0
- package/src/zalo/listener/reactions.js +224 -0
- package/src/zalo/listener/socket-tap.js +228 -0
- package/src/zalo/login.js +387 -0
- package/src/zalo/logout.js +192 -0
- package/src/zalo/maintenance.js +183 -0
- package/src/zalo/official-logout.js +254 -0
- package/src/zalo/paging.js +114 -0
- package/src/zalo/profile.js +184 -0
- package/src/zalo/pulls.js +129 -0
- package/src/zalo/qr-image.js +90 -0
- package/src/zalo/qr-login.js +494 -0
- package/src/zalo/queues/control-queue.js +193 -0
- package/src/zalo/queues/offline-queue.js +275 -0
- package/src/zalo/queues/queue-verify.js +306 -0
- package/src/zalo/reads.js +723 -0
- package/src/zalo/receipts.js +550 -0
- package/src/zalo/req-id.js +24 -0
- package/src/zalo/retry.js +343 -0
- package/src/zalo/session-call.js +55 -0
- package/src/zalo/socket.js +762 -0
- package/src/zalo/transfer-sync/assets.js +181 -0
- package/src/zalo/transfer-sync/channel.js +459 -0
- package/src/zalo/transfer-sync/download.js +161 -0
- package/src/zalo/transfer-sync/message-types.js +520 -0
- package/src/zalo/transfer-sync/transfer.js +468 -0
- package/src/zalo/trust-store.js +99 -0
- package/src/zalo/trust-wasm.js +393 -0
- package/src/zalo/upkeep.js +127 -0
- package/src/zalo/web-call.js +103 -0
- package/src/zalo/writes.js +704 -0
- package/src/zalo/zcloud-e2ee.js +214 -0
- package/src/zalo/zcloud.js +802 -0
- package/node_modules/asynckit/LICENSE +0 -21
- package/node_modules/asynckit/README.md +0 -233
- package/node_modules/asynckit/bench.js +0 -76
- package/node_modules/asynckit/index.js +0 -6
- package/node_modules/asynckit/lib/abort.js +0 -29
- package/node_modules/asynckit/lib/async.js +0 -34
- package/node_modules/asynckit/lib/defer.js +0 -26
- package/node_modules/asynckit/lib/iterate.js +0 -75
- package/node_modules/asynckit/lib/readable_asynckit.js +0 -91
- package/node_modules/asynckit/lib/readable_parallel.js +0 -25
- package/node_modules/asynckit/lib/readable_serial.js +0 -25
- package/node_modules/asynckit/lib/readable_serial_ordered.js +0 -29
- package/node_modules/asynckit/lib/state.js +0 -37
- package/node_modules/asynckit/lib/streamify.js +0 -141
- package/node_modules/asynckit/lib/terminator.js +0 -29
- package/node_modules/asynckit/package.json +0 -63
- package/node_modules/asynckit/parallel.js +0 -43
- package/node_modules/asynckit/serial.js +0 -17
- package/node_modules/asynckit/serialOrdered.js +0 -75
- package/node_modules/asynckit/stream.js +0 -21
- package/node_modules/bignumber.js/CHANGELOG.md +0 -381
- package/node_modules/bignumber.js/LICENCE.md +0 -26
- package/node_modules/bignumber.js/README.md +0 -289
- package/node_modules/bignumber.js/bignumber.d.mts +0 -6
- package/node_modules/bignumber.js/bignumber.d.ts +0 -5
- package/node_modules/bignumber.js/bignumber.js +0 -2922
- package/node_modules/bignumber.js/bignumber.mjs +0 -2907
- package/node_modules/bignumber.js/doc/API.html +0 -2249
- package/node_modules/bignumber.js/package.json +0 -60
- package/node_modules/bignumber.js/types.d.ts +0 -1821
- package/node_modules/call-bind-apply-helpers/.eslintrc +0 -17
- package/node_modules/call-bind-apply-helpers/.github/FUNDING.yml +0 -12
- package/node_modules/call-bind-apply-helpers/.nycrc +0 -9
- package/node_modules/call-bind-apply-helpers/CHANGELOG.md +0 -30
- package/node_modules/call-bind-apply-helpers/LICENSE +0 -21
- package/node_modules/call-bind-apply-helpers/README.md +0 -62
- package/node_modules/call-bind-apply-helpers/actualApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/actualApply.js +0 -10
- package/node_modules/call-bind-apply-helpers/applyBind.d.ts +0 -19
- package/node_modules/call-bind-apply-helpers/applyBind.js +0 -10
- package/node_modules/call-bind-apply-helpers/functionApply.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/functionCall.d.ts +0 -1
- package/node_modules/call-bind-apply-helpers/functionCall.js +0 -4
- package/node_modules/call-bind-apply-helpers/index.d.ts +0 -64
- package/node_modules/call-bind-apply-helpers/index.js +0 -15
- package/node_modules/call-bind-apply-helpers/package.json +0 -85
- package/node_modules/call-bind-apply-helpers/reflectApply.d.ts +0 -3
- package/node_modules/call-bind-apply-helpers/reflectApply.js +0 -4
- package/node_modules/call-bind-apply-helpers/test/index.js +0 -63
- package/node_modules/call-bind-apply-helpers/tsconfig.json +0 -9
- package/node_modules/combined-stream/License +0 -19
- package/node_modules/combined-stream/Readme.md +0 -138
- package/node_modules/combined-stream/lib/combined_stream.js +0 -208
- package/node_modules/combined-stream/package.json +0 -25
- package/node_modules/crypto-js/CONTRIBUTING.md +0 -28
- package/node_modules/crypto-js/LICENSE +0 -24
- package/node_modules/crypto-js/README.md +0 -275
- package/node_modules/crypto-js/aes.js +0 -234
- package/node_modules/crypto-js/blowfish.js +0 -471
- package/node_modules/crypto-js/bower.json +0 -39
- package/node_modules/crypto-js/cipher-core.js +0 -895
- package/node_modules/crypto-js/core.js +0 -807
- package/node_modules/crypto-js/crypto-js.js +0 -6657
- package/node_modules/crypto-js/docs/QuickStartGuide.wiki +0 -470
- package/node_modules/crypto-js/enc-base64.js +0 -136
- package/node_modules/crypto-js/enc-base64url.js +0 -148
- package/node_modules/crypto-js/enc-hex.js +0 -18
- package/node_modules/crypto-js/enc-latin1.js +0 -18
- package/node_modules/crypto-js/enc-utf16.js +0 -149
- package/node_modules/crypto-js/enc-utf8.js +0 -18
- package/node_modules/crypto-js/evpkdf.js +0 -134
- package/node_modules/crypto-js/format-hex.js +0 -66
- package/node_modules/crypto-js/format-openssl.js +0 -18
- package/node_modules/crypto-js/hmac-md5.js +0 -18
- package/node_modules/crypto-js/hmac-ripemd160.js +0 -18
- package/node_modules/crypto-js/hmac-sha1.js +0 -18
- package/node_modules/crypto-js/hmac-sha224.js +0 -18
- package/node_modules/crypto-js/hmac-sha256.js +0 -18
- package/node_modules/crypto-js/hmac-sha3.js +0 -18
- package/node_modules/crypto-js/hmac-sha384.js +0 -18
- package/node_modules/crypto-js/hmac-sha512.js +0 -18
- package/node_modules/crypto-js/hmac.js +0 -143
- package/node_modules/crypto-js/index.js +0 -18
- package/node_modules/crypto-js/lib-typedarrays.js +0 -76
- package/node_modules/crypto-js/md5.js +0 -268
- package/node_modules/crypto-js/mode-cfb.js +0 -80
- package/node_modules/crypto-js/mode-ctr-gladman.js +0 -116
- package/node_modules/crypto-js/mode-ctr.js +0 -58
- package/node_modules/crypto-js/mode-ecb.js +0 -40
- package/node_modules/crypto-js/mode-ofb.js +0 -54
- package/node_modules/crypto-js/package.json +0 -42
- package/node_modules/crypto-js/pad-ansix923.js +0 -49
- package/node_modules/crypto-js/pad-iso10126.js +0 -44
- package/node_modules/crypto-js/pad-iso97971.js +0 -40
- package/node_modules/crypto-js/pad-nopadding.js +0 -30
- package/node_modules/crypto-js/pad-pkcs7.js +0 -18
- package/node_modules/crypto-js/pad-zeropadding.js +0 -47
- package/node_modules/crypto-js/pbkdf2.js +0 -145
- package/node_modules/crypto-js/rabbit-legacy.js +0 -190
- package/node_modules/crypto-js/rabbit.js +0 -192
- package/node_modules/crypto-js/rc4.js +0 -139
- package/node_modules/crypto-js/ripemd160.js +0 -267
- package/node_modules/crypto-js/sha1.js +0 -150
- package/node_modules/crypto-js/sha224.js +0 -80
- package/node_modules/crypto-js/sha256.js +0 -199
- package/node_modules/crypto-js/sha3.js +0 -326
- package/node_modules/crypto-js/sha384.js +0 -83
- package/node_modules/crypto-js/sha512.js +0 -326
- package/node_modules/crypto-js/tripledes.js +0 -779
- package/node_modules/crypto-js/x64-core.js +0 -304
- package/node_modules/delayed-stream/.npmignore +0 -1
- package/node_modules/delayed-stream/License +0 -19
- package/node_modules/delayed-stream/Makefile +0 -7
- package/node_modules/delayed-stream/Readme.md +0 -141
- package/node_modules/delayed-stream/lib/delayed_stream.js +0 -107
- package/node_modules/delayed-stream/package.json +0 -27
- package/node_modules/dunder-proto/.eslintrc +0 -5
- package/node_modules/dunder-proto/.github/FUNDING.yml +0 -12
- package/node_modules/dunder-proto/.nycrc +0 -13
- package/node_modules/dunder-proto/CHANGELOG.md +0 -24
- package/node_modules/dunder-proto/LICENSE +0 -21
- package/node_modules/dunder-proto/README.md +0 -54
- package/node_modules/dunder-proto/get.d.ts +0 -5
- package/node_modules/dunder-proto/get.js +0 -30
- package/node_modules/dunder-proto/package.json +0 -76
- package/node_modules/dunder-proto/set.d.ts +0 -5
- package/node_modules/dunder-proto/set.js +0 -35
- package/node_modules/dunder-proto/test/get.js +0 -34
- package/node_modules/dunder-proto/test/index.js +0 -4
- package/node_modules/dunder-proto/test/set.js +0 -50
- package/node_modules/dunder-proto/tsconfig.json +0 -9
- package/node_modules/es-define-property/.eslintrc +0 -13
- package/node_modules/es-define-property/.github/FUNDING.yml +0 -12
- package/node_modules/es-define-property/.nycrc +0 -9
- package/node_modules/es-define-property/CHANGELOG.md +0 -29
- package/node_modules/es-define-property/LICENSE +0 -21
- package/node_modules/es-define-property/README.md +0 -49
- package/node_modules/es-define-property/index.d.ts +0 -3
- package/node_modules/es-define-property/index.js +0 -14
- package/node_modules/es-define-property/package.json +0 -81
- package/node_modules/es-define-property/test/index.js +0 -56
- package/node_modules/es-define-property/tsconfig.json +0 -10
- package/node_modules/es-errors/.eslintrc +0 -5
- package/node_modules/es-errors/.github/FUNDING.yml +0 -12
- package/node_modules/es-errors/CHANGELOG.md +0 -40
- package/node_modules/es-errors/LICENSE +0 -21
- package/node_modules/es-errors/README.md +0 -55
- package/node_modules/es-errors/eval.d.ts +0 -3
- package/node_modules/es-errors/eval.js +0 -4
- package/node_modules/es-errors/index.d.ts +0 -3
- package/node_modules/es-errors/index.js +0 -4
- package/node_modules/es-errors/package.json +0 -80
- package/node_modules/es-errors/range.d.ts +0 -3
- package/node_modules/es-errors/range.js +0 -4
- package/node_modules/es-errors/ref.d.ts +0 -3
- package/node_modules/es-errors/ref.js +0 -4
- package/node_modules/es-errors/syntax.d.ts +0 -3
- package/node_modules/es-errors/syntax.js +0 -4
- package/node_modules/es-errors/test/index.js +0 -19
- package/node_modules/es-errors/tsconfig.json +0 -49
- package/node_modules/es-errors/type.d.ts +0 -3
- package/node_modules/es-errors/type.js +0 -4
- package/node_modules/es-errors/uri.d.ts +0 -3
- package/node_modules/es-errors/uri.js +0 -4
- package/node_modules/es-object-atoms/.eslintrc +0 -16
- package/node_modules/es-object-atoms/.github/FUNDING.yml +0 -12
- package/node_modules/es-object-atoms/CHANGELOG.md +0 -44
- package/node_modules/es-object-atoms/LICENSE +0 -21
- package/node_modules/es-object-atoms/README.md +0 -63
- package/node_modules/es-object-atoms/RequireObjectCoercible.d.ts +0 -3
- package/node_modules/es-object-atoms/RequireObjectCoercible.js +0 -11
- package/node_modules/es-object-atoms/ToObject.d.ts +0 -7
- package/node_modules/es-object-atoms/ToObject.js +0 -10
- package/node_modules/es-object-atoms/index.d.ts +0 -3
- package/node_modules/es-object-atoms/index.js +0 -4
- package/node_modules/es-object-atoms/isObject.d.ts +0 -3
- package/node_modules/es-object-atoms/isObject.js +0 -6
- package/node_modules/es-object-atoms/package.json +0 -79
- package/node_modules/es-object-atoms/test/index.js +0 -38
- package/node_modules/es-object-atoms/tsconfig.json +0 -7
- package/node_modules/es-set-tostringtag/.eslintrc +0 -13
- package/node_modules/es-set-tostringtag/.nycrc +0 -9
- package/node_modules/es-set-tostringtag/CHANGELOG.md +0 -67
- package/node_modules/es-set-tostringtag/LICENSE +0 -21
- package/node_modules/es-set-tostringtag/README.md +0 -53
- package/node_modules/es-set-tostringtag/index.d.ts +0 -10
- package/node_modules/es-set-tostringtag/index.js +0 -35
- package/node_modules/es-set-tostringtag/package.json +0 -78
- package/node_modules/es-set-tostringtag/test/index.js +0 -85
- package/node_modules/es-set-tostringtag/tsconfig.json +0 -9
- package/node_modules/form-data/CHANGELOG.md +0 -686
- package/node_modules/form-data/License +0 -19
- package/node_modules/form-data/README.md +0 -355
- package/node_modules/form-data/index.d.ts +0 -62
- package/node_modules/form-data/lib/browser.js +0 -4
- package/node_modules/form-data/lib/form_data.js +0 -506
- package/node_modules/form-data/lib/populate.js +0 -10
- package/node_modules/form-data/node_modules/mime-db/HISTORY.md +0 -507
- package/node_modules/form-data/node_modules/mime-db/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-db/README.md +0 -100
- package/node_modules/form-data/node_modules/mime-db/db.json +0 -8519
- package/node_modules/form-data/node_modules/mime-db/index.js +0 -12
- package/node_modules/form-data/node_modules/mime-db/package.json +0 -60
- package/node_modules/form-data/node_modules/mime-types/HISTORY.md +0 -397
- package/node_modules/form-data/node_modules/mime-types/LICENSE +0 -23
- package/node_modules/form-data/node_modules/mime-types/README.md +0 -113
- package/node_modules/form-data/node_modules/mime-types/index.js +0 -188
- package/node_modules/form-data/node_modules/mime-types/package.json +0 -44
- package/node_modules/form-data/package.json +0 -82
- package/node_modules/function-bind/.eslintrc +0 -21
- package/node_modules/function-bind/.github/FUNDING.yml +0 -12
- package/node_modules/function-bind/.github/SECURITY.md +0 -3
- package/node_modules/function-bind/.nycrc +0 -13
- package/node_modules/function-bind/CHANGELOG.md +0 -136
- package/node_modules/function-bind/LICENSE +0 -20
- package/node_modules/function-bind/README.md +0 -46
- package/node_modules/function-bind/implementation.js +0 -84
- package/node_modules/function-bind/index.js +0 -5
- package/node_modules/function-bind/package.json +0 -87
- package/node_modules/function-bind/test/.eslintrc +0 -9
- package/node_modules/function-bind/test/index.js +0 -252
- package/node_modules/get-intrinsic/.eslintrc +0 -42
- package/node_modules/get-intrinsic/.github/FUNDING.yml +0 -12
- package/node_modules/get-intrinsic/.nycrc +0 -9
- package/node_modules/get-intrinsic/CHANGELOG.md +0 -186
- package/node_modules/get-intrinsic/LICENSE +0 -21
- package/node_modules/get-intrinsic/README.md +0 -71
- package/node_modules/get-intrinsic/index.js +0 -378
- package/node_modules/get-intrinsic/package.json +0 -97
- package/node_modules/get-intrinsic/test/GetIntrinsic.js +0 -274
- package/node_modules/get-proto/.eslintrc +0 -10
- package/node_modules/get-proto/.github/FUNDING.yml +0 -12
- package/node_modules/get-proto/.nycrc +0 -9
- package/node_modules/get-proto/CHANGELOG.md +0 -21
- package/node_modules/get-proto/LICENSE +0 -21
- package/node_modules/get-proto/Object.getPrototypeOf.d.ts +0 -5
- package/node_modules/get-proto/Object.getPrototypeOf.js +0 -6
- package/node_modules/get-proto/README.md +0 -50
- package/node_modules/get-proto/Reflect.getPrototypeOf.d.ts +0 -3
- package/node_modules/get-proto/Reflect.getPrototypeOf.js +0 -4
- package/node_modules/get-proto/index.d.ts +0 -5
- package/node_modules/get-proto/index.js +0 -27
- package/node_modules/get-proto/package.json +0 -81
- package/node_modules/get-proto/test/index.js +0 -68
- package/node_modules/get-proto/tsconfig.json +0 -9
- package/node_modules/gopd/.eslintrc +0 -16
- package/node_modules/gopd/.github/FUNDING.yml +0 -12
- package/node_modules/gopd/CHANGELOG.md +0 -45
- package/node_modules/gopd/LICENSE +0 -21
- package/node_modules/gopd/README.md +0 -40
- package/node_modules/gopd/gOPD.d.ts +0 -1
- package/node_modules/gopd/gOPD.js +0 -4
- package/node_modules/gopd/index.d.ts +0 -5
- package/node_modules/gopd/index.js +0 -15
- package/node_modules/gopd/package.json +0 -77
- package/node_modules/gopd/test/index.js +0 -36
- package/node_modules/gopd/tsconfig.json +0 -9
- package/node_modules/has-symbols/.eslintrc +0 -11
- package/node_modules/has-symbols/.github/FUNDING.yml +0 -12
- package/node_modules/has-symbols/.nycrc +0 -9
- package/node_modules/has-symbols/CHANGELOG.md +0 -91
- package/node_modules/has-symbols/LICENSE +0 -21
- package/node_modules/has-symbols/README.md +0 -46
- package/node_modules/has-symbols/index.d.ts +0 -3
- package/node_modules/has-symbols/index.js +0 -14
- package/node_modules/has-symbols/package.json +0 -111
- package/node_modules/has-symbols/shams.d.ts +0 -3
- package/node_modules/has-symbols/shams.js +0 -45
- package/node_modules/has-symbols/test/index.js +0 -22
- package/node_modules/has-symbols/test/shams/core-js.js +0 -29
- package/node_modules/has-symbols/test/shams/get-own-property-symbols.js +0 -29
- package/node_modules/has-symbols/test/tests.js +0 -58
- package/node_modules/has-symbols/tsconfig.json +0 -10
- package/node_modules/has-tostringtag/.eslintrc +0 -5
- package/node_modules/has-tostringtag/.github/FUNDING.yml +0 -12
- package/node_modules/has-tostringtag/.nycrc +0 -13
- package/node_modules/has-tostringtag/CHANGELOG.md +0 -42
- package/node_modules/has-tostringtag/LICENSE +0 -21
- package/node_modules/has-tostringtag/README.md +0 -46
- package/node_modules/has-tostringtag/index.d.ts +0 -3
- package/node_modules/has-tostringtag/index.js +0 -8
- package/node_modules/has-tostringtag/package.json +0 -108
- package/node_modules/has-tostringtag/shams.d.ts +0 -3
- package/node_modules/has-tostringtag/shams.js +0 -8
- package/node_modules/has-tostringtag/test/index.js +0 -21
- package/node_modules/has-tostringtag/test/shams/core-js.js +0 -31
- package/node_modules/has-tostringtag/test/shams/get-own-property-symbols.js +0 -30
- package/node_modules/has-tostringtag/test/tests.js +0 -15
- package/node_modules/has-tostringtag/tsconfig.json +0 -49
- package/node_modules/hasown/.github/FUNDING.yml +0 -12
- package/node_modules/hasown/.nycrc +0 -13
- package/node_modules/hasown/CHANGELOG.md +0 -58
- package/node_modules/hasown/LICENSE +0 -21
- package/node_modules/hasown/README.md +0 -40
- package/node_modules/hasown/eslint.config.mjs +0 -6
- package/node_modules/hasown/index.d.ts +0 -3
- package/node_modules/hasown/index.js +0 -8
- package/node_modules/hasown/package.json +0 -91
- package/node_modules/hasown/tsconfig.json +0 -6
- package/node_modules/json-bigint/LICENSE +0 -20
- package/node_modules/json-bigint/README.md +0 -240
- package/node_modules/json-bigint/index.js +0 -12
- package/node_modules/json-bigint/lib/parse.js +0 -443
- package/node_modules/json-bigint/lib/stringify.js +0 -384
- package/node_modules/json-bigint/package.json +0 -34
- package/node_modules/math-intrinsics/.eslintrc +0 -16
- package/node_modules/math-intrinsics/.github/FUNDING.yml +0 -12
- package/node_modules/math-intrinsics/CHANGELOG.md +0 -24
- package/node_modules/math-intrinsics/LICENSE +0 -21
- package/node_modules/math-intrinsics/README.md +0 -50
- package/node_modules/math-intrinsics/abs.d.ts +0 -1
- package/node_modules/math-intrinsics/abs.js +0 -4
- package/node_modules/math-intrinsics/constants/maxArrayLength.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxArrayLength.js +0 -4
- package/node_modules/math-intrinsics/constants/maxSafeInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxSafeInteger.js +0 -5
- package/node_modules/math-intrinsics/constants/maxValue.d.ts +0 -3
- package/node_modules/math-intrinsics/constants/maxValue.js +0 -5
- package/node_modules/math-intrinsics/floor.d.ts +0 -1
- package/node_modules/math-intrinsics/floor.js +0 -4
- package/node_modules/math-intrinsics/isFinite.d.ts +0 -3
- package/node_modules/math-intrinsics/isFinite.js +0 -12
- package/node_modules/math-intrinsics/isInteger.d.ts +0 -3
- package/node_modules/math-intrinsics/isInteger.js +0 -16
- package/node_modules/math-intrinsics/isNaN.d.ts +0 -1
- package/node_modules/math-intrinsics/isNaN.js +0 -6
- package/node_modules/math-intrinsics/isNegativeZero.d.ts +0 -3
- package/node_modules/math-intrinsics/isNegativeZero.js +0 -6
- package/node_modules/math-intrinsics/max.d.ts +0 -1
- package/node_modules/math-intrinsics/max.js +0 -4
- package/node_modules/math-intrinsics/min.d.ts +0 -1
- package/node_modules/math-intrinsics/min.js +0 -4
- package/node_modules/math-intrinsics/mod.d.ts +0 -3
- package/node_modules/math-intrinsics/mod.js +0 -9
- package/node_modules/math-intrinsics/package.json +0 -86
- package/node_modules/math-intrinsics/pow.d.ts +0 -1
- package/node_modules/math-intrinsics/pow.js +0 -4
- package/node_modules/math-intrinsics/round.d.ts +0 -1
- package/node_modules/math-intrinsics/round.js +0 -4
- package/node_modules/math-intrinsics/sign.d.ts +0 -3
- package/node_modules/math-intrinsics/sign.js +0 -11
- package/node_modules/math-intrinsics/test/index.js +0 -192
- package/node_modules/math-intrinsics/tsconfig.json +0 -3
- package/node_modules/pako/LICENSE +0 -21
- package/node_modules/pako/README.md +0 -155
- package/node_modules/pako/dist/pako.es5.js +0 -6760
- package/node_modules/pako/dist/pako.es5.min.js +0 -2
- package/node_modules/pako/dist/pako.esm.mjs +0 -6945
- package/node_modules/pako/dist/pako.js +0 -6964
- package/node_modules/pako/dist/pako.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.es5.js +0 -3953
- package/node_modules/pako/dist/pako_deflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_deflate.js +0 -4154
- package/node_modules/pako/dist/pako_deflate.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.es5.js +0 -3272
- package/node_modules/pako/dist/pako_inflate.es5.min.js +0 -2
- package/node_modules/pako/dist/pako_inflate.js +0 -3279
- package/node_modules/pako/dist/pako_inflate.min.js +0 -2
- package/node_modules/pako/index.js +0 -18
- package/node_modules/pako/lib/deflate.js +0 -387
- package/node_modules/pako/lib/inflate.js +0 -456
- package/node_modules/pako/lib/utils/common.js +0 -48
- package/node_modules/pako/lib/utils/strings.js +0 -174
- package/node_modules/pako/lib/zlib/README +0 -59
- package/node_modules/pako/lib/zlib/adler32.js +0 -51
- package/node_modules/pako/lib/zlib/constants.js +0 -68
- package/node_modules/pako/lib/zlib/crc32.js +0 -59
- package/node_modules/pako/lib/zlib/deflate.js +0 -2069
- package/node_modules/pako/lib/zlib/gzheader.js +0 -58
- package/node_modules/pako/lib/zlib/inffast.js +0 -344
- package/node_modules/pako/lib/zlib/inflate.js +0 -1575
- package/node_modules/pako/lib/zlib/inftrees.js +0 -340
- package/node_modules/pako/lib/zlib/messages.js +0 -32
- package/node_modules/pako/lib/zlib/trees.js +0 -1179
- package/node_modules/pako/lib/zlib/zstream.js +0 -47
- package/node_modules/pako/package.json +0 -73
- package/node_modules/semver/LICENSE +0 -15
- package/node_modules/semver/README.md +0 -680
- package/node_modules/semver/bin/semver.js +0 -195
- package/node_modules/semver/classes/comparator.js +0 -143
- package/node_modules/semver/classes/index.js +0 -7
- package/node_modules/semver/classes/range.js +0 -577
- package/node_modules/semver/classes/semver.js +0 -350
- package/node_modules/semver/functions/clean.js +0 -8
- package/node_modules/semver/functions/cmp.js +0 -54
- package/node_modules/semver/functions/coerce.js +0 -62
- package/node_modules/semver/functions/compare-build.js +0 -9
- package/node_modules/semver/functions/compare-loose.js +0 -5
- package/node_modules/semver/functions/compare.js +0 -7
- package/node_modules/semver/functions/diff.js +0 -60
- package/node_modules/semver/functions/eq.js +0 -5
- package/node_modules/semver/functions/gt.js +0 -5
- package/node_modules/semver/functions/gte.js +0 -5
- package/node_modules/semver/functions/inc.js +0 -21
- package/node_modules/semver/functions/lt.js +0 -5
- package/node_modules/semver/functions/lte.js +0 -5
- package/node_modules/semver/functions/major.js +0 -5
- package/node_modules/semver/functions/minor.js +0 -5
- package/node_modules/semver/functions/neq.js +0 -5
- package/node_modules/semver/functions/parse.js +0 -18
- package/node_modules/semver/functions/patch.js +0 -5
- package/node_modules/semver/functions/prerelease.js +0 -8
- package/node_modules/semver/functions/rcompare.js +0 -5
- package/node_modules/semver/functions/rsort.js +0 -5
- package/node_modules/semver/functions/satisfies.js +0 -12
- package/node_modules/semver/functions/sort.js +0 -5
- package/node_modules/semver/functions/truncate.js +0 -48
- package/node_modules/semver/functions/valid.js +0 -8
- package/node_modules/semver/index.js +0 -93
- package/node_modules/semver/internal/constants.js +0 -37
- package/node_modules/semver/internal/debug.js +0 -11
- package/node_modules/semver/internal/identifiers.js +0 -29
- package/node_modules/semver/internal/lrucache.js +0 -42
- package/node_modules/semver/internal/parse-options.js +0 -17
- package/node_modules/semver/internal/re.js +0 -223
- package/node_modules/semver/package.json +0 -78
- package/node_modules/semver/preload.js +0 -4
- package/node_modules/semver/range.bnf +0 -17
- package/node_modules/semver/ranges/gtr.js +0 -6
- package/node_modules/semver/ranges/intersects.js +0 -9
- package/node_modules/semver/ranges/ltr.js +0 -6
- package/node_modules/semver/ranges/max-satisfying.js +0 -27
- package/node_modules/semver/ranges/min-satisfying.js +0 -26
- package/node_modules/semver/ranges/min-version.js +0 -63
- package/node_modules/semver/ranges/outside.js +0 -82
- package/node_modules/semver/ranges/simplify.js +0 -49
- package/node_modules/semver/ranges/subset.js +0 -249
- package/node_modules/semver/ranges/to-comparators.js +0 -10
- package/node_modules/semver/ranges/valid.js +0 -13
- package/node_modules/spark-md5/LICENSE +0 -13
- package/node_modules/spark-md5/README.md +0 -191
- package/node_modules/spark-md5/package.json +0 -35
- package/node_modules/spark-md5/spark-md5.js +0 -751
- package/node_modules/spark-md5/spark-md5.min.js +0 -1
- package/node_modules/tldts/LICENSE +0 -13
- package/node_modules/tldts/README.md +0 -327
- package/node_modules/tldts/bin/cli.js +0 -21
- package/node_modules/tldts/dist/cjs/index.js +0 -666
- package/node_modules/tldts/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/data/trie.js +0 -14
- package/node_modules/tldts/dist/cjs/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js +0 -67
- package/node_modules/tldts/dist/cjs/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/es6/index.js +0 -33
- package/node_modules/tldts/dist/es6/index.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/data/trie.js +0 -11
- package/node_modules/tldts/dist/es6/src/data/trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/src/suffix-trie.js +0 -64
- package/node_modules/tldts/dist/es6/src/suffix-trie.js.map +0 -1
- package/node_modules/tldts/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts/dist/index.cjs.min.js +0 -2
- package/node_modules/tldts/dist/index.cjs.min.js.map +0 -1
- package/node_modules/tldts/dist/index.esm.min.js +0 -2
- package/node_modules/tldts/dist/index.esm.min.js.map +0 -1
- package/node_modules/tldts/dist/index.umd.min.js +0 -2
- package/node_modules/tldts/dist/index.umd.min.js.map +0 -1
- package/node_modules/tldts/dist/types/index.d.ts +0 -7
- package/node_modules/tldts/dist/types/src/data/trie.d.ts +0 -5
- package/node_modules/tldts/dist/types/src/suffix-trie.d.ts +0 -5
- package/node_modules/tldts/index.ts +0 -62
- package/node_modules/tldts/package.json +0 -91
- package/node_modules/tldts/src/data/trie.ts +0 -14
- package/node_modules/tldts/src/suffix-trie.ts +0 -110
- package/node_modules/tldts-core/LICENSE +0 -13
- package/node_modules/tldts-core/README.md +0 -3
- package/node_modules/tldts-core/dist/cjs/index.js +0 -561
- package/node_modules/tldts-core/dist/cjs/index.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js +0 -15
- package/node_modules/tldts-core/dist/cjs/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/domain.js +0 -83
- package/node_modules/tldts-core/dist/cjs/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js +0 -149
- package/node_modules/tldts-core/dist/cjs/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/factory.js +0 -104
- package/node_modules/tldts-core/dist/cjs/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js +0 -72
- package/node_modules/tldts-core/dist/cjs/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js +0 -69
- package/node_modules/tldts-core/dist/cjs/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js +0 -3
- package/node_modules/tldts-core/dist/cjs/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/options.js +0 -22
- package/node_modules/tldts-core/dist/cjs/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js +0 -14
- package/node_modules/tldts-core/dist/cjs/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/cjs/tsconfig.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/es6/index.js +0 -4
- package/node_modules/tldts-core/dist/es6/index.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js +0 -12
- package/node_modules/tldts-core/dist/es6/src/domain-without-suffix.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/domain.js +0 -80
- package/node_modules/tldts-core/dist/es6/src/domain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js +0 -146
- package/node_modules/tldts-core/dist/es6/src/extract-hostname.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/factory.js +0 -99
- package/node_modules/tldts-core/dist/es6/src/factory.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-ip.js +0 -69
- package/node_modules/tldts-core/dist/es6/src/is-ip.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/is-valid.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/is-valid.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js +0 -66
- package/node_modules/tldts-core/dist/es6/src/lookup/fast-path.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js +0 -2
- package/node_modules/tldts-core/dist/es6/src/lookup/interface.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/options.js +0 -19
- package/node_modules/tldts-core/dist/es6/src/options.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/src/subdomain.js +0 -11
- package/node_modules/tldts-core/dist/es6/src/subdomain.js.map +0 -1
- package/node_modules/tldts-core/dist/es6/tsconfig.bundle.tsbuildinfo +0 -1
- package/node_modules/tldts-core/dist/types/index.d.ts +0 -4
- package/node_modules/tldts-core/dist/types/src/domain-without-suffix.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/domain.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/extract-hostname.d.ts +0 -5
- package/node_modules/tldts-core/dist/types/src/factory.d.ts +0 -28
- package/node_modules/tldts-core/dist/types/src/is-ip.d.ts +0 -6
- package/node_modules/tldts-core/dist/types/src/is-valid.d.ts +0 -15
- package/node_modules/tldts-core/dist/types/src/lookup/fast-path.d.ts +0 -2
- package/node_modules/tldts-core/dist/types/src/lookup/interface.d.ts +0 -9
- package/node_modules/tldts-core/dist/types/src/options.d.ts +0 -10
- package/node_modules/tldts-core/dist/types/src/subdomain.d.ts +0 -4
- package/node_modules/tldts-core/index.ts +0 -10
- package/node_modules/tldts-core/package.json +0 -68
- package/node_modules/tldts-core/src/domain-without-suffix.ts +0 -14
- package/node_modules/tldts-core/src/domain.ts +0 -100
- package/node_modules/tldts-core/src/extract-hostname.ts +0 -170
- package/node_modules/tldts-core/src/factory.ts +0 -160
- package/node_modules/tldts-core/src/is-ip.ts +0 -87
- package/node_modules/tldts-core/src/is-valid.ts +0 -79
- package/node_modules/tldts-core/src/lookup/fast-path.ts +0 -80
- package/node_modules/tldts-core/src/lookup/interface.ts +0 -10
- package/node_modules/tldts-core/src/options.ts +0 -39
- package/node_modules/tldts-core/src/subdomain.ts +0 -11
- package/node_modules/tough-cookie/LICENSE +0 -12
- package/node_modules/tough-cookie/README.md +0 -154
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.d.ts +0 -33
- package/node_modules/tough-cookie/dist/cookie/canonicalDomain.js +0 -65
- package/node_modules/tough-cookie/dist/cookie/constants.d.ts +0 -54
- package/node_modules/tough-cookie/dist/cookie/constants.js +0 -38
- package/node_modules/tough-cookie/dist/cookie/cookie.d.ts +0 -326
- package/node_modules/tough-cookie/dist/cookie/cookie.js +0 -831
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.d.ts +0 -58
- package/node_modules/tough-cookie/dist/cookie/cookieCompare.js +0 -84
- package/node_modules/tough-cookie/dist/cookie/cookieJar.d.ts +0 -621
- package/node_modules/tough-cookie/dist/cookie/cookieJar.js +0 -1000
- package/node_modules/tough-cookie/dist/cookie/defaultPath.d.ts +0 -40
- package/node_modules/tough-cookie/dist/cookie/defaultPath.js +0 -60
- package/node_modules/tough-cookie/dist/cookie/domainMatch.d.ts +0 -38
- package/node_modules/tough-cookie/dist/cookie/domainMatch.js +0 -94
- package/node_modules/tough-cookie/dist/cookie/formatDate.d.ts +0 -15
- package/node_modules/tough-cookie/dist/cookie/formatDate.js +0 -20
- package/node_modules/tough-cookie/dist/cookie/index.d.ts +0 -29
- package/node_modules/tough-cookie/dist/cookie/index.js +0 -54
- package/node_modules/tough-cookie/dist/cookie/parseDate.d.ts +0 -103
- package/node_modules/tough-cookie/dist/cookie/parseDate.js +0 -323
- package/node_modules/tough-cookie/dist/cookie/permutePath.d.ts +0 -14
- package/node_modules/tough-cookie/dist/cookie/permutePath.js +0 -32
- package/node_modules/tough-cookie/dist/getPublicSuffix.d.ts +0 -55
- package/node_modules/tough-cookie/dist/getPublicSuffix.js +0 -71
- package/node_modules/tough-cookie/dist/memstore.d.ts +0 -220
- package/node_modules/tough-cookie/dist/memstore.js +0 -187
- package/node_modules/tough-cookie/dist/pathMatch.d.ts +0 -17
- package/node_modules/tough-cookie/dist/pathMatch.js +0 -40
- package/node_modules/tough-cookie/dist/permuteDomain.d.ts +0 -15
- package/node_modules/tough-cookie/dist/permuteDomain.js +0 -44
- package/node_modules/tough-cookie/dist/store.d.ts +0 -211
- package/node_modules/tough-cookie/dist/store.js +0 -76
- package/node_modules/tough-cookie/dist/utils.d.ts +0 -34
- package/node_modules/tough-cookie/dist/utils.js +0 -99
- package/node_modules/tough-cookie/dist/validators.d.ts +0 -24
- package/node_modules/tough-cookie/dist/validators.js +0 -90
- package/node_modules/tough-cookie/dist/version.d.ts +0 -5
- package/node_modules/tough-cookie/dist/version.js +0 -8
- package/node_modules/tough-cookie/package.json +0 -144
- package/node_modules/ws/LICENSE +0 -20
- package/node_modules/ws/README.md +0 -548
- package/node_modules/ws/browser.js +0 -8
- package/node_modules/ws/index.js +0 -22
- package/node_modules/ws/lib/buffer-util.js +0 -131
- package/node_modules/ws/lib/constants.js +0 -19
- package/node_modules/ws/lib/event-target.js +0 -292
- package/node_modules/ws/lib/extension.js +0 -203
- package/node_modules/ws/lib/limiter.js +0 -55
- package/node_modules/ws/lib/permessage-deflate.js +0 -530
- package/node_modules/ws/lib/receiver.js +0 -743
- package/node_modules/ws/lib/sender.js +0 -607
- package/node_modules/ws/lib/stream.js +0 -161
- package/node_modules/ws/lib/subprotocol.js +0 -62
- package/node_modules/ws/lib/validation.js +0 -152
- package/node_modules/ws/lib/websocket-server.js +0 -562
- package/node_modules/ws/lib/websocket.js +0 -1407
- package/node_modules/ws/package.json +0 -74
- package/node_modules/ws/wrapper.mjs +0 -21
- package/node_modules/zca-js/.prettierrc +0 -5
- package/node_modules/zca-js/CODE_OF_CONDUCT.md +0 -163
- package/node_modules/zca-js/CONTRIBUTING.md +0 -470
- package/node_modules/zca-js/LICENSE +0 -21
- package/node_modules/zca-js/README.md +0 -225
- package/node_modules/zca-js/SECURITY.md +0 -83
- package/node_modules/zca-js/dist/Errors/ZaloApiError.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiError.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRAborted.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiLoginQRDeclined.js +0 -7
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/ZaloApiMissingImageMetadataGetter.js +0 -7
- package/node_modules/zca-js/dist/Errors/index.d.ts +0 -4
- package/node_modules/zca-js/dist/Errors/index.js +0 -4
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/acceptFriendRequest.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/addGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/addGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/addPollOptions.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/addPollOptions.js +0 -26
- package/node_modules/zca-js/dist/apis/addQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/addQuickMessage.js +0 -60
- package/node_modules/zca-js/dist/apis/addReaction.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/addReaction.js +0 -294
- package/node_modules/zca-js/dist/apis/addUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/addUnreadMark.js +0 -52
- package/node_modules/zca-js/dist/apis/addUserToGroup.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/addUserToGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/blockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/blockViewFeed.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/blockViewFeed.js +0 -30
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeAccountAvatar.js +0 -52
- package/node_modules/zca-js/dist/apis/changeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/changeFriendAlias.js +0 -27
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/changeGroupAvatar.js +0 -44
- package/node_modules/zca-js/dist/apis/changeGroupName.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupName.js +0 -32
- package/node_modules/zca-js/dist/apis/changeGroupOwner.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/changeGroupOwner.js +0 -30
- package/node_modules/zca-js/dist/apis/createAutoReply.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/createAutoReply.js +0 -37
- package/node_modules/zca-js/dist/apis/createBankAccount.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/createBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/createCatalog.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createCatalog.js +0 -29
- package/node_modules/zca-js/dist/apis/createGroup.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/createGroup.js +0 -43
- package/node_modules/zca-js/dist/apis/createNote.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/createNote.js +0 -47
- package/node_modules/zca-js/dist/apis/createPoll.d.ts +0 -36
- package/node_modules/zca-js/dist/apis/createPoll.js +0 -40
- package/node_modules/zca-js/dist/apis/createProductCatalog.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/createProductCatalog.js +0 -50
- package/node_modules/zca-js/dist/apis/createReminder.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/createReminder.js +0 -63
- package/node_modules/zca-js/dist/apis/custom.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/custom.js +0 -15
- package/node_modules/zca-js/dist/apis/deleteAutoReply.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/deleteAutoReply.js +0 -29
- package/node_modules/zca-js/dist/apis/deleteAvatar.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteAvatar.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteBankAccount.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/deleteBankAccount.js +0 -32
- package/node_modules/zca-js/dist/apis/deleteCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/deleteCatalog.js +0 -28
- package/node_modules/zca-js/dist/apis/deleteChat.d.ts +0 -19
- package/node_modules/zca-js/dist/apis/deleteChat.js +0 -50
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/deleteGroupInviteBox.js +0 -27
- package/node_modules/zca-js/dist/apis/deleteMessage.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/deleteMessage.js +0 -52
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/deleteProductCatalog.js +0 -31
- package/node_modules/zca-js/dist/apis/disableGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disableGroupLink.js +0 -24
- package/node_modules/zca-js/dist/apis/disperseGroup.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/disperseGroup.js +0 -28
- package/node_modules/zca-js/dist/apis/editNote.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/editNote.js +0 -46
- package/node_modules/zca-js/dist/apis/editReminder.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/editReminder.js +0 -61
- package/node_modules/zca-js/dist/apis/enableGroupLink.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/enableGroupLink.js +0 -25
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/fetchAccountInfo.js +0 -10
- package/node_modules/zca-js/dist/apis/findUser.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUser.js +0 -42
- package/node_modules/zca-js/dist/apis/findUserByUsername.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/findUserByUsername.js +0 -27
- package/node_modules/zca-js/dist/apis/forwardMessage.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/forwardMessage.js +0 -114
- package/node_modules/zca-js/dist/apis/getAliasList.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getAliasList.js +0 -27
- package/node_modules/zca-js/dist/apis/getAllFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getAllFriends.js +0 -34
- package/node_modules/zca-js/dist/apis/getAllGroups.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAllGroups.js +0 -10
- package/node_modules/zca-js/dist/apis/getArchivedChatList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getArchivedChatList.js +0 -23
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getAutoDeleteChat.js +0 -21
- package/node_modules/zca-js/dist/apis/getAutoReplyList.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getAutoReplyList.js +0 -24
- package/node_modules/zca-js/dist/apis/getAvatarList.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/getAvatarList.js +0 -28
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getAvatarUrlProfile.js +0 -30
- package/node_modules/zca-js/dist/apis/getBizAccount.d.ts +0 -24
- package/node_modules/zca-js/dist/apis/getBizAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getCatalogList.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getCatalogList.js +0 -32
- package/node_modules/zca-js/dist/apis/getCloseFriends.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getCloseFriends.js +0 -20
- package/node_modules/zca-js/dist/apis/getContext.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getContext.js +0 -4
- package/node_modules/zca-js/dist/apis/getCookie.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getCookie.js +0 -9
- package/node_modules/zca-js/dist/apis/getFriendBoardList.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFriendBoardList.js +0 -26
- package/node_modules/zca-js/dist/apis/getFriendOnlines.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getFriendOnlines.js +0 -35
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.d.ts +0 -42
- package/node_modules/zca-js/dist/apis/getFriendRecommendations.js +0 -27
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getFriendRequestStatus.js +0 -25
- package/node_modules/zca-js/dist/apis/getFullAvatar.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getFullAvatar.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.d.ts +0 -23
- package/node_modules/zca-js/dist/apis/getGroupBlockedMember.js +0 -29
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getGroupChatHistory.js +0 -36
- package/node_modules/zca-js/dist/apis/getGroupInfo.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/getGroupInfo.js +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.d.ts +0 -32
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxInfo.js +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.d.ts +0 -38
- package/node_modules/zca-js/dist/apis/getGroupInviteBoxList.js +0 -31
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/getGroupLinkDetail.js +0 -25
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.d.ts +0 -34
- package/node_modules/zca-js/dist/apis/getGroupLinkInfo.js +0 -28
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/getGroupMembersInfo.js +0 -24
- package/node_modules/zca-js/dist/apis/getHiddenConversations.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getHiddenConversations.js +0 -23
- package/node_modules/zca-js/dist/apis/getLabels.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getLabels.js +0 -28
- package/node_modules/zca-js/dist/apis/getListBank.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getListBank.js +0 -20
- package/node_modules/zca-js/dist/apis/getListBankAccount.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getListBankAccount.js +0 -27
- package/node_modules/zca-js/dist/apis/getListBoard.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/getListBoard.js +0 -45
- package/node_modules/zca-js/dist/apis/getListDevice.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/getListDevice.js +0 -22
- package/node_modules/zca-js/dist/apis/getListReminder.d.ts +0 -28
- package/node_modules/zca-js/dist/apis/getListReminder.js +0 -47
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getMultiUsersByPhones.js +0 -39
- package/node_modules/zca-js/dist/apis/getMute.d.ts +0 -13
- package/node_modules/zca-js/dist/apis/getMute.js +0 -22
- package/node_modules/zca-js/dist/apis/getOwnId.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getOwnId.js +0 -4
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/getPendingGroupMembers.js +0 -27
- package/node_modules/zca-js/dist/apis/getPinConversations.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getPinConversations.js +0 -22
- package/node_modules/zca-js/dist/apis/getPollDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getPollDetail.js +0 -30
- package/node_modules/zca-js/dist/apis/getProductCatalogList.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/getProductCatalogList.js +0 -33
- package/node_modules/zca-js/dist/apis/getQR.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/getQR.js +0 -29
- package/node_modules/zca-js/dist/apis/getQuickMessageList.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/getQuickMessageList.js +0 -24
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/getRelatedFriendGroup.js +0 -30
- package/node_modules/zca-js/dist/apis/getReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getReminder.js +0 -25
- package/node_modules/zca-js/dist/apis/getReminderResponses.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/getReminderResponses.js +0 -24
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.d.ts +0 -18
- package/node_modules/zca-js/dist/apis/getSentFriendRequest.js +0 -24
- package/node_modules/zca-js/dist/apis/getSettings.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getSettings.js +0 -20
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickerCategoryDetail.js +0 -24
- package/node_modules/zca-js/dist/apis/getStickers.d.ts +0 -1
- package/node_modules/zca-js/dist/apis/getStickers.js +0 -40
- package/node_modules/zca-js/dist/apis/getStickersDetail.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/getStickersDetail.js +0 -40
- package/node_modules/zca-js/dist/apis/getUnreadMark.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/getUnreadMark.js +0 -30
- package/node_modules/zca-js/dist/apis/getUserInfo.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/getUserInfo.js +0 -44
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/inviteUserToGroups.js +0 -30
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupInviteBox.js +0 -25
- package/node_modules/zca-js/dist/apis/joinGroupLink.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/joinGroupLink.js +0 -27
- package/node_modules/zca-js/dist/apis/keepAlive.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/keepAlive.js +0 -22
- package/node_modules/zca-js/dist/apis/lastOnline.d.ts +0 -7
- package/node_modules/zca-js/dist/apis/lastOnline.js +0 -26
- package/node_modules/zca-js/dist/apis/leaveGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/leaveGroup.js +0 -33
- package/node_modules/zca-js/dist/apis/listen.d.ts +0 -102
- package/node_modules/zca-js/dist/apis/listen.js +0 -425
- package/node_modules/zca-js/dist/apis/lockPoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/lockPoll.js +0 -28
- package/node_modules/zca-js/dist/apis/login.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/login.js +0 -96
- package/node_modules/zca-js/dist/apis/loginQR.d.ts +0 -71
- package/node_modules/zca-js/dist/apis/loginQR.js +0 -376
- package/node_modules/zca-js/dist/apis/logoutV2.js +0 -79
- package/node_modules/zca-js/dist/apis/lostFocus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/lostFocus.js +0 -23
- package/node_modules/zca-js/dist/apis/parseLink.d.ts +0 -21
- package/node_modules/zca-js/dist/apis/parseLink.js +0 -27
- package/node_modules/zca-js/dist/apis/registerCatalog.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/registerCatalog.js +0 -27
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/rejectFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/removeFriend.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriend.js +0 -28
- package/node_modules/zca-js/dist/apis/removeFriendAlias.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeFriendAlias.js +0 -24
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupBlockedMember.js +0 -28
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/removeGroupDeputy.js +0 -30
- package/node_modules/zca-js/dist/apis/removeQuickMessage.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/removeQuickMessage.js +0 -27
- package/node_modules/zca-js/dist/apis/removeReminder.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/removeReminder.js +0 -40
- package/node_modules/zca-js/dist/apis/removeUnreadMark.d.ts +0 -8
- package/node_modules/zca-js/dist/apis/removeUnreadMark.js +0 -50
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/removeUserFromGroup.js +0 -34
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/resetHiddenConversPin.js +0 -20
- package/node_modules/zca-js/dist/apis/reuseAvatar.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/reuseAvatar.js +0 -26
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/reviewPendingMemberRequest.js +0 -38
- package/node_modules/zca-js/dist/apis/scanURL.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/scanURL.js +0 -28
- package/node_modules/zca-js/dist/apis/searchSticker.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/searchSticker.js +0 -28
- package/node_modules/zca-js/dist/apis/sendBankCard.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/sendBankCard.js +0 -53
- package/node_modules/zca-js/dist/apis/sendCard.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendCard.js +0 -75
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendDeliveredEvent.js +0 -55
- package/node_modules/zca-js/dist/apis/sendFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sendFriendRequest.js +0 -39
- package/node_modules/zca-js/dist/apis/sendLink.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendLink.js +0 -78
- package/node_modules/zca-js/dist/apis/sendMessage.d.ts +0 -105
- package/node_modules/zca-js/dist/apis/sendMessage.js +0 -486
- package/node_modules/zca-js/dist/apis/sendReport.d.ts +0 -17
- package/node_modules/zca-js/dist/apis/sendReport.js +0 -53
- package/node_modules/zca-js/dist/apis/sendSeenEvent.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/sendSeenEvent.js +0 -63
- package/node_modules/zca-js/dist/apis/sendSticker.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/sendSticker.js +0 -74
- package/node_modules/zca-js/dist/apis/sendTypingEvent.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/sendTypingEvent.js +0 -33
- package/node_modules/zca-js/dist/apis/sendVideo.d.ts +0 -35
- package/node_modules/zca-js/dist/apis/sendVideo.js +0 -134
- package/node_modules/zca-js/dist/apis/sendVoice.d.ts +0 -12
- package/node_modules/zca-js/dist/apis/sendVoice.js +0 -89
- package/node_modules/zca-js/dist/apis/setHiddenConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setHiddenConversations.js +0 -39
- package/node_modules/zca-js/dist/apis/setMute.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/setMute.js +0 -67
- package/node_modules/zca-js/dist/apis/setPinnedConversations.d.ts +0 -3
- package/node_modules/zca-js/dist/apis/setPinnedConversations.js +0 -34
- package/node_modules/zca-js/dist/apis/sharePoll.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/sharePoll.js +0 -28
- package/node_modules/zca-js/dist/apis/unblockUser.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/unblockUser.js +0 -28
- package/node_modules/zca-js/dist/apis/undo.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/undo.js +0 -42
- package/node_modules/zca-js/dist/apis/undoFriendRequest.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/undoFriendRequest.js +0 -27
- package/node_modules/zca-js/dist/apis/updateActiveStatus.d.ts +0 -4
- package/node_modules/zca-js/dist/apis/updateActiveStatus.js +0 -27
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.d.ts +0 -10
- package/node_modules/zca-js/dist/apis/updateArchivedChatList.js +0 -34
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateAutoDeleteChat.js +0 -40
- package/node_modules/zca-js/dist/apis/updateAutoReply.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateAutoReply.js +0 -38
- package/node_modules/zca-js/dist/apis/updateBankAccount.d.ts +0 -9
- package/node_modules/zca-js/dist/apis/updateBankAccount.js +0 -31
- package/node_modules/zca-js/dist/apis/updateCatalog.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateCatalog.js +0 -30
- package/node_modules/zca-js/dist/apis/updateGroupSettings.d.ts +0 -40
- package/node_modules/zca-js/dist/apis/updateGroupSettings.js +0 -43
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateHiddenConversPin.js +0 -30
- package/node_modules/zca-js/dist/apis/updateLabels.d.ts +0 -15
- package/node_modules/zca-js/dist/apis/updateLabels.js +0 -34
- package/node_modules/zca-js/dist/apis/updateLang.d.ts +0 -6
- package/node_modules/zca-js/dist/apis/updateLang.js +0 -30
- package/node_modules/zca-js/dist/apis/updateProductCatalog.d.ts +0 -25
- package/node_modules/zca-js/dist/apis/updateProductCatalog.js +0 -51
- package/node_modules/zca-js/dist/apis/updateProfile.d.ts +0 -20
- package/node_modules/zca-js/dist/apis/updateProfile.js +0 -43
- package/node_modules/zca-js/dist/apis/updateProfileBio.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/updateProfileBio.js +0 -27
- package/node_modules/zca-js/dist/apis/updateQuickMessage.d.ts +0 -11
- package/node_modules/zca-js/dist/apis/updateQuickMessage.js +0 -61
- package/node_modules/zca-js/dist/apis/updateSettings.d.ts +0 -16
- package/node_modules/zca-js/dist/apis/updateSettings.js +0 -90
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.d.ts +0 -2
- package/node_modules/zca-js/dist/apis/upgradeGroupToCommunity.js +0 -27
- package/node_modules/zca-js/dist/apis/uploadAttachment.d.ts +0 -50
- package/node_modules/zca-js/dist/apis/uploadAttachment.js +0 -197
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.d.ts +0 -14
- package/node_modules/zca-js/dist/apis/uploadProductPhoto.js +0 -50
- package/node_modules/zca-js/dist/apis/votePoll.d.ts +0 -5
- package/node_modules/zca-js/dist/apis/votePoll.js +0 -29
- package/node_modules/zca-js/dist/apis.d.ts +0 -317
- package/node_modules/zca-js/dist/apis.js +0 -319
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiError.cjs +0 -11
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRAborted.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiLoginQRDeclined.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/Errors/ZaloApiMissingImageMetadataGetter.cjs +0 -12
- package/node_modules/zca-js/dist/cjs/apis/acceptFriendRequest.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/addGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/addPollOptions.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/addQuickMessage.cjs +0 -65
- package/node_modules/zca-js/dist/cjs/apis/addReaction.cjs +0 -308
- package/node_modules/zca-js/dist/cjs/apis/addUnreadMark.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/addUserToGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/blockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/blockViewFeed.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/changeAccountAvatar.cjs +0 -57
- package/node_modules/zca-js/dist/cjs/apis/changeFriendAlias.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/changeGroupAvatar.cjs +0 -49
- package/node_modules/zca-js/dist/cjs/apis/changeGroupName.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/changeGroupOwner.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/createAutoReply.cjs +0 -42
- package/node_modules/zca-js/dist/cjs/apis/createBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/createCatalog.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/createGroup.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/createNote.cjs +0 -52
- package/node_modules/zca-js/dist/cjs/apis/createPoll.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/createProductCatalog.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/createReminder.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/custom.cjs +0 -19
- package/node_modules/zca-js/dist/cjs/apis/deleteAutoReply.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/deleteAvatar.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteBankAccount.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/deleteCatalog.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/deleteChat.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/deleteGroupInviteBox.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/deleteMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/deleteProductCatalog.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/disableGroupLink.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/disperseGroup.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/editNote.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/editReminder.cjs +0 -75
- package/node_modules/zca-js/dist/cjs/apis/enableGroupLink.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/fetchAccountInfo.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/findUser.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/findUserByUsername.cjs +0 -41
- package/node_modules/zca-js/dist/cjs/apis/forwardMessage.cjs +0 -129
- package/node_modules/zca-js/dist/cjs/apis/getAliasList.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getAllFriends.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/getAllGroups.cjs +0 -15
- package/node_modules/zca-js/dist/cjs/apis/getArchivedChatList.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getAutoDeleteChat.cjs +0 -26
- package/node_modules/zca-js/dist/cjs/apis/getAutoReplyList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getAvatarList.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getAvatarUrlProfile.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/getBizAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getCatalogList.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getCloseFriends.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getContext.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getCookie.cjs +0 -14
- package/node_modules/zca-js/dist/cjs/apis/getFriendBoardList.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/getFriendOnlines.cjs +0 -40
- package/node_modules/zca-js/dist/cjs/apis/getFriendRecommendations.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getFriendRequestStatus.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getFullAvatar.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupBlockedMember.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getGroupChatHistory.cjs +0 -51
- package/node_modules/zca-js/dist/cjs/apis/getGroupInfo.cjs +0 -37
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxInfo.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/getGroupInviteBoxList.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkDetail.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getGroupLinkInfo.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getGroupMembersInfo.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getHiddenConversations.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/getLabels.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/getListBank.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getListBankAccount.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getListBoard.cjs +0 -59
- package/node_modules/zca-js/dist/cjs/apis/getListDevice.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getListReminder.cjs +0 -61
- package/node_modules/zca-js/dist/cjs/apis/getMultiUsersByPhones.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/getMute.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getOwnId.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/apis/getPendingGroupMembers.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/getPinConversations.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/getPollDetail.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getProductCatalogList.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/getQR.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis/getQuickMessageList.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getRelatedFriendGroup.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getReminder.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/getReminderResponses.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSentFriendRequest.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getSettings.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/getStickerCategoryDetail.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/getStickers.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getStickersDetail.cjs +0 -45
- package/node_modules/zca-js/dist/cjs/apis/getUnreadMark.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/getUserInfo.cjs +0 -58
- package/node_modules/zca-js/dist/cjs/apis/inviteUserToGroups.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/joinGroupInviteBox.cjs +0 -30
- package/node_modules/zca-js/dist/cjs/apis/joinGroupLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/keepAlive.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/apis/lastOnline.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/leaveGroup.cjs +0 -38
- package/node_modules/zca-js/dist/cjs/apis/listen.cjs +0 -440
- package/node_modules/zca-js/dist/cjs/apis/lockPoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/login.cjs +0 -102
- package/node_modules/zca-js/dist/cjs/apis/loginQR.cjs +0 -368
- package/node_modules/zca-js/dist/cjs/apis/logoutV2.cjs +0 -83
- package/node_modules/zca-js/dist/cjs/apis/lostFocus.cjs +0 -28
- package/node_modules/zca-js/dist/cjs/apis/parseLink.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/registerCatalog.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/rejectFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeFriend.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeFriendAlias.cjs +0 -29
- package/node_modules/zca-js/dist/cjs/apis/removeGroupBlockedMember.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/removeGroupDeputy.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/removeQuickMessage.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/removeReminder.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/removeUnreadMark.cjs +0 -64
- package/node_modules/zca-js/dist/cjs/apis/removeUserFromGroup.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/resetHiddenConversPin.cjs +0 -25
- package/node_modules/zca-js/dist/cjs/apis/reuseAvatar.cjs +0 -31
- package/node_modules/zca-js/dist/cjs/apis/reviewPendingMemberRequest.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/scanURL.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/searchSticker.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/sendBankCard.cjs +0 -68
- package/node_modules/zca-js/dist/cjs/apis/sendCard.cjs +0 -89
- package/node_modules/zca-js/dist/cjs/apis/sendDeliveredEvent.cjs +0 -69
- package/node_modules/zca-js/dist/cjs/apis/sendFriendRequest.cjs +0 -44
- package/node_modules/zca-js/dist/cjs/apis/sendLink.cjs +0 -92
- package/node_modules/zca-js/dist/cjs/apis/sendMessage.cjs +0 -500
- package/node_modules/zca-js/dist/cjs/apis/sendReport.cjs +0 -67
- package/node_modules/zca-js/dist/cjs/apis/sendSeenEvent.cjs +0 -77
- package/node_modules/zca-js/dist/cjs/apis/sendSticker.cjs +0 -88
- package/node_modules/zca-js/dist/cjs/apis/sendTypingEvent.cjs +0 -47
- package/node_modules/zca-js/dist/cjs/apis/sendVideo.cjs +0 -148
- package/node_modules/zca-js/dist/cjs/apis/sendVoice.cjs +0 -103
- package/node_modules/zca-js/dist/cjs/apis/setHiddenConversations.cjs +0 -53
- package/node_modules/zca-js/dist/cjs/apis/setMute.cjs +0 -81
- package/node_modules/zca-js/dist/cjs/apis/setPinnedConversations.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/sharePoll.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/unblockUser.cjs +0 -33
- package/node_modules/zca-js/dist/cjs/apis/undo.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/undoFriendRequest.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateActiveStatus.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateArchivedChatList.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateAutoDeleteChat.cjs +0 -54
- package/node_modules/zca-js/dist/cjs/apis/updateAutoReply.cjs +0 -43
- package/node_modules/zca-js/dist/cjs/apis/updateBankAccount.cjs +0 -36
- package/node_modules/zca-js/dist/cjs/apis/updateCatalog.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateGroupSettings.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateHiddenConversPin.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateLabels.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/apis/updateLang.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/apis/updateProductCatalog.cjs +0 -56
- package/node_modules/zca-js/dist/cjs/apis/updateProfile.cjs +0 -48
- package/node_modules/zca-js/dist/cjs/apis/updateProfileBio.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/updateQuickMessage.cjs +0 -66
- package/node_modules/zca-js/dist/cjs/apis/updateSettings.cjs +0 -95
- package/node_modules/zca-js/dist/cjs/apis/upgradeGroupToCommunity.cjs +0 -32
- package/node_modules/zca-js/dist/cjs/apis/uploadAttachment.cjs +0 -211
- package/node_modules/zca-js/dist/cjs/apis/uploadProductPhoto.cjs +0 -55
- package/node_modules/zca-js/dist/cjs/apis/votePoll.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/apis.cjs +0 -324
- package/node_modules/zca-js/dist/cjs/context.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/index.cjs +0 -159
- package/node_modules/zca-js/dist/cjs/models/AutoReply.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/Bank.cjs +0 -263
- package/node_modules/zca-js/dist/cjs/models/Board.cjs +0 -8
- package/node_modules/zca-js/dist/cjs/models/DeliveredMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Enum.cjs +0 -27
- package/node_modules/zca-js/dist/cjs/models/FriendEvent.cjs +0 -87
- package/node_modules/zca-js/dist/cjs/models/Group.cjs +0 -13
- package/node_modules/zca-js/dist/cjs/models/GroupEvent.cjs +0 -94
- package/node_modules/zca-js/dist/cjs/models/Message.cjs +0 -35
- package/node_modules/zca-js/dist/cjs/models/Reaction.cjs +0 -74
- package/node_modules/zca-js/dist/cjs/models/Reminder.cjs +0 -9
- package/node_modules/zca-js/dist/cjs/models/SeenMessage.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Typing.cjs +0 -23
- package/node_modules/zca-js/dist/cjs/models/Undo.cjs +0 -16
- package/node_modules/zca-js/dist/cjs/models/ZBusiness.cjs +0 -39
- package/node_modules/zca-js/dist/cjs/update.cjs +0 -34
- package/node_modules/zca-js/dist/cjs/utils.cjs +0 -703
- package/node_modules/zca-js/dist/cjs/zalo.cjs +0 -112
- package/node_modules/zca-js/dist/context.d.ts +0 -179
- package/node_modules/zca-js/dist/context.js +0 -28
- package/node_modules/zca-js/dist/index.d.ts +0 -166
- package/node_modules/zca-js/dist/index.js +0 -14
- package/node_modules/zca-js/dist/models/Attachment.d.ts +0 -9
- package/node_modules/zca-js/dist/models/Attachment.js +0 -1
- package/node_modules/zca-js/dist/models/AutoReply.d.ts +0 -20
- package/node_modules/zca-js/dist/models/AutoReply.js +0 -7
- package/node_modules/zca-js/dist/models/Bank.d.ts +0 -291
- package/node_modules/zca-js/dist/models/Bank.js +0 -262
- package/node_modules/zca-js/dist/models/Board.d.ts +0 -60
- package/node_modules/zca-js/dist/models/Board.js +0 -6
- package/node_modules/zca-js/dist/models/Catalog.d.ts +0 -16
- package/node_modules/zca-js/dist/models/Catalog.js +0 -1
- package/node_modules/zca-js/dist/models/DeliveredMessage.d.ts +0 -27
- package/node_modules/zca-js/dist/models/DeliveredMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Enum.d.ts +0 -21
- package/node_modules/zca-js/dist/models/Enum.js +0 -25
- package/node_modules/zca-js/dist/models/FriendEvent.d.ts +0 -107
- package/node_modules/zca-js/dist/models/FriendEvent.js +0 -83
- package/node_modules/zca-js/dist/models/Group.d.ts +0 -125
- package/node_modules/zca-js/dist/models/Group.js +0 -11
- package/node_modules/zca-js/dist/models/GroupEvent.d.ts +0 -178
- package/node_modules/zca-js/dist/models/GroupEvent.js +0 -90
- package/node_modules/zca-js/dist/models/Label.d.ts +0 -10
- package/node_modules/zca-js/dist/models/Label.js +0 -1
- package/node_modules/zca-js/dist/models/Message.d.ts +0 -91
- package/node_modules/zca-js/dist/models/Message.js +0 -29
- package/node_modules/zca-js/dist/models/ProductCatalog.d.ts +0 -17
- package/node_modules/zca-js/dist/models/ProductCatalog.js +0 -1
- package/node_modules/zca-js/dist/models/QuickMessage.d.ts +0 -25
- package/node_modules/zca-js/dist/models/QuickMessage.js +0 -1
- package/node_modules/zca-js/dist/models/Reaction.d.ts +0 -85
- package/node_modules/zca-js/dist/models/Reaction.js +0 -70
- package/node_modules/zca-js/dist/models/Reminder.d.ts +0 -51
- package/node_modules/zca-js/dist/models/Reminder.js +0 -7
- package/node_modules/zca-js/dist/models/SeenMessage.d.ts +0 -26
- package/node_modules/zca-js/dist/models/SeenMessage.js +0 -17
- package/node_modules/zca-js/dist/models/Sticker.d.ts +0 -27
- package/node_modules/zca-js/dist/models/Sticker.js +0 -1
- package/node_modules/zca-js/dist/models/Typing.d.ts +0 -24
- package/node_modules/zca-js/dist/models/Typing.js +0 -17
- package/node_modules/zca-js/dist/models/Undo.d.ts +0 -34
- package/node_modules/zca-js/dist/models/Undo.js +0 -12
- package/node_modules/zca-js/dist/models/User.d.ts +0 -70
- package/node_modules/zca-js/dist/models/User.js +0 -1
- package/node_modules/zca-js/dist/models/ZBusiness.d.ts +0 -22
- package/node_modules/zca-js/dist/models/ZBusiness.js +0 -35
- package/node_modules/zca-js/dist/models/index.d.ts +0 -22
- package/node_modules/zca-js/dist/models/index.js +0 -22
- package/node_modules/zca-js/dist/update.d.ts +0 -2
- package/node_modules/zca-js/dist/update.js +0 -29
- package/node_modules/zca-js/dist/utils.d.ts +0 -167
- package/node_modules/zca-js/dist/utils.js +0 -719
- package/node_modules/zca-js/dist/zalo.d.ts +0 -41
- package/node_modules/zca-js/dist/zalo.js +0 -107
- package/node_modules/zca-js/eslint.config.js +0 -21
- package/node_modules/zca-js/index.d.ts +0 -2
- package/node_modules/zca-js/package.json +0 -78
- package/node_modules/zca-js/rollup.config.js +0 -28
- package/patches/zca-js+2.2.0.patch +0 -1445
- package/src/cli.test.js +0 -127
- package/src/core/forward.js +0 -112
- package/src/core/group-history.js +0 -248
- package/src/core/group-invite.js +0 -53
- package/src/core/offline-queue.js +0 -194
- package/src/core/pin.js +0 -222
- package/src/core/socket-tap.js +0 -154
- package/src/core/sync-v2/assets.js +0 -181
- package/src/core/sync-v2/gid.js +0 -106
- package/src/core/sync-v2/keepalive.js +0 -177
- package/src/core/sync-v2/message-types.js +0 -522
- package/src/core/sync-v2/renewlink.js +0 -124
- package/src/core/sync-v2/zcloud-cipher.js +0 -88
- package/src/core/zca-custom.js +0 -78
- package/src/mcp/message-buffer.test.js +0 -360
- package/src/mcp/notifier.test.js +0 -275
- package/src/mcp/thread-filter.test.js +0 -206
- package/src/mcp/thread-name-cache.test.js +0 -142
- package/src/utils/atomic-file.js +0 -209
- package/src/utils/bank-helpers.test.js +0 -66
- package/src/utils/device-fingerprint.js +0 -72
- package/src/utils/mentions.js +0 -140
- package/src/utils/proxy-helpers.test.js +0 -36
- package/src/utils/split-message.js +0 -222
- package/src/utils/urgency.js +0 -29
- /package/src/{core → zalo/custom}/user-info.js +0 -0
- /package/src/{utils → zalo/format}/extract-message-text.js +0 -0
- /package/src/{utils → zalo/format}/markdown.js +0 -0
|
@@ -0,0 +1,976 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Attachments: local files uploaded to Zalo and the messages that carry them (spec-send 2, design 1.4).
|
|
3
|
+
*
|
|
4
|
+
* `sendAttachments(message, threadId, type)` is the half of `sendMessage` that `createApi` calls when
|
|
5
|
+
* `message.attachments` is non-empty; `uploadAttachment(paths, threadId, type)` is the upload alone.
|
|
6
|
+
*
|
|
7
|
+
* What goes on the wire, as the server expects it (the legacy upload path, design 6.1 item 9):
|
|
8
|
+
*
|
|
9
|
+
* - Routing by lowercase extension: `jpg jpeg png webp` are photos (`photo_original/*`), `gif` its own path
|
|
10
|
+
* (`upthumb`, then `gif` in chunks of 512000 bytes, up to six in flight), everything
|
|
11
|
+
* else, `mp4` included, a file (`asyncfile/*`).
|
|
12
|
+
* - A local video sent as a video (`sendVideoFile`): the video goes up as a file
|
|
13
|
+
* (its URL arrives as the `video_done`/`file_done` push), the thumbnail as a photo unless a URL is given, and the
|
|
14
|
+
* message is the forward-video send of `sendVideo`. Not verified live: Zalo's own apps upload the thumbnail through
|
|
15
|
+
* the async-file path and read `oriUrl`/`hdUrl` from it; this sends it as a photo and reads the same names.
|
|
16
|
+
* - Limits from the login's `settings.features.sharefile`, all checked before the first request (the caption
|
|
17
|
+
* included): `max_file` (count), `max_size_share_file_v3` (MB), `restricted_ext_file` (denied extensions).
|
|
18
|
+
* - Upload: `POST {file}/api/{message|group}/{photo_original|asyncfile}/upload?zpw_ver&zpw_type¶ms&type`, `type`
|
|
19
|
+
* 2 for a user and 11 for a group, a multipart body with one part `chunkContent` (the chunk's bytes, named after
|
|
20
|
+
* the file). `params` per chunk: `{totalChunk, fileName, clientId, totalSize, imei, chunkId, toid|grid}`, without
|
|
21
|
+
* the `isE2EE: 0`/`jxl: 0` the previous engine added (a non-E2EE chunk carries neither). The chunk size is
|
|
22
|
+
* `chunk_size_file` when it is a number of at least 64000, else 256000. At most three chunks are in flight; the
|
|
23
|
+
* last chunk goes once every other one has answered, so its reply is the one that says whether the upload
|
|
24
|
+
* finished. An inner `error_code` 1 on a chunk is Zalo's "already uploaded", an answer, not an error.
|
|
25
|
+
* - A photo's reply carries its URLs. A file's does not: Zalo pushes them later in a 601 control (`file_done`,
|
|
26
|
+
* `video_done`; `photo_success` for a photo whose reply had none), which the listener hands to
|
|
27
|
+
* `ctx.uploadCallbacks.settle(fileId, {url, kind, data})` (kernel/session.js). A settlement that came before the
|
|
28
|
+
* wait is kept for it. While a file waits, a callback stands under its id in `ctx.uploadCallbacks` too, so a
|
|
29
|
+
* listener that only calls the entry it finds with `{fileUrl, fileId}` settles it as well. When nothing comes,
|
|
30
|
+
* the last chunk is sent again after a size-bucketed delay (a valid reply carries the URL), and once more
|
|
31
|
+
* at the overall wait (120 s); the upload fails when that replay gives nothing, or at the latest
|
|
32
|
+
* {@link FINAL_REPLAY_GRACE_MS} later. No chunk request waits longer than {@link CHUNK_TIMEOUT_MS}.
|
|
33
|
+
* - Send: `photo_original/send` with `{photoId, clientId, desc, width, height, rawUrl, thumbUrl, hdUrl,
|
|
34
|
+
* normalUrl|oriUrl, (layout), toid|grid, language, (extMsgProp), zsource, ttl, imei}`; `asyncfile/msg` with
|
|
35
|
+
* `{fileId, checksum, checksumSha, extension, totalSize, fileName, clientId, fType, fileCount, fdata, toid|grid,
|
|
36
|
+
* fileUrl, zsource, ttl, imei (to a user)}`, spelled `extension` (not `extention`).
|
|
37
|
+
* - A caption rides on a single photo as its `desc`; otherwise it goes first, as its own text message through
|
|
38
|
+
* `s.api.sendMessage`. The reply is `{message, attachment}`, `attachment[i]` carrying the `cliMsgId` it was sent
|
|
39
|
+
* with, files in the order given and GIFs last.
|
|
40
|
+
*
|
|
41
|
+
* Every message clientId comes from the session's monotonic generator (`s.nextClientId()`), so no two sends of one
|
|
42
|
+
* session share one: a photo's upload and its send use the same id.
|
|
43
|
+
*
|
|
44
|
+
* Waits read the session clock (`s.now()`), checked every {@link TICK_MS}, so a test moves them by moving the clock.
|
|
45
|
+
*/
|
|
46
|
+
import { createHash } from "node:crypto";
|
|
47
|
+
import { open, stat } from "node:fs/promises";
|
|
48
|
+
import path from "node:path";
|
|
49
|
+
import { imageSizeFromFile } from "image-size/fromFile";
|
|
50
|
+
import { THREAD_TYPE } from "../enums.js";
|
|
51
|
+
import { ZaloApiError } from "../errors.js";
|
|
52
|
+
|
|
53
|
+
/** The chunk size when the server names none we can use. */
|
|
54
|
+
export const DEFAULT_CHUNK_SIZE = 256000;
|
|
55
|
+
|
|
56
|
+
/** The smallest server chunk size accepted; anything below falls back to {@link DEFAULT_CHUNK_SIZE}. */
|
|
57
|
+
export const MIN_CHUNK_SIZE = 64000;
|
|
58
|
+
|
|
59
|
+
/** Chunks of one file in flight at once. */
|
|
60
|
+
export const MAX_CHUNKS_IN_FLIGHT = 3;
|
|
61
|
+
|
|
62
|
+
/** How long to wait for the server's word on an uploaded file before giving up (the default). */
|
|
63
|
+
export const DEFAULT_WAIT_MS = 120000;
|
|
64
|
+
|
|
65
|
+
/**
|
|
66
|
+
* Seconds before the last chunk is sent again, by `floor(size / 30 MB)` (the default when the server sends no
|
|
67
|
+
* `upload_file_timeout_replay_last_chunk`).
|
|
68
|
+
*/
|
|
69
|
+
export const DEFAULT_REPLAY_SECONDS = Object.freeze([30, 35, 40, 45, 50, 60]);
|
|
70
|
+
|
|
71
|
+
/** The size step of {@link DEFAULT_REPLAY_SECONDS}. */
|
|
72
|
+
export const REPLAY_SIZE_STEP = 31457280;
|
|
73
|
+
|
|
74
|
+
/**
|
|
75
|
+
* How long one chunk request may take before it fails. A multipart call has no timeout of its own (kernel
|
|
76
|
+
* endpoint.js), so without this a chunk the server never answers would hold the upload forever.
|
|
77
|
+
*/
|
|
78
|
+
export const CHUNK_TIMEOUT_MS = 60000;
|
|
79
|
+
|
|
80
|
+
/**
|
|
81
|
+
* How long past the overall wait the last replay may still answer before the upload fails whatever the replay is
|
|
82
|
+
* doing (the replay's own request timeout is {@link CHUNK_TIMEOUT_MS}, so this is the same length).
|
|
83
|
+
*/
|
|
84
|
+
export const FINAL_REPLAY_GRACE_MS = CHUNK_TIMEOUT_MS;
|
|
85
|
+
|
|
86
|
+
/** How often a wait looks at the clock, in real milliseconds. */
|
|
87
|
+
export const TICK_MS = 100;
|
|
88
|
+
|
|
89
|
+
/** Extensions sent as a photo. */
|
|
90
|
+
const PHOTO_EXTS = new Set(["jpg", "jpeg", "png", "webp"]);
|
|
91
|
+
|
|
92
|
+
/** How much of a file the checksum reads at a time. */
|
|
93
|
+
const READ_MD5_STEP = 2 * 1024 * 1024;
|
|
94
|
+
|
|
95
|
+
/**
|
|
96
|
+
* The lowercase extension of a path, without the dot.
|
|
97
|
+
*
|
|
98
|
+
* @param {string} p
|
|
99
|
+
* @returns {string}
|
|
100
|
+
*/
|
|
101
|
+
function extOf(p) {
|
|
102
|
+
return path.extname(p).slice(1).toLowerCase();
|
|
103
|
+
}
|
|
104
|
+
|
|
105
|
+
/**
|
|
106
|
+
* How a file travels: "photo", "gif" or "file", and the type name of its upload result.
|
|
107
|
+
*
|
|
108
|
+
* @param {string} ext
|
|
109
|
+
* @returns {{route: "photo"|"gif"|"file", fileType: "image"|"gif"|"video"|"others"}}
|
|
110
|
+
*/
|
|
111
|
+
function routeOf(ext) {
|
|
112
|
+
if (PHOTO_EXTS.has(ext)) return { route: "photo", fileType: "image" };
|
|
113
|
+
if (ext === "gif") return { route: "gif", fileType: "gif" };
|
|
114
|
+
return { route: "file", fileType: ext === "mp4" ? "video" : "others" };
|
|
115
|
+
}
|
|
116
|
+
|
|
117
|
+
/**
|
|
118
|
+
* The upload settings of the session, with the defaults.
|
|
119
|
+
*
|
|
120
|
+
* @param {object} ctx
|
|
121
|
+
* @returns {{maxFile: number|null, maxBytes: number|null, maxMb: number|null, denied: string[], chunkSize: number,
|
|
122
|
+
* waitMs: number, replaySeconds: number[], replay: boolean}}
|
|
123
|
+
*/
|
|
124
|
+
export function uploadSettings(ctx) {
|
|
125
|
+
const share = ctx?.settings?.features?.sharefile ?? {};
|
|
126
|
+
const retry = ctx?.settings?.features?.retry_upload_file_configs ?? {};
|
|
127
|
+
const maxMb = Number(share.max_size_share_file_v3);
|
|
128
|
+
const chunk = Number(share.chunk_size_file);
|
|
129
|
+
const wait = parseInt(retry.upload_file_timeout_wait_ctrl_event, 10);
|
|
130
|
+
const replaySeconds =
|
|
131
|
+
Array.isArray(retry.upload_file_timeout_replay_last_chunk) && retry.upload_file_timeout_replay_last_chunk.length
|
|
132
|
+
? retry.upload_file_timeout_replay_last_chunk.map(Number)
|
|
133
|
+
: [...DEFAULT_REPLAY_SECONDS];
|
|
134
|
+
return {
|
|
135
|
+
maxFile: Number.isFinite(Number(share.max_file)) ? Number(share.max_file) : null,
|
|
136
|
+
maxMb: Number.isFinite(maxMb) ? maxMb : null,
|
|
137
|
+
maxBytes: Number.isFinite(maxMb) ? maxMb * 1024 * 1024 : null,
|
|
138
|
+
denied: Array.isArray(share.restricted_ext_file) ? share.restricted_ext_file.map(String) : [],
|
|
139
|
+
chunkSize: Number.isFinite(chunk) && chunk >= MIN_CHUNK_SIZE ? Math.floor(chunk) : DEFAULT_CHUNK_SIZE,
|
|
140
|
+
waitMs: Number.isFinite(wait) ? wait : DEFAULT_WAIT_MS,
|
|
141
|
+
replaySeconds,
|
|
142
|
+
replay: retry.enable_resend_lastchunk === undefined ? true : !!retry.enable_resend_lastchunk,
|
|
143
|
+
};
|
|
144
|
+
}
|
|
145
|
+
|
|
146
|
+
/**
|
|
147
|
+
* Milliseconds before the last chunk of a `size`-byte upload is sent again.
|
|
148
|
+
*
|
|
149
|
+
* @param {number} size
|
|
150
|
+
* @param {number[]} [seconds] - the server's table
|
|
151
|
+
* @returns {number}
|
|
152
|
+
*/
|
|
153
|
+
export function replayDelayMs(size, seconds = DEFAULT_REPLAY_SECONDS) {
|
|
154
|
+
const i = Math.min(Math.floor(Math.max(0, Number(size) || 0) / REPLAY_SIZE_STEP), seconds.length - 1);
|
|
155
|
+
return seconds[i] * 1000;
|
|
156
|
+
}
|
|
157
|
+
|
|
158
|
+
/**
|
|
159
|
+
* An image's size and display dimensions: the session's `imageMetadataGetter` when the engine gave one, else
|
|
160
|
+
* image-size with the EXIF 90-degree rotations (orientations 5-8) swapping width and height.
|
|
161
|
+
*
|
|
162
|
+
* @param {object} ctx
|
|
163
|
+
* @param {string} file
|
|
164
|
+
* @returns {Promise<{width: number, height: number, size: number}>}
|
|
165
|
+
*/
|
|
166
|
+
async function imageMeta(ctx, file) {
|
|
167
|
+
const getter = ctx?.options?.imageMetadataGetter;
|
|
168
|
+
if (typeof getter === "function") {
|
|
169
|
+
const meta = await getter(file);
|
|
170
|
+
if (!meta) throw new ZaloApiError("Failed to get image metadata");
|
|
171
|
+
return meta;
|
|
172
|
+
}
|
|
173
|
+
const { size } = await stat(file);
|
|
174
|
+
const dims = await imageSizeFromFile(file);
|
|
175
|
+
const turned = dims.orientation >= 5 && dims.orientation <= 8;
|
|
176
|
+
return { width: turned ? dims.height : dims.width, height: turned ? dims.width : dims.height, size };
|
|
177
|
+
}
|
|
178
|
+
|
|
179
|
+
/**
|
|
180
|
+
* The MD5 of a file, lowercase hex, read in steps.
|
|
181
|
+
*
|
|
182
|
+
* @param {string} file
|
|
183
|
+
* @param {number} size
|
|
184
|
+
* @returns {Promise<string>}
|
|
185
|
+
*/
|
|
186
|
+
async function md5Of(file, size) {
|
|
187
|
+
const hash = createHash("md5");
|
|
188
|
+
const fh = await open(file, "r");
|
|
189
|
+
try {
|
|
190
|
+
const buf = Buffer.alloc(Math.min(READ_MD5_STEP, Math.max(1, size)));
|
|
191
|
+
for (let at = 0; at < size;) {
|
|
192
|
+
const { bytesRead } = await fh.read(buf, 0, Math.min(buf.length, size - at), at);
|
|
193
|
+
if (bytesRead === 0) break;
|
|
194
|
+
hash.update(buf.subarray(0, bytesRead));
|
|
195
|
+
at += bytesRead;
|
|
196
|
+
}
|
|
197
|
+
} finally {
|
|
198
|
+
await fh.close();
|
|
199
|
+
}
|
|
200
|
+
return hash.digest("hex");
|
|
201
|
+
}
|
|
202
|
+
|
|
203
|
+
/**
|
|
204
|
+
* Bytes `[start, start + length)` of a file.
|
|
205
|
+
*
|
|
206
|
+
* @param {string} file
|
|
207
|
+
* @param {number} start
|
|
208
|
+
* @param {number} length
|
|
209
|
+
* @returns {Promise<Buffer>}
|
|
210
|
+
*/
|
|
211
|
+
async function readRange(file, start, length) {
|
|
212
|
+
const fh = await open(file, "r");
|
|
213
|
+
try {
|
|
214
|
+
const buf = Buffer.alloc(length);
|
|
215
|
+
let got = 0;
|
|
216
|
+
while (got < length) {
|
|
217
|
+
const { bytesRead } = await fh.read(buf, got, length - got, start + got);
|
|
218
|
+
if (bytesRead === 0) break;
|
|
219
|
+
got += bytesRead;
|
|
220
|
+
}
|
|
221
|
+
return got === length ? buf : buf.subarray(0, got);
|
|
222
|
+
} finally {
|
|
223
|
+
await fh.close();
|
|
224
|
+
}
|
|
225
|
+
}
|
|
226
|
+
|
|
227
|
+
/**
|
|
228
|
+
* Look at every file before anything is sent: it exists, its extension is allowed, its size is within the limit.
|
|
229
|
+
* Messages are the ones the engine has always shown.
|
|
230
|
+
*
|
|
231
|
+
* @param {object} ctx
|
|
232
|
+
* @param {string[]} files
|
|
233
|
+
* @param {ReturnType<typeof uploadSettings>} cfg
|
|
234
|
+
* @returns {Promise<Array<{file: string, fileName: string, ext: string, size: number, route: string,
|
|
235
|
+
* fileType: string, width?: number, height?: number}>>}
|
|
236
|
+
* @throws {ZaloApiError} for the first file that fails
|
|
237
|
+
*/
|
|
238
|
+
async function inspect(ctx, files, cfg) {
|
|
239
|
+
const out = [];
|
|
240
|
+
for (const file of files) {
|
|
241
|
+
if (typeof file !== "string" || !file) throw new ZaloApiError("Invalid source type");
|
|
242
|
+
let st;
|
|
243
|
+
try {
|
|
244
|
+
st = await stat(file);
|
|
245
|
+
} catch {
|
|
246
|
+
throw new ZaloApiError("File not found");
|
|
247
|
+
}
|
|
248
|
+
if (!st.isFile()) throw new ZaloApiError("File not found");
|
|
249
|
+
const ext = extOf(file);
|
|
250
|
+
const fileName = path.basename(file);
|
|
251
|
+
if (cfg.denied.includes(ext)) throw new ZaloApiError(`File extension "${ext}" is not allowed`);
|
|
252
|
+
const { route, fileType } = routeOf(ext);
|
|
253
|
+
const item = { file, fileName, ext, size: st.size, route, fileType };
|
|
254
|
+
if (route === "photo" || route === "gif") {
|
|
255
|
+
const meta = await imageMeta(ctx, file);
|
|
256
|
+
item.size = Number(meta.size ?? st.size);
|
|
257
|
+
item.width = meta.width;
|
|
258
|
+
item.height = meta.height;
|
|
259
|
+
}
|
|
260
|
+
if (cfg.maxBytes !== null && item.size > cfg.maxBytes) {
|
|
261
|
+
throw new ZaloApiError(`File ${fileName} size exceed maximum size of ${cfg.maxMb}MB`);
|
|
262
|
+
}
|
|
263
|
+
if (item.size === 0) throw new ZaloApiError(`File ${fileName} is empty`);
|
|
264
|
+
out.push(item);
|
|
265
|
+
}
|
|
266
|
+
return out;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/**
|
|
270
|
+
* A thread's id as the upload and send params carry it.
|
|
271
|
+
*
|
|
272
|
+
* @param {string} threadId
|
|
273
|
+
* @param {boolean} group
|
|
274
|
+
* @returns {{toid: string}|{grid: string}}
|
|
275
|
+
*/
|
|
276
|
+
function threadParam(threadId, group) {
|
|
277
|
+
return group ? { grid: String(threadId) } : { toid: String(threadId) };
|
|
278
|
+
}
|
|
279
|
+
|
|
280
|
+
/**
|
|
281
|
+
* The endpoint of one upload chunk.
|
|
282
|
+
*
|
|
283
|
+
* @param {"photo"|"file"} route
|
|
284
|
+
* @param {boolean} group
|
|
285
|
+
* @returns {object}
|
|
286
|
+
*/
|
|
287
|
+
function chunkEndpoint(route, group) {
|
|
288
|
+
const photo = route === "photo";
|
|
289
|
+
return {
|
|
290
|
+
host: "file",
|
|
291
|
+
path: `/api/${group ? "group" : "message"}/${photo ? "photo_original" : "asyncfile"}/upload`,
|
|
292
|
+
cmd: photo ? (group ? 11820 : 11772) : group ? 13000 : 11776,
|
|
293
|
+
method: "multipart",
|
|
294
|
+
body: (a) => a.params,
|
|
295
|
+
query: () => ({ type: group ? 11 : 2 }),
|
|
296
|
+
file: (a) => ({
|
|
297
|
+
field: "chunkContent",
|
|
298
|
+
filename: a.fileName,
|
|
299
|
+
type: "application/octet-stream",
|
|
300
|
+
bytes: a.bytes,
|
|
301
|
+
}),
|
|
302
|
+
reply: "session",
|
|
303
|
+
okCodes: [1],
|
|
304
|
+
timeoutMs: CHUNK_TIMEOUT_MS,
|
|
305
|
+
transform: (data, _args, { code }) => ({ data: data && typeof data === "object" ? data : {}, code }),
|
|
306
|
+
};
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/** `POST {file}/api/{message|group}/photo_original/send`. */
|
|
310
|
+
const photoSendEndpoint = (group) => ({
|
|
311
|
+
host: "file",
|
|
312
|
+
path: `/api/${group ? "group" : "message"}/photo_original/send`,
|
|
313
|
+
cmd: group ? 11826 : 11773,
|
|
314
|
+
method: "post",
|
|
315
|
+
body: (a) => a.params,
|
|
316
|
+
reply: "session",
|
|
317
|
+
});
|
|
318
|
+
|
|
319
|
+
/** `POST {file}/api/{message|group}/asyncfile/msg`. */
|
|
320
|
+
const fileSendEndpoint = (group) => ({
|
|
321
|
+
host: "file",
|
|
322
|
+
path: `/api/${group ? "group" : "message"}/asyncfile/msg`,
|
|
323
|
+
cmd: group ? 13001 : 11777,
|
|
324
|
+
method: "post",
|
|
325
|
+
body: (a) => a.params,
|
|
326
|
+
reply: "session",
|
|
327
|
+
});
|
|
328
|
+
|
|
329
|
+
/** `POST {file}/api/message/upthumb`: a GIF's thumbnail, always on the user path. */
|
|
330
|
+
const UPTHUMB = Object.freeze({
|
|
331
|
+
host: "file",
|
|
332
|
+
path: "/api/message/upthumb",
|
|
333
|
+
method: "multipart",
|
|
334
|
+
body: (a) => a.params,
|
|
335
|
+
file: (a) => ({ field: "fileContent", filename: "blob", type: "image/png", bytes: a.bytes }),
|
|
336
|
+
reply: "session",
|
|
337
|
+
});
|
|
338
|
+
|
|
339
|
+
/** A local GIF's chunk size. */
|
|
340
|
+
export const GIF_CHUNK_SIZE = 512000;
|
|
341
|
+
|
|
342
|
+
/** GIF chunks in flight at once (sent while fewer than six are waiting). */
|
|
343
|
+
export const GIF_CHUNKS_IN_FLIGHT = 6;
|
|
344
|
+
|
|
345
|
+
/**
|
|
346
|
+
* `POST {file}/api/{message|group}/gif`: one chunk of a local GIF. An inner code 1 or 220 is a chunk taken while the
|
|
347
|
+
* upload goes on (0, 1 and 220 all mean success); the chunk that says `isFinish`, or 0,
|
|
348
|
+
* carries the message.
|
|
349
|
+
*/
|
|
350
|
+
const gifEndpoint = (group) => ({
|
|
351
|
+
host: "file",
|
|
352
|
+
path: `/api/${group ? "group" : "message"}/gif`,
|
|
353
|
+
cmd: group ? 11194 : 11292,
|
|
354
|
+
method: "multipart",
|
|
355
|
+
body: (a) => a.params,
|
|
356
|
+
query: () => ({ type: 1 }),
|
|
357
|
+
file: (a) => ({ field: "chunkContent", filename: a.fileName, type: "application/octet-stream", bytes: a.bytes }),
|
|
358
|
+
reply: "session",
|
|
359
|
+
okCodes: [1, 220],
|
|
360
|
+
timeoutMs: CHUNK_TIMEOUT_MS,
|
|
361
|
+
transform: (data, _args, { code }) => ({ data: data && typeof data === "object" ? data : {}, code }),
|
|
362
|
+
});
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Send a local GIF in chunks: every chunk but the last, at most
|
|
366
|
+
* {@link GIF_CHUNKS_IN_FLIGHT} at a time, then the last, so its reply is the one that says the message was made.
|
|
367
|
+
*
|
|
368
|
+
* @param {import("../api.js").Session} s
|
|
369
|
+
* @param {{item: object, bytes: Buffer}} g - the GIF and its bytes
|
|
370
|
+
* @param {boolean} group
|
|
371
|
+
* @param {object} params - the message params, without `totalChunk` and `chunkId`
|
|
372
|
+
* @returns {Promise<object>} the reply of the chunk that finished the upload
|
|
373
|
+
*/
|
|
374
|
+
async function sendGifChunks(s, g, group, params) {
|
|
375
|
+
const total = Math.max(1, Math.ceil(g.bytes.length / GIF_CHUNK_SIZE));
|
|
376
|
+
const def = gifEndpoint(group);
|
|
377
|
+
let finished = null;
|
|
378
|
+
let last = null;
|
|
379
|
+
const send = async (chunkId) => {
|
|
380
|
+
const start = (chunkId - 1) * GIF_CHUNK_SIZE;
|
|
381
|
+
const bytes = g.bytes.subarray(start, Math.min(start + GIF_CHUNK_SIZE, g.bytes.length));
|
|
382
|
+
const r = await s.call(def, {
|
|
383
|
+
params: { ...params, totalChunk: total, chunkId },
|
|
384
|
+
fileName: g.item.fileName,
|
|
385
|
+
bytes,
|
|
386
|
+
});
|
|
387
|
+
last = r.data;
|
|
388
|
+
if (!finished && (r.code === 0 || r.data?.isFinish)) finished = r.data;
|
|
389
|
+
};
|
|
390
|
+
const rest = Array.from({ length: total - 1 }, (_, i) => i + 1);
|
|
391
|
+
while (rest.length) await Promise.all(rest.splice(0, GIF_CHUNKS_IN_FLIGHT).map(send));
|
|
392
|
+
await send(total);
|
|
393
|
+
return finished ?? last ?? {};
|
|
394
|
+
}
|
|
395
|
+
|
|
396
|
+
/**
|
|
397
|
+
* What a chunk reply says.
|
|
398
|
+
*
|
|
399
|
+
* @param {"photo"|"file"} route
|
|
400
|
+
* @param {{data: object, code: number}} reply
|
|
401
|
+
* @returns {{done: boolean, duplicate: boolean}}
|
|
402
|
+
*/
|
|
403
|
+
function chunkState(route, { data, code }) {
|
|
404
|
+
const id = route === "photo" ? data.photoId : data.fileId;
|
|
405
|
+
const has = id !== undefined && id !== null && String(id) !== "-1" && String(id) !== "";
|
|
406
|
+
if (code === 1) return { done: false, duplicate: has };
|
|
407
|
+
const finished = route === "photo" ? data.finished || data.isFinish : data.finished;
|
|
408
|
+
return { done: !!finished && has, duplicate: false };
|
|
409
|
+
}
|
|
410
|
+
|
|
411
|
+
/**
|
|
412
|
+
* Photo URLs from a chunk reply, a replayed chunk's reply, or a `photo_success` control, filling a missing one from
|
|
413
|
+
* the others; null when there is no full set.
|
|
414
|
+
*
|
|
415
|
+
* @param {{normalUrl?: string, hdUrl?: string, thumbUrl?: string}} u
|
|
416
|
+
* @returns {{normalUrl: string, hdUrl: string, thumbUrl: string}|null}
|
|
417
|
+
*/
|
|
418
|
+
function photoUrls(u) {
|
|
419
|
+
const normalUrl = u?.normalUrl || u?.hdUrl;
|
|
420
|
+
const thumbUrl = u?.thumbUrl;
|
|
421
|
+
if (!normalUrl || !thumbUrl) return null;
|
|
422
|
+
return { normalUrl, hdUrl: u.hdUrl || normalUrl, thumbUrl };
|
|
423
|
+
}
|
|
424
|
+
|
|
425
|
+
/**
|
|
426
|
+
* The control's own `data` inside a settlement (our listener passes the whole control as the settlement's `data`;
|
|
427
|
+
* a listener that only calls the entry under the id makes none, see {@link awaitUrls}), parsed when it came as a
|
|
428
|
+
* JSON string.
|
|
429
|
+
*
|
|
430
|
+
* @param {import("../kernel/session.js").UploadSettlement} settlement
|
|
431
|
+
* @returns {object}
|
|
432
|
+
*/
|
|
433
|
+
function controlData(settlement) {
|
|
434
|
+
const raw = settlement?.data;
|
|
435
|
+
const content = raw && typeof raw === "object" ? (raw.content ?? raw) : {};
|
|
436
|
+
let d = content?.data;
|
|
437
|
+
if (typeof d === "string") {
|
|
438
|
+
try {
|
|
439
|
+
d = JSON.parse(d);
|
|
440
|
+
} catch {
|
|
441
|
+
d = null;
|
|
442
|
+
}
|
|
443
|
+
}
|
|
444
|
+
return d && typeof d === "object" ? d : {};
|
|
445
|
+
}
|
|
446
|
+
|
|
447
|
+
/**
|
|
448
|
+
* The URL(s) a settlement gives an upload, or null when it gives none.
|
|
449
|
+
*
|
|
450
|
+
* @param {"photo"|"file"} route
|
|
451
|
+
* @param {import("../kernel/session.js").UploadSettlement} settlement
|
|
452
|
+
* @returns {{fileUrl: string}|{normalUrl: string, hdUrl: string, thumbUrl: string}|null}
|
|
453
|
+
*/
|
|
454
|
+
function fromSettlement(route, settlement) {
|
|
455
|
+
const d = controlData(settlement);
|
|
456
|
+
if (route === "photo") return photoUrls({ normalUrl: d.org, hdUrl: d.hd, thumbUrl: d.thumb });
|
|
457
|
+
const url = settlement?.url ?? (typeof d.url === "string" ? d.url : null);
|
|
458
|
+
return typeof url === "string" && url ? { fileUrl: url } : null;
|
|
459
|
+
}
|
|
460
|
+
|
|
461
|
+
/**
|
|
462
|
+
* The URL(s) a replayed last chunk's reply gives, or null when it is not a valid answer for this upload.
|
|
463
|
+
*
|
|
464
|
+
* @param {"photo"|"file"} route
|
|
465
|
+
* @param {string} id - the photoId or fileId
|
|
466
|
+
* @param {object} data
|
|
467
|
+
* @returns {{fileUrl: string}|{normalUrl: string, hdUrl: string, thumbUrl: string}|null}
|
|
468
|
+
*/
|
|
469
|
+
function fromReplay(route, id, data) {
|
|
470
|
+
if (route === "photo") return String(data?.photoId) === id ? photoUrls(data) : null;
|
|
471
|
+
return String(data?.fileId) === id && typeof data?.url === "string" && data.url ? { fileUrl: data.url } : null;
|
|
472
|
+
}
|
|
473
|
+
|
|
474
|
+
/**
|
|
475
|
+
* Wait for the server's word on an uploaded file: the listener's settlement, or a replayed last chunk.
|
|
476
|
+
*
|
|
477
|
+
* Two listeners can deliver the settlement. Ours calls `ctx.uploadCallbacks.settle(id, {url, kind, data})` with the
|
|
478
|
+
* whole control; one that knows only the Map calls the function it finds under the id with `{fileUrl, fileId}`.
|
|
479
|
+
* So while a file waits, a callback of ours stands under its id (when nothing else is registered there). The
|
|
480
|
+
* callback takes only a `{fileUrl}` that is a non-empty string, and only for a file (a photo needs the whole set of
|
|
481
|
+
* URLs, which only the control has). Under our listener the registry's `settle()` calls that callback and then
|
|
482
|
+
* hands the waiter the control; the callback acts one macrotask later, so the control (which reached the waiter
|
|
483
|
+
* first) is what the upload uses, and the callback finds the wait over and does nothing. Either way the settlement
|
|
484
|
+
* was taken, so nothing is left in the registry's early cache.
|
|
485
|
+
*
|
|
486
|
+
* @param {import("../api.js").Session} s
|
|
487
|
+
* @param {object} p
|
|
488
|
+
* @param {"photo"|"file"} p.route
|
|
489
|
+
* @param {string} p.id - the photoId or fileId the settlement comes under
|
|
490
|
+
* @param {number} p.size - the file's size (it picks the replay delay)
|
|
491
|
+
* @param {() => Promise<{data: object, code: number}>} p.replay - send the last chunk again
|
|
492
|
+
* @param {ReturnType<typeof uploadSettings>} p.cfg
|
|
493
|
+
* @param {string} p.fileName - for the error
|
|
494
|
+
* @param {AbortSignal} [p.signal] - gives up waiting (the send failed elsewhere)
|
|
495
|
+
* @returns {Promise<{fileUrl: string}|{normalUrl: string, hdUrl: string, thumbUrl: string}>}
|
|
496
|
+
* @throws {ZaloApiError} code "UPLOAD_TIMEOUT" when nothing came within the wait and the last replay gave nothing,
|
|
497
|
+
* or {@link FINAL_REPLAY_GRACE_MS} after the wait whatever the last replay is doing
|
|
498
|
+
*/
|
|
499
|
+
function awaitUrls(s, { route, id, size, replay, cfg, fileName, signal }) {
|
|
500
|
+
return new Promise((resolve, reject) => {
|
|
501
|
+
const stop = new AbortController();
|
|
502
|
+
const start = s.now();
|
|
503
|
+
const replayAt = cfg.replay ? start + replayDelayMs(size, cfg.replaySeconds) : Infinity;
|
|
504
|
+
const deadline = start + cfg.waitMs;
|
|
505
|
+
const lastChance = deadline + (cfg.replay ? FINAL_REPLAY_GRACE_MS : 0);
|
|
506
|
+
let finished = false;
|
|
507
|
+
let replayed = false;
|
|
508
|
+
let replayedLast = false;
|
|
509
|
+
let timer = null;
|
|
510
|
+
const bridge = (d) => {
|
|
511
|
+
const url = d?.fileUrl;
|
|
512
|
+
if (route !== "file" || typeof url !== "string" || !url) return;
|
|
513
|
+
setImmediate(() => finish(resolve, { fileUrl: url }));
|
|
514
|
+
};
|
|
515
|
+
/** Stand under the id for a Map-only listener, unless something else is registered there. */
|
|
516
|
+
const plant = () => {
|
|
517
|
+
if (!finished && !s.uploads.has(id)) s.uploads.set(id, bridge);
|
|
518
|
+
};
|
|
519
|
+
const finish = (fn, value) => {
|
|
520
|
+
if (finished) return;
|
|
521
|
+
finished = true;
|
|
522
|
+
clearTimeout(timer);
|
|
523
|
+
stop.abort();
|
|
524
|
+
signal?.removeEventListener("abort", onAbort);
|
|
525
|
+
if (s.uploads.get(id) === bridge) s.uploads.delete(id);
|
|
526
|
+
fn(value);
|
|
527
|
+
};
|
|
528
|
+
const onAbort = () => finish(reject, signal.reason ?? new Error("aborted"));
|
|
529
|
+
if (signal?.aborted) return onAbort();
|
|
530
|
+
signal?.addEventListener("abort", onAbort, { once: true });
|
|
531
|
+
const timeout = (cause) => {
|
|
532
|
+
const err = new ZaloApiError(
|
|
533
|
+
`Zalo did not confirm the upload of ${fileName} within ${Math.round(cfg.waitMs / 1000)} s`,
|
|
534
|
+
);
|
|
535
|
+
err.code = "UPLOAD_TIMEOUT";
|
|
536
|
+
if (cause) err.cause = cause;
|
|
537
|
+
return err;
|
|
538
|
+
};
|
|
539
|
+
const tryReplay = async (last) => {
|
|
540
|
+
let urls = null;
|
|
541
|
+
let failure = null;
|
|
542
|
+
try {
|
|
543
|
+
const reply = await replay();
|
|
544
|
+
urls = fromReplay(route, id, reply.data);
|
|
545
|
+
} catch (e) {
|
|
546
|
+
failure = e;
|
|
547
|
+
}
|
|
548
|
+
if (urls) finish(resolve, urls);
|
|
549
|
+
else if (last) finish(reject, timeout(failure));
|
|
550
|
+
};
|
|
551
|
+
|
|
552
|
+
const wait = () => {
|
|
553
|
+
plant();
|
|
554
|
+
s.uploads
|
|
555
|
+
.waitFor(id, { signal: stop.signal })
|
|
556
|
+
.then((settlement) => {
|
|
557
|
+
const urls = fromSettlement(route, settlement);
|
|
558
|
+
if (urls) finish(resolve, urls);
|
|
559
|
+
else if (!finished) wait(); // a control without what we need: keep waiting
|
|
560
|
+
})
|
|
561
|
+
.catch(() => {});
|
|
562
|
+
};
|
|
563
|
+
wait();
|
|
564
|
+
|
|
565
|
+
const check = () => {
|
|
566
|
+
if (finished) return;
|
|
567
|
+
const now = s.now();
|
|
568
|
+
if (now >= lastChance) {
|
|
569
|
+
// The last replay never answered (or there is none): give up whatever it is doing.
|
|
570
|
+
finish(reject, timeout(null));
|
|
571
|
+
return;
|
|
572
|
+
}
|
|
573
|
+
if (now >= deadline && !replayedLast) {
|
|
574
|
+
replayedLast = true;
|
|
575
|
+
replayed = true; // the early replay, if it was still due, is this one
|
|
576
|
+
tryReplay(true);
|
|
577
|
+
}
|
|
578
|
+
if (!replayed && now >= replayAt) {
|
|
579
|
+
replayed = true;
|
|
580
|
+
tryReplay(false);
|
|
581
|
+
}
|
|
582
|
+
plant(); // back in place should it have expired (a server wait longer than the registry's entry life)
|
|
583
|
+
timer = setTimeout(check, TICK_MS);
|
|
584
|
+
};
|
|
585
|
+
check();
|
|
586
|
+
});
|
|
587
|
+
}
|
|
588
|
+
|
|
589
|
+
/**
|
|
590
|
+
* Upload one photo or file in chunks and learn its URL(s).
|
|
591
|
+
*
|
|
592
|
+
* @param {import("../api.js").Session} s
|
|
593
|
+
* @param {object} item - from {@link inspect}
|
|
594
|
+
* @param {{group: boolean, threadId: string, cfg: ReturnType<typeof uploadSettings>, signal?: AbortSignal}} where
|
|
595
|
+
* @returns {Promise<{item: object, clientId: number, reply: object, urls: object|null, wait: Promise<object>|null}>}
|
|
596
|
+
* `wait` resolves to the URL(s) when they come later (a file, or a photo whose reply had none)
|
|
597
|
+
*/
|
|
598
|
+
async function uploadChunks(s, item, { group, threadId, cfg, signal }) {
|
|
599
|
+
const route = item.route;
|
|
600
|
+
const def = chunkEndpoint(route, group);
|
|
601
|
+
const clientId = s.nextClientId();
|
|
602
|
+
const totalChunk = Math.max(1, Math.ceil(item.size / cfg.chunkSize));
|
|
603
|
+
const base = {
|
|
604
|
+
totalChunk,
|
|
605
|
+
fileName: item.fileName,
|
|
606
|
+
clientId,
|
|
607
|
+
totalSize: item.size,
|
|
608
|
+
imei: s.ctx.imei,
|
|
609
|
+
chunkId: 0,
|
|
610
|
+
...threadParam(threadId, group),
|
|
611
|
+
};
|
|
612
|
+
const argsOf = async (chunkId) => {
|
|
613
|
+
const start = (chunkId - 1) * cfg.chunkSize;
|
|
614
|
+
const bytes = await readRange(item.file, start, Math.min(cfg.chunkSize, item.size - start));
|
|
615
|
+
return { params: { ...base, chunkId }, fileName: item.fileName, bytes };
|
|
616
|
+
};
|
|
617
|
+
// Chunks are read one after another, so they go out in chunkId order however the reads interleave.
|
|
618
|
+
let reading = Promise.resolve();
|
|
619
|
+
const post = async (chunkId) => {
|
|
620
|
+
const read = reading.then(() => argsOf(chunkId));
|
|
621
|
+
reading = read.catch(() => {});
|
|
622
|
+
const args = await read;
|
|
623
|
+
const reply = await s.call(def, args);
|
|
624
|
+
return { ...reply, ...chunkState(route, reply), args };
|
|
625
|
+
};
|
|
626
|
+
|
|
627
|
+
// Every chunk but the last, at most MAX_CHUNKS_IN_FLIGHT at a time; a reply that already settles the
|
|
628
|
+
// upload (finished, or "already uploaded") ends it early.
|
|
629
|
+
let next = 1;
|
|
630
|
+
let early = null;
|
|
631
|
+
let failed = false;
|
|
632
|
+
const worker = async () => {
|
|
633
|
+
while (!failed && !early && next < totalChunk) {
|
|
634
|
+
const chunkId = next++;
|
|
635
|
+
try {
|
|
636
|
+
const r = await post(chunkId);
|
|
637
|
+
if (r.done || r.duplicate) early ??= r;
|
|
638
|
+
} catch (e) {
|
|
639
|
+
failed = true;
|
|
640
|
+
throw e;
|
|
641
|
+
}
|
|
642
|
+
}
|
|
643
|
+
};
|
|
644
|
+
await Promise.all(Array.from({ length: Math.min(MAX_CHUNKS_IN_FLIGHT, totalChunk - 1) }, worker));
|
|
645
|
+
const last = early ?? (await post(totalChunk));
|
|
646
|
+
const data = last.data;
|
|
647
|
+
|
|
648
|
+
if (!last.done && !last.duplicate) {
|
|
649
|
+
throw new ZaloApiError(`Zalo did not finish the upload of ${item.fileName}`, last.code || null);
|
|
650
|
+
}
|
|
651
|
+
const id = String(route === "photo" ? data.photoId : data.fileId);
|
|
652
|
+
const replay = () => s.call(def, last.args);
|
|
653
|
+
|
|
654
|
+
if (route === "photo") {
|
|
655
|
+
const urls = photoUrls(data);
|
|
656
|
+
if (urls) return { item, clientId, reply: data, urls, wait: null };
|
|
657
|
+
} else if (last.duplicate && typeof data.url === "string" && data.url) {
|
|
658
|
+
return { item, clientId, reply: data, urls: { fileUrl: data.url }, wait: null };
|
|
659
|
+
}
|
|
660
|
+
if (last.duplicate) {
|
|
661
|
+
// A duplicate with no URL is given up on (a retry would need a new clientId).
|
|
662
|
+
throw new ZaloApiError(`Zalo reports ${item.fileName} as already uploaded but gave no URL for it`, 1);
|
|
663
|
+
}
|
|
664
|
+
const wait = awaitUrls(s, { route, id, size: item.size, replay, cfg, fileName: item.fileName, signal });
|
|
665
|
+
wait.catch(() => {}); // awaited by the caller; never an unhandled rejection meanwhile
|
|
666
|
+
return { item, clientId, reply: data, urls: null, wait };
|
|
667
|
+
}
|
|
668
|
+
|
|
669
|
+
/**
|
|
670
|
+
* Upload every photo and file of a send, one file after another (a file's settlement wait does not hold up the
|
|
671
|
+
* next upload), then wait for every URL.
|
|
672
|
+
*
|
|
673
|
+
* @param {import("../api.js").Session} s
|
|
674
|
+
* @param {object[]} items
|
|
675
|
+
* @param {{group: boolean, threadId: string, cfg: ReturnType<typeof uploadSettings>}} where
|
|
676
|
+
* @returns {Promise<Array<{item: object, clientId: number, reply: object, urls: object}>>}
|
|
677
|
+
*/
|
|
678
|
+
async function uploadAll(s, items, where) {
|
|
679
|
+
// A failure anywhere ends the other files' waits too, so no timer outlives the call.
|
|
680
|
+
const giveUp = new AbortController();
|
|
681
|
+
const at = { ...where, signal: giveUp.signal };
|
|
682
|
+
const uploads = [];
|
|
683
|
+
try {
|
|
684
|
+
for (const item of items) uploads.push(await uploadChunks(s, item, at));
|
|
685
|
+
for (const u of uploads) if (!u.urls) u.urls = await u.wait;
|
|
686
|
+
for (const u of uploads) {
|
|
687
|
+
if (u.item.route === "file") u.checksum = await md5Of(u.item.file, u.item.size);
|
|
688
|
+
}
|
|
689
|
+
} catch (e) {
|
|
690
|
+
giveUp.abort(e);
|
|
691
|
+
throw e;
|
|
692
|
+
}
|
|
693
|
+
return uploads;
|
|
694
|
+
}
|
|
695
|
+
|
|
696
|
+
/**
|
|
697
|
+
* The result `uploadAttachment` gives for one upload, the shape its callers have always read.
|
|
698
|
+
*
|
|
699
|
+
* @param {object} u
|
|
700
|
+
* @returns {object}
|
|
701
|
+
*/
|
|
702
|
+
function uploadResult(u) {
|
|
703
|
+
const { item, reply, urls } = u;
|
|
704
|
+
if (item.route === "photo") {
|
|
705
|
+
return {
|
|
706
|
+
fileType: "image",
|
|
707
|
+
width: item.width,
|
|
708
|
+
height: item.height,
|
|
709
|
+
totalSize: item.size,
|
|
710
|
+
hdSize: item.size,
|
|
711
|
+
finished: reply.finished,
|
|
712
|
+
normalUrl: urls.normalUrl,
|
|
713
|
+
hdUrl: urls.hdUrl,
|
|
714
|
+
thumbUrl: urls.thumbUrl,
|
|
715
|
+
chunkId: reply.chunkId,
|
|
716
|
+
photoId: reply.photoId,
|
|
717
|
+
clientFileId: reply.clientFileId,
|
|
718
|
+
};
|
|
719
|
+
}
|
|
720
|
+
return {
|
|
721
|
+
fileType: item.fileType,
|
|
722
|
+
...reply,
|
|
723
|
+
fileUrl: urls.fileUrl,
|
|
724
|
+
fileId: String(reply.fileId),
|
|
725
|
+
totalSize: item.size,
|
|
726
|
+
fileName: item.fileName,
|
|
727
|
+
checksum: u.checksum,
|
|
728
|
+
};
|
|
729
|
+
}
|
|
730
|
+
|
|
731
|
+
/**
|
|
732
|
+
* Stamp a send's reply with the clientId it went out with (Zalo answers only `msgId`).
|
|
733
|
+
*
|
|
734
|
+
* @param {unknown} reply
|
|
735
|
+
* @param {number|string} clientId
|
|
736
|
+
* @returns {object}
|
|
737
|
+
*/
|
|
738
|
+
function stamped(reply, clientId) {
|
|
739
|
+
const out = reply && typeof reply === "object" ? reply : {};
|
|
740
|
+
out.cliMsgId = String(clientId);
|
|
741
|
+
return out;
|
|
742
|
+
}
|
|
743
|
+
|
|
744
|
+
/**
|
|
745
|
+
* The upload calls, bound to one session handle.
|
|
746
|
+
*
|
|
747
|
+
* @param {import("../api.js").Session} s
|
|
748
|
+
* @returns {{
|
|
749
|
+
* sendAttachments: (message: {msg?: string, attachments: string|string[], quote?: object, mentions?: object[],
|
|
750
|
+
* styles?: object[], urgency?: number, ttl?: number}, threadId: string, type?: number) =>
|
|
751
|
+
* Promise<{message: object|null, attachment: object[]}>,
|
|
752
|
+
* uploadAttachment: (sources: string|string[], threadId: string, type?: number) => Promise<object[]>,
|
|
753
|
+
* sendVideoFile: (options: object, threadId: string, type?: number) => Promise<object>,
|
|
754
|
+
* }}
|
|
755
|
+
*/
|
|
756
|
+
export function uploadMethods(s) {
|
|
757
|
+
/**
|
|
758
|
+
* Refuse an empty list, too many files, or a missing thread before anything is read.
|
|
759
|
+
*
|
|
760
|
+
* @param {unknown} list
|
|
761
|
+
* @param {string} threadId
|
|
762
|
+
* @param {ReturnType<typeof uploadSettings>} cfg
|
|
763
|
+
* @returns {string[]}
|
|
764
|
+
*/
|
|
765
|
+
const checkList = (list, threadId, cfg) => {
|
|
766
|
+
if (!threadId) throw new ZaloApiError("Missing threadId");
|
|
767
|
+
const files = list === undefined || list === null ? [] : Array.isArray(list) ? list : [list];
|
|
768
|
+
if (!files.length) throw new ZaloApiError("Missing sources");
|
|
769
|
+
if (cfg.maxFile !== null && files.length > cfg.maxFile) {
|
|
770
|
+
throw new ZaloApiError("Exceed maximum file of " + cfg.maxFile);
|
|
771
|
+
}
|
|
772
|
+
return files;
|
|
773
|
+
};
|
|
774
|
+
|
|
775
|
+
/**
|
|
776
|
+
* Upload files to a conversation without sending them.
|
|
777
|
+
*
|
|
778
|
+
* @param {string|string[]} sources - local file paths
|
|
779
|
+
* @param {string} threadId - the user or group the files are for
|
|
780
|
+
* @param {number} [type] - 0 a user, 1 a group
|
|
781
|
+
* @returns {Promise<object[]>} one result per file, in order: a photo's `{fileType: "image", width, height,
|
|
782
|
+
* totalSize, hdSize, finished, normalUrl, hdUrl, thumbUrl, chunkId, photoId, clientFileId}`, a file's upload
|
|
783
|
+
* reply plus `{fileType, fileUrl, fileId, totalSize, fileName, checksum}`
|
|
784
|
+
*/
|
|
785
|
+
async function uploadAttachment(sources, threadId, type = THREAD_TYPE.USER) {
|
|
786
|
+
const cfg = uploadSettings(s.ctx);
|
|
787
|
+
const files = checkList(sources, threadId, cfg);
|
|
788
|
+
const group = Number(type) === THREAD_TYPE.GROUP;
|
|
789
|
+
// A GIF goes up through this call as a plain file, as it always has.
|
|
790
|
+
const items = (await inspect(s.ctx, files, cfg)).map((it) =>
|
|
791
|
+
it.route === "gif" ? { ...it, route: "file", fileType: "others" } : it,
|
|
792
|
+
);
|
|
793
|
+
const uploads = await uploadAll(s, items, { group, threadId: String(threadId), cfg });
|
|
794
|
+
return uploads.map(uploadResult);
|
|
795
|
+
}
|
|
796
|
+
|
|
797
|
+
/**
|
|
798
|
+
* Send local files to a conversation, with an optional caption: the `attachments` half of `sendMessage`.
|
|
799
|
+
*
|
|
800
|
+
* @param {{msg?: string, attachments: string|string[], quote?: object, mentions?: object[], styles?: object[],
|
|
801
|
+
* urgency?: number, ttl?: number}} message - `attachments` are local file paths
|
|
802
|
+
* @param {string} threadId - the user or group to send to
|
|
803
|
+
* @param {number} [type] - 0 a user, 1 a group
|
|
804
|
+
* @returns {Promise<{message: object|null, attachment: object[]}>} `message` is the caption's own send, when it
|
|
805
|
+
* went separately; `attachment[i]` the send of each file (`{msgId, cliMsgId}`), photos and files in the order
|
|
806
|
+
* given, then GIFs
|
|
807
|
+
*/
|
|
808
|
+
async function sendAttachments(message, threadId, type = THREAD_TYPE.USER) {
|
|
809
|
+
const cfg = uploadSettings(s.ctx);
|
|
810
|
+
const files = checkList(message?.attachments, threadId, cfg);
|
|
811
|
+
const group = Number(type) === THREAD_TYPE.GROUP;
|
|
812
|
+
const thread = String(threadId);
|
|
813
|
+
const items = await inspect(s.ctx, files, cfg);
|
|
814
|
+
|
|
815
|
+
const caption = typeof message.msg === "string" ? message.msg : "";
|
|
816
|
+
const asDesc = items.length === 1 && items[0].route === "photo";
|
|
817
|
+
const responses = { message: null, attachment: [] };
|
|
818
|
+
let desc = caption;
|
|
819
|
+
if (caption.length > 0 && (!asDesc || message.quote)) {
|
|
820
|
+
const text = { ...message };
|
|
821
|
+
delete text.attachments;
|
|
822
|
+
const sent = await s.api.sendMessage(text, threadId, type);
|
|
823
|
+
responses.message = sent?.message ?? null;
|
|
824
|
+
desc = "";
|
|
825
|
+
}
|
|
826
|
+
|
|
827
|
+
const where = { group, threadId: thread, cfg };
|
|
828
|
+
const uploads = await uploadAll(
|
|
829
|
+
s,
|
|
830
|
+
items.filter((it) => it.route !== "gif"),
|
|
831
|
+
where,
|
|
832
|
+
);
|
|
833
|
+
const gifs = [];
|
|
834
|
+
for (const item of items.filter((it) => it.route === "gif")) {
|
|
835
|
+
const clientId = s.nextClientId();
|
|
836
|
+
const bytes = await readRange(item.file, 0, item.size);
|
|
837
|
+
const thumb = await s.call(UPTHUMB, { params: { clientId, imei: s.ctx.imei }, bytes });
|
|
838
|
+
gifs.push({ item, clientId, bytes, thumbUrl: thumb?.url, checksum: await md5Of(item.file, item.size) });
|
|
839
|
+
}
|
|
840
|
+
|
|
841
|
+
const photos = uploads.filter((u) => u.item.route === "photo");
|
|
842
|
+
const layout = photos.length > 1 ? String(s.now()) : null;
|
|
843
|
+
const language = s.ctx.language;
|
|
844
|
+
for (const u of uploads) {
|
|
845
|
+
const { item, clientId, urls } = u;
|
|
846
|
+
let params;
|
|
847
|
+
let def;
|
|
848
|
+
if (item.route === "photo") {
|
|
849
|
+
const index = photos.indexOf(u);
|
|
850
|
+
params = {
|
|
851
|
+
photoId: u.reply.photoId,
|
|
852
|
+
clientId: String(clientId),
|
|
853
|
+
desc,
|
|
854
|
+
width: item.width,
|
|
855
|
+
height: item.height,
|
|
856
|
+
rawUrl: urls.normalUrl,
|
|
857
|
+
thumbUrl: urls.thumbUrl,
|
|
858
|
+
hdUrl: urls.hdUrl,
|
|
859
|
+
...(group ? { oriUrl: urls.normalUrl } : { normalUrl: urls.normalUrl }),
|
|
860
|
+
...(layout
|
|
861
|
+
? { groupLayoutId: layout, idInGroup: index, isGroupLayout: 1, totalItemInGroup: photos.length }
|
|
862
|
+
: {}),
|
|
863
|
+
...threadParam(thread, group),
|
|
864
|
+
language,
|
|
865
|
+
...(layout ? { extMsgProp: JSON.stringify({ groupMediaMsg: { groupLayoutId: layout } }) } : {}),
|
|
866
|
+
zsource: -1,
|
|
867
|
+
ttl: 0,
|
|
868
|
+
imei: s.ctx.imei,
|
|
869
|
+
};
|
|
870
|
+
def = photoSendEndpoint(group);
|
|
871
|
+
} else {
|
|
872
|
+
params = {
|
|
873
|
+
fileId: String(u.reply.fileId),
|
|
874
|
+
checksum: u.checksum,
|
|
875
|
+
checksumSha: "",
|
|
876
|
+
extension: item.ext,
|
|
877
|
+
totalSize: item.size,
|
|
878
|
+
fileName: item.fileName,
|
|
879
|
+
clientId,
|
|
880
|
+
fType: 1,
|
|
881
|
+
fileCount: 0,
|
|
882
|
+
fdata: "{}",
|
|
883
|
+
...threadParam(thread, group),
|
|
884
|
+
fileUrl: urls.fileUrl,
|
|
885
|
+
zsource: -1,
|
|
886
|
+
ttl: 0,
|
|
887
|
+
...(group ? {} : { imei: s.ctx.imei }),
|
|
888
|
+
};
|
|
889
|
+
def = fileSendEndpoint(group);
|
|
890
|
+
}
|
|
891
|
+
responses.attachment.push(stamped(await s.call(def, { params }), clientId));
|
|
892
|
+
}
|
|
893
|
+
for (const g of gifs) {
|
|
894
|
+
const params = {
|
|
895
|
+
clientId: String(g.clientId),
|
|
896
|
+
fileName: g.item.fileName,
|
|
897
|
+
totalSize: g.item.size,
|
|
898
|
+
width: g.item.width,
|
|
899
|
+
height: g.item.height,
|
|
900
|
+
msg: desc,
|
|
901
|
+
type: 1,
|
|
902
|
+
ttl: 0,
|
|
903
|
+
...(group ? { visibility: 0 } : {}),
|
|
904
|
+
...threadParam(thread, group),
|
|
905
|
+
thumb: g.thumbUrl,
|
|
906
|
+
checksum: g.checksum,
|
|
907
|
+
totalChunk: 1,
|
|
908
|
+
chunkId: 1,
|
|
909
|
+
};
|
|
910
|
+
const reply = await sendGifChunks(s, g, group, params);
|
|
911
|
+
responses.attachment.push(stamped(reply, g.clientId));
|
|
912
|
+
}
|
|
913
|
+
return responses;
|
|
914
|
+
}
|
|
915
|
+
|
|
916
|
+
/**
|
|
917
|
+
* Send a local video file as a video message: the
|
|
918
|
+
* video uploaded as a file (its URL comes from the listener's `video_done`/`file_done`), the thumbnail uploaded
|
|
919
|
+
* as a photo when it is a local file, then the forward-video send. Unverified live.
|
|
920
|
+
*
|
|
921
|
+
* @param {{file: string, thumbnailFile?: string, thumbnailUrl?: string, msg?: string, duration?: number,
|
|
922
|
+
* width: number, height: number, ttl?: number}} options - a local thumbnail or its URL; `duration` in ms
|
|
923
|
+
* @param {string} threadId
|
|
924
|
+
* @param {number} [type] - 0 a user, 1 a group
|
|
925
|
+
* @returns {Promise<{msgId: string, cliMsgId: string, videoUrl: string, thumbnailUrl: string}>}
|
|
926
|
+
* @throws {ZaloApiError} before any request, for no file, a file that is not a video's route (a photo or a GIF),
|
|
927
|
+
* no thumbnail, missing geometry or a thread type other than 0/1
|
|
928
|
+
*/
|
|
929
|
+
async function sendVideoFile(options, threadId, type = THREAD_TYPE.USER) {
|
|
930
|
+
const t = Number(type);
|
|
931
|
+
if (t !== THREAD_TYPE.USER && t !== THREAD_TYPE.GROUP) throw new ZaloApiError("Thread type is invalid");
|
|
932
|
+
if (!options?.file) throw new ZaloApiError("Missing video file");
|
|
933
|
+
if (!options.thumbnailFile && !options.thumbnailUrl) {
|
|
934
|
+
throw new ZaloApiError(
|
|
935
|
+
"A video needs a thumbnail: a local image (thumbnailFile) or its URL (thumbnailUrl)",
|
|
936
|
+
);
|
|
937
|
+
}
|
|
938
|
+
if (!(Number(options.width) > 0) || !(Number(options.height) > 0)) {
|
|
939
|
+
throw new ZaloApiError("A video needs its width and height (Zalo refuses one without them, code 114)");
|
|
940
|
+
}
|
|
941
|
+
const cfg = uploadSettings(s.ctx);
|
|
942
|
+
checkList([options.file], threadId, cfg);
|
|
943
|
+
const [video] = await inspect(s.ctx, [options.file], cfg);
|
|
944
|
+
if (video.route !== "file") throw new ZaloApiError(`${video.fileName} is not a video file`);
|
|
945
|
+
const items = [{ ...video, fileType: "video" }];
|
|
946
|
+
if (options.thumbnailFile && !options.thumbnailUrl) {
|
|
947
|
+
const [thumb] = await inspect(s.ctx, [options.thumbnailFile], cfg);
|
|
948
|
+
if (thumb.route !== "photo") throw new ZaloApiError(`${thumb.fileName} is not a jpg, png or webp image`);
|
|
949
|
+
items.push(thumb);
|
|
950
|
+
}
|
|
951
|
+
const group = t === THREAD_TYPE.GROUP;
|
|
952
|
+
const uploads = await uploadAll(s, items, { group, threadId: String(threadId), cfg });
|
|
953
|
+
const videoUrl = uploads[0].urls?.fileUrl;
|
|
954
|
+
if (!videoUrl) throw new ZaloApiError("Zalo gave no address for the uploaded video");
|
|
955
|
+
const thumbUrls = uploads[1]?.urls ?? {};
|
|
956
|
+
const thumbnailUrl = options.thumbnailUrl ?? thumbUrls.hdUrl ?? thumbUrls.normalUrl ?? thumbUrls.thumbUrl;
|
|
957
|
+
if (!thumbnailUrl) throw new ZaloApiError("Zalo gave no address for the uploaded thumbnail");
|
|
958
|
+
const sent = await s.api.sendVideo(
|
|
959
|
+
{
|
|
960
|
+
videoUrl,
|
|
961
|
+
thumbnailUrl,
|
|
962
|
+
msg: options.msg,
|
|
963
|
+
duration: options.duration,
|
|
964
|
+
width: Number(options.width),
|
|
965
|
+
height: Number(options.height),
|
|
966
|
+
ttl: options.ttl,
|
|
967
|
+
fileSize: video.size,
|
|
968
|
+
},
|
|
969
|
+
threadId,
|
|
970
|
+
t,
|
|
971
|
+
);
|
|
972
|
+
return { ...sent, videoUrl, thumbnailUrl };
|
|
973
|
+
}
|
|
974
|
+
|
|
975
|
+
return { sendAttachments, uploadAttachment, sendVideoFile };
|
|
976
|
+
}
|