diff --git a/index.js b/index.js index 2886788..8786d53 100644 --- a/index.js +++ b/index.js @@ -1,700 +1,25 @@ #!/usr/bin/env node -const request = require('request'); -require('shelljs/global'); -const ora = require('ora'); -const boxen = require('boxen'); -const table = require('cli-table'); -const colors = require('colors'); -const fs = require('fs'); -const md5 = require('md5'); +var yargs = require('yargs'); -const conf = new (require('conf'))({ - email: { - type: "string", - format: "email" - }, - url: { - type: "string", - format: "url", - default: "https://api.yimian.xyz/todo-ddl/" - }, - taskData: { - type: "array", - default: [] - }, - ddlData: { - type: "array", - default: [] - } -}); -if(conf.get('url') == undefined) conf.set('url', "https://api.yimian.xyz/todo-ddl/"); -if(conf.get('email') == undefined) conf.set('email', ""); -if(conf.get('taskData') == undefined) conf.set('taskData', []); -if(conf.get('ddlData') == undefined) conf.set('ddlData', []); +/* help */ +yargs = require(__dirname + '/modules/help.js')(yargs); +/* version */ +yargs = require(__dirname + '/modules/version.js')(yargs); +/* systemctl */ +yargs = require(__dirname + '/modules/systemctl.js')(yargs); -const tds = ['todo', 'task', 'history', 'ash']; +/* config */ +yargs = require(__dirname + '/modules/config.js')(yargs); -var tools = { - _parseTime: t => { - var st = new Date(t); - return `${st.getFullYear()}-${st.getMonth()+1}-${st.getDate()} ${st.getHours()}:${st.getMinutes()}:${st.getSeconds()}`; - }, - _showInfo: (arr, head, value) => { - var info = new table({ - 'head': head - }); - arr.forEach((i, index) => { - var item = conf.get('taskData')[i]; - info.push(value(item)); - if(index == arr.length-1){ - console.log(info.toString()); - } - }); - }, - td: { - _filter: condition => new Promise(resolve => { - var arr = []; - conf.get('taskData').forEach((item, index) => { - if(condition(item)){ - arr.push(index); - } - if(index == conf.get('taskData').length-1){ - resolve(arr); - } - }); - }), - task: { - _: item => (!item.isDel && item.tt == null), - _head: ['id', 'class', 'name', 'Create Time'], - _value: item => [item.id, item.class, item.name, tools._parseTime(item.st)], - ls: {} - }, - todo: { - _: item => !item.isDel && item.tt != null && item.et == null, - _head: ['id', 'class', 'name', 'Create Time', 'Start Time'], - _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt)], - ls: {} - }, - history: { - _: item => !item.isDel && item.tt != null && item.et != null, - _head: ['id', 'class', 'name', 'Create Time', 'Start Time', 'Finish Time'], - _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt), tools._parseTime(item.et)], - ls: {} - }, - ash: { - _: item => item.isDel, - _head: ['id', 'class', 'name', 'Create Time', 'Start Time', 'Finish Time'], - _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt), tools._parseTime(item.et)], - ls: {} - } - } -}; - -tds.forEach(item => { - tools.td[item].ls.all = async () => { - tools._showInfo(await tools.td._filter(tools.td[item]._), tools.td[item]._head, tools.td[item]._value); - }; - tools.td[item].__ = async () => new Promise(async resolve => { - var arr = []; - var index = await tools.td._filter(tools.td[item]._); - index.forEach((i, ind) => { - arr.push(conf.get('taskData')[i]); - if(ind == index.length-1){ - resolve(arr); - } - }); - }); -}); - - -const getIDs = (id, data, zone) => new Promise(resolve => { - var ban = ora('Searching IDs...').start(); - var arr = []; - data.forEach((item, index) => { - if(item.id.substring(0, String(id).length) == id && tools.td[zone]._(item)){ - arr.push(index); - ban.info(item.id); - ban = new ora('Searching IDs...').start(); - } - if(index == data.length-1){ - ban.succeed('Search finished!! Found '+arr.length+' result!!'); - resolve(arr); - } - }); -}); - -const getID = async (id, data, zone) => { - var arr = await getIDs(id, data, zone); - if(arr.length > 1){ - console.error(boxen('Which ID do you want?')); - return null; - } - if(arr.length < 1){ - console.error(boxen('No ID Found!! Please use '+'td task|todo|history|ddl ls'.blue+' to check!!')); - return null; - } - return arr[0]; -}; - - - - -const argv = require('yargs') - .command("config", "Set todo-ddl tool confignation..", yargs => { - var argv = yargs - .reset() - .command("show", "Show config details..", yargs2 => { - var argv = yargs2 - .reset() - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - var configInfo = new table(); - configInfo.push({email: conf.get('email')},{remote: conf.get('url')}); - console.log(configInfo.toString()); - }) - .command("reset", "Reset All config..", yargs2 => { - var argv = yargs2 - .reset() - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - conf.set('url', "https://api.yimian.xyz/todo-ddl/"); - conf.set('email', ""); - }) - .option("e", { - alias: "email", - default: "", - describe: "Your Email to login.", - demand: false, - type: 'string' - }) - .option("r", { - alias: "remote", - default: "", - describe: "Remote todo-ddl server URL.", - demand: false, - type: 'string' - }) - .version(false) - .argv - - return argv; - }, yargs => { - if(yargs.e == "" && yargs.r == ""){ - console.error(boxen('Please use '+'td config -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - if(yargs.e != ""){ - conf.set('email', yargs.e); - } - if(yargs.r != ""){ - conf.set('url', yargs.r); - } - var configInfo = new table(); - configInfo.push({email: conf.get('email')},{remote: conf.get('url')}); - console.log(configInfo.toString()); - }) - - - /* init */ - .command("init", "Set todo-ddl tool confignation..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - var t = (new Date()).valueOf(); - var ban = ora('Clear Data...').start(); - var data = conf.get('taskData'); - for(var i = 0; i < data.length; i ++){ - ban.succeed(data[i].id.red); - ban = new ora('Clear Data...').start(); - } - conf.set('taskData', []); - ban.succeed(`Finished in ${(new Date()).valueOf() - t} ms!!`); - }) - - - /* ls */ - .command("ls", "= td todo ls..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - tools.td.todo.ls.all(); - }) - - /* lst */ - .command("lst", "= td todo ls..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - tools.td.task.ls.all(); - }) - - /* lsh */ - .command("lsh", "= td todo ls..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - tools.td.history.ls.all(); - }) - - /* lsa */ - .command("lsa", "= td todo ls..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - tools.td.ash.ls.all(); - }) - - /* new */ - .command("new", "= td task add -n -c [class]..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, yargs => { - if(yargs._.length < 2 || yargs._.length > 3){ - return; - } - if(yargs._.length == 2){ - yargs._[2] = "default"; - } - if(yargs._[1].length > 30){ - console.error(boxen('Too Long Name!!!\nPlease shorten your task name!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - data.push({ - id: md5((new Date()).valueOf()).substring(0, 6), - name: yargs._[1], - class: yargs._[2], - st: (new Date()).valueOf(), - tt: null, - et: null, - isDel: false - }); - conf.set('taskData', data); - tools.td.task.ls.all(); - }) - - /* add */ - .command("add", "= td todo add..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, async yargs => { - if(yargs._.length != 2) { - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs._[1], data, 'task'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].tt = (new Date()).valueOf(); - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - - - /* done */ - .command("done", "= td todo done..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, async yargs => { - if(yargs._.length != 2) { - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs._[1], data, 'todo'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].et = (new Date()).valueOf(); - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - - - /* return */ - .command("return", "= td todo return..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, async yargs => { - if(yargs._.length != 2) { - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs._[1], data, 'todo'); - if(index == null) index = getID(yargs._[1], data, 'history'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].tt = null; - data[index].et = null; - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - - - /* rm */ - .command("rm", "= td task del..", yargs => { - var argv = yargs - .reset() - .version(false) - .argv - - return argv; - }, async yargs => { - if(yargs._.length != 2) { - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs._[1], data, 'todo'); - if(index == null) index = getID(yargs._[1], data, 'task'); - if(index == null) index = getID(yargs._[1], data, 'history'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].isDel = true; - conf.set('taskData', data); - //tools.td.todo.ls.all(); - }) - - /* tasks */ - .command("task", "Add, del and change tasks..", yargs => { - var argv = yargs - .reset() - .command("ls", "Show all tasks..", yargs2 => { - var argv = yargs2 - .reset() - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - tools.td.task.ls.all(); - }) - .command("add", "td task add -n -c [class]".green+" Add new task..", yargs2 => { - var argv = yargs2 - .reset() - .option("n", { - alias: "name", - default: "", - describe: "Task name.", - demand: true, - type: 'string' - }) - .option("c", { - alias: "class", - default: "", - describe: "Task class.", - demand: false, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - if(yargs2.n == "" && yargs2.c == ""){ - console.error(boxen('Please use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - if(yargs2.n == ""){ - console.error(boxen('No Task Name!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - if(yargs2.c == ""){ - yargs2.c = "default"; - } - if(yargs2.c.length > 30){ - console.error(boxen('Too Long Name!!!\nPlease shorten your task name!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - data.push({ - id: md5((new Date()).valueOf()).substring(0, 6), - name: yargs2.n, - class: yargs2.c, - st: (new Date()).valueOf(), - tt: null, - et: null, - isDel: false - }); - conf.set('taskData', data); - tools.td.task.ls.all(); - }) - - .command("del", "td del -i ".green+" Delete task..", yargs2 => { - var argv = yargs2 - .reset() - .option("i", { - alias: "id", - default: "", - describe: "Task id.", - demand: true, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, async yargs2 => { - if(yargs2.i == ""){ - console.error(boxen('No Task ID!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs2.i, data, 'task'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].isDel = true; - conf.set('taskData', data); - tools.td.task.ls.all(); - }) - .version(false) - .argv - - return argv; - }, yargs => { - console.error(boxen('Please use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - }) - - - /* todo */ - .command("todo", "Add, return and done todos..", yargs => { - var argv = yargs - .reset() - .command("ls", "td todo ls".green+" Show all todos..", yargs2 => { - var argv = yargs2 - .reset() - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - tools.td.todo.ls.all(); - }) - - .command("add", "td todo add -i ".green+" Add new todo from tasks..", yargs2 => { - var argv = yargs2 - .reset() - .option("i", { - alias: "id", - default: "", - describe: "Task ID.", - demand: true, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, async yargs2 => { - if(yargs2.i == ""){ - console.error(boxen('Please use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs2.i, data, 'task'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].tt = (new Date()).valueOf(); - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - - .command("return", "td todo return -i ".green+" Delete task..", yargs2 => { - var argv = yargs2 - .reset() - .option("i", { - alias: "id", - default: "", - describe: "Task id.", - demand: true, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, async yargs2 => { - if(yargs2.i == ""){ - console.error(boxen('No Task ID!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs2.i, data, 'todo'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].tt = null; - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - - - .command("done", "td todo done -i ".green+" Delete task..", yargs2 => { - var argv = yargs2 - .reset() - .option("i", { - alias: "id", - default: "", - describe: "Task id.", - demand: true, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, async yargs2 => { - if(yargs2.i == ""){ - console.error(boxen('No Task ID!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs2.i, data, 'todo'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].et = (new Date()).valueOf(); - conf.set('taskData', data); - tools.td.todo.ls.all(); - }) - .version(false) - .argv - - return argv; - }, yargs => { - console.error(boxen('Please use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - }) - - - - - /* history */ - .command("history", "Check history..", yargs => { - var argv = yargs - .reset() - .command("ls", "td history ls".green+" Show all history..", yargs2 => { - var argv = yargs2 - .reset() - .option("a", { - alias: "ash", - default: "", - describe: "Show ash bin..", - demand: false, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, yargs2 => { - if(yargs2.a == ""){ - tools.td.history.ls.all(); - }else{ - tools.td.ash.ls.all(); - } - }) - - .command("return", "td history return -i ".green+" Return item to tasks..", yargs2 => { - var argv = yargs2 - .reset() - .option("i", { - alias: "id", - default: "", - describe: "Task id.", - demand: true, - type: 'string' - }) - .version(false) - .help("") - .argv - return argv; - }, async yargs2 => { - if(yargs2.i == ""){ - console.error(boxen('No Task ID!!!\nPlease use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - var data = conf.get('taskData'); - var index = await getID(yargs2.i, data, 'history'); - if(index==null){ - console.error(boxen('Illegal operation!!!\nPlease use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - } - data[index].tt = null; - data[index].et = null; - conf.set('taskData', data); - tools.td.history.ls.all(); - }) - .version(false) - .argv - - return argv; - }, yargs => { - console.error(boxen('Please use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); - return; - }) - .help() - .alias("h", "help") - .alias("v", "version") - //.recommendCommands() - .epilogue("") - .argv; +/* td */ +yargs = require(__dirname + '/modules/td.js')(yargs); +/* log */ +yargs = require(__dirname + '/modules/log.js')(yargs); +/* push */ +yargs = require(__dirname + '/modules/sync.js')(yargs); +argv = yargs.epilogue("hhh").argv; \ No newline at end of file diff --git a/modules/config.js b/modules/config.js new file mode 100644 index 0000000..623f9ea --- /dev/null +++ b/modules/config.js @@ -0,0 +1,88 @@ +module.exports = (yargs) => { + + var o = { + email: { + set: s => { + if(!o.email.check(s)){ + return 'Illegal Email!!'; + } + data.config.email(s); + return; + }, + get: () => data.config.email(), + check: s => { + var reg = /^([A-Za-z0-9_\-\.])+\@([A-Za-z0-9_\-\.])+\.([A-Za-z]{2,4})$/; + return reg.test(s); + } + }, + remote: { + set: s => { + if(!o.remote.check(s)){ + return 'Illegal URL!!'; + } + data.config.remote(s); + return; + }, + get: () => data.config.remote(), + check: s => { + var reg = /./;///^((https|http|ftp|rtsp|mms):\/\/)(([0-9a-z_!~*'().&=+$%-]+: )?[0-9a-z_!~*'().&=+$%-]+@)?(([0-9]{1,3}.){3}[0-9]{1,3}|([0-9a-z_!~*'()-]+.)*([0-9a-z][0-9a-z-]{0,61})?[0-9a-z].[a-z]{2,6})(:[0-9]{1,4})?((\/?)|(\/[0-9a-z_!~*'().;?:@&=+$,%#-]+)+\/?)$/; + return reg.test(s); + } + }, + show: () => { + let configInfo = new table(); + configInfo.push({email: o.email.get()},{remote: o.remote.get()}); + console.log(configInfo.toString()); + } + }; + + var data = require(__dirname + '/../utilities/data.js')(); + const colors = require('colors'); + const boxen = require('boxen'); + const table = require('cli-table'); + + yargs = yargs + .command("config", "td config [-e email] [-r remote]".green + " Config Email or/and remote url..", yargs => { + return yargs + .option("e", { + alias: "email", + default: "", + describe: "Your Email to login.", + demand: false, + type: 'string' + }) + .option("r", { + alias: "remote", + default: "", + describe: "Remote todo-ddl server URL.", + demand: false, + type: 'string' + }) + .help() + .version(false) + .argv; + }, argv => { + if(argv.e == "" && argv.r == ""){ + o.show(); + console.error(boxen('Please use '+'td config -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + if(argv.e != ""){ + var m = o.email.set(argv.e); + if(m){ + console.error(boxen(m, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + } + if(argv.r != ""){ + var m = o.remote.set(argv.r); + if(m){ + console.error(boxen(m, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + } + o.show(); + }) + + return yargs; +} \ No newline at end of file diff --git a/modules/ddl.js b/modules/ddl.js new file mode 100644 index 0000000..e69de29 diff --git a/modules/help.js b/modules/help.js new file mode 100644 index 0000000..6a68383 --- /dev/null +++ b/modules/help.js @@ -0,0 +1,7 @@ +module.exports = yargs => { + yargs = yargs + .help() + .alias("h", "help") + + return yargs; +} \ No newline at end of file diff --git a/modules/log.js b/modules/log.js new file mode 100644 index 0000000..9996500 --- /dev/null +++ b/modules/log.js @@ -0,0 +1,46 @@ +module.exports = yargs => { + + const tools = require(__dirname + '/../utilities/tdTools.js')(); + const colors = require('colors'); + const boxen = require('boxen'); + const table = require('cli-table'); + + yargs = yargs + + .command('ll', "td ll".green + " List all logs..", yargs => yargs, argv => { + let msg = tools.ll(); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + }) + + .command('log', "td log ".green + " Add new log..", yargs => yargs, argv => { + let msg = tools.log(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + }) + + .command('select', "td select ".green + " Select a task to record logs..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.select(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + }) + + .command('rml', "td rml ".green + " Remove log..", yargs => yargs, argv => { + let msg = tools.rml(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + }) + return yargs; +} \ No newline at end of file diff --git a/modules/sync.js b/modules/sync.js new file mode 100644 index 0000000..df3a346 --- /dev/null +++ b/modules/sync.js @@ -0,0 +1,72 @@ +module.exports = (yargs) => { + var o = { + push: () => { + let ban = ora(`Pushing...`).start(); + request.post(data.config.remote(), { + form:{ + action: 'push', + email: data.config.email(), + data: JSON.stringify({ + td: data.td(), + ddl: data.ddl() + }) + } + }, (err, res, body) => { + if(err){ + ban.fail('Push data failed with errors!!'); + }else{ + ban.succeed('Push data to remote successfully!!'); + + } + process.exit(); + }); + }, + pull: (f) => { + let ban = ora(`Pulling...`).start(); + request.post(data.config.remote(), { + form:{ + action: 'pull', + email: data.config.email(), + data: JSON.stringify({}) + } + }, (err, res, body) => { + if(err){ + ban.fail('Pull data failed with errors!!'); + }else{ + try{ + body = JSON.parse(body); + }catch(e){ + ban.fail('Pull data failed with errors!!'); + process.exit(); + } + let d = find.merge({td: data.td(), ddl: data.ddl()}, body); + data.td(d.td); + data.ddl(d.ddl); + ban.succeed('Push data to remote successfully!!'); + if(typeof f != "undefined") f(); + } + process.exit(); + }); + } + } + + const request = require('request'); + const ora = require('ora'); + var data = require(__dirname + '/../utilities/data.js')(); + var find = require(__dirname + '/../utilities/find.js')(); + + yargs = yargs + .command('push', "td push".green + " Push local data to remote..", yargs => yargs, argv => { + o.push(); + }) + .command('pull', "td pull".green + " Pull remote data to local..", yargs => yargs, argv => { + o.pull(); + }) + .command('sync', "td sync".green + " Sync remote and local data..", yargs => yargs, argv => { + o.pull(()=>{ + o.push(); + }); + }) + + return yargs; +} \ No newline at end of file diff --git a/modules/systemctl.js b/modules/systemctl.js new file mode 100644 index 0000000..e083c80 --- /dev/null +++ b/modules/systemctl.js @@ -0,0 +1,15 @@ +module.exports = (yargs) => { + + yargs = yargs + .command('init', "td init".green + " Clear All Data..", yargs => yargs, argv => { + data.td([]); + data.ddl([]); + data.log('null'); + }) + + var data = require(__dirname + '/../utilities/data.js')(); + const colors = require('colors'); + const boxen = require('boxen'); + + return yargs; +} \ No newline at end of file diff --git a/modules/td.js b/modules/td.js new file mode 100644 index 0000000..958b07f --- /dev/null +++ b/modules/td.js @@ -0,0 +1,100 @@ +module.exports = yargs => { + + const tools = require(__dirname + '/../utilities/tdTools.js')(); + const colors = require('colors'); + const boxen = require('boxen'); + const table = require('cli-table'); + + yargs = yargs + .command('lt', "td lt".green + " List all todos..", yargs => yargs, argv => { + tools.__.show(tools.todo.getAll()); + }) + + .command('ls', "td ls".green + " List all tasks..", yargs => yargs, argv => { + tools.__.show(tools.task.getAll()); + }) + + .command('history', "td history".green + " List all history..", yargs => yargs, argv => { + tools.__.show(tools.history.getAll()); + }) + + .command('new', "td new [class]".green + " Create new todo..", yargs => yargs, argv => { + if(argv._.length < 2 || argv._.length > 3){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.new(argv._[1], (argv._.length == 2)?null:argv._[2]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + tools.__.show(tools.todo.getAll()); + }) + + .command('add', "td add ".green + " Add todo to task..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.add(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + tools.__.show(tools.task.getAll()); + }) + + .command('done', "td done ".green + " Finish task..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.done(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + tools.__.show(tools.task.getAll()); + }) + + .command('rm', "td rm ".green + " Remove task..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.rm(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + console.log(argv._[1]); + }) + + .command('return', "td return ".green + " Return task to todo..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.return(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + tools.__.show(tools.task.getAll()); + }) + + .command('recover', "td recover ".green + " Recover from history to task..", yargs => yargs, argv => { + if(argv._.length != 2){ + console.error(boxen('Please use '+'td -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + let msg = tools.recover(argv._[1]); + if(msg){ + console.error(boxen(msg, {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + tools.__.show(tools.task.getAll()); + }) + + return yargs; +} \ No newline at end of file diff --git a/modules/version.js b/modules/version.js new file mode 100644 index 0000000..09130c0 --- /dev/null +++ b/modules/version.js @@ -0,0 +1,6 @@ +module.exports = yargs => { + yargs = yargs + .alias("v", "version") + + return yargs; +} \ No newline at end of file diff --git a/old.js b/old.js new file mode 100644 index 0000000..2886788 --- /dev/null +++ b/old.js @@ -0,0 +1,700 @@ +#!/usr/bin/env node +const request = require('request'); +require('shelljs/global'); +const ora = require('ora'); +const boxen = require('boxen'); +const table = require('cli-table'); +const colors = require('colors'); +const fs = require('fs'); +const md5 = require('md5'); + +const conf = new (require('conf'))({ + email: { + type: "string", + format: "email" + }, + url: { + type: "string", + format: "url", + default: "https://api.yimian.xyz/todo-ddl/" + }, + taskData: { + type: "array", + default: [] + }, + ddlData: { + type: "array", + default: [] + } +}); + +if(conf.get('url') == undefined) conf.set('url', "https://api.yimian.xyz/todo-ddl/"); +if(conf.get('email') == undefined) conf.set('email', ""); +if(conf.get('taskData') == undefined) conf.set('taskData', []); +if(conf.get('ddlData') == undefined) conf.set('ddlData', []); + + +const tds = ['todo', 'task', 'history', 'ash']; + +var tools = { + _parseTime: t => { + var st = new Date(t); + return `${st.getFullYear()}-${st.getMonth()+1}-${st.getDate()} ${st.getHours()}:${st.getMinutes()}:${st.getSeconds()}`; + }, + _showInfo: (arr, head, value) => { + var info = new table({ + 'head': head + }); + arr.forEach((i, index) => { + var item = conf.get('taskData')[i]; + info.push(value(item)); + if(index == arr.length-1){ + console.log(info.toString()); + } + }); + }, + td: { + _filter: condition => new Promise(resolve => { + var arr = []; + conf.get('taskData').forEach((item, index) => { + if(condition(item)){ + arr.push(index); + } + if(index == conf.get('taskData').length-1){ + resolve(arr); + } + }); + }), + task: { + _: item => (!item.isDel && item.tt == null), + _head: ['id', 'class', 'name', 'Create Time'], + _value: item => [item.id, item.class, item.name, tools._parseTime(item.st)], + ls: {} + }, + todo: { + _: item => !item.isDel && item.tt != null && item.et == null, + _head: ['id', 'class', 'name', 'Create Time', 'Start Time'], + _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt)], + ls: {} + }, + history: { + _: item => !item.isDel && item.tt != null && item.et != null, + _head: ['id', 'class', 'name', 'Create Time', 'Start Time', 'Finish Time'], + _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt), tools._parseTime(item.et)], + ls: {} + }, + ash: { + _: item => item.isDel, + _head: ['id', 'class', 'name', 'Create Time', 'Start Time', 'Finish Time'], + _value: item => [item.id, item.class, item.name, tools._parseTime(item.st), tools._parseTime(item.tt), tools._parseTime(item.et)], + ls: {} + } + } +}; + +tds.forEach(item => { + tools.td[item].ls.all = async () => { + tools._showInfo(await tools.td._filter(tools.td[item]._), tools.td[item]._head, tools.td[item]._value); + }; + tools.td[item].__ = async () => new Promise(async resolve => { + var arr = []; + var index = await tools.td._filter(tools.td[item]._); + index.forEach((i, ind) => { + arr.push(conf.get('taskData')[i]); + if(ind == index.length-1){ + resolve(arr); + } + }); + }); +}); + + +const getIDs = (id, data, zone) => new Promise(resolve => { + var ban = ora('Searching IDs...').start(); + var arr = []; + data.forEach((item, index) => { + if(item.id.substring(0, String(id).length) == id && tools.td[zone]._(item)){ + arr.push(index); + ban.info(item.id); + ban = new ora('Searching IDs...').start(); + } + if(index == data.length-1){ + ban.succeed('Search finished!! Found '+arr.length+' result!!'); + resolve(arr); + } + }); +}); + +const getID = async (id, data, zone) => { + var arr = await getIDs(id, data, zone); + if(arr.length > 1){ + console.error(boxen('Which ID do you want?')); + return null; + } + if(arr.length < 1){ + console.error(boxen('No ID Found!! Please use '+'td task|todo|history|ddl ls'.blue+' to check!!')); + return null; + } + return arr[0]; +}; + + + + +const argv = require('yargs') + .command("config", "Set todo-ddl tool confignation..", yargs => { + var argv = yargs + .reset() + .command("show", "Show config details..", yargs2 => { + var argv = yargs2 + .reset() + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + var configInfo = new table(); + configInfo.push({email: conf.get('email')},{remote: conf.get('url')}); + console.log(configInfo.toString()); + }) + .command("reset", "Reset All config..", yargs2 => { + var argv = yargs2 + .reset() + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + conf.set('url', "https://api.yimian.xyz/todo-ddl/"); + conf.set('email', ""); + }) + .option("e", { + alias: "email", + default: "", + describe: "Your Email to login.", + demand: false, + type: 'string' + }) + .option("r", { + alias: "remote", + default: "", + describe: "Remote todo-ddl server URL.", + demand: false, + type: 'string' + }) + .version(false) + .argv + + return argv; + }, yargs => { + if(yargs.e == "" && yargs.r == ""){ + console.error(boxen('Please use '+'td config -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + if(yargs.e != ""){ + conf.set('email', yargs.e); + } + if(yargs.r != ""){ + conf.set('url', yargs.r); + } + var configInfo = new table(); + configInfo.push({email: conf.get('email')},{remote: conf.get('url')}); + console.log(configInfo.toString()); + }) + + + /* init */ + .command("init", "Set todo-ddl tool confignation..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + var t = (new Date()).valueOf(); + var ban = ora('Clear Data...').start(); + var data = conf.get('taskData'); + for(var i = 0; i < data.length; i ++){ + ban.succeed(data[i].id.red); + ban = new ora('Clear Data...').start(); + } + conf.set('taskData', []); + ban.succeed(`Finished in ${(new Date()).valueOf() - t} ms!!`); + }) + + + /* ls */ + .command("ls", "= td todo ls..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + tools.td.todo.ls.all(); + }) + + /* lst */ + .command("lst", "= td todo ls..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + tools.td.task.ls.all(); + }) + + /* lsh */ + .command("lsh", "= td todo ls..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + tools.td.history.ls.all(); + }) + + /* lsa */ + .command("lsa", "= td todo ls..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + tools.td.ash.ls.all(); + }) + + /* new */ + .command("new", "= td task add -n -c [class]..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, yargs => { + if(yargs._.length < 2 || yargs._.length > 3){ + return; + } + if(yargs._.length == 2){ + yargs._[2] = "default"; + } + if(yargs._[1].length > 30){ + console.error(boxen('Too Long Name!!!\nPlease shorten your task name!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + data.push({ + id: md5((new Date()).valueOf()).substring(0, 6), + name: yargs._[1], + class: yargs._[2], + st: (new Date()).valueOf(), + tt: null, + et: null, + isDel: false + }); + conf.set('taskData', data); + tools.td.task.ls.all(); + }) + + /* add */ + .command("add", "= td todo add..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, async yargs => { + if(yargs._.length != 2) { + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs._[1], data, 'task'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].tt = (new Date()).valueOf(); + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + + + /* done */ + .command("done", "= td todo done..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, async yargs => { + if(yargs._.length != 2) { + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs._[1], data, 'todo'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].et = (new Date()).valueOf(); + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + + + /* return */ + .command("return", "= td todo return..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, async yargs => { + if(yargs._.length != 2) { + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs._[1], data, 'todo'); + if(index == null) index = getID(yargs._[1], data, 'history'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].tt = null; + data[index].et = null; + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + + + /* rm */ + .command("rm", "= td task del..", yargs => { + var argv = yargs + .reset() + .version(false) + .argv + + return argv; + }, async yargs => { + if(yargs._.length != 2) { + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs._[1], data, 'todo'); + if(index == null) index = getID(yargs._[1], data, 'task'); + if(index == null) index = getID(yargs._[1], data, 'history'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].isDel = true; + conf.set('taskData', data); + //tools.td.todo.ls.all(); + }) + + /* tasks */ + .command("task", "Add, del and change tasks..", yargs => { + var argv = yargs + .reset() + .command("ls", "Show all tasks..", yargs2 => { + var argv = yargs2 + .reset() + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + tools.td.task.ls.all(); + }) + .command("add", "td task add -n -c [class]".green+" Add new task..", yargs2 => { + var argv = yargs2 + .reset() + .option("n", { + alias: "name", + default: "", + describe: "Task name.", + demand: true, + type: 'string' + }) + .option("c", { + alias: "class", + default: "", + describe: "Task class.", + demand: false, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + if(yargs2.n == "" && yargs2.c == ""){ + console.error(boxen('Please use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + if(yargs2.n == ""){ + console.error(boxen('No Task Name!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + if(yargs2.c == ""){ + yargs2.c = "default"; + } + if(yargs2.c.length > 30){ + console.error(boxen('Too Long Name!!!\nPlease shorten your task name!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + data.push({ + id: md5((new Date()).valueOf()).substring(0, 6), + name: yargs2.n, + class: yargs2.c, + st: (new Date()).valueOf(), + tt: null, + et: null, + isDel: false + }); + conf.set('taskData', data); + tools.td.task.ls.all(); + }) + + .command("del", "td del -i ".green+" Delete task..", yargs2 => { + var argv = yargs2 + .reset() + .option("i", { + alias: "id", + default: "", + describe: "Task id.", + demand: true, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, async yargs2 => { + if(yargs2.i == ""){ + console.error(boxen('No Task ID!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs2.i, data, 'task'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].isDel = true; + conf.set('taskData', data); + tools.td.task.ls.all(); + }) + .version(false) + .argv + + return argv; + }, yargs => { + console.error(boxen('Please use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + }) + + + /* todo */ + .command("todo", "Add, return and done todos..", yargs => { + var argv = yargs + .reset() + .command("ls", "td todo ls".green+" Show all todos..", yargs2 => { + var argv = yargs2 + .reset() + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + tools.td.todo.ls.all(); + }) + + .command("add", "td todo add -i ".green+" Add new todo from tasks..", yargs2 => { + var argv = yargs2 + .reset() + .option("i", { + alias: "id", + default: "", + describe: "Task ID.", + demand: true, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, async yargs2 => { + if(yargs2.i == ""){ + console.error(boxen('Please use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs2.i, data, 'task'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].tt = (new Date()).valueOf(); + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + + .command("return", "td todo return -i ".green+" Delete task..", yargs2 => { + var argv = yargs2 + .reset() + .option("i", { + alias: "id", + default: "", + describe: "Task id.", + demand: true, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, async yargs2 => { + if(yargs2.i == ""){ + console.error(boxen('No Task ID!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs2.i, data, 'todo'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].tt = null; + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + + + .command("done", "td todo done -i ".green+" Delete task..", yargs2 => { + var argv = yargs2 + .reset() + .option("i", { + alias: "id", + default: "", + describe: "Task id.", + demand: true, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, async yargs2 => { + if(yargs2.i == ""){ + console.error(boxen('No Task ID!!!\nPlease use '+'td task -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs2.i, data, 'todo'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].et = (new Date()).valueOf(); + conf.set('taskData', data); + tools.td.todo.ls.all(); + }) + .version(false) + .argv + + return argv; + }, yargs => { + console.error(boxen('Please use '+'td todo -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + }) + + + + + /* history */ + .command("history", "Check history..", yargs => { + var argv = yargs + .reset() + .command("ls", "td history ls".green+" Show all history..", yargs2 => { + var argv = yargs2 + .reset() + .option("a", { + alias: "ash", + default: "", + describe: "Show ash bin..", + demand: false, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, yargs2 => { + if(yargs2.a == ""){ + tools.td.history.ls.all(); + }else{ + tools.td.ash.ls.all(); + } + }) + + .command("return", "td history return -i ".green+" Return item to tasks..", yargs2 => { + var argv = yargs2 + .reset() + .option("i", { + alias: "id", + default: "", + describe: "Task id.", + demand: true, + type: 'string' + }) + .version(false) + .help("") + .argv + return argv; + }, async yargs2 => { + if(yargs2.i == ""){ + console.error(boxen('No Task ID!!!\nPlease use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + var data = conf.get('taskData'); + var index = await getID(yargs2.i, data, 'history'); + if(index==null){ + console.error(boxen('Illegal operation!!!\nPlease use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + } + data[index].tt = null; + data[index].et = null; + conf.set('taskData', data); + tools.td.history.ls.all(); + }) + .version(false) + .argv + + return argv; + }, yargs => { + console.error(boxen('Please use '+'td history -h '.red+'to get Help!!', {padding: 1, margin: 1, borderStyle: 'double'})); + return; + }) + .help() + .alias("h", "help") + .alias("v", "version") + //.recommendCommands() + .epilogue("") + .argv; + + + diff --git a/package.json b/package.json index 9bb0fd2..7858783 100644 --- a/package.json +++ b/package.json @@ -10,10 +10,12 @@ "td": "index.js" }, "dependencies": { + "body-parser": "^1.19.0", "boxen": "^4.2.0", "cli-table": "^0.3.1", "colors": "^1.4.0", "conf": "^6.2.0", + "express": "^4.17.1", "fs": "^0.0.1-security", "md5": "^2.2.1", "ora": "^4.0.3", diff --git a/server.js b/server.js new file mode 100644 index 0000000..b02c125 --- /dev/null +++ b/server.js @@ -0,0 +1,35 @@ +const app = require('express')(); +const fs = require('fs'); +const bodyParser = require('body-parser'); + +const find = require(__dirname + '/utilities/find.js')(); + +app.use(bodyParser.urlencoded({ extended: false })); + +var data = JSON.parse(fs.readFileSync(__dirname + '/var/data.json')); + +app.listen(13233 /*default port*/, () => console.log('todo-ddl listening on port 13233!')); + +app.post('/', (req, res) => { + let query = req.body; + query.data = JSON.parse(query.data); + if(!query.action || !query.email || !query.data){ + return; + } + if(query.action == 'push'){ + if(data.hasOwnProperty(query.email)){ + data[query.email] = find.merge(data[query.email], query.data); + }else{ + data[query.email] = query.data; + } + fs.writeFile(__dirname + '/var/data.json', JSON.stringify(data), ()=>{}); + res.send('ok'); + } + if(query.action == 'pull'){ + if(data.hasOwnProperty(query.email)){ + res.send(data[query.email]); + }else{ + res.status(404).send(''); + } + } +}); \ No newline at end of file diff --git a/utilities/data.js b/utilities/data.js new file mode 100644 index 0000000..2f37c0e --- /dev/null +++ b/utilities/data.js @@ -0,0 +1,60 @@ +module.exports = () => { + + var o = { + __: (c, w, s) => { + var data = conf.get(c); + if(typeof s != "undefined"){ + data[w] = s; + conf.set(c, data); + } + return data[w]; + }, + //config + config: { + email: s => o.__('config', 'email', s), + remote: s => o.__('config', 'remote', s) + }, + //data + td: s => o.__('data', 'td', s), + ddl: s => o.__('data', 'ddl', s), + log: s => { + if(typeof s != "undefined"){ + conf.set('log', s); + } + return conf.get('log'); + } + }; + + const conf = new (require('conf'))({ + config: { + type: "object", + default: { + email: '', + remote: "https://api.yimian.xyz/todo-ddl/" + } + }, + data: { + type: "object", + default: { + td: [], + ddl: [] + } + }, + log: { + type: 'string', + default: 'null' + } + }); + + if(conf.get('config') == undefined) conf.set('config', { + email: '', + remote: "https://api.yimian.xyz/todo-ddl/" + }); + if(conf.get('data') == undefined) conf.set('data', { + td: [], + ddl: [] + }); + if(conf.get('log') == undefined) conf.set('log', 'null'); + + return o; +} \ No newline at end of file diff --git a/utilities/find.js b/utilities/find.js new file mode 100644 index 0000000..76d62ad --- /dev/null +++ b/utilities/find.js @@ -0,0 +1,113 @@ +module.exports = () => { + var o = { + search: (s, w, zone) => { + let res = []; + let ban = ora(`Searching ${w}s...`).start(); + for(const cla of zone){ + for(const i of cla){ + let pos = i[w].indexOf(s); + if(pos != -1 && res.indexOf(i[w]) == -1){ + res.push(i[w]); + ban.info(i[w].substring(0, pos) + String(s).yellow + i[w].substring(pos + String(s).length) + ' ' + ((typeof i.name == "undefined")?'':i.name) + ((typeof i.content == "undefined")?'':i.content)); + ban = new ora(`Searching ${w}s...`).start(); + } + } + } + ban.succeed('Search finished!! Found '+res.length+' results!!'); + return res; + }, + byIDs: (id, arr) => arr.filter(item => id.indexOf(item.id) >= 0), + updateTd: (id, w, s) => { + let d = data.td(); + for(let i = 0; i < d.length; i ++){ + if(d[i].id == id){ + d[i][w] = s; + d[i]['lastOperateTime'] = (new Date()).valueOf(); + break; + } + } + data.td(d); + }, + mergeArray: (a, b) => Array.from(new Set(a.concat(b))), + merge: (a, b) => { + let td = []; + + for(let td1 of a.td){ + for(let td2 of b.td){ + + if(td1.id == td2.id && !td.some(item => item.id == td2.id)){ + let obj = {}; + let logs = []; + for(let l2 of td2.logs){ + if(!logs.some(item => item.id == l2.id)){ + let l1 = td1.logs.filter(item => item.id == l2.id); + if(l1){ + l1 = l1[0]; + if(l1.lastOperateTime < l2.lastOperateTime){ + logs.push(l2); + }else{ + logs.push(l1); + } + }else{ + logs.push(l2); + } + } + } + + for(let l1 of td1.logs){ + if(!logs.some(item => item.id == l1.id)){ + let l2 = td2.logs.filter(item => item.id == l1.id); + if(l2){ + l2 = l2[0]; + if(l2.lastOperateTime < l1.lastOperateTime){ + logs.push(l1); + }else{ + logs.push(l2); + } + }else{ + logs.push(l1); + } + } + } + + if(td1.lastOperateTime < td2.lastOperateTime){ + obj = td2; + }else{ + obj = td1; + } + obj.logs = logs; + td.push(obj); + } + + } + } + + + for(let td1 of a.td){ + if(!td.some(item => item.id == td1.id)){ + td.push(td1); + } + } + + for(let td2 of b.td){ + if(!td.some(item => item.id == td2.id)){ + td.push(td2); + } + } + + + /* ddl */ + //console.log(td); + return { + 'td': td, + 'ddl': [] + }; + } + } + + const colors = require('colors'); + const ora = require('ora'); + var data = require(__dirname + '/../utilities/data.js')(); + + return o; +} \ No newline at end of file diff --git a/utilities/tdTools.js b/utilities/tdTools.js new file mode 100644 index 0000000..797ff5c --- /dev/null +++ b/utilities/tdTools.js @@ -0,0 +1,244 @@ +module.exports = () => { + var o = { + __: { + id: (aid, zone) => { + const ids = find.search(aid, 'id', zone); + if(zone.length > 1){ + return find.byIDs(ids, data.td()); + } + return find.byIDs(ids, zone[0]); + }, + name: (aname, zone) => { + const names = find.search(aname, 'name', zone); + return find.byIDs(names); + }, + getLogs: id => data.td().filter(item => item.id == id)[0].logs.filter(item2 => !item2.isDel), + getAllLogs: id => data.td().filter(item => item.id == id)[0].logs, + resetLog: id => { + if(id == data.log()) { + data.log('null'); + } + }, + addLog: (id, content) => { + let logs = o.__.getAllLogs(id); + logs.push({ + 'id': o.__.generateID(16), + 'content': content, + createTime: (new Date()).valueOf(), + lastOperateTime: (new Date()).valueOf(), + isDel: false + }); + find.updateTd(id, 'logs', logs); + }, + rmLog: (id, lid) => { + let logs = o.__.getAllLogs(id); + for(let i of logs){ + if(i.id == lid){ + i.isDel = true; + break; + } + } + find.updateTd(id, 'logs', logs); + }, + getAllClass: (zone) => { + let arr = []; + for(const cla of zone){ + for(const i of cla){ + if(arr.indexOf(i.class) != -1){ + arr.push(i.class); + } + } + } + return arr; + }, + parseTime: t => { + if(!t){ + return 'null'; + } + const st = new Date(t); + return `${st.getFullYear()}-${st.getMonth()+1}-${st.getDate()} ${st.getHours()}:${st.getMinutes()}:${st.getSeconds()}`; + }, + generateID: (l) => md5((new Date()).valueOf()).substring(0, l), + show: arr => { + let configInfo = new table({ + head: ['id', 'class', 'name', 'createTime', 'todoTime', 'endTime'] + }); + for(const i of arr){ + configInfo.push([i.id, i.class, i.name, o.__.parseTime(i.createTime), o.__.parseTime(i.todoTime), o.__.parseTime(i.endTime)]); + } + console.log(configInfo.toString()); + }, + showLogs: arr => { + let configInfo = new table({ + head: ['id', 'content', 'createTime'] + }); + for(const i of arr){ + configInfo.push([i.id, i.content, o.__.parseTime(i.createTime)]); + } + console.log(configInfo.toString()); + } + }, + getAll: () => data.td(), + getAllClass: () => o.__.getAllClass([data.td()]), + getByaID: id => o.__.id(id, [data.td()]), + getByaName: name => o.__.name(name, [data.td()]), + new: (name, cla) => { + let d = data.td(); + if(!cla){ + cla = 'default'; + } + if(!name){ + return 'Name should not be empty!!'; + } + if(name.length > 25){ + return 'Name too Long!!'; + } + d.push({ + id: o.__.generateID(8), + 'name': name, + 'class': cla, + createTime: (new Date()).valueOf(), + todoTime: null, + endTime: null, + lastOperateTime: (new Date()).valueOf(), + idDel: false, + logs: [{ + id: o.__.generateID(16), + content: 'Todo Item Created!!', + createTime: (new Date()).valueOf(), + lastOperateTime: (new Date()).valueOf() + }] + }); + data.td(d); + return; + }, + rm: aid => { + let items = o.__.id(aid, [o.todo.getAll(), o.task.getAll(), o.history.getAll()]); + if(items.length > 1){ + return 'Which id do you want to remove?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + find.updateTd(items[0].id, 'isDel', true); + console.log(items[0].id); + o.__.resetLog(items[0].id); + }, + add: aid => { + let items = o.__.id(aid, [o.todo.getAll()]); + if(items.length > 1){ + return 'Which id do you want to add to task?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + find.updateTd(items[0].id, 'todoTime', (new Date()).valueOf()); + }, + return: aid => { + let items = o.__.id(aid, [o.task.getAll()]); + if(items.length > 1){ + return 'Which id do you want to return?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + find.updateTd(items[0].id, 'todoTime', null); + o.__.resetLog(items[0].id); + }, + done: aid => { + let items = o.__.id(aid, [o.task.getAll()]); + if(items.length > 1){ + return 'Which id do you want to finish?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + find.updateTd(items[0].id, 'endTime', (new Date()).valueOf()); + o.__.resetLog(items[0].id); + }, + recover: aid => { + let items = o.__.id(aid, [o.history.getAll()]); + if(items.length > 1){ + return 'Which id do you want to recover?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + find.updateTd(items[0].id, 'endTime', null); + }, + /* log */ + ll: () => { + if(data.log() == 'null'){ + return 'No Task Pointed!! Please select a task to begin!!'; + } + let logs = o.__.getLogs(data.log()); + console.log('At task ' + data.log() + ' ' + o.__.id(data.log(), [data.td()])[0].name); + o.__.showLogs(logs); + }, + select: aid => { + let items = o.__.id(aid, [o.task.getAll()]); + if(items.length > 1){ + return 'Which id do you want to add to task?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + data.log(items[0].id); + console.log(items[0].id); + }, + log: content => { + if(data.log() == "null"){ + return 'No Task Pointed!! Please select a task to begin!!'; + } + o.__.addLog(data.log(), content); + }, + rml: aid => { + if(data.log() == "null"){ + return 'No Task Pointed!! Please select a task to begin!!'; + } + let items = o.__.id(aid, [o.__.id(data.log(), [data.td()])[0].logs]); + if(items.length > 1){ + return 'Which id do you want to add to task?'; + } + if(items.length <= 0){ + return 'Not found!!'; + } + o.__.rmLog(data.log(), items[0].id); + console.log(items[0].id); + }, + /* sub */ + todo: { + getAll: () => data.td().filter(item => !item.isDel && item.todoTime == null), + getByaID: id => o.__.id(id, [o.todo.getAll()]), + getByaName: name => o.__.name(name, [o.todo.getAll()]), + getAllClass: () => o.__.getAllClass([o.todo.getAll()]), + }, + task: { + getAll: () => data.td().filter(item => !item.isDel && item.todoTime != null && item.endTime == null), + getByaID: id => o.__.id(id, [o.task.getAll()]), + getByaName: name => o.__.name(name, [o.task.getAll()]), + getAllClass: () => o.__.getAllClass([o.task.getAll()]), + }, + history: { + getAll: () => data.td().filter(item => !item.isDel && item.todoTime != null && item.endTime != null), + getByaID: id => o.__.id(id, [o.history.getAll()]), + getByaName: name => o.__.name(name, [o.history.getAll()]), + getAllClass: () => o.__.getAllClass([o.history.getAll()]), + }, + ash: { + getAll: () => data.td().filter(item => item.isDel), + getByaID: id => o.__.id(id, [o.ash.getAll()]), + getByaName: name => o.__.name(name, [o.ash.getAll()]), + getAllClass: () => o.__.getAllClass([o.ash.getAll()]), + } + } + + var data = require(__dirname + '/../utilities/data.js')(); + const find = require(__dirname + '/../utilities/find.js')(); + const colors = require('colors'); + const boxen = require('boxen'); + const table = require('cli-table'); + const md5 = require('md5'); + + return o; +} \ No newline at end of file diff --git a/yarn.lock b/yarn.lock index 22a7c94..6f0041d 100644 --- a/yarn.lock +++ b/yarn.lock @@ -7,6 +7,14 @@ resolved "https://registry.yarnpkg.com/@types/color-name/-/color-name-1.1.1.tgz#1c1261bbeaa10a8055bbc5d8ab84b7b2afc846a0" integrity sha512-rr+OQyAjxze7GgWrSaJwydHStIhHq2lvY3BOC2Mj7KnzI7XK0Uw1TOOdI9lDoajEbSWLiYgoo4f1R51erQfhPQ== +accepts@~1.3.7: + version "1.3.7" + resolved "https://registry.yarnpkg.com/accepts/-/accepts-1.3.7.tgz#531bc726517a3b2b41f850021c6cc15eaab507cd" + integrity sha512-Il80Qs2WjYlJIBNzNkK6KYqlVMTbZLXgHx2oT0pU/fjRHyEp+PEfEPY0R3WCwAGVOtauxh1hOxNgIf5bv7dQpA== + dependencies: + mime-types "~2.1.24" + negotiator "0.6.2" + ajv@^6.10.2, ajv@^6.5.5: version "6.11.0" resolved "https://registry.yarnpkg.com/ajv/-/ajv-6.11.0.tgz#c3607cbc8ae392d8a5a536f25b21f8e5f3f87fe9" @@ -49,6 +57,11 @@ ansi-styles@^4.0.0, ansi-styles@^4.1.0: "@types/color-name" "^1.1.1" color-convert "^2.0.1" +array-flatten@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/array-flatten/-/array-flatten-1.1.1.tgz#9a5f699051b1e7073328f2a008968b64ea2955d2" + integrity sha1-ml9pkFGx5wczKPKgCJaLZOopVdI= + asn1@~0.2.3: version "0.2.4" resolved "https://registry.yarnpkg.com/asn1/-/asn1-0.2.4.tgz#8d2475dfab553bb33e77b54e59e880bb8ce23136" @@ -88,6 +101,22 @@ bcrypt-pbkdf@^1.0.0: dependencies: tweetnacl "^0.14.3" +body-parser@1.19.0, body-parser@^1.19.0: + version "1.19.0" + resolved "https://registry.yarnpkg.com/body-parser/-/body-parser-1.19.0.tgz#96b2709e57c9c4e09a6fd66a8fd979844f69f08a" + integrity sha512-dhEPs72UPbDnAQJ9ZKMNTP6ptJaionhP5cBb541nXPlW60Jepo9RV/a4fX4XWW9CuFNK22krhrj1+rgzifNCsw== + dependencies: + bytes "3.1.0" + content-type "~1.0.4" + debug "2.6.9" + depd "~1.1.2" + http-errors "1.7.2" + iconv-lite "0.4.24" + on-finished "~2.3.0" + qs "6.7.0" + raw-body "2.4.0" + type-is "~1.6.17" + boxen@^4.2.0: version "4.2.0" resolved "https://registry.yarnpkg.com/boxen/-/boxen-4.2.0.tgz#e411b62357d6d6d36587c8ac3d5d974daa070e64" @@ -110,6 +139,11 @@ brace-expansion@^1.1.7: balanced-match "^1.0.0" concat-map "0.0.1" +bytes@3.1.0: + version "3.1.0" + resolved "https://registry.yarnpkg.com/bytes/-/bytes-3.1.0.tgz#f6cf7933a360e0588fa9fde85651cdc7f805d1f6" + integrity sha512-zauLjrfCG+xvoyaqLoV8bLVXXNGC4JqlxFCutSDWA6fJrTo2ZuvLYTqZ7aHBLZSMOopbzwv8f+wZcVzfVTI2Dg== + camelcase@^5.0.0, camelcase@^5.3.1: version "5.3.1" resolved "https://registry.yarnpkg.com/camelcase/-/camelcase-5.3.1.tgz#e3c9b31569e106811df242f715725a1f4c494320" @@ -242,6 +276,28 @@ conf@^6.2.0: semver "^6.2.0" write-file-atomic "^3.0.0" +content-disposition@0.5.3: + version "0.5.3" + resolved "https://registry.yarnpkg.com/content-disposition/-/content-disposition-0.5.3.tgz#e130caf7e7279087c5616c2007d0485698984fbd" + integrity sha512-ExO0774ikEObIAEV9kDo50o+79VCUdEB6n6lzKgGwupcVeRlhrj3qGAfwq8G6uBJjkqLrhT0qEYFcWng8z1z0g== + dependencies: + safe-buffer "5.1.2" + +content-type@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/content-type/-/content-type-1.0.4.tgz#e138cc75e040c727b1966fe5e5f8c9aee256fe3b" + integrity sha512-hIP3EEPs8tB9AT1L+NUqtwOAps4mk2Zob89MWXMHjHWg9milF/j4osnnQLXBCBFBk/tvIG/tUc9mOUJiPBhPXA== + +cookie-signature@1.0.6: + version "1.0.6" + resolved "https://registry.yarnpkg.com/cookie-signature/-/cookie-signature-1.0.6.tgz#e303a882b342cc3ee8ca513a79999734dab3ae2c" + integrity sha1-4wOogrNCzD7oylE6eZmXNNqzriw= + +cookie@0.4.0: + version "0.4.0" + resolved "https://registry.yarnpkg.com/cookie/-/cookie-0.4.0.tgz#beb437e7022b3b6d49019d088665303ebe9c14ba" + integrity sha512-+Hp8fLp57wnUSt0tY0tHEXh4voZRDnoIrZPqlo3DPiI4y9lwg/jqx+1Om94/W6ZaPDOUbnjOt/99w66zk+l1Xg== + core-util-is@1.0.2: version "1.0.2" resolved "https://registry.yarnpkg.com/core-util-is/-/core-util-is-1.0.2.tgz#b5fd54220aa2bc5ab57aab7140c940754503c1a7" @@ -266,6 +322,13 @@ debounce-fn@^3.0.1: dependencies: mimic-fn "^2.1.0" +debug@2.6.9: + version "2.6.9" + resolved "https://registry.yarnpkg.com/debug/-/debug-2.6.9.tgz#5d128515df134ff327e90a4c93f4e077a536341f" + integrity sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA== + dependencies: + ms "2.0.0" + decamelize@^1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/decamelize/-/decamelize-1.2.0.tgz#f6534d15148269b20352e7bee26f501f9a191290" @@ -283,6 +346,16 @@ delayed-stream@~1.0.0: resolved "https://registry.yarnpkg.com/delayed-stream/-/delayed-stream-1.0.0.tgz#df3ae199acadfb7d440aaae0b29e2272b24ec619" integrity sha1-3zrhmayt+31ECqrgsp4icrJOxhk= +depd@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/depd/-/depd-1.1.2.tgz#9bcd52e14c097763e749b274c4346ed2e560b5a9" + integrity sha1-m81S4UwJd2PnSbJ0xDRu0uVgtak= + +destroy@~1.0.4: + version "1.0.4" + resolved "https://registry.yarnpkg.com/destroy/-/destroy-1.0.4.tgz#978857442c44749e4206613e37946205826abd80" + integrity sha1-l4hXRCxEdJ5CBmE+N5RiBYJqvYA= + dot-prop@^5.0.0: version "5.2.0" resolved "https://registry.yarnpkg.com/dot-prop/-/dot-prop-5.2.0.tgz#c34ecc29556dc45f1f4c22697b6f4904e0cc4fcb" @@ -298,6 +371,11 @@ ecc-jsbn@~0.1.1: jsbn "~0.1.0" safer-buffer "^2.1.0" +ee-first@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/ee-first/-/ee-first-1.1.1.tgz#590c61156b0ae2f4f0255732a158b266bc56b21d" + integrity sha1-WQxhFWsK4vTwJVcyoViyZrxWsh0= + emoji-regex@^7.0.1: version "7.0.3" resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-7.0.3.tgz#933a04052860c85e83c122479c4748a8e4c72156" @@ -308,16 +386,67 @@ emoji-regex@^8.0.0: resolved "https://registry.yarnpkg.com/emoji-regex/-/emoji-regex-8.0.0.tgz#e818fd69ce5ccfcb404594f842963bf53164cc37" integrity sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A== +encodeurl@~1.0.2: + version "1.0.2" + resolved "https://registry.yarnpkg.com/encodeurl/-/encodeurl-1.0.2.tgz#ad3ff4c86ec2d029322f5a02c3a9a606c95b3f59" + integrity sha1-rT/0yG7C0CkyL1oCw6mmBslbP1k= + env-paths@^2.2.0: version "2.2.0" resolved "https://registry.yarnpkg.com/env-paths/-/env-paths-2.2.0.tgz#cdca557dc009152917d6166e2febe1f039685e43" integrity sha512-6u0VYSCo/OW6IoD5WCLLy9JUGARbamfSavcNXry/eu8aHVFei6CD3Sw+VGX5alea1i9pgPHW0mbu6Xj0uBh7gA== +escape-html@~1.0.3: + version "1.0.3" + resolved "https://registry.yarnpkg.com/escape-html/-/escape-html-1.0.3.tgz#0258eae4d3d0c0974de1c169188ef0051d1d1988" + integrity sha1-Aljq5NPQwJdN4cFpGI7wBR0dGYg= + escape-string-regexp@^1.0.5: version "1.0.5" resolved "https://registry.yarnpkg.com/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz#1b61c0562190a8dff6ae3bb2cf0200ca130b86d4" integrity sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ= +etag@~1.8.1: + version "1.8.1" + resolved "https://registry.yarnpkg.com/etag/-/etag-1.8.1.tgz#41ae2eeb65efa62268aebfea83ac7d79299b0887" + integrity sha1-Qa4u62XvpiJorr/qg6x9eSmbCIc= + +express@^4.17.1: + version "4.17.1" + resolved "https://registry.yarnpkg.com/express/-/express-4.17.1.tgz#4491fc38605cf51f8629d39c2b5d026f98a4c134" + integrity sha512-mHJ9O79RqluphRrcw2X/GTh3k9tVv8YcoyY4Kkh4WDMUYKRZUq0h1o0w2rrrxBqM7VoeUVqgb27xlEMXTnYt4g== + dependencies: + accepts "~1.3.7" + array-flatten "1.1.1" + body-parser "1.19.0" + content-disposition "0.5.3" + content-type "~1.0.4" + cookie "0.4.0" + cookie-signature "1.0.6" + debug "2.6.9" + depd "~1.1.2" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + finalhandler "~1.1.2" + fresh "0.5.2" + merge-descriptors "1.0.1" + methods "~1.1.2" + on-finished "~2.3.0" + parseurl "~1.3.3" + path-to-regexp "0.1.7" + proxy-addr "~2.0.5" + qs "6.7.0" + range-parser "~1.2.1" + safe-buffer "5.1.2" + send "0.17.1" + serve-static "1.14.1" + setprototypeof "1.1.1" + statuses "~1.5.0" + type-is "~1.6.18" + utils-merge "1.0.1" + vary "~1.1.2" + extend@~3.0.2: version "3.0.2" resolved "https://registry.yarnpkg.com/extend/-/extend-3.0.2.tgz#f8b1136b4071fbd8eb140aff858b1019ec2915fa" @@ -343,6 +472,19 @@ fast-json-stable-stringify@^2.0.0: resolved "https://registry.yarnpkg.com/fast-json-stable-stringify/-/fast-json-stable-stringify-2.1.0.tgz#874bf69c6f404c2b5d99c481341399fd55892633" integrity sha512-lhd/wF+Lk98HZoTCtlVraHtfh5XYijIjalXck7saUtuanSDyLMxnHhSXEDJqHxD7msR8D0uCmqlkwjCV8xvwHw== +finalhandler@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/finalhandler/-/finalhandler-1.1.2.tgz#b7e7d000ffd11938d0fdb053506f6ebabe9f587d" + integrity sha512-aAWcW57uxVNrQZqFXjITpW3sIUQmHGG3qSb9mUah9MgMC4NeWhNOlNjXEYq3HjRAvL6arUviZGGJsBg6z0zsWA== + dependencies: + debug "2.6.9" + encodeurl "~1.0.2" + escape-html "~1.0.3" + on-finished "~2.3.0" + parseurl "~1.3.3" + statuses "~1.5.0" + unpipe "~1.0.0" + find-up@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/find-up/-/find-up-3.0.0.tgz#49169f1d7993430646da61ecc5ae355c21c97b73" @@ -372,6 +514,16 @@ form-data@~2.3.2: combined-stream "^1.0.6" mime-types "^2.1.12" +forwarded@~0.1.2: + version "0.1.2" + resolved "https://registry.yarnpkg.com/forwarded/-/forwarded-0.1.2.tgz#98c23dab1175657b8c0573e8ceccd91b0ff18c84" + integrity sha1-mMI9qxF1ZXuMBXPozszZGw/xjIQ= + +fresh@0.5.2: + version "0.5.2" + resolved "https://registry.yarnpkg.com/fresh/-/fresh-0.5.2.tgz#3d8cadd90d976569fa835ab1f8e4b23a105605a7" + integrity sha1-PYyt2Q2XZWn6g1qx+OSyOhBWBac= + fs.realpath@^1.0.0: version "1.0.0" resolved "https://registry.yarnpkg.com/fs.realpath/-/fs.realpath-1.0.0.tgz#1504ad2523158caa40db4a2787cb01411994ea4f" @@ -429,6 +581,28 @@ has-flag@^4.0.0: resolved "https://registry.yarnpkg.com/has-flag/-/has-flag-4.0.0.tgz#944771fd9c81c81265c4d6941860da06bb59479b" integrity sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ== +http-errors@1.7.2: + version "1.7.2" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.2.tgz#4f5029cf13239f31036e5b2e55292bcfbcc85c8f" + integrity sha512-uUQBt3H/cSIVfch6i1EuPNy/YsRSOUBXTVfZ+yR7Zjez3qjBz6i9+i4zjNaoqcoFVI4lQJ5plg63TvGfRSDCRg== + dependencies: + depd "~1.1.2" + inherits "2.0.3" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + +http-errors@~1.7.2: + version "1.7.3" + resolved "https://registry.yarnpkg.com/http-errors/-/http-errors-1.7.3.tgz#6c619e4f9c60308c38519498c14fbb10aacebb06" + integrity sha512-ZTTX0MWrsQ2ZAhA1cejAwDLycFsd7I7nVtnkT3Ol0aqodaKW+0CTZDQ1uBv5whptCnc8e8HeRRJxRs0kmm/Qfw== + dependencies: + depd "~1.1.2" + inherits "2.0.4" + setprototypeof "1.1.1" + statuses ">= 1.5.0 < 2" + toidentifier "1.0.0" + http-signature@~1.2.0: version "1.2.0" resolved "https://registry.yarnpkg.com/http-signature/-/http-signature-1.2.0.tgz#9aecd925114772f3d95b65a60abb8f7c18fbace1" @@ -438,6 +612,13 @@ http-signature@~1.2.0: jsprim "^1.2.2" sshpk "^1.7.0" +iconv-lite@0.4.24: + version "0.4.24" + resolved "https://registry.yarnpkg.com/iconv-lite/-/iconv-lite-0.4.24.tgz#2022b4b25fbddc21d2f524974a474aafe733908b" + integrity sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA== + dependencies: + safer-buffer ">= 2.1.2 < 3" + imurmurhash@^0.1.4: version "0.1.4" resolved "https://registry.yarnpkg.com/imurmurhash/-/imurmurhash-0.1.4.tgz#9218b9b2b928a238b13dc4fb6b6d576f231453ea" @@ -451,16 +632,26 @@ inflight@^1.0.4: once "^1.3.0" wrappy "1" -inherits@2: +inherits@2, inherits@2.0.4: version "2.0.4" resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.4.tgz#0fa2c64f932917c3433a0ded55363aae37416b7c" integrity sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ== +inherits@2.0.3: + version "2.0.3" + resolved "https://registry.yarnpkg.com/inherits/-/inherits-2.0.3.tgz#633c2c83e3da42a502f52466022480f4208261de" + integrity sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4= + interpret@^1.0.0: version "1.2.0" resolved "https://registry.yarnpkg.com/interpret/-/interpret-1.2.0.tgz#d5061a6224be58e8083985f5014d844359576296" integrity sha512-mT34yGKMNceBQUoVn7iCDKDntA7SC6gycMAWzGx1z/CMCTV7b2AAtXlo3nRyHZ1FelRkQbQjprHSYGwzLtkVbw== +ipaddr.js@1.9.0: + version "1.9.0" + resolved "https://registry.yarnpkg.com/ipaddr.js/-/ipaddr.js-1.9.0.tgz#37df74e430a0e47550fe54a2defe30d8acd95f65" + integrity sha512-M4Sjn6N/+O6/IXSJseKqHoFc+5FdGJ22sXqnjTpdZweHK64MzEPAyQZyEU3R/KRv2GLoa7nNtg/C2Ev6m7z+eA== + is-buffer@~1.1.1: version "1.1.6" resolved "https://registry.yarnpkg.com/is-buffer/-/is-buffer-1.1.6.tgz#efaa2ea9daa0d7ab2ea13a97b2b8ad51fefbe8be" @@ -569,18 +760,38 @@ md5@^2.2.1: crypt "~0.0.1" is-buffer "~1.1.1" +media-typer@0.3.0: + version "0.3.0" + resolved "https://registry.yarnpkg.com/media-typer/-/media-typer-0.3.0.tgz#8710d7af0aa626f8fffa1ce00168545263255748" + integrity sha1-hxDXrwqmJvj/+hzgAWhUUmMlV0g= + +merge-descriptors@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/merge-descriptors/-/merge-descriptors-1.0.1.tgz#b00aaa556dd8b44568150ec9d1b953f3f90cbb61" + integrity sha1-sAqqVW3YtEVoFQ7J0blT8/kMu2E= + +methods@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/methods/-/methods-1.1.2.tgz#5529a4d67654134edcc5266656835b0f851afcee" + integrity sha1-VSmk1nZUE07cxSZmVoNbD4Ua/O4= + mime-db@1.43.0: version "1.43.0" resolved "https://registry.yarnpkg.com/mime-db/-/mime-db-1.43.0.tgz#0a12e0502650e473d735535050e7c8f4eb4fae58" integrity sha512-+5dsGEEovYbT8UY9yD7eE4XTc4UwJ1jBYlgaQQF38ENsKR3wj/8q8RFZrF9WIZpB2V1ArTVFUva8sAul1NzRzQ== -mime-types@^2.1.12, mime-types@~2.1.19: +mime-types@^2.1.12, mime-types@~2.1.19, mime-types@~2.1.24: version "2.1.26" resolved "https://registry.yarnpkg.com/mime-types/-/mime-types-2.1.26.tgz#9c921fc09b7e149a65dfdc0da4d20997200b0a06" integrity sha512-01paPWYgLrkqAyrlDorC1uDwl2p3qZT7yl806vW7DvDoxwXi46jsjFbg+WdwotBIk6/MbEhO/dh5aZ5sNj/dWQ== dependencies: mime-db "1.43.0" +mime@1.6.0: + version "1.6.0" + resolved "https://registry.yarnpkg.com/mime/-/mime-1.6.0.tgz#32cd9e5c64553bd58d19a568af452acff04981b1" + integrity sha512-x0Vn8spI+wuJ1O6S7gnbaQg8Pxh4NNHb7KSINmEWKiPE4RKOplvijn+NkmYmmRgP68mc70j2EbeTFRsrswaQeg== + mimic-fn@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/mimic-fn/-/mimic-fn-2.1.0.tgz#7ed2c2ccccaf84d3ffcb7a69b57711fc2083401b" @@ -593,16 +804,38 @@ minimatch@^3.0.4: dependencies: brace-expansion "^1.1.7" +ms@2.0.0: + version "2.0.0" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.0.0.tgz#5608aeadfc00be6c2901df5f9861788de0d597c8" + integrity sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g= + +ms@2.1.1: + version "2.1.1" + resolved "https://registry.yarnpkg.com/ms/-/ms-2.1.1.tgz#30a5864eb3ebb0a66f2ebe6d727af06a09d86e0a" + integrity sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg== + mute-stream@0.0.8: version "0.0.8" resolved "https://registry.yarnpkg.com/mute-stream/-/mute-stream-0.0.8.tgz#1630c42b2251ff81e2a283de96a5497ea92e5e0d" integrity sha512-nnbWWOkoWyUsTjKrhgD0dcz22mdkSnpYqbEjIm2nhwhuxlSkpywJmBo8h0ZqJdkp73mb90SssHkN4rsRaBAfAA== +negotiator@0.6.2: + version "0.6.2" + resolved "https://registry.yarnpkg.com/negotiator/-/negotiator-0.6.2.tgz#feacf7ccf525a77ae9634436a64883ffeca346fb" + integrity sha512-hZXc7K2e+PgeI1eDBe/10Ard4ekbfrrqG8Ep+8Jmf4JID2bNg7NvCPOZN+kfF574pFQI7mum2AUqDidoKqcTOw== + oauth-sign@~0.9.0: version "0.9.0" resolved "https://registry.yarnpkg.com/oauth-sign/-/oauth-sign-0.9.0.tgz#47a7b016baa68b5fa0ecf3dee08a85c679ac6455" integrity sha512-fexhUFFPTGV8ybAtSIGbV6gOkSv8UtRbDBnAyLQw4QPKkgNlsH2ByPGtMUqdWkos6YCRmAqViwgZrJc/mRDzZQ== +on-finished@~2.3.0: + version "2.3.0" + resolved "https://registry.yarnpkg.com/on-finished/-/on-finished-2.3.0.tgz#20f1336481b083cd75337992a16971aa2d906947" + integrity sha1-IPEzZIGwg811M3mSoWlxqi2QaUc= + dependencies: + ee-first "1.1.1" + once@^1.3.0: version "1.4.0" resolved "https://registry.yarnpkg.com/once/-/once-1.4.0.tgz#583b1aa775961d4b113ac17d9c50baef9dd76bd1" @@ -657,6 +890,11 @@ p-try@^2.0.0: resolved "https://registry.yarnpkg.com/p-try/-/p-try-2.2.0.tgz#cb2868540e313d61de58fafbe35ce9004d5540e6" integrity sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ== +parseurl@~1.3.3: + version "1.3.3" + resolved "https://registry.yarnpkg.com/parseurl/-/parseurl-1.3.3.tgz#9da19e7bee8d12dff0513ed5b76957793bc2e8d4" + integrity sha512-CiyeOxFT/JZyN5m0z9PfXw4SCBJ6Sygz1Dpl0wqjlhDEGGBP1GnsUVEL0p63hoG1fcj3fHynXi9NYO4nWOL+qQ== + path-exists@^3.0.0: version "3.0.0" resolved "https://registry.yarnpkg.com/path-exists/-/path-exists-3.0.0.tgz#ce0ebeaa5f78cb18925ea7d810d7b59b010fd515" @@ -677,6 +915,11 @@ path-parse@^1.0.6: resolved "https://registry.yarnpkg.com/path-parse/-/path-parse-1.0.6.tgz#d62dbb5679405d72c4737ec58600e9ddcf06d24c" integrity sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw== +path-to-regexp@0.1.7: + version "0.1.7" + resolved "https://registry.yarnpkg.com/path-to-regexp/-/path-to-regexp-0.1.7.tgz#df604178005f522f15eb4490e7247a1bfaa67f8c" + integrity sha1-32BBeABfUi8V60SQ5yR6G/qmf4w= + performance-now@^2.1.0: version "2.1.0" resolved "https://registry.yarnpkg.com/performance-now/-/performance-now-2.1.0.tgz#6309f4e0e5fa913ec1c69307ae364b4b377c9e7b" @@ -689,6 +932,14 @@ pkg-up@^3.0.1: dependencies: find-up "^3.0.0" +proxy-addr@~2.0.5: + version "2.0.5" + resolved "https://registry.yarnpkg.com/proxy-addr/-/proxy-addr-2.0.5.tgz#34cbd64a2d81f4b1fd21e76f9f06c8a45299ee34" + integrity sha512-t/7RxHXPH6cJtP0pRG6smSr9QJidhB+3kXu0KgXnbGYMgzEnUxRQ4/LDdfOwZEMyIh3/xHb8PX3t+lfL9z+YVQ== + dependencies: + forwarded "~0.1.2" + ipaddr.js "1.9.0" + psl@^1.1.24: version "1.7.0" resolved "https://registry.yarnpkg.com/psl/-/psl-1.7.0.tgz#f1c4c47a8ef97167dea5d6bbf4816d736e884a3c" @@ -704,11 +955,31 @@ punycode@^2.1.0: resolved "https://registry.yarnpkg.com/punycode/-/punycode-2.1.1.tgz#b58b010ac40c22c5657616c8d2c2c02c7bf479ec" integrity sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A== +qs@6.7.0: + version "6.7.0" + resolved "https://registry.yarnpkg.com/qs/-/qs-6.7.0.tgz#41dc1a015e3d581f1621776be31afb2876a9b1bc" + integrity sha512-VCdBRNFTX1fyE7Nb6FYoURo/SPe62QCaAyzJvUjwRaIsc+NePBEniHlvxFmmX56+HZphIGtV0XeCirBtpDrTyQ== + qs@~6.5.2: version "6.5.2" resolved "https://registry.yarnpkg.com/qs/-/qs-6.5.2.tgz#cb3ae806e8740444584ef154ce8ee98d403f3e36" integrity sha512-N5ZAX4/LxJmF+7wN74pUD6qAh9/wnvdQcjq9TZjevvXzSUo7bfmw91saqMjzGS2xq91/odN2dW/WOl7qQHNDGA== +range-parser@~1.2.1: + version "1.2.1" + resolved "https://registry.yarnpkg.com/range-parser/-/range-parser-1.2.1.tgz#3cf37023d199e1c24d1a55b84800c2f3e6468031" + integrity sha512-Hrgsx+orqoygnmhFbKaHE6c296J+HTAQXoxEF6gNupROmmGJRoyzfG3ccAveqCBrwr/2yxQ5BVd/GTl5agOwSg== + +raw-body@2.4.0: + version "2.4.0" + resolved "https://registry.yarnpkg.com/raw-body/-/raw-body-2.4.0.tgz#a1ce6fb9c9bc356ca52e89256ab59059e13d0332" + integrity sha512-4Oz8DUIwdvoa5qMJelxipzi/iJIi40O5cGV1wNYp5hvZP8ZN0T+jiNkL0QepXs+EsQ9XJ8ipEDoiH70ySUJP3Q== + dependencies: + bytes "3.1.0" + http-errors "1.7.2" + iconv-lite "0.4.24" + unpipe "1.0.0" + rechoir@^0.6.2: version "0.6.2" resolved "https://registry.yarnpkg.com/rechoir/-/rechoir-0.6.2.tgz#85204b54dba82d5742e28c96756ef43af50e3384" @@ -767,12 +1038,17 @@ restore-cursor@^3.1.0: onetime "^5.1.0" signal-exit "^3.0.2" +safe-buffer@5.1.2: + version "5.1.2" + resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.1.2.tgz#991ec69d296e0313747d59bdfd2b745c35f8828d" + integrity sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g== + safe-buffer@^5.0.1, safe-buffer@^5.1.2: version "5.2.0" resolved "https://registry.yarnpkg.com/safe-buffer/-/safe-buffer-5.2.0.tgz#b74daec49b1148f88c64b68d49b1e815c1f2f519" integrity sha512-fZEwUGbVl7kouZs1jCdMLdt95hdIv0ZeHg6L7qPeciMZhZ+/gdesW4wgTARkrFWEpspjEATAzUGPG8N2jJiwbg== -safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: +"safer-buffer@>= 2.1.2 < 3", safer-buffer@^2.0.2, safer-buffer@^2.1.0, safer-buffer@~2.1.0: version "2.1.2" resolved "https://registry.yarnpkg.com/safer-buffer/-/safer-buffer-2.1.2.tgz#44fa161b0187b9549dd84bb91802f9bd8385cd6a" integrity sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg== @@ -782,11 +1058,45 @@ semver@^6.0.0, semver@^6.2.0: resolved "https://registry.yarnpkg.com/semver/-/semver-6.3.0.tgz#ee0a64c8af5e8ceea67687b133761e1becbd1d3d" integrity sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw== +send@0.17.1: + version "0.17.1" + resolved "https://registry.yarnpkg.com/send/-/send-0.17.1.tgz#c1d8b059f7900f7466dd4938bdc44e11ddb376c8" + integrity sha512-BsVKsiGcQMFwT8UxypobUKyv7irCNRHk1T0G680vk88yf6LBByGcZJOTJCrTP2xVN6yI+XjPJcNuE3V4fT9sAg== + dependencies: + debug "2.6.9" + depd "~1.1.2" + destroy "~1.0.4" + encodeurl "~1.0.2" + escape-html "~1.0.3" + etag "~1.8.1" + fresh "0.5.2" + http-errors "~1.7.2" + mime "1.6.0" + ms "2.1.1" + on-finished "~2.3.0" + range-parser "~1.2.1" + statuses "~1.5.0" + +serve-static@1.14.1: + version "1.14.1" + resolved "https://registry.yarnpkg.com/serve-static/-/serve-static-1.14.1.tgz#666e636dc4f010f7ef29970a88a674320898b2f9" + integrity sha512-JMrvUwE54emCYWlTI+hGrGv5I8dEwmco/00EvkzIIsR7MqrHonbD9pO2MOfFnpFntl7ecpZs+3mW+XbQZu9QCg== + dependencies: + encodeurl "~1.0.2" + escape-html "~1.0.3" + parseurl "~1.3.3" + send "0.17.1" + set-blocking@^2.0.0: version "2.0.0" resolved "https://registry.yarnpkg.com/set-blocking/-/set-blocking-2.0.0.tgz#045f9782d011ae9a6803ddd382b24392b3d890f7" integrity sha1-BF+XgtARrppoA93TgrJDkrPYkPc= +setprototypeof@1.1.1: + version "1.1.1" + resolved "https://registry.yarnpkg.com/setprototypeof/-/setprototypeof-1.1.1.tgz#7e95acb24aa92f5885e0abef5ba131330d4ae683" + integrity sha512-JvdAWfbXeIGaZ9cILp38HntZSFSo3mWg6xGcJJsd+d4aRMOqauag1C63dJfDw7OaMYwEbHMOxEZ1lqVRYP2OAw== + shelljs@^0.8.3: version "0.8.3" resolved "https://registry.yarnpkg.com/shelljs/-/shelljs-0.8.3.tgz#a7f3319520ebf09ee81275b2368adb286659b097" @@ -816,6 +1126,11 @@ sshpk@^1.7.0: safer-buffer "^2.0.2" tweetnacl "~0.14.0" +"statuses@>= 1.5.0 < 2", statuses@~1.5.0: + version "1.5.0" + resolved "https://registry.yarnpkg.com/statuses/-/statuses-1.5.0.tgz#161c7dac177659fd9811f43771fa99381478628c" + integrity sha1-Fhx9rBd2Wf2YEfQ3cfqZOBR4Yow= + string-width@^3.0.0: version "3.1.0" resolved "https://registry.yarnpkg.com/string-width/-/string-width-3.1.0.tgz#22767be21b62af1081574306f69ac51b62203961" @@ -867,6 +1182,11 @@ term-size@^2.1.0: resolved "https://registry.yarnpkg.com/term-size/-/term-size-2.2.0.tgz#1f16adedfe9bdc18800e1776821734086fcc6753" integrity sha512-a6sumDlzyHVJWb8+YofY4TW112G6p2FCPEAFk+59gIYHv3XHRhm9ltVQ9kli4hNWeQBwSpe8cRN25x0ROunMOw== +toidentifier@1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/toidentifier/-/toidentifier-1.0.0.tgz#7e1be3470f1e77948bc43d94a3c8f4d7752ba553" + integrity sha512-yaOH/Pk/VEhBWWTlhI+qXxDFXlejDGcQipMlyxda9nthulaxLZUNcUqFxokp0vcYnvteJln5FNQDRrxj3YcbVw== + tough-cookie@~2.4.3: version "2.4.3" resolved "https://registry.yarnpkg.com/tough-cookie/-/tough-cookie-2.4.3.tgz#53f36da3f47783b0925afa06ff9f3b165280f781" @@ -892,6 +1212,14 @@ type-fest@^0.8.1: resolved "https://registry.yarnpkg.com/type-fest/-/type-fest-0.8.1.tgz#09e249ebde851d3b1e48d27c105444667f17b83d" integrity sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA== +type-is@~1.6.17, type-is@~1.6.18: + version "1.6.18" + resolved "https://registry.yarnpkg.com/type-is/-/type-is-1.6.18.tgz#4e552cd05df09467dcbc4ef739de89f2cf37c131" + integrity sha512-TkRKr9sUTxEH8MdfuCSP7VizJyzRNMjj2J2do2Jr3Kym598JVdEksuzPQCnlFPW4ky9Q+iA+ma9BGm06XQBy8g== + dependencies: + media-typer "0.3.0" + mime-types "~2.1.24" + typedarray-to-buffer@^3.1.5: version "3.1.5" resolved "https://registry.yarnpkg.com/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz#a97ee7a9ff42691b9f783ff1bc5112fe3fca9080" @@ -899,6 +1227,11 @@ typedarray-to-buffer@^3.1.5: dependencies: is-typedarray "^1.0.0" +unpipe@1.0.0, unpipe@~1.0.0: + version "1.0.0" + resolved "https://registry.yarnpkg.com/unpipe/-/unpipe-1.0.0.tgz#b2bf4ee8514aae6165b4817829d21b2ef49904ec" + integrity sha1-sr9O6FFKrmFltIF4KdIbLvSZBOw= + uri-js@^4.2.2: version "4.2.2" resolved "https://registry.yarnpkg.com/uri-js/-/uri-js-4.2.2.tgz#94c540e1ff772956e2299507c010aea6c8838eb0" @@ -906,11 +1239,21 @@ uri-js@^4.2.2: dependencies: punycode "^2.1.0" +utils-merge@1.0.1: + version "1.0.1" + resolved "https://registry.yarnpkg.com/utils-merge/-/utils-merge-1.0.1.tgz#9f95710f50a267947b2ccc124741c1028427e713" + integrity sha1-n5VxD1CiZ5R7LMwSR0HBAoQn5xM= + uuid@^3.3.2: version "3.4.0" resolved "https://registry.yarnpkg.com/uuid/-/uuid-3.4.0.tgz#b23e4358afa8a202fe7a100af1f5f883f02007ee" integrity sha512-HjSDRw6gZE5JMggctHBcjVak08+KEVhSIiDzFnT9S9aegmp85S/bReBVTb4QTFaRNptJ9kuYaNhnbNEOkbKb/A== +vary@~1.1.2: + version "1.1.2" + resolved "https://registry.yarnpkg.com/vary/-/vary-1.1.2.tgz#2299f02c6ded30d4a5961b0b9f74524a18f634fc" + integrity sha1-IpnwLG3tMNSllhsLn3RSShj2NPw= + verror@1.10.0: version "1.10.0" resolved "https://registry.yarnpkg.com/verror/-/verror-1.10.0.tgz#3a105ca17053af55d6e270c1f8288682e18da400"