From b31ba78b93d1fb37415a745be168aa0a4367638e Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Wed, 22 Sep 2021 22:56:10 -0300 Subject: [PATCH 1/9] Add new Bds Maneger Core CLI Dependecies add: - inquirer - ora Changes to be committed: modified: .gitignore modified: bin/bds_maneger.js new file: bin/bds_maneger/menus.js new file: bin/bds_maneger_v2.js modified: lib/BdsSettings.js modified: package-lock.json modified: package.json modified: src/BdsServersDownload.js --- .gitignore | 6 - bin/bds_maneger.js | 1 + bin/bds_maneger/menus.js | 86 ++++ bin/bds_maneger_v2.js | 77 ++++ lib/BdsSettings.js | 3 +- package-lock.json | 949 ++++++++++++++++++++++++++++++++++++-- package.json | 2 + src/BdsServersDownload.js | 165 ++++++- 8 files changed, 1243 insertions(+), 46 deletions(-) create mode 100644 bin/bds_maneger/menus.js create mode 100644 bin/bds_maneger_v2.js diff --git a/.gitignore b/.gitignore index 3d9a409..d42e3b3 100644 --- a/.gitignore +++ b/.gitignore @@ -9,16 +9,10 @@ Test/ # Node node_modules/ -Bds_Maneger .dccache docs/ the-bds-maneger-core-*.tgz -# Bds Maneger Core Binaries -bds_maneger -BdsManager-bin* -Bds-Maneger-Core - # ** .husky Servers diff --git a/bin/bds_maneger.js b/bin/bds_maneger.js index fe076e4..d6d6dbd 100755 --- a/bin/bds_maneger.js +++ b/bin/bds_maneger.js @@ -9,6 +9,7 @@ process.env.IS_BDS_CLI = process.env.IS_BIN_BDS = true; const argv = require("minimist")(process.argv.slice(2)); if (Object.getOwnPropertyNames(argv).length <= 1) argv.help = true +// Bds Core Imports const bds = require("../index"); const SystemInfo = require("../lib/BdsSystemInfo"); const { bds_dir, GetServerVersion, GetPlatform, UpdatePlatform, GetServerPaths, GetPaths } = require("../lib/BdsSettings"); diff --git a/bin/bds_maneger/menus.js b/bin/bds_maneger/menus.js new file mode 100644 index 0000000..155f680 --- /dev/null +++ b/bin/bds_maneger/menus.js @@ -0,0 +1,86 @@ +// Import Node Modules +const fs = require("fs"); + +// Import external modules +const inquirer = require("inquirer"); + +// Bds Core +const { getBdsConfig } = require("../../index"); +const { GetPaths } = require("../../lib/BdsSettings"); + +const GetPlayers = (Platform = getBdsConfig().server.platform) => [...JSON.parse(fs.readFileSync(GetPaths("player"), "utf8"))[Platform]]; + +async function TpMenu() { + const { BdsRun } = require("../../src/BdsManegerServer"); + const playerList = GetPlayers().map(player => player.Player && player.Action === "connect" ? player.Player : null).filter(a => a); + + // Check if there are players online + if (playerList.length > 0) { + const Player = await inquirer.prompt([ + { + type: "list", + name: "player", + message: "Select a player", + choices: playerList + } + ]); + + // Ask X, Y and Z Cordinates + const cords = await inquirer.prompt([ + { + type: "input", + name: "x", + message: "X Cordinate", + validate: function (value) { + if (isNaN(value) === false) { + return true; + } + return "Please enter a number"; + } + }, + { + type: "input", + name: "y", + message: "Y Cordinate", + validate: function (value) { + if (isNaN(value) === false) { + return true; + } + return "Please enter a number"; + } + }, + { + type: "input", + name: "z", + message: "Z Cordinate", + validate: function (value) { + if (isNaN(value) === false) { + return true; + } + return "Please enter a number"; + } + } + ]); + return BdsRun.tp(Player.player, { + x: parseInt(cords.x), + y: parseInt(cords.y), + z: parseInt(cords.z) + }); + } else throw new Error("No players online"); +} + +async function Command() { + const { BdsRun } = require("../../src/BdsManegerServer"); + const Command = await inquirer.prompt([ + { + type: "input", + name: "command", + message: "Enter a command" + } + ]); + return BdsRun.command(Command.command); +} + +module.exports.Command = Command; +module.exports.TpMenu = TpMenu; +TpMenu(); \ No newline at end of file diff --git a/bin/bds_maneger_v2.js b/bin/bds_maneger_v2.js new file mode 100644 index 0000000..ce268e3 --- /dev/null +++ b/bin/bds_maneger_v2.js @@ -0,0 +1,77 @@ +#!/usr/bin/env node +if (process.platform === "win32") process.title = "Bds Maneger CLI"; else process.title = "Bds-Manger-CLI"; +process.env.IS_BDS_CLI = process.env.IS_BIN_BDS = true; + +// External Modules +const cli_color = require("cli-color"); +const inquirer = require("inquirer"); + +// Bin Args +const ProcessArgs = require("minimist")(process.argv.slice(2)); + +// Import Bds Core +const BdsCore = require("../index"); + +// Async functiona +async function Runner() { + // ESM Modules + const ora = (await import("ora")).default; + + // Update Bds Core Platform + if (ProcessArgs.platform || ProcessArgs.p) { + const UpdatePla = ora("Updating Bds Platform").start(); + try { + BdsCore.platform_update(ProcessArgs.platform || ProcessArgs.p); + UpdatePla.succeed(`Now the platform is the ${ProcessArgs.platform || ProcessArgs.p}`); + } catch (error) { + UpdatePla.fail(`Unable to update platform to ${ProcessArgs.platform || ProcessArgs.p}`); + process.exit(1); + } + } + + // Download + if (ProcessArgs.download || ProcessArgs.d) { + const oraDownload = ora("Downloading...").start(); + try { + const DownloadInfo = await BdsCore.download.v2(ProcessArgs.d || ProcessArgs.download, true); + const DownloadSucess = ["Downloaded Successfully"]; + if (DownloadInfo.version) DownloadSucess.push(`Version: ${DownloadInfo.version}`); + if (DownloadInfo.data) DownloadSucess.push(`Data: ${DownloadInfo.data}`); + if (DownloadInfo.platform) DownloadSucess.push(`Bds Core Platform: ${DownloadInfo.platform}`); + oraDownload.succeed(DownloadSucess.join(", ")) + } catch (error) { + oraDownload.fail(error.message); + process.exit(1); + } + } + + // Start + const BdsCoreStart = BdsCore.start(); + BdsCoreStart.log(data => process.stdout.write(cli_color.blueBright(data))); + BdsCoreStart.exit(code => { + console.log(cli_color.redBright(`Bds Core Exit with code ${code}, Uptimed: ${BdsCoreStart.uptime}`)); + process.exit(code); + }); + const BdsCliMenus = require("./bds_maneger/menus"); + const InfinitCommands = async () => { + const CommandtoRun = (await inquirer.prompt([ + { + type: "list", + name: "commands", + message: "Select a command", + choices: [ + "tp" + ] + } + ])).commands; + if (CommandtoRun === "tp") { + BdsCliMenus.tp(); + return await InfinitCommands(); + } else { + BdsCliMenus.Command(); + return await InfinitCommands(); + } + } + InfinitCommands(); +} +Runner(); \ No newline at end of file diff --git a/lib/BdsSettings.js b/lib/BdsSettings.js index 536eb7c..2d4bc12 100644 --- a/lib/BdsSettings.js +++ b/lib/BdsSettings.js @@ -50,7 +50,6 @@ var Config = { bedrock: null, java: null, pocketmine: null, - jsprismarine: null, spigot: null, }, Settings: { @@ -155,6 +154,7 @@ function GetPaths(path = null){ function GetServerPaths(path = null){ if (!(path)) throw new Error("Set path to get"); if (!(ServersPaths[path])) throw new Error("Put a valid path: " + Object.getOwnPropertyNames(ServersPaths).join(", ")); + if (path === "all") return ServersPaths return ServersPaths[path] } @@ -275,6 +275,7 @@ if (!(existsSync(GetPaths("player")))) { module.exports = { bds_dir: bds_dir, + ServersPaths: ServersPaths, GetJsonConfig, GetPaths, GetServerPaths, diff --git a/package-lock.json b/package-lock.json index 35a0fd2..9f9727d 100644 --- a/package-lock.json +++ b/package-lock.json @@ -20,12 +20,14 @@ "express-prettify": "^0.1.1", "express-rate-limit": "^5.2.3", "googleapis": "^87.0.0", + "inquirer": "^8.1.5", "js-yaml": "^4.1.0", "minimist": "^1.2.5", "node-cron": "^3.0.0", "node-fetch": "^3.0.0", "oci-sdk": "^2.0.0", "open": "^8.0.0", + "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", "telegraf": "^4.0.0", @@ -586,6 +588,31 @@ "node": ">=6" } }, + "node_modules/ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "dependencies": { + "type-fest": "^0.21.3" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ansi-escapes/node_modules/type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -722,6 +749,21 @@ "node": ">=8" } }, + "node_modules/bl": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", + "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "dependencies": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/bl/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, "node_modules/body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -850,6 +892,29 @@ "concat-map": "0.0.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" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "node_modules/buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", @@ -915,7 +980,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "dependencies": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -931,7 +995,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "dependencies": { "color-convert": "^2.0.1" }, @@ -946,7 +1009,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "dependencies": { "color-name": "~1.1.4" }, @@ -957,14 +1019,12 @@ "node_modules/chalk/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==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "node_modules/chalk/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==", - "dev": true, "engines": { "node": ">=8" } @@ -973,7 +1033,6 @@ "version": "7.2.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dev": true, "dependencies": { "has-flag": "^4.0.0" }, @@ -981,6 +1040,11 @@ "node": ">=8" } }, + "node_modules/chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "node_modules/chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -1078,6 +1142,44 @@ "timers-ext": "^0.1.7" } }, + "node_modules/cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dependencies": { + "restore-cursor": "^3.1.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/cli-spinners": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz", + "integrity": "sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q==", + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==", + "engines": { + "node": ">= 10" + } + }, + "node_modules/clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "engines": { + "node": ">=0.8" + } + }, "node_modules/clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -1303,6 +1405,14 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "node_modules/defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dependencies": { + "clone": "^1.0.2" + } + }, "node_modules/defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -1417,8 +1527,7 @@ "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==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "node_modules/encodeurl": { "version": "1.0.2", @@ -1891,6 +2000,19 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "node_modules/external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "dependencies": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + }, + "engines": { + "node": ">=4" + } + }, "node_modules/extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -1943,6 +2065,28 @@ "node": "^12.20 || >= 14.13" } }, + "node_modules/figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "dependencies": { + "escape-string-regexp": "^1.0.5" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/figures/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": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "engines": { + "node": ">=0.8.0" + } + }, "node_modules/file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -2436,6 +2580,25 @@ "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" + } + ] + }, "node_modules/ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -2506,6 +2669,124 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "node_modules/inquirer": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.1.5.tgz", + "integrity": "sha512-G6/9xUqmt/r+UvufSyrPpt84NYwhKZ9jLsgMbQzlx804XErNupor8WQdBnBRrXmBfTPpuwf1sV+ss2ovjgdXIg==", + "dependencies": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.2.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "engines": { + "node": ">=8.0.0" + } + }, + "node_modules/inquirer/node_modules/bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "dependencies": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "node_modules/inquirer/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" + } + ], + "dependencies": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "node_modules/inquirer/node_modules/inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "node_modules/inquirer/node_modules/is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==", + "engines": { + "node": ">=8" + } + }, + "node_modules/inquirer/node_modules/is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/inquirer/node_modules/ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "dependencies": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": ">=10" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -2570,7 +2851,6 @@ "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==", - "dev": true, "engines": { "node": ">=8" } @@ -2603,6 +2883,17 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-npm": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", @@ -2652,6 +2943,17 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "node_modules/is-unicode-supported": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.1.0.tgz", + "integrity": "sha512-lDcxivp8TJpLG75/DpatAqNzOpDPSpED8XNtrpBHTdQ2InQ1PbW78jhwSxyxhhu+xbVSast2X38bwj8atwoUQA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -2866,6 +3168,11 @@ "node": ">= 0.8.0" } }, + "node_modules/lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "node_modules/lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -2919,6 +3226,21 @@ "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, + "node_modules/log-symbols": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.0.0.tgz", + "integrity": "sha512-zBsSKauX7sM0kcqrf8VpMRPqcWzU6a/Wi7iEl0QlVSCiIZ4CctaLdfVdiZUn6q2/nenyt392qJqpw9FhNAwqxQ==", + "dependencies": { + "chalk": "^4.1.0", + "is-unicode-supported": "^1.0.0" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -3018,6 +3340,14 @@ "node": ">= 0.6" } }, + "node_modules/mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "engines": { + "node": ">=6" + } + }, "node_modules/mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -3073,6 +3403,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "node_modules/mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -4041,6 +4376,20 @@ "wrappy": "1" } }, + "node_modules/onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "dependencies": { + "mimic-fn": "^2.1.0" + }, + "engines": { + "node": ">=6" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, "node_modules/open": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/open/-/open-8.2.1.tgz", @@ -4082,6 +4431,90 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.0.1.tgz", + "integrity": "sha512-TDdKkKHdWE6jo/6pIa5U5AWcSVfpNRFJ8sdRJpioGNVPLAzZzHs/N+QhUfF7ZbyoC+rnDuNTKzeDJUbAza9g4g==", + "dependencies": { + "bl": "^5.0.0", + "chalk": "^4.1.2", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.0.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, + "node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-timeout": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", @@ -4316,6 +4749,19 @@ "node": ">=0.10.0" } }, + "node_modules/readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "dependencies": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + }, + "engines": { + "node": ">= 6" + } + }, "node_modules/readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -4399,6 +4845,18 @@ "lowercase-keys": "^1.0.0" } }, + "node_modules/restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": ">=8" + } + }, "node_modules/rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -4414,6 +4872,27 @@ "url": "https://github.com/sponsors/isaacs" } }, + "node_modules/run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==", + "engines": { + "node": ">=0.12.0" + } + }, + "node_modules/rxjs": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.3.0.tgz", + "integrity": "sha512-p2yuGIg9S1epc3vrjKf6iVb3RCaAYjYskkO+jHIaV0IjOPlJop4UnodOoFb2xeNwlguqLYvGw1b1McillYb5Gw==", + "dependencies": { + "tslib": "~2.1.0" + } + }, + "node_modules/rxjs/node_modules/tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + }, "node_modules/safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -4545,8 +5024,7 @@ "node_modules/signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "node_modules/slice-ansi": { "version": "4.0.0", @@ -4644,11 +5122,37 @@ "node": ">=0.8.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==", + "dependencies": { + "safe-buffer": "~5.2.0" + } + }, + "node_modules/string_decoder/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" + } + ] + }, "node_modules/string-width": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, "dependencies": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -4662,7 +5166,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "dependencies": { "ansi-regex": "^5.0.0" }, @@ -4674,7 +5177,6 @@ "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true, "engines": { "node": ">=8" } @@ -4811,6 +5313,11 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "node_modules/through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, "node_modules/timers-ext": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", @@ -4820,6 +5327,17 @@ "next-tick": "1" } }, + "node_modules/tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dependencies": { + "os-tmpdir": "~1.0.2" + }, + "engines": { + "node": ">=0.6.0" + } + }, "node_modules/to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -5092,6 +5610,11 @@ "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" }, + "node_modules/util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, "node_modules/utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -5135,6 +5658,14 @@ "extsprintf": "^1.2.0" } }, + "node_modules/wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dependencies": { + "defaults": "^1.0.3" + } + }, "node_modules/web-streams-polyfill": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", @@ -5674,6 +6205,21 @@ "integrity": "sha512-JoX0apGbHaUJBNl6yF+p6JAFYZ666/hhCGKN5t9QFjbJQKUU/g8MNbFDbvfrgKXvI1QpZplPOnwIo99lX/AAmA==", "dev": true }, + "ansi-escapes": { + "version": "4.3.2", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.3.2.tgz", + "integrity": "sha512-gKXj5ALrKWQLsYG9jlTRmR/xKluxHV+Z9QEwNIgCfM1/uwPMCuzVVnh5mwTd+OuBZcwSIMbqssNWRm1lE51QaQ==", + "requires": { + "type-fest": "^0.21.3" + }, + "dependencies": { + "type-fest": { + "version": "0.21.3", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.21.3.tgz", + "integrity": "sha512-t0rzBq87m3fVcduHDUFhKmyyX+9eo6WQjZvf51Ea/M0Q7+T374Jp1aUiyUl0GKxp8M/OETVHSDvmkyPgvX+X2w==" + } + } + }, "ansi-regex": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-2.1.1.tgz", @@ -5772,6 +6318,23 @@ "integrity": "sha512-jDctJ/IVQbZoJykoeHbhXpOlNBqGNcwXJKJog42E5HDPUwQTSdjCHdihjj0DlnheQ7blbT6dHOafNAiS8ooQKA==", "dev": true }, + "bl": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-5.0.0.tgz", + "integrity": "sha512-8vxFNZ0pflFfi0WXA3WQXlj6CaMEwsmh63I1CNp0q+wWv8sD0ARx1KovSQd0l2GkwrMIOyedq0EF1FxI+RCZLQ==", + "requires": { + "buffer": "^6.0.3", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + }, + "dependencies": { + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + } + } + }, "body-parser": { "version": "1.19.0", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.19.0.tgz", @@ -5872,6 +6435,15 @@ "concat-map": "0.0.1" } }, + "buffer": { + "version": "6.0.3", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-6.0.3.tgz", + "integrity": "sha512-FTiCpNxtwiZZHEZbcbTIcZjERVICn9yq/pDFkTl95/AxzD1naBctN7YO68riM/gLSDY7sdrMby8hofADYuuqOA==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.2.1" + } + }, "buffer-alloc": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/buffer-alloc/-/buffer-alloc-1.2.0.tgz", @@ -5925,7 +6497,6 @@ "version": "4.1.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dev": true, "requires": { "ansi-styles": "^4.1.0", "supports-color": "^7.1.0" @@ -5935,7 +6506,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dev": true, "requires": { "color-convert": "^2.0.1" } @@ -5944,7 +6514,6 @@ "version": "2.0.1", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dev": true, "requires": { "color-name": "~1.1.4" } @@ -5952,26 +6521,28 @@ "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==", - "dev": true + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" }, "has-flag": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "dev": true + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==" }, "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==", - "dev": true, "requires": { "has-flag": "^4.0.0" } } } }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==" + }, "chokidar": { "version": "3.5.2", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.2.tgz", @@ -6048,6 +6619,29 @@ "timers-ext": "^0.1.7" } }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "cli-spinners": { + "version": "2.6.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.6.0.tgz", + "integrity": "sha512-t+4/y50K/+4xcCRosKkA7W4gTr1MySvLV0q+PxmG7FJ5g+66ChKurYjxBCjHggHH3HA5Hh9cy+lcUGWDqVH+4Q==" + }, + "cli-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-3.0.0.tgz", + "integrity": "sha512-FxqpkPPwu1HjuN93Omfm4h8uIanXofW0RxVEW3k5RKx+mJJYSthzNhp32Kzxxy3YAEZ/Dc/EWN1vZRY0+kOhbw==" + }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=" + }, "clone-response": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", @@ -6230,6 +6824,14 @@ "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", "dev": true }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "requires": { + "clone": "^1.0.2" + } + }, "defer-to-connect": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.1.3.tgz", @@ -6323,8 +6925,7 @@ "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==", - "dev": true + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" }, "encodeurl": { "version": "1.0.2", @@ -6707,6 +7308,16 @@ "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" }, + "external-editor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.1.0.tgz", + "integrity": "sha512-hMQ4CX1p1izmuLYyZqLMO/qGNw10wSv9QDCPfzXfyFrOaCSSoRfqE1Kf1s5an66J5JZC62NewG+mK49jOCtQew==", + "requires": { + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" + } + }, "extsprintf": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/extsprintf/-/extsprintf-1.3.0.tgz", @@ -6743,6 +7354,21 @@ "web-streams-polyfill": "^3.0.3" } }, + "figures": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", + "integrity": "sha512-yaduQFRKLXYOGgEn6AZau90j3ggSOyiqXU0F9JZfeXYhNa+Jk4X+s45A2zg5jns87GAFa34BBm2kXw4XpNcbdg==", + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=" + } + } + }, "file-entry-cache": { "version": "6.0.1", "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-6.0.1.tgz", @@ -7120,6 +7746,11 @@ "safer-buffer": ">= 2.1.2 < 3" } }, + "ieee754": { + "version": "1.2.1", + "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", + "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==" + }, "ignore": { "version": "4.0.6", "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", @@ -7175,6 +7806,88 @@ "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==", "dev": true }, + "inquirer": { + "version": "8.1.5", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-8.1.5.tgz", + "integrity": "sha512-G6/9xUqmt/r+UvufSyrPpt84NYwhKZ9jLsgMbQzlx804XErNupor8WQdBnBRrXmBfTPpuwf1sV+ss2ovjgdXIg==", + "requires": { + "ansi-escapes": "^4.2.1", + "chalk": "^4.1.1", + "cli-cursor": "^3.1.0", + "cli-width": "^3.0.0", + "external-editor": "^3.0.3", + "figures": "^3.0.0", + "lodash": "^4.17.21", + "mute-stream": "0.0.8", + "ora": "^5.4.1", + "run-async": "^2.4.0", + "rxjs": "^7.2.0", + "string-width": "^4.1.0", + "strip-ansi": "^6.0.0", + "through": "^2.3.6" + }, + "dependencies": { + "bl": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/bl/-/bl-4.1.0.tgz", + "integrity": "sha512-1W07cM9gS6DcLperZfFSj+bWLtaPGSOHWhPiGzXmvVJbRLdG82sH/Kn8EtW1VqWVA54AKf2h5k5BbnIbwF3h6w==", + "requires": { + "buffer": "^5.5.0", + "inherits": "^2.0.4", + "readable-stream": "^3.4.0" + } + }, + "buffer": { + "version": "5.7.1", + "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", + "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", + "requires": { + "base64-js": "^1.3.1", + "ieee754": "^1.1.13" + } + }, + "inherits": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", + "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" + }, + "is-interactive": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-1.0.0.tgz", + "integrity": "sha512-2HvIEKRoqS62guEC+qBjpvRubdX910WCMuJTZ+I9yvqKU2/12eSL549HMwtabb4oupdj2sMP50k+XJfB/8JE6w==" + }, + "is-unicode-supported": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", + "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==" + }, + "log-symbols": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", + "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^0.1.0" + } + }, + "ora": { + "version": "5.4.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-5.4.1.tgz", + "integrity": "sha512-5b6Y85tPxZZ7QytO+BQzysW31HJku27cRIlkbAXaNx+BdcVi+LlRFmVXzeF6a7JCwJpyw5c4b+YSVImQIrBpuQ==", + "requires": { + "bl": "^4.1.0", + "chalk": "^4.1.0", + "cli-cursor": "^3.1.0", + "cli-spinners": "^2.5.0", + "is-interactive": "^1.0.0", + "is-unicode-supported": "^0.1.0", + "log-symbols": "^4.1.0", + "strip-ansi": "^6.0.0", + "wcwidth": "^1.0.1" + } + } + } + }, "ipaddr.js": { "version": "1.9.1", "resolved": "https://registry.npmjs.org/ipaddr.js/-/ipaddr.js-1.9.1.tgz", @@ -7217,8 +7930,7 @@ "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==", - "dev": true + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==" }, "is-glob": { "version": "4.0.1", @@ -7239,6 +7951,11 @@ "is-path-inside": "^3.0.1" } }, + "is-interactive": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-interactive/-/is-interactive-2.0.0.tgz", + "integrity": "sha512-qP1vozQRI+BMOPcjFzrjXuQvdak2pHNUMZoeG2eRbiSqyvbEf/wQtEOTOX1guk6E3t36RkaqiSt8A/6YElNxLQ==" + }, "is-npm": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-4.0.0.tgz", @@ -7273,6 +7990,11 @@ "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", "dev": true }, + "is-unicode-supported": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-1.1.0.tgz", + "integrity": "sha512-lDcxivp8TJpLG75/DpatAqNzOpDPSpED8XNtrpBHTdQ2InQ1PbW78jhwSxyxhhu+xbVSast2X38bwj8atwoUQA==" + }, "is-wsl": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", @@ -7465,6 +8187,11 @@ "type-check": "~0.4.0" } }, + "lodash": { + "version": "4.17.21", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", + "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" + }, "lodash.clonedeep": { "version": "4.5.0", "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", @@ -7518,6 +8245,15 @@ "integrity": "sha1-WjUNoLERO4N+z//VgSy+WNbq4ZM=", "dev": true }, + "log-symbols": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-5.0.0.tgz", + "integrity": "sha512-zBsSKauX7sM0kcqrf8VpMRPqcWzU6a/Wi7iEl0QlVSCiIZ4CctaLdfVdiZUn6q2/nenyt392qJqpw9FhNAwqxQ==", + "requires": { + "chalk": "^4.1.0", + "is-unicode-supported": "^1.0.0" + } + }, "lowercase-keys": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", @@ -7595,6 +8331,11 @@ "mime-db": "1.49.0" } }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==" + }, "mimic-response": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", @@ -7638,6 +8379,11 @@ "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=" }, + "mute-stream": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.8.tgz", + "integrity": "sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA==" + }, "natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -8564,6 +9310,14 @@ "wrappy": "1" } }, + "onetime": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.2.tgz", + "integrity": "sha512-kbpaSSGJTWdAY5KPVeMOKXSrPtr8C8C7wodJbcsd51jRnmD+GZu8Y0VoU6Dm5Z4vWr0Ig/1NKuWRKf7j5aaYSg==", + "requires": { + "mimic-fn": "^2.1.0" + } + }, "open": { "version": "8.2.1", "resolved": "https://registry.npmjs.org/open/-/open-8.2.1.tgz", @@ -8593,6 +9347,59 @@ "word-wrap": "^1.2.3" } }, + "ora": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.0.1.tgz", + "integrity": "sha512-TDdKkKHdWE6jo/6pIa5U5AWcSVfpNRFJ8sdRJpioGNVPLAzZzHs/N+QhUfF7ZbyoC+rnDuNTKzeDJUbAza9g4g==", + "requires": { + "bl": "^5.0.0", + "chalk": "^4.1.2", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.0.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "requires": { + "restore-cursor": "^4.0.0" + } + }, + "restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + }, "p-timeout": { "version": "4.1.0", "resolved": "https://registry.npmjs.org/p-timeout/-/p-timeout-4.1.0.tgz", @@ -8768,6 +9575,16 @@ } } }, + "readable-stream": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.0.tgz", + "integrity": "sha512-BViHy7LKeTz4oNnkcLJ+lVSL6vpiFeX6/d3oSH8zCW7UxP2onchk+vTGB143xuFjHS3deTgkKoXXymXqymiIdA==", + "requires": { + "inherits": "^2.0.3", + "string_decoder": "^1.1.1", + "util-deprecate": "^1.0.1" + } + }, "readdirp": { "version": "3.6.0", "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", @@ -8830,6 +9647,15 @@ "lowercase-keys": "^1.0.0" } }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, "rimraf": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-3.0.2.tgz", @@ -8839,6 +9665,26 @@ "glob": "^7.1.3" } }, + "run-async": { + "version": "2.4.1", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.4.1.tgz", + "integrity": "sha512-tvVnVv01b8c1RrA6Ep7JkStj85Guv/YrMcwqYQnwjsAS2cTmmPGBBjAjpCW7RrSodNSoE2/qg9O4bceNvUuDgQ==" + }, + "rxjs": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-7.3.0.tgz", + "integrity": "sha512-p2yuGIg9S1epc3vrjKf6iVb3RCaAYjYskkO+jHIaV0IjOPlJop4UnodOoFb2xeNwlguqLYvGw1b1McillYb5Gw==", + "requires": { + "tslib": "~2.1.0" + }, + "dependencies": { + "tslib": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.1.0.tgz", + "integrity": "sha512-hcVC3wYEziELGGmEEXue7D75zbwIIVUMWAVbHItGPx0ziyXxrOMQx4rQEVEV45Ut/1IotuEvwqPopzIOkDMf0A==" + } + } + }, "safe-buffer": { "version": "5.1.2", "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", @@ -8950,8 +9796,7 @@ "signal-exit": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.3.tgz", - "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==", - "dev": true + "integrity": "sha512-VUJ49FC8U1OxwZLxIbTTrDvLnf/6TDgxZcK8wxR8zs13xpx7xbG60ndBlhNrFi2EMuFRoeDoJO7wthSLq42EjA==" }, "slice-ansi": { "version": "4.0.0", @@ -9022,11 +9867,25 @@ "resolved": "https://registry.npmjs.org/streamsearch/-/streamsearch-0.1.2.tgz", "integrity": "sha1-gIudDlb8Jz2Am6VzOOkpkZoanxo=" }, + "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==", + "requires": { + "safe-buffer": "~5.2.0" + }, + "dependencies": { + "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==" + } + } + }, "string-width": { "version": "4.2.2", "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.2.tgz", "integrity": "sha512-XBJbT3N4JhVumXE0eoLU9DCjcaF92KLNqTmFCnG1pf8duUxFGwtP6AD6nkjw9a3IdiRtL3E2w3JDiE/xi3vOeA==", - "dev": true, "requires": { "emoji-regex": "^8.0.0", "is-fullwidth-code-point": "^3.0.0", @@ -9037,7 +9896,6 @@ "version": "6.0.0", "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.0.tgz", "integrity": "sha512-AuvKTrTfQNYNIctbR1K/YGTR1756GycPsg7b9bdV9Duqur4gv6aKqHXah67Z8ImS7WEz5QVcOtlfW2rZEugt6w==", - "dev": true, "requires": { "ansi-regex": "^5.0.0" }, @@ -9045,8 +9903,7 @@ "ansi-regex": { "version": "5.0.0", "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.0.tgz", - "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==", - "dev": true + "integrity": "sha512-bY6fj56OUQ0hU1KjFNDQuJFezqKdrAyFdIevADiqrWHwSlbmBNMHp5ak2f40Pm8JTFyM2mqxkG6ngkHO11f/lg==" } } }, @@ -9147,6 +10004,11 @@ "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", "dev": true }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=" + }, "timers-ext": { "version": "0.1.7", "resolved": "https://registry.npmjs.org/timers-ext/-/timers-ext-0.1.7.tgz", @@ -9156,6 +10018,14 @@ "next-tick": "1" } }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "requires": { + "os-tmpdir": "~1.0.2" + } + }, "to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -9367,6 +10237,11 @@ "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" }, + "util-deprecate": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", + "integrity": "sha1-RQ1Nyfpw3nMnYvvS1KKJgUGaDM8=" + }, "utils-merge": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/utils-merge/-/utils-merge-1.0.1.tgz", @@ -9398,6 +10273,14 @@ "extsprintf": "^1.2.0" } }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "requires": { + "defaults": "^1.0.3" + } + }, "web-streams-polyfill": { "version": "3.1.1", "resolved": "https://registry.npmjs.org/web-streams-polyfill/-/web-streams-polyfill-3.1.1.tgz", diff --git a/package.json b/package.json index 3ec50ef..47ef2e7 100644 --- a/package.json +++ b/package.json @@ -59,12 +59,14 @@ "express-prettify": "^0.1.1", "express-rate-limit": "^5.2.3", "googleapis": "^87.0.0", + "inquirer": "^8.1.5", "js-yaml": "^4.1.0", "minimist": "^1.2.5", "node-cron": "^3.0.0", "node-fetch": "^3.0.0", "oci-sdk": "^2.0.0", "open": "^8.0.0", + "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", "telegraf": "^4.0.0", diff --git a/src/BdsServersDownload.js b/src/BdsServersDownload.js index b54bf06..fddc54f 100644 --- a/src/BdsServersDownload.js +++ b/src/BdsServersDownload.js @@ -1,5 +1,9 @@ -const { writeFileSync, existsSync, readFileSync, readdirSync, rmSync } = require("fs"); -const { join, resolve, basename } = require("path"); +const child_process = require("child_process"); +const fs = require("fs"); +const os = require("os"); +const path = require("path"); +const { writeFileSync, existsSync, readFileSync, readdirSync, rmSync } = fs; +const { join, resolve, basename } = path; var AdmZip = require("adm-zip"); const BdsInfo = require("../lib/BdsSystemInfo"); const { GetServerPaths, GetServerVersion, UpdateServerVersion, GetPlatform } = require("../lib/BdsSettings"); @@ -23,14 +27,14 @@ module.exports = function (version = true, force_install = false, callback = (er // JSON Configs and others const ServerVersion = GetServerVersion(); const CurrentPlatform = GetPlatform(); - if (typeof version === "boolean" || /true|latest/gi.test(version)) version = Servers.latest[CurrentPlatform] + if (typeof version === "boolean" || /true|latest/gi.test(`${version}`.toLocaleLowerCase())) version = Servers.latest[CurrentPlatform]; // Donwload console.log(`Installing version ${version}`); // Bedrock Installer Script if (CurrentPlatform === "bedrock") { if (valid_platform.bedrock === true){ - if (version === "latest") version = Servers.latest.bedrock + if (!(force_install === true) && ServerVersion.bedrock === version) { console.warn("Jumping, installed version") if (typeof callback === "function") callback(undefined, true); @@ -190,8 +194,9 @@ module.exports = function (version = true, force_install = false, callback = (er // Unidentified platform else { - promise_reject(Error("Bds maneger Config file error")); - if (typeof callback === "function") callback(err); + const Err = Error("Bds maneger Config file error"); + promise_reject(Err); + if (typeof callback === "function") callback(Err); } } catch (err) { promise_reject(err); @@ -208,6 +213,154 @@ module.exports = function (version = true, force_install = false, callback = (er }); } +// New Download Method +module.exports.v2 = async (version = true, force = true) => { + const CurrentPlatform = GetPlatform(); + const valid_platform = (await BdsInfo()).valid_platform; + const LocalServersVersions = bds.BdsSettigs.GetServerVersion(); + const { ServersPaths } = bds.BdsSettigs; + + // Load Version List + const ServerDownloadJSON = await Request.json(Extra.Fetchs.servers); + + // Check is latest version options or boolean + if (typeof version === "boolean" || /true|false|latest/.test(`${version}`.toLocaleLowerCase())) version = ServerDownloadJSON.latest[CurrentPlatform]; + if (!version) throw Error("No version found"); + + const ReturnObject = { + version: version, + platform: CurrentPlatform, + url: "", + data: "", + skip: false + } + + // Bedrock + if (CurrentPlatform === "bedrock") { + if (valid_platform.bedrock) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + // Add info to ReturnObject + ReturnObject.url = ServerDownloadJSON.bedrock[version][bds.arch][process.platform]; + ReturnObject.data = ServerDownloadJSON.bedrock[version].data; + + // Download and Add buffer to AdmZip + const BedrockZip = new AdmZip(await Request.buffer(ReturnObject.url)); + + // Create Backup Bedrock Config + const BedrockConfigFiles = { + proprieties: "", + whitelist: "", + permissions: "", + } + + // Get Bedrock Config Files + if (fs.existsSync(path.join(ServersPaths.bedrock, "bedrock_server.properties"))) BedrockConfigFiles.proprieties = fs.readFileSync(path.join(ServersPaths.bedrock, "bedrock_server.properties"), "utf8"); + if (fs.existsSync(path.join(ServersPaths.bedrock, "whitelist.json"))) BedrockConfigFiles.whitelist = fs.readFileSync(path.join(ServersPaths.bedrock, "whitelist.json"), "utf8"); + if (fs.existsSync(path.join(ServersPaths.bedrock, "permissions.json"))) BedrockConfigFiles.permissions = fs.readFileSync(path.join(ServersPaths.bedrock, "permissions.json"), "utf8"); + + // Extract to Bedrock Dir + BedrockZip.extractAllTo(ServersPaths.bedrock, true); + + // Write Bedrock Config Files + if (BedrockConfigFiles.proprieties) fs.writeFileSync(path.join(ServersPaths.bedrock, "bedrock_server.properties"), BedrockConfigFiles.proprieties, "utf8"); + if (BedrockConfigFiles.whitelist) fs.writeFileSync(path.join(ServersPaths.bedrock, "whitelist.json"), BedrockConfigFiles.whitelist, "utf8"); + if (BedrockConfigFiles.permissions) fs.writeFileSync(path.join(ServersPaths.bedrock, "permissions.json"), BedrockConfigFiles.permissions, "utf8"); + + // Update Server Version + bds.BdsSettigs.UpdateServerVersion(version, CurrentPlatform); + } else { + ReturnObject.skip = true; + } + } else { + throw Error("Bedrock not suported"); + } + } + + // Java + else if (CurrentPlatform === "java") { + if (valid_platform.java) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + // Add info to ReturnObject + ReturnObject.url = ServerDownloadJSON.java[version].url; + ReturnObject.data = ServerDownloadJSON.java[version].data; + + // Download and write java file + fs.writeFileSync(path.join(ServersPaths.java, "MinecraftServerJava.jar"), await Request.buffer(ReturnObject.url), "binary"); + + // Write EULA + fs.writeFileSync(path.join(ServersPaths.java, "eula.txt"), "eula=true"); + + // Update Server Version + bds.BdsSettigs.UpdateServerVersion(version, CurrentPlatform); + } else { + ReturnObject.skip = true; + } + } else { + throw Error("Java not suported"); + } + } + + // Spigot + else if (CurrentPlatform === "spigot") { + if (valid_platform.spigot) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + // Add info to ReturnObject + const FindedSpigot = ServerDownloadJSON.spigot.findOne(spigot => spigot.version === version); + ReturnObject.url = FindedSpigot.url; + ReturnObject.data = FindedSpigot.data; + + // Download and write java file + fs.writeFileSync(path.join(ServersPaths.spigot, "spigot.jar"), await Request.buffer(ReturnObject.url), "binary"); + + // Update Server Version + bds.BdsSettigs.UpdateServerVersion(version, CurrentPlatform); + } else { + ReturnObject.skip = true; + } + } else { + throw Error("Spigot not suported"); + } + } + + // Dragonfly + else if (CurrentPlatform === "dragonfly") { + if (valid_platform.dragonfly) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + // Add info to ReturnObject + ReturnObject.url = "https://github.com/df-mc/dragonfly/tree/master"; + ReturnObject.data = ""; + + // Build Dragonfly + const TmpDragonflyDir = path.join(os.tmpdir(), `dragonfly_${Math.random().toString(36).substring(7)}`); + child_process.execFileSync("git", ["clone", "https://github.com/df-mc/dragonfly", "--depth", "1", TmpDragonflyDir]); + let DragonflyPackageOut = path.join(ServersPaths.dragonfly, "DragonFly"); + if (process.platform === "win32") DragonflyPackageOut += ".exe"; + child_process.execFileSync("go", ["build", "-o", DragonflyPackageOut], {cwd: TmpDragonflyDir}); + + // move Dragonfly to ServersPaths + fs.renameSync(DragonflyPackageOut, path.join(ServersPaths.dragonfly, path.basename(DragonflyPackageOut))); + + // Remove Build Dir + fs.rmSync(TmpDragonflyDir, {recursive: true, force: true}); + + // Update Server Version + bds.BdsSettigs.UpdateServerVersion(Math.random().toString(), CurrentPlatform); + } else { + ReturnObject.skip = true; + } + } else { + throw Error("Dragonfly not suported"); + } + } + + // if the platform does not exist + else throw Error("No Valid Platform"); + + // Return info download + return ReturnObject; +} + +// Php download and install async function php_download() { const bds_dir_pocketmine = GetServerPaths("pocketmine"); const PHPBin = (await (await fetch(Extra.Fetchs.php)).json()); -- 2.45.2 From 0530612a94f9198799030b665c7aa6a3f7106eb1 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Thu, 23 Sep 2021 04:36:23 -0300 Subject: [PATCH 2/9] Modifications to command cli and add error pocketmine download v2 --- bin/bds_maneger_v2.js | 30 +++++++------------------- package-lock.json | 14 +++++++++++++ package.json | 1 + src/BdsManegerServer.js | 44 +++++++++++++-------------------------- src/BdsServersDownload.js | 22 ++++++++++++-------- 5 files changed, 50 insertions(+), 61 deletions(-) diff --git a/bin/bds_maneger_v2.js b/bin/bds_maneger_v2.js index ce268e3..a0b4e61 100644 --- a/bin/bds_maneger_v2.js +++ b/bin/bds_maneger_v2.js @@ -5,6 +5,7 @@ process.env.IS_BDS_CLI = process.env.IS_BIN_BDS = true; // External Modules const cli_color = require("cli-color"); const inquirer = require("inquirer"); +const serverline = require("serverline"); // Bin Args const ProcessArgs = require("minimist")(process.argv.slice(2)); @@ -52,26 +53,11 @@ async function Runner() { console.log(cli_color.redBright(`Bds Core Exit with code ${code}, Uptimed: ${BdsCoreStart.uptime}`)); process.exit(code); }); - const BdsCliMenus = require("./bds_maneger/menus"); - const InfinitCommands = async () => { - const CommandtoRun = (await inquirer.prompt([ - { - type: "list", - name: "commands", - message: "Select a command", - choices: [ - "tp" - ] - } - ])).commands; - if (CommandtoRun === "tp") { - BdsCliMenus.tp(); - return await InfinitCommands(); - } else { - BdsCliMenus.Command(); - return await InfinitCommands(); - } - } - InfinitCommands(); + serverline.init(); + serverline.setCompletion(["tp"]); + serverline.setPrompt("Command > "); + serverline.on('line', function(line) { + BdsCoreStart.command(line); + }); } -Runner(); \ No newline at end of file +Runner(); diff --git a/package-lock.json b/package-lock.json index 9f9727d..6f5e54e 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", + "serverline": "^1.5.0", "telegraf": "^4.0.0", "uuid": "^8.3.2" }, @@ -4995,6 +4996,14 @@ "node": ">= 0.8.0" } }, + "node_modules/serverline": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", + "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -9773,6 +9782,11 @@ "send": "0.17.1" } }, + "serverline": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", + "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==" + }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", diff --git a/package.json b/package.json index 47ef2e7..d6b1dab 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", + "serverline": "^1.5.0", "telegraf": "^4.0.0", "uuid": "^8.3.2" }, diff --git a/src/BdsManegerServer.js b/src/BdsManegerServer.js index 08269ad..75a4904 100644 --- a/src/BdsManegerServer.js +++ b/src/BdsManegerServer.js @@ -46,7 +46,7 @@ function start() { // Set Env and Cwd SetupCommands.cwd = GetServerPaths("bedrock"); SetupCommands.env.LD_LIBRARY_PATH = GetServerPaths("bedrock"); - + // In case the cpu is different from x64, the command will use qemu static to run the server if (process.arch !== "x64") { if (!(commandExists("qemu-x86_64-static"))) throw new Error("Install qemu static") @@ -67,7 +67,7 @@ function start() { SetupCommands.args.push("-jar", `-Xms${JavaConfig.ram_mb}M`, `-Xmx${JavaConfig.ram_mb}M`, "MinecraftServerJava.jar", "nogui"); } else {require("open")(bds.package_json.docs_base + "Java-Download#windows"); throw new Error(`Open: ${bds.package_json.docs_base + "Java-Download#windows"}`)} } - + // Minecraft Bedrock (Pocketmine-MP) else if (GetPlatform() === "pocketmine") { // Start PocketMine-MP @@ -75,32 +75,16 @@ function start() { SetupCommands.args.push("./PocketMine-MP.phar"); SetupCommands.cwd = GetServerPaths("pocketmine"); } - + // Show Error platform else throw Error("Bds Config Error") - + // Setup commands const ServerExec = child_process.execFile(SetupCommands.command, SetupCommands.args, { cwd: SetupCommands.cwd, env: SetupCommands.env }); - - // Post Start - if (GetPlatform() === "java") { - const eula_file_path = path.join(GetServerPaths("java"), "eula.txt"); - if (fs.existsSync(eula_file_path)) { - const eula_file = fs.readFileSync(eula_file_path, "utf8"); - console.log(eula_file); - if (eula_file.includes("eula=false")) { - fs.writeFileSync(eula_file_path, eula_file.replace(/eula=false/gi, "eula=true")); - throw new Error("Restart application/CLI") - } - } else { - console.log("EULA file not found"); - throw new Error("EULA file not found") - } - } - + // Log file const LogFile = path.join(GetPaths("log"), `${GetPlatform()}_${new Date().toString().replace(/:|\(|\)/g, "_")}_Bds_log.log`); const LatestLog_Path = path.join(GetPaths("log"), "latest.log"); @@ -110,11 +94,11 @@ function start() { return data; } fs.writeFileSync(LatestLog_Path, ""); - + // Player JSON File ServerExec.stdout.on("data", data => Player_Json(data, UpdateUserJSON)); ServerExec.stderr.on("data", data => Player_Json(data, UpdateUserJSON)); - + // Log File ServerExec.stdout.on("data", LogSaveFunction); ServerExec.stderr.on("data", LogSaveFunction); @@ -149,7 +133,7 @@ function start() { }; const on = function(action = String, callback = Function) { if (!(action === "all" || action === "connect" || action === "disconnect")) throw new Error("Use some valid action: all, connect, disconnect"); - + // Functions const data = data => Player_Json(data, function (array_status){ array_status.filter(On => {if ("all" === action || On.Action === action) return true; else return false;}).forEach(_player => callback(_player)) @@ -190,7 +174,7 @@ function start() { return command; }; const say = (text = "") => ServerExec.stdin.write(BdsInfo.Servers.bedrock.say.replace("{{Text}}", text)); - + // Mount commands to Return const returnFuntion = { uuid: randomUUID(), @@ -222,7 +206,7 @@ function Player_Json(data = "aaaaaa\n\n\naa", callback = () => {}){ const BedrockMap = data.split(/\n|\r/gi).map(line => { if (line.includes("connected") || line.includes("disconnected")) { let SplitLine = line.replace(/\[.+\]\s+Player/gi, "").trim().split(/\s+/gi); - + // player let Player = line.trim().replace(/\[.+\]\s+Player/gi, "").trim().replace(/disconnected:|connected:/, "").trim().split(/,\s+xuid:/).filter(a=>a).map(a=>a.trim()).filter(a=>a); @@ -253,7 +237,7 @@ function Player_Json(data = "aaaaaa\n\n\naa", callback = () => {}){ let Actions = null; if (/joined/.test(line)) Actions = "connect"; else if (/left/.test(line)) Actions = "disconnect"; - + // Player Object const JavaObject = { Player: line.replace(/joined the game|left the game/gi, "").trim(), @@ -279,7 +263,7 @@ const UpdateUserJSON = function (New_Object = []){ jsprismarine: [], } if (fs.existsSync(Player_Json_path)) Players_Json = JSON.parse(fs.readFileSync(Player_Json_path, "utf8")); - + // Array Players_Json[Current_platorm] = Players_Json[Current_platorm].concat(New_Object) @@ -340,11 +324,11 @@ const CurrentBackups = GetCronBackup().map(Crron => { // Azure if (Crron.Azure) Cloud_Backup.Azure(CurrentBackup.file_name, CurrentBackup.file_path); else console.info("Azure Backup Disabled"); - + // Google Driver if (Crron.Driver) Cloud_Backup.Driver(CurrentBackup.file_name, CurrentBackup.file_path); else console.info("Google Driver Backup Disabled"); - + // Oracle Bucket if (Crron.Oracle) Cloud_Backup.Oracle(CurrentBackup.file_name, CurrentBackup.file_path); else console.info("Oracle Bucket Backup Disabled"); diff --git a/src/BdsServersDownload.js b/src/BdsServersDownload.js index fddc54f..b89d5f3 100644 --- a/src/BdsServersDownload.js +++ b/src/BdsServersDownload.js @@ -222,7 +222,7 @@ module.exports.v2 = async (version = true, force = true) => { // Load Version List const ServerDownloadJSON = await Request.json(Extra.Fetchs.servers); - + // Check is latest version options or boolean if (typeof version === "boolean" || /true|false|latest/.test(`${version}`.toLocaleLowerCase())) version = ServerDownloadJSON.latest[CurrentPlatform]; if (!version) throw Error("No version found"); @@ -238,7 +238,7 @@ module.exports.v2 = async (version = true, force = true) => { // Bedrock if (CurrentPlatform === "bedrock") { if (valid_platform.bedrock) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions.bedrock !== version) { // Add info to ReturnObject ReturnObject.url = ServerDownloadJSON.bedrock[version][bds.arch][process.platform]; ReturnObject.data = ServerDownloadJSON.bedrock[version].data; @@ -279,13 +279,14 @@ module.exports.v2 = async (version = true, force = true) => { // Java else if (CurrentPlatform === "java") { if (valid_platform.java) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions.java !== version) { // Add info to ReturnObject ReturnObject.url = ServerDownloadJSON.java[version].url; ReturnObject.data = ServerDownloadJSON.java[version].data; // Download and write java file - fs.writeFileSync(path.join(ServersPaths.java, "MinecraftServerJava.jar"), await Request.buffer(ReturnObject.url), "binary"); + const JavaBufferJar = await Request.buffer(ReturnObject.url); + fs.writeFileSync(path.join(ServersPaths.java, "MinecraftServerJava.jar"), JavaBufferJar, "binary"); // Write EULA fs.writeFileSync(path.join(ServersPaths.java, "eula.txt"), "eula=true"); @@ -303,7 +304,7 @@ module.exports.v2 = async (version = true, force = true) => { // Spigot else if (CurrentPlatform === "spigot") { if (valid_platform.spigot) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions.spigot !== version) { // Add info to ReturnObject const FindedSpigot = ServerDownloadJSON.spigot.findOne(spigot => spigot.version === version); ReturnObject.url = FindedSpigot.url; @@ -325,11 +326,11 @@ module.exports.v2 = async (version = true, force = true) => { // Dragonfly else if (CurrentPlatform === "dragonfly") { if (valid_platform.dragonfly) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions !== version) { + if (!(force === true && typeof force === "boolean") && LocalServersVersions.dragonfly !== version) { // Add info to ReturnObject ReturnObject.url = "https://github.com/df-mc/dragonfly/tree/master"; ReturnObject.data = ""; - + // Build Dragonfly const TmpDragonflyDir = path.join(os.tmpdir(), `dragonfly_${Math.random().toString(36).substring(7)}`); child_process.execFileSync("git", ["clone", "https://github.com/df-mc/dragonfly", "--depth", "1", TmpDragonflyDir]); @@ -352,7 +353,10 @@ module.exports.v2 = async (version = true, force = true) => { throw Error("Dragonfly not suported"); } } - + + // Pocketmine-MP + else if (CurrentPlatform === "pocketmine") {throw new Error("We are still creating for Pocketmine-MP");} + // if the platform does not exist else throw Error("No Valid Platform"); @@ -401,4 +405,4 @@ async function php_download() { writeFileSync(join(phpFolder, "php7", "bin", "php.ini"), phpConfigInit); } return true; -} \ No newline at end of file +} -- 2.45.2 From 0d11dc4a5a5fbfe52a95085552cea78efa542470 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Thu, 23 Sep 2021 06:04:08 -0300 Subject: [PATCH 3/9] add pocketmine in v2 download --- bin/bds_maneger_v2.js | 11 ++++++---- index.js | 2 +- lib/BdsSettings.js | 37 ++++++++++--------------------- lib/BdsSystemInfo.js | 2 +- src/BdsManegerServer.js | 1 + src/BdsServersDownload.js | 46 +++++++++++++++++++++++++++------------ 6 files changed, 53 insertions(+), 46 deletions(-) diff --git a/bin/bds_maneger_v2.js b/bin/bds_maneger_v2.js index a0b4e61..3a9ffc9 100644 --- a/bin/bds_maneger_v2.js +++ b/bin/bds_maneger_v2.js @@ -4,7 +4,6 @@ process.env.IS_BDS_CLI = process.env.IS_BIN_BDS = true; // External Modules const cli_color = require("cli-color"); -const inquirer = require("inquirer"); const serverline = require("serverline"); // Bin Args @@ -46,9 +45,11 @@ async function Runner() { } } + if (!(ProcessArgs.start || ProcessArgs.s)) return; + // Start const BdsCoreStart = BdsCore.start(); - BdsCoreStart.log(data => process.stdout.write(cli_color.blueBright(data))); + BdsCoreStart.log(data => console.log(cli_color.blueBright(data.replace(/\n$/gi, "")))); BdsCoreStart.exit(code => { console.log(cli_color.redBright(`Bds Core Exit with code ${code}, Uptimed: ${BdsCoreStart.uptime}`)); process.exit(code); @@ -56,8 +57,10 @@ async function Runner() { serverline.init(); serverline.setCompletion(["tp"]); serverline.setPrompt("Command > "); - serverline.on('line', function(line) { - BdsCoreStart.command(line); + serverline.on("line", function(line) { + if (/^@/.test(line)) { + console.log("🤪It's not working yet!"); + } else BdsCoreStart.command(line); }); } Runner(); diff --git a/index.js b/index.js index 293efc1..d93040f 100644 --- a/index.js +++ b/index.js @@ -5,7 +5,7 @@ const fs = require("fs"); const randomUUID = require("uuid").v4; const { bds_dir } = require("./lib/BdsSettings"); -if (typeof fetch === "undefined") global.fetch = require("node-fetch"); +require("./lib/Requests") const bds_core_package = resolve(__dirname, "package.json") module.exports.package_path = bds_core_package diff --git a/lib/BdsSettings.js b/lib/BdsSettings.js index 2d4bc12..2dc5b1b 100644 --- a/lib/BdsSettings.js +++ b/lib/BdsSettings.js @@ -1,7 +1,6 @@ const { join, resolve, basename } = require("path"); const { existsSync, writeFileSync, mkdirSync, readFileSync } = require("fs"); const { homedir } = require("os"); -const BdsInfo = require("./BdsSystemInfo"); const yaml = require("js-yaml"); // PATHs @@ -9,19 +8,6 @@ const home = homedir(); const bds_dir = join(home, "bds_core"); if (!(existsSync(bds_dir))) mkdirSync(bds_dir, {recursive: true}) -BdsInfo().then(validation => { - const { valid_platform } = validation; - // Set default platform for bds maneger - var default_platformConfig; - if (valid_platform["bedrock"]) default_platformConfig = "bedrock"; - else if (valid_platform["java"]) default_platformConfig = "java"; - else if (valid_platform["pocketmine"]) default_platformConfig = "pocketmine"; - else throw new Error("We cannot run any platforms on this system/device"); - UpdatePlatform(default_platformConfig); -}).catch(err => { - console.log(err); - process.exit(1); -}); // Config Base to Bds Maneger Core and others Projects var Config = { @@ -115,12 +101,12 @@ var Config = { // Config const ConfigPath = join(resolve(homedir(), "bds_core"), "BdsConfig.yaml") -function SaveConfig(){writeFileSync(ConfigPath, yaml.dump(Config));} -if (existsSync(ConfigPath)) Config = { - ...Config, - ...yaml.load(readFileSync(ConfigPath, "utf8")) -}; else writeFileSync(ConfigPath, yaml.dump(Config)) -process.on("exit", () => SaveConfig()) + +const SaveConfig = () => writeFileSync(ConfigPath, yaml.dump(Config)); +process.on("exit", () => SaveConfig()); + +if (existsSync(ConfigPath)) Config = yaml.load(readFileSync(ConfigPath, "utf8")); +else writeFileSync(ConfigPath, yaml.dump(Config)) // Paths if (!(existsSync(Config.paths["backups"]))) mkdirSync(Config.paths["backups"], {recursive: true}) @@ -168,21 +154,20 @@ function UpdateServerVersion(version = null, platform = Config.server.platform){ } // Update the entire Bds Manager Core platform -function UpdatePlatform(platform = Config.server.platform){ +function UpdatePlatform(platform = "null"){ platform = platform.toLocaleLowerCase(); if (/bedrock/.test(platform)) { Config.server.platform = "bedrock"; - SaveConfig() } else if (/java/.test(platform)) { Config.server.platform = "java"; - SaveConfig() } else if (/pocketmine/.test(platform)) { Config.server.platform = "pocketmine"; - SaveConfig() } else if (/spigot/.test(platform)) { Config.server.platform = "spigot"; - SaveConfig() - } else throw new Error("platform no Exists") + } else if (/dragonfly/.test(platform)) { + Config.server.platform = "dragonfly"; + } else throw new Error("platform no exists"); + SaveConfig(); return platform } diff --git a/lib/BdsSystemInfo.js b/lib/BdsSystemInfo.js index 8236f1b..c2bb9aa 100644 --- a/lib/BdsSystemInfo.js +++ b/lib/BdsSystemInfo.js @@ -35,7 +35,7 @@ async function CheckSystemAsync() { if (valid_platform["bedrock"] === false) { if (commadExist("qemu-x86_64-static")) { - console.warn("The Minecraft Bedrock Server is only being validated because you can use 'qemu-x86_64-static'"); + // console.warn("The Minecraft Bedrock Server is only being validated because you can use 'qemu-x86_64-static'"); valid_platform["bedrock"] = true require_qemu = true } diff --git a/src/BdsManegerServer.js b/src/BdsManegerServer.js index 75a4904..4db68dd 100644 --- a/src/BdsManegerServer.js +++ b/src/BdsManegerServer.js @@ -72,6 +72,7 @@ function start() { else if (GetPlatform() === "pocketmine") { // Start PocketMine-MP SetupCommands.command = path.join(path.resolve(GetServerPaths("pocketmine"), "bin", "php7", "bin"), "php"); + if (process.platform === "win32") SetupCommands.command = path.join(path.resolve(GetServerPaths("pocketmine"), "bin/php"), "php.exe"); SetupCommands.args.push("./PocketMine-MP.phar"); SetupCommands.cwd = GetServerPaths("pocketmine"); } diff --git a/src/BdsServersDownload.js b/src/BdsServersDownload.js index b89d5f3..239b7ce 100644 --- a/src/BdsServersDownload.js +++ b/src/BdsServersDownload.js @@ -3,7 +3,7 @@ const fs = require("fs"); const os = require("os"); const path = require("path"); const { writeFileSync, existsSync, readFileSync, readdirSync, rmSync } = fs; -const { join, resolve, basename } = path; +const { join, resolve } = path; var AdmZip = require("adm-zip"); const BdsInfo = require("../lib/BdsSystemInfo"); const { GetServerPaths, GetServerVersion, UpdateServerVersion, GetPlatform } = require("../lib/BdsSettings"); @@ -214,7 +214,7 @@ module.exports = function (version = true, force_install = false, callback = (er } // New Download Method -module.exports.v2 = async (version = true, force = true) => { +module.exports.v2 = async (version = true) => { const CurrentPlatform = GetPlatform(); const valid_platform = (await BdsInfo()).valid_platform; const LocalServersVersions = bds.BdsSettigs.GetServerVersion(); @@ -238,7 +238,7 @@ module.exports.v2 = async (version = true, force = true) => { // Bedrock if (CurrentPlatform === "bedrock") { if (valid_platform.bedrock) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions.bedrock !== version) { + if (LocalServersVersions.bedrock !== version) { // Add info to ReturnObject ReturnObject.url = ServerDownloadJSON.bedrock[version][bds.arch][process.platform]; ReturnObject.data = ServerDownloadJSON.bedrock[version].data; @@ -279,7 +279,7 @@ module.exports.v2 = async (version = true, force = true) => { // Java else if (CurrentPlatform === "java") { if (valid_platform.java) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions.java !== version) { + if (LocalServersVersions.java !== version) { // Add info to ReturnObject ReturnObject.url = ServerDownloadJSON.java[version].url; ReturnObject.data = ServerDownloadJSON.java[version].data; @@ -304,7 +304,7 @@ module.exports.v2 = async (version = true, force = true) => { // Spigot else if (CurrentPlatform === "spigot") { if (valid_platform.spigot) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions.spigot !== version) { + if (LocalServersVersions.spigot !== version) { // Add info to ReturnObject const FindedSpigot = ServerDownloadJSON.spigot.findOne(spigot => spigot.version === version); ReturnObject.url = FindedSpigot.url; @@ -326,7 +326,7 @@ module.exports.v2 = async (version = true, force = true) => { // Dragonfly else if (CurrentPlatform === "dragonfly") { if (valid_platform.dragonfly) { - if (!(force === true && typeof force === "boolean") && LocalServersVersions.dragonfly !== version) { + if (LocalServersVersions.dragonfly !== version) { // Add info to ReturnObject ReturnObject.url = "https://github.com/df-mc/dragonfly/tree/master"; ReturnObject.data = ""; @@ -355,7 +355,29 @@ module.exports.v2 = async (version = true, force = true) => { } // Pocketmine-MP - else if (CurrentPlatform === "pocketmine") {throw new Error("We are still creating for Pocketmine-MP");} + else if (CurrentPlatform === "pocketmine") { + if (valid_platform.pocketmine) { + if (LocalServersVersions.pocketmine !== version) { + // Add info to ReturnObject + ReturnObject.url = ServerDownloadJSON.pocketmine[version].url; + ReturnObject.data = ServerDownloadJSON.pocketmine[version].data; + + // Download PHP Bin + await php_download(); + + // Download php file and save + const PocketmineBufferPhp = await Request.buffer(ReturnObject.url); + fs.writeFileSync(path.join(ServersPaths.pocketmine, "PocketMine-MP.phar"), PocketmineBufferPhp, "binary"); + + // Update Server Version + bds.BdsSettigs.UpdateServerVersion(version, CurrentPlatform); + } else { + ReturnObject.skip = true; + } + } else { + throw Error("Pocketmine-MP not suported"); + } + } // if the platform does not exist else throw Error("No Valid Platform"); @@ -379,17 +401,13 @@ async function php_download() { // Remove Old php Binary if it exists if (existsSync(phpFolder)) { - console.log("Removing old PHP files."); rmSync(phpFolder, { recursive: true }); - } - console.log(`Downloading ${urlPHPBin}`); + } const ZipBuffer = Buffer.from((await (await fetch(urlPHPBin)).arrayBuffer())); - console.log(`${basename(urlPHPBin)} downloaded`); - - console.log(`Extracting ${basename(urlPHPBin)}`); const zipExtractBin = new AdmZip(ZipBuffer); zipExtractBin.extractAllTo(bds_dir_pocketmine, false) - console.log("Successfully extracting the binaries") + + if (process.platform === "win32") return resolve(); let phpConfigInit = readFileSync(join(phpFolder, "php7", "bin", "php.ini"), "utf8"); if (!(existsSync(phpExtensiosnsDir))) return true; -- 2.45.2 From 9b22e53cb5c756f545512f11ece07fce34a49411 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 24 Sep 2021 09:01:27 -0300 Subject: [PATCH 4/9] Update Packages --- package-lock.json | 130 ++++++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 126 insertions(+), 4 deletions(-) diff --git a/package-lock.json b/package-lock.json index e0e74f5..2e14551 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4350,6 +4350,82 @@ "node": ">= 0.8.0" } }, + "node_modules/ora": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.0.1.tgz", + "integrity": "sha512-TDdKkKHdWE6jo/6pIa5U5AWcSVfpNRFJ8sdRJpioGNVPLAzZzHs/N+QhUfF7ZbyoC+rnDuNTKzeDJUbAza9g4g==", + "dependencies": { + "bl": "^5.0.0", + "chalk": "^4.1.2", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.0.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==", + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/ansi-regex?sponsor=1" + } + }, + "node_modules/ora/node_modules/cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "dependencies": { + "restore-cursor": "^4.0.0" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "dependencies": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + }, + "engines": { + "node": "^12.20.0 || ^14.13.1 || >=16.0.0" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/ora/node_modules/strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "dependencies": { + "ansi-regex": "^6.0.1" + }, + "engines": { + "node": ">=12" + }, + "funding": { + "url": "https://github.com/chalk/strip-ansi?sponsor=1" + } + }, "node_modules/p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -4882,8 +4958,7 @@ "node_modules/signal-exit": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", - "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==", - "dev": true + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "node_modules/slice-ansi": { "version": "4.0.0", @@ -9120,6 +9195,54 @@ "word-wrap": "^1.2.3" } }, + "ora": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ora/-/ora-6.0.1.tgz", + "integrity": "sha512-TDdKkKHdWE6jo/6pIa5U5AWcSVfpNRFJ8sdRJpioGNVPLAzZzHs/N+QhUfF7ZbyoC+rnDuNTKzeDJUbAza9g4g==", + "requires": { + "bl": "^5.0.0", + "chalk": "^4.1.2", + "cli-cursor": "^4.0.0", + "cli-spinners": "^2.6.0", + "is-interactive": "^2.0.0", + "is-unicode-supported": "^1.1.0", + "log-symbols": "^5.0.0", + "strip-ansi": "^7.0.1", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "6.0.1", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.0.1.tgz", + "integrity": "sha512-n5M855fKb2SsfMIiFFoVrABHJC8QtHwVx+mHWP3QcEqBHYienj5dHSgjbxtC0WEZXYt4wcD6zrQElDPhFuZgfA==" + }, + "cli-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-4.0.0.tgz", + "integrity": "sha512-VGtlMu3x/4DOtIUwEkRezxUZ2lBacNJCHash0N0WeZDBS+7Ux1dm3XWAgWYxLJFMMdOeXMHXorshEFhbMSGelg==", + "requires": { + "restore-cursor": "^4.0.0" + } + }, + "restore-cursor": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-4.0.0.tgz", + "integrity": "sha512-I9fPXU9geO9bHOt9pHHOhOkYerIMsmVaWB0rA2AI9ERh/+x/i7MV5HKBNrg+ljO5eoPVgCcnFuRjJ9uH6I/3eg==", + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "strip-ansi": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.0.1.tgz", + "integrity": "sha512-cXNxvT8dFNRVfhVME3JAe98mkXDYN2O1l7jmcwMnOslDeESg1rF/OZMtK0nRAhiari1unG5cD4jG3rapUAkLbw==", + "requires": { + "ansi-regex": "^6.0.1" + } + } + } + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -9533,8 +9656,7 @@ "signal-exit": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.4.tgz", - "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==", - "dev": true + "integrity": "sha512-rqYhcAnZ6d/vTPGghdrw7iumdcbXpsk1b8IG/rz+VWV51DM0p7XCtMoJ3qhPLIbp3tvyt3pKRbaaEMZYpHto8Q==" }, "slice-ansi": { "version": "4.0.0", -- 2.45.2 From 7f59c958791981522c466c33c01922a808ecfe5f Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 24 Sep 2021 23:12:38 -0300 Subject: [PATCH 5/9] info --- bin/bds_maneger_v2.js | 52 +++++++++++++++++++++++++++++++++++++++++-- 1 file changed, 50 insertions(+), 2 deletions(-) diff --git a/bin/bds_maneger_v2.js b/bin/bds_maneger_v2.js index 3a9ffc9..6464518 100644 --- a/bin/bds_maneger_v2.js +++ b/bin/bds_maneger_v2.js @@ -5,12 +5,15 @@ process.env.IS_BDS_CLI = process.env.IS_BIN_BDS = true; // External Modules const cli_color = require("cli-color"); const serverline = require("serverline"); +const inquirer = require("inquirer"); // Bin Args const ProcessArgs = require("minimist")(process.argv.slice(2)); // Import Bds Core const BdsCore = require("../index"); +const BdsReq = require("../lib/Requests"); +const BdsExtraInfo = require("../BdsManegerInfo.json"); // Async functiona async function Runner() { @@ -29,9 +32,46 @@ async function Runner() { } } + // Print Info about Bds Core and Platforms + if (ProcessArgs.info || ProcessArgs.i) { + const { valid_platform } = await (require("../lib/BdsSystemInfo"))(); + var checkothearch = ""; + if (process.platform === "linux" && BdsCore.arch !== "x64"){checkothearch = `qemu-x86_64-static is installed to emulate an x64 system: ${commandExits("qemu-x86_64-static")}\n`} + if (process.platform === "android" && BdsCore.arch !== "x64"){checkothearch = `qemu-x86_64 is installed to emulate an x64 system: ${commandExits("qemu-x86_64")}\n`} + const help = [ + `Bds Maneger Core And Bds Maneger CLI version: ${cli_color.magentaBright(BdsCore.package_json.version)}`, + `System: ${cli_color.yellow(process.platform)}, architecture: ${cli_color.blue(BdsCore.arch)}`, + checkothearch, + "**************************************************************", + "* Servers currently available:", + `* - Bedrock: ${valid_platform.bedrock}`, + `* - Pocketmine-MP: ${valid_platform.pocketmine}`, + `* - Dragonfly: ${valid_platform.dragonfly}`, + `* - Java: ${valid_platform.java}`, + `* - Spigot: ${valid_platform.java}`, + "*", + "**************************************************************" + ]; + console.log(cli_color.whiteBright(help.join("\n").replace(/true/gi, cli_color.greenBright("true")).replace(/false/gi, cli_color.redBright("false")).replace(/undefined/gi, cli_color.red("undefined")))); + // End + return; + } + // Download if (ProcessArgs.download || ProcessArgs.d) { - const oraDownload = ora("Downloading...").start(); + const VersionList = Object.getOwnPropertyNames((await BdsReq.json(BdsExtraInfo.Fetchs.servers))[BdsCore.BdsSettigs.GetPlatform()]).map(version => ({ + name: `${BdsCore.BdsSettigs.GetPlatform()}: v${version}`, + value: version, + })) + if ((ProcessArgs.download || ProcessArgs.d) === true || (ProcessArgs.download || ProcessArgs.d) === "latest") ProcessArgs.d = ProcessArgs.download = (await inquirer.prompt([ + { + type: "list", + name: "download", + message: "Select the platform to download", + choices: VersionList + } + ])).download; + const oraDownload = ora(`Downloading ${BdsCore.BdsSettigs.GetPlatform()} on version ${ProcessArgs.d || ProcessArgs.download}`).start(); try { const DownloadInfo = await BdsCore.download.v2(ProcessArgs.d || ProcessArgs.download, true); const DownloadSucess = ["Downloaded Successfully"]; @@ -57,9 +97,17 @@ async function Runner() { serverline.init(); serverline.setCompletion(["tp"]); serverline.setPrompt("Command > "); - serverline.on("line", function(line) { + serverline.on("line", async function(line) { if (/^@/.test(line)) { console.log("🤪It's not working yet!"); + // const command = (await inquirer.prompt([ + // { + // type: "list", + // name: "command", + // message: "Select the command to run", + // choices: ["tp", "stop", "restart", "update", "info", "download"] + // } + // ])).command; } else BdsCoreStart.command(line); }); } -- 2.45.2 From 7f51d4d1068a5ccc7343754248fd639cf8809b0b Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 24 Sep 2021 23:16:16 -0300 Subject: [PATCH 6/9] fix. commandExits --- bin/bds_maneger_v2.js | 1 + 1 file changed, 1 insertion(+) diff --git a/bin/bds_maneger_v2.js b/bin/bds_maneger_v2.js index 6464518..4ef0d56 100644 --- a/bin/bds_maneger_v2.js +++ b/bin/bds_maneger_v2.js @@ -14,6 +14,7 @@ const ProcessArgs = require("minimist")(process.argv.slice(2)); const BdsCore = require("../index"); const BdsReq = require("../lib/Requests"); const BdsExtraInfo = require("../BdsManegerInfo.json"); +const commandExits = require("../lib/commandExist") // Async functiona async function Runner() { -- 2.45.2 From 4a9a2a6875a76ed92f492fd43831d837904144ba Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Fri, 24 Sep 2021 23:46:02 -0300 Subject: [PATCH 7/9] add os-tmpdir for inquirer on Android (Termux) --- package-lock.json | 34 +++++++++++++++++++++++++++++++++- package.json | 3 ++- 2 files changed, 35 insertions(+), 2 deletions(-) diff --git a/package-lock.json b/package-lock.json index 2e14551..010e684 100644 --- a/package-lock.json +++ b/package-lock.json @@ -41,7 +41,8 @@ "devDependencies": { "docker-run_build": "*", "eslint": "^7.19.0", - "nodemon": "^2.0.12" + "nodemon": "^2.0.12", + "os-tmpdir": "^2.0.0" }, "engines": { "node": ">=14", @@ -4426,6 +4427,16 @@ "url": "https://github.com/chalk/strip-ansi?sponsor=1" } }, + "node_modules/os-tmpdir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-2.0.0.tgz", + "integrity": "sha512-wZojVQP1fR3zW/Z9YLGJz4etXiu5d2tm4D6R4w2FTx1BAx9F1T+tEBb4+0deWQoskF1xe9zgBr/9mYwE+KY3xw==", + "deprecated": "This is not needed anymore. `require('os').tmpdir()` in Node.js 4 and up is good.", + "dev": true, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -5260,6 +5271,14 @@ "node": ">=0.6.0" } }, + "node_modules/tmp/node_modules/os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/to-readable-stream": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", @@ -9243,6 +9262,12 @@ } } }, + "os-tmpdir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-2.0.0.tgz", + "integrity": "sha512-wZojVQP1fR3zW/Z9YLGJz4etXiu5d2tm4D6R4w2FTx1BAx9F1T+tEBb4+0deWQoskF1xe9zgBr/9mYwE+KY3xw==", + "dev": true + }, "p-cancelable": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", @@ -9878,6 +9903,13 @@ "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "requires": { "os-tmpdir": "~1.0.2" + }, + "dependencies": { + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=" + } } }, "to-readable-stream": { diff --git a/package.json b/package.json index d6b1dab..ed6fb57 100644 --- a/package.json +++ b/package.json @@ -76,6 +76,7 @@ "devDependencies": { "docker-run_build": "*", "eslint": "^7.19.0", - "nodemon": "^2.0.12" + "nodemon": "^2.0.12", + "os-tmpdir": "^2.0.0" } } -- 2.45.2 From 81e425f79cf747cc79eddac3e0e52c2cc2edbd21 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Sat, 25 Sep 2021 02:53:14 -0300 Subject: [PATCH 8/9] Update node Packages after Merge --- package-lock.json | 13 ------------- 1 file changed, 13 deletions(-) diff --git a/package-lock.json b/package-lock.json index 17ece38..35844c9 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4930,14 +4930,6 @@ "node": ">= 0.8.0" } }, - "node_modules/serverline": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", - "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==", - "engines": { - "node": ">=10.0.0" - } - }, "node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -9651,11 +9643,6 @@ "send": "0.17.1" } }, - "serverline": { - "version": "1.5.0", - "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", - "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==" - }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", -- 2.45.2 From 7cbbda9bc80d5287a5812c0cc5389bdbcd7f0d50 Mon Sep 17 00:00:00 2001 From: Matheus Sampaio Queiroga Date: Sat, 25 Sep 2021 02:58:11 -0300 Subject: [PATCH 9/9] Update node Packages after Merge 2 --- package-lock.json | 14 ++++++++++++++ package.json | 1 + 2 files changed, 15 insertions(+) diff --git a/package-lock.json b/package-lock.json index 35844c9..9bde1e2 100644 --- a/package-lock.json +++ b/package-lock.json @@ -30,6 +30,7 @@ "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", + "serverline": "^1.5.0", "telegraf": "^4.0.0" }, "bin": { @@ -4930,6 +4931,14 @@ "node": ">= 0.8.0" } }, + "node_modules/serverline": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", + "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==", + "engines": { + "node": ">=10.0.0" + } + }, "node_modules/setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", @@ -9643,6 +9652,11 @@ "send": "0.17.1" } }, + "serverline": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/serverline/-/serverline-1.5.0.tgz", + "integrity": "sha512-QzNBH8omGchv+L5n/irZEeU2IGK3r8EMRh3EKRIlbfTklf9PtNRiRbWcYr8kqdNeWdc5M5jS13VtspDKgFXFFg==" + }, "setprototypeof": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/setprototypeof/-/setprototypeof-1.1.1.tgz", diff --git a/package.json b/package.json index 096a134..4658e72 100644 --- a/package.json +++ b/package.json @@ -69,6 +69,7 @@ "ora": "^6.0.1", "properties-to-json": "^0.2.1", "request-ip": "^2.1.3", + "serverline": "^1.5.0", "telegraf": "^4.0.0" }, "devDependencies": { -- 2.45.2