@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,1058 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* The runtime policy store: what a deployment may change while the server runs (confirmMode, hiddenChats, approval,
|
|
3
|
+
* media delivery and links, webhooks, quotas, retention), kept apart from the files and the environment that are read
|
|
4
|
+
* once at start.
|
|
5
|
+
*
|
|
6
|
+
* - **Files.** One per account, `<accountDir>/policy.json`, and one per tenant, `<configDir>/tenants/<tenantId>.json`
|
|
7
|
+
* (a tenant is a group of accounts: `quota.tenant.accounts`). Each is `{rev, updatedAt, updatedBy, policy}`, sealed
|
|
8
|
+
* under the boot key (src/core/keystore), so it opens without a login. A tenant's files share the keyring of
|
|
9
|
+
* `<configDir>/tenants/`.
|
|
10
|
+
* - **Users.** `<configDir>/users/<userId>.json` (opaque CRM ids): a user belongs to exactly one tenant (`tenant`) and
|
|
11
|
+
* owns accounts (`accounts`); each account has exactly one owning user. A tenant's accounts are its users' accounts
|
|
12
|
+
* and its legacy `quota.tenant.accounts` list; a write that would put an account under two tenants, or under two
|
|
13
|
+
* users, is refused (MEMBERSHIP). Caps and quotas count toward the owner.
|
|
14
|
+
* - **Layers.** defaults < files < environment < policy; within the policy, a tenant's (in tenant id order), then the
|
|
15
|
+
* owning user's, then the account's own. The resolvers read it through ./policy-layer.js on every call.
|
|
16
|
+
* - **Always-on cap.** `presence.alwaysOn.maxPerUser` (tenant or user policy, default 1) and `maxPerTenant` (tenant,
|
|
17
|
+
* default none). A write that takes a user or tenant over its cap demotes the **oldest** always-on account to
|
|
18
|
+
* on-demand (owner decision 2026-11-08), as a lowered cap does: an account-level `presence.mode: "on-demand"` written
|
|
19
|
+
* by `presence-cap`, a `presence_changed` hook ({@link onPresenceChange}) and an audit line. The check runs under a
|
|
20
|
+
* host lock (`users/.presence.lock`), so two writers cannot both pass it.
|
|
21
|
+
* - **Writers.** The admin API on the MCP HTTP server (src/core/admin-api.js), `zalo-agent policy set|unset` (through
|
|
22
|
+
* the daemon's channel when one runs, else the file), and a file drop: a config-management tool writes the file as
|
|
23
|
+
* plain JSON; the watcher of a running daemon (debounced) checks it and seals it, or rejects it, keeps the last good
|
|
24
|
+
* policy and saves the rejected text beside it as `policy.json.rejected`.
|
|
25
|
+
* - **Revisions.** Every change raises `rev`. A writer may name the rev it read (`If-Match`): a different one is a
|
|
26
|
+
* conflict and nothing is written.
|
|
27
|
+
* - **Audit.** `<configDir>/policy-audit.log`, one JSON line per change or refusal: when, who, which file, which keys,
|
|
28
|
+
* the old and new rev. Never a value: a webhook URL can carry a token.
|
|
29
|
+
*/
|
|
30
|
+
import {
|
|
31
|
+
appendFileSync,
|
|
32
|
+
existsSync,
|
|
33
|
+
mkdirSync,
|
|
34
|
+
readFileSync,
|
|
35
|
+
readdirSync,
|
|
36
|
+
renameSync,
|
|
37
|
+
rmSync,
|
|
38
|
+
statSync,
|
|
39
|
+
watch,
|
|
40
|
+
writeFileSync,
|
|
41
|
+
} from "node:fs";
|
|
42
|
+
import { join } from "node:path";
|
|
43
|
+
import { CONFIG_DIR, getAccountDir } from "./credentials.js";
|
|
44
|
+
import { isSealed, openBuffer, scopeOfDir, writeSealedJson } from "./keystore/index.js";
|
|
45
|
+
import { setPolicyProvider } from "./policy-layer.js";
|
|
46
|
+
import { setTenantLookup } from "./storage-quota.js";
|
|
47
|
+
import { changedKeys, flattenPolicy, mergePolicy, policyGet, validatePolicy } from "./policy-schema.js";
|
|
48
|
+
import { onLeaveChangeNote } from "./group-exit.js";
|
|
49
|
+
import { writeFileAtomic } from "../zalo/kernel/atomic-file.js";
|
|
50
|
+
|
|
51
|
+
/** The account's policy file. */
|
|
52
|
+
export const POLICY_FILE = "policy.json";
|
|
53
|
+
const SPEC = Object.freeze({ kind: "policy", use: "boot" });
|
|
54
|
+
// `keyring` is the tenants' folder's own keyring.json (src/core/keystore/keyring.js), never a tenant.
|
|
55
|
+
const TENANT_ID = /^(?!keyring$)[A-Za-z0-9][A-Za-z0-9_-]{0,63}$/;
|
|
56
|
+
const ACCOUNT_ID = /^[1-9][0-9]{0,30}$/;
|
|
57
|
+
// A user is the CRM's opaque id, as a tenant is.
|
|
58
|
+
const USER_ID = TENANT_ID;
|
|
59
|
+
|
|
60
|
+
/** The default `presence.alwaysOn.maxPerUser`. */
|
|
61
|
+
export const DEFAULT_ALWAYS_ON_PER_USER = 1;
|
|
62
|
+
|
|
63
|
+
/**
|
|
64
|
+
* A policy write that could not be done: `code` is INVALID, RESTART_REQUIRED, CONFLICT, NOT_FOUND, BUSY or MEMBERSHIP
|
|
65
|
+
* (an account under two users or two tenants).
|
|
66
|
+
*/
|
|
67
|
+
export class PolicyError extends Error {
|
|
68
|
+
/**
|
|
69
|
+
* @param {string} message
|
|
70
|
+
* @param {string} code
|
|
71
|
+
* @param {object} [details]
|
|
72
|
+
*/
|
|
73
|
+
constructor(message, code, details = {}) {
|
|
74
|
+
super(message);
|
|
75
|
+
this.name = "PolicyError";
|
|
76
|
+
this.code = code;
|
|
77
|
+
this.details = details;
|
|
78
|
+
Object.assign(this, details);
|
|
79
|
+
}
|
|
80
|
+
}
|
|
81
|
+
|
|
82
|
+
/** @returns {string} */
|
|
83
|
+
export function tenantsDir() {
|
|
84
|
+
return join(CONFIG_DIR, "tenants");
|
|
85
|
+
}
|
|
86
|
+
|
|
87
|
+
/** @returns {string} */
|
|
88
|
+
export function usersDir() {
|
|
89
|
+
return join(CONFIG_DIR, "users");
|
|
90
|
+
}
|
|
91
|
+
|
|
92
|
+
/** @returns {string} */
|
|
93
|
+
export function policyAuditFile() {
|
|
94
|
+
return join(CONFIG_DIR, "policy-audit.log");
|
|
95
|
+
}
|
|
96
|
+
|
|
97
|
+
/**
|
|
98
|
+
* Check a policy target and name its file.
|
|
99
|
+
*
|
|
100
|
+
* @param {{kind: "account"|"user"|"tenant", id: string}} target
|
|
101
|
+
* @returns {{kind: string, id: string, file: string, dir: string, label: string}}
|
|
102
|
+
*/
|
|
103
|
+
export function resolveTarget(target) {
|
|
104
|
+
const kind = target?.kind === "tenant" ? "tenant" : target?.kind === "user" ? "user" : "account";
|
|
105
|
+
const id = String(target?.id ?? "").trim();
|
|
106
|
+
if (kind === "user") {
|
|
107
|
+
if (!USER_ID.test(id)) throw new PolicyError(`"${id}" is not a user id (letters, digits, - and _)`, "INVALID");
|
|
108
|
+
return { kind, id, dir: usersDir(), file: join(usersDir(), `${id}.json`), label: `user:${id}` };
|
|
109
|
+
}
|
|
110
|
+
if (kind === "tenant") {
|
|
111
|
+
if (!TENANT_ID.test(id))
|
|
112
|
+
throw new PolicyError(`"${id}" is not a tenant id (letters, digits, - and _)`, "INVALID");
|
|
113
|
+
return { kind, id, dir: tenantsDir(), file: join(tenantsDir(), `${id}.json`), label: `tenant:${id}` };
|
|
114
|
+
}
|
|
115
|
+
if (!ACCOUNT_ID.test(id)) throw new PolicyError(`"${id}" is not an account id`, "INVALID");
|
|
116
|
+
const dir = getAccountDir(id);
|
|
117
|
+
return { kind, id, dir, file: join(dir, POLICY_FILE), label: `account:${id}` };
|
|
118
|
+
}
|
|
119
|
+
|
|
120
|
+
/** A dropped (plain JSON) document: `{policy, rev?}`, or the policy object itself. */
|
|
121
|
+
function droppedDoc(text, file) {
|
|
122
|
+
let parsed;
|
|
123
|
+
try {
|
|
124
|
+
parsed = JSON.parse(text);
|
|
125
|
+
} catch (e) {
|
|
126
|
+
throw new PolicyError(`${file} is not valid JSON (${e.message})`, "INVALID", { errors: [] });
|
|
127
|
+
}
|
|
128
|
+
if (!parsed || typeof parsed !== "object" || Array.isArray(parsed))
|
|
129
|
+
throw new PolicyError(`${file} must hold a JSON object`, "INVALID", { errors: [] });
|
|
130
|
+
const wrapped = Boolean(parsed.policy && typeof parsed.policy === "object");
|
|
131
|
+
const policy = wrapped ? parsed.policy : parsed;
|
|
132
|
+
const rev = Number.isInteger(parsed.rev) && parsed.policy ? parsed.rev : null;
|
|
133
|
+
return { policy, rev, tenant: wrapped ? (parsed.tenant ?? null) : null, accounts: wrapped ? parsed.accounts : [] };
|
|
134
|
+
}
|
|
135
|
+
|
|
136
|
+
/**
|
|
137
|
+
* Check a user's membership fields. A user names exactly one tenant and owns a list of account ids.
|
|
138
|
+
*
|
|
139
|
+
* @param {{tenant?: unknown, accounts?: unknown}} m
|
|
140
|
+
* @returns {{tenant: string|null, accounts: string[], errors: Array<{key: string, error: string}>}}
|
|
141
|
+
*/
|
|
142
|
+
export function validateMembership(m) {
|
|
143
|
+
const errors = [];
|
|
144
|
+
let tenant = m?.tenant ?? null;
|
|
145
|
+
if (tenant !== null) {
|
|
146
|
+
tenant = String(tenant).trim();
|
|
147
|
+
if (!TENANT_ID.test(tenant)) errors.push({ key: "tenant", error: "is not a tenant id" });
|
|
148
|
+
}
|
|
149
|
+
const raw = m?.accounts ?? [];
|
|
150
|
+
const okShape = Array.isArray(raw) || typeof raw === "string";
|
|
151
|
+
const list = Array.isArray(raw) ? raw : okShape ? String(raw).split(",") : [];
|
|
152
|
+
const accounts = [...new Set(list.map((a) => String(a).trim()).filter(Boolean))].sort();
|
|
153
|
+
if (!okShape) errors.push({ key: "accounts", error: "is not a list" });
|
|
154
|
+
else if (accounts.some((a) => !ACCOUNT_ID.test(a)))
|
|
155
|
+
errors.push({ key: "accounts", error: "is not a list of account ids" });
|
|
156
|
+
return { tenant, accounts, errors };
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/** The user-only fields of a document: who it belongs to, what it owns, and the cap's bookkeeping. */
|
|
160
|
+
function memberFields(doc) {
|
|
161
|
+
return {
|
|
162
|
+
tenant: doc?.tenant ?? null,
|
|
163
|
+
accounts: Array.isArray(doc?.accounts) ? doc.accounts.map(String) : [],
|
|
164
|
+
alwaysOnSince: doc?.alwaysOnSince && typeof doc.alwaysOnSince === "object" ? doc.alwaysOnSince : {},
|
|
165
|
+
};
|
|
166
|
+
}
|
|
167
|
+
|
|
168
|
+
/**
|
|
169
|
+
* Read one policy file. A sealed file is opened; a plain one (a file drop) is checked and, when valid, sealed in place
|
|
170
|
+
* with the next rev. An invalid drop throws INVALID and is left as it is for the caller.
|
|
171
|
+
*
|
|
172
|
+
* @param {{kind: string, id: string, file: string, dir: string}} t - from {@link resolveTarget}
|
|
173
|
+
* @param {{lastRev?: number}} [opts] - the rev known before the drop (the next one is above it)
|
|
174
|
+
* @returns {{rev: number, updatedAt: string|null, updatedBy: string|null, policy: object, dropped?: boolean}|null}
|
|
175
|
+
*/
|
|
176
|
+
export function readPolicyFile(t, { lastRev = 0 } = {}) {
|
|
177
|
+
let bytes;
|
|
178
|
+
try {
|
|
179
|
+
bytes = readFileSync(t.file);
|
|
180
|
+
} catch (e) {
|
|
181
|
+
if (e.code === "ENOENT") return null;
|
|
182
|
+
throw e;
|
|
183
|
+
}
|
|
184
|
+
if (isSealed(bytes)) {
|
|
185
|
+
const doc = JSON.parse(openBuffer(scopeOfDir(t.dir), SPEC, bytes).toString("utf8"));
|
|
186
|
+
return {
|
|
187
|
+
rev: Number(doc.rev) || 0,
|
|
188
|
+
updatedAt: doc.updatedAt ?? null,
|
|
189
|
+
updatedBy: doc.updatedBy ?? null,
|
|
190
|
+
policy: doc.policy ?? {},
|
|
191
|
+
...(t.kind === "user" ? memberFields(doc) : {}),
|
|
192
|
+
};
|
|
193
|
+
}
|
|
194
|
+
const drop = droppedDoc(bytes.toString("utf8"), t.file);
|
|
195
|
+
const v = validatePolicy(drop.policy, { scope: t.kind });
|
|
196
|
+
const member = t.kind === "user" ? validateMembership(drop) : null;
|
|
197
|
+
if (member?.errors.length) v.errors.push(...member.errors);
|
|
198
|
+
if (v.errors.length || v.restartRequired.length) {
|
|
199
|
+
throw new PolicyError(`${t.file} was not taken: ${describeProblems(v)}`, "INVALID", {
|
|
200
|
+
errors: v.errors,
|
|
201
|
+
restartRequired: v.restartRequired,
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
const doc = {
|
|
205
|
+
rev: Math.max(lastRev + 1, drop.rev ?? 0, 1),
|
|
206
|
+
updatedAt: new Date().toISOString(),
|
|
207
|
+
updatedBy: "file",
|
|
208
|
+
policy: v.policy,
|
|
209
|
+
...(member ? { tenant: member.tenant, accounts: member.accounts, alwaysOnSince: {} } : {}),
|
|
210
|
+
};
|
|
211
|
+
writeSealedJson(t.file, scopeOfDir(t.dir), SPEC, doc);
|
|
212
|
+
return { ...doc, dropped: true };
|
|
213
|
+
}
|
|
214
|
+
|
|
215
|
+
/** One line naming what is wrong with a policy. */
|
|
216
|
+
export function describeProblems({ errors = [], restartRequired = [] }) {
|
|
217
|
+
const parts = errors.map((e) => (e.key ? `${e.key} ${e.error}` : e.error));
|
|
218
|
+
if (restartRequired.length)
|
|
219
|
+
parts.push(`${restartRequired.join(", ")} cannot change while the server runs (restartRequired)`);
|
|
220
|
+
return parts.join("; ");
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
// ── The live registry ──────────────────────────────────────────────────────────────────────────────────────────────
|
|
224
|
+
|
|
225
|
+
/** ownId -> the account's document (null: none) */
|
|
226
|
+
const accounts = new Map();
|
|
227
|
+
/** tenantId -> document; null until loaded */
|
|
228
|
+
let tenants = null;
|
|
229
|
+
/** userId -> document; null until loaded */
|
|
230
|
+
let users = null;
|
|
231
|
+
const listeners = new Set();
|
|
232
|
+
const warned = new Set();
|
|
233
|
+
|
|
234
|
+
function warnOnce(key, line) {
|
|
235
|
+
if (warned.has(key)) return;
|
|
236
|
+
warned.add(key);
|
|
237
|
+
console.error(line);
|
|
238
|
+
}
|
|
239
|
+
|
|
240
|
+
/** Load every tenant's file (once, or again with `force`; `store: false` reads them without caching). */
|
|
241
|
+
function loadTenants({ strict = false, force = false, store = true } = {}) {
|
|
242
|
+
if (tenants && !force) return tenants;
|
|
243
|
+
const next = new Map();
|
|
244
|
+
let names = [];
|
|
245
|
+
try {
|
|
246
|
+
names = readdirSync(tenantsDir()).filter((f) => f.endsWith(".json"));
|
|
247
|
+
} catch {
|
|
248
|
+
/* no tenants */
|
|
249
|
+
}
|
|
250
|
+
for (const name of names.sort()) {
|
|
251
|
+
const id = name.slice(0, -5);
|
|
252
|
+
if (!TENANT_ID.test(id)) continue;
|
|
253
|
+
try {
|
|
254
|
+
const t = resolveTarget({ kind: "tenant", id });
|
|
255
|
+
const doc = readPolicyFile(t, { lastRev: tenants?.get(id)?.rev ?? 0 });
|
|
256
|
+
if (doc) next.set(id, doc);
|
|
257
|
+
} catch (e) {
|
|
258
|
+
if (strict) throw e;
|
|
259
|
+
const keep = tenants?.get(id);
|
|
260
|
+
if (keep) next.set(id, keep);
|
|
261
|
+
warnOnce(`tenant:${id}:${e.message}`, `[policy] tenant ${id}: ${e.message}`);
|
|
262
|
+
}
|
|
263
|
+
}
|
|
264
|
+
if (!store) return next;
|
|
265
|
+
tenants = next;
|
|
266
|
+
return tenants;
|
|
267
|
+
}
|
|
268
|
+
|
|
269
|
+
/** Load every user's file (once, or again with `force`; `store: false` reads them without caching). */
|
|
270
|
+
function loadUsers({ strict = false, force = false, store = true } = {}) {
|
|
271
|
+
if (users && !force) return users;
|
|
272
|
+
const next = new Map();
|
|
273
|
+
let names = [];
|
|
274
|
+
try {
|
|
275
|
+
names = readdirSync(usersDir()).filter((f) => f.endsWith(".json"));
|
|
276
|
+
} catch {
|
|
277
|
+
/* no users */
|
|
278
|
+
}
|
|
279
|
+
for (const name of names.sort()) {
|
|
280
|
+
const id = name.slice(0, -5);
|
|
281
|
+
if (!USER_ID.test(id)) continue;
|
|
282
|
+
try {
|
|
283
|
+
const doc = readPolicyFile(resolveTarget({ kind: "user", id }), { lastRev: users?.get(id)?.rev ?? 0 });
|
|
284
|
+
if (doc) next.set(id, doc);
|
|
285
|
+
} catch (e) {
|
|
286
|
+
if (strict) throw e;
|
|
287
|
+
const keep = users?.get(id);
|
|
288
|
+
if (keep) next.set(id, keep);
|
|
289
|
+
warnOnce(`user:${id}:${e.message}`, `[policy] user ${id}: ${e.message}`);
|
|
290
|
+
}
|
|
291
|
+
}
|
|
292
|
+
if (!store) return next;
|
|
293
|
+
users = next;
|
|
294
|
+
return users;
|
|
295
|
+
}
|
|
296
|
+
|
|
297
|
+
/**
|
|
298
|
+
* The user that owns an account, or null (a legacy or self-hosted install).
|
|
299
|
+
*
|
|
300
|
+
* @param {string} ownId
|
|
301
|
+
* @returns {{id: string, rev: number, tenant: string|null, accounts: string[], policy: object}|null}
|
|
302
|
+
*/
|
|
303
|
+
export function ownerOf(ownId) {
|
|
304
|
+
for (const [id, doc] of loadUsers()) {
|
|
305
|
+
if (doc.accounts?.includes(String(ownId))) return { id, ...doc };
|
|
306
|
+
}
|
|
307
|
+
return null;
|
|
308
|
+
}
|
|
309
|
+
|
|
310
|
+
/** Every user id on this host, sorted. */
|
|
311
|
+
export function listUsers() {
|
|
312
|
+
return [...loadUsers().keys()];
|
|
313
|
+
}
|
|
314
|
+
|
|
315
|
+
/** A tenant's accounts: its users' accounts and its legacy `quota.tenant.accounts`. */
|
|
316
|
+
function tenantMembers(tenantId, doc, allUsers = loadUsers()) {
|
|
317
|
+
const ids = new Set();
|
|
318
|
+
const legacy = policyGet(doc?.policy, "quota.tenant.accounts");
|
|
319
|
+
if (Array.isArray(legacy)) for (const a of legacy) ids.add(String(a));
|
|
320
|
+
for (const u of allUsers.values()) if (u.tenant === tenantId) for (const a of u.accounts ?? []) ids.add(a);
|
|
321
|
+
return [...ids].sort();
|
|
322
|
+
}
|
|
323
|
+
|
|
324
|
+
/** Load one account's file (once, or again with `force`). */
|
|
325
|
+
function loadAccount(ownId, { strict = false, force = false } = {}) {
|
|
326
|
+
if (accounts.has(ownId) && !force) return accounts.get(ownId);
|
|
327
|
+
const t = resolveTarget({ kind: "account", id: ownId });
|
|
328
|
+
try {
|
|
329
|
+
const doc = readPolicyFile(t, { lastRev: accounts.get(ownId)?.rev ?? 0 });
|
|
330
|
+
accounts.set(ownId, doc);
|
|
331
|
+
return doc;
|
|
332
|
+
} catch (e) {
|
|
333
|
+
if (strict) throw e;
|
|
334
|
+
warnOnce(`account:${ownId}:${e.message}`, `[policy] account ${ownId}: ${e.message}`);
|
|
335
|
+
if (!accounts.has(ownId)) accounts.set(ownId, null);
|
|
336
|
+
return accounts.get(ownId);
|
|
337
|
+
}
|
|
338
|
+
}
|
|
339
|
+
|
|
340
|
+
/**
|
|
341
|
+
* The tenants an account belongs to (through its owning user, or a legacy `quota.tenant.accounts` list), in id order.
|
|
342
|
+
* `accounts` is each tenant's whole membership, users' accounts included: quotas sum over it.
|
|
343
|
+
*
|
|
344
|
+
* @param {string} ownId
|
|
345
|
+
* @returns {Array<{id: string, rev: number, policy: object, accounts: string[]}>}
|
|
346
|
+
*/
|
|
347
|
+
export function tenantsOf(ownId) {
|
|
348
|
+
const out = [];
|
|
349
|
+
const owner = ownerOf(ownId);
|
|
350
|
+
const all = loadTenants();
|
|
351
|
+
for (const [id, doc] of all) {
|
|
352
|
+
const members = tenantMembers(id, doc);
|
|
353
|
+
if (members.includes(String(ownId))) out.push({ id, rev: doc.rev, policy: doc.policy, accounts: members });
|
|
354
|
+
}
|
|
355
|
+
// A user's tenant that has no file yet is still the account's tenant (no policy, no quota).
|
|
356
|
+
if (owner?.tenant && !all.has(owner.tenant))
|
|
357
|
+
out.push({ id: owner.tenant, rev: 0, policy: {}, accounts: tenantMembers(owner.tenant, null) });
|
|
358
|
+
return out.sort((a, b) => (a.id < b.id ? -1 : a.id > b.id ? 1 : 0));
|
|
359
|
+
}
|
|
360
|
+
|
|
361
|
+
/**
|
|
362
|
+
* One account's effective policy: its tenants' policies (in id order), then its own.
|
|
363
|
+
*
|
|
364
|
+
* @param {string} ownId
|
|
365
|
+
* @returns {object}
|
|
366
|
+
*/
|
|
367
|
+
export function effectivePolicy(ownId) {
|
|
368
|
+
const id = String(ownId);
|
|
369
|
+
let merged = {};
|
|
370
|
+
const mine = tenantsOf(id);
|
|
371
|
+
if (mine.length > 1)
|
|
372
|
+
warnOnce(
|
|
373
|
+
`multi:${id}`,
|
|
374
|
+
`[policy] account ${id} is listed by ${mine.length} tenants (${mine.map((t) => t.id).join(", ")}); the later ones win`,
|
|
375
|
+
);
|
|
376
|
+
for (const t of mine) merged = mergePolicy(merged, t.policy);
|
|
377
|
+
const owner = ownerOf(id);
|
|
378
|
+
if (owner) merged = mergePolicy(merged, owner.policy ?? {});
|
|
379
|
+
const own = loadAccount(id);
|
|
380
|
+
if (own) merged = mergePolicy(merged, own.policy);
|
|
381
|
+
return merged;
|
|
382
|
+
}
|
|
383
|
+
|
|
384
|
+
// The quota resolver (./storage-quota.js) reads the tenants an account is in from here.
|
|
385
|
+
setTenantLookup((ownId) => tenantsOf(ownId));
|
|
386
|
+
|
|
387
|
+
setPolicyProvider((ownId) => {
|
|
388
|
+
const p = effectivePolicy(ownId);
|
|
389
|
+
return Object.keys(p).length ? p : null;
|
|
390
|
+
});
|
|
391
|
+
|
|
392
|
+
/**
|
|
393
|
+
* Load an account's policy and every tenant's now, failing on a file that cannot be used (a daemon's start: a policy
|
|
394
|
+
* it cannot read is never silently replaced by the defaults).
|
|
395
|
+
*
|
|
396
|
+
* @param {string} ownId
|
|
397
|
+
* @returns {{account: object|null, tenants: string[]}}
|
|
398
|
+
*/
|
|
399
|
+
export function loadPoliciesStrict(ownId) {
|
|
400
|
+
loadTenants({ strict: true, force: true });
|
|
401
|
+
loadUsers({ strict: true, force: true });
|
|
402
|
+
const account = loadAccount(String(ownId), { strict: true, force: true });
|
|
403
|
+
return { account, tenants: tenantsOf(ownId).map((t) => t.id) };
|
|
404
|
+
}
|
|
405
|
+
|
|
406
|
+
/**
|
|
407
|
+
* One target's document as it is now (read from disk, not the cache).
|
|
408
|
+
*
|
|
409
|
+
* @param {{kind: "account"|"tenant", id: string}} target
|
|
410
|
+
* @returns {{rev: number, updatedAt: string|null, updatedBy: string|null, policy: object}}
|
|
411
|
+
*/
|
|
412
|
+
export function getPolicy(target) {
|
|
413
|
+
const t = resolveTarget(target);
|
|
414
|
+
const doc = readPolicyFile(t, { lastRev: cacheOf(t.kind)?.get(t.id)?.rev ?? 0 });
|
|
415
|
+
return (
|
|
416
|
+
doc ?? {
|
|
417
|
+
rev: 0,
|
|
418
|
+
updatedAt: null,
|
|
419
|
+
updatedBy: null,
|
|
420
|
+
policy: {},
|
|
421
|
+
...(t.kind === "user" ? memberFields(null) : {}),
|
|
422
|
+
}
|
|
423
|
+
);
|
|
424
|
+
}
|
|
425
|
+
|
|
426
|
+
/** The live cache of one kind of target. */
|
|
427
|
+
function cacheOf(kind) {
|
|
428
|
+
return kind === "tenant" ? loadTenants() : kind === "user" ? loadUsers() : accounts;
|
|
429
|
+
}
|
|
430
|
+
|
|
431
|
+
/**
|
|
432
|
+
* Be told of every applied change (from any writer in this process, and from the watcher).
|
|
433
|
+
*
|
|
434
|
+
* @param {(change: {target: string, kind: string, id: string, rev: number, changed: string[], accounts: string[]}) => void} fn
|
|
435
|
+
* @returns {() => void} unsubscribe
|
|
436
|
+
*/
|
|
437
|
+
export function onPolicyChange(fn) {
|
|
438
|
+
listeners.add(fn);
|
|
439
|
+
return () => listeners.delete(fn);
|
|
440
|
+
}
|
|
441
|
+
|
|
442
|
+
function emit(change) {
|
|
443
|
+
for (const fn of listeners) {
|
|
444
|
+
try {
|
|
445
|
+
fn(change);
|
|
446
|
+
} catch (e) {
|
|
447
|
+
console.error(`[policy] a change hook failed: ${e.message}`);
|
|
448
|
+
}
|
|
449
|
+
}
|
|
450
|
+
}
|
|
451
|
+
|
|
452
|
+
/** The accounts a change to one target reaches. */
|
|
453
|
+
function reachedAccounts(t, before, after) {
|
|
454
|
+
if (t.kind === "account") return [t.id];
|
|
455
|
+
const ids = new Set();
|
|
456
|
+
if (t.kind === "user") {
|
|
457
|
+
for (const doc of [before, after]) for (const id of doc?.accounts ?? []) ids.add(String(id));
|
|
458
|
+
return [...ids].sort();
|
|
459
|
+
}
|
|
460
|
+
for (const doc of [before, after]) {
|
|
461
|
+
const m = policyGet(doc?.policy, "quota.tenant.accounts");
|
|
462
|
+
if (Array.isArray(m)) for (const id of m) ids.add(String(id));
|
|
463
|
+
}
|
|
464
|
+
for (const id of tenantMembers(t.id, null)) ids.add(id);
|
|
465
|
+
return [...ids].sort();
|
|
466
|
+
}
|
|
467
|
+
|
|
468
|
+
/**
|
|
469
|
+
* Append one line to the audit log. Keys and revs only: never a value.
|
|
470
|
+
*
|
|
471
|
+
* @param {object} entry
|
|
472
|
+
*/
|
|
473
|
+
export function audit(entry) {
|
|
474
|
+
try {
|
|
475
|
+
mkdirSync(CONFIG_DIR, { recursive: true });
|
|
476
|
+
appendFileSync(policyAuditFile(), JSON.stringify({ at: new Date().toISOString(), ...entry }) + "\n", {
|
|
477
|
+
mode: 0o600,
|
|
478
|
+
});
|
|
479
|
+
} catch (e) {
|
|
480
|
+
console.error(`[policy] the audit log could not be written: ${e.message}`);
|
|
481
|
+
}
|
|
482
|
+
}
|
|
483
|
+
|
|
484
|
+
/** A short exclusive lock on one policy file, across processes. */
|
|
485
|
+
function withFileLock(file, fn) {
|
|
486
|
+
const lock = `${file}.lock`;
|
|
487
|
+
const deadline = Date.now() + 5000;
|
|
488
|
+
for (;;) {
|
|
489
|
+
try {
|
|
490
|
+
writeFileSync(lock, String(process.pid), { flag: "wx", mode: 0o600 });
|
|
491
|
+
break;
|
|
492
|
+
} catch (e) {
|
|
493
|
+
if (e.code !== "EEXIST") throw e;
|
|
494
|
+
try {
|
|
495
|
+
if (Date.now() - statSync(lock).mtimeMs > 10_000) rmSync(lock, { force: true });
|
|
496
|
+
} catch {
|
|
497
|
+
/* gone meanwhile */
|
|
498
|
+
}
|
|
499
|
+
if (Date.now() > deadline)
|
|
500
|
+
throw new PolicyError(`${file} is being changed by another writer; try again`, "BUSY");
|
|
501
|
+
const until = Date.now() + 20;
|
|
502
|
+
while (Date.now() < until) {
|
|
503
|
+
/* a short spin: writes are rare and take milliseconds */
|
|
504
|
+
}
|
|
505
|
+
}
|
|
506
|
+
}
|
|
507
|
+
try {
|
|
508
|
+
return fn();
|
|
509
|
+
} finally {
|
|
510
|
+
rmSync(lock, { force: true });
|
|
511
|
+
}
|
|
512
|
+
}
|
|
513
|
+
|
|
514
|
+
/** The host lock every membership or presence write takes, so the cap check sees one writer at a time. */
|
|
515
|
+
function withHostLock(fn) {
|
|
516
|
+
mkdirSync(usersDir(), { recursive: true });
|
|
517
|
+
return withFileLock(join(usersDir(), ".presence"), fn);
|
|
518
|
+
}
|
|
519
|
+
|
|
520
|
+
/** Where the cap keeps when each account became always-on (ids and times only). */
|
|
521
|
+
export function alwaysOnFile() {
|
|
522
|
+
return join(usersDir(), ".always-on.json");
|
|
523
|
+
}
|
|
524
|
+
|
|
525
|
+
function readAlwaysOnSince() {
|
|
526
|
+
try {
|
|
527
|
+
const v = JSON.parse(readFileSync(alwaysOnFile(), "utf8"));
|
|
528
|
+
return v && typeof v === "object" && !Array.isArray(v) ? v : {};
|
|
529
|
+
} catch {
|
|
530
|
+
return {};
|
|
531
|
+
}
|
|
532
|
+
}
|
|
533
|
+
|
|
534
|
+
/** Refuse a membership that puts an account under two users or two tenants. */
|
|
535
|
+
function checkMembership(t, next) {
|
|
536
|
+
const problems = [];
|
|
537
|
+
if (t.kind === "user") {
|
|
538
|
+
for (const a of next.accounts) {
|
|
539
|
+
for (const [uid, u] of loadUsers()) {
|
|
540
|
+
if (uid !== t.id && u.accounts?.includes(a)) problems.push(`account ${a} is owned by user ${uid}`);
|
|
541
|
+
}
|
|
542
|
+
for (const [tid, doc] of loadTenants()) {
|
|
543
|
+
const legacy = policyGet(doc.policy, "quota.tenant.accounts");
|
|
544
|
+
if (tid !== next.tenant && Array.isArray(legacy) && legacy.map(String).includes(a))
|
|
545
|
+
problems.push(
|
|
546
|
+
`account ${a} is listed by tenant ${tid}, and user ${t.id} is in tenant ${next.tenant}`,
|
|
547
|
+
);
|
|
548
|
+
}
|
|
549
|
+
}
|
|
550
|
+
} else if (t.kind === "tenant") {
|
|
551
|
+
const listed = policyGet(next.policy, "quota.tenant.accounts");
|
|
552
|
+
for (const a of Array.isArray(listed) ? listed.map(String) : []) {
|
|
553
|
+
for (const [tid, doc] of loadTenants()) {
|
|
554
|
+
const legacy = policyGet(doc.policy, "quota.tenant.accounts");
|
|
555
|
+
if (tid !== t.id && Array.isArray(legacy) && legacy.map(String).includes(a))
|
|
556
|
+
problems.push(`account ${a} is already listed by tenant ${tid}`);
|
|
557
|
+
}
|
|
558
|
+
const owner = ownerOf(a);
|
|
559
|
+
if (owner && owner.tenant && owner.tenant !== t.id)
|
|
560
|
+
problems.push(`account ${a} is owned by user ${owner.id} of tenant ${owner.tenant}`);
|
|
561
|
+
}
|
|
562
|
+
}
|
|
563
|
+
return problems;
|
|
564
|
+
}
|
|
565
|
+
|
|
566
|
+
/** One write, under the target file's lock. No cap check (the caller runs it). */
|
|
567
|
+
function writeOne({ t, op, v, keys, ifMatch, actor, member }) {
|
|
568
|
+
return withFileLock(t.file, () => {
|
|
569
|
+
const cache = cacheOf(t.kind);
|
|
570
|
+
const before = readPolicyFile(t, { lastRev: cache.get(t.id)?.rev ?? 0 }) ?? {
|
|
571
|
+
rev: 0,
|
|
572
|
+
policy: {},
|
|
573
|
+
...(t.kind === "user" ? memberFields(null) : {}),
|
|
574
|
+
};
|
|
575
|
+
const wanted =
|
|
576
|
+
ifMatch === null || ifMatch === undefined || ifMatch === "" || ifMatch === "*"
|
|
577
|
+
? null
|
|
578
|
+
: Number(String(ifMatch).replace(/"/g, ""));
|
|
579
|
+
if (wanted !== null && wanted !== before.rev) {
|
|
580
|
+
audit({ actor, target: t.label, op, keys, oldRev: before.rev, result: "conflict" });
|
|
581
|
+
throw new PolicyError(`the policy is at rev ${before.rev}, not ${ifMatch}: read it again`, "CONFLICT", {
|
|
582
|
+
rev: before.rev,
|
|
583
|
+
});
|
|
584
|
+
}
|
|
585
|
+
const next = op === "put" ? v.policy : mergePolicy(before.policy, v.policy);
|
|
586
|
+
const changed = changedKeys(before.policy, next);
|
|
587
|
+
let membership = null;
|
|
588
|
+
if (t.kind === "user") {
|
|
589
|
+
membership = {
|
|
590
|
+
tenant: member.tenant !== undefined ? member.tenant : op === "put" ? null : before.tenant,
|
|
591
|
+
accounts: member.accounts !== undefined ? member.accounts : op === "put" ? [] : before.accounts,
|
|
592
|
+
};
|
|
593
|
+
if (!membership.tenant)
|
|
594
|
+
throw new PolicyError("a user belongs to exactly one tenant: name it (tenant)", "INVALID", {
|
|
595
|
+
errors: [{ key: "tenant", error: "is required" }],
|
|
596
|
+
});
|
|
597
|
+
if (membership.tenant !== before.tenant) changed.push("tenant");
|
|
598
|
+
if (JSON.stringify(membership.accounts) !== JSON.stringify(before.accounts ?? [])) changed.push("accounts");
|
|
599
|
+
}
|
|
600
|
+
if (!changed.length)
|
|
601
|
+
return {
|
|
602
|
+
target: t.label,
|
|
603
|
+
rev: before.rev,
|
|
604
|
+
oldRev: before.rev,
|
|
605
|
+
changed,
|
|
606
|
+
policy: before.policy,
|
|
607
|
+
accounts: [],
|
|
608
|
+
};
|
|
609
|
+
const problems = checkMembership(t, { policy: next, ...(membership ?? {}) });
|
|
610
|
+
if (problems.length) {
|
|
611
|
+
audit({ actor, target: t.label, op, keys, oldRev: before.rev, result: "membership" });
|
|
612
|
+
throw new PolicyError(
|
|
613
|
+
`${problems.join("; ")}: an account has one owning user and one tenant`,
|
|
614
|
+
"MEMBERSHIP",
|
|
615
|
+
{
|
|
616
|
+
errors: problems.map((error) => ({ key: "accounts", error })),
|
|
617
|
+
},
|
|
618
|
+
);
|
|
619
|
+
}
|
|
620
|
+
const doc = {
|
|
621
|
+
rev: before.rev + 1,
|
|
622
|
+
updatedAt: new Date().toISOString(),
|
|
623
|
+
updatedBy: actor,
|
|
624
|
+
policy: next,
|
|
625
|
+
...(membership ?? {}),
|
|
626
|
+
};
|
|
627
|
+
writeSealedJson(t.file, scopeOfDir(t.dir), SPEC, doc);
|
|
628
|
+
cache.set(t.id, doc);
|
|
629
|
+
const reached = reachedAccounts(t, before, doc);
|
|
630
|
+
changed.sort();
|
|
631
|
+
audit({ actor, target: t.label, op, keys: changed, oldRev: before.rev, newRev: doc.rev, result: "applied" });
|
|
632
|
+
emit({ target: t.label, kind: t.kind, id: t.id, rev: doc.rev, changed, accounts: reached });
|
|
633
|
+
// What a change means beyond the value: a switch of groups.onLeave is not symmetric (src/core/group-exit.js).
|
|
634
|
+
const notes = changed.includes("groups.onLeave") ? [onLeaveChangeNote(policyGet(next, "groups.onLeave"))] : [];
|
|
635
|
+
return {
|
|
636
|
+
target: t.label,
|
|
637
|
+
rev: doc.rev,
|
|
638
|
+
oldRev: before.rev,
|
|
639
|
+
changed,
|
|
640
|
+
policy: next,
|
|
641
|
+
accounts: reached,
|
|
642
|
+
...(notes.length ? { notes } : {}),
|
|
643
|
+
};
|
|
644
|
+
});
|
|
645
|
+
}
|
|
646
|
+
|
|
647
|
+
/**
|
|
648
|
+
* Change one target's policy: validate, check the rev, check the membership, write it sealed, swap the live copy, run
|
|
649
|
+
* the hooks, audit; then enforce the always-on caps (demoting the oldest always-on accounts over a cap).
|
|
650
|
+
*
|
|
651
|
+
* @param {object} args
|
|
652
|
+
* @param {{kind: "account"|"user"|"tenant", id: string}} args.target
|
|
653
|
+
* @param {"put"|"patch"} args.op - put replaces the whole policy; patch is a JSON merge patch (null removes a key)
|
|
654
|
+
* @param {object} args.policy - the new policy, or the patch
|
|
655
|
+
* @param {number|string|null} [args.ifMatch] - the rev the writer read; another rev is a CONFLICT
|
|
656
|
+
* @param {string} args.actor - who, for the audit log (`admin-api`, `cli`, …), never a credential
|
|
657
|
+
* @param {string} [args.tenant] - a user's tenant (users only)
|
|
658
|
+
* @param {string[]|string} [args.accounts] - the accounts a user owns (users only; replaces the list)
|
|
659
|
+
* @returns {{target: string, rev: number, oldRev: number, changed: string[], policy: object, accounts: string[],
|
|
660
|
+
* demoted: Array<object>}}
|
|
661
|
+
* @throws {PolicyError}
|
|
662
|
+
*/
|
|
663
|
+
export function applyPolicy({ target, op, policy, ifMatch = null, actor, tenant, accounts: owned }) {
|
|
664
|
+
const t = resolveTarget(target);
|
|
665
|
+
const v = validatePolicy(policy ?? {}, { scope: t.kind, allowNull: op === "patch" });
|
|
666
|
+
const keys = Object.keys(flattenPolicy(policy && typeof policy === "object" ? policy : {})).sort();
|
|
667
|
+
let member = {};
|
|
668
|
+
if (t.kind === "user") {
|
|
669
|
+
const m = validateMembership({ tenant: tenant ?? null, accounts: owned ?? [] });
|
|
670
|
+
v.errors.push(...m.errors);
|
|
671
|
+
member = {
|
|
672
|
+
tenant: tenant === undefined ? undefined : m.tenant,
|
|
673
|
+
accounts: owned === undefined ? undefined : m.accounts,
|
|
674
|
+
};
|
|
675
|
+
} else if (tenant !== undefined || owned !== undefined) {
|
|
676
|
+
v.errors.push({ key: "tenant", error: "membership is set on a user only" });
|
|
677
|
+
}
|
|
678
|
+
if (v.errors.length || v.restartRequired.length) {
|
|
679
|
+
const restart = v.restartRequired.length && !v.errors.length;
|
|
680
|
+
audit({ actor, target: t.label, op, keys, result: restart ? "restartRequired" : "invalid" });
|
|
681
|
+
throw new PolicyError(describeProblems(v), restart ? "RESTART_REQUIRED" : "INVALID", {
|
|
682
|
+
errors: v.errors,
|
|
683
|
+
restartRequired: v.restartRequired,
|
|
684
|
+
});
|
|
685
|
+
}
|
|
686
|
+
if (t.kind === "account" && !existsSync(t.dir)) {
|
|
687
|
+
throw new PolicyError(`account ${t.id} has no folder on this host`, "NOT_FOUND");
|
|
688
|
+
}
|
|
689
|
+
mkdirSync(t.dir, { recursive: true });
|
|
690
|
+
return withHostLock(() => {
|
|
691
|
+
const r = writeOne({ t, op, v, keys, ifMatch, actor, member });
|
|
692
|
+
const demoted = r.changed.length ? enforceCaps({ actor }) : [];
|
|
693
|
+
return { ...r, demoted };
|
|
694
|
+
});
|
|
695
|
+
}
|
|
696
|
+
|
|
697
|
+
/** The effective mode the policy gives one account (the policy layers only: what a console controls). */
|
|
698
|
+
function policyMode(ownId) {
|
|
699
|
+
return policyGet(effectivePolicy(ownId), "presence.mode") ?? null;
|
|
700
|
+
}
|
|
701
|
+
|
|
702
|
+
/** A user's always-on cap: its own policy, then its tenant's, then the default. */
|
|
703
|
+
function userCap(u, allTenants = loadTenants()) {
|
|
704
|
+
const own = policyGet(u.policy, "presence.alwaysOn.maxPerUser");
|
|
705
|
+
if (Number.isInteger(own)) return own;
|
|
706
|
+
const t = u.tenant ? allTenants.get(u.tenant) : null;
|
|
707
|
+
const fromTenant = policyGet(t?.policy, "presence.alwaysOn.maxPerUser");
|
|
708
|
+
return Number.isInteger(fromTenant) ? fromTenant : DEFAULT_ALWAYS_ON_PER_USER;
|
|
709
|
+
}
|
|
710
|
+
|
|
711
|
+
/**
|
|
712
|
+
* What the cap check counts: every user, tenant and account file as it is on disk now, read without touching this
|
|
713
|
+
* process's cache. Another process may have written since this one cached them (a `policy` CLI write beside the
|
|
714
|
+
* daemon's admin API), and counting the cached copies let both writers keep an account always-on past the cap. The
|
|
715
|
+
* cache itself stays as it was: the watcher compares against it to notice and announce those changes.
|
|
716
|
+
*
|
|
717
|
+
* @returns {{users: Map<string, object>, tenants: Map<string, object>, mode: (ownId: string) => string|null}}
|
|
718
|
+
*/
|
|
719
|
+
function capView() {
|
|
720
|
+
const allUsers = loadUsers({ force: true, store: false });
|
|
721
|
+
const allTenants = loadTenants({ force: true, store: false });
|
|
722
|
+
const own = new Map();
|
|
723
|
+
const accountDoc = (id) => {
|
|
724
|
+
if (!own.has(id)) {
|
|
725
|
+
let doc;
|
|
726
|
+
try {
|
|
727
|
+
doc = readPolicyFile(resolveTarget({ kind: "account", id }), { lastRev: accounts.get(id)?.rev ?? 0 });
|
|
728
|
+
} catch {
|
|
729
|
+
doc = accounts.get(id) ?? null; // unreadable now: the last good copy, as loadAccount keeps it
|
|
730
|
+
}
|
|
731
|
+
own.set(id, doc);
|
|
732
|
+
}
|
|
733
|
+
return own.get(id);
|
|
734
|
+
};
|
|
735
|
+
const mode = (id) => {
|
|
736
|
+
let merged = {};
|
|
737
|
+
for (const [tid, doc] of [...allTenants].sort(([a], [b]) => (a < b ? -1 : a > b ? 1 : 0)))
|
|
738
|
+
if (tenantMembers(tid, doc, allUsers).includes(id)) merged = mergePolicy(merged, doc.policy);
|
|
739
|
+
for (const u of allUsers.values())
|
|
740
|
+
if (u.accounts?.includes(id)) {
|
|
741
|
+
merged = mergePolicy(merged, u.policy ?? {});
|
|
742
|
+
break;
|
|
743
|
+
}
|
|
744
|
+
const doc = accountDoc(id);
|
|
745
|
+
if (doc) merged = mergePolicy(merged, doc.policy);
|
|
746
|
+
return policyGet(merged, "presence.mode") ?? null;
|
|
747
|
+
};
|
|
748
|
+
return { users: allUsers, tenants: allTenants, mode };
|
|
749
|
+
}
|
|
750
|
+
|
|
751
|
+
/**
|
|
752
|
+
* Hold every user and tenant to its always-on cap: over a cap, the oldest always-on accounts (by when they became
|
|
753
|
+
* always-on, then by id) are demoted to on-demand with an account-level write. Accounts are counted on this host only.
|
|
754
|
+
* Runs under the host lock (from {@link applyPolicy}, or alone).
|
|
755
|
+
*
|
|
756
|
+
* @param {{actor?: string, now?: number}} [o]
|
|
757
|
+
* @returns {Array<{accountId: string, scope: "user"|"tenant", userId?: string, tenantId?: string, cap: number}>}
|
|
758
|
+
*/
|
|
759
|
+
function enforceCaps({ actor = "presence-cap", now = Date.now() } = {}) {
|
|
760
|
+
const onHost = (id) => existsSync(getAccountDir(id));
|
|
761
|
+
const since = readAlwaysOnSince();
|
|
762
|
+
const live = new Set();
|
|
763
|
+
const groups = [];
|
|
764
|
+
const view = capView();
|
|
765
|
+
for (const [uid, u] of view.users) {
|
|
766
|
+
const on = (u.accounts ?? []).filter((a) => onHost(a) && view.mode(a) === "always-on");
|
|
767
|
+
groups.push({ scope: "user", userId: uid, cap: userCap(u, view.tenants), on });
|
|
768
|
+
}
|
|
769
|
+
for (const [tid, doc] of view.tenants) {
|
|
770
|
+
const cap = policyGet(doc.policy, "presence.alwaysOn.maxPerTenant");
|
|
771
|
+
if (!Number.isInteger(cap)) continue;
|
|
772
|
+
const on = tenantMembers(tid, doc, view.users).filter((a) => onHost(a) && view.mode(a) === "always-on");
|
|
773
|
+
groups.push({ scope: "tenant", tenantId: tid, cap, on });
|
|
774
|
+
}
|
|
775
|
+
for (const g of groups) for (const a of g.on) live.add(a);
|
|
776
|
+
for (const a of live) if (!Number.isFinite(since[a])) since[a] = now;
|
|
777
|
+
const demoted = [];
|
|
778
|
+
const gone = new Set();
|
|
779
|
+
for (const g of groups) {
|
|
780
|
+
const on = g.on.filter((a) => !gone.has(a));
|
|
781
|
+
if (on.length <= g.cap) continue;
|
|
782
|
+
on.sort((a, b) => since[a] - since[b] || (a < b ? -1 : a > b ? 1 : 0));
|
|
783
|
+
for (const a of on.slice(0, on.length - g.cap)) {
|
|
784
|
+
const t = resolveTarget({ kind: "account", id: a });
|
|
785
|
+
const v = validatePolicy({ presence: { mode: "on-demand" } }, { allowNull: true });
|
|
786
|
+
writeOne({ t, op: "patch", v, keys: ["presence.mode"], ifMatch: null, actor: "presence-cap", member: {} });
|
|
787
|
+
gone.add(a);
|
|
788
|
+
delete since[a];
|
|
789
|
+
const event = {
|
|
790
|
+
accountId: a,
|
|
791
|
+
from: "always-on",
|
|
792
|
+
to: "on-demand",
|
|
793
|
+
reason: "cap",
|
|
794
|
+
scope: g.scope,
|
|
795
|
+
...(g.userId ? { userId: g.userId } : {}),
|
|
796
|
+
...(g.tenantId ? { tenantId: g.tenantId } : {}),
|
|
797
|
+
cap: g.cap,
|
|
798
|
+
};
|
|
799
|
+
audit({ actor, target: `account:${a}`, op: "demote", keys: ["presence.mode"], result: "capDemoted" });
|
|
800
|
+
demoted.push(event);
|
|
801
|
+
for (const fn of presenceListeners) {
|
|
802
|
+
try {
|
|
803
|
+
fn(event);
|
|
804
|
+
} catch (e) {
|
|
805
|
+
console.error(`[policy] a presence hook failed: ${e.message}`);
|
|
806
|
+
}
|
|
807
|
+
}
|
|
808
|
+
}
|
|
809
|
+
}
|
|
810
|
+
for (const a of Object.keys(since)) if (!live.has(a) || gone.has(a)) delete since[a];
|
|
811
|
+
try {
|
|
812
|
+
mkdirSync(usersDir(), { recursive: true });
|
|
813
|
+
writeFileAtomic(alwaysOnFile(), JSON.stringify(since, null, 2), { mode: 0o600 });
|
|
814
|
+
} catch (e) {
|
|
815
|
+
console.error(`[policy] the always-on record could not be written: ${e.message}`);
|
|
816
|
+
}
|
|
817
|
+
return demoted;
|
|
818
|
+
}
|
|
819
|
+
|
|
820
|
+
/**
|
|
821
|
+
* Hold every user and tenant to its always-on cap now (a lowered cap read from a file drop, a daemon's start).
|
|
822
|
+
*
|
|
823
|
+
* @param {{actor?: string}} [o]
|
|
824
|
+
* @returns {Array<object>} the demotions
|
|
825
|
+
*/
|
|
826
|
+
export function enforceAlwaysOnCaps(o = {}) {
|
|
827
|
+
return withHostLock(() => enforceCaps(o));
|
|
828
|
+
}
|
|
829
|
+
|
|
830
|
+
const presenceListeners = new Set();
|
|
831
|
+
|
|
832
|
+
/**
|
|
833
|
+
* Be told when the cap demotes an account (`presence_changed`, reason `cap`): the daemon of that account sends it to
|
|
834
|
+
* its webhook and MCP buffer.
|
|
835
|
+
*
|
|
836
|
+
* @param {(event: {accountId: string, from: string, to: string, reason: string, scope: string, cap: number}) => void} fn
|
|
837
|
+
* @returns {() => void} unsubscribe
|
|
838
|
+
*/
|
|
839
|
+
export function onPresenceChange(fn) {
|
|
840
|
+
presenceListeners.add(fn);
|
|
841
|
+
return () => presenceListeners.delete(fn);
|
|
842
|
+
}
|
|
843
|
+
|
|
844
|
+
/**
|
|
845
|
+
* How many always-on accounts each user (and capped tenant) has on this host, against its cap.
|
|
846
|
+
*
|
|
847
|
+
* @returns {{users: Array<{userId: string, tenant: string|null, cap: number, alwaysOn: string[]}>,
|
|
848
|
+
* tenants: Array<{tenantId: string, cap: number, alwaysOn: string[]}>}}
|
|
849
|
+
*/
|
|
850
|
+
export function alwaysOnUsage() {
|
|
851
|
+
const onHost = (id) => existsSync(getAccountDir(id));
|
|
852
|
+
const out = { users: [], tenants: [] };
|
|
853
|
+
for (const [uid, u] of loadUsers()) {
|
|
854
|
+
out.users.push({
|
|
855
|
+
userId: uid,
|
|
856
|
+
tenant: u.tenant ?? null,
|
|
857
|
+
cap: userCap(u),
|
|
858
|
+
alwaysOn: (u.accounts ?? []).filter((a) => onHost(a) && policyMode(a) === "always-on"),
|
|
859
|
+
});
|
|
860
|
+
}
|
|
861
|
+
for (const [tid, doc] of loadTenants()) {
|
|
862
|
+
const cap = policyGet(doc.policy, "presence.alwaysOn.maxPerTenant");
|
|
863
|
+
if (!Number.isInteger(cap)) continue;
|
|
864
|
+
out.tenants.push({
|
|
865
|
+
tenantId: tid,
|
|
866
|
+
cap,
|
|
867
|
+
alwaysOn: tenantMembers(tid, doc).filter((a) => onHost(a) && policyMode(a) === "always-on"),
|
|
868
|
+
});
|
|
869
|
+
}
|
|
870
|
+
return out;
|
|
871
|
+
}
|
|
872
|
+
|
|
873
|
+
/**
|
|
874
|
+
* Re-read one file after it changed on disk (the watcher): a sealed file another writer wrote, or a drop. A drop that
|
|
875
|
+
* does not validate is moved to `<file>.rejected`, the last good policy is written back, and nothing changes.
|
|
876
|
+
*
|
|
877
|
+
* @param {{kind: "account"|"tenant", id: string}} target
|
|
878
|
+
* @param {{log?: (line: string) => void}} [opts]
|
|
879
|
+
* @returns {{applied: boolean, rejected?: boolean, rev?: number, changed?: string[]}}
|
|
880
|
+
*/
|
|
881
|
+
export function reloadPolicy(target, { log = (l) => console.error(l) } = {}) {
|
|
882
|
+
const t = resolveTarget(target);
|
|
883
|
+
const cache = cacheOf(t.kind);
|
|
884
|
+
const before = cache.get(t.id) ?? null;
|
|
885
|
+
let doc;
|
|
886
|
+
try {
|
|
887
|
+
doc = readPolicyFile(t, { lastRev: before?.rev ?? 0 });
|
|
888
|
+
} catch (e) {
|
|
889
|
+
if (!(e instanceof PolicyError)) {
|
|
890
|
+
log(`[policy] ${t.file} could not be read (${e.message}); the last good policy stays`);
|
|
891
|
+
return { applied: false, rejected: true };
|
|
892
|
+
}
|
|
893
|
+
try {
|
|
894
|
+
renameSync(t.file, `${t.file}.rejected`);
|
|
895
|
+
if (before) writeSealedJson(t.file, scopeOfDir(t.dir), SPEC, before);
|
|
896
|
+
} catch (err) {
|
|
897
|
+
log(`[policy] could not set the rejected file aside: ${err.message}`);
|
|
898
|
+
}
|
|
899
|
+
audit({ actor: "file", target: t.label, op: "drop", result: "invalid" });
|
|
900
|
+
log(
|
|
901
|
+
`[policy] ${e.message}. The last good policy stays (rev ${before?.rev ?? 0}); the file is kept as ${t.file}.rejected`,
|
|
902
|
+
);
|
|
903
|
+
return { applied: false, rejected: true };
|
|
904
|
+
}
|
|
905
|
+
if ((doc?.rev ?? 0) === (before?.rev ?? 0) && !doc?.dropped) return { applied: false };
|
|
906
|
+
if (doc) cache.set(t.id, doc);
|
|
907
|
+
else cache.delete(t.id);
|
|
908
|
+
const changed = changedKeys(before?.policy ?? {}, doc?.policy ?? {});
|
|
909
|
+
const reached = reachedAccounts(t, before, doc);
|
|
910
|
+
audit({
|
|
911
|
+
actor: "file",
|
|
912
|
+
target: t.label,
|
|
913
|
+
op: doc ? "drop" : "remove",
|
|
914
|
+
keys: changed,
|
|
915
|
+
oldRev: before?.rev ?? 0,
|
|
916
|
+
newRev: doc?.rev ?? 0,
|
|
917
|
+
result: "applied",
|
|
918
|
+
});
|
|
919
|
+
if (changed.length) {
|
|
920
|
+
log(`[policy] ${t.label} rev ${doc?.rev ?? 0} from a file: ${changed.join(", ")}`);
|
|
921
|
+
emit({ target: t.label, kind: t.kind, id: t.id, rev: doc?.rev ?? 0, changed, accounts: reached });
|
|
922
|
+
}
|
|
923
|
+
return { applied: true, rev: doc?.rev ?? 0, changed };
|
|
924
|
+
}
|
|
925
|
+
|
|
926
|
+
/**
|
|
927
|
+
* Watch one account's policy file and the tenants' folder for drops and other writers (a daemon). Debounced.
|
|
928
|
+
*
|
|
929
|
+
* @param {object} args
|
|
930
|
+
* @param {string} args.ownId
|
|
931
|
+
* @param {(line: string) => void} [args.log]
|
|
932
|
+
* @param {number} [args.debounceMs]
|
|
933
|
+
* @returns {{stop: () => void}}
|
|
934
|
+
*/
|
|
935
|
+
export function watchPolicies({ ownId, log = (l) => console.error(l), debounceMs = 500 }) {
|
|
936
|
+
const timers = new Map();
|
|
937
|
+
const watchers = [];
|
|
938
|
+
const later = (key, target) => {
|
|
939
|
+
clearTimeout(timers.get(key));
|
|
940
|
+
const timer = setTimeout(() => {
|
|
941
|
+
timers.delete(key);
|
|
942
|
+
reloadPolicy(target, { log });
|
|
943
|
+
}, debounceMs);
|
|
944
|
+
timer.unref?.();
|
|
945
|
+
timers.set(key, timer);
|
|
946
|
+
};
|
|
947
|
+
const account = resolveTarget({ kind: "account", id: ownId });
|
|
948
|
+
for (const [dir, onName] of [
|
|
949
|
+
[account.dir, (name) => name === POLICY_FILE && later("account", { kind: "account", id: ownId })],
|
|
950
|
+
[
|
|
951
|
+
tenantsDir(),
|
|
952
|
+
(name) => {
|
|
953
|
+
const id = name.endsWith(".json") ? name.slice(0, -5) : "";
|
|
954
|
+
if (TENANT_ID.test(id)) later(`tenant:${id}`, { kind: "tenant", id });
|
|
955
|
+
},
|
|
956
|
+
],
|
|
957
|
+
[
|
|
958
|
+
usersDir(),
|
|
959
|
+
(name) => {
|
|
960
|
+
const id = name.endsWith(".json") ? name.slice(0, -5) : "";
|
|
961
|
+
if (USER_ID.test(id)) later(`user:${id}`, { kind: "user", id });
|
|
962
|
+
},
|
|
963
|
+
],
|
|
964
|
+
]) {
|
|
965
|
+
try {
|
|
966
|
+
mkdirSync(dir, { recursive: true });
|
|
967
|
+
const w = watch(dir, { persistent: false }, (_event, name) => name && onName(String(name)));
|
|
968
|
+
w.on("error", () => {});
|
|
969
|
+
watchers.push(w);
|
|
970
|
+
} catch (e) {
|
|
971
|
+
log(`[policy] cannot watch ${dir} (${e.message}): file drops there are picked up at the next start`);
|
|
972
|
+
}
|
|
973
|
+
}
|
|
974
|
+
return {
|
|
975
|
+
stop() {
|
|
976
|
+
for (const t of timers.values()) clearTimeout(t);
|
|
977
|
+
timers.clear();
|
|
978
|
+
for (const w of watchers) w.close();
|
|
979
|
+
},
|
|
980
|
+
};
|
|
981
|
+
}
|
|
982
|
+
|
|
983
|
+
/** Forget every cached policy (tests). */
|
|
984
|
+
export function resetPolicyCache() {
|
|
985
|
+
accounts.clear();
|
|
986
|
+
tenants = null;
|
|
987
|
+
users = null;
|
|
988
|
+
warned.clear();
|
|
989
|
+
}
|
|
990
|
+
|
|
991
|
+
/**
|
|
992
|
+
* Write a policy as a config-management tool would (plain JSON, atomic). For tests and the docs' examples.
|
|
993
|
+
*
|
|
994
|
+
* @param {string} file
|
|
995
|
+
* @param {object} policy
|
|
996
|
+
*/
|
|
997
|
+
export function dropPolicyFile(file, policy) {
|
|
998
|
+
writeFileAtomic(file, JSON.stringify({ policy }, null, 2));
|
|
999
|
+
}
|
|
1000
|
+
|
|
1001
|
+
/**
|
|
1002
|
+
* What a daemon runs: the account's and the tenants' policies loaded now (a file that cannot be used stops the start),
|
|
1003
|
+
* the watcher for drops, and one hook for every change that reaches this account.
|
|
1004
|
+
*
|
|
1005
|
+
* @param {object} args
|
|
1006
|
+
* @param {string} args.ownId
|
|
1007
|
+
* @param {(changed: string[], change: object) => void} [args.onChange]
|
|
1008
|
+
* @param {(line: string) => void} [args.log]
|
|
1009
|
+
* @returns {{stop: () => void, describe: () => string}}
|
|
1010
|
+
* @throws {PolicyError} when a policy file is invalid
|
|
1011
|
+
*/
|
|
1012
|
+
export function startPolicyRuntime({ ownId, onChange, log = (l) => console.error(l) }) {
|
|
1013
|
+
const loaded = loadPoliciesStrict(ownId);
|
|
1014
|
+
const watcher = watchPolicies({ ownId, log });
|
|
1015
|
+
const off = onPolicyChange((change) => {
|
|
1016
|
+
if (!change.accounts.includes(String(ownId))) return;
|
|
1017
|
+
onChange?.(change.changed, change);
|
|
1018
|
+
});
|
|
1019
|
+
return {
|
|
1020
|
+
stop() {
|
|
1021
|
+
watcher.stop();
|
|
1022
|
+
off();
|
|
1023
|
+
},
|
|
1024
|
+
describe: () =>
|
|
1025
|
+
`account rev ${loaded.account?.rev ?? 0}` +
|
|
1026
|
+
(loaded.tenants.length ? `, tenant(s) ${loaded.tenants.join(", ")}` : ""),
|
|
1027
|
+
};
|
|
1028
|
+
}
|
|
1029
|
+
|
|
1030
|
+
/**
|
|
1031
|
+
* Whether a change names any of these keys or a key under them (`media` covers `media.linkAuth`).
|
|
1032
|
+
*
|
|
1033
|
+
* @param {string[]} changed
|
|
1034
|
+
* @param {string[]} prefixes
|
|
1035
|
+
* @returns {boolean}
|
|
1036
|
+
*/
|
|
1037
|
+
export function touches(changed, prefixes) {
|
|
1038
|
+
return changed.some((k) => prefixes.some((p) => k === p || k.startsWith(`${p}.`)));
|
|
1039
|
+
}
|
|
1040
|
+
|
|
1041
|
+
/**
|
|
1042
|
+
* The daemon side of `policy set|unset` over the daemon channel.
|
|
1043
|
+
*
|
|
1044
|
+
* @param {{target: {kind: string, id: string}, op: string, policy: object, ifMatch?: unknown}} params
|
|
1045
|
+
* @returns {object}
|
|
1046
|
+
*/
|
|
1047
|
+
export function servePolicyRequest(params) {
|
|
1048
|
+
const op = params?.op === "put" ? "put" : "patch";
|
|
1049
|
+
return applyPolicy({
|
|
1050
|
+
target: params?.target,
|
|
1051
|
+
op,
|
|
1052
|
+
policy: params?.policy,
|
|
1053
|
+
ifMatch: params?.ifMatch ?? null,
|
|
1054
|
+
actor: "cli via daemon",
|
|
1055
|
+
...(params?.tenant !== undefined ? { tenant: params.tenant } : {}),
|
|
1056
|
+
...(params?.accounts !== undefined ? { accounts: params.accounts } : {}),
|
|
1057
|
+
});
|
|
1058
|
+
}
|