From 323f05a70d261fce64c97bb798cd7a277f9f66b8 Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga Date: Wed, 30 Dec 2020 19:12:50 -0300 Subject: [PATCH 1/4] push --- Services/bds_settings.js | 4 ++-- Services/telegram/telegram_bot.js | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/Services/bds_settings.js b/Services/bds_settings.js index 989f2b6..711176e 100644 --- a/Services/bds_settings.js +++ b/Services/bds_settings.js @@ -4,7 +4,7 @@ const cpuCount = require('os').cpus().length; var fs = require("fs") if (2 < cpuCount - 2) var CPU = cpuCount - 2; else var CPU = cpuCount; if (json_config.includes('.json')){ - var config = JSON.parse(fs.readFileSync(json_config, 'utf-8')) + var config = JSON.parse(fs.readFileSync(json_config, 'utf8')) } else var config = JSON.parse(json_config) // const config = json_storage/*JSON.parse(json_storage)*/ @@ -139,7 +139,7 @@ function bds_get_config(){ var fs = require("fs"); const propertiesToJSON = require("properties-to-json"); const Server_Config = `${require("../index").server_dir}/server.properties`; - const inGET = fs.readFileSync(Server_Config, "utf-8").replaceAll('-','_'); + const inGET = fs.readFileSync(Server_Config, "utf8").replaceAll('-','_'); return propertiesToJSON(inGET); }; module.exports.config_example = () =>{ diff --git a/Services/telegram/telegram_bot.js b/Services/telegram/telegram_bot.js index 0ca58a0..c603b02 100644 --- a/Services/telegram/telegram_bot.js +++ b/Services/telegram/telegram_bot.js @@ -9,7 +9,8 @@ Commands: /server_stop /server_restart /log -/command: Commands are not working in this version, wait until it is broken +/command +/list The messages are re-transmitted to the minecraft chat if it is already connected: ✔ Message Control: ❌` ctx.reply(amenssagem) -- 2.45.2 From fe98b1421e28768ccc1af62296ea404df0841082 Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga Date: Wed, 6 Jan 2021 00:25:51 -0300 Subject: [PATCH 2/4] teste --- Services/drive/auth.js | 63 +++++++++++++++++++++++++++++++ Services/telegram/telegram_bot.js | 6 +++ index.js | 1 + 3 files changed, 70 insertions(+) diff --git a/Services/drive/auth.js b/Services/drive/auth.js index c813f90..890be32 100644 --- a/Services/drive/auth.js +++ b/Services/drive/auth.js @@ -80,4 +80,67 @@ module.exports.drive_backup = (parent_id) => { }); } return 'Use backup_id para ter o id do ultimo arquivo' +}; /*End*/ + +// Donwnload +module.exports.drive_download = (parent_id) => { + const fs = require('fs'); + const readline = require('readline'); + const {google} = require('googleapis'); + + const SCOPES = ['https://www.googleapis.com/auth/drive']; + const TOKEN_PATH = __dirname+'/token.json'; + + return fs.readFile(__dirname+'/credentials.json', (err, content) => { + if (err) return console.log('Error loading client secret file:', err); + return authorize(JSON.parse(content), listFiles); + }); + + + function authorize(credentials, callback) { + const {client_secret, client_id, redirect_uris} = credentials.installed; + const oAuth2Client = new google.auth.OAuth2( + client_id, client_secret, redirect_uris[0]); + + fs.readFile(TOKEN_PATH, (err, token) => { + if (err) return getAccessToken(oAuth2Client, callback); + oAuth2Client.setCredentials(JSON.parse(token)); + callback(oAuth2Client); + }); + } + + function getAccessToken(oAuth2Client, callback) { + const authUrl = oAuth2Client.generateAuthUrl({ + access_type: 'offline', + scope: SCOPES, + }); + console.log('Authorize this app by visiting this url:', authUrl); + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }); + rl.question('Enter the code from that page here: ', (code) => { + rl.close(); + oAuth2Client.getToken(code, (err, token) => { + if (err) return console.error('Error retrieving access token', err); + oAuth2Client.setCredentials(token); + fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { + if (err) return console.error(err); + console.log('Token stored to', TOKEN_PATH); + }); + callback(oAuth2Client); + }); + }); + }; + function listFiles(auth) { + const bds = require('../../index').tmp_dir + const drive = google.drive({version: 'v3', auth}); + var fileId = '11jJjMZRtrQus3Labo_kr85EgtgSVRPLI'; + var dest = fs.createWriteStream(`${bds}/mcpe.apk`); + drive.files.get({fileId: fileId, alt: 'media'}, {responseType: 'stream'},function(err, res){ + res.data.on('end', () => { + console.log('Done');}).on('error', err => { + console.log('Error', err)}).pipe(dest)}) + } + // return 'Use backup_id para ter o id do ultimo arquivo' }; /*End*/ \ No newline at end of file diff --git a/Services/telegram/telegram_bot.js b/Services/telegram/telegram_bot.js index c603b02..dd3be3a 100644 --- a/Services/telegram/telegram_bot.js +++ b/Services/telegram/telegram_bot.js @@ -83,6 +83,12 @@ bot.command('list', (ctx) =>{ ctx.reply('NO log file to get list player') } }); +bot.command('mcpe', (ctx) =>{ + const fs = require('fs'); + const bds = require('../../index'); + // https://telegraf.js.org/#/?id=senddocument + telegram.sendDocument(ctx.chatId, doc) +}); bot.command('log', (ctx) => { const file_log_path = require('../../index').log_file; const fs = require("fs") diff --git a/index.js b/index.js index 0e46bb1..435ee7c 100644 --- a/index.js +++ b/index.js @@ -102,6 +102,7 @@ module.exports.date = date module.exports.command = require('./Services/command').command module.exports.backup = require("./Services/backup").World_BAckup module.exports.drive_backup = require('./Services/drive/auth').drive_backup +module.exports.mcpe_file = require('./Services/drive/auth').drive_download module.exports.kill = require("./Services/kill").bds_kill module.exports.version_Download = require("./Services/download").DownloadBDS module.exports.set_config = require("./Services/bds_settings").config -- 2.45.2 From 06635882cb65f4dfd0bfdb738924636a62b35ec0 Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga Date: Fri, 8 Jan 2021 15:12:42 -0300 Subject: [PATCH 3/4] push --- .gitignore | 2 +- .vscode/settings.json | 3 - Services/drive/auth.js | 204 +++---- Services/stop.js | 20 +- Services/telegram/telegram_bot.js | 7 +- index.js | 54 +- package-lock.json | 877 ++++++++++++++++++++++++++++++ package.json | 4 +- 8 files changed, 995 insertions(+), 176 deletions(-) delete mode 100644 .vscode/settings.json create mode 100644 package-lock.json diff --git a/.gitignore b/.gitignore index 145287d..cb1ef8d 100644 --- a/.gitignore +++ b/.gitignore @@ -2,6 +2,6 @@ node_modules/ *-Test/ *teste/ debug.log -package-lock.json +# package-lock.json Bds_Maneger .dccache diff --git a/.vscode/settings.json b/.vscode/settings.json deleted file mode 100644 index cad7657..0000000 --- a/.vscode/settings.json +++ /dev/null @@ -1,3 +0,0 @@ -{ - "cmake.configureOnOpen": false -} \ No newline at end of file diff --git a/Services/drive/auth.js b/Services/drive/auth.js index 890be32..1af5fca 100644 --- a/Services/drive/auth.js +++ b/Services/drive/auth.js @@ -1,146 +1,72 @@ +const fs = require('fs'); +const readline = require('readline'); +const {google} = require('googleapis'); +const bds = require('../../index') +const SCOPES = ['https://www.googleapis.com/auth/drive']; +const TOKEN_PATH = path.join(bds.server_dir, 'google_token.json'); + + +function authorize(credentials, callback) { + const {client_secret, client_id, redirect_uris} = credentials.installed; + const oAuth2Client = new google.auth.OAuth2( + client_id, client_secret, redirect_uris[0]); + + fs.readFile(TOKEN_PATH, (err, token) => { + if (err) return getAccessToken(oAuth2Client, callback); + oAuth2Client.setCredentials(JSON.parse(token)); + callback(oAuth2Client);}); +} +function getAccessToken(oAuth2Client, callback) { + const authUrl = oAuth2Client.generateAuthUrl({ + access_type: 'offline', + scope: SCOPES, + }); + console.log('Authorize this app by visiting this url:', authUrl); + const rl = readline.createInterface({ + input: process.stdin, + output: process.stdout, + }); + rl.question('Enter the code from that page here: ', (code) => { + rl.close(); + oAuth2Client.getToken(code, (err, token) => { + if (err) return console.error('Error retrieving access token', err); + oAuth2Client.setCredentials(token); + fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { + if (err) return console.error(err); + console.log('Token stored to', TOKEN_PATH); + }); + callback(oAuth2Client); + }); + }); +}; + +const CREDENTIAL = require('../../index').google_drive_credential module.exports.drive_backup = (parent_id) => { - const fs = require('fs'); - const readline = require('readline'); - const {google} = require('googleapis'); - - const SCOPES = ['https://www.googleapis.com/auth/drive']; - const TOKEN_PATH = __dirname+'/token.json'; - - fs.readFile(__dirname+'/credentials.json', (err, content) => { - if (err) return console.log('Error loading client secret file:', err); - authorize(JSON.parse(content), listFiles); - }); - - - function authorize(credentials, callback) { - const {client_secret, client_id, redirect_uris} = credentials.installed; - const oAuth2Client = new google.auth.OAuth2( - client_id, client_secret, redirect_uris[0]); - - fs.readFile(TOKEN_PATH, (err, token) => { - if (err) return getAccessToken(oAuth2Client, callback); - oAuth2Client.setCredentials(JSON.parse(token)); - callback(oAuth2Client); - }); - } - - function getAccessToken(oAuth2Client, callback) { - const authUrl = oAuth2Client.generateAuthUrl({ - access_type: 'offline', - scope: SCOPES, - }); - console.log('Authorize this app by visiting this url:', authUrl); - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }); - rl.question('Enter the code from that page here: ', (code) => { - rl.close(); - oAuth2Client.getToken(code, (err, token) => { - if (err) return console.error('Error retrieving access token', err); - oAuth2Client.setCredentials(token); - fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { - if (err) return console.error(err); - console.log('Token stored to', TOKEN_PATH); - }); - callback(oAuth2Client); - }); - }); - }; - function listFiles(auth) { - const bds_backup = require('../backup').Drive_backup() + function upload_backup(auth) { + const bds_backup = require('../backup').Drive_backup(); const drive = google.drive({version: 'v3', auth}); - if (parent_id == undefined){ - var fileMetadata = { - 'name': bds_backup.file_name, - }; - console.log('Your backup will be saved to My Drive') - } else { - var fileMetadata = { - 'name': bds_backup.file_name, - parents: [parent_id] - }; - }; - var media = { - mimeType: 'application/octet-stream', - body: fs.createReadStream(bds_backup.file_dir) - }; - drive.files.create({ - resource: fileMetadata, - media: media, - fields: 'id', - }, function (err, file) { - if (err) { - // Handle error - console.error(err); - } else { + if (parent_id == undefined){var fileMetadata = {'name': bds_backup.file_name,};console.log('Your backup will be saved to My Drive')} else {var fileMetadata = {'name': bds_backup.file_name,parents: [parent_id]};}; + var media = {mimeType: 'application/octet-stream',body: fs.createReadStream(bds_backup.file_dir)}; + drive.files.create({resource: fileMetadata, media: media, fields: 'id'}, function (err, file) { + if (err) {console.error(err);} else { global.backup_id = file.data.id; - console.log('File: ', file.data.id); - } + console.log('File: ', file.data.id);} }); } - return 'Use backup_id para ter o id do ultimo arquivo' -}; /*End*/ + return authorize(JSON.parse(CREDENTIAL), upload_backup); + // End Upload Backup +}; -// Donwnload -module.exports.drive_download = (parent_id) => { - const fs = require('fs'); - const readline = require('readline'); - const {google} = require('googleapis'); - - const SCOPES = ['https://www.googleapis.com/auth/drive']; - const TOKEN_PATH = __dirname+'/token.json'; - - return fs.readFile(__dirname+'/credentials.json', (err, content) => { - if (err) return console.log('Error loading client secret file:', err); - return authorize(JSON.parse(content), listFiles); - }); - - - function authorize(credentials, callback) { - const {client_secret, client_id, redirect_uris} = credentials.installed; - const oAuth2Client = new google.auth.OAuth2( - client_id, client_secret, redirect_uris[0]); - - fs.readFile(TOKEN_PATH, (err, token) => { - if (err) return getAccessToken(oAuth2Client, callback); - oAuth2Client.setCredentials(JSON.parse(token)); - callback(oAuth2Client); - }); - } - - function getAccessToken(oAuth2Client, callback) { - const authUrl = oAuth2Client.generateAuthUrl({ - access_type: 'offline', - scope: SCOPES, - }); - console.log('Authorize this app by visiting this url:', authUrl); - const rl = readline.createInterface({ - input: process.stdin, - output: process.stdout, - }); - rl.question('Enter the code from that page here: ', (code) => { - rl.close(); - oAuth2Client.getToken(code, (err, token) => { - if (err) return console.error('Error retrieving access token', err); - oAuth2Client.setCredentials(token); - fs.writeFile(TOKEN_PATH, JSON.stringify(token), (err) => { - if (err) return console.error(err); - console.log('Token stored to', TOKEN_PATH); - }); - callback(oAuth2Client); - }); - }); +module.exports.mcpe = () => { + function download_mcpe(auth) { + const drive = google.drive({version: 'v3', auth}); + var fileId = '11jJjMZRtrQus3Labo_kr85EgtgSVRPLI'; + var dest = fs.createWriteStream(path.join(bds.tmp_dir, 'mcpe.apk')); + let progress = 0; + drive.files.get({fileId: fileId, alt: 'media'}, {responseType: 'stream'},function(err, res){res.data.on('end', () => {console.log('\nDone');}).on('error', err => {console.log('\nError', err)}).on('data', d => { + progress += d.length / 1024 / 1024; + if (process.stdout.isTTY) {process.stdout.clearLine();process.stdout.cursorTo(0);process.stdout.write(`Downloaded ${Math.trunc(progress)} Mbytes`);} + }).pipe(dest)}); }; - function listFiles(auth) { - const bds = require('../../index').tmp_dir - const drive = google.drive({version: 'v3', auth}); - var fileId = '11jJjMZRtrQus3Labo_kr85EgtgSVRPLI'; - var dest = fs.createWriteStream(`${bds}/mcpe.apk`); - drive.files.get({fileId: fileId, alt: 'media'}, {responseType: 'stream'},function(err, res){ - res.data.on('end', () => { - console.log('Done');}).on('error', err => { - console.log('Error', err)}).pipe(dest)}) - } - // return 'Use backup_id para ter o id do ultimo arquivo' -}; /*End*/ \ No newline at end of file + return authorize(JSON.parse(CREDENTIAL), download_mcpe); +} diff --git a/Services/stop.js b/Services/stop.js index 3abe476..0f0f69f 100644 --- a/Services/stop.js +++ b/Services/stop.js @@ -1,18 +1,14 @@ module.exports.Server_stop = () => { - const Storage = require('../index').Storage(); - if (typeof bds_server_string == 'undefined'){ + if (typeof bds_server_string == 'undefined') console.log("The server is stopped!"); - return false - } else { + else { + const Storage = require('../index').Storage(); bds_server_string.stdin.write('stop\n'); - bds_server_string.stdout.on('data', function (data) { + bds_server_string.stdout.on('data', function (data){ if (data.includes('Quit correctly')){ - Storage.setItem('bds_status', false); - } + Storage.setItem('bds_status', false) + }; }); - if (!require('../Services/detect_bds').bds_detect()) - return true - else - return false }; -}; \ No newline at end of file + return !(require('../Services/detect_bds').bds_detect()) +} \ No newline at end of file diff --git a/Services/telegram/telegram_bot.js b/Services/telegram/telegram_bot.js index dd3be3a..af87622 100644 --- a/Services/telegram/telegram_bot.js +++ b/Services/telegram/telegram_bot.js @@ -86,8 +86,13 @@ bot.command('list', (ctx) =>{ bot.command('mcpe', (ctx) =>{ const fs = require('fs'); const bds = require('../../index'); + const path = require('path') + // doc = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')) + const buff = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')) + console.log(`mcpe.apk buffer: ${buff}`) + ctx.replyWithDocument({ source: buff}, {filename: 'Bds.apk' }) // https://telegraf.js.org/#/?id=senddocument - telegram.sendDocument(ctx.chatId, doc) + // bot.sendDocument(ctx.chatId, doc) }); bot.command('log', (ctx) => { const file_log_path = require('../../index').log_file; diff --git a/index.js b/index.js index 435ee7c..427eca8 100644 --- a/index.js +++ b/index.js @@ -1,18 +1,16 @@ function date(fu) { var today = new Date(); - if (fu == 'year') { + if (fu == 'year') return `${today.getFullYear()}` - } else if (fu == 'day') { + else if (fu == 'day') return `${String(today.getDate()).padStart(2, '0')}` - }else if (fu == 'month') { + else if (fu == 'month') return `${String(today.getMonth() + 1).padStart(2, '0')}` - } else if (fu == 'hour'){ + else if (fu == 'hour') return `${today.getHours()}_${today.getMinutes()}` - } else { + else return `${String(today.getDate()).padStart(2, '0')}-${String(today.getMonth() + 1).padStart(2, '0')}-${today.getFullYear()}_${today.getHours()}-${today.getSeconds()}` - }; } - function Storage(){ var LocalStorage = require('node-localstorage').LocalStorage; return new LocalStorage(`${require('./').api_dir}/Local_Storage`); @@ -64,18 +62,42 @@ if (process.platform == 'win32') { console.log(`Please use an operating system (OS) compatible with Minecraft Bedrock Server ${process.platform} is not supported`); process.exit(2021) }; + +if (!(fs.existsSync(server_dir))){ + fs.mkdirSync(server_dir); + console.log('Creating the bds directory') +} function telegram_tokenv1(){ if (require("fs").existsSync(`${server_dir}/token.txt`)){ - return require("fs").readFileSync(`${server_dir}/token.txt`, "utf-8").replaceAll('\n', ''); + return require("fs").readFileSync(`${server_dir}/token.txt`, "utf8").replaceAll('\n', ''); } else { - return '10000a0asd1dssd0000000'; - }; + return undefined; + } }; if (typeof fetch === 'undefined'){ var fetch = require('node-fetch') -} -fetch('https://raw.githubusercontent.com/Bds-Maneger/Raw_files/main/Server.json').then(response => response.text()).then(rawOUT => {Storage().setItem('bds_versions', rawOUT);}); -fetch("https://raw.githubusercontent.com/Bds-Maneger/Raw_files/main/Server.json").then(function (response) {return response.json();}).then(function (content) {Storage().setItem('bds_latest', content.latest);}); +} +fetch('https://raw.githubusercontent.com/Bds-Maneger/Raw_files/main/credentials.json').then(response => response.text()).then(gd_cre => { + module.exports.google_drive_credential = gd_cre + module.exports.drive_backup = require('./Services/drive/auth').drive_backup + module.exports.mcpe_file = require('./Services/drive/auth').mcpe +}).catch(function(error) {console.log(`Could not get credentials, Error: \"${error.message}\"`);}); +fetch('https://raw.githubusercontent.com/Bds-Maneger/Raw_files/main/Server.json').then(response => response.json()).then(rawOUT => { + for (let v in rawOUT.Versions){ + var html = `${rawOUT.Versions[v]}`; + var out = `${out}\n `; + v++; + }; + module.exports.version_select = out.replaceAll(undefined, ''); + module.exports.version_raw = rawOUT.Versions; + module.exports.bds_latest = rawOUT.latest; + module.exports.get_version = (type) => { + if (type == 'raw') + return rawOUT.Versions; + else + return out.replaceAll(undefined, ''); + } +}).catch(function(error) {console.log('There has been a problem with your fetch operation: ' + error.message);}); // // Module export /* Variaveis */ @@ -90,21 +112,17 @@ module.exports.electron = electron_de module.exports.api_dir = cache_dir module.exports.log_file = log_file module.exports.log_date = log_date -module.exports.bds_latest = require("./Services/versions").bds_latest() /* Commands server */ module.exports.detect = require("./Services/detect_bds").bds_detect -module.exports.get_version = require("./Services/versions").bds_version_get module.exports.telegram = require("./Services/telegram/telegram_bot") module.exports.start = require('./Services/start').Server_start module.exports.stop = require('./Services/stop').Server_stop module.exports.date = date module.exports.command = require('./Services/command').command module.exports.backup = require("./Services/backup").World_BAckup -module.exports.drive_backup = require('./Services/drive/auth').drive_backup -module.exports.mcpe_file = require('./Services/drive/auth').drive_download module.exports.kill = require("./Services/kill").bds_kill module.exports.version_Download = require("./Services/download").DownloadBDS module.exports.set_config = require("./Services/bds_settings").config module.exports.get_config = require("./Services/bds_settings").get_config -module.exports.config_example = require("./Services/bds_settings").config_example \ No newline at end of file +module.exports.config_example = require("./Services/bds_settings").config_example diff --git a/package-lock.json b/package-lock.json new file mode 100644 index 0000000..754d106 --- /dev/null +++ b/package-lock.json @@ -0,0 +1,877 @@ +{ + "name": "bds_maneger_api", + "version": "1.0.3", + "lockfileVersion": 2, + "requires": true, + "packages": { + "": { + "version": "1.0.3", + "license": "LGPL", + "dependencies": { + "@google-cloud/local-auth": "^1.0.0", + "adm-zip": "^0.5.1", + "googleapis": "^66.0.0", + "node-fetch": "^2.6.1", + "node-localstorage": "^2.1.6", + "open": "^7.3.0", + "properties-to-json": "^0.1.7", + "telegraf": "^3.38.0" + } + }, + "node_modules/@google-cloud/local-auth": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/local-auth/-/local-auth-1.0.0.tgz", + "integrity": "sha512-8++xe3wbfWurkG/TTQWgZAsgFPjyV6jrImEooK1OH50mNp+rImsJ/SUgf4a/TST7va5Uhc5cQEn7HpsIcxS+ew==", + "dependencies": { + "arrify": "^2.0.1", + "google-auth-library": "^6.0.0", + "open": "^7.0.3", + "server-destroy": "^1.0.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "dependencies": { + "event-target-shim": "^5.0.0" + }, + "engines": { + "node": ">=6.5" + } + }, + "node_modules/adm-zip": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.1.tgz", + "integrity": "sha512-a5ABmIFUJ9OxHV5zrXM9Q41JzpRIflFtdgpL4UQM9DsTHHxQzPRaeyAdnMW7kxL0NRWm/NHafJdj6pO+ty7L2g==", + "engines": { + "node": ">=6.0" + } + }, + "node_modules/agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "dependencies": { + "debug": "4" + }, + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "engines": { + "node": ">=8" + } + }, + "node_modules/base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", + "funding": [ + { + "type": "github", + "url": "https://github.com/sponsors/feross" + }, + { + "type": "patreon", + "url": "https://www.patreon.com/feross" + }, + { + "type": "consulting", + "url": "https://feross.org/support" + } + ] + }, + "node_modules/bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==", + "engines": { + "node": "*" + } + }, + "node_modules/buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "node_modules/debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "dependencies": { + "ms": "2.1.2" + }, + "engines": { + "node": ">=6.0" + }, + "peerDependenciesMeta": { + "supports-color": { + "optional": true + } + } + }, + "node_modules/ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "dependencies": { + "safe-buffer": "^5.0.1" + } + }, + "node_modules/event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==", + "engines": { + "node": ">=6" + } + }, + "node_modules/extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "node_modules/fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, + "node_modules/gaxios": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz", + "integrity": "sha512-vb0to8xzGnA2qcgywAjtshOKKVDf2eQhJoiL6fHhgW5tVN7wNk7egnYIO9zotfn3lQ3De1VPdf7V5/BWfCtCmg==", + "dependencies": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/gcp-metadata": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", + "dependencies": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-auth-library": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.3.tgz", + "integrity": "sha512-m9mwvY3GWbr7ZYEbl61isWmk+fvTmOt0YNUfPOUY2VH8K5pZlAIWJjxEi0PqR3OjMretyiQLI6GURMrPSwHQ2g==", + "dependencies": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/google-p12-pem": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz", + "integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==", + "dependencies": { + "node-forge": "^0.10.0" + }, + "bin": { + "gp12-pem": "build/src/bin/gp12-pem.js" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/googleapis": { + "version": "66.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-66.0.0.tgz", + "integrity": "sha512-jdEleRoyo/AeJZjKGC7Z2mHgochn2vR2JKqey6kydRkIBmCZxoQKLisRR4H8CRYZeEd6+c8Ns/LzS1S7qUjoFw==", + "dependencies": { + "google-auth-library": "^6.0.0", + "googleapis-common": "^4.4.1" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/googleapis-common": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-4.4.3.tgz", + "integrity": "sha512-W46WKCk3QtlCCfmZyQIH5zxmDOyeV5Qj+qs7nr2ox08eRkEJMWp6iwv542R/PsokXaGUSrmif4vCC4+rGzRSsQ==", + "dependencies": { + "extend": "^3.0.2", + "gaxios": "^4.0.0", + "google-auth-library": "^6.0.0", + "qs": "^6.7.0", + "url-template": "^2.0.8", + "uuid": "^8.0.0" + }, + "engines": { + "node": ">=10.10.0" + } + }, + "node_modules/graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "node_modules/gtoken": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.1.0.tgz", + "integrity": "sha512-4d8N6Lk8TEAHl9vVoRVMh9BNOKWVgl2DdNtr3428O75r3QFrF/a5MMu851VmK0AA8+iSvbwRv69k5XnMLURGhg==", + "dependencies": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0", + "mime": "^2.2.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "dependencies": { + "agent-base": "6", + "debug": "4" + }, + "engines": { + "node": ">= 6" + } + }, + "node_modules/imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "engines": { + "node": ">=0.8.19" + } + }, + "node_modules/is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==", + "bin": { + "is-docker": "cli.js" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==", + "engines": { + "node": ">=8" + } + }, + "node_modules/is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "dependencies": { + "is-docker": "^2.0.0" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "dependencies": { + "bignumber.js": "^9.0.0" + } + }, + "node_modules/jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "dependencies": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "dependencies": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "node_modules/lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "dependencies": { + "yallist": "^4.0.0" + }, + "engines": { + "node": ">=10" + } + }, + "node_modules/mime": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", + "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==", + "bin": { + "mime": "cli.js" + }, + "engines": { + "node": ">=4.0.0" + } + }, + "node_modules/minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "node_modules/module-alias": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz", + "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" + }, + "node_modules/ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node_modules/node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==", + "engines": { + "node": "4.x || >=6.0.0" + } + }, + "node_modules/node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==", + "engines": { + "node": ">= 6.0.0" + } + }, + "node_modules/node-localstorage": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.1.6.tgz", + "integrity": "sha512-yE7AycE5G2hU55d+F7Ona9nx97C+enJzWWx6jrsji7fuPZFJOvuW3X/LKKAcXRBcEIJPDOKt8ZiFWFmShR/irg==", + "dependencies": { + "write-file-atomic": "^1.1.4" + }, + "engines": { + "node": ">=0.12" + } + }, + "node_modules/open": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/open/-/open-7.3.0.tgz", + "integrity": "sha512-mgLwQIx2F/ye9SmbrUkurZCnkoXyXyu9EbHtJZrICjVAJfyMArdHp3KkixGdZx1ZHFPNIwl0DDM1dFFqXbTLZw==", + "dependencies": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + }, + "engines": { + "node": ">=8" + }, + "funding": { + "url": "https://github.com/sponsors/sindresorhus" + } + }, + "node_modules/properties-to-json": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/properties-to-json/-/properties-to-json-0.1.7.tgz", + "integrity": "sha512-zIq+KEciImrJrI9ZV/p4t7d2f1j/yUATZguWeGH2SUhd0PF/56dPitc5zaSYI4f0Pghp3L9JniMAED8AG/ztcQ==" + }, + "node_modules/qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==", + "engines": { + "node": ">=0.6" + }, + "funding": { + "url": "https://github.com/sponsors/ljharb" + } + }, + "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/sandwich-stream": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz", + "integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==", + "engines": { + "node": ">= 0.10" + } + }, + "node_modules/server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=" + }, + "node_modules/slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=", + "engines": { + "node": "*" + } + }, + "node_modules/telegraf": { + "version": "3.38.0", + "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.38.0.tgz", + "integrity": "sha512-va4VlrKWp64JrowFoZX/NPzzA6q38kvaIukVXOWFO1V+jR1G8+hCfgJy4TX8Z3rwLJzwaBEet1QhikHDRZWl3A==", + "dependencies": { + "debug": "^4.0.1", + "minimist": "^1.2.0", + "module-alias": "^2.2.2", + "node-fetch": "^2.2.0", + "sandwich-stream": "^2.0.1", + "telegram-typings": "^3.6.0" + }, + "bin": { + "telegraf": "bin/telegraf" + }, + "engines": { + "node": ">=8" + } + }, + "node_modules/telegram-typings": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz", + "integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw==" + }, + "node_modules/url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "node_modules/uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==", + "bin": { + "uuid": "dist/bin/uuid" + } + }, + "node_modules/write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "dependencies": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "node_modules/yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + }, + "dependencies": { + "@google-cloud/local-auth": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/@google-cloud/local-auth/-/local-auth-1.0.0.tgz", + "integrity": "sha512-8++xe3wbfWurkG/TTQWgZAsgFPjyV6jrImEooK1OH50mNp+rImsJ/SUgf4a/TST7va5Uhc5cQEn7HpsIcxS+ew==", + "requires": { + "arrify": "^2.0.1", + "google-auth-library": "^6.0.0", + "open": "^7.0.3", + "server-destroy": "^1.0.1" + } + }, + "abort-controller": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/abort-controller/-/abort-controller-3.0.0.tgz", + "integrity": "sha512-h8lQ8tacZYnR3vNQTgibj+tODHI5/+l06Au2Pcriv/Gmet0eaj4TwWH41sO9wnHDiQsEj19q0drzdWdeAHtweg==", + "requires": { + "event-target-shim": "^5.0.0" + } + }, + "adm-zip": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/adm-zip/-/adm-zip-0.5.1.tgz", + "integrity": "sha512-a5ABmIFUJ9OxHV5zrXM9Q41JzpRIflFtdgpL4UQM9DsTHHxQzPRaeyAdnMW7kxL0NRWm/NHafJdj6pO+ty7L2g==" + }, + "agent-base": { + "version": "6.0.2", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-6.0.2.tgz", + "integrity": "sha512-RZNwNclF7+MS/8bDg70amg32dyeZGZxiDuQmZxKLAlQjr3jGyLx+4Kkk58UO7D2QdgFIQCovuSuZESne6RG6XQ==", + "requires": { + "debug": "4" + } + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==" + }, + "base64-js": { + "version": "1.5.1", + "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", + "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==" + }, + "bignumber.js": { + "version": "9.0.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.0.1.tgz", + "integrity": "sha512-IdZR9mh6ahOBv/hYGiXyVuyCetmGJhtYkqLBpTStdhEGjegpPlUawydyaF3pbIOFynJTpllEs+NP+CS9jKFLjA==" + }, + "buffer-equal-constant-time": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buffer-equal-constant-time/-/buffer-equal-constant-time-1.0.1.tgz", + "integrity": "sha1-+OcRMvf/5uAaXJaXpMbz5I1cyBk=" + }, + "debug": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.1.tgz", + "integrity": "sha512-doEwdvm4PCeK4K3RQN2ZC2BYUBaxwLARCqZmMjtF8a51J2Rb0xpVloFRnCODwqjpwnAoao4pelN8l3RJdv3gRQ==", + "requires": { + "ms": "2.1.2" + } + }, + "ecdsa-sig-formatter": { + "version": "1.0.11", + "resolved": "https://registry.npmjs.org/ecdsa-sig-formatter/-/ecdsa-sig-formatter-1.0.11.tgz", + "integrity": "sha512-nagl3RYrbNv6kQkeJIpt6NJZy8twLB/2vtz6yN9Z4vRKHN4/QZJIEbqohALSgwKdnksuY3k5Addp5lg8sVoVcQ==", + "requires": { + "safe-buffer": "^5.0.1" + } + }, + "event-target-shim": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/event-target-shim/-/event-target-shim-5.0.1.tgz", + "integrity": "sha512-i/2XbnSz/uxRCU6+NdVJgKWDTM427+MqYbkQzD321DuCQJUqOuJKIA0IM2+W2xtYHdKOmZ4dR6fExsd4SXL+WQ==" + }, + "extend": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.2.tgz", + "integrity": "sha512-fjquC59cD7CyW6urNXK0FBufkZcoiGG80wTuPujX590cB5Ttln20E2UB4S/WARVqhXffZl2LNgS+gQdPIIim/g==" + }, + "fast-text-encoding": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/fast-text-encoding/-/fast-text-encoding-1.0.3.tgz", + "integrity": "sha512-dtm4QZH9nZtcDt8qJiOH9fcQd1NAgi+K1O2DbE6GG1PPCK/BWfOH3idCTRQ4ImXRUOyopDEgDEnVEE7Y/2Wrig==" + }, + "gaxios": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/gaxios/-/gaxios-4.1.0.tgz", + "integrity": "sha512-vb0to8xzGnA2qcgywAjtshOKKVDf2eQhJoiL6fHhgW5tVN7wNk7egnYIO9zotfn3lQ3De1VPdf7V5/BWfCtCmg==", + "requires": { + "abort-controller": "^3.0.0", + "extend": "^3.0.2", + "https-proxy-agent": "^5.0.0", + "is-stream": "^2.0.0", + "node-fetch": "^2.3.0" + } + }, + "gcp-metadata": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/gcp-metadata/-/gcp-metadata-4.2.1.tgz", + "integrity": "sha512-tSk+REe5iq/N+K+SK1XjZJUrFPuDqGZVzCy2vocIHIGmPlTGsa8owXMJwGkrXr73NO0AzhPW4MF2DEHz7P2AVw==", + "requires": { + "gaxios": "^4.0.0", + "json-bigint": "^1.0.0" + } + }, + "google-auth-library": { + "version": "6.1.3", + "resolved": "https://registry.npmjs.org/google-auth-library/-/google-auth-library-6.1.3.tgz", + "integrity": "sha512-m9mwvY3GWbr7ZYEbl61isWmk+fvTmOt0YNUfPOUY2VH8K5pZlAIWJjxEi0PqR3OjMretyiQLI6GURMrPSwHQ2g==", + "requires": { + "arrify": "^2.0.0", + "base64-js": "^1.3.0", + "ecdsa-sig-formatter": "^1.0.11", + "fast-text-encoding": "^1.0.0", + "gaxios": "^4.0.0", + "gcp-metadata": "^4.2.0", + "gtoken": "^5.0.4", + "jws": "^4.0.0", + "lru-cache": "^6.0.0" + } + }, + "google-p12-pem": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/google-p12-pem/-/google-p12-pem-3.0.3.tgz", + "integrity": "sha512-wS0ek4ZtFx/ACKYF3JhyGe5kzH7pgiQ7J5otlumqR9psmWMYc+U9cErKlCYVYHoUaidXHdZ2xbo34kB+S+24hA==", + "requires": { + "node-forge": "^0.10.0" + } + }, + "googleapis": { + "version": "66.0.0", + "resolved": "https://registry.npmjs.org/googleapis/-/googleapis-66.0.0.tgz", + "integrity": "sha512-jdEleRoyo/AeJZjKGC7Z2mHgochn2vR2JKqey6kydRkIBmCZxoQKLisRR4H8CRYZeEd6+c8Ns/LzS1S7qUjoFw==", + "requires": { + "google-auth-library": "^6.0.0", + "googleapis-common": "^4.4.1" + } + }, + "googleapis-common": { + "version": "4.4.3", + "resolved": "https://registry.npmjs.org/googleapis-common/-/googleapis-common-4.4.3.tgz", + "integrity": "sha512-W46WKCk3QtlCCfmZyQIH5zxmDOyeV5Qj+qs7nr2ox08eRkEJMWp6iwv542R/PsokXaGUSrmif4vCC4+rGzRSsQ==", + "requires": { + "extend": "^3.0.2", + "gaxios": "^4.0.0", + "google-auth-library": "^6.0.0", + "qs": "^6.7.0", + "url-template": "^2.0.8", + "uuid": "^8.0.0" + } + }, + "graceful-fs": { + "version": "4.2.4", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.2.4.tgz", + "integrity": "sha512-WjKPNJF79dtJAVniUlGGWHYGz2jWxT6VhN/4m1NdkbZ2nOsEF+cI1Edgql5zCRhs/VsQYRvrXctxktVXZUkixw==" + }, + "gtoken": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/gtoken/-/gtoken-5.1.0.tgz", + "integrity": "sha512-4d8N6Lk8TEAHl9vVoRVMh9BNOKWVgl2DdNtr3428O75r3QFrF/a5MMu851VmK0AA8+iSvbwRv69k5XnMLURGhg==", + "requires": { + "gaxios": "^4.0.0", + "google-p12-pem": "^3.0.3", + "jws": "^4.0.0", + "mime": "^2.2.0" + } + }, + "https-proxy-agent": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-5.0.0.tgz", + "integrity": "sha512-EkYm5BcKUGiduxzSt3Eppko+PiNWNEpa4ySk9vTC6wDsQJW9rHSa+UhGNJoRYp7bz6Ht1eaRIa6QaJqO5rCFbA==", + "requires": { + "agent-base": "6", + "debug": "4" + } + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=" + }, + "is-docker": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-docker/-/is-docker-2.1.1.tgz", + "integrity": "sha512-ZOoqiXfEwtGknTiuDEy8pN2CfE3TxMHprvNer1mXiqwkOT77Rw3YVrUQ52EqAOU3QAWDQ+bQdx7HJzrv7LS2Hw==" + }, + "is-stream": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-2.0.0.tgz", + "integrity": "sha512-XCoy+WlUr7d1+Z8GgSuXmpuUFC9fOhRXglJMx+dwLKTkL44Cjd4W1Z5P+BQZpr+cR93aGP4S/s7Ftw6Nd/kiEw==" + }, + "is-wsl": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-wsl/-/is-wsl-2.2.0.tgz", + "integrity": "sha512-fKzAra0rGJUUBwGBgNkHZuToZcn+TtXHpeCgmkMJMMYx1sQDYaCSyjJBSCa2nH1DGm7s3n1oBnohoVTBaN7Lww==", + "requires": { + "is-docker": "^2.0.0" + } + }, + "json-bigint": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", + "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", + "requires": { + "bignumber.js": "^9.0.0" + } + }, + "jwa": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/jwa/-/jwa-2.0.0.tgz", + "integrity": "sha512-jrZ2Qx916EA+fq9cEAeCROWPTfCwi1IVHqT2tapuqLEVVDKFDENFw1oL+MwrTvH6msKxsd1YTDVw6uKEcsrLEA==", + "requires": { + "buffer-equal-constant-time": "1.0.1", + "ecdsa-sig-formatter": "1.0.11", + "safe-buffer": "^5.0.1" + } + }, + "jws": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/jws/-/jws-4.0.0.tgz", + "integrity": "sha512-KDncfTmOZoOMTFG4mBlG0qUIOlc03fmzH+ru6RgYVZhPkyiy/92Owlt/8UEN+a4TXR1FQetfIpJE8ApdvdVxTg==", + "requires": { + "jwa": "^2.0.0", + "safe-buffer": "^5.0.1" + } + }, + "lru-cache": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-6.0.0.tgz", + "integrity": "sha512-Jo6dJ04CmSjuznwJSS3pUeWmd/H0ffTlkXXgwZi+eq1UCmqQwCh+eLsYOYCwY991i2Fah4h1BEMCx4qThGbsiA==", + "requires": { + "yallist": "^4.0.0" + } + }, + "mime": { + "version": "2.4.7", + "resolved": "https://registry.npmjs.org/mime/-/mime-2.4.7.tgz", + "integrity": "sha512-dhNd1uA2u397uQk3Nv5LM4lm93WYDUXFn3Fu291FJerns4jyTudqhIWe4W04YLy7Uk1tm1Ore04NpjRvQp/NPA==" + }, + "minimist": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.5.tgz", + "integrity": "sha512-FM9nNUYrRBAELZQT3xeZQ7fmMOBg6nWNmJKTcgsJeaLstP/UODVpGsr5OhXhhXg6f+qtJ8uiZ+PUxkDWcgIXLw==" + }, + "module-alias": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/module-alias/-/module-alias-2.2.2.tgz", + "integrity": "sha512-A/78XjoX2EmNvppVWEhM2oGk3x4lLxnkEA4jTbaK97QKSDjkIoOsKQlfylt/d3kKKi596Qy3NP5XrXJ6fZIC9Q==" + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==" + }, + "node-fetch": { + "version": "2.6.1", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.6.1.tgz", + "integrity": "sha512-V4aYg89jEoVRxRb2fJdAg8FHvI7cEyYdVAh94HH0UIK8oJxUfkjlDQN9RbMx+bEjP7+ggMiFRprSti032Oipxw==" + }, + "node-forge": { + "version": "0.10.0", + "resolved": "https://registry.npmjs.org/node-forge/-/node-forge-0.10.0.tgz", + "integrity": "sha512-PPmu8eEeG9saEUvI97fm4OYxXVB6bFvyNTyiUOBichBpFG8A1Ljw3bY62+5oOjDEMHRnd0Y7HQ+x7uzxOzC6JA==" + }, + "node-localstorage": { + "version": "2.1.6", + "resolved": "https://registry.npmjs.org/node-localstorage/-/node-localstorage-2.1.6.tgz", + "integrity": "sha512-yE7AycE5G2hU55d+F7Ona9nx97C+enJzWWx6jrsji7fuPZFJOvuW3X/LKKAcXRBcEIJPDOKt8ZiFWFmShR/irg==", + "requires": { + "write-file-atomic": "^1.1.4" + } + }, + "open": { + "version": "7.3.0", + "resolved": "https://registry.npmjs.org/open/-/open-7.3.0.tgz", + "integrity": "sha512-mgLwQIx2F/ye9SmbrUkurZCnkoXyXyu9EbHtJZrICjVAJfyMArdHp3KkixGdZx1ZHFPNIwl0DDM1dFFqXbTLZw==", + "requires": { + "is-docker": "^2.0.0", + "is-wsl": "^2.1.1" + } + }, + "properties-to-json": { + "version": "0.1.7", + "resolved": "https://registry.npmjs.org/properties-to-json/-/properties-to-json-0.1.7.tgz", + "integrity": "sha512-zIq+KEciImrJrI9ZV/p4t7d2f1j/yUATZguWeGH2SUhd0PF/56dPitc5zaSYI4f0Pghp3L9JniMAED8AG/ztcQ==" + }, + "qs": { + "version": "6.9.4", + "resolved": "https://registry.npmjs.org/qs/-/qs-6.9.4.tgz", + "integrity": "sha512-A1kFqHekCTM7cz0udomYUoYNWjBebHm/5wzU/XqrBRBNWectVH0QIiN+NEcZ0Dte5hvzHwbr8+XQmguPhJ6WdQ==" + }, + "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==" + }, + "sandwich-stream": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/sandwich-stream/-/sandwich-stream-2.0.2.tgz", + "integrity": "sha512-jLYV0DORrzY3xaz/S9ydJL6Iz7essZeAfnAavsJ+zsJGZ1MOnsS52yRjU3uF3pJa/lla7+wisp//fxOwOH8SKQ==" + }, + "server-destroy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/server-destroy/-/server-destroy-1.0.1.tgz", + "integrity": "sha1-8Tv5KOQrnD55OD5hzDmYtdFObN0=" + }, + "slide": { + "version": "1.1.6", + "resolved": "https://registry.npmjs.org/slide/-/slide-1.1.6.tgz", + "integrity": "sha1-VusCfWW00tzmyy4tMsTUr8nh1wc=" + }, + "telegraf": { + "version": "3.38.0", + "resolved": "https://registry.npmjs.org/telegraf/-/telegraf-3.38.0.tgz", + "integrity": "sha512-va4VlrKWp64JrowFoZX/NPzzA6q38kvaIukVXOWFO1V+jR1G8+hCfgJy4TX8Z3rwLJzwaBEet1QhikHDRZWl3A==", + "requires": { + "debug": "^4.0.1", + "minimist": "^1.2.0", + "module-alias": "^2.2.2", + "node-fetch": "^2.2.0", + "sandwich-stream": "^2.0.1", + "telegram-typings": "^3.6.0" + } + }, + "telegram-typings": { + "version": "3.6.1", + "resolved": "https://registry.npmjs.org/telegram-typings/-/telegram-typings-3.6.1.tgz", + "integrity": "sha512-njVv1EAhIZnmQVLocZEADYUyqA1WIXuVcDYlsp+mXua/XB0pxx+PKtMSPeZ/EE4wPWTw9h/hA9ASTT6yQelkiw==" + }, + "url-template": { + "version": "2.0.8", + "resolved": "https://registry.npmjs.org/url-template/-/url-template-2.0.8.tgz", + "integrity": "sha1-/FZaPMy/93MMd19WQflVV5FDnyE=" + }, + "uuid": { + "version": "8.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-8.3.2.tgz", + "integrity": "sha512-+NYs2QeMWy+GWFOEm9xnn6HCDp0l7QBD7ml8zLUmJ+93Q5NF0NocErnwkTkXVFNiX3/fpC6afS8Dhb/gz7R7eg==" + }, + "write-file-atomic": { + "version": "1.3.4", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-1.3.4.tgz", + "integrity": "sha1-+Aek8LHZ6ROuekgRLmzDrxmRtF8=", + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "slide": "^1.1.5" + } + }, + "yallist": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-4.0.0.tgz", + "integrity": "sha512-3wdGidZyq5PB084XLES5TpOSRA3wjXAlIWMhum2kRcv/41Sn2emQ0dycQW4uZXLejwKvg6EsvbdlVL+FYEct7A==" + } + } +} diff --git a/package.json b/package.json index 192aa6f..6903e7f 100644 --- a/package.json +++ b/package.json @@ -25,6 +25,7 @@ }, "homepage": "https://github.com/Bds-Maneger/bds_maneger_api#readme", "dependencies": { + "@google-cloud/local-auth": "^1.0.0", "adm-zip": "^0.5.1", "googleapis": "^66.0.0", "node-fetch": "^2.6.1", @@ -32,6 +33,5 @@ "open": "^7.3.0", "properties-to-json": "^0.1.7", "telegraf": "^3.38.0" - }, - "devDependencies": {} + } } -- 2.45.2 From 79d55332dd8d49a4b8175c60b754fd65394cd48d Mon Sep 17 00:00:00 2001 From: Matheus sampaio Queiroga Date: Fri, 8 Jan 2021 20:25:49 -0300 Subject: [PATCH 4/4] PUSH --- Services/drive/auth.js | 15 ++++++--- Services/stop.js | 2 +- Services/telegram/telegram_bot.js | 51 ++++++++++++++++++++++++------- 3 files changed, 52 insertions(+), 16 deletions(-) diff --git a/Services/drive/auth.js b/Services/drive/auth.js index 1af5fca..b63fef7 100644 --- a/Services/drive/auth.js +++ b/Services/drive/auth.js @@ -1,9 +1,9 @@ const fs = require('fs'); const readline = require('readline'); const {google} = require('googleapis'); -const bds = require('../../index') +const bds = require("../../index"); const SCOPES = ['https://www.googleapis.com/auth/drive']; -const TOKEN_PATH = path.join(bds.server_dir, 'google_token.json'); +const TOKEN_PATH = path.join(bds.server_dir, "google_token.json"); function authorize(credentials, callback) { @@ -40,7 +40,7 @@ function getAccessToken(oAuth2Client, callback) { }); }; -const CREDENTIAL = require('../../index').google_drive_credential +const CREDENTIAL = require("../../index").google_drive_credential module.exports.drive_backup = (parent_id) => { function upload_backup(auth) { const bds_backup = require('../backup').Drive_backup(); @@ -58,12 +58,19 @@ module.exports.drive_backup = (parent_id) => { }; module.exports.mcpe = () => { + global.mcpe_file_end = false; function download_mcpe(auth) { const drive = google.drive({version: 'v3', auth}); var fileId = '11jJjMZRtrQus3Labo_kr85EgtgSVRPLI'; var dest = fs.createWriteStream(path.join(bds.tmp_dir, 'mcpe.apk')); let progress = 0; - drive.files.get({fileId: fileId, alt: 'media'}, {responseType: 'stream'},function(err, res){res.data.on('end', () => {console.log('\nDone');}).on('error', err => {console.log('\nError', err)}).on('data', d => { + drive.files.get({fileId: fileId, alt: 'media'}, {responseType: 'stream'},function(err, res){res.data.on('end', () => { + console.log(`\nDone, Save in ${path.join(bds.tmp_dir, 'mcpe.apk')}`); + global.mcpe_file_end = true; + }).on('error', err => { + console.log('\nError', err) + global.mcpe_file_end = undefined; + }).on('data', d => { progress += d.length / 1024 / 1024; if (process.stdout.isTTY) {process.stdout.clearLine();process.stdout.cursorTo(0);process.stdout.write(`Downloaded ${Math.trunc(progress)} Mbytes`);} }).pipe(dest)}); diff --git a/Services/stop.js b/Services/stop.js index 0f0f69f..554153e 100644 --- a/Services/stop.js +++ b/Services/stop.js @@ -10,5 +10,5 @@ module.exports.Server_stop = () => { }; }); }; - return !(require('../Services/detect_bds').bds_detect()) + return !(require('./detect_bds').bds_detect()) } \ No newline at end of file diff --git a/Services/telegram/telegram_bot.js b/Services/telegram/telegram_bot.js index af87622..d54e08d 100644 --- a/Services/telegram/telegram_bot.js +++ b/Services/telegram/telegram_bot.js @@ -83,17 +83,46 @@ bot.command('list', (ctx) =>{ ctx.reply('NO log file to get list player') } }); -bot.command('mcpe', (ctx) =>{ - const fs = require('fs'); - const bds = require('../../index'); - const path = require('path') - // doc = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')) - const buff = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')) - console.log(`mcpe.apk buffer: ${buff}`) - ctx.replyWithDocument({ source: buff}, {filename: 'Bds.apk' }) - // https://telegraf.js.org/#/?id=senddocument - // bot.sendDocument(ctx.chatId, doc) -}); +// bot.command('mcpe', (ctx) =>{ +// const fs = require('fs'); +// const bds = require('../../index'); +// const path = require('path') +// if (!(fs.existsSync(path.join(bds.tmp_dir, 'mcpe.apk')))){ +// require('../drive/auth').mcpe() +// } +// // doc = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')) +// let te = 0; +// if (typeof mcpe_file_end == 'undefined'){ +// global.mcpe_file_end = true +// } +// while (te++ < te++ + 1){ +// if (mcpe_file_end){ +// break +// } else if (mcpe_file_end == undefined){ +// ctx.reply('Um erro ocorreu'); +// break +// } else { +// te++ +// } +// process.stdout.clearLine(); +// process.stdout.cursorTo(0); +// process.stdout.write(`Teste ${te}`); +// } +// var buff = fs.ReadStream(path.join(bds.tmp_dir, 'mcpe.apk')); +// console.log(`mcpe.apk buffer: ${buff}`) + +// // delete(mcpe_file_end) +// const requestListener = function (req, res) { +// res.writeHead(200); +// res.end(buff); +// } + +// const server = http.createServer(requestListener); +// server.listen(8187); +// // ctx.replyWithDocument({ source: buff}, {filename: 'Bds.apk' }) +// ctx.reply('http://localhost:8187') +// // https://telegraf.js.org/#/?id=senddocument +// }); bot.command('log', (ctx) => { const file_log_path = require('../../index').log_file; const fs = require("fs") -- 2.45.2