diff --git a/.gitattributes b/.gitattributes index a6344aac8c09253b3b630fb776ae94478aa0275b..dab9a4e17afd2ef39d90ccb0b40ef2786fe77422 100644 --- a/.gitattributes +++ b/.gitattributes @@ -1,35 +1,35 @@ -*.7z filter=lfs diff=lfs merge=lfs -text -*.arrow filter=lfs diff=lfs merge=lfs -text -*.bin filter=lfs diff=lfs merge=lfs -text -*.bz2 filter=lfs diff=lfs merge=lfs -text -*.ckpt filter=lfs diff=lfs merge=lfs -text -*.ftz filter=lfs diff=lfs merge=lfs -text -*.gz filter=lfs diff=lfs merge=lfs -text -*.h5 filter=lfs diff=lfs merge=lfs -text -*.joblib filter=lfs diff=lfs merge=lfs -text -*.lfs.* filter=lfs diff=lfs merge=lfs -text -*.mlmodel filter=lfs diff=lfs merge=lfs -text -*.model filter=lfs diff=lfs merge=lfs -text -*.msgpack filter=lfs diff=lfs merge=lfs -text -*.npy filter=lfs diff=lfs merge=lfs -text -*.npz filter=lfs diff=lfs merge=lfs -text -*.onnx filter=lfs diff=lfs merge=lfs -text -*.ot filter=lfs diff=lfs merge=lfs -text -*.parquet filter=lfs diff=lfs merge=lfs -text -*.pb filter=lfs diff=lfs merge=lfs -text -*.pickle filter=lfs diff=lfs merge=lfs -text -*.pkl filter=lfs diff=lfs merge=lfs -text -*.pt filter=lfs diff=lfs merge=lfs -text -*.pth filter=lfs diff=lfs merge=lfs -text -*.rar filter=lfs diff=lfs merge=lfs -text -*.safetensors filter=lfs diff=lfs merge=lfs -text -saved_model/**/* filter=lfs diff=lfs merge=lfs -text -*.tar.* filter=lfs diff=lfs merge=lfs -text -*.tar filter=lfs diff=lfs merge=lfs -text -*.tflite filter=lfs diff=lfs merge=lfs -text -*.tgz filter=lfs diff=lfs merge=lfs -text -*.wasm filter=lfs diff=lfs merge=lfs -text -*.xz filter=lfs diff=lfs merge=lfs -text -*.zip filter=lfs diff=lfs merge=lfs -text -*.zst filter=lfs diff=lfs merge=lfs -text -*tfevents* filter=lfs diff=lfs merge=lfs -text +*.7z filter=lfs diff=lfs merge=lfs -text +*.arrow filter=lfs diff=lfs merge=lfs -text +*.bin filter=lfs diff=lfs merge=lfs -text +*.bz2 filter=lfs diff=lfs merge=lfs -text +*.ckpt filter=lfs diff=lfs merge=lfs -text +*.ftz filter=lfs diff=lfs merge=lfs -text +*.gz filter=lfs diff=lfs merge=lfs -text +*.h5 filter=lfs diff=lfs merge=lfs -text +*.joblib filter=lfs diff=lfs merge=lfs -text +*.lfs.* filter=lfs diff=lfs merge=lfs -text +*.mlmodel filter=lfs diff=lfs merge=lfs -text +*.model filter=lfs diff=lfs merge=lfs -text +*.msgpack filter=lfs diff=lfs merge=lfs -text +*.npy filter=lfs diff=lfs merge=lfs -text +*.npz filter=lfs diff=lfs merge=lfs -text +*.onnx filter=lfs diff=lfs merge=lfs -text +*.ot filter=lfs diff=lfs merge=lfs -text +*.parquet filter=lfs diff=lfs merge=lfs -text +*.pb filter=lfs diff=lfs merge=lfs -text +*.pickle filter=lfs diff=lfs merge=lfs -text +*.pkl filter=lfs diff=lfs merge=lfs -text +*.pt filter=lfs diff=lfs merge=lfs -text +*.pth filter=lfs diff=lfs merge=lfs -text +*.rar filter=lfs diff=lfs merge=lfs -text +*.safetensors filter=lfs diff=lfs merge=lfs -text +saved_model/**/* filter=lfs diff=lfs merge=lfs -text +*.tar.* filter=lfs diff=lfs merge=lfs -text +*.tar filter=lfs diff=lfs merge=lfs -text +*.tflite filter=lfs diff=lfs merge=lfs -text +*.tgz filter=lfs diff=lfs merge=lfs -text +*.wasm filter=lfs diff=lfs merge=lfs -text +*.xz filter=lfs diff=lfs merge=lfs -text +*.zip filter=lfs diff=lfs merge=lfs -text +*.zst filter=lfs diff=lfs merge=lfs -text +*tfevents* filter=lfs diff=lfs merge=lfs -text diff --git a/Dockerfile b/Dockerfile index 02681bb904f53ae3a204855c267dfa8fac0458f2..bf3e493017047222630f9e3dcff665bfe4866122 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,49 +1,49 @@ -FROM nvidia/cuda:11.3.1-base-ubuntu20.04 - -ENV DEBIAN_FRONTEND=noninteractive \ - TZ=Europe/Paris - -# Remove any third-party apt sources to avoid issues with expiring keys. -# Install some basic utilities -RUN rm -f /etc/apt/sources.list.d/*.list && \ - apt-get update && apt-get install -y --no-install-recommends \ - curl \ - ca-certificates \ - sudo \ - git \ - wget \ - procps \ - git-lfs \ - zip \ - unzip \ - htop \ - vim \ - nano \ - bzip2 \ - libx11-6 \ - build-essential \ - libsndfile-dev \ - software-properties-common \ - && rm -rf /var/lib/apt/lists/* - - RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \ - apt-get install -y nodejs && \ - npm install -g configurable-http-proxy - -# Tạo thư mục làm việc trong container -WORKDIR /app - -# Clone repository từ GitHub -RUN git clone https://github.com/pedguedes090/mira-bot-v1.git . - -# Cài đặt các phụ thuộc -RUN npm install - -# Cấp quyền đọc/ghi cho thư mục -RUN chmod -R 755 /app - -# Expose port mà ứng dụng sẽ chạy -EXPOSE 25645 - -# Lệnh để chạy ứng dụng -CMD ["npm", "start"] +FROM nvidia/cuda:11.3.1-base-ubuntu20.04 + +ENV DEBIAN_FRONTEND=noninteractive \ + TZ=Europe/Paris + +# Remove any third-party apt sources to avoid issues with expiring keys. +# Install some basic utilities +RUN rm -f /etc/apt/sources.list.d/*.list && \ + apt-get update && apt-get install -y --no-install-recommends \ + curl \ + ca-certificates \ + sudo \ + git \ + wget \ + procps \ + git-lfs \ + zip \ + unzip \ + htop \ + vim \ + nano \ + bzip2 \ + libx11-6 \ + build-essential \ + libsndfile-dev \ + software-properties-common \ + && rm -rf /var/lib/apt/lists/* + + RUN curl -sL https://deb.nodesource.com/setup_18.x | bash - && \ + apt-get install -y nodejs && \ + npm install -g configurable-http-proxy + +# Tạo thư mục làm việc trong container +WORKDIR /app +COPY package*.json ./ +COPY package-lock*.json ./ +COPY . . + +# Cài đặt các phụ thuộc +RUN npm install + +# Cấp quyền đọc/ghi cho thư mục +RUN chmod -R 755 /app + +# Expose port mà ứng dụng sẽ chạy +EXPOSE 25645 + +# Lệnh để chạy ứng dụng +CMD ["npm", "start"] diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000000000000000000000000000000000000..e19ae12509ffbd46a53a72521a7645f54c7eb5d7 --- /dev/null +++ b/LICENSE @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2024, GiaKhang1810 + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md index 6257424bc77267408439435d0fbc3c209b877cd1..d94e357f74f3a7a5e7460711100e6b49c53b7ebf 100644 --- a/README.md +++ b/README.md @@ -1,12 +1,12 @@ ---- -title: Dunbot -emoji: 🐢 -colorFrom: indigo -colorTo: gray -sdk: docker -app_port: 25645 -pinned: false -license: mit ---- - -Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference +--- +title: Dunbot +emoji: 🐢 +colorFrom: indigo +colorTo: gray +sdk: docker +app_port: 25645 +pinned: false +license: mit +--- + +Check out the configuration reference at https://huggingface.co/docs/hub/spaces-config-reference diff --git a/changelog.json b/changelog.json new file mode 100644 index 0000000000000000000000000000000000000000..70de4731ef2af375c3e6c38664b61890f53497ca --- /dev/null +++ b/changelog.json @@ -0,0 +1,33 @@ +{ + "beta-1.0.1": { + "source/database/index.js": [], + "source/database/model/thread.mongodb.js": [], + "source/database/model/thread.sqlite3.js": [], + "source/database/model/user.mongodb.js": [], + "source/database/model/user.sqlite3.js": [], + "source/languages/en-US.json": [], + "source/languages/vi-VN.json": [], + "source/lib/log.js": [], + "source/lib/utils.js": [], + "source/control/index.js": [], + "source/control/model.js": [], + "source/mira.js": [], + "source/apis/utils.js": [], + "source/apis/lib/changeAvatar.js": [], + "source/apis/lib/changeBio.js": [], + "source/apis/lib/changeCover.js": [], + "source/apis/lib/Client.js": [], + "source/apis/lib/getAccessToken.js": [], + "source/apis/lib/getCurrentUserID.js": [], + "source/apis/lib/getThreadInfo.js": [], + "source/apis/lib/getUserID.js": [], + "source/apis/lib/logout.js": [], + "source/apis/lib/markAsDelivered.js": [], + "source/apis/lib/markAsRead.js": [], + "source/apis/lib/Messenger.js": [], + "source/apis/lib/muteThread.js": [], + "source/apis/lib/post.js": [], + "source/apis/lib/resolvePhotoUrl.js": [], + "source/apis/lib/screenshot.js": [] + } +} diff --git a/config.json b/config.json new file mode 100644 index 0000000000000000000000000000000000000000..5795bea0c1721b1c40ad6f76edb561c8504535c1 --- /dev/null +++ b/config.json @@ -0,0 +1,62 @@ +{ + "facebookAccountOptions": { + "email": "", + "password": "", + "whiteID": "", + "pageID": "", + "proxy": null, + "cookies": "", + "facebookState": "fbstate.json" + }, + "dashboardOptions": { + "port": 25645, + "user": "zpNJSxhCuG@mira.com", + "password": "ZU2pXI93sDCT5mIy", + "resetAccount": false + }, + "botOptions": { + "adminOnly": false, + "name": "Mira", + "prefix": ",", + "adminIDs": [ + 100036947774673, + 100035731083424 + ] + }, + "facebookAPIsOptions": { + "autoReconnect": true, + "listenSelf": true, + "listenNotif": true, + "listenEventsSelf": true, + "listenEvents": true, + "forceLogin": true, + "autoRefreshState": true, + "online": true, + "updatePresence": true, + "autoMarkDelivery": true + }, + "systemOptions": { + "time_zone": "Asia/Ho_Chi_Minh", + "language": "en-US", + "autoUpdate": { + "enable": true, + "releaseOnly": true + }, + "autoRestart": { + "enable": true, + "timeMS": 3600000 + }, + "autoLoadPlugins": { + "enable": true, + "ignore": [] + }, + "autoReloadPlugins": { + "enable": true, + "ignore": [] + }, + "DataBase": { + "type": "sqlite", + "mongoURI": "mongodb+srv://GiaKhang1810:Promaxcapdo123@mira.kcuhmnf.mongodb.net/?retryWrites=true&w=majority&appName=Mira" + } + } +} \ No newline at end of file diff --git a/configCommands.json b/configCommands.json new file mode 100644 index 0000000000000000000000000000000000000000..58e5cb823ba210af55a66a36e61329ab4474c429 --- /dev/null +++ b/configCommands.json @@ -0,0 +1,4 @@ +{ + "fb": {}, + "facebook": {} +} \ No newline at end of file diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000000000000000000000000000000000000..dfdbca4211f1ee42a0469cf9739dd78655316a17 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,5631 @@ +{ + "name": "mira-bot-v1", + "version": "release-1.0.0", + "lockfileVersion": 3, + "requires": true, + "packages": { + "": { + "name": "mira-bot-v1", + "version": "release-1.0.0", + "license": "MIT", + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "axios": "^1.7.2", + "cheerio": "^1.0.0", + "ejs": "^3.1.10", + "express": "^4.19.2", + "express-session": "^1.18.0", + "express-ws": "^5.0.2", + "https-proxy-agent": "^7.0.5", + "moment-timezone": "^0.5.45", + "mongodb": "^6.8.0", + "mongoose": "^8.5.2", + "mqtt": "^5.9.1", + "mqtt-packet": "^9.0.0", + "puppeteer": "^22.14.0", + "request": "^2.88.2", + "sequelize": "^6.37.3", + "sqlite3": "^5.1.7", + "websocket-stream": "^5.5.2" + }, + "engines": { + "node": "16.x", + "npm": ">=7.0.0" + } + }, + "node_modules/@babel/code-frame": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.24.7.tgz", + "integrity": "sha512-BcYH1CVJBO9tvyIZ2jVeXgSIMvGZ2FDRvDdOIVQyuklNKSsx+eppDEBq/g47Ayw+RqNFE+URvOShmf+f/qwAlA==", + "license": "MIT", + "dependencies": { + "@babel/highlight": "^7.24.7", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/helper-validator-identifier": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/helper-validator-identifier/-/helper-validator-identifier-7.24.7.tgz", + "integrity": "sha512-rR+PBcQ1SMQDDyF6X0wxtG8QyLCgUB0eRAGguqRLfkCA87l7yAP7ehq8SNj96OOGTO8OBV70KhuFYcIkHXOg0w==", + "license": "MIT", + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight": { + "version": "7.24.7", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.24.7.tgz", + "integrity": "sha512-EStJpq4OuY8xYfhGVXngigBJRWxftKX9ksiGDnmlY3o7B/V7KIAc9X4oiK87uPJSc/vs5L869bem5fhZa8caZw==", + "license": "MIT", + "dependencies": { + "@babel/helper-validator-identifier": "^7.24.7", + "chalk": "^2.4.2", + "js-tokens": "^4.0.0", + "picocolors": "^1.0.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@babel/highlight/node_modules/ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "license": "MIT", + "dependencies": { + "color-convert": "^1.9.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "license": "MIT", + "dependencies": { + "color-name": "1.1.3" + } + }, + "node_modules/@babel/highlight/node_modules/color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha512-72fSenhMw2HZMTVHeCA9KCmpEIbzWiQsjN+BHcBbS9vr1mtt+vJjPdksIBNUmKAW8TFUDPJK5SUU3QhE9NEXDw==", + "license": "MIT" + }, + "node_modules/@babel/highlight/node_modules/has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha512-sKJf1+ceQBr4SMkvQnBDNDtf4TXpVhVGateu0t918bl30FnbE2m4vNLX+VWe/dpjlb+HugGYzW7uQXH98HPEYw==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/highlight/node_modules/supports-color": { + "version": "5.5.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.5.0.tgz", + "integrity": "sha512-QjVjwdXIt408MIiAqCX4oUKsgU2EqAGzs2Ppkm4aQYbjm+ZEWEcW4SfFNTr4uMNZma0ey4f5lgLrkB0aX0QMow==", + "license": "MIT", + "dependencies": { + "has-flag": "^3.0.0" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/@babel/runtime": { + "version": "7.25.0", + "resolved": "https://registry.npmjs.org/@babel/runtime/-/runtime-7.25.0.tgz", + "integrity": "sha512-7dRy4DwXwtzBrPbZflqxnvfxLF8kdZXPkhymtDeFoFqE6ldzjQFgYTtYIFARcLEYDrqfBfYcZt1WqFxRoyC9Rw==", + "license": "MIT", + "dependencies": { + "regenerator-runtime": "^0.14.0" + }, + "engines": { + "node": ">=6.9.0" + } + }, + "node_modules/@gar/promisify": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/@gar/promisify/-/promisify-1.1.3.tgz", + "integrity": "sha512-k2Ty1JcVojjJFwrg/ThKi2ujJ7XNLYaFGNB/bWT9wGR+oSMJHMa5w+CUq6p/pVrKeNNgA7pCqEcjSnHVoqJQFw==", + "license": "MIT", + "optional": true + }, + "node_modules/@mongodb-js/saslprep": { + "version": "1.1.8", + "resolved": "https://registry.npmjs.org/@mongodb-js/saslprep/-/saslprep-1.1.8.tgz", + "integrity": "sha512-qKwC/M/nNNaKUBMQ0nuzm47b7ZYWQHN3pcXq4IIcoSBc2hOIrflAxJduIvvqmhoz3gR2TacTAs8vlsCVPkiEdQ==", + "license": "MIT", + "dependencies": { + "sparse-bitfield": "^3.0.3" + } + }, + "node_modules/@npmcli/fs": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/@npmcli/fs/-/fs-1.1.1.tgz", + "integrity": "sha512-8KG5RD0GVP4ydEzRn/I4BNDuxDtqVbOdm8675T49OIG/NGhaK0pjPX7ZcDlvKYbA+ulvVK3ztfcF4uBdOxuJbQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@gar/promisify": "^1.0.1", + "semver": "^7.3.5" + } + }, + "node_modules/@npmcli/move-file": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@npmcli/move-file/-/move-file-1.1.2.tgz", + "integrity": "sha512-1SUf/Cg2GzGDyaf15aR9St9TWlb+XvbZXWpDx8YKs7MLzMH/BCeopv+y9vzrzgkfykCGuWOlSu3mZhj2+FQcrg==", + "deprecated": "This functionality has been moved to @npmcli/fs", + "license": "MIT", + "optional": true, + "dependencies": { + "mkdirp": "^1.0.4", + "rimraf": "^3.0.2" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/@puppeteer/browsers": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/@puppeteer/browsers/-/browsers-2.3.0.tgz", + "integrity": "sha512-ioXoq9gPxkss4MYhD+SFaU9p1IHFUX0ILAWFPyjGaBdjLsYAlZw6j1iLA0N/m12uVHLFDfSYNF7EQccjinIMDA==", + "license": "Apache-2.0", + "dependencies": { + "debug": "^4.3.5", + "extract-zip": "^2.0.1", + "progress": "^2.0.3", + "proxy-agent": "^6.4.0", + "semver": "^7.6.3", + "tar-fs": "^3.0.6", + "unbzip2-stream": "^1.4.3", + "yargs": "^17.7.2" + }, + "bin": { + "browsers": "lib/cjs/main-cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/@puppeteer/browsers/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/@puppeteer/browsers/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/@tootallnate/once": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@tootallnate/once/-/once-1.1.2.tgz", + "integrity": "sha512-RbzJvlNzmRq5c3O09UipeuXno4tA1FE6ikOjxZK0tuxVv3412l64l5t1W5pj4+rJq9vpkm/kwiR07aZXnsKPxw==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 6" + } + }, + "node_modules/@tootallnate/quickjs-emscripten": { + "version": "0.23.0", + "resolved": "https://registry.npmjs.org/@tootallnate/quickjs-emscripten/-/quickjs-emscripten-0.23.0.tgz", + "integrity": "sha512-C5Mc6rdnsaJDjO3UpGW/CQTHtCKaYlScZTly4JIu97Jxo/odCiH0ITnDXSJPTOrEKk/ycSZ0AOgTmkDtkOsvIA==", + "license": "MIT" + }, + "node_modules/@types/debug": { + "version": "4.1.12", + "resolved": "https://registry.npmjs.org/@types/debug/-/debug-4.1.12.tgz", + "integrity": "sha512-vIChWdVG3LG1SMxEvI/AK+FWJthlrqlTu7fbrlywTkkaONwk/UAGaULXRlf8vkzFBLVm0zkMdCquhL5aOjhXPQ==", + "license": "MIT", + "dependencies": { + "@types/ms": "*" + } + }, + "node_modules/@types/ms": { + "version": "0.7.34", + "resolved": "https://registry.npmjs.org/@types/ms/-/ms-0.7.34.tgz", + "integrity": "sha512-nG96G3Wp6acyAgJqGasjODb+acrI7KltPiRxzHPXnP3NgI28bpQDRv53olbqGXbfcgF5aiiHmO3xpwEpS5Ld9g==", + "license": "MIT" + }, + "node_modules/@types/node": { + "version": "22.2.0", + "resolved": "https://registry.npmjs.org/@types/node/-/node-22.2.0.tgz", + "integrity": "sha512-bm6EG6/pCpkxDf/0gDNDdtDILMOHgaQBVOJGdwsqClnxA3xL6jtMv76rLBc006RVMWbmaf0xbmom4Z/5o2nRkQ==", + "license": "MIT", + "dependencies": { + "undici-types": "~6.13.0" + } + }, + "node_modules/@types/readable-stream": { + "version": "4.0.15", + "resolved": "https://registry.npmjs.org/@types/readable-stream/-/readable-stream-4.0.15.tgz", + "integrity": "sha512-oAZ3kw+kJFkEqyh7xORZOku1YAKvsFTogRY8kVl4vHpEKiDkfnSA/My8haRE7fvmix5Zyy+1pwzOi7yycGLBJw==", + "license": "MIT", + "dependencies": { + "@types/node": "*", + "safe-buffer": "~5.1.1" + } + }, + "node_modules/@types/readable-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/@types/validator": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/@types/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-nH45Lk7oPIJ1RVOF6JgFI6Dy0QpHEzq4QecZhvguxYPDwT8c93prCMqAtiIttm39voZ+DDR+qkNnMpJmMBRqag==", + "license": "MIT" + }, + "node_modules/@types/webidl-conversions": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/@types/webidl-conversions/-/webidl-conversions-7.0.3.tgz", + "integrity": "sha512-CiJJvcRtIgzadHCYXw7dqEnMNRjhGZlYK05Mj9OyktqV8uVT8fD2BFOB7S1uwBE3Kj2Z+4UyPmFw/Ixgw/LAlA==", + "license": "MIT" + }, + "node_modules/@types/whatwg-url": { + "version": "11.0.5", + "resolved": "https://registry.npmjs.org/@types/whatwg-url/-/whatwg-url-11.0.5.tgz", + "integrity": "sha512-coYR071JRaHa+xoEvvYqvnIHaVqaYrLPbsufM9BF63HkwI5Lgmy2QR8Q5K/lYDYo5AK82wOvSOS0UsLTpTG7uQ==", + "license": "MIT", + "dependencies": { + "@types/webidl-conversions": "*" + } + }, + "node_modules/@types/ws": { + "version": "8.5.12", + "resolved": "https://registry.npmjs.org/@types/ws/-/ws-8.5.12.tgz", + "integrity": "sha512-3tPRkv1EtkDpzlgyKyI8pGsGZAGPEaXeu0DOj5DI25Ja91bdAYddYHbADRYVrZMRbfW+1l5YwXVDKohDJNQxkQ==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/@types/yauzl": { + "version": "2.10.3", + "resolved": "https://registry.npmjs.org/@types/yauzl/-/yauzl-2.10.3.tgz", + "integrity": "sha512-oJoftv0LSuaDZE3Le4DbKX+KS9G36NzOeSap90UIK0yMA/NhKJhqlSGtNDORNRaIbQfzjXDrQa0ytJ6mNRGz/Q==", + "license": "MIT", + "optional": true, + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/abbrev": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-1.1.1.tgz", + "integrity": "sha512-nne9/IiQ/hzIhY6pdDnbBtz7DjPTKrY00P/zvPSm5pOFkl6xuGrGnXn/VtTNNfNtAfZ9/1RtehkszU9qcTii0Q==", + "license": "ISC", + "optional": true + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "license": "MIT", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/accepts": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/accepts/-/accepts-1.3.8.tgz", + "integrity": "sha512-PYAthTa2m2VKxuvSD3DPC/Gy+U+sOA1LAuT8mkmRuvw+NACSaeXEQ+NHcVF7rONl6qcaxV3Uuemwawk+7+SJLw==", + "license": "MIT", + "dependencies": { + "mime-types": "~2.1.34", + "negotiator": "0.6.3" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/agent-base": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-7.1.1.tgz", + "integrity": "sha512-H0TSyFNDMomMNJQBn8wFV5YC/2eJ+VXECwOadZJT554xP6cODZHPX3H9QMQECxvrgiSOP1pHjy1sMWQVYJOUOA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/agent-base/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/agent-base/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/agentkeepalive": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/agentkeepalive/-/agentkeepalive-4.5.0.tgz", + "integrity": "sha512-5GG/5IbQQpC9FpkRGsSvZI5QYeSCzlJHdpBQntCsuTOxhKD8lqKhrleg2Yi7yvMIf82Ycmmqln9U8V9qwEiJew==", + "license": "MIT", + "optional": true, + "dependencies": { + "humanize-ms": "^1.2.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, + "node_modules/aggregate-error": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/aggregate-error/-/aggregate-error-3.1.0.tgz", + "integrity": "sha512-4I7Td01quW/RpocfNayFdFVk1qSuoh0E7JrbRJ16nH01HhKFQ88INq9Sd+nd72zqRySlr9BmDA8xlEJ6vJMrYA==", + "license": "MIT", + "optional": true, + "dependencies": { + "clean-stack": "^2.0.0", + "indent-string": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/ajv": { + "version": "6.12.6", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.12.6.tgz", + "integrity": "sha512-j3fVLgvTo527anyYyJOGTYJbG+vnnQYvE0m5mmkc1TK+nxAppkCLMIL0aZ4dblVCNoGShhm+kzE4ZUykBoMg4g==", + "license": "MIT", + "dependencies": { + "fast-deep-equal": "^3.1.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + }, + "funding": { + "type": "github", + "url": "https://github.com/sponsors/epoberezkin" + } + }, + "node_modules/ansi-regex": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", + "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/ansi-styles": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", + "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", + "license": "MIT", + "dependencies": { + "color-convert": "^2.0.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/chalk/ansi-styles?sponsor=1" + } + }, + "node_modules/aproba": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/aproba/-/aproba-2.0.0.tgz", + "integrity": "sha512-lYe4Gx7QT+MKGbDsA+Z+he/Wtef0BiwDOlK/XkBrdfsh9J/jPPXbX0tE9x9cl27Tmu5gg3QUbUrQYa/y+KOHPQ==", + "license": "ISC", + "optional": true + }, + "node_modules/are-we-there-yet": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/are-we-there-yet/-/are-we-there-yet-3.0.1.tgz", + "integrity": "sha512-QZW4EDmGwlYur0Yyf/b2uGucHQMa8aFUP7eu9ddR73vvhFyt4V0Vl3QHPcTNJ8l6qYOBdxgXdnBXQrHilfRQBg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "delegates": "^1.0.0", + "readable-stream": "^3.6.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/are-we-there-yet/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "optional": true, + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/argparse": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", + "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==", + "license": "Python-2.0" + }, + "node_modules/array-flatten": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/array-flatten/-/array-flatten-1.1.1.tgz", + "integrity": "sha512-PCVAQswWemu6UdxsDFFX/+gVeYqKAod3D3UVm91jHwynguOwAvYPhx8nNlM++NqRcK6CxxpUafjmhIdKiHibqg==", + "license": "MIT" + }, + "node_modules/asn1": { + "version": "0.2.6", + "resolved": "https://registry.npmjs.org/asn1/-/asn1-0.2.6.tgz", + "integrity": "sha512-ix/FxPn0MDjeyJ7i/yoHGFt/EX6LyNbxSEhPPXODPL+KB0VPk86UYfL0lMdy+KCnv+fmvIzySwaK5COwqVbWTQ==", + "license": "MIT", + "dependencies": { + "safer-buffer": "~2.1.0" + } + }, + "node_modules/assert-plus": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/assert-plus/-/assert-plus-1.0.0.tgz", + "integrity": "sha512-NfJ4UzBCcQGLDlQq7nHxH+tv3kyZ0hHQqF5BO6J7tNJeP5do1llPr8dZ8zHonfhAu0PHAdMkSo+8o0wxg9lZWw==", + "license": "MIT", + "engines": { + "node": ">=0.8" + } + }, + "node_modules/ast-types": { + "version": "0.13.4", + "resolved": "https://registry.npmjs.org/ast-types/-/ast-types-0.13.4.tgz", + "integrity": "sha512-x1FCFnFifvYDDzTaLII71vG5uvDwgtmDTEVWAxrgeiR8VjMONcCXJx7E+USjDtHlwFmt9MysbqgF9b9Vjr6w+w==", + "license": "MIT", + "dependencies": { + "tslib": "^2.0.1" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/async": { + "version": "3.2.5", + "resolved": "https://registry.npmjs.org/async/-/async-3.2.5.tgz", + "integrity": "sha512-baNZyqaaLhyLVKm/DlvdW051MSgO6b8eVfIezl9E5PqWxFgzLm/wQntEW4zOytVburDEr0JlALEpdOFwvErLsg==", + "license": "MIT" + }, + "node_modules/async-limiter": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/async-limiter/-/async-limiter-1.0.1.tgz", + "integrity": "sha512-csOlWGAcRFJaI6m+F2WKdnMKr4HhdhFVBk0H/QbJFMCr+uO2kwohwXQPxw/9OCxp05r5ghVBFSyioixx3gfkNQ==", + "license": "MIT" + }, + "node_modules/asynckit": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/asynckit/-/asynckit-0.4.0.tgz", + "integrity": "sha512-Oei9OH4tRh0YqU3GxhX79dM/mwVgvbZJaSNaRk+bshkj0S5cfHcgYakreBjrHwatXKbz+IoIdYLxrKim2MjW0Q==", + "license": "MIT" + }, + "node_modules/aws-sign2": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/aws-sign2/-/aws-sign2-0.7.0.tgz", + "integrity": "sha512-08kcGqnYf/YmjoRhfxyu+CLxBjUtHLXLXX/vUfx9l2LYzG3c1m61nrpyFUZI6zeS+Li/wWMMidD9KgrqtGq3mA==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/aws4": { + "version": "1.13.1", + "resolved": "https://registry.npmjs.org/aws4/-/aws4-1.13.1.tgz", + "integrity": "sha512-u5w79Rd7SU4JaIlA/zFqG+gOiuq25q5VLyZ8E+ijJeILuTxVzZgp2CaGw/UTw6pXYN9XMO9yiqj/nEHmhTG5CA==", + "license": "MIT" + }, + "node_modules/axios": { + "version": "1.7.3", + "resolved": "https://registry.npmjs.org/axios/-/axios-1.7.3.tgz", + "integrity": "sha512-Ar7ND9pU99eJ9GpoGQKhKf58GpUOgnzuaB7ueNQ5BMi0p+LZ5oaEnfF999fAArcTIBwXTCHAmGcHOZJaWPq9Nw==", + "license": "MIT", + "dependencies": { + "follow-redirects": "^1.15.6", + "form-data": "^4.0.0", + "proxy-from-env": "^1.1.0" + } + }, + "node_modules/b4a": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==", + "license": "Apache-2.0" + }, + "node_modules/balanced-match": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", + "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==", + "license": "MIT" + }, + "node_modules/bare-events": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/bare-events/-/bare-events-2.4.2.tgz", + "integrity": "sha512-qMKFd2qG/36aA4GwvKq8MxnPgCQAmBWmSyLWsJcbn8v03wvIPQ/hG1Ms8bPzndZxMDoHpxez5VOS+gC9Yi24/Q==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-fs": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/bare-fs/-/bare-fs-2.3.1.tgz", + "integrity": "sha512-W/Hfxc/6VehXlsgFtbB5B4xFcsCl+pAh30cYhoFyXErf6oGrwjh8SwiPAdHgpmWonKuYpZgGywN0SXt7dgsADA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-events": "^2.0.0", + "bare-path": "^2.0.0", + "bare-stream": "^2.0.0" + } + }, + "node_modules/bare-os": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/bare-os/-/bare-os-2.4.0.tgz", + "integrity": "sha512-v8DTT08AS/G0F9xrhyLtepoo9EJBJ85FRSMbu1pQUlAf6A8T0tEEQGMVObWeqpjhSPXsE0VGlluFBJu2fdoTNg==", + "license": "Apache-2.0", + "optional": true + }, + "node_modules/bare-path": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-path/-/bare-path-2.1.3.tgz", + "integrity": "sha512-lh/eITfU8hrj9Ru5quUp0Io1kJWIk1bTjzo7JH1P5dWmQ2EL4hFUlfI8FonAhSlgIfhn63p84CDY/x+PisgcXA==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "bare-os": "^2.1.0" + } + }, + "node_modules/bare-stream": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/bare-stream/-/bare-stream-2.1.3.tgz", + "integrity": "sha512-tiDAH9H/kP+tvNO5sczyn9ZAA7utrSMobyDchsnyyXBuUe2FSQWbxhtuHB8jwpHYYevVo2UJpcmvvjrbHboUUQ==", + "license": "Apache-2.0", + "optional": true, + "dependencies": { + "streamx": "^2.18.0" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/basic-ftp": { + "version": "5.0.5", + "resolved": "https://registry.npmjs.org/basic-ftp/-/basic-ftp-5.0.5.tgz", + "integrity": "sha512-4Bcg1P8xhUuqcii/S0Z9wiHIrQVPMermM1any+MX5GeGD7faD3/msQUDGLol9wOcz4/jbg/WJnGqoJF6LiBdtg==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + } + }, + "node_modules/bcrypt-pbkdf": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/bcrypt-pbkdf/-/bcrypt-pbkdf-1.0.2.tgz", + "integrity": "sha512-qeFIXtP4MSoi6NLqO12WfqARWWuCKi2Rn/9hJLEmtB5yTNr9DqFWkJRCf2qShWzPeAMRnOgCrq0sg/KLv5ES9w==", + "license": "BSD-3-Clause", + "dependencies": { + "tweetnacl": "^0.14.3" + } + }, + "node_modules/bignumber.js": { + "version": "9.1.2", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", + "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": "*" + } + }, + "node_modules/bindings": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/bindings/-/bindings-1.5.0.tgz", + "integrity": "sha512-p2q/t/mhvuOj/UeLlV6566GD/guowlr0hHxClI0W9m7MWYkL1F0hLo+0Aexs9HSPCtR1SXQ0TD3MMKrXZajbiQ==", + "license": "MIT", + "dependencies": { + "file-uri-to-path": "1.0.0" + } + }, + "node_modules/bl": { + "version": "6.0.14", + "resolved": "https://registry.npmjs.org/bl/-/bl-6.0.14.tgz", + "integrity": "sha512-TJfbvGdL7KFGxTsEbsED7avqpFdY56q9IW0/aiytyheJzxST/+Io6cx/4Qx0K2/u0BPRDs65mjaQzYvMZeNocQ==", + "license": "MIT", + "dependencies": { + "@types/readable-stream": "^4.0.0", + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^4.2.0" + } + }, + "node_modules/body-parser": { + "version": "1.20.2", + "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", + "integrity": "sha512-ml9pReCu3M61kGlqoTm2umSXTlRTuGTx0bfYj+uIUKKYycG5NtSbeetV3faSU6R7ajOPw0g/J1PvK4qNy7s5bA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "content-type": "~1.0.5", + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "on-finished": "2.4.1", + "qs": "6.11.0", + "raw-body": "2.5.2", + "type-is": "~1.6.18", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/boolbase": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/boolbase/-/boolbase-1.0.0.tgz", + "integrity": "sha512-JZOSA7Mo9sNGB8+UjSgzdLtokWAky1zbztM3WRLCbZ70/3cTANmQmOdR7y2g+J0e2WXywy1yS468tY+IruqEww==", + "license": "ISC" + }, + "node_modules/brace-expansion": { + "version": "1.1.11", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", + "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "node_modules/bson": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/bson/-/bson-6.8.0.tgz", + "integrity": "sha512-iOJg8pr7wq2tg/zSlCCHMi3hMm5JTOxLTagf3zxhcenHsFp+c6uOs6K7W5UE7A4QIJGtqh/ZovFNMP4mOPJynQ==", + "license": "Apache-2.0", + "engines": { + "node": ">=16.20.1" + } + }, + "node_modules/buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, + "node_modules/buffer-crc32": { + "version": "0.2.13", + "resolved": "https://registry.npmjs.org/buffer-crc32/-/buffer-crc32-0.2.13.tgz", + "integrity": "sha512-VO9Ht/+p3SN7SKWqcrgEzjGbRSJYTx+Q1pTQC0wrWqHx0vpJraQ6GtHx8tvcg1rlK1byhU5gccxgOgj7B0TDkQ==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-from": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.2.tgz", + "integrity": "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ==", + "license": "MIT" + }, + "node_modules/bytes": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/bytes/-/bytes-3.1.2.tgz", + "integrity": "sha512-/Nf7TyzTx6S3yRJObOAV7956r8cr2+Oj8AC5dt8wSP3BQAoeX58NoHyCU8P8zGkNXStjTSi6fzO6F0pBdcYbEg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/cacache": { + "version": "15.3.0", + "resolved": "https://registry.npmjs.org/cacache/-/cacache-15.3.0.tgz", + "integrity": "sha512-VVdYzXEn+cnbXpFgWs5hTT7OScegHVmLhJIR8Ufqk3iFD6A6j5iSX1KuBTfNEv4tdJWE2PzA6IVFtcLC7fN9wQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "@npmcli/fs": "^1.0.0", + "@npmcli/move-file": "^1.0.1", + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "glob": "^7.1.4", + "infer-owner": "^1.0.4", + "lru-cache": "^6.0.0", + "minipass": "^3.1.1", + "minipass-collect": "^1.0.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.2", + "mkdirp": "^1.0.3", + "p-map": "^4.0.0", + "promise-inflight": "^1.0.1", + "rimraf": "^3.0.2", + "ssri": "^8.0.1", + "tar": "^6.0.2", + "unique-filename": "^1.1.1" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/cacache/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/call-bind": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", + "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "set-function-length": "^1.2.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/callsites": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.1.0.tgz", + "integrity": "sha512-P8BjAsXvZS+VIDUI11hHCQEv74YT67YUi5JJFNWIqL235sBmjX4+qx9Muvls5ivyNENctx46xQLQ3aTuE7ssaQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/caseless": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/caseless/-/caseless-0.12.0.tgz", + "integrity": "sha512-4tYFyifaFfGacoiObjJegolkwSU4xQNGbVgUiNYVUxbQ2x2lUsFvY4hVgVzGiIe6WLOPqycWXA40l+PWsxthUw==", + "license": "Apache-2.0" + }, + "node_modules/chalk": { + "version": "4.1.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", + "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.1.0", + "supports-color": "^7.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/chalk?sponsor=1" + } + }, + "node_modules/cheerio": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/cheerio/-/cheerio-1.0.0.tgz", + "integrity": "sha512-quS9HgjQpdaXOvsZz82Oz7uxtXiy6UIsIQcpBj7HRw2M63Skasm9qlDocAM7jNuaxdhpPU7c4kJN+gA5MCu4ww==", + "license": "MIT", + "dependencies": { + "cheerio-select": "^2.1.0", + "dom-serializer": "^2.0.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "encoding-sniffer": "^0.2.0", + "htmlparser2": "^9.1.0", + "parse5": "^7.1.2", + "parse5-htmlparser2-tree-adapter": "^7.0.0", + "parse5-parser-stream": "^7.1.2", + "undici": "^6.19.5", + "whatwg-mimetype": "^4.0.0" + }, + "engines": { + "node": ">=18.17" + }, + "funding": { + "url": "https://github.com/cheeriojs/cheerio?sponsor=1" + } + }, + "node_modules/cheerio-select": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cheerio-select/-/cheerio-select-2.1.0.tgz", + "integrity": "sha512-9v9kG0LvzrlcungtnJtpGNxY+fzECQKhK4EGJX2vByejiMX84MFNQw4UxPJl3bFbTMw+Dfs37XaIkCwTZfLh4g==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-select": "^5.1.0", + "css-what": "^6.1.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/chownr": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-2.0.0.tgz", + "integrity": "sha512-bIomtDF5KGpdogkLd9VspvFzk9KfpyyGlS8YFVZl7TGPBHL5snIOnxeshwVgPteQ9b4Eydl+pVbIyE1DcvCWgQ==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/chromium-bidi": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/chromium-bidi/-/chromium-bidi-0.6.3.tgz", + "integrity": "sha512-qXlsCmpCZJAnoTYI83Iu6EdYQpMYdVkCfq08KDh2pmlVqK5t5IA9mGs4/LwCwp4fqisSOMXZxP3HIh8w8aRn0A==", + "license": "Apache-2.0", + "dependencies": { + "mitt": "3.0.1", + "urlpattern-polyfill": "10.0.0", + "zod": "3.23.8" + }, + "peerDependencies": { + "devtools-protocol": "*" + } + }, + "node_modules/clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=6" + } + }, + "node_modules/cliui": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", + "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", + "license": "ISC", + "dependencies": { + "string-width": "^4.2.0", + "strip-ansi": "^6.0.1", + "wrap-ansi": "^7.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "license": "MIT", + "dependencies": { + "color-name": "~1.1.4" + }, + "engines": { + "node": ">=7.0.0" + } + }, + "node_modules/color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "license": "MIT" + }, + "node_modules/color-support": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-support/-/color-support-1.1.3.tgz", + "integrity": "sha512-qiBjkpbMLO/HL68y+lh4q0/O1MZFj2RX6X/KmMa3+gJD3z+WwI1ZzDHysvqHGS3mP6mznPckpXmw1nI9cJjyRg==", + "license": "ISC", + "optional": true, + "bin": { + "color-support": "bin.js" + } + }, + "node_modules/combined-stream": { + "version": "1.0.8", + "resolved": "https://registry.npmjs.org/combined-stream/-/combined-stream-1.0.8.tgz", + "integrity": "sha512-FQN4MRfuJeHf7cBbBMJFXhKSDq+2kAArBlmRBvcvFE5BB1HZKXtSFASDhdlz9zOYwxh8lDdnvmMOe/+5cdoEdg==", + "license": "MIT", + "dependencies": { + "delayed-stream": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/commist": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/commist/-/commist-3.2.0.tgz", + "integrity": "sha512-4PIMoPniho+LqXmpS5d3NuGYncG6XWlkBSVGiWycL22dd42OYdUGil2CWuzklaJoNxyxUSpO4MKIBU94viWNAw==", + "license": "MIT" + }, + "node_modules/concat-map": { + "version": "0.0.1", + "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", + "license": "MIT" + }, + "node_modules/concat-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/concat-stream/-/concat-stream-2.0.0.tgz", + "integrity": "sha512-MWufYdFw53ccGjCA+Ol7XJYpAlW6/prSMzuPOTRnJGcGzuhLn4Scrz7qf6o8bROZ514ltazcIFJZevcfbo0x7A==", + "engines": [ + "node >= 6.0" + ], + "license": "MIT", + "dependencies": { + "buffer-from": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.0.2", + "typedarray": "^0.0.6" + } + }, + "node_modules/concat-stream/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/console-control-strings": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/console-control-strings/-/console-control-strings-1.1.0.tgz", + "integrity": "sha512-ty/fTekppD2fIwRvnZAVdeOiGd1c7YXEixbgJTNzqcxJWKQnjJ/V1bNEEE6hygpM3WjwHFUVK6HTjWSzV4a8sQ==", + "license": "ISC", + "optional": true + }, + "node_modules/content-disposition": { + "version": "0.5.4", + "resolved": "https://registry.npmjs.org/content-disposition/-/content-disposition-0.5.4.tgz", + "integrity": "sha512-FveZTNuGw04cxlAiWbzi6zTAL/lhehaWbTtgluJh4/E95DqMwTmha3KZN1aAWA8cFIhHzMZUvLevkw5Rqk+tSQ==", + "license": "MIT", + "dependencies": { + "safe-buffer": "5.2.1" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/content-type": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/content-type/-/content-type-1.0.5.tgz", + "integrity": "sha512-nTjqfcBFEipKdXCv4YDQWCfmcLZKm81ldF0pAopTvyrFGVbcR6P/VAAd5G7N+0tTr8QqiU0tFadD6FK4NtJwOA==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/cookie/-/cookie-0.6.0.tgz", + "integrity": "sha512-U71cyTamuh1CRNCfpGY6to28lxvNwPG4Guz/EVjgf3Jmzv0vlDp1atT9eS5dDjMYHucpHbWns6Lwf3BKz6svdw==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/cookie-signature": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.6.tgz", + "integrity": "sha512-QADzlaHc8icV8I7vbaJXJwod9HWYp8uCqf1xa4OfNu1T7JVxQIrUgOWtHdNDtPiywmFbiS12VjotIXLrKM3orQ==", + "license": "MIT" + }, + "node_modules/core-util-is": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/core-util-is/-/core-util-is-1.0.2.tgz", + "integrity": "sha512-3lqz5YjWTYnW6dlDa5TLaTCcShfar1e40rmcJVwCBJC6mWlFuj0eCHIElmG1g5kyuJ/GD+8Wn4FFCcz4gJPfaQ==", + "license": "MIT" + }, + "node_modules/cosmiconfig": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/cosmiconfig/-/cosmiconfig-9.0.0.tgz", + "integrity": "sha512-itvL5h8RETACmOTFc4UfIyB2RfEHi71Ax6E/PivVxq9NseKbOWpeyHEOIbmAw1rs8Ak0VursQNww7lf7YtUwzg==", + "license": "MIT", + "dependencies": { + "env-paths": "^2.2.1", + "import-fresh": "^3.3.0", + "js-yaml": "^4.1.0", + "parse-json": "^5.2.0" + }, + "engines": { + "node": ">=14" + }, + "funding": { + "url": "https://github.com/sponsors/d-fischer" + }, + "peerDependencies": { + "typescript": ">=4.9.5" + }, + "peerDependenciesMeta": { + "typescript": { + "optional": true + } + } + }, + "node_modules/css-select": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/css-select/-/css-select-5.1.0.tgz", + "integrity": "sha512-nwoRF1rvRRnnCqqY7updORDsuqKzqYJ28+oSMaJMMgOauh3fvwHqMS7EZpIPqK8GL+g9mKxF1vP/ZjSeNjEVHg==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0", + "css-what": "^6.1.0", + "domhandler": "^5.0.2", + "domutils": "^3.0.1", + "nth-check": "^2.0.1" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/css-what": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/css-what/-/css-what-6.1.0.tgz", + "integrity": "sha512-HTUrgRJ7r4dsZKU6GjmpfRK1O76h97Z8MfS1G0FozR+oF2kG6Vfe8JE6zwrkbxigziPHinCJ+gCPjA9EaBDtRw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">= 6" + }, + "funding": { + "url": "https://github.com/sponsors/fb55" + } + }, + "node_modules/dashdash": { + "version": "1.14.1", + "resolved": "https://registry.npmjs.org/dashdash/-/dashdash-1.14.1.tgz", + "integrity": "sha512-jRFi8UDGo6j+odZiEpjazZaWqEal3w/basFjQHQEwVtZJGDpxbH1MeYluwCS8Xq5wmLJooDlMgvVarmWfGM44g==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + }, + "engines": { + "node": ">=0.10" + } + }, + "node_modules/data-uri-to-buffer": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/data-uri-to-buffer/-/data-uri-to-buffer-6.0.2.tgz", + "integrity": "sha512-7hvf7/GW8e86rW0ptuwS3OcBGDjIi6SZva7hCyWC0yYry2cOPmLIjXAUHI6DK2HsnwJd9ifmt57i8eV2n4YNpw==", + "license": "MIT", + "engines": { + "node": ">= 14" + } + }, + "node_modules/debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "license": "MIT", + "dependencies": { + "ms": "2.0.0" + } + }, + "node_modules/decompress-response": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-6.0.0.tgz", + "integrity": "sha512-aW35yZM6Bb/4oJlZncMH2LCoZtJXTRxES17vE3hoRiowU2kWHaJKFkSBDnDR+cm9J+9QhXmREyIfv0pji9ejCQ==", + "license": "MIT", + "dependencies": { + "mimic-response": "^3.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/deep-extend": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", + "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/define-data-property": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", + "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0", + "es-errors": "^1.3.0", + "gopd": "^1.0.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/degenerator": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/degenerator/-/degenerator-5.0.1.tgz", + "integrity": "sha512-TllpMR/t0M5sqCXfj85i4XaAzxmS5tVA16dqvdkMwGmzI+dXLXnw3J+3Vdv7VKw+ThlTMboK6i9rnZ6Nntj5CQ==", + "license": "MIT", + "dependencies": { + "ast-types": "^0.13.4", + "escodegen": "^2.1.0", + "esprima": "^4.0.1" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/delayed-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delayed-stream/-/delayed-stream-1.0.0.tgz", + "integrity": "sha512-ZySD7Nf91aLB0RxL4KGrKHBXl7Eds1DAmEdcoVawXnLD7SDhpNgtuII2aAkg7a7QS41jxPSZ17p4VdGnMHk3MQ==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/delegates": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/delegates/-/delegates-1.0.0.tgz", + "integrity": "sha512-bd2L678uiWATM6m5Z1VzNCErI3jiGzt6HGY8OVICs40JQq/HALfbyNJmp0UDakEY4pMMaN0Ly5om/B1VI/+xfQ==", + "license": "MIT", + "optional": true + }, + "node_modules/depd": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/depd/-/depd-2.0.0.tgz", + "integrity": "sha512-g7nH6P6dyDioJogAAGprGpCtVImJhpPk/roCzdb3fIh61/s/nPsfR6onyMwkCAR/OlC3yBC0lESvUoQEAssIrw==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/destroy": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/destroy/-/destroy-1.2.0.tgz", + "integrity": "sha512-2sJGJTaXIIaR1w4iJSNoN0hnMY7Gpc/n8D4qSCJw8QqFWXf7cuAgnEHxBpweaVcPevC2l3KpjYCx3NypQQgaJg==", + "license": "MIT", + "engines": { + "node": ">= 0.8", + "npm": "1.2.8000 || >= 1.4.16" + } + }, + "node_modules/detect-libc": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/detect-libc/-/detect-libc-2.0.3.tgz", + "integrity": "sha512-bwy0MGW55bG41VqxxypOsdSdGqLwXPI/focwgTYCFMbdUiBAxLg9CFzG08sz2aqzknwiX7Hkl0bQENjg8iLByw==", + "license": "Apache-2.0", + "engines": { + "node": ">=8" + } + }, + "node_modules/devtools-protocol": { + "version": "0.0.1312386", + "resolved": "https://registry.npmjs.org/devtools-protocol/-/devtools-protocol-0.0.1312386.tgz", + "integrity": "sha512-DPnhUXvmvKT2dFA/j7B+riVLUt9Q6RKJlcppojL5CoRywJJKLDYnRlw0gTFKfgDPHP5E04UoB71SxoJlVZy8FA==", + "license": "BSD-3-Clause" + }, + "node_modules/dom-serializer": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/dom-serializer/-/dom-serializer-2.0.0.tgz", + "integrity": "sha512-wIkAryiqt/nV5EQKqQpo3SToSOV9J0DnbJqwK7Wv/Trc92zIAYZ4FlMu+JPFW1DfGFt81ZTCGgDEabffXeLyJg==", + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.2", + "entities": "^4.2.0" + }, + "funding": { + "url": "https://github.com/cheeriojs/dom-serializer?sponsor=1" + } + }, + "node_modules/domelementtype": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/domelementtype/-/domelementtype-2.3.0.tgz", + "integrity": "sha512-OLETBj6w0OsagBwdXnPdN0cnMfF9opN69co+7ZrbfPGrdpPVNBUj02spi6B1N7wChLQiPn4CSH/zJvXw56gmHw==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "BSD-2-Clause" + }, + "node_modules/domhandler": { + "version": "5.0.3", + "resolved": "https://registry.npmjs.org/domhandler/-/domhandler-5.0.3.tgz", + "integrity": "sha512-cgwlv/1iFQiFnU96XXgROh8xTeetsnJiDsTc7TYCLFd9+/WNkIqPTxiM/8pSd8VIrhXGTf1Ny1q1hquVqDJB5w==", + "license": "BSD-2-Clause", + "dependencies": { + "domelementtype": "^2.3.0" + }, + "engines": { + "node": ">= 4" + }, + "funding": { + "url": "https://github.com/fb55/domhandler?sponsor=1" + } + }, + "node_modules/domutils": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/domutils/-/domutils-3.1.0.tgz", + "integrity": "sha512-H78uMmQtI2AhgDJjWeQmHwJJ2bLPD3GMmO7Zja/ZZh84wkm+4ut+IUnUdRa8uCGX88DiVx1j6FRe1XfxEgjEZA==", + "license": "BSD-2-Clause", + "dependencies": { + "dom-serializer": "^2.0.0", + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3" + }, + "funding": { + "url": "https://github.com/fb55/domutils?sponsor=1" + } + }, + "node_modules/dottie": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/dottie/-/dottie-2.0.6.tgz", + "integrity": "sha512-iGCHkfUc5kFekGiqhe8B/mdaurD+lakO9txNnTvKtA6PISrw86LgqHvRzWYPyoE2Ph5aMIrCw9/uko6XHTKCwA==", + "license": "MIT" + }, + "node_modules/duplexify": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/duplexify/-/duplexify-3.7.1.tgz", + "integrity": "sha512-07z8uv2wMyS51kKhD1KsdXJg5WQ6t93RneqRxUHnskXVtlYYkLqM0gqStQZ3pj073g687jPCHrqNfCzawLYh5g==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.0.0", + "inherits": "^2.0.1", + "readable-stream": "^2.0.0", + "stream-shift": "^1.0.0" + } + }, + "node_modules/duplexify/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/duplexify/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/duplexify/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/ecc-jsbn": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/ecc-jsbn/-/ecc-jsbn-0.1.2.tgz", + "integrity": "sha512-eh9O+hwRHNbG4BLTjEl3nw044CkGm5X6LoaCf7LPp7UU8Qrt47JYNi6nPX8xjW97TKGKm1ouctg0QSpZe9qrnw==", + "license": "MIT", + "dependencies": { + "jsbn": "~0.1.0", + "safer-buffer": "^2.1.0" + } + }, + "node_modules/ecc-jsbn/node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "license": "MIT" + }, + "node_modules/ee-first": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", + "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==", + "license": "MIT" + }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "license": "Apache-2.0", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "license": "MIT" + }, + "node_modules/encodeurl": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/encodeurl/-/encodeurl-1.0.2.tgz", + "integrity": "sha512-TPJXq8JqFaVYm2CWmPvnP2Iyo4ZSM7/QKcSmuMLDObfpH5fi7RUGmd/rTDf+rut/saiDiQEeVTNgAmJEdAOx0w==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/encoding": { + "version": "0.1.13", + "resolved": "https://registry.npmjs.org/encoding/-/encoding-0.1.13.tgz", + "integrity": "sha512-ETBauow1T35Y/WZMkio9jiM0Z5xjHHmJ4XmjZOq1l/dXz3lr2sRn87nJy20RupqSh1F2m3HHPSp8ShIPQJrJ3A==", + "license": "MIT", + "optional": true, + "dependencies": { + "iconv-lite": "^0.6.2" + } + }, + "node_modules/encoding-sniffer": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/encoding-sniffer/-/encoding-sniffer-0.2.0.tgz", + "integrity": "sha512-ju7Wq1kg04I3HtiYIOrUrdfdDvkyO9s5XM8QAj/bN61Yo/Vb4vgJxy5vi4Yxk01gWHbrofpPtpxM8bKger9jhg==", + "license": "MIT", + "dependencies": { + "iconv-lite": "^0.6.3", + "whatwg-encoding": "^3.1.1" + }, + "funding": { + "url": "https://github.com/fb55/encoding-sniffer?sponsor=1" + } + }, + "node_modules/encoding-sniffer/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "optional": true, + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "license": "MIT", + "dependencies": { + "once": "^1.4.0" + } + }, + "node_modules/entities": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/entities/-/entities-4.5.0.tgz", + "integrity": "sha512-V0hjH4dGPh9Ao5p0MoRY6BVqtwCjhz6vI5LT8AJ55H+4g9/4vbHx1I54fS0XuclLhDHArPQCiMjDxjaL8fPxhw==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.12" + }, + "funding": { + "url": "https://github.com/fb55/entities?sponsor=1" + } + }, + "node_modules/env-paths": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/env-paths/-/env-paths-2.2.1.tgz", + "integrity": "sha512-+h1lkLKhZMTYjog1VEpJNG7NZJWcuc2DDk/qsqSTRRCOXiLjeQ1d1/udrUGhqMxUgAlwKNZ0cf2uqan5GLuS2A==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/err-code": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/err-code/-/err-code-2.0.3.tgz", + "integrity": "sha512-2bmlRpNKBxT/CRmPOlyISQpNj+qSeYvcym/uT0Jx2bMOlKLtSy1ZmLuVxSEKKyor/N5yhvp/ZiG1oE3DEYMSFA==", + "license": "MIT", + "optional": true + }, + "node_modules/error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "license": "MIT", + "dependencies": { + "is-arrayish": "^0.2.1" + } + }, + "node_modules/es-define-property": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", + "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.2.4" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/es-errors": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", + "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/escalade": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.1.2.tgz", + "integrity": "sha512-ErCHMCae19vR8vQGe50xIsVomy19rg6gFu3+r3jkEO46suLMWBksvVyoGgQV+jOfl84ZSOSlmv6Gxa89PmTGmA==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/escape-html": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/escape-html/-/escape-html-1.0.3.tgz", + "integrity": "sha512-NiSupZ4OeuGwr68lGIeym/ksIZMJodUGOSCZ/FSnTxcrekbvqrgdUxlJOMpijaKZVjAJrWrGs/6Jy8OMuyj9ow==", + "license": "MIT" + }, + "node_modules/escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha512-vbRorB5FUQWvla16U8R/qgaFIya2qGzwDrNmCZuYKrbdSUMG6I1ZCGQRefkRVhuOkIGVne7BQ35DSfo1qvJqFg==", + "license": "MIT", + "engines": { + "node": ">=0.8.0" + } + }, + "node_modules/escodegen": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-2.1.0.tgz", + "integrity": "sha512-2NlIDTwUWJN0mRPQOdtQBzbUHvdGY2P1VXSyU83Q3xKxM7WHX2Ql8dKq782Q9TgQUNOLEzEYu9bzLNj1q88I5w==", + "license": "BSD-2-Clause", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^5.2.0", + "esutils": "^2.0.2" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=6.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "license": "BSD-2-Clause", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/estraverse": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-5.3.0.tgz", + "integrity": "sha512-MMdARuVEQziNTeJD8DgMqmhwR11BRQ/cBP+pLtYdSTnf3MIO8fFeiINEbX36ZdNlfU/7A9f3gUw49B3oQsvwBA==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=4.0" + } + }, + "node_modules/esutils": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", + "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/etag": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/etag/-/etag-1.8.1.tgz", + "integrity": "sha512-aIL5Fx7mawVa300al2BnEE4iNvo1qETxLrPI/o05L7z6go7fCw1J6EQmbK4FmJ2AS7kgVF/KEZWufBfdClMcPg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/events": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/events/-/events-3.3.0.tgz", + "integrity": "sha512-mQw+2fkQbALzQ7V0MY0IqdnXNOeTtP4r0lN9z7AAawCXgqea7bDii20AYrIBrFd/Hx0M2Ocz6S111CaFkUcb0Q==", + "license": "MIT", + "engines": { + "node": ">=0.8.x" + } + }, + "node_modules/expand-template": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/expand-template/-/expand-template-2.0.3.tgz", + "integrity": "sha512-XYfuKMvj4O35f/pOXLObndIRvyQ+/+6AhODh+OKWj9S9498pHHn/IMszH+gt0fBCRWMNfk1ZSp5x3AifmnI2vg==", + "license": "(MIT OR WTFPL)", + "engines": { + "node": ">=6" + } + }, + "node_modules/express": { + "version": "4.19.2", + "resolved": "https://registry.npmjs.org/express/-/express-4.19.2.tgz", + "integrity": "sha512-5T6nhjsT+EOMzuck8JjBHARTHfMht0POzlA60WV2pMD3gyXw2LZnZ+ueGdNxG+0calOJcWKbpFcuzLZ91YWq9Q==", + "license": "MIT", + "dependencies": { + "accepts": "~1.3.8", + "array-flatten": "1.1.1", + "body-parser": "1.20.2", + "content-disposition": "0.5.4", + "content-type": "~1.0.4", + "cookie": "0.6.0", + "cookie-signature": "1.0.6", + "debug": "2.6.9", + "depd": "2.0.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "finalhandler": "1.2.0", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "merge-descriptors": "1.0.1", + "methods": "~1.1.2", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "path-to-regexp": "0.1.7", + "proxy-addr": "~2.0.7", + "qs": "6.11.0", + "range-parser": "~1.2.1", + "safe-buffer": "5.2.1", + "send": "0.18.0", + "serve-static": "1.15.0", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "type-is": "~1.6.18", + "utils-merge": "1.0.1", + "vary": "~1.1.2" + }, + "engines": { + "node": ">= 0.10.0" + } + }, + "node_modules/express-session": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/express-session/-/express-session-1.18.0.tgz", + "integrity": "sha512-m93QLWr0ju+rOwApSsyso838LQwgfs44QtOP/WBiwtAgPIo/SAh1a5c6nn2BR6mFNZehTpqKDESzP+fRHVbxwQ==", + "license": "MIT", + "dependencies": { + "cookie": "0.6.0", + "cookie-signature": "1.0.7", + "debug": "2.6.9", + "depd": "~2.0.0", + "on-headers": "~1.0.2", + "parseurl": "~1.3.3", + "safe-buffer": "5.2.1", + "uid-safe": "~2.1.5" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/express-session/node_modules/cookie-signature": { + "version": "1.0.7", + "resolved": "https://registry.npmjs.org/cookie-signature/-/cookie-signature-1.0.7.tgz", + "integrity": "sha512-NXdYc3dLr47pBkpUCHtKSwIOQXLVn8dZEuywboCOJY/osA0wFSLlSawr3KN8qXJEyX66FcONTH8EIlVuK0yyFA==", + "license": "MIT" + }, + "node_modules/express-ws": { + "version": "5.0.2", + "resolved": "https://registry.npmjs.org/express-ws/-/express-ws-5.0.2.tgz", + "integrity": "sha512-0uvmuk61O9HXgLhGl3QhNSEtRsQevtmbL94/eILaliEADZBHZOQUAiHFrGPrgsjikohyrmSG5g+sCfASTt0lkQ==", + "license": "BSD-2-Clause", + "dependencies": { + "ws": "^7.4.6" + }, + "engines": { + "node": ">=4.5.0" + }, + "peerDependencies": { + "express": "^4.0.0 || ^5.0.0-alpha.1" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==", + "license": "MIT" + }, + "node_modules/extract-zip": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/extract-zip/-/extract-zip-2.0.1.tgz", + "integrity": "sha512-GDhU9ntwuKyGXdZBUgTIe+vXnWj0fppUEtMDL0+idd5Sta8TGpHssn/eusA9mrPr9qNDym6SxAYZjNvCn/9RBg==", + "license": "BSD-2-Clause", + "dependencies": { + "debug": "^4.1.1", + "get-stream": "^5.1.0", + "yauzl": "^2.10.0" + }, + "bin": { + "extract-zip": "cli.js" + }, + "engines": { + "node": ">= 10.17.0" + }, + "optionalDependencies": { + "@types/yauzl": "^2.9.1" + } + }, + "node_modules/extract-zip/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/extract-zip/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/extsprintf": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", + "integrity": "sha512-11Ndz7Nv+mvAC1j0ktTa7fAb0vLyGGX+rMHNBYQviQDGU0Hw7lhctJANqbPhu9nV9/izT/IntTgZ7Im/9LJs9g==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT" + }, + "node_modules/fast-deep-equal": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-3.1.3.tgz", + "integrity": "sha512-f3qQ9oQy9j2AhBe/H9VC91wLmKBCCU/gDOnKNAYG5hswO7BLKj09Hc5HYNz9cGI++xlpDCIgDaitVs03ATR84Q==", + "license": "MIT" + }, + "node_modules/fast-fifo": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/fast-fifo/-/fast-fifo-1.3.2.tgz", + "integrity": "sha512-/d9sfos4yxzpwkDkuN7k2SqFKtYNmCTzgfEpz82x34IM9/zc8KGxQoXg1liNC/izpRM/MBdt44Nmx41ZWqk+FQ==", + "license": "MIT" + }, + "node_modules/fast-json-stable-stringify": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz", + "integrity": "sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw==", + "license": "MIT" + }, + "node_modules/fast-unique-numbers": { + "version": "8.0.13", + "resolved": "https://registry.npmjs.org/fast-unique-numbers/-/fast-unique-numbers-8.0.13.tgz", + "integrity": "sha512-7OnTFAVPefgw2eBJ1xj2PGGR9FwYzSUso9decayHgCDX4sJkHLdcsYTytTg+tYv+wKF3U8gJuSBz2jJpQV4u/g==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.23.8", + "tslib": "^2.6.2" + }, + "engines": { + "node": ">=16.1.0" + } + }, + "node_modules/fd-slicer": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/fd-slicer/-/fd-slicer-1.1.0.tgz", + "integrity": "sha512-cE1qsB/VwyQozZ+q1dGxR8LBYNZeofhEdUNGSMbQD3Gw2lAzX9Zb3uIU6Ebc/Fmyjo9AWWfnn0AUCHqtevs/8g==", + "license": "MIT", + "dependencies": { + "pend": "~1.2.0" + } + }, + "node_modules/file-uri-to-path": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/file-uri-to-path/-/file-uri-to-path-1.0.0.tgz", + "integrity": "sha512-0Zt+s3L7Vf1biwWZ29aARiVYLx7iMGnEUl9x33fbB/j3jR81u/O2LbqK+Bm1CDSNDKVtJ/YjwY7TUd5SkeLQLw==", + "license": "MIT" + }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "license": "Apache-2.0", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "license": "MIT", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/finalhandler": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/finalhandler/-/finalhandler-1.2.0.tgz", + "integrity": "sha512-5uXcUVftlQMFnWC9qu/svkWv3GTd2PfUhK/3PLkYNAe7FbqJMt3515HaxE6eRL74GdsriiwujiawdaB1BpEISg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "on-finished": "2.4.1", + "parseurl": "~1.3.3", + "statuses": "2.0.1", + "unpipe": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/follow-redirects": { + "version": "1.15.6", + "resolved": "https://registry.npmjs.org/follow-redirects/-/follow-redirects-1.15.6.tgz", + "integrity": "sha512-wWN62YITEaOpSK584EZXJafH1AGpO8RVgElfkuXbTOrPX4fIfOyEpW/CsiNd8JdYrAoOvafRTOEnvsO++qCqFA==", + "funding": [ + { + "type": "individual", + "url": "https://github.com/sponsors/RubenVerborgh" + } + ], + "license": "MIT", + "engines": { + "node": ">=4.0" + }, + "peerDependenciesMeta": { + "debug": { + "optional": true + } + } + }, + "node_modules/forever-agent": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/forever-agent/-/forever-agent-0.6.1.tgz", + "integrity": "sha512-j0KLYPhm6zeac4lz3oJ3o65qvgQCcPubiyotZrXqEaG4hNagNYO8qdlUrX5vwqv9ohqeT/Z3j6+yW067yWWdUw==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/form-data": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-4.0.0.tgz", + "integrity": "sha512-ETEklSGi5t0QMZuiXoA/Q6vcnxcLQP5vdugSpuAyi6SVGi2clPPp+xgEhuMaHC+zGgn31Kd235W35f7Hykkaww==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.8", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/forwarded": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/forwarded/-/forwarded-0.2.0.tgz", + "integrity": "sha512-buRG0fpBtRHSTCOASe6hD258tEubFoRLb4ZNA6NxMVHNw2gOcwHo9wyablzMzOA5z9xA9L1KNjk/Nt6MT9aYow==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fresh": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/fresh/-/fresh-0.5.2.tgz", + "integrity": "sha512-zJ2mQYM18rEFOudeV4GShTGIQ7RbzA7ozbU9I/XBpm7kqgMywgmylMwXHxZJmkVoYkna9d2pVXVXPdYTP9ej8Q==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/fs-constants": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs-constants/-/fs-constants-1.0.0.tgz", + "integrity": "sha512-y6OAwoSIf7FyjMIv94u+b5rdheZEjzR63GTyZJm5qh4Bi+2YgwLCcI/fPFZkL5PSixOt6ZNKm+w+Hfp/Bciwow==", + "license": "MIT" + }, + "node_modules/fs-extra": { + "version": "11.2.0", + "resolved": "https://registry.npmjs.org/fs-extra/-/fs-extra-11.2.0.tgz", + "integrity": "sha512-PmDi3uwK5nFuXh7XDTlVnS17xJS7vW36is2+w3xcv8SVxiB4NyATf4ctkVY5bkSjX0Y4nbvZCq1/EjtEyr9ktw==", + "license": "MIT", + "dependencies": { + "graceful-fs": "^4.2.0", + "jsonfile": "^6.0.1", + "universalify": "^2.0.0" + }, + "engines": { + "node": ">=14.14" + } + }, + "node_modules/fs-minipass": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fs-minipass/-/fs-minipass-2.1.0.tgz", + "integrity": "sha512-V/JgOLFCS+R6Vcq0slCuaeWEdNC3ouDlJMNIsacH2VtALiu9mV4LPrHc5cDl8k5aw6J8jwgWWpiTo5RYhmIzvg==", + "license": "ISC", + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==", + "license": "ISC", + "optional": true + }, + "node_modules/function-bind": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", + "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/gauge": { + "version": "4.0.4", + "resolved": "https://registry.npmjs.org/gauge/-/gauge-4.0.4.tgz", + "integrity": "sha512-f9m+BEN5jkg6a0fZjleidjN51VE1X+mPFQ2DJ0uv1V39oCLCbsGe6yjbBnp7eK7z/+GAon99a3nHuqbuuthyPg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "aproba": "^1.0.3 || ^2.0.0", + "color-support": "^1.1.3", + "console-control-strings": "^1.1.0", + "has-unicode": "^2.0.1", + "signal-exit": "^3.0.7", + "string-width": "^4.2.3", + "strip-ansi": "^6.0.1", + "wide-align": "^1.1.5" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/gcp-metadata": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-5.3.0.tgz", + "integrity": "sha512-FNTkdNEnBdlqF2oatizolQqNANMrcqJt6AAYt99B3y1aLLC8Hc5IOBb+ZnnzllodEEf6xMBp6wRcBbc16fa65w==", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "gaxios": "^5.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/gcp-metadata/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/gcp-metadata/node_modules/gaxios": { + "version": "5.1.3", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-5.1.3.tgz", + "integrity": "sha512-95hVgBRgEIRQQQHIbnxBXeHbW4TqFk4ZDJW7wmVtvYar72FdhRIo1UGOLS2eRAKCPEdPBWu+M7+A33D9CdX9rA==", + "license": "Apache-2.0", + "optional": true, + "peer": true, + "dependencies": { + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.6.9" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/gcp-metadata/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/gcp-metadata/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/get-caller-file": { + "version": "2.0.5", + "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", + "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", + "license": "ISC", + "engines": { + "node": "6.* || 8.* || >= 10.*" + } + }, + "node_modules/get-intrinsic": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", + "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", + "license": "MIT", + "dependencies": { + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "has-proto": "^1.0.1", + "has-symbols": "^1.0.3", + "hasown": "^2.0.0" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/get-stream": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.2.0.tgz", + "integrity": "sha512-nBF+F1rAZVCu/p7rjzgA+Yb4lfYXrpl7a6VmJrU8wF9I1CKvP/QwPNZHnOlwbTkY6dvtFIzFMSyQXbLoTQPRpA==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/get-uri": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/get-uri/-/get-uri-6.0.3.tgz", + "integrity": "sha512-BzUrJBS9EcUb4cFol8r4W3v1cPsSyajLSthNkz5BxbpDcHN5tIrM10E2eNvfnvBn3DaT3DUgx0OpsBKkaOpanw==", + "license": "MIT", + "dependencies": { + "basic-ftp": "^5.0.2", + "data-uri-to-buffer": "^6.0.2", + "debug": "^4.3.4", + "fs-extra": "^11.2.0" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/get-uri/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/get-uri/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/getpass": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/getpass/-/getpass-0.1.7.tgz", + "integrity": "sha512-0fzj9JxOLfJ+XGLhR8ze3unN0KZCgZwiSSDz168VERjK8Wl8kVSdcu2kspd4s4wtAa1y/qrVRiAA0WclVsu0ng==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0" + } + }, + "node_modules/github-from-package": { + "version": "0.0.0", + "resolved": "https://registry.npmjs.org/github-from-package/-/github-from-package-0.0.0.tgz", + "integrity": "sha512-SyHy3T1v2NUXn29OsWdxmK6RwHD+vkj3v8en8AOBZ1wBQ/hCAQ5bAQTD02kW4W9tUp/3Qh6J8r9EvntiyCmOOw==", + "license": "MIT" + }, + "node_modules/glob": { + "version": "7.2.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.2.3.tgz", + "integrity": "sha512-nFR0zLpU2YCaRxwoCJvL6UvCH2JFyFVIvwTLsIf21AuHlMskA1hhTdk+LlYJtOlYt9v6dvszD2BGRqBL+iQK9Q==", + "deprecated": "Glob versions prior to v9 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.1.1", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + }, + "engines": { + "node": "*" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/gopd": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", + "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", + "license": "MIT", + "dependencies": { + "get-intrinsic": "^1.1.3" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.11", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.11.tgz", + "integrity": "sha512-RbJ5/jmFcNNCcDV5o9eTnBLJ/HszWV0P73bc+Ff4nS/rJj+YaS6IGyiOL0VoBYX+l1Wrl3k63h/KrH+nhJ0XvQ==", + "license": "ISC" + }, + "node_modules/har-schema": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/har-schema/-/har-schema-2.0.0.tgz", + "integrity": "sha512-Oqluz6zhGX8cyRaTQlFMPw80bSJVG2x/cFb8ZPhUILGgHka9SsokCCOQgpveePerqidZOrT14ipqfJb7ILcW5Q==", + "license": "ISC", + "engines": { + "node": ">=4" + } + }, + "node_modules/har-validator": { + "version": "5.1.5", + "resolved": "https://registry.npmjs.org/har-validator/-/har-validator-5.1.5.tgz", + "integrity": "sha512-nmT2T0lljbxdQZfspsno9hgrG3Uir6Ks5afism62poxqBM6sDnMEuPmzTq8XN0OEwqKLLdh1jQI3qyE66Nzb3w==", + "deprecated": "this library is no longer supported", + "license": "MIT", + "dependencies": { + "ajv": "^6.12.3", + "har-schema": "^2.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/has-property-descriptors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", + "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", + "license": "MIT", + "dependencies": { + "es-define-property": "^1.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-proto": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", + "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-symbols": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", + "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/has-unicode": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/has-unicode/-/has-unicode-2.0.1.tgz", + "integrity": "sha512-8Rf9Y83NBReMnx0gFzA8JImQACstCYWUplepDa9xprwwtmgEZUF0h/i5xSA625zB/I37EtrswSST6OXxwaaIJQ==", + "license": "ISC", + "optional": true + }, + "node_modules/hasown": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", + "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", + "license": "MIT", + "dependencies": { + "function-bind": "^1.1.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/help-me": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/help-me/-/help-me-5.0.0.tgz", + "integrity": "sha512-7xgomUX6ADmcYzFik0HzAxh/73YlKR9bmFzf51CZwR+b6YtzU2m0u49hQCqV6SvlqIqsaxovfwdvbnsw3b/zpg==", + "license": "MIT" + }, + "node_modules/htmlparser2": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/htmlparser2/-/htmlparser2-9.1.0.tgz", + "integrity": "sha512-5zfg6mHUoaer/97TxnGpxmbR7zJtPwIYFMZ/H5ucTlPZhKvtum05yiPK3Mgai3a0DyVxv7qYqoweaEd2nrYQzQ==", + "funding": [ + "https://github.com/fb55/htmlparser2?sponsor=1", + { + "type": "github", + "url": "https://github.com/sponsors/fb55" + } + ], + "license": "MIT", + "dependencies": { + "domelementtype": "^2.3.0", + "domhandler": "^5.0.3", + "domutils": "^3.1.0", + "entities": "^4.5.0" + } + }, + "node_modules/http-cache-semantics": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.1.1.tgz", + "integrity": "sha512-er295DKPVsV82j5kw1Gjt+ADA/XYHsajl82cGNQG2eyoPkvgUhX+nDIyelzhIWbbsXP39EHcI6l5tYs2FYqYXQ==", + "license": "BSD-2-Clause", + "optional": true + }, + "node_modules/http-errors": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/http-errors/-/http-errors-2.0.0.tgz", + "integrity": "sha512-FtwrG/euBzaEjYeRqOgly7G0qviiXoJWnvEH2Z1plBdXgbyjv34pHTSb9zoeHMyDy33+DWy5Wt9Wo+TURtOYSQ==", + "license": "MIT", + "dependencies": { + "depd": "2.0.0", + "inherits": "2.0.4", + "setprototypeof": "1.2.0", + "statuses": "2.0.1", + "toidentifier": "1.0.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/http-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-7.0.2.tgz", + "integrity": "sha512-T1gkAiYYDWYx3V5Bmyu7HcfcvL7mUrTWiM6yOfa3PIphViJ/gFPbvidQ+veqSOHci/PxBcDabeUNCzpOODJZig==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.0", + "debug": "^4.3.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/http-proxy-agent/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/http-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/http-signature": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/http-signature/-/http-signature-1.2.0.tgz", + "integrity": "sha512-CAbnr6Rz4CYQkLYUtSNXxQPUH2gK8f3iWexVlsnMeD+GjlsQ0Xsy1cOX+mN3dtxYomRy21CiOzU8Uhw6OwncEQ==", + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "jsprim": "^1.2.2", + "sshpk": "^1.7.0" + }, + "engines": { + "node": ">=0.8", + "npm": ">=1.3.7" + } + }, + "node_modules/https-proxy-agent": { + "version": "7.0.5", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-7.0.5.tgz", + "integrity": "sha512-1e4Wqeblerz+tMKPIq2EMGiiWW1dIjZOksyHWSUm1rmuvw/how9hBHZ38lAGj5ID4Ik6EdkOw7NmWPy6LAwalw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/https-proxy-agent/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/https-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/humanize-ms": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/humanize-ms/-/humanize-ms-1.2.1.tgz", + "integrity": "sha512-Fl70vYtsAFb/C06PTS9dZBo7ihau+Tu/DNCk/OyHhea07S+aeMWpFFkUaXRa8fI+ScZbEI8dfSxwY7gxZ9SAVQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "^2.0.0" + } + }, + "node_modules/iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "BSD-3-Clause" + }, + "node_modules/import-fresh": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.3.0.tgz", + "integrity": "sha512-veYYhQa+D1QBKznvhUHxb8faxlrwUnxseDAbAp457E0wLNio2bOSKnjYDhMj+YiAq61xrMGhQk9iXVk5FzgQMw==", + "license": "MIT", + "dependencies": { + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha512-JmXMZ6wuvDmLiHEml9ykzqO6lwFbof0GG4IkcGaENdCRDDmMVnny7s5HsIgHCbaq0w2MyPhDqkhTUgS2LU2PHA==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=8" + } + }, + "node_modules/infer-owner": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/infer-owner/-/infer-owner-1.0.4.tgz", + "integrity": "sha512-IClj+Xz94+d7irH5qRyfJonOdfTzuDaifE6ZPWfx0N0+/ATZCbuTPq2prFl526urkQd90WyUKIh1DfBQ2hMz9A==", + "license": "ISC", + "optional": true + }, + "node_modules/inflection": { + "version": "1.13.4", + "resolved": "https://registry.npmjs.org/inflection/-/inflection-1.13.4.tgz", + "integrity": "sha512-6I/HUDeYFfuNCVS3td055BaXBwKYuzw7K3ExVMStBowKo9oOAMJIXIHvdyR3iboTCp1b+1i5DSkIZTcwIktuDw==", + "engines": [ + "node >= 0.4.0" + ], + "license": "MIT" + }, + "node_modules/inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", + "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", + "license": "ISC", + "optional": true, + "dependencies": { + "once": "^1.3.0", + "wrappy": "1" + } + }, + "node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==", + "license": "ISC" + }, + "node_modules/ini": { + "version": "1.3.8", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", + "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", + "license": "ISC" + }, + "node_modules/ip-address": { + "version": "9.0.5", + "resolved": "https://registry.npmjs.org/ip-address/-/ip-address-9.0.5.tgz", + "integrity": "sha512-zHtQzGojZXTwZTHQqra+ETKd4Sn3vgi7uBmlPoXVWZqYvuKmtI0l/VZTjqGmJY9x88GGOaZ9+G9ES8hC4T4X8g==", + "license": "MIT", + "dependencies": { + "jsbn": "1.1.0", + "sprintf-js": "^1.1.3" + }, + "engines": { + "node": ">= 12" + } + }, + "node_modules/ipaddr.js": { + "version": "1.9.1", + "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", + "integrity": "sha512-0KI/607xoxSToH7GjN1FfSbLoU0+btTicjsQSWQlh/hZykN8KpmMf7uYwPW3R+akZ6R/w18ZlXSHBYXiYUPO3g==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha512-zz06S8t0ozoDXMG+ube26zeCTNXcKIPJZJi8hBrF4idCLms4CG9QtK7qBl1boi5ODzFpjswb5JPmHCbMpjaYzg==", + "license": "MIT" + }, + "node_modules/is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "license": "MIT", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-lambda": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-lambda/-/is-lambda-1.0.1.tgz", + "integrity": "sha512-z7CMFGNrENq5iFB9Bqo64Xk6Y9sg+epq1myIcdHaGnbMTYOxvzsEtdYqQUylB7LxfkvgrrjP32T6Ywciio9UIQ==", + "license": "MIT", + "optional": true + }, + "node_modules/is-stream": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.1.tgz", + "integrity": "sha512-hFoiJiTl63nn+kstHGBtewWSKnQLpyb155KHheA1l39uvtO9nWIop1p3udqPcUd/xbF1VLMO4n7OI6p7RbngDg==", + "license": "MIT", + "optional": true, + "peer": true, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha512-cyA56iCMHAh5CdzjJIa4aohJyeO1YbwLi3Jc35MmRU6poroFjIGZzUzupGiRPOjgHg9TLu43xbpwXk523fMxKA==", + "license": "MIT" + }, + "node_modules/isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha512-VLghIWNM6ELQzo7zwmcg0NmTVyWKYjvIeM83yjp0wRDTmUnrM678fQbcKBo6n2CJEF0szoG//ytg+TKla89ALQ==", + "license": "MIT" + }, + "node_modules/isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==", + "license": "ISC", + "optional": true + }, + "node_modules/isstream": { + "version": "0.1.2", + "resolved": "https://registry.npmjs.org/isstream/-/isstream-0.1.2.tgz", + "integrity": "sha512-Yljz7ffyPbrLpLngrMtZ7NduUgVvi6wG9RJ9IUcyCd59YQ911PBJphODUcbOVbqYfxe1wuYf/LJ8PauMRwsM/g==", + "license": "MIT" + }, + "node_modules/jake": { + "version": "10.9.2", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", + "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", + "license": "Apache-2.0", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/js-sdsl": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/js-sdsl/-/js-sdsl-4.3.0.tgz", + "integrity": "sha512-mifzlm2+5nZ+lEcLJMoBK0/IH/bDg8XnJfd/Wq6IP+xoCjLZsTOnV2QpxlVbX9bMnkl5PdEjNtBJ9Cj1NjifhQ==", + "license": "MIT", + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/js-sdsl" + } + }, + "node_modules/js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "license": "MIT" + }, + "node_modules/js-yaml": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", + "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", + "license": "MIT", + "dependencies": { + "argparse": "^2.0.1" + }, + "bin": { + "js-yaml": "bin/js-yaml.js" + } + }, + "node_modules/jsbn": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-1.1.0.tgz", + "integrity": "sha512-4bYVV3aAMtDTTu4+xsDYa6sy9GyJ69/amsu9sYF2zqjiEoZA5xJi3BrfX3uY+/IekIu7MwdObdbDWpoZdBv3/A==", + "license": "MIT" + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/json-parse-even-better-errors": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/json-parse-even-better-errors/-/json-parse-even-better-errors-2.3.1.tgz", + "integrity": "sha512-xyFwyhro/JEof6Ghe2iz2NcXoj2sloNsWr/XsERDK/oiPCfaNhl5ONfp+jQdAZRQQ0IJWNzH9zIZF7li91kh2w==", + "license": "MIT" + }, + "node_modules/json-schema": { + "version": "0.4.0", + "resolved": "https://registry.npmjs.org/json-schema/-/json-schema-0.4.0.tgz", + "integrity": "sha512-es94M3nTIfsEPisRafak+HDLfHXnKBhV3vU5eqPcS3flIWqcxJWgXHXiey3YrpaNsanY5ei1VoYEbOzijuq9BA==", + "license": "(AFL-2.1 OR BSD-3-Clause)" + }, + "node_modules/json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "license": "MIT" + }, + "node_modules/json-stringify-safe": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/json-stringify-safe/-/json-stringify-safe-5.0.1.tgz", + "integrity": "sha512-ZClg6AaYvamvYEE82d3Iyd3vSSIjQ+odgjaTzRuO3s7toCdFKczob2i0zCh7JE8kWn17yvAWhUVxvqGwUalsRA==", + "license": "ISC" + }, + "node_modules/jsonfile": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/jsonfile/-/jsonfile-6.1.0.tgz", + "integrity": "sha512-5dgndWOriYSm5cnYaJNhalLNDKOqFwyDB/rr1E9ZsGciGvKPs8R2xYGCacuf3z6K1YKDz182fd+fY3cn3pMqXQ==", + "license": "MIT", + "dependencies": { + "universalify": "^2.0.0" + }, + "optionalDependencies": { + "graceful-fs": "^4.1.6" + } + }, + "node_modules/jsprim": { + "version": "1.4.2", + "resolved": "https://registry.npmjs.org/jsprim/-/jsprim-1.4.2.tgz", + "integrity": "sha512-P2bSOMAc/ciLz6DzgjVlGJP9+BrJWu5UDGK70C2iweC5QBIeFf0ZXRvGjEj2uYgrY2MkAAhsSWHDWlFtEroZWw==", + "license": "MIT", + "dependencies": { + "assert-plus": "1.0.0", + "extsprintf": "1.3.0", + "json-schema": "0.4.0", + "verror": "1.10.0" + }, + "engines": { + "node": ">=0.6.0" + } + }, + "node_modules/kareem": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/kareem/-/kareem-2.6.3.tgz", + "integrity": "sha512-C3iHfuGUXK2u8/ipq9LfjFfXFxAZMQJJq7vLS45r3D9Y2xQ/m4S8zaR4zMLFWh9AsNPXmcFfUDhTEO8UIC/V6Q==", + "license": "Apache-2.0", + "engines": { + "node": ">=12.0.0" + } + }, + "node_modules/lines-and-columns": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/lines-and-columns/-/lines-and-columns-1.2.4.tgz", + "integrity": "sha512-7ylylesZQ/PV29jhEDl3Ufjo6ZX7gCqJr5F7PKrqc93v7fzSymt1BpwEU8nAUXs8qzzvqhbjhK5QZg6Mt/HkBg==", + "license": "MIT" + }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==", + "license": "MIT" + }, + "node_modules/lru-cache": { + "version": "10.4.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", + "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==", + "license": "ISC" + }, + "node_modules/make-fetch-happen": { + "version": "9.1.0", + "resolved": "https://registry.npmjs.org/make-fetch-happen/-/make-fetch-happen-9.1.0.tgz", + "integrity": "sha512-+zopwDy7DNknmwPQplem5lAZX/eCOzSvSNNcSKm5eVwTkOBzoktEfXsa9L23J/GIRhxRsaxzkPEhrJEpE2F4Gg==", + "license": "ISC", + "optional": true, + "dependencies": { + "agentkeepalive": "^4.1.3", + "cacache": "^15.2.0", + "http-cache-semantics": "^4.1.0", + "http-proxy-agent": "^4.0.1", + "https-proxy-agent": "^5.0.0", + "is-lambda": "^1.0.1", + "lru-cache": "^6.0.0", + "minipass": "^3.1.3", + "minipass-collect": "^1.0.2", + "minipass-fetch": "^1.3.2", + "minipass-flush": "^1.0.5", + "minipass-pipeline": "^1.2.4", + "negotiator": "^0.6.2", + "promise-retry": "^2.0.1", + "socks-proxy-agent": "^6.0.0", + "ssri": "^8.0.0" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/make-fetch-happen/node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/make-fetch-happen/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "optional": true, + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/make-fetch-happen/node_modules/http-proxy-agent": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/http-proxy-agent/-/http-proxy-agent-4.0.1.tgz", + "integrity": "sha512-k0zdNgqWTGA6aeIRVpvfVob4fL52dTfaehylg0Y4UvSySvOq/Y+BOyPrgpUrA7HylqvU8vIZGsRuXmspskV0Tg==", + "license": "MIT", + "optional": true, + "dependencies": { + "@tootallnate/once": "1", + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-fetch-happen/node_modules/https-proxy-agent": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.1.tgz", + "integrity": "sha512-dFcAjpTQFgoLMzC2VwU+C/CbS7uRL0lWmxDITmqm7C+7F0Odmj6s9l6alZc6AELXhrnggM2CeWSXHGOdX2YtwA==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/make-fetch-happen/node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "license": "ISC", + "optional": true, + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/make-fetch-happen/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT", + "optional": true + }, + "node_modules/make-fetch-happen/node_modules/socks-proxy-agent": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-6.2.1.tgz", + "integrity": "sha512-a6KW9G+6B3nWZ1yB8G7pJwL3ggLy1uTzKAgCb7ttblwqdz9fMGJUuTy3uFzEP48FAs9FLILlmzDlE2JJhVQaXQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "agent-base": "^6.0.2", + "debug": "^4.3.3", + "socks": "^2.6.2" + }, + "engines": { + "node": ">= 10" + } + }, + "node_modules/media-typer": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/media-typer/-/media-typer-0.3.0.tgz", + "integrity": "sha512-dq+qelQ9akHpcOl/gUVRTxVIOkAJ1wR3QAvb4RsVjS8oVoFjDGTc679wJYmUmknUF5HwMLOgb5O+a3KxfWapPQ==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/memory-pager": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/memory-pager/-/memory-pager-1.5.0.tgz", + "integrity": "sha512-ZS4Bp4r/Zoeq6+NLJpP+0Zzm0pR8whtGPf1XExKLJBAczGMnSi3It14OiNCStjQjM6NU1okjQGSxgEZN8eBYKg==", + "license": "MIT" + }, + "node_modules/merge-descriptors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/merge-descriptors/-/merge-descriptors-1.0.1.tgz", + "integrity": "sha512-cCi6g3/Zr1iqQi6ySbseM1Xvooa98N0w31jzUYrXPX2xqObmFGHJ0tQ5u74H3mVh7wLouTseZyYIq39g8cNp1w==", + "license": "MIT" + }, + "node_modules/methods": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/methods/-/methods-1.1.2.tgz", + "integrity": "sha512-iclAHeNqNm68zFtnZ0e+1L2yUIdvzNoauKU4WBA3VvH/vPFieF7qfRlwUZU+DA9P9bPXIS90ulxoUoCH23sV2w==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/mime/-/mime-1.6.0.tgz", + "integrity": "sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg==", + "license": "MIT", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4" + } + }, + "node_modules/mime-db": { + "version": "1.52.0", + "resolved": "https://registry.npmjs.org/mime-db/-/mime-db-1.52.0.tgz", + "integrity": "sha512-sPU4uV7dYlvtWJxwwxHD0PuihVNiE7TyAbQ5SWxDCB9mUYvOgroQOwYQQOKPJ8CIbE+1ETVlOoK1UC2nU3gYvg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mime-types": { + "version": "2.1.35", + "resolved": "https://registry.npmjs.org/mime-types/-/mime-types-2.1.35.tgz", + "integrity": "sha512-ZDY+bPm5zTTF+YpCrAU9nK0UgICYPT0QtT1NZWFv4s++TNkcgVaT0g6+4R2uI4MjQjzysHB1zxuWL50hzaeXiw==", + "license": "MIT", + "dependencies": { + "mime-db": "1.52.0" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/mimic-response": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-3.1.0.tgz", + "integrity": "sha512-z0yWI+4FDrrweS8Zmt4Ej5HdJmky15+L2e6Wgn3+iK5fWzb6T3fhNFq2+MeTRb064c6Wr4N/wv0DzQTjNzHNGQ==", + "license": "MIT", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/minimatch": { + "version": "3.1.2", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", + "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", + "license": "ISC", + "dependencies": { + "brace-expansion": "^1.1.7" + }, + "engines": { + "node": "*" + } + }, + "node_modules/minimist": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.8.tgz", + "integrity": "sha512-2yyAR8qBkN3YuheJanUpWC5U3bb5osDywNB8RzDVlDwDHbocAJveqqj1u8+SVD7jkWT4yvsHCpWqqWqAxb0zCA==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/minipass": { + "version": "3.3.6", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-3.3.6.tgz", + "integrity": "sha512-DxiNidxSEK+tHG6zOIklvNOwm3hvCrbUrdtzY74U6HKTJxvIDfOUL5W5P2Ghd3DTkhhKPYGqeNUIh5qcM4YBfw==", + "license": "ISC", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-collect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/minipass-collect/-/minipass-collect-1.0.2.tgz", + "integrity": "sha512-6T6lH0H8OG9kITm/Jm6tdooIbogG9e0tLgpY6mphXSm/A9u8Nq1ryBG+Qspiub9LjWlBPsPS3tWQ/Botq4FdxA==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-fetch": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/minipass-fetch/-/minipass-fetch-1.4.1.tgz", + "integrity": "sha512-CGH1eblLq26Y15+Azk7ey4xh0J/XfJfrCox5LDJiKqI2Q2iwOLOKrlmIaODiSQS8d18jalF6y2K2ePUm0CmShw==", + "license": "MIT", + "optional": true, + "dependencies": { + "minipass": "^3.1.0", + "minipass-sized": "^1.0.3", + "minizlib": "^2.0.0" + }, + "engines": { + "node": ">=8" + }, + "optionalDependencies": { + "encoding": "^0.1.12" + } + }, + "node_modules/minipass-flush": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/minipass-flush/-/minipass-flush-1.0.5.tgz", + "integrity": "sha512-JmQSYYpPUqX5Jyn1mXaRwOda1uQ8HP5KAT/oDSLCzt1BYRhQU0/hDtsB1ufZfEEzMZ9aAVmsBw8+FWsIXlClWw==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/minipass-pipeline": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/minipass-pipeline/-/minipass-pipeline-1.2.4.tgz", + "integrity": "sha512-xuIq7cIOt09RPRJ19gdi4b+RiNvDFYe5JH+ggNvBqGqpQXcru3PcRmOZuHBKWK1Txf9+cQ+HMVN4d6z46LZP7A==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minipass-sized": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/minipass-sized/-/minipass-sized-1.0.3.tgz", + "integrity": "sha512-MbkQQ2CTiBMlA2Dm/5cY+9SWFEN8pzzOXi6rlM5Xxq0Yqbda5ZQy9sU75a673FE9ZK0Zsbr6Y5iP6u9nktfg2g==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/minizlib": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/minizlib/-/minizlib-2.1.2.tgz", + "integrity": "sha512-bAxsR8BVfj60DWXHE3u30oHzfl4G7khkSuPW+qvpd7jFRHm7dLxOjUk1EHACJ/hxLY8phGJ0YhYHZo7jil7Qdg==", + "license": "MIT", + "dependencies": { + "minipass": "^3.0.0", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/mitt": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mitt/-/mitt-3.0.1.tgz", + "integrity": "sha512-vKivATfr97l2/QBCYAkXYDbrIWPM2IIKEl7YPhjCvKlG3kE2gm+uBo6nEXK3M5/Ffh/FLpKExzOQ3JJoJGFKBw==", + "license": "MIT" + }, + "node_modules/mkdirp": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-1.0.4.tgz", + "integrity": "sha512-vVqVZQyf3WLx2Shd0qJ9xuvqgAyKPLAiqITEtqW0oIUjzo3PePDd6fW9iFz30ef7Ysp/oiWqbhszeGWW2T6Gzw==", + "license": "MIT", + "bin": { + "mkdirp": "bin/cmd.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mkdirp-classic": { + "version": "0.5.3", + "resolved": "https://registry.npmjs.org/mkdirp-classic/-/mkdirp-classic-0.5.3.tgz", + "integrity": "sha512-gKLcREMhtuZRwRAfqP3RFW+TK4JqApVBtOIftVgjuABpAtpxhPGaDcfvbhNvD0B8iD1oUr/txX35NjcaY6Ns/A==", + "license": "MIT" + }, + "node_modules/moment": { + "version": "2.30.1", + "resolved": "https://registry.npmjs.org/moment/-/moment-2.30.1.tgz", + "integrity": "sha512-uEmtNhbDOrWPFS+hdjFCBfy9f2YoyzRpwcl+DqpC6taX21FzsTLQVbMV/W7PzNSX6x/bhC1zA3c2UQ5NzH6how==", + "license": "MIT", + "engines": { + "node": "*" + } + }, + "node_modules/moment-timezone": { + "version": "0.5.45", + "resolved": "https://registry.npmjs.org/moment-timezone/-/moment-timezone-0.5.45.tgz", + "integrity": "sha512-HIWmqA86KcmCAhnMAN0wuDOARV/525R2+lOLotuGFzn4HO+FH+/645z2wx0Dt3iDv6/p61SIvKnDstISainhLQ==", + "license": "MIT", + "dependencies": { + "moment": "^2.29.4" + }, + "engines": { + "node": "*" + } + }, + "node_modules/mongodb": { + "version": "6.8.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.8.0.tgz", + "integrity": "sha512-HGQ9NWDle5WvwMnrvUxsFYPd3JEbqD3RgABHBQRuoCEND0qzhsd0iH5ypHsf1eJ+sXmvmyKpP+FLOKY8Il7jMw==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongodb-connection-string-url": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/mongodb-connection-string-url/-/mongodb-connection-string-url-3.0.1.tgz", + "integrity": "sha512-XqMGwRX0Lgn05TDB4PyG2h2kKO/FfWJyCzYQbIhXUxz7ETt0I/FqHjUeqj37irJ+Dl1ZtU82uYyj14u2XsZKfg==", + "license": "Apache-2.0", + "dependencies": { + "@types/whatwg-url": "^11.0.2", + "whatwg-url": "^13.0.0" + } + }, + "node_modules/mongoose": { + "version": "8.5.2", + "resolved": "https://registry.npmjs.org/mongoose/-/mongoose-8.5.2.tgz", + "integrity": "sha512-GZB4rHMdYfGatV+23IpCrqFbyCOjCNOHXgWbirr92KRwTEncBrtW3kgU9vmpKjsGf7nMmnAy06SwWUv1vhDkSg==", + "license": "MIT", + "dependencies": { + "bson": "^6.7.0", + "kareem": "2.6.3", + "mongodb": "6.7.0", + "mpath": "0.9.0", + "mquery": "5.0.0", + "ms": "2.1.3", + "sift": "17.1.3" + }, + "engines": { + "node": ">=16.20.1" + }, + "funding": { + "type": "opencollective", + "url": "https://opencollective.com/mongoose" + } + }, + "node_modules/mongoose/node_modules/mongodb": { + "version": "6.7.0", + "resolved": "https://registry.npmjs.org/mongodb/-/mongodb-6.7.0.tgz", + "integrity": "sha512-TMKyHdtMcO0fYBNORiYdmM25ijsHs+Njs963r4Tro4OQZzqYigAzYQouwWRg4OIaiLRUEGUh/1UAcH5lxdSLIA==", + "license": "Apache-2.0", + "dependencies": { + "@mongodb-js/saslprep": "^1.1.5", + "bson": "^6.7.0", + "mongodb-connection-string-url": "^3.0.0" + }, + "engines": { + "node": ">=16.20.1" + }, + "peerDependencies": { + "@aws-sdk/credential-providers": "^3.188.0", + "@mongodb-js/zstd": "^1.1.0", + "gcp-metadata": "^5.2.0", + "kerberos": "^2.0.1", + "mongodb-client-encryption": ">=6.0.0 <7", + "snappy": "^7.2.2", + "socks": "^2.7.1" + }, + "peerDependenciesMeta": { + "@aws-sdk/credential-providers": { + "optional": true + }, + "@mongodb-js/zstd": { + "optional": true + }, + "gcp-metadata": { + "optional": true + }, + "kerberos": { + "optional": true + }, + "mongodb-client-encryption": { + "optional": true + }, + "snappy": { + "optional": true + }, + "socks": { + "optional": true + } + } + }, + "node_modules/mongoose/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/mpath": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/mpath/-/mpath-0.9.0.tgz", + "integrity": "sha512-ikJRQTk8hw5DEoFVxHG1Gn9T/xcjtdnOKIU1JTmGjZZlg9LST2mBLmcX3/ICIbgJydT2GOc15RnNy5mHmzfSew==", + "license": "MIT", + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/mqtt": { + "version": "5.9.1", + "resolved": "https://registry.npmjs.org/mqtt/-/mqtt-5.9.1.tgz", + "integrity": "sha512-FMENfSUMfCSUCnkuUVAL4U01795SUEfrX0NZ53HNr1r2VNpwKhR5Au9viq9WCFGtgrDAmsll4fkloqFCFgStYA==", + "license": "MIT", + "dependencies": { + "@types/readable-stream": "^4.0.5", + "@types/ws": "^8.5.9", + "commist": "^3.2.0", + "concat-stream": "^2.0.0", + "debug": "^4.3.4", + "help-me": "^5.0.0", + "lru-cache": "^10.0.1", + "minimist": "^1.2.8", + "mqtt": "^5.2.0", + "mqtt-packet": "^9.0.0", + "number-allocator": "^1.0.14", + "readable-stream": "^4.4.2", + "reinterval": "^1.1.0", + "rfdc": "^1.3.0", + "split2": "^4.2.0", + "worker-timers": "^7.1.4", + "ws": "^8.17.1" + }, + "bin": { + "mqtt": "build/bin/mqtt.js", + "mqtt_pub": "build/bin/pub.js", + "mqtt_sub": "build/bin/sub.js" + }, + "engines": { + "node": ">=16.0.0" + } + }, + "node_modules/mqtt-packet": { + "version": "9.0.0", + "resolved": "https://registry.npmjs.org/mqtt-packet/-/mqtt-packet-9.0.0.tgz", + "integrity": "sha512-8v+HkX+fwbodsWAZIZTI074XIoxVBOmPeggQuDFCGg1SqNcC+uoRMWu7J6QlJPqIUIJXmjNYYHxBBLr1Y/Df4w==", + "license": "MIT", + "dependencies": { + "bl": "^6.0.8", + "debug": "^4.3.4", + "process-nextick-args": "^2.0.1" + } + }, + "node_modules/mqtt-packet/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mqtt-packet/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/mqtt/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mqtt/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/mqtt/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/mquery": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/mquery/-/mquery-5.0.0.tgz", + "integrity": "sha512-iQMncpmEK8R8ncT8HJGsGc9Dsp8xcgYMVSbs5jgnm1lFHTZqMJTUWTDx1LBO8+mK3tPNZWFLBghQEIOULSTHZg==", + "license": "MIT", + "dependencies": { + "debug": "4.x" + }, + "engines": { + "node": ">=14.0.0" + } + }, + "node_modules/mquery/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/mquery/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha512-Tpp60P6IUJDTuOq/5Z8cdskzJujfwqfOTkrwIwj7IRISpnkJnT6SyJ4PCPnGMoFjC9ddhal5KVIYtAt97ix05A==", + "license": "MIT" + }, + "node_modules/napi-build-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/napi-build-utils/-/napi-build-utils-1.0.2.tgz", + "integrity": "sha512-ONmRUqK7zj7DWX0D9ADe03wbwOBZxNAfF20PlGfCWQcD3+/MakShIHrMqx9YwPTfxDdF1zLeL+RGZiR9kGMLdg==", + "license": "MIT" + }, + "node_modules/negotiator": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/negotiator/-/negotiator-0.6.3.tgz", + "integrity": "sha512-+EUsqGPLsM+j/zdChZjsnX51g4XrHFOIXwfnCVPGlQk/k5giakcKsuxCObBRu6DSm9opw/O6slWbJdghQM4bBg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/netmask": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/netmask/-/netmask-2.0.2.tgz", + "integrity": "sha512-dBpDMdxv9Irdq66304OLfEmQ9tbNRFnFTuZiLo+bD+r332bBmMJ8GBLXklIXXgxd3+v9+KUnZaUR5PJMa75Gsg==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/node-abi": { + "version": "3.65.0", + "resolved": "https://registry.npmjs.org/node-abi/-/node-abi-3.65.0.tgz", + "integrity": "sha512-ThjYBfoDNr08AWx6hGaRbfPwxKV9kVzAzOzlLKbk2CuqXE2xnCh+cbAGnwM3t8Lq4v9rUB7VfondlkBckcJrVA==", + "license": "MIT", + "dependencies": { + "semver": "^7.3.5" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/node-addon-api": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-7.1.1.tgz", + "integrity": "sha512-5m3bsyrjFWE1xf7nz7YXdN4udnVtXK6/Yfgn5qnahL6bCkf2yKt4k3nuTKAtT4r3IG8JNR2ncsIMdZuAzJjHQQ==", + "license": "MIT" + }, + "node_modules/node-fetch": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.7.0.tgz", + "integrity": "sha512-c4FRfUm/dbcWZ7U+1Wq0AwCyFL+3nt2bEw05wfxSz+DWpWsitgmSgYmy2dQdWyKC1694ELPqMs/YzUSNozLt8A==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "whatwg-url": "^5.0.0" + }, + "engines": { + "node": "4.x || >=6.0.0" + }, + "peerDependencies": { + "encoding": "^0.1.0" + }, + "peerDependenciesMeta": { + "encoding": { + "optional": true + } + } + }, + "node_modules/node-fetch/node_modules/tr46": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-0.0.3.tgz", + "integrity": "sha512-N3WMsuqV66lT30CrXNbEjx4GEwlow3v6rr4mCcv6prnfwhS01rkgyFdjPNBYd9br7LpXV1+Emh01fHnq2Gdgrw==", + "license": "MIT", + "optional": true, + "peer": true + }, + "node_modules/node-fetch/node_modules/webidl-conversions": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", + "integrity": "sha512-2JAn3z8AR6rjK8Sm8orRC0h/bcl/DqL7tRPdGZ4I1CjdF+EaMLmYxBHyXuKL849eucPFhvBoxMsflfOb8kxaeQ==", + "license": "BSD-2-Clause", + "optional": true, + "peer": true + }, + "node_modules/node-fetch/node_modules/whatwg-url": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-5.0.0.tgz", + "integrity": "sha512-saE57nupxk6v3HY35+jzBwYa0rKSy0XR8JSxZPwgLr7ys0IBzhGviA1/TUGJLmSVqs8pb9AnvICXEuOHLprYTw==", + "license": "MIT", + "optional": true, + "peer": true, + "dependencies": { + "tr46": "~0.0.3", + "webidl-conversions": "^3.0.0" + } + }, + "node_modules/node-gyp": { + "version": "8.4.1", + "resolved": "https://registry.npmjs.org/node-gyp/-/node-gyp-8.4.1.tgz", + "integrity": "sha512-olTJRgUtAb/hOXG0E93wZDs5YiJlgbXxTwQAFHyNlRsXQnYzUaF2aGgujZbw+hR8aF4ZG/rST57bWMWD16jr9w==", + "license": "MIT", + "optional": true, + "dependencies": { + "env-paths": "^2.2.0", + "glob": "^7.1.4", + "graceful-fs": "^4.2.6", + "make-fetch-happen": "^9.1.0", + "nopt": "^5.0.0", + "npmlog": "^6.0.0", + "rimraf": "^3.0.2", + "semver": "^7.3.5", + "tar": "^6.1.2", + "which": "^2.0.2" + }, + "bin": { + "node-gyp": "bin/node-gyp.js" + }, + "engines": { + "node": ">= 10.12.0" + } + }, + "node_modules/nopt": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/nopt/-/nopt-5.0.0.tgz", + "integrity": "sha512-Tbj67rffqceeLpcRXrT7vKAN8CwfPeIBgM7E6iBkmKLV7bEMwpGgYLGv0jACUsECaa/vuxP0IjEont6umdMgtQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "abbrev": "1" + }, + "bin": { + "nopt": "bin/nopt.js" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/npmlog": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/npmlog/-/npmlog-6.0.2.tgz", + "integrity": "sha512-/vBvz5Jfr9dT/aFWd0FIRf+T/Q2WBsLENygUaFUqstqsycmZAP/t5BvFJTK0viFmSUxiUKTUplWy5vt+rvKIxg==", + "deprecated": "This package is no longer supported.", + "license": "ISC", + "optional": true, + "dependencies": { + "are-we-there-yet": "^3.0.0", + "console-control-strings": "^1.1.0", + "gauge": "^4.0.3", + "set-blocking": "^2.0.0" + }, + "engines": { + "node": "^12.13.0 || ^14.15.0 || >=16.0.0" + } + }, + "node_modules/nth-check": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/nth-check/-/nth-check-2.1.1.tgz", + "integrity": "sha512-lqjrjmaOoAnWfMmBPL+XNnynZh2+swxiX3WUE0s4yEHI6m+AwrK2UZOimIRl3X/4QctVqS8AiZjFqyOGrMXb/w==", + "license": "BSD-2-Clause", + "dependencies": { + "boolbase": "^1.0.0" + }, + "funding": { + "url": "https://github.com/fb55/nth-check?sponsor=1" + } + }, + "node_modules/number-allocator": { + "version": "1.0.14", + "resolved": "https://registry.npmjs.org/number-allocator/-/number-allocator-1.0.14.tgz", + "integrity": "sha512-OrL44UTVAvkKdOdRQZIJpLkAdjXGTRda052sN4sO77bKEzYYqWKMBjQvrJFzqygI99gL6Z4u2xctPW1tB8ErvA==", + "license": "MIT", + "dependencies": { + "debug": "^4.3.1", + "js-sdsl": "4.3.0" + } + }, + "node_modules/number-allocator/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/number-allocator/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/oauth-sign": { + "version": "0.9.0", + "resolved": "https://registry.npmjs.org/oauth-sign/-/oauth-sign-0.9.0.tgz", + "integrity": "sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ==", + "license": "Apache-2.0", + "engines": { + "node": "*" + } + }, + "node_modules/object-inspect": { + "version": "1.13.2", + "resolved": "https://registry.npmjs.org/object-inspect/-/object-inspect-1.13.2.tgz", + "integrity": "sha512-IRZSRuzJiynemAXPYtPe5BoI/RESNYR7TYm50MC5Mqbd3Jmw5y790sErYw3V6SryFJD64b74qQQs9wn5Bg/k3g==", + "license": "MIT", + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/on-finished": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/on-finished/-/on-finished-2.4.1.tgz", + "integrity": "sha512-oVlzkg3ENAhCk2zdv7IJwd/QUD4z2RxRwpkcGY8psCVcCYZNq4wYnVWALHM+brtuJjePWiYF/ClmuDr8Ch5+kg==", + "license": "MIT", + "dependencies": { + "ee-first": "1.1.1" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/on-headers": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/on-headers/-/on-headers-1.0.2.tgz", + "integrity": "sha512-pZAE+FJLoyITytdqK0U5s+FIpjN0JP3OzFi/u8Rx+EV5/W+JTWGXG8xFzevE7AjBfDqHv/8vL8qQsIhHnqRkrA==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", + "license": "ISC", + "dependencies": { + "wrappy": "1" + } + }, + "node_modules/p-map": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-4.0.0.tgz", + "integrity": "sha512-/bjOqmgETBYB5BoEeGVea8dmvHb2m9GLy1E9W43yeyfP6QQCZGFNa+XRceJEuDB6zqr+gKpIAmlLebMpykw/MQ==", + "license": "MIT", + "optional": true, + "dependencies": { + "aggregate-error": "^3.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/pac-proxy-agent": { + "version": "7.0.2", + "resolved": "https://registry.npmjs.org/pac-proxy-agent/-/pac-proxy-agent-7.0.2.tgz", + "integrity": "sha512-BFi3vZnO9X5Qt6NRz7ZOaPja3ic0PhlsmCRYLOpN11+mWBCR6XJDqW5RF3j8jm4WGGQZtBA+bTfxYzeKW73eHg==", + "license": "MIT", + "dependencies": { + "@tootallnate/quickjs-emscripten": "^0.23.0", + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "get-uri": "^6.0.1", + "http-proxy-agent": "^7.0.0", + "https-proxy-agent": "^7.0.5", + "pac-resolver": "^7.0.1", + "socks-proxy-agent": "^8.0.4" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/pac-proxy-agent/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/pac-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/pac-resolver": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/pac-resolver/-/pac-resolver-7.0.1.tgz", + "integrity": "sha512-5NPgf87AT2STgwa2ntRMr45jTKrYBGkVU36yT0ig/n/GMAa3oPqhZfIQ2kMEimReg0+t9kZViDVZ83qfVUlckg==", + "license": "MIT", + "dependencies": { + "degenerator": "^5.0.0", + "netmask": "^2.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/parent-module": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.1.tgz", + "integrity": "sha512-GQ2EWRpQV8/o+Aw8YqtfZZPfNRWZYkbidE9k5rpl/hC3vtHHBfGm2Ifi6qWV+coDGkrUKZAxE3Lot5kcsRlh+g==", + "license": "MIT", + "dependencies": { + "callsites": "^3.0.0" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/parse-json": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-5.2.0.tgz", + "integrity": "sha512-ayCKvm/phCGxOkYRSCM82iDwct8/EonSEgCSxWxD7ve6jHggsFl4fZVQBPRNgQoKiuV/odhFrGzQXZwbifC8Rg==", + "license": "MIT", + "dependencies": { + "@babel/code-frame": "^7.0.0", + "error-ex": "^1.3.1", + "json-parse-even-better-errors": "^2.3.0", + "lines-and-columns": "^1.1.6" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/parse5": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5/-/parse5-7.1.2.tgz", + "integrity": "sha512-Czj1WaSVpaoj0wbhMzLmWD69anp2WH7FXMB9n1Sy8/ZFF9jolSQVMu1Ij5WIyGmcBmhk7EOndpO4mIpihVqAXw==", + "license": "MIT", + "dependencies": { + "entities": "^4.4.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-htmlparser2-tree-adapter": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/parse5-htmlparser2-tree-adapter/-/parse5-htmlparser2-tree-adapter-7.0.0.tgz", + "integrity": "sha512-B77tOZrqqfUfnVcOrUvfdLbz4pu4RopLD/4vmu3HUPswwTA8OH0EMW9BlWR2B0RCoiZRAHEUu7IxeP1Pd1UU+g==", + "license": "MIT", + "dependencies": { + "domhandler": "^5.0.2", + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parse5-parser-stream": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/parse5-parser-stream/-/parse5-parser-stream-7.1.2.tgz", + "integrity": "sha512-JyeQc9iwFLn5TbvvqACIF/VXG6abODeB3Fwmv/TGdLk2LfbWkaySGY72at4+Ty7EkPZj854u4CrICqNk2qIbow==", + "license": "MIT", + "dependencies": { + "parse5": "^7.0.0" + }, + "funding": { + "url": "https://github.com/inikulin/parse5?sponsor=1" + } + }, + "node_modules/parseurl": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/parseurl/-/parseurl-1.3.3.tgz", + "integrity": "sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha512-AVbw3UJ2e9bq64vSaS9Am0fje1Pa8pbGqTTsmXfaIiMpnr5DlDhfJOuLj9Sf95ZPVDAUerDfEk88MPmPe7UCQg==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/path-to-regexp": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/path-to-regexp/-/path-to-regexp-0.1.7.tgz", + "integrity": "sha512-5DFkuoqlv1uYQKxy8omFBeJPQcdoE07Kv2sferDCrAq1ohOU+MSDswDIbnx3YAM60qIOnYa53wBhXW0EbMonrQ==", + "license": "MIT" + }, + "node_modules/pend": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/pend/-/pend-1.2.0.tgz", + "integrity": "sha512-F3asv42UuXchdzt+xXqfW1OGlVBe+mxa2mqI0pg5yAHZPvFmY3Y6drSf/GQ1A86WgWEN9Kzh/WrgKa6iGcHXLg==", + "license": "MIT" + }, + "node_modules/performance-now": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/performance-now/-/performance-now-2.1.0.tgz", + "integrity": "sha512-7EAHlyLHI56VEIdK57uwHdHKIaAGbnXPiw0yWbarQZOKaKpvUIgW0jWRVLiatnM+XXlSwsanIBH/hzGMJulMow==", + "license": "MIT" + }, + "node_modules/pg-connection-string": { + "version": "2.6.4", + "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.6.4.tgz", + "integrity": "sha512-v+Z7W/0EO707aNMaAEfiGnGL9sxxumwLl2fJvCQtMn9Fxsg+lPpPkdcyBSv/KFgpGdYkMfn+EI1Or2EHjpgLCA==", + "license": "MIT" + }, + "node_modules/picocolors": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/picocolors/-/picocolors-1.0.1.tgz", + "integrity": "sha512-anP1Z8qwhkbmu7MFP5iTt+wQKXgwzf7zTyGlcdzabySa9vd0Xt392U0rVmz9poOaBj0uHJKyyo9/upk0HrEQew==", + "license": "ISC" + }, + "node_modules/prebuild-install": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/prebuild-install/-/prebuild-install-7.1.2.tgz", + "integrity": "sha512-UnNke3IQb6sgarcZIDU3gbMeTp/9SSU1DAIkil7PrqG1vZlBtY5msYccSKSHDqa3hNg436IXK+SNImReuA1wEQ==", + "license": "MIT", + "dependencies": { + "detect-libc": "^2.0.0", + "expand-template": "^2.0.3", + "github-from-package": "0.0.0", + "minimist": "^1.2.3", + "mkdirp-classic": "^0.5.3", + "napi-build-utils": "^1.0.1", + "node-abi": "^3.3.0", + "pump": "^3.0.0", + "rc": "^1.2.7", + "simple-get": "^4.0.0", + "tar-fs": "^2.0.0", + "tunnel-agent": "^0.6.0" + }, + "bin": { + "prebuild-install": "bin.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/prebuild-install/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "license": "MIT", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/prebuild-install/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/prebuild-install/node_modules/chownr": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/chownr/-/chownr-1.1.4.tgz", + "integrity": "sha512-jJ0bqzaylmJtVnNgzTeSOs8DPavpbYgEr/b0YL8/2GO3xJEhInFmhKMUnEJQjZumK7KXGFhUy89PrsJWlakBVg==", + "license": "ISC" + }, + "node_modules/prebuild-install/node_modules/readable-stream": { + "version": "3.6.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", + "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", + "license": "MIT", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/prebuild-install/node_modules/tar-fs": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-2.1.1.tgz", + "integrity": "sha512-V0r2Y9scmbDRLCNex/+hYzvp/zyYjvFbHPNgVTKfQvVrb6guiE/fxP+XblDNR011utopbkex2nM4dHNV6GDsng==", + "license": "MIT", + "dependencies": { + "chownr": "^1.1.1", + "mkdirp-classic": "^0.5.2", + "pump": "^3.0.0", + "tar-stream": "^2.1.4" + } + }, + "node_modules/prebuild-install/node_modules/tar-stream": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-2.2.0.tgz", + "integrity": "sha512-ujeqbceABgwMZxEJnk2HDY2DlnUZ+9oEcb1KzTVfYHio0UE6dG71n60d8D2I4qNvleWrrXpmjpt7vZeF1LnMZQ==", + "license": "MIT", + "dependencies": { + "bl": "^4.0.3", + "end-of-stream": "^1.4.1", + "fs-constants": "^1.0.0", + "inherits": "^2.0.3", + "readable-stream": "^3.1.1" + }, + "engines": { + "node": ">=6" + } + }, + "node_modules/process": { + "version": "0.11.10", + "resolved": "https://registry.npmjs.org/process/-/process-0.11.10.tgz", + "integrity": "sha512-cdGef/drWFoydD1JsMzuFf8100nZl+GT+yacc2bEced5f9Rjk4z+WtFUTBu9PhOi9j/jfmBPu0mMEY4wIdAF8A==", + "license": "MIT", + "engines": { + "node": ">= 0.6.0" + } + }, + "node_modules/process-nextick-args": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/process-nextick-args/-/process-nextick-args-2.0.1.tgz", + "integrity": "sha512-3ouUOpQhtgrbOa17J7+uxOTpITYWaGP7/AhoR3+A+/1e9skrzelGi/dXzEYyvbxubEF6Wn2ypscTKiKJFFn1ag==", + "license": "MIT" + }, + "node_modules/progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "license": "MIT", + "engines": { + "node": ">=0.4.0" + } + }, + "node_modules/promise-inflight": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/promise-inflight/-/promise-inflight-1.0.1.tgz", + "integrity": "sha512-6zWPyEOFaQBJYcGMHBKTKJ3u6TBsnMFOIZSa6ce1e/ZrrsOlnHRHbabMjLiBYKp+n44X9eUI6VUPaukCXHuG4g==", + "license": "ISC", + "optional": true + }, + "node_modules/promise-retry": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/promise-retry/-/promise-retry-2.0.1.tgz", + "integrity": "sha512-y+WKFlBR8BGXnsNlIHFGPZmyDf3DFMoLhaflAnyZgV6rG6xu+JwesTo2Q9R6XwYmtmwAFCkAk3e35jEdoeh/3g==", + "license": "MIT", + "optional": true, + "dependencies": { + "err-code": "^2.0.2", + "retry": "^0.12.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/proxy-addr": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/proxy-addr/-/proxy-addr-2.0.7.tgz", + "integrity": "sha512-llQsMLSUDUPT44jdrU/O37qlnifitDP+ZwrmmZcoSKyLKvtZxpyV0n2/bD/N4tBAAZ/gJEdZU7KMraoK1+XYAg==", + "license": "MIT", + "dependencies": { + "forwarded": "0.2.0", + "ipaddr.js": "1.9.1" + }, + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/proxy-agent": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/proxy-agent/-/proxy-agent-6.4.0.tgz", + "integrity": "sha512-u0piLU+nCOHMgGjRbimiXmA9kM/L9EHh3zL81xCdp7m+Y2pHIsnmbdDoEDoAz5geaonNR6q6+yOPQs6n4T6sBQ==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.0.2", + "debug": "^4.3.4", + "http-proxy-agent": "^7.0.1", + "https-proxy-agent": "^7.0.3", + "lru-cache": "^7.14.1", + "pac-proxy-agent": "^7.0.1", + "proxy-from-env": "^1.1.0", + "socks-proxy-agent": "^8.0.2" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/proxy-agent/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/proxy-agent/node_modules/lru-cache": { + "version": "7.18.3", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-7.18.3.tgz", + "integrity": "sha512-jumlc0BIUrS3qJGgIkWZsyfAM7NCWiBcCDhnd+3NNM5KbBmLTgHVfWBcg6W+rLUsIpzpERPsvwUP7CckAQSOoA==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/proxy-from-env": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/proxy-from-env/-/proxy-from-env-1.1.0.tgz", + "integrity": "sha512-D+zkORCbA9f1tdWRK0RaCR3GPv50cMxcrz4X8k5LTSUD1Dkw47mKJEZQNunItRTkWwgtaUSo1RVFRIG9ZXiFYg==", + "license": "MIT" + }, + "node_modules/psl": { + "version": "1.9.0", + "resolved": "https://registry.npmjs.org/psl/-/psl-1.9.0.tgz", + "integrity": "sha512-E/ZsdU4HLs/68gYzgGTkMicWTLPdAftJLfJFlLUAAKZGkStNU72sZjT66SnMDVOfOWY/YAoiD7Jxa9iHvngcag==", + "license": "MIT" + }, + "node_modules/pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "license": "MIT", + "dependencies": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" + } + }, + "node_modules/punycode": { + "version": "2.3.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.3.1.tgz", + "integrity": "sha512-vYt7UD1U9Wg6138shLtLOvdAu+8DsC/ilFtEVHcH+wydcSpNE20AfSOduf6MkRFahL5FY7X1oU7nKVZFtfq8Fg==", + "license": "MIT", + "engines": { + "node": ">=6" + } + }, + "node_modules/puppeteer": { + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/puppeteer/-/puppeteer-22.15.0.tgz", + "integrity": "sha512-XjCY1SiSEi1T7iSYuxS82ft85kwDJUS7wj1Z0eGVXKdtr5g4xnVcbjwxhq5xBnpK/E7x1VZZoJDxpjAOasHT4Q==", + "hasInstallScript": true, + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.3.0", + "cosmiconfig": "^9.0.0", + "devtools-protocol": "0.0.1312386", + "puppeteer-core": "22.15.0" + }, + "bin": { + "puppeteer": "lib/esm/puppeteer/node/cli.js" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core": { + "version": "22.15.0", + "resolved": "https://registry.npmjs.org/puppeteer-core/-/puppeteer-core-22.15.0.tgz", + "integrity": "sha512-cHArnywCiAAVXa3t4GGL2vttNxh7GqXtIYGym99egkNJ3oG//wL9LkvO4WE8W1TJe95t1F1ocu9X4xWaGsOKOA==", + "license": "Apache-2.0", + "dependencies": { + "@puppeteer/browsers": "2.3.0", + "chromium-bidi": "0.6.3", + "debug": "^4.3.6", + "devtools-protocol": "0.0.1312386", + "ws": "^8.18.0" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/puppeteer-core/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/puppeteer-core/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/puppeteer-core/node_modules/ws": { + "version": "8.18.0", + "resolved": "https://registry.npmjs.org/ws/-/ws-8.18.0.tgz", + "integrity": "sha512-8VbfWfHLbbwu3+N6OKsOMpBdT4kXPDDB9cJk2bJ6mh9ucxdlnNvH1e+roYkKmN9Nxw2yjz7VzeO9oOz2zJ04Pw==", + "license": "MIT", + "engines": { + "node": ">=10.0.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": ">=5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/qs": { + "version": "6.11.0", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.11.0.tgz", + "integrity": "sha512-MvjoMCJwEarSbUYk5O+nmoSzSutSsTwF85zcHPQ9OrlFoZOYIjaqBAJIqIXjptyD5vThxGq52Xu/MaJzRkIk4Q==", + "license": "BSD-3-Clause", + "dependencies": { + "side-channel": "^1.0.4" + }, + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/queue-tick": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/queue-tick/-/queue-tick-1.0.1.tgz", + "integrity": "sha512-kJt5qhMxoszgU/62PLP1CJytzd2NKetjSRnyuj31fDd3Rlcz3fzlFdFLD1SItunPwyqEOkca6GbV612BWfaBag==", + "license": "MIT" + }, + "node_modules/random-bytes": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/random-bytes/-/random-bytes-1.0.0.tgz", + "integrity": "sha512-iv7LhNVO047HzYR3InF6pUcUsPQiHTM1Qal51DcGSuZFBil1aBBWG5eHPNek7bvILMaYJ/8RU1e8w1AMdHmLQQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/range-parser": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/range-parser/-/range-parser-1.2.1.tgz", + "integrity": "sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg==", + "license": "MIT", + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/raw-body": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/raw-body/-/raw-body-2.5.2.tgz", + "integrity": "sha512-8zGqypfENjCIqGhgXToC8aB2r7YrBX+AQAfIPs/Mlk+BtPTztOvTS01NRW/3Eh60J+a48lt8qsCzirQ6loCVfA==", + "license": "MIT", + "dependencies": { + "bytes": "3.1.2", + "http-errors": "2.0.0", + "iconv-lite": "0.4.24", + "unpipe": "1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "license": "(BSD-2-Clause OR MIT OR Apache-2.0)", + "dependencies": { + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" + }, + "bin": { + "rc": "cli.js" + } + }, + "node_modules/readable-stream": { + "version": "4.5.2", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-4.5.2.tgz", + "integrity": "sha512-yjavECdqeZ3GLXNgRXgeQEdz9fvDDkNKyHnbHRFtOr7/LcfgBcmct7t/ET+HaCTqfh06OzoAxrkN/IfjJBVe+g==", + "license": "MIT", + "dependencies": { + "abort-controller": "^3.0.0", + "buffer": "^6.0.3", + "events": "^3.3.0", + "process": "^0.11.10", + "string_decoder": "^1.3.0" + }, + "engines": { + "node": "^12.22.0 || ^14.17.0 || >=16.0.0" + } + }, + "node_modules/regenerator-runtime": { + "version": "0.14.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.14.1.tgz", + "integrity": "sha512-dYnhHh0nJoMfnkZs6GmmhFknAGRrLznOu5nc9ML+EJxGvrx6H7teuevqVqCuPcPK//3eDrrjQhehXVx9cnkGdw==", + "license": "MIT" + }, + "node_modules/reinterval": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/reinterval/-/reinterval-1.1.0.tgz", + "integrity": "sha512-QIRet3SYrGp0HUHO88jVskiG6seqUGC5iAG7AwI/BV4ypGcuqk9Du6YQBUOUqm9c8pw1eyLoIaONifRua1lsEQ==", + "license": "MIT" + }, + "node_modules/request": { + "version": "2.88.2", + "resolved": "https://registry.npmjs.org/request/-/request-2.88.2.tgz", + "integrity": "sha512-MsvtOrfG9ZcrOwAW+Qi+F6HbD0CWXEh9ou77uOb7FM2WPhwT7smM833PzanhJLsgXjN89Ir6V2PczXNnMpwKhw==", + "deprecated": "request has been deprecated, see https://github.com/request/request/issues/3142", + "license": "Apache-2.0", + "dependencies": { + "aws-sign2": "~0.7.0", + "aws4": "^1.8.0", + "caseless": "~0.12.0", + "combined-stream": "~1.0.6", + "extend": "~3.0.2", + "forever-agent": "~0.6.1", + "form-data": "~2.3.2", + "har-validator": "~5.1.3", + "http-signature": "~1.2.0", + "is-typedarray": "~1.0.0", + "isstream": "~0.1.2", + "json-stringify-safe": "~5.0.1", + "mime-types": "~2.1.19", + "oauth-sign": "~0.9.0", + "performance-now": "^2.1.0", + "qs": "~6.5.2", + "safe-buffer": "^5.1.2", + "tough-cookie": "~2.5.0", + "tunnel-agent": "^0.6.0", + "uuid": "^3.3.2" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/request/node_modules/form-data": { + "version": "2.3.3", + "resolved": "https://registry.npmjs.org/form-data/-/form-data-2.3.3.tgz", + "integrity": "sha512-1lLKB2Mu3aGP1Q/2eCOx0fNbRMe7XdwktwOruhfqqd0rIJWwN4Dh+E3hrPSlDCXnSR7UtZ1N38rVXm+6+MEhJQ==", + "license": "MIT", + "dependencies": { + "asynckit": "^0.4.0", + "combined-stream": "^1.0.6", + "mime-types": "^2.1.12" + }, + "engines": { + "node": ">= 0.12" + } + }, + "node_modules/request/node_modules/qs": { + "version": "6.5.3", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.5.3.tgz", + "integrity": "sha512-qxXIEh4pCGfHICj1mAJQ2/2XVZkjCDTcEgfoSQxc/fYivUZxTkk7L3bDBJSoNrEzXI17oUO5Dp07ktqE5KzczA==", + "license": "BSD-3-Clause", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/require-directory": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", + "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "license": "MIT", + "engines": { + "node": ">=4" + } + }, + "node_modules/retry": { + "version": "0.12.0", + "resolved": "https://registry.npmjs.org/retry/-/retry-0.12.0.tgz", + "integrity": "sha512-9LkiTwjUh6rT555DtE9rTX+BKByPfrMzEAtnlEtdEwr3Nkffwiihqe2bWADg+OQRjt9gl6ICdmB/ZFDCGAtSow==", + "license": "MIT", + "optional": true, + "engines": { + "node": ">= 4" + } + }, + "node_modules/retry-as-promised": { + "version": "7.0.4", + "resolved": "https://registry.npmjs.org/retry-as-promised/-/retry-as-promised-7.0.4.tgz", + "integrity": "sha512-XgmCoxKWkDofwH8WddD0w85ZfqYz+ZHlr5yo+3YUCfycWawU56T5ckWXsScsj5B8tqUcIG67DxXByo3VUgiAdA==", + "license": "MIT" + }, + "node_modules/rfdc": { + "version": "1.4.1", + "resolved": "https://registry.npmjs.org/rfdc/-/rfdc-1.4.1.tgz", + "integrity": "sha512-q1b3N5QkRUWUl7iyylaaj3kOpIT0N2i9MqIEQXP73GVsN9cw3fdx8X63cEmWhJGi2PPCF23Ijp7ktmd39rawIA==", + "license": "MIT" + }, + "node_modules/rimraf": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", + "integrity": "sha512-JZkJMZkAGFFPP2YqXZXPbMlMBgsxzE8ILs4lMIX/2o0L9UBw9O/Y3o6wFw/i9YLapcUJWwqbi3kdxIPdC62TIA==", + "deprecated": "Rimraf versions prior to v4 are no longer supported", + "license": "ISC", + "optional": true, + "dependencies": { + "glob": "^7.1.3" + }, + "bin": { + "rimraf": "bin.js" + }, + "funding": { + "url": "https://github.com/sponsors/isaacs" + } + }, + "node_modules/safe-buffer": { + "version": "5.2.1", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", + "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", + "license": "MIT" + }, + "node_modules/semver": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", + "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", + "license": "ISC", + "bin": { + "semver": "bin/semver.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/send": { + "version": "0.18.0", + "resolved": "https://registry.npmjs.org/send/-/send-0.18.0.tgz", + "integrity": "sha512-qqWzuOjSFOuqPjFe4NOsMLafToQQwBSOEpS+FwEt3A2V3vKubTquT3vmLTQpFgMXp8AlFWFuP1qKaJZOtPpVXg==", + "license": "MIT", + "dependencies": { + "debug": "2.6.9", + "depd": "2.0.0", + "destroy": "1.2.0", + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "etag": "~1.8.1", + "fresh": "0.5.2", + "http-errors": "2.0.0", + "mime": "1.6.0", + "ms": "2.1.3", + "on-finished": "2.4.1", + "range-parser": "~1.2.1", + "statuses": "2.0.1" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/send/node_modules/ms": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", + "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==", + "license": "MIT" + }, + "node_modules/sequelize": { + "version": "6.37.3", + "resolved": "https://registry.npmjs.org/sequelize/-/sequelize-6.37.3.tgz", + "integrity": "sha512-V2FTqYpdZjPy3VQrZvjTPnOoLm0KudCRXfGWp48QwhyPPp2yW8z0p0sCYZd/em847Tl2dVxJJ1DR+hF+O77T7A==", + "funding": [ + { + "type": "opencollective", + "url": "https://opencollective.com/sequelize" + } + ], + "license": "MIT", + "dependencies": { + "@types/debug": "^4.1.8", + "@types/validator": "^13.7.17", + "debug": "^4.3.4", + "dottie": "^2.0.6", + "inflection": "^1.13.4", + "lodash": "^4.17.21", + "moment": "^2.29.4", + "moment-timezone": "^0.5.43", + "pg-connection-string": "^2.6.1", + "retry-as-promised": "^7.0.4", + "semver": "^7.5.4", + "sequelize-pool": "^7.1.0", + "toposort-class": "^1.0.1", + "uuid": "^8.3.2", + "validator": "^13.9.0", + "wkx": "^0.5.0" + }, + "engines": { + "node": ">=10.0.0" + }, + "peerDependenciesMeta": { + "ibm_db": { + "optional": true + }, + "mariadb": { + "optional": true + }, + "mysql2": { + "optional": true + }, + "oracledb": { + "optional": true + }, + "pg": { + "optional": true + }, + "pg-hstore": { + "optional": true + }, + "snowflake-sdk": { + "optional": true + }, + "sqlite3": { + "optional": true + }, + "tedious": { + "optional": true + } + } + }, + "node_modules/sequelize-pool": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/sequelize-pool/-/sequelize-pool-7.1.0.tgz", + "integrity": "sha512-G9c0qlIWQSK29pR/5U2JF5dDQeqqHRragoyahj/Nx4KOOQ3CPPfzxnfqFPCSB7x5UgjOgnZ61nSxz+fjDpRlJg==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/sequelize/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/sequelize/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/sequelize/node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "license": "MIT", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/serve-static": { + "version": "1.15.0", + "resolved": "https://registry.npmjs.org/serve-static/-/serve-static-1.15.0.tgz", + "integrity": "sha512-XGuRDNjXUijsUL0vl6nSD7cwURuzEgglbOaFuZM9g3kwDXOWVTck0jLzjPzGD+TazWbboZYu52/9/XPdUgne9g==", + "license": "MIT", + "dependencies": { + "encodeurl": "~1.0.2", + "escape-html": "~1.0.3", + "parseurl": "~1.3.3", + "send": "0.18.0" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/set-blocking": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/set-blocking/-/set-blocking-2.0.0.tgz", + "integrity": "sha512-KiKBS8AnWGEyLzofFfmvKwpdPzqiy16LvQfK3yv/fVH7Bj13/wl3JSR1J+rfgRE9q7xUJK4qvgS8raSOeLUehw==", + "license": "ISC", + "optional": true + }, + "node_modules/set-function-length": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", + "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", + "license": "MIT", + "dependencies": { + "define-data-property": "^1.1.4", + "es-errors": "^1.3.0", + "function-bind": "^1.1.2", + "get-intrinsic": "^1.2.4", + "gopd": "^1.0.1", + "has-property-descriptors": "^1.0.2" + }, + "engines": { + "node": ">= 0.4" + } + }, + "node_modules/setprototypeof": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.2.0.tgz", + "integrity": "sha512-E5LDX7Wrp85Kil5bhZv46j8jOeboKq5JMmYM3gVGdGH8xFpPWXUMsNrlODCrkoxMEeNi/XZIwuRvY4XNwYMJpw==", + "license": "ISC" + }, + "node_modules/side-channel": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/side-channel/-/side-channel-1.0.6.tgz", + "integrity": "sha512-fDW/EZ6Q9RiO8eFG8Hj+7u/oW+XrPTIChwCOM2+th2A6OblDtYYIpve9m+KvI9Z4C9qSEXlaGR6bTEYHReuglA==", + "license": "MIT", + "dependencies": { + "call-bind": "^1.0.7", + "es-errors": "^1.3.0", + "get-intrinsic": "^1.2.4", + "object-inspect": "^1.13.1" + }, + "engines": { + "node": ">= 0.4" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "node_modules/sift": { + "version": "17.1.3", + "resolved": "https://registry.npmjs.org/sift/-/sift-17.1.3.tgz", + "integrity": "sha512-Rtlj66/b0ICeFzYTuNvX/EF1igRbbnGSvEyT79McoZa/DeGhMyC5pWKOEsZKnpkqtSeovd5FL/bjHWC3CIIvCQ==", + "license": "MIT" + }, + "node_modules/signal-exit": { + "version": "3.0.7", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.7.tgz", + "integrity": "sha512-wnD2ZE+l+SPC/uoS0vXeE9L1+0wuaMqKlfz9AMUo38JsyLSBWSFcHR1Rri62LZc12vLr1gb3jl7iwQhgwpAbGQ==", + "license": "ISC", + "optional": true + }, + "node_modules/simple-concat": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/simple-concat/-/simple-concat-1.0.1.tgz", + "integrity": "sha512-cSFtAPtRhljv69IK0hTVZQ+OfE9nePi/rtJmw5UjHeVyVroEqJXP1sFztKUy1qU+xvz3u/sfYJLa947b7nAN2Q==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT" + }, + "node_modules/simple-get": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/simple-get/-/simple-get-4.0.1.tgz", + "integrity": "sha512-brv7p5WgH0jmQJr1ZDDfKDOSeWWg+OVypG99A/5vYGPqJ6pxiaHLy8nxtFjBA7oMa01ebA9gfh1uMCFqOuXxvA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "decompress-response": "^6.0.0", + "once": "^1.3.1", + "simple-concat": "^1.0.0" + } + }, + "node_modules/smart-buffer": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/smart-buffer/-/smart-buffer-4.2.0.tgz", + "integrity": "sha512-94hK0Hh8rPqQl2xXc3HsaBoOXKV20MToPkcXvwbISWLEs+64sBq5kFgn2kJDHb1Pry9yrP0dxrCI9RRci7RXKg==", + "license": "MIT", + "engines": { + "node": ">= 6.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks": { + "version": "2.8.3", + "resolved": "https://registry.npmjs.org/socks/-/socks-2.8.3.tgz", + "integrity": "sha512-l5x7VUUWbjVFbafGLxPWkYsHIhEvmF85tbIeFZWc8ZPtoMyybuEhL7Jye/ooC4/d48FgOjSJXgsF/AJPYCW8Zw==", + "license": "MIT", + "dependencies": { + "ip-address": "^9.0.5", + "smart-buffer": "^4.2.0" + }, + "engines": { + "node": ">= 10.0.0", + "npm": ">= 3.0.0" + } + }, + "node_modules/socks-proxy-agent": { + "version": "8.0.4", + "resolved": "https://registry.npmjs.org/socks-proxy-agent/-/socks-proxy-agent-8.0.4.tgz", + "integrity": "sha512-GNAq/eg8Udq2x0eNiFkr9gRg5bA7PXEWagQdeRX4cPSG+X/8V38v637gim9bjFptMk1QWsCTr0ttrJEiXbNnRw==", + "license": "MIT", + "dependencies": { + "agent-base": "^7.1.1", + "debug": "^4.3.4", + "socks": "^2.8.3" + }, + "engines": { + "node": ">= 14" + } + }, + "node_modules/socks-proxy-agent/node_modules/debug": { + "version": "4.3.6", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.6.tgz", + "integrity": "sha512-O/09Bd4Z1fBrU4VzkhFqVgpPzaGbw6Sm9FEkBT1A/YBXQFGuuSxa1dN2nxgxS34JmKXqYx8CZAwEVoJFImUXIg==", + "license": "MIT", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/socks-proxy-agent/node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "license": "MIT" + }, + "node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "license": "BSD-3-Clause", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sparse-bitfield": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/sparse-bitfield/-/sparse-bitfield-3.0.3.tgz", + "integrity": "sha512-kvzhi7vqKTfkh0PZU+2D2PIllw2ymqJKujUcyPMd9Y75Nv4nPbGJZXNhxsgdQab2BmlDct1YnfQCguEvHr7VsQ==", + "license": "MIT", + "dependencies": { + "memory-pager": "^1.0.2" + } + }, + "node_modules/split2": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", + "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", + "license": "ISC", + "engines": { + "node": ">= 10.x" + } + }, + "node_modules/sprintf-js": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.1.3.tgz", + "integrity": "sha512-Oo+0REFV59/rz3gfJNKQiBlwfHaSESl1pcGyABQsnnIfWOFt6JNj5gCog2U6MLZ//IGYD+nA8nI+mTShREReaA==", + "license": "BSD-3-Clause" + }, + "node_modules/sqlite3": { + "version": "5.1.7", + "resolved": "https://registry.npmjs.org/sqlite3/-/sqlite3-5.1.7.tgz", + "integrity": "sha512-GGIyOiFaG+TUra3JIfkI/zGP8yZYLPQ0pl1bH+ODjiX57sPhrLU5sQJn1y9bDKZUFYkX1crlrPfSYt0BKKdkog==", + "hasInstallScript": true, + "license": "BSD-3-Clause", + "dependencies": { + "bindings": "^1.5.0", + "node-addon-api": "^7.0.0", + "prebuild-install": "^7.1.1", + "tar": "^6.1.11" + }, + "optionalDependencies": { + "node-gyp": "8.x" + }, + "peerDependencies": { + "node-gyp": "8.x" + }, + "peerDependenciesMeta": { + "node-gyp": { + "optional": true + } + } + }, + "node_modules/sshpk": { + "version": "1.18.0", + "resolved": "https://registry.npmjs.org/sshpk/-/sshpk-1.18.0.tgz", + "integrity": "sha512-2p2KJZTSqQ/I3+HX42EpYOa2l3f8Erv8MWKsy2I9uf4wA7yFIkXRffYdsx86y6z4vHtV8u7g+pPlr8/4ouAxsQ==", + "license": "MIT", + "dependencies": { + "asn1": "~0.2.3", + "assert-plus": "^1.0.0", + "bcrypt-pbkdf": "^1.0.0", + "dashdash": "^1.12.0", + "ecc-jsbn": "~0.1.1", + "getpass": "^0.1.1", + "jsbn": "~0.1.0", + "safer-buffer": "^2.0.2", + "tweetnacl": "~0.14.0" + }, + "bin": { + "sshpk-conv": "bin/sshpk-conv", + "sshpk-sign": "bin/sshpk-sign", + "sshpk-verify": "bin/sshpk-verify" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/sshpk/node_modules/jsbn": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/jsbn/-/jsbn-0.1.1.tgz", + "integrity": "sha512-UVU9dibq2JcFWxQPA6KCqj5O42VOmAY3zQUfEKxU0KpTGXwNoCjkX1e13eHNvw/xPynt6pU0rZ1htjWTNTSXsg==", + "license": "MIT" + }, + "node_modules/ssri": { + "version": "8.0.1", + "resolved": "https://registry.npmjs.org/ssri/-/ssri-8.0.1.tgz", + "integrity": "sha512-97qShzy1AiyxvPNIkLWoGua7xoQzzPjQ0HAH4B0rWKo7SZ6USuPcrUiAFrws0UH8RrbWmgq3LMTObhPIHbbBeQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "minipass": "^3.1.1" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/statuses": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", + "integrity": "sha512-RwNA9Z/7PrK06rYLIzFMlaF+l73iwpzsqRIFgbMLbTcLD6cOao82TaWefPXQvB2fOC4AjuYSEndS7N/mTCbkdQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/stream-shift": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/stream-shift/-/stream-shift-1.0.3.tgz", + "integrity": "sha512-76ORR0DO1o1hlKwTbi/DM3EXWGf3ZJYO8cXX5RJwnul2DEg2oyoZyjLNoQM8WsvZiFKCRfC1O0J7iCvie3RZmQ==", + "license": "MIT" + }, + "node_modules/streamx": { + "version": "2.18.0", + "resolved": "https://registry.npmjs.org/streamx/-/streamx-2.18.0.tgz", + "integrity": "sha512-LLUC1TWdjVdn1weXGcSxyTR3T4+acB6tVGXT95y0nGbca4t4o/ng1wKAGTljm9VicuCVLvRlqFYXYy5GwgM7sQ==", + "license": "MIT", + "dependencies": { + "fast-fifo": "^1.3.2", + "queue-tick": "^1.0.1", + "text-decoder": "^1.1.0" + }, + "optionalDependencies": { + "bare-events": "^2.2.0" + } + }, + "node_modules/string_decoder": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", + "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string-width": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", + "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", + "license": "MIT", + "dependencies": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^6.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-ansi": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", + "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", + "license": "MIT", + "dependencies": { + "ansi-regex": "^5.0.1" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/strip-json-comments": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", + "integrity": "sha512-4gB8na07fecVVkOI6Rs4e7T6NOTki5EmL7TUduTs6bu3EdnSycntVJ4re8kgZA+wx9IueI2Y11bfbgwtzuE0KQ==", + "license": "MIT", + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/supports-color": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", + "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", + "license": "MIT", + "dependencies": { + "has-flag": "^4.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/tar": { + "version": "6.2.1", + "resolved": "https://registry.npmjs.org/tar/-/tar-6.2.1.tgz", + "integrity": "sha512-DZ4yORTwrbTj/7MZYq2w+/ZFdI6OZ/f9SFHR+71gIVUZhOQPHzVCLpvRnPgyaMpfWxxk/4ONva3GQSyNIKRv6A==", + "license": "ISC", + "dependencies": { + "chownr": "^2.0.0", + "fs-minipass": "^2.0.0", + "minipass": "^5.0.0", + "minizlib": "^2.1.1", + "mkdirp": "^1.0.3", + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/tar-fs": { + "version": "3.0.6", + "resolved": "https://registry.npmjs.org/tar-fs/-/tar-fs-3.0.6.tgz", + "integrity": "sha512-iokBDQQkUyeXhgPYaZxmczGPhnhXZ0CmrqI+MOb/WFGS9DW5wnfrLgtjUJBvz50vQ3qfRwJ62QVoCFu8mPVu5w==", + "license": "MIT", + "dependencies": { + "pump": "^3.0.0", + "tar-stream": "^3.1.5" + }, + "optionalDependencies": { + "bare-fs": "^2.1.1", + "bare-path": "^2.1.0" + } + }, + "node_modules/tar-stream": { + "version": "3.1.7", + "resolved": "https://registry.npmjs.org/tar-stream/-/tar-stream-3.1.7.tgz", + "integrity": "sha512-qJj60CXt7IU1Ffyc3NJMjh6EkuCFej46zUqJ4J7pqYlThyd9bO0XBTmcOIhSzZJVWfsLks0+nle/j538YAW9RQ==", + "license": "MIT", + "dependencies": { + "b4a": "^1.6.4", + "fast-fifo": "^1.2.0", + "streamx": "^2.15.0" + } + }, + "node_modules/tar/node_modules/minipass": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/minipass/-/minipass-5.0.0.tgz", + "integrity": "sha512-3FnjYuehv9k6ovOEbyOswadCDPX1piCfhV8ncmYtHOjuPwylVWsghTLo7rabjC3Rx5xD4HDx8Wm1xnMF7S5qFQ==", + "license": "ISC", + "engines": { + "node": ">=8" + } + }, + "node_modules/text-decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/text-decoder/-/text-decoder-1.1.1.tgz", + "integrity": "sha512-8zll7REEv4GDD3x4/0pW+ppIxSNs7H1J10IKFZsuOMscumCdM2a+toDGLPA3T+1+fLBql4zbt5z83GEQGGV5VA==", + "license": "Apache-2.0", + "dependencies": { + "b4a": "^1.6.4" + } + }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha512-w89qg7PI8wAdvX60bMDP+bFoD5Dvhm9oLheFp5O4a2QF0cSBGsBX4qZmadPMvVqlLJBBci+WqGGOAPvcDeNSVg==", + "license": "MIT" + }, + "node_modules/toidentifier": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toidentifier/-/toidentifier-1.0.1.tgz", + "integrity": "sha512-o5sSPKEkg/DIQNmH43V0/uerLrpzVedkUh8tGNvaeXpfpuwjKenlSox/2O/BTlZUtEe+JG7s5YhEz608PlAHRA==", + "license": "MIT", + "engines": { + "node": ">=0.6" + } + }, + "node_modules/toposort-class": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/toposort-class/-/toposort-class-1.0.1.tgz", + "integrity": "sha512-OsLcGGbYF3rMjPUf8oKktyvCiUxSbqMMS39m33MAjLTC1DVIH6x3WSt63/M77ihI09+Sdfk1AXvfhCEeUmC7mg==", + "license": "MIT" + }, + "node_modules/tough-cookie": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/tough-cookie/-/tough-cookie-2.5.0.tgz", + "integrity": "sha512-nlLsUzgm1kfLXSXfRZMc1KLAugd4hqJHDTvc2hDIwS3mZAfMEuMbc03SujMF+GEcpaX/qboeycw6iO8JwVv2+g==", + "license": "BSD-3-Clause", + "dependencies": { + "psl": "^1.1.28", + "punycode": "^2.1.1" + }, + "engines": { + "node": ">=0.8" + } + }, + "node_modules/tr46": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/tr46/-/tr46-4.1.1.tgz", + "integrity": "sha512-2lv/66T7e5yNyhAAC4NaKe5nVavzuGJQVVtRYLyQ2OI8tsJ61PMLlelehb0wi2Hx6+hT/OJUWZcw8MjlSRnxvw==", + "license": "MIT", + "dependencies": { + "punycode": "^2.3.0" + }, + "engines": { + "node": ">=14" + } + }, + "node_modules/tslib": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.6.3.tgz", + "integrity": "sha512-xNvxJEOUiWPGhUuUdQgAJPKOOJfGnIyKySOc09XkKsgdUV/3E2zvwZYdejjmRgPCgcym1juLH3226yA7sEFJKQ==", + "license": "0BSD" + }, + "node_modules/tunnel-agent": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/tunnel-agent/-/tunnel-agent-0.6.0.tgz", + "integrity": "sha512-McnNiV1l8RYeY8tBgEpuodCC1mLUdbSN+CYBL7kJsJNInOP8UjDDEwdk6Mw60vdLLrr5NHKZhMAOSrR2NZuQ+w==", + "license": "Apache-2.0", + "dependencies": { + "safe-buffer": "^5.0.1" + }, + "engines": { + "node": "*" + } + }, + "node_modules/tweetnacl": { + "version": "0.14.5", + "resolved": "https://registry.npmjs.org/tweetnacl/-/tweetnacl-0.14.5.tgz", + "integrity": "sha512-KXXFFdAbFXY4geFIwoyNK+f5Z1b7swfXABfL7HXCmoIWMKU3dmS26672A4EeQtDzLKy7SXmfBu51JolvEKwtGA==", + "license": "Unlicense" + }, + "node_modules/type-is": { + "version": "1.6.18", + "resolved": "https://registry.npmjs.org/type-is/-/type-is-1.6.18.tgz", + "integrity": "sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g==", + "license": "MIT", + "dependencies": { + "media-typer": "0.3.0", + "mime-types": "~2.1.24" + }, + "engines": { + "node": ">= 0.6" + } + }, + "node_modules/typedarray": { + "version": "0.0.6", + "resolved": "https://registry.npmjs.org/typedarray/-/typedarray-0.0.6.tgz", + "integrity": "sha512-/aCDEGatGvZ2BIk+HmLf4ifCJFwvKFNb9/JeZPMulfgFracn9QFcAf5GO8B/mweUjSoblS5In0cWhqpfs/5PQA==", + "license": "MIT" + }, + "node_modules/uid-safe": { + "version": "2.1.5", + "resolved": "https://registry.npmjs.org/uid-safe/-/uid-safe-2.1.5.tgz", + "integrity": "sha512-KPHm4VL5dDXKz01UuEd88Df+KzynaohSL9fBh096KWAxSKZQDI2uBrVqtvRM4rwrIrRRKsdLNML/lnaaVSRioA==", + "license": "MIT", + "dependencies": { + "random-bytes": "~1.0.0" + }, + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/ultron": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/ultron/-/ultron-1.1.1.tgz", + "integrity": "sha512-UIEXBNeYmKptWH6z8ZnqTeS8fV74zG0/eRU9VGkpzz+LIJNs8W/zM/L+7ctCkRrgbNnnR0xxw4bKOr0cW0N0Og==", + "license": "MIT" + }, + "node_modules/unbzip2-stream": { + "version": "1.4.3", + "resolved": "https://registry.npmjs.org/unbzip2-stream/-/unbzip2-stream-1.4.3.tgz", + "integrity": "sha512-mlExGW4w71ebDJviH16lQLtZS32VKqsSfk80GCfUlwT/4/hNRFsoscrF/c++9xinkMzECL1uL9DDwXqFWkruPg==", + "license": "MIT", + "dependencies": { + "buffer": "^5.2.1", + "through": "^2.3.8" + } + }, + "node_modules/unbzip2-stream/node_modules/buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ], + "license": "MIT", + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/undici": { + "version": "6.19.8", + "resolved": "https://registry.npmjs.org/undici/-/undici-6.19.8.tgz", + "integrity": "sha512-U8uCCl2x9TK3WANvmBavymRzxbfFYG+tAu+fgx3zxQy3qdagQqBLwJVrdyO1TBfUXvfKveMKJZhpvUYoOjM+4g==", + "license": "MIT", + "engines": { + "node": ">=18.17" + } + }, + "node_modules/undici-types": { + "version": "6.13.0", + "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.13.0.tgz", + "integrity": "sha512-xtFJHudx8S2DSoujjMd1WeWvn7KKWFRESZTMeL1RptAYERu29D6jphMjjY+vn96jvN3kVPDNxU/E13VTaXj6jg==", + "license": "MIT" + }, + "node_modules/unique-filename": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/unique-filename/-/unique-filename-1.1.1.tgz", + "integrity": "sha512-Vmp0jIp2ln35UTXuryvjzkjGdRyf9b2lTXuSYUiPmzRcl3FDtYqAwOnTJkAngD9SWhnoJzDbTKwaOrZ+STtxNQ==", + "license": "ISC", + "optional": true, + "dependencies": { + "unique-slug": "^2.0.0" + } + }, + "node_modules/unique-slug": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/unique-slug/-/unique-slug-2.0.2.tgz", + "integrity": "sha512-zoWr9ObaxALD3DOPfjPSqxt4fnZiWblxHIgeWqW8x7UqDzEtHEQLzji2cuJYQFCU6KmoJikOYAZlrTHHebjx2w==", + "license": "ISC", + "optional": true, + "dependencies": { + "imurmurhash": "^0.1.4" + } + }, + "node_modules/universalify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", + "integrity": "sha512-gptHNQghINnc/vTGIk0SOFGFNXw7JVrlRUtConJRlvaw6DuX0wO5Jeko9sWrMBhh+PsYAZ7oXAiOnf/UKogyiw==", + "license": "MIT", + "engines": { + "node": ">= 10.0.0" + } + }, + "node_modules/unpipe": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unpipe/-/unpipe-1.0.0.tgz", + "integrity": "sha512-pjy2bYhSsufwWlKwPc+l3cN7+wuJlK6uz0YdJEOlQDbl6jo/YlPi4mb8agUkVC8BF7V8NuzeyPNqRksA3hztKQ==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/uri-js": { + "version": "4.4.1", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.4.1.tgz", + "integrity": "sha512-7rKUyy33Q1yc98pQ1DAmLtwX109F7TIfWlW1Ydo8Wl1ii1SeHieeh0HHfPeL2fMXK6z0s8ecKs9frCuLJvndBg==", + "license": "BSD-2-Clause", + "dependencies": { + "punycode": "^2.1.0" + } + }, + "node_modules/urlpattern-polyfill": { + "version": "10.0.0", + "resolved": "https://registry.npmjs.org/urlpattern-polyfill/-/urlpattern-polyfill-10.0.0.tgz", + "integrity": "sha512-H/A06tKD7sS1O1X2SshBVeA5FLycRpjqiBeqGKmBwBDBy28EnRjORxTNe269KSSr5un5qyWi1iL61wLxpd+ZOg==", + "license": "MIT" + }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==", + "license": "MIT" + }, + "node_modules/utils-merge": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", + "integrity": "sha512-pMZTvIkT1d+TFGvDOqodOclx0QWkkgi6Tdoa8gC8ffGAAqz9pzPTZWAybbsHHoED/ztMtkv/VoYTYyShUn81hA==", + "license": "MIT", + "engines": { + "node": ">= 0.4.0" + } + }, + "node_modules/uuid": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.4.0.tgz", + "integrity": "sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A==", + "deprecated": "Please upgrade to version 7 or higher. Older versions may use Math.random() in certain circumstances, which is known to be problematic. See https://v8.dev/blog/math-random for details.", + "license": "MIT", + "bin": { + "uuid": "bin/uuid" + } + }, + "node_modules/validator": { + "version": "13.12.0", + "resolved": "https://registry.npmjs.org/validator/-/validator-13.12.0.tgz", + "integrity": "sha512-c1Q0mCiPlgdTVVVIJIrBuxNicYE+t/7oKeI9MWLj3fh/uq2Pxh/3eeWbVZ4OcGW1TUf53At0njHw5SMdA3tmMg==", + "license": "MIT", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/vary": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/vary/-/vary-1.1.2.tgz", + "integrity": "sha512-BNGbWLfd0eUPabhkXUVm0j8uuvREyTh5ovRa/dyow/BqAbZJyC+5fU+IzQOzmAKzYqYRAISoRhdQr3eIZ/PXqg==", + "license": "MIT", + "engines": { + "node": ">= 0.8" + } + }, + "node_modules/verror": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/verror/-/verror-1.10.0.tgz", + "integrity": "sha512-ZZKSmDAEFOijERBLkmYfJ+vmk3w+7hOLYDNkRCuRuMJGEmqYNCNLyBBFwWKVMhfwaEF3WOd0Zlw86U/WC/+nYw==", + "engines": [ + "node >=0.6.0" + ], + "license": "MIT", + "dependencies": { + "assert-plus": "^1.0.0", + "core-util-is": "1.0.2", + "extsprintf": "^1.2.0" + } + }, + "node_modules/webidl-conversions": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-7.0.0.tgz", + "integrity": "sha512-VwddBukDzu71offAQR975unBIGqfKZpM+8ZX6ySk8nYhVoo5CYaZyzt3YBvYtRtO+aoGlqxPg/B87NGVZ/fu6g==", + "license": "BSD-2-Clause", + "engines": { + "node": ">=12" + } + }, + "node_modules/websocket-stream": { + "version": "5.5.2", + "resolved": "https://registry.npmjs.org/websocket-stream/-/websocket-stream-5.5.2.tgz", + "integrity": "sha512-8z49MKIHbGk3C4HtuHWDtYX8mYej1wWabjthC/RupM9ngeukU4IWoM46dgth1UOS/T4/IqgEdCDJuMe2039OQQ==", + "license": "BSD-2-Clause", + "dependencies": { + "duplexify": "^3.5.1", + "inherits": "^2.0.1", + "readable-stream": "^2.3.3", + "safe-buffer": "^5.1.2", + "ws": "^3.2.0", + "xtend": "^4.0.0" + } + }, + "node_modules/websocket-stream/node_modules/readable-stream": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-2.3.8.tgz", + "integrity": "sha512-8p0AUk4XODgIewSi0l8Epjs+EVnWiK7NoDIEGU0HhE7+ZyY8D1IMY7odu5lRrFXGg71L15KG8QrPmum45RTtdA==", + "license": "MIT", + "dependencies": { + "core-util-is": "~1.0.0", + "inherits": "~2.0.3", + "isarray": "~1.0.0", + "process-nextick-args": "~2.0.0", + "safe-buffer": "~5.1.1", + "string_decoder": "~1.1.1", + "util-deprecate": "~1.0.1" + } + }, + "node_modules/websocket-stream/node_modules/safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "license": "MIT" + }, + "node_modules/websocket-stream/node_modules/string_decoder": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.1.1.tgz", + "integrity": "sha512-n/ShnvDi6FHbbVfviro+WojiFzv+s8MPMHBczVePfUpDJLwoLT0ht1l4YwBCbi8pJAveEEdnkHyPyTP/mzRfwg==", + "license": "MIT", + "dependencies": { + "safe-buffer": "~5.1.0" + } + }, + "node_modules/websocket-stream/node_modules/ws": { + "version": "3.3.3", + "resolved": "https://registry.npmjs.org/ws/-/ws-3.3.3.tgz", + "integrity": "sha512-nnWLa/NwZSt4KQJu51MYlCcSQ5g7INpOrOMt4XV8j4dqTXdmlUmSHQ8/oLC069ckre0fRsgfvsKwbTdtKLCDkA==", + "license": "MIT", + "dependencies": { + "async-limiter": "~1.0.0", + "safe-buffer": "~5.1.0", + "ultron": "~1.1.0" + } + }, + "node_modules/whatwg-encoding": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/whatwg-encoding/-/whatwg-encoding-3.1.1.tgz", + "integrity": "sha512-6qN4hJdMwfYBtE3YBTTHhoeuUrDBPZmbQaxWAqSALV/MeEnR5z1xd8UKud2RAkFoPkmB+hli1TZSnyi84xz1vQ==", + "license": "MIT", + "dependencies": { + "iconv-lite": "0.6.3" + }, + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-encoding/node_modules/iconv-lite": { + "version": "0.6.3", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.6.3.tgz", + "integrity": "sha512-4fCk79wshMdzMp2rH06qWrJE4iolqLhCUH+OiuIgU++RB0+94NlDL81atO7GX55uUKueo0txHNtvEyI6D7WdMw==", + "license": "MIT", + "dependencies": { + "safer-buffer": ">= 2.1.2 < 3.0.0" + }, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/whatwg-mimetype": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/whatwg-mimetype/-/whatwg-mimetype-4.0.0.tgz", + "integrity": "sha512-QaKxh0eNIi2mE9p2vEdzfagOKHCcj1pJ56EEHGQOVxp8r9/iszLUUV7v89x9O1p/T+NlTM5W7jW6+cz4Fq1YVg==", + "license": "MIT", + "engines": { + "node": ">=18" + } + }, + "node_modules/whatwg-url": { + "version": "13.0.0", + "resolved": "https://registry.npmjs.org/whatwg-url/-/whatwg-url-13.0.0.tgz", + "integrity": "sha512-9WWbymnqj57+XEuqADHrCJ2eSXzn8WXIW/YSGaZtb2WKAInQ6CHfaUUcTyyver0p8BDg5StLQq8h1vtZuwmOig==", + "license": "MIT", + "dependencies": { + "tr46": "^4.1.1", + "webidl-conversions": "^7.0.0" + }, + "engines": { + "node": ">=16" + } + }, + "node_modules/which": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", + "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", + "license": "ISC", + "optional": true, + "dependencies": { + "isexe": "^2.0.0" + }, + "bin": { + "node-which": "bin/node-which" + }, + "engines": { + "node": ">= 8" + } + }, + "node_modules/wide-align": { + "version": "1.1.5", + "resolved": "https://registry.npmjs.org/wide-align/-/wide-align-1.1.5.tgz", + "integrity": "sha512-eDMORYaPNZ4sQIuuYPDHdQvf4gyCF9rEEV/yPxGfwPkRodwEgiMUUXTx/dex+Me0wxx53S+NgUHaP7y3MGlDmg==", + "license": "ISC", + "optional": true, + "dependencies": { + "string-width": "^1.0.2 || 2 || 3 || 4" + } + }, + "node_modules/wkx": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/wkx/-/wkx-0.5.0.tgz", + "integrity": "sha512-Xng/d4Ichh8uN4l0FToV/258EjMGU9MGcA0HV2d9B/ZpZB3lqQm7nkOdZdm5GhKtLLhAE7PiVQwN4eN+2YJJUg==", + "license": "MIT", + "dependencies": { + "@types/node": "*" + } + }, + "node_modules/worker-timers": { + "version": "7.1.8", + "resolved": "https://registry.npmjs.org/worker-timers/-/worker-timers-7.1.8.tgz", + "integrity": "sha512-R54psRKYVLuzff7c1OTFcq/4Hue5Vlz4bFtNEIarpSiCYhpifHU3aIQI29S84o1j87ePCYqbmEJPqwBTf+3sfw==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2", + "worker-timers-broker": "^6.1.8", + "worker-timers-worker": "^7.0.71" + } + }, + "node_modules/worker-timers-broker": { + "version": "6.1.8", + "resolved": "https://registry.npmjs.org/worker-timers-broker/-/worker-timers-broker-6.1.8.tgz", + "integrity": "sha512-FUCJu9jlK3A8WqLTKXM9E6kAmI/dR1vAJ8dHYLMisLNB/n3GuaFIjJ7pn16ZcD1zCOf7P6H62lWIEBi+yz/zQQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.5", + "fast-unique-numbers": "^8.0.13", + "tslib": "^2.6.2", + "worker-timers-worker": "^7.0.71" + } + }, + "node_modules/worker-timers-worker": { + "version": "7.0.71", + "resolved": "https://registry.npmjs.org/worker-timers-worker/-/worker-timers-worker-7.0.71.tgz", + "integrity": "sha512-ks/5YKwZsto1c2vmljroppOKCivB/ma97g9y77MAAz2TBBjPPgpoOiS1qYQKIgvGTr2QYPT3XhJWIB6Rj2MVPQ==", + "license": "MIT", + "dependencies": { + "@babel/runtime": "^7.24.5", + "tslib": "^2.6.2" + } + }, + "node_modules/wrap-ansi": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", + "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", + "license": "MIT", + "dependencies": { + "ansi-styles": "^4.0.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/chalk/wrap-ansi?sponsor=1" + } + }, + "node_modules/wrappy": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", + "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==", + "license": "ISC" + }, + "node_modules/ws": { + "version": "7.5.10", + "resolved": "https://registry.npmjs.org/ws/-/ws-7.5.10.tgz", + "integrity": "sha512-+dbF1tHwZpXcbOJdVOkzLDxZP1ailvSxM6ZweXTegylPny803bFhA+vqBYw4s31NSAk4S2Qz+AKXK9a4wkdjcQ==", + "license": "MIT", + "engines": { + "node": ">=8.3.0" + }, + "peerDependencies": { + "bufferutil": "^4.0.1", + "utf-8-validate": "^5.0.2" + }, + "peerDependenciesMeta": { + "bufferutil": { + "optional": true + }, + "utf-8-validate": { + "optional": true + } + } + }, + "node_modules/xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "license": "MIT", + "engines": { + "node": ">=0.4" + } + }, + "node_modules/y18n": { + "version": "5.0.8", + "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", + "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", + "license": "ISC", + "engines": { + "node": ">=10" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==", + "license": "ISC" + }, + "node_modules/yargs": { + "version": "17.7.2", + "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", + "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", + "license": "MIT", + "dependencies": { + "cliui": "^8.0.1", + "escalade": "^3.1.1", + "get-caller-file": "^2.0.5", + "require-directory": "^2.1.1", + "string-width": "^4.2.3", + "y18n": "^5.0.5", + "yargs-parser": "^21.1.1" + }, + "engines": { + "node": ">=12" + } + }, + "node_modules/yargs-parser": { + "version": "21.1.1", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", + "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", + "license": "ISC", + "engines": { + "node": ">=12" + } + }, + "node_modules/yauzl": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/yauzl/-/yauzl-2.10.0.tgz", + "integrity": "sha512-p4a9I6X6nu6IhoGmBqAcbJy1mlC4j27vEPZX9F4L4/vZT3Lyq1VkFHw/V/PUcB9Buo+DG3iHkT0x3Qya58zc3g==", + "license": "MIT", + "dependencies": { + "buffer-crc32": "~0.2.3", + "fd-slicer": "~1.1.0" + } + }, + "node_modules/zod": { + "version": "3.23.8", + "resolved": "https://registry.npmjs.org/zod/-/zod-3.23.8.tgz", + "integrity": "sha512-XBx9AXhXktjUqnepgTiE5flcKIYWi/rme0Eaj+5Y0lftuGBq+jyRu/md4WnuxqgP1ubdpNCsYEYPxrzVHD8d6g==", + "license": "MIT", + "funding": { + "url": "https://github.com/sponsors/colinhacks" + } + } + } +} diff --git a/package.json b/package.json new file mode 100644 index 0000000000000000000000000000000000000000..e4da9706cffafa2cccd535e631697e0ec7ffbe9d --- /dev/null +++ b/package.json @@ -0,0 +1,44 @@ +{ + "name": "mira-bot-v1", + "version": "beta-1.0.1", + "description": "Simple Chatbot Messenger", + "main": "source/mira.js", + "scripts": { + "start": "node source/index.js" + }, + "repository": { + "type": "git", + "url": "git+https://github.com/GiaKhang1810/mira-bot-v1.git" + }, + "keywords": [], + "author": "Khang", + "license": "MIT", + "bugs": { + "url": "https://github.com/GiaKhang1810/mira-bot-v1/issues" + }, + "homepage": "https://github.com/GiaKhang1810/mira-bot-v1#readme", + "os": [ + "win32", + "darwin", + "linux" + ], + "dependencies": { + "axios": "^1.7.2", + "cheerio": "^1.0.0", + "ejs": "^3.1.10", + "express": "^4.19.2", + "express-session": "^1.18.0", + "express-ws": "^5.0.2", + "https-proxy-agent": "^7.0.5", + "moment-timezone": "^0.5.45", + "mongodb": "^6.8.0", + "mongoose": "^8.5.2", + "mqtt": "^5.9.1", + "mqtt-packet": "^9.0.0", + "puppeteer": "^22.14.0", + "request": "^2.88.2", + "sequelize": "^6.37.3", + "sqlite3": "^5.1.7", + "websocket-stream": "^5.5.2" + } +} diff --git a/plugins/fb.js b/plugins/fb.js new file mode 100644 index 0000000000000000000000000000000000000000..e355d2804cc4c24235263d8a71ec944d8084ecdc --- /dev/null +++ b/plugins/fb.js @@ -0,0 +1,63 @@ +class facebook { + get Options() { + return { + name: "fb", + version: "1.0.0", + role: 0, + author: [ + { + info: "Khang", + contact: "m.me/100036947774673" + } + ], + category: "Tools", + description: { + "vi-VN": "Công cụ giúp bạn thực hiện các thao tác không cho phép trên facebook.", + "en-US": "Tool to help you perform actions that are not allowed on Facebook." + }, + delay: 2000, + guides: { + "vi-VN": + "{p}{n}dl reel {url} - Tải video từ reel.\n" + + "{p}{n}dl watch {url} - Tải video từ watch.\n" + + "{p}{n}token {cookie} - Lấy token từ cookie.\n" + + "{p}{n}info user {uid} - Lấy thông tin người dùng.\n" + + "{p}{n}info thread {tid} - Lấy thông tin nhóm.\n" + + "{p}{n}screen {uid} {userAgent} - Chụp màn hình người dùng.", + "en-US": + "{p}{n}help - Sends a list of instructions for use.\n" + + "{p}{n}dl reel {url} - Download video from reel.\n" + + "{p}{n}dl watch {url} - Download videos from watch.\n" + + "{p}{n}token {cookie} - Get token from cookie.\n" + + "{p}{n}info user {uid} - Get user information.\n" + + "{p}{n}info thread {tid} - Get group information.\n" + + "{p}{n}screen {uid} {userAgent} - Capture user screen." + }, + dependencies: ["fs"], + envConfig: {} + } + } + + get Langs() { + return { + "vi-VN": { + + }, + "en-US": { + + } + } + } + + async Reply({ Messenger, User, Thread, events, apis }) {} + + async React({ Messenger, User, Thread, events, apis }) {} + + async Schedule({ Messenger, User, Thread, events, apis }) {} + + async Main({ Messenger, User, Thread, events, apis , args}) { + + } +} + +module.exports = facebook; \ No newline at end of file diff --git a/source/apis/index.js b/source/apis/index.js new file mode 100644 index 0000000000000000000000000000000000000000..62ad5c4356a51cb670fc479c0c4861ccb3f6ab6f --- /dev/null +++ b/source/apis/index.js @@ -0,0 +1,272 @@ +var log = require("../lib/log"); +var utils = require("./utils"); +var fs = require("fs"); +var globalOptions = global.mira.config.facebookAPIsOptions; + +function buildAPIs(body, jar, whiteID, proxy, loginCount) { + var infoCookies = jar + .getCookies("https://www.facebook.com") + .reduce(function (form, cookies) { + var [name, value] = cookies.cookieString().split("="); + form[name] = value; + return form; + }, {}); + + if (!infoCookies.i_user && !infoCookies.c_user) { + log.warn("facebook.login.notUser"); + if (globalOptions.forceLogin) { + log.warn("facebook.relogin.force"); + return Login(false, loginCount += 1); + } else + process.exit(1); + } + + var userID = whiteID === infoCookies.i_user ? infoCookies.i_user : infoCookies.c_user; + log.info("facebook.login.user", userID); + var clientID = (Math.random() * 2147483648 | 0).toString(16); + var apis = { + getAppState: function getAppState() { + return jar + .getCookies("https://www.facebook.com") + .concat(jar.getCookies("https://www.messenger.com")); + } + } + + var endpoint, region, syncToken; + var endpointExec = /"appID":219994525426954,"endpoint":"(.+?)"/g.exec(body); + if (endpointExec) { + endpoint = endpointExec[1].replace(/\\\//g, "/"); + region = new URL(endpoint).searchParams.get("region").toUpperCase(); + log.info("facebook.login.region", region); + } else + log.warn("facebook.login.notRegion"); + + var ctx = { + userID, + region, + endpoint, + clientID, + jar, + get globalOptions() { + return global.mira.config.facebookAPIsOptions; + }, + isLogin: true, + lastSeqID: null, + clientMutationID: 0, + proxy + } + + var http = utils.makeDefaults(body, userID, ctx); + fs.readdirSync(__dirname + "/lib") + .filter(item => item.endsWith(".js")) + .map(function (item) { + apis[item.replace(".js", "")] = require("./lib/" + item)(http, apis, ctx); + }); + log.info("facebook.apis", Object.keys(apis).length); + global.mira.apis = apis; + + var checkLogin = setInterval(function () { + if (ctx.isLogin) + return; + + log.warn("facebook.login.logout"); + if (globalOptions.autoReconnect) { + log.warn("facebook.login.reconnect"); + clearInterval(checkLogin); + return Login(false, loginCount += 1); + } + }, 5000); + + return utils + .post("https://www.facebook.com/v1.0/dialog/oauth/confirm", ctx.jar, { + fb_dtsg: /\["DTSGInitData",\[],{"token":"(\S+)","async_get_token"/g.exec(body)[1], + app_id: "124024574287414", + redirect_uri: "fbconnect://success", + display: "popup", + return_format: "access_token", + }) + .then(function (res) { + var body = res.body; + var token = body.match(/access_token=(.+?)&/); + if (token && token[1]) { + ctx.token = token[1]; + log.info("facebook.access.token", token[1]); + } else + throw new Error("Token is undefined."); + }) + .catch(function (error) { + log.warn("facebook.access.error", error.message); + console.log(error); + }); +} + +async function makeLogin(email, password, proxy) { + var Browser; + var Pup = require("puppeteer"); + var Proxy = utils.parseProxy(proxy); + + if (Proxy && Proxy.length > 0) { + Browser = await Pup.launch({ headless: true, args: ["--proxy-server=" + proxy] }); + } else + Browser = await Pup.launch({ headless: false }); + + var Page = await Browser.newPage(); + + if (Proxy && Proxy[0] && Proxy[1]) + await Page.authenticate({ + username: Proxy[0], + password: Proxy[1] + }); + + await Page.setUserAgent("Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"); + await Page.goto("https://www.facebook.com"); + await Page.type("input[name=\"email\"]", email); + await Page.type("input[name=\"pass\"]", password); + await Page.click("button[name=\"login\"]"); + var waitForLoad = Page.waitForNavigation({ waitUntil: "networkidle0" }); + await new Promise(resolve => setTimeout(resolve, 5000)); + var currentUrl = Page.url(); + + if (currentUrl.indexOf("/two_step_verification/two_factor/") > -1 || currentUrl.indexOf("/checkpoint/465803052217681") > -1) { + log.warn("facebook.login.checkpoint"); + var timeoutCheckpoint = setTimeout(function () { + log.warn("facebook.login.missTimeCheckpoint"); + process.exit(1); + }, 2 * 60 * 1000); + if (await Page.evaluate(_ => document.querySelectorAll("input").length) === 1) { + async function waitForCheckpointSMS(length) { + var NotChangeURL = _ => currentUrl === Page.url(); + var ReClick = _ => Page.click("span[class=\"x1lliihq x193iq5w x6ikm8r x10wlt62 xlyipyv xuxw1ft\"]"); + var GetCodeSMS = _ => log.input("facebook.access.codeSMS", "yellow", 60 * 1000); + var EnterCodeSMS = SMS => length === 0 ? Page.type("input[dir=\"ltr\"", SMS) : Page.evaluate(SMS => { + var input = document.querySelector("input[dir=\"ltr\""); + if (input) { + input.value = SMS; + input.dispatchEvent(new Event("input", { bubbles: true })); + } + }, SMS); + + if (length > 2) + throw new Error("Cant Authenticated With CodeSMS."); + var SMS = await GetCodeSMS(); + if (SMS) { + await EnterCodeSMS(SMS); + await ReClick(); + await new Promise(resolve => setTimeout(resolve, 2000)); + if (NotChangeURL()) { + log.warn("facebook.access.wrongSMS"); + return waitForCheckpointSMS(length + 1); + } + } else + throw new Error("CodeSMS is undefined."); + } + + await waitForCheckpointSMS(0); + } else { + var intervalCheckURL; + var waitForCheckpoint = new Promise(resolve => { + intervalCheckURL = setInterval(function () { + var currentURL = Page.url(); + if (currentURL.indexOf("/two_factor/remember_browser/") > -1) + resolve(); + }, 5000); + }); + await waitForCheckpoint; + clearInterval(intervalCheckURL); + } + clearTimeout(timeoutCheckpoint); + await Page.click("div[class=\"x1n2onr6 x1ja2u2z x78zum5 x2lah0s xl56j7k x6s0dn4 xozqiw3 x1q0g3np x9f619 xi112ho x17zwfj4 x585lrc x1403ito x1qhmfi1 x1s9qjmn x39innc x7gj0x1 x1mpseq2 x13fuv20 xu3j5b3 x1q0q8m5 x26u7qi x178xt8z xm81vs4 xso031l xy80clv x1fq8qgq x1ghtduv x1oktzhs\""); + } + + if (currentUrl.indexOf("/two_step_verification/authentication/") > -1) { + log.warn("facebook.login.checkpointImage"); + process.exit(1); + } + + if (currentUrl.indexOf("/login/") > -1) { + log.warn("facebook.login.wrong"); + process.exit(1); + } + + await waitForLoad; + var appState = await Page.cookies(); + await Browser.close(); + return appState; +} + +function LoginHelper(appState, email, password, proxy, whiteID, loginCount) { + if (appState) { + var jar = utils.getJar(); + + if (typeof appState === "string") { + appState = decodeURIComponent(appState).split("; ").map(item => { + var [key, value] = item.split("="); + return { + key, + value, + domain: "facebook.com", + path: "/", + expires: new Date().getTime() + 1000 * 60 * 60 * 24 * 365 + } + }); + } + appState.map(item => { + var string = [ + (item.key || item.name) + "=" + item.value, + "expires=" + item.expires, + "domain=" + item.domain, + "path=" + item.path + ].join("; "); + jar.setCookie(utils.cookie(string), "http://" + item.domain); + }); + + return utils + .get("https://www.facebook.com", jar, null, null, { noRef: true }) + .then(function (res) { + var reg = /]+>/; + var redirect = reg.exec(res.body); + if (redirect && redirect[1]) { + return utils + .get(redirect[1], jar); + } + return res; + }) + .then(res => buildAPIs(res.body, jar, whiteID, proxy, loginCount)) + .catch(function (error) { + log.error("facebook.login.error"); + console.log(error); + process.exit(1); + }); + } else if (email && email.length > 0 && password && password.length > 0) { + return makeLogin(email, password, proxy) + .then(fbState => LoginHelper(fbState, email, password, proxy, whiteID, loginCount)); + } else { + log.warn("facebook.missing"); + process.exit(1); + } +} + +function Login(firstLogin = true, loginCount = 1) { + if (loginCount >= 3) { + log.warn("facebook.relogin.error"); + process.exit(1); + } + + var appState; + var { email, password, cookies, facebookState, proxy, whiteID } = global.mira.config.facebookAccountOptions; + var path = __dirname + "/../../" + facebookState; + + if (facebookState && facebookState.length > 0 && fs.existsSync(path)) + appState = require(path); + else if (cookies && cookies.length > 0) + appState = cookies; + + if (proxy && proxy.length > 0) + utils.setProxy(proxy); + + proxy = proxy || ""; + appState = firstLogin ? appState : null; + return LoginHelper(appState, email, password, proxy, whiteID, loginCount); +} + +module.exports = Login; \ No newline at end of file diff --git a/source/apis/lib/Client.js b/source/apis/lib/Client.js new file mode 100644 index 0000000000000000000000000000000000000000..427791101648be2d8592c206ccb289008c0e3307 --- /dev/null +++ b/source/apis/lib/Client.js @@ -0,0 +1,1132 @@ +var utils = require("../utils"); +var mqtt = require("mqtt"); +var websocket = require("websocket-stream"); +var HttpsProxyAgent = require("https-proxy-agent"); +var EventEmitter = require("events"); +var topics = [ + "/legacy_web", + "/webrtc", + "/rtc_multi", + "/onevc", + "/br_sr", + "/sr_res", + "/t_ms", + "/thread_typing", + "/orca_typing_notifications", + "/notify_disconnect", + "/orca_presence", + "/legacy_web_mtouch", + "/t_rtc_multi", + "/ls_foreground_state", + "/ls_resp", + "/inbox", + "/mercury", + "/messaging_events", + "/orca_message_notifications", + "/pp", + "/webrtc_response" +]; + +function notificationConnect(ctx) { + var next = true; + return utils + .get("https://www.facebook.com/notifications", ctx.jar) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + next = false; + console.log(error); + }) + .finally(function () { + if (next && ctx.listenNotif) + return setTimeout(notificationConnect, 1000, ctx); + }); +} + +function markDelivery(apis, threadID, messageID) { + if (threadID && messageID) + apis.markAsDelivered(threadID, messageID, error => !error ? apis.markAsRead(threadID) : null); +} + +function parseAndReCallback(http, apis, ctx, globalCallback, deltails) { + function getExtension(original_extension, fullFileName = "") { + if (original_extension) + return original_extension; + else { + var extension = fullFileName.split(".").pop(); + if (extension === fullFileName) + return ""; + else + return extension; + } + } + + function formatAttachment(attachment1, attachment2) { + var fullFileName = attachment1.filename; + var fileSize = Number(attachment1.fileSize || 0); + var durationVideo = attachment1.genericMetadata ? Number(attachment1.genericMetadata.videoLength) : undefined; + var durationAudio = attachment1.genericMetadata ? Number(attachment1.genericMetadata.duration) : undefined; + var mimeType = attachment1.mimeType; + + attachment2 = attachment2 || { id: "", image_data: {} }; + attachment1 = attachment1.mercury || attachment1; + var blob = attachment1.blob_attachment || attachment1.sticker_attachment; + var type = blob && blob.__typename ? blob.__typename : attachment1.attach_type; + if (!type && attachment1.sticker_attachment) { + type = "StickerAttachment"; + blob = attachment1.sticker_attachment; + } else if (!type && attachment1.extensible_attachment) { + if (attachment1.extensible_attachment.story_attachment && attachment1.extensible_attachment.story_attachment.target && attachment1.extensible_attachment.story_attachment.target.__typename && attachment1.extensible_attachment.story_attachment.target.__typename === "MessageLocation") + type = "MessageLocation"; + else + type = "ExtensibleAttachment"; + blob = attachment1.extensible_attachment; + } + switch (type) { + case "sticker": + return { + type: "sticker", + ID: attachment1.metadata.stickerID.toString(), + url: attachment1.url, + packID: attachment1.metadata.packID.toString(), + spriteUrl: attachment1.metadata.spriteURI, + spriteUrl2x: attachment1.metadata.spriteURI2x, + width: attachment1.metadata.width, + height: attachment1.metadata.height, + caption: attachment2.caption, + description: attachment2.description, + frameCount: attachment1.metadata.frameCount, + frameRate: attachment1.metadata.frameRate, + framesPerRow: attachment1.metadata.framesPerRow, + framesPerCol: attachment1.metadata.framesPerCol, + stickerID: attachment1.metadata.stickerID.toString(), + spriteURI: attachment1.metadata.spriteURI, + spriteURI2x: attachment1.metadata.spriteURI2x + } + case "file": + return { + type: "file", + ID: attachment2.id.toString(), + fullFileName, + filename: attachment1.name, + fileSize, + original_extension: getExtension(attachment1.original_extension, fullFileName), + mimeType, + url: attachment1.url, + isMalicious: attachment2.is_malicious, + contentType: attachment2.mime_type, + name: attachment1.name + } + case "photo": + return { + type: "photo", + ID: attachment1.metadata.fbid.toString(), + filename: attachment1.fileName, + fullFileName, + fileSize, + original_extension: getExtension(attachment1.original_extension, fullFileName), + mimeType, + thumbnailUrl: attachment1.thumbnail_url, + previewUrl: attachment1.preview_url, + previewWidth: attachment1.preview_width, + previewHeight: attachment1.preview_height, + largePreviewUrl: attachment1.large_preview_url, + largePreviewWidth: attachment1.large_preview_width, + largePreviewHeight: attachment1.large_preview_height, + url: attachment1.metadata.url, + width: attachment1.metadata.dimensions.split(",")[0], + height: attachment1.metadata.dimensions.split(",")[1], + name: fullFileName + } + case "animated_image": + return { + type: "animated_image", + ID: attachment2.id.toString(), + filename: attachment2.filename, + fullFileName: fullFileName, + original_extension: getExtension(attachment2.original_extension, fullFileName), + mimeType, + previewUrl: attachment1.preview_url, + previewWidth: attachment1.preview_width, + previewHeight: attachment1.preview_height, + url: attachment2.image_data.url, + width: attachment2.image_data.width, + height: attachment2.image_data.height, + name: attachment1.name, + facebookUrl: attachment1.url, + thumbnailUrl: attachment1.thumbnail_url, + rawGifImage: attachment2.image_data.raw_gif_image, + rawWebpImage: attachment2.image_data.raw_webp_image, + animatedGifUrl: attachment2.image_data.animated_gif_url, + animatedGifPreviewUrl: attachment2.image_data.animated_gif_preview_url, + animatedWebpUrl: attachment2.image_data.animated_webp_url, + animatedWebpPreviewUrl: attachment2.image_data.animated_webp_preview_url + } + case "share": + return { + type: "share", + ID: attachment1.share.share_id.toString(), + url: attachment2.href, + title: attachment1.share.title, + description: attachment1.share.description, + source: attachment1.share.source, + image: attachment1.share.media.image, + width: attachment1.share.media.image_size.width, + height: attachment1.share.media.image_size.height, + playable: attachment1.share.media.playable, + duration: attachment1.share.media.duration, + subattachments: attachment1.share.subattachments, + properties: {}, + animatedImageSize: attachment1.share.media.animated_image_size, + facebookUrl: attachment1.share.uri, + target: attachment1.share.target, + styleList: attachment1.share.style_list + } + case "video": + return { + type: "video", + ID: attachment1.metadata.fbid.toString(), + filename: attachment1.name, + fullFileName: fullFileName, + original_extension: getExtension(attachment1.original_extension, fullFileName), + mimeType, + duration: durationVideo, + previewUrl: attachment1.preview_url, + previewWidth: attachment1.preview_width, + previewHeight: attachment1.preview_height, + url: attachment1.url, + width: attachment1.metadata.dimensions.width, + height: attachment1.metadata.dimensions.height, + videoType: "unknown", + thumbnailUrl: attachment1.thumbnail_url + } + case "error": + return { + type: "error", + attachment1: attachment1, + attachment2: attachment2 + } + case "MessageImage": + return { + type: "photo", + ID: blob.legacy_attachment_id, + filename: blob.filename, + fullFileName, + fileSize, + original_extension: getExtension(blob.original_extension, fullFileName), + mimeType, + thumbnailUrl: blob.thumbnail.uri, + previewUrl: blob.preview.uri, + previewWidth: blob.preview.width, + previewHeight: blob.preview.height, + largePreviewUrl: blob.large_preview.uri, + largePreviewWidth: blob.large_preview.width, + largePreviewHeight: blob.large_preview.height, + url: blob.large_preview.uri, + width: blob.original_dimensions.x, + height: blob.original_dimensions.y, + name: blob.filename + } + case "MessageAnimatedImage": + return { + type: "animated_image", + ID: blob.legacy_attachment_id, + filename: blob.filename, + fullFileName, + original_extension: getExtension(blob.original_extension, fullFileName), + mimeType, + previewUrl: blob.preview_image.uri, + previewWidth: blob.preview_image.width, + previewHeight: blob.preview_image.height, + url: blob.animated_image.uri, + width: blob.animated_image.width, + height: blob.animated_image.height, + thumbnailUrl: blob.preview_image.uri, + name: blob.filename, + facebookUrl: blob.animated_image.uri, + rawGifImage: blob.animated_image.uri, + animatedGifUrl: blob.animated_image.uri, + animatedGifPreviewUrl: blob.preview_image.uri, + animatedWebpUrl: blob.animated_image.uri, + animatedWebpPreviewUrl: blob.preview_image.uri + } + case "MessageVideo": + return { + type: "video", + ID: blob.legacy_attachment_id, + filename: blob.filename, + fullFileName, + original_extension: getExtension(blob.original_extension, fullFileName), + fileSize: fileSize, + duration: durationVideo, + mimeType, + previewUrl: blob.large_image.uri, + previewWidth: blob.large_image.width, + previewHeight: blob.large_image.height, + url: blob.playable_url, + width: blob.original_dimensions.x, + height: blob.original_dimensions.y, + videoType: blob.video_type.toLowerCase(), + thumbnailUrl: blob.large_image.uri + } + case "MessageAudio": + return { + type: "audio", + ID: blob.url_shimhash, + filename: blob.filename, + fullFileName, + fileSize, + duration: durationAudio, + original_extension: getExtension(blob.original_extension, fullFileName), + mimeType, + audioType: blob.audio_type, + url: blob.playable_url, + isVoiceMail: blob.is_voicemail + } + case "StickerAttachment": + case "Sticker": + return { + type: "sticker", + ID: blob.id, + url: blob.url, + packID: blob.pack ? blob.pack.id : null, + spriteUrl: blob.sprite_image, + spriteUrl2x: blob.sprite_image_2x, + width: blob.width, + height: blob.height, + caption: blob.label, + description: blob.label, + frameCount: blob.frame_count, + frameRate: blob.frame_rate, + framesPerRow: blob.frames_per_row, + framesPerCol: blob.frames_per_column, + stickerID: blob.id, + spriteURI: blob.sprite_image, + spriteURI2x: blob.sprite_image_2x + } + case "MessageLocation": + var urlAttach = blob.story_attachment.url; + var mediaAttach = blob.story_attachment.media; + var u = querystring.parse(url.parse(urlAttach).query).u; + var where1 = querystring.parse(url.parse(u).query).where1; + var address = where1.split(", "); + var latitude; + var longitude; + + try { + latitude = Number.parseFloat(address[0]); + longitude = Number.parseFloat(address[1]); + } finally { } + + var imageUrl; + var width; + var height; + if (mediaAttach && mediaAttach.image) { + imageUrl = mediaAttach.image.uri; + width = mediaAttach.image.width; + height = mediaAttach.image.height; + } + + return { + type: "location", + ID: blob.legacy_attachment_id, + latitude, + longitude, + image: imageUrl, + width, + height, + url: u || urlAttach, + address: where1, + facebookUrl: blob.story_attachment.url, + target: blob.story_attachment.target, + styleList: blob.story_attachment.style_list + } + case "ExtensibleAttachment": + return { + type: "share", + ID: blob.legacy_attachment_id, + url: blob.story_attachment.url, + title: blob.story_attachment.title_with_entities.text, + description: blob.story_attachment.description && blob.story_attachment.description.text, + source: blob.story_attachment.source ? blob.story_attachment.source.text : null, + image: blob.story_attachment.media && blob.story_attachment.media.image && blob.story_attachment.media.image.uri, + width: blob.story_attachment.media && blob.story_attachment.media.image && blob.story_attachment.media.image.width, + height: blob.story_attachment.media && blob.story_attachment.media.image && blob.story_attachment.media.image.height, + playable: blob.story_attachment.media && blob.story_attachment.media.is_playable, + duration: blob.story_attachment.media && blob.story_attachment.media.playable_duration_in_ms, + playableUrl: !blob.story_attachment.media ? null : blob.story_attachment.media.playable_url, + subattachments: blob.story_attachment.subattachments, + properties: blob.story_attachment.properties.reduce(function (obj, cur) { + obj[cur.key] = cur.value.text; + return obj; + }, {}), + facebookUrl: blob.story_attachment.url, + target: blob.story_attachment.target, + styleList: blob.story_attachment.style_list + } + case "MessageFile": + return { + type: "file", + ID: blob.message_file_fbid, + fullFileName, + filename: blob.filename, + fileSize, + mimeType: blob.mimetype, + original_extension: blob.original_extension || fullFileName.split(".").pop(), + url: blob.url, + isMalicious: blob.is_malicious, + contentType: blob.content_type, + name: blob.filename + } + default: + throw new Error("unrecognized attach_file of type " + type + "`" + JSON.stringify(attachment1, null, 4) + " attachment2: " + JSON.stringify(attachment2, null, 4) + "`"); + } + } + + if (deltails.class === "NewMessage") { + function formatMessage() { + var md = deltails.messageMetadata; + var mdata = !deltails.data ? [] : !deltails.data.prng ? [] : JSON.parse(deltails.data.prng); + var m_id = mdata.map(u => u.i); + var m_offset = mdata.map(u => u.o); + var m_length = mdata.map(u => u.l); + var mentions = {}; + for (var i = 0; i < m_id.length; i++) + mentions[m_id[i]] = deltails.body.substring(m_offset[i], m_offset[i] + m_length[i]); + + return { + type: "message", + senderID: utils.formatID(md.actorFbId.toString()), + body: deltails.body || "", + threadID: utils.formatID((md.threadKey.threadFbId || md.threadKey.otherUserFbId).toString()), + messageID: md.messageId, + attachments: (deltails.attachments || []).map(v => formatAttachment(v)), + mentions, + timestamp: md.timestamp, + isGroup: !!md.threadKey.threadFbId, + participantIDs: deltails.participants || [] + } + } + + (function resolveAttachmentUrl(i) { + if (i === (deltails.attachments || []).length) { + try { + var message = formatMessage(); + (message.senderID !== ctx.userID || ctx.globalOptions.listenSelf) ? globalCallback(null, message) : null; + if (ctx.globalOptions.autoMarkDelivery) + markDelivery(apis, message.threadID, message.messageID); + } catch (error) { + error = { + error: "Problem parsing message object. Please open an issue at https://github.com/GiaKhang1810/mira-bot-v1/issues.", + detail: error, + response: deltails, + type: "parse_error" + } + globalCallback(error); + } + } else { + if (deltails.attachments[i].mercury.attach_type === "photo") { + apis.resolvePhotoUrl(deltails.attachments[i].fbid, (e, u) => e ? deltails.attachments[i].mercury.metadata.url = u : null, resolveAttachmentUrl(i + 1)); + } else { + return resolveAttachmentUrl(i + 1); + } + } + })(0); + } + + if (deltails.class === "ClientPayload") { + var ClientPayload = JSON.parse(String.fromCharCode.apply(null, deltails.payload)); + if (ClientPayload && ClientPayload.deltas) { + for (var i in ClientPayload.deltas) { + var delta = ClientPayload.deltas[i]; + + if (delta.deltaMessageReaction && ctx.globalOptions.listenEvents) { + var reaction = { + type: "message_reaction", + threadID: (delta.deltaMessageReaction.threadKey.threadFbId ? delta.deltaMessageReaction.threadKey.threadFbId : delta.deltaMessageReaction.threadKey.otherUserFbId).toString(), + messageID: delta.deltaMessageReaction.messageId, + reaction: delta.deltaMessageReaction.reaction, + senderID: delta.deltaMessageReaction.senderId.toString(), + userID: (delta.deltaMessageReaction.userId || delta.deltaMessageReaction.senderId).toString() + } + globalCallback(null, reaction); + } else if (delta.deltaRecallMessageData && ctx.globalOptions.listenEvents) { + var unsend = { + type: "message_unsend", + threadID: (delta.deltaRecallMessageData.threadKey.threadFbId ? delta.deltaRecallMessageData.threadKey.threadFbId : delta.deltaRecallMessageData.threadKey.otherUserFbId).toString(), + messageID: delta.deltaRecallMessageData.messageID, + senderID: delta.deltaRecallMessageData.senderID.toString(), + deletionTimestamp: delta.deltaRecallMessageData.deletionTimestamp, + timestamp: delta.deltaRecallMessageData.timestamp + } + globalCallback(null, unsend); + } else if (delta.deltaRemoveMessage && ctx.globalOptions.listenEvents) { + var del = { + type: "message_self_delete", + threadID: (delta.deltaRemoveMessage.threadKey.threadFbId ? delta.deltaRemoveMessage.threadKey.threadFbId : delta.deltaRemoveMessage.threadKey.otherUserFbId).toString(), + messageID: delta.deltaRemoveMessage.messageIds.length === 1 ? delta.deltaRemoveMessage.messageIds[0] : delta.deltaRemoveMessage.messageIds, + senderID: ctx.userID, + deletionTimestamp: delta.deltaRemoveMessage.deletionTimestamp, + timestamp: delta.deltaRemoveMessage.timestamp + } + globalCallback(null, del); + } else if (delta.deltaMessageReply) { + var mdata = !delta.deltaMessageReply.message ? [] : !delta.deltaMessageReply.message.data ? [] : !delta.deltaMessageReply.message.data.prng ? [] : JSON.parse(delta.deltaMessageReply.message.data.prng); + var m_id = mdata.map(u => u.i); + var m_offset = mdata.map(u => u.o); + var m_length = mdata.map(u => u.l); + var mentions = {} + + for (var i = 0; i < m_id.length; i++) + mentions[m_id[i]] = (delta.deltaMessageReply.message.body || "").substring(m_offset[i], m_offset[i] + m_length[i]); + + var callbackToReturn = { + type: "message_reply", + threadID: (delta.deltaMessageReply.message.messageMetadata.threadKey.threadFbId ? delta.deltaMessageReply.message.messageMetadata.threadKey.threadFbId : delta.deltaMessageReply.message.messageMetadata.threadKey.otherUserFbId).toString(), + messageID: delta.deltaMessageReply.message.messageMetadata.messageId, + senderID: delta.deltaMessageReply.message.messageMetadata.actorFbId.toString(), + attachments: (delta.deltaMessageReply.message.attachments || []).map(att => { + var mercury = JSON.parse(att.mercuryJSON); + Object.assign(att, mercury); + return att; + }).map(att => { + var x; + try { + x = formatAttachment(att); + } catch (ex) { + x = att; + x.error = ex; + x.type = "unknown"; + } + return x; + }), + body: delta.deltaMessageReply.message.body || "", + isGroup: !!delta.deltaMessageReply.message.messageMetadata.threadKey.threadFbId, + mentions, + timestamp: delta.deltaMessageReply.message.messageMetadata.timestamp, + participantIDs: (delta.deltaMessageReply.message.messageMetadata.cid.canonicalParticipantFbids || delta.deltaMessageReply.message.participants || []).map(e => e.toString()) + } + + if (delta.deltaMessageReply.repliedToMessage) { + mdata = !delta.deltaMessageReply.repliedToMessage ? [] : !delta.deltaMessageReply.repliedToMessage.data ? [] : !delta.deltaMessageReply.repliedToMessage.data.prng ? [] : JSON.parse(delta.deltaMessageReply.repliedToMessage.data.prng); + m_id = mdata.map(u => u.i); + m_offset = mdata.map(u => u.o); + m_length = mdata.map(u => u.l); + var rmentions = {} + + for (var i = 0; i < m_id.length; i++) + rmentions[m_id[i]] = (delta.deltaMessageReply.repliedToMessage.body || "").substring(m_offset[i], m_offset[i] + m_length[i]); + + callbackToReturn.messageReply = { + threadID: (delta.deltaMessageReply.repliedToMessage.messageMetadata.threadKey.threadFbId ? delta.deltaMessageReply.repliedToMessage.messageMetadata.threadKey.threadFbId : delta.deltaMessageReply.repliedToMessage.messageMetadata.threadKey.otherUserFbId).toString(), + messageID: delta.deltaMessageReply.repliedToMessage.messageMetadata.messageId, + senderID: delta.deltaMessageReply.repliedToMessage.messageMetadata.actorFbId.toString(), + attachments: delta.deltaMessageReply.repliedToMessage.attachments.map(att => { + var mercury = JSON.parse(att.mercuryJSON); + Object.assign(att, mercury); + return att; + }).map(att => { + var x; + try { + x = formatAttachment(att); + } catch (ex) { + x = att; + x.error = ex; + x.type = "unknown"; + } + return x; + }), + body: delta.deltaMessageReply.repliedToMessage.body || "", + isGroup: !!delta.deltaMessageReply.repliedToMessage.messageMetadata.threadKey.threadFbId, + mentions: rmentions, + timestamp: delta.deltaMessageReply.repliedToMessage.messageMetadata.timestamp + }; + } else if (delta.deltaMessageReply.replyToMessageId) { + return http + .post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, { + queries: JSON.stringify({ + o0: { + doc_id: "2848441488556444", + query_params: { + thread_and_message_id: { + thread_id: callbackToReturn.threadID, + message_id: delta.deltaMessageReply.replyToMessageId.id + } + } + } + }) + }) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(resData => { + if (resData[resData.length - 1].error_results > 0) + throw resData[0].o0.errors; + + + if (resData[resData.length - 1].successful_results === 0) + throw { error: "forcedFetch: there was no successful_results", response: resData }; + + var fetchData = resData[0].o0.data.message; + var mobj = {} + for (var n in fetchData.message.ranges) + mobj[fetchData.message.ranges[n].entity.id] = (fetchData.message.text || "").substr(fetchData.message.ranges[n].offset, fetchData.message.ranges[n].length); + + + callbackToReturn.messageReply = { + threadID: callbackToReturn.threadID, + messageID: fetchData.message_id, + senderID: fetchData.message_sender.id.toString(), + attachments: fetchData.message.blob_attachment.map(att => { + var x; + try { + x = formatAttachment({ blob_attachment: att }); + } catch (ex) { + x = att; + x.error = ex; + x.type = "unknown"; + } + return x; + }), + body: fetchData.message.text || "", + isGroup: callbackToReturn.isGroup, + mentions: mobj, + timestamp: parseInt(fetchData.timestamp_precise) + }; + }) + .catch(console.log) + .finally(function () { + if (ctx.globalOptions.autoMarkDelivery) + markDelivery(apis, callbackToReturn.threadID, callbackToReturn.messageID); + + (callbackToReturn.senderID !== ctx.userID || ctx.globalOptions.listenSelf) ? globalCallback(null, callbackToReturn) : null; + }); + } else + callbackToReturn.delta = delta; + + if (ctx.globalOptions.autoMarkDelivery) + markDelivery(apis, callbackToReturn.threadID, callbackToReturn.messageID); + + return (callbackToReturn.senderID !== ctx.userID || ctx.globalOptions.listenSelf) ? globalCallback(null, callbackToReturn) : null; + } + } + return; + } + } + + if (deltails.class !== "NewMessage" && !ctx.globalOptions.listenEvents) + return; + + function getAdminTextMessageType(type) { + switch (type) { + case 'unpin_messages_v2': + return 'log:unpin-message'; + case 'pin_messages_v2': + return 'log:pin-message'; + case "change_thread_theme": + return "log:thread-color"; + case "change_thread_icon": + return "log:thread-icon"; + case "change_thread_nickname": + return "log:user-nickname"; + case "change_thread_admins": + return "log:thread-admins"; + case "group_poll": + return "log:thread-poll"; + case "change_thread_approval_mode": + return "log:thread-approval-mode"; + case "messenger_call_log": + case "participant_joined_group_call": + return "log:thread-call"; + default: + return type; + } + } + function formatDeltaEvent() { + var logMessageType; + var logMessageData; + switch (deltails.class) { + case "AdminTextMessage": + logMessageData = deltails.untypedData; + logMessageType = getAdminTextMessageType(deltails.type); + break; + case "ThreadName": + logMessageType = "log:thread-name"; + logMessageData = { name: deltails.name }; + break; + case "ParticipantsAddedToGroupThread": + logMessageType = "log:subscribe"; + logMessageData = { addedParticipants: deltails.addedParticipants }; + break; + case "ParticipantLeftGroupThread": + logMessageType = "log:unsubscribe"; + logMessageData = { leftParticipantFbId: deltails.leftParticipantFbId }; + break; + case "ApprovalQueue": + logMessageType = "log:approval-queue"; + logMessageData = { + approvalQueue: { + action: deltails.action, + recipientFbId: deltails.recipientFbId, + requestSource: deltails.requestSource, + ...deltails.messageMetadata + } + } + } + + return { + type: "event", + threadID: utils.formatID((deltails.messageMetadata.threadKey.threadFbId || deltails.messageMetadata.threadKey.otherUserFbId).toString()), + messageID: deltails.messageMetadata.messageId.toString(), + logMessageType: logMessageType, + logMessageData: logMessageData, + logMessageBody: deltails.messageMetadata.adminText, + timestamp: deltails.messageMetadata.timestamp, + author: deltails.messageMetadata.actorFbId, + participantIDs: deltails.participants + } + } + + function getAdminTextMessageType(type) { + switch (type) { + case 'unpin_messages_v2': + return 'log:unpin-message'; + case 'pin_messages_v2': + return 'log:pin-message'; + case "change_thread_theme": + return "log:thread-color"; + case "change_thread_icon": + return "log:thread-icon"; + case "change_thread_nickname": + return "log:user-nickname"; + case "change_thread_admins": + return "log:thread-admins"; + case "group_poll": + return "log:thread-poll"; + case "change_thread_approval_mode": + return "log:thread-approval-mode"; + case "messenger_call_log": + case "participant_joined_group_call": + return "log:thread-call"; + default: + return type; + } + } + function formatDeltaEvent() { + var logMessageType; + var logMessageData; + switch (deltails.class) { + case "AdminTextMessage": + logMessageData = deltails.untypedData; + logMessageType = getAdminTextMessageType(deltails.type); + break; + case "ThreadName": + logMessageType = "log:thread-name"; + logMessageData = { name: deltails.name }; + break; + case "ParticipantsAddedToGroupThread": + logMessageType = "log:subscribe"; + logMessageData = { addedParticipants: deltails.addedParticipants }; + break; + case "ParticipantLeftGroupThread": + logMessageType = "log:unsubscribe"; + logMessageData = { leftParticipantFbId: deltails.leftParticipantFbId }; + break; + case "ApprovalQueue": + logMessageType = "log:approval-queue"; + logMessageData = { + approvalQueue: { + action: deltails.action, + recipientFbId: deltails.recipientFbId, + requestSource: deltails.requestSource, + ...deltails.messageMetadata + } + } + } + + return { + type: "event", + threadID: utils.formatID((deltails.messageMetadata.threadKey.threadFbId || deltails.messageMetadata.threadKey.otherUserFbId).toString()), + messageID: deltails.messageMetadata.messageId.toString(), + logMessageType: logMessageType, + logMessageData: logMessageData, + logMessageBody: deltails.messageMetadata.adminText, + timestamp: deltails.messageMetadata.timestamp, + author: deltails.messageMetadata.actorFbId, + participantIDs: deltails.participants + } + } + switch (deltails.class) { + case "ReadReceipt": + try { + var readReceipt = { + reader: (deltails.threadKey.otherUserFbId || deltails.actorFbId).toString(), + time: deltails.actionTimestampMs, + threadID: utils.formatID((deltails.threadKey.otherUserFbId || deltails.threadKey.threadFbId).toString()), + type: "read_receipt" + } + globalCallback(null, readReceipt); + } catch (error) { + error = { + error: "Problem parsing message object. Please open an issue at https://github.com/GiaKhang1810/mira-bot-v1/issues.", + detail: error, + response: deltails, + type: "parse_error" + } + globalCallback(error); + } + break; + case "AdminTextMessage": + switch (deltails.type) { + case "change_thread_theme": + case "change_thread_nickname": + case "change_thread_icon": + case "change_thread_quick_reaction": + case "change_thread_admins": + case "group_poll": + case "joinable_group_link_mode_change": + case "magic_words": + case "change_thread_approval_mode": + case "messenger_call_log": + case "participant_joined_group_call": + try { + var detailsEvent = formatDeltaEvent(); + globalCallback(null, detailsEvent); + } catch (error) { + error = { + error: "Problem parsing message object. Please open an issue at https://github.com/GiaKhang1810/mira-bot-v1/issues.", + detail: error, + response: deltails, + type: "parse_error" + } + } + break; + default: + break; + } + break; + case "ForcedFetch": + if (!deltails.threadKey) + return; + var mid = deltails.messageId; + var tid = deltails.threadKey.threadFbId; + if (mid && tid) { + var form = { + queries: JSON.stringify({ + o0: { + doc_id: "2848441488556444", + query_params: { + thread_and_message_id: { + thread_id: tid.toString(), + message_id: mid + } + } + } + }) + } + + http + .post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(resData => { + if (resData[resData.length - 1].error_results > 0) + throw resData[0].o0.errors; + if (resData[resData.length - 1].successful_results === 0) + throw { error: "forcedFetch: there was no successful_results", response: resData } + + var fetchData = resData[0].o0.data.message; + if (utils.getType(fetchData) !== "Object") + return; + + switch (fetchData.__typename) { + case "ThreadImageMessage": + (fetchData.message_sender.id.toString() !== ctx.userID || ctx.globalOptions.listenEventsSelf) ? globalCallback(null, { + type: "event", + threadID: utils.formatID(tid.toString()), + messageID: fetchData.message_id, + logMessageType: "log:thread-image", + logMessageData: { + attachmentID: fetchData.image_with_metadata && fetchData.image_with_metadata.legacy_attachment_id, + width: fetchData.image_with_metadata && fetchData.image_with_metadata.original_dimensions.x, + height: fetchData.image_with_metadata && fetchData.image_with_metadata.original_dimensions.y, + url: fetchData.image_with_metadata && fetchData.image_with_metadata.preview.uri + }, + logMessageBody: fetchData.snippet, + timestamp: fetchData.timestamp_precise, + author: fetchData.message_sender.id + }) : null; + break; + case "UserMessage": + globalCallback(null, { + type: "message", + senderID: utils.formatID(fetchData.message_sender.id), + body: fetchData.message.text || "", + threadID: utils.formatID(tid.toString()), + messageID: fetchData.message_id, + attachments: [{ + type: "share", + ID: fetchData.extensible_attachment.legacy_attachment_id, + url: fetchData.extensible_attachment.story_attachment.url, + + title: fetchData.extensible_attachment.story_attachment.title_with_entities.text, + description: fetchData.extensible_attachment.story_attachment.description.text, + source: fetchData.extensible_attachment.story_attachment.source, + + image: ((fetchData.extensible_attachment.story_attachment.media || {}).image || {}).uri, + width: ((fetchData.extensible_attachment.story_attachment.media || {}).image || {}).width, + height: ((fetchData.extensible_attachment.story_attachment.media || {}).image || {}).height, + playable: (fetchData.extensible_attachment.story_attachment.media || {}).is_playable || false, + duration: (fetchData.extensible_attachment.story_attachment.media || {}).playable_duration_in_ms || 0, + + subattachments: fetchData.extensible_attachment.subattachments, + properties: fetchData.extensible_attachment.story_attachment.properties + }], + mentions: {}, + timestamp: parseInt(fetchData.timestamp_precise), + participantIDs: (fetchData.participants || (fetchData.messageMetadata ? fetchData.messageMetadata.cid ? fetchData.messageMetadata.cid.canonicalParticipantFbids : fetchData.messageMetadata.participantIds : []) || []), + isGroup: (fetchData.message_sender.id != tid.toString()) + }); + break; + } + }) + .catch(console.log); + } + break; + case "ThreadName": + case "ParticipantsAddedToGroupThread": + case "ParticipantLeftGroupThread": + case "ApprovalQueue": + try { + var detailsEvent = formatDeltaEvent(); + globalCallback(null, detailsEvent); + } catch (error) { + error = { + error: "Problem parsing message object. Please open an issue at https://github.com/ntkhang03/fb-chat-api/issues.", + detail: error, + response: deltails, + type: "parse_error" + } + globalCallback(error); + } + break; + } +} + +function connectClientWs(http, apis, ctx, globalCallback) { + var chatOn = ctx.globalOptions.online; + var foreground = false; + var sessionID = Math.floor(Math.random() * 9007199254740991) + 1; + var username = JSON.stringify({ + u: ctx.userID, + s: sessionID, + chat_on: chatOn, + fg: foreground, + d: utils.getGUID(), + ct: "websocket", + aid: "219994525426954", + mqtt_sid: "", + cp: 3, + ecp: 10, + st: [], + pm: [], + dc: "", + no_auto_fg: true, + gas: null, + pack: [], + a: "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Kbody, like Gecko) Chrome/127.0.0.0 Safari/537.36", + aids: null + }); + var host = ctx.endpoint ? ctx.endpoint + "&sid=" + sessionID : ctx.region ? "wss://edge-chat.facebook.com/chat?region=" + ctx.region.toLocaleLowerCase() + "&sid=" + sessionID : "wss://edge-chat.facebook.com/chat?sid=" + sessionID; + var options = { + clientId: "mqttwsclient", + protocolId: "MQIsdp", + protocolVersion: 3, + username, + clean: true, + wsOptions: { + headers: { + "Cookie": ctx.jar.getCookies("https://www.facebook.com").join("; "), + "Origin": "https://www.facebook.com", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Kbody, like Gecko) Chrome/127.0.0.0 Safari/537.36", + "Referer": "https://www.facebook.com/", + "Host": new URL(host).hostname + }, + origin: "https://www.facebook.com", + protocolVersion: 13 + }, + keepalive: 10, + reschedulePings: true + } + + if (ctx.proxy) { + var agent = new HttpsProxyAgent(ctx.globalOptions.proxy); + options.wsOptions.agent = agent; + } + + ctx.Client = new mqtt.Client(_ => websocket(host, options.wsOptions), options); + var Client = ctx.Client; + Client + .on("error", function (error) { + if (error.message === "Invalid header flag bits, must be 0x0 for puback packet") + return; + if (ctx.Client) + ctx.Client.end(false, _ => ctx.Client = null); + if (ctx.globalOptions.autoReconnect) { + return getSeqID(http, apis, ctx, globalCallback); + } + error = { + type: "disconnect", + message: "Connection refused: Server unavailable", + error + } + globalCallback(error); + }) + .on("close", _ => { }) + .on("connect", function () { + topics.map(topic => Client.subscribe(topic)); + + var topic; + var queue = { + sync_api_version: 10, + max_deltas_able_to_process: 1000, + delta_batch_size: 500, + encoding: "JSON", + entity_fbid: ctx.userID + } + + if (ctx.syncToken) { + topic = "/messenger_sync_get_diffs"; + queue.last_seq_id = ctx.lastSeqID; + queue.sync_token = ctx.syncToken; + } else { + topic = "/messenger_sync_create_queue"; + queue.initial_titan_sequence_id = ctx.lastSeqID; + queue.device_params = null; + } + + Client.publish(topic, JSON.stringify(queue), { qos: 1, retain: false }); + Client.publish("/foreground_state", JSON.stringify({ foreground: chatOn }), { qos: 1 }); + Client.publish("/set_client_settings", JSON.stringify({ make_user_available_when_in_foreground: true }), { qos: 1 }); + ctx.listenNotif ? notificationConnect(ctx) : null; + }) + .on("message", function (topic, message) { + var Message = JSON.parse(Buffer.from(message).toString()); + if (Message.type === "jewel_requests_add") { + globalCallback(null, { + type: "friend_request_received", + actorFbId: Message.frodeltails.toString(), + timestamp: Date.now().toString() + }); + } + else if (Message.type === "jewel_requests_remove_old") { + globalCallback(null, { + type: "friend_request_cancel", + actorFbId: Message.frodeltails.toString(), + timestamp: Date.now().toString() + }); + } + else if (topic === "/t_ms") { + if (Message.firstDeltaSeqId && Message.syncToken) { + ctx.lastSeqID = Message.firstDeltaSeqId; + ctx.syncToken = Message.syncToken; + } + + if (Message.lastIssuedSeqId) { + ctx.lastSeqID = parseInt(Message.lastIssuedSeqId); + } + + for (var i in Message.deltas) { + var deltails = Message.deltas[i]; + parseAndReCallback(http, apis, ctx, globalCallback, deltails); + } + } else if (topic === "/thread_typing" || topic === "/orca_typing_notifications") { + var typ = { + type: "typ", + isTyping: !!Message.state, + from: Message.sender_fbid.toString(), + threadID: utils.formatID((Message.thread || Message.sender_fbid).toString()) + }; + globalCallback(null, typ); + } else if (topic === "/orca_presence") { + if (!ctx.globalOptions.updatePresence) { + for (var i in Message.list) { + var data = Message.list[i]; + var userID = data["u"]; + + var presence = { + type: "presence", + userID: userID.toString(), + timestamp: data["l"] * 1000, + statuses: data["p"] + } + globalCallback(null, presence); + } + } + } else if (Message.type === "notifications_seen") { + var notif = { + type: "notification", + alertIDs: Message.alert_ids, + graphQLIDs: Message.graphql_ids, + notiGraphQLIDs: Message.notif_graphql_ids, + timestamp: Date.now().toString() + } + globalCallback(null, notif); + } else { + console.log(topic, Message); + } + }); +} + +function getSeqID(http, apis, ctx, globalCallback) { + var headers = { + "User-Agent": "Mozilla/5.0 (Macintosh; Intel Mac OS X 10_10_2) AppleWebKit/600.3.18 (KHTML, like Gecko) Version/8.0.3 Safari/600.3.18" + } + utils + .get("https://www.facebook.com/", ctx.jar, null, null, headers) + .then(function (res) { + var reg = /]+>/; + var redirect = reg.exec(res.body); + if (redirect && redirect[1]) { + delete headers.noRef; + return utils + .get(redirect[1], ctx.jar, null, null, headers); + } + + return res; + }) + .then(function (res) { + var seqRegex = /irisSeqID:"(\d+)"/.exec(res.body); + if (seqRegex && seqRegex[1]) { + ctx.lastSeqID = seqRegex[1]; + connectClientWs(http, apis, ctx, globalCallback); + } else { + var error = new Error("seqID is undefined."); + error.type = "logout."; + throw error; + } + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + console.log(error); + return globalCallback(error); + }); +} + +module.exports = function (http, apis, ctx) { + var globalCallback; + return class Client extends EventEmitter { + constructor() { + super(); + + globalCallback = (error, message) => error ? this.emit("error", error) : this.emit("message", message); + getSeqID(http, apis, ctx, globalCallback); + return this; + } + + disconnect() { + globalCallback = () => { } + if (ctx.Client) + ctx.Client.end(false, _ => ctx.Client = null); + } + } +} \ No newline at end of file diff --git a/source/apis/lib/Messenger.js b/source/apis/lib/Messenger.js new file mode 100644 index 0000000000000000000000000000000000000000..9f5e09a441d1cac8a7894b91442741bb2d8b0899 --- /dev/null +++ b/source/apis/lib/Messenger.js @@ -0,0 +1,464 @@ +/* + Origin Source: https://github.com/ntkhang03/Goat-Bot-V2/blob/main/fb-chat-api/ + Converter: Khang +*/ + +var utils = require("../utils"); +var allowedProperties = { + attachments: true, + url: true, + sticker: true, + emoji: true, + emojiSize: true, + body: true, + mentions: true, + location: true +} + +function removeSpecialChar(inputString) { + if (typeof inputString !== "string") + return inputString; + var buffer = Buffer.from(inputString, "utf8"); + let filteredBuffer = Buffer.alloc(0); + for (let i = 0; i < buffer.length; i++) { + if (buffer[i] === 0xEF && buffer[i + 1] === 0xB8 && buffer[i + 2] === 0x8F) + i += 2; + else + filteredBuffer = Buffer.concat([filteredBuffer, buffer.slice(i, i + 1)]); + + } + + var convertedString = filteredBuffer.toString("utf8"); + return convertedString; +} + +module.exports = function (http, apis, ctx) { + function edit(message, messageID, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof message === "function") { + callback = message; + message = ""; + } + if (typeof messageID === "function") { + callback = messageID; + messageID = null; + } + if (typeof callback !== "function") + callback = pCallback; + if (typeof messageID !== "string") + callback(new Error("messageID must be an string")); + else if (!ctx.Client) + callback(new Error("You must connect mqtt first")); + else { + var queryPayload = { + message_id: messageID, + text: message + } + var query = { + failure_count: null, + label: "742", + payload: JSON.stringify(queryPayload), + queue_name: "edit_message", + task_id: Math.round(Math.random() * 312312721413).toString() + } + + var context = { + app_id: "2220391788200892", + payload: JSON.stringify({ + data_trace_id: null, + epoch_id: 0, + tasks: [query], + version_id: "6903494529735864" + }), + request_id: Math.round(Math.random() * 312312721413).toString(), + type: 3 + } + ctx.Client.publish("/ls_req", JSON.stringify(context), { qos: 1, retain: false }); + callback(); + } + + return returnPromise; + } + + function react(reaction, messageID, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof reaction === "function") { + callback = reaction; + reaction = ""; + } + if (typeof messageID === "function") { + callback = messageID; + messageID = null; + } + if (typeof callback !== "function") + callback = pCallback; + if (typeof messageID !== "string") + callback(new Error("messageID must be an string")); + else { + var variables = { + data: { + client_mutation_id: Math.round(Math.random() * 312312721413).toString(), + actor_id: ctx.userID, + action: reaction === "" ? "REMOVE_REACTION" : "ADD_REACTION", + message_id: messageID, + reaction + } + } + var qs = { + doc_id: "1491398900900362", + variables: JSON.stringify(variables), + dpr: 1 + } + + http + .postData("https://www.facebook.com/webgraphql/mutation/", ctx.jar, {}, qs) + .then(utils.parseAndCheckLogin(ctx.jar, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + } + + return returnPromise; + } + + function unsend(messageID, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof messageID === "function") { + callback = messageID; + messageID = null; + } + if (typeof callback !== "function") + callback = pCallback; + if (typeof messageID !== "string") + callback(new Error("messageID must be an string")); + else { + http + .post("https://www.facebook.com/messaging/unsend_message/", ctx.jar, { message_id: messageID }) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + } + + return returnPromise; + } + + function send(message, threadID, messageID, callback, isGroup) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof message === "function") { + callback = message; + message = null; + } + if (typeof threadID === "function") { + callback = threadID; + threadID = null; + } + if (typeof messageID === "function") { + callback = messageID; + messageID = null; + } + if (typeof callback !== "function") + callback = pCallback; + + var messageType = utils.getType(message); + var threadIDType = utils.getType(threadID); + var messageIDType = utils.getType(messageID); + + var error; + if (messageType !== "String" && messageType !== "Object") + error = new Error("Message should be of type string or object and not " + messageType + "."); + if (threadIDType !== "Array" && threadIDType !== "Number" && threadIDType !== "String") + error = new Error("ThreadID should be of type number, string, or array and not " + threadIDType + "."); + if (messageID && messageIDType !== "String") + error = new Error("MessageID should be of type string and not " + messageIDType + "."); + if (messageType === "String") + message = { + body: message + } + if (utils.getType(message.body) === "String") + message.body = removeSpecialChar(message.body); + + var disallowedProperties = Object.keys(message).filter(prop => !allowedProperties[prop]); + if (disallowedProperties.length > 0) + error = new Error("Dissallowed props: `" + disallowedProperties.join(", ") + "`"); + if (error) + callback(error); + else { + var messageAndOTID = utils.generateOfflineThreadingID(); + var form = { + client: "mercury", + action_type: "ma-type:user-generated-message", + author: "fbid:" + ctx.userID, + timestamp: Date.now(), + timestamp_absolute: "Today", + timestamp_relative: utils.generateTimestampRelative(), + timestamp_time_passed: "0", + is_unread: false, + is_cleared: false, + is_forward: false, + is_filtered_content: false, + is_filtered_content_bh: false, + is_filtered_content_account: false, + is_filtered_content_quasar: false, + is_filtered_content_invalid_app: false, + is_spoof_warning: false, + source: "source:chat:web", + "source_tags[0]": "source:chat", + body: message.body ? message.body.toString() : "", + html_body: false, + ui_push_phase: "V3", + status: "0", + offline_threading_id: messageAndOTID, + message_id: messageAndOTID, + threading_id: utils.generateThreadingID(ctx.clientID), + "ephemeral_ttl_mode:": "0", + manual_retry_cnt: "0", + has_attachment: !!(message.attachments || message.url || message.sticker), + signatureID: utils.getSignatureID(), + replied_to_message_id: messageID + } + handleLocation(message, form, threadID, messageAndOTID, callback, isGroup) + .then(handleSticker) + .then(handleAttachment) + .then(handleURL) + .then(handleEmoji) + .then(handleMention) + .then(function (input) { + if (utils.getType(input[2]) === "Array") + input[5] = false; + else { + if (utils.getType(input[5]) !== "Boolean") + input[5] = input[2].toString().length < 16; + else + input[5] = !input[5]; + } + + return input; + }) + .then(sendContent) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + } + + return returnPromise; + } + + function handleLocation(...input) { + if (input[0].location) { + if (input[0].location.latitude === null || input[0].location.longitude === null) + return Promise.reject(new Error("location property needs both latitude and longitude")); + + input[1]["location_attachment[coordinates][latitude]"] = input[0].location.latitude; + input[1]["location_attachment[coordinates][longitude]"] = input[0].location.longitude; + input[1]["location_attachment[is_current_location]"] = !!input[0].location.current; + } + return Promise.resolve(input); + } + + function handleEmoji(input) { + if (input[0].emojiSize !== null && input[0].emoji === null) + return Promise.reject(new Error("emoji property is empty")); + if (input[0].emoji) { + if (input[0].emojiSize == null) + input[0].emojiSize = "medium"; + if (input[0].emojiSize !== "small" && input[0].emojiSize !== "medium" && input[0].emojiSize !== "large") + return Promise.reject(new Error("emojiSize property is invalid")); + if (input[1].body !== null && input[1].body !== "") + return Promise.reject(new Error("body is not empty")); + input[1].body = input[0].emoji; + input[1]["tags[0]"] = "hot_emoji_size:" + input[0].emojiSize; + } + + return Promise.resolve(input); + } + + function handleSticker(input) { + if (input[0].sticker) + input[1].sticker_id = input[0].sticker; + return Promise.resolve(input); + } + + function handleAttachment(input) { + if (input[0].attachments) { + input[1].image_ids = []; + input[1].gif_ids = []; + input[1].file_ids = []; + input[1].video_ids = []; + input[1].audio_ids = []; + + input[0].attachments = Array.isArray(input[0].attachments) ? input[0].attachments : [input[0].attachments]; + + return handleUpload(input[0].attachments) + .then(function (files) { + files.forEach(function (file) { + var key = Object.keys(file); + var type = key[0]; + input[1][type + "s"].push(file[type]); + }); + return input; + }); + } + + return Promise.resolve(input); + } + + function handleUpload(attachments) { + var uploads = []; + + for (var i = 0; i < attachments.length; i++) { + if (!utils.isReadableStream(attachments[i])) + throw new Error("Attachment should be a readable stream and not " + utils.getType(attachments[i]) + "."); + + var form = { + upload_1024: attachments[i], + voice_clip: "true" + } + + uploads.push( + http + .postData("https://upload.facebook.com/ajax/mercury/upload.php", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + return res.payload.metadata[0]; + }) + ); + } + + return Promise.all(uploads); + } + + function handleURL(input) { + if (input[0].url) { + input[1]["shareable_attachment[share_type]"] = "100"; + + return getURL() + .then(function (params) { + input[1]["shareable_attachment[share_params]"] = params; + return input; + }); + } + + return Promise.resolve(input); + } + + function getURL(url) { + var form = { + image_height: 960, + image_width: 960, + uri: url + } + + return http + .post("https://www.facebook.com/message_share_attachment/fromURI/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors || !res.payload) + throw res; + + return res.payload.share_data.share_params; + }); + } + + function handleMention(input) { + if (input[0].mentions) { + for (var i = 0; i < input[0].mentions.length; i++) { + var mention = input[0].mentions[i]; + + var tag = mention.tag; + if (typeof tag !== "string") + return Promise.reject(new Error("Mention tags must be strings.")); + + var offset = input[0].body.indexOf(tag, mention.fromIndex || 0); + + var id = mention.id || 0; + input[1]["profile_xmd[" + i + "][offset]"] = offset; + input[1]["profile_xmd[" + i + "][length]"] = tag.length; + input[1]["profile_xmd[" + i + "][id]"] = id; + input[1]["profile_xmd[" + i + "][type]"] = "p"; + } + } + + return Promise.resolve(input); + } + + function sendContent(input) { + if (utils.getType(input[2]) === "Array") { + for (var i = 0; i < input[2].length; i++) + input[1]["specific_to_list[" + i + "]"] = "fbid:" + input[2][i]; + + input[1]["specific_to_list[" + input[2].length + "]"] = "fbid:" + ctx.userID; + input[1]["client_thread_id"] = "root:" + input[3]; + } else { + if (input[5]) { + input[1]["specific_to_list[0]"] = "fbid:" + input[2]; + input[1]["specific_to_list[1]"] = "fbid:" + ctx.userID; + input[1]["other_user_fbid"] = input[2]; + } else + input[1]["thread_fbid"] = input[2]; + } + + return http + .post("https://www.facebook.com/messaging/send/", ctx.jar, input[1]) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (!res || res.error || res.errors) + throw res + + var messageInfo = res.payload.actions.reduce(function (p, v) { + return { + threadID: v.thread_fbid || v.other_user_fbid, + messageID: v.message_id, + timestamp: v.timestamp + } + }, null); + + return input[4](null, messageInfo); + }); + } + + return { + send, + edit, + react, + unsend + } +} \ No newline at end of file diff --git a/source/apis/lib/changeAvatar.js b/source/apis/lib/changeAvatar.js new file mode 100644 index 0000000000000000000000000000000000000000..69032dd8c65586376a53af8e14ebfcced4c14bf2 --- /dev/null +++ b/source/apis/lib/changeAvatar.js @@ -0,0 +1,103 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + function handleUpload(image) { + var callback; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (!utils.isReadableStream(image)) + callback(new Error("image is not a readable stream")); + + var form = { + profile_id: ctx.userID, + photo_source: 57, + av: ctx.userID, + file: image + } + + http + .postData("https://www.facebook.com/profile/picture/upload/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(null, res); + }) + .catch(callback); + + return returnPromise; + } + + return function changeAvatar(image, caption = "", timestamp = null, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (typeof caption === "number") { + timestamp = caption; + caption = ""; + } + if (typeof caption === "function") { + callback = caption; + caption = ""; + } + if (typeof timestamp === "function") { + callback = timestamp; + timestamp = null; + } + if (typeof callback !== "function") + callback = pCallback; + + handleUpload(image) + .then(res => ({ + fb_api_req_friendly_name: "ProfileCometProfilePictureSetMutation", + doc_id: "5066134240065849", + variables: JSON.stringify({ + input: { + caption, + existing_photo_id: res.payload.fbid, + expiration_time: timestamp, + profile_id: ctx.userID, + profile_pic_method: "EXISTING", + profile_pic_source: "TIMELINE", + scaled_crop_rect: { + height: 1, + width: 1, + x: 0, + y: 0 + }, + skip_cropping: true, + actor_id: ctx.userID, + client_mutation_id: Math.round(Math.random() * 19).toString() + }, + isPage: false, + isProfile: true, + scale: 3 + }), + fb_api_caller_class: "RelayModern" + })) + .then(form => http.post("https://www.facebook.com/api/graphql", ctx.jar, form)) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(null, { + url: res.data.user_update_cover_photo.user.cover_photo.photo.url + }); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + console.log(error); + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/changeBio.js b/source/apis/lib/changeBio.js new file mode 100644 index 0000000000000000000000000000000000000000..69554687ce3e8270bd2088f9e583a45c596def52 --- /dev/null +++ b/source/apis/lib/changeBio.js @@ -0,0 +1,61 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function changeBio(bio, publish, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof bio === "function") { + callback = bio; + bio = ""; + } + if (typeof bio === "boolean") { + publish = bio; + bio = ""; + } + if (typeof publish === "function") { + callback = publish; + publish = false; + } + if (typeof publish !== "boolean") + publish = false; + if (typeof callback !== "function") + callback = pCallback; + + var form = { + fb_api_caller_class: "RelayModern", + fb_api_req_friendly_name: "ProfileCometSetBioMutation", + doc_id: "2725043627607610", + variables: JSON.stringify({ + input: { + bio, + publish_bio_feed_story: publish, + actor_id: ctx.userID, + client_mutation_id: Math.round(Math.random() * 1024).toString() + }, + hasProfileTileViewID: false, + profileTileViewID: null, + scale: 1 + }) + } + + http + .post("https://www.facebook.com/api/graphql/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/changeCover.js b/source/apis/lib/changeCover.js new file mode 100644 index 0000000000000000000000000000000000000000..5514df541a579dc499b59518e416d2ed2232c6f4 --- /dev/null +++ b/source/apis/lib/changeCover.js @@ -0,0 +1,84 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + function handleUpload(image) { + var callback; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (!utils.isReadableStream(image)) + callback(new Error("image is not a readable stream")); + + var form = { + profile_id: ctx.userID, + photo_source: 57, + av: ctx.userID, + file: image + } + + http + .postData("https://www.facebook.com/profile/picture/upload/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(null, res); + }) + .catch(callback); + + return returnPromise; + } + + return function changeCover(image, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (typeof callback !== "function") + callback = pCallback; + + handleUpload(image) + .then(res => ({ + fb_api_caller_class: "RelayModern", + fb_api_req_friendly_name: "ProfileCometCoverPhotoUpdateMutation", + variables: JSON.stringify({ + input: { + attribution_id_v2: `ProfileCometCollectionRoot.react,comet.profile.collection.photos_by,unexpected,${Date.now()},770083,,;ProfileCometCollectionRoot.react,comet.profile.collection.photos_albums,unexpected,${Date.now()},470774,,;ProfileCometCollectionRoot.react,comet.profile.collection.photos,unexpected,${Date.now()},94740,,;ProfileCometCollectionRoot.react,comet.profile.collection.saved_reels_on_profile,unexpected,${Date.now()},89669,,;ProfileCometCollectionRoot.react,comet.profile.collection.reels_tab,unexpected,${Date.now()},152201,,`, + cover_photo_id: res.payload.fbid, + focus: { + x: 0.5, + y: 1 + }, + target_user_id: ctx.userID, + actor_id: ctx.userID, + client_mutation_id: Math.round(Math.random() * 19).toString() + }, + scale: 1, + contextualProfileContext: null + }), + doc_id: "8247793861913071" + })) + .then(form => http.post("https://www.facebook.com/api/graphql", ctx.jar, form)) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(null, { + url: res.data.profile_picture_set + }); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + console.log(error); + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/getAccessToken.js b/source/apis/lib/getAccessToken.js new file mode 100644 index 0000000000000000000000000000000000000000..3c0dbda0b22ac06ba59bcf27c0380bc04d2ff98a --- /dev/null +++ b/source/apis/lib/getAccessToken.js @@ -0,0 +1,81 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function getAccessToken(callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, token) => error ? reject(error) : resolve(token); + }); + + if (typeof callback !== "function") + callback = pCallback; + + if (ctx.token) { + var qs = { + access_token: ctx.token + } + utils + .get("https://graph.facebook.com/me/permissions", ctx.jar, qs) + .then(function () { + return callback(null, ctx.token); + }) + .catch(function () { + return utils + .getDTSGInitData(ctx) + .then(function () { + return utils + .post("https://www.facebook.com/v1.0/dialog/oauth/confirm", ctx.jar, { + fb_dtsg: ctx.fb_dtsg, + app_id: "124024574287414", + redirect_uri: "fbconnect://success", + display: "popup", + return_format: "access_token", + }); + }) + .then(function (res) { + var body = res.body; + var token = body.match(/access_token=(.*?)&/); + if (token && token[1]) + ctx.token = token[1]; + else + throw new Error("Token is undefined."); + + return callback(null, ctx.token); + }) + .catch(function (error) { + console.log(error); + return callback(error); + }); + }); + } else { + utils + .getDTSGInitData(ctx) + .then(function () { + return utils + .post("https://www.facebook.com/v1.0/dialog/oauth/confirm", ctx.jar, { + fb_dtsg: ctx.fb_dtsg, + app_id: "124024574287414", + redirect_uri: "fbconnect://success", + display: "popup", + return_format: "access_token", + }); + }) + .then(function (res) { + var body = res.body; + var token = body.match(/access_token=(.*?)&/); + if (token && token[1]) + ctx.token = token[1]; + else + throw new Error("Token is undefined."); + + return callback(null, ctx.token); + }) + .catch(function (error) { + console.log(error); + return callback(error); + }); + } + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/getCurrentUserID.js b/source/apis/lib/getCurrentUserID.js new file mode 100644 index 0000000000000000000000000000000000000000..2dbf8659858719f84a64bc174743ec79a4b52b03 --- /dev/null +++ b/source/apis/lib/getCurrentUserID.js @@ -0,0 +1,5 @@ +module.exports = function (http, apis, ctx) { + return function getCurrentUserID() { + return ctx.userID; + } +} \ No newline at end of file diff --git a/source/apis/lib/getThreadInfo.js b/source/apis/lib/getThreadInfo.js new file mode 100644 index 0000000000000000000000000000000000000000..e3c11efb8050aef5ccd88eb7df4a288cd7d2a93c --- /dev/null +++ b/source/apis/lib/getThreadInfo.js @@ -0,0 +1,163 @@ +var utils = require("../utils"); + +function formatEventReminders(reminder) { + return { + reminderID: reminder.id, + eventCreatorID: reminder.lightweight_event_creator.id, + time: reminder.time, + eventType: reminder.lightweight_event_type.toLowerCase(), + locationName: reminder.location_name, + locationCoordinates: reminder.location_coordinates, + locationPage: reminder.location_page, + eventStatus: reminder.lightweight_event_status.toLowerCase(), + note: reminder.note, + repeatMode: reminder.repeat_mode.toLowerCase(), + eventTitle: reminder.event_title, + triggerMessage: reminder.trigger_message, + secondsToNotifyBefore: reminder.seconds_to_notify_before, + allowsRsvp: reminder.allows_rsvp, + relatedEvent: reminder.related_event, + members: reminder.event_reminder_members.edges.map(member => ({ + memberID: member.node.id, + state: member.guest_list_state.toLowerCase() + })) + } +} + +function formatThreadGraphQLResponse(data) { + var messageThread = data.message_thread; + if (!messageThread) return {} + + var threadID = messageThread.thread_key.thread_fbid || messageThread.thread_key.other_user_id; + + var lastM = messageThread.last_message; + var snippetID = lastM && lastM.nodes && lastM.nodes[0] && lastM.nodes[0].message_sender && lastM.nodes[0].message_sender.messaging_actor ? lastM.nodes[0].message_sender.messaging_actor.id : null; + var snippetText = lastM && lastM.nodes && lastM.nodes[0] ? lastM.nodes[0].snippet : null; + var lastR = messageThread.last_read_receipt; + var lastReadTimestamp = lastR && lastR.nodes && lastR.nodes[0] && lastR.nodes[0].timestamp_precise ? lastR.nodes[0].timestamp_precise : null; + + return { + threadID: threadID, + threadName: messageThread.name, + participantIDs: messageThread.all_participants.edges.map(d => d.node.messaging_actor.id), + userInfo: messageThread.all_participants.edges.map(d => ({ + id: d.node.messaging_actor.id, + name: d.node.messaging_actor.name, + firstName: d.node.messaging_actor.short_name, + vanity: d.node.messaging_actor.username, + thumbSrc: d.node.messaging_actor.big_image_src.uri, + profileUrl: d.node.messaging_actor.big_image_src.uri, + gender: d.node.messaging_actor.gender, + type: d.node.messaging_actor.__typename, + isFriend: d.node.messaging_actor.is_viewer_friend, + isBirthday: !!d.node.messaging_actor.is_birthday + })), + unreadCount: messageThread.unread_count, + messageCount: messageThread.messages_count, + timestamp: messageThread.updated_time_precise, + muteUntil: messageThread.mute_until, + isGroup: messageThread.thread_type == "GROUP", + isSubscribed: messageThread.is_viewer_subscribed, + isArchived: messageThread.has_viewer_archived, + folder: messageThread.folder, + cannotReplyReason: messageThread.cannot_reply_reason, + eventReminders: messageThread.event_reminders ? messageThread.event_reminders.nodes.map(formatEventReminders) : null, + emoji: messageThread.customization_info ? messageThread.customization_info.emoji : null, + color: messageThread.customization_info && messageThread.customization_info.outgoing_bubble_color ? messageThread.customization_info.outgoing_bubble_color.slice(2) : null, + nicknames: + messageThread.customization_info && + messageThread.customization_info.participant_customizations + ? messageThread.customization_info.participant_customizations.reduce(function (res, val) { + if (val.nickname) res[val.participant_id] = val.nickname; + return res; + }, {}) + : {}, + adminIDs: messageThread.thread_admins, + approvalMode: Boolean(messageThread.approval_mode), + approvalQueue: messageThread.group_approval_queue.nodes.map(a => ({ + inviterID: a.inviter.id, + requesterID: a.requester.id, + timestamp: a.request_timestamp, + request_source: a.request_source + })), + reactionsMuteMode: messageThread.reactions_mute_mode.toLowerCase(), + mentionsMuteMode: messageThread.mentions_mute_mode.toLowerCase(), + isPinProtected: messageThread.is_pin_protected, + relatedPageThread: messageThread.related_page_thread, + name: messageThread.name, + snippet: snippetText, + snippetSender: snippetID, + snippetAttachments: [], + serverTimestamp: messageThread.updated_time_precise, + imageSrc: messageThread.image ? messageThread.image.uri : null, + isCanonicalUser: messageThread.is_canonical_neo_user, + isCanonical: messageThread.thread_type != "GROUP", + recipientsLoadable: true, + hasEmailParticipant: false, + readOnly: false, + canReply: messageThread.cannot_reply_reason == null, + lastMessageTimestamp: messageThread.last_message ? messageThread.last_message.timestamp_precise : null, + lastMessageType: "message", + lastReadTimestamp: lastReadTimestamp, + threadType: messageThread.thread_type == "GROUP" ? 2 : 1, + inviteLink: { + enable: messageThread.joinable_mode ? messageThread.joinable_mode.mode == 1 : false, + link: messageThread.joinable_mode ? messageThread.joinable_mode.link : null + } + } +} + +module.exports = function (http, apis, ctx) { + return function getThreadInfo(threadIDs, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (typeof callback !== "function") callback = pCallback; + if (!Array.isArray(threadIDs)) threadIDs = [threadIDs]; + + var form = {} + threadIDs.map((id, i) => form["o" + i] = { + doc_id: "3449967031715030", + query_params: { + id, + message_limit: 0, + load_messages: false, + load_read_receipts: false, + before: null + } + }); + + form = { + queries: JSON.stringify(form), + batch_name: "MessengerGraphQLThreadFetcher" + } + + http + .post("https://www.facebook.com/api/graphqlbatch/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (resData) { + if (resData.error) throw resData; + var threadInfos = {} + for (let i = resData.length - 2; i >= 0; i--) { + var threadInfo = formatThreadGraphQLResponse(resData[i][Object.keys(resData[i])[0]].data); + threadInfos[threadInfo.threadID] = threadInfo; + } + if (Object.values(threadInfos).length === 1) { + callback(null, Object.values(threadInfos)[0]); + } + else { + callback(null, threadInfos); + } + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + console.log(error); + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/getUserID.js b/source/apis/lib/getUserID.js new file mode 100644 index 0000000000000000000000000000000000000000..45403d74d7f4418e09c2c716a89ca0485e56d467 --- /dev/null +++ b/source/apis/lib/getUserID.js @@ -0,0 +1,91 @@ +var utils = require("../utils"); + +function format(res) { + var res = res.relay_rendering_strategy.view_model.profile; + return { + userID: res.id, + name: res.name, + isVerified: res.is_verified, + profileUrl: res.url, + photoUrl: res.profile_picture.uri + } +} + +module.exports = function (http, apis, ctx) { + return function getUserID(name, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (typeof name === "function") { + callback = name; + name = null; + } + if (typeof callback !== "function") + callback = pCallback; + + if (typeof name !== "string") + callback(new Error("name must be an string")); + else { + var form = { + fb_api_caller_class: "RelayModern", + fb_api_req_friendly_name: "SearchCometResultsInitialResultsQuery", + variables: JSON.stringify({ + count: 5, + allow_streaming: false, + args: { + callsite: "COMET_GLOBAL_SEARCH", + config: { + exact_match: false, + high_confidence_config: null, + intercept_config: null, + sts_disambiguation: null, + watch_config: null + }, + context: { + bsid: utils.getGUID(), + tsid: null + }, + experience: { + encoded_server_defined_params: null, + fbid: null, + type: "PEOPLE_TAB" + }, + filters: [], + text: name.toLowerCase() + }, + cursor: null, + feedbackSource: 23, + fetch_filters: true, + renderLocation: "search_results_page", + scale: 1, + stream_initial_count: 0, + useDefaultActor: false, + __relay_internal__pv__IsWorkUserrelayprovider: false, + __relay_internal__pv__IsMergQAPollsrelayprovider: false, + __relay_internal__pv__StoriesArmadilloReplyEnabledrelayprovider: false, + __relay_internal__pv__StoriesRingrelayprovider: false + }), + doc_id: "9946783172059974" + } + + http + .post("https://www.facebook.com/api/graphql/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + return callback(null, res.data.serpResponse.results.edges.map(format)); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + } + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/getUserInfo.js b/source/apis/lib/getUserInfo.js new file mode 100644 index 0000000000000000000000000000000000000000..b748f79a7c9c2843ca041c514388f040113c38cc --- /dev/null +++ b/source/apis/lib/getUserInfo.js @@ -0,0 +1,144 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + function parseData(data) { + var retObj = {} + + for (var prop in data) { + if (data.hasOwnProperty(prop)) { + var innerObj = data[prop]; + retObj[prop] = { + name: innerObj.name, + firstName: innerObj.firstName, + vanity: innerObj.vanity, + thumbSrc: innerObj.thumbSrc, + profileUrl: innerObj.uri, + gender: innerObj.gender, + type: innerObj.type, + isFriend: innerObj.is_friend, + isBirthday: !!innerObj.is_birthday, + searchTokens: innerObj.searchTokens, + alternateName: innerObj.alternateName, + } + } + } + + return retObj; + } + + function parseDataHighLevel(userIDs, data) { + var retObj = {} + + for (var index in userIDs) { + var res = data[index]; + if (Object.keys(res).length > 0) { + retObj[res.id] = { + id: res.id, + name: res.name, + shortName: res.short_name || null, + verified: res.verified != false ? true : false, + email: res.email || null, + website: res.website || null, + follower: !!res.subscribers == true ? res.subscribers.summary.total_count : null, + lover: res.significant_other || null, + cover: !!res.cover == true ? res.cover.source : null, + first_name: res.first_name || null, + middle_name: res.middle_name || null, + last_name: res.last_name || null, + about: res.about || null, + birthday: res.birthday || null, + languages: res.languages || [], + gender: res.gender || null, + hometown: !!res.hometown == true ? res.hometown.name : null, + profileUrl: res.link || null, + location: !!res.location == true ? res.location.name : null, + username: res.username || null, + avatar: !!res.picture == true ? res.picture.data.url : null, + relationship_status: !!res.relationship_status == true ? res.relationship_status : null, + subscribers: !!res.subscribers == true ? res.subscribers.data : null, + favorite_athletes: !!res.favorite_athletes == false ? [] : res.favorite_athletes.map(v => ({ + name: v.name + })), + education: !!res.education == true ? res.education.map(v => ({ + type: v.type, + school: v.school.name + })) : [], + work: !!res.work == true ? res.work : [] + } + } else + retObj[userIDs[index]] = {} + } + + return retObj; + } + + function requestData(userID) { + var qs = { + fields: "id,name,verified,cover,first_name,email,about,birthday,gender,website,hometown,link,location,quotes,relationship_status,significant_other,username,subscribers.limite(0),short_name,last_name,middle_name,education,picture,work,languages,favorite_athletes", + access_token: ctx.token + } + return utils + .get("https://graph.facebook.com/v1.0/" + userID, ctx.jar, qs) + .then(function (res) { + return JSON.parse(res.body); + }) + .catch(function (error) { + console.log(error); + return {} + }); + } + + return function getUserInfo(userIDs, deprecated = false, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, data) => error ? reject(error) : resolve(data); + }); + + if (typeof deprecated === "function") { + callback = deprecated; + deprecated = false; + } + if (typeof callback !== "function") + callback = pCallback; + if (!Array.isArray(userIDs)) + userIDs = [userIDs]; + if (!deprecated) { + var form = []; + apis + .getAccessToken() + .then(function () { + userIDs.map(userID => form.push(requestData(userID))); + return Promise.all(form); + }) + .then(function (res) { + return callback(null, parseDataHighLevel(userIDs, res)); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + console.log(error); + return callback(error); + }); + } else { + var form = {} + userIDs.map((value, index) => form["ids[" + index + "]"] = value); + http + .post("https://www.facebook.com/chat/user_info/", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw new Error(res); + + return callback(null, parseData(res.payload.profiles)); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + console.log(error); + return callback(error); + }); + } + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/logout.js b/source/apis/lib/logout.js new file mode 100644 index 0000000000000000000000000000000000000000..78222c2b16b822ec5100206f7287bc4d1fdfb85b --- /dev/null +++ b/source/apis/lib/logout.js @@ -0,0 +1,53 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function logout(callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof callback !== "function") + callback = pCallback + + var form = { + pmid: "0" + } + + http + .post("https://www.facebook.com/bluebar/modern_settings_menu/?help_type=364455653583099&show_contextual_help=1", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + var elem = res.jsmods.instances[0][2][0].filter(item => item.value === "logout")[0]; + var body = res.jsmods.markup.filter(item => item[0] === elem.markup.__m)[0][1].__html; + var match = [...body.matchAll(/]*name="([^"]+)"[^>]*value="([^"]+)"[^>]*>/g)].map(item => item[2]); + var form = { + jazoest: match[0], + fb_dtsg: match[1], + ref: match[2], + h: match[3] + } + + return http.post("https://www.facebook.com/logout.php", ctx.jar, form); + }) + .then(function (res) { + if (!res.headers) + throw { + error: "An error occurred when logging out." + } + + return http.get(res.headers.location, ctx.jar); + }) + .then(function () { + ctx.isLogin = false; + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/markAsDelivered.js b/source/apis/lib/markAsDelivered.js new file mode 100644 index 0000000000000000000000000000000000000000..8dd0056df2ef8b6e0756f4af6cbd1ca1b25f11f6 --- /dev/null +++ b/source/apis/lib/markAsDelivered.js @@ -0,0 +1,35 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function markAsDelivered(threadID, messageID, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof callback !== "function") callback = pCallback; + if (threadID && messageID) { + var form = {} + form["message_ids[0]"] = messageID; + form["thread_ids[" + threadID + "][0]"] = messageID; + + http + .post("https://www.facebook.com/ajax/mercury/delivery_receipts.php", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (resData) { + if (resData.error) + throw resData; + + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + return callback(error); + }); + } else + callback("Error: messageID or threadID is not defined"); + + return returnPromise; + } +} diff --git a/source/apis/lib/markAsRead.js b/source/apis/lib/markAsRead.js new file mode 100644 index 0000000000000000000000000000000000000000..45bb8884a24b794dc6eb1bc06a09e63bab3236bf --- /dev/null +++ b/source/apis/lib/markAsRead.js @@ -0,0 +1,41 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function markAsRead(threadID, read = true, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof read === "function") { + callback = read; + read = true; + } + + if (typeof callback !== "function") + callback = pCallback; + + var form = {} + form["source"] = "PagesManagerMessagesInterface"; + form["request_user_id"] = ctx.userID; + form["ids[" + threadID + "]"] = read; + form["watermarkTimestamp"] = new Date().getTime(); + form["shouldSendReadReceipt"] = true; + form["commerce_last_message_type"] = ""; + + http + .post("https://www.facebook.com/ajax/mercury/change_read_status.php", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function () { + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }) + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/muteThread.js b/source/apis/lib/muteThread.js new file mode 100644 index 0000000000000000000000000000000000000000..8c6b56795f564c68bf5a1b7eae0aac26dab86b5a --- /dev/null +++ b/source/apis/lib/muteThread.js @@ -0,0 +1,49 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function muteThread(threadID, muteSeconds = 0, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof threadID === "function") { + callback = threadID; + threadID = null; + } + if (typeof muteSeconds === "function") { + callback = muteSeconds; + muteSeconds = 0; + } + if (typeof callback !== "function") + callback = pCallback; + if (utils.getType(threadID) !== "String" || utils.getType(threadID) !== "Number") + callback(new Error("threadID must be an string number")); + else if (utils.getType(muteSeconds) !== "String" || utils.getType(muteSeconds) !== "Number") + callback(new Error("muteSeconds must be an string number")); + else { + var form = { + thread_fbid: threadID, + mute_settings: muteSeconds + } + + http + .post("https://www.facebook.com/ajax/mercury/change_mute_thread.php", ctx.jar, form) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error || res.errors) + throw res; + + return callback(); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + + return callback(error); + }); + } + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/post.js b/source/apis/lib/post.js new file mode 100644 index 0000000000000000000000000000000000000000..b050e729b9bdb989a1d8cfa99a14d0a62ada4698 --- /dev/null +++ b/source/apis/lib/post.js @@ -0,0 +1,12 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + return function HttpClientPostData(url, form, parse = false, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/resolvePhotoUrl.js b/source/apis/lib/resolvePhotoUrl.js new file mode 100644 index 0000000000000000000000000000000000000000..08681cfb3b9e605fae86485b18edf88ff581ba73 --- /dev/null +++ b/source/apis/lib/resolvePhotoUrl.js @@ -0,0 +1,63 @@ +var utils = require("../utils"); + +module.exports = function (http, apis, ctx) { + function getPhotoUrls(photoIDs) { + var callback; + var uploads = []; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, photoUrl) => photoUrl ? resolve(photoUrl) : reject(error); + }); + + photoIDs.map(function (id) { + var httpPromise = http + .get("https://www.facebook.com/mercury/attachments/photo", ctx.jar, { + photo_id: id + }) + .then(utils.parseAndCheckLogin(ctx, http)) + .then(function (res) { + if (res.error) throw res; + return res.jsmods.require[0][3][0] + }) + .catch(function (error) { + return callback(error); + }); + uploads.push(httpPromise); + }); + + Promise + .all(uploads) + .then(function (res) { + return callback(null, res.reduce(function (form, v, i) { + form[photoIDs[i]] = v; + return form; + }, {})); + }) + + return returnPromise; + } + + return function resolvePhotoUrl(photoIDs, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = (error, photoUrl) => photoUrl ? resolve(photoUrl) : reject(error); + }); + + if (!Array.isArray(photoIDs)) photoIDs = [photoIDs]; + if (typeof callback !== 'function') callback = pCallback; + + getPhotoUrls(photoIDs) + .then(function (photoUrl) { + if (Object.keys(photoUrl).length == 1) { + callback(null, photoUrl[photoIDs[0]]); + } else callback(null, photoUrl); + }) + .catch(function (error) { + if (error.type === "logout.") + ctx.isLogin = false; + console.log(error); + return callback(error); + }); + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/lib/screenshot.js b/source/apis/lib/screenshot.js new file mode 100644 index 0000000000000000000000000000000000000000..be127eefeba9288f8e0fc42ba7b90f64eff52cb2 --- /dev/null +++ b/source/apis/lib/screenshot.js @@ -0,0 +1,77 @@ +var utils = require("../utils"); +var Pup = require("puppeteer"); + +module.exports = function (http, apis, ctx) { + return async function ScreenShotChromium(url, path, Options, callback) { + var pCallback; + var returnPromise = new Promise(function (resolve, reject) { + pCallback = error => error ? reject(error) : resolve(); + }); + + if (typeof url === "function") { + callback = url; + url = null; + } + if (typeof path === "function") { + callback = path; + path = null; + } + if (typeof Options === "function") { + callback = Options; + Options = {} + } + if (typeof Options !== "object") + Options = {} + if (typeof callback !== "function") + callback = pCallback; + + Options.userAgent = Options.userAgent || "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/127.0.0.0 Safari/537.36"; + Options.width = Options.width || 1920; + Options.height = Options.height || 1080; + Options.fullPage = Options.fullPage || false; + + if (!utils.isURL(url)) + callback(new Error("url is invalid")); + else if (!utils.isPath(path)) + callback(new Error("path is invalid")); + else { + var Browser; + var Proxy = utils.parseProxy(ctx.proxy); + + if (Proxy && Proxy.length > 0) { + Browser = await Pup.launch({ headless: true, args: ["--proxy-server=" + ctx.proxy] }); + } else + Browser = await Pup.launch({ headless: true }); + + var Page = await Browser.newPage(); + + if (Proxy && Proxy[0] && Proxy[1]) + await Page.authenticate({ + username: Proxy[0], + password: Proxy[1] + }); + + var Cookies = apis.getAppState().map(item => ({ + name: item.key, + value: item.value, + domain: ".facebook.com", + path: "/", + secure: true, + httpOnly: true + })); + + await Page.setViewport({ + width: Options.width, + height: Options.height + }); + await Page.setUserAgent(Options.userAgent); + await Page.setCookie(...Cookies); + await Page.goto(url, { waitUntil: "networkidle0" }); + await Page.screenshot({ path, fullPage: Options.fullPage }); + await Browser.close(); + callback(); + } + + return returnPromise; + } +} \ No newline at end of file diff --git a/source/apis/utils.js b/source/apis/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..700de661ba365bd15c144eebe3804474ff6d1881 --- /dev/null +++ b/source/apis/utils.js @@ -0,0 +1,372 @@ +var request = require("request").defaults({ jar: true }); +var parseProxy = proxy => (proxy.match(/^(?:http:\/\/)?(?:(\S+):(\S+)@)?([A-Za-z0-9.-]+):(\d{2,5})$/) || []).slice(1); +var utilsLib = require("../lib/utils"); +var log = require("../lib/log"); +var stream = require("stream"); + +function setProxy(proxy) { + var proxyArray = parseProxy(proxy); + + if (proxyArray) + request = require("request").defaults({ jar: true, proxy }); + else + request = require("request").defaults({ jar: true }); +} + +function setHeaders(url, ctx, customHeaders) { + var headers = { + "Content-Type": "application/x-www-form-urlencoded", + Referer: "https://www.facebook.com/", + Host: new URL(url).hostname, + Origin: "https://www.facebook.com", + "User-Agent": "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (Kbody, like Gecko) Chrome/127.0.0.0 Safari/537.36", + Connection: "keep-alive", + "sec-fetch-site": "same-origin" + } + if (customHeaders) + Object.assign(headers, customHeaders); + if (customHeaders && customHeaders.noRef) { + delete headers.Referer; + delete headers.noRef; + } + if (ctx && ctx.region) + headers["X-MSGR-Region"] = ctx.region; + + return headers; +} + +function get(url, jar, qs, ctx, customHeaders) { + if (utilsLib.getType(qs) === "Object") { + for (var prop in qs) { + if (qs.hasOwnProperty(prop) && utilsLib.getType(qs[prop]) === "Object") { + qs[prop] = JSON.stringify(qs[prop]); + } + } + } + var options = { + headers: setHeaders(url, ctx, customHeaders), + timeout: 60000, + qs, + url, + method: "GET", + jar, + gzip: true + } + + var callback; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, response) => error ? reject(error) : resolve(response); + }); + request(options, callback); + + return returnPromise; +} + +function post(url, jar, form, ctx, customHeaders) { + var options = { + headers: setHeaders(url, ctx, customHeaders), + timeout: 60000, + url, + method: "POST", + form, + jar, + gzip: true + } + + var callback; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, response) => error ? reject(error) : resolve(response); + }); + request(options, callback); + + return returnPromise; +} + +function postData(url, jar, formData, qs, ctx, customHeaders) { + if (utilsLib.getType(qs) === "Object") { + for (var prop in qs) { + if (qs.hasOwnProperty(prop) && utilsLib.getType(qs[prop]) === "Object") { + qs[prop] = JSON.stringify(qs[prop]); + } + } + } + var headers = setHeaders(url, ctx, customHeaders); + headers["Content-Type"] = "multipart/form-data"; + var options = { + headers, + timeout: 60000, + url, + method: "POST", + formData, + qs, + jar, + gzip: true + } + + var callback; + var returnPromise = new Promise(function (resolve, reject) { + callback = (error, response) => error ? reject(error) : resolve(response); + }); + request(options, callback); + + return returnPromise; +} + +function isReadableStream(maybeStream) { + return (maybeStream instanceof stream.Stream && typeof maybeStream._read === "function" && utilsLib.getType(maybeStream._readableState) === "Object"); +} + +function getGUID() { + var sectionLength = Date.now(); + var id = "xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g, function (c) { + var r = Math.floor((sectionLength + Math.random() * 16) % 16); + sectionLength = Math.floor(sectionLength / 16); + var _guid = (c === "x" ? r : (r & 7) | 8).toString(16); + return _guid; + }); + return id; +} + +function getSignatureID() { + return Math.floor(Math.random() * 2147483648).toString(16); +} + +function makeDefaults(body, userID, ctx) { + var reqCounter = 1; + var fb_dtsg = /\["DTSGInitData",\[],{"token":"(\S+)","async_get_token"/g.exec(body)[1]; + var revision = /"server_revision":(\d+)/g.exec(body)[1]; + + function mergeWithDefaults(Obj) { + fb_dtsg = ctx.fb_dtsg ? ctx.fb_dtsg : fb_dtsg + var ttstamp = "2"; + for (var i = 0; i < fb_dtsg.length; i++) { + ttstamp += fb_dtsg.charCodeAt(i); + } + var newObj = { + av: userID, + __user: userID, + __req: (reqCounter++).toString(36), + __rev: revision, + __a: 1, + fb_dtsg, + jazoest: ctx.ttstamp ? ctx.ttstamp : ttstamp + } + if (!Obj) + return newObj; + + for (var prop in Obj) + if (Obj.hasOwnProperty(prop)) + if (!newObj[prop]) + newObj[prop] = Obj[prop]; + + return newObj; + } + + function postWithDefaults(url, jar, form, ctxx = ctx, customHeaders) { + return post(url, jar, mergeWithDefaults(form), ctxx, customHeaders); + } + + function getWithDefaults(url, jar, qs, ctxx = ctx, customHeaders) { + return get(url, jar, mergeWithDefaults(qs), ctxx, customHeaders); + } + + function postDataWithDefault(url, jar, form, qs, ctxx = ctx, customHeaders) { + return postData(url, jar, mergeWithDefaults(form), mergeWithDefaults(qs), ctxx, customHeaders); + } + + return { + get: getWithDefaults, + post: postWithDefaults, + postData: postDataWithDefault + } +} + +function makeParsable(body) { + var withoutForLoop = body.replace(/for\s*\(\s*;\s*;\s*\)\s*;\s*/, ""); + var maybeMultipleObjects = withoutForLoop.split(/\}\r\n *\{/); + if (maybeMultipleObjects.length === 1) + return maybeMultipleObjects; + return "[" + maybeMultipleObjects.join("},{") + "]"; +} + +function parseAndCheckLogin(ctx, http, retryCount) { + var delay = ms => new Promise(resolve => setTimeout(resolve, ms)); + var _try = tryData => new Promise(function (resolve, reject) { + try { + resolve(tryData()); + } catch (error) { + reject(error); + } + }); + if (retryCount === undefined) retryCount = 0; + + return function (data) { + function any() { + if (data.statusCode >= 500 && data.statusCode < 600) { + if (retryCount >= 5) { + var err = new Error("Request retry failed. Check the `res` and `statusCode` property on this error."); + err.statusCode = data.statusCode; + err.res = data.body; + err.error = "Request retry failed. Check the `res` and `statusCode` property on this error."; + throw err; + } + retryCount++; + var retryTime = Math.floor(Math.random() * 5000); + var url = data.request.uri.protocol + "//" + data.request.uri.hostname + data.request.uri.pathname; + if (data.request.headers["Content-Type"].split(";")[0] === "multipart/form-data") { + return delay(retryTime) + .then(function () { + return http + .postData(url, ctx.jar, data.request.formData); + }) + .then(parseAndCheckLogin(ctx, http, retryCount)); + } + else { + return delay(retryTime) + .then(function () { + return http + .post(url, ctx.jar, data.request.formData); + }) + .then(parseAndCheckLogin(ctx, http, retryCount)); + } + } + if (data.statusCode !== 200) + throw new Error("parseAndCheckLogin got status code: " + data.statusCode + ". Bailing out of trying to parse response."); + + var res = null; + try { + res = JSON.parse(makeParsable(data.body)); + } catch (e) { + var err = new Error("JSON.parse error. Check the `detail` property on this error."); + err.error = "JSON.parse error. Check the `detail` property on this error."; + err.detail = e; + err.res = data.body; + throw err; + } + + if (res.redirect && data.request.method === "GET") { + return http + .get(res.redirect, ctx.jar) + .then(parseAndCheckLogin(ctx, http)); + } + + if (res.jsmods && res.jsmods.require && Array.isArray(res.jsmods.require[0]) && res.jsmods.require[0][0] === "Cookie") { + res.jsmods.require[0][3][0] = res.jsmods.require[0][3][0].replace("_js_", ""); + var cookie = formatCookie(res.jsmods.require[0][3], "facebook"); + var cookie2 = formatCookie(res.jsmods.require[0][3], "messenger"); + ctx.jar.setCookie(request.cookie(cookie), "https://www.facebook.com"); + ctx.jar.setCookie(request.cookie(cookie2), "https://www.messenger.com"); + } + + if (res.jsmods && Array.isArray(res.jsmods.require)) { + var arr = res.jsmods.require; + for (var i in arr) { + if (arr[i][0] === "DTSG" && arr[i][1] === "setToken") { + ctx.fb_dtsg = arr[i][3][0]; + + ctx.ttstamp = "2"; + for (var j = 0; j < ctx.fb_dtsg.length; j++) { + ctx.ttstamp += ctx.fb_dtsg.charCodeAt(j); + } + } + } + } + + if (res.error === 1357001) { + var err = new Error('Facebook blocked login. Please visit https://facebook.com and check your account.'); + err.type = "Logout."; + throw err; + } + return res; + } + return _try(any); + } +} + +function formatID(id) { + if (id != undefined && id != null) { + return id.replace(/(fb)?id[:.]/, ""); + } + else { + return id; + } +} + +function getDTSGInitData(ctx) { + return get("https://www.facebook.com", ctx.jar) + .then(function (res) { + var body = res.body; + ctx.fb_dtsg = /\["DTSGInitData",\[],{"token":"(.+?)"/g.exec(body)[1]; + }); +} + +function binaryToDecimal(data) { + var ret = ""; + while (data !== "0") { + var end = 0; + var fullName = ""; + var i = 0; + for (; i < data.length; i++) { + end = 2 * end + parseInt(data[i], 10); + if (end >= 10) { + fullName += "1"; + end -= 10; + } else + fullName += "0"; + } + ret = end.toString() + ret; + data = fullName.slice(fullName.indexOf("1")); + } + return ret; +} + +function generateOfflineThreadingID() { + var ret = Date.now(); + var value = Math.floor(Math.random() * 4294967295); + var str = ("0000000000000000000000" + value.toString(2)).slice(-22); + var message = ret.toString(2) + str; + return binaryToDecimal(message); +} + +function generateTimestampRelative() { + var d = new Date(); + return d.getHours() + ":" + padZeros(d.getMinutes()); +} + +function padZeros(val, len) { + val = String(val); + len = len || 2; + while (val.length < len) val = "0" + val; + return val; +} + +function generateThreadingID(clientID) { + var k = Date.now(); + var l = Math.floor(Math.random() * 4294967295); + var m = clientID; + return "<" + k + ":" + l + "-" + m + "@mail.projektitan.com>"; +} + +var utils = { + getJar: request.jar, + cookie: request.cookie, + setProxy, + parseProxy, + get, + post, + postData, + isReadableStream, + getGUID, + getSignatureID, + makeDefaults, + parseAndCheckLogin, + formatID, + getDTSGInitData, + generateOfflineThreadingID, + generateTimestampRelative, + generateThreadingID +} + +Object.assign(utils, utilsLib); + +module.exports = utils; \ No newline at end of file diff --git a/source/control/events/cache.json b/source/control/events/cache.json new file mode 100644 index 0000000000000000000000000000000000000000..9e26dfeeb6e641a33dae4961196235bdb965b21b --- /dev/null +++ b/source/control/events/cache.json @@ -0,0 +1 @@ +{} \ No newline at end of file diff --git a/source/control/index.js b/source/control/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a51992ea284415e589de3bce3e3c5c7c5ac89f9a --- /dev/null +++ b/source/control/index.js @@ -0,0 +1,204 @@ +var utils = require("../lib/utils"); +var log = require("../lib/log"); +var fs = require("fs"); +var Child = require("child_process"); + +var requiredOptions = { + name: [ + "String", + true + ], + version: [ + "String", + true + ], + role: [ + "Number", + true + ], + author: [ + "Array", + true + ], + category: [ + "String", + true + ], + description: [ + "Object", + true + ], + delay: [ + "Number", + true + ], + guides: [ + "Object", + true + ], + dependencies: [ + "Array", + false + ], + envConfig: [ + "Object", + false + ] +} + +module.exports = function () { + var apis = global.mira.apis; + var { systemOptions } = global.mira.config; + + if (systemOptions.autoLoadPlugins.enable) { + var path = require("path"); + var fs = require("fs"); + var dir = path.resolve(global.mira.dir, "plugins"); + var plugins = fs.readdirSync(dir).filter(item => item.endsWith(".js") && !systemOptions.autoLoadPlugins.ignore.includes(item)); + + function LoadPlugin(pluginPath) { + delete require.cache[pluginPath]; + function error(message) { + var error = new Error(message); + error.at = pluginPath; + return error; + } + try { + var pl = new (require(pluginPath))(); + var Options = pl.Options; + var Langs = pl.Langs; + var Reply = pl.Reply; + var React = pl.React; + var Schedule = pl.Schedule; + var Events = pl.Events; + var Main = pl.Main; + if (utils.getType(Options) !== "Object") + throw error("Object is required in Options"); + + for (var item of Object.entries(requiredOptions)) { + if (item[1][1] && !Options[item[0]].toString() || utils.getType(Options[item[0]]) !== item[1][0]) + throw error(item[0] + " is not accepted."); + } + + if (typeof Main !== "function") + throw error("function is required in Main."); + + if (utils.getType(Langs) !== "Object") + throw error("Object is required in " + lang); + + for (var lang in Langs) { + if (utils.getType(Langs[lang]) !== "Object") + throw error("Object is required in " + lang); + + for (var content in Langs[lang]) { + if (utils.getType(Langs[lang][content]) !== "String") + throw error("String is required in " + content); + } + } + + if (Reply && typeof Reply !== "function") + throw error("Reply must be function"); + if (React && typeof React !== "function") + throw error("React must be function"); + if (Schedule && typeof Schedule !== "function") + throw error("Schedule must be function"); + if (Events && typeof Events !== "function") + throw error("Events must be function"); + + if (Options.dependencies) { + pl.dependencies = {} + var execOptions = { + cwd: dir, + stdio: "inherit", + shell: true + } + for (var dependencie of Options.dependencies) { + try { + pl.dependencies[dependencie] = require(dependencie); + } catch (error) { + Child.execSync("npm install " + dependencie, execOptions); + pl.dependencies[dependencie] = require(dependencie); + } + } + } + + if (Options.envConfig) { + var envConfig = {} + envConfig[Options.name] = {} + for (var env in Options.envConfig) { + envConfig[Options.name][env] = Options.envConfig[env]; + } + global.mira.configCommands = envConfig; + } + + global.modules.cmds = global.modules.cmds.filter(item => item[0] !== Options.name); + global.modules.cmds.push([Options.name, pl]); + } catch (error) { + console.log(error); + } + } + + plugins.forEach(plugin => { + var pluginPath = path.resolve(dir, plugin); + LoadPlugin(pluginPath); + if (systemOptions.autoReloadPlugins.enable && !systemOptions.autoReloadPlugins.ignore.includes(plugin)) { + var lastReload = fs.statSync(pluginPath).mtimeMs; + var reloading = false; + + function reload() { + if (reloading) + return; + reloading = true; + setTimeout(function () { + reloading = false; + if (lastReload === fs.statSync(pluginPath).mtimeMs) + return; + + try { + LoadPlugin(pluginPath); + log.info("control.modules.reload", plugin); + } finally {} + }, 2000); + } + fs.watch(pluginPath, type => { + if (type === "change") + reload(); + }); + } + }); + + log.info("control.modules.len", global.modules.cmds.length); + } + + var Client = new apis.Client(); + var model = require("./model"); + log.info("control.model.connect"); + log.info("control.Client.connect"); + log.wall(); + global.mira.Client = Client; + return Client + .on("message", message => { + switch (message.type) { + case "message": + model.Main(message); + case "message_reply": + case "message_unsend": + model.db.createDataBase(message); + model.Events(message); + break; + case "event": + break; + case "message_reaction": + break; + default: + break; + } + }) + .on("error", function (error) { + if (error.type === "disconnect") + Client.disconnect(); + + log.error("control.Client.error", error.message || error); + console.log(error); + }); +} \ No newline at end of file diff --git a/source/control/model.js b/source/control/model.js new file mode 100644 index 0000000000000000000000000000000000000000..ef00773e971c77e2459be892cbdcf3c337e18efd --- /dev/null +++ b/source/control/model.js @@ -0,0 +1,267 @@ +var utils = require("../lib/utils"); +var log = require("../lib/log"); +var { apis } = global.mira; +var { model } = global.database; +var ScheduleInterval; + +var bannedAPIs = [ + "Messenger", + "Client", + "markAsDelivered", + "markAsRead", + "getUserInfo" +]; + +async function createDataBase(message) { + var { User, Thread } = model; + var { threadID, participantIDs, isGroup } = message; + + if (isGroup) { + try { + await Thread.findOne(threadID); + } catch (error) { + log.error("database.create.fail", threadID, error.message); + console.log(error); + } + } else { + try { + await User.findOne(threadID); + } catch (error) { + log.error("database.create.fail", threadID, error.message); + console.log(error); + } + } + + for (var userID of participantIDs || []) { + try { + await User.findOne(userID); + await new Promise(resolve => setTimeout(resolve, 2000)); + } catch (error) { + log.error("database.create.fail", userID, error.message); + console.log(error); + } + } +} + +async function updateDataBase(message) { + +} + +function levenshteinDistance(str1, str2) { + var len1 = str1.length; + var len2 = str2.length; + var dp = []; + + for (var i = 0; i <= len1; i++) + dp[i] = [i]; + for (var j = 0; j <= len2; j++) + dp[0][j] = j; + for (var i = 1; i <= len1; i++) { + for (var j = 1; j <= len2; j++) { + var cost = str1[i - 1] === str2[j - 1] ? 0 : 1; + dp[i][j] = Math.min(dp[i - 1][j] + 1, dp[i][j - 1] + 1, dp[i - 1][j - 1] + cost); + } + } + + return dp[len1][len2]; +} + +function similarityScore(str1, str2) { + var maxLength = Math.max(str1.length, str2.length); + if (maxLength === 0) + return 1.0; + var distance = levenshteinDistance(str1, str2); + return (maxLength - distance) / maxLength; +} + +function findBestMatch(target, possibleMatches) { + var bestMatch = ""; + var bestScore = 0; + + for (var match of possibleMatches) { + var score = similarityScore(target, match); + if (score > bestScore) { + bestScore = score; + bestMatch = match; + } + } + + return { + target: bestMatch, + rating: bestScore + } +} + +async function Main(info) { + var allCMD = [...global.modules.cmds]; + var { prefix, adminOnly, adminIDs } = global.mira.config.botOptions; + var { language } = require("../../config.json").systemOptions; + var { senderID, threadID, isGroup } = info; + var { User, Thread } = model; + var escapedPrefix = prefix.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); + var prefixRegex = new RegExp("^" + escapedPrefix, "i"); + var isCalled = prefixRegex.test(info.body); + if (!isCalled) + return; + + var [namePlg, ...args] = info.body.replace(prefixRegex, "").trim().split(/\s+/); + var cmd = allCMD.find(item => item[0] === namePlg); + var Messenger = utils.createMessenger(apis, info); + var userData = await User.findOne(senderID); + var userID = parseInt(senderID); + + if (adminOnly && !adminIDs.includes(userID)) + return; + + if (isGroup) { + var threadData = await Thread.findOne(threadID); + if (threadData.banAt > 0 && !adminIDs.includes(userID)) + return Messenger.reply(log.parseDir("control.model.threadBanned", [threadData.reason, utils.getTime(null, threadData.banAt)])); + } + + if (userData.banAt > 0 && !adminIDs.includes(userID)) + return Messenger.reply(log.parseDir("control.model.userBanned", [userData.reason, utils.getTime(null, userData.banAt)])); + + if (namePlg.length === 0) + return Messenger.reply(log.parseDir("control.model.noPluginCalled", prefix)); + + if (!cmd) { + var allPlugins = allCMD.map(item => item[0]); + var bestMatch = findBestMatch(namePlg, allPlugins); + var content = log.parseDir("control.model.notExist", [namePlg, bestMatch.target]); + return Messenger.reply(content); + } + + var pl = cmd[1]; + var Langs = pl.Langs[language] || pl.Langs[Object.keys(pl.Langs)[0]]; + + function getText(dir, inputs) { + try { + if (Langs.hasOwnProperty(dir)) { + var content = Langs[dir]; + + if (inputs.length > 0) { + for (var index = 1; index <= inputs.length; index++) + content = content.replace("%" + index, inputs[index - 1]); + } + + content = content.replace(/{p}|{n}/g, match => match === "{p}" ? prefix : namePlg); + return content; + } + return dir; + } catch (error) { + console.log(error); + return dir; + } + } + + var subAPIs = { ...apis } + + for (var api of bannedAPIs) + delete subAPIs[api]; + + Messenger.getText = getText; + + var util = { + args, + Messenger, + events: info, + ...model, + apis: subAPIs + } + + try { + pl.Main(util); + } catch (error) { + console.log(error); + } +} + +async function Events(info) { + var allCMD = [...global.modules.cmds]; + var { prefix, adminOnly, adminIDs } = global.mira.config.botOptions; + var { language } = require("../../config.json").systemOptions; + var { senderID, threadID, isGroup } = info; + var { User, Thread } = model; + var escapedPrefix = prefix.replace(/[-\/\\^$*+?.()|[\]{}]/g, "\\$&"); + var prefixRegex = new RegExp("^" + escapedPrefix, "i"); + var isCalled = prefixRegex.test(info.body); + if (isCalled || senderID === apis.getCurrentUserID()) + return; + + var args = info.body.trim().split(/\s+/); + var Messenger = utils.createMessenger(apis, info); + var userData = await User.findOne(senderID); + var userID = parseInt(senderID); + + if (adminOnly && !adminIDs.includes(userID)) + return; + + if (isGroup) { + var threadData = await Thread.findOne(threadID); + if (threadData.banAt > 0 && !adminIDs.includes(userID)) + return; + } + + if (userData.banAt > 0 && !adminIDs.includes(userID)) + return; + + for (var item of allCMD.filter(item => !!item[1].Events)) { + var pl = item[1]; + var Langs = pl.Langs[language] || pl.Langs[Object.keys(pl.Langs)[0]]; + + function getText(dir, inputs) { + try { + if (Langs.hasOwnProperty(dir)) { + var content = Langs[dir]; + + if (inputs.length > 0) { + for (var index = 1; index <= inputs.length; index++) + content = content.replace("%" + index, inputs[index - 1]); + } + + content = content.replace(/{p}|{n}/g, match => match === "{p}" ? prefix : namePlg); + return content; + } + return dir; + } catch (error) { + console.log(error); + return dir; + } + } + + var subAPIs = { ...apis } + + for (var api of bannedAPIs) + delete subAPIs[api]; + + Messenger.getText = getText; + + var util = { + args, + Messenger, + events: info, + ...model, + apis: subAPIs + } + + try { + pl.Events(util); + } catch (error) { + console.log(error); + } + } +} + +async function Reply(info) { + +} + +module.exports = { + db: { + createDataBase, + updateDataBase + }, + Main, + Events +} \ No newline at end of file diff --git a/source/dashboard/assets/css/404.css b/source/dashboard/assets/css/404.css new file mode 100644 index 0000000000000000000000000000000000000000..7641852bc227b2495b718b4e2a97f0d7dfa970cd --- /dev/null +++ b/source/dashboard/assets/css/404.css @@ -0,0 +1,113 @@ +* { + margin: 0; + padding: 0; + font-family: "Montserrat", sans-serif; +} + +body { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; + +} + +main { + display: flex; + flex-direction: row; + padding: 0 10%; + gap: 40px; +} + +.main-text { + width: 50%; + text-align: start; + padding: 10px; + margin-right: 10px; +} + +.main-text h3 { + font-size: 15px; + color: #ABB0B3; + text-transform: capitalize; + letter-spacing: 2px; + margin-bottom: 16px; +} + +.main-text h1 { + font-size: 57px; + color: #121212; + font-weight: bold; + margin-top: 12px; +} + +.main-text h2 { + font-size: 33px; + color: #121212; + font-weight: 400; + margin-bottom: 40px; + line-height: 48px; + + +} + +.main-text a { + padding: 10px 20px; + background: linear-gradient(90deg, #fef506, #ff6575, #ae4df9, #029aff); + background-size: 500%; + color: white; + text-decoration: none; + border-radius: 5px; + animation: color 5s infinite alternate; + +} + +@keyframes color { + 0% { + background-position: left; + } + + 100% { + background-position: right; + } + +} + +.main-text a:hover { + animation: color 1s infinite alternate; +} + +.main-image { + display: flex; + justify-content: center; + width: 50%; + background-color: transparent; + +} + +@keyframes move { + 0% { + transform: translateY(-10px); + } + + 25% { + transform: translateX(10px); + } + + 50% { + transform: translateY(10px); + } + + 75% { + transform: translateX(-10px); + } + + 100% { + transform: translateY(-10px); + } +} + +.main-image img { + width: 720px; + animation: move 10s infinite linear; +} \ No newline at end of file diff --git a/source/dashboard/assets/css/login.css b/source/dashboard/assets/css/login.css new file mode 100644 index 0000000000000000000000000000000000000000..bc75531f7eb0a1c7200d2cdcba3a21bd7fa63467 --- /dev/null +++ b/source/dashboard/assets/css/login.css @@ -0,0 +1,176 @@ +* { + margin: 0; + padding: 0; + font-family: "Montserrat", sans-serif; +} + +body { + display: flex; + justify-content: center; + align-items: center; + height: 100vh; +} + +main { + display: flex; + flex-direction: row; + padding: 0 10%; + gap: 40px; +} + +.main-text { + width: 50%; + text-align: start; + padding: 10px; + margin-right: 10px; + justify-content: right; +} + +.text { + font-size: 33px; + font-weight: 600; + margin-bottom: 35px; + color: #595959; + text-align: center; +} + +@keyframes color { + 0% { + background-position: left; + } + + 100% { + background-position: right; + } +} + +.main-image { + display: flex; + justify-content: left; + width: 50%; + background-color: transparent; +} + +@keyframes move { + 0% { + transform: translateY(-10px); + } + + 25% { + transform: translateX(10px); + } + + 50% { + transform: translateY(10px); + } + + 75% { + transform: translateX(-10px); + } + + 100% { + transform: translateY(-10px); + } +} + +.main-image img { + width: 720px; + animation: move 10s infinite linear; +} + +.field { + height: 50px; + width: 100%; + display: flex; + position: relative; +} + +.field:nth-child(2) { + margin-top: 20px; +} + +.field input { + height: 100%; + width: 100%; + padding-left: 45px; + outline: none; + border: none; + font-size: 18px; + background: #dde1e7; + color: #595959; + border-radius: 25px; + box-shadow: inset 2px 2px 5px #BABECC, + inset -5px -5px 10px #ffffff73; +} + +.field input:focus { + box-shadow: inset 1px 1px 2px #BABECC, + inset -1px -1px 2px #ffffff73; +} + +.field span { + position: absolute; + left: 15px; + top: 50%; + transform: translateY(-50%); + color: #595959; + width: 50px; + line-height: 50px; +} + +.field label { + position: absolute; + top: 50%; + transform: translateY(-50%); + left: 45px; + pointer-events: none; + color: #666666; +} + +.field input:valid~label { + opacity: 0; +} + +button { + margin: 15px 0; + width: 100%; + height: 50px; + font-size: 18px; + line-height: 50px; + font-weight: 600; + background: #dde1e7; + border-radius: 25px; + border: none; + outline: none; + cursor: pointer; + color: #595959; + box-shadow: 2px 2px 5px #BABECC, + -5px -5px 10px #ffffff73; +} + +button:focus { + color: #3498db; + box-shadow: inset 2px 2px 5px #BABECC, + inset -5px -5px 10px #ffffff73; +} + +.remember { + text-align: left; + margin: 10px 0 10px 5px; + text-transform: capitalize; +} + +#remember { + accent-color: #fff; +} + +.remember label { + display: flex; + align-items: center; + font-size: 16px; + text-decoration: none; +} + +.remember label p { + margin-left: 8px; +} \ No newline at end of file diff --git a/source/dashboard/assets/image/403.png b/source/dashboard/assets/image/403.png new file mode 100644 index 0000000000000000000000000000000000000000..19fedc94f50465a561d0c4c1906d525423298db1 Binary files /dev/null and b/source/dashboard/assets/image/403.png differ diff --git a/source/dashboard/assets/image/404.png b/source/dashboard/assets/image/404.png new file mode 100644 index 0000000000000000000000000000000000000000..83a8e0e4e5d9c01c979655c31cf99cf53b3756a8 Binary files /dev/null and b/source/dashboard/assets/image/404.png differ diff --git a/source/dashboard/assets/image/login.png b/source/dashboard/assets/image/login.png new file mode 100644 index 0000000000000000000000000000000000000000..94148e83281ff6ab0460b040d47f31e2ca36f296 Binary files /dev/null and b/source/dashboard/assets/image/login.png differ diff --git a/source/dashboard/assets/js/lockkey.js b/source/dashboard/assets/js/lockkey.js new file mode 100644 index 0000000000000000000000000000000000000000..8086b5f4e27b9e60f0928fede8c426855d713579 --- /dev/null +++ b/source/dashboard/assets/js/lockkey.js @@ -0,0 +1,89 @@ +(function () { + function detectDevTools() { + var threshold = 160; + var devToolsOpen = false; + + function checkDevTools() { + if (window.outerWidth - window.innerWidth > threshold || + window.outerHeight - window.innerHeight > threshold) { + devToolsOpen = true; + alert("Developer tools are open!"); + } + } + setInterval(checkDevTools, 1000); + + document.addEventListener("keydown", function (event) { + if (event.key === "F12") { + event.preventDefault(); + event.stopPropagation(); + } + }); + + document.addEventListener("keydown", function (event) { + if ( + (event.ctrlKey && event.shiftKey && event.key === "I") || + (event.ctrlKey && event.shiftKey && event.key === "C") || + (event.ctrlKey && event.shiftKey && event.key === "J") || + (event.ctrlKey && event.key === "U") + ) { + event.preventDefault(); + event.stopPropagation(); + } + }); + + document.addEventListener("contextmenu", function (event) { + event.preventDefault(); + event.stopPropagation(); + }); + + document.addEventListener("copy", function (event) { + event.preventDefault(); + event.stopPropagation(); + }); + + document.addEventListener("cut", function (event) { + event.preventDefault(); + event.stopPropagation(); + }); + document.body.style.userSelect = "none"; + document.body.style.webkitUserSelect = "none"; + document.body.style.mozUserSelect = "none"; + document.body.style.msUserSelect = "none"; + } + + document.addEventListener("DOMContentLoaded", detectDevTools); + + window.onload = function () { + document.addEventListener("contextmenu", function (event) { + event.preventDefault(); + }, false); + + document.addEventListener("keydown", function (event) { + if (event.ctrlKey && event.shiftKey && event.keyCode === 73) { // Ctrl+Shift+I + disabledEvent(event); + } + if (event.ctrlKey && event.shiftKey && event.keyCode === 74) { // Ctrl+Shift+J + disabledEvent(event); + } + if (event.keyCode === 83 && (navigator.platform.match("Mac") ? event.metaKey : event.ctrlKey)) { // Ctrl+S or Cmd+S + disabledEvent(event); + } + if (event.ctrlKey && event.keyCode === 85) { // Ctrl+U + disabledEvent(event); + } + if (event.keyCode === 123) { // F12 + disabledEvent(event); + } + }, false); + + function disabledEvent(event) { + if (event.stopPropagation) { + event.stopPropagation(); + } else if (window.event) { + window.event.cancelBubble = true; + } + event.preventDefault(); + return false; + } + } +})(); diff --git a/source/dashboard/assets/js/login.js b/source/dashboard/assets/js/login.js new file mode 100644 index 0000000000000000000000000000000000000000..b3b5682c6d1562c3de2f86388b1304b22fa96ff0 --- /dev/null +++ b/source/dashboard/assets/js/login.js @@ -0,0 +1,46 @@ +function DOMContentLoaded() { + var formLogin = document.querySelector("form"); + var isSubmitting = false; + + async function formLoginSubmit(event) { + event.preventDefault(); + + if (isSubmitting) + return; + + isSubmitting = true; + + var formData = new FormData(formLogin); + var formDataObject = Object.fromEntries(formData.entries()); + formDataObject.url = "/login"; + formDataObject.remember = formLogin.querySelector("#remember").checked; + + var submitButton = formLogin.querySelector("button"); + submitButton.disabled = true; + + try { + var response = await fetch("/", { + method: "POST", + headers: { + "Content-Type": "application/json" + }, + body: JSON.stringify(formDataObject) + }); + + response = await response.json(); + if (response.isLogin) + window.location.href = "/dashboard"; + else + alert(response.message); + } catch (error) { + console.error(error); + formLogin.reset(); + alert(error.message); + } finally { + submitButton.disabled = false; + isSubmitting = false; + } + } + formLogin.addEventListener("submit", formLoginSubmit); +} +document.addEventListener("DOMContentLoaded", DOMContentLoaded); \ No newline at end of file diff --git a/source/dashboard/index.js b/source/dashboard/index.js new file mode 100644 index 0000000000000000000000000000000000000000..a7b2692856c23e66676ff9852f1d9e7b21612d38 --- /dev/null +++ b/source/dashboard/index.js @@ -0,0 +1,123 @@ +var log = require("../lib/log"); +var utils = require("../lib/utils"); + +var path = require("path"); +var Express = require("express"); +var ExpressWs = require("express-ws"); +var ExpressSession = require("express-session")({ + secret: "không có gì là bí mật.", + resave: false, + saveUninitialized: true, + cookie: { + secure: true + } +}); +var Os = require("os"); +var fs = require("fs"); + +var App = Express(); + +ExpressWs(App); +App.set("view engine", "ejs"); +App.set("views", path.resolve(__dirname, "views")); +App.use("/assets", utils.requestChecked, Express.static(path.resolve(__dirname, "assets"))); +App.use(Express.urlencoded({ extended: true })); +App.use(Express.json()); +App.use(ExpressSession); + +if (global.mira.config.dashboardOptions.resetAccount) { + var { Messenger } = global.mira.apis; + var { adminIDs } = global.mira.config.botOptions; + var templMail = utils.randomStr({ length: 10, letter: true, number: false }) + "@mira.com"; + var templPass = utils.randomStr({ length: 16 }); + global.mira.config = { + dashboardOptions: { + user: templMail, + password: templPass + } + } + + var message = + "==========================" + + "\n• Email: " + templMail + + "\n• Password: " + templPass + + "\n• Timestamp: " + Date.now() + + "\n=========================="; + adminIDs.map(id => Messenger.send(message, id, _ => {})); +} + +App.post("/", function (req, res) { + var { dashboardOptions } = global.mira.config; + var body = req.body; + var status, resData; + + if (body.url === "/login") { + var { username, password, remember } = body; + if (username === dashboardOptions.user && password === dashboardOptions.password) { + req.session.loggedIn = true; + req.session.username = username; + + req.session.cookie.maxAge = remember ? 7 * 24 * 60 * 60 * 1000 : 3 * 60 * 60 * 1000; + req.session.cookie.secure = req.secure || req.headers["x-forwarded-proto"] === "https"; + req.session.cookie.httpOnly = true; + + status = 200; + resData = { + isLogin: true + } + } else { + status = 401; + resData = { + message: "Wrong Username/Password." + } + } + } else if (body.url === "/logout") { + req.session.destroy(); + status = 200; + resData = { + isLogin: false + } + } + + res.status(status || 404); + res.json(resData || {}); +}); + +App.get("/login", function (req, res) { + if (utils.isAuthenticated(req)) + res.redirect("/dashboard"); + else + res.render("login"); +}); + +App.get("/", function (req, res) { + if (utils.isAuthenticated(req)) + res.redirect("/dashboard"); + else + res.redirect("/login"); +}); + +App.use(function (req, res) { + res.status(404); + res.render("404"); +}); + +var interfaces = Os.networkInterfaces(); +var info; + +for (var network in interfaces) { + if (info) + break; + + info = interfaces[network].find(item => !item.internal && item.family === "IPv4"); +} + +var Server = App.listen(global.mira.config.dashboardOptions.port, _ => { + var port = Server.address().port; + + log.info("dashboard.port", port); + log.info("dashboard.ip", info.address); + log.info("dashboard.host", "http://" + info.address + ":" + port); + log.wall(); +}); + diff --git a/source/dashboard/views/403.ejs b/source/dashboard/views/403.ejs new file mode 100644 index 0000000000000000000000000000000000000000..2bd91eea2554343745e14b6d2086f1b30654b5fa --- /dev/null +++ b/source/dashboard/views/403.ejs @@ -0,0 +1,42 @@ + + + + + + + + + + + Sorry, This Page Can't Be Accessed | Mira + + + + + + + + + +
+
+

ERROR CODE: 403

+

OOOPS!!

+

Please go back to the previous page to continue browsing.

+ Go Back +
+
+ +
+
+ + + \ No newline at end of file diff --git a/source/dashboard/views/404.ejs b/source/dashboard/views/404.ejs new file mode 100644 index 0000000000000000000000000000000000000000..e13ef8bd99fd2205866b2378ceb1d79726b8fafb --- /dev/null +++ b/source/dashboard/views/404.ejs @@ -0,0 +1,34 @@ + + + + + + + + + + + Sorry, This Page Can't Be Found | Mira + + + + + + + + +
+
+

ERROR CODE: 404

+

OOOPS!!

+

This page may have been moved, deleted, or may never have existed.

+ Go Home +
+
+ +
+
+ + + \ No newline at end of file diff --git a/source/dashboard/views/login.ejs b/source/dashboard/views/login.ejs new file mode 100644 index 0000000000000000000000000000000000000000..70530e784b36eb602e6fec190f5370043c7d2891 --- /dev/null +++ b/source/dashboard/views/login.ejs @@ -0,0 +1,52 @@ + + + + + + + + + + + Login | Mira + + + + + + + + + + +
+
+
Login
+
+
+ + + +
+
+ + + +
+
+ +
+ +
+
+
+ +
+
+ + + \ No newline at end of file diff --git a/source/database/database.sqlite b/source/database/database.sqlite new file mode 100644 index 0000000000000000000000000000000000000000..097f7a06836806e7ced997b5430006105b0863be Binary files /dev/null and b/source/database/database.sqlite differ diff --git a/source/database/index.js b/source/database/index.js new file mode 100644 index 0000000000000000000000000000000000000000..aaa641595c4f77ac8eaf9a15c714490bd098677d --- /dev/null +++ b/source/database/index.js @@ -0,0 +1,93 @@ +var { DataBase } = global.mira.config.systemOptions; +var log = require("../lib/log"); + +async function SQLiteDataBase(firstConnect = true) { + var sql = require("sequelize"); + var SQL = new sql({ + dialect: "sqlite", + storage: __dirname + "/database.sqlite", + pool: { + max: 20, + min: 0, + acquire: 60000, + idle: 20000 + }, + retry: { + match: [ + /SQLITE_BUSY/, + ], + name: "query", + max: 20 + }, + logging: false, + transactionType: "IMMEDIATE", + define: { + underscored: false, + freezeTableName: true, + charset: "utf8", + dialectOptions: { + collate: "utf8_general_ci" + }, + timestamps: true + }, + sync: { + force: false + } + }); + + try { + await SQL.authenticate(); + log.info("database.authenticate.type", "SQLite"); + await require("./model/user.sqlite3.js")(SQL, sql); + await require("./model/thread.sqlite3.js")(SQL, sql); + return log.wall(); + } catch (error) { + log.error("database.authenticate.error", "SQLite", error.message); + console.log(error); + if (firstConnect) { + log.warn("database.reAuthenticated", "MongoDB"); + var newConfig = global.mira.config; + newConfig.systemOptions.DataBase.type = "mongodb"; + global.mira.config = newConfig; + return MongoDataBase(false); + } else + process.exit(1); + } +} + +async function MongoDataBase(firstConnect = true) { + var { mongoURI } = DataBase; + var Mongo = require("mongoose"); + var mongoRegex = /^(mongodb:\/\/|mongodb+srv:\/\/)[\w.-]+(:\d{2,5})?(\/[\w.-]*)?(\?.*)?$/; + + try { + if (!mongoRegex.test(mongoURI)) + throw new Error("mongoURI is invalid."); + await Mongo.connect(mongoURI); + log.info("database.authenticate.type", "MongoDB"); + await require("./model/user.mongodb.js")(Mongo); + await require("./model/thread.mongodb.js")(Mongo); + return log.wall(); + } catch (error) { + log.error("database.authenticate.error", "MongoDB", error.message); + console.log(error); + if (firstConnect) { + log.warn("database.reAuthenticated", "SQLite"); + var newConfig = global.mira.config; + newConfig.systemOptions.DataBase.type = "sqlite"; + global.mira.config = newConfig; + return SQLiteDataBase(false); + } else + process.exit(1); + } +} + +if (DataBase.type !== "sqlite" && DataBase.type !== "mongodb") { + log.warn("database.notSupport", DataBase.type); + log.warn("database.defaultType"); + var newConfig = global.mira.config; + newConfig.systemOptions.DataBase.type = "sqlite"; + global.mira.config = newConfig; +} + +module.exports = DataBase.type.toLowerCase() === "sqlite" ? SQLiteDataBase : MongoDataBase; \ No newline at end of file diff --git a/source/database/model/thread.mongodb.js b/source/database/model/thread.mongodb.js new file mode 100644 index 0000000000000000000000000000000000000000..02109be924aaa5a782d4d2166080b8c3fbab1487 --- /dev/null +++ b/source/database/model/thread.mongodb.js @@ -0,0 +1,159 @@ +var { apis } = global.mira; +var log = require("../../lib/log"); +var { getType } = require("../../lib/utils"); + +module.exports = async function ThreadDataBase(Client) { + var ThreadShema = new Client.Schema({ + threadID: { + type: Client.Schema.Types.Decimal128, + unique: true, + required: true + }, + name: { + type: String, + required: true, + validate: { + validator: v => v && v.trim().length > 0, + message: "Name must not be empty" + } + }, + info: { + type: Client.Schema.Types.Mixed, + validate: { + validator: function (v) { + try { + JSON.stringify(v); + return true; + } catch (e) { + return false; + } + }, + message: "Info must be a valid JSON object" + } + }, + data: { + type: Client.Schema.Types.Mixed, + validate: { + validator: function (v) { + try { + JSON.stringify(v); + return true; + } catch (e) { + return false; + } + }, + message: "Data must be a valid JSON object" + } + }, + banAt: { + type: Number, + default: 0, + validate: { + validator: v => Number.isInteger(v) && v >= 0, + message: "banAt must be a non-negative integer" + } + }, + reason: { + type: String, + required: false, + validate: { + validator: v => (!v || v.trim().length > 0), + message: "Reason must not be empty if providedy" + } + } + }, { + timestamps: true + }); + + ThreadShema.pre("save", function (next) { + this.updatedAt = Date.now(); + next(); + }); + var Thread = Client.model("Thread", ThreadShema); + + function getAll() { + return Thread.find(); + } + + function find(conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + + return Thread.find(conditions); + } + + async function getInfo(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("threadID must be a string number."); + + var infoObj = await apis.getThreadInfo(threadID); + return infoObj; + } + + async function findOne(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("threadID must be a string number."); + + var thread = await Thread.findOne({ threadID }); + if (!thread) { + await createData(threadID); + thread = await findOne(threadID); + } + + return thread; + } + + async function createData(threadID) { + var info = await getInfo(threadID); + var infoObj = { + threadID, + name: info.name, + money: 0, + info, + data: {}, + banAt: 0, + reason: null + } + delete infoObj.info.name; + await Thread.findOneAndUpdate({ threadID }, infoObj, { upsert: true, new: true }); + log.info("database.create.success", threadID); + return; + } + + async function setData(threadID, data) { + if (isNaN(parseInt(threadID))) + throw new Error("threadID must be a string number."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await Thread.updateOne({ threadID }, { $set: data }); + return; + } + + async function setDataAll(data, conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await Thread.updateMany(conditions, { $set: data }); + return; + } + + async function deleteThread(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("threadID must be a string number."); + await Thread.deleteOne({ threadID }); + return; + } + + log.info("database.model", "Thread.mongodb"); + return global.database.model.Thread = { + getAll, + find, + findOne, + setData, + setDataAll, + deleteThread + } +} \ No newline at end of file diff --git a/source/database/model/thread.sqlite3.js b/source/database/model/thread.sqlite3.js new file mode 100644 index 0000000000000000000000000000000000000000..58aa1416823a4dfcd74e6df24f4460a32f600e67 --- /dev/null +++ b/source/database/model/thread.sqlite3.js @@ -0,0 +1,132 @@ +var { apis } = global.mira; +var log = require("../../lib/log"); +var { getType } = require("../../lib/utils"); + +module.exports = async function ThreadDataBase(SQL, sql) { + var Thread = SQL.define("Thread", { + threadID: { + type: sql.BIGINT, + unique: true + }, + name: { + type: sql.STRING, + allowNull: false, + validate: { + notEmpty: true + } + }, + info: { + type: sql.JSON, + validate: { + isJSON: value => JSON.stringify(value) + } + }, + data: { + type: sql.JSON, + validate: { + isJSON: value => JSON.stringify(value) + } + }, + banAt: { + type: sql.BIGINT, + defaultValue: 0, + validate: { + isInt: true, + min: 0 + } + }, + reason: { + type: sql.STRING, + allowNull: true, + validate: { + notEmpty: true + } + } + }); + + Thread.sync({ force: false }); + + function getAll() { + return Thread.findAll(); + } + + function find(conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + + return Thread.findAll({ where: conditions }); + } + + async function getInfo(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("ThreadID must be a string number."); + + var infoObj = await apis.getThreadInfo(threadID); + return infoObj; + } + + async function findOne(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("ThreadID must be a string number."); + + var threadData = await Thread.findOne({ where: { threadID } }); + if (!threadData) { + await createData(threadID); + return await findOne(threadID); + } + + return threadData.get({ plain: true }); + } + + async function createData(threadID) { + var info = await getInfo(threadID); + var infoObj = { + threadID, + name: info.name, + money: 0, + info, + data: {} + } + delete infoObj.info.name; + await Thread.findOrCreate({ where: { threadID }, defaults: infoObj }); + log.info("database.create.success", threadID); + return; + } + + async function setData(threadID, data) { + if (isNaN(parseInt(threadID))) + throw new Error("ThreadID must be a string number."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await Thread.update(data, { where: { threadID } }); + return; + } + + async function setDataAll(data, conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await Thread.update(data, { where: conditions }); + return; + } + + async function deleteThread(threadID) { + if (isNaN(parseInt(threadID))) + throw new Error("threadID must be a string number."); + await Thread.destroy({ where: { threadID } }); + return; + } + + log.info("database.model", "Thread.sqlite3"); + return global.database.model.Thread = { + getAll, + find, + findOne, + setData, + setDataAll, + deleteThread + } +} \ No newline at end of file diff --git a/source/database/model/user.mongodb.js b/source/database/model/user.mongodb.js new file mode 100644 index 0000000000000000000000000000000000000000..5a2c35740849d04cc245bbbe37ca4b0191e96e11 --- /dev/null +++ b/source/database/model/user.mongodb.js @@ -0,0 +1,167 @@ +var { apis } = global.mira; +var log = require("../../lib/log"); +var { getType } = require("../../lib/utils"); + +module.exports = async function UserDataBase(Client) { + var UserShema = new Client.Schema({ + userID: { + type: Client.Schema.Types.Decimal128, + unique: true, + required: true + }, + name: { + type: String, + required: true, + validate: { + validator: v => v && v.trim().length > 0, + message: "Name must not be empty" + } + }, + money: { + type: Client.Schema.Types.Decimal128, + default: 0, + validate: { + validator: v => Number.isInteger(v) && v >= 0, + message: "Money must be a non-negative integer" + } + }, + info: { + type: Client.Schema.Types.Mixed, + validate: { + validator: function (v) { + try { + JSON.stringify(v); + return true; + } catch (e) { + return false; + } + }, + message: "Info must be a valid JSON object" + } + }, + data: { + type: Client.Schema.Types.Mixed, + validate: { + validator: function (v) { + try { + JSON.stringify(v); + return true; + } catch (e) { + return false; + } + }, + message: "Data must be a valid JSON object" + } + }, + banAt: { + type: Number, + default: 0, + validate: { + validator: v => Number.isInteger(v) && v >= 0, + message: "banAt must be a non-negative integer" + } + }, + reason: { + type: String, + required: false, + validate: { + validator: v => (!v || v.trim().length > 0), + message: "Reason must not be empty if providedy" + } + } + }, { + timestamps: true + }); + + UserShema.pre("save", function (next) { + this.updatedAt = Date.now(); + next(); + }); + var User = Client.model("User", UserShema); + + function getAll() { + return User.find(); + } + + function find(conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + + return User.find(conditions); + } + + async function getInfo(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + + var infoObj = await apis.getUserInfo(userID); + return infoObj[userID] || {} + } + + async function findOne(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + + var user = await User.findOne({ userID }); + if (!user) { + await createData(userID); + user = await findOne(userID); + } + + return user; + } + + async function createData(userID) { + var info = await getInfo(userID); + var infoObj = { + userID, + name: info.name || "User", + money: 0, + info, + data: {}, + banAt: 0, + reason: null + } + delete infoObj.info.name; + await User.findOneAndUpdate({ userID }, infoObj, { upsert: true, new: true }); + log.info("database.create.success", userID); + return; + } + + async function setData(userID, data) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await User.updateOne({ userID }, { $set: data }); + return; + } + + async function setDataAll(data, conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await User.updateMany(conditions, { $set: data }); + return; + } + + async function deleteUser(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + await User.deleteOne({ userID }); + return; + } + + log.info("database.model", "User.mongodb"); + return global.database.model.User = { + getAll, + find, + findOne, + setData, + setDataAll, + deleteUser + } +} \ No newline at end of file diff --git a/source/database/model/user.sqlite3.js b/source/database/model/user.sqlite3.js new file mode 100644 index 0000000000000000000000000000000000000000..1090db20780202b6a90af11a09d31c2ccfc9d8d4 --- /dev/null +++ b/source/database/model/user.sqlite3.js @@ -0,0 +1,142 @@ +var { apis } = global.mira; +var log = require("../../lib/log"); +var { getType } = require("../../lib/utils"); + +module.exports = async function UserDataBase(SQL, sql) { + var User = SQL.define("User", { + userID: { + type: sql.BIGINT, + unique: true + }, + name: { + type: sql.STRING, + allowNull: false, + validate: { + notEmpty: true + } + }, + money: { + type: sql.BIGINT, + defaultValue: 0, + validate: { + isInt: true, + min: 0 + } + }, + info: { + type: sql.JSON, + validate: { + isJSON: value => JSON.stringify(value) + } + }, + data: { + type: sql.JSON, + validate: { + isJSON: value => JSON.stringify(value) + } + }, + banAt: { + type: sql.BIGINT, + defaultValue: 0, + validate: { + isInt: true, + min: 0 + } + }, + reason: { + type: sql.STRING, + allowNull: true, + validate: { + notEmpty: true + } + } + }); + + User.sync({ force: false }); + + function getAll() { + return User.findAll(); + } + + function find(conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + + return User.findAll({ where: conditions }); + } + + async function getInfo(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + + var infoObj = await apis.getUserInfo(userID); + return infoObj[userID] || {} + } + + async function findOne(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + + var userData = await User.findOne({ where: { userID } }); + if (!userData) { + await createData(userID); + return await findOne(userID); + } + + return userData.get({ plain: true }); + } + + async function createData(userID) { + var info = await getInfo(userID); + var infoObj = { + userID, + name: info.name || "User", + money: 0, + info, + data: {}, + banAt: 0, + reason: null + } + delete infoObj.info.name; + await User.findOrCreate({ where: { userID }, defaults: infoObj }); + log.info("database.create.success", userID); + return; + } + + async function setData(userID, data) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await User.update(data, { where: { userID } }); + return; + } + + async function setDataAll(data, conditions = {}) { + if (getType(conditions) !== "Object") + throw new Error("conditions must be an JSON Object."); + if (getType(data) !== "Object") + throw new Error("data must be an JSON Object."); + + await User.update(data, { where: conditions }); + return; + } + + async function deleteUser(userID) { + if (isNaN(parseInt(userID))) + throw new Error("userID must be a string number."); + await User.destroy({ where: { userID } }); + return; + } + + log.info("database.model", "User.sqlite3"); + return global.database.model.User = { + getAll, + find, + findOne, + setData, + setDataAll, + deleteUser + } +} \ No newline at end of file diff --git a/source/index.js b/source/index.js new file mode 100644 index 0000000000000000000000000000000000000000..b66ca463427e952b7e174ffb340889a9117e4d51 --- /dev/null +++ b/source/index.js @@ -0,0 +1,27 @@ +var { spawn } = require("child_process"); +var { version, name } = require("../package.json"); +var log = require("./lib/log"); + +function RunSystem() { + log.wall(); + log.info("process.name", name); + log.info("process.version", version); + var Mira = spawn("node", ["mira.js"], { + cwd: __dirname, + stdio: "inherit", + shell: true + }); + + Mira.on("close", exitCode => { + if (exitCode === 2) { + log.info("process.restarting"); + setTimeout(_ => { + console.clear(); + RunSystem(); + }, 5000); + } else { + log.info("process.exit", exitCode); + } + }); +} +RunSystem(); \ No newline at end of file diff --git a/source/languages/en-US.json b/source/languages/en-US.json new file mode 100644 index 0000000000000000000000000000000000000000..173b34a44ac19da41269db9620a04811968662db --- /dev/null +++ b/source/languages/en-US.json @@ -0,0 +1,76 @@ +{ + "process": { + "name": "Source: %1", + "version": "Version: %1", + "restart": "Restart After: %1ms", + "restarting": "Restarting...", + "exit": "Shutdown With Code: %1" + }, + "database": { + "authenticate": { + "type": "DataBase: %1", + "error": "Unable To Connect To DataBase %1, Error: %2" + }, + "reAuthenticated": "Reconnecting To DataBase: %1", + "model": "Connect Model: %1", + "create": { + "success": "Created Data For: %1", + "fail": "Unable To Create Data For %1, Error: %2" + } + }, + "dashboard": { + "port": "Port: %1", + "ip": "IP: %1", + "host": "URL: %1" + }, + "facebook": { + "login": { + "user": "User: %1", + "notUser": "User Undefined.", + "region": "Region: %1", + "notRegion": "Cant Detemined Region.", + "error": "Cant Login.", + "wrong": "Wrong Login Information.", + "missTimeCheckpoint": "Approve Waiting Time Expired.", + "checkpoint": "You Have Checkpoint Enabled. Please Approve.", + "reconnect": "Reconnecting.", + "logout": "Connection Lost.", + "checkpointImage": "You Have Enabled Checkpoint Visuals. Please Login Again Using Cookie..." + }, + "relogin": { + "force": "Reconnecting.", + "error": "Cant Login Again." + }, + "missing": "Missing Login Information.", + "apis": "Loaded: %1 APIs", + "access": { + "token": "Token: %1", + "error": "Cant Get Token, Error: %1", + "codeSMS": "Code: ", + "checkpoint": "You Have Enabled Checkpoint.", + "wrongSMS": "Wrong Code." + }, + "refreshCookie": "Refreshed: %1" + }, + "control": { + "modules": { + "len": "Success Loaded %1 Modules", + "reload": "Reloaded %1." + }, + "model": { + "connect": "Model Control Connection Successful!", + "notExist": "Command \"%1\" does not exist, is it \"%2\"?", + "noPluginCalled": "Use %1help list to see a list of commands!", + "userBanned": "You are unable to use bot!\nReason: %1\nBan at: %2", + "threadBanned": "Your thread are unable to use bot!\nReason: %1\nBan at: %2" + }, + "Client": { + "connect": "Mqtt Connection Successful!", + "error": "Mqtt An Error Occurred: %1" + } + }, + "updater": { + "newVersion": "Version %1 Has Officially Launched, Link: https://github.com/GiaKhang1810/mira-bot-v1/blob/main/changelog.json", + "error": "Unable to Update, Please Update Manually, Error: %1" + } +} diff --git a/source/languages/vi-VN.json b/source/languages/vi-VN.json new file mode 100644 index 0000000000000000000000000000000000000000..18c252b8f77b169c643df4853399935c0357967c --- /dev/null +++ b/source/languages/vi-VN.json @@ -0,0 +1,70 @@ +{ + "process": { + "name": "Mã Nguồn: %1", + "version": "Phiên Bản: %1", + "restart": "Khởi Động Lại Sau: %1ms", + "restarting": "Đang Khởi Động Lại...", + "exit": "Đã Tắt Hệ Thống Với Mã: %1" + }, + "database": { + "authenticate": { + "type": "DataBase: %1", + "error": "Không Thể Kết Nối DataBase %1, Lỗi: %2" + }, + "reAuthenticated": "Đang Kết Nối Lại DataBase: %1", + "model": "Kết Nối Model: %1", + "create": { + "success": "Đã Tạo Dữ Liệu Cho: %1", + "fail": "Không Thể Tạo Dữ Liệu Cho %1, Lỗi: %2" + } + }, + "dashboard": { + "port": "Cổng: %1", + "ip": "IP: %1", + "host": "URL: %1" + }, + "facebook": { + "login": { + "user": "Tài Khoản: %1", + "notUser": "Không Tìm Thấy Tài Khoản.", + "region": "Khu Vực: %1", + "notRegion": "Không Thể Xác Định Khu Vực.", + "error": "Không Thể Đăng Nhập.", + "wrong": "Sai Thông Tin Đăng Nhập.", + "missTimeCheckpoint": "Hết Thời Gian Chờ Xét Duyệt.", + "checkpoint": "Bạn Đã Bật Checkpoint. Vui Lòng Xét Duyệt.", + "reconnect": "Đang Đăng Nhập Lại.", + "logout": "Đã Bị Mất Kết Nối.", + "checkpointImage": "Bạn Đã Bật Checkpoint Photo. Vui Lòng Đăng Nhập Lại Bằng Cookie..." + }, + "relogin": { + "force": "Đang Đăng Nhập Lại.", + "error": "Không Thể Đăng Nhập Lại." + }, + "missing": "Thiếu Thông Tin Đăng Nhập.", + "apis": "Tải Thành Công: %1 APIs", + "access": { + "token": "Token: %1", + "error": "Không Thể Lấy Token, Lỗi: %1", + "codeSMS": "Mã: ", + "checkpoint": "Bạn Đã Bật Checkpoint.", + "wrongSMS": "Sai Mã." + }, + "refreshCookie": "Đã Làm Mới: %1" + }, + "control": { + "modules": { + "len": "Tải Thành Công %1 Modules.", + "reload": "Đã Cập Nhật %1." + }, + "model": "Kết Nối Model Control Thành Công!", + "Client": { + "connect": "Mqtt Kết Nối Thành Công!", + "error": "Mqtt Đã Xảy Ra Lỗi: %1" + } + }, + "updater": { + "newVersion": "Phiên Bản %1 Đã Chính Thức Ra Mắt, Link: https://github.com/GiaKhang1810/mira-bot-v1/blob/main/changelog.json", + "error": "Không Thể Cập Nhật, Vui Lòng Cập Nhật Thủ Công, Lỗi: %1" + } +} diff --git a/source/lib/log.js b/source/lib/log.js new file mode 100644 index 0000000000000000000000000000000000000000..40eed9d665e0ffd09b4ab03b5ebf1a0116469030 --- /dev/null +++ b/source/lib/log.js @@ -0,0 +1,126 @@ +var { getTime } = require("./utils.js"); +var { existsSync } = require("fs"); + +function color(text) { + return { + black: "\x1b[30m" + text + "\x1b[0m", + red: "\x1b[31m" + text + "\x1b[0m", + green: "\x1b[32m" + text + "\x1b[0m", + yellow: "\x1b[33m" + text + "\x1b[0m", + blue: "\x1b[34m" + text + "\x1b[0m", + magenta: "\x1b[35m" + text + "\x1b[0m", + cyan: "\x1b[36m" + text + "\x1b[0m", + white: "\x1b[37m" + text + "\x1b[0m", + bgBlack: "\x1b[40m" + text + "\x1b[0m", + bgRed: "\x1b[41m" + text + "\x1b[0m", + bgGreen: "\x1b[42m" + text + "\x1b[0m", + bgYellow: "\x1b[43m" + text + "\x1b[0m", + bgBlue: "\x1b[44m" + text + "\x1b[0m", + bgMagenta: "\x1b[45m" + text + "\x1b[0m", + bgCyan: "\x1b[46m" + text + "\x1b[0m", + bgWhite: "\x1b[47m" + text + "\x1b[0m" + } +} + +function parseDir(dir, inputs = []) { + try { + var { language } = require("../../config.json").systemOptions; + var languagePath = __dirname + "/../languages/" + language + ".json"; + + if (!existsSync(languagePath)) + languagePath = __dirname + "/../languages/vi-VN.json"; + + if (/^([^.]+)(\.[^.]+)*$/.test(dir)) { + var languageData = require(languagePath); + var ArrayKey = dir.split("."); + var content = languageData; + + for (var key of ArrayKey) + content = content[key]; + + if (inputs.length > 0) { + for (var index = 1; index <= inputs.length; index++) + content = content.replace("%" + index, inputs[index - 1]); + } + + return content; + } + return dir; + } catch (error) { + console.log(error); + return dir; + } +} + +function info(dir, ...inputs) { + inputs = !inputs ? [] : inputs; + var time = getTime(); + var content = parseDir(dir, inputs); + var output = color("[ " + time + " ] ").green + content; + return console.log(output); +} + +function warn(dir, ...inputs) { + inputs = !inputs ? [] : inputs; + var time = getTime(); + var content = parseDir(dir, inputs); + var output = color("[ " + time + " ] ").yellow + content; + return console.log(output); +} + +function error(dir, ...inputs) { + inputs = !inputs ? [] : inputs; + var time = getTime(); + var content = parseDir(dir, inputs); + var output = color("[ " + time + " ] ").red + content; + return console.log(output); +} + +function wall() { + var content = color("====================================================").blue; + return console.log(content); +} + +function input(dir, col = "green", timeout = 30000) { + var time = getTime(); + var content = parseDir(dir, []); + var output = color("[ " + time + " ] ")[col] + content; + process.stdout.write(output); + return new Promise((resolve, reject) => { + var data = ""; + var inputReceived = false; + var timer = setTimeout(() => { + if (!inputReceived) { + process.stdout.write("\n"); + resolve(data.trim()); + } + }, timeout); + process.stdin.setEncoding("utf8"); + process.stdin.on("data", (chunk) => { + clearTimeout(timer); + data += chunk; + inputReceived = true; + process.stdin.pause(); + resolve(data.trim()); + }); + process.stdin.on("error", (err) => { + clearTimeout(timer); + reject(err); + }); + process.stdin.on("end", () => { + clearTimeout(timer); + resolve(data.trim()); + }); + process.stdin.resume(); + }); +} + +module.exports = { + info, + warn, + error, + wall, + color, + input, + parseDir +} \ No newline at end of file diff --git a/source/lib/utils.js b/source/lib/utils.js new file mode 100644 index 0000000000000000000000000000000000000000..8c5e13dbbde8471d03c0fee1df56f7b6c70b4d97 --- /dev/null +++ b/source/lib/utils.js @@ -0,0 +1,155 @@ +var fs = require("fs"); +var path = require("path"); + +function getType(data) { + return Object.prototype.toString.call(data).slice(8, -1); +} + +function getTime(format = "HH:mm:ss DD/MM/YYYY", time = new Date(Date.now()), options = { + hour12: false, + day: "numeric", + month: "numeric", + year: "numeric", + weekday: "long", + hour: "2-digit", + minute: "2-digit", + second: "2-digit" +}) { + var { time_zone, language } = require("../../config.json").systemOptions; + if (time_zone === "vi-VN" || time_zone === "en-US") { + if (getType(time) === "Number" || getType(time) === "String") + time = new Date(time); + + options.timeZone = time_zone; + + var lastTime = time.toLocaleString(language, options); + return format.replace(/HH|mm|ss|DD|MM|YYYY|dddd/g, function (key) { + if (time_zone === "vi-VN") { + if (key === "HH") + return lastTime.slice(0, 2); + else if (key === "mm") + return lastTime.slice(3, 5); + else if (key === "ss") + return lastTime.slice(6, 8); + else if (key === "dddd") + return lastTime.split(",")[0].slice(9, lastTime.length); + else { + var date = lastTime.split(", ")[1].split("/"); + if (key === "DD") + return date[0]; + else if (key === "MM") + return date[1]; + else if (key === "YYYY") + return date[2]; + } + } else { + var [day, date, time] = lastTime.split(", "); + if (key === "HH") + return time.slice(0, 2); + else if (key === "mm") + return time.slice(3, 5); + else if (key === "ss") + return time.slice(6, 8); + else if (key === "dddd") + return day; + else { + date = date.split("/"); + if (key === "DD") + return date[0]; + else if (key === "MM") + return date[1]; + else if (key === "YYYY") + return date[2]; + } + } + }); + } else { + var moment = require("moment-timezone").tz(time, time_zone); + return moment.format(format); + } +} + +function isAuthenticated(req) { + return req.session && req.session.loggedIn === true; +} + +function requestChecked(req, res, next) { + var headers = req.headers; + + if (headers.referer || headers.origin) + next(); + else { + res.status(403); + res.render("403"); + } +} + +function isPath(url) { + try { + var resolveURL = path.resolve(url); + return resolveURL === url || resolveURL === path.normalize(url); + } catch (error) { + return false; + } +} + +function isURL(url) { + try { + new URL(url); + return true; + } catch (error) { + return false; + } +} + +function randomStr({ length = 10, number = true, letter = true, symbol = false }) { + var numberChars = "0123456789"; + var letterChars = "ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"; + var symbolChars = "!@#$%^&*()_+[]{}|;:',.<>/?"; + var characterPool = ""; + + if (number) + characterPool += numberChars; + if (letter) + characterPool += letterChars; + if (symbol) + characterPool += symbolChars; + if (!characterPool) + throw new Error("At least one character type should be selected."); + + var randomString = ""; + for (var i = 0; i < length; i++) { + var index = Math.floor(Math.random() * characterPool.length); + randomString += characterPool[index]; + } + + return randomString; +} + +function createMessenger(apis, info) { + var { Messenger } = apis; + return { + getText: _ => _, + send: function (message, ...inputs) { + inputs = !inputs ? [] : inputs; + return Messenger.send(this.getText(message, inputs), info.threadID); + }, + unsend: messageID => Messenger.unsend(messageID), + reply: function (message, ...inputs) { + inputs = !inputs ? [] : inputs; + return Messenger.send(this.getText(message, inputs), info.threadID, info.messageID); + }, + react: icon => Messenger.react(icon, info.threadID, info.messageID) + } +} + +module.exports = { + getTime, + getType, + isAuthenticated, + requestChecked, + isPath, + isURL, + randomStr, + createMessenger +} diff --git a/source/mira.js b/source/mira.js new file mode 100644 index 0000000000000000000000000000000000000000..89754de7b7e67c3a521ed8d0c791b7ea78ee767a --- /dev/null +++ b/source/mira.js @@ -0,0 +1,146 @@ +process.on("unhandledRejection", console.log); +process.on("uncaughtException", console.log); + +var log = require("./lib/log"); +var utils = require("./lib/utils"); +var config = require("../config.json"); + +var fs = require("fs"); +var path = require("path"); +var axios = require("axios"); + +var dirConfig = path.resolve(__dirname, "..", "config.json"); +var dirConfigCommands = path.resolve(__dirname, "..", "configCommands.json"); + +function mergeObjects(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + if (source[key] === null || source[key] === undefined) + delete target[key]; + else if (typeof source[key] === "object" && !Array.isArray(source[key]) && source[key] !== null) { + if (!target[key] || typeof target[key] !== "object" || Array.isArray(target[key])) + target[key] = {} + mergeObjects(target[key], source[key]); + } else + target[key] = source[key]; + } + } + return target; +} + +function mergeObjectsPrimitives(target, source) { + for (var key in source) { + if (source.hasOwnProperty(key)) { + if (typeof source[key] !== "object" || Array.isArray(source[key]) || source[key] === null) { + if (target.hasOwnProperty(key)) + target[key] = source[key]; + } else if (typeof target[key] === "object" && target[key] !== null && !Array.isArray(target[key])) + mergeObjectsPrimitives(target[key], source[key]); + } + } + return target; +} + +global.mira = { + dir: path.resolve(__dirname, ".."), + dirConfig, + dirConfigCommands, + get configCommands() { + return require(this.dirConfigCommands); + }, + set configCommands(value) { + if (utils.getType(value) === "Object") { + var lastConfig = require(this.dirConfigCommands); + lastConfig = mergeObjects(lastConfig, value); + fs.writeFileSync(this.dirConfigCommands, JSON.stringify(lastConfig, null, 4)); + } + }, + get config() { + return require(this.dirConfig); + }, + set config(value) { + if (utils.getType(value) === "Object") { + var lastConfig = require(this.dirConfig); + lastConfig = mergeObjectsPrimitives(lastConfig, value); + fs.writeFileSync(this.dirConfig, JSON.stringify(lastConfig, null, 4)); + } + }, + apis: null, + Client: null +} + +global.modules = { + cmds: [], + Reply: {}, + Reaction: {}, + Schedule: {} +} + +global.database = { + model: {}, + cache: [] +} + +function watchAndDeleteCache(dir) { + fs.watch(dir, type => type === "change" ? (function () { + delete require.cache[dir]; + })() : null); +} + +watchAndDeleteCache(dirConfig); +watchAndDeleteCache(dirConfigCommands); + +function compare(str_1, str_2) { + var bool; + var comparseString = string => { + var [type, version] = string.split("-"); + version = Number(version.split(".").join("")); + return { type, version } + } + + var test_1 = comparseString(str_1); + var test_2 = comparseString(str_2); + + if (test_1.version > test_2.version) + bool = true; + else if (test_1.version < test_2.version) + bool = false; + else if (test_1.type === "release" && test_2.type === "beta") + bool = true; + else if (test_1.type === "beta" && test_2.type === "release") + bool = false; + else + bool = false; + + return bool; +} + +if (config.systemOptions.autoRestart.enable && parseInt(config.systemOptions.autoRestart.timeMS) > 0) { + log.info("process.restart", config.systemOptions.autoRestart.timeMS); + setTimeout(process.exit, config.systemOptions.autoRestart.timeMS, 2); +} + +(async () => { + log.wall(); + var currentVersion = require("../package.json").version; + var lastVersion = (await axios.get("https://raw.githubusercontent.com/GiaKhang1810/mira-bot-v1/main/package.json")).data.version; + if (compare(lastVersion, currentVersion)) { + log.warn("updater.newVersion", lastVersion, "https://github.com/GiaKhang1810/mira-bot-v1/"); + if (config.systemOptions.autoUpdate.enable) { + var type = lastVersion.split("-")[0]; + if (!config.systemOptions.autoUpdate.releaseOnly || config.systemOptions.autoUpdate.releaseOnly && type === "release") { + return require("./updater"); + } + } + } + + await require("./apis")(); + if (config.facebookAPIsOptions.autoRefreshState) { + fs.writeFileSync(global.mira.dir + "/" + config.facebookAccountOptions.facebookState, JSON.stringify(global.mira.apis.getAppState(), null, 2)); + log.info("facebook.refreshCookie", config.facebookAccountOptions.facebookState); + } + log.wall(); + await require("./database")(); + await require("./control")(); + return require("./dashboard"); +})(); diff --git a/source/updater.js b/source/updater.js new file mode 100644 index 0000000000000000000000000000000000000000..77e9d75e240b39082a11d3230b13463a1eaacde0 --- /dev/null +++ b/source/updater.js @@ -0,0 +1,84 @@ +var uri = "https://raw.githubusercontent.com/GiaKhang1810/mira-bot-v1/main/"; +var axios = require("axios"); +var path = require("path"); +var fs = require("fs"); +var dir = path.resolve(__dirname, "..") + "/"; +var log = require("./lib/log"); +var { execSync } = require("child_process"); +var changelog; + +function getExtension(param) { + var ext = path.extname(param).toLowerCase().split(".").pop(); + switch (ext) { + case "json": + return "json"; + case "js": + case "css": + case "ejs": + return "text"; + default: + return "binary"; + } +} + +async function readChangelog() { + var res = await axios.get(uri + "/changelog.json"); + changelog = res.data; + fs.writeFileSync(dir + "/changelog.json", JSON.stringify(changelog, null, 4)); + changelog = changelog[Object.keys(changelog).pop()]; + return; +} + +async function Writer() { + for (var param in changelog) { + var ext = getExtension(param); + var url = uri + param; + var res = await axios.get(url, { responseType: ext === "binary" ? "arraybuffer" : "text" }); + var data; + var pathWrite = path.resolve(dir, param); + var Dir = path.dirname(pathWrite); + if (!fs.existsSync(Dir)) + fs.mkdirSync(Dir, { recursive: true }); + + switch (ext) { + case "json": + data = JSON.stringify(JSON.parse(res.data), null, 4); + break; + case "text": + data = res.data; + break; + default: + data = Buffer.from(res.data, "utf-8"); + break; + } + fs.writeFileSync(pathWrite, data); + } + return; +} + +async function finishedUpdate() { + var url = uri + "package.json"; + var res = await axios.get(url); + var data = JSON.stringify(res.data, null, 4); + var pathWrite = path.resolve(dir, "package.json"); + fs.writeFileSync(pathWrite, data); + execSync("npm install", { + cwd: __dirname, + stdio: "inherit", + shell: true + }); + return; +} + +(async () => { + try { + await readChangelog(); + await Writer(); + await finishedUpdate(); + process.exit(2); + } catch (error) { + log.error("updater.error", error.message); + console.log(error); + return process.exit(1); + } +})();