From 404e362717bfa6e7665ba94ad99314ea8f8aadcd Mon Sep 17 00:00:00 2001 From: Adriean Khisbe Date: Fri, 1 Mar 2019 15:44:38 +0100 Subject: [PATCH 01/24] Let and Const all the things :hammer_and_wrench: --- lib/api/comment.js | 18 ++++---- lib/api/downtime.js | 16 +++---- lib/api/embed.js | 34 +++++++-------- lib/api/event.js | 44 +++++++++---------- lib/api/graph.js | 24 +++++----- lib/api/host.js | 22 +++++----- lib/api/index.js | 4 +- lib/api/infrastructure.js | 10 ++--- lib/api/metric.js | 48 ++++++++++---------- lib/api/monitor.js | 92 +++++++++++++++++++-------------------- lib/api/screenboard.js | 60 ++++++++++++------------- lib/api/search.js | 10 ++--- lib/api/serviceCheck.js | 14 +++--- lib/api/tag.js | 44 +++++++++---------- lib/api/timeboard.js | 64 +++++++++++++-------------- lib/api/user.js | 10 ++--- lib/client.js | 24 +++++----- 17 files changed, 269 insertions(+), 269 deletions(-) diff --git a/lib/api/comment.js b/lib/api/comment.js index 309c857..ddf9b59 100644 --- a/lib/api/comment.js +++ b/lib/api/comment.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require("util"); +const client = require("../client"); +const util = require("util"); /*section: comment *comment: create a new comment @@ -29,7 +29,7 @@ function create(message, properties, callback){ properties = {}; } - var params = { + const params = { body: { message: message } @@ -73,7 +73,7 @@ function update(commentId, message, handle, callback){ handle = undefined; } - var params = { + const params = { body: { message: message } @@ -134,8 +134,8 @@ module.exports = { }, handleCli: function(subcommand, args, callback){ if(subcommand === "create"){ - var message = args._[4]; - var properties = {}; + const message = args._[4]; + const properties = {}; if(args["handle"]){ properties.handle = args["handle"]; } @@ -144,11 +144,11 @@ module.exports = { } create(message, properties, callback); } else if(subcommand === "update"){ - var commentId = args._[4]; - var message = args._[5]; + const commentId = args._[4]; + const message = args._[5]; update(commentId, message, args["handle"], callback); } else if(subcommand === "remove"){ - var commentId = args._[4]; + const commentId = args._[4]; remove(commentId, callback); } else { callback("unknown subcommand or arguments try `dogapi comment --help` for help", false); diff --git a/lib/api/downtime.js b/lib/api/downtime.js index 5f35a96..b9bd59f 100644 --- a/lib/api/downtime.js +++ b/lib/api/downtime.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require("util"); +const client = require("../client"); +const util = require("util"); /*section: downtime *comment: schedule a new downtime @@ -30,7 +30,7 @@ function create(scope, properties, callback){ properties = {}; } - var params = { + const params = { body: { scope: scope } @@ -81,7 +81,7 @@ function update(downtimeId, properties, callback){ callback = properties; properties = {}; } - var params = { + const params = { body: {} }; if(typeof properties === "object"){ @@ -207,8 +207,8 @@ module.exports = { } else if(subcommand === "remove"){ remove(args._[4], callback); } else if(subcommand === "create"){ - var scope = args._[4]; - var properties = {}; + const scope = args._[4]; + const properties = {}; if(args["start"]){ properties.start = parseInt(args["start"]); } @@ -220,8 +220,8 @@ module.exports = { } create(scope, properties, callback); } else if(subcommand === "update"){ - var downtimeId = args._[4]; - var properties = {}; + const downtimeId = args._[4]; + const properties = {}; if(args["scope"]){ properties.scope = args["scope"]; } diff --git a/lib/api/embed.js b/lib/api/embed.js index c7c33e3..3516e30 100644 --- a/lib/api/embed.js +++ b/lib/api/embed.js @@ -1,7 +1,7 @@ -var client = require("../client"); -var extend = require("extend"); -var json = require("../json"); -var querystring = require("querystring"); +const client = require("../client"); +const extend = require("extend"); +const json = require("../json"); +const querystring = require("querystring"); /*section: embed *comment: create an embed graph of a metric query @@ -15,14 +15,14 @@ var querystring = require("querystring"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var query = "system.cpu.idle{*}"; - * var graphJSON = { + * const query = "system.cpu.idle{*}"; + * const graphJSON = { * viz: "timeseries", * requests: [ * { @@ -33,7 +33,7 @@ var querystring = require("querystring"); * } * ] * } - * var options = { + * const options = { * timeframe: "1_hour", * size: "xlarge", * legend: "yes", @@ -49,7 +49,7 @@ function create(graphJSON, options, callback){ callback = options; options = {}; } - var body = { + const body = { graph_json: JSON.stringify(graphJSON) }; // Use `extend` to merge `options` into `body` @@ -57,7 +57,7 @@ function create(graphJSON, options, callback){ extend(body, options || {}); // Create the request - var params = { + const params = { body: querystring.stringify(body), contentType: "application/x-www-form-urlencoded" }; @@ -72,7 +72,7 @@ function create(graphJSON, options, callback){ * callback: function(err, res) *example: | * ```javascript - * var embedid = "foo"; + * const embedid = "foo"; * dogapi.embed.revoke(embedid, function(err, res){ * console.dir(res); * }); @@ -105,7 +105,7 @@ function getAll(callback) { * callback: function(err, res) *example: | * ```javascript - * var embedId = "foo"; + * const embedId = "foo"; * dogapi.embed.get(embedId, function(err, res){ * console.dir(res); * }); @@ -147,8 +147,8 @@ module.exports = { }, handleCli: function(subcommand, args, callback) { if (args._.length > 4 && subcommand === "create") { - var graph_json = json.parse(args._[4]); - var options = { + const graph_json = json.parse(args._[4]); + const options = { timeframe: args["timeframe"], size: args["size"], legend: args["legend"], @@ -156,10 +156,10 @@ module.exports = { }; create(graph_json, options, callback); } else if (args._.length > 4 && subcommand === "revoke") { - var embedId = args._[4]; + const embedId = args._[4]; revoke(embedId, callback); } else if (args._.length > 4 && subcommand === "get") { - var embedId = args._[4]; + const embedId = args._[4]; get(embedId, callback); } else if (subcommand === "getall") { getAll(callback); diff --git a/lib/api/event.js b/lib/api/event.js index 4c1be38..f568d5d 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require("util"); +const client = require("../client"); +const util = require("util"); /*section: event *comment: | @@ -20,20 +20,20 @@ var util = require("util"); * function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var title = "some new event"; - * var text = "IT HAPPENED!"; + * const title = "some new event"; + * const text = "IT HAPPENED!"; * dogapi.event.create(title, text, function(err, res){ * console.dir(res); * }); * title = "another event"; * text = "IT HAPPENED AGAIN!"; - * var properties = { + * const properties = { * tags: ["some:tag"], * alert_type: "error" * }; @@ -54,7 +54,7 @@ function create(title, text, properties, callback){ properties.title = title; properties.text = text; - var params = { + const params = { body: properties }; client.request("POST", "/events", params, callback); @@ -70,8 +70,8 @@ function create(title, text, properties, callback){ * function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -100,15 +100,15 @@ function get(eventId, callback){ * function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var now = parseInt(new Date().getTime() / 1000); - * var then = now - 3600; // an hour ago - * var parameters = { + * const now = parseInt(new Date().getTime() / 1000); + * const then = now - 3600; // an hour ago + * const parameters = { * tags: "some:tag", * sources: "jenkins" * }; @@ -129,7 +129,7 @@ function query(start, end, parameters, callback){ parameters.start = start; parameters.end = end; - var params = { + const params = { query: parameters }; @@ -169,9 +169,9 @@ module.exports = { if(subcommand === "get" && args._.length > 4){ get(parseInt(args._[4]), callback); } else if(subcommand === "query" && args._.length > 5){ - var from = parseInt(args._[4]); - var to = parseInt(args._[5]); - var parameters = {}; + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const parameters = {}; if(args["sources"]){ parameters.sources = args["sources"]; } @@ -180,9 +180,9 @@ module.exports = { } query(from, to, parameters, callback); } else if(subcommand === "create" && args._.length > 5){ - var title = args._[4]; - var text = args._[5]; - var properties = {}; + const title = args._[4]; + const text = args._[5]; + const properties = {}; if(args["priority"]){ properties.priority = args["priority"]; } diff --git a/lib/api/graph.js b/lib/api/graph.js index 7690690..fcbb8a8 100644 --- a/lib/api/graph.js +++ b/lib/api/graph.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var embed = require("./embed"); +const client = require("../client"); +const embed = require("./embed"); /*section: graph *comment: take a snapshot of a metric query @@ -11,15 +11,15 @@ var embed = require("./embed"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var query = "system.cpu.idle{*}"; - * var to = dogapi.now(); - * var from = to - 3600; // an hour ago + * const query = "system.cpu.idle{*}"; + * const to = dogapi.now(); + * const from = to - 3600; // an hour ago * dogapi.graph.snapshot(query, from, to, function(err, res){ * console.dir(res); * }); @@ -30,7 +30,7 @@ function snapshot(query, from, to, eventQuery, callback){ callback = eventQuery; eventQuery = undefined; } - var params = { + const params = { query: { metric_query: query, start: parseInt(from), @@ -63,10 +63,10 @@ module.exports = { }, handleCli: function(subcommand, args, callback){ if (args._.length > 5 && subcommand === "snapshot"){ - var query = args._[4]; - var from = parseInt(args._[5]); - var to = parseInt(args._[6]); - var eventQuery = args["events"]; + const query = args._[4]; + const from = parseInt(args._[5]); + const to = parseInt(args._[6]); + const eventQuery = args["events"]; snapshot(query, from, to, eventQuery, callback); } else { callback("unknown subcommand or arguments try `dogapi graph --help` for help", false); diff --git a/lib/api/host.js b/lib/api/host.js index 7a88c93..dbe86d8 100644 --- a/lib/api/host.js +++ b/lib/api/host.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require("util"); +const client = require("../client"); +const util = require("util"); /*section: host *comment: mute the given host, if it is not already muted @@ -12,8 +12,8 @@ var util = require("util"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -28,7 +28,7 @@ function mute(hostname, options, callback){ callback = options; options = {}; } - var params = {}; + const params = {}; if(typeof options === "object"){ params.body = {}; // create body property if(options.end){ @@ -50,8 +50,8 @@ function mute(hostname, options, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -62,7 +62,7 @@ function mute(hostname, options, callback){ * ``` */ function unmute(hostname, callback){ - var params = {body: ""}; // create empty body + const params = {body: ""}; // create empty body client.request("POST", util.format("/host/%s/unmute", hostname), params, callback); } @@ -89,8 +89,8 @@ module.exports = { }, handleCli: function(subcommand, args, callback){ if(subcommand === "mute"){ - var hostname = args._[4]; - var options = {}; + const hostname = args._[4]; + const options = {}; if(args["end"]){ options.end = parseInt(args["end"]); } @@ -99,7 +99,7 @@ module.exports = { } mute(hostname, options, callback); } else if(subcommand === "unmute"){ - var hostname = args._[4]; + const hostname = args._[4]; unmute(hostname, callback); } else { callback("unknown subcommand or arguments try `dogapi host --help` for help", false); diff --git a/lib/api/index.js b/lib/api/index.js index e96793c..b3914a6 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -1,4 +1,4 @@ -var api = { +const api = { comment: require("./comment"), downtime: require("./downtime"), embed: require("./embed"), @@ -17,7 +17,7 @@ var api = { }; module.exports = function(obj){ - for(var key in api){ + for(const key in api){ obj[key] = api[key]; } }; diff --git a/lib/api/infrastructure.js b/lib/api/infrastructure.js index b96f245..3d0de06 100644 --- a/lib/api/infrastructure.js +++ b/lib/api/infrastructure.js @@ -1,4 +1,4 @@ -var client = require("../client"); +const client = require("../client"); /*section: infrastructure *comment: | @@ -10,8 +10,8 @@ var client = require("../client"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -22,7 +22,7 @@ var client = require("../client"); * ``` */ function search(query, callback){ - var params = { + const params = { query: { q: query } @@ -46,7 +46,7 @@ module.exports = { ]; }, handleCli: function(subcommand, args, callback){ - var query = args._[4]; + const query = args._[4]; search(query, callback); } }; diff --git a/lib/api/metric.js b/lib/api/metric.js index e3b94b8..3750aa3 100644 --- a/lib/api/metric.js +++ b/lib/api/metric.js @@ -1,4 +1,4 @@ -var client = require("../client"); +const client = require("../client"); /*section: metric *comment: | @@ -17,8 +17,8 @@ var client = require("../client"); * function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -29,7 +29,7 @@ var client = require("../client"); * dogapi.metric.send("my.metric", [500, 1000], function(err, results){ * console.dir(results); * }); - * var now = parseInt(new Date().getTime() / 1000); + * const now = parseInt(new Date().getTime() / 1000); * dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){ * console.dir(results); * }); @@ -44,7 +44,7 @@ function send(metric, points, extra, callback){ extra = {}; } extra = extra || {}; - var series = [ + const series = [ { metric: metric, points: points, @@ -73,14 +73,14 @@ function send(metric, points, extra, callback){ * function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var now = parseInt(new Date().getTime() / 1000); - * var metrics = [ + * const now = parseInt(new Date().getTime() / 1000); + * const metrics = [ * { * metric: "my.metric", * points: [[now, 1000]], @@ -101,15 +101,15 @@ function send(metric, points, extra, callback){ * ``` */ function send_all(metrics, callback){ - var now = parseInt(new Date().getTime() / 1000); - for(var i = 0; i < metrics.length; ++i){ + const now = parseInt(new Date().getTime() / 1000); + for(let i = 0; i < metrics.length; ++i){ // Try to normalize `points` // DEV: We need `points` to be an array of arrays regardless of what they give us // Always wrap points in an array, this way we will get: // 500 => [500] // [500, 100] => [[, 500], [, 1000]] // [[, 500]] => [[, 500]] - var points = metrics[i].points; + let points = metrics[i].points; if(!Array.isArray(metrics[i].points)){ points = [points]; } @@ -118,7 +118,7 @@ function send_all(metrics, callback){ // 500 => [, 500] // [, 500] => unchanged if(!Array.isArray(point)){ - var now = parseInt(new Date().getTime() / 1000); + const now = parseInt(new Date().getTime() / 1000); point = [now, point]; } return point; @@ -133,7 +133,7 @@ function send_all(metrics, callback){ delete metrics[i].metric_type; } - var params = { + const params = { body: { series: metrics } @@ -151,22 +151,22 @@ function send_all(metrics, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var now = parseInt(new Date().getTime() / 1000); - * var then = now - 3600; // one hour ago - * var query = "system.cpu.idle{*}by{host}"; + * const now = parseInt(new Date().getTime() / 1000); + * const then = now - 3600; // one hour ago + * const query = "system.cpu.idle{*}by{host}"; * dogapi.metric.query(then, now, query, function(err, res){ * console.dir(res); * }); * ``` */ function query(from, to, query, callback){ - var params = { + const params = { query: { from: from, to: to, @@ -201,7 +201,7 @@ module.exports = { }, handleCli: function(subcommand, args, callback){ if(args._.length > 5 && subcommand === "send"){ - var extra = {}; + const extra = {}; if(args.tags){ extra.tags = args.tags.split(","); } @@ -209,9 +209,9 @@ module.exports = { extra.type = args.type; send(args._[4], args._[5], extra, callback); } else if(subcommand === "query" && args._.length > 6){ - var from = parseInt(args._[4]); - var to = parseInt(args._[5]); - var q = args._[6]; + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const q = args._[6]; query(from, to, q, callback); } else { callback("unknown subcommand or arguments try `dogapi metric --help` for help", false); diff --git a/lib/api/monitor.js b/lib/api/monitor.js index d506891..381f14a 100644 --- a/lib/api/monitor.js +++ b/lib/api/monitor.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require("util"); +const client = require("../client"); +const util = require("util"); /*section: monitor *comment: create a new monitor @@ -15,14 +15,14 @@ var util = require("util"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var metricType = "metric alert"; - * var query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; + * const metricType = "metric alert"; + * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; * dogapi.monitor.create(metricType, query, function(err, res){ * console.dir(res); * }); @@ -34,7 +34,7 @@ function create(type, query, properties, callback){ properties = {}; } - var params = { + const params = { body: { type: type, query: query @@ -66,8 +66,8 @@ function create(type, query, properties, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -83,7 +83,7 @@ function get(monitorId, groupStates, callback){ groupStates = undefined; } - var params = {}; + const params = {}; if(groupStates){ params.query = { group_states: groupStates.join(",") @@ -104,8 +104,8 @@ function get(monitorId, groupStates, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -120,7 +120,7 @@ function getAll(options, callback){ callback = options; options = {}; } - var params = {}; + const params = {}; if(typeof options === "object"){ params.query = {}; if(options.group_states){ @@ -150,13 +150,13 @@ function getAll(options, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; + * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; * dogapi.monitor.update(1234, query, function(err, res){ * console.dir(res); * }); @@ -168,7 +168,7 @@ function update(monitorId, query, properties, callback){ properties = {}; } - var params = { + const params = { body: { query: query } @@ -198,8 +198,8 @@ function update(monitorId, query, properties, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -224,8 +224,8 @@ function remove(monitorId, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -240,7 +240,7 @@ function mute(monitorId, options, callback){ callback = options; options = {}; } - var params = {}; + const params = {}; if(typeof options === "object"){ params.body = {}; if(options.scope){ @@ -261,8 +261,8 @@ function mute(monitorId, options, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -284,8 +284,8 @@ function muteAll(callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -300,7 +300,7 @@ function unmute(monitorId, scope, callback){ callback = scope; scope = undefined; } - var params = {}; + const params = {}; if(scope){ params.body = { scope: scope @@ -317,8 +317,8 @@ function unmute(monitorId, scope, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -379,24 +379,24 @@ module.exports = { ]; }, handleCli: function(subcommand, args, callback){ - var states = []; + const states = []; if(args["states"]){ states = args["states"].split(","); } - var tags = []; + const tags = []; if(args["tags"]){ tags = args["tags"].split(","); } - var name = args["name"]; - var message = args["message"]; + const name = args["name"]; + const message = args["message"]; if(subcommand === "get"){ - var monitorId = args._[4]; + const monitorId = args._[4]; get(monitorId, states, callback); } else if(subcommand === "getall"){ - var options = {}; + const options = {}; if(states.length){ options.group_states = states; } @@ -405,8 +405,8 @@ module.exports = { } getAll(options, callback); } else if(subcommand === "mute"){ - var monitorId = args._[4]; - var options = {}; + const monitorId = args._[4]; + const options = {}; if(args["scope"]){ options.scope = args["scope"]; } @@ -415,20 +415,20 @@ module.exports = { } mute(monitorId, options, callback); } else if(subcommand === "unmute"){ - var monitorId = args._[4]; - var scope = args["scope"]; + const monitorId = args._[4]; + const scope = args["scope"]; unmute(monitorId, scope, callback); } else if(subcommand === "unmuteall"){ unmuteAll(callback); } else if(subcommand === "muteall"){ muteAll(callback); } else if(subcommand === "remove"){ - var monitorId = args._[4]; + const monitorId = args._[4]; remove(monitorId, callback); } else if(subcommand === "create" && args._.length > 5){ - var type = args._[4]; - var query = args._[5]; - var properties = {}; + const type = args._[4]; + const query = args._[5]; + const properties = {}; if(name){ properties.name = name; } @@ -437,9 +437,9 @@ module.exports = { } create(type, query, properties, callback); } else if(subcommand === "update" && args._.length > 5){ - var monitorId = args._[4]; - var query = args._[5]; - var properties = {}; + const monitorId = args._[4]; + const query = args._[5]; + const properties = {}; if(name){ properties.name = name; } diff --git a/lib/api/screenboard.js b/lib/api/screenboard.js index 05ebc99..81d9686 100644 --- a/lib/api/screenboard.js +++ b/lib/api/screenboard.js @@ -1,6 +1,6 @@ -var client = require("../client"); -var json = require("../json"); -var util = require("util"); +const client = require("../client"); +const json = require("../json"); +const util = require("util"); /*section: screenboard @@ -22,14 +22,14 @@ var util = require("util"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var boardTitle = "my screenboard"; - * var widgets = [ + * const boardTitle = "my screenboard"; + * const widgets = [ * { * type: "image", * height: 20, @@ -39,7 +39,7 @@ var util = require("util"); * url: "https://path/to/image.jpg" * } * ]; - * var options = { + * const options = { * templateVariables: [ * { * name: "host1", @@ -66,7 +66,7 @@ function create(boardTitle, widgets, options, callback){ options = {}; } - var params = { + const params = { body: { board_title: boardTitle, widgets: widgets @@ -112,14 +112,14 @@ function create(boardTitle, widgets, options, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var boardTitle = "my screenboard"; - * var widgets = [ + * const boardTitle = "my screenboard"; + * const widgets = [ * { * type: "image", * height: 20, @@ -129,7 +129,7 @@ function create(boardTitle, widgets, options, callback){ * url: "https://path/to/image.jpg" * } * ]; - * var options = { + * const options = { * description: "it is super awesome" * }; * dogapi.screenboard.update( @@ -149,7 +149,7 @@ function update(boardId, boardTitle, widgets, options, callback) { options = {}; } - var params = { + const params = { body: { board_title: boardTitle, widgets: widgets @@ -182,8 +182,8 @@ function update(boardId, boardTitle, widgets, options, callback) { * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -204,8 +204,8 @@ function remove(boardId, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -225,8 +225,8 @@ function get(boardId, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -247,8 +247,8 @@ function getAll(callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -306,11 +306,11 @@ module.exports = { } else if(subcommand === "share"){ share(args._[4], callback); } else if (subcommand === "update"){ - var boardId = args._[4]; - var boardTitle = args._[5]; - var widgets = json.parse(args._[6]); + const boardId = args._[4]; + const boardTitle = args._[5]; + const widgets = json.parse(args._[6]); - var options = {}; + const options = {}; if(args["description"]) { options.description = args["description"]; } @@ -326,10 +326,10 @@ module.exports = { update(boardId, boardTitle, widgets, options, callback); } else if(subcommand === "create"){ - var boardTitle = args._[4]; - var widgets = json.parse(args._[5]); + const boardTitle = args._[4]; + const widgets = json.parse(args._[5]); - var options = {}; + const options = {}; if(args["description"]) { options.description = args["description"]; } diff --git a/lib/api/search.js b/lib/api/search.js index 39c700b..b62ee36 100644 --- a/lib/api/search.js +++ b/lib/api/search.js @@ -1,4 +1,4 @@ -var client = require("../client"); +const client = require("../client"); /*section: search *comment: | @@ -8,20 +8,20 @@ var client = require("../client"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var query = "app"; + * const query = "app"; * dogapi.search.query(query, function(err, res){ * console.dir(res); * }); * ``` */ function query(query, callback){ - var params = { + const params = { query: { q: query } diff --git a/lib/api/serviceCheck.js b/lib/api/serviceCheck.js index 6a6e7fe..1fb961d 100644 --- a/lib/api/serviceCheck.js +++ b/lib/api/serviceCheck.js @@ -1,4 +1,4 @@ -var client = require("../client"); +const client = require("../client"); /*section: serviceCheck *comment: | @@ -15,14 +15,14 @@ var client = require("../client"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var check = "app.ok"; - * var hostName = "some.machine"; + * const check = "app.ok"; + * const hostName = "some.machine"; * dogapi.serviceCheck.check( * check, hostName, dogapi.WARNING, function(err, res){ * console.dir(res); @@ -43,7 +43,7 @@ function check(check, hostName, status, parameters, callback){ parameters.host_name = hostName, parameters.status = status; - var params = { + const params = { body: parameters }; client.request("POST", "/check_run", params, callback); @@ -71,7 +71,7 @@ module.exports = { }, handleCli: function(subcommand, args, callback){ if(args._.length > 6){ - var parameters = {}; + const parameters = {}; if(args["time"]){ parameters.time = parseInt(args["time"]); } diff --git a/lib/api/tag.js b/lib/api/tag.js index 3094a36..3f00eab 100644 --- a/lib/api/tag.js +++ b/lib/api/tag.js @@ -1,5 +1,5 @@ -var client = require("../client"); -var util = require('util'); +const client = require("../client"); +const util = require('util'); /*section: tag @@ -12,8 +12,8 @@ var util = require('util'); * function callback(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -29,7 +29,7 @@ function getAll(source, callback){ source = undefined; } - var params = { + const params = { query: { source: source } @@ -52,8 +52,8 @@ function getAll(source, callback){ * function callback(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -70,7 +70,7 @@ function get(hostname, options, callback){ } options = options || {}; - var params = { + const params = { query: { } }; @@ -98,8 +98,8 @@ function get(hostname, options, callback){ * function callback(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -115,7 +115,7 @@ function create(hostname, tags, source, callback){ source = undefined; } - var params = { + const params = { body: { tags: tags, source: source @@ -140,8 +140,8 @@ function create(hostname, tags, source, callback){ * function callback(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -157,7 +157,7 @@ function update(hostname, tags, source, callback){ source = undefined; } - var params = { + const params = { body: { tags: tags, source: source @@ -178,8 +178,8 @@ function update(hostname, tags, source, callback){ * function callback(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -195,7 +195,7 @@ function remove(hostname, source, callback){ source = undefined; } - var params = { + const params = { query: { source: source } @@ -235,13 +235,13 @@ module.exports = { ]; }, handleCli: function(subcommand, args, callback){ - var source = args["source"]; - var host = args._[4]; + const source = args["source"]; + const host = args._[4]; if(subcommand === "getall"){ getAll(source, callback); } else if(subcommand === "get"){ - var options = {}; + const options = {}; if(source){ options.source = source; } @@ -250,10 +250,10 @@ module.exports = { } get(host, options, callback); } else if(subcommand === "create"){ - var tags = args._[5].split(","); + const tags = args._[5].split(","); create(host, tags, source, callback); } else if(subcommand === "update"){ - var tags = args._[5].split(","); + const tags = args._[5].split(","); update(host, tags, source, callback); } else if(subcommand === "delete"){ remove(host, source, callback); diff --git a/lib/api/timeboard.js b/lib/api/timeboard.js index d3dbe93..9dcf4c4 100644 --- a/lib/api/timeboard.js +++ b/lib/api/timeboard.js @@ -1,6 +1,6 @@ -var client = require("../client"); -var json = require("../json"); -var util = require("util"); +const client = require("../client"); +const json = require("../json"); +const util = require("util"); /*section: timeboard *comment: add a new timeboard @@ -19,15 +19,15 @@ var util = require("util"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var title = "Time Keeps on Slipping"; - * var description = "Into the Future"; - * var graphs = [ + * const title = "Time Keeps on Slipping"; + * const description = "Into the Future"; + * const graphs = [ * { * definition: { * events: [], @@ -39,7 +39,7 @@ var util = require("util"); * title: "Average Memory Free" * } * ]; - * var templateVariables = [ + * const templateVariables = [ * { * name: "host1", * prefix: "host", @@ -60,7 +60,7 @@ function create(title, description, graphs, templateVariables, callback){ templateVariables = []; } - var params = { + const params = { body: { title: title, description: description, @@ -92,15 +92,15 @@ function create(title, description, graphs, templateVariables, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var title = "Time Keeps on Slipping"; - * var description = "Into the Future"; - * var graphs = [ + * const title = "Time Keeps on Slipping"; + * const description = "Into the Future"; + * const graphs = [ * { * definition: { * events: [], @@ -112,7 +112,7 @@ function create(title, description, graphs, templateVariables, callback){ * title: "Average Memory Free" * } * ]; - * var templateVariables = [ + * const templateVariables = [ * { * name: "host1", * prefix: "host", @@ -133,7 +133,7 @@ function update(dashId, title, description, graphs, templateVariables, callback) templateVariables = []; } - var params = { + const params = { body: { title: title, description: description, @@ -154,8 +154,8 @@ function update(dashId, title, description, graphs, templateVariables, callback) * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -175,8 +175,8 @@ function remove(dashId, callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -197,8 +197,8 @@ function getAll(callback){ * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; @@ -248,21 +248,21 @@ module.exports = { } else if(subcommand === "remove"){ remove(args._[4], callback); } else if(subcommand === "create"){ - var title = args._[4]; - var description = args._[5]; - var graphs = json.parse(args._[6]); - var templateVariables = []; + const title = args._[4]; + const description = args._[5]; + const graphs = json.parse(args._[6]); + const templateVariables = []; if(args["tmpvars"]){ templateVariables = json.parse(args["tmpvars"]); } create(title, description, graphs, templateVariables, callback); } else if(subcommand === "update"){ - var dashId = parseInt(args._[4]); - var title = args._[5]; - var description = args._[6]; - var graphs = json.parse(args._[7]); - var templateVariables = []; + const dashId = parseInt(args._[4]); + const title = args._[5]; + const description = args._[6]; + const graphs = json.parse(args._[7]); + const templateVariables = []; if(args["tmpvars"]){ templateVariables = json.parse(args["tmpvars"]); } diff --git a/lib/api/user.js b/lib/api/user.js index e0f21f3..1c45a33 100644 --- a/lib/api/user.js +++ b/lib/api/user.js @@ -1,4 +1,4 @@ -var client = require("../client"); +const client = require("../client"); /*section: user *comment: invite users via e-mail @@ -7,20 +7,20 @@ var client = require("../client"); * callback: function(err, res) *example: | * ```javascript - * var dogapi = require("dogapi"); - * var options = { + * const dogapi = require("dogapi"); + * const options = { * api_key: "api_key", * app_key: "app_key" * }; * dogapi.initialize(options); - * var emails = ["me@domain.com", "you@domain.com"]; + * const emails = ["me@domain.com", "you@domain.com"]; * dogapi.user.invite(emails, fuction(err, res){ * console.dir(res): * }); * ``` */ function invite(emails, callback){ - var params = { + const params = { body: { emails: emails } diff --git a/lib/client.js b/lib/client.js index 275c6db..6f2e28e 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,9 +1,9 @@ -var extend = require("extend"); -var https = require("https"); -var json = require("./json"); -var url = require("url"); -var util = require("util"); -var _ = require('lodash'); +const https = require("https"); +const url = require("url"); +const util = require("util"); +const extend = require("extend"); +const _ = require('lodash'); +const json = require("./json"); /*section: client *comment: | @@ -52,8 +52,8 @@ client.prototype.request = function(method, path, params, callback){ params = {body: ''}; // create params with empty body property } - var body = (typeof params["body"] === "object") ? json.stringify(params["body"]) : params["body"]; - var query = { + const body = (typeof params["body"] === "object") ? json.stringify(params["body"]) : params["body"]; + const query = { "api_key": this.api_key, "application_key": this.app_key, }; @@ -67,7 +67,7 @@ client.prototype.request = function(method, path, params, callback){ "query": query, }); - var http_options = _.assign({ + const http_options = _.assign({ hostname: this.api_host, port: 443, method: method.toUpperCase(), @@ -85,20 +85,20 @@ client.prototype.request = function(method, path, params, callback){ }; } - var req = https.request(http_options, function(res){ + const req = https.request(http_options, function(res){ res.on("error", function(err){ if(typeof callback == "function"){ callback(err, null, res.statusCode); } }); - var data = ""; + let data = ""; res.on("data", function(chunk){ data += chunk; }); res.on("end", function(){ - var error = null; + let error = null; try{ data = json.parse(data); }catch(e){} if(data["errors"]){ error = data["errors"]; From 45649fcde174e333b910c2994396de01d1b52a28 Mon Sep 17 00:00:00 2001 From: AdrieanKhisbe Date: Fri, 1 Mar 2019 18:01:20 +0100 Subject: [PATCH 02/24] Massive refactor trying to have instantiable client :hammer_and_pick: --- lib/api/comment.js | 281 ++++++------- lib/api/downtime.js | 451 ++++++++++---------- lib/api/embed.js | 316 +++++++------- lib/api/event.js | 393 ++++++++--------- lib/api/graph.js | 141 ++++--- lib/api/host.js | 197 ++++----- lib/api/index.js | 2 + lib/api/infrastructure.js | 96 ++--- lib/api/metric.js | 415 +++++++++--------- lib/api/monitor.js | 858 +++++++++++++++++++------------------- lib/api/screenboard.js | 652 ++++++++++++++--------------- lib/api/search.js | 98 ++--- lib/api/serviceCheck.js | 159 +++---- lib/api/tag.js | 481 ++++++++++----------- lib/api/timeboard.js | 513 +++++++++++------------ lib/api/user.js | 89 ++-- lib/client.js | 18 +- lib/index.js | 14 +- test/api/embed.js | 34 +- test/api/metric.js | 12 +- 20 files changed, 2625 insertions(+), 2595 deletions(-) diff --git a/lib/api/comment.js b/lib/api/comment.js index ddf9b59..df5b233 100644 --- a/lib/api/comment.js +++ b/lib/api/comment.js @@ -1,157 +1,158 @@ -const client = require("../client"); const util = require("util"); -/*section: comment - *comment: create a new comment - *params: - * message: the message of the comment - * properties: | - * optional, an object containing any of the following - * * handle: the handle to associate the comment with (e.g. "user@domain.com") - * * related_event_id: the event to associate the comment with - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.comment.create("a comment message", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function create(message, properties, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = properties; - properties = {}; +module.exports = function (client) { + /*section: comment + *comment: create a new comment + *params: + * message: the message of the comment + * properties: | + * optional, an object containing any of the following + * * handle: the handle to associate the comment with (e.g. "user@domain.com") + * * related_event_id: the event to associate the comment with + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.comment.create("a comment message", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function create(message, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = properties; + properties = {}; + } + + const params = { + body: { + message: message + } + }; + + if (typeof properties === "object") { + if (properties.handle) { + params.body.handle = properties.handle; + } + if (properties.related_event_id) { + params.body.related_event_id = properties.related_event_id; + } + } + + client.request("POST", "/comments", params, callback); } - const params = { - body: { - message: message + /*section: comment + *comment: update an existing comment + *params: + * commentId: the id of the comment to update + * message: the message of the comment + * handle: optional, the handle to associate the comment with (e.g. "user@domain.com") + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.comment.update(1234, "new message", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function update(commentId, message, handle, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = handle; + handle = undefined; } - }; - if(typeof properties === "object"){ - if(properties.handle){ + const params = { + body: { + message: message + } + }; + if (handle) { params.body.handle = properties.handle; } - if(properties.related_event_id){ - params.body.related_event_id = properties.related_event_id; - } - } - - client.request("POST", "/comments", params, callback); -} -/*section: comment - *comment: update an existing comment - *params: - * commentId: the id of the comment to update - * message: the message of the comment - * handle: optional, the handle to associate the comment with (e.g. "user@domain.com") - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.comment.update(1234, "new message", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function update(commentId, message, handle, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = handle; - handle = undefined; + client.request("PUT", util.format("/comments/%s", commentId), params, callback); } - const params = { - body: { - message: message - } - }; - if(handle){ - params.body.handle = properties.handle; + /*section: comment + *comment: remove a comment + *params: + * commentId: the id of the comment to remove + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.comment.remove(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function remove(commentId, callback) { + client.request("DELETE", util.format("/comments/%s", commentId), callback); } - client.request("PUT", util.format("/comments/%s", commentId), params, callback); -} -/*section: comment - *comment: remove a comment - *params: - * commentId: the id of the comment to remove - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.comment.remove(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function remove(commentId, callback){ - client.request("DELETE" ,util.format("/comments/%s", commentId), callback); -} - - -module.exports = { - create: create, - update: update, - remove: remove, - getUsage: function(){ - return [ - " dogapi comment create [--handle ] [--event ]", - " dogapi comment update [--handle ]", - " dogapi comment remove " - ]; - }, - getHelp: function(){ - return [ - "Comment:", - " Subcommands:", - " create add a new comment", - " update update an existing comment", - " remove delete a comment", - "", - " Options:", - " --handle the handle to associate with the comment (e.g. \"user@domain.com\")", - " --event related event id to associate the comment with" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "create"){ - const message = args._[4]; - const properties = {}; - if(args["handle"]){ - properties.handle = args["handle"]; - } - if(args["event"]){ - properties.related_event_id = parseInt(args["event"]); + return { + create: create, + update: update, + remove: remove, + getUsage: function () { + return [ + " dogapi comment create [--handle ] [--event ]", + " dogapi comment update [--handle ]", + " dogapi comment remove " + ]; + }, + getHelp: function () { + return [ + "Comment:", + " Subcommands:", + " create add a new comment", + " update update an existing comment", + " remove delete a comment", + "", + " Options:", + " --handle the handle to associate with the comment (e.g. \"user@domain.com\")", + " --event related event id to associate the comment with" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "create") { + const message = args._[4]; + const properties = {}; + if (args["handle"]) { + properties.handle = args["handle"]; + } + if (args["event"]) { + properties.related_event_id = parseInt(args["event"]); + } + create(message, properties, callback); + } else if (subcommand === "update") { + const commentId = args._[4]; + const message = args._[5]; + update(commentId, message, args["handle"], callback); + } else if (subcommand === "remove") { + const commentId = args._[4]; + remove(commentId, callback); + } else { + callback("unknown subcommand or arguments try `dogapi comment --help` for help", false); } - create(message, properties, callback); - } else if(subcommand === "update"){ - const commentId = args._[4]; - const message = args._[5]; - update(commentId, message, args["handle"], callback); - } else if(subcommand === "remove"){ - const commentId = args._[4]; - remove(commentId, callback); - } else { - callback("unknown subcommand or arguments try `dogapi comment --help` for help", false); } - } + }; }; diff --git a/lib/api/downtime.js b/lib/api/downtime.js index b9bd59f..05eb600 100644 --- a/lib/api/downtime.js +++ b/lib/api/downtime.js @@ -1,242 +1,243 @@ -const client = require("../client"); const util = require("util"); -/*section: downtime - *comment: schedule a new downtime - *params: - * scope: string scope that the downtime should apply to (e.g. "env:staging") - * properties: | - * optional, an object containing any of the following - * * start: POSIX timestamp for when the downtime should start - * * end: POSIX timestamp for when the downtime should end - * * message: a string message to accompany the downtime - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.downtime.create("env:staging", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function create(scope, properties, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = properties; - properties = {}; - } - - const params = { - body: { - scope: scope - } - }; - if(typeof properties === "object"){ - if(properties.start){ - params.body.start = parseInt(properties.start); +module.exports = function (client) { + /*section: downtime + *comment: schedule a new downtime + *params: + * scope: string scope that the downtime should apply to (e.g. "env:staging") + * properties: | + * optional, an object containing any of the following + * * start: POSIX timestamp for when the downtime should start + * * end: POSIX timestamp for when the downtime should end + * * message: a string message to accompany the downtime + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.downtime.create("env:staging", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function create(scope, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = properties; + properties = {}; } - if(properties.end){ - params.body.end = parseInt(properties.end); - } - if(properties.message){ - params.body.message = properties.message; + + const params = { + body: { + scope: scope + } + }; + if (typeof properties === "object") { + if (properties.start) { + params.body.start = parseInt(properties.start); + } + if (properties.end) { + params.body.end = parseInt(properties.end); + } + if (properties.message) { + params.body.message = properties.message; + } } + client.request("POST", "/downtime", params, callback); } - client.request("POST", "/downtime", params, callback); -} -/*section: downtime - *comment: update an existing downtime - *params: - * downtimeId: the id the downtie to update - * properties: | - * optional, an object containing any of the following - * * scope: the scope the downtime should be changed to (e.g. "env:staging") - * * start: POSIX timestamp for when the downtime should start - * * end: POSIX timestamp for when the downtime should end - * * message: a string message to accompany the downtime - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * var properties = { - * scope: "env:staging" - * }; - * dogapi.downtime.update(1234, properties, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function update(downtimeId, properties, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = properties; - properties = {}; - } - const params = { - body: {} - }; - if(typeof properties === "object"){ - if(properties.scope){ - params.body.scope = properties.scope; + /*section: downtime + *comment: update an existing downtime + *params: + * downtimeId: the id the downtie to update + * properties: | + * optional, an object containing any of the following + * * scope: the scope the downtime should be changed to (e.g. "env:staging") + * * start: POSIX timestamp for when the downtime should start + * * end: POSIX timestamp for when the downtime should end + * * message: a string message to accompany the downtime + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * var properties = { + * scope: "env:staging" + * }; + * dogapi.downtime.update(1234, properties, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function update(downtimeId, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = properties; + properties = {}; } - if(properties.start){ - params.body.start = parseInt(properties.start); - } - if(properties.end){ - params.body.end = parseInt(properties.end); - } - if(properties.message){ - params.body.message = properties.message; + const params = { + body: {} + }; + if (typeof properties === "object") { + if (properties.scope) { + params.body.scope = properties.scope; + } + if (properties.start) { + params.body.start = parseInt(properties.start); + } + if (properties.end) { + params.body.end = parseInt(properties.end); + } + if (properties.message) { + params.body.message = properties.message; + } } + client.request("PUT", util.format("/downtime/%s", downtimeId), params, callback); } - client.request("PUT", util.format("/downtime/%s", downtimeId), params, callback); -} -/*section: downtime - *comment: delete a scheduled downtime - *params: - * downtimeId: the id of the downtime - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.downtime.remove(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function remove(downtimeId, callback){ - client.request("DELETE", util.format("/downtime/%s", downtimeId), callback); -} + /*section: downtime + *comment: delete a scheduled downtime + *params: + * downtimeId: the id of the downtime + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.downtime.remove(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function remove(downtimeId, callback) { + client.request("DELETE", util.format("/downtime/%s", downtimeId), callback); + } -/*section: downtime - *comment: get a scheduled downtimes details - *params: - * downtimeId: the id of the downtime - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.downtime.get(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(downtimeId, callback){ - client.request("GET", util.format("/downtime/%s", downtimeId), callback); -} + /*section: downtime + *comment: get a scheduled downtimes details + *params: + * downtimeId: the id of the downtime + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.downtime.get(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(downtimeId, callback) { + client.request("GET", util.format("/downtime/%s", downtimeId), callback); + } -/*section: downtime - *comment: get all downtimes details - *params: - * callback: function(err, res) - *example: | - * ```javascript - * var dogapi = require("dogapi"); - * var options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.downtime.getAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function getAll(callback){ - client.request("GET", "/downtime", callback); -} + /*section: downtime + *comment: get all downtimes details + *params: + * callback: function(err, res) + *example: | + * ```javascript + * var dogapi = require("dogapi"); + * var options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.downtime.getAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function getAll(callback) { + client.request("GET", "/downtime", callback); + } -module.exports = { - create: create, - update: update, - remove: remove, - get: get, - getAll: getAll, - getUsage: function(){ - return [ - " dogapi downtime create [--start ] [--end ] [--message ]", - " dogapi downtime update [--scope ] [--start ] [--end ] [--message ]", - " dogapi downtime remove ", - " dogapi downtime get ", - " dogapi downtime getall", - ]; - }, - getHelp: function(){ - return [ - "Downtime:", - " Subcommands:", - " create create a new downtime with the provided scope (e.g. \"env:staging\")", - " update update an existing downtime with the provided id", - " remove remove the downtime with the provided id", - " get get the details of the downtime with the provided id", - " getall get the details of all downtimes", - "", - " Options:", - " --start POSIX timestamp for when the downtime should start", - " --end POSIX timestamp for when the downtime should end", - " --message a string message to accompany the downtime", - " --scope the scope of the downtime (e.g. \"env:staging\")" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "get"){ - get(args._[4], callback); - } else if(subcommand === "getall"){ - getAll(callback); - } else if(subcommand === "remove"){ - remove(args._[4], callback); - } else if(subcommand === "create"){ - const scope = args._[4]; - const properties = {}; - if(args["start"]){ - properties.start = parseInt(args["start"]); - } - if(args["end"]){ - properties.end = parseInt(args["end"]); + return { + create: create, + update: update, + remove: remove, + get: get, + getAll: getAll, + getUsage: function () { + return [ + " dogapi downtime create [--start ] [--end ] [--message ]", + " dogapi downtime update [--scope ] [--start ] [--end ] [--message ]", + " dogapi downtime remove ", + " dogapi downtime get ", + " dogapi downtime getall", + ]; + }, + getHelp: function () { + return [ + "Downtime:", + " Subcommands:", + " create create a new downtime with the provided scope (e.g. \"env:staging\")", + " update update an existing downtime with the provided id", + " remove remove the downtime with the provided id", + " get get the details of the downtime with the provided id", + " getall get the details of all downtimes", + "", + " Options:", + " --start POSIX timestamp for when the downtime should start", + " --end POSIX timestamp for when the downtime should end", + " --message a string message to accompany the downtime", + " --scope the scope of the downtime (e.g. \"env:staging\")" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "get") { + get(args._[4], callback); + } else if (subcommand === "getall") { + getAll(callback); + } else if (subcommand === "remove") { + remove(args._[4], callback); + } else if (subcommand === "create") { + const scope = args._[4]; + const properties = {}; + if (args["start"]) { + properties.start = parseInt(args["start"]); + } + if (args["end"]) { + properties.end = parseInt(args["end"]); + } + if (args["message"]) { + properties.message = args["message"]; + } + create(scope, properties, callback); + } else if (subcommand === "update") { + const downtimeId = args._[4]; + const properties = {}; + if (args["scope"]) { + properties.scope = args["scope"]; + } + if (args["start"]) { + properties.start = parseInt(args["start"]); + } + if (args["end"]) { + properties.end = parseInt(args["end"]); + } + if (args["message"]) { + properties.message = args["message"]; + } + update(downtimeId, properties, callback); + } else { + callback("unknown subcommand or arguments try `dogapi downtime --help` for help", false); } - if(args["message"]){ - properties.message = args["message"]; - } - create(scope, properties, callback); - } else if(subcommand === "update"){ - const downtimeId = args._[4]; - const properties = {}; - if(args["scope"]){ - properties.scope = args["scope"]; - } - if(args["start"]){ - properties.start = parseInt(args["start"]); - } - if(args["end"]){ - properties.end = parseInt(args["end"]); - } - if(args["message"]){ - properties.message = args["message"]; - } - update(downtimeId, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi downtime --help` for help", false); } - } + }; }; diff --git a/lib/api/embed.js b/lib/api/embed.js index 3516e30..3921ed1 100644 --- a/lib/api/embed.js +++ b/lib/api/embed.js @@ -1,170 +1,172 @@ -const client = require("../client"); const extend = require("extend"); -const json = require("../json"); +const json = require("../json"); // TODO inline lib const querystring = require("querystring"); -/*section: embed - *comment: create an embed graph of a metric query - *params: - * graph_json: The request array to pass create in the embed - * options: optional, object of extra parameters to pass to the embed create (see options[*] params) - * options["timeframe"]: optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week") - * options["size"]: optional, one of ("small", "medium", "large", "xlarge") - * options["legend"]: optional, "yes" or "no" - * options["title"]: optional, the title of the embed - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const query = "system.cpu.idle{*}"; - * const graphJSON = { - * viz: "timeseries", - * requests: [ - * { - * q: query, - * aggregator: "avg", - * conditional_formats: [], - * type: "area" - * } - * ] - * } - * const options = { - * timeframe: "1_hour", - * size: "xlarge", - * legend: "yes", - * title: "my awesome embed" - * }; - * dogapi.embed.create(graphJSON, options, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function create(graphJSON, options, callback){ - if(callback === undefined && typeof options === "function"){ - callback = options; - options = {}; - } - const body = { - graph_json: JSON.stringify(graphJSON) - }; - // Use `extend` to merge `options` into `body` - // DEV: `extend` will ignore any properties whose value is `undefined` - extend(body, options || {}); +module.exports = function (client) { - // Create the request - const params = { - body: querystring.stringify(body), - contentType: "application/x-www-form-urlencoded" - }; + /*section: embed + *comment: create an embed graph of a metric query + *params: + * graph_json: The request array to pass create in the embed + * options: optional, object of extra parameters to pass to the embed create (see options[*] params) + * options["timeframe"]: optional, one of ("1_hour", "4_hours", "1_day", "2_days", and "1_week") + * options["size"]: optional, one of ("small", "medium", "large", "xlarge") + * options["legend"]: optional, "yes" or "no" + * options["title"]: optional, the title of the embed + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const query = "system.cpu.idle{*}"; + * const graphJSON = { + * viz: "timeseries", + * requests: [ + * { + * q: query, + * aggregator: "avg", + * conditional_formats: [], + * type: "area" + * } + * ] + * } + * const options = { + * timeframe: "1_hour", + * size: "xlarge", + * legend: "yes", + * title: "my awesome embed" + * }; + * dogapi.embed.create(graphJSON, options, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function create(graphJSON, options, callback) { + if (callback === undefined && typeof options === "function") { + callback = options; + options = {}; + } + const body = { + graph_json: JSON.stringify(graphJSON) + }; + // Use `extend` to merge `options` into `body` + // DEV: `extend` will ignore any properties whose value is `undefined` + extend(body, options || {}); - client.request("POST", "/graph/embed", params, callback); -} + // Create the request + const params = { + body: querystring.stringify(body), + contentType: "application/x-www-form-urlencoded" + }; -/*section: embed - *comment: delete an embed with a specific id - *params: - * embedId: the id of the embed to delete - * callback: function(err, res) - *example: | - * ```javascript - * const embedid = "foo"; - * dogapi.embed.revoke(embedid, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function revoke(embedId, callback){ - client.request("GET", "/graph/embed/" + embedId + "/revoke", callback); -} + client.request("POST", "/graph/embed", params, callback); + } + /*section: embed + *comment: delete an embed with a specific id + *params: + * embedId: the id of the embed to delete + * callback: function(err, res) + *example: | + * ```javascript + * const embedid = "foo"; + * dogapi.embed.revoke(embedid, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function revoke(embedId, callback) { + client.request("GET", "/graph/embed/" + embedId + "/revoke", callback); + } -/*section: embed - *comment: get all embeds from datadog - *params: - * callback: function(err, res) - *example: | - * ```javascript - * dogapi.embed.getAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function getAll(callback) { - client.request("GET", "/graph/embed", callback); -} -/*section: embed - *comment: get a single embed - *params: - * embedId: the id of the embed to get - * callback: function(err, res) - *example: | - * ```javascript - * const embedId = "foo"; - * dogapi.embed.get(embedId, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(embedId, callback) { - client.request("GET", "/graph/embed/" + embedId, callback); -} + /*section: embed + *comment: get all embeds from datadog + *params: + * callback: function(err, res) + *example: | + * ```javascript + * dogapi.embed.getAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function getAll(callback) { + client.request("GET", "/graph/embed", callback); + } + + /*section: embed + *comment: get a single embed + *params: + * embedId: the id of the embed to get + * callback: function(err, res) + *example: | + * ```javascript + * const embedId = "foo"; + * dogapi.embed.get(embedId, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(embedId, callback) { + client.request("GET", "/graph/embed/" + embedId, callback); + } -module.exports = { - create: create, - revoke: revoke, - getAll: getAll, - get: get, - getUsage: function(){ - return [ - " dogapi embed create [--timeframe ] [--size ] [--legend ] [--title ]", - " dogapi embed revoke <embed_id>", - " dogapi embed get <embed_id>", - " dogapi embed getall" - ]; - }, - getHelp: function(){ - return [ - "Embed:", - " Subcommands:", - " create <embed_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed", - " revoke <embed_id> revoke/delete an embed", - " get <embed_id> gets a single embed object", - " getall gets all embed objects", - " Options:", - " --events <event-query> a query for event bands to add to the snapshot", - " --timeframe <timeframe> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)", - " --size <size> The size of the embed to create (small, medium, large, xlarge)", - " --legend <legend> Whether or not to have a legend (yes, no)", - " --title <title> The title of the embed to create" + return { + create: create, + revoke: revoke, + getAll: getAll, + get: get, + getUsage: function () { + return [ + " dogapi embed create <embed_json> [--timeframe <timeframe>] [--size <size>] [--legend <legend>] [--title <title>]", + " dogapi embed revoke <embed_id>", + " dogapi embed get <embed_id>", + " dogapi embed getall" + ]; + }, + getHelp: function () { + return [ + "Embed:", + " Subcommands:", + " create <embed_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed", + " revoke <embed_id> revoke/delete an embed", + " get <embed_id> gets a single embed object", + " getall gets all embed objects", + " Options:", + " --events <event-query> a query for event bands to add to the snapshot", + " --timeframe <timeframe> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)", + " --size <size> The size of the embed to create (small, medium, large, xlarge)", + " --legend <legend> Whether or not to have a legend (yes, no)", + " --title <title> The title of the embed to create" - ]; - }, - handleCli: function(subcommand, args, callback) { - if (args._.length > 4 && subcommand === "create") { - const graph_json = json.parse(args._[4]); - const options = { - timeframe: args["timeframe"], - size: args["size"], - legend: args["legend"], - title: args["title"] - }; - create(graph_json, options, callback); - } else if (args._.length > 4 && subcommand === "revoke") { - const embedId = args._[4]; - revoke(embedId, callback); - } else if (args._.length > 4 && subcommand === "get") { - const embedId = args._[4]; - get(embedId, callback); - } else if (subcommand === "getall") { - getAll(callback); - } else { - callback("unknown subcommand or arguments try `dogapi embed --help` for help", false); + ]; + }, + handleCli: function (subcommand, args, callback) { + if (args._.length > 4 && subcommand === "create") { + const graph_json = json.parse(args._[4]); + const options = { + timeframe: args["timeframe"], + size: args["size"], + legend: args["legend"], + title: args["title"] + }; + create(graph_json, options, callback); + } else if (args._.length > 4 && subcommand === "revoke") { + const embedId = args._[4]; + revoke(embedId, callback); + } else if (args._.length > 4 && subcommand === "get") { + const embedId = args._[4]; + get(embedId, callback); + } else if (subcommand === "getall") { + getAll(callback); + } else { + callback("unknown subcommand or arguments try `dogapi embed --help` for help", false); + } } - } + }; }; diff --git a/lib/api/event.js b/lib/api/event.js index f568d5d..3a31912 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -1,209 +1,210 @@ -const client = require("../client"); const util = require("util"); -/*section: event - *comment: | - * create a new event - *params: - * title: the title of the event - * text: the body of the event - * properties: | - * an optional object continaing any of the following additional optional properties - * * date_happened: POSIX timestamp of when it happened - * * priority: "normal" or "low" [defualt: "normal"] - * * host: the host name to associate with the event - * * tags: array of "tag:value"'s to associate with the event - * * alert_type: "error", "warning", "info" or "success" [defualt: "info"] - * * aggregation_key: an arbitrary string used to aggregate like events - * * source_type_name: options: "nagios", "hudson", "jenkins", "user", "my apps", "feed", "chef", "puppet", "git", "bitbucket", "fabric", "capistrano" - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const title = "some new event"; - * const text = "IT HAPPENED!"; - * dogapi.event.create(title, text, function(err, res){ - * console.dir(res); - * }); - * title = "another event"; - * text = "IT HAPPENED AGAIN!"; - * const properties = { - * tags: ["some:tag"], - * alert_type: "error" - * }; - * dogapi.event.create(title, text, properties, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function create(title, text, properties, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = properties; - properties = {}; - } - if(typeof properties !== "object"){ - properties = {}; - } - - properties.title = title; - properties.text = text; - - const params = { - body: properties - }; - client.request("POST", "/events", params, callback); -} +module.exports = function (client) { + /*section: event + *comment: | + * create a new event + *params: + * title: the title of the event + * text: the body of the event + * properties: | + * an optional object continaing any of the following additional optional properties + * * date_happened: POSIX timestamp of when it happened + * * priority: "normal" or "low" [defualt: "normal"] + * * host: the host name to associate with the event + * * tags: array of "tag:value"'s to associate with the event + * * alert_type: "error", "warning", "info" or "success" [defualt: "info"] + * * aggregation_key: an arbitrary string used to aggregate like events + * * source_type_name: options: "nagios", "hudson", "jenkins", "user", "my apps", "feed", "chef", "puppet", "git", "bitbucket", "fabric", "capistrano" + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const title = "some new event"; + * const text = "IT HAPPENED!"; + * dogapi.event.create(title, text, function(err, res){ + * console.dir(res); + * }); + * title = "another event"; + * text = "IT HAPPENED AGAIN!"; + * const properties = { + * tags: ["some:tag"], + * alert_type: "error" + * }; + * dogapi.event.create(title, text, properties, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function create(title, text, properties, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = properties; + properties = {}; + } + if (typeof properties !== "object") { + properties = {}; + } -/*section: event - *comment: | - * get event details from the provided event id - *params: - * eventId: | - * the id of the event to fetch - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.event.get(10005, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(eventId, callback){ - client.request("GET", util.format("/events/%s", eventId), callback); -} + properties.title = title; + properties.text = text; -/*section: event - *comment: | - * query the event stream - *params: - * start: POSIX timestamp for start of query - * end: POSIX timestamp for end of query - * parameters: | - * optional parameters to use for the query - * * priority: "low" or "normal" - * * sources: comma separated list of sources (e.g. "jenkins,user") - * * tags: comma separated list of tags (e.g. "tag:value1,tag:value2") - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const now = parseInt(new Date().getTime() / 1000); - * const then = now - 3600; // an hour ago - * const parameters = { - * tags: "some:tag", - * sources: "jenkins" - * }; - * dogapi.event.query(then, now, parameters, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function query(start, end, parameters, callback){ - if(arguments.length < 4 && typeof argument[2] === "function"){ - callback = parameters; - parameters = {}; + const params = { + body: properties + }; + client.request("POST", "/events", params, callback); } - if(typeof parameters !== "object"){ - parameters = {} + /*section: event + *comment: | + * get event details from the provided event id + *params: + * eventId: | + * the id of the event to fetch + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.event.get(10005, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(eventId, callback) { + client.request("GET", util.format("/events/%s", eventId), callback); } - parameters.start = start; - parameters.end = end; - const params = { - query: parameters - }; + /*section: event + *comment: | + * query the event stream + *params: + * start: POSIX timestamp for start of query + * end: POSIX timestamp for end of query + * parameters: | + * optional parameters to use for the query + * * priority: "low" or "normal" + * * sources: comma separated list of sources (e.g. "jenkins,user") + * * tags: comma separated list of tags (e.g. "tag:value1,tag:value2") + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const now = parseInt(new Date().getTime() / 1000); + * const then = now - 3600; // an hour ago + * const parameters = { + * tags: "some:tag", + * sources: "jenkins" + * }; + * dogapi.event.query(then, now, parameters, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function query(start, end, parameters, callback) { + if (arguments.length < 4 && typeof argument[2] === "function") { + callback = parameters; + parameters = {}; + } - client.request("GET", "/events", params, callback); -} + if (typeof parameters !== "object") { + parameters = {} + } + parameters.start = start; + parameters.end = end; -module.exports = { - create: create, - get: get, - query: query, - getUsage: function(){ - return [ - " dogapi event get <event-id>", - " dogapi event query <from> <to> [--priority <priority>] [--sources <sources>] [--tags <tags>]", - " dogapi event create <title> <text> [--time <timestamp>] [--priority <priority>] [--host <host>] [--tags <tags>] [--type <type>] [--agg-key <agg-key>] [--source <source>]" - ]; - }, - getHelp: function(){ - return [ - "Event:", - " Subcommands:", - " get <event-id> get the event with the provided <event-id>", - " query <from> <to> query the event stream between <from> and <to> POSIX timestamps", - " create <title> <text> create a new event with <title> and <text>", - " Options:", - " --priority <priority> the priority of the event \"normal\" or \"low\"", - " --sources <sources> a comma separated list of sources (e.g. \"users,jenkins,chef\")", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --time <time> a POSIX timestamp for when the event happened", - " --host <host> the host to associate the event to", - " --type <type> the event type \"error\", \"warning\", \"info\" or \"success\"", - " --agg-key <agg-key> an aggregation key to use to associate like events", - " --source <source> the source to associate with this event (e.g. \"users\", \"jenkins\", etc)" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "get" && args._.length > 4){ - get(parseInt(args._[4]), callback); - } else if(subcommand === "query" && args._.length > 5){ - const from = parseInt(args._[4]); - const to = parseInt(args._[5]); - const parameters = {}; - if(args["sources"]){ - parameters.sources = args["sources"]; - } - if(args["tags"]){ - parameters.tags = args["tags"]; - } - query(from, to, parameters, callback); - } else if(subcommand === "create" && args._.length > 5){ - const title = args._[4]; - const text = args._[5]; - const properties = {}; - if(args["priority"]){ - properties.priority = args["priority"]; - } - if(args["host"]){ - properties.host = args["host"]; - } - if(args["time"]){ - properties.date_happened = parseInt(args["time"]); - } - if(args["tags"]){ - properties.tags = args["tags"].split(","); - } - if(args["agg-key"]){ - properties.aggregation_key = args["agg-key"]; - } - if(args["source"]){ - properties.source_type_name = args["source"]; + const params = { + query: parameters + }; + + client.request("GET", "/events", params, callback); + } + + return { + create: create, + get: get, + query: query, + getUsage: function () { + return [ + " dogapi event get <event-id>", + " dogapi event query <from> <to> [--priority <priority>] [--sources <sources>] [--tags <tags>]", + " dogapi event create <title> <text> [--time <timestamp>] [--priority <priority>] [--host <host>] [--tags <tags>] [--type <type>] [--agg-key <agg-key>] [--source <source>]" + ]; + }, + getHelp: function () { + return [ + "Event:", + " Subcommands:", + " get <event-id> get the event with the provided <event-id>", + " query <from> <to> query the event stream between <from> and <to> POSIX timestamps", + " create <title> <text> create a new event with <title> and <text>", + " Options:", + " --priority <priority> the priority of the event \"normal\" or \"low\"", + " --sources <sources> a comma separated list of sources (e.g. \"users,jenkins,chef\")", + " --tags <tags> a comma separated list of \"tag:value\"'s", + " --time <time> a POSIX timestamp for when the event happened", + " --host <host> the host to associate the event to", + " --type <type> the event type \"error\", \"warning\", \"info\" or \"success\"", + " --agg-key <agg-key> an aggregation key to use to associate like events", + " --source <source> the source to associate with this event (e.g. \"users\", \"jenkins\", etc)" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "get" && args._.length > 4) { + get(parseInt(args._[4]), callback); + } else if (subcommand === "query" && args._.length > 5) { + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const parameters = {}; + if (args["sources"]) { + parameters.sources = args["sources"]; + } + if (args["tags"]) { + parameters.tags = args["tags"]; + } + query(from, to, parameters, callback); + } else if (subcommand === "create" && args._.length > 5) { + const title = args._[4]; + const text = args._[5]; + const properties = {}; + if (args["priority"]) { + properties.priority = args["priority"]; + } + if (args["host"]) { + properties.host = args["host"]; + } + if (args["time"]) { + properties.date_happened = parseInt(args["time"]); + } + if (args["tags"]) { + properties.tags = args["tags"].split(","); + } + if (args["agg-key"]) { + properties.aggregation_key = args["agg-key"]; + } + if (args["source"]) { + properties.source_type_name = args["source"]; + } + create(title, text, properties, callback); + } else { + callback("unknown subcommand or arguments try `dogapi event --help` for help", false); } - create(title, text, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi event --help` for help", false); } - } + }; }; diff --git a/lib/api/graph.js b/lib/api/graph.js index fcbb8a8..fd2906e 100644 --- a/lib/api/graph.js +++ b/lib/api/graph.js @@ -1,75 +1,78 @@ -const client = require("../client"); -const embed = require("./embed"); +const Embed = require("./embed"); -/*section: graph - *comment: take a snapshot of a metric query - *params: - * query: the metric query to use for the snapshot - * from: POSIX timestamp for the beginning of the query - * to: POSIX timestamp for the end of the query - * eventQuery: optional, an event query to overlay event bands on the snapshot - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const query = "system.cpu.idle{*}"; - * const to = dogapi.now(); - * const from = to - 3600; // an hour ago - * dogapi.graph.snapshot(query, from, to, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function snapshot(query, from, to, eventQuery, callback){ - if(arguments.length < 5 && typeof arguments[3] === "function"){ - callback = eventQuery; - eventQuery = undefined; - } - const params = { - query: { - metric_query: query, - start: parseInt(from), - end: parseInt(to) +module.exports = function (client) { + const embed = Embed(client); + + /*section: graph + *comment: take a snapshot of a metric query + *params: + * query: the metric query to use for the snapshot + * from: POSIX timestamp for the beginning of the query + * to: POSIX timestamp for the end of the query + * eventQuery: optional, an event query to overlay event bands on the snapshot + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const query = "system.cpu.idle{*}"; + * const to = dogapi.now(); + * const from = to - 3600; // an hour ago + * dogapi.graph.snapshot(query, from, to, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function snapshot(query, from, to, eventQuery, callback) { + if (arguments.length < 5 && typeof arguments[3] === "function") { + callback = eventQuery; + eventQuery = undefined; + } + const params = { + query: { + metric_query: query, + start: parseInt(from), + end: parseInt(to) + } + }; + if (eventQuery) { + params.query.event_query = eventQuery; } - }; - if(eventQuery){ - params.query.event_query = eventQuery; - } - client.request("GET", "/graph/snapshot", params, callback); -} + client.request("GET", "/graph/snapshot", params, callback); + } -module.exports = { - snapshot: snapshot, - createEmbed: embed.create, - getUsage: function(){ - return [ - " dogapi graph snapshot <query> <from> <to> [--events <event-query>]" - ]; - }, - getHelp: function(){ - return [ - "Graph:", - " Subcommands:", - " snapshot <query> <from> <to> --events <event-query> | take a snapshot of a graph", - " Options:", - " --events <event-query> a query for event bands to add to the snapshot" - ]; - }, - handleCli: function(subcommand, args, callback){ - if (args._.length > 5 && subcommand === "snapshot"){ - const query = args._[4]; - const from = parseInt(args._[5]); - const to = parseInt(args._[6]); - const eventQuery = args["events"]; - snapshot(query, from, to, eventQuery, callback); - } else { - callback("unknown subcommand or arguments try `dogapi graph --help` for help", false); + return { + snapshot: snapshot, + createEmbed: embed.create, + getUsage: function () { + return [ + " dogapi graph snapshot <query> <from> <to> [--events <event-query>]" + ]; + }, + getHelp: function () { + return [ + "Graph:", + " Subcommands:", + " snapshot <query> <from> <to> --events <event-query> | take a snapshot of a graph", + " Options:", + " --events <event-query> a query for event bands to add to the snapshot" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (args._.length > 5 && subcommand === "snapshot") { + const query = args._[4]; + const from = parseInt(args._[5]); + const to = parseInt(args._[6]); + const eventQuery = args["events"]; + snapshot(query, from, to, eventQuery, callback); + } else { + callback("unknown subcommand or arguments try `dogapi graph --help` for help", false); + } } - } + }; }; diff --git a/lib/api/host.js b/lib/api/host.js index dbe86d8..d6a597d 100644 --- a/lib/api/host.js +++ b/lib/api/host.js @@ -1,108 +1,109 @@ -const client = require("../client"); const util = require("util"); -/*section: host - *comment: mute the given host, if it is not already muted - *params: - * hostname: the hostname of the host to mute - * options: | - * optional, an object containing any of the following - * * end: POSIX timestamp for when the mute should end - * * override: whether or not to override the end for an existing mute - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.host.mute("my.host.name", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function mute(hostname, options, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = options; - options = {}; - } - const params = {}; - if(typeof options === "object"){ - params.body = {}; // create body property - if(options.end){ - params.body.end = parseInt(options.end); +module.exports = function (client) { + /*section: host + *comment: mute the given host, if it is not already muted + *params: + * hostname: the hostname of the host to mute + * options: | + * optional, an object containing any of the following + * * end: POSIX timestamp for when the mute should end + * * override: whether or not to override the end for an existing mute + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.host.mute("my.host.name", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function mute(hostname, options, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = options; + options = {}; } - if(options.override){ - params.body.override = options.override; + const params = {}; + if (typeof options === "object") { + params.body = {}; // create body property + if (options.end) { + params.body.end = parseInt(options.end); + } + if (options.override) { + params.body.override = options.override; + } + } else { + params.body = ""; // create empty body } - } else { - params.body = ""; // create empty body + client.request("POST", util.format("/host/%s/mute", hostname), params, callback); } - client.request("POST", util.format("/host/%s/mute", hostname), params, callback); -} -/*section: host - *comment: unmute the given host, if it is not already unmuted - *params: - * hostname: the hostname of the host to unmute - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.host.unmute("my.host.name", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function unmute(hostname, callback){ - const params = {body: ""}; // create empty body - client.request("POST", util.format("/host/%s/unmute", hostname), params, callback); -} + /*section: host + *comment: unmute the given host, if it is not already unmuted + *params: + * hostname: the hostname of the host to unmute + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.host.unmute("my.host.name", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function unmute(hostname, callback) { + const params = { body: "" }; // create empty body + client.request("POST", util.format("/host/%s/unmute", hostname), params, callback); + } -module.exports = { - mute: mute, - unmute: unmute, - getUsage: function(){ - return [ - " dogapi host mute <host> [--end <end>] [--override]", - " dogapi host unmute <host>" - ]; - }, - getHelp: function(){ - return [ - "Host:", - " Subcommands:", - " mute <host> mute the host with the provided hostname", - " unmute <host> unmute the host with the provided hostname", - "", - " Options:", - " --end <end> POSIX timestamp for when the mute should end", - " --override override an existing \"end\" for a mute on a host" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "mute"){ - const hostname = args._[4]; - const options = {}; - if(args["end"]){ - options.end = parseInt(args["end"]); - } - if(args["override"]){ - options.override = args["override"]; + return { + mute: mute, + unmute: unmute, + getUsage: function () { + return [ + " dogapi host mute <host> [--end <end>] [--override]", + " dogapi host unmute <host>" + ]; + }, + getHelp: function () { + return [ + "Host:", + " Subcommands:", + " mute <host> mute the host with the provided hostname", + " unmute <host> unmute the host with the provided hostname", + "", + " Options:", + " --end <end> POSIX timestamp for when the mute should end", + " --override override an existing \"end\" for a mute on a host" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "mute") { + const hostname = args._[4]; + const options = {}; + if (args["end"]) { + options.end = parseInt(args["end"]); + } + if (args["override"]) { + options.override = args["override"]; + } + mute(hostname, options, callback); + } else if (subcommand === "unmute") { + const hostname = args._[4]; + unmute(hostname, callback); + } else { + callback("unknown subcommand or arguments try `dogapi host --help` for help", false); } - mute(hostname, options, callback); - } else if(subcommand === "unmute"){ - const hostname = args._[4]; - unmute(hostname, callback); - } else { - callback("unknown subcommand or arguments try `dogapi host --help` for help", false); } - } + }; }; diff --git a/lib/api/index.js b/lib/api/index.js index b3914a6..41a315b 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -21,3 +21,5 @@ module.exports = function(obj){ obj[key] = api[key]; } }; + +module.exports.api = api; diff --git a/lib/api/infrastructure.js b/lib/api/infrastructure.js index 3d0de06..25caa6b 100644 --- a/lib/api/infrastructure.js +++ b/lib/api/infrastructure.js @@ -1,52 +1,52 @@ -const client = require("../client"); +module.exports = function (client) { -/*section: infrastructure - *comment: | - * search for metrics or hosts - *params: - * query: | - * the query to use for search see [datadog docs](http://docs.datadoghq.com/api/#search) - * for examples of the query (e.g. "hosts:database", "metrics:system" or "test") - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.infrastructure.search("hosts:database", function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function search(query, callback){ - const params = { - query: { - q: query - } - }; - - client.request("GET", "/search", params, callback); -} + /*section: infrastructure + *comment: | + * search for metrics or hosts + *params: + * query: | + * the query to use for search see [datadog docs](http://docs.datadoghq.com/api/#search) + * for examples of the query (e.g. "hosts:database", "metrics:system" or "test") + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.infrastructure.search("hosts:database", function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function search(query, callback) { + const params = { + query: { + q: query + } + }; -module.exports = { - search: search, - getUsage: function(){ - return [ - " dogapi infrastructure search <query>" - ] - }, - getHelp: function(){ - return [ - "Infrastructure:", - " Subcommands:", - " search <query> query for hosts or metrics with <query> (see http://docs.datadoghq.com/api/#search)", - ]; - }, - handleCli: function(subcommand, args, callback){ - const query = args._[4]; - search(query, callback); + client.request("GET", "/search", params, callback); } + return { + search: search, + getUsage: function () { + return [ + " dogapi infrastructure search <query>" + ] + }, + getHelp: function () { + return [ + "Infrastructure:", + " Subcommands:", + " search <query> query for hosts or metrics with <query> (see http://docs.datadoghq.com/api/#search)", + ]; + }, + handleCli: function (subcommand, args, callback) { + const query = args._[4]; + search(query, callback); + } + }; }; diff --git a/lib/api/metric.js b/lib/api/metric.js index 3750aa3..c8150f5 100644 --- a/lib/api/metric.js +++ b/lib/api/metric.js @@ -1,220 +1,221 @@ -const client = require("../client"); +module.exports = function (client) { -/*section: metric - *comment: | - * submit a new metric - *params: - * metric: the metric name - * points: | - * a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) - * or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) - * extra: | - * optional, object which can contain the following keys - * * host: the host source of the metric - * * tags: array of "tag:value"'s to use for the metric - * * metric_type|type: which metric type to use ("gauge" or "count") [default: gauge] - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.metric.send("my.metric", 1000, function(err, results){ - * console.dir(results); - * }); - * dogapi.metric.send("my.metric", [500, 1000], function(err, results){ - * console.dir(results); - * }); - * const now = parseInt(new Date().getTime() / 1000); - * dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){ - * console.dir(results); - * }); - * dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function send(metric, points, extra, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = extra; - extra = {}; - } - extra = extra || {}; - const series = [ - { - metric: metric, - points: points, - host: extra.host, - tags: extra.tags, - // DEV: For backwards compatibility, allow `metric_type` - type: extra.type || extra.metric_type + /*section: metric + *comment: | + * submit a new metric + *params: + * metric: the metric name + * points: | + * a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) + * or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) + * extra: | + * optional, object which can contain the following keys + * * host: the host source of the metric + * * tags: array of "tag:value"'s to use for the metric + * * metric_type|type: which metric type to use ("gauge" or "count") [default: gauge] + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.metric.send("my.metric", 1000, function(err, results){ + * console.dir(results); + * }); + * dogapi.metric.send("my.metric", [500, 1000], function(err, results){ + * console.dir(results); + * }); + * const now = parseInt(new Date().getTime() / 1000); + * dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){ + * console.dir(results); + * }); + * dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function send(metric, points, extra, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = extra; + extra = {}; } - ]; + extra = extra || {}; + const series = [ + { + metric: metric, + points: points, + host: extra.host, + tags: extra.tags, + // DEV: For backwards compatibility, allow `metric_type` + type: extra.type || extra.metric_type + } + ]; - send_all(series, callback); -} + send_all(series, callback); + } -/*section: metric - *comment: | - * send a list of metrics - *params: - * metrics: | - * an array of metrics where each element is an object with the following keys - * * metric: the name of the metric - * * points: a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) - * * tags: an array of "tag:value"'s - * * host: the source hostname to use for the metrics - * * metric_type|type: the type of metric to use ("gauge" or "count") [default: gauge] - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const now = parseInt(new Date().getTime() / 1000); - * const metrics = [ - * { - * metric: "my.metric", - * points: [[now, 1000]], - * tags: ["tag:value"] - * }, - * { - * metric: "another.metric", - * points: [50, 1000] - * }, - * { - * metric: "another.metric", - * points: 1000 - * } - * ]; - * dogapi.metric.send_all(metrics, function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function send_all(metrics, callback){ - const now = parseInt(new Date().getTime() / 1000); - for(let i = 0; i < metrics.length; ++i){ - // Try to normalize `points` - // DEV: We need `points` to be an array of arrays regardless of what they give us - // Always wrap points in an array, this way we will get: - // 500 => [500] - // [500, 100] => [[<timestamp>, 500], [<timestamp>, 1000]] - // [[<timestamp>, 500]] => [[<timestamp>, 500]] - let points = metrics[i].points; - if(!Array.isArray(metrics[i].points)){ - points = [points]; - } - points = points.map(function(point){ - // Make sure each point is an array, if not make array with current timestamp - // 500 => [<timestamp>, 500] - // [<timestamp>, 500] => unchanged - if(!Array.isArray(point)){ - const now = parseInt(new Date().getTime() / 1000); - point = [now, point]; + /*section: metric + *comment: | + * send a list of metrics + *params: + * metrics: | + * an array of metrics where each element is an object with the following keys + * * metric: the name of the metric + * * points: a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) + * * tags: an array of "tag:value"'s + * * host: the source hostname to use for the metrics + * * metric_type|type: the type of metric to use ("gauge" or "count") [default: gauge] + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const now = parseInt(new Date().getTime() / 1000); + * const metrics = [ + * { + * metric: "my.metric", + * points: [[now, 1000]], + * tags: ["tag:value"] + * }, + * { + * metric: "another.metric", + * points: [50, 1000] + * }, + * { + * metric: "another.metric", + * points: 1000 + * } + * ]; + * dogapi.metric.send_all(metrics, function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function send_all(metrics, callback) { + const now = parseInt(new Date().getTime() / 1000); + for (let i = 0; i < metrics.length; ++i) { + // Try to normalize `points` + // DEV: We need `points` to be an array of arrays regardless of what they give us + // Always wrap points in an array, this way we will get: + // 500 => [500] + // [500, 100] => [[<timestamp>, 500], [<timestamp>, 1000]] + // [[<timestamp>, 500]] => [[<timestamp>, 500]] + let points = metrics[i].points; + if (!Array.isArray(metrics[i].points)) { + points = [points]; } - return point; - }); + points = points.map(function (point) { + // Make sure each point is an array, if not make array with current timestamp + // 500 => [<timestamp>, 500] + // [<timestamp>, 500] => unchanged + if (!Array.isArray(point)) { + const now = parseInt(new Date().getTime() / 1000); + point = [now, point]; + } + return point; + }); - metrics[i].points = points; + metrics[i].points = points; - // DEV: Change `metric_type` to `type` for backwards compatibility - metrics[i].type = metrics[i].type || metrics[i].metric_type; - // Remove `metric_type` if it was set - // DEV: This will not cause an error if `metric_type` does not exist - delete metrics[i].metric_type; - } - - const params = { - body: { - series: metrics + // DEV: Change `metric_type` to `type` for backwards compatibility + metrics[i].type = metrics[i].type || metrics[i].metric_type; + // Remove `metric_type` if it was set + // DEV: This will not cause an error if `metric_type` does not exist + delete metrics[i].metric_type; } - }; - client.request("POST", "/series", params, callback); -} -/*section: metric - *comment: | - * make a metric query - *params: - * from: POSIX timestamp for start of query - * to: POSIX timestamp for end of query - * query: the string query to perform (e.g. "system.cpu.idle{*}by{host}") - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const now = parseInt(new Date().getTime() / 1000); - * const then = now - 3600; // one hour ago - * const query = "system.cpu.idle{*}by{host}"; - * dogapi.metric.query(then, now, query, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function query(from, to, query, callback){ - const params = { - query: { - from: from, - to: to, - query: query - } - }; - client.request("GET", "/query", params, callback); -} + const params = { + body: { + series: metrics + } + }; + client.request("POST", "/series", params, callback); + } -module.exports = { - send: send, - send_all: send_all, - query: query, - getUsage: function(){ - return [ - " dogapi metric send <metric> <point> [--tags <tags>] [--host <host>] [--type <type>]", - " dogapi metric query <from> <to> <query>" - ] - }, - getHelp: function(){ - return [ - "Metric:", - " Subcommands:", - " send <metric> <point> add a new datapoint for <metric> for right now", - " query <from> <to> <query> query for <query> between <from> and <to> POSIX timestamps", - "", - " Options:", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --host <host> the hostname that should be associated with this metric", - " --type <type> the type of metric \"gauge\" or \"count\"" - ] - }, - handleCli: function(subcommand, args, callback){ - if(args._.length > 5 && subcommand === "send"){ - const extra = {}; - if(args.tags){ - extra.tags = args.tags.split(","); + /*section: metric + *comment: | + * make a metric query + *params: + * from: POSIX timestamp for start of query + * to: POSIX timestamp for end of query + * query: the string query to perform (e.g. "system.cpu.idle{*}by{host}") + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const now = parseInt(new Date().getTime() / 1000); + * const then = now - 3600; // one hour ago + * const query = "system.cpu.idle{*}by{host}"; + * dogapi.metric.query(then, now, query, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function query(from, to, query, callback) { + const params = { + query: { + from: from, + to: to, + query: query } - extra.host = args.host; - extra.type = args.type; - send(args._[4], args._[5], extra, callback); - } else if(subcommand === "query" && args._.length > 6){ - const from = parseInt(args._[4]); - const to = parseInt(args._[5]); - const q = args._[6]; - query(from, to, q, callback); - } else { - callback("unknown subcommand or arguments try `dogapi metric --help` for help", false); - } + }; + client.request("GET", "/query", params, callback); } + + return { + send: send, + send_all: send_all, + query: query, + getUsage: function () { + return [ + " dogapi metric send <metric> <point> [--tags <tags>] [--host <host>] [--type <type>]", + " dogapi metric query <from> <to> <query>" + ] + }, + getHelp: function () { + return [ + "Metric:", + " Subcommands:", + " send <metric> <point> add a new datapoint for <metric> for right now", + " query <from> <to> <query> query for <query> between <from> and <to> POSIX timestamps", + "", + " Options:", + " --tags <tags> a comma separated list of \"tag:value\"'s", + " --host <host> the hostname that should be associated with this metric", + " --type <type> the type of metric \"gauge\" or \"count\"" + ] + }, + handleCli: function (subcommand, args, callback) { + if (args._.length > 5 && subcommand === "send") { + const extra = {}; + if (args.tags) { + extra.tags = args.tags.split(","); + } + extra.host = args.host; + extra.type = args.type; + send(args._[4], args._[5], extra, callback); + } else if (subcommand === "query" && args._.length > 6) { + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const q = args._[6]; + query(from, to, q, callback); + } else { + callback("unknown subcommand or arguments try `dogapi metric --help` for help", false); + } + } + }; }; diff --git a/lib/api/monitor.js b/lib/api/monitor.js index 381f14a..9f36def 100644 --- a/lib/api/monitor.js +++ b/lib/api/monitor.js @@ -1,454 +1,456 @@ -const client = require("../client"); const util = require("util"); -/*section: monitor - *comment: create a new monitor - *params: - * type: one of "metric alert" or "service check" - * query: the monitor query to use, you probably want to read datadog's [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs - * properties: | - * optional, an object containing any of the following - * * name: the name of the monitor - * * message: the message for the monitor - * * tags: a list of strings as tags to associate with the monitor - * * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const metricType = "metric alert"; - * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; - * dogapi.monitor.create(metricType, query, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function create(type, query, properties, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = properties; - properties = {}; - } - - const params = { - body: { - type: type, - query: query - } - }; +module.exports = function(client){ - if(typeof properties === "object"){ - if(properties.name){ - params.body.name = properties.name; + /*section: monitor + *comment: create a new monitor + *params: + * type: one of "metric alert" or "service check" + * query: the monitor query to use, you probably want to read datadog's [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs + * properties: | + * optional, an object containing any of the following + * * name: the name of the monitor + * * message: the message for the monitor + * * tags: a list of strings as tags to associate with the monitor + * * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const metricType = "metric alert"; + * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; + * dogapi.monitor.create(metricType, query, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function create(type, query, properties, callback){ + if(arguments.length < 4 && typeof arguments[2] === "function"){ + callback = properties; + properties = {}; } - if(properties.message){ - params.body.message = properties.message; - } - if(properties.tags){ - params.body.tags = properties.tags; - } - if(typeof properties.options === "object"){ - params.body.options = properties.options; - } - } - client.request("POST", "/monitor", params, callback); -} - -/*section: monitor - *comment: get an existing monitor's details - *params: - * monitorId: the id of the monitor - * groupStates: an array containing any of the following "all", "alert", "warn", or "no data" - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.get(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(monitorId, groupStates, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = groupStates; - groupStates = undefined; - } - - const params = {}; - if(groupStates){ - params.query = { - group_states: groupStates.join(",") + + const params = { + body: { + type: type, + query: query + } }; - } - - client.request("GET", util.format("/monitor/%s", monitorId), params, callback); -} - -/*section: monitor - *comment: get all monitors - *params: - * options: | - * optional, an object containing any of the following - * * group_states: an array containing any of the following "all", "alert", "warn", or "no data" - * * tags: an array of "tag:value"'s to filter on - * * monitor_tags: a comma separated list indicating what service and/or custom tags - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.getAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function getAll(options, callback){ - if(arguments.length < 2 && typeof arguments[0] === "function"){ - callback = options; - options = {}; - } - const params = {}; - if(typeof options === "object"){ - params.query = {}; - if(options.group_states){ - params.query.group_states = options.group_states.join(","); + + if(typeof properties === "object"){ + if(properties.name){ + params.body.name = properties.name; + } + if(properties.message){ + params.body.message = properties.message; + } + if(properties.tags){ + params.body.tags = properties.tags; + } + if(typeof properties.options === "object"){ + params.body.options = properties.options; + } } - if(options.tags){ - params.query.tags = options.tags.join(","); + client.request("POST", "/monitor", params, callback); + } + + /*section: monitor + *comment: get an existing monitor's details + *params: + * monitorId: the id of the monitor + * groupStates: an array containing any of the following "all", "alert", "warn", or "no data" + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.get(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(monitorId, groupStates, callback){ + if(arguments.length < 3 && typeof arguments[1] === "function"){ + callback = groupStates; + groupStates = undefined; } - if(options.monitor_tags){ - params.query.monitor_tags = options.monitor_tags.join(","); + + const params = {}; + if(groupStates){ + params.query = { + group_states: groupStates.join(",") + }; } + + client.request("GET", util.format("/monitor/%s", monitorId), params, callback); } - client.request("GET", "/monitor", params, callback); -} - -/*section: monitor - *comment: update a monitor's details - *params: - * monitorId: the id of the monitor to edit - * query: the query that the monitor should have, see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs for more info - * properties: | - * optional, an object containing any of the following - * * name: the name of the monitor - * * message: the message for the monitor - * * tags: a list of strings as tags to associate with the monitor - * * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; - * dogapi.monitor.update(1234, query, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function update(monitorId, query, properties, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = properties; - properties = {}; - } - - const params = { - body: { - query: query + + /*section: monitor + *comment: get all monitors + *params: + * options: | + * optional, an object containing any of the following + * * group_states: an array containing any of the following "all", "alert", "warn", or "no data" + * * tags: an array of "tag:value"'s to filter on + * * monitor_tags: a comma separated list indicating what service and/or custom tags + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.getAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function getAll(options, callback){ + if(arguments.length < 2 && typeof arguments[0] === "function"){ + callback = options; + options = {}; } - }; - - if(typeof properties === "object"){ - if(properties.name){ - params.body.name = properties.name; - } - if(properties.message){ - params.body.message = properties.message; + const params = {}; + if(typeof options === "object"){ + params.query = {}; + if(options.group_states){ + params.query.group_states = options.group_states.join(","); + } + if(options.tags){ + params.query.tags = options.tags.join(","); + } + if(options.monitor_tags){ + params.query.monitor_tags = options.monitor_tags.join(","); + } } - if(properties.tags){ - params.body.tags = properties.tags; + client.request("GET", "/monitor", params, callback); + } + + /*section: monitor + *comment: update a monitor's details + *params: + * monitorId: the id of the monitor to edit + * query: the query that the monitor should have, see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs for more info + * properties: | + * optional, an object containing any of the following + * * name: the name of the monitor + * * message: the message for the monitor + * * tags: a list of strings as tags to associate with the monitor + * * options: an object, to see available options please see the [monitor create](http://docs.datadoghq.com/api/#monitor-create) docs + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const query = "avg(last_1h):sum:system.net.bytes_rcvd{host:host0} > 100"; + * dogapi.monitor.update(1234, query, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function update(monitorId, query, properties, callback){ + if(arguments.length < 4 && typeof arguments[2] === "function"){ + callback = properties; + properties = {}; } - if(typeof properties.options === "object"){ - params.body.options = properties.options; + + const params = { + body: { + query: query + } + }; + + if(typeof properties === "object"){ + if(properties.name){ + params.body.name = properties.name; + } + if(properties.message){ + params.body.message = properties.message; + } + if(properties.tags){ + params.body.tags = properties.tags; + } + if(typeof properties.options === "object"){ + params.body.options = properties.options; + } } + client.request("PUT", util.format("/monitor/%s", monitorId), params, callback); } - client.request("PUT", util.format("/monitor/%s", monitorId), params, callback); -} - -/*section: monitor - *comment: delete an existing monitor - *params: - * monitorId: the id of the monitor to remove - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.remove(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function remove(monitorId, callback){ - client.request("DELETE", util.format("/monitor/%s", monitorId), callback); -} - -/*section: monitor - *comment: mute an existing monitor - *params: - * monitorId: the id of the monitor to mute - * options: | - * optional, an object containing any of the following - * * scope: the scope to mute (e.g. "role:db") - * * end: POSIX timestamp indicating when the mute should end - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.mute(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function mute(monitorId, options, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = options; - options = {}; + + /*section: monitor + *comment: delete an existing monitor + *params: + * monitorId: the id of the monitor to remove + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.remove(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function remove(monitorId, callback){ + client.request("DELETE", util.format("/monitor/%s", monitorId), callback); } - const params = {}; - if(typeof options === "object"){ - params.body = {}; - if(options.scope){ - params.body.scope = options.scope; + + /*section: monitor + *comment: mute an existing monitor + *params: + * monitorId: the id of the monitor to mute + * options: | + * optional, an object containing any of the following + * * scope: the scope to mute (e.g. "role:db") + * * end: POSIX timestamp indicating when the mute should end + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.mute(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function mute(monitorId, options, callback){ + if(arguments.length < 3 && typeof arguments[1] === "function"){ + callback = options; + options = {}; } - if(options.end){ - params.body.end = parseInt(options.end); + const params = {}; + if(typeof options === "object"){ + params.body = {}; + if(options.scope){ + params.body.scope = options.scope; + } + if(options.end){ + params.body.end = parseInt(options.end); + } + } else { + params.body = ""; // create empty body } - } else { - params.body = ""; // create empty body - } - client.request("POST", util.format("/monitor/%s/mute", monitorId), params, callback); -} - -/*section: monitor - *comment: mute all monitors - *params: - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.muteAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function muteAll(callback){ - client.request("POST", "/monitor/mute_all", callback); -} - -/*section: monitor - *comment: unmute an existing monitor - *params: - * monitorId: the id of the monitor to unmute - * scope: optional, a scope to apply the unmute to (e.g. "role:db") - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.unmute(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function unmute(monitorId, scope, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = scope; - scope = undefined; + client.request("POST", util.format("/monitor/%s/mute", monitorId), params, callback); } - const params = {}; - if(scope){ - params.body = { - scope: scope - }; - } else { - params.body = ""; // create empty body + + /*section: monitor + *comment: mute all monitors + *params: + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.muteAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function muteAll(callback){ + client.request("POST", "/monitor/mute_all", callback); } - client.request("POST", util.format("/monitor/%s/unmute", monitorId), params, callback); -} - -/*section: monitor - *comment: unmute all monitors - *params: - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.monitor.unmuteAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function unmuteAll(callback){ - client.request("POST", "/monitor/unmute_all", callback); -} - -module.exports = { - create: create, - get: get, - update: update, - remove: remove, - getAll: getAll, - mute: mute, - muteAll: muteAll, - unmute: unmute, - unmuteAll: unmuteAll, - getUsage: function(){ - return [ - " dogapi monitor create <type> <query> [--name <name>] [--message <message>]", - " dogapi monitor get <monitor-id> [--states <states>]", - " dogapi monitor getall [--states <states>] [--tags <tags>]", - " dogapi monitor mute <monitor-id> [--scope <scope>] [--end <end>]", - " dogapi monitor muteall", - " dogapi monitor remove <monitor-id>", - " dogapi monitor unmute <monitor-id> [--scope <scope>]", - " dogapi monitor unmuteall", - " dogapi monitor update <monitor-id> <query> [--name <name>] [--message <message>]" - ]; - }, - getHelp: function(){ - return [ - "Monitor:", - " Subcommands:", - " create <type> <query> create a new monitor", - " get <monitor-id> get a monitors details", - " getall get a list of all monitors", - " mute <monitor-id> mute the monitor with the id <monitor-id>", - " muteall mute all monitors", - " remove <monitor-id> delete the monitor with the id <monitor-id>", - " unmute <monitor-id> unmute the monitor with the id <monitor-id>", - " unmuteall unmute all monitors", - " update <monitor-id> <query> update an existing monitor", - "", - " Options:", - " --states <states> a comma separated list containing any of \"all\", \"alert\", \"warn\", or \"no data\"", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --scope <scope> the scope of the monitor to mute (e.g. \"role:db\")", - " --end <end> POSIX timestamp for when the mute should end", - " --name <name> the name for the monitor", - " --message <message> the message for the monitor" - ]; - }, - handleCli: function(subcommand, args, callback){ - const states = []; - if(args["states"]){ - states = args["states"].split(","); + + /*section: monitor + *comment: unmute an existing monitor + *params: + * monitorId: the id of the monitor to unmute + * scope: optional, a scope to apply the unmute to (e.g. "role:db") + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.unmute(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function unmute(monitorId, scope, callback){ + if(arguments.length < 3 && typeof arguments[1] === "function"){ + callback = scope; + scope = undefined; } - - const tags = []; - if(args["tags"]){ - tags = args["tags"].split(","); + const params = {}; + if(scope){ + params.body = { + scope: scope + }; + } else { + params.body = ""; // create empty body } - - const name = args["name"]; - const message = args["message"]; - - if(subcommand === "get"){ - const monitorId = args._[4]; - get(monitorId, states, callback); - } else if(subcommand === "getall"){ - const options = {}; - if(states.length){ - options.group_states = states; - } - if(tags.length){ - options.tags = tags; - } - getAll(options, callback); - } else if(subcommand === "mute"){ - const monitorId = args._[4]; - const options = {}; - if(args["scope"]){ - options.scope = args["scope"]; - } - if(args["end"]){ - options.end = args["end"]; - } - mute(monitorId, options, callback); - } else if(subcommand === "unmute"){ - const monitorId = args._[4]; - const scope = args["scope"]; - unmute(monitorId, scope, callback); - } else if(subcommand === "unmuteall"){ - unmuteAll(callback); - } else if(subcommand === "muteall"){ - muteAll(callback); - } else if(subcommand === "remove"){ - const monitorId = args._[4]; - remove(monitorId, callback); - } else if(subcommand === "create" && args._.length > 5){ - const type = args._[4]; - const query = args._[5]; - const properties = {}; - if(name){ - properties.name = name; - } - if(message){ - properties.message = message; + client.request("POST", util.format("/monitor/%s/unmute", monitorId), params, callback); + } + + /*section: monitor + *comment: unmute all monitors + *params: + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.monitor.unmuteAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function unmuteAll(callback){ + client.request("POST", "/monitor/unmute_all", callback); + } + + return { + create: create, + get: get, + update: update, + remove: remove, + getAll: getAll, + mute: mute, + muteAll: muteAll, + unmute: unmute, + unmuteAll: unmuteAll, + getUsage: function(){ + return [ + " dogapi monitor create <type> <query> [--name <name>] [--message <message>]", + " dogapi monitor get <monitor-id> [--states <states>]", + " dogapi monitor getall [--states <states>] [--tags <tags>]", + " dogapi monitor mute <monitor-id> [--scope <scope>] [--end <end>]", + " dogapi monitor muteall", + " dogapi monitor remove <monitor-id>", + " dogapi monitor unmute <monitor-id> [--scope <scope>]", + " dogapi monitor unmuteall", + " dogapi monitor update <monitor-id> <query> [--name <name>] [--message <message>]" + ]; + }, + getHelp: function(){ + return [ + "Monitor:", + " Subcommands:", + " create <type> <query> create a new monitor", + " get <monitor-id> get a monitors details", + " getall get a list of all monitors", + " mute <monitor-id> mute the monitor with the id <monitor-id>", + " muteall mute all monitors", + " remove <monitor-id> delete the monitor with the id <monitor-id>", + " unmute <monitor-id> unmute the monitor with the id <monitor-id>", + " unmuteall unmute all monitors", + " update <monitor-id> <query> update an existing monitor", + "", + " Options:", + " --states <states> a comma separated list containing any of \"all\", \"alert\", \"warn\", or \"no data\"", + " --tags <tags> a comma separated list of \"tag:value\"'s", + " --scope <scope> the scope of the monitor to mute (e.g. \"role:db\")", + " --end <end> POSIX timestamp for when the mute should end", + " --name <name> the name for the monitor", + " --message <message> the message for the monitor" + ]; + }, + handleCli: function(subcommand, args, callback){ + const states = []; + if(args["states"]){ + states = args["states"].split(","); } - create(type, query, properties, callback); - } else if(subcommand === "update" && args._.length > 5){ - const monitorId = args._[4]; - const query = args._[5]; - const properties = {}; - if(name){ - properties.name = name; + + const tags = []; + if(args["tags"]){ + tags = args["tags"].split(","); } - if(message){ - properties.message = message; + + const name = args["name"]; + const message = args["message"]; + + if(subcommand === "get"){ + const monitorId = args._[4]; + get(monitorId, states, callback); + } else if(subcommand === "getall"){ + const options = {}; + if(states.length){ + options.group_states = states; + } + if(tags.length){ + options.tags = tags; + } + getAll(options, callback); + } else if(subcommand === "mute"){ + const monitorId = args._[4]; + const options = {}; + if(args["scope"]){ + options.scope = args["scope"]; + } + if(args["end"]){ + options.end = args["end"]; + } + mute(monitorId, options, callback); + } else if(subcommand === "unmute"){ + const monitorId = args._[4]; + const scope = args["scope"]; + unmute(monitorId, scope, callback); + } else if(subcommand === "unmuteall"){ + unmuteAll(callback); + } else if(subcommand === "muteall"){ + muteAll(callback); + } else if(subcommand === "remove"){ + const monitorId = args._[4]; + remove(monitorId, callback); + } else if(subcommand === "create" && args._.length > 5){ + const type = args._[4]; + const query = args._[5]; + const properties = {}; + if(name){ + properties.name = name; + } + if(message){ + properties.message = message; + } + create(type, query, properties, callback); + } else if(subcommand === "update" && args._.length > 5){ + const monitorId = args._[4]; + const query = args._[5]; + const properties = {}; + if(name){ + properties.name = name; + } + if(message){ + properties.message = message; + } + update(monitorId, query, properties, callback); + } else { + callback("unknown subcommand or arguments try `dogapi monitor --help` for help", false); } - update(monitorId, query, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi monitor --help` for help", false); } - } + }; }; diff --git a/lib/api/screenboard.js b/lib/api/screenboard.js index 81d9686..b4253b7 100644 --- a/lib/api/screenboard.js +++ b/lib/api/screenboard.js @@ -1,351 +1,351 @@ -const client = require("../client"); const json = require("../json"); const util = require("util"); +module.exports = function (client) { + /*section: screenboard + *comment: create a new screenboard + *params: + * boardTitle: the name of the screenboard + * widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info + * options: | + * optional, a object which can contain any of the following keys + * * description: description of the screenboard + * * templateVariables: | + * an array of objects with the following keys + * * name: the name of the variable + * * prefix: optional, the tag prefix for this variable + * * default: optional, the default value for this tag + * * width: the width of the screenboard in pixels + * * height: the height of the screenboard in pixels + * * readOnly: the read-only status of the screenboard + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const boardTitle = "my screenboard"; + * const widgets = [ + * { + * type: "image", + * height: 20, + * width: 32, + * y: 7, + * x: 32, + * url: "https://path/to/image.jpg" + * } + * ]; + * const options = { + * templateVariables: [ + * { + * name: "host1", + * prefix: "host", + * "default": "host:my-host" + * } + * ], + * description: "it is super awesome" + * }; + * dogapi.screenboard.create( + * boardTitle, widgets, options, + * function(err, res){ + * console.dir(res); + * } + * ); + * ``` + */ + function create(boardTitle, widgets, options, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = options; + options = {}; + } + if (typeof options !== "object") { + options = {}; + } -/*section: screenboard - *comment: create a new screenboard - *params: - * boardTitle: the name of the screenboard - * widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info - * options: | - * optional, a object which can contain any of the following keys - * * description: description of the screenboard - * * templateVariables: | - * an array of objects with the following keys - * * name: the name of the variable - * * prefix: optional, the tag prefix for this variable - * * default: optional, the default value for this tag - * * width: the width of the screenboard in pixels - * * height: the height of the screenboard in pixels - * * readOnly: the read-only status of the screenboard - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const boardTitle = "my screenboard"; - * const widgets = [ - * { - * type: "image", - * height: 20, - * width: 32, - * y: 7, - * x: 32, - * url: "https://path/to/image.jpg" - * } - * ]; - * const options = { - * templateVariables: [ - * { - * name: "host1", - * prefix: "host", - * "default": "host:my-host" - * } - * ], - * description: "it is super awesome" - * }; - * dogapi.screenboard.create( - * boardTitle, widgets, options, - * function(err, res){ - * console.dir(res); - * } - * ); - * ``` - */ -function create(boardTitle, widgets, options, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = options; - options = {}; - } - if(typeof options !== "object"){ - options = {}; - } + const params = { + body: { + board_title: boardTitle, + widgets: widgets + } + }; - const params = { - body: { - board_title: boardTitle, - widgets: widgets + if (options.description) { + params.body.description = options.description; + } + if (options.templateVariables) { + params.body.template_variables = options.templateVariables; + } + if (options.width) { + params.body.width = options.width; + } + if (options.height) { + params.body.height = options.height; + } + if (options.readOnly) { + params.body.read_only = options.readOnly; } - }; - if(options.description){ - params.body.description = options.description; - } - if(options.templateVariables){ - params.body.template_variables = options.templateVariables; - } - if(options.width){ - params.body.width = options.width; - } - if(options.height){ - params.body.height = options.height; - } - if(options.readOnly){ - params.body.read_only = options.readOnly; + client.request("POST", "/screen", params, callback); } - client.request("POST", "/screen", params, callback); -} + /*section: screenboard + *comment: update an existing screenboard + *params: + * boardId: the id of the screenboard to update + * boardTitle: the name of the screenboard + * widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info + * options: | + * optional, a object which can contain any of the following keys + * * description: description of the screenboard + * * templateVariables: | + * an array of objects with the following keys + * * name: the name of the variable + * * prefix: optional, the tag prefix for this variable + * * default: optional, the default value for this tag + * * width: the width of the screenboard in pixels + * * height: the height of the screenboard in pixels + * * readOnly: the read-only status of the screenboard + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const boardTitle = "my screenboard"; + * const widgets = [ + * { + * type: "image", + * height: 20, + * width: 32, + * y: 7, + * x: 32, + * url: "https://path/to/image.jpg" + * } + * ]; + * const options = { + * description: "it is super awesome" + * }; + * dogapi.screenboard.update( + * 1234, boardTitle, widgets, options, + * function(err, res){ + * console.dir(res); + * } + * ); + * ``` + */ + function update(boardId, boardTitle, widgets, options, callback) { + if (arguments.length < 5 && typeof arguments[3] === "function") { + callback = options; + options = {}; + } + if (typeof options !== "object") { + options = {}; + } -/*section: screenboard - *comment: update an existing screenboard - *params: - * boardId: the id of the screenboard to update - * boardTitle: the name of the screenboard - * widgets: an array of widgets, see http://docs.datadoghq.com/api/screenboards/ for more info - * options: | - * optional, a object which can contain any of the following keys - * * description: description of the screenboard - * * templateVariables: | - * an array of objects with the following keys - * * name: the name of the variable - * * prefix: optional, the tag prefix for this variable - * * default: optional, the default value for this tag - * * width: the width of the screenboard in pixels - * * height: the height of the screenboard in pixels - * * readOnly: the read-only status of the screenboard - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const boardTitle = "my screenboard"; - * const widgets = [ - * { - * type: "image", - * height: 20, - * width: 32, - * y: 7, - * x: 32, - * url: "https://path/to/image.jpg" - * } - * ]; - * const options = { - * description: "it is super awesome" - * }; - * dogapi.screenboard.update( - * 1234, boardTitle, widgets, options, - * function(err, res){ - * console.dir(res); - * } - * ); - * ``` - */ -function update(boardId, boardTitle, widgets, options, callback) { - if(arguments.length < 5 && typeof arguments[3] === "function"){ - callback = options; - options = {}; - } - if(typeof options !== "object"){ - options = {}; - } + const params = { + body: { + board_title: boardTitle, + widgets: widgets + } + }; - const params = { - body: { - board_title: boardTitle, - widgets: widgets - } - }; + if (options.description) { + params.body.description = options.description; + } + if (options.templateVariables) { + params.body.template_variables = options.templateVariables; + } + if (options.width) { + params.body.width = options.width; + } + if (options.height) { + params.body.height = options.height; + } + if (options.readOnly) { + params.body.read_only = options.readOnly; + } - if(options.description){ - params.body.description = options.description; - } - if(options.templateVariables){ - params.body.template_variables = options.templateVariables; - } - if(options.width){ - params.body.width = options.width; - } - if(options.height){ - params.body.height = options.height; - } - if(options.readOnly){ - params.body.read_only = options.readOnly; - } + client.request("PUT", util.format("/screen/%s", boardId), params, callback); + } - client.request("PUT", util.format("/screen/%s", boardId), params, callback); -} + /*section: screenboard + *comment: delete an existing screenboard + *params: + * boardId: the id of the screenboard to delete + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.screenboard.remove(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function remove(boardId, callback) { + client.request("DELETE", util.format("/screen/%s", boardId), callback); + } -/*section: screenboard - *comment: delete an existing screenboard - *params: - * boardId: the id of the screenboard to delete - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.screenboard.remove(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function remove(boardId, callback){ - client.request("DELETE", util.format("/screen/%s", boardId), callback); -} + /*section: screenboard + *comment: get the info of a single existing screenboard + *params: + * boardId: the id of the screenboard to fetch + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.screenboard.get(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(boardId, callback) { + client.request("GET", util.format("/screen/%s", boardId), callback); + } -/*section: screenboard - *comment: get the info of a single existing screenboard - *params: - * boardId: the id of the screenboard to fetch - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.screenboard.get(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(boardId, callback){ - client.request("GET", util.format("/screen/%s", boardId), callback); -} + /*section: screenboard + *comment: get all existing screenboards + *params: + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.screenboard.getAll(function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function getAll(callback) { + client.request("GET", "/screen", callback); + } -/*section: screenboard - *comment: get all existing screenboards - *params: - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.screenboard.getAll(function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function getAll(callback){ - client.request("GET", "/screen", callback); -} + /*section: screenboard + *comment: share an existing screenboard + *params: + * boardId: the id of the screenboard to share + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.screenboard.share(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function share(boardId, callback) { + client.request("POST", util.format("/screen/share/%s", boardId), callback); + } -/*section: screenboard - *comment: share an existing screenboard - *params: - * boardId: the id of the screenboard to share - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.screenboard.share(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function share(boardId, callback){ - client.request("POST", util.format("/screen/share/%s", boardId), callback); -} + return { + create: create, + remove: remove, + update: update, + get: get, + getAll: getAll, + share: share, + getUsage: function () { + return [ + " dogapi screenboard create <boardTitle> <widgets> [--description <description>] [--tmpvars <templateVariables>] [--width <width>] [--height <height>]", + " dogapi screenboard remove <boardId>", + " dogapi screenboard get <boardId>", + " dogapi screenboard getall", + " dogapi screenboard share <boardId>" + ]; + }, + getHelp: function () { + return [ + "Screenboard:", + " Subcommands:", + " create <boardTitle> <widgets> create a new screenboard, <widgets> is a json of the graph definition", + " update <boardId> <boardTitle> <widgets> update a screenboard", + " remove <boardId> remove an existing screenboard", + " get <boardId> get an existing screenboard", + " getall get all screenboards", + " share <boardId> get share info for an existing screenboard", + " Options:", + " --description <description> a description of the screenboard's content", + " --tmpvars <templateVariables> json representation of the template variable definition", + " --width <width> width of the screenboard in pixels", + " --height <height> height of the screenboard in pixels", + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "get") { + get(args._[4], callback); + } else if (subcommand === "getall") { + getAll(callback); + } else if (subcommand === "remove") { + remove(args._[4], callback); + } else if (subcommand === "share") { + share(args._[4], callback); + } else if (subcommand === "update") { + const boardId = args._[4]; + const boardTitle = args._[5]; + const widgets = json.parse(args._[6]); -module.exports = { - create: create, - remove: remove, - update: update, - get: get, - getAll: getAll, - share: share, - getUsage: function(){ - return [ - " dogapi screenboard create <boardTitle> <widgets> [--description <description>] [--tmpvars <templateVariables>] [--width <width>] [--height <height>]", - " dogapi screenboard remove <boardId>", - " dogapi screenboard get <boardId>", - " dogapi screenboard getall", - " dogapi screenboard share <boardId>" - ]; - }, - getHelp: function(){ - return [ - "Screenboard:", - " Subcommands:", - " create <boardTitle> <widgets> create a new screenboard, <widgets> is a json of the graph definition", - " update <boardId> <boardTitle> <widgets> update a screenboard", - " remove <boardId> remove an existing screenboard", - " get <boardId> get an existing screenboard", - " getall get all screenboards", - " share <boardId> get share info for an existing screenboard", - " Options:", - " --description <description> a description of the screenboard's content", - " --tmpvars <templateVariables> json representation of the template variable definition", - " --width <width> width of the screenboard in pixels", - " --height <height> height of the screenboard in pixels", - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "get"){ - get(args._[4], callback); - } else if(subcommand === "getall"){ - getAll(callback); - } else if(subcommand === "remove"){ - remove(args._[4], callback); - } else if(subcommand === "share"){ - share(args._[4], callback); - } else if (subcommand === "update"){ - const boardId = args._[4]; - const boardTitle = args._[5]; - const widgets = json.parse(args._[6]); + const options = {}; + if (args["description"]) { + options.description = args["description"]; + } + if (args["tmpvars"]) { + options.templateVariables = json.parse(args["tmpvars"]); + } + if (args["width"]) { + options.width = parseInt(args["width"]); + } + if (args["height"]) { + options.height = parseInt(args["height"]); + } - const options = {}; - if(args["description"]) { - options.description = args["description"]; - } - if(args["tmpvars"]){ - options.templateVariables = json.parse(args["tmpvars"]); - } - if(args["width"]){ - options.width = parseInt(args["width"]); - } - if(args["height"]){ - options.height = parseInt(args["height"]); - } + update(boardId, boardTitle, widgets, options, callback); + } else if (subcommand === "create") { + const boardTitle = args._[4]; + const widgets = json.parse(args._[5]); - update(boardId, boardTitle, widgets, options, callback); - } else if(subcommand === "create"){ - const boardTitle = args._[4]; - const widgets = json.parse(args._[5]); + const options = {}; + if (args["description"]) { + options.description = args["description"]; + } + if (args["tmpvars"]) { + options.templateVariables = json.parse(args["tmpvars"]); + } + if (args["width"]) { + options.width = parseInt(args["width"]); + } + if (args["height"]) { + options.height = parseInt(args["height"]); + } - const options = {}; - if(args["description"]) { - options.description = args["description"]; - } - if(args["tmpvars"]){ - options.templateVariables = json.parse(args["tmpvars"]); - } - if(args["width"]){ - options.width = parseInt(args["width"]); + create(boardTitle, widgets, options, callback); + } else { + callback("unknown subcommand or arguments try `dogapi screenboard --help` for help", false); } - if(args["height"]){ - options.height = parseInt(args["height"]); - } - - create(boardTitle, widgets, options, callback); - } else { - callback("unknown subcommand or arguments try `dogapi screenboard --help` for help", false); } - } + }; }; diff --git a/lib/api/search.js b/lib/api/search.js index b62ee36..0c57b03 100644 --- a/lib/api/search.js +++ b/lib/api/search.js @@ -1,53 +1,53 @@ -const client = require("../client"); +module.exports = function (client) { + /*section: search + *comment: | + * search for metrics and hosts from the past 24 hours + *params: + * query: the seach query to perform (e.g. "app1" or "hosts:app1" or "metrics:response") + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const query = "app"; + * dogapi.search.query(query, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function query(query, callback) { + const params = { + query: { + q: query + } + }; + client.request("GET", "/search", params, callback); + } -/*section: search - *comment: | - * search for metrics and hosts from the past 24 hours - *params: - * query: the seach query to perform (e.g. "app1" or "hosts:app1" or "metrics:response") - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const query = "app"; - * dogapi.search.query(query, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function query(query, callback){ - const params = { - query: { - q: query + return { + query: query, + getUsage: function () { + return [ + " dogapi search query <query>" + ]; + }, + getHelp: function () { + return [ + "Search:", + " Subcommands:", + " query <query> search for hosts and metrics from the last 24 hours" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "query" && args._.length > 4) { + query(args._[4], callback); + } else { + callback("unknown subcommand or arguments try `dogapi search --help` for help", false); + } } }; - client.request("GET", "/search", params, callback); -} - -module.exports = { - query: query, - getUsage: function(){ - return [ - " dogapi search query <query>" - ]; - }, - getHelp: function(){ - return [ - "Search:", - " Subcommands:", - " query <query> search for hosts and metrics from the last 24 hours" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "query" && args._.length > 4){ - query(args._[4], callback); - } else { - callback("unknown subcommand or arguments try `dogapi search --help` for help", false); - } - } }; diff --git a/lib/api/serviceCheck.js b/lib/api/serviceCheck.js index 1fb961d..b93d1f8 100644 --- a/lib/api/serviceCheck.js +++ b/lib/api/serviceCheck.js @@ -1,89 +1,90 @@ -const client = require("../client"); +module.exports = function (client) { -/*section: serviceCheck - *comment: | - * post an update to a service check - *params: - * check: the check name (e.g. "app.ok") - * hostName: the name of the host submitting the check - * status: one of `dogapi.OK`, `dogapi.WARNING`, `dogapi.CRITICAL` or `dogapi.UNKNOWN` - * parameters: | - * optional, an object containing any of the following - * * timestamp: POSIX timestamp for when the check happened - * * message: string message to accompany the check - * * tags: an array of "tag:value"'s associated with the check - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const check = "app.ok"; - * const hostName = "some.machine"; - * dogapi.serviceCheck.check( - * check, hostName, dogapi.WARNING, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function check(check, hostName, status, parameters, callback){ - if(arguments.length < 5 && typeof arguments[3] === "function"){ - callback = parameters; - parameters = {}; - } + /*section: serviceCheck + *comment: | + * post an update to a service check + *params: + * check: the check name (e.g. "app.ok") + * hostName: the name of the host submitting the check + * status: one of `dogapi.OK`, `dogapi.WARNING`, `dogapi.CRITICAL` or `dogapi.UNKNOWN` + * parameters: | + * optional, an object containing any of the following + * * timestamp: POSIX timestamp for when the check happened + * * message: string message to accompany the check + * * tags: an array of "tag:value"'s associated with the check + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const check = "app.ok"; + * const hostName = "some.machine"; + * dogapi.serviceCheck.check( + * check, hostName, dogapi.WARNING, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function check(check, hostName, status, parameters, callback) { + if (arguments.length < 5 && typeof arguments[3] === "function") { + callback = parameters; + parameters = {}; + } - if(typeof parameters !== "object"){ - parameters = {}; - } + if (typeof parameters !== "object") { + parameters = {}; + } - parameters.check = check; - parameters.host_name = hostName, - parameters.status = status; + parameters.check = check; + parameters.host_name = hostName, + parameters.status = status; - const params = { - body: parameters + const params = { + body: parameters + }; + client.request("POST", "/check_run", params, callback); }; - client.request("POST", "/check_run", params, callback); -}; -module.exports = { - check: check, - getUsage: function(){ - return [ - " dogapi servicecheck check <check> <host> <status> [--time <timestamp>] [--message <message>] [--tags <tags>]" - ]; - }, - getHelp: function(){ - return [ - "Service Check:", - " Subcommands:", - " check <check> <host> <status> add a new service check for <check> and <host> at level <status> (0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN)", - "", - " Options:", - " --time <timestamp> the POSIX timestamp to use for the check", - " --message <message> an optional message to accompany the check", - " --tags <tags> a comma separated list of \"tag:value\"'s for the check" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(args._.length > 6){ - const parameters = {}; - if(args["time"]){ - parameters.time = parseInt(args["time"]); + return { + check: check, + getUsage: function () { + return [ + " dogapi servicecheck check <check> <host> <status> [--time <timestamp>] [--message <message>] [--tags <tags>]" + ]; + }, + getHelp: function () { + return [ + "Service Check:", + " Subcommands:", + " check <check> <host> <status> add a new service check for <check> and <host> at level <status> (0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN)", + "", + " Options:", + " --time <timestamp> the POSIX timestamp to use for the check", + " --message <message> an optional message to accompany the check", + " --tags <tags> a comma separated list of \"tag:value\"'s for the check" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (args._.length > 6) { + const parameters = {}; + if (args["time"]) { + parameters.time = parseInt(args["time"]); + } + if (args["message"]) { + paramaters.message = args["message"]; + } + if (args["tags"]) { + parameters.tags = args["tags"].split(","); + } + check(args._[4], args._[5], parseInt(args._[6]), parameters, callback); + } else { + callback("not enough arguments try `dogapi servicecheck --help` for help", false); } - if(args["message"]){ - paramaters.message = args["message"]; - } - if(args["tags"]){ - parameters.tags = args["tags"].split(","); - } - check(args._[4], args._[5], parseInt(args._[6]), parameters, callback); - } else { - callback("not enough arguments try `dogapi servicecheck --help` for help", false); } - } + }; }; diff --git a/lib/api/tag.js b/lib/api/tag.js index 3f00eab..210b3a3 100644 --- a/lib/api/tag.js +++ b/lib/api/tag.js @@ -1,264 +1,265 @@ -const client = require("../client"); const util = require('util'); +module.exports = function (client) { -/*section: tag - *comment: | - * get all host tags - *params: - * source: | - * optional, only show tags for a particular source [default: null] - * callback: | - * function callback(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.tag.getAll(function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function getAll(source, callback){ - if(arguments.length < 2 && typeof arguments[0] === "function"){ - callback = source; - source = undefined; - } - - const params = { - query: { - source: source + /*section: tag + *comment: | + * get all host tags + *params: + * source: | + * optional, only show tags for a particular source [default: null] + * callback: | + * function callback(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.tag.getAll(function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function getAll(source, callback) { + if (arguments.length < 2 && typeof arguments[0] === "function") { + callback = source; + source = undefined; } - }; - client.request("GET", "/tags/hosts", params, callback); -} -/*section: tag - *comment: | - * get the host tags for a provided host name or host id - *params: - * hostname: | - * the hostname or host id - * options: - * | - * optional, an object of options for the query allowing the following - * * source: the source of the tags (e.g. chef, puppet, users, etc) [default: null] - * * by_source: whether or not to group the results by source [default: false] - * callback: | - * function callback(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.tag.get("host.name", function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function get(hostname, options, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = options; - options = {}; + const params = { + query: { + source: source + } + }; + client.request("GET", "/tags/hosts", params, callback); } - options = options || {}; - const params = { - query: { + /*section: tag + *comment: | + * get the host tags for a provided host name or host id + *params: + * hostname: | + * the hostname or host id + * options: + * | + * optional, an object of options for the query allowing the following + * * source: the source of the tags (e.g. chef, puppet, users, etc) [default: null] + * * by_source: whether or not to group the results by source [default: false] + * callback: | + * function callback(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.tag.get("host.name", function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function get(hostname, options, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = options; + options = {}; } - }; - if(options.source){ - params.query.source = options.source; - } - if(options.by_source){ - params.query.by_source = options.by_source; - } - client.request("GET", "/tags/hosts/" + hostname, params, callback); -}; + options = options || {}; - -/*section: tag - *comment: | - * assign new host tags to the provided host name or host id - *params: - * hostname: | - * the hostname or host id - * tags: | - * list of `<tag>:<value>` tags to assign to the server - * source: | - * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] - * callback: | - * function callback(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.tag.create("host.name", ["role:webserver"], function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function create(hostname, tags, source, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = source; - source = undefined; - } - - const params = { - body: { - tags: tags, - source: source - }, + const params = { + query: { + } + }; + if (options.source) { + params.query.source = options.source; + } + if (options.by_source) { + params.query.by_source = options.by_source; + } + client.request("GET", "/tags/hosts/" + hostname, params, callback); }; - client.request("POST", "/tags/hosts/" + hostname, params, callback); -}; + /*section: tag + *comment: | + * assign new host tags to the provided host name or host id + *params: + * hostname: | + * the hostname or host id + * tags: | + * list of `<tag>:<value>` tags to assign to the server + * source: | + * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] + * callback: | + * function callback(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.tag.create("host.name", ["role:webserver"], function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function create(hostname, tags, source, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = source; + source = undefined; + } -/*section: tag - *comment: | - * update the host tags for the provided host name or host id - *params: - * hostname: | - * the hostname or host id - * tags: | - * list of `<tag>:<value>` tags to assign to the server - * source: | - * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] - * callback: | - * function callback(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.tag.update("host.name", function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function update(hostname, tags, source, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = source; - source = undefined; - } + const params = { + body: { + tags: tags, + source: source + }, + }; - const params = { - body: { - tags: tags, - source: source - }, + client.request("POST", "/tags/hosts/" + hostname, params, callback); }; - client.request("PUT", "/tags/hosts/" + hostname, params, callback); -}; -/*section: tag - *comment: | - * delete the host tags for the provided host name or host id - *params: - * hostname: | - * the hostname or host id - * source: | - * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] - * callback: | - * function callback(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.tag.remove("host.name", function(err, results){ - * console.dir(results); - * }); - * ``` - */ -function remove(hostname, source, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = source; - source = undefined; - } - const params = { - query: { - source: source + /*section: tag + *comment: | + * update the host tags for the provided host name or host id + *params: + * hostname: | + * the hostname or host id + * tags: | + * list of `<tag>:<value>` tags to assign to the server + * source: | + * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] + * callback: | + * function callback(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.tag.update("host.name", function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function update(hostname, tags, source, callback) { + if (arguments.length < 4 && typeof arguments[2] === "function") { + callback = source; + source = undefined; } + + const params = { + body: { + tags: tags, + source: source + }, + }; + client.request("PUT", "/tags/hosts/" + hostname, params, callback); }; - client.request("DELETE", "/tags/hosts/" + hostname, params, callback); -}; -module.exports = { - _client: client, - getAll: getAll, - get: get, - create: create, - update: update, - remove: remove, - getUsage: function(){ - return [ - " dogapi tag getall [--source <source>]", - " dogapi tag get <host> [--source <source>] [--by-source]", - " dogapi tag remove <host> [--source <source>]", - " dogapi tag create <host> <tags> [--source <source>]", - " dogapi tag update <host> <tags> [--source <source>]" - ]; - }, - getHelp: function(){ - return [ - "Tag:", - " Subcommands:", - " getall get all tags", - " get <host> get all tags for a given host", - " remove <host> delete tags for a given host", - " create <host> <tags> add the comma separates \"tag:value\"'s from <tag> to <host>", - " update <host> <tags> update the comma separates \"tag:value\"'s from <tag> to <host>", - "", - " Options:", - " --source <source> the source of the tags (e.g. \"chef\", \"user\", \"jenkins\", etc)", - " --by-source whether the results should be grouped by source" - ]; - }, - handleCli: function(subcommand, args, callback){ - const source = args["source"]; - const host = args._[4]; + /*section: tag + *comment: | + * delete the host tags for the provided host name or host id + *params: + * hostname: | + * the hostname or host id + * source: | + * optional, the source of the tags (e.g. chef, puppet, etc) [default: users] + * callback: | + * function callback(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.tag.remove("host.name", function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function remove(hostname, source, callback) { + if (arguments.length < 3 && typeof arguments[1] === "function") { + callback = source; + source = undefined; + } - if(subcommand === "getall"){ - getAll(source, callback); - } else if(subcommand === "get"){ - const options = {}; - if(source){ - options.source = source; + const params = { + query: { + source: source } - if(args["by-source"]){ - options.by_source = true; + }; + client.request("DELETE", "/tags/hosts/" + hostname, params, callback); + }; + + return { + _client: client, + getAll: getAll, + get: get, + create: create, + update: update, + remove: remove, + getUsage: function () { + return [ + " dogapi tag getall [--source <source>]", + " dogapi tag get <host> [--source <source>] [--by-source]", + " dogapi tag remove <host> [--source <source>]", + " dogapi tag create <host> <tags> [--source <source>]", + " dogapi tag update <host> <tags> [--source <source>]" + ]; + }, + getHelp: function () { + return [ + "Tag:", + " Subcommands:", + " getall get all tags", + " get <host> get all tags for a given host", + " remove <host> delete tags for a given host", + " create <host> <tags> add the comma separates \"tag:value\"'s from <tag> to <host>", + " update <host> <tags> update the comma separates \"tag:value\"'s from <tag> to <host>", + "", + " Options:", + " --source <source> the source of the tags (e.g. \"chef\", \"user\", \"jenkins\", etc)", + " --by-source whether the results should be grouped by source" + ]; + }, + handleCli: function (subcommand, args, callback) { + const source = args["source"]; + const host = args._[4]; + + if (subcommand === "getall") { + getAll(source, callback); + } else if (subcommand === "get") { + const options = {}; + if (source) { + options.source = source; + } + if (args["by-source"]) { + options.by_source = true; + } + get(host, options, callback); + } else if (subcommand === "create") { + const tags = args._[5].split(","); + create(host, tags, source, callback); + } else if (subcommand === "update") { + const tags = args._[5].split(","); + update(host, tags, source, callback); + } else if (subcommand === "delete") { + remove(host, source, callback); + } else { + callback("unknown subcommand or arguments try `dogapi tag --help` for help", false); } - get(host, options, callback); - } else if(subcommand === "create"){ - const tags = args._[5].split(","); - create(host, tags, source, callback); - } else if(subcommand === "update"){ - const tags = args._[5].split(","); - update(host, tags, source, callback); - } else if(subcommand === "delete"){ - remove(host, source, callback); - } else { - callback("unknown subcommand or arguments try `dogapi tag --help` for help", false); } - } -} + }; +}; diff --git a/lib/api/timeboard.js b/lib/api/timeboard.js index 9dcf4c4..90ffee4 100644 --- a/lib/api/timeboard.js +++ b/lib/api/timeboard.js @@ -1,275 +1,276 @@ -const client = require("../client"); const json = require("../json"); const util = require("util"); -/*section: timeboard - *comment: add a new timeboard - *params: - * title: the title of the timeboard - * description: the description of the timeboard - * graphs: | - * an array of objects with the following keys - * * title: the name of the graph - * * definition: an object containing the graph definition, e.g. `{"requests": [{"q": "system.cpu.idle{*} by {host}"}` - * templateVariables: | - * optional, an array of objects with the following keys - * * name: the name of the variable - * * prefix: optional, the tag prefix for this variable - * * default: optional, the default value for this tag - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const title = "Time Keeps on Slipping"; - * const description = "Into the Future"; - * const graphs = [ - * { - * definition: { - * events: [], - * requests: [ - * {q: "avg:system.mem.free{*}"} - * ], - * viz: "timeseries" - * }, - * title: "Average Memory Free" - * } - * ]; - * const templateVariables = [ - * { - * name: "host1", - * prefix: "host", - * "default": "host:my-host" - * } - * ]; - * dogapi.timeboard.create( - * title, description, graphs, templateVariables, - * function(err, res){ - * console.dir(res); - * } - * ); - * ``` - */ -function create(title, description, graphs, templateVariables, callback){ - if(arguments.length < 5 && typeof arguments[3] === "function"){ - callback = templateVariables; - templateVariables = []; - } - - const params = { - body: { - title: title, - description: description, - graphs: graphs +module.exports = function (client) { + /*section: timeboard + *comment: add a new timeboard + *params: + * title: the title of the timeboard + * description: the description of the timeboard + * graphs: | + * an array of objects with the following keys + * * title: the name of the graph + * * definition: an object containing the graph definition, e.g. `{"requests": [{"q": "system.cpu.idle{*} by {host}"}` + * templateVariables: | + * optional, an array of objects with the following keys + * * name: the name of the variable + * * prefix: optional, the tag prefix for this variable + * * default: optional, the default value for this tag + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const title = "Time Keeps on Slipping"; + * const description = "Into the Future"; + * const graphs = [ + * { + * definition: { + * events: [], + * requests: [ + * {q: "avg:system.mem.free{*}"} + * ], + * viz: "timeseries" + * }, + * title: "Average Memory Free" + * } + * ]; + * const templateVariables = [ + * { + * name: "host1", + * prefix: "host", + * "default": "host:my-host" + * } + * ]; + * dogapi.timeboard.create( + * title, description, graphs, templateVariables, + * function(err, res){ + * console.dir(res); + * } + * ); + * ``` + */ + function create(title, description, graphs, templateVariables, callback) { + if (arguments.length < 5 && typeof arguments[3] === "function") { + callback = templateVariables; + templateVariables = []; } - }; - if(Array.isArray(templateVariables) && templateVariables.length){ - params.body.template_variables = templateVariables; - } - client.request("POST", "/dash", params, callback); -} + const params = { + body: { + title: title, + description: description, + graphs: graphs + } + }; + if (Array.isArray(templateVariables) && templateVariables.length) { + params.body.template_variables = templateVariables; + } -/*section: timeboard - *comment: update an existing timeboard - *params: - * dashId: the id of the timeboard to update - * title: the title of the timeboard - * description: the description of the timeboard - * graphs: | - * an array of objects with the following keys - * * title: the name of the graph - * * definition: an object containing the graph definition, e.g. `{"requests": [{"q": "system.cpu.idle{*} by {host}"}` - * templateVariables: | - * optional, an array of objects with the following keys - * * name: the name of the variable - * * prefix: optional, the tag prefix for this variable - * * default: optional, the default value for this tag - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const title = "Time Keeps on Slipping"; - * const description = "Into the Future"; - * const graphs = [ - * { - * definition: { - * events: [], - * requests: [ - * {q: "avg:system.mem.free{*}"} - * ], - * viz: "timeseries" - * }, - * title: "Average Memory Free" - * } - * ]; - * const templateVariables = [ - * { - * name: "host1", - * prefix: "host", - * default: "host:my-host" - * } - * ]; - * dogapi.timeboard.update( - * 1234, title, description, graphs, templateVariables, - * function(err, res){ - * console.dir(res); - * } - * ); - * ``` - */ -function update(dashId, title, description, graphs, templateVariables, callback){ - if(arguments.length < 6 && typeof arguments[4] === "function"){ - callback = templateVariables; - templateVariables = []; + client.request("POST", "/dash", params, callback); } - const params = { - body: { - title: title, - description: description, - graphs: graphs + /*section: timeboard + *comment: update an existing timeboard + *params: + * dashId: the id of the timeboard to update + * title: the title of the timeboard + * description: the description of the timeboard + * graphs: | + * an array of objects with the following keys + * * title: the name of the graph + * * definition: an object containing the graph definition, e.g. `{"requests": [{"q": "system.cpu.idle{*} by {host}"}` + * templateVariables: | + * optional, an array of objects with the following keys + * * name: the name of the variable + * * prefix: optional, the tag prefix for this variable + * * default: optional, the default value for this tag + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const title = "Time Keeps on Slipping"; + * const description = "Into the Future"; + * const graphs = [ + * { + * definition: { + * events: [], + * requests: [ + * {q: "avg:system.mem.free{*}"} + * ], + * viz: "timeseries" + * }, + * title: "Average Memory Free" + * } + * ]; + * const templateVariables = [ + * { + * name: "host1", + * prefix: "host", + * default: "host:my-host" + * } + * ]; + * dogapi.timeboard.update( + * 1234, title, description, graphs, templateVariables, + * function(err, res){ + * console.dir(res); + * } + * ); + * ``` + */ + function update(dashId, title, description, graphs, templateVariables, callback) { + if (arguments.length < 6 && typeof arguments[4] === "function") { + callback = templateVariables; + templateVariables = []; } - }; - if(Array.isArray(templateVariables) && templateVariables.length){ - params.body.template_variables = templateVariables; + + const params = { + body: { + title: title, + description: description, + graphs: graphs + } + }; + if (Array.isArray(templateVariables) && templateVariables.length) { + params.body.template_variables = templateVariables; + } + + client.request("PUT", util.format("/dash/%s", dashId), params, callback); } - client.request("PUT", util.format("/dash/%s", dashId), params, callback); -} + /*section: timeboard + *comment: remove an existing timeboard + *params: + * dashId: the id of the timeboard to remove + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.timeboard.remove(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function remove(dashId, callback) { + client.request("DELETE", util.format("/dash/%s", dashId), {}, callback); + } -/*section: timeboard - *comment: remove an existing timeboard - *params: - * dashId: the id of the timeboard to remove - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.timeboard.remove(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function remove(dashId, callback){ - client.request("DELETE", util.format("/dash/%s", dashId), {}, callback); -} + /*section: timeboard + *comment: get all existing timeboards + *params: + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.timeboard.getAll(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function getAll(callback) { + client.request("GET", "/dash", {}, callback); + } -/*section: timeboard - *comment: get all existing timeboards - *params: - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.timeboard.getAll(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function getAll(callback){ - client.request("GET", "/dash", {}, callback); -} + /*section: timeboard + *comment: get an existing timeboard + *params: + * dashId: the id of the timeboard to get + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.timeboard.get(1234, function(err, res){ + * console.dir(res); + * }); + * ``` + */ + function get(dashId, callback) { + client.request("GET", util.format("/dash/%s", dashId), {}, callback); + } -/*section: timeboard - *comment: get an existing timeboard - *params: - * dashId: the id of the timeboard to get - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.timeboard.get(1234, function(err, res){ - * console.dir(res); - * }); - * ``` - */ -function get(dashId, callback){ - client.request("GET", util.format("/dash/%s", dashId), {}, callback); -} + return { + create: create, + update: update, + remove: remove, + getAll: getAll, + get: get, + getUsage: function () { + return [ + " dogapi timeboard get <dash-id>", + " dogapi timeboard getall", + " dogapi timeboard remove <dash-id>", + " dogapi timeboard create <title> <description> <graphs> [--tmpvars <templateVariables>]", + " dogapi timeboard update <dash-id> <title> <description> <graphs> [--tmpvars <templateVariables>]", + ]; + }, + getHelp: function () { + return [ + "Timeboard:", + " Subcommands:", + " get <dash-id> get an existing timeboard", + " getall get all existing timeboards", + " remove <dash-id> remove an existing timeboard", + " create <title> <description> <graphs> create a new timeboard, <graphs> is a json of the graphs definition", + " update <dash-id> <title> <description> <graphs> update an existing timeboard, <graphs> is a json of the graphs definition", + " Options:", + " --tmpvars <templateVariables> a json representation of the template variables definition" + ]; + }, + handleCli: function (subcommand, args, callback) { + if (subcommand === "get") { + get(args._[4], callback); + } else if (subcommand === "getall") { + getAll(callback); + } else if (subcommand === "remove") { + remove(args._[4], callback); + } else if (subcommand === "create") { + const title = args._[4]; + const description = args._[5]; + const graphs = json.parse(args._[6]); + const templateVariables = []; + if (args["tmpvars"]) { + templateVariables = json.parse(args["tmpvars"]); + } -module.exports = { - create: create, - update: update, - remove: remove, - getAll: getAll, - get: get, - getUsage: function(){ - return [ - " dogapi timeboard get <dash-id>", - " dogapi timeboard getall", - " dogapi timeboard remove <dash-id>", - " dogapi timeboard create <title> <description> <graphs> [--tmpvars <templateVariables>]", - " dogapi timeboard update <dash-id> <title> <description> <graphs> [--tmpvars <templateVariables>]", - ]; - }, - getHelp: function(){ - return [ - "Timeboard:", - " Subcommands:", - " get <dash-id> get an existing timeboard", - " getall get all existing timeboards", - " remove <dash-id> remove an existing timeboard", - " create <title> <description> <graphs> create a new timeboard, <graphs> is a json of the graphs definition", - " update <dash-id> <title> <description> <graphs> update an existing timeboard, <graphs> is a json of the graphs definition", - " Options:", - " --tmpvars <templateVariables> a json representation of the template variables definition" - ]; - }, - handleCli: function(subcommand, args, callback){ - if(subcommand === "get"){ - get(args._[4], callback); - } else if(subcommand === "getall"){ - getAll(callback); - } else if(subcommand === "remove"){ - remove(args._[4], callback); - } else if(subcommand === "create"){ - const title = args._[4]; - const description = args._[5]; - const graphs = json.parse(args._[6]); - const templateVariables = []; - if(args["tmpvars"]){ - templateVariables = json.parse(args["tmpvars"]); - } + create(title, description, graphs, templateVariables, callback); + } else if (subcommand === "update") { + const dashId = parseInt(args._[4]); + const title = args._[5]; + const description = args._[6]; + const graphs = json.parse(args._[7]); + const templateVariables = []; + if (args["tmpvars"]) { + templateVariables = json.parse(args["tmpvars"]); + } - create(title, description, graphs, templateVariables, callback); - } else if(subcommand === "update"){ - const dashId = parseInt(args._[4]); - const title = args._[5]; - const description = args._[6]; - const graphs = json.parse(args._[7]); - const templateVariables = []; - if(args["tmpvars"]){ - templateVariables = json.parse(args["tmpvars"]); + update(dashId, title, description, graphs, templateVariables, callback); + } else { + callback("unknown subcommand or arguments try `dogapi timeboard --help` for help", false); } - - update(dashId, title, description, graphs, templateVariables, callback); - } else { - callback("unknown subcommand or arguments try `dogapi timeboard --help` for help", false); } - } + }; }; diff --git a/lib/api/user.js b/lib/api/user.js index 1c45a33..6e426d8 100644 --- a/lib/api/user.js +++ b/lib/api/user.js @@ -1,48 +1,49 @@ -const client = require("../client"); +module.exports = function (client) { -/*section: user - *comment: invite users via e-mail - *params: - * emails: an array of email addresses to send invites to - * callback: function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * const emails = ["me@domain.com", "you@domain.com"]; - * dogapi.user.invite(emails, fuction(err, res){ - * console.dir(res): - * }); - * ``` - */ -function invite(emails, callback){ - const params = { - body: { - emails: emails - } + /*section: user + *comment: invite users via e-mail + *params: + * emails: an array of email addresses to send invites to + * callback: function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * const emails = ["me@domain.com", "you@domain.com"]; + * dogapi.user.invite(emails, fuction(err, res){ + * console.dir(res): + * }); + * ``` + */ + function invite(emails, callback) { + const params = { + body: { + emails: emails + } + }; + client.request("POST", "/invite_users", params, callback); }; - client.request("POST", "/invite_users", params, callback); -}; -module.exports = { - invite: invite, - getUsage: function(){ - return [ - " dogapi user invite <address>..." - ]; - }, - getHelp: function(){ - return [ - "User:", - " Subcommands:", - " invite <address>... invite the given list of e-mail addresses to your datadog org" - ]; - }, - handleCli: function(subcommand, args, callback){ - invite(args._.slice(4), callback) - } + return { + invite: invite, + getUsage: function () { + return [ + " dogapi user invite <address>..." + ]; + }, + getHelp: function () { + return [ + "User:", + " Subcommands:", + " invite <address>... invite the given list of e-mail addresses to your datadog org" + ]; + }, + handleCli: function (subcommand, args, callback) { + invite(args._.slice(4), callback) + } + }; }; diff --git a/lib/client.js b/lib/client.js index 6f2e28e..79aa338 100644 --- a/lib/client.js +++ b/lib/client.js @@ -12,13 +12,13 @@ const json = require("./json"); *example: | * See [client.request](#client-request) */ -var client = function(){ - this.api_key = null; - this.app_key = null; - this.proxy_agent = null; - this.http_options = null; - this.api_version = "v1"; - this.api_host = "app.datadoghq.com"; +const DatadogMetricClient = function(options){ + this.api_key = options.api_key || null; + this.app_key = options.app_key || null; + this.proxy_agent = options.proxy_agent || null; + this.http_options = options.http_options || null; + this.api_version = options.api_version || "v1"; + this.api_host = options.api_host || "app.datadoghq.com"; }; /*section: client @@ -46,7 +46,7 @@ var client = function(){ * }); * ``` */ -client.prototype.request = function(method, path, params, callback){ +DatadogMetricClient.prototype.request = function(method, path, params, callback){ if(arguments.length === 3 && typeof arguments[2] === "function"){ callback = arguments[2]; params = {body: ''}; // create params with empty body property @@ -129,4 +129,4 @@ client.prototype.request = function(method, path, params, callback){ req.end() }; -module.exports = new client(); +module.exports = DatadogMetricClient; diff --git a/lib/index.js b/lib/index.js index 9e4ef18..e0007bb 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,4 +1,6 @@ -require("./api")(module.exports); +const _ = require('lodash') +const api = require("./api").api; +const Client = require("./client"); /*section: dogapi *comment: configure the dogapi client with your app/api keys @@ -45,6 +47,13 @@ function initialize(options){ } }; +function DogApi(options) { + const client = new Client(options || {}); + _.forEach(api, (value, key) => { + this[key] = value(client) + }); +} + /*section: dogapi *comment: get the current POSIX timestamp *example: | @@ -58,8 +67,7 @@ function initialize(options){ function now(){ return parseInt(new Date().getTime() / 1000); }; - -module.exports.client = require("./client"), +module.exports = DogApi module.exports.initialize = initialize; module.exports.now = now; module.exports.OK = 0; diff --git a/test/api/embed.js b/test/api/embed.js index 3de5296..6cf9bff 100644 --- a/test/api/embed.js +++ b/test/api/embed.js @@ -1,12 +1,14 @@ -var assert = require("assert"); -var client = require("../../lib/client"); -var extend = require("extend"); -var embed = require("../../lib/api/embed"); -var sinon = require("sinon"); -var querystring = require("querystring"); +const assert = require("assert"); +const Client = require("../../lib/client"); +const extend = require("extend"); +const Embed = require("../../lib/api/embed"); +const sinon = require("sinon"); +const querystring = require("querystring"); describe("api/embed", function(){ - var stub_request; + const client = new Client({}); + const embed = Embed(client); + let stub_request; beforeEach(function(){ // Setup `client.request` as a stub stub_request = sinon.stub(client, "request"); @@ -18,7 +20,7 @@ describe("api/embed", function(){ }); describe("#create", function(){ it("should make a valid api call", function(){ - var graphJSON = { + const graphJSON = { viz: "timeseries", requests: [ { @@ -26,7 +28,7 @@ describe("api/embed", function(){ } ] }; - var options = { + const options = { timeframe: "1_hour", size: "large", legend: "yes", @@ -38,14 +40,14 @@ describe("api/embed", function(){ // Assert we properly called `client.request` assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; + const call_args = stub_request.getCall(0).args; // Method and endpoint are correct assert.equal(call_args[0], "POST"); assert.equal(call_args[1], "/graph/embed"); // Properly formatted body and content-type - var params = call_args[2]; - var expectedBody = { + const params = call_args[2]; + const expectedBody = { graph_json: JSON.stringify(graphJSON), timeframe: "1_hour", size: "large", @@ -57,7 +59,7 @@ describe("api/embed", function(){ }); it("should only require graph_json", function(){ - var graphJSON = { + const graphJSON = { viz: "timeseries", requests: [ { @@ -71,11 +73,11 @@ describe("api/embed", function(){ // Assert we properly called `client.request` assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; + const call_args = stub_request.getCall(0).args; // Properly formatted body - var params = call_args[2]; - var expectedBody = { + const params = call_args[2]; + const expectedBody = { graph_json: JSON.stringify(graphJSON) }; assert.deepEqual(querystring.parse(params.body), expectedBody); diff --git a/test/api/metric.js b/test/api/metric.js index dd00ed8..0bbc432 100644 --- a/test/api/metric.js +++ b/test/api/metric.js @@ -1,10 +1,12 @@ -var assert = require("assert"); -var client = require("../../lib/client"); -var extend = require("extend"); -var metric = require("../../lib/api/metric"); -var sinon = require("sinon"); +const assert = require("assert"); +const Client = require("../../lib/client"); +const extend = require("extend"); +const Metric = require("../../lib/api/metric"); +const sinon = require("sinon"); describe("api/metrics", function(){ + const client = new Client({}); + const metric = Metric(client); var stub_request; beforeEach(function(){ // Setup `client.request` as a stub From 9c26fa96713f9aebcffa45b774303f91af51c107 Mon Sep 17 00:00:00 2001 From: AdrieanKhisbe <adriean.khisbe@live.fr> Date: Fri, 1 Mar 2019 18:12:33 +0100 Subject: [PATCH 03/24] Add some tweaks methods to keep initial api working :hammer_and_pick: --- lib/api/index.js | 10 +--------- lib/index.js | 19 ++++++++++++------- 2 files changed, 13 insertions(+), 16 deletions(-) diff --git a/lib/api/index.js b/lib/api/index.js index 41a315b..cc81266 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -1,4 +1,4 @@ -const api = { +module.exports = { comment: require("./comment"), downtime: require("./downtime"), embed: require("./embed"), @@ -15,11 +15,3 @@ const api = { timeboard: require("./timeboard"), user: require("./user"), }; - -module.exports = function(obj){ - for(const key in api){ - obj[key] = api[key]; - } -}; - -module.exports.api = api; diff --git a/lib/index.js b/lib/index.js index e0007bb..8e1266b 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,8 @@ -const _ = require('lodash') -const api = require("./api").api; +const _ = require('lodash'); +const api = require("./api"); const Client = require("./client"); +const initialClient = new Client({}) /*section: dogapi *comment: configure the dogapi client with your app/api keys *params: @@ -41,8 +42,8 @@ const Client = require("./client"); function initialize(options){ options = options || {}; for(var key in options){ - if(module.exports.client.hasOwnProperty(key)){ - module.exports.client[key] = options[key]; + if(initialClient.hasOwnProperty(key)){ + initialClient[key] = options[key]; } } }; @@ -50,10 +51,15 @@ function initialize(options){ function DogApi(options) { const client = new Client(options || {}); _.forEach(api, (value, key) => { - this[key] = value(client) + this[key] = value(client); }); } +DogApi.initialize = initialize; +_.forEach(api, (value, key) => { + DogApi[key] = value(initialClient); +}); + /*section: dogapi *comment: get the current POSIX timestamp *example: | @@ -67,8 +73,7 @@ function DogApi(options) { function now(){ return parseInt(new Date().getTime() / 1000); }; -module.exports = DogApi -module.exports.initialize = initialize; +module.exports = DogApi; module.exports.now = now; module.exports.OK = 0; module.exports.WARNING = 1; From 07613ae064c11d234737a6bfffb32fc8b61d8bc6 Mon Sep 17 00:00:00 2001 From: AdrieanKhisbe <adriean.khisbe@live.fr> Date: Fri, 1 Mar 2019 18:14:21 +0100 Subject: [PATCH 04/24] Add two examples file with the original and new api :bookmark_tabs: --- examples/new-interface.js | 10 ++++++++++ examples/original-interface.js | 10 ++++++++++ 2 files changed, 20 insertions(+) create mode 100644 examples/new-interface.js create mode 100644 examples/original-interface.js diff --git a/examples/new-interface.js b/examples/new-interface.js new file mode 100644 index 0000000..7fd6cb6 --- /dev/null +++ b/examples/new-interface.js @@ -0,0 +1,10 @@ +var Dogapi = require("../lib"); + +var options = { + api_key: "YOUR_KEY_HERE", + app_key: "YOUR_KEY_HERE", +}; + +const dogapi = new Dogapi(options); + +dogapi.metric.send('test', 1) \ No newline at end of file diff --git a/examples/original-interface.js b/examples/original-interface.js new file mode 100644 index 0000000..c1e9e8c --- /dev/null +++ b/examples/original-interface.js @@ -0,0 +1,10 @@ +var dogapi = require("../lib"); + +var options = { + api_key: "YOUR_KEY_HERE", + app_key: "YOUR_KEY_HERE", +}; + +dogapi.initialize(options); + +dogapi.metric.send('test', 1) \ No newline at end of file From e50186817510f217f1acc3b966966ceab189fa62 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 08:19:39 +0100 Subject: [PATCH 05/24] Set up linting configuration :gear: --- .eslintignore | 2 + .eslintrc | 39 + package-lock.json | 2396 +++++++++++++++++++++++++++++++++++++++++---- package.json | 3 + 4 files changed, 2244 insertions(+), 196 deletions(-) create mode 100644 .eslintignore create mode 100644 .eslintrc diff --git a/.eslintignore b/.eslintignore new file mode 100644 index 0000000..7517ec0 --- /dev/null +++ b/.eslintignore @@ -0,0 +1,2 @@ +node_modules/ +test/coverage/ diff --git a/.eslintrc b/.eslintrc new file mode 100644 index 0000000..0522bf4 --- /dev/null +++ b/.eslintrc @@ -0,0 +1,39 @@ +{ + "env": { + "commonjs": true, + "es6": true, + "node": true + }, + "extends": [ + "plugin:@coorpacademy/coorpacademy/core", + "plugin:@coorpacademy/coorpacademy/mocha", + "plugin:@coorpacademy/coorpacademy/es20XX", + "plugin:@coorpacademy/coorpacademy/lodash-fp", + "plugin:@coorpacademy/coorpacademy/prettier" + ], + "parserOptions": { + "ecmaVersion": 2017, + "sourceType": "module" + }, + "plugins": [ + "@coorpacademy/coorpacademy" + ], + "rules": { + "promise/no-native": "off", + "strict": "off" + }, + "overrides": [ + { + "files": [ "scripts/migrate*.js", "lib/*.js" ], + "env": { + "mongo": true + } + }, + { + "files": ["**/test/**"], + "rules": { + "unicorn/filename-case": "off" + } + } + ] +} diff --git a/package-lock.json b/package-lock.json index ab42da1..e03ff91 100644 --- a/package-lock.json +++ b/package-lock.json @@ -4,15 +4,274 @@ "lockfileVersion": 1, "requires": true, "dependencies": { + "@babel/code-frame": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", + "integrity": "sha512-cuAuTTIQ9RqcFRJ/Y8PvTh+paepNcaGxwQwjIDRWPXmzzyAeCO4KqS9ikMvq0MCbRk6GlYKwfzStrcP3/jSL8g==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0-beta.44" + } + }, + "@babel/generator": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", + "integrity": "sha512-5xVb7hlhjGcdkKpMXgicAVgx8syK5VJz193k0i/0sLP6DzE6lRrU1K3B/rFefgdo9LPGMAOOOAWW4jycj07ShQ==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44", + "jsesc": "2.5.2", + "lodash": "4.17.10", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", + "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.44", + "@babel/template": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", + "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", + "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/highlight": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0-beta.44.tgz", + "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "esutils": "2.0.2", + "js-tokens": "3.0.2" + } + }, + "@babel/template": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", + "integrity": "sha512-w750Sloq0UNifLx1rUqwfbnC6uSUk0mfwwgGRfdLiaUzfAOiH0tHJE6ILQIUi3KYkjiCDTskoIsnfqZvWLBDng==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "lodash": "4.17.10" + } + }, + "@babel/traverse": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.0.0-beta.44.tgz", + "integrity": "sha512-UHuDz8ukQkJCDASKHf+oDt3FVUzFd+QYfuBIsiNu/4+/ix6pP/C+uQZJ6K1oEfbCMv/IKWbgDEh7fcsnIE5AtA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/generator": "7.0.0-beta.44", + "@babel/helper-function-name": "7.0.0-beta.44", + "@babel/helper-split-export-declaration": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "debug": "3.1.0", + "globals": "11.11.0", + "invariant": "2.2.4", + "lodash": "4.17.10" + } + }, + "@babel/types": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.0.0-beta.44.tgz", + "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", + "dev": true, + "requires": { + "esutils": "2.0.2", + "lodash": "4.17.10", + "to-fast-properties": "2.0.0" + } + }, + "@coorpacademy/eslint-plugin-coorpacademy": { + "version": "8.1.1", + "resolved": "https://registry.npmjs.org/@coorpacademy/eslint-plugin-coorpacademy/-/eslint-plugin-coorpacademy-8.1.1.tgz", + "integrity": "sha1-9PoNOWyVSdEaAYZXHhBvF0rLF0s=", + "dev": true, + "requires": { + "babel-eslint": "8.2.6", + "eslint-ast-utils": "1.1.0", + "eslint-config-prettier": "2.10.0", + "eslint-plugin-ava": "4.5.1", + "eslint-plugin-css-modules": "2.11.0", + "eslint-plugin-flowtype": "2.50.3", + "eslint-plugin-flowtype-errors": "3.6.0", + "eslint-plugin-fp": "2.3.0", + "eslint-plugin-import": "2.16.0", + "eslint-plugin-json": "1.4.0", + "eslint-plugin-lodash-fp": "2.1.3", + "eslint-plugin-mocha": "4.12.1", + "eslint-plugin-prettier": "2.7.0", + "eslint-plugin-promise": "3.8.0", + "eslint-plugin-react": "7.12.4", + "eslint-plugin-unicorn": "4.0.3", + "lodash": "4.17.10", + "prettier": "1.11.1", + "requireindex": "1.2.0" + } + }, + "acorn": { + "version": "5.7.3", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", + "integrity": "sha512-T/zvzYRfbVojPWahDsE5evJdHb3oJoQfFbsrKM7w5Zcs++Tr257tia3BmMP8XYVjp1S9RZXQMh7gao96BlqZOw==", + "dev": true + }, + "acorn-jsx": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-3.0.1.tgz", + "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", + "dev": true, + "requires": { + "acorn": "3.3.0" + }, + "dependencies": { + "acorn": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-3.3.0.tgz", + "integrity": "sha1-ReN/s56No/JbruP/U2niu18iAXo=", + "dev": true + } + } + }, + "ajv": { + "version": "6.10.0", + "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", + "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", + "dev": true, + "requires": { + "fast-deep-equal": "2.0.1", + "fast-json-stable-stringify": "2.0.0", + "json-schema-traverse": "0.4.1", + "uri-js": "4.2.2" + } + }, + "ansi-escapes": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-3.2.0.tgz", + "integrity": "sha512-cBhpre4ma+U0T1oM5fXg7Dy1Jw7zzwv7lt/GoCpr+hDQJoYnKVPLL4dCvSEFMmQurOQvSrwT7SL/DAlhBI97RQ==", + "dev": true + }, + "ansi-regex": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-3.0.0.tgz", + "integrity": "sha1-7QMXwyIGT3lGbAKWa922Bas32Zg=", + "dev": true + }, + "ansi-styles": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-3.2.1.tgz", + "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", + "dev": true, + "requires": { + "color-convert": "1.9.3" + } + }, "argparse": { "version": "1.0.10", "resolved": "https://registry.npmjs.org/argparse/-/argparse-1.0.10.tgz", "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "~1.0.2" + "sprintf-js": "1.0.3" } }, + "array-differ": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", + "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", + "dev": true + }, + "array-includes": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", + "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", + "dev": true, + "requires": { + "define-properties": "1.1.3", + "es-abstract": "1.13.0" + } + }, + "array-union": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-1.0.2.tgz", + "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", + "dev": true, + "requires": { + "array-uniq": "1.0.3" + } + }, + "array-uniq": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-1.0.3.tgz", + "integrity": "sha1-r2rId6Jcx/dOBYiUdThY39sk/bY=", + "dev": true + }, + "arrify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-1.0.1.tgz", + "integrity": "sha1-iYUI2iIm84DfkEcoRWhJwVAaSw0=", + "dev": true + }, + "astral-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/astral-regex/-/astral-regex-1.0.0.tgz", + "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", + "dev": true + }, + "babel-eslint": { + "version": "8.2.6", + "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz", + "integrity": "sha512-aCdHjhzcILdP8c9lej7hvXKvQieyRt20SF102SIGyY4cUIiw6UaAtK4j2o3dXX74jEmy0TJ0CEhv4fTIM3SzcA==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0-beta.44", + "@babel/traverse": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44", + "babylon": "7.0.0-beta.44", + "eslint-scope": "3.7.1", + "eslint-visitor-keys": "1.0.0" + } + }, + "babel-runtime": { + "version": "6.26.0", + "resolved": "https://registry.npmjs.org/babel-runtime/-/babel-runtime-6.26.0.tgz", + "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", + "dev": true, + "requires": { + "core-js": "2.6.5", + "regenerator-runtime": "0.11.1" + } + }, + "babylon": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/babylon/-/babylon-7.0.0-beta.44.tgz", + "integrity": "sha512-5Hlm13BJVAioCHpImtFqNOF2H3ieTOHd0fmFGMxOJ9jgeFqeAwsv3u5P5cR7CSeFrkgHsT19DgFJkHV0/Mcd8g==", + "dev": true + }, "balanced-match": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.0.tgz", @@ -31,7 +290,7 @@ "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "^1.0.0", + "balanced-match": "1.0.0", "concat-map": "0.0.1" } }, @@ -41,6 +300,74 @@ "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", "dev": true }, + "buf-compare": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", + "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", + "dev": true + }, + "callsites": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/callsites/-/callsites-3.0.0.tgz", + "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", + "dev": true + }, + "chalk": { + "version": "2.4.2", + "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", + "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "escape-string-regexp": "1.0.5", + "supports-color": "5.4.0" + } + }, + "chardet": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/chardet/-/chardet-0.7.0.tgz", + "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", + "dev": true + }, + "clean-regexp": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", + "integrity": "sha1-jffHquUf02h06PjQW5GAvBGj/tc=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "cli-cursor": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", + "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", + "dev": true, + "requires": { + "restore-cursor": "2.0.0" + } + }, + "cli-width": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-width/-/cli-width-2.2.0.tgz", + "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", + "dev": true + }, + "color-convert": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", + "integrity": "sha512-QfAUtd+vFdAtFQcC8CCyYt1fYWxSqAiK2cSD6zDB8N3cpsEBAvRxp9zOGg6G/SHHJYAT88/az/IuDGALsNVbGg==", + "dev": true, + "requires": { + "color-name": "1.1.3" + } + }, + "color-name": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.3.tgz", + "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", + "dev": true + }, "commander": { "version": "2.15.1", "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", @@ -53,6 +380,50 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "contains-path": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", + "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", + "dev": true + }, + "core-assert": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", + "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", + "dev": true, + "requires": { + "buf-compare": "1.0.1", + "is-error": "2.2.1" + } + }, + "core-js": { + "version": "2.6.5", + "resolved": "https://registry.npmjs.org/core-js/-/core-js-2.6.5.tgz", + "integrity": "sha512-klh/kDpwX8hryYL14M9w/xei6vrv6sE8gTHDG7/T/+SEovB/G4ejwcfE/CBzO6Edsu+OETZMZ3wcX/EjUkrl5A==", + "dev": true + }, + "create-eslint-index": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/create-eslint-index/-/create-eslint-index-1.0.0.tgz", + "integrity": "sha1-2VQ3LYbVeS/NZ+nyt5GxqxYkEbs=", + "dev": true, + "requires": { + "lodash.get": "4.4.2" + } + }, + "cross-spawn": { + "version": "6.0.5", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-6.0.5.tgz", + "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", + "dev": true, + "requires": { + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.6.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + }, "debug": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/debug/-/debug-3.1.0.tgz", @@ -67,6 +438,30 @@ "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", "integrity": "sha512-LOHxIOaPYdHlJRtCQfDIVZtfw/ufM8+rVj649RIHzcm/vGwQRXFt6OPqIFWsm2XEMrNIEtWR64sY1LEKD2vAOA==" }, + "deep-is": { + "version": "0.1.3", + "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.3.tgz", + "integrity": "sha1-s2nW+128E+7PUk+RsHD+7cNXzzQ=", + "dev": true + }, + "deep-strict-equal": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/deep-strict-equal/-/deep-strict-equal-0.2.0.tgz", + "integrity": "sha1-SgeBR6irV/ag1PVUckPNIvROtOQ=", + "dev": true, + "requires": { + "core-assert": "0.2.1" + } + }, + "define-properties": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", + "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", + "dev": true, + "requires": { + "object-keys": "1.1.0" + } + }, "diff": { "version": "3.5.0", "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", @@ -79,8 +474,8 @@ "integrity": "sha1-+vMVSf8ME5RIbd8BLKqxeI1zcIU=", "dev": true, "requires": { - "docopt": "^0.4.1", - "esprima": "^1.2.3" + "docopt": "0.4.1", + "esprima": "1.2.5" }, "dependencies": { "docopt": { @@ -97,273 +492,1635 @@ } } }, + "doctrine": { + "version": "1.5.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-1.5.0.tgz", + "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", + "dev": true, + "requires": { + "esutils": "2.0.2", + "isarray": "1.0.0" + } + }, + "emoji-regex": { + "version": "7.0.3", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", + "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", + "dev": true + }, + "enhance-visitors": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/enhance-visitors/-/enhance-visitors-1.0.0.tgz", + "integrity": "sha1-qpRdBdpGVnKh69OP7i7T2oUY6Vo=", + "dev": true, + "requires": { + "lodash": "4.17.10" + } + }, + "error-ex": { + "version": "1.3.2", + "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", + "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es-abstract": { + "version": "1.13.0", + "resolved": "https://registry.npmjs.org/es-abstract/-/es-abstract-1.13.0.tgz", + "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", + "dev": true, + "requires": { + "es-to-primitive": "1.2.0", + "function-bind": "1.1.1", + "has": "1.0.3", + "is-callable": "1.1.4", + "is-regex": "1.0.4", + "object-keys": "1.1.0" + } + }, + "es-to-primitive": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/es-to-primitive/-/es-to-primitive-1.2.0.tgz", + "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", + "dev": true, + "requires": { + "is-callable": "1.1.4", + "is-date-object": "1.0.1", + "is-symbol": "1.0.2" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", "dev": true }, - "extend": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", - "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=" - }, - "fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", - "dev": true - }, - "glob": { - "version": "6.0.4", - "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", - "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "eslint": { + "version": "5.15.1", + "resolved": "https://registry.npmjs.org/eslint/-/eslint-5.15.1.tgz", + "integrity": "sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg==", "dev": true, "requires": { - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "2 || 3", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "@babel/code-frame": "7.0.0", + "ajv": "6.10.0", + "chalk": "2.4.2", + "cross-spawn": "6.0.5", + "debug": "4.1.1", + "doctrine": "3.0.0", + "eslint-scope": "4.0.2", + "eslint-utils": "1.3.1", + "eslint-visitor-keys": "1.0.0", + "espree": "5.0.1", + "esquery": "1.0.1", + "esutils": "2.0.2", + "file-entry-cache": "5.0.1", + "functional-red-black-tree": "1.0.1", + "glob": "7.1.3", + "globals": "11.11.0", + "ignore": "4.0.6", + "import-fresh": "3.0.0", + "imurmurhash": "0.1.4", + "inquirer": "6.2.2", + "js-yaml": "3.12.2", + "json-stable-stringify-without-jsonify": "1.0.1", + "levn": "0.3.0", + "lodash": "4.17.11", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "natural-compare": "1.4.0", + "optionator": "0.8.2", + "path-is-inside": "1.0.2", + "progress": "2.0.3", + "regexpp": "2.0.1", + "semver": "5.6.0", + "strip-ansi": "4.0.0", + "strip-json-comments": "2.0.1", + "table": "5.2.3", + "text-table": "0.2.0" }, "dependencies": { - "inflight": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", - "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=", + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" - }, - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=", - "dev": true - } + "@babel/highlight": "7.0.0" } }, - "inherits": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", - "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "esutils": "2.0.2", + "js-tokens": "4.0.0" + } + }, + "acorn": { + "version": "6.1.1", + "resolved": "https://registry.npmjs.org/acorn/-/acorn-6.1.1.tgz", + "integrity": "sha512-jPTiwtOxaHNaAPg/dmrJ/beuzLRnXtB0kQPQ8JpotKJgTB6rX6c8mlf315941pyjBSaPg8NHXS9fhP4u17DpGA==", "dev": true }, - "once": { - "version": "1.3.3", - "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", - "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "acorn-jsx": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/acorn-jsx/-/acorn-jsx-5.0.1.tgz", + "integrity": "sha512-HJ7CfNHrfJLlNTzIEUTj43LNWGkqpRLxm3YjAlcD0ACydk9XynzYsCBHxut+iqt+1aBXkx9UP/w/ZqMr13XIzg==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "wrappy": "1" - }, - "dependencies": { - "wrappy": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", - "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=", - "dev": true - } + "ms": "2.1.1" } }, - "path-is-absolute": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", - "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=", + "doctrine": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-3.0.0.tgz", + "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + }, + "eslint-scope": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-4.0.2.tgz", + "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "espree": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/espree/-/espree-5.0.1.tgz", + "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", + "dev": true, + "requires": { + "acorn": "6.1.1", + "acorn-jsx": "5.0.1", + "eslint-visitor-keys": "1.0.0" + } + }, + "glob": { + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", "dev": true - } - } - }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + }, + "js-yaml": { + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, + "eslint-ast-utils": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/eslint-ast-utils/-/eslint-ast-utils-1.1.0.tgz", + "integrity": "sha512-otzzTim2/1+lVrlH19EfQQJEhVJSu0zOb9ygb3iapN6UlyaDtyRq4b5U1FuW0v1lRa9Fp/GJyHkSwm6NqABgCA==", + "dev": true, + "requires": { + "lodash.get": "4.4.2", + "lodash.zip": "4.2.0" + } + }, + "eslint-config-prettier": { + "version": "2.10.0", + "resolved": "https://registry.npmjs.org/eslint-config-prettier/-/eslint-config-prettier-2.10.0.tgz", + "integrity": "sha512-Mhl90VLucfBuhmcWBgbUNtgBiK955iCDK1+aHAz7QfDQF6wuzWZ6JjihZ3ejJoGlJWIuko7xLqNm8BA5uenKhA==", + "dev": true, + "requires": { + "get-stdin": "5.0.1" + } + }, + "eslint-import-resolver-node": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/eslint-import-resolver-node/-/eslint-import-resolver-node-0.3.2.tgz", + "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", + "dev": true, + "requires": { + "debug": "2.6.9", + "resolve": "1.10.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-module-utils": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-module-utils/-/eslint-module-utils-2.3.0.tgz", + "integrity": "sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==", + "dev": true, + "requires": { + "debug": "2.6.9", + "pkg-dir": "2.0.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + } + } + }, + "eslint-plugin-ava": { + "version": "4.5.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-ava/-/eslint-plugin-ava-4.5.1.tgz", + "integrity": "sha512-V0+QZkTYoEXAp8fojaoD85orqNgGfyHWpwQEUqVIRGCRsX9BFnKbG2eX875NgciF3Aouq7smOZcLYqQKgAyH7w==", + "dev": true, + "requires": { + "arrify": "1.0.1", + "deep-strict-equal": "0.2.0", + "enhance-visitors": "1.0.0", + "espree": "3.5.4", + "espurify": "1.8.1", + "import-modules": "1.1.0", + "multimatch": "2.1.0", + "pkg-up": "2.0.0" + } + }, + "eslint-plugin-css-modules": { + "version": "2.11.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-css-modules/-/eslint-plugin-css-modules-2.11.0.tgz", + "integrity": "sha512-CLvQvJOMlCywZzaI4HVu7QH/ltgNXvCg7giJGiE+sA9wh5zQ+AqTgftAzrERV22wHe1p688wrU/Zwxt1Ry922w==", + "dev": true, + "requires": { + "gonzales-pe": "4.2.3", + "lodash": "4.17.10" + } + }, + "eslint-plugin-flowtype": { + "version": "2.50.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype/-/eslint-plugin-flowtype-2.50.3.tgz", + "integrity": "sha512-X+AoKVOr7Re0ko/yEXyM5SSZ0tazc6ffdIOocp2fFUlWoDt7DV0Bz99mngOkAFLOAWjqRA5jPwqUCbrx13XoxQ==", + "dev": true, + "requires": { + "lodash": "4.17.10" + } + }, + "eslint-plugin-flowtype-errors": { + "version": "3.6.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-flowtype-errors/-/eslint-plugin-flowtype-errors-3.6.0.tgz", + "integrity": "sha1-V4KZQmHpJa7RMgYwFGY26I5K1VM=", + "dev": true, + "requires": { + "babel-runtime": "6.26.0", + "slash": "2.0.0" + } + }, + "eslint-plugin-fp": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-fp/-/eslint-plugin-fp-2.3.0.tgz", + "integrity": "sha1-N20qEIcQ6YGYC9w4deO5kg2gSJw=", + "dev": true, + "requires": { + "create-eslint-index": "1.0.0", + "eslint-ast-utils": "1.1.0", + "lodash": "4.17.10", + "req-all": "0.1.0" + } + }, + "eslint-plugin-import": { + "version": "2.16.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-import/-/eslint-plugin-import-2.16.0.tgz", + "integrity": "sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A==", + "dev": true, + "requires": { + "contains-path": "0.1.0", + "debug": "2.6.9", + "doctrine": "1.5.0", + "eslint-import-resolver-node": "0.3.2", + "eslint-module-utils": "2.3.0", + "has": "1.0.3", + "lodash": "4.17.11", + "minimatch": "3.0.4", + "read-pkg-up": "2.0.0", + "resolve": "1.10.0" + }, + "dependencies": { + "debug": { + "version": "2.6.9", + "resolved": "https://registry.npmjs.org/debug/-/debug-2.6.9.tgz", + "integrity": "sha512-bC7ElrdJaJnPbAP+1EotYvqZsb3ecl5wi6Bfi6BJTUcNowp6cvspg0jXznRTKDjm/E7AdgFBVeAPVMNcKGsHMA==", + "dev": true, + "requires": { + "ms": "2.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + } + } + }, + "eslint-plugin-json": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-json/-/eslint-plugin-json-1.4.0.tgz", + "integrity": "sha512-CECvgRAWtUzuepdlPWd+VA7fhyF9HT183pZnl8wQw5x699Mk/MbME/q8xtULBfooi3LUbj6fToieNmsvUcDxWA==", + "dev": true, + "requires": { + "vscode-json-languageservice": "3.2.1" + } + }, + "eslint-plugin-lodash-fp": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-lodash-fp/-/eslint-plugin-lodash-fp-2.1.3.tgz", + "integrity": "sha1-7B1ngqu4NEFTNLl6ILFFcwoNCng=", + "dev": true, + "requires": { + "create-eslint-index": "1.0.0", + "enhance-visitors": "1.0.0", + "eslint-ast-utils": "1.1.0", + "lodash": "4.17.10", + "req-all": "0.1.0" + } + }, + "eslint-plugin-mocha": { + "version": "4.12.1", + "resolved": "https://registry.npmjs.org/eslint-plugin-mocha/-/eslint-plugin-mocha-4.12.1.tgz", + "integrity": "sha512-hxWtYHvLA0p/PKymRfDYh9Mxt5dYkg2Goy1vZDarTEEYfELP9ksga7kKG1NUKSQy27C8Qjc7YrSWTLUhOEOksA==", + "dev": true, + "requires": { + "ramda": "0.25.0" + } + }, + "eslint-plugin-prettier": { + "version": "2.7.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-prettier/-/eslint-plugin-prettier-2.7.0.tgz", + "integrity": "sha512-CStQYJgALoQBw3FsBzH0VOVDRnJ/ZimUlpLm226U8qgqYJfPOY/CPK6wyRInMxh73HSKg5wyRwdS4BVYYHwokA==", + "dev": true, + "requires": { + "fast-diff": "1.2.0", + "jest-docblock": "21.2.0" + } + }, + "eslint-plugin-promise": { + "version": "3.8.0", + "resolved": "https://registry.npmjs.org/eslint-plugin-promise/-/eslint-plugin-promise-3.8.0.tgz", + "integrity": "sha512-JiFL9UFR15NKpHyGii1ZcvmtIqa3UTwiDAGb8atSffe43qJ3+1czVGN6UtkklpcJ2DVnqvTMzEKRaJdBkAL2aQ==", "dev": true }, - "has-flag": { + "eslint-plugin-react": { + "version": "7.12.4", + "resolved": "https://registry.npmjs.org/eslint-plugin-react/-/eslint-plugin-react-7.12.4.tgz", + "integrity": "sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ==", + "dev": true, + "requires": { + "array-includes": "3.0.3", + "doctrine": "2.1.0", + "has": "1.0.3", + "jsx-ast-utils": "2.0.1", + "object.fromentries": "2.0.0", + "prop-types": "15.7.2", + "resolve": "1.10.0" + }, + "dependencies": { + "doctrine": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/doctrine/-/doctrine-2.1.0.tgz", + "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", + "dev": true, + "requires": { + "esutils": "2.0.2" + } + } + } + }, + "eslint-plugin-unicorn": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/eslint-plugin-unicorn/-/eslint-plugin-unicorn-4.0.3.tgz", + "integrity": "sha512-F1JMyd42hx4qGhIaVdOSbDyhcxPgTy4BOzctTCkV+hqebPBUOAQn1f5AhMK2LTyiqCmKiTs8huAErbLBSWKoCQ==", + "dev": true, + "requires": { + "clean-regexp": "1.0.0", + "eslint-ast-utils": "1.1.0", + "import-modules": "1.1.0", + "lodash.camelcase": "4.3.0", + "lodash.kebabcase": "4.1.1", + "lodash.snakecase": "4.1.1", + "lodash.upperfirst": "4.3.1", + "safe-regex": "1.1.0" + } + }, + "eslint-scope": { + "version": "3.7.1", + "resolved": "https://registry.npmjs.org/eslint-scope/-/eslint-scope-3.7.1.tgz", + "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", + "dev": true, + "requires": { + "esrecurse": "4.2.1", + "estraverse": "4.2.0" + } + }, + "eslint-utils": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/eslint-utils/-/eslint-utils-1.3.1.tgz", + "integrity": "sha512-Z7YjnIldX+2XMcjr7ZkgEsOj/bREONV60qYeB/bjMAqqqZ4zxKyWX+BOUkdmRmA9riiIPVvo5x86m5elviOk0Q==", + "dev": true + }, + "eslint-visitor-keys": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/eslint-visitor-keys/-/eslint-visitor-keys-1.0.0.tgz", + "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", + "dev": true + }, + "espree": { + "version": "3.5.4", + "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", + "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", + "dev": true, + "requires": { + "acorn": "5.7.3", + "acorn-jsx": "3.0.1" + } + }, + "esprima": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", + "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", + "dev": true + }, + "espurify": { + "version": "1.8.1", + "resolved": "https://registry.npmjs.org/espurify/-/espurify-1.8.1.tgz", + "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", + "dev": true, + "requires": { + "core-js": "2.6.5" + } + }, + "esquery": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/esquery/-/esquery-1.0.1.tgz", + "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "esrecurse": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/esrecurse/-/esrecurse-4.2.1.tgz", + "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", + "dev": true, + "requires": { + "estraverse": "4.2.0" + } + }, + "estraverse": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.2.0.tgz", + "integrity": "sha1-De4/7TH81GlhjOc0IJn8GvoL2xM=", + "dev": true + }, + "esutils": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.2.tgz", + "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", + "dev": true + }, + "extend": { "version": "3.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", - "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", + "integrity": "sha1-WkdDU7nzNT3dgXbf03uRyDpG8dQ=" + }, + "external-editor": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/external-editor/-/external-editor-3.0.3.tgz", + "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", + "dev": true, + "requires": { + "chardet": "0.7.0", + "iconv-lite": "0.4.24", + "tmp": "0.0.33" + } + }, + "fast-deep-equal": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/fast-deep-equal/-/fast-deep-equal-2.0.1.tgz", + "integrity": "sha1-ewUhjd+WZ79/Nwv3/bLLFf3Qqkk=", "dev": true }, - "he": { + "fast-diff": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/fast-diff/-/fast-diff-1.2.0.tgz", + "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", + "dev": true + }, + "fast-json-stable-stringify": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", + "integrity": "sha1-1RQsDK7msRifh9OnYREGT4bIu/I=", + "dev": true + }, + "fast-levenshtein": { + "version": "2.0.6", + "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", + "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", + "dev": true + }, + "figures": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", + "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", + "dev": true, + "requires": { + "escape-string-regexp": "1.0.5" + } + }, + "file-entry-cache": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/file-entry-cache/-/file-entry-cache-5.0.1.tgz", + "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", + "dev": true, + "requires": { + "flat-cache": "2.0.1" + } + }, + "find-up": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-2.1.0.tgz", + "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", + "dev": true, + "requires": { + "locate-path": "2.0.0" + } + }, + "flat-cache": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/flat-cache/-/flat-cache-2.0.1.tgz", + "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", + "dev": true, + "requires": { + "flatted": "2.0.0", + "rimraf": "2.6.3", + "write": "1.0.3" + } + }, + "flatted": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/flatted/-/flatted-2.0.0.tgz", + "integrity": "sha512-R+H8IZclI8AAkSBRQJLVOsxwAoHd6WC40b4QTNWIjzAa6BXOBfQcM587MXDTVPeYaopFNWHUFLx7eNmHDSxMWg==", + "dev": true + }, + "fs.realpath": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", + "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", + "dev": true + }, + "function-bind": { "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", + "integrity": "sha512-yIovAzMX49sF8Yl58fSCWJ5svSLuaibPxXQJFLmBObTuCr0Mf1KiPopGM9NiFjiYBCbfaa2Fh6breQ6ANVTI0A==", + "dev": true + }, + "functional-red-black-tree": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", + "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", + "dev": true + }, + "get-stdin": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", + "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", + "dev": true + }, + "glob": { + "version": "6.0.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", + "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", + "dev": true, + "requires": { + "inflight": "1.0.4", + "inherits": "2.0.1", + "minimatch": "3.0.4", + "once": "1.3.3", + "path-is-absolute": "1.0.0" + }, + "dependencies": { + "inflight": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.4.tgz", + "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=", + "dev": true, + "requires": { + "once": "1.3.3", + "wrappy": "1.0.1" + }, + "dependencies": { + "wrappy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", + "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=", + "dev": true + } + } + }, + "inherits": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.1.tgz", + "integrity": "sha1-sX0I0ya0Qj5Wjv9xn5GwscvfafE=", + "dev": true + }, + "once": { + "version": "1.3.3", + "resolved": "https://registry.npmjs.org/once/-/once-1.3.3.tgz", + "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", + "dev": true, + "requires": { + "wrappy": "1.0.1" + }, + "dependencies": { + "wrappy": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.1.tgz", + "integrity": "sha1-HmWWmWXMvC20VIxrhKbyxa7dRzk=", + "dev": true + } + } + }, + "path-is-absolute": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.0.tgz", + "integrity": "sha1-Jj2tpmqz8vsQv3+dJN2PPlcO+RI=", + "dev": true + } + } + }, + "globals": { + "version": "11.11.0", + "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", + "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", + "dev": true + }, + "gonzales-pe": { + "version": "4.2.3", + "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.3.tgz", + "integrity": "sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw==", + "dev": true, + "requires": { + "minimist": "1.1.3" + } + }, + "graceful-fs": { + "version": "4.1.15", + "resolved": "https://registry.npmjs.org/graceful-fs/-/graceful-fs-4.1.15.tgz", + "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", + "dev": true + }, + "growl": { + "version": "1.10.5", + "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", + "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", + "dev": true + }, + "has": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", + "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", + "dev": true, + "requires": { + "function-bind": "1.1.1" + } + }, + "has-flag": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-3.0.0.tgz", + "integrity": "sha1-tdRU3CGZriJWmfNGfloH87lVuv0=", + "dev": true + }, + "has-symbols": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.0.tgz", + "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", + "dev": true + }, + "he": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", + "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "dev": true + }, + "hosted-git-info": { + "version": "2.7.1", + "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", + "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", + "dev": true + }, + "iconv-lite": { + "version": "0.4.24", + "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", + "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", + "dev": true, + "requires": { + "safer-buffer": "2.1.2" + } + }, + "ignore": { + "version": "4.0.6", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-4.0.6.tgz", + "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", + "dev": true + }, + "import-fresh": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", + "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", + "dev": true, + "requires": { + "parent-module": "1.0.0", + "resolve-from": "4.0.0" + } + }, + "import-modules": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/import-modules/-/import-modules-1.1.0.tgz", + "integrity": "sha1-dI23nFzEK7lwHvq0JPiU5yYA6dw=", + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/imurmurhash/-/imurmurhash-0.1.4.tgz", + "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", + "dev": true + }, + "inflight": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", + "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", + "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "dev": true + }, + "ini": { + "version": "1.3.5", + "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", + "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + }, + "inquirer": { + "version": "6.2.2", + "resolved": "https://registry.npmjs.org/inquirer/-/inquirer-6.2.2.tgz", + "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", + "dev": true, + "requires": { + "ansi-escapes": "3.2.0", + "chalk": "2.4.2", + "cli-cursor": "2.1.0", + "cli-width": "2.2.0", + "external-editor": "3.0.3", + "figures": "2.0.0", + "lodash": "4.17.11", + "mute-stream": "0.0.7", + "run-async": "2.3.0", + "rxjs": "6.4.0", + "string-width": "2.1.1", + "strip-ansi": "5.0.0", + "through": "2.3.8" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "4.0.0" + } + } + } + }, + "invariant": { + "version": "2.2.4", + "resolved": "https://registry.npmjs.org/invariant/-/invariant-2.2.4.tgz", + "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", + "dev": true, + "requires": { + "loose-envify": "1.4.0" + } + }, + "is-arrayish": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", + "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", + "dev": true + }, + "is-callable": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", + "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", + "dev": true + }, + "is-date-object": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", + "integrity": "sha1-mqIOtq7rv/d/vTPnTKAbM1gdOhY=", + "dev": true + }, + "is-error": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.1.tgz", + "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", + "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", + "dev": true + }, + "is-promise": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", + "integrity": "sha1-eaKp7OfwlugPNtKy87wWwf9L8/o=", + "dev": true + }, + "is-regex": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-regex/-/is-regex-1.0.4.tgz", + "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", + "dev": true, + "requires": { + "has": "1.0.3" + } + }, + "is-symbol": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", + "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", + "dev": true, + "requires": { + "has-symbols": "1.0.0" + } + }, + "isarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", + "integrity": "sha1-u5NdSFgsuhaMBoNJV6VKPgcSTxE=", + "dev": true + }, + "isexe": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", + "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", + "dev": true + }, + "jest-docblock": { + "version": "21.2.0", + "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", + "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", + "dev": true + }, + "js-tokens": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", + "integrity": "sha1-mGbfOVECEw449/mWvOtlRDIJwls=", + "dev": true + }, + "js-yaml": { + "version": "3.3.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz", + "integrity": "sha1-yhrNNCPsJ10SFAp7q1HbAVugs8A=", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "2.2.0" + }, + "dependencies": { + "esprima": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.2.0.tgz", + "integrity": "sha1-QpLB1o5Bc9gV+iKQ3Hr8ltgfzYM=", + "dev": true + } + } + }, + "jsesc": { + "version": "2.5.2", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-2.5.2.tgz", + "integrity": "sha512-OYu7XEzjkCQ3C5Ps3QIZsQfNpqoJyZZA99wd9aWd05NCtC5pWOkShK2mkL6HXQR6/Cy2lbNdPlZBpuQHXE63gA==", + "dev": true + }, + "json-bigint": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.1.4.tgz", + "integrity": "sha1-tdQLipAJ6S8Vf3wHnbCXABgw4B4=", + "requires": { + "bignumber.js": "1.1.1" + }, + "dependencies": { + "bignumber.js": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.1.1.tgz", + "integrity": "sha1-GkFdmsAUwTJWrx/u2dGj5XF6jPc=" + } + } + }, + "json-schema-traverse": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", + "integrity": "sha512-xbbCH5dCYU5T8LcEhhuh7HJ88HXuW3qsI3Y0zOZFKfZEHcpWiHU/Jxzk629Brsab/mMiHQti9wMP+845RPe3Vg==", + "dev": true + }, + "json-stable-stringify-without-jsonify": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/json-stable-stringify-without-jsonify/-/json-stable-stringify-without-jsonify-1.0.1.tgz", + "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", + "dev": true + }, + "jsonc-parser": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.0.3.tgz", + "integrity": "sha512-WJi9y9ABL01C8CxTKxRRQkkSpY/x2bo4Gy0WuiZGrInxQqgxQpvkBCLNcDYcHOSdhx4ODgbFcgAvfL49C+PHgQ==", + "dev": true + }, + "jsx-ast-utils": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/jsx-ast-utils/-/jsx-ast-utils-2.0.1.tgz", + "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", + "dev": true, + "requires": { + "array-includes": "3.0.3" + } + }, + "levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2", + "type-check": "0.3.2" + } + }, + "load-json-file": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-2.0.0.tgz", + "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "parse-json": "2.2.0", + "pify": "2.3.0", + "strip-bom": "3.0.0" + } + }, + "locate-path": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-2.0.0.tgz", + "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", + "dev": true, + "requires": { + "p-locate": "2.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.10", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", + "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + }, + "lodash.camelcase": { + "version": "4.3.0", + "resolved": "https://registry.npmjs.org/lodash.camelcase/-/lodash.camelcase-4.3.0.tgz", + "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", + "dev": true + }, + "lodash.get": { + "version": "4.4.2", + "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", + "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", + "dev": true + }, + "lodash.kebabcase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", + "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", + "dev": true + }, + "lodash.snakecase": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", + "integrity": "sha1-OdcUo1NXFHg3rv1ktdy7Fr7Nj40=", + "dev": true + }, + "lodash.upperfirst": { + "version": "4.3.1", + "resolved": "https://registry.npmjs.org/lodash.upperfirst/-/lodash.upperfirst-4.3.1.tgz", + "integrity": "sha1-E2Xt9DFIBIHvDRxolXpe2Z1J984=", + "dev": true + }, + "lodash.zip": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/lodash.zip/-/lodash.zip-4.2.0.tgz", + "integrity": "sha1-7GZi5IlkCO1KtsVCo5kLcswIACA=", + "dev": true + }, + "loose-envify": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", + "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", + "dev": true, + "requires": { + "js-tokens": "3.0.2" + } + }, + "marked": { + "version": "0.3.19", + "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", + "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "dev": true + }, + "mimic-fn": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", + "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", + "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "1.1.3", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", + "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=" + }, + "mkdirp": { + "version": "0.5.1", + "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", + "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", + "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", + "dev": true + } + } + }, + "mocha": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", + "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "dev": true, + "requires": { + "browser-stdout": "1.3.1", + "commander": "2.15.1", + "debug": "3.1.0", + "diff": "3.5.0", + "escape-string-regexp": "1.0.5", + "glob": "7.1.2", + "growl": "1.10.5", + "he": "1.1.1", + "minimatch": "3.0.4", + "mkdirp": "0.5.1", + "supports-color": "5.4.0" + }, + "dependencies": { + "glob": { + "version": "7.1.2", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", + "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + } + } + }, + "ms": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", + "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", + "dev": true + }, + "multimatch": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/multimatch/-/multimatch-2.1.0.tgz", + "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", + "dev": true, + "requires": { + "array-differ": "1.0.0", + "array-union": "1.0.2", + "arrify": "1.0.1", + "minimatch": "3.0.4" + } + }, + "mute-stream": { + "version": "0.0.7", + "resolved": "https://registry.npmjs.org/mute-stream/-/mute-stream-0.0.7.tgz", + "integrity": "sha1-MHXOk7whuPq0PhvE2n6BFe0ee6s=", + "dev": true + }, + "natural-compare": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", + "integrity": "sha1-Sr6/7tdUHywnrPspvbvRXI1bpPc=", + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/nice-try/-/nice-try-1.0.5.tgz", + "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", + "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", + "dev": true, + "requires": { + "hosted-git-info": "2.7.1", + "resolve": "1.10.0", + "semver": "5.6.0", + "validate-npm-package-license": "3.0.4" + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "dev": true + }, + "object.fromentries": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", + "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "dev": true, + "requires": { + "define-properties": "1.1.3", + "es-abstract": "1.13.0", + "function-bind": "1.1.1", + "has": "1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "dev": true, + "requires": { + "callsites": "3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.2" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", + "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/path-parse/-/path-parse-1.0.6.tgz", + "integrity": "sha512-GSmOT2EbHrINBf9SR7CDELwlJ8AENk3Qn7OikK4nFYAu3Ote2+JYNVvkpAEQm3/TLNEJFD/xZJjzyxg3KBWOzw==", + "dev": true + }, + "path-type": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-2.0.0.tgz", + "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", + "dev": true, + "requires": { + "pify": "2.3.0" + } + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pkg-dir": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", + "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + }, + "pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/pkg-up/-/pkg-up-2.0.0.tgz", + "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", + "dev": true, + "requires": { + "find-up": "2.1.0" + } + }, + "prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", + "dev": true + }, + "prettier": { + "version": "1.11.1", + "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.11.1.tgz", + "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", "dev": true }, - "inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", + "progress": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", + "integrity": "sha512-7PiHtLll5LdnKIMw100I+8xJXR5gW2QwWYkT6iJva0bXitZKa/XMrSbdmg3r2Xnaidz9Qumd0VPaMrZlF9V9sA==", + "dev": true + }, + "prop-types": { + "version": "15.7.2", + "resolved": "https://registry.npmjs.org/prop-types/-/prop-types-15.7.2.tgz", + "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", "dev": true, "requires": { - "once": "^1.3.0", - "wrappy": "1" + "loose-envify": "1.4.0", + "object-assign": "4.1.1", + "react-is": "16.8.3" } }, - "inherits": { - "version": "2.0.3", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.3.tgz", - "integrity": "sha1-Yzwsg+PaQqUC9SRmAiSA9CCCYd4=", + "punycode": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/punycode/-/punycode-2.1.1.tgz", + "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, - "ini": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.5.tgz", - "integrity": "sha512-RZY5huIKCMRWDUqZlEi72f/lmXKMvuszcMBduliQ3nnWbx9X/ZBQO7DijMEYS9EhHBb2qacRUMtC7svLwe0lcw==" + "ramda": { + "version": "0.25.0", + "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", + "integrity": "sha512-GXpfrYVPwx3K7RQ6aYT8KPS8XViSXUVJT1ONhoKPE9VAleW42YE+U+8VEyGWt41EnEQW7gwecYJriTI0pKoecQ==", + "dev": true }, - "js-yaml": { - "version": "3.3.1", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.3.1.tgz", - "integrity": "sha1-yhrNNCPsJ10SFAp7q1HbAVugs8A=", - "dev": true, + "rc": { + "version": "1.2.8", + "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", + "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { - "argparse": "~1.0.2", - "esprima": "~2.2.0" + "deep-extend": "0.6.0", + "ini": "1.3.5", + "minimist": "1.2.0", + "strip-json-comments": "2.0.1" }, "dependencies": { - "esprima": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/esprima/-/esprima-2.2.0.tgz", - "integrity": "sha1-QpLB1o5Bc9gV+iKQ3Hr8ltgfzYM=", - "dev": true + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" } } }, - "json-bigint": { - "version": "0.1.4", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.1.4.tgz", - "integrity": "sha1-tdQLipAJ6S8Vf3wHnbCXABgw4B4=", + "react-is": { + "version": "16.8.3", + "resolved": "https://registry.npmjs.org/react-is/-/react-is-16.8.3.tgz", + "integrity": "sha512-Y4rC1ZJmsxxkkPuMLwvKvlL1Zfpbcu+Bf4ZigkHup3v9EfdYhAlWAaVyA19olXq2o2mGn0w+dFKvk3pVVlYcIA==", + "dev": true + }, + "read-pkg": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-2.0.0.tgz", + "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", + "dev": true, "requires": { - "bignumber.js": "~1.1.1" - }, - "dependencies": { - "bignumber.js": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-1.1.1.tgz", - "integrity": "sha1-GkFdmsAUwTJWrx/u2dGj5XF6jPc=" - } + "load-json-file": "2.0.0", + "normalize-package-data": "2.5.0", + "path-type": "2.0.0" } }, - "lodash": { - "version": "4.17.10", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.10.tgz", - "integrity": "sha512-UejweD1pDoXu+AD825lWwp4ZGtSwgnpZxb3JDViD7StjQz+Nb/6l093lx4OQ0foGWNRoc19mWy7BzL+UAK2iVg==" + "read-pkg-up": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-2.0.0.tgz", + "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", + "dev": true, + "requires": { + "find-up": "2.1.0", + "read-pkg": "2.0.0" + } }, - "marked": { - "version": "0.3.19", - "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", - "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", + "regenerator-runtime": { + "version": "0.11.1", + "resolved": "https://registry.npmjs.org/regenerator-runtime/-/regenerator-runtime-0.11.1.tgz", + "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, - "minimatch": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", - "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", + "regexpp": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", + "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", + "dev": true + }, + "req-all": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/req-all/-/req-all-0.1.0.tgz", + "integrity": "sha1-EwBR4qzligLqy/ydRIV3pzapJzo=", + "dev": true + }, + "requireindex": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", + "integrity": "sha512-L9jEkOi3ASd9PYit2cwRfyppc9NoABujTP8/5gFcbERmo5jUoAKovIC3fsF17pkTnGsrByysqX+Kxd2OTNI1ww==", + "dev": true + }, + "resolve": { + "version": "1.10.0", + "resolved": "https://registry.npmjs.org/resolve/-/resolve-1.10.0.tgz", + "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "dev": true, "requires": { - "brace-expansion": "^1.1.7" + "path-parse": "1.0.6" } }, - "minimist": { - "version": "1.1.3", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", - "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=" + "resolve-from": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-4.0.0.tgz", + "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", + "dev": true }, - "mkdirp": { - "version": "0.5.1", - "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", - "integrity": "sha1-MAV0OOrGz3+MR2fzhkjWaX11yQM=", + "restore-cursor": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", + "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "minimist": "0.0.8" - }, - "dependencies": { - "minimist": { - "version": "0.0.8", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-0.0.8.tgz", - "integrity": "sha1-hX/Kv8M5fSYluCKCYuhqp6ARsF0=", - "dev": true - } + "onetime": "2.0.1", + "signal-exit": "3.0.2" } }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", + "ret": { + "version": "0.1.15", + "resolved": "https://registry.npmjs.org/ret/-/ret-0.1.15.tgz", + "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", + "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" + "glob": "7.1.3" }, "dependencies": { "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", + "version": "7.1.3", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.3.tgz", + "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^3.0.4", - "once": "^1.3.0", - "path-is-absolute": "^1.0.0" + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" } } } }, - "ms": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", - "integrity": "sha1-VgiurfwAvmwpAd9fmGF4jeDVl8g=", - "dev": true + "run-async": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/run-async/-/run-async-2.3.0.tgz", + "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", + "dev": true, + "requires": { + "is-promise": "2.1.0" + } }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "rxjs": { + "version": "6.4.0", + "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", + "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { - "wrappy": "1" + "tslib": "1.9.3" } }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "safe-regex": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", + "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", + "dev": true, + "requires": { + "ret": "0.1.15" + } + }, + "safer-buffer": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/safer-buffer/-/safer-buffer-2.1.2.tgz", + "integrity": "sha512-YZo3K82SD7Riyi0E1EQPojLz7kpepnSQI9IyPbHHg1XXXevb5dJI7tpyN2ADxGcQbHG7vcyRHk0cbwqcQriUtg==", "dev": true }, - "rc": { - "version": "1.2.8", - "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", - "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", + "semver": { + "version": "5.6.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-5.6.0.tgz", + "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", + "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", + "dev": true, "requires": { - "deep-extend": "^0.6.0", - "ini": "~1.3.0", - "minimist": "^1.2.0", - "strip-json-comments": "~2.0.1" - }, - "dependencies": { - "minimist": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", - "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=" - } + "shebang-regex": "1.0.0" } }, + "shebang-regex": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-1.0.0.tgz", + "integrity": "sha1-2kL0l0DAtC2yypcoVxyxkMmO/qM=", + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-3.0.2.tgz", + "integrity": "sha1-tf3AjxKH6hF4Yo5BXiUTK3NkbG0=", + "dev": true + }, "sinon": { "version": "1.15.4", "resolved": "https://registry.npmjs.org/sinon/-/sinon-1.15.4.tgz", @@ -373,7 +2130,7 @@ "formatio": "1.1.1", "lolex": "1.1.0", "samsam": "1.1.2", - "util": ">=0.10.3 <1" + "util": "0.10.3" }, "dependencies": { "formatio": { @@ -382,7 +2139,7 @@ "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", "dev": true, "requires": { - "samsam": "~1.1" + "samsam": "1.1.2" } }, "lolex": { @@ -416,12 +2173,92 @@ } } }, + "slash": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-2.0.0.tgz", + "integrity": "sha512-ZYKh3Wh2z1PpEXWr0MpSBZ0V6mZHAQfYevttO11c51CaWjGTaadiKZ+wVt1PbMlDV5qhMFslpZCemhwOK7C89A==", + "dev": true + }, + "slice-ansi": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/slice-ansi/-/slice-ansi-2.1.0.tgz", + "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", + "dev": true, + "requires": { + "ansi-styles": "3.2.1", + "astral-regex": "1.0.0", + "is-fullwidth-code-point": "2.0.0" + } + }, + "source-map": { + "version": "0.5.7", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.5.7.tgz", + "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", + "dev": true + }, + "spdx-correct": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", + "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.3" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/spdx-exceptions/-/spdx-exceptions-2.2.0.tgz", + "integrity": "sha512-2XQACfElKi9SlVb1CYadKDXvoajPgBVPn/gOQLrTvHdElaVhr7ZEbqJaRnJLVNeaI4cMEAgVCeBMKF6MWRDCRA==", + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/spdx-expression-parse/-/spdx-expression-parse-3.0.0.tgz", + "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", + "dev": true, + "requires": { + "spdx-exceptions": "2.2.0", + "spdx-license-ids": "3.0.3" + } + }, + "spdx-license-ids": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/spdx-license-ids/-/spdx-license-ids-3.0.3.tgz", + "integrity": "sha512-uBIcIl3Ih6Phe3XHK1NqboJLdGfwr1UN3k6wSD1dZpmPsIkb8AGNbZYJ1fOBk834+Gxy8rpfDxrS6XLEMZMY2g==", + "dev": true + }, "sprintf-js": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/sprintf-js/-/sprintf-js-1.0.3.tgz", "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "string-width": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", + "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-4.0.0.tgz", + "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/strip-bom/-/strip-bom-3.0.0.tgz", + "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", @@ -433,14 +2270,181 @@ "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "^3.0.0" + "has-flag": "3.0.0" + } + }, + "table": { + "version": "5.2.3", + "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", + "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", + "dev": true, + "requires": { + "ajv": "6.10.0", + "lodash": "4.17.11", + "slice-ansi": "2.1.0", + "string-width": "3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.0.0.tgz", + "integrity": "sha512-iB5Dda8t/UqpPI/IjsejXu5jOGDrzn41wJyljwPH65VCIbk6+1BzFIMJGFwTNrYXT1CrD+B4l19U7awiQ8rk7w==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "string-width": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.0.0.tgz", + "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", + "dev": true, + "requires": { + "emoji-regex": "7.0.3", + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "5.0.0" + } + }, + "strip-ansi": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.0.0.tgz", + "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", + "dev": true, + "requires": { + "ansi-regex": "4.0.0" + } + } + } + }, + "text-table": { + "version": "0.2.0", + "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", + "integrity": "sha1-f17oI66AUgfACvLfSoTsP8+lcLQ=", + "dev": true + }, + "through": { + "version": "2.3.8", + "resolved": "https://registry.npmjs.org/through/-/through-2.3.8.tgz", + "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", + "dev": true + }, + "tmp": { + "version": "0.0.33", + "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", + "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", + "dev": true, + "requires": { + "os-tmpdir": "1.0.2" + } + }, + "to-fast-properties": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/to-fast-properties/-/to-fast-properties-2.0.0.tgz", + "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", + "dev": true + }, + "trim-right": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", + "integrity": "sha1-yy4SAwZ+DI3h9hQJS5/kVwTqYAM=", + "dev": true + }, + "tslib": { + "version": "1.9.3", + "resolved": "https://registry.npmjs.org/tslib/-/tslib-1.9.3.tgz", + "integrity": "sha512-4krF8scpejhaOgqzBEcGM7yDIEfi0/8+8zDRZhNZZ2kjmHJ4hv3zCbQWxoJGz1iw5U0Jl0nma13xzHXcncMavQ==", + "dev": true + }, + "type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", + "dev": true, + "requires": { + "prelude-ls": "1.1.2" + } + }, + "uri-js": { + "version": "4.2.2", + "resolved": "https://registry.npmjs.org/uri-js/-/uri-js-4.2.2.tgz", + "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", + "dev": true, + "requires": { + "punycode": "2.1.1" + } + }, + "validate-npm-package-license": { + "version": "3.0.4", + "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", + "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", + "dev": true, + "requires": { + "spdx-correct": "3.1.0", + "spdx-expression-parse": "3.0.0" + } + }, + "vscode-json-languageservice": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/vscode-json-languageservice/-/vscode-json-languageservice-3.2.1.tgz", + "integrity": "sha512-ee9MJ70/xR55ywvm0bZsDLhA800HCRE27AYgMNTU14RSg20Y+ngHdQnUt6OmiTXrQDI/7sne6QUOtHIN0hPQYA==", + "dev": true, + "requires": { + "jsonc-parser": "2.0.3", + "vscode-languageserver-types": "3.14.0", + "vscode-nls": "4.0.0", + "vscode-uri": "1.0.6" + } + }, + "vscode-languageserver-types": { + "version": "3.14.0", + "resolved": "https://registry.npmjs.org/vscode-languageserver-types/-/vscode-languageserver-types-3.14.0.tgz", + "integrity": "sha512-lTmS6AlAlMHOvPQemVwo3CezxBp0sNB95KNPkqp3Nxd5VFEnuG1ByM0zlRWos0zjO3ZWtkvhal0COgiV1xIA4A==", + "dev": true + }, + "vscode-nls": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/vscode-nls/-/vscode-nls-4.0.0.tgz", + "integrity": "sha512-qCfdzcH+0LgQnBpZA53bA32kzp9rpq/f66Som577ObeuDlFIrtbEJ+A/+CCxjIh4G8dpJYNCKIsxpRAHIfsbNw==", + "dev": true + }, + "vscode-uri": { + "version": "1.0.6", + "resolved": "https://registry.npmjs.org/vscode-uri/-/vscode-uri-1.0.6.tgz", + "integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==", + "dev": true + }, + "which": { + "version": "1.3.1", + "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", + "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", + "dev": true, + "requires": { + "isexe": "2.0.0" } }, + "wordwrap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/wordwrap/-/wordwrap-1.0.0.tgz", + "integrity": "sha1-J1hIEIkUVqQXHI0CJkQa3pDLyus=", + "dev": true + }, "wrappy": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", "integrity": "sha1-tSQ9jz7BqjXxNkYFvA0QNuMKtp8=", "dev": true + }, + "write": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/write/-/write-1.0.3.tgz", + "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", + "dev": true, + "requires": { + "mkdirp": "0.5.1" + } } } } diff --git a/package.json b/package.json index 1ebf6d3..4c1e512 100644 --- a/package.json +++ b/package.json @@ -5,6 +5,7 @@ "main": "lib/index.js", "scripts": { "test": "./node_modules/.bin/mocha --recursive ./test", + "lint": "eslint lib test bin/dogapi examples", "docs": "node ./docs/create.js > index.html" }, "bin": { @@ -34,8 +35,10 @@ "rc": "^1.2.8" }, "devDependencies": { + "@coorpacademy/eslint-plugin-coorpacademy": "^8.1.1", "bignumber.js": "^2.0.7", "docast": "^0.1.1", + "eslint": "^5.15.1", "glob": "^6.0.0", "js-yaml": "^3.2.7", "marked": "^0.3.9", From 83303376d36d0b009744ad49e1ac49fa36d48d6f Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 08:22:03 +0100 Subject: [PATCH 06/24] Reformating with the new prettier configuration :wrench: --- bin/dogapi | 131 +++--- examples/new-interface.js | 10 +- examples/original-interface.js | 10 +- lib/api/comment.js | 179 +++++---- lib/api/downtime.js | 267 +++++++------ lib/api/embed.js | 177 ++++----- lib/api/event.js | 216 +++++----- lib/api/graph.js | 98 +++-- lib/api/host.js | 130 +++--- lib/api/index.js | 30 +- lib/api/infrastructure.js | 55 ++- lib/api/metric.js | 221 ++++++----- lib/api/monitor.js | 537 +++++++++++++------------ lib/api/screenboard.js | 331 ++++++++-------- lib/api/search.js | 62 ++- lib/api/serviceCheck.js | 107 +++-- lib/api/tag.js | 256 ++++++------ lib/api/timeboard.js | 220 +++++------ lib/api/user.js | 53 ++- lib/client.js | 175 ++++---- lib/constants.js | 16 +- lib/index.js | 40 +- lib/json.js | 7 +- test/api/embed.js | 152 +++---- test/api/graph.js | 16 +- test/api/metric.js | 701 ++++++++++++++++----------------- test/json.js | 42 +- 27 files changed, 2112 insertions(+), 2127 deletions(-) diff --git a/bin/dogapi b/bin/dogapi index 69f3a1a..e71588c 100755 --- a/bin/dogapi +++ b/bin/dogapi @@ -1,81 +1,90 @@ #!/usr/bin/env node -var dogapi = require("../"); -var json = require("../lib/json"); -var minimist = require("minimist"); -var rc = require("rc"); -var EOL = require("os").EOL; +const dogapi = require('..'); +const json = require('../lib/json'); +const minimist = require('minimist'); +const rc = require('rc'); +const EOL = require('os').EOL; -var config = rc("dogapi", { - api_key: null, - app_key: null +const config = rc('dogapi', { + api_key: null, + app_key: null }); dogapi.initialize(config); -var usage = [ - "Usage:", - " dogapi --help", - " dogapi <command> --help", - " dogapi --version", - " dogapi now", - " dogapi past <seconds-ago>", - " dogapi future <seconds-ahead>" +let usage = [ + 'Usage:', + ' dogapi --help', + ' dogapi <command> --help', + ' dogapi --version', + ' dogapi now', + ' dogapi past <seconds-ago>', + ' dogapi future <seconds-ahead>' ]; -var help = []; -for(var key in dogapi){ - if(!dogapi.hasOwnProperty(key)){ - continue; - } else if(!dogapi[key].hasOwnProperty("getUsage") || typeof dogapi[key].getUsage !== "function"){ - continue; - } else if(!dogapi[key].hasOwnProperty("handleCli") || typeof dogapi[key].handleCli !== "function"){ - continue; - } - usage = usage.concat(dogapi[key].getUsage()); +let help = []; +for (const key in dogapi) { + if (!dogapi.hasOwnProperty(key)) { + continue; + } else if ( + !dogapi[key].hasOwnProperty('getUsage') || + typeof dogapi[key].getUsage !== 'function' + ) { + continue; + } else if ( + !dogapi[key].hasOwnProperty('handleCli') || + typeof dogapi[key].handleCli !== 'function' + ) { + continue; + } + usage = usage.concat(dogapi[key].getUsage()); - if(dogapi[key].hasOwnProperty("getHelp") && typeof dogapi[key].getHelp === "function"){ - help = help.concat([""], dogapi[key].getHelp()); - } + if (dogapi[key].hasOwnProperty('getHelp') && typeof dogapi[key].getHelp === 'function') { + help = help.concat([''], dogapi[key].getHelp()); + } } usage = usage.concat(help); usage = usage.join(EOL); -var args = minimist(process.argv); +const args = minimist(process.argv); -var command = args._[2]; -var subcommand = args._[3]; +let command = args._[2]; +const subcommand = args._[3]; // this is the one unusual case -if(command === "servicecheck"){ - command = "serviceCheck"; +if (command === 'servicecheck') { + command = 'serviceCheck'; } -if(command === "now"){ - console.log(dogapi.now()); -} else if(command === "past" && args._.length > 3){ - console.log(dogapi.now() - parseInt(args._[args._.length - 1])); -} else if(command === "future" && args._.length > 3){ - console.log(dogapi.now() + parseInt(args._[args._.length - 1])); -} else if(dogapi.hasOwnProperty(command)){ - if(subcommand){ - dogapi[command].handleCli(subcommand, args, function(err, res){ - if(err){ - console.error(json.stringify(err, null, ' ')); - process.exit(1); - } else { - if(res === ""){ - res = "success"; - } - console.log(json.stringify(res, null, ' ')); - } - }); - } else { - var commandUsage = ["Usage:"].concat(dogapi[command].getUsage()); - if(dogapi[command].hasOwnProperty("getHelp") && typeof dogapi[command].getHelp === "function"){ - commandUsage = commandUsage.concat([EOL], dogapi[command].getHelp()); +if (command === 'now') { + console.log(dogapi.now()); +} else if (command === 'past' && args._.length > 3) { + console.log(dogapi.now() - parseInt(args._[args._.length - 1])); +} else if (command === 'future' && args._.length > 3) { + console.log(dogapi.now() + parseInt(args._[args._.length - 1])); +} else if (dogapi.hasOwnProperty(command)) { + if (subcommand) { + dogapi[command].handleCli(subcommand, args, function(err, res) { + if (err) { + console.error(json.stringify(err, null, ' ')); + process.exit(1); + } else { + if (res === '') { + res = 'success'; } - console.log(commandUsage.join(EOL).replace(/\$\{command\}/g, " dogapi")); + console.log(json.stringify(res, null, ' ')); + } + }); + } else { + let commandUsage = ['Usage:'].concat(dogapi[command].getUsage()); + if ( + dogapi[command].hasOwnProperty('getHelp') && + typeof dogapi[command].getHelp === 'function' + ) { + commandUsage = commandUsage.concat([EOL], dogapi[command].getHelp()); } -} else if(args.version){ - console.log(require("../package.json").version); + console.log(commandUsage.join(EOL).replace(/\$\{command\}/g, ' dogapi')); + } +} else if (args.version) { + console.log(require('../package.json').version); } else { - console.log(usage); + console.log(usage); } diff --git a/examples/new-interface.js b/examples/new-interface.js index 7fd6cb6..ea37b5e 100644 --- a/examples/new-interface.js +++ b/examples/new-interface.js @@ -1,10 +1,10 @@ -var Dogapi = require("../lib"); +const Dogapi = require('../lib'); -var options = { - api_key: "YOUR_KEY_HERE", - app_key: "YOUR_KEY_HERE", +const options = { + api_key: 'YOUR_KEY_HERE', + app_key: 'YOUR_KEY_HERE' }; const dogapi = new Dogapi(options); -dogapi.metric.send('test', 1) \ No newline at end of file +dogapi.metric.send('test', 1); diff --git a/examples/original-interface.js b/examples/original-interface.js index c1e9e8c..161f1a0 100644 --- a/examples/original-interface.js +++ b/examples/original-interface.js @@ -1,10 +1,10 @@ -var dogapi = require("../lib"); +const dogapi = require('../lib'); -var options = { - api_key: "YOUR_KEY_HERE", - app_key: "YOUR_KEY_HERE", +const options = { + api_key: 'YOUR_KEY_HERE', + app_key: 'YOUR_KEY_HERE' }; dogapi.initialize(options); -dogapi.metric.send('test', 1) \ No newline at end of file +dogapi.metric.send('test', 1); diff --git a/lib/api/comment.js b/lib/api/comment.js index df5b233..21e7879 100644 --- a/lib/api/comment.js +++ b/lib/api/comment.js @@ -1,7 +1,7 @@ -const util = require("util"); +const util = require('util'); -module.exports = function (client) { - /*section: comment +module.exports = function(client) { + /* section: comment *comment: create a new comment *params: * message: the message of the comment @@ -23,31 +23,31 @@ module.exports = function (client) { * }); * ``` */ - function create(message, properties, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = properties; - properties = {}; - } - - const params = { - body: { - message: message - } - }; + function create(message, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = properties; + properties = {}; + } - if (typeof properties === "object") { - if (properties.handle) { - params.body.handle = properties.handle; - } - if (properties.related_event_id) { - params.body.related_event_id = properties.related_event_id; - } - } + const params = { + body: { + message + } + }; - client.request("POST", "/comments", params, callback); + if (typeof properties === 'object') { + if (properties.handle) { + params.body.handle = properties.handle; + } + if (properties.related_event_id) { + params.body.related_event_id = properties.related_event_id; + } } - /*section: comment + client.request('POST', '/comments', params, callback); + } + + /* section: comment *comment: update an existing comment *params: * commentId: the id of the comment to update @@ -67,25 +67,25 @@ module.exports = function (client) { * }); * ``` */ - function update(commentId, message, handle, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = handle; - handle = undefined; - } - - const params = { - body: { - message: message - } - }; - if (handle) { - params.body.handle = properties.handle; - } + function update(commentId, message, handle, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = handle; + handle = undefined; + } - client.request("PUT", util.format("/comments/%s", commentId), params, callback); + const params = { + body: { + message + } + }; + if (handle) { + params.body.handle = properties.handle; } - /*section: comment + client.request('PUT', util.format('/comments/%s', commentId), params, callback); + } + + /* section: comment *comment: remove a comment *params: * commentId: the id of the comment to remove @@ -103,56 +103,55 @@ module.exports = function (client) { * }); * ``` */ - function remove(commentId, callback) { - client.request("DELETE", util.format("/comments/%s", commentId), callback); - } + function remove(commentId, callback) { + client.request('DELETE', util.format('/comments/%s', commentId), callback); + } - - return { - create: create, - update: update, - remove: remove, - getUsage: function () { - return [ - " dogapi comment create <message> [--handle <handle>] [--event <event-id>]", - " dogapi comment update <comment-id> <message> [--handle <handle>]", - " dogapi comment remove <comment-id>" - ]; - }, - getHelp: function () { - return [ - "Comment:", - " Subcommands:", - " create <message> add a new comment", - " update <comment-id> <message> update an existing comment", - " remove <comment-id> delete a comment", - "", - " Options:", - " --handle <handle> the handle to associate with the comment (e.g. \"user@domain.com\")", - " --event <event-id> related event id to associate the comment with" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "create") { - const message = args._[4]; - const properties = {}; - if (args["handle"]) { - properties.handle = args["handle"]; - } - if (args["event"]) { - properties.related_event_id = parseInt(args["event"]); - } - create(message, properties, callback); - } else if (subcommand === "update") { - const commentId = args._[4]; - const message = args._[5]; - update(commentId, message, args["handle"], callback); - } else if (subcommand === "remove") { - const commentId = args._[4]; - remove(commentId, callback); - } else { - callback("unknown subcommand or arguments try `dogapi comment --help` for help", false); - } + return { + create, + update, + remove, + getUsage() { + return [ + ' dogapi comment create <message> [--handle <handle>] [--event <event-id>]', + ' dogapi comment update <comment-id> <message> [--handle <handle>]', + ' dogapi comment remove <comment-id>' + ]; + }, + getHelp() { + return [ + 'Comment:', + ' Subcommands:', + ' create <message> add a new comment', + ' update <comment-id> <message> update an existing comment', + ' remove <comment-id> delete a comment', + '', + ' Options:', + ' --handle <handle> the handle to associate with the comment (e.g. "user@domain.com")', + ' --event <event-id> related event id to associate the comment with' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'create') { + const message = args._[4]; + const properties = {}; + if (args.handle) { + properties.handle = args.handle; } - }; + if (args.event) { + properties.related_event_id = parseInt(args.event); + } + create(message, properties, callback); + } else if (subcommand === 'update') { + const commentId = args._[4]; + const message = args._[5]; + update(commentId, message, args.handle, callback); + } else if (subcommand === 'remove') { + const commentId = args._[4]; + remove(commentId, callback); + } else { + callback('unknown subcommand or arguments try `dogapi comment --help` for help', false); + } + } + }; }; diff --git a/lib/api/downtime.js b/lib/api/downtime.js index 05eb600..805f1d4 100644 --- a/lib/api/downtime.js +++ b/lib/api/downtime.js @@ -1,7 +1,7 @@ -const util = require("util"); +const util = require('util'); -module.exports = function (client) { - /*section: downtime +module.exports = function(client) { + /* section: downtime *comment: schedule a new downtime *params: * scope: string scope that the downtime should apply to (e.g. "env:staging") @@ -24,32 +24,32 @@ module.exports = function (client) { * }); * ``` */ - function create(scope, properties, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = properties; - properties = {}; - } + function create(scope, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = properties; + properties = {}; + } - const params = { - body: { - scope: scope - } - }; - if (typeof properties === "object") { - if (properties.start) { - params.body.start = parseInt(properties.start); - } - if (properties.end) { - params.body.end = parseInt(properties.end); - } - if (properties.message) { - params.body.message = properties.message; - } - } - client.request("POST", "/downtime", params, callback); + const params = { + body: { + scope + } + }; + if (typeof properties === 'object') { + if (properties.start) { + params.body.start = parseInt(properties.start); + } + if (properties.end) { + params.body.end = parseInt(properties.end); + } + if (properties.message) { + params.body.message = properties.message; + } } + client.request('POST', '/downtime', params, callback); + } - /*section: downtime + /* section: downtime *comment: update an existing downtime *params: * downtimeId: the id the downtie to update @@ -76,32 +76,32 @@ module.exports = function (client) { * }); * ``` */ - function update(downtimeId, properties, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = properties; - properties = {}; - } - const params = { - body: {} - }; - if (typeof properties === "object") { - if (properties.scope) { - params.body.scope = properties.scope; - } - if (properties.start) { - params.body.start = parseInt(properties.start); - } - if (properties.end) { - params.body.end = parseInt(properties.end); - } - if (properties.message) { - params.body.message = properties.message; - } - } - client.request("PUT", util.format("/downtime/%s", downtimeId), params, callback); + function update(downtimeId, properties, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = properties; + properties = {}; + } + const params = { + body: {} + }; + if (typeof properties === 'object') { + if (properties.scope) { + params.body.scope = properties.scope; + } + if (properties.start) { + params.body.start = parseInt(properties.start); + } + if (properties.end) { + params.body.end = parseInt(properties.end); + } + if (properties.message) { + params.body.message = properties.message; + } } + client.request('PUT', util.format('/downtime/%s', downtimeId), params, callback); + } - /*section: downtime + /* section: downtime *comment: delete a scheduled downtime *params: * downtimeId: the id of the downtime @@ -119,11 +119,11 @@ module.exports = function (client) { * }); * ``` */ - function remove(downtimeId, callback) { - client.request("DELETE", util.format("/downtime/%s", downtimeId), callback); - } + function remove(downtimeId, callback) { + client.request('DELETE', util.format('/downtime/%s', downtimeId), callback); + } - /*section: downtime + /* section: downtime *comment: get a scheduled downtimes details *params: * downtimeId: the id of the downtime @@ -141,11 +141,11 @@ module.exports = function (client) { * }); * ``` */ - function get(downtimeId, callback) { - client.request("GET", util.format("/downtime/%s", downtimeId), callback); - } + function get(downtimeId, callback) { + client.request('GET', util.format('/downtime/%s', downtimeId), callback); + } - /*section: downtime + /* section: downtime *comment: get all downtimes details *params: * callback: function(err, res) @@ -162,82 +162,81 @@ module.exports = function (client) { * }); * ``` */ - function getAll(callback) { - client.request("GET", "/downtime", callback); - } - + function getAll(callback) { + client.request('GET', '/downtime', callback); + } - return { - create: create, - update: update, - remove: remove, - get: get, - getAll: getAll, - getUsage: function () { - return [ - " dogapi downtime create <scope> [--start <start>] [--end <end>] [--message <message>]", - " dogapi downtime update <downtime-id> [--scope <scope>] [--start <start>] [--end <end>] [--message <message>]", - " dogapi downtime remove <downtime-id>", - " dogapi downtime get <downtime-id>", - " dogapi downtime getall", - ]; - }, - getHelp: function () { - return [ - "Downtime:", - " Subcommands:", - " create <scope> create a new downtime with the provided scope (e.g. \"env:staging\")", - " update <downtime-id> update an existing downtime with the provided id", - " remove <downtime-id> remove the downtime with the provided id", - " get <downtime-id> get the details of the downtime with the provided id", - " getall get the details of all downtimes", - "", - " Options:", - " --start <start> POSIX timestamp for when the downtime should start", - " --end <end> POSIX timestamp for when the downtime should end", - " --message <message> a string message to accompany the downtime", - " --scope <scope> the scope of the downtime (e.g. \"env:staging\")" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "get") { - get(args._[4], callback); - } else if (subcommand === "getall") { - getAll(callback); - } else if (subcommand === "remove") { - remove(args._[4], callback); - } else if (subcommand === "create") { - const scope = args._[4]; - const properties = {}; - if (args["start"]) { - properties.start = parseInt(args["start"]); - } - if (args["end"]) { - properties.end = parseInt(args["end"]); - } - if (args["message"]) { - properties.message = args["message"]; - } - create(scope, properties, callback); - } else if (subcommand === "update") { - const downtimeId = args._[4]; - const properties = {}; - if (args["scope"]) { - properties.scope = args["scope"]; - } - if (args["start"]) { - properties.start = parseInt(args["start"]); - } - if (args["end"]) { - properties.end = parseInt(args["end"]); - } - if (args["message"]) { - properties.message = args["message"]; - } - update(downtimeId, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi downtime --help` for help", false); - } + return { + create, + update, + remove, + get, + getAll, + getUsage() { + return [ + ' dogapi downtime create <scope> [--start <start>] [--end <end>] [--message <message>]', + ' dogapi downtime update <downtime-id> [--scope <scope>] [--start <start>] [--end <end>] [--message <message>]', + ' dogapi downtime remove <downtime-id>', + ' dogapi downtime get <downtime-id>', + ' dogapi downtime getall' + ]; + }, + getHelp() { + return [ + 'Downtime:', + ' Subcommands:', + ' create <scope> create a new downtime with the provided scope (e.g. "env:staging")', + ' update <downtime-id> update an existing downtime with the provided id', + ' remove <downtime-id> remove the downtime with the provided id', + ' get <downtime-id> get the details of the downtime with the provided id', + ' getall get the details of all downtimes', + '', + ' Options:', + ' --start <start> POSIX timestamp for when the downtime should start', + ' --end <end> POSIX timestamp for when the downtime should end', + ' --message <message> a string message to accompany the downtime', + ' --scope <scope> the scope of the downtime (e.g. "env:staging")' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'get') { + get(args._[4], callback); + } else if (subcommand === 'getall') { + getAll(callback); + } else if (subcommand === 'remove') { + remove(args._[4], callback); + } else if (subcommand === 'create') { + const scope = args._[4]; + const properties = {}; + if (args.start) { + properties.start = parseInt(args.start); } - }; + if (args.end) { + properties.end = parseInt(args.end); + } + if (args.message) { + properties.message = args.message; + } + create(scope, properties, callback); + } else if (subcommand === 'update') { + const downtimeId = args._[4]; + const properties = {}; + if (args.scope) { + properties.scope = args.scope; + } + if (args.start) { + properties.start = parseInt(args.start); + } + if (args.end) { + properties.end = parseInt(args.end); + } + if (args.message) { + properties.message = args.message; + } + update(downtimeId, properties, callback); + } else { + callback('unknown subcommand or arguments try `dogapi downtime --help` for help', false); + } + } + }; }; diff --git a/lib/api/embed.js b/lib/api/embed.js index 3921ed1..1252efd 100644 --- a/lib/api/embed.js +++ b/lib/api/embed.js @@ -1,10 +1,9 @@ -const extend = require("extend"); -const json = require("../json"); // TODO inline lib -const querystring = require("querystring"); +const querystring = require('querystring'); +const extend = require('extend'); +const json = require('../json'); // TODO inline lib -module.exports = function (client) { - - /*section: embed +module.exports = function(client) { + /* section: embed *comment: create an embed graph of a metric query *params: * graph_json: The request array to pass create in the embed @@ -45,28 +44,28 @@ module.exports = function (client) { * }); * ``` */ - function create(graphJSON, options, callback) { - if (callback === undefined && typeof options === "function") { - callback = options; - options = {}; - } - const body = { - graph_json: JSON.stringify(graphJSON) - }; - // Use `extend` to merge `options` into `body` - // DEV: `extend` will ignore any properties whose value is `undefined` - extend(body, options || {}); + function create(graphJSON, options, callback) { + if (callback === undefined && typeof options === 'function') { + callback = options; + options = {}; + } + const body = { + graph_json: JSON.stringify(graphJSON) + }; + // Use `extend` to merge `options` into `body` + // DEV: `extend` will ignore any properties whose value is `undefined` + extend(body, options || {}); - // Create the request - const params = { - body: querystring.stringify(body), - contentType: "application/x-www-form-urlencoded" - }; + // Create the request + const params = { + body: querystring.stringify(body), + contentType: 'application/x-www-form-urlencoded' + }; - client.request("POST", "/graph/embed", params, callback); - } + client.request('POST', '/graph/embed', params, callback); + } - /*section: embed + /* section: embed *comment: delete an embed with a specific id *params: * embedId: the id of the embed to delete @@ -79,12 +78,11 @@ module.exports = function (client) { * }); * ``` */ - function revoke(embedId, callback) { - client.request("GET", "/graph/embed/" + embedId + "/revoke", callback); - } + function revoke(embedId, callback) { + client.request('GET', `/graph/embed/${embedId}/revoke`, callback); + } - - /*section: embed + /* section: embed *comment: get all embeds from datadog *params: * callback: function(err, res) @@ -95,11 +93,11 @@ module.exports = function (client) { * }); * ``` */ - function getAll(callback) { - client.request("GET", "/graph/embed", callback); - } + function getAll(callback) { + client.request('GET', '/graph/embed', callback); + } - /*section: embed + /* section: embed *comment: get a single embed *params: * embedId: the id of the embed to get @@ -112,61 +110,60 @@ module.exports = function (client) { * }); * ``` */ - function get(embedId, callback) { - client.request("GET", "/graph/embed/" + embedId, callback); - } - - return { - create: create, - revoke: revoke, - getAll: getAll, - get: get, - getUsage: function () { - return [ - " dogapi embed create <embed_json> [--timeframe <timeframe>] [--size <size>] [--legend <legend>] [--title <title>]", - " dogapi embed revoke <embed_id>", - " dogapi embed get <embed_id>", - " dogapi embed getall" - ]; - }, - getHelp: function () { - return [ - "Embed:", - " Subcommands:", - " create <embed_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed", - " revoke <embed_id> revoke/delete an embed", - " get <embed_id> gets a single embed object", - " getall gets all embed objects", - " Options:", - " --events <event-query> a query for event bands to add to the snapshot", - " --timeframe <timeframe> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)", - " --size <size> The size of the embed to create (small, medium, large, xlarge)", - " --legend <legend> Whether or not to have a legend (yes, no)", - " --title <title> The title of the embed to create" + function get(embedId, callback) { + client.request('GET', `/graph/embed/${embedId}`, callback); + } - ]; - }, - handleCli: function (subcommand, args, callback) { - if (args._.length > 4 && subcommand === "create") { - const graph_json = json.parse(args._[4]); - const options = { - timeframe: args["timeframe"], - size: args["size"], - legend: args["legend"], - title: args["title"] - }; - create(graph_json, options, callback); - } else if (args._.length > 4 && subcommand === "revoke") { - const embedId = args._[4]; - revoke(embedId, callback); - } else if (args._.length > 4 && subcommand === "get") { - const embedId = args._[4]; - get(embedId, callback); - } else if (subcommand === "getall") { - getAll(callback); - } else { - callback("unknown subcommand or arguments try `dogapi embed --help` for help", false); - } - } - }; + return { + create, + revoke, + getAll, + get, + getUsage() { + return [ + ' dogapi embed create <embed_json> [--timeframe <timeframe>] [--size <size>] [--legend <legend>] [--title <title>]', + ' dogapi embed revoke <embed_id>', + ' dogapi embed get <embed_id>', + ' dogapi embed getall' + ]; + }, + getHelp() { + return [ + 'Embed:', + ' Subcommands:', + ' create <embed_json> --timeframe <timeframe> --size <size> --legend <legend> --title <title> | create a new graph embed', + ' revoke <embed_id> revoke/delete an embed', + ' get <embed_id> gets a single embed object', + ' getall gets all embed objects', + ' Options:', + ' --events <event-query> a query for event bands to add to the snapshot', + ' --timeframe <timeframe> The timeframe for the embed (1_hour, 4_hours, 1_day, 2_days, and 1_week)', + ' --size <size> The size of the embed to create (small, medium, large, xlarge)', + ' --legend <legend> Whether or not to have a legend (yes, no)', + ' --title <title> The title of the embed to create' + ]; + }, + handleCli(subcommand, args, callback) { + if (args._.length > 4 && subcommand === 'create') { + const graph_json = json.parse(args._[4]); + const options = { + timeframe: args.timeframe, + size: args.size, + legend: args.legend, + title: args.title + }; + create(graph_json, options, callback); + } else if (args._.length > 4 && subcommand === 'revoke') { + const embedId = args._[4]; + revoke(embedId, callback); + } else if (args._.length > 4 && subcommand === 'get') { + const embedId = args._[4]; + get(embedId, callback); + } else if (subcommand === 'getall') { + getAll(callback); + } else { + callback('unknown subcommand or arguments try `dogapi embed --help` for help', false); + } + } + }; }; diff --git a/lib/api/event.js b/lib/api/event.js index 3a31912..f92fb47 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -1,7 +1,7 @@ -const util = require("util"); +const util = require('util'); -module.exports = function (client) { - /*section: event +module.exports = function(client) { + /* section: event *comment: | * create a new event *params: @@ -42,25 +42,25 @@ module.exports = function (client) { * }); * ``` */ - function create(title, text, properties, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = properties; - properties = {}; - } - if (typeof properties !== "object") { - properties = {}; - } + function create(title, text, properties, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = properties; + properties = {}; + } + if (typeof properties !== 'object') { + properties = {}; + } - properties.title = title; - properties.text = text; + properties.title = title; + properties.text = text; - const params = { - body: properties - }; - client.request("POST", "/events", params, callback); - } + const params = { + body: properties + }; + client.request('POST', '/events', params, callback); + } - /*section: event + /* section: event *comment: | * get event details from the provided event id *params: @@ -81,11 +81,11 @@ module.exports = function (client) { * }); * ``` */ - function get(eventId, callback) { - client.request("GET", util.format("/events/%s", eventId), callback); - } + function get(eventId, callback) { + client.request('GET', util.format('/events/%s', eventId), callback); + } - /*section: event + /* section: event *comment: | * query the event stream *params: @@ -117,94 +117,94 @@ module.exports = function (client) { * }); * ``` */ - function query(start, end, parameters, callback) { - if (arguments.length < 4 && typeof argument[2] === "function") { - callback = parameters; - parameters = {}; - } + function query(start, end, parameters, callback) { + if (arguments.length < 4 && typeof argument[2] === 'function') { + callback = parameters; + parameters = {}; + } - if (typeof parameters !== "object") { - parameters = {} - } - parameters.start = start; - parameters.end = end; + if (typeof parameters !== 'object') { + parameters = {}; + } + parameters.start = start; + parameters.end = end; - const params = { - query: parameters - }; + const params = { + query: parameters + }; - client.request("GET", "/events", params, callback); - } + client.request('GET', '/events', params, callback); + } - return { - create: create, - get: get, - query: query, - getUsage: function () { - return [ - " dogapi event get <event-id>", - " dogapi event query <from> <to> [--priority <priority>] [--sources <sources>] [--tags <tags>]", - " dogapi event create <title> <text> [--time <timestamp>] [--priority <priority>] [--host <host>] [--tags <tags>] [--type <type>] [--agg-key <agg-key>] [--source <source>]" - ]; - }, - getHelp: function () { - return [ - "Event:", - " Subcommands:", - " get <event-id> get the event with the provided <event-id>", - " query <from> <to> query the event stream between <from> and <to> POSIX timestamps", - " create <title> <text> create a new event with <title> and <text>", - " Options:", - " --priority <priority> the priority of the event \"normal\" or \"low\"", - " --sources <sources> a comma separated list of sources (e.g. \"users,jenkins,chef\")", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --time <time> a POSIX timestamp for when the event happened", - " --host <host> the host to associate the event to", - " --type <type> the event type \"error\", \"warning\", \"info\" or \"success\"", - " --agg-key <agg-key> an aggregation key to use to associate like events", - " --source <source> the source to associate with this event (e.g. \"users\", \"jenkins\", etc)" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "get" && args._.length > 4) { - get(parseInt(args._[4]), callback); - } else if (subcommand === "query" && args._.length > 5) { - const from = parseInt(args._[4]); - const to = parseInt(args._[5]); - const parameters = {}; - if (args["sources"]) { - parameters.sources = args["sources"]; - } - if (args["tags"]) { - parameters.tags = args["tags"]; - } - query(from, to, parameters, callback); - } else if (subcommand === "create" && args._.length > 5) { - const title = args._[4]; - const text = args._[5]; - const properties = {}; - if (args["priority"]) { - properties.priority = args["priority"]; - } - if (args["host"]) { - properties.host = args["host"]; - } - if (args["time"]) { - properties.date_happened = parseInt(args["time"]); - } - if (args["tags"]) { - properties.tags = args["tags"].split(","); - } - if (args["agg-key"]) { - properties.aggregation_key = args["agg-key"]; - } - if (args["source"]) { - properties.source_type_name = args["source"]; - } - create(title, text, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi event --help` for help", false); - } + return { + create, + get, + query, + getUsage() { + return [ + ' dogapi event get <event-id>', + ' dogapi event query <from> <to> [--priority <priority>] [--sources <sources>] [--tags <tags>]', + ' dogapi event create <title> <text> [--time <timestamp>] [--priority <priority>] [--host <host>] [--tags <tags>] [--type <type>] [--agg-key <agg-key>] [--source <source>]' + ]; + }, + getHelp() { + return [ + 'Event:', + ' Subcommands:', + ' get <event-id> get the event with the provided <event-id>', + ' query <from> <to> query the event stream between <from> and <to> POSIX timestamps', + ' create <title> <text> create a new event with <title> and <text>', + ' Options:', + ' --priority <priority> the priority of the event "normal" or "low"', + ' --sources <sources> a comma separated list of sources (e.g. "users,jenkins,chef")', + ' --tags <tags> a comma separated list of "tag:value"\'s', + ' --time <time> a POSIX timestamp for when the event happened', + ' --host <host> the host to associate the event to', + ' --type <type> the event type "error", "warning", "info" or "success"', + ' --agg-key <agg-key> an aggregation key to use to associate like events', + ' --source <source> the source to associate with this event (e.g. "users", "jenkins", etc)' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'get' && args._.length > 4) { + get(parseInt(args._[4]), callback); + } else if (subcommand === 'query' && args._.length > 5) { + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const parameters = {}; + if (args.sources) { + parameters.sources = args.sources; } - }; + if (args.tags) { + parameters.tags = args.tags; + } + query(from, to, parameters, callback); + } else if (subcommand === 'create' && args._.length > 5) { + const title = args._[4]; + const text = args._[5]; + const properties = {}; + if (args.priority) { + properties.priority = args.priority; + } + if (args.host) { + properties.host = args.host; + } + if (args.time) { + properties.date_happened = parseInt(args.time); + } + if (args.tags) { + properties.tags = args.tags.split(','); + } + if (args['agg-key']) { + properties.aggregation_key = args['agg-key']; + } + if (args.source) { + properties.source_type_name = args.source; + } + create(title, text, properties, callback); + } else { + callback('unknown subcommand or arguments try `dogapi event --help` for help', false); + } + } + }; }; diff --git a/lib/api/graph.js b/lib/api/graph.js index fd2906e..2390f47 100644 --- a/lib/api/graph.js +++ b/lib/api/graph.js @@ -1,9 +1,9 @@ -const Embed = require("./embed"); +const Embed = require('./embed'); -module.exports = function (client) { - const embed = Embed(client); +module.exports = function(client) { + const embed = Embed(client); - /*section: graph + /* section: graph *comment: take a snapshot of a metric query *params: * query: the metric query to use for the snapshot @@ -27,52 +27,50 @@ module.exports = function (client) { * }); * ``` */ - function snapshot(query, from, to, eventQuery, callback) { - if (arguments.length < 5 && typeof arguments[3] === "function") { - callback = eventQuery; - eventQuery = undefined; - } - const params = { - query: { - metric_query: query, - start: parseInt(from), - end: parseInt(to) - } - }; - if (eventQuery) { - params.query.event_query = eventQuery; - } - - client.request("GET", "/graph/snapshot", params, callback); + function snapshot(query, from, to, eventQuery, callback) { + if (arguments.length < 5 && typeof arguments[3] === 'function') { + callback = eventQuery; + eventQuery = undefined; } - - return { - snapshot: snapshot, - createEmbed: embed.create, - getUsage: function () { - return [ - " dogapi graph snapshot <query> <from> <to> [--events <event-query>]" - ]; - }, - getHelp: function () { - return [ - "Graph:", - " Subcommands:", - " snapshot <query> <from> <to> --events <event-query> | take a snapshot of a graph", - " Options:", - " --events <event-query> a query for event bands to add to the snapshot" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (args._.length > 5 && subcommand === "snapshot") { - const query = args._[4]; - const from = parseInt(args._[5]); - const to = parseInt(args._[6]); - const eventQuery = args["events"]; - snapshot(query, from, to, eventQuery, callback); - } else { - callback("unknown subcommand or arguments try `dogapi graph --help` for help", false); - } - } + const params = { + query: { + metric_query: query, + start: parseInt(from), + end: parseInt(to) + } }; + if (eventQuery) { + params.query.event_query = eventQuery; + } + + client.request('GET', '/graph/snapshot', params, callback); + } + + return { + snapshot, + createEmbed: embed.create, + getUsage() { + return [' dogapi graph snapshot <query> <from> <to> [--events <event-query>]']; + }, + getHelp() { + return [ + 'Graph:', + ' Subcommands:', + ' snapshot <query> <from> <to> --events <event-query> | take a snapshot of a graph', + ' Options:', + ' --events <event-query> a query for event bands to add to the snapshot' + ]; + }, + handleCli(subcommand, args, callback) { + if (args._.length > 5 && subcommand === 'snapshot') { + const query = args._[4]; + const from = parseInt(args._[5]); + const to = parseInt(args._[6]); + const eventQuery = args.events; + snapshot(query, from, to, eventQuery, callback); + } else { + callback('unknown subcommand or arguments try `dogapi graph --help` for help', false); + } + } + }; }; diff --git a/lib/api/host.js b/lib/api/host.js index d6a597d..3b639e7 100644 --- a/lib/api/host.js +++ b/lib/api/host.js @@ -1,7 +1,7 @@ -const util = require("util"); +const util = require('util'); -module.exports = function (client) { - /*section: host +module.exports = function(client) { + /* section: host *comment: mute the given host, if it is not already muted *params: * hostname: the hostname of the host to mute @@ -23,27 +23,27 @@ module.exports = function (client) { * }); * ``` */ - function mute(hostname, options, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = options; - options = {}; - } - const params = {}; - if (typeof options === "object") { - params.body = {}; // create body property - if (options.end) { - params.body.end = parseInt(options.end); - } - if (options.override) { - params.body.override = options.override; - } - } else { - params.body = ""; // create empty body - } - client.request("POST", util.format("/host/%s/mute", hostname), params, callback); + function mute(hostname, options, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = options; + options = {}; + } + const params = {}; + if (typeof options === 'object') { + params.body = {}; // create body property + if (options.end) { + params.body.end = parseInt(options.end); + } + if (options.override) { + params.body.override = options.override; + } + } else { + params.body = ''; // create empty body } + client.request('POST', util.format('/host/%s/mute', hostname), params, callback); + } - /*section: host + /* section: host *comment: unmute the given host, if it is not already unmuted *params: * hostname: the hostname of the host to unmute @@ -61,49 +61,49 @@ module.exports = function (client) { * }); * ``` */ - function unmute(hostname, callback) { - const params = { body: "" }; // create empty body - client.request("POST", util.format("/host/%s/unmute", hostname), params, callback); - } + function unmute(hostname, callback) { + const params = {body: ''}; // create empty body + client.request('POST', util.format('/host/%s/unmute', hostname), params, callback); + } - return { - mute: mute, - unmute: unmute, - getUsage: function () { - return [ - " dogapi host mute <host> [--end <end>] [--override]", - " dogapi host unmute <host>" - ]; - }, - getHelp: function () { - return [ - "Host:", - " Subcommands:", - " mute <host> mute the host with the provided hostname", - " unmute <host> unmute the host with the provided hostname", - "", - " Options:", - " --end <end> POSIX timestamp for when the mute should end", - " --override override an existing \"end\" for a mute on a host" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "mute") { - const hostname = args._[4]; - const options = {}; - if (args["end"]) { - options.end = parseInt(args["end"]); - } - if (args["override"]) { - options.override = args["override"]; - } - mute(hostname, options, callback); - } else if (subcommand === "unmute") { - const hostname = args._[4]; - unmute(hostname, callback); - } else { - callback("unknown subcommand or arguments try `dogapi host --help` for help", false); - } + return { + mute, + unmute, + getUsage() { + return [ + ' dogapi host mute <host> [--end <end>] [--override]', + ' dogapi host unmute <host>' + ]; + }, + getHelp() { + return [ + 'Host:', + ' Subcommands:', + ' mute <host> mute the host with the provided hostname', + ' unmute <host> unmute the host with the provided hostname', + '', + ' Options:', + ' --end <end> POSIX timestamp for when the mute should end', + ' --override override an existing "end" for a mute on a host' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'mute') { + const hostname = args._[4]; + const options = {}; + if (args.end) { + options.end = parseInt(args.end); + } + if (args.override) { + options.override = args.override; } - }; + mute(hostname, options, callback); + } else if (subcommand === 'unmute') { + const hostname = args._[4]; + unmute(hostname, callback); + } else { + callback('unknown subcommand or arguments try `dogapi host --help` for help', false); + } + } + }; }; diff --git a/lib/api/index.js b/lib/api/index.js index cc81266..5d9b0f1 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -1,17 +1,17 @@ module.exports = { - comment: require("./comment"), - downtime: require("./downtime"), - embed: require("./embed"), - event: require("./event"), - graph: require("./graph"), - host: require("./host"), - infrastructure: require("./infrastructure"), - metric: require("./metric"), - monitor: require("./monitor"), - screenboard: require("./screenboard"), - search: require("./search"), - serviceCheck: require("./serviceCheck"), - tag: require("./tag"), - timeboard: require("./timeboard"), - user: require("./user"), + comment: require('./comment'), + downtime: require('./downtime'), + embed: require('./embed'), + event: require('./event'), + graph: require('./graph'), + host: require('./host'), + infrastructure: require('./infrastructure'), + metric: require('./metric'), + monitor: require('./monitor'), + screenboard: require('./screenboard'), + search: require('./search'), + serviceCheck: require('./serviceCheck'), + tag: require('./tag'), + timeboard: require('./timeboard'), + user: require('./user') }; diff --git a/lib/api/infrastructure.js b/lib/api/infrastructure.js index 25caa6b..89ad706 100644 --- a/lib/api/infrastructure.js +++ b/lib/api/infrastructure.js @@ -1,6 +1,5 @@ -module.exports = function (client) { - - /*section: infrastructure +module.exports = function(client) { + /* section: infrastructure *comment: | * search for metrics or hosts *params: @@ -21,32 +20,30 @@ module.exports = function (client) { * }); * ``` */ - function search(query, callback) { - const params = { - query: { - q: query - } - }; + function search(query, callback) { + const params = { + query: { + q: query + } + }; - client.request("GET", "/search", params, callback); + client.request('GET', '/search', params, callback); + } + return { + search, + getUsage() { + return [' dogapi infrastructure search <query>']; + }, + getHelp() { + return [ + 'Infrastructure:', + ' Subcommands:', + ' search <query> query for hosts or metrics with <query> (see http://docs.datadoghq.com/api/#search)' + ]; + }, + handleCli(subcommand, args, callback) { + const query = args._[4]; + search(query, callback); } - return { - search: search, - getUsage: function () { - return [ - " dogapi infrastructure search <query>" - ] - }, - getHelp: function () { - return [ - "Infrastructure:", - " Subcommands:", - " search <query> query for hosts or metrics with <query> (see http://docs.datadoghq.com/api/#search)", - ]; - }, - handleCli: function (subcommand, args, callback) { - const query = args._[4]; - search(query, callback); - } - }; + }; }; diff --git a/lib/api/metric.js b/lib/api/metric.js index c8150f5..7c47c9f 100644 --- a/lib/api/metric.js +++ b/lib/api/metric.js @@ -1,6 +1,5 @@ -module.exports = function (client) { - - /*section: metric +module.exports = function(client) { + /* section: metric *comment: | * submit a new metric *params: @@ -38,27 +37,27 @@ module.exports = function (client) { * }); * ``` */ - function send(metric, points, extra, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = extra; - extra = {}; - } - extra = extra || {}; - const series = [ - { - metric: metric, - points: points, - host: extra.host, - tags: extra.tags, - // DEV: For backwards compatibility, allow `metric_type` - type: extra.type || extra.metric_type - } - ]; - - send_all(series, callback); + function send(metric, points, extra, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = extra; + extra = {}; } + extra = extra || {}; + const series = [ + { + metric, + points, + host: extra.host, + tags: extra.tags, + // DEV: For backwards compatibility, allow `metric_type` + type: extra.type || extra.metric_type + } + ]; + + send_all(series, callback); + } - /*section: metric + /* section: metric *comment: | * send a list of metrics *params: @@ -100,48 +99,48 @@ module.exports = function (client) { * }); * ``` */ - function send_all(metrics, callback) { - const now = parseInt(new Date().getTime() / 1000); - for (let i = 0; i < metrics.length; ++i) { - // Try to normalize `points` - // DEV: We need `points` to be an array of arrays regardless of what they give us - // Always wrap points in an array, this way we will get: - // 500 => [500] - // [500, 100] => [[<timestamp>, 500], [<timestamp>, 1000]] - // [[<timestamp>, 500]] => [[<timestamp>, 500]] - let points = metrics[i].points; - if (!Array.isArray(metrics[i].points)) { - points = [points]; - } - points = points.map(function (point) { - // Make sure each point is an array, if not make array with current timestamp - // 500 => [<timestamp>, 500] - // [<timestamp>, 500] => unchanged - if (!Array.isArray(point)) { - const now = parseInt(new Date().getTime() / 1000); - point = [now, point]; - } - return point; - }); - - metrics[i].points = points; - - // DEV: Change `metric_type` to `type` for backwards compatibility - metrics[i].type = metrics[i].type || metrics[i].metric_type; - // Remove `metric_type` if it was set - // DEV: This will not cause an error if `metric_type` does not exist - delete metrics[i].metric_type; + function send_all(metrics, callback) { + const now = parseInt(new Date().getTime() / 1000); + for (let i = 0; i < metrics.length; ++i) { + // Try to normalize `points` + // DEV: We need `points` to be an array of arrays regardless of what they give us + // Always wrap points in an array, this way we will get: + // 500 => [500] + // [500, 100] => [[<timestamp>, 500], [<timestamp>, 1000]] + // [[<timestamp>, 500]] => [[<timestamp>, 500]] + let points = metrics[i].points; + if (!Array.isArray(metrics[i].points)) { + points = [points]; + } + points = points.map(function(point) { + // Make sure each point is an array, if not make array with current timestamp + // 500 => [<timestamp>, 500] + // [<timestamp>, 500] => unchanged + if (!Array.isArray(point)) { + const now = parseInt(new Date().getTime() / 1000); + point = [now, point]; } + return point; + }); + + metrics[i].points = points; - const params = { - body: { - series: metrics - } - }; - client.request("POST", "/series", params, callback); + // DEV: Change `metric_type` to `type` for backwards compatibility + metrics[i].type = metrics[i].type || metrics[i].metric_type; + // Remove `metric_type` if it was set + // DEV: This will not cause an error if `metric_type` does not exist + delete metrics[i].metric_type; } - /*section: metric + const params = { + body: { + series: metrics + } + }; + client.request('POST', '/series', params, callback); + } + + /* section: metric *comment: | * make a metric query *params: @@ -165,57 +164,57 @@ module.exports = function (client) { * }); * ``` */ - function query(from, to, query, callback) { - const params = { - query: { - from: from, - to: to, - query: query - } - }; - client.request("GET", "/query", params, callback); - } + function query(from, to, query, callback) { + const params = { + query: { + from, + to, + query + } + }; + client.request('GET', '/query', params, callback); + } - return { - send: send, - send_all: send_all, - query: query, - getUsage: function () { - return [ - " dogapi metric send <metric> <point> [--tags <tags>] [--host <host>] [--type <type>]", - " dogapi metric query <from> <to> <query>" - ] - }, - getHelp: function () { - return [ - "Metric:", - " Subcommands:", - " send <metric> <point> add a new datapoint for <metric> for right now", - " query <from> <to> <query> query for <query> between <from> and <to> POSIX timestamps", - "", - " Options:", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --host <host> the hostname that should be associated with this metric", - " --type <type> the type of metric \"gauge\" or \"count\"" - ] - }, - handleCli: function (subcommand, args, callback) { - if (args._.length > 5 && subcommand === "send") { - const extra = {}; - if (args.tags) { - extra.tags = args.tags.split(","); - } - extra.host = args.host; - extra.type = args.type; - send(args._[4], args._[5], extra, callback); - } else if (subcommand === "query" && args._.length > 6) { - const from = parseInt(args._[4]); - const to = parseInt(args._[5]); - const q = args._[6]; - query(from, to, q, callback); - } else { - callback("unknown subcommand or arguments try `dogapi metric --help` for help", false); - } + return { + send, + send_all, + query, + getUsage() { + return [ + ' dogapi metric send <metric> <point> [--tags <tags>] [--host <host>] [--type <type>]', + ' dogapi metric query <from> <to> <query>' + ]; + }, + getHelp() { + return [ + 'Metric:', + ' Subcommands:', + ' send <metric> <point> add a new datapoint for <metric> for right now', + ' query <from> <to> <query> query for <query> between <from> and <to> POSIX timestamps', + '', + ' Options:', + ' --tags <tags> a comma separated list of "tag:value"\'s', + ' --host <host> the hostname that should be associated with this metric', + ' --type <type> the type of metric "gauge" or "count"' + ]; + }, + handleCli(subcommand, args, callback) { + if (args._.length > 5 && subcommand === 'send') { + const extra = {}; + if (args.tags) { + extra.tags = args.tags.split(','); } - }; + extra.host = args.host; + extra.type = args.type; + send(args._[4], args._[5], extra, callback); + } else if (subcommand === 'query' && args._.length > 6) { + const from = parseInt(args._[4]); + const to = parseInt(args._[5]); + const q = args._[6]; + query(from, to, q, callback); + } else { + callback('unknown subcommand or arguments try `dogapi metric --help` for help', false); + } + } + }; }; diff --git a/lib/api/monitor.js b/lib/api/monitor.js index 9f36def..7d31351 100644 --- a/lib/api/monitor.js +++ b/lib/api/monitor.js @@ -1,8 +1,7 @@ -const util = require("util"); +const util = require('util'); -module.exports = function(client){ - - /*section: monitor +module.exports = function(client) { + /* section: monitor *comment: create a new monitor *params: * type: one of "metric alert" or "service check" @@ -29,37 +28,37 @@ module.exports = function(client){ * }); * ``` */ - function create(type, query, properties, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = properties; - properties = {}; - } - - const params = { - body: { - type: type, - query: query - } - }; - - if(typeof properties === "object"){ - if(properties.name){ - params.body.name = properties.name; - } - if(properties.message){ - params.body.message = properties.message; - } - if(properties.tags){ - params.body.tags = properties.tags; - } - if(typeof properties.options === "object"){ - params.body.options = properties.options; - } - } - client.request("POST", "/monitor", params, callback); + function create(type, query, properties, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = properties; + properties = {}; + } + + const params = { + body: { + type, + query + } + }; + + if (typeof properties === 'object') { + if (properties.name) { + params.body.name = properties.name; + } + if (properties.message) { + params.body.message = properties.message; + } + if (properties.tags) { + params.body.tags = properties.tags; + } + if (typeof properties.options === 'object') { + params.body.options = properties.options; + } } - - /*section: monitor + client.request('POST', '/monitor', params, callback); + } + + /* section: monitor *comment: get an existing monitor's details *params: * monitorId: the id of the monitor @@ -78,23 +77,23 @@ module.exports = function(client){ * }); * ``` */ - function get(monitorId, groupStates, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = groupStates; - groupStates = undefined; - } - - const params = {}; - if(groupStates){ - params.query = { - group_states: groupStates.join(",") - }; - } - - client.request("GET", util.format("/monitor/%s", monitorId), params, callback); + function get(monitorId, groupStates, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = groupStates; + groupStates = undefined; } - - /*section: monitor + + const params = {}; + if (groupStates) { + params.query = { + group_states: groupStates.join(',') + }; + } + + client.request('GET', util.format('/monitor/%s', monitorId), params, callback); + } + + /* section: monitor *comment: get all monitors *params: * options: | @@ -116,28 +115,28 @@ module.exports = function(client){ * }); * ``` */ - function getAll(options, callback){ - if(arguments.length < 2 && typeof arguments[0] === "function"){ - callback = options; - options = {}; - } - const params = {}; - if(typeof options === "object"){ - params.query = {}; - if(options.group_states){ - params.query.group_states = options.group_states.join(","); - } - if(options.tags){ - params.query.tags = options.tags.join(","); - } - if(options.monitor_tags){ - params.query.monitor_tags = options.monitor_tags.join(","); - } - } - client.request("GET", "/monitor", params, callback); + function getAll(options, callback) { + if (arguments.length < 2 && typeof arguments[0] === 'function') { + callback = options; + options = {}; + } + const params = {}; + if (typeof options === 'object') { + params.query = {}; + if (options.group_states) { + params.query.group_states = options.group_states.join(','); + } + if (options.tags) { + params.query.tags = options.tags.join(','); + } + if (options.monitor_tags) { + params.query.monitor_tags = options.monitor_tags.join(','); + } } - - /*section: monitor + client.request('GET', '/monitor', params, callback); + } + + /* section: monitor *comment: update a monitor's details *params: * monitorId: the id of the monitor to edit @@ -163,36 +162,36 @@ module.exports = function(client){ * }); * ``` */ - function update(monitorId, query, properties, callback){ - if(arguments.length < 4 && typeof arguments[2] === "function"){ - callback = properties; - properties = {}; - } - - const params = { - body: { - query: query - } - }; - - if(typeof properties === "object"){ - if(properties.name){ - params.body.name = properties.name; - } - if(properties.message){ - params.body.message = properties.message; - } - if(properties.tags){ - params.body.tags = properties.tags; - } - if(typeof properties.options === "object"){ - params.body.options = properties.options; - } - } - client.request("PUT", util.format("/monitor/%s", monitorId), params, callback); + function update(monitorId, query, properties, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = properties; + properties = {}; } - - /*section: monitor + + const params = { + body: { + query + } + }; + + if (typeof properties === 'object') { + if (properties.name) { + params.body.name = properties.name; + } + if (properties.message) { + params.body.message = properties.message; + } + if (properties.tags) { + params.body.tags = properties.tags; + } + if (typeof properties.options === 'object') { + params.body.options = properties.options; + } + } + client.request('PUT', util.format('/monitor/%s', monitorId), params, callback); + } + + /* section: monitor *comment: delete an existing monitor *params: * monitorId: the id of the monitor to remove @@ -210,11 +209,11 @@ module.exports = function(client){ * }); * ``` */ - function remove(monitorId, callback){ - client.request("DELETE", util.format("/monitor/%s", monitorId), callback); - } - - /*section: monitor + function remove(monitorId, callback) { + client.request('DELETE', util.format('/monitor/%s', monitorId), callback); + } + + /* section: monitor *comment: mute an existing monitor *params: * monitorId: the id of the monitor to mute @@ -236,27 +235,27 @@ module.exports = function(client){ * }); * ``` */ - function mute(monitorId, options, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = options; - options = {}; - } - const params = {}; - if(typeof options === "object"){ - params.body = {}; - if(options.scope){ - params.body.scope = options.scope; - } - if(options.end){ - params.body.end = parseInt(options.end); - } - } else { - params.body = ""; // create empty body - } - client.request("POST", util.format("/monitor/%s/mute", monitorId), params, callback); + function mute(monitorId, options, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = options; + options = {}; + } + const params = {}; + if (typeof options === 'object') { + params.body = {}; + if (options.scope) { + params.body.scope = options.scope; + } + if (options.end) { + params.body.end = parseInt(options.end); + } + } else { + params.body = ''; // create empty body } - - /*section: monitor + client.request('POST', util.format('/monitor/%s/mute', monitorId), params, callback); + } + + /* section: monitor *comment: mute all monitors *params: * callback: function(err, res) @@ -273,11 +272,11 @@ module.exports = function(client){ * }); * ``` */ - function muteAll(callback){ - client.request("POST", "/monitor/mute_all", callback); - } - - /*section: monitor + function muteAll(callback) { + client.request('POST', '/monitor/mute_all', callback); + } + + /* section: monitor *comment: unmute an existing monitor *params: * monitorId: the id of the monitor to unmute @@ -296,23 +295,23 @@ module.exports = function(client){ * }); * ``` */ - function unmute(monitorId, scope, callback){ - if(arguments.length < 3 && typeof arguments[1] === "function"){ - callback = scope; - scope = undefined; - } - const params = {}; - if(scope){ - params.body = { - scope: scope - }; - } else { - params.body = ""; // create empty body - } - client.request("POST", util.format("/monitor/%s/unmute", monitorId), params, callback); + function unmute(monitorId, scope, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = scope; + scope = undefined; + } + const params = {}; + if (scope) { + params.body = { + scope + }; + } else { + params.body = ''; // create empty body } - - /*section: monitor + client.request('POST', util.format('/monitor/%s/unmute', monitorId), params, callback); + } + + /* section: monitor *comment: unmute all monitors *params: * callback: function(err, res) @@ -329,128 +328,128 @@ module.exports = function(client){ * }); * ``` */ - function unmuteAll(callback){ - client.request("POST", "/monitor/unmute_all", callback); - } - - return { - create: create, - get: get, - update: update, - remove: remove, - getAll: getAll, - mute: mute, - muteAll: muteAll, - unmute: unmute, - unmuteAll: unmuteAll, - getUsage: function(){ - return [ - " dogapi monitor create <type> <query> [--name <name>] [--message <message>]", - " dogapi monitor get <monitor-id> [--states <states>]", - " dogapi monitor getall [--states <states>] [--tags <tags>]", - " dogapi monitor mute <monitor-id> [--scope <scope>] [--end <end>]", - " dogapi monitor muteall", - " dogapi monitor remove <monitor-id>", - " dogapi monitor unmute <monitor-id> [--scope <scope>]", - " dogapi monitor unmuteall", - " dogapi monitor update <monitor-id> <query> [--name <name>] [--message <message>]" - ]; - }, - getHelp: function(){ - return [ - "Monitor:", - " Subcommands:", - " create <type> <query> create a new monitor", - " get <monitor-id> get a monitors details", - " getall get a list of all monitors", - " mute <monitor-id> mute the monitor with the id <monitor-id>", - " muteall mute all monitors", - " remove <monitor-id> delete the monitor with the id <monitor-id>", - " unmute <monitor-id> unmute the monitor with the id <monitor-id>", - " unmuteall unmute all monitors", - " update <monitor-id> <query> update an existing monitor", - "", - " Options:", - " --states <states> a comma separated list containing any of \"all\", \"alert\", \"warn\", or \"no data\"", - " --tags <tags> a comma separated list of \"tag:value\"'s", - " --scope <scope> the scope of the monitor to mute (e.g. \"role:db\")", - " --end <end> POSIX timestamp for when the mute should end", - " --name <name> the name for the monitor", - " --message <message> the message for the monitor" - ]; - }, - handleCli: function(subcommand, args, callback){ - const states = []; - if(args["states"]){ - states = args["states"].split(","); - } - - const tags = []; - if(args["tags"]){ - tags = args["tags"].split(","); - } - - const name = args["name"]; - const message = args["message"]; - - if(subcommand === "get"){ - const monitorId = args._[4]; - get(monitorId, states, callback); - } else if(subcommand === "getall"){ - const options = {}; - if(states.length){ - options.group_states = states; - } - if(tags.length){ - options.tags = tags; - } - getAll(options, callback); - } else if(subcommand === "mute"){ - const monitorId = args._[4]; - const options = {}; - if(args["scope"]){ - options.scope = args["scope"]; - } - if(args["end"]){ - options.end = args["end"]; - } - mute(monitorId, options, callback); - } else if(subcommand === "unmute"){ - const monitorId = args._[4]; - const scope = args["scope"]; - unmute(monitorId, scope, callback); - } else if(subcommand === "unmuteall"){ - unmuteAll(callback); - } else if(subcommand === "muteall"){ - muteAll(callback); - } else if(subcommand === "remove"){ - const monitorId = args._[4]; - remove(monitorId, callback); - } else if(subcommand === "create" && args._.length > 5){ - const type = args._[4]; - const query = args._[5]; - const properties = {}; - if(name){ - properties.name = name; - } - if(message){ - properties.message = message; - } - create(type, query, properties, callback); - } else if(subcommand === "update" && args._.length > 5){ - const monitorId = args._[4]; - const query = args._[5]; - const properties = {}; - if(name){ - properties.name = name; - } - if(message){ - properties.message = message; - } - update(monitorId, query, properties, callback); - } else { - callback("unknown subcommand or arguments try `dogapi monitor --help` for help", false); - } + function unmuteAll(callback) { + client.request('POST', '/monitor/unmute_all', callback); + } + + return { + create, + get, + update, + remove, + getAll, + mute, + muteAll, + unmute, + unmuteAll, + getUsage() { + return [ + ' dogapi monitor create <type> <query> [--name <name>] [--message <message>]', + ' dogapi monitor get <monitor-id> [--states <states>]', + ' dogapi monitor getall [--states <states>] [--tags <tags>]', + ' dogapi monitor mute <monitor-id> [--scope <scope>] [--end <end>]', + ' dogapi monitor muteall', + ' dogapi monitor remove <monitor-id>', + ' dogapi monitor unmute <monitor-id> [--scope <scope>]', + ' dogapi monitor unmuteall', + ' dogapi monitor update <monitor-id> <query> [--name <name>] [--message <message>]' + ]; + }, + getHelp() { + return [ + 'Monitor:', + ' Subcommands:', + ' create <type> <query> create a new monitor', + ' get <monitor-id> get a monitors details', + ' getall get a list of all monitors', + ' mute <monitor-id> mute the monitor with the id <monitor-id>', + ' muteall mute all monitors', + ' remove <monitor-id> delete the monitor with the id <monitor-id>', + ' unmute <monitor-id> unmute the monitor with the id <monitor-id>', + ' unmuteall unmute all monitors', + ' update <monitor-id> <query> update an existing monitor', + '', + ' Options:', + ' --states <states> a comma separated list containing any of "all", "alert", "warn", or "no data"', + ' --tags <tags> a comma separated list of "tag:value"\'s', + ' --scope <scope> the scope of the monitor to mute (e.g. "role:db")', + ' --end <end> POSIX timestamp for when the mute should end', + ' --name <name> the name for the monitor', + ' --message <message> the message for the monitor' + ]; + }, + handleCli(subcommand, args, callback) { + const states = []; + if (args.states) { + states = args.states.split(','); + } + + const tags = []; + if (args.tags) { + tags = args.tags.split(','); + } + + const name = args.name; + const message = args.message; + + if (subcommand === 'get') { + const monitorId = args._[4]; + get(monitorId, states, callback); + } else if (subcommand === 'getall') { + const options = {}; + if (states.length) { + options.group_states = states; } - }; + if (tags.length) { + options.tags = tags; + } + getAll(options, callback); + } else if (subcommand === 'mute') { + const monitorId = args._[4]; + const options = {}; + if (args.scope) { + options.scope = args.scope; + } + if (args.end) { + options.end = args.end; + } + mute(monitorId, options, callback); + } else if (subcommand === 'unmute') { + const monitorId = args._[4]; + const scope = args.scope; + unmute(monitorId, scope, callback); + } else if (subcommand === 'unmuteall') { + unmuteAll(callback); + } else if (subcommand === 'muteall') { + muteAll(callback); + } else if (subcommand === 'remove') { + const monitorId = args._[4]; + remove(monitorId, callback); + } else if (subcommand === 'create' && args._.length > 5) { + const type = args._[4]; + const query = args._[5]; + const properties = {}; + if (name) { + properties.name = name; + } + if (message) { + properties.message = message; + } + create(type, query, properties, callback); + } else if (subcommand === 'update' && args._.length > 5) { + const monitorId = args._[4]; + const query = args._[5]; + const properties = {}; + if (name) { + properties.name = name; + } + if (message) { + properties.message = message; + } + update(monitorId, query, properties, callback); + } else { + callback('unknown subcommand or arguments try `dogapi monitor --help` for help', false); + } + } + }; }; diff --git a/lib/api/screenboard.js b/lib/api/screenboard.js index b4253b7..57de1ed 100644 --- a/lib/api/screenboard.js +++ b/lib/api/screenboard.js @@ -1,8 +1,8 @@ -const json = require("../json"); -const util = require("util"); +const util = require('util'); +const json = require('../json'); -module.exports = function (client) { - /*section: screenboard +module.exports = function(client) { + /* section: screenboard *comment: create a new screenboard *params: * boardTitle: the name of the screenboard @@ -56,42 +56,42 @@ module.exports = function (client) { * ); * ``` */ - function create(boardTitle, widgets, options, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = options; - options = {}; - } - if (typeof options !== "object") { - options = {}; - } - - const params = { - body: { - board_title: boardTitle, - widgets: widgets - } - }; + function create(boardTitle, widgets, options, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = options; + options = {}; + } + if (typeof options !== 'object') { + options = {}; + } - if (options.description) { - params.body.description = options.description; - } - if (options.templateVariables) { - params.body.template_variables = options.templateVariables; - } - if (options.width) { - params.body.width = options.width; - } - if (options.height) { - params.body.height = options.height; - } - if (options.readOnly) { - params.body.read_only = options.readOnly; - } + const params = { + body: { + board_title: boardTitle, + widgets + } + }; - client.request("POST", "/screen", params, callback); + if (options.description) { + params.body.description = options.description; + } + if (options.templateVariables) { + params.body.template_variables = options.templateVariables; + } + if (options.width) { + params.body.width = options.width; + } + if (options.height) { + params.body.height = options.height; + } + if (options.readOnly) { + params.body.read_only = options.readOnly; } - /*section: screenboard + client.request('POST', '/screen', params, callback); + } + + /* section: screenboard *comment: update an existing screenboard *params: * boardId: the id of the screenboard to update @@ -139,42 +139,42 @@ module.exports = function (client) { * ); * ``` */ - function update(boardId, boardTitle, widgets, options, callback) { - if (arguments.length < 5 && typeof arguments[3] === "function") { - callback = options; - options = {}; - } - if (typeof options !== "object") { - options = {}; - } - - const params = { - body: { - board_title: boardTitle, - widgets: widgets - } - }; + function update(boardId, boardTitle, widgets, options, callback) { + if (arguments.length < 5 && typeof arguments[3] === 'function') { + callback = options; + options = {}; + } + if (typeof options !== 'object') { + options = {}; + } - if (options.description) { - params.body.description = options.description; - } - if (options.templateVariables) { - params.body.template_variables = options.templateVariables; - } - if (options.width) { - params.body.width = options.width; - } - if (options.height) { - params.body.height = options.height; - } - if (options.readOnly) { - params.body.read_only = options.readOnly; - } + const params = { + body: { + board_title: boardTitle, + widgets + } + }; - client.request("PUT", util.format("/screen/%s", boardId), params, callback); + if (options.description) { + params.body.description = options.description; + } + if (options.templateVariables) { + params.body.template_variables = options.templateVariables; + } + if (options.width) { + params.body.width = options.width; + } + if (options.height) { + params.body.height = options.height; } + if (options.readOnly) { + params.body.read_only = options.readOnly; + } + + client.request('PUT', util.format('/screen/%s', boardId), params, callback); + } - /*section: screenboard + /* section: screenboard *comment: delete an existing screenboard *params: * boardId: the id of the screenboard to delete @@ -192,11 +192,11 @@ module.exports = function (client) { * }); * ``` */ - function remove(boardId, callback) { - client.request("DELETE", util.format("/screen/%s", boardId), callback); - } + function remove(boardId, callback) { + client.request('DELETE', util.format('/screen/%s', boardId), callback); + } - /*section: screenboard + /* section: screenboard *comment: get the info of a single existing screenboard *params: * boardId: the id of the screenboard to fetch @@ -214,11 +214,11 @@ module.exports = function (client) { * }); * ``` */ - function get(boardId, callback) { - client.request("GET", util.format("/screen/%s", boardId), callback); - } + function get(boardId, callback) { + client.request('GET', util.format('/screen/%s', boardId), callback); + } - /*section: screenboard + /* section: screenboard *comment: get all existing screenboards *params: * callback: function(err, res) @@ -235,11 +235,11 @@ module.exports = function (client) { * }); * ``` */ - function getAll(callback) { - client.request("GET", "/screen", callback); - } + function getAll(callback) { + client.request('GET', '/screen', callback); + } - /*section: screenboard + /* section: screenboard *comment: share an existing screenboard *params: * boardId: the id of the screenboard to share @@ -257,95 +257,94 @@ module.exports = function (client) { * }); * ``` */ - function share(boardId, callback) { - client.request("POST", util.format("/screen/share/%s", boardId), callback); - } + function share(boardId, callback) { + client.request('POST', util.format('/screen/share/%s', boardId), callback); + } + return { + create, + remove, + update, + get, + getAll, + share, + getUsage() { + return [ + ' dogapi screenboard create <boardTitle> <widgets> [--description <description>] [--tmpvars <templateVariables>] [--width <width>] [--height <height>]', + ' dogapi screenboard remove <boardId>', + ' dogapi screenboard get <boardId>', + ' dogapi screenboard getall', + ' dogapi screenboard share <boardId>' + ]; + }, + getHelp() { + return [ + 'Screenboard:', + ' Subcommands:', + ' create <boardTitle> <widgets> create a new screenboard, <widgets> is a json of the graph definition', + ' update <boardId> <boardTitle> <widgets> update a screenboard', + ' remove <boardId> remove an existing screenboard', + ' get <boardId> get an existing screenboard', + ' getall get all screenboards', + ' share <boardId> get share info for an existing screenboard', + ' Options:', + " --description <description> a description of the screenboard's content", + ' --tmpvars <templateVariables> json representation of the template variable definition', + ' --width <width> width of the screenboard in pixels', + ' --height <height> height of the screenboard in pixels' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'get') { + get(args._[4], callback); + } else if (subcommand === 'getall') { + getAll(callback); + } else if (subcommand === 'remove') { + remove(args._[4], callback); + } else if (subcommand === 'share') { + share(args._[4], callback); + } else if (subcommand === 'update') { + const boardId = args._[4]; + const boardTitle = args._[5]; + const widgets = json.parse(args._[6]); - return { - create: create, - remove: remove, - update: update, - get: get, - getAll: getAll, - share: share, - getUsage: function () { - return [ - " dogapi screenboard create <boardTitle> <widgets> [--description <description>] [--tmpvars <templateVariables>] [--width <width>] [--height <height>]", - " dogapi screenboard remove <boardId>", - " dogapi screenboard get <boardId>", - " dogapi screenboard getall", - " dogapi screenboard share <boardId>" - ]; - }, - getHelp: function () { - return [ - "Screenboard:", - " Subcommands:", - " create <boardTitle> <widgets> create a new screenboard, <widgets> is a json of the graph definition", - " update <boardId> <boardTitle> <widgets> update a screenboard", - " remove <boardId> remove an existing screenboard", - " get <boardId> get an existing screenboard", - " getall get all screenboards", - " share <boardId> get share info for an existing screenboard", - " Options:", - " --description <description> a description of the screenboard's content", - " --tmpvars <templateVariables> json representation of the template variable definition", - " --width <width> width of the screenboard in pixels", - " --height <height> height of the screenboard in pixels", - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "get") { - get(args._[4], callback); - } else if (subcommand === "getall") { - getAll(callback); - } else if (subcommand === "remove") { - remove(args._[4], callback); - } else if (subcommand === "share") { - share(args._[4], callback); - } else if (subcommand === "update") { - const boardId = args._[4]; - const boardTitle = args._[5]; - const widgets = json.parse(args._[6]); - - const options = {}; - if (args["description"]) { - options.description = args["description"]; - } - if (args["tmpvars"]) { - options.templateVariables = json.parse(args["tmpvars"]); - } - if (args["width"]) { - options.width = parseInt(args["width"]); - } - if (args["height"]) { - options.height = parseInt(args["height"]); - } - - update(boardId, boardTitle, widgets, options, callback); - } else if (subcommand === "create") { - const boardTitle = args._[4]; - const widgets = json.parse(args._[5]); + const options = {}; + if (args.description) { + options.description = args.description; + } + if (args.tmpvars) { + options.templateVariables = json.parse(args.tmpvars); + } + if (args.width) { + options.width = parseInt(args.width); + } + if (args.height) { + options.height = parseInt(args.height); + } - const options = {}; - if (args["description"]) { - options.description = args["description"]; - } - if (args["tmpvars"]) { - options.templateVariables = json.parse(args["tmpvars"]); - } - if (args["width"]) { - options.width = parseInt(args["width"]); - } - if (args["height"]) { - options.height = parseInt(args["height"]); - } + update(boardId, boardTitle, widgets, options, callback); + } else if (subcommand === 'create') { + const boardTitle = args._[4]; + const widgets = json.parse(args._[5]); - create(boardTitle, widgets, options, callback); - } else { - callback("unknown subcommand or arguments try `dogapi screenboard --help` for help", false); - } + const options = {}; + if (args.description) { + options.description = args.description; } - }; + if (args.tmpvars) { + options.templateVariables = json.parse(args.tmpvars); + } + if (args.width) { + options.width = parseInt(args.width); + } + if (args.height) { + options.height = parseInt(args.height); + } + + create(boardTitle, widgets, options, callback); + } else { + callback('unknown subcommand or arguments try `dogapi screenboard --help` for help', false); + } + } + }; }; diff --git a/lib/api/search.js b/lib/api/search.js index 0c57b03..0500fed 100644 --- a/lib/api/search.js +++ b/lib/api/search.js @@ -1,5 +1,5 @@ -module.exports = function (client) { - /*section: search +module.exports = function(client) { + /* section: search *comment: | * search for metrics and hosts from the past 24 hours *params: @@ -19,35 +19,33 @@ module.exports = function (client) { * }); * ``` */ - function query(query, callback) { - const params = { - query: { - q: query - } - }; - client.request("GET", "/search", params, callback); - } - - return { - query: query, - getUsage: function () { - return [ - " dogapi search query <query>" - ]; - }, - getHelp: function () { - return [ - "Search:", - " Subcommands:", - " query <query> search for hosts and metrics from the last 24 hours" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "query" && args._.length > 4) { - query(args._[4], callback); - } else { - callback("unknown subcommand or arguments try `dogapi search --help` for help", false); - } - } + function query(query, callback) { + const params = { + query: { + q: query + } }; + client.request('GET', '/search', params, callback); + } + + return { + query, + getUsage() { + return [' dogapi search query <query>']; + }, + getHelp() { + return [ + 'Search:', + ' Subcommands:', + ' query <query> search for hosts and metrics from the last 24 hours' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'query' && args._.length > 4) { + query(args._[4], callback); + } else { + callback('unknown subcommand or arguments try `dogapi search --help` for help', false); + } + } + }; }; diff --git a/lib/api/serviceCheck.js b/lib/api/serviceCheck.js index b93d1f8..0d39c8d 100644 --- a/lib/api/serviceCheck.js +++ b/lib/api/serviceCheck.js @@ -1,6 +1,5 @@ -module.exports = function (client) { - - /*section: serviceCheck +module.exports = function(client) { + /* section: serviceCheck *comment: | * post an update to a service check *params: @@ -29,62 +28,60 @@ module.exports = function (client) { * }); * ``` */ - function check(check, hostName, status, parameters, callback) { - if (arguments.length < 5 && typeof arguments[3] === "function") { - callback = parameters; - parameters = {}; - } + function check(check, hostName, status, parameters, callback) { + if (arguments.length < 5 && typeof arguments[3] === 'function') { + callback = parameters; + parameters = {}; + } - if (typeof parameters !== "object") { - parameters = {}; - } + if (typeof parameters !== 'object') { + parameters = {}; + } - parameters.check = check; - parameters.host_name = hostName, - parameters.status = status; + parameters.check = check; + (parameters.host_name = hostName), (parameters.status = status); - const params = { - body: parameters - }; - client.request("POST", "/check_run", params, callback); + const params = { + body: parameters }; + client.request('POST', '/check_run', params, callback); + } - - return { - check: check, - getUsage: function () { - return [ - " dogapi servicecheck check <check> <host> <status> [--time <timestamp>] [--message <message>] [--tags <tags>]" - ]; - }, - getHelp: function () { - return [ - "Service Check:", - " Subcommands:", - " check <check> <host> <status> add a new service check for <check> and <host> at level <status> (0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN)", - "", - " Options:", - " --time <timestamp> the POSIX timestamp to use for the check", - " --message <message> an optional message to accompany the check", - " --tags <tags> a comma separated list of \"tag:value\"'s for the check" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (args._.length > 6) { - const parameters = {}; - if (args["time"]) { - parameters.time = parseInt(args["time"]); - } - if (args["message"]) { - paramaters.message = args["message"]; - } - if (args["tags"]) { - parameters.tags = args["tags"].split(","); - } - check(args._[4], args._[5], parseInt(args._[6]), parameters, callback); - } else { - callback("not enough arguments try `dogapi servicecheck --help` for help", false); - } + return { + check, + getUsage() { + return [ + ' dogapi servicecheck check <check> <host> <status> [--time <timestamp>] [--message <message>] [--tags <tags>]' + ]; + }, + getHelp() { + return [ + 'Service Check:', + ' Subcommands:', + ' check <check> <host> <status> add a new service check for <check> and <host> at level <status> (0=OK, 1=WARNING, 2=CRITICAL, 3=UNKNOWN)', + '', + ' Options:', + ' --time <timestamp> the POSIX timestamp to use for the check', + ' --message <message> an optional message to accompany the check', + ' --tags <tags> a comma separated list of "tag:value"\'s for the check' + ]; + }, + handleCli(subcommand, args, callback) { + if (args._.length > 6) { + const parameters = {}; + if (args.time) { + parameters.time = parseInt(args.time); } - }; + if (args.message) { + paramaters.message = args.message; + } + if (args.tags) { + parameters.tags = args.tags.split(','); + } + check(args._[4], args._[5], parseInt(args._[6]), parameters, callback); + } else { + callback('not enough arguments try `dogapi servicecheck --help` for help', false); + } + } + }; }; diff --git a/lib/api/tag.js b/lib/api/tag.js index 210b3a3..1e967e0 100644 --- a/lib/api/tag.js +++ b/lib/api/tag.js @@ -1,8 +1,7 @@ const util = require('util'); -module.exports = function (client) { - - /*section: tag +module.exports = function(client) { + /* section: tag *comment: | * get all host tags *params: @@ -23,21 +22,21 @@ module.exports = function (client) { * }); * ``` */ - function getAll(source, callback) { - if (arguments.length < 2 && typeof arguments[0] === "function") { - callback = source; - source = undefined; - } - - const params = { - query: { - source: source - } - }; - client.request("GET", "/tags/hosts", params, callback); + function getAll(source, callback) { + if (arguments.length < 2 && typeof arguments[0] === 'function') { + callback = source; + source = undefined; } - /*section: tag + const params = { + query: { + source + } + }; + client.request('GET', '/tags/hosts', params, callback); + } + + /* section: tag *comment: | * get the host tags for a provided host name or host id *params: @@ -63,28 +62,26 @@ module.exports = function (client) { * }); * ``` */ - function get(hostname, options, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = options; - options = {}; - } - options = options || {}; + function get(hostname, options, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = options; + options = {}; + } + options = options || {}; - const params = { - query: { - } - }; - if (options.source) { - params.query.source = options.source; - } - if (options.by_source) { - params.query.by_source = options.by_source; - } - client.request("GET", "/tags/hosts/" + hostname, params, callback); + const params = { + query: {} }; + if (options.source) { + params.query.source = options.source; + } + if (options.by_source) { + params.query.by_source = options.by_source; + } + client.request('GET', `/tags/hosts/${hostname}`, params, callback); + } - - /*section: tag + /* section: tag *comment: | * assign new host tags to the provided host name or host id *params: @@ -109,24 +106,23 @@ module.exports = function (client) { * }); * ``` */ - function create(hostname, tags, source, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = source; - source = undefined; - } - - const params = { - body: { - tags: tags, - source: source - }, - }; + function create(hostname, tags, source, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = source; + source = undefined; + } - client.request("POST", "/tags/hosts/" + hostname, params, callback); + const params = { + body: { + tags, + source + } }; + client.request('POST', `/tags/hosts/${hostname}`, params, callback); + } - /*section: tag + /* section: tag *comment: | * update the host tags for the provided host name or host id *params: @@ -151,22 +147,22 @@ module.exports = function (client) { * }); * ``` */ - function update(hostname, tags, source, callback) { - if (arguments.length < 4 && typeof arguments[2] === "function") { - callback = source; - source = undefined; - } + function update(hostname, tags, source, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = source; + source = undefined; + } - const params = { - body: { - tags: tags, - source: source - }, - }; - client.request("PUT", "/tags/hosts/" + hostname, params, callback); + const params = { + body: { + tags, + source + } }; + client.request('PUT', `/tags/hosts/${hostname}`, params, callback); + } - /*section: tag + /* section: tag *comment: | * delete the host tags for the provided host name or host id *params: @@ -189,77 +185,77 @@ module.exports = function (client) { * }); * ``` */ - function remove(hostname, source, callback) { - if (arguments.length < 3 && typeof arguments[1] === "function") { - callback = source; - source = undefined; - } + function remove(hostname, source, callback) { + if (arguments.length < 3 && typeof arguments[1] === 'function') { + callback = source; + source = undefined; + } - const params = { - query: { - source: source - } - }; - client.request("DELETE", "/tags/hosts/" + hostname, params, callback); + const params = { + query: { + source + } }; + client.request('DELETE', `/tags/hosts/${hostname}`, params, callback); + } - return { - _client: client, - getAll: getAll, - get: get, - create: create, - update: update, - remove: remove, - getUsage: function () { - return [ - " dogapi tag getall [--source <source>]", - " dogapi tag get <host> [--source <source>] [--by-source]", - " dogapi tag remove <host> [--source <source>]", - " dogapi tag create <host> <tags> [--source <source>]", - " dogapi tag update <host> <tags> [--source <source>]" - ]; - }, - getHelp: function () { - return [ - "Tag:", - " Subcommands:", - " getall get all tags", - " get <host> get all tags for a given host", - " remove <host> delete tags for a given host", - " create <host> <tags> add the comma separates \"tag:value\"'s from <tag> to <host>", - " update <host> <tags> update the comma separates \"tag:value\"'s from <tag> to <host>", - "", - " Options:", - " --source <source> the source of the tags (e.g. \"chef\", \"user\", \"jenkins\", etc)", - " --by-source whether the results should be grouped by source" - ]; - }, - handleCli: function (subcommand, args, callback) { - const source = args["source"]; - const host = args._[4]; + return { + _client: client, + getAll, + get, + create, + update, + remove, + getUsage() { + return [ + ' dogapi tag getall [--source <source>]', + ' dogapi tag get <host> [--source <source>] [--by-source]', + ' dogapi tag remove <host> [--source <source>]', + ' dogapi tag create <host> <tags> [--source <source>]', + ' dogapi tag update <host> <tags> [--source <source>]' + ]; + }, + getHelp() { + return [ + 'Tag:', + ' Subcommands:', + ' getall get all tags', + ' get <host> get all tags for a given host', + ' remove <host> delete tags for a given host', + ' create <host> <tags> add the comma separates "tag:value"\'s from <tag> to <host>', + ' update <host> <tags> update the comma separates "tag:value"\'s from <tag> to <host>', + '', + ' Options:', + ' --source <source> the source of the tags (e.g. "chef", "user", "jenkins", etc)', + ' --by-source whether the results should be grouped by source' + ]; + }, + handleCli(subcommand, args, callback) { + const source = args.source; + const host = args._[4]; - if (subcommand === "getall") { - getAll(source, callback); - } else if (subcommand === "get") { - const options = {}; - if (source) { - options.source = source; - } - if (args["by-source"]) { - options.by_source = true; - } - get(host, options, callback); - } else if (subcommand === "create") { - const tags = args._[5].split(","); - create(host, tags, source, callback); - } else if (subcommand === "update") { - const tags = args._[5].split(","); - update(host, tags, source, callback); - } else if (subcommand === "delete") { - remove(host, source, callback); - } else { - callback("unknown subcommand or arguments try `dogapi tag --help` for help", false); - } + if (subcommand === 'getall') { + getAll(source, callback); + } else if (subcommand === 'get') { + const options = {}; + if (source) { + options.source = source; } - }; + if (args['by-source']) { + options.by_source = true; + } + get(host, options, callback); + } else if (subcommand === 'create') { + const tags = args._[5].split(','); + create(host, tags, source, callback); + } else if (subcommand === 'update') { + const tags = args._[5].split(','); + update(host, tags, source, callback); + } else if (subcommand === 'delete') { + remove(host, source, callback); + } else { + callback('unknown subcommand or arguments try `dogapi tag --help` for help', false); + } + } + }; }; diff --git a/lib/api/timeboard.js b/lib/api/timeboard.js index 90ffee4..160bc94 100644 --- a/lib/api/timeboard.js +++ b/lib/api/timeboard.js @@ -1,8 +1,8 @@ -const json = require("../json"); -const util = require("util"); +const util = require('util'); +const json = require('../json'); -module.exports = function (client) { - /*section: timeboard +module.exports = function(client) { + /* section: timeboard *comment: add a new timeboard *params: * title: the title of the timeboard @@ -54,27 +54,27 @@ module.exports = function (client) { * ); * ``` */ - function create(title, description, graphs, templateVariables, callback) { - if (arguments.length < 5 && typeof arguments[3] === "function") { - callback = templateVariables; - templateVariables = []; - } - - const params = { - body: { - title: title, - description: description, - graphs: graphs - } - }; - if (Array.isArray(templateVariables) && templateVariables.length) { - params.body.template_variables = templateVariables; - } + function create(title, description, graphs, templateVariables, callback) { + if (arguments.length < 5 && typeof arguments[3] === 'function') { + callback = templateVariables; + templateVariables = []; + } - client.request("POST", "/dash", params, callback); + const params = { + body: { + title, + description, + graphs + } + }; + if (Array.isArray(templateVariables) && templateVariables.length) { + params.body.template_variables = templateVariables; } - /*section: timeboard + client.request('POST', '/dash', params, callback); + } + + /* section: timeboard *comment: update an existing timeboard *params: * dashId: the id of the timeboard to update @@ -127,27 +127,27 @@ module.exports = function (client) { * ); * ``` */ - function update(dashId, title, description, graphs, templateVariables, callback) { - if (arguments.length < 6 && typeof arguments[4] === "function") { - callback = templateVariables; - templateVariables = []; - } - - const params = { - body: { - title: title, - description: description, - graphs: graphs - } - }; - if (Array.isArray(templateVariables) && templateVariables.length) { - params.body.template_variables = templateVariables; - } + function update(dashId, title, description, graphs, templateVariables, callback) { + if (arguments.length < 6 && typeof arguments[4] === 'function') { + callback = templateVariables; + templateVariables = []; + } - client.request("PUT", util.format("/dash/%s", dashId), params, callback); + const params = { + body: { + title, + description, + graphs + } + }; + if (Array.isArray(templateVariables) && templateVariables.length) { + params.body.template_variables = templateVariables; } - /*section: timeboard + client.request('PUT', util.format('/dash/%s', dashId), params, callback); + } + + /* section: timeboard *comment: remove an existing timeboard *params: * dashId: the id of the timeboard to remove @@ -165,11 +165,11 @@ module.exports = function (client) { * }); * ``` */ - function remove(dashId, callback) { - client.request("DELETE", util.format("/dash/%s", dashId), {}, callback); - } + function remove(dashId, callback) { + client.request('DELETE', util.format('/dash/%s', dashId), {}, callback); + } - /*section: timeboard + /* section: timeboard *comment: get all existing timeboards *params: * callback: function(err, res) @@ -186,11 +186,11 @@ module.exports = function (client) { * }); * ``` */ - function getAll(callback) { - client.request("GET", "/dash", {}, callback); - } + function getAll(callback) { + client.request('GET', '/dash', {}, callback); + } - /*section: timeboard + /* section: timeboard *comment: get an existing timeboard *params: * dashId: the id of the timeboard to get @@ -208,69 +208,69 @@ module.exports = function (client) { * }); * ``` */ - function get(dashId, callback) { - client.request("GET", util.format("/dash/%s", dashId), {}, callback); - } + function get(dashId, callback) { + client.request('GET', util.format('/dash/%s', dashId), {}, callback); + } - return { - create: create, - update: update, - remove: remove, - getAll: getAll, - get: get, - getUsage: function () { - return [ - " dogapi timeboard get <dash-id>", - " dogapi timeboard getall", - " dogapi timeboard remove <dash-id>", - " dogapi timeboard create <title> <description> <graphs> [--tmpvars <templateVariables>]", - " dogapi timeboard update <dash-id> <title> <description> <graphs> [--tmpvars <templateVariables>]", - ]; - }, - getHelp: function () { - return [ - "Timeboard:", - " Subcommands:", - " get <dash-id> get an existing timeboard", - " getall get all existing timeboards", - " remove <dash-id> remove an existing timeboard", - " create <title> <description> <graphs> create a new timeboard, <graphs> is a json of the graphs definition", - " update <dash-id> <title> <description> <graphs> update an existing timeboard, <graphs> is a json of the graphs definition", - " Options:", - " --tmpvars <templateVariables> a json representation of the template variables definition" - ]; - }, - handleCli: function (subcommand, args, callback) { - if (subcommand === "get") { - get(args._[4], callback); - } else if (subcommand === "getall") { - getAll(callback); - } else if (subcommand === "remove") { - remove(args._[4], callback); - } else if (subcommand === "create") { - const title = args._[4]; - const description = args._[5]; - const graphs = json.parse(args._[6]); - const templateVariables = []; - if (args["tmpvars"]) { - templateVariables = json.parse(args["tmpvars"]); - } - - create(title, description, graphs, templateVariables, callback); - } else if (subcommand === "update") { - const dashId = parseInt(args._[4]); - const title = args._[5]; - const description = args._[6]; - const graphs = json.parse(args._[7]); - const templateVariables = []; - if (args["tmpvars"]) { - templateVariables = json.parse(args["tmpvars"]); - } + return { + create, + update, + remove, + getAll, + get, + getUsage() { + return [ + ' dogapi timeboard get <dash-id>', + ' dogapi timeboard getall', + ' dogapi timeboard remove <dash-id>', + ' dogapi timeboard create <title> <description> <graphs> [--tmpvars <templateVariables>]', + ' dogapi timeboard update <dash-id> <title> <description> <graphs> [--tmpvars <templateVariables>]' + ]; + }, + getHelp() { + return [ + 'Timeboard:', + ' Subcommands:', + ' get <dash-id> get an existing timeboard', + ' getall get all existing timeboards', + ' remove <dash-id> remove an existing timeboard', + ' create <title> <description> <graphs> create a new timeboard, <graphs> is a json of the graphs definition', + ' update <dash-id> <title> <description> <graphs> update an existing timeboard, <graphs> is a json of the graphs definition', + ' Options:', + ' --tmpvars <templateVariables> a json representation of the template variables definition' + ]; + }, + handleCli(subcommand, args, callback) { + if (subcommand === 'get') { + get(args._[4], callback); + } else if (subcommand === 'getall') { + getAll(callback); + } else if (subcommand === 'remove') { + remove(args._[4], callback); + } else if (subcommand === 'create') { + const title = args._[4]; + const description = args._[5]; + const graphs = json.parse(args._[6]); + const templateVariables = []; + if (args.tmpvars) { + templateVariables = json.parse(args.tmpvars); + } - update(dashId, title, description, graphs, templateVariables, callback); - } else { - callback("unknown subcommand or arguments try `dogapi timeboard --help` for help", false); - } + create(title, description, graphs, templateVariables, callback); + } else if (subcommand === 'update') { + const dashId = parseInt(args._[4]); + const title = args._[5]; + const description = args._[6]; + const graphs = json.parse(args._[7]); + const templateVariables = []; + if (args.tmpvars) { + templateVariables = json.parse(args.tmpvars); } - }; + + update(dashId, title, description, graphs, templateVariables, callback); + } else { + callback('unknown subcommand or arguments try `dogapi timeboard --help` for help', false); + } + } + }; }; diff --git a/lib/api/user.js b/lib/api/user.js index 6e426d8..190ae5b 100644 --- a/lib/api/user.js +++ b/lib/api/user.js @@ -1,6 +1,5 @@ -module.exports = function (client) { - - /*section: user +module.exports = function(client) { + /* section: user *comment: invite users via e-mail *params: * emails: an array of email addresses to send invites to @@ -19,31 +18,29 @@ module.exports = function (client) { * }); * ``` */ - function invite(emails, callback) { - const params = { - body: { - emails: emails - } - }; - client.request("POST", "/invite_users", params, callback); + function invite(emails, callback) { + const params = { + body: { + emails + } }; + client.request('POST', '/invite_users', params, callback); + } - return { - invite: invite, - getUsage: function () { - return [ - " dogapi user invite <address>..." - ]; - }, - getHelp: function () { - return [ - "User:", - " Subcommands:", - " invite <address>... invite the given list of e-mail addresses to your datadog org" - ]; - }, - handleCli: function (subcommand, args, callback) { - invite(args._.slice(4), callback) - } - }; + return { + invite, + getUsage() { + return [' dogapi user invite <address>...']; + }, + getHelp() { + return [ + 'User:', + ' Subcommands:', + ' invite <address>... invite the given list of e-mail addresses to your datadog org' + ]; + }, + handleCli(subcommand, args, callback) { + invite(args._.slice(4), callback); + } + }; }; diff --git a/lib/client.js b/lib/client.js index 79aa338..fdc69e8 100644 --- a/lib/client.js +++ b/lib/client.js @@ -1,27 +1,27 @@ -const https = require("https"); -const url = require("url"); -const util = require("util"); -const extend = require("extend"); +const https = require('https'); +const url = require('url'); +const util = require('util'); +const extend = require('extend'); const _ = require('lodash'); -const json = require("./json"); +const json = require('./json'); -/*section: client +/* section: client *comment: | * the constructor for _client_ object *params: *example: | * See [client.request](#client-request) */ -const DatadogMetricClient = function(options){ - this.api_key = options.api_key || null; - this.app_key = options.app_key || null; - this.proxy_agent = options.proxy_agent || null; - this.http_options = options.http_options || null; - this.api_version = options.api_version || "v1"; - this.api_host = options.api_host || "app.datadoghq.com"; +const DatadogMetricClient = function(options) { + this.api_key = options.api_key || null; + this.app_key = options.app_key || null; + this.proxy_agent = options.proxy_agent || null; + this.http_options = options.http_options || null; + this.api_version = options.api_version || 'v1'; + this.api_host = options.api_host || 'app.datadoghq.com'; }; -/*section: client +/* section: client *comment: | * used to make a raw request to the datadog api *params: @@ -46,87 +46,92 @@ const DatadogMetricClient = function(options){ * }); * ``` */ -DatadogMetricClient.prototype.request = function(method, path, params, callback){ - if(arguments.length === 3 && typeof arguments[2] === "function"){ - callback = arguments[2]; - params = {body: ''}; // create params with empty body property - } - - const body = (typeof params["body"] === "object") ? json.stringify(params["body"]) : params["body"]; - const query = { - "api_key": this.api_key, - "application_key": this.app_key, +DatadogMetricClient.prototype.request = function(method, path, params, callback) { + if (arguments.length === 3 && typeof arguments[2] === 'function') { + callback = arguments[2]; + params = {body: ''}; // create params with empty body property + } + + const body = typeof params.body === 'object' ? json.stringify(params.body) : params.body; + const query = { + api_key: this.api_key, + application_key: this.app_key + }; + + if (typeof params.query === 'object') { + extend(query, params.query); + } + + path = url.format({ + pathname: util.format('/api/%s%s', this.api_version, path), + query + }); + + const http_options = _.assign( + { + hostname: this.api_host, + port: 443, + method: method.toUpperCase(), + path + }, + this.http_options + ); + + if (this.proxy_agent) { + http_options.agent = this.proxy_agent; + } + + if (['POST', 'PUT'].indexOf(http_options.method) >= 0) { + http_options.headers = { + 'Content-Type': params.contentType ? params.contentType : 'application/json', + 'Content-Length': Buffer.byteLength(body) }; + } - if(typeof params["query"] === "object"){ - extend(query, params["query"]); - } - - path = url.format({ - "pathname": util.format("/api/%s%s", this.api_version, path), - "query": query, + const req = https.request(http_options, function(res) { + res.on('error', function(err) { + if (typeof callback === 'function') { + callback(err, null, res.statusCode); + } }); - const http_options = _.assign({ - hostname: this.api_host, - port: 443, - method: method.toUpperCase(), - path: path - }, this.http_options); - - if(this.proxy_agent){ - http_options["agent"] = this.proxy_agent; - } - - if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){ - http_options["headers"] = { - "Content-Type": params["contentType"] ? params["contentType"] : "application/json", - "Content-Length": Buffer.byteLength(body), - }; - } - - const req = https.request(http_options, function(res){ - res.on("error", function(err){ - if(typeof callback == "function"){ - callback(err, null, res.statusCode); - } - }); - - let data = ""; - res.on("data", function(chunk){ - data += chunk; - }); - - res.on("end", function(){ - let error = null; - try{ data = json.parse(data); }catch(e){} - if(data["errors"]){ - error = data["errors"]; - data = null; - } - - if(typeof callback === "function"){ - callback(error, data, res.statusCode); - } - }); + let data = ''; + res.on('data', function(chunk) { + data += chunk; }); - req.setTimeout(30000, function(){ - req.abort(); + res.on('end', function() { + let error = null; + try { + data = json.parse(data); + } catch (e) {} + if (data.errors) { + error = data.errors; + data = null; + } + + if (typeof callback === 'function') { + callback(error, data, res.statusCode); + } }); + }); - // This should only occur for errors such as a socket hang up prior to any - // data being received, or SSL-related issues. - req.on("error", function(err){ - if(typeof callback === "function"){ - callback(err, null, 0); - } - }); + req.setTimeout(30000, function() { + req.abort(); + }); - if(["POST", "PUT"].indexOf(http_options["method"]) >= 0){ - req.write(body); + // This should only occur for errors such as a socket hang up prior to any + // data being received, or SSL-related issues. + req.on('error', function(err) { + if (typeof callback === 'function') { + callback(err, null, 0); } - req.end() + }); + + if (['POST', 'PUT'].indexOf(http_options.method) >= 0) { + req.write(body); + } + req.end(); }; module.exports = DatadogMetricClient; diff --git a/lib/constants.js b/lib/constants.js index 59c145a..701f3f7 100644 --- a/lib/constants.js +++ b/lib/constants.js @@ -1,13 +1,13 @@ module.exports.STATUSES = { - OK: 0, - WARNING: 1, - CRITICAL: 2, - UNKNOWN: 3, + OK: 0, + WARNING: 1, + CRITICAL: 2, + UNKNOWN: 3 }; module.exports.ALL_STATUSES = [ - module.exports.STATUSES.OK, - module.exports.STATUSES.WARNING, - module.exports.STATUSES.CRITICAL, - module.exports.STATUSES.UNKNOWN, + module.exports.STATUSES.OK, + module.exports.STATUSES.WARNING, + module.exports.STATUSES.CRITICAL, + module.exports.STATUSES.UNKNOWN ]; diff --git a/lib/index.js b/lib/index.js index 8e1266b..a2c5133 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,9 +1,9 @@ const _ = require('lodash'); -const api = require("./api"); -const Client = require("./client"); +const api = require('./api'); +const Client = require('./client'); -const initialClient = new Client({}) -/*section: dogapi +const initialClient = new Client({}); +/* section: dogapi *comment: configure the dogapi client with your app/api keys *params: * options: @@ -39,28 +39,28 @@ const initialClient = new Client({}) * dogapi.event.create(...); * ``` */ -function initialize(options){ - options = options || {}; - for(var key in options){ - if(initialClient.hasOwnProperty(key)){ - initialClient[key] = options[key]; - } +function initialize(options) { + options = options || {}; + for (const key in options) { + if (initialClient.hasOwnProperty(key)) { + initialClient[key] = options[key]; } -}; + } +} function DogApi(options) { - const client = new Client(options || {}); - _.forEach(api, (value, key) => { - this[key] = value(client); - }); + const client = new Client(options || {}); + _.forEach(api, (value, key) => { + this[key] = value(client); + }); } DogApi.initialize = initialize; _.forEach(api, (value, key) => { - DogApi[key] = value(initialClient); + DogApi[key] = value(initialClient); }); -/*section: dogapi +/* section: dogapi *comment: get the current POSIX timestamp *example: | * ```javascript @@ -70,9 +70,9 @@ _.forEach(api, (value, key) => { * parseInt(new Date().getTime() / 1000); * ``` */ -function now(){ - return parseInt(new Date().getTime() / 1000); -}; +function now() { + return parseInt(new Date().getTime() / 1000); +} module.exports = DogApi; module.exports.now = now; module.exports.OK = 0; diff --git a/lib/json.js b/lib/json.js index 1036179..fab1de2 100644 --- a/lib/json.js +++ b/lib/json.js @@ -1,7 +1,6 @@ -var JSONBig = require("json-bigint"); - +const JSONBig = require('json-bigint'); module.exports = { - stringify: JSONBig.stringify, - parse: JSONBig.parse + stringify: JSONBig.stringify, + parse: JSONBig.parse }; diff --git a/test/api/embed.js b/test/api/embed.js index 6cf9bff..a59fc18 100644 --- a/test/api/embed.js +++ b/test/api/embed.js @@ -1,86 +1,86 @@ -const assert = require("assert"); -const Client = require("../../lib/client"); -const extend = require("extend"); -const Embed = require("../../lib/api/embed"); -const sinon = require("sinon"); -const querystring = require("querystring"); +const assert = require('assert'); +const querystring = require('querystring'); +const extend = require('extend'); +const sinon = require('sinon'); +const Client = require('../../lib/client'); +const Embed = require('../../lib/api/embed'); -describe("api/embed", function(){ - const client = new Client({}); - const embed = Embed(client); - let stub_request; - beforeEach(function(){ - // Setup `client.request` as a stub - stub_request = sinon.stub(client, "request"); - }); - afterEach(function(){ - // Reset the original `client.request` - stub_request.restore(); - stub_request = null; - }); - describe("#create", function(){ - it("should make a valid api call", function(){ - const graphJSON = { - viz: "timeseries", - requests: [ - { - q: "system.cpu.idle{*}" - } - ] - }; - const options = { - timeframe: "1_hour", - size: "large", - legend: "yes", - title: "test graph embed" - }; +describe('api/embed', function() { + const client = new Client({}); + const embed = Embed(client); + let stub_request; + beforeEach(function() { + // Setup `client.request` as a stub + stub_request = sinon.stub(client, 'request'); + }); + afterEach(function() { + // Reset the original `client.request` + stub_request.restore(); + stub_request = null; + }); + describe('#create', function() { + it('should make a valid api call', function() { + const graphJSON = { + viz: 'timeseries', + requests: [ + { + q: 'system.cpu.idle{*}' + } + ] + }; + const options = { + timeframe: '1_hour', + size: 'large', + legend: 'yes', + title: 'test graph embed' + }; - // Make our api call - embed.create(graphJSON, options); + // Make our api call + embed.create(graphJSON, options); - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], "POST"); - assert.equal(call_args[1], "/graph/embed"); + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + assert.equal(call_args[0], 'POST'); + assert.equal(call_args[1], '/graph/embed'); - // Properly formatted body and content-type - const params = call_args[2]; - const expectedBody = { - graph_json: JSON.stringify(graphJSON), - timeframe: "1_hour", - size: "large", - legend: "yes", - title: "test graph embed" - }; - assert.deepEqual(querystring.parse(params.body), expectedBody); - assert(params.contentType, "application/x-form-urlencoded"); - }); + // Properly formatted body and content-type + const params = call_args[2]; + const expectedBody = { + graph_json: JSON.stringify(graphJSON), + timeframe: '1_hour', + size: 'large', + legend: 'yes', + title: 'test graph embed' + }; + assert.deepEqual(querystring.parse(params.body), expectedBody); + assert(params.contentType, 'application/x-form-urlencoded'); + }); - it("should only require graph_json", function(){ - const graphJSON = { - viz: "timeseries", - requests: [ - { - q: "system.cpu.idle{*}" - } - ] - }; + it('should only require graph_json', function() { + const graphJSON = { + viz: 'timeseries', + requests: [ + { + q: 'system.cpu.idle{*}' + } + ] + }; - // Make our api call - embed.create(graphJSON); + // Make our api call + embed.create(graphJSON); - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; - // Properly formatted body - const params = call_args[2]; - const expectedBody = { - graph_json: JSON.stringify(graphJSON) - }; - assert.deepEqual(querystring.parse(params.body), expectedBody); - }); + // Properly formatted body + const params = call_args[2]; + const expectedBody = { + graph_json: JSON.stringify(graphJSON) + }; + assert.deepEqual(querystring.parse(params.body), expectedBody); }); + }); }); diff --git a/test/api/graph.js b/test/api/graph.js index 927cbbc..757ace5 100644 --- a/test/api/graph.js +++ b/test/api/graph.js @@ -1,10 +1,8 @@ -var assert = require("assert"); -var client = require("../../lib/client"); -var extend = require("extend"); -var graph = require("../../lib/api/graph"); -var sinon = require("sinon"); -var querystring = require("querystring"); +const assert = require('assert'); +const querystring = require('querystring'); +const extend = require('extend'); +const sinon = require('sinon'); +const client = require('../../lib/client'); +const graph = require('../../lib/api/graph'); -describe("api/graph", function(){ - -}); +describe('api/graph', function() {}); diff --git a/test/api/metric.js b/test/api/metric.js index 0bbc432..c7dc868 100644 --- a/test/api/metric.js +++ b/test/api/metric.js @@ -1,357 +1,356 @@ -const assert = require("assert"); -const Client = require("../../lib/client"); -const extend = require("extend"); -const Metric = require("../../lib/api/metric"); -const sinon = require("sinon"); - -describe("api/metrics", function(){ - const client = new Client({}); - const metric = Metric(client); - var stub_request; - beforeEach(function(){ - // Setup `client.request` as a stub - stub_request = sinon.stub(client, "request"); +const assert = require('assert'); +const extend = require('extend'); +const sinon = require('sinon'); +const Client = require('../../lib/client'); +const Metric = require('../../lib/api/metric'); + +describe('api/metrics', function() { + const client = new Client({}); + const metric = Metric(client); + let stub_request; + beforeEach(function() { + // Setup `client.request` as a stub + stub_request = sinon.stub(client, 'request'); + }); + afterEach(function() { + // Reset the original `client.request` + stub_request.restore(); + stub_request = null; + }); + describe('#send', function() { + it('should make a valid api call', function() { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + metric.send('metric.send', [[now, 500]]); + + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + assert.equal(call_args[0], 'POST'); + assert.equal(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send", host: undefined, tags: undefined, type: undefined} ] } + // DEV: host/tags/type are optional and should be undefined for this case + const data = call_args[2]; + assert(data.hasOwnProperty('body')); + assert(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metric.send'); + assert(Array.isArray(first_series.points)); + assert.deepEqual(first_series.points, [[now, 500]]); + + // These keys are optional and should be set, but undefined + assert(first_series.hasOwnProperty('host')); + assert.equal(first_series.host, undefined); + assert(first_series.hasOwnProperty('tags')); + assert.equal(first_series.tags, undefined); + assert(first_series.hasOwnProperty('type')); + assert.equal(first_series.type, undefined); }); - afterEach(function(){ - // Reset the original `client.request` - stub_request.restore(); - stub_request = null; + + it('should properly normalize values to points', function() { + // Make our api call + metric.send('metrics.send.normalize', 500); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 1); + + // points = [ [<timestamp>, 500] ] + const points = body.series[0].points; + assert(Array.isArray(points)); + assert.equal(points.length, 1); + + // point = [<timestamp>, 500] + const point = points[0]; + assert(Array.isArray(point)); + assert.equal(point.length, 2); + assert.equal(point[1], 500); + }); + + it('should properly normalize array of values to points', function() { + // Make our api call + metric.send('metrics.send.normalize', [500, 1000]); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 1); + + // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] + const points = body.series[0].points; + assert(Array.isArray(points)); + assert.equal(points.length, 2); + + // point = [<timestamp>, 500] + let point = points[0]; + assert(Array.isArray(point)); + assert.equal(point.length, 2); + assert.equal(point[1], 500); + + // point = [<timestamp>, 1000] + point = points[1]; + assert(Array.isArray(point)); + assert.equal(point.length, 2); + assert.equal(point[1], 1000); + }); + + it('should not normalize correctly formatted points', function() { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + metric.send('metrics.send.normalize', [[now, 1000]]); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 1); + + // points = [ [<timestamp>, 1000], ] + const points = body.series[0].points; + assert(Array.isArray(points)); + assert.equal(points.length, 1); + + // point = [<timestamp>, 500] + const point = points[0]; + assert(Array.isArray(point)); + assert.deepEqual(point, [now, 1000]); + }); + + it('should properly set metric type', function() { + // Make our api call + metric.send('metrics.send.counter', 5, {type: 'count'}); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 1); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metrics.send.counter'); + assert(first_series.hasOwnProperty('type')); + assert.equal(first_series.type, 'count'); }); - describe("#send", function(){ - it("should make a valid api call", function(){ - // Make our api call - var now = parseInt(new Date().getTime() / 1000); - metric.send("metric.send", [[now, 500]]); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], "POST"); - assert.equal(call_args[1], "/series"); - - // Properly formatted body - // { body: series: [ {metric: "metric.send", host: undefined, tags: undefined, type: undefined} ] } - // DEV: host/tags/type are optional and should be undefined for this case - var data = call_args[2]; - assert(data.hasOwnProperty("body")); - assert(data.body.hasOwnProperty("series")); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metric.send"); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.points, [[now, 500]]); - - // These keys are optional and should be set, but undefined - assert(first_series.hasOwnProperty("host")); - assert.equal(first_series.host, undefined); - assert(first_series.hasOwnProperty("tags")); - assert.equal(first_series.tags, undefined); - assert(first_series.hasOwnProperty("type")); - assert.equal(first_series.type, undefined); - }); - - it("should properly normalize values to points", function(){ - // Make our api call - metric.send("metrics.send.normalize", 500); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 500] ] - var points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - - // point = [<timestamp>, 500] - var point = points[0]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 500); - }); - - it("should properly normalize array of values to points", function(){ - // Make our api call - metric.send("metrics.send.normalize", [500, 1000]); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] - var points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 2); - - // point = [<timestamp>, 500] - var point = points[0]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 500); - - // point = [<timestamp>, 1000] - point = points[1]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 1000); - }); - - it("should not normalize correctly formatted points", function(){ - // Make our api call - var now = parseInt(new Date().getTime() / 1000); - metric.send("metrics.send.normalize", [[now, 1000]]); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 1000], ] - var points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - - // point = [<timestamp>, 500] - var point = points[0]; - assert(Array.isArray(point)); - assert.deepEqual(point, [now, 1000]); - }); - - it("should properly set metric type", function(){ - // Make our api call - metric.send("metrics.send.counter", 5, {type: "count"}); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 1); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metrics.send.counter"); - assert(first_series.hasOwnProperty("type")); - assert.equal(first_series.type, "count"); - }); - - it("should properly set convert metric_type to type", function(){ - // Make our api call - metric.send("metrics.send.counter", 5, {metric_type: "count"}); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 1); - - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metrics.send.counter"); - assert(first_series.hasOwnProperty("type")); - assert.equal(first_series.type, "count"); - }); + + it('should properly set convert metric_type to type', function() { + // Make our api call + metric.send('metrics.send.counter', 5, {metric_type: 'count'}); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 1); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metrics.send.counter'); + assert(first_series.hasOwnProperty('type')); + assert.equal(first_series.type, 'count'); + }); + }); + + describe('#send_all', function() { + it('should make a valid api call', function() { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + const metrics = [ + { + metric: 'metric.send_all', + points: [[now, 500]] + } + ]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + assert.equal(call_args[0], 'POST'); + assert.equal(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send_all", host: undefined, tags: undefined, type: undefined} ] } + // DEV: host/tags/type are optional and should be undefined for this case + const data = call_args[2]; + assert(data.hasOwnProperty('body')); + assert(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metric.send_all'); + assert(Array.isArray(first_series.points)); + assert.deepEqual(first_series.points, [[now, 500]]); + }); + + it('should properly normalize metric points', function() { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + const metrics = [ + { + metric: 'metric.send_all.normalize', + points: [[now, 500]] + }, + { + metric: 'metric.send_all.normalize', + points: [500, 1000] + }, + { + metric: 'metric.send_all.normalize', + points: 1000 + } + ]; + metric.send_all(metrics); + + // Assert we called `client.request` with the correct `points` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + assert.equal(body.series.length, 3); + + // points = [ [<timestamp>, 500] ] + let points = body.series[0].points; + assert(Array.isArray(points)); + assert.equal(points.length, 1); + assert.equal(points[0].length, 2); + assert.equal(points[0][1], 500); + + // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] + points = body.series[1].points; + assert(Array.isArray(points)); + assert.equal(points.length, 2); + assert.equal(points[0].length, 2); + assert.equal(points[0][1], 500); + assert.equal(points[1].length, 2); + assert.equal(points[1][1], 1000); + + // points = [ [<timestamp>, 1000] ] + points = body.series[2].points; + assert(Array.isArray(points)); + assert.equal(points.length, 1); + assert.equal(points[0].length, 2); + assert.equal(points[0][1], 1000); + }); + + it('should properly send metric type', function() { + // Make our api call + const metrics = [ + { + metric: 'metric.send.counter', + points: 5, + type: 'count' + } + ]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + assert.equal(call_args[0], 'POST'); + assert.equal(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } + // DEV: host/tags are optional and should be undefined for this case + const data = call_args[2]; + assert(data.hasOwnProperty('body')); + assert(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metric.send.counter'); + assert(Array.isArray(first_series.points)); + assert.deepEqual(first_series.type, 'count'); }); - describe("#send_all", function(){ - it("should make a valid api call", function(){ - // Make our api call - var now = parseInt(new Date().getTime() / 1000); - var metrics = [ - { - metric: "metric.send_all", - points: [[now, 500]] - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], "POST"); - assert.equal(call_args[1], "/series"); - - // Properly formatted body - // { body: series: [ {metric: "metric.send_all", host: undefined, tags: undefined, type: undefined} ] } - // DEV: host/tags/type are optional and should be undefined for this case - var data = call_args[2]; - assert(data.hasOwnProperty("body")); - assert(data.body.hasOwnProperty("series")); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metric.send_all"); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.points, [[now, 500]]); - }); - - it("should properly normalize metric points", function(){ - // Make our api call - var now = parseInt(new Date().getTime() / 1000); - var metrics = [ - { - metric: "metric.send_all.normalize", - points: [[now, 500]] - }, - { - metric: "metric.send_all.normalize", - points: [500, 1000] - }, - { - metric: "metric.send_all.normalize", - points: 1000 - } - ]; - metric.send_all(metrics); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - var body = call_args[2].body; - assert.equal(body.series.length, 3); - - // points = [ [<timestamp>, 500] ] - var points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 500); - - // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] - points = body.series[1].points; - assert(Array.isArray(points)); - assert.equal(points.length, 2); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 500); - assert.equal(points[1].length, 2); - assert.equal(points[1][1], 1000); - - // points = [ [<timestamp>, 1000] ] - points = body.series[2].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 1000); - }); - - it("should properly send metric type", function(){ - // Make our api call - var metrics = [ - { - metric: "metric.send.counter", - points: 5, - type: "count" - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], "POST"); - assert.equal(call_args[1], "/series"); - - // Properly formatted body - // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } - // DEV: host/tags are optional and should be undefined for this case - var data = call_args[2]; - assert(data.hasOwnProperty("body")); - assert(data.body.hasOwnProperty("series")); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metric.send.counter"); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.type, "count"); - }); - - it("should properly send metric_type as type", function(){ - // Make our api call - var metrics = [ - { - metric: "metric.send.counter", - points: 5, - metric_type: "count" - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - var call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], "POST"); - assert.equal(call_args[1], "/series"); - - // Properly formatted body - // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } - // DEV: host/tags are optional and should be undefined for this case - var data = call_args[2]; - assert(data.hasOwnProperty("body")); - assert(data.body.hasOwnProperty("series")); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - var series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - var first_series = series[0] - assert.equal(first_series.metric, "metric.send.counter"); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.type, "count"); - }); + it('should properly send metric_type as type', function() { + // Make our api call + const metrics = [ + { + metric: 'metric.send.counter', + points: 5, + metric_type: 'count' + } + ]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + assert(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + assert.equal(call_args[0], 'POST'); + assert.equal(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } + // DEV: host/tags are optional and should be undefined for this case + const data = call_args[2]; + assert(data.hasOwnProperty('body')); + assert(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + assert(Array.isArray(series)); + assert.equal(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + assert.equal(first_series.metric, 'metric.send.counter'); + assert(Array.isArray(first_series.points)); + assert.deepEqual(first_series.type, 'count'); }); + }); }); diff --git a/test/json.js b/test/json.js index a1e2dff..73ba430 100644 --- a/test/json.js +++ b/test/json.js @@ -1,26 +1,26 @@ -var assert = require("assert"); -var BigNumber = require("bignumber.js"); -var json = require("../lib/json"); +const assert = require('assert'); +const BigNumber = require('bignumber.js'); +const json = require('../lib/json'); -describe("json", function(){ - describe("#parse()", function(){ - it("should properly parse big integers", function(){ - // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 - var data = "{\"id\": 2868860079149422351}"; - var parsed = json.parse(data); - // `parsed.id` is an instance of `BigNumber` - assert.equal(parsed.id.toString(), "2868860079149422351"); - }); +describe('json', function() { + describe('#parse()', function() { + it('should properly parse big integers', function() { + // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 + const data = '{"id": 2868860079149422351}'; + const parsed = json.parse(data); + // `parsed.id` is an instance of `BigNumber` + assert.equal(parsed.id.toString(), '2868860079149422351'); }); + }); - describe("#stringify()", function(){ - it("should properly parse big integers", function(){ - // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 - var data = {"id": new BigNumber('2868860079149422351')}; - var stringified = json.stringify(data); - // Yeah, it ends up being a string and not an int, but mostly we - // want to make sure it doesn't throw an error or provide the wrong number - assert.equal(stringified, "{\"id\":\"2868860079149422351\"}"); - }); + describe('#stringify()', function() { + it('should properly parse big integers', function() { + // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 + const data = {id: new BigNumber('2868860079149422351')}; + const stringified = json.stringify(data); + // Yeah, it ends up being a string and not an int, but mostly we + // want to make sure it doesn't throw an error or provide the wrong number + assert.equal(stringified, '{"id":"2868860079149422351"}'); }); + }); }); From 0dbab0c916e8ce11765039c00589439eead3ea97 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 08:55:08 +0100 Subject: [PATCH 07/24] Make linting green again :white_check_mark: - disable some rules (put as warning) - refactor some stuff - fix some bugs introduced in 404e362 :bug: - fix some original bugs (paramater, argument) --- .eslintrc | 21 +-- lib/api/comment.js | 11 +- lib/api/downtime.js | 5 +- lib/api/embed.js | 5 +- lib/api/event.js | 7 +- lib/api/graph.js | 5 +- lib/api/host.js | 2 +- lib/api/index.js | 2 +- lib/api/metric.js | 128 +++++++++--------- lib/api/monitor.js | 20 ++- lib/api/screenboard.js | 5 +- lib/api/search.js | 9 +- lib/api/{serviceCheck.js => service-check.js} | 11 +- lib/api/tag.js | 4 +- lib/api/timeboard.js | 19 ++- lib/client.js | 17 +-- lib/index.js | 12 +- 17 files changed, 143 insertions(+), 140 deletions(-) rename lib/api/{serviceCheck.js => service-check.js} (89%) diff --git a/.eslintrc b/.eslintrc index 0522bf4..7c6905e 100644 --- a/.eslintrc +++ b/.eslintrc @@ -20,20 +20,11 @@ ], "rules": { "promise/no-native": "off", - "strict": "off" + "strict": "off", + "fp/no-arguments": "warn", + "no-param-reassign": "warn", + "prefer-rest-params": "warn", + "fp/no-loops": "warn" }, - "overrides": [ - { - "files": [ "scripts/migrate*.js", "lib/*.js" ], - "env": { - "mongo": true - } - }, - { - "files": ["**/test/**"], - "rules": { - "unicorn/filename-case": "off" - } - } - ] + "overrides": [] } diff --git a/lib/api/comment.js b/lib/api/comment.js index 21e7879..d46ea55 100644 --- a/lib/api/comment.js +++ b/lib/api/comment.js @@ -75,12 +75,10 @@ module.exports = function(client) { const params = { body: { - message + message, + handle: handle || undefined } }; - if (handle) { - params.body.handle = properties.handle; - } client.request('PUT', util.format('/comments/%s', commentId), params, callback); } @@ -150,7 +148,10 @@ module.exports = function(client) { const commentId = args._[4]; remove(commentId, callback); } else { - callback('unknown subcommand or arguments try `dogapi comment --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi comment --help` for help', + false + ); } } }; diff --git a/lib/api/downtime.js b/lib/api/downtime.js index 805f1d4..8549a1f 100644 --- a/lib/api/downtime.js +++ b/lib/api/downtime.js @@ -235,7 +235,10 @@ module.exports = function(client) { } update(downtimeId, properties, callback); } else { - callback('unknown subcommand or arguments try `dogapi downtime --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi downtime --help` for help', + false + ); } } }; diff --git a/lib/api/embed.js b/lib/api/embed.js index 1252efd..696aa76 100644 --- a/lib/api/embed.js +++ b/lib/api/embed.js @@ -162,7 +162,10 @@ module.exports = function(client) { } else if (subcommand === 'getall') { getAll(callback); } else { - callback('unknown subcommand or arguments try `dogapi embed --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi embed --help` for help', + false + ); } } }; diff --git a/lib/api/event.js b/lib/api/event.js index f92fb47..164d4c4 100644 --- a/lib/api/event.js +++ b/lib/api/event.js @@ -118,7 +118,7 @@ module.exports = function(client) { * ``` */ function query(start, end, parameters, callback) { - if (arguments.length < 4 && typeof argument[2] === 'function') { + if (arguments.length < 4 && typeof arguments[2] === 'function') { callback = parameters; parameters = {}; } @@ -203,7 +203,10 @@ module.exports = function(client) { } create(title, text, properties, callback); } else { - callback('unknown subcommand or arguments try `dogapi event --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi event --help` for help', + false + ); } } }; diff --git a/lib/api/graph.js b/lib/api/graph.js index 2390f47..9e451fc 100644 --- a/lib/api/graph.js +++ b/lib/api/graph.js @@ -69,7 +69,10 @@ module.exports = function(client) { const eventQuery = args.events; snapshot(query, from, to, eventQuery, callback); } else { - callback('unknown subcommand or arguments try `dogapi graph --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi graph --help` for help', + false + ); } } }; diff --git a/lib/api/host.js b/lib/api/host.js index 3b639e7..b216300 100644 --- a/lib/api/host.js +++ b/lib/api/host.js @@ -102,7 +102,7 @@ module.exports = function(client) { const hostname = args._[4]; unmute(hostname, callback); } else { - callback('unknown subcommand or arguments try `dogapi host --help` for help', false); + return callback('unknown subcommand or arguments try `dogapi host --help` for help', false); } } }; diff --git a/lib/api/index.js b/lib/api/index.js index 5d9b0f1..2a5de0b 100644 --- a/lib/api/index.js +++ b/lib/api/index.js @@ -10,7 +10,7 @@ module.exports = { monitor: require('./monitor'), screenboard: require('./screenboard'), search: require('./search'), - serviceCheck: require('./serviceCheck'), + serviceCheck: require('./service-check'), tag: require('./tag'), timeboard: require('./timeboard'), user: require('./user') diff --git a/lib/api/metric.js b/lib/api/metric.js index 7c47c9f..dd7baac 100644 --- a/lib/api/metric.js +++ b/lib/api/metric.js @@ -1,62 +1,4 @@ module.exports = function(client) { - /* section: metric - *comment: | - * submit a new metric - *params: - * metric: the metric name - * points: | - * a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) - * or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) - * extra: | - * optional, object which can contain the following keys - * * host: the host source of the metric - * * tags: array of "tag:value"'s to use for the metric - * * metric_type|type: which metric type to use ("gauge" or "count") [default: gauge] - * callback: | - * function(err, res) - *example: | - * ```javascript - * const dogapi = require("dogapi"); - * const options = { - * api_key: "api_key", - * app_key: "app_key" - * }; - * dogapi.initialize(options); - * dogapi.metric.send("my.metric", 1000, function(err, results){ - * console.dir(results); - * }); - * dogapi.metric.send("my.metric", [500, 1000], function(err, results){ - * console.dir(results); - * }); - * const now = parseInt(new Date().getTime() / 1000); - * dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){ - * console.dir(results); - * }); - * dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ - * console.dir(results); - * }); - * ``` - */ - function send(metric, points, extra, callback) { - if (arguments.length < 4 && typeof arguments[2] === 'function') { - callback = extra; - extra = {}; - } - extra = extra || {}; - const series = [ - { - metric, - points, - host: extra.host, - tags: extra.tags, - // DEV: For backwards compatibility, allow `metric_type` - type: extra.type || extra.metric_type - } - ]; - - send_all(series, callback); - } - /* section: metric *comment: | * send a list of metrics @@ -117,7 +59,6 @@ module.exports = function(client) { // 500 => [<timestamp>, 500] // [<timestamp>, 500] => unchanged if (!Array.isArray(point)) { - const now = parseInt(new Date().getTime() / 1000); point = [now, point]; } return point; @@ -140,13 +81,71 @@ module.exports = function(client) { client.request('POST', '/series', params, callback); } + /* section: metric + *comment: | + * submit a new metric + *params: + * metric: the metric name + * points: | + * a single data point (e.g. `50`), an array of data points (e.g. `[50, 100]`) + * or an array of `[timestamp, value]` elements (e.g. `[[now, 50], [now, 100]]`) + * extra: | + * optional, object which can contain the following keys + * * host: the host source of the metric + * * tags: array of "tag:value"'s to use for the metric + * * metric_type|type: which metric type to use ("gauge" or "count") [default: gauge] + * callback: | + * function(err, res) + *example: | + * ```javascript + * const dogapi = require("dogapi"); + * const options = { + * api_key: "api_key", + * app_key: "app_key" + * }; + * dogapi.initialize(options); + * dogapi.metric.send("my.metric", 1000, function(err, results){ + * console.dir(results); + * }); + * dogapi.metric.send("my.metric", [500, 1000], function(err, results){ + * console.dir(results); + * }); + * const now = parseInt(new Date().getTime() / 1000); + * dogapi.metric.send("my.metric", [[now, 1000]], function(err, results){ + * console.dir(results); + * }); + * dogapi.metric.send("my.counter", 5, {type: "count"}, function(err, results){ + * console.dir(results); + * }); + * ``` + */ + function send(metric, points, extra, callback) { + if (arguments.length < 4 && typeof arguments[2] === 'function') { + callback = extra; + extra = {}; + } + extra = extra || {}; + const series = [ + { + metric, + points, + host: extra.host, + tags: extra.tags, + // DEV: For backwards compatibility, allow `metric_type` + type: extra.type || extra.metric_type + } + ]; + + send_all(series, callback); + } + /* section: metric *comment: | * make a metric query *params: * from: POSIX timestamp for start of query * to: POSIX timestamp for end of query - * query: the string query to perform (e.g. "system.cpu.idle{*}by{host}") + * q: the string query to perform (e.g. "system.cpu.idle{*}by{host}") * callback: function(err, res) *example: | * ```javascript @@ -164,12 +163,12 @@ module.exports = function(client) { * }); * ``` */ - function query(from, to, query, callback) { + function query(from, to, q, callback) { const params = { query: { from, to, - query + query: q } }; client.request('GET', '/query', params, callback); @@ -213,7 +212,10 @@ module.exports = function(client) { const q = args._[6]; query(from, to, q, callback); } else { - callback('unknown subcommand or arguments try `dogapi metric --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi metric --help` for help', + false + ); } } }; diff --git a/lib/api/monitor.js b/lib/api/monitor.js index 7d31351..cb3b5bd 100644 --- a/lib/api/monitor.js +++ b/lib/api/monitor.js @@ -379,15 +379,8 @@ module.exports = function(client) { ]; }, handleCli(subcommand, args, callback) { - const states = []; - if (args.states) { - states = args.states.split(','); - } - - const tags = []; - if (args.tags) { - tags = args.tags.split(','); - } + const states = args.states ? args.states.split(',') : []; + const tags = args.tags ? args.tags.split(',') : []; const name = args.name; const message = args.message; @@ -397,10 +390,10 @@ module.exports = function(client) { get(monitorId, states, callback); } else if (subcommand === 'getall') { const options = {}; - if (states.length) { + if (states.length > 0) { options.group_states = states; } - if (tags.length) { + if (tags.length > 0) { options.tags = tags; } getAll(options, callback); @@ -448,7 +441,10 @@ module.exports = function(client) { } update(monitorId, query, properties, callback); } else { - callback('unknown subcommand or arguments try `dogapi monitor --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi monitor --help` for help', + false + ); } } }; diff --git a/lib/api/screenboard.js b/lib/api/screenboard.js index 57de1ed..8c2086e 100644 --- a/lib/api/screenboard.js +++ b/lib/api/screenboard.js @@ -343,7 +343,10 @@ module.exports = function(client) { create(boardTitle, widgets, options, callback); } else { - callback('unknown subcommand or arguments try `dogapi screenboard --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi screenboard --help` for help', + false + ); } } }; diff --git a/lib/api/search.js b/lib/api/search.js index 0500fed..a63a434 100644 --- a/lib/api/search.js +++ b/lib/api/search.js @@ -19,10 +19,10 @@ module.exports = function(client) { * }); * ``` */ - function query(query, callback) { + function query(q, callback) { const params = { query: { - q: query + q } }; client.request('GET', '/search', params, callback); @@ -44,7 +44,10 @@ module.exports = function(client) { if (subcommand === 'query' && args._.length > 4) { query(args._[4], callback); } else { - callback('unknown subcommand or arguments try `dogapi search --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi search --help` for help', + false + ); } } }; diff --git a/lib/api/serviceCheck.js b/lib/api/service-check.js similarity index 89% rename from lib/api/serviceCheck.js rename to lib/api/service-check.js index 0d39c8d..1bff849 100644 --- a/lib/api/serviceCheck.js +++ b/lib/api/service-check.js @@ -28,7 +28,7 @@ module.exports = function(client) { * }); * ``` */ - function check(check, hostName, status, parameters, callback) { + function check(checkName, hostName, status, parameters, callback) { if (arguments.length < 5 && typeof arguments[3] === 'function') { callback = parameters; parameters = {}; @@ -38,8 +38,9 @@ module.exports = function(client) { parameters = {}; } - parameters.check = check; - (parameters.host_name = hostName), (parameters.status = status); + parameters.check = checkName; + parameters.host_name = hostName; + parameters.status = status; const params = { body: parameters @@ -73,14 +74,14 @@ module.exports = function(client) { parameters.time = parseInt(args.time); } if (args.message) { - paramaters.message = args.message; + parameters.message = args.message; } if (args.tags) { parameters.tags = args.tags.split(','); } check(args._[4], args._[5], parseInt(args._[6]), parameters, callback); } else { - callback('not enough arguments try `dogapi servicecheck --help` for help', false); + return callback('not enough arguments try `dogapi servicecheck --help` for help', false); } } }; diff --git a/lib/api/tag.js b/lib/api/tag.js index 1e967e0..1962234 100644 --- a/lib/api/tag.js +++ b/lib/api/tag.js @@ -1,5 +1,3 @@ -const util = require('util'); - module.exports = function(client) { /* section: tag *comment: | @@ -254,7 +252,7 @@ module.exports = function(client) { } else if (subcommand === 'delete') { remove(host, source, callback); } else { - callback('unknown subcommand or arguments try `dogapi tag --help` for help', false); + return callback('unknown subcommand or arguments try `dogapi tag --help` for help', false); } } }; diff --git a/lib/api/timeboard.js b/lib/api/timeboard.js index 160bc94..cfc787e 100644 --- a/lib/api/timeboard.js +++ b/lib/api/timeboard.js @@ -67,7 +67,7 @@ module.exports = function(client) { graphs } }; - if (Array.isArray(templateVariables) && templateVariables.length) { + if (Array.isArray(templateVariables) && templateVariables.length > 0) { params.body.template_variables = templateVariables; } @@ -140,7 +140,7 @@ module.exports = function(client) { graphs } }; - if (Array.isArray(templateVariables) && templateVariables.length) { + if (Array.isArray(templateVariables) && templateVariables.length > 0) { params.body.template_variables = templateVariables; } @@ -251,10 +251,7 @@ module.exports = function(client) { const title = args._[4]; const description = args._[5]; const graphs = json.parse(args._[6]); - const templateVariables = []; - if (args.tmpvars) { - templateVariables = json.parse(args.tmpvars); - } + const templateVariables = args.tmpvars ? json.parse(args.tmpvars) : []; create(title, description, graphs, templateVariables, callback); } else if (subcommand === 'update') { @@ -262,14 +259,14 @@ module.exports = function(client) { const title = args._[5]; const description = args._[6]; const graphs = json.parse(args._[7]); - const templateVariables = []; - if (args.tmpvars) { - templateVariables = json.parse(args.tmpvars); - } + const templateVariables = args.tmpvars ? json.parse(args.tmpvars) : []; update(dashId, title, description, graphs, templateVariables, callback); } else { - callback('unknown subcommand or arguments try `dogapi timeboard --help` for help', false); + return callback( + 'unknown subcommand or arguments try `dogapi timeboard --help` for help', + false + ); } } }; diff --git a/lib/client.js b/lib/client.js index fdc69e8..b77aa33 100644 --- a/lib/client.js +++ b/lib/client.js @@ -2,7 +2,7 @@ const https = require('https'); const url = require('url'); const util = require('util'); const extend = require('extend'); -const _ = require('lodash'); +const _ = require('lodash/fp'); const json = require('./json'); /* section: client @@ -67,15 +67,12 @@ DatadogMetricClient.prototype.request = function(method, path, params, callback) query }); - const http_options = _.assign( - { - hostname: this.api_host, - port: 443, - method: method.toUpperCase(), - path - }, - this.http_options - ); + const http_options = _.assign(this.http_options, { + hostname: this.api_host, + port: 443, + method: method.toUpperCase(), + path + }); if (this.proxy_agent) { http_options.agent = this.proxy_agent; diff --git a/lib/index.js b/lib/index.js index a2c5133..33d1630 100644 --- a/lib/index.js +++ b/lib/index.js @@ -1,7 +1,9 @@ -const _ = require('lodash'); +const _ = require('lodash/fp'); const api = require('./api'); const Client = require('./client'); +const forEach = _.forEach.convert({cap: false}); + const initialClient = new Client({}); /* section: dogapi *comment: configure the dogapi client with your app/api keys @@ -50,15 +52,15 @@ function initialize(options) { function DogApi(options) { const client = new Client(options || {}); - _.forEach(api, (value, key) => { + forEach((value, key) => { this[key] = value(client); - }); + }, api); } DogApi.initialize = initialize; -_.forEach(api, (value, key) => { +forEach((value, key) => { DogApi[key] = value(initialClient); -}); +}, api); /* section: dogapi *comment: get the current POSIX timestamp From b971434484e6abfe0d2f68361b01d65678c399f9 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 09:10:18 +0100 Subject: [PATCH 08/24] Make linting green again for all files, not just lib :green_book: --- .eslintrc | 10 +++++++++- lib/client.js | 18 +++++++++++------- test/api/embed.js | 20 ++++++++++---------- test/api/graph.js | 8 -------- test/api/metric.js | 1 - 5 files changed, 30 insertions(+), 27 deletions(-) delete mode 100644 test/api/graph.js diff --git a/.eslintrc b/.eslintrc index 7c6905e..4ca1bdb 100644 --- a/.eslintrc +++ b/.eslintrc @@ -26,5 +26,13 @@ "prefer-rest-params": "warn", "fp/no-loops": "warn" }, - "overrides": [] + "overrides": [ + { + "files": [ "bin/*" ], + "rules": { + "no-console": "off", + "no-continue": "warn" + } + } + ] } diff --git a/lib/client.js b/lib/client.js index b77aa33..42e4a33 100644 --- a/lib/client.js +++ b/lib/client.js @@ -88,27 +88,31 @@ DatadogMetricClient.prototype.request = function(method, path, params, callback) const req = https.request(http_options, function(res) { res.on('error', function(err) { if (typeof callback === 'function') { - callback(err, null, res.statusCode); + return callback(err, null, res.statusCode); } }); - let data = ''; + let _data = ''; res.on('data', function(chunk) { - data += chunk; + _data += chunk; }); res.on('end', function() { let error = null; + let data; + try { - data = json.parse(data); - } catch (e) {} + data = json.parse(_data); + } catch (e) { + data = {}; + } if (data.errors) { error = data.errors; data = null; } if (typeof callback === 'function') { - callback(error, data, res.statusCode); + return callback(error, data, res.statusCode); } }); }); @@ -121,7 +125,7 @@ DatadogMetricClient.prototype.request = function(method, path, params, callback) // data being received, or SSL-related issues. req.on('error', function(err) { if (typeof callback === 'function') { - callback(err, null, 0); + return callback(err, null, 0); } }); diff --git a/test/api/embed.js b/test/api/embed.js index a59fc18..081e3c6 100644 --- a/test/api/embed.js +++ b/test/api/embed.js @@ -1,6 +1,5 @@ const assert = require('assert'); const querystring = require('querystring'); -const extend = require('extend'); const sinon = require('sinon'); const Client = require('../../lib/client'); const Embed = require('../../lib/api/embed'); @@ -9,16 +8,17 @@ describe('api/embed', function() { const client = new Client({}); const embed = Embed(client); let stub_request; - beforeEach(function() { - // Setup `client.request` as a stub - stub_request = sinon.stub(client, 'request'); - }); - afterEach(function() { - // Reset the original `client.request` - stub_request.restore(); - stub_request = null; - }); + describe('#create', function() { + beforeEach(function() { + // Setup `client.request` as a stub + stub_request = sinon.stub(client, 'request'); + }); + afterEach(function() { + // Reset the original `client.request` + stub_request.restore(); + stub_request = null; + }); it('should make a valid api call', function() { const graphJSON = { viz: 'timeseries', diff --git a/test/api/graph.js b/test/api/graph.js deleted file mode 100644 index 757ace5..0000000 --- a/test/api/graph.js +++ /dev/null @@ -1,8 +0,0 @@ -const assert = require('assert'); -const querystring = require('querystring'); -const extend = require('extend'); -const sinon = require('sinon'); -const client = require('../../lib/client'); -const graph = require('../../lib/api/graph'); - -describe('api/graph', function() {}); diff --git a/test/api/metric.js b/test/api/metric.js index c7dc868..632ad5d 100644 --- a/test/api/metric.js +++ b/test/api/metric.js @@ -1,5 +1,4 @@ const assert = require('assert'); -const extend = require('extend'); const sinon = require('sinon'); const Client = require('../../lib/client'); const Metric = require('../../lib/api/metric'); From f1cbac8d73edf54659fa93d3fa19f19cbac27c13 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 09:10:40 +0100 Subject: [PATCH 09/24] Configure travis to make lint run :traffic_light: --- .travis.yml | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/.travis.yml b/.travis.yml index 49cff8e..0299c94 100644 --- a/.travis.yml +++ b/.travis.yml @@ -8,3 +8,10 @@ node_js: - "9" - "10" - "node" + +install: + - npm install + +script: + - npm run lint + - npm test From 9785317bfa279d5f3c6ad0075c9e884f6d1b3cfa Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Tue, 5 Mar 2019 09:16:33 +0100 Subject: [PATCH 10/24] Specify engine and drop support of node 4/5 :rotating_light: --- .travis.yml | 2 -- package.json | 3 +++ 2 files changed, 3 insertions(+), 2 deletions(-) diff --git a/.travis.yml b/.travis.yml index 0299c94..e01223c 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,7 +1,5 @@ language: node_js node_js: - - "4" - - "5" - "6" - "7" - "8" diff --git a/package.json b/package.json index 4c1e512..ce68540 100644 --- a/package.json +++ b/package.json @@ -3,6 +3,9 @@ "version": "2.8.3", "description": "Datadog API Node.JS Client", "main": "lib/index.js", + "engines": { + "node": ">= 6.10.0" + }, "scripts": { "test": "./node_modules/.bin/mocha --recursive ./test", "lint": "eslint lib test bin/dogapi examples", From 4d1cc5dbf84b8bb52f3783c3695a49e401abf117 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 8 Mar 2019 15:26:23 +0100 Subject: [PATCH 11/24] Set up coverage reports :shield: --- .gitignore | 3 + .travis.yml | 5 +- package-lock.json | 1536 +++++++++++++++++++++++++++++++++++++++++---- package.json | 4 + 4 files changed, 1426 insertions(+), 122 deletions(-) diff --git a/.gitignore b/.gitignore index 82cee7b..2a9bf7b 100644 --- a/.gitignore +++ b/.gitignore @@ -16,3 +16,6 @@ results npm-debug.log .dogapirc + +.nyc_output +coverage.lcov diff --git a/.travis.yml b/.travis.yml index e01223c..881d6a4 100644 --- a/.travis.yml +++ b/.travis.yml @@ -12,4 +12,7 @@ install: script: - npm run lint - - npm test + - npm run cover + +after_success: + - npm run publish-coverage diff --git a/package-lock.json b/package-lock.json index e03ff91..3d15f06 100644 --- a/package-lock.json +++ b/package-lock.json @@ -66,6 +66,12 @@ "js-tokens": "3.0.2" } }, + "@babel/parser": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.3.4.tgz", + "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", + "dev": true + }, "@babel/template": { "version": "7.0.0-beta.44", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", @@ -157,6 +163,15 @@ } } }, + "agent-base": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/agent-base/-/agent-base-4.2.1.tgz", + "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", + "dev": true, + "requires": { + "es6-promisify": "5.0.0" + } + }, "ajv": { "version": "6.10.0", "resolved": "https://registry.npmjs.org/ajv/-/ajv-6.10.0.tgz", @@ -199,6 +214,12 @@ "sprintf-js": "1.0.3" } }, + "argv": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/argv/-/argv-0.0.2.tgz", + "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", + "dev": true + }, "array-differ": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", @@ -353,6 +374,31 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "codecov": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.2.0.tgz", + "integrity": "sha512-3NJvNARXxilqnqVfgzDHyVrF4oeVgaYW1c1O6Oi5mn93exE7HTSSFNiYdwojWW6IwrCZABJ8crpNbKoo9aUHQw==", + "dev": true, + "requires": { + "argv": "0.0.2", + "ignore-walk": "3.0.1", + "js-yaml": "3.12.2", + "teeny-request": "3.11.3", + "urlgrey": "0.4.4" + }, + "dependencies": { + "js-yaml": { + "version": "3.12.2", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.12.2.tgz", + "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", + "dev": true, + "requires": { + "argparse": "1.0.10", + "esprima": "4.0.1" + } + } + } + }, "color-convert": { "version": "1.9.3", "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-1.9.3.tgz", @@ -551,6 +597,21 @@ "is-symbol": "1.0.2" } }, + "es6-promise": { + "version": "4.2.6", + "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", + "integrity": "sha512-aRVgGdnmW2OiySVPUC9e6m+plolMAJKjZnQlCwNSuK5yQ0JN61DZSO1X1Ufd1foqWRAlig0rhduTCHe7sVtK5Q==", + "dev": true + }, + "es6-promisify": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/es6-promisify/-/es6-promisify-5.0.0.tgz", + "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", + "dev": true, + "requires": { + "es6-promise": "4.2.6" + } + }, "escape-string-regexp": { "version": "1.0.5", "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", @@ -1265,6 +1326,16 @@ "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, + "https-proxy-agent": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", + "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", + "dev": true, + "requires": { + "agent-base": "4.2.1", + "debug": "3.1.0" + } + }, "iconv-lite": { "version": "0.4.24", "resolved": "https://registry.npmjs.org/iconv-lite/-/iconv-lite-0.4.24.tgz", @@ -1280,6 +1351,15 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "ignore-walk": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", + "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", + "dev": true, + "requires": { + "minimatch": "3.0.4" + } + }, "import-fresh": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/import-fresh/-/import-fresh-3.0.0.tgz", @@ -1442,6 +1522,157 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "istanbul-lib-coverage": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", + "integrity": "sha512-dKWuzRGCs4G+67VfW9pBFFz2Jpi4vSp/k7zBcJ888ofV5Mi1g5CUML5GvMvV6u9Cjybftu+E8Cgp+k0dI1E5lw==", + "dev": true + }, + "istanbul-lib-instrument": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/istanbul-lib-instrument/-/istanbul-lib-instrument-3.1.0.tgz", + "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", + "dev": true, + "requires": { + "@babel/generator": "7.3.4", + "@babel/parser": "7.3.4", + "@babel/template": "7.2.2", + "@babel/traverse": "7.3.4", + "@babel/types": "7.3.4", + "istanbul-lib-coverage": "2.0.3", + "semver": "5.6.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0.tgz", + "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", + "dev": true, + "requires": { + "@babel/highlight": "7.0.0" + } + }, + "@babel/generator": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.3.4.tgz", + "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", + "dev": true, + "requires": { + "@babel/types": "7.3.4", + "jsesc": "2.5.2", + "lodash": "4.17.11", + "source-map": "0.5.7", + "trim-right": "1.0.1" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0", + "@babel/template": "7.2.2", + "@babel/types": "7.3.4" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "7.3.4" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0.tgz", + "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", + "dev": true, + "requires": { + "@babel/types": "7.3.4" + } + }, + "@babel/highlight": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.0.0.tgz", + "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", + "dev": true, + "requires": { + "chalk": "2.4.2", + "esutils": "2.0.2", + "js-tokens": "4.0.0" + } + }, + "@babel/template": { + "version": "7.2.2", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.2.2.tgz", + "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0", + "@babel/parser": "7.3.4", + "@babel/types": "7.3.4" + } + }, + "@babel/traverse": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.3.4.tgz", + "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", + "dev": true, + "requires": { + "@babel/code-frame": "7.0.0", + "@babel/generator": "7.3.4", + "@babel/helper-function-name": "7.1.0", + "@babel/helper-split-export-declaration": "7.0.0", + "@babel/parser": "7.3.4", + "@babel/types": "7.3.4", + "debug": "4.1.1", + "globals": "11.11.0", + "lodash": "4.17.11" + } + }, + "@babel/types": { + "version": "7.3.4", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.3.4.tgz", + "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", + "dev": true, + "requires": { + "esutils": "2.0.2", + "lodash": "4.17.11", + "to-fast-properties": "2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "2.1.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.11", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.11.tgz", + "integrity": "sha512-cQKh8igo5QUhZ7lg38DYWAxMvjSAKG0A8wGSVimP07SIUEK2UO+arSRKbRZWtelMtN5V0Hkwh5ryOto/SshYIg==", + "dev": true + }, + "ms": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.1.tgz", + "integrity": "sha512-tgp+dl5cGk28utYktBsrFqA7HKgrhgPsg6Z/EfhWI4gl1Hwq8B/GmY/0oXZ6nF8hDVesS/FpnYaD/kOWhYQvyg==", + "dev": true + } + } + }, "jest-docblock": { "version": "21.2.0", "resolved": "https://registry.npmjs.org/jest-docblock/-/jest-docblock-21.2.0.tgz", @@ -1716,6 +1947,12 @@ "integrity": "sha512-1nh45deeb5olNY7eX82BkPO7SSxR5SSYJiPTrTdFUVYwAl8CKMA5N9PjTYkHiRjisVcxcQ1HXdLhx2qxxJzLNQ==", "dev": true }, + "node-fetch": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/node-fetch/-/node-fetch-2.3.0.tgz", + "integrity": "sha512-MOd8pV3fxENbryESLgVIeaGKrdl+uaYhCSSVkjeOb/31/njTpcis5aWfdqgNlHIrKOLRbMnfPINPOML2CIFeXA==", + "dev": true + }, "normalize-package-data": { "version": "2.5.0", "resolved": "https://registry.npmjs.org/normalize-package-data/-/normalize-package-data-2.5.0.tgz", @@ -1728,129 +1965,1163 @@ "validate-npm-package-license": "3.0.4" } }, - "object-assign": { - "version": "4.1.1", - "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", - "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", - "dev": true - }, - "object-keys": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", - "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", - "dev": true - }, - "object.fromentries": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", - "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", - "dev": true, - "requires": { - "define-properties": "1.1.3", - "es-abstract": "1.13.0", - "function-bind": "1.1.1", - "has": "1.0.3" - } - }, - "once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", - "dev": true, - "requires": { - "wrappy": "1.0.2" - } - }, - "onetime": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", - "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", - "dev": true, - "requires": { - "mimic-fn": "1.2.0" - } - }, - "optionator": { - "version": "0.8.2", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", - "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", - "dev": true, - "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" - } - }, - "os-tmpdir": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", - "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", - "dev": true - }, - "p-limit": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", - "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", - "dev": true, - "requires": { - "p-try": "1.0.0" - } - }, - "p-locate": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", - "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", - "dev": true, - "requires": { - "p-limit": "1.3.0" - } - }, - "p-try": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", - "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", - "dev": true - }, - "parent-module": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", - "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", - "dev": true, - "requires": { - "callsites": "3.0.0" - } - }, - "parse-json": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", - "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "nyc": { + "version": "13.3.0", + "resolved": "https://registry.npmjs.org/nyc/-/nyc-13.3.0.tgz", + "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", "dev": true, "requires": { - "error-ex": "1.3.2" - } - }, - "path-exists": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", - "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", - "dev": true - }, - "path-is-absolute": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", - "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", - "dev": true - }, - "path-is-inside": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", - "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", - "dev": true - }, - "path-key": { + "archy": "1.0.0", + "arrify": "1.0.1", + "caching-transform": "3.0.1", + "convert-source-map": "1.6.0", + "find-cache-dir": "2.0.0", + "find-up": "3.0.0", + "foreground-child": "1.5.6", + "glob": "7.1.3", + "istanbul-lib-coverage": "2.0.3", + "istanbul-lib-hook": "2.0.3", + "istanbul-lib-instrument": "3.1.0", + "istanbul-lib-report": "2.0.4", + "istanbul-lib-source-maps": "3.0.2", + "istanbul-reports": "2.1.1", + "make-dir": "1.3.0", + "merge-source-map": "1.1.0", + "resolve-from": "4.0.0", + "rimraf": "2.6.3", + "signal-exit": "3.0.2", + "spawn-wrap": "1.4.2", + "test-exclude": "5.1.0", + "uuid": "3.3.2", + "yargs": "12.0.5", + "yargs-parser": "11.1.1" + }, + "dependencies": { + "ansi-regex": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "append-transform": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "default-require-extensions": "2.0.0" + } + }, + "archy": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "arrify": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "async": { + "version": "2.6.2", + "bundled": true, + "dev": true, + "requires": { + "lodash": "4.17.11" + } + }, + "balanced-match": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "brace-expansion": { + "version": "1.1.11", + "bundled": true, + "dev": true, + "requires": { + "balanced-match": "1.0.0", + "concat-map": "0.0.1" + } + }, + "caching-transform": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "hasha": "3.0.0", + "make-dir": "1.3.0", + "package-hash": "3.0.0", + "write-file-atomic": "2.4.2" + } + }, + "camelcase": { + "version": "5.0.0", + "bundled": true, + "dev": true + }, + "cliui": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "2.1.1", + "strip-ansi": "4.0.0", + "wrap-ansi": "2.1.0" + } + }, + "code-point-at": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "commander": { + "version": "2.17.1", + "bundled": true, + "dev": true, + "optional": true + }, + "commondir": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "concat-map": { + "version": "0.0.1", + "bundled": true, + "dev": true + }, + "convert-source-map": { + "version": "1.6.0", + "bundled": true, + "dev": true, + "requires": { + "safe-buffer": "5.1.2" + } + }, + "cross-spawn": { + "version": "4.0.2", + "bundled": true, + "dev": true, + "requires": { + "lru-cache": "4.1.5", + "which": "1.3.1" + } + }, + "debug": { + "version": "4.1.1", + "bundled": true, + "dev": true, + "requires": { + "ms": "2.1.1" + } + }, + "decamelize": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "default-require-extensions": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "strip-bom": "3.0.0" + } + }, + "end-of-stream": { + "version": "1.4.1", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0" + } + }, + "error-ex": { + "version": "1.3.2", + "bundled": true, + "dev": true, + "requires": { + "is-arrayish": "0.2.1" + } + }, + "es6-error": { + "version": "4.1.1", + "bundled": true, + "dev": true + }, + "execa": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "6.0.5", + "get-stream": "4.1.0", + "is-stream": "1.1.0", + "npm-run-path": "2.0.2", + "p-finally": "1.0.0", + "signal-exit": "3.0.2", + "strip-eof": "1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "6.0.5", + "bundled": true, + "dev": true, + "requires": { + "nice-try": "1.0.5", + "path-key": "2.0.1", + "semver": "5.6.0", + "shebang-command": "1.2.0", + "which": "1.3.1" + } + } + } + }, + "find-cache-dir": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "commondir": "1.0.1", + "make-dir": "1.3.0", + "pkg-dir": "3.0.0" + } + }, + "find-up": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "locate-path": "3.0.0" + } + }, + "foreground-child": { + "version": "1.5.6", + "bundled": true, + "dev": true, + "requires": { + "cross-spawn": "4.0.2", + "signal-exit": "3.0.2" + } + }, + "fs.realpath": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "get-caller-file": { + "version": "1.0.3", + "bundled": true, + "dev": true + }, + "get-stream": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "pump": "3.0.0" + } + }, + "glob": { + "version": "7.1.3", + "bundled": true, + "dev": true, + "requires": { + "fs.realpath": "1.0.0", + "inflight": "1.0.6", + "inherits": "2.0.3", + "minimatch": "3.0.4", + "once": "1.4.0", + "path-is-absolute": "1.0.1" + } + }, + "graceful-fs": { + "version": "4.1.15", + "bundled": true, + "dev": true + }, + "handlebars": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "async": "2.6.2", + "optimist": "0.6.1", + "source-map": "0.6.1", + "uglify-js": "3.4.9" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "has-flag": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "hasha": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "is-stream": "1.1.0" + } + }, + "hosted-git-info": { + "version": "2.7.1", + "bundled": true, + "dev": true + }, + "imurmurhash": { + "version": "0.1.4", + "bundled": true, + "dev": true + }, + "inflight": { + "version": "1.0.6", + "bundled": true, + "dev": true, + "requires": { + "once": "1.4.0", + "wrappy": "1.0.2" + } + }, + "inherits": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "invert-kv": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-arrayish": { + "version": "0.2.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "is-stream": { + "version": "1.1.0", + "bundled": true, + "dev": true + }, + "isexe": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "istanbul-lib-coverage": { + "version": "2.0.3", + "bundled": true, + "dev": true + }, + "istanbul-lib-hook": { + "version": "2.0.3", + "bundled": true, + "dev": true, + "requires": { + "append-transform": "1.0.0" + } + }, + "istanbul-lib-report": { + "version": "2.0.4", + "bundled": true, + "dev": true, + "requires": { + "istanbul-lib-coverage": "2.0.3", + "make-dir": "1.3.0", + "supports-color": "6.1.0" + }, + "dependencies": { + "supports-color": { + "version": "6.1.0", + "bundled": true, + "dev": true, + "requires": { + "has-flag": "3.0.0" + } + } + } + }, + "istanbul-lib-source-maps": { + "version": "3.0.2", + "bundled": true, + "dev": true, + "requires": { + "debug": "4.1.1", + "istanbul-lib-coverage": "2.0.3", + "make-dir": "1.3.0", + "rimraf": "2.6.3", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "istanbul-reports": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "handlebars": "4.1.0" + } + }, + "json-parse-better-errors": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "lcid": { + "version": "2.0.0", + "bundled": true, + "dev": true, + "requires": { + "invert-kv": "2.0.0" + } + }, + "load-json-file": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "parse-json": "4.0.0", + "pify": "3.0.0", + "strip-bom": "3.0.0" + } + }, + "locate-path": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-locate": "3.0.0", + "path-exists": "3.0.0" + } + }, + "lodash": { + "version": "4.17.11", + "bundled": true, + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "bundled": true, + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "bundled": true, + "dev": true, + "requires": { + "pseudomap": "1.0.2", + "yallist": "2.1.2" + } + }, + "make-dir": { + "version": "1.3.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "map-age-cleaner": { + "version": "0.1.3", + "bundled": true, + "dev": true, + "requires": { + "p-defer": "1.0.0" + } + }, + "mem": { + "version": "4.1.0", + "bundled": true, + "dev": true, + "requires": { + "map-age-cleaner": "0.1.3", + "mimic-fn": "1.2.0", + "p-is-promise": "2.0.0" + } + }, + "merge-source-map": { + "version": "1.1.0", + "bundled": true, + "dev": true, + "requires": { + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true + } + } + }, + "mimic-fn": { + "version": "1.2.0", + "bundled": true, + "dev": true + }, + "minimatch": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "brace-expansion": "1.1.11" + } + }, + "minimist": { + "version": "0.0.10", + "bundled": true, + "dev": true + }, + "mkdirp": { + "version": "0.5.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.8" + }, + "dependencies": { + "minimist": { + "version": "0.0.8", + "bundled": true, + "dev": true + } + } + }, + "ms": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "nice-try": { + "version": "1.0.5", + "bundled": true, + "dev": true + }, + "normalize-package-data": { + "version": "2.5.0", + "bundled": true, + "dev": true, + "requires": { + "hosted-git-info": "2.7.1", + "resolve": "1.10.0", + "semver": "5.6.0", + "validate-npm-package-license": "3.0.4" + } + }, + "npm-run-path": { + "version": "2.0.2", + "bundled": true, + "dev": true, + "requires": { + "path-key": "2.0.1" + } + }, + "number-is-nan": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "once": { + "version": "1.4.0", + "bundled": true, + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "optimist": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "requires": { + "minimist": "0.0.10", + "wordwrap": "0.0.3" + } + }, + "os-homedir": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "os-locale": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "execa": "1.0.0", + "lcid": "2.0.0", + "mem": "4.1.0" + } + }, + "p-defer": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "p-is-promise": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "p-limit": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "p-try": "2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "p-limit": "2.1.0" + } + }, + "p-try": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "package-hash": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "hasha": "3.0.0", + "lodash.flattendeep": "4.4.0", + "release-zalgo": "1.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "error-ex": "1.3.2", + "json-parse-better-errors": "1.0.2" + } + }, + "path-exists": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "path-key": { + "version": "2.0.1", + "bundled": true, + "dev": true + }, + "path-parse": { + "version": "1.0.6", + "bundled": true, + "dev": true + }, + "path-type": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "pify": "3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "pkg-dir": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "3.0.0" + } + }, + "pseudomap": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "pump": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "end-of-stream": "1.4.1", + "once": "1.4.0" + } + }, + "read-pkg": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "load-json-file": "4.0.0", + "normalize-package-data": "2.5.0", + "path-type": "3.0.0" + } + }, + "read-pkg-up": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "find-up": "3.0.0", + "read-pkg": "3.0.0" + } + }, + "release-zalgo": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "es6-error": "4.1.1" + } + }, + "require-directory": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "require-main-filename": { + "version": "1.0.1", + "bundled": true, + "dev": true + }, + "resolve": { + "version": "1.10.0", + "bundled": true, + "dev": true, + "requires": { + "path-parse": "1.0.6" + } + }, + "resolve-from": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "rimraf": { + "version": "2.6.3", + "bundled": true, + "dev": true, + "requires": { + "glob": "7.1.3" + } + }, + "safe-buffer": { + "version": "5.1.2", + "bundled": true, + "dev": true + }, + "semver": { + "version": "5.6.0", + "bundled": true, + "dev": true + }, + "set-blocking": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "shebang-command": { + "version": "1.2.0", + "bundled": true, + "dev": true, + "requires": { + "shebang-regex": "1.0.0" + } + }, + "shebang-regex": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "signal-exit": { + "version": "3.0.2", + "bundled": true, + "dev": true + }, + "spawn-wrap": { + "version": "1.4.2", + "bundled": true, + "dev": true, + "requires": { + "foreground-child": "1.5.6", + "mkdirp": "0.5.1", + "os-homedir": "1.0.2", + "rimraf": "2.6.3", + "signal-exit": "3.0.2", + "which": "1.3.1" + } + }, + "spdx-correct": { + "version": "3.1.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-expression-parse": "3.0.0", + "spdx-license-ids": "3.0.3" + } + }, + "spdx-exceptions": { + "version": "2.2.0", + "bundled": true, + "dev": true + }, + "spdx-expression-parse": { + "version": "3.0.0", + "bundled": true, + "dev": true, + "requires": { + "spdx-exceptions": "2.2.0", + "spdx-license-ids": "3.0.3" + } + }, + "spdx-license-ids": { + "version": "3.0.3", + "bundled": true, + "dev": true + }, + "string-width": { + "version": "2.1.1", + "bundled": true, + "dev": true, + "requires": { + "is-fullwidth-code-point": "2.0.0", + "strip-ansi": "4.0.0" + } + }, + "strip-ansi": { + "version": "4.0.0", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "3.0.0" + } + }, + "strip-bom": { + "version": "3.0.0", + "bundled": true, + "dev": true + }, + "strip-eof": { + "version": "1.0.0", + "bundled": true, + "dev": true + }, + "test-exclude": { + "version": "5.1.0", + "bundled": true, + "dev": true, + "requires": { + "arrify": "1.0.1", + "minimatch": "3.0.4", + "read-pkg-up": "4.0.0", + "require-main-filename": "1.0.1" + } + }, + "uglify-js": { + "version": "3.4.9", + "bundled": true, + "dev": true, + "optional": true, + "requires": { + "commander": "2.17.1", + "source-map": "0.6.1" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "bundled": true, + "dev": true, + "optional": true + } + } + }, + "uuid": { + "version": "3.3.2", + "bundled": true, + "dev": true + }, + "validate-npm-package-license": { + "version": "3.0.4", + "bundled": true, + "dev": true, + "requires": { + "spdx-correct": "3.1.0", + "spdx-expression-parse": "3.0.0" + } + }, + "which": { + "version": "1.3.1", + "bundled": true, + "dev": true, + "requires": { + "isexe": "2.0.0" + } + }, + "which-module": { + "version": "2.0.0", + "bundled": true, + "dev": true + }, + "wordwrap": { + "version": "0.0.3", + "bundled": true, + "dev": true + }, + "wrap-ansi": { + "version": "2.1.0", + "bundled": true, + "dev": true, + "requires": { + "string-width": "1.0.2", + "strip-ansi": "3.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "2.1.1", + "bundled": true, + "dev": true + }, + "is-fullwidth-code-point": { + "version": "1.0.0", + "bundled": true, + "dev": true, + "requires": { + "number-is-nan": "1.0.1" + } + }, + "string-width": { + "version": "1.0.2", + "bundled": true, + "dev": true, + "requires": { + "code-point-at": "1.1.0", + "is-fullwidth-code-point": "1.0.0", + "strip-ansi": "3.0.1" + } + }, + "strip-ansi": { + "version": "3.0.1", + "bundled": true, + "dev": true, + "requires": { + "ansi-regex": "2.1.1" + } + } + } + }, + "wrappy": { + "version": "1.0.2", + "bundled": true, + "dev": true + }, + "write-file-atomic": { + "version": "2.4.2", + "bundled": true, + "dev": true, + "requires": { + "graceful-fs": "4.1.15", + "imurmurhash": "0.1.4", + "signal-exit": "3.0.2" + } + }, + "y18n": { + "version": "4.0.0", + "bundled": true, + "dev": true + }, + "yallist": { + "version": "2.1.2", + "bundled": true, + "dev": true + }, + "yargs": { + "version": "12.0.5", + "bundled": true, + "dev": true, + "requires": { + "cliui": "4.1.0", + "decamelize": "1.2.0", + "find-up": "3.0.0", + "get-caller-file": "1.0.3", + "os-locale": "3.1.0", + "require-directory": "2.1.1", + "require-main-filename": "1.0.1", + "set-blocking": "2.0.0", + "string-width": "2.1.1", + "which-module": "2.0.0", + "y18n": "4.0.0", + "yargs-parser": "11.1.1" + } + }, + "yargs-parser": { + "version": "11.1.1", + "bundled": true, + "dev": true, + "requires": { + "camelcase": "5.0.0", + "decamelize": "1.2.0" + } + } + } + }, + "object-assign": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/object-assign/-/object-assign-4.1.1.tgz", + "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", + "dev": true + }, + "object-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", + "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", + "dev": true + }, + "object.fromentries": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", + "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", + "dev": true, + "requires": { + "define-properties": "1.1.3", + "es-abstract": "1.13.0", + "function-bind": "1.1.1", + "has": "1.0.3" + } + }, + "once": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", + "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", + "dev": true, + "requires": { + "wrappy": "1.0.2" + } + }, + "onetime": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-2.0.1.tgz", + "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", + "dev": true, + "requires": { + "mimic-fn": "1.2.0" + } + }, + "optionator": { + "version": "0.8.2", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.2.tgz", + "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", + "dev": true, + "requires": { + "deep-is": "0.1.3", + "fast-levenshtein": "2.0.6", + "levn": "0.3.0", + "prelude-ls": "1.1.2", + "type-check": "0.3.2", + "wordwrap": "1.0.0" + } + }, + "os-tmpdir": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/os-tmpdir/-/os-tmpdir-1.0.2.tgz", + "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", + "dev": true + }, + "p-limit": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", + "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", + "dev": true, + "requires": { + "p-try": "1.0.0" + } + }, + "p-locate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-2.0.0.tgz", + "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", + "dev": true, + "requires": { + "p-limit": "1.3.0" + } + }, + "p-try": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", + "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", + "dev": true + }, + "parent-module": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", + "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", + "dev": true, + "requires": { + "callsites": "3.0.0" + } + }, + "parse-json": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-2.2.0.tgz", + "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", + "dev": true, + "requires": { + "error-ex": "1.3.2" + } + }, + "path-exists": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", + "integrity": "sha1-zg6+ql94yxiSXqfYENe1mwEP1RU=", + "dev": true + }, + "path-is-absolute": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/path-is-absolute/-/path-is-absolute-1.0.1.tgz", + "integrity": "sha1-F0uSaHNVNP+8es5r9TpanhtcX18=", + "dev": true + }, + "path-is-inside": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/path-is-inside/-/path-is-inside-1.0.2.tgz", + "integrity": "sha1-NlQX3t5EQw0cEa9hAn+s8HS9/FM=", + "dev": true + }, + "path-key": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/path-key/-/path-key-2.0.1.tgz", "integrity": "sha1-QRyttXTFoUDTpLGRDUDYDMn0C0A=", @@ -2319,6 +3590,17 @@ } } }, + "teeny-request": { + "version": "3.11.3", + "resolved": "https://registry.npmjs.org/teeny-request/-/teeny-request-3.11.3.tgz", + "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==", + "dev": true, + "requires": { + "https-proxy-agent": "2.2.1", + "node-fetch": "2.3.0", + "uuid": "3.3.2" + } + }, "text-table": { "version": "0.2.0", "resolved": "https://registry.npmjs.org/text-table/-/text-table-0.2.0.tgz", @@ -2376,6 +3658,18 @@ "punycode": "2.1.1" } }, + "urlgrey": { + "version": "0.4.4", + "resolved": "https://registry.npmjs.org/urlgrey/-/urlgrey-0.4.4.tgz", + "integrity": "sha1-iS/pWWCAXoVRnxzUOJ8stMu3ZS8=", + "dev": true + }, + "uuid": { + "version": "3.3.2", + "resolved": "https://registry.npmjs.org/uuid/-/uuid-3.3.2.tgz", + "integrity": "sha512-yXJmeNaw3DnnKAOKJE51sL/ZaYfWJRl1pK9dr19YFCu0ObS231AB1/LbqTKRAQ5kw8A90rA6fr4riOUpTZvQZA==", + "dev": true + }, "validate-npm-package-license": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/validate-npm-package-license/-/validate-npm-package-license-3.0.4.tgz", diff --git a/package.json b/package.json index ce68540..77fa538 100644 --- a/package.json +++ b/package.json @@ -8,6 +8,8 @@ }, "scripts": { "test": "./node_modules/.bin/mocha --recursive ./test", + "cover": "nyc npm run test", + "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint lib test bin/dogapi examples", "docs": "node ./docs/create.js > index.html" }, @@ -40,12 +42,14 @@ "devDependencies": { "@coorpacademy/eslint-plugin-coorpacademy": "^8.1.1", "bignumber.js": "^2.0.7", + "codecov": "^3.2.0", "docast": "^0.1.1", "eslint": "^5.15.1", "glob": "^6.0.0", "js-yaml": "^3.2.7", "marked": "^0.3.9", "mocha": "^5.2.0", + "nyc": "^13.3.0", "sinon": "^1.15.4" } } From 449180b0e255c94e6999a4d9012bca3ad3bfa993 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 8 Mar 2019 16:04:22 +0100 Subject: [PATCH 12/24] Tune coverage setting and reports :spiral_notepad: --- .gitignore | 1 + .nycrc | 19 +++++++++++++++++++ 2 files changed, 20 insertions(+) create mode 100644 .nycrc diff --git a/.gitignore b/.gitignore index 2a9bf7b..72d412e 100644 --- a/.gitignore +++ b/.gitignore @@ -19,3 +19,4 @@ npm-debug.log .nyc_output coverage.lcov +coverage diff --git a/.nycrc b/.nycrc new file mode 100644 index 0000000..8fb0fd7 --- /dev/null +++ b/.nycrc @@ -0,0 +1,19 @@ +{ + "all": true, + "reporter": [ + "html", + "lcov", + "text", + "text-summary" + ], + "report-dir": "./coverage", + "include": [ + "lib/**/*.js" + ], + "exclude": [ + "test/**/*", + "examples/" + ], + "cache": true +} + From 34c3930377208648d0f181bd6c77d5cd892dc7a2 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 8 Mar 2019 16:06:56 +0100 Subject: [PATCH 13/24] Add coverage badge to the README :name_badge: --- README.md | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index cf103d1..454885a 100644 --- a/README.md +++ b/README.md @@ -4,12 +4,13 @@ dogapi [![npm version](https://badge.fury.io/js/dogapi.svg)](https://www.npmjs.com/package/dogapi) [![Build Status](https://travis-ci.org/brettlangdon/node-dogapi.svg?branch=master)](https://travis-ci.org/brettlangdon/node-dogapi) [![Dependency Status](https://david-dm.org/brettlangdon/node-dogapi.svg)](https://david-dm.org/brettlangdon/node-dogapi) +[![codecov](https://codecov.io/gh/brettlangdon/node-dogapi/branch/master/graph/badge.svg)](https://codecov.io/gh/brettlangdon/node-dogapi) -Datadog API Node.JS Client. +> Datadog API Node.JS Client. Official Datadog API Documentation: http://docs.datadoghq.com/api/ -dogapi API Docs: http://brettlangdon.github.io/node-dogapi/ +`dogapi` API Docs: http://brettlangdon.github.io/node-dogapi/ ## StatsD From 1df6286bdc7c575920b31bfe517cc47cfa80866f Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 14:52:44 +0200 Subject: [PATCH 14/24] Rename packages and warning in README --- README.md | 18 +++++++++++------- package.json | 6 +++--- 2 files changed, 14 insertions(+), 10 deletions(-) diff --git a/README.md b/README.md index 454885a..432fb01 100644 --- a/README.md +++ b/README.md @@ -1,16 +1,20 @@ -dogapi -====== +datadog-client +============== + +> Datadog API Node.JS Client. + +:warning: This is a fork from [node-dogapi](https://github.com/brettlangdon/node-dogapi) + +**README does not yet fully reflect that!** [![npm version](https://badge.fury.io/js/dogapi.svg)](https://www.npmjs.com/package/dogapi) [![Build Status](https://travis-ci.org/brettlangdon/node-dogapi.svg?branch=master)](https://travis-ci.org/brettlangdon/node-dogapi) [![Dependency Status](https://david-dm.org/brettlangdon/node-dogapi.svg)](https://david-dm.org/brettlangdon/node-dogapi) [![codecov](https://codecov.io/gh/brettlangdon/node-dogapi/branch/master/graph/badge.svg)](https://codecov.io/gh/brettlangdon/node-dogapi) -> Datadog API Node.JS Client. - -Official Datadog API Documentation: http://docs.datadoghq.com/api/ - -`dogapi` API Docs: http://brettlangdon.github.io/node-dogapi/ +# Documentation :books: +- Official Datadog API Documentation: http://docs.datadoghq.com/api/ +- Original `dogapi` API Docs: http://brettlangdon.github.io/node-dogapi/ ## StatsD diff --git a/package.json b/package.json index 77fa538..94fdf6c 100644 --- a/package.json +++ b/package.json @@ -1,5 +1,5 @@ { - "name": "dogapi", + "name": "datadog-client", "version": "2.8.3", "description": "Datadog API Node.JS Client", "main": "lib/index.js", @@ -14,7 +14,8 @@ "docs": "node ./docs/create.js > index.html" }, "bin": { - "dogapi": "bin/dogapi" + "dogapi": "bin/dogapi", + "datadog-cli": "bin/dogapi" }, "repository": { "type": "git", @@ -31,7 +32,6 @@ "author": "Brett Langdon <me@brett.is> (http://brett.is)", "license": "MIT", "readmeFilename": "README.md", - "gitHead": "f388635a5ab4f4da25702dc0999385d437bdf2bc", "dependencies": { "extend": "^3.0.0", "json-bigint": "^0.1.4", From 4c70d9ae45f0bc0b1b288e29d6478121de7dbd73 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 14:56:41 +0200 Subject: [PATCH 15/24] Reorganise a bit the repository :file_cabinet: --- index.html => documentation/index.html | 0 package.json | 6 +++--- docs/create.js => scripts/create-documentation.js | 0 {lib => src}/api/comment.js | 0 {lib => src}/api/downtime.js | 0 {lib => src}/api/embed.js | 0 {lib => src}/api/event.js | 0 {lib => src}/api/graph.js | 0 {lib => src}/api/host.js | 0 {lib => src}/api/index.js | 0 {lib => src}/api/infrastructure.js | 0 {lib => src}/api/metric.js | 0 {lib => src}/api/monitor.js | 0 {lib => src}/api/screenboard.js | 0 {lib => src}/api/search.js | 0 {lib => src}/api/service-check.js | 0 {lib => src}/api/tag.js | 0 {lib => src}/api/timeboard.js | 0 {lib => src}/api/user.js | 0 {lib => src}/client.js | 0 {lib => src}/constants.js | 0 {lib => src}/index.js | 0 {lib => src}/json.js | 0 23 files changed, 3 insertions(+), 3 deletions(-) rename index.html => documentation/index.html (100%) rename docs/create.js => scripts/create-documentation.js (100%) rename {lib => src}/api/comment.js (100%) rename {lib => src}/api/downtime.js (100%) rename {lib => src}/api/embed.js (100%) rename {lib => src}/api/event.js (100%) rename {lib => src}/api/graph.js (100%) rename {lib => src}/api/host.js (100%) rename {lib => src}/api/index.js (100%) rename {lib => src}/api/infrastructure.js (100%) rename {lib => src}/api/metric.js (100%) rename {lib => src}/api/monitor.js (100%) rename {lib => src}/api/screenboard.js (100%) rename {lib => src}/api/search.js (100%) rename {lib => src}/api/service-check.js (100%) rename {lib => src}/api/tag.js (100%) rename {lib => src}/api/timeboard.js (100%) rename {lib => src}/api/user.js (100%) rename {lib => src}/client.js (100%) rename {lib => src}/constants.js (100%) rename {lib => src}/index.js (100%) rename {lib => src}/json.js (100%) diff --git a/index.html b/documentation/index.html similarity index 100% rename from index.html rename to documentation/index.html diff --git a/package.json b/package.json index 94fdf6c..ed18678 100644 --- a/package.json +++ b/package.json @@ -1,8 +1,8 @@ { "name": "datadog-client", - "version": "2.8.3", + "version": "3.0.0-alpha.0", "description": "Datadog API Node.JS Client", - "main": "lib/index.js", + "main": "src/index.js", "engines": { "node": ">= 6.10.0" }, @@ -11,7 +11,7 @@ "cover": "nyc npm run test", "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint lib test bin/dogapi examples", - "docs": "node ./docs/create.js > index.html" + "docs": "node ./scripts/create-documentation.js > documentation/index.html" }, "bin": { "dogapi": "bin/dogapi", diff --git a/docs/create.js b/scripts/create-documentation.js similarity index 100% rename from docs/create.js rename to scripts/create-documentation.js diff --git a/lib/api/comment.js b/src/api/comment.js similarity index 100% rename from lib/api/comment.js rename to src/api/comment.js diff --git a/lib/api/downtime.js b/src/api/downtime.js similarity index 100% rename from lib/api/downtime.js rename to src/api/downtime.js diff --git a/lib/api/embed.js b/src/api/embed.js similarity index 100% rename from lib/api/embed.js rename to src/api/embed.js diff --git a/lib/api/event.js b/src/api/event.js similarity index 100% rename from lib/api/event.js rename to src/api/event.js diff --git a/lib/api/graph.js b/src/api/graph.js similarity index 100% rename from lib/api/graph.js rename to src/api/graph.js diff --git a/lib/api/host.js b/src/api/host.js similarity index 100% rename from lib/api/host.js rename to src/api/host.js diff --git a/lib/api/index.js b/src/api/index.js similarity index 100% rename from lib/api/index.js rename to src/api/index.js diff --git a/lib/api/infrastructure.js b/src/api/infrastructure.js similarity index 100% rename from lib/api/infrastructure.js rename to src/api/infrastructure.js diff --git a/lib/api/metric.js b/src/api/metric.js similarity index 100% rename from lib/api/metric.js rename to src/api/metric.js diff --git a/lib/api/monitor.js b/src/api/monitor.js similarity index 100% rename from lib/api/monitor.js rename to src/api/monitor.js diff --git a/lib/api/screenboard.js b/src/api/screenboard.js similarity index 100% rename from lib/api/screenboard.js rename to src/api/screenboard.js diff --git a/lib/api/search.js b/src/api/search.js similarity index 100% rename from lib/api/search.js rename to src/api/search.js diff --git a/lib/api/service-check.js b/src/api/service-check.js similarity index 100% rename from lib/api/service-check.js rename to src/api/service-check.js diff --git a/lib/api/tag.js b/src/api/tag.js similarity index 100% rename from lib/api/tag.js rename to src/api/tag.js diff --git a/lib/api/timeboard.js b/src/api/timeboard.js similarity index 100% rename from lib/api/timeboard.js rename to src/api/timeboard.js diff --git a/lib/api/user.js b/src/api/user.js similarity index 100% rename from lib/api/user.js rename to src/api/user.js diff --git a/lib/client.js b/src/client.js similarity index 100% rename from lib/client.js rename to src/client.js diff --git a/lib/constants.js b/src/constants.js similarity index 100% rename from lib/constants.js rename to src/constants.js diff --git a/lib/index.js b/src/index.js similarity index 100% rename from lib/index.js rename to src/index.js diff --git a/lib/json.js b/src/json.js similarity index 100% rename from lib/json.js rename to src/json.js From 95d46d320c25c71d20c7adb538ce125407c87535 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:01:09 +0200 Subject: [PATCH 16/24] Extract license from README :balance_scale: --- LICENSE | 22 ++++++++++++++++++++++ README.md | 11 ----------- package.json | 9 ++++++--- 3 files changed, 28 insertions(+), 14 deletions(-) create mode 100644 LICENSE diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..d8f9efc --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +The MIT License (MIT) +Copyright (c) 2013 Brett Langdon <me@brett.is> +Copyright (c) 2019 Adriean Khisbe + + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, +DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR +OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE +OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/README.md b/README.md index 432fb01..5ce2329 100644 --- a/README.md +++ b/README.md @@ -164,14 +164,3 @@ var metrics = [ ]; dogapi.metric.send_all(metrics); ``` - -## License - -The MIT License (MIT) -Copyright (c) 2013 Brett Langdon <me@brett.is> - -Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions: - -The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. - -THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. diff --git a/package.json b/package.json index ed18678..36ef1f7 100644 --- a/package.json +++ b/package.json @@ -6,8 +6,13 @@ "engines": { "node": ">= 6.10.0" }, + "author": "Brett Langdon <me@brett.is> (http://brett.is)", + "contributors": [ + "Adriean Khisbe <adriean.khisbe@live.fr> (https://github.com/AdrieanKhisbe/)" + ], + "license": "MIT", "scripts": { - "test": "./node_modules/.bin/mocha --recursive ./test", + "test": "mocha --recursive ./test", "cover": "nyc npm run test", "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint lib test bin/dogapi examples", @@ -29,8 +34,6 @@ "dogapi", "dog api" ], - "author": "Brett Langdon <me@brett.is> (http://brett.is)", - "license": "MIT", "readmeFilename": "README.md", "dependencies": { "extend": "^3.0.0", From 6681895b62dc52d89f93ca5cc800d0d0386ca60b Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:02:30 +0200 Subject: [PATCH 17/24] Update tested version on npm to reflect new lts :vertical_traffic_light: --- .travis.yml | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/.travis.yml b/.travis.yml index 881d6a4..c484145 100644 --- a/.travis.yml +++ b/.travis.yml @@ -1,10 +1,8 @@ language: node_js node_js: - - "6" - - "7" - "8" - - "9" - "10" + - "12" - "node" install: From a2ce6d592bf36a1973fd95ee9b24162ce83cab75 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:04:17 +0200 Subject: [PATCH 18/24] Add some npmignore for future publications :see_no_evil: --- .npmignore | 8 ++++++++ 1 file changed, 8 insertions(+) create mode 100644 .npmignore diff --git a/.npmignore b/.npmignore new file mode 100644 index 0000000..c479a1e --- /dev/null +++ b/.npmignore @@ -0,0 +1,8 @@ +documentation +scripts +.eslintrc +.eslintignore +.travis.yml +tmp +private +examples From 7afaeacb6e3591180411f2c910d53f0ab8c39334 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:06:52 +0200 Subject: [PATCH 19/24] Rewire together package post to package reorg :paperclips: --- .nycrc | 2 +- bin/dogapi | 4 ++-- examples/new-interface.js | 2 +- examples/original-interface.js | 2 +- package.json | 2 +- scripts/create-documentation.js | 2 +- test/api/embed.js | 4 ++-- test/api/metric.js | 4 ++-- test/json.js | 2 +- 9 files changed, 12 insertions(+), 12 deletions(-) diff --git a/.nycrc b/.nycrc index 8fb0fd7..e705be6 100644 --- a/.nycrc +++ b/.nycrc @@ -8,7 +8,7 @@ ], "report-dir": "./coverage", "include": [ - "lib/**/*.js" + "src/**/*.js" ], "exclude": [ "test/**/*", diff --git a/bin/dogapi b/bin/dogapi index e71588c..d20cac8 100755 --- a/bin/dogapi +++ b/bin/dogapi @@ -1,9 +1,9 @@ #!/usr/bin/env node const dogapi = require('..'); -const json = require('../lib/json'); +const json = require('../src/json'); const minimist = require('minimist'); const rc = require('rc'); -const EOL = require('os').EOL; +const {EOL} = require('os'); const config = rc('dogapi', { api_key: null, diff --git a/examples/new-interface.js b/examples/new-interface.js index ea37b5e..559d3b5 100644 --- a/examples/new-interface.js +++ b/examples/new-interface.js @@ -1,4 +1,4 @@ -const Dogapi = require('../lib'); +const Dogapi = require('../src'); // use 'datadog-client' instead const options = { api_key: 'YOUR_KEY_HERE', diff --git a/examples/original-interface.js b/examples/original-interface.js index 161f1a0..c9664cf 100644 --- a/examples/original-interface.js +++ b/examples/original-interface.js @@ -1,4 +1,4 @@ -const dogapi = require('../lib'); +const dogapi = require('../src'); // use 'datadog-client' instead const options = { api_key: 'YOUR_KEY_HERE', diff --git a/package.json b/package.json index 36ef1f7..f5dcab8 100644 --- a/package.json +++ b/package.json @@ -15,7 +15,7 @@ "test": "mocha --recursive ./test", "cover": "nyc npm run test", "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", - "lint": "eslint lib test bin/dogapi examples", + "lint": "eslint src test bin/dogapi examples", "docs": "node ./scripts/create-documentation.js > documentation/index.html" }, "bin": { diff --git a/scripts/create-documentation.js b/scripts/create-documentation.js index 49599bd..1441515 100644 --- a/scripts/create-documentation.js +++ b/scripts/create-documentation.js @@ -11,7 +11,7 @@ marked.setOptions({ pedantic: false }); -var above = path.resolve(__dirname, "../lib/"); +var above = path.resolve(__dirname, "../src/"); var match = above + "/**/*.js"; var docs = {}; diff --git a/test/api/embed.js b/test/api/embed.js index 081e3c6..7edf9e4 100644 --- a/test/api/embed.js +++ b/test/api/embed.js @@ -1,8 +1,8 @@ const assert = require('assert'); const querystring = require('querystring'); const sinon = require('sinon'); -const Client = require('../../lib/client'); -const Embed = require('../../lib/api/embed'); +const Client = require('../../src/client'); +const Embed = require('../../src/api/embed'); describe('api/embed', function() { const client = new Client({}); diff --git a/test/api/metric.js b/test/api/metric.js index 632ad5d..13702ab 100644 --- a/test/api/metric.js +++ b/test/api/metric.js @@ -1,7 +1,7 @@ const assert = require('assert'); const sinon = require('sinon'); -const Client = require('../../lib/client'); -const Metric = require('../../lib/api/metric'); +const Client = require('../../src/client'); +const Metric = require('../../src/api/metric'); describe('api/metrics', function() { const client = new Client({}); diff --git a/test/json.js b/test/json.js index 73ba430..9601cbe 100644 --- a/test/json.js +++ b/test/json.js @@ -1,6 +1,6 @@ const assert = require('assert'); const BigNumber = require('bignumber.js'); -const json = require('../lib/json'); +const json = require('../src/json'); describe('json', function() { describe('#parse()', function() { From 38190f9e09996879aa2c67a14d2d6c7c64396716 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:32:40 +0200 Subject: [PATCH 20/24] Refactoring constant and bin/cli :hammer_and_wrench: --- bin/dogapi | 105 +++++++++++++++++++---------------------------- src/constants.js | 13 +++--- 2 files changed, 47 insertions(+), 71 deletions(-) diff --git a/bin/dogapi b/bin/dogapi index d20cac8..6301493 100755 --- a/bin/dogapi +++ b/bin/dogapi @@ -1,17 +1,19 @@ #!/usr/bin/env node const dogapi = require('..'); +const _ = require('lodash/fp'); const json = require('../src/json'); const minimist = require('minimist'); const rc = require('rc'); const {EOL} = require('os'); +const {version} = require('../package'); -const config = rc('dogapi', { - api_key: null, - app_key: null -}); +const config = rc('dogapi', {api_key: null, app_key: null}); dogapi.initialize(config); -let usage = [ +const hasKey = (key, functionName) => + _.hasOwnProperty(functionName, dogapi[key]) && _.isFunction(_.get([key, functionName], dogapi)); + +const usage = [ 'Usage:', ' dogapi --help', ' dogapi <command> --help', @@ -20,71 +22,48 @@ let usage = [ ' dogapi past <seconds-ago>', ' dogapi future <seconds-ahead>' ]; -let help = []; -for (const key in dogapi) { - if (!dogapi.hasOwnProperty(key)) { - continue; - } else if ( - !dogapi[key].hasOwnProperty('getUsage') || - typeof dogapi[key].getUsage !== 'function' - ) { - continue; - } else if ( - !dogapi[key].hasOwnProperty('handleCli') || - typeof dogapi[key].handleCli !== 'function' - ) { - continue; - } - usage = usage.concat(dogapi[key].getUsage()); - - if (dogapi[key].hasOwnProperty('getHelp') && typeof dogapi[key].getHelp === 'function') { - help = help.concat([''], dogapi[key].getHelp()); - } -} +const help = []; +_.keys(dogapi).forEach(key => { + if (!hasKey(key, 'getUsage') || hasKey(key, 'handleCli')) return; + usage.push(...dogapi[key].getUsage()); + if (hasKey(key, 'getHelp')) help.push('', ...dogapi[key].getHelp()); +}); -usage = usage.concat(help); -usage = usage.join(EOL); -const args = minimist(process.argv); +usage.push(...help); -let command = args._[2]; -const subcommand = args._[3]; +const main = args => { + const command = args._[2] === 'servicecheck' ? 'serviceCheck' : args._[2]; + const subcommand = args._[3]; -// this is the one unusual case -if (command === 'servicecheck') { - command = 'serviceCheck'; -} + if (command === 'now') return console.log(dogapi.now()); + if (command === 'past' && args._.length > 3) + return console.log(dogapi.now() - parseInt(args._[args._.length - 1])); + if (command === 'future' && args._.length > 3) + return console.log(dogapi.now() + parseInt(args._[args._.length - 1])); -if (command === 'now') { - console.log(dogapi.now()); -} else if (command === 'past' && args._.length > 3) { - console.log(dogapi.now() - parseInt(args._[args._.length - 1])); -} else if (command === 'future' && args._.length > 3) { - console.log(dogapi.now() + parseInt(args._[args._.length - 1])); -} else if (dogapi.hasOwnProperty(command)) { - if (subcommand) { - dogapi[command].handleCli(subcommand, args, function(err, res) { - if (err) { - console.error(json.stringify(err, null, ' ')); - process.exit(1); - } else { - if (res === '') { - res = 'success'; + if (dogapi.hasOwnProperty(command)) { + if (subcommand) { + dogapi[command].handleCli(subcommand, args, function(err, res) { + if (err) { + console.error(json.stringify(err, null, ' ')); + process.exit(1); } - console.log(json.stringify(res, null, ' ')); - } - }); - } else { + return console.log(json.stringify(res || 'success', null, ' ')); + }); + } + let commandUsage = ['Usage:'].concat(dogapi[command].getUsage()); - if ( - dogapi[command].hasOwnProperty('getHelp') && - typeof dogapi[command].getHelp === 'function' - ) { + if (hasKey(command, 'getHelp')) { commandUsage = commandUsage.concat([EOL], dogapi[command].getHelp()); } - console.log(commandUsage.join(EOL).replace(/\$\{command\}/g, ' dogapi')); + return console.log(commandUsage.join(EOL).replace(/\$\{command\}/g, ' dogapi')); } -} else if (args.version) { - console.log(require('../package.json').version); -} else { - console.log(usage); + if (args.version) return console.log(version); + + console.log(usage.join(EOL)); +}; + +if (!module.parent) { + const args = minimist(process.argv); + main(args); } diff --git a/src/constants.js b/src/constants.js index 701f3f7..740944c 100644 --- a/src/constants.js +++ b/src/constants.js @@ -1,13 +1,10 @@ -module.exports.STATUSES = { +const STATUSES = { OK: 0, WARNING: 1, CRITICAL: 2, UNKNOWN: 3 }; - -module.exports.ALL_STATUSES = [ - module.exports.STATUSES.OK, - module.exports.STATUSES.WARNING, - module.exports.STATUSES.CRITICAL, - module.exports.STATUSES.UNKNOWN -]; +module.exports = { + STATUSES, + ALL_STATUSES: [STATUSES.OK, STATUSES.WARNING, STATUSES.CRITICAL, STATUSES.UNKNOWN] +}; From d0774fc67d54c30c04614c6af416aa1b599b9bdf Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:34:05 +0200 Subject: [PATCH 21/24] Set node v8.10 as minimal engine :8ball: --- package.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/package.json b/package.json index f5dcab8..c7f7c3a 100644 --- a/package.json +++ b/package.json @@ -4,7 +4,7 @@ "description": "Datadog API Node.JS Client", "main": "src/index.js", "engines": { - "node": ">= 6.10.0" + "node": ">= 8.10.0" }, "author": "Brett Langdon <me@brett.is> (http://brett.is)", "contributors": [ From 9bd34bf34ce2af0f633e0b29f474e5190ad6214a Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 15:41:11 +0200 Subject: [PATCH 22/24] Directly use library json-bigint :clamp: --- bin/dogapi | 2 +- src/api/embed.js | 2 +- src/api/screenboard.js | 2 +- src/api/timeboard.js | 2 +- src/client.js | 2 +- src/json.js | 6 ------ test/json.js | 26 -------------------------- 7 files changed, 5 insertions(+), 37 deletions(-) delete mode 100644 src/json.js delete mode 100644 test/json.js diff --git a/bin/dogapi b/bin/dogapi index 6301493..966c6c0 100755 --- a/bin/dogapi +++ b/bin/dogapi @@ -1,7 +1,7 @@ #!/usr/bin/env node const dogapi = require('..'); const _ = require('lodash/fp'); -const json = require('../src/json'); +const json = require('json-bigint'); const minimist = require('minimist'); const rc = require('rc'); const {EOL} = require('os'); diff --git a/src/api/embed.js b/src/api/embed.js index 696aa76..9f0640d 100644 --- a/src/api/embed.js +++ b/src/api/embed.js @@ -1,6 +1,6 @@ const querystring = require('querystring'); const extend = require('extend'); -const json = require('../json'); // TODO inline lib +const json = require('json-bigint'); module.exports = function(client) { /* section: embed diff --git a/src/api/screenboard.js b/src/api/screenboard.js index 8c2086e..59a7858 100644 --- a/src/api/screenboard.js +++ b/src/api/screenboard.js @@ -1,5 +1,5 @@ const util = require('util'); -const json = require('../json'); +const json = require('json-bigint'); module.exports = function(client) { /* section: screenboard diff --git a/src/api/timeboard.js b/src/api/timeboard.js index cfc787e..52b5b2e 100644 --- a/src/api/timeboard.js +++ b/src/api/timeboard.js @@ -1,5 +1,5 @@ const util = require('util'); -const json = require('../json'); +const json = require('json-bigint'); module.exports = function(client) { /* section: timeboard diff --git a/src/client.js b/src/client.js index 42e4a33..db9cd00 100644 --- a/src/client.js +++ b/src/client.js @@ -3,7 +3,7 @@ const url = require('url'); const util = require('util'); const extend = require('extend'); const _ = require('lodash/fp'); -const json = require('./json'); +const json = require('json-bigint'); /* section: client *comment: | diff --git a/src/json.js b/src/json.js deleted file mode 100644 index fab1de2..0000000 --- a/src/json.js +++ /dev/null @@ -1,6 +0,0 @@ -const JSONBig = require('json-bigint'); - -module.exports = { - stringify: JSONBig.stringify, - parse: JSONBig.parse -}; diff --git a/test/json.js b/test/json.js deleted file mode 100644 index 9601cbe..0000000 --- a/test/json.js +++ /dev/null @@ -1,26 +0,0 @@ -const assert = require('assert'); -const BigNumber = require('bignumber.js'); -const json = require('../src/json'); - -describe('json', function() { - describe('#parse()', function() { - it('should properly parse big integers', function() { - // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 - const data = '{"id": 2868860079149422351}'; - const parsed = json.parse(data); - // `parsed.id` is an instance of `BigNumber` - assert.equal(parsed.id.toString(), '2868860079149422351'); - }); - }); - - describe('#stringify()', function() { - it('should properly parse big integers', function() { - // DEV: This test case is from: https://github.com/brettlangdon/node-dogapi/issues/16 - const data = {id: new BigNumber('2868860079149422351')}; - const stringified = json.stringify(data); - // Yeah, it ends up being a string and not an int, but mostly we - // want to make sure it doesn't throw an error or provide the wrong number - assert.equal(stringified, '{"id":"2868860079149422351"}'); - }); - }); -}); From 12eecf5aa234ca2907080e4e78a459fd96795614 Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 16:06:19 +0200 Subject: [PATCH 23/24] Convert tests to ava :rocket: --- .eslintrc | 2 +- package-lock.json | 4858 ++++++++++++++++++++++++++---- package.json | 4 +- test/api.embed.test.js | 66 + test/api.metric-send-all.test.js | 157 + test/api.metric-send.test.js | 182 ++ test/api/embed.js | 86 - test/api/metric.js | 355 --- 8 files changed, 4614 insertions(+), 1096 deletions(-) create mode 100644 test/api.embed.test.js create mode 100644 test/api.metric-send-all.test.js create mode 100644 test/api.metric-send.test.js delete mode 100644 test/api/embed.js delete mode 100644 test/api/metric.js diff --git a/.eslintrc b/.eslintrc index 4ca1bdb..c10dac3 100644 --- a/.eslintrc +++ b/.eslintrc @@ -6,7 +6,7 @@ }, "extends": [ "plugin:@coorpacademy/coorpacademy/core", - "plugin:@coorpacademy/coorpacademy/mocha", + "plugin:@coorpacademy/coorpacademy/ava", "plugin:@coorpacademy/coorpacademy/es20XX", "plugin:@coorpacademy/coorpacademy/lodash-fp", "plugin:@coorpacademy/coorpacademy/prettier" diff --git a/package-lock.json b/package-lock.json index 3d15f06..1b11133 100644 --- a/package-lock.json +++ b/package-lock.json @@ -1,9 +1,38 @@ { - "name": "dogapi", - "version": "2.8.3", + "name": "datadog-client", + "version": "3.0.0-alpha.0", "lockfileVersion": 1, "requires": true, "dependencies": { + "@ava/babel-plugin-throws-helper": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-plugin-throws-helper/-/babel-plugin-throws-helper-4.0.0.tgz", + "integrity": "sha512-3diBLIVBPPh3j4+hb5lo0I1D+S/O/VDJPI4Y502apBxmwEqjyXG4gTSPFUlm41sSZeZzMarT/Gzovw9kV7An0w==", + "dev": true + }, + "@ava/babel-preset-stage-4": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-stage-4/-/babel-preset-stage-4-4.0.0.tgz", + "integrity": "sha512-lZEV1ZANzfzSYBU6WHSErsy7jLPbD1iIgAboASPMcKo7woVni5/5IKWeT0RxC8rY802MFktur3OKEw2JY1Tv2w==", + "dev": true, + "requires": { + "@babel/plugin-proposal-async-generator-functions": "^7.2.0", + "@babel/plugin-proposal-dynamic-import": "^7.5.0", + "@babel/plugin-proposal-optional-catch-binding": "^7.2.0", + "@babel/plugin-transform-dotall-regex": "^7.4.4", + "@babel/plugin-transform-modules-commonjs": "^7.5.0" + } + }, + "@ava/babel-preset-transform-test-files": { + "version": "6.0.0", + "resolved": "https://registry.npmjs.org/@ava/babel-preset-transform-test-files/-/babel-preset-transform-test-files-6.0.0.tgz", + "integrity": "sha512-8eKhFzZp7Qcq1VLfoC75ggGT8nQs9q8fIxltU47yCB7Wi7Y8Qf6oqY1Bm0z04fIec24vEgr0ENhDHEOUGVDqnA==", + "dev": true, + "requires": { + "@ava/babel-plugin-throws-helper": "^4.0.0", + "babel-plugin-espower": "^3.0.1" + } + }, "@babel/code-frame": { "version": "7.0.0-beta.44", "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.0.0-beta.44.tgz", @@ -13,6 +42,163 @@ "@babel/highlight": "7.0.0-beta.44" } }, + "@babel/core": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/core/-/core-7.6.4.tgz", + "integrity": "sha512-Rm0HGw101GY8FTzpWSyRbki/jzq+/PkNQJ+nSulrdY6gFGOsNseCqD6KHRYe2E+EdzuBdr2pxCp6s4Uk6eJ+XQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.4", + "@babel/helpers": "^7.6.2", + "@babel/parser": "^7.6.4", + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.3", + "@babel/types": "^7.6.3", + "convert-source-map": "^1.1.0", + "debug": "^4.1.0", + "json5": "^2.1.0", + "lodash": "^4.17.13", + "resolve": "^1.3.2", + "semver": "^5.4.1", + "source-map": "^0.5.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", + "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, "@babel/generator": { "version": "7.0.0-beta.44", "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.0.0-beta.44.tgz", @@ -20,39 +206,716 @@ "dev": true, "requires": { "@babel/types": "7.0.0-beta.44", - "jsesc": "2.5.2", - "lodash": "4.17.10", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "jsesc": "^2.5.1", + "lodash": "^4.2.0", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" + } + }, + "@babel/helper-annotate-as-pure": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-annotate-as-pure/-/helper-annotate-as-pure-7.0.0.tgz", + "integrity": "sha512-3UYcJUj9kvSLbLbUIfQTqzcy5VX7GRZ/CCDrnOaZorFFM01aXp1+GJwuFGV4NDDoAS+mOUyHcO6UD/RfqOks3Q==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, + "@babel/helper-function-name": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", + "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "7.0.0-beta.44", + "@babel/template": "7.0.0-beta.44", + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0-beta.44", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", + "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", + "dev": true, + "requires": { + "@babel/types": "7.0.0-beta.44" + } + }, + "@babel/helper-module-imports": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-module-imports/-/helper-module-imports-7.0.0.tgz", + "integrity": "sha512-aP/hlLq01DWNEiDg4Jn23i+CXxW/owM4WpDLFUbpjxe4NS3BhLVZQ5i7E0ZrxuQ/vwekIeciyamgB1UIYxxM6A==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + }, + "dependencies": { + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, + "@babel/helper-module-transforms": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/helper-module-transforms/-/helper-module-transforms-7.5.5.tgz", + "integrity": "sha512-jBeCvETKuJqeiaCdyaheF40aXnnU1+wkSiUs/IQg3tB85up1LyL8x77ClY8qJpuRJUcXQo+ZtdNESmZl4j56Pw==", + "dev": true, + "requires": { + "@babel/helper-module-imports": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/template": "^7.4.4", + "@babel/types": "^7.5.5", + "lodash": "^4.17.13" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, + "@babel/helper-plugin-utils": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-plugin-utils/-/helper-plugin-utils-7.0.0.tgz", + "integrity": "sha512-CYAOUCARwExnEixLdB6sDm2dIJ/YgEAKDM1MOeMeZu9Ld/bDgVo8aiWrXwcY7OBh+1Ea2uUcVRcxKk0GJvW7QA==", + "dev": true + }, + "@babel/helper-regex": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/helper-regex/-/helper-regex-7.5.5.tgz", + "integrity": "sha512-CkCYQLkfkiugbRDO8eZn6lRuR8kzZoGXCg3149iTk5se7g6qykSpy3+hELSwquhu+TgHn8nkLiBwHvNX8Hofcw==", + "dev": true, + "requires": { + "lodash": "^4.17.13" + }, + "dependencies": { + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } + } + }, + "@babel/helper-remap-async-to-generator": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-remap-async-to-generator/-/helper-remap-async-to-generator-7.1.0.tgz", + "integrity": "sha512-3fOK0L+Fdlg8S5al8u/hWE6vhufGSn0bN09xm2LXMy//REAF8kDCrYoOBKYmA8m5Nom+sV9LyLCwrFynA8/slg==", + "dev": true, + "requires": { + "@babel/helper-annotate-as-pure": "^7.0.0", + "@babel/helper-wrap-function": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.0.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", + "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } + } + }, + "@babel/helper-simple-access": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-simple-access/-/helper-simple-access-7.1.0.tgz", + "integrity": "sha512-Vk+78hNjRbsiu49zAPALxTb+JUQCz1aolpd8osOF16BGnLtseD21nbHgLPGUwrXEurZgiCOUmvs3ExTu4F5x6w==", + "dev": true, + "requires": { + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } }, - "@babel/helper-function-name": { + "@babel/helper-split-export-declaration": { "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.0.0-beta.44.tgz", - "integrity": "sha512-MHRG2qZMKMFaBavX0LWpfZ2e+hLloT++N7rfM3DYOMUOGCD8cVjqZpwiL8a0bOX3IYcQev1ruciT0gdFFRTxzg==", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", + "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "7.0.0-beta.44", - "@babel/template": "7.0.0-beta.44", "@babel/types": "7.0.0-beta.44" } }, - "@babel/helper-get-function-arity": { - "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0-beta.44.tgz", - "integrity": "sha512-w0YjWVwrM2HwP6/H3sEgrSQdkCaxppqFeJtAnB23pRiJB5E/O9Yp7JAAeWBl+gGEgmBFinnTyOv2RN7rcSmMiw==", + "@babel/helper-wrap-function": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/helper-wrap-function/-/helper-wrap-function-7.2.0.tgz", + "integrity": "sha512-o9fP1BZLLSrYlxYEYyl2aS+Flun5gtjTIG8iln+XuEzQTs0PLagAGSXUcqruJwD5fM48jzIEggCKpIfWTcR7pQ==", "dev": true, "requires": { - "@babel/types": "7.0.0-beta.44" + "@babel/helper-function-name": "^7.1.0", + "@babel/template": "^7.1.0", + "@babel/traverse": "^7.1.0", + "@babel/types": "^7.2.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", + "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, - "@babel/helper-split-export-declaration": { - "version": "7.0.0-beta.44", - "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.0.0-beta.44.tgz", - "integrity": "sha512-aQ7QowtkgKKzPGf0j6u77kBMdUFVBKNHw2p/3HX/POt5/oz8ec5cs0GwlgM8Hz7ui5EwJnzyfRmkNF1Nx1N7aA==", + "@babel/helpers": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/helpers/-/helpers-7.6.2.tgz", + "integrity": "sha512-3/bAUL8zZxYs1cdX2ilEE0WobqbCmKWr/889lf2SS0PpDcpEIY8pb1CCyz0pEcX3pEb+MCbks1jIokz2xLtGTA==", "dev": true, "requires": { - "@babel/types": "7.0.0-beta.44" + "@babel/template": "^7.6.0", + "@babel/traverse": "^7.6.2", + "@babel/types": "^7.6.0" + }, + "dependencies": { + "@babel/code-frame": { + "version": "7.5.5", + "resolved": "https://registry.npmjs.org/@babel/code-frame/-/code-frame-7.5.5.tgz", + "integrity": "sha512-27d4lZoomVyo51VegxI20xZPuSHusqbQag/ztrBC7wegWoQ1nLREPVSKSW8byhTlzTKyNE4ifaTA6lCp7JjpFw==", + "dev": true, + "requires": { + "@babel/highlight": "^7.0.0" + } + }, + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/helper-function-name": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/@babel/helper-function-name/-/helper-function-name-7.1.0.tgz", + "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", + "dev": true, + "requires": { + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-get-function-arity": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/@babel/helper-get-function-arity/-/helper-get-function-arity-7.0.0.tgz", + "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", + "dev": true, + "requires": { + "@babel/types": "^7.0.0" + } + }, + "@babel/helper-split-export-declaration": { + "version": "7.4.4", + "resolved": "https://registry.npmjs.org/@babel/helper-split-export-declaration/-/helper-split-export-declaration-7.4.4.tgz", + "integrity": "sha512-Ro/XkzLf3JFITkW6b+hNxzZ1n5OQ80NvIUdmHspih1XAhtN3vPTuUFT4eQnela+2MaZ5ulH+iyP513KJrxbN7Q==", + "dev": true, + "requires": { + "@babel/types": "^7.4.4" + } + }, + "@babel/highlight": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/highlight/-/highlight-7.5.0.tgz", + "integrity": "sha512-7dV4eu9gBxoM0dAnj/BCFDW9LFU0zvTrkq0ugM7pnHEgguOEeOz1so2ZghEdzviYzQEED0r4EAgpsBChKy1TRQ==", + "dev": true, + "requires": { + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" + } + }, + "@babel/parser": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/parser/-/parser-7.6.4.tgz", + "integrity": "sha512-D8RHPW5qd0Vbyo3qb+YjO5nvUVRTXFLQ/FsDxJU2Nqz4uB5EnUN0ZQSEYpvTIbRuttig1XbHWU5oMeQwQSAA+A==", + "dev": true + }, + "@babel/template": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.6.0.tgz", + "integrity": "sha512-5AEH2EXD8euCk446b7edmgFdub/qfH1SN6Nii3+fyXP807QRx9Q73A2N5hNwRRslC2H9sNzaFhsPubkS4L8oNQ==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.6.0", + "@babel/types": "^7.6.0" + } + }, + "@babel/traverse": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/traverse/-/traverse-7.6.3.tgz", + "integrity": "sha512-unn7P4LGsijIxaAJo/wpoU11zN+2IaClkQAxcJWBNCMS6cmVh802IyLHNkAjQ0iYnRS3nnxk5O3fuXW28IMxTw==", + "dev": true, + "requires": { + "@babel/code-frame": "^7.5.5", + "@babel/generator": "^7.6.3", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.4.4", + "@babel/parser": "^7.6.3", + "@babel/types": "^7.6.3", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.13" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "js-tokens": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", + "integrity": "sha512-RdJUflcE3cUzKiMqQgsCu06FPu9UdIJO0beYbPhHN4k6apgJtifcoCtT9bcxOpYBtpD2kCM6Sbzg4CausW/PKQ==", + "dev": true + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + } } }, "@babel/highlight": { @@ -61,9 +924,9 @@ "integrity": "sha512-Il19yJvy7vMFm8AVAh6OZzaFoAd0hbkeMZiX3P5HGD+z7dyI7RzndHB0dg6Urh/VAFfHtpOIzDUSxmY6coyZWQ==", "dev": true, "requires": { - "chalk": "2.4.2", - "esutils": "2.0.2", - "js-tokens": "3.0.2" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^3.0.0" } }, "@babel/parser": { @@ -72,6 +935,87 @@ "integrity": "sha512-tXZCqWtlOOP4wgCp6RjRvLmfuhnqTLy9VHwRochJBCP2nDm27JnnuFEnXFASVyQNHk36jD1tAammsCEEqgscIQ==", "dev": true }, + "@babel/plugin-proposal-async-generator-functions": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-async-generator-functions/-/plugin-proposal-async-generator-functions-7.2.0.tgz", + "integrity": "sha512-+Dfo/SCQqrwx48ptLVGLdE39YtWRuKc/Y9I5Fy0P1DDBB9lsAHpjcEJQt+4IifuSOSTLBKJObJqMvaO1pIE8LQ==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-remap-async-to-generator": "^7.1.0", + "@babel/plugin-syntax-async-generators": "^7.2.0" + } + }, + "@babel/plugin-proposal-dynamic-import": { + "version": "7.5.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-dynamic-import/-/plugin-proposal-dynamic-import-7.5.0.tgz", + "integrity": "sha512-x/iMjggsKTFHYC6g11PL7Qy58IK8H5zqfm9e6hu4z1iH2IRyAp9u9dL80zA6R76yFovETFLKz2VJIC2iIPBuFw==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-dynamic-import": "^7.2.0" + } + }, + "@babel/plugin-proposal-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-proposal-optional-catch-binding/-/plugin-proposal-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-mgYj3jCcxug6KUcX4OBoOJz3CMrwRfQELPQ5560F70YQUBZB7uac9fqaWamKR1iWUzGiK2t0ygzjTScZnVz75g==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/plugin-syntax-optional-catch-binding": "^7.2.0" + } + }, + "@babel/plugin-syntax-async-generators": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-async-generators/-/plugin-syntax-async-generators-7.2.0.tgz", + "integrity": "sha512-1ZrIRBv2t0GSlcwVoQ6VgSLpLgiN/FVQUzt9znxo7v2Ov4jJrs8RY8tv0wvDmFN3qIdMKWrmMMW6yZ0G19MfGg==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-dynamic-import": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-dynamic-import/-/plugin-syntax-dynamic-import-7.2.0.tgz", + "integrity": "sha512-mVxuJ0YroI/h/tbFTPGZR8cv6ai+STMKNBq0f8hFxsxWjl94qqhsb+wXbpNMDPU3cfR1TIsVFzU3nXyZMqyK4w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-syntax-optional-catch-binding": { + "version": "7.2.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-syntax-optional-catch-binding/-/plugin-syntax-optional-catch-binding-7.2.0.tgz", + "integrity": "sha512-bDe4xKNhb0LI7IvZHiA13kff0KEfaGX/Hv4lMA9+7TEc63hMNvfKo6ZFpXhKuEp+II/q35Gc4NoMeDZyaUbj9w==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0" + } + }, + "@babel/plugin-transform-dotall-regex": { + "version": "7.6.2", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-dotall-regex/-/plugin-transform-dotall-regex-7.6.2.tgz", + "integrity": "sha512-KGKT9aqKV+9YMZSkowzYoYEiHqgaDhGmPNZlZxX6UeHC4z30nC1J9IrZuGqbYFB1jaIGdv91ujpze0exiVK8bA==", + "dev": true, + "requires": { + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-regex": "^7.4.4", + "regexpu-core": "^4.6.0" + } + }, + "@babel/plugin-transform-modules-commonjs": { + "version": "7.6.0", + "resolved": "https://registry.npmjs.org/@babel/plugin-transform-modules-commonjs/-/plugin-transform-modules-commonjs-7.6.0.tgz", + "integrity": "sha512-Ma93Ix95PNSEngqomy5LSBMAQvYKVe3dy+JlVJSHEXZR5ASL9lQBedMiCyVtmTLraIDVRE3ZjTZvmXXD2Ozw3g==", + "dev": true, + "requires": { + "@babel/helper-module-transforms": "^7.4.4", + "@babel/helper-plugin-utils": "^7.0.0", + "@babel/helper-simple-access": "^7.1.0", + "babel-plugin-dynamic-import-node": "^2.3.0" + } + }, "@babel/template": { "version": "7.0.0-beta.44", "resolved": "https://registry.npmjs.org/@babel/template/-/template-7.0.0-beta.44.tgz", @@ -81,7 +1025,7 @@ "@babel/code-frame": "7.0.0-beta.44", "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", - "lodash": "4.17.10" + "lodash": "^4.2.0" } }, "@babel/traverse": { @@ -96,10 +1040,10 @@ "@babel/helper-split-export-declaration": "7.0.0-beta.44", "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", - "debug": "3.1.0", - "globals": "11.11.0", - "invariant": "2.2.4", - "lodash": "4.17.10" + "debug": "^3.1.0", + "globals": "^11.1.0", + "invariant": "^2.2.0", + "lodash": "^4.2.0" } }, "@babel/types": { @@ -108,9 +1052,18 @@ "integrity": "sha512-5eTV4WRmqbaFM3v9gHAIljEQJU4Ssc6fxL61JN+Oe2ga/BwyjzjamwkCVVAQjHGuAX8i0BWo42dshL8eO5KfLQ==", "dev": true, "requires": { - "esutils": "2.0.2", - "lodash": "4.17.10", - "to-fast-properties": "2.0.0" + "esutils": "^2.0.2", + "lodash": "^4.2.0", + "to-fast-properties": "^2.0.0" + } + }, + "@concordance/react": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/@concordance/react/-/react-2.0.0.tgz", + "integrity": "sha512-huLSkUuM2/P+U0uy2WwlKuixMsTODD8p4JVQBI4VKeopkiN0C7M3N9XYVawb4M+4spN5RrO/eLhk7KoQX6nsfA==", + "dev": true, + "requires": { + "arrify": "^1.0.1" } }, "@coorpacademy/eslint-plugin-coorpacademy": { @@ -119,27 +1072,97 @@ "integrity": "sha1-9PoNOWyVSdEaAYZXHhBvF0rLF0s=", "dev": true, "requires": { - "babel-eslint": "8.2.6", - "eslint-ast-utils": "1.1.0", - "eslint-config-prettier": "2.10.0", - "eslint-plugin-ava": "4.5.1", - "eslint-plugin-css-modules": "2.11.0", - "eslint-plugin-flowtype": "2.50.3", - "eslint-plugin-flowtype-errors": "3.6.0", - "eslint-plugin-fp": "2.3.0", - "eslint-plugin-import": "2.16.0", - "eslint-plugin-json": "1.4.0", - "eslint-plugin-lodash-fp": "2.1.3", - "eslint-plugin-mocha": "4.12.1", - "eslint-plugin-prettier": "2.7.0", - "eslint-plugin-promise": "3.8.0", - "eslint-plugin-react": "7.12.4", - "eslint-plugin-unicorn": "4.0.3", - "lodash": "4.17.10", + "babel-eslint": "^8.2.2", + "eslint-ast-utils": "^1.1.0", + "eslint-config-prettier": "^2.9.0", + "eslint-plugin-ava": "^4.5.1", + "eslint-plugin-css-modules": "^2.7.5", + "eslint-plugin-flowtype": "^2.46.1", + "eslint-plugin-flowtype-errors": "^3.5.1", + "eslint-plugin-fp": "^2.3.0", + "eslint-plugin-import": "^2.9.0", + "eslint-plugin-json": "^1.2.0", + "eslint-plugin-lodash-fp": "^2.1.3", + "eslint-plugin-mocha": "^4.12.1", + "eslint-plugin-prettier": "^2.6.0", + "eslint-plugin-promise": "^3.7.0", + "eslint-plugin-react": "^7.4.0", + "eslint-plugin-unicorn": "^4.0.2", + "lodash": "^4.17.5", "prettier": "1.11.1", - "requireindex": "1.2.0" + "requireindex": "^1.2.0" + } + }, + "@nodelib/fs.scandir": { + "version": "2.1.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.scandir/-/fs.scandir-2.1.3.tgz", + "integrity": "sha512-eGmwYQn3gxo4r7jdQnkrrN6bY478C3P+a/y72IJukF8LjB6ZHeB3c+Ehacj3sYeSmUXGlnA67/PmbM9CVwL7Dw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "2.0.3", + "run-parallel": "^1.1.9" + } + }, + "@nodelib/fs.stat": { + "version": "2.0.3", + "resolved": "https://registry.npmjs.org/@nodelib/fs.stat/-/fs.stat-2.0.3.tgz", + "integrity": "sha512-bQBFruR2TAwoevBEd/NWMoAAtNGzTRgdrqnYCc7dhzfoNvqPzLyqlEQnzZ3kVnNrSp25iyxE00/3h2fqGAGArA==", + "dev": true + }, + "@nodelib/fs.walk": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/@nodelib/fs.walk/-/fs.walk-1.2.4.tgz", + "integrity": "sha512-1V9XOY4rDW0rehzbrcqAmHnz8e7SKvX27gh8Gt2WgB0+pdzdiLV83p72kZPU+jvMbS1qU5mauP2iOvO8rhmurQ==", + "dev": true, + "requires": { + "@nodelib/fs.scandir": "2.1.3", + "fastq": "^1.6.0" + } + }, + "@sindresorhus/is": { + "version": "0.14.0", + "resolved": "https://registry.npmjs.org/@sindresorhus/is/-/is-0.14.0.tgz", + "integrity": "sha512-9NET910DNaIPngYnLLPeg+Ogzqsi9uM4mSboU5y6p8S5DzMTVEsJZrawi+BoDNUVBa2DhJqQYUFvMDfgU062LQ==", + "dev": true + }, + "@szmarczak/http-timer": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/@szmarczak/http-timer/-/http-timer-1.1.2.tgz", + "integrity": "sha512-XIB2XbzHTN6ieIjfIMV9hlVcfPU26s2vafYWQcZHWXHOxiaRZYEDKEwdl129Zyg50+foYV2jCgtrqSA6qNuNSA==", + "dev": true, + "requires": { + "defer-to-connect": "^1.0.1" + } + }, + "@types/events": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/@types/events/-/events-3.0.0.tgz", + "integrity": "sha512-EaObqwIvayI5a8dCzhFrjKzVwKLxjoG9T6Ppd5CEo07LRKfQ8Yokw54r5+Wq7FaBQ+yXRvQAYPrHwya1/UFt9g==", + "dev": true + }, + "@types/glob": { + "version": "7.1.1", + "resolved": "https://registry.npmjs.org/@types/glob/-/glob-7.1.1.tgz", + "integrity": "sha512-1Bh06cbWJUHMC97acuD6UMG29nMt0Aqz1vF3guLfG+kHHJhy3AyohZFFxYk2f7Q1SQIrNwvncxAE0N/9s70F2w==", + "dev": true, + "requires": { + "@types/events": "*", + "@types/minimatch": "*", + "@types/node": "*" } }, + "@types/minimatch": { + "version": "3.0.3", + "resolved": "https://registry.npmjs.org/@types/minimatch/-/minimatch-3.0.3.tgz", + "integrity": "sha512-tHq6qdbT9U1IRSGf14CL0pUlULksvY9OZ+5eEgl1N7t+OA3tGvNpxJCzuKQlsNgCVwbAs670L1vcVQi8j9HjnA==", + "dev": true + }, + "@types/node": { + "version": "12.7.12", + "resolved": "https://registry.npmjs.org/@types/node/-/node-12.7.12.tgz", + "integrity": "sha512-KPYGmfD0/b1eXurQ59fXD1GBzhSQfz6/lKBxkaHX9dKTzjXbK68Zt7yGUxUsCS1jeTy/8aL+d9JEr+S54mpkWQ==", + "dev": true + }, "acorn": { "version": "5.7.3", "resolved": "https://registry.npmjs.org/acorn/-/acorn-5.7.3.tgz", @@ -152,7 +1175,7 @@ "integrity": "sha1-r9+UiPsezvyDSPb7IvRk4ypYs2s=", "dev": true, "requires": { - "acorn": "3.3.0" + "acorn": "^3.0.4" }, "dependencies": { "acorn": { @@ -169,7 +1192,7 @@ "integrity": "sha512-JVwXMr9nHYTUXsBFKUqhJwvlcYU/blreOEUkhNR2eXZIvwd+c+o5V4MgDPKWnMS/56awN3TRzIP+KoPn+roQtg==", "dev": true, "requires": { - "es6-promisify": "5.0.0" + "es6-promisify": "^5.0.0" } }, "ajv": { @@ -178,10 +1201,47 @@ "integrity": "sha512-nffhOpkymDECQyR0mnsUtoCE8RlX38G0rYP+wgLWFyZuUyuuojSSvi/+euOiQBIn63whYwYVIIH1TvE3tu4OEg==", "dev": true, "requires": { - "fast-deep-equal": "2.0.1", - "fast-json-stable-stringify": "2.0.0", - "json-schema-traverse": "0.4.1", - "uri-js": "4.2.2" + "fast-deep-equal": "^2.0.1", + "fast-json-stable-stringify": "^2.0.0", + "json-schema-traverse": "^0.4.1", + "uri-js": "^4.2.2" + } + }, + "ansi-align": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/ansi-align/-/ansi-align-3.0.0.tgz", + "integrity": "sha512-ZpClVKqXN3RGBmKibdfWzqCY4lnjEuoNzU5T0oEFpfd/z5qJHVarukridD4juLO2FXMiwUQxr9WqQtaYa8XRYw==", + "dev": true, + "requires": { + "string-width": "^3.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "ansi-escapes": { @@ -202,7 +1262,17 @@ "integrity": "sha512-VT0ZI6kZRdTh8YyJw3SMbYm/u+NqfsAxEpWO0Pf9sq8/e94WxxOpPKx9FR1FlyCtOVDNOQ+8ntlqFxiRc+r5qA==", "dev": true, "requires": { - "color-convert": "1.9.3" + "color-convert": "^1.9.0" + } + }, + "anymatch": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.1.tgz", + "integrity": "sha512-mM8522psRCqzV+6LhomX5wgp25YVibjh8Wj23I5RPkPppSVSjyKD2A2mBJmWGa+KN7f2D6LNh9jkBCeyLktzjg==", + "dev": true, + "requires": { + "normalize-path": "^3.0.0", + "picomatch": "^2.0.4" } }, "argparse": { @@ -211,7 +1281,7 @@ "integrity": "sha512-o5Roy6tNG4SL/FOkCAN6RzjiakZS25RLYFrcMttJqbdd8BWrnA+fGz57iN5Pb06pvBGvl5gQ0B48dJlslXvoTg==", "dev": true, "requires": { - "sprintf-js": "1.0.3" + "sprintf-js": "~1.0.2" } }, "argv": { @@ -220,20 +1290,32 @@ "integrity": "sha1-7L0W+JSbFXGDcRsb2jNPN4QBhas=", "dev": true }, + "arr-flatten": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/arr-flatten/-/arr-flatten-1.1.0.tgz", + "integrity": "sha512-L3hKV5R/p5o81R7O02IGnwpDmkp6E982XhtbuwSe3O4qOtMMMtodicASA1Cny2U+aCXcNpml+m4dPsvsJ3jatg==", + "dev": true + }, "array-differ": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/array-differ/-/array-differ-1.0.0.tgz", "integrity": "sha1-7/UuN1gknTO+QCuLuOVkuytdQDE=", "dev": true }, + "array-find-index": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/array-find-index/-/array-find-index-1.0.2.tgz", + "integrity": "sha1-3wEKoSh+Fku9pvlyOwqWoexBh6E=", + "dev": true + }, "array-includes": { "version": "3.0.3", "resolved": "https://registry.npmjs.org/array-includes/-/array-includes-3.0.3.tgz", "integrity": "sha1-GEtI9i2S10UrsxsyMWXH+L0CJm0=", "dev": true, "requires": { - "define-properties": "1.1.3", - "es-abstract": "1.13.0" + "define-properties": "^1.1.2", + "es-abstract": "^1.7.0" } }, "array-union": { @@ -242,7 +1324,7 @@ "integrity": "sha1-mjRBDk9OPaI96jdb5b5w8kd47Dk=", "dev": true, "requires": { - "array-uniq": "1.0.3" + "array-uniq": "^1.0.1" } }, "array-uniq": { @@ -263,6 +1345,332 @@ "integrity": "sha512-+Ryf6g3BKoRc7jfp7ad8tM4TtMiaWvbF/1/sQcZPkkS7ag3D5nMBCe2UfOTONtAkaG0tO0ij3C5Lwmf1EiyjHg==", "dev": true }, + "ava": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/ava/-/ava-2.4.0.tgz", + "integrity": "sha512-CQWtzZZZeU2g4StojRv6MO9RIRi4sLxGSB9+3C3hv0ttUEG1tkJLTLyrBQeFS4WEeK12Z4ovE3f2iPVhSy8elA==", + "dev": true, + "requires": { + "@ava/babel-preset-stage-4": "^4.0.0", + "@ava/babel-preset-transform-test-files": "^6.0.0", + "@babel/core": "^7.6.0", + "@babel/generator": "^7.6.0", + "@concordance/react": "^2.0.0", + "ansi-escapes": "^4.2.1", + "ansi-styles": "^4.1.0", + "arr-flatten": "^1.1.0", + "array-union": "^2.1.0", + "array-uniq": "^2.1.0", + "arrify": "^2.0.1", + "bluebird": "^3.5.5", + "chalk": "^2.4.2", + "chokidar": "^3.0.2", + "chunkd": "^1.0.0", + "ci-parallel-vars": "^1.0.0", + "clean-stack": "^2.2.0", + "clean-yaml-object": "^0.1.0", + "cli-cursor": "^3.1.0", + "cli-truncate": "^2.0.0", + "code-excerpt": "^2.1.1", + "common-path-prefix": "^1.0.0", + "concordance": "^4.0.0", + "convert-source-map": "^1.6.0", + "currently-unhandled": "^0.4.1", + "debug": "^4.1.1", + "del": "^4.1.1", + "dot-prop": "^5.1.0", + "emittery": "^0.4.1", + "empower-core": "^1.2.0", + "equal-length": "^1.0.0", + "escape-string-regexp": "^2.0.0", + "esm": "^3.2.25", + "figures": "^3.0.0", + "find-up": "^4.1.0", + "get-port": "^5.0.0", + "globby": "^10.0.1", + "ignore-by-default": "^1.0.0", + "import-local": "^3.0.2", + "indent-string": "^4.0.0", + "is-ci": "^2.0.0", + "is-error": "^2.2.2", + "is-observable": "^2.0.0", + "is-plain-object": "^3.0.0", + "is-promise": "^2.1.0", + "lodash": "^4.17.15", + "loud-rejection": "^2.1.0", + "make-dir": "^3.0.0", + "matcher": "^2.0.0", + "md5-hex": "^3.0.1", + "meow": "^5.0.0", + "micromatch": "^4.0.2", + "ms": "^2.1.2", + "observable-to-promise": "^1.0.0", + "ora": "^3.4.0", + "package-hash": "^4.0.0", + "pkg-conf": "^3.1.0", + "plur": "^3.1.1", + "pretty-ms": "^5.0.0", + "require-precompiled": "^0.1.0", + "resolve-cwd": "^3.0.0", + "slash": "^3.0.0", + "source-map-support": "^0.5.13", + "stack-utils": "^1.0.2", + "strip-ansi": "^5.2.0", + "strip-bom-buf": "^2.0.0", + "supertap": "^1.0.0", + "supports-color": "^7.0.0", + "trim-off-newlines": "^1.0.1", + "trim-right": "^1.0.1", + "unique-temp-dir": "^1.0.0", + "update-notifier": "^3.0.1", + "write-file-atomic": "^3.0.0" + }, + "dependencies": { + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "ansi-escapes": { + "version": "4.2.1", + "resolved": "https://registry.npmjs.org/ansi-escapes/-/ansi-escapes-4.2.1.tgz", + "integrity": "sha512-Cg3ymMAdN10wOk/VYfLV7KCQyv7EDirJ64500sU7n9UlmioEtDuU5Gd+hj73hXSU/ex7tHJSssmyftDdkMLO8Q==", + "dev": true, + "requires": { + "type-fest": "^0.5.2" + } + }, + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "ansi-styles": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.1.0.tgz", + "integrity": "sha512-Qts4KCLKG+waHc9C4m07weIY8qyeixoS0h6RnbsNVD6Fw+pEZGW3vTyObL3WXpE09Mq4Oi7/lBEyLmOiLtlYWQ==", + "dev": true, + "requires": { + "color-convert": "^2.0.1" + } + }, + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "array-uniq": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-uniq/-/array-uniq-2.1.0.tgz", + "integrity": "sha512-bdHxtev7FN6+MXI1YFW0Q8mQ8dTJc2S8AMfju+ZR77pbg2yAdVyDlwkaUI7Har0LyOMRFPHrJ9lYdyjZZswdlQ==", + "dev": true + }, + "arrify": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/arrify/-/arrify-2.0.1.tgz", + "integrity": "sha512-3duEwti880xqi4eAMN8AyR4a0ByT90zoYdLlevfrvU43vb0YZwZVfxOgxWrLXXXpyugL0hNZc9G6BiB5B3nUug==", + "dev": true + }, + "cli-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-3.1.0.tgz", + "integrity": "sha512-I/zHAwsKf9FqGoXM4WWRACob9+SNukZTd94DWF57E4toouRulbCxcUh6RKUEOQlYTHJnzkPMySvPNaaSLNfLZw==", + "dev": true, + "requires": { + "restore-cursor": "^3.1.0" + } + }, + "color-convert": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", + "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", + "dev": true, + "requires": { + "color-name": "~1.1.4" + } + }, + "color-name": { + "version": "1.1.4", + "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", + "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==", + "dev": true + }, + "debug": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/debug/-/debug-4.1.1.tgz", + "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", + "dev": true, + "requires": { + "ms": "^2.1.1" + } + }, + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + }, + "figures": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/figures/-/figures-3.0.0.tgz", + "integrity": "sha512-HKri+WoWoUgr83pehn/SIgLOMZ9nAWC6dcGj26RY2R4F50u4+RTUz0RCrUlOV3nKRAICW1UGzyb+kcX2qK1S/g==", + "dev": true, + "requires": { + "escape-string-regexp": "^1.0.5" + }, + "dependencies": { + "escape-string-regexp": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-1.0.5.tgz", + "integrity": "sha1-G2HAViGQqN/2rjuyzwIAyhMLhtQ=", + "dev": true + } + } + }, + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "has-flag": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", + "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", + "dev": true + }, + "is-error": { + "version": "2.2.2", + "resolved": "https://registry.npmjs.org/is-error/-/is-error-2.2.2.tgz", + "integrity": "sha512-IOQqts/aHWbiisY5DuPJQ0gcbvaLFCa7fBa9xoLfxBZvQ+ZI/Zh9xoI7Gk+G64N0FdK4AbibytHht2tWgpJWLg==", + "dev": true + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + }, + "mimic-fn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-2.1.0.tgz", + "integrity": "sha512-OqbOk5oEQeAZ8WXWydlu9HJjz9WVdEIvamMCcXmuqUYjTknH/sqsWvhQ3vgwKFRR1HpjvNBKQ37nbJgYzGqGcg==", + "dev": true + }, + "ms": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.2.tgz", + "integrity": "sha512-sGkPx+VjMtmA6MX27oA4FBFELFCZZ4S4XqeGOXCv68tT+jb3vk/RyaKWP0PTKyWtmLSM0b+adUTEvbs1PEaH2w==", + "dev": true + }, + "onetime": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/onetime/-/onetime-5.1.0.tgz", + "integrity": "sha512-5NcSkPHhwTVFIQN+TUqXoS5+dlElHXdpAWu9I0HP20YOtIi+aZ0Ct82jdlILDxjLEAWwvm+qj1m6aEtsDVmm6Q==", + "dev": true, + "requires": { + "mimic-fn": "^2.1.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "restore-cursor": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-3.1.0.tgz", + "integrity": "sha512-l+sSefzHpj5qimhFSE5a8nufZYAM3sBSVMAPtYkmC+4EH2anSGaEMXSD0izRQbu9nfyQ9y5JrVmp7E8oZrUjvA==", + "dev": true, + "requires": { + "onetime": "^5.1.0", + "signal-exit": "^3.0.2" + } + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "supports-color": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.1.0.tgz", + "integrity": "sha512-oRSIpR8pxT1Wr2FquTNnGet79b3BWljqOuoW/h4oBhxJ/HUbX5nX6JSruTkvXDCFMwDPvsaTTbvMLKZWSy0R5g==", + "dev": true, + "requires": { + "has-flag": "^4.0.0" + } + } + } + }, "babel-eslint": { "version": "8.2.6", "resolved": "https://registry.npmjs.org/babel-eslint/-/babel-eslint-8.2.6.tgz", @@ -274,7 +1682,62 @@ "@babel/types": "7.0.0-beta.44", "babylon": "7.0.0-beta.44", "eslint-scope": "3.7.1", - "eslint-visitor-keys": "1.0.0" + "eslint-visitor-keys": "^1.0.0" + } + }, + "babel-plugin-dynamic-import-node": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/babel-plugin-dynamic-import-node/-/babel-plugin-dynamic-import-node-2.3.0.tgz", + "integrity": "sha512-o6qFkpeQEBxcqt0XYlWzAVxNCSCZdUgcR8IRlhD/8DylxjjO4foPcvTW0GGKa/cVt3rvxZ7o5ippJ+/0nvLhlQ==", + "dev": true, + "requires": { + "object.assign": "^4.1.0" + } + }, + "babel-plugin-espower": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/babel-plugin-espower/-/babel-plugin-espower-3.0.1.tgz", + "integrity": "sha512-Ms49U7VIAtQ/TtcqRbD6UBmJBUCSxiC3+zPc+eGqxKUIFO1lTshyEDRUjhoAbd2rWfwYf3cZ62oXozrd8W6J0A==", + "dev": true, + "requires": { + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "call-matcher": "^1.0.0", + "core-js": "^2.0.0", + "espower-location-detector": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.1.1" + }, + "dependencies": { + "@babel/generator": { + "version": "7.6.4", + "resolved": "https://registry.npmjs.org/@babel/generator/-/generator-7.6.4.tgz", + "integrity": "sha512-jsBuXkFoZxk0yWLyGI9llT9oiQ2FeTASmRFE32U+aaDTfoE92t78eroO7PTpU/OrYq38hlcDM6vbfLDaOLy+7w==", + "dev": true, + "requires": { + "@babel/types": "^7.6.3", + "jsesc": "^2.5.1", + "lodash": "^4.17.13", + "source-map": "^0.5.0" + } + }, + "@babel/types": { + "version": "7.6.3", + "resolved": "https://registry.npmjs.org/@babel/types/-/types-7.6.3.tgz", + "integrity": "sha512-CqbcpTxMcpuQTMhjI37ZHVgjBkysg5icREQIEZ0eG1yCNwg3oy+5AaLiOKmjsCj6nqOsa6Hf0ObjRVwokb7srA==", + "dev": true, + "requires": { + "esutils": "^2.0.2", + "lodash": "^4.17.13", + "to-fast-properties": "^2.0.0" + } + }, + "lodash": { + "version": "4.17.15", + "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.15.tgz", + "integrity": "sha512-8xOcRHvCjnocdS5cpwXQXVzmmh5e5+saE2QGoeQmbKmRS6J3VQppPOIt0MnmE+4xlZoumy0GPG0D0MVIQbNA1A==", + "dev": true + } } }, "babel-runtime": { @@ -283,8 +1746,8 @@ "integrity": "sha1-llxwWGaOgrVde/4E/yM3vItWR/4=", "dev": true, "requires": { - "core-js": "2.6.5", - "regenerator-runtime": "0.11.1" + "core-js": "^2.4.0", + "regenerator-runtime": "^0.11.0" } }, "babylon": { @@ -305,26 +1768,159 @@ "integrity": "sha1-husHB89qURCQnSPm6nQ0wU9QDxw=", "dev": true }, + "binary-extensions": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.0.0.tgz", + "integrity": "sha512-Phlt0plgpIIBOGTT/ehfFnbNlfsDEiqmzE2KRXoX1bLIlir4X/MR+zSyBEkL05ffWgnRSf/DXv+WrUAVr93/ow==", + "dev": true + }, + "bluebird": { + "version": "3.7.0", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.0.tgz", + "integrity": "sha512-aBQ1FxIa7kSWCcmKHlcHFlT2jt6J/l4FzC7KcPELkOJOsPOb/bccdhmIrKDfXhwFrmc7vDoDrrepFvGqjyXGJg==", + "dev": true + }, + "blueimp-md5": { + "version": "2.12.0", + "resolved": "https://registry.npmjs.org/blueimp-md5/-/blueimp-md5-2.12.0.tgz", + "integrity": "sha512-zo+HIdIhzojv6F1siQPqPFROyVy7C50KzHv/k/Iz+BtvtVzSHXiMXOpq2wCfNkeBqdCv+V8XOV96tsEt2W/3rQ==", + "dev": true + }, + "boxen": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/boxen/-/boxen-3.2.0.tgz", + "integrity": "sha512-cU4J/+NodM3IHdSL2yN8bqYqnmlBTidDR4RC7nJs61ZmtGz8VZzM3HLQX0zY5mrSmPtR3xWwsq2jOUQqFZN8+A==", + "dev": true, + "requires": { + "ansi-align": "^3.0.0", + "camelcase": "^5.3.1", + "chalk": "^2.4.2", + "cli-boxes": "^2.2.0", + "string-width": "^3.0.0", + "term-size": "^1.2.0", + "type-fest": "^0.3.0", + "widest-line": "^2.0.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "camelcase": { + "version": "5.3.1", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-5.3.1.tgz", + "integrity": "sha512-L28STB170nwWS63UjtlEOE3dldQApaJXZkOI1uMFfzf3rRuPegHaHesyee+YxQ+W6SvRDQV6UrdOdRiR153wJg==", + "dev": true + }, + "string-width": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-3.1.0.tgz", + "integrity": "sha512-vafcv6KjVZKSgz06oM/H6GDBrAtz8vdhQakGjFIvNrHA6y3HCF1CInLy+QLq8dTJPQ1b+KDUqDFctkdRW44e1w==", + "dev": true, + "requires": { + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.1.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + } + } + }, "brace-expansion": { "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", "dev": true, "requires": { - "balanced-match": "1.0.0", - "concat-map": "0.0.1" + "balanced-match": "^1.0.0", + "concat-map": "0.0.1" + } + }, + "braces": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.2.tgz", + "integrity": "sha512-b8um+L1RzM3WDSzvhm6gIz1yfTbBt6YTlcEKAvsmqCZZFw46z626lVj9j1yEPW33H5H+lBQpZMP1k8l+78Ha0A==", + "dev": true, + "requires": { + "fill-range": "^7.0.1" + } + }, + "buf-compare": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", + "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", + "dev": true + }, + "buffer-from": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/buffer-from/-/buffer-from-1.1.1.tgz", + "integrity": "sha512-MQcXEUbCKtEo7bhqEs6560Hyd4XaovZlO/k9V3hjVUF/zwW7KBVdSK4gIt/bzwS9MbR5qob+F5jusZsb0YQK2A==", + "dev": true + }, + "cacheable-request": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/cacheable-request/-/cacheable-request-6.1.0.tgz", + "integrity": "sha512-Oj3cAGPCqOZX7Rz64Uny2GYAZNliQSqfbePrgAQ1wKAihYmCUnraBtJtKcGR4xz7wF+LoJC+ssFZvv5BgF9Igg==", + "dev": true, + "requires": { + "clone-response": "^1.0.2", + "get-stream": "^5.1.0", + "http-cache-semantics": "^4.0.0", + "keyv": "^3.0.0", + "lowercase-keys": "^2.0.0", + "normalize-url": "^4.1.0", + "responselike": "^1.0.2" + }, + "dependencies": { + "get-stream": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-5.1.0.tgz", + "integrity": "sha512-EXr1FOzrzTfGeL0gQdeFEvOMm2mzMOglyiOXSTpPC+iAjAKftbr3jpCMWynogwYnM+eSj9sHGc6wjIcDvYiygw==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + }, + "lowercase-keys": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-2.0.0.tgz", + "integrity": "sha512-tqNXrS78oMOE73NMxK4EMLQsQowWf8jKooH9g7xPavRT706R6bkQJ6DY2Te7QukaZsulxa30wQ7bk0pm4XiHmA==", + "dev": true + } + } + }, + "call-matcher": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/call-matcher/-/call-matcher-1.1.0.tgz", + "integrity": "sha512-IoQLeNwwf9KTNbtSA7aEBb1yfDbdnzwjCetjkC8io5oGeOmK2CBNdg0xr+tadRYKO0p7uQyZzvon0kXlZbvGrw==", + "dev": true, + "requires": { + "core-js": "^2.0.0", + "deep-equal": "^1.0.0", + "espurify": "^1.6.0", + "estraverse": "^4.0.0" } }, - "browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==", - "dev": true - }, - "buf-compare": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/buf-compare/-/buf-compare-1.0.1.tgz", - "integrity": "sha1-/vKNqLgROgoNtEMLC2Rntpcws0o=", + "call-signature": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/call-signature/-/call-signature-0.0.2.tgz", + "integrity": "sha1-qEq8glpV70yysCi9dOIFpluaSZY=", "dev": true }, "callsites": { @@ -333,15 +1929,32 @@ "integrity": "sha512-tWnkwu9YEq2uzlBDI4RcLn8jrFvF9AOi8PxDNU3hZZjJcjkcRAq3vCI+vZcg1SuxISDYe86k9VZFwAxDiJGoAw==", "dev": true }, + "camelcase": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-4.1.0.tgz", + "integrity": "sha1-1UVjW+HjPFQmScaRc+Xeas+uNN0=", + "dev": true + }, + "camelcase-keys": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/camelcase-keys/-/camelcase-keys-4.2.0.tgz", + "integrity": "sha1-oqpfsa9oh1glnDLBQUJteJI7m3c=", + "dev": true, + "requires": { + "camelcase": "^4.1.0", + "map-obj": "^2.0.0", + "quick-lru": "^1.0.0" + } + }, "chalk": { "version": "2.4.2", "resolved": "https://registry.npmjs.org/chalk/-/chalk-2.4.2.tgz", "integrity": "sha512-Mti+f9lpJNcwF4tWV8/OrTTtF1gZi+f8FqlyAdouralcFWFQWF2+NgCHShjkCb+IFBLq9buZwE1xckQU4peSuQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "escape-string-regexp": "1.0.5", - "supports-color": "5.4.0" + "ansi-styles": "^3.2.1", + "escape-string-regexp": "^1.0.5", + "supports-color": "^5.3.0" } }, "chardet": { @@ -350,22 +1963,130 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "chokidar": { + "version": "3.2.1", + "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.2.1.tgz", + "integrity": "sha512-/j5PPkb5Feyps9e+jo07jUZGvkB5Aj953NrI4s8xSVScrAo/RHeILrtdb4uzR7N6aaFFxxJ+gt8mA8HfNpw76w==", + "dev": true, + "requires": { + "anymatch": "~3.1.1", + "braces": "~3.0.2", + "fsevents": "~2.1.0", + "glob-parent": "~5.1.0", + "is-binary-path": "~2.1.0", + "is-glob": "~4.0.1", + "normalize-path": "~3.0.0", + "readdirp": "~3.1.3" + } + }, + "chunkd": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/chunkd/-/chunkd-1.0.0.tgz", + "integrity": "sha512-xx3Pb5VF9QaqCotolyZ1ywFBgyuJmu6+9dLiqBxgelEse9Xsr3yUlpoX3O4Oh11M00GT2kYMsRByTKIMJW2Lkg==", + "dev": true + }, + "ci-info": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/ci-info/-/ci-info-2.0.0.tgz", + "integrity": "sha512-5tK7EtrZ0N+OLFMthtqOj4fI2Jeb88C4CAZPu25LDVUgXJ0A3Js4PMGqrn0JU1W0Mh1/Z8wZzYPxqUrXeBboCQ==", + "dev": true + }, + "ci-parallel-vars": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/ci-parallel-vars/-/ci-parallel-vars-1.0.0.tgz", + "integrity": "sha512-u6dx20FBXm+apMi+5x7UVm6EH7BL1gc4XrcnQewjcB7HWRcor/V5qWc3RG2HwpgDJ26gIi2DSEu3B7sXynAw/g==", + "dev": true + }, "clean-regexp": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/clean-regexp/-/clean-regexp-1.0.0.tgz", "integrity": "sha1-jffHquUf02h06PjQW5GAvBGj/tc=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, + "clean-stack": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/clean-stack/-/clean-stack-2.2.0.tgz", + "integrity": "sha512-4diC9HaTE+KRAMWhDhrGOECgWZxoevMc5TlkObMqNSsVU62PYzXZ/SMTjzyGAFF1YusgxGcSWTEXBhp0CPwQ1A==", + "dev": true + }, + "clean-yaml-object": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/clean-yaml-object/-/clean-yaml-object-0.1.0.tgz", + "integrity": "sha1-Y/sRDcLOGoTcIfbZM0h20BCui2g=", + "dev": true + }, + "cli-boxes": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-boxes/-/cli-boxes-2.2.0.tgz", + "integrity": "sha512-gpaBrMAizVEANOpfZp/EEUixTXDyGt7DFzdK5hU+UbWt/J0lB0w20ncZj59Z9a93xHb9u12zF5BS6i9RKbtg4w==", + "dev": true + }, "cli-cursor": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/cli-cursor/-/cli-cursor-2.1.0.tgz", "integrity": "sha1-s12sN2R5+sw+lHR9QdDQ9SOP/LU=", "dev": true, "requires": { - "restore-cursor": "2.0.0" + "restore-cursor": "^2.0.0" + } + }, + "cli-spinners": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/cli-spinners/-/cli-spinners-2.2.0.tgz", + "integrity": "sha512-tgU3fKwzYjiLEQgPMD9Jt+JjHVL9kW93FiIMX/l7rivvOD4/LL0Mf7gda3+4U2KJBloybwgj5KEoQgGRioMiKQ==", + "dev": true + }, + "cli-truncate": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/cli-truncate/-/cli-truncate-2.0.0.tgz", + "integrity": "sha512-C4hp+8GCIFVsUUiXcw+ce+7wexVWImw8rQrgMBFsqerx9LvvcGlwm6sMjQYAEmV/Xb87xc1b5Ttx505MSpZVqg==", + "dev": true, + "requires": { + "slice-ansi": "^2.1.0", + "string-width": "^4.1.0" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "emoji-regex": { + "version": "8.0.0", + "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", + "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==", + "dev": true + }, + "is-fullwidth-code-point": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", + "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", + "dev": true + }, + "string-width": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.1.0.tgz", + "integrity": "sha512-NrX+1dVVh+6Y9dnQ19pR0pP4FiEIlUvdTGn8pw6CKTNq5sgib2nIhmUNT5TAmhWmvKr3WcxBcP3E8nWezuipuQ==", + "dev": true, + "requires": { + "emoji-regex": "^8.0.0", + "is-fullwidth-code-point": "^3.0.0", + "strip-ansi": "^5.2.0" + } + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "cli-width": { @@ -374,17 +2095,41 @@ "integrity": "sha1-/xnt6Kml5XkyQUewwR8PvLq+1jk=", "dev": true }, + "clone": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/clone/-/clone-1.0.4.tgz", + "integrity": "sha1-2jCcwmPfFZlMaIypAheco8fNfH4=", + "dev": true + }, + "clone-response": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/clone-response/-/clone-response-1.0.2.tgz", + "integrity": "sha1-0dyXOSAxTfZ/vrlCI7TuNQI56Ws=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "code-excerpt": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/code-excerpt/-/code-excerpt-2.1.1.tgz", + "integrity": "sha512-tJLhH3EpFm/1x7heIW0hemXJTUU5EWl2V0EIX558jp05Mt1U6DVryCgkp3l37cxqs+DNbNgxG43SkwJXpQ14Jw==", + "dev": true, + "requires": { + "convert-to-spaces": "^1.0.1" + } + }, "codecov": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/codecov/-/codecov-3.2.0.tgz", "integrity": "sha512-3NJvNARXxilqnqVfgzDHyVrF4oeVgaYW1c1O6Oi5mn93exE7HTSSFNiYdwojWW6IwrCZABJ8crpNbKoo9aUHQw==", "dev": true, "requires": { - "argv": "0.0.2", - "ignore-walk": "3.0.1", - "js-yaml": "3.12.2", - "teeny-request": "3.11.3", - "urlgrey": "0.4.4" + "argv": "^0.0.2", + "ignore-walk": "^3.0.1", + "js-yaml": "^3.12.0", + "teeny-request": "^3.7.0", + "urlgrey": "^0.4.4" }, "dependencies": { "js-yaml": { @@ -393,8 +2138,8 @@ "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } } } @@ -414,10 +2159,10 @@ "integrity": "sha1-p9BVi9icQveV3UIyj3QIMcpTvCU=", "dev": true }, - "commander": { - "version": "2.15.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-2.15.1.tgz", - "integrity": "sha512-VlfT9F3V0v+jr4yxPc5gg9s62/fIVWsd2Bk2iD435um1NlGMYdVCq+MjcXnhYq2icNOizHr1kK+5TI6H0Hy0ag==", + "common-path-prefix": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/common-path-prefix/-/common-path-prefix-1.0.0.tgz", + "integrity": "sha1-zVL28HEuC6q5fW+XModPIvR3UsA=", "dev": true }, "concat-map": { @@ -426,20 +2171,122 @@ "integrity": "sha1-2Klr13/Wjfd5OnMDajug1UBdR3s=", "dev": true }, + "concordance": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/concordance/-/concordance-4.0.0.tgz", + "integrity": "sha512-l0RFuB8RLfCS0Pt2Id39/oCPykE01pyxgAFypWTlaGRgvLkZrtczZ8atEHpTeEIW+zYWXTBuA9cCSeEOScxReQ==", + "dev": true, + "requires": { + "date-time": "^2.1.0", + "esutils": "^2.0.2", + "fast-diff": "^1.1.2", + "js-string-escape": "^1.0.1", + "lodash.clonedeep": "^4.5.0", + "lodash.flattendeep": "^4.4.0", + "lodash.islength": "^4.0.1", + "lodash.merge": "^4.6.1", + "md5-hex": "^2.0.0", + "semver": "^5.5.1", + "well-known-symbols": "^2.0.0" + }, + "dependencies": { + "md5-hex": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-2.0.0.tgz", + "integrity": "sha1-0FiOnxx0lUSS7NJKwKxs6ZfZLjM=", + "dev": true, + "requires": { + "md5-o-matic": "^0.1.1" + } + } + } + }, + "configstore": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/configstore/-/configstore-4.0.0.tgz", + "integrity": "sha512-CmquAXFBocrzaSM8mtGPMM/HiWmyIpr4CcJl/rgY2uCObZ/S7cKU0silxslqJejl+t/T9HS8E0PUNQD81JGUEQ==", + "dev": true, + "requires": { + "dot-prop": "^4.1.0", + "graceful-fs": "^4.1.2", + "make-dir": "^1.0.0", + "unique-string": "^1.0.0", + "write-file-atomic": "^2.0.0", + "xdg-basedir": "^3.0.0" + }, + "dependencies": { + "dot-prop": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-4.2.0.tgz", + "integrity": "sha512-tUMXrxlExSW6U2EXiiKGSBVdYgtV8qlHL+C10TsW4PURY/ic+eaysnSkwB4kA/mBlCyy/IKDJ+Lc3wbWeaXtuQ==", + "dev": true, + "requires": { + "is-obj": "^1.0.0" + } + }, + "is-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-1.0.1.tgz", + "integrity": "sha1-PkcprB9f3gJc19g6iW2rn09n2w8=", + "dev": true + }, + "make-dir": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-1.3.0.tgz", + "integrity": "sha512-2w31R7SJtieJJnQtGc7RVL2StM2vGYVfqUOvUDxH6bC6aJTxPxTF0GnIgCyu7tjockiUWAYQRbxa7vKn34s5sQ==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "write-file-atomic": { + "version": "2.4.3", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-2.4.3.tgz", + "integrity": "sha512-GaETH5wwsX+GcnzhPgKcKjJ6M2Cq3/iZp1WyY/X1CSqrW+jVNM9Y7D8EC2sM4ZG/V8wZlSniJnCKWPmBYAucRQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" + } + } + } + }, "contains-path": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/contains-path/-/contains-path-0.1.0.tgz", "integrity": "sha1-/ozxhP9mcLa67wGp1IYaXL7EEgo=", "dev": true }, + "convert-source-map": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/convert-source-map/-/convert-source-map-1.6.0.tgz", + "integrity": "sha512-eFu7XigvxdZ1ETfbgPBohgyQ/Z++C0eEhTor0qRwBw9unw+L0/6V8wkSuGgzdThkiS5lSpdptOQPD8Ak40a+7A==", + "dev": true, + "requires": { + "safe-buffer": "~5.1.1" + } + }, + "convert-to-spaces": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/convert-to-spaces/-/convert-to-spaces-1.0.2.tgz", + "integrity": "sha1-fj5Iu+bZl7FBfdyihoIEtNPYVxU=", + "dev": true + }, "core-assert": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/core-assert/-/core-assert-0.2.1.tgz", "integrity": "sha1-+F4s+b/tKPdzzIs/pcW2m9wC/j8=", "dev": true, "requires": { - "buf-compare": "1.0.1", - "is-error": "2.2.1" + "buf-compare": "^1.0.0", + "is-error": "^2.2.0" } }, "core-js": { @@ -454,7 +2301,7 @@ "integrity": "sha1-2VQ3LYbVeS/NZ+nyt5GxqxYkEbs=", "dev": true, "requires": { - "lodash.get": "4.4.2" + "lodash.get": "^4.3.0" } }, "cross-spawn": { @@ -463,11 +2310,35 @@ "integrity": "sha512-eTVLrBSt7fjbDygz805pMnstIs2VTBNkRm0qxZd+M7A5XDdxVRWO5MxGBXZhjY4cqLYLdtrGqRf8mBPmzwSpWQ==", "dev": true, "requires": { - "nice-try": "1.0.5", - "path-key": "2.0.1", - "semver": "5.6.0", - "shebang-command": "1.2.0", - "which": "1.3.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "crypto-random-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/crypto-random-string/-/crypto-random-string-1.0.0.tgz", + "integrity": "sha1-ojD2T1aDEOFJgAmUB5DsmVRbyn4=", + "dev": true + }, + "currently-unhandled": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/currently-unhandled/-/currently-unhandled-0.4.1.tgz", + "integrity": "sha1-mI3zP+qxke95mmE2nddsF635V+o=", + "dev": true, + "requires": { + "array-find-index": "^1.0.1" + } + }, + "date-time": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/date-time/-/date-time-2.1.0.tgz", + "integrity": "sha512-/9+C44X7lot0IeiyfgJmETtRMhBidBYM2QFFIkGa0U1k+hSyY87Nw7PY3eDqpvCBm7I3WCSfPeZskW/YYq6m4g==", + "dev": true, + "requires": { + "time-zone": "^1.0.0" } }, "debug": { @@ -479,6 +2350,61 @@ "ms": "2.0.0" } }, + "decamelize": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-1.2.0.tgz", + "integrity": "sha1-9lNNFRSCabIDUue+4m9QH5oZEpA=", + "dev": true + }, + "decamelize-keys": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/decamelize-keys/-/decamelize-keys-1.1.0.tgz", + "integrity": "sha1-0XGoeTMlKAfrPLYdwcFEXQeN8tk=", + "dev": true, + "requires": { + "decamelize": "^1.1.0", + "map-obj": "^1.0.0" + }, + "dependencies": { + "map-obj": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-1.0.1.tgz", + "integrity": "sha1-2TPOuSBdgr3PSIb2dCvcK03qFG0=", + "dev": true + } + } + }, + "decompress-response": { + "version": "3.3.0", + "resolved": "https://registry.npmjs.org/decompress-response/-/decompress-response-3.3.0.tgz", + "integrity": "sha1-gKTdMjdIOEv6JICDYirt7Jgq3/M=", + "dev": true, + "requires": { + "mimic-response": "^1.0.0" + } + }, + "deep-equal": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/deep-equal/-/deep-equal-1.1.0.tgz", + "integrity": "sha512-ZbfWJq/wN1Z273o7mUSjILYqehAktR2NVoSrOukDkU9kg2v/Uv89yU4Cvz8seJeAmtN5oqiefKq8FPuXOboqLw==", + "dev": true, + "requires": { + "is-arguments": "^1.0.4", + "is-date-object": "^1.0.1", + "is-regex": "^1.0.4", + "object-is": "^1.0.1", + "object-keys": "^1.1.1", + "regexp.prototype.flags": "^1.2.0" + }, + "dependencies": { + "object-keys": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.1.tgz", + "integrity": "sha512-NuAESUOUMrlIXOfHKzD6bpPu3tYt3xvjNdRIQ+FeT0lNb4K8WR70CaDxhuNguS2XG+GjkyMwOzsN5ZktImfhLA==", + "dev": true + } + } + }, "deep-extend": { "version": "0.6.0", "resolved": "https://registry.npmjs.org/deep-extend/-/deep-extend-0.6.0.tgz", @@ -496,23 +2422,107 @@ "integrity": "sha1-SgeBR6irV/ag1PVUckPNIvROtOQ=", "dev": true, "requires": { - "core-assert": "0.2.1" + "core-assert": "^0.2.0" + } + }, + "defaults": { + "version": "1.0.3", + "resolved": "https://registry.npmjs.org/defaults/-/defaults-1.0.3.tgz", + "integrity": "sha1-xlYFHpgX2f8I7YgUd/P+QBnz730=", + "dev": true, + "requires": { + "clone": "^1.0.2" } }, + "defer-to-connect": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/defer-to-connect/-/defer-to-connect-1.0.2.tgz", + "integrity": "sha512-k09hcQcTDY+cwgiwa6PYKLm3jlagNzQ+RSvhjzESOGOx+MNOuXkxTfEvPrO1IOQ81tArCFYQgi631clB70RpQw==", + "dev": true + }, "define-properties": { "version": "1.1.3", "resolved": "https://registry.npmjs.org/define-properties/-/define-properties-1.1.3.tgz", "integrity": "sha512-3MqfYKj2lLzdMSf8ZIZE/V+Zuy+BgD6f164e8K2w7dgnpKArBDerGYpM46IYYcjnkdPNMjPk9A6VFB8+3SKlXQ==", "dev": true, "requires": { - "object-keys": "1.1.0" + "object-keys": "^1.0.12" } }, - "diff": { - "version": "3.5.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-3.5.0.tgz", - "integrity": "sha512-A46qtFgd+g7pDZinpnwiRJtxbC1hpgf0uzP3iG89scHk0AUC7A1TGxf5OiiOUv/JMZR8GOt8hL900hV0bOy5xA==", - "dev": true + "del": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/del/-/del-4.1.1.tgz", + "integrity": "sha512-QwGuEUouP2kVwQenAsOof5Fv8K9t3D8Ca8NxcXKrIpEHjTXK5J2nXLdP+ALI1cgv8wj7KuwBhTwBkOZSJKM5XQ==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "globby": "^6.1.0", + "is-path-cwd": "^2.0.0", + "is-path-in-cwd": "^2.0.0", + "p-map": "^2.0.0", + "pify": "^4.0.1", + "rimraf": "^2.6.3" + }, + "dependencies": { + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "globby": { + "version": "6.1.0", + "resolved": "https://registry.npmjs.org/globby/-/globby-6.1.0.tgz", + "integrity": "sha1-9abXDoOV4hyFj7BInWTfAkJNUGw=", + "dev": true, + "requires": { + "array-union": "^1.0.1", + "glob": "^7.0.3", + "object-assign": "^4.0.1", + "pify": "^2.0.0", + "pinkie-promise": "^2.0.0" + }, + "dependencies": { + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + } + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + } + } + }, + "dir-glob": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/dir-glob/-/dir-glob-3.0.1.tgz", + "integrity": "sha512-WkrWp9GR4KXfKGYzOLmTuGVi1UWFfws377n9cc55/tb6DuqyF6pcQ5AbiHEshaDpY9v6oaSr2XCDidGmMwdzIA==", + "dev": true, + "requires": { + "path-type": "^4.0.0" + }, + "dependencies": { + "path-type": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-4.0.0.tgz", + "integrity": "sha512-gDKb8aZMDeD/tZWs9P6+q0J9Mwkdl6xMV8TjnGP3qJVJ06bdMgkbBlLU8IdfOsIsFz2BW1rNVT3XuNEl8zPAvw==", + "dev": true + } + } }, "docast": { "version": "0.1.1", @@ -520,8 +2530,8 @@ "integrity": "sha1-+vMVSf8ME5RIbd8BLKqxeI1zcIU=", "dev": true, "requires": { - "docopt": "0.4.1", - "esprima": "1.2.5" + "docopt": "^0.4.1", + "esprima": "^1.2.3" }, "dependencies": { "docopt": { @@ -544,32 +2554,78 @@ "integrity": "sha1-N53Ocw9hZvds76TmcHoVmwLFpvo=", "dev": true, "requires": { - "esutils": "2.0.2", - "isarray": "1.0.0" + "esutils": "^2.0.2", + "isarray": "^1.0.0" + } + }, + "dot-prop": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/dot-prop/-/dot-prop-5.1.0.tgz", + "integrity": "sha512-n1oC6NBF+KM9oVXtjmen4Yo7HyAVWV2UUl50dCYJdw2924K6dX9bf9TTTWaKtYlRn0FEtxG27KS80ayVLixxJA==", + "dev": true, + "requires": { + "is-obj": "^2.0.0" } }, + "duplexer3": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/duplexer3/-/duplexer3-0.1.4.tgz", + "integrity": "sha1-7gHdHKwO08vH/b6jfcCo8c4ALOI=", + "dev": true + }, + "emittery": { + "version": "0.4.1", + "resolved": "https://registry.npmjs.org/emittery/-/emittery-0.4.1.tgz", + "integrity": "sha512-r4eRSeStEGf6M5SKdrQhhLK5bOwOBxQhIE3YSTnZE3GpKiLfnnhE+tPtrJE79+eDJgm39BM6LSoI8SCx4HbwlQ==", + "dev": true + }, "emoji-regex": { "version": "7.0.3", "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-7.0.3.tgz", "integrity": "sha512-CwBLREIQ7LvYFB0WyRvwhq5N5qPhc6PMjD6bYggFlI5YyDgl+0vxq5VHbMOFqLg7hfWzmu8T5Z1QofhmTIhItA==", "dev": true }, + "empower-core": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/empower-core/-/empower-core-1.2.0.tgz", + "integrity": "sha512-g6+K6Geyc1o6FdXs9HwrXleCFan7d66G5xSCfSF7x1mJDCes6t0om9lFQG3zOrzh3Bkb/45N0cZ5Gqsf7YrzGQ==", + "dev": true, + "requires": { + "call-signature": "0.0.2", + "core-js": "^2.0.0" + } + }, + "end-of-stream": { + "version": "1.4.4", + "resolved": "https://registry.npmjs.org/end-of-stream/-/end-of-stream-1.4.4.tgz", + "integrity": "sha512-+uw1inIHVPQoaVuHzRyXd21icM+cnt4CzD5rW+NC1wjOUSTOs+Te7FOv7AhN7vS9x/oIyhLP5PR1H+phQAHu5Q==", + "dev": true, + "requires": { + "once": "^1.4.0" + } + }, "enhance-visitors": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/enhance-visitors/-/enhance-visitors-1.0.0.tgz", "integrity": "sha1-qpRdBdpGVnKh69OP7i7T2oUY6Vo=", "dev": true, "requires": { - "lodash": "4.17.10" + "lodash": "^4.13.1" } }, + "equal-length": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/equal-length/-/equal-length-1.0.1.tgz", + "integrity": "sha1-IcoRLUirJLTh5//A5TOdMf38J0w=", + "dev": true + }, "error-ex": { "version": "1.3.2", "resolved": "https://registry.npmjs.org/error-ex/-/error-ex-1.3.2.tgz", "integrity": "sha512-7dFHNmqeFSEt2ZBsCriorKnn3Z2pj+fd9kmI6QoWw4//DL+icEBfc0U7qJCisqrTsKTjw4fNFy2pW9OqStD84g==", "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es-abstract": { @@ -578,12 +2634,12 @@ "integrity": "sha512-vDZfg/ykNxQVwup/8E1BZhVzFfBxs9NqMzGcvIJrqg5k2/5Za2bWo40dK2J1pgLngZ7c+Shh8lwYtLGyrwPutg==", "dev": true, "requires": { - "es-to-primitive": "1.2.0", - "function-bind": "1.1.1", - "has": "1.0.3", - "is-callable": "1.1.4", - "is-regex": "1.0.4", - "object-keys": "1.1.0" + "es-to-primitive": "^1.2.0", + "function-bind": "^1.1.1", + "has": "^1.0.3", + "is-callable": "^1.1.4", + "is-regex": "^1.0.4", + "object-keys": "^1.0.12" } }, "es-to-primitive": { @@ -592,11 +2648,17 @@ "integrity": "sha512-qZryBOJjV//LaxLTV6UC//WewneB3LcXOL9NP++ozKVXsIIIpm/2c13UDiD9Jp2eThsecw9m3jPqDwTyobcdbg==", "dev": true, "requires": { - "is-callable": "1.1.4", - "is-date-object": "1.0.1", - "is-symbol": "1.0.2" + "is-callable": "^1.1.4", + "is-date-object": "^1.0.1", + "is-symbol": "^1.0.2" } }, + "es6-error": { + "version": "4.1.1", + "resolved": "https://registry.npmjs.org/es6-error/-/es6-error-4.1.1.tgz", + "integrity": "sha512-Um/+FxMr9CISWh0bi5Zv0iOD+4cFh5qLeks1qhAopKVAJw3drgKbKySikp7wGhDL0HPeaja0P5ULZrxLkniUVg==", + "dev": true + }, "es6-promise": { "version": "4.2.6", "resolved": "https://registry.npmjs.org/es6-promise/-/es6-promise-4.2.6.tgz", @@ -609,7 +2671,7 @@ "integrity": "sha1-UQnWLz5W6pZ8S2NQWu8IKRyKUgM=", "dev": true, "requires": { - "es6-promise": "4.2.6" + "es6-promise": "^4.0.3" } }, "escape-string-regexp": { @@ -624,42 +2686,42 @@ "integrity": "sha512-NTcm6vQ+PTgN3UBsALw5BMhgO6i5EpIjQF/Xb5tIh3sk9QhrFafujUOczGz4J24JBlzWclSB9Vmx8d+9Z6bFCg==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0", - "ajv": "6.10.0", - "chalk": "2.4.2", - "cross-spawn": "6.0.5", - "debug": "4.1.1", - "doctrine": "3.0.0", - "eslint-scope": "4.0.2", - "eslint-utils": "1.3.1", - "eslint-visitor-keys": "1.0.0", - "espree": "5.0.1", - "esquery": "1.0.1", - "esutils": "2.0.2", - "file-entry-cache": "5.0.1", - "functional-red-black-tree": "1.0.1", - "glob": "7.1.3", - "globals": "11.11.0", - "ignore": "4.0.6", - "import-fresh": "3.0.0", - "imurmurhash": "0.1.4", - "inquirer": "6.2.2", - "js-yaml": "3.12.2", - "json-stable-stringify-without-jsonify": "1.0.1", - "levn": "0.3.0", - "lodash": "4.17.11", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "natural-compare": "1.4.0", - "optionator": "0.8.2", - "path-is-inside": "1.0.2", - "progress": "2.0.3", - "regexpp": "2.0.1", - "semver": "5.6.0", - "strip-ansi": "4.0.0", - "strip-json-comments": "2.0.1", - "table": "5.2.3", - "text-table": "0.2.0" + "@babel/code-frame": "^7.0.0", + "ajv": "^6.9.1", + "chalk": "^2.1.0", + "cross-spawn": "^6.0.5", + "debug": "^4.0.1", + "doctrine": "^3.0.0", + "eslint-scope": "^4.0.2", + "eslint-utils": "^1.3.1", + "eslint-visitor-keys": "^1.0.0", + "espree": "^5.0.1", + "esquery": "^1.0.1", + "esutils": "^2.0.2", + "file-entry-cache": "^5.0.1", + "functional-red-black-tree": "^1.0.1", + "glob": "^7.1.2", + "globals": "^11.7.0", + "ignore": "^4.0.6", + "import-fresh": "^3.0.0", + "imurmurhash": "^0.1.4", + "inquirer": "^6.2.2", + "js-yaml": "^3.12.0", + "json-stable-stringify-without-jsonify": "^1.0.1", + "levn": "^0.3.0", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "mkdirp": "^0.5.1", + "natural-compare": "^1.4.0", + "optionator": "^0.8.2", + "path-is-inside": "^1.0.2", + "progress": "^2.0.0", + "regexpp": "^2.0.1", + "semver": "^5.5.1", + "strip-ansi": "^4.0.0", + "strip-json-comments": "^2.0.1", + "table": "^5.2.3", + "text-table": "^0.2.0" }, "dependencies": { "@babel/code-frame": { @@ -668,7 +2730,7 @@ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0" + "@babel/highlight": "^7.0.0" } }, "@babel/highlight": { @@ -677,9 +2739,9 @@ "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { - "chalk": "2.4.2", - "esutils": "2.0.2", - "js-tokens": "4.0.0" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" } }, "acorn": { @@ -700,7 +2762,7 @@ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "doctrine": { @@ -709,7 +2771,7 @@ "integrity": "sha512-yS+Q5i3hBf7GBkd4KG8a7eBNNWNGLTaEwwYWUijIYM7zrlYDM0BFXHjjPWlWZ1Rg7UaddZeIDmi9jF3HmqiQ2w==", "dev": true, "requires": { - "esutils": "2.0.2" + "esutils": "^2.0.2" } }, "eslint-scope": { @@ -718,8 +2780,8 @@ "integrity": "sha512-5q1+B/ogmHl8+paxtOKx38Z8LtWkVGuNt3+GQNErqwLl6ViNp/gdJGMCjZNxZ8j/VYjDNZ2Fo+eQc1TAVPIzbg==", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "espree": { @@ -728,9 +2790,9 @@ "integrity": "sha512-qWAZcWh4XE/RwzLJejfcofscgMc9CamR6Tn1+XRXNzrvUSSbiAjGOI/fggztjIi7y9VLPqnICMIPiGyr8JaZ0A==", "dev": true, "requires": { - "acorn": "6.1.1", - "acorn-jsx": "5.0.1", - "eslint-visitor-keys": "1.0.0" + "acorn": "^6.0.7", + "acorn-jsx": "^5.0.0", + "eslint-visitor-keys": "^1.0.0" } }, "glob": { @@ -739,12 +2801,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "js-tokens": { @@ -759,8 +2821,8 @@ "integrity": "sha512-QHn/Lh/7HhZ/Twc7vJYQTkjuCa0kaCcDcjK5Zlk2rvnUpy7DxMJ23+Jc2dcyvltwQVg1nygAVlB2oRDFHoRS5Q==", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "4.0.1" + "argparse": "^1.0.7", + "esprima": "^4.0.0" } }, "lodash": { @@ -783,8 +2845,8 @@ "integrity": "sha512-otzzTim2/1+lVrlH19EfQQJEhVJSu0zOb9ygb3iapN6UlyaDtyRq4b5U1FuW0v1lRa9Fp/GJyHkSwm6NqABgCA==", "dev": true, "requires": { - "lodash.get": "4.4.2", - "lodash.zip": "4.2.0" + "lodash.get": "^4.4.2", + "lodash.zip": "^4.2.0" } }, "eslint-config-prettier": { @@ -793,7 +2855,7 @@ "integrity": "sha512-Mhl90VLucfBuhmcWBgbUNtgBiK955iCDK1+aHAz7QfDQF6wuzWZ6JjihZ3ejJoGlJWIuko7xLqNm8BA5uenKhA==", "dev": true, "requires": { - "get-stdin": "5.0.1" + "get-stdin": "^5.0.1" } }, "eslint-import-resolver-node": { @@ -802,8 +2864,8 @@ "integrity": "sha512-sfmTqJfPSizWu4aymbPr4Iidp5yKm8yDkHp+Ir3YiTHiiDfxh69mOUsmiqW6RZ9zRXFaF64GtYmN7e+8GHBv6Q==", "dev": true, "requires": { - "debug": "2.6.9", - "resolve": "1.10.0" + "debug": "^2.6.9", + "resolve": "^1.5.0" }, "dependencies": { "debug": { @@ -823,8 +2885,8 @@ "integrity": "sha512-lmDJgeOOjk8hObTysjqH7wyMi+nsHwwvfBykwfhjR1LNdd7C2uFJBvx4OpWYpXOw4df1yE1cDEVd1yLHitk34w==", "dev": true, "requires": { - "debug": "2.6.9", - "pkg-dir": "2.0.0" + "debug": "^2.6.8", + "pkg-dir": "^2.0.0" }, "dependencies": { "debug": { @@ -844,14 +2906,14 @@ "integrity": "sha512-V0+QZkTYoEXAp8fojaoD85orqNgGfyHWpwQEUqVIRGCRsX9BFnKbG2eX875NgciF3Aouq7smOZcLYqQKgAyH7w==", "dev": true, "requires": { - "arrify": "1.0.1", - "deep-strict-equal": "0.2.0", - "enhance-visitors": "1.0.0", - "espree": "3.5.4", - "espurify": "1.8.1", - "import-modules": "1.1.0", - "multimatch": "2.1.0", - "pkg-up": "2.0.0" + "arrify": "^1.0.1", + "deep-strict-equal": "^0.2.0", + "enhance-visitors": "^1.0.0", + "espree": "^3.1.3", + "espurify": "^1.5.0", + "import-modules": "^1.1.0", + "multimatch": "^2.1.0", + "pkg-up": "^2.0.0" } }, "eslint-plugin-css-modules": { @@ -860,8 +2922,8 @@ "integrity": "sha512-CLvQvJOMlCywZzaI4HVu7QH/ltgNXvCg7giJGiE+sA9wh5zQ+AqTgftAzrERV22wHe1p688wrU/Zwxt1Ry922w==", "dev": true, "requires": { - "gonzales-pe": "4.2.3", - "lodash": "4.17.10" + "gonzales-pe": "^4.0.3", + "lodash": "^4.17.2" } }, "eslint-plugin-flowtype": { @@ -870,7 +2932,7 @@ "integrity": "sha512-X+AoKVOr7Re0ko/yEXyM5SSZ0tazc6ffdIOocp2fFUlWoDt7DV0Bz99mngOkAFLOAWjqRA5jPwqUCbrx13XoxQ==", "dev": true, "requires": { - "lodash": "4.17.10" + "lodash": "^4.17.10" } }, "eslint-plugin-flowtype-errors": { @@ -879,8 +2941,8 @@ "integrity": "sha1-V4KZQmHpJa7RMgYwFGY26I5K1VM=", "dev": true, "requires": { - "babel-runtime": "6.26.0", - "slash": "2.0.0" + "babel-runtime": "^6.26.0", + "slash": "^2.0.0" } }, "eslint-plugin-fp": { @@ -889,10 +2951,10 @@ "integrity": "sha1-N20qEIcQ6YGYC9w4deO5kg2gSJw=", "dev": true, "requires": { - "create-eslint-index": "1.0.0", - "eslint-ast-utils": "1.1.0", - "lodash": "4.17.10", - "req-all": "0.1.0" + "create-eslint-index": "^1.0.0", + "eslint-ast-utils": "^1.0.0", + "lodash": "^4.13.1", + "req-all": "^0.1.0" } }, "eslint-plugin-import": { @@ -901,16 +2963,16 @@ "integrity": "sha512-z6oqWlf1x5GkHIFgrSvtmudnqM6Q60KM4KvpWi5ubonMjycLjndvd5+8VAZIsTlHC03djdgJuyKG6XO577px6A==", "dev": true, "requires": { - "contains-path": "0.1.0", - "debug": "2.6.9", + "contains-path": "^0.1.0", + "debug": "^2.6.9", "doctrine": "1.5.0", - "eslint-import-resolver-node": "0.3.2", - "eslint-module-utils": "2.3.0", - "has": "1.0.3", - "lodash": "4.17.11", - "minimatch": "3.0.4", - "read-pkg-up": "2.0.0", - "resolve": "1.10.0" + "eslint-import-resolver-node": "^0.3.2", + "eslint-module-utils": "^2.3.0", + "has": "^1.0.3", + "lodash": "^4.17.11", + "minimatch": "^3.0.4", + "read-pkg-up": "^2.0.0", + "resolve": "^1.9.0" }, "dependencies": { "debug": { @@ -936,7 +2998,7 @@ "integrity": "sha512-CECvgRAWtUzuepdlPWd+VA7fhyF9HT183pZnl8wQw5x699Mk/MbME/q8xtULBfooi3LUbj6fToieNmsvUcDxWA==", "dev": true, "requires": { - "vscode-json-languageservice": "3.2.1" + "vscode-json-languageservice": "^3.2.1" } }, "eslint-plugin-lodash-fp": { @@ -945,11 +3007,11 @@ "integrity": "sha1-7B1ngqu4NEFTNLl6ILFFcwoNCng=", "dev": true, "requires": { - "create-eslint-index": "1.0.0", - "enhance-visitors": "1.0.0", - "eslint-ast-utils": "1.1.0", - "lodash": "4.17.10", - "req-all": "0.1.0" + "create-eslint-index": "^1.0.0", + "enhance-visitors": "^1.0.0", + "eslint-ast-utils": "^1.0.0", + "lodash": "^4.11.1", + "req-all": "^0.1.0" } }, "eslint-plugin-mocha": { @@ -958,7 +3020,7 @@ "integrity": "sha512-hxWtYHvLA0p/PKymRfDYh9Mxt5dYkg2Goy1vZDarTEEYfELP9ksga7kKG1NUKSQy27C8Qjc7YrSWTLUhOEOksA==", "dev": true, "requires": { - "ramda": "0.25.0" + "ramda": "^0.25.0" } }, "eslint-plugin-prettier": { @@ -967,8 +3029,8 @@ "integrity": "sha512-CStQYJgALoQBw3FsBzH0VOVDRnJ/ZimUlpLm226U8qgqYJfPOY/CPK6wyRInMxh73HSKg5wyRwdS4BVYYHwokA==", "dev": true, "requires": { - "fast-diff": "1.2.0", - "jest-docblock": "21.2.0" + "fast-diff": "^1.1.1", + "jest-docblock": "^21.0.0" } }, "eslint-plugin-promise": { @@ -983,13 +3045,13 @@ "integrity": "sha512-1puHJkXJY+oS1t467MjbqjvX53uQ05HXwjqDgdbGBqf5j9eeydI54G3KwiJmWciQ0HTBacIKw2jgwSBSH3yfgQ==", "dev": true, "requires": { - "array-includes": "3.0.3", - "doctrine": "2.1.0", - "has": "1.0.3", - "jsx-ast-utils": "2.0.1", - "object.fromentries": "2.0.0", - "prop-types": "15.7.2", - "resolve": "1.10.0" + "array-includes": "^3.0.3", + "doctrine": "^2.1.0", + "has": "^1.0.3", + "jsx-ast-utils": "^2.0.1", + "object.fromentries": "^2.0.0", + "prop-types": "^15.6.2", + "resolve": "^1.9.0" }, "dependencies": { "doctrine": { @@ -998,7 +3060,7 @@ "integrity": "sha512-35mSku4ZXK0vfCuHEDAwt55dg2jNajHZ1odvF+8SSr82EsZY4QmXfuWso8oEd8zRhVObSN18aM0CjSdoBX7zIw==", "dev": true, "requires": { - "esutils": "2.0.2" + "esutils": "^2.0.2" } } } @@ -1009,14 +3071,14 @@ "integrity": "sha512-F1JMyd42hx4qGhIaVdOSbDyhcxPgTy4BOzctTCkV+hqebPBUOAQn1f5AhMK2LTyiqCmKiTs8huAErbLBSWKoCQ==", "dev": true, "requires": { - "clean-regexp": "1.0.0", - "eslint-ast-utils": "1.1.0", - "import-modules": "1.1.0", - "lodash.camelcase": "4.3.0", - "lodash.kebabcase": "4.1.1", - "lodash.snakecase": "4.1.1", - "lodash.upperfirst": "4.3.1", - "safe-regex": "1.1.0" + "clean-regexp": "^1.0.0", + "eslint-ast-utils": "^1.0.0", + "import-modules": "^1.1.0", + "lodash.camelcase": "^4.1.1", + "lodash.kebabcase": "^4.0.1", + "lodash.snakecase": "^4.0.1", + "lodash.upperfirst": "^4.2.0", + "safe-regex": "^1.1.0" } }, "eslint-scope": { @@ -1025,8 +3087,8 @@ "integrity": "sha1-PWPD7f2gLgbgGkUq2IyqzHzctug=", "dev": true, "requires": { - "esrecurse": "4.2.1", - "estraverse": "4.2.0" + "esrecurse": "^4.1.0", + "estraverse": "^4.1.1" } }, "eslint-utils": { @@ -1041,14 +3103,32 @@ "integrity": "sha512-qzm/XxIbxm/FHyH341ZrbnMUpe+5Bocte9xkmFMzPMjRaZMcXww+MpBptFvtU+79L362nqiLhekCxCxDPaUMBQ==", "dev": true }, + "esm": { + "version": "3.2.25", + "resolved": "https://registry.npmjs.org/esm/-/esm-3.2.25.tgz", + "integrity": "sha512-U1suiZ2oDVWv4zPO56S0NcR5QriEahGtdN2OR6FiOG4WJvcjBVFB0qI4+eKoWFH483PKGuLuu6V8Z4T5g63UVA==", + "dev": true + }, + "espower-location-detector": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/espower-location-detector/-/espower-location-detector-1.0.0.tgz", + "integrity": "sha1-oXt+zFnTDheeK+9z+0E3cEyzMbU=", + "dev": true, + "requires": { + "is-url": "^1.2.1", + "path-is-absolute": "^1.0.0", + "source-map": "^0.5.0", + "xtend": "^4.0.0" + } + }, "espree": { "version": "3.5.4", "resolved": "https://registry.npmjs.org/espree/-/espree-3.5.4.tgz", "integrity": "sha512-yAcIQxtmMiB/jL32dzEp2enBeidsB7xWPLNiw3IIkpVds1P+h7qF9YwJq1yUNzp2OKXgAprs4F61ih66UsoD1A==", "dev": true, "requires": { - "acorn": "5.7.3", - "acorn-jsx": "3.0.1" + "acorn": "^5.5.0", + "acorn-jsx": "^3.0.0" } }, "esprima": { @@ -1063,7 +3143,7 @@ "integrity": "sha512-ZDko6eY/o+D/gHCWyHTU85mKDgYcS4FJj7S+YD6WIInm7GQ6AnOjmcL4+buFV/JOztVLELi/7MmuGU5NHta0Mg==", "dev": true, "requires": { - "core-js": "2.6.5" + "core-js": "^2.0.0" } }, "esquery": { @@ -1072,7 +3152,7 @@ "integrity": "sha512-SmiyZ5zIWH9VM+SRUReLS5Q8a7GxtRdxEBVZpm98rJM7Sb+A9DVCndXfkeFUd3byderg+EbDkfnevfCwynWaNA==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.0.0" } }, "esrecurse": { @@ -1081,7 +3161,7 @@ "integrity": "sha512-64RBB++fIOAXPw3P9cy89qfMlvZEXZkqqJkjqqXIvzP5ezRZjW+lPWjw35UX/3EhUPFYbg5ER4JYgDw4007/DQ==", "dev": true, "requires": { - "estraverse": "4.2.0" + "estraverse": "^4.1.0" } }, "estraverse": { @@ -1096,6 +3176,40 @@ "integrity": "sha1-Cr9PHKpbyx96nYrMbepPqqBLrJs=", "dev": true }, + "execa": { + "version": "0.7.0", + "resolved": "https://registry.npmjs.org/execa/-/execa-0.7.0.tgz", + "integrity": "sha1-lEvs00zEHuMqY6n68nrVpl/Fl3c=", + "dev": true, + "requires": { + "cross-spawn": "^5.0.1", + "get-stream": "^3.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" + }, + "dependencies": { + "cross-spawn": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-5.1.0.tgz", + "integrity": "sha1-6L0O/uWPz/b4+UUQoKVUu/ojVEk=", + "dev": true, + "requires": { + "lru-cache": "^4.0.1", + "shebang-command": "^1.2.0", + "which": "^1.2.9" + } + }, + "is-stream": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-stream/-/is-stream-1.1.0.tgz", + "integrity": "sha1-EtSj3U5o4Lec6428hBc66A2RykQ=", + "dev": true + } + } + }, "extend": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/extend/-/extend-3.0.0.tgz", @@ -1107,9 +3221,9 @@ "integrity": "sha512-bn71H9+qWoOQKyZDo25mOMVpSmXROAsTJVVVYzrrtol3d4y+AsKjf4Iwl2Q+IuT0kFSQ1qo166UuIwqYq7mGnA==", "dev": true, "requires": { - "chardet": "0.7.0", - "iconv-lite": "0.4.24", - "tmp": "0.0.33" + "chardet": "^0.7.0", + "iconv-lite": "^0.4.24", + "tmp": "^0.0.33" } }, "fast-deep-equal": { @@ -1124,6 +3238,19 @@ "integrity": "sha512-xJuoT5+L99XlZ8twedaRf6Ax2TgQVxvgZOYoPKqZufmJib0tL2tegPBOZb1pVNgIhlqDlA0eO0c3wBvQcmzx4w==", "dev": true }, + "fast-glob": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/fast-glob/-/fast-glob-3.1.0.tgz", + "integrity": "sha512-TrUz3THiq2Vy3bjfQUB2wNyPdGBeGmdjbzzBLhfHN4YFurYptCKwGq/TfiRavbGywFRzY6U2CdmQ1zmsY5yYaw==", + "dev": true, + "requires": { + "@nodelib/fs.stat": "^2.0.2", + "@nodelib/fs.walk": "^1.2.3", + "glob-parent": "^5.1.0", + "merge2": "^1.3.0", + "micromatch": "^4.0.2" + } + }, "fast-json-stable-stringify": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/fast-json-stable-stringify/-/fast-json-stable-stringify-2.0.0.tgz", @@ -1136,13 +3263,22 @@ "integrity": "sha1-PYpcZog6FqMMqGQ+hR8Zuqd5eRc=", "dev": true }, + "fastq": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.6.0.tgz", + "integrity": "sha512-jmxqQ3Z/nXoeyDmWAzF9kH1aGZSis6e/SbfPmJpUnyZ0ogr6iscHQaml4wsEepEWSdtmpy+eVXmCRIMpxaXqOA==", + "dev": true, + "requires": { + "reusify": "^1.0.0" + } + }, "figures": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/figures/-/figures-2.0.0.tgz", "integrity": "sha1-OrGi0qYsi/tDGgyUy3l6L84nyWI=", "dev": true, "requires": { - "escape-string-regexp": "1.0.5" + "escape-string-regexp": "^1.0.5" } }, "file-entry-cache": { @@ -1151,7 +3287,16 @@ "integrity": "sha512-bCg29ictuBaKUwwArK4ouCaqDgLZcysCFLmM/Yn/FDoqndh/9vNuQfXRDvTuXKLxfD/JtZQGKFT8MGcJBK644g==", "dev": true, "requires": { - "flat-cache": "2.0.1" + "flat-cache": "^2.0.1" + } + }, + "fill-range": { + "version": "7.0.1", + "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", + "integrity": "sha512-qOo9F+dMUmC2Lcb4BbVvnKJxTPjCm+RRpe4gDuGrzkL7mEVl/djYSu2OdQ2Pa302N4oqkSg9ir6jaLWJ2USVpQ==", + "dev": true, + "requires": { + "to-regex-range": "^5.0.1" } }, "find-up": { @@ -1160,7 +3305,7 @@ "integrity": "sha1-RdG35QbHF93UgndaK3eSCjwMV6c=", "dev": true, "requires": { - "locate-path": "2.0.0" + "locate-path": "^2.0.0" } }, "flat-cache": { @@ -1169,7 +3314,7 @@ "integrity": "sha512-LoQe6yDuUMDzQAEH8sgmh4Md6oZnc/7PjtwjNFSzveXqSHt6ka9fPBuso7IGf9Rz4uqnSnWiFH2B/zj24a5ReA==", "dev": true, "requires": { - "flatted": "2.0.0", + "flatted": "^2.0.0", "rimraf": "2.6.3", "write": "1.0.3" } @@ -1186,6 +3331,13 @@ "integrity": "sha1-FQStJSMVjKpA20onh8sBQRmU6k8=", "dev": true }, + "fsevents": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.1.0.tgz", + "integrity": "sha512-+iXhW3LuDQsno8dOIrCIT/CBjeBWuP7PXe8w9shnj9Lebny/Gx1ZjVBYwexLz36Ri2jKuXMNpV6CYNh8lHHgrQ==", + "dev": true, + "optional": true + }, "function-bind": { "version": "1.1.1", "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.1.tgz", @@ -1198,23 +3350,46 @@ "integrity": "sha1-GwqzvVU7Kg1jmdKcDj6gslIHgyc=", "dev": true }, + "get-port": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/get-port/-/get-port-5.0.0.tgz", + "integrity": "sha512-imzMU0FjsZqNa6BqOjbbW6w5BivHIuQKopjpPqcnx0AVHJQKCxK1O+Ab3OrVXhrekqfVMjwA9ZYu062R+KcIsQ==", + "dev": true, + "requires": { + "type-fest": "^0.3.0" + }, + "dependencies": { + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + } + } + }, "get-stdin": { "version": "5.0.1", "resolved": "https://registry.npmjs.org/get-stdin/-/get-stdin-5.0.1.tgz", "integrity": "sha1-Ei4WFZHiH/TFJTAwVpPyDmOTo5g=", "dev": true }, + "get-stream": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-3.0.0.tgz", + "integrity": "sha1-jpQ9E1jcN1VQVOy+LtsFqhdO3hQ=", + "dev": true + }, "glob": { "version": "6.0.4", "resolved": "https://registry.npmjs.org/glob/-/glob-6.0.4.tgz", "integrity": "sha1-DwiGD2oVUSey+t1PnOJLGqtuTSI=", "dev": true, "requires": { - "inflight": "1.0.4", - "inherits": "2.0.1", - "minimatch": "3.0.4", - "once": "1.3.3", - "path-is-absolute": "1.0.0" + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "2 || 3", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" }, "dependencies": { "inflight": { @@ -1223,8 +3398,8 @@ "integrity": "sha1-bLtFIevVHODsCpNr/XZX736bFyo=", "dev": true, "requires": { - "once": "1.3.3", - "wrappy": "1.0.1" + "once": "^1.3.0", + "wrappy": "1" }, "dependencies": { "wrappy": { @@ -1247,7 +3422,7 @@ "integrity": "sha1-suJhVXzkwxTsgwTz+oJmPkKXyiA=", "dev": true, "requires": { - "wrappy": "1.0.1" + "wrappy": "1" }, "dependencies": { "wrappy": { @@ -1266,19 +3441,117 @@ } } }, + "glob-parent": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.0.tgz", + "integrity": "sha512-qjtRgnIVmOfnKUE3NJAQEdk+lKrxfw8t5ke7SXtfMTHcjsBfOfWXCQfdb30zfDoZQ2IRSIiidmjtbHZPZ++Ihw==", + "dev": true, + "requires": { + "is-glob": "^4.0.1" + } + }, + "global-dirs": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/global-dirs/-/global-dirs-0.1.1.tgz", + "integrity": "sha1-sxnA3UYH81PzvpzKTHL8FIxJ9EU=", + "dev": true, + "requires": { + "ini": "^1.3.4" + } + }, "globals": { "version": "11.11.0", "resolved": "https://registry.npmjs.org/globals/-/globals-11.11.0.tgz", "integrity": "sha512-WHq43gS+6ufNOEqlrDBxVEbb8ntfXrfAUU2ZOpCxrBdGKW3gyv8mCxAfIBD0DroPKGrJ2eSsXsLtY9MPntsyTw==", "dev": true }, + "globby": { + "version": "10.0.1", + "resolved": "https://registry.npmjs.org/globby/-/globby-10.0.1.tgz", + "integrity": "sha512-sSs4inE1FB2YQiymcmTv6NWENryABjUNPeWhOvmn4SjtKybglsyPZxFB3U1/+L1bYi0rNZDqCLlHyLYDl1Pq5A==", + "dev": true, + "requires": { + "@types/glob": "^7.1.1", + "array-union": "^2.1.0", + "dir-glob": "^3.0.1", + "fast-glob": "^3.0.3", + "glob": "^7.1.3", + "ignore": "^5.1.1", + "merge2": "^1.2.3", + "slash": "^3.0.0" + }, + "dependencies": { + "array-union": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/array-union/-/array-union-2.1.0.tgz", + "integrity": "sha512-HGyxoOTYUyCM6stUe6EJgnd4EoewAI7zMdfqO+kGjnlZmBDz/cR5pf8r/cR4Wq60sL/p0IkcjUEEPwS3GFrIyw==", + "dev": true + }, + "glob": { + "version": "7.1.4", + "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.4.tgz", + "integrity": "sha512-hkLPepehmnKk41pUGm3sYxoFs/umurYfYJCerbXEyFIWcAzvpipAgVkBqqT9RBKMGjnq6kMuyYwha6csxbiM1A==", + "dev": true, + "requires": { + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" + } + }, + "ignore": { + "version": "5.1.4", + "resolved": "https://registry.npmjs.org/ignore/-/ignore-5.1.4.tgz", + "integrity": "sha512-MzbUSahkTW1u7JpKKjY7LCARd1fU5W2rLdxlM4kdkayuCwZImjkpluF9CM1aLewYJguPDqewLam18Y6AU69A8A==", + "dev": true + }, + "slash": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/slash/-/slash-3.0.0.tgz", + "integrity": "sha512-g9Q1haeby36OSStwb4ntCGGGaKsaVSjQ68fBxoQcutl5fS1vuY18H3wSt3jFyFtrkx+Kz0V1G85A4MyAdDMi2Q==", + "dev": true + } + } + }, "gonzales-pe": { "version": "4.2.3", "resolved": "https://registry.npmjs.org/gonzales-pe/-/gonzales-pe-4.2.3.tgz", "integrity": "sha512-Kjhohco0esHQnOiqqdJeNz/5fyPkOMD/d6XVjwTAoPGUFh0mCollPUTUTa2OZy4dYNAqlPIQdTiNzJTWdd9Htw==", "dev": true, "requires": { - "minimist": "1.1.3" + "minimist": "1.1.x" + } + }, + "got": { + "version": "9.6.0", + "resolved": "https://registry.npmjs.org/got/-/got-9.6.0.tgz", + "integrity": "sha512-R7eWptXuGYxwijs0eV+v3o6+XH1IqVK8dJOEecQfTmkncw9AV4dcw/Dhxi8MdlqPthxxpZyizMzyg8RTmEsG+Q==", + "dev": true, + "requires": { + "@sindresorhus/is": "^0.14.0", + "@szmarczak/http-timer": "^1.1.2", + "cacheable-request": "^6.0.0", + "decompress-response": "^3.3.0", + "duplexer3": "^0.1.4", + "get-stream": "^4.1.0", + "lowercase-keys": "^1.0.1", + "mimic-response": "^1.0.1", + "p-cancelable": "^1.0.0", + "to-readable-stream": "^1.0.0", + "url-parse-lax": "^3.0.0" + }, + "dependencies": { + "get-stream": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/get-stream/-/get-stream-4.1.0.tgz", + "integrity": "sha512-GMat4EJ5161kIy2HevLlr4luNjBgvmj413KaQA7jt4V8B4RDsfpHk7WQ9GVqfYyyx8OS/L66Kox+rJRNklLK7w==", + "dev": true, + "requires": { + "pump": "^3.0.0" + } + } } }, "graceful-fs": { @@ -1287,19 +3560,13 @@ "integrity": "sha512-6uHUhOPEBgQ24HM+r6b/QwWfZq+yiFcipKFrOFiBEnWdy5sdzYoi+pJeQaPI5qOLRFqWmAXUPQNsielzdLoecA==", "dev": true }, - "growl": { - "version": "1.10.5", - "resolved": "https://registry.npmjs.org/growl/-/growl-1.10.5.tgz", - "integrity": "sha512-qBr4OuELkhPenW6goKVXiv47US3clb3/IbuWF9KNKEijAy9oeHxU9IgzjvJhHkUzhaj7rOUD7+YGWqUjLp5oSA==", - "dev": true - }, "has": { "version": "1.0.3", "resolved": "https://registry.npmjs.org/has/-/has-1.0.3.tgz", "integrity": "sha512-f2dvO0VU6Oej7RkWJGrehjbzMAjFp5/VKPp5tTpWIV4JHHZK1/BxbFRtf/siA2SWTe09caDmVtYYzWEIbBS4zw==", "dev": true, "requires": { - "function-bind": "1.1.1" + "function-bind": "^1.1.1" } }, "has-flag": { @@ -1314,26 +3581,50 @@ "integrity": "sha1-uhqPGvKg/DllD1yFA2dwQSIGO0Q=", "dev": true }, - "he": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/he/-/he-1.1.1.tgz", - "integrity": "sha1-k0EP0hsAlzUVH4howvJx80J+I/0=", + "has-yarn": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/has-yarn/-/has-yarn-2.1.0.tgz", + "integrity": "sha512-UqBRqi4ju7T+TqGNdqAO0PaSVGsDGJUBQvk9eUWNGRY1CFGDzYhLWoM7JQEemnlvVcv/YEmc2wNW8BC24EnUsw==", "dev": true }, + "hasha": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/hasha/-/hasha-5.1.0.tgz", + "integrity": "sha512-OFPDWmzPN1l7atOV1TgBVmNtBxaIysToK6Ve9DK+vT6pYuklw/nPNT+HJbZi0KDcI6vWB+9tgvZ5YD7fA3CXcA==", + "dev": true, + "requires": { + "is-stream": "^2.0.0", + "type-fest": "^0.8.0" + }, + "dependencies": { + "type-fest": { + "version": "0.8.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.8.1.tgz", + "integrity": "sha512-4dbzIzqvjtgiM5rw1k5rEHtBANKmdudhGyBEajN01fEyhaAIhsoKNy6y7+IN93IfpFtwY9iqi7kD+xwKhQsNJA==", + "dev": true + } + } + }, "hosted-git-info": { "version": "2.7.1", "resolved": "https://registry.npmjs.org/hosted-git-info/-/hosted-git-info-2.7.1.tgz", "integrity": "sha512-7T/BxH19zbcCTa8XkMlbK5lTo1WtgkFi3GvdWEyNuc4Vex7/9Dqbnpsf4JMydcfj9HCg4zUWFTL3Za6lapg5/w==", "dev": true }, + "http-cache-semantics": { + "version": "4.0.3", + "resolved": "https://registry.npmjs.org/http-cache-semantics/-/http-cache-semantics-4.0.3.tgz", + "integrity": "sha512-TcIMG3qeVLgDr1TEd2XvHaTnMPwYQUQMIBLy+5pLSDKYFc7UIqj39w8EGzZkaxoLv/l2K8HaI0t5AVA+YYgUew==", + "dev": true + }, "https-proxy-agent": { "version": "2.2.1", "resolved": "https://registry.npmjs.org/https-proxy-agent/-/https-proxy-agent-2.2.1.tgz", "integrity": "sha512-HPCTS1LW51bcyMYbxUIOO4HEOlQ1/1qRaFWcyxvwaqUS9TY88aoEuHUY33kuAh1YhVVaDQhLZsnPd+XNARWZlQ==", "dev": true, "requires": { - "agent-base": "4.2.1", - "debug": "3.1.0" + "agent-base": "^4.1.0", + "debug": "^3.1.0" } }, "iconv-lite": { @@ -1342,7 +3633,7 @@ "integrity": "sha512-v3MXnZAcvnywkTUEZomIActle7RXXeedOR31wwl7VlyoXO4Qi9arvSenNQWne1TcRwhCL1HwLI21bEqdpj8/rA==", "dev": true, "requires": { - "safer-buffer": "2.1.2" + "safer-buffer": ">= 2.1.2 < 3" } }, "ignore": { @@ -1351,13 +3642,19 @@ "integrity": "sha512-cyFDKrqc/YdcWFniJhzI42+AzS+gNwmUzOSFcRCQYwySuBBBy/KjuxWLZ/FHEH6Moq1NizMOBWyTcv8O4OZIMg==", "dev": true }, + "ignore-by-default": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/ignore-by-default/-/ignore-by-default-1.0.1.tgz", + "integrity": "sha1-SMptcvbGo68Aqa1K5odr44ieKwk=", + "dev": true + }, "ignore-walk": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/ignore-walk/-/ignore-walk-3.0.1.tgz", "integrity": "sha512-DTVlMx3IYPe0/JJcYP7Gxg7ttZZu3IInhuEhbchuqneY9wWe5Ojy2mXLBaQFUQmo0AW2r3qG7m1mg86js+gnlQ==", "dev": true, "requires": { - "minimatch": "3.0.4" + "minimatch": "^3.0.4" } }, "import-fresh": { @@ -1366,8 +3663,84 @@ "integrity": "sha512-pOnA9tfM3Uwics+SaBLCNyZZZbK+4PTu0OPZtLlMIrv17EdBoC15S9Kn8ckJ9TZTyKb3ywNE5y1yeDxxGA7nTQ==", "dev": true, "requires": { - "parent-module": "1.0.0", - "resolve-from": "4.0.0" + "parent-module": "^1.0.0", + "resolve-from": "^4.0.0" + } + }, + "import-lazy": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/import-lazy/-/import-lazy-2.1.0.tgz", + "integrity": "sha1-BWmOPUXIjo1+nZLLBYTnfwlvPkM=", + "dev": true + }, + "import-local": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/import-local/-/import-local-3.0.2.tgz", + "integrity": "sha512-vjL3+w0oulAVZ0hBHnxa/Nm5TAurf9YLQJDhqRZyqb+VKGOB6LU8t9H1Nr5CIo16vh9XfJTOoHwU0B71S557gA==", + "dev": true, + "requires": { + "pkg-dir": "^4.2.0", + "resolve-cwd": "^3.0.0" + }, + "dependencies": { + "find-up": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-4.1.0.tgz", + "integrity": "sha512-PpOwAdQ/YlXQ2vj8a3h8IipDuYRi3wceVQQGYWxNINccq40Anw7BlsEXCMbt1Zt+OLA6Fq9suIpIWD0OsnISlw==", + "dev": true, + "requires": { + "locate-path": "^5.0.0", + "path-exists": "^4.0.0" + } + }, + "locate-path": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-5.0.0.tgz", + "integrity": "sha512-t7hw9pI+WvuwNJXwk5zVHpyhIqzg2qTlklJOf0mVxGSbe3Fp2VieZcduNYjaLDoy6p9uGpQEGWG87WpMKlNq8g==", + "dev": true, + "requires": { + "p-locate": "^4.1.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-4.1.0.tgz", + "integrity": "sha512-R79ZZ/0wAxKGu3oYMlz8jy/kbhsNrS7SKZ7PxEHBgJ5+F2mtFW2fK2cOtBh1cHYkQsbzFV7I+EoRKe6Yt0oK7A==", + "dev": true, + "requires": { + "p-limit": "^2.2.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "path-exists": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", + "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", + "dev": true + }, + "pkg-dir": { + "version": "4.2.0", + "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-4.2.0.tgz", + "integrity": "sha512-HRDzbaKjC+AOWVXxAU/x54COGeIv9eb+6CkDSQoNTt4XyWoIJvuPsXizxu/Fr23EiekbtZwmh1IcIG/l/a10GQ==", + "dev": true, + "requires": { + "find-up": "^4.0.0" + } + } } }, "import-modules": { @@ -1382,14 +3755,20 @@ "integrity": "sha1-khi5srkoojixPcT7a21XbyMUU+o=", "dev": true }, + "indent-string": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-4.0.0.tgz", + "integrity": "sha512-EdDDZu4A2OyIK7Lr/2zG+w5jmbuk1DVBnEwREQvBzspBJkCEbRa8GxU1lghYcaGJCnRWibjDXlq779X1/y5xwg==", + "dev": true + }, "inflight": { "version": "1.0.6", "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", "integrity": "sha1-Sb1jMdfQLQwJvJEKEHW6gWW1bfk=", "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -1409,19 +3788,19 @@ "integrity": "sha512-Z2rREiXA6cHRR9KBOarR3WuLlFzlIfAEIiB45ll5SSadMg7WqOh1MKEjjndfuH5ewXdixWCxqnVfGOQzPeiztA==", "dev": true, "requires": { - "ansi-escapes": "3.2.0", - "chalk": "2.4.2", - "cli-cursor": "2.1.0", - "cli-width": "2.2.0", - "external-editor": "3.0.3", - "figures": "2.0.0", - "lodash": "4.17.11", + "ansi-escapes": "^3.2.0", + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-width": "^2.0.0", + "external-editor": "^3.0.3", + "figures": "^2.0.0", + "lodash": "^4.17.11", "mute-stream": "0.0.7", - "run-async": "2.3.0", - "rxjs": "6.4.0", - "string-width": "2.1.1", - "strip-ansi": "5.0.0", - "through": "2.3.8" + "run-async": "^2.2.0", + "rxjs": "^6.4.0", + "string-width": "^2.1.0", + "strip-ansi": "^5.0.0", + "through": "^2.3.6" }, "dependencies": { "ansi-regex": { @@ -1442,7 +3821,7 @@ "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", "dev": true, "requires": { - "ansi-regex": "4.0.0" + "ansi-regex": "^4.0.0" } } } @@ -1453,21 +3832,51 @@ "integrity": "sha512-phJfQVBuaJM5raOpJjSfkiD6BpbCE4Ns//LaXl6wGYtUBY83nWS6Rf9tXm2e8VaK60JEjYldbPif/A2B1C2gNA==", "dev": true, "requires": { - "loose-envify": "1.4.0" + "loose-envify": "^1.0.0" } }, + "irregular-plurals": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/irregular-plurals/-/irregular-plurals-2.0.0.tgz", + "integrity": "sha512-Y75zBYLkh0lJ9qxeHlMjQ7bSbyiSqNW/UOPWDmzC7cXskL1hekSITh1Oc6JV0XCWWZ9DE8VYSB71xocLk3gmGw==", + "dev": true + }, + "is-arguments": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.0.4.tgz", + "integrity": "sha512-xPh0Rmt8NE65sNzvyUmWgI1tz3mKq74lGA0mL8LYZcoIzKOzDh6HmrYm3d18k60nHerC8A9Km8kYu87zfSFnLA==", + "dev": true + }, "is-arrayish": { "version": "0.2.1", "resolved": "https://registry.npmjs.org/is-arrayish/-/is-arrayish-0.2.1.tgz", "integrity": "sha1-d8mYQFJ6qOyxqLppe4BkWnqSap0=", "dev": true }, + "is-binary-path": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", + "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", + "dev": true, + "requires": { + "binary-extensions": "^2.0.0" + } + }, "is-callable": { "version": "1.1.4", "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.1.4.tgz", "integrity": "sha512-r5p9sxJjYnArLjObpjA4xu5EKI3CuKHkJXMhT7kwbpUyIFD1n5PMAsoPvWnvtZiNz7LjkYDRZhd7FlI0eMijEA==", "dev": true }, + "is-ci": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-ci/-/is-ci-2.0.0.tgz", + "integrity": "sha512-YfJT7rkpQB0updsdHLGWrvhBJfcfzNNawYDNIyQXJz0IViGf75O8EBPKSdvw2rF+LGCsX4FZ8tcr3b19LcZq4w==", + "dev": true, + "requires": { + "ci-info": "^2.0.0" + } + }, "is-date-object": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/is-date-object/-/is-date-object-1.0.1.tgz", @@ -1480,12 +3889,111 @@ "integrity": "sha1-aEqW2EB2V3yY9M20DG0mpRI78Zw=", "dev": true }, + "is-extglob": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", + "integrity": "sha1-qIwCU1eR8C7TfHahueqXc8gz+MI=", + "dev": true + }, "is-fullwidth-code-point": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-2.0.0.tgz", "integrity": "sha1-o7MKXE8ZkYMWeqq5O+764937ZU8=", "dev": true }, + "is-glob": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.1.tgz", + "integrity": "sha512-5G0tKtBTFImOqDnLB2hG6Bp2qcKEFduo4tZu9MT/H6NQv/ghhy30o55ufafxJ/LdH79LLs2Kfrn85TLKyA7BUg==", + "dev": true, + "requires": { + "is-extglob": "^2.1.1" + } + }, + "is-installed-globally": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/is-installed-globally/-/is-installed-globally-0.1.0.tgz", + "integrity": "sha1-Df2Y9akRFxbdU13aZJL2e/PSWoA=", + "dev": true, + "requires": { + "global-dirs": "^0.1.0", + "is-path-inside": "^1.0.0" + }, + "dependencies": { + "is-path-inside": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-1.0.1.tgz", + "integrity": "sha1-jvW33lBDej/cprToZe96pVy0gDY=", + "dev": true, + "requires": { + "path-is-inside": "^1.0.1" + } + } + } + }, + "is-npm": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-npm/-/is-npm-3.0.0.tgz", + "integrity": "sha512-wsigDr1Kkschp2opC4G3yA6r9EgVA6NjRpWzIi9axXqeIaAATPRJc4uLujXe3Nd9uO8KoDyA4MD6aZSeXTADhA==", + "dev": true + }, + "is-number": { + "version": "7.0.0", + "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", + "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", + "dev": true + }, + "is-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-obj/-/is-obj-2.0.0.tgz", + "integrity": "sha512-drqDG3cbczxxEJRoOXcOjtdp1J/lyp1mNn0xaznRs8+muBhgQcrnbspox5X5fOw0HnMnbfDzvnEMEtqDEJEo8w==", + "dev": true + }, + "is-observable": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/is-observable/-/is-observable-2.0.0.tgz", + "integrity": "sha512-fhBZv3eFKUbyHXZ1oHujdo2tZ+CNbdpdzzlENgCGZUC8keoGxUew2jYFLYcUB4qo7LDD03o4KK11m/QYD7kEjg==", + "dev": true + }, + "is-path-cwd": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/is-path-cwd/-/is-path-cwd-2.2.0.tgz", + "integrity": "sha512-w942bTcih8fdJPJmQHFzkS76NEP8Kzzvmw92cXsazb8intwLqPibPPdXf4ANdKV3rYMuuQYGIWtvz9JilB3NFQ==", + "dev": true + }, + "is-path-in-cwd": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-in-cwd/-/is-path-in-cwd-2.1.0.tgz", + "integrity": "sha512-rNocXHgipO+rvnP6dk3zI20RpOtrAM/kzbB258Uw5BWr3TpXi861yzjo16Dn4hUox07iw5AyeMLHWsujkjzvRQ==", + "dev": true, + "requires": { + "is-path-inside": "^2.1.0" + } + }, + "is-path-inside": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/is-path-inside/-/is-path-inside-2.1.0.tgz", + "integrity": "sha512-wiyhTzfDWsvwAW53OBWF5zuvaOGlZ6PwYxAbPVDhpm+gM09xKQGjBq/8uYN12aDvMxnAnq3dxTyoSoRNmg5YFg==", + "dev": true, + "requires": { + "path-is-inside": "^1.0.2" + } + }, + "is-plain-obj": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-1.1.0.tgz", + "integrity": "sha1-caUMhCnfync8kqOQpKA7OfzVHT4=", + "dev": true + }, + "is-plain-object": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/is-plain-object/-/is-plain-object-3.0.0.tgz", + "integrity": "sha512-tZIpofR+P05k8Aocp7UI/2UTa9lTJSebCXpFFoR9aibpokDj/uXBsJ8luUu0tTVYKkMU6URDUuOfJZ7koewXvg==", + "dev": true, + "requires": { + "isobject": "^4.0.0" + } + }, "is-promise": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/is-promise/-/is-promise-2.1.0.tgz", @@ -1498,18 +4006,48 @@ "integrity": "sha1-VRdIm1RwkbCTDglWVM7SXul+lJE=", "dev": true, "requires": { - "has": "1.0.3" + "has": "^1.0.1" } }, + "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==", + "dev": true + }, "is-symbol": { "version": "1.0.2", "resolved": "https://registry.npmjs.org/is-symbol/-/is-symbol-1.0.2.tgz", "integrity": "sha512-HS8bZ9ox60yCJLH9snBpIwv9pYUAkcuLhSA1oero1UB5y9aiQpRA8y2ex945AOtCZL1lJDeIk3G5LthswI46Lw==", "dev": true, "requires": { - "has-symbols": "1.0.0" + "has-symbols": "^1.0.0" } }, + "is-typedarray": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/is-typedarray/-/is-typedarray-1.0.0.tgz", + "integrity": "sha1-5HnICFjfDBsR3dppQPlgEfzaSpo=", + "dev": true + }, + "is-url": { + "version": "1.2.4", + "resolved": "https://registry.npmjs.org/is-url/-/is-url-1.2.4.tgz", + "integrity": "sha512-ITvGim8FhRiYe4IQ5uHSkj7pVaPDrCTkNd3yq3cV7iZAcJdHTUMPMEHcqSOy9xZ9qFenQCvi+2wjH9a1nXqHww==", + "dev": true + }, + "is-utf8": { + "version": "0.2.1", + "resolved": "https://registry.npmjs.org/is-utf8/-/is-utf8-0.2.1.tgz", + "integrity": "sha1-Sw2hRCEE0bM2NA6AeX6GXPOffXI=", + "dev": true + }, + "is-yarn-global": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/is-yarn-global/-/is-yarn-global-0.3.0.tgz", + "integrity": "sha512-VjSeb/lHmkoyd8ryPVIKvOCn4D1koMqY+vqyjjUfc3xyKtP4dYOxM44sZrnqQSzSds3xyOrUTLTC9LVCVgLngw==", + "dev": true + }, "isarray": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/isarray/-/isarray-1.0.0.tgz", @@ -1522,6 +4060,12 @@ "integrity": "sha1-6PvzdNxVb/iUehDcsFctYz8s+hA=", "dev": true }, + "isobject": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/isobject/-/isobject-4.0.0.tgz", + "integrity": "sha512-S/2fF5wH8SJA/kmwr6HYhK/RI/OkhD84k8ntalo0iJjZikgq1XFvR5M8NPT1x5F7fBwCG3qHfnzeP/Vh/ZxCUA==", + "dev": true + }, "istanbul-lib-coverage": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/istanbul-lib-coverage/-/istanbul-lib-coverage-2.0.3.tgz", @@ -1534,13 +4078,13 @@ "integrity": "sha512-ooVllVGT38HIk8MxDj/OIHXSYvH+1tq/Vb38s8ixt9GoJadXska4WkGY+0wkmtYCZNYtaARniH/DixUGGLZ0uA==", "dev": true, "requires": { - "@babel/generator": "7.3.4", - "@babel/parser": "7.3.4", - "@babel/template": "7.2.2", - "@babel/traverse": "7.3.4", - "@babel/types": "7.3.4", - "istanbul-lib-coverage": "2.0.3", - "semver": "5.6.0" + "@babel/generator": "^7.0.0", + "@babel/parser": "^7.0.0", + "@babel/template": "^7.0.0", + "@babel/traverse": "^7.0.0", + "@babel/types": "^7.0.0", + "istanbul-lib-coverage": "^2.0.3", + "semver": "^5.5.0" }, "dependencies": { "@babel/code-frame": { @@ -1549,7 +4093,7 @@ "integrity": "sha512-OfC2uemaknXr87bdLUkWog7nYuliM9Ij5HUcajsVcMCpQrcLmtxRbVFTIqmcSkSeYRBFBRxs2FiUqFJDLdiebA==", "dev": true, "requires": { - "@babel/highlight": "7.0.0" + "@babel/highlight": "^7.0.0" } }, "@babel/generator": { @@ -1558,11 +4102,11 @@ "integrity": "sha512-8EXhHRFqlVVWXPezBW5keTiQi/rJMQTg/Y9uVCEZ0CAF3PKtCCaVRnp64Ii1ujhkoDhhF1fVsImoN4yJ2uz4Wg==", "dev": true, "requires": { - "@babel/types": "7.3.4", - "jsesc": "2.5.2", - "lodash": "4.17.11", - "source-map": "0.5.7", - "trim-right": "1.0.1" + "@babel/types": "^7.3.4", + "jsesc": "^2.5.1", + "lodash": "^4.17.11", + "source-map": "^0.5.0", + "trim-right": "^1.0.1" } }, "@babel/helper-function-name": { @@ -1571,9 +4115,9 @@ "integrity": "sha512-A95XEoCpb3TO+KZzJ4S/5uW5fNe26DjBGqf1o9ucyLyCmi1dXq/B3c8iaWTfBk3VvetUxl16e8tIrd5teOCfGw==", "dev": true, "requires": { - "@babel/helper-get-function-arity": "7.0.0", - "@babel/template": "7.2.2", - "@babel/types": "7.3.4" + "@babel/helper-get-function-arity": "^7.0.0", + "@babel/template": "^7.1.0", + "@babel/types": "^7.0.0" } }, "@babel/helper-get-function-arity": { @@ -1582,7 +4126,7 @@ "integrity": "sha512-r2DbJeg4svYvt3HOS74U4eWKsUAMRH01Z1ds1zx8KNTPtpTL5JAsdFv8BNyOpVqdFhHkkRDIg5B4AsxmkjAlmQ==", "dev": true, "requires": { - "@babel/types": "7.3.4" + "@babel/types": "^7.0.0" } }, "@babel/helper-split-export-declaration": { @@ -1591,7 +4135,7 @@ "integrity": "sha512-MXkOJqva62dfC0w85mEf/LucPPS/1+04nmmRMPEBUB++hiiThQ2zPtX/mEWQ3mtzCEjIJvPY8nuwxXtQeQwUag==", "dev": true, "requires": { - "@babel/types": "7.3.4" + "@babel/types": "^7.0.0" } }, "@babel/highlight": { @@ -1600,9 +4144,9 @@ "integrity": "sha512-UFMC4ZeFC48Tpvj7C8UgLvtkaUuovQX+5xNWrsIoMG8o2z+XFKjKaN9iVmS84dPwVN00W4wPmqvYoZF3EGAsfw==", "dev": true, "requires": { - "chalk": "2.4.2", - "esutils": "2.0.2", - "js-tokens": "4.0.0" + "chalk": "^2.0.0", + "esutils": "^2.0.2", + "js-tokens": "^4.0.0" } }, "@babel/template": { @@ -1611,9 +4155,9 @@ "integrity": "sha512-zRL0IMM02AUDwghf5LMSSDEz7sBCO2YnNmpg3uWTZj/v1rcG2BmQUvaGU8GhU8BvfMh1k2KIAYZ7Ji9KXPUg7g==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0", - "@babel/parser": "7.3.4", - "@babel/types": "7.3.4" + "@babel/code-frame": "^7.0.0", + "@babel/parser": "^7.2.2", + "@babel/types": "^7.2.2" } }, "@babel/traverse": { @@ -1622,15 +4166,15 @@ "integrity": "sha512-TvTHKp6471OYEcE/91uWmhR6PrrYywQntCHSaZ8CM8Vmp+pjAusal4nGB2WCCQd0rvI7nOMKn9GnbcvTUz3/ZQ==", "dev": true, "requires": { - "@babel/code-frame": "7.0.0", - "@babel/generator": "7.3.4", - "@babel/helper-function-name": "7.1.0", - "@babel/helper-split-export-declaration": "7.0.0", - "@babel/parser": "7.3.4", - "@babel/types": "7.3.4", - "debug": "4.1.1", - "globals": "11.11.0", - "lodash": "4.17.11" + "@babel/code-frame": "^7.0.0", + "@babel/generator": "^7.3.4", + "@babel/helper-function-name": "^7.1.0", + "@babel/helper-split-export-declaration": "^7.0.0", + "@babel/parser": "^7.3.4", + "@babel/types": "^7.3.4", + "debug": "^4.1.0", + "globals": "^11.1.0", + "lodash": "^4.17.11" } }, "@babel/types": { @@ -1639,9 +4183,9 @@ "integrity": "sha512-WEkp8MsLftM7O/ty580wAmZzN1nDmCACc5+jFzUt+GUFNNIi3LdRlueYz0YIlmJhlZx1QYDMZL5vdWCL0fNjFQ==", "dev": true, "requires": { - "esutils": "2.0.2", - "lodash": "4.17.11", - "to-fast-properties": "2.0.0" + "esutils": "^2.0.2", + "lodash": "^4.17.11", + "to-fast-properties": "^2.0.0" } }, "debug": { @@ -1650,7 +4194,7 @@ "integrity": "sha512-pYAIzeRo8J6KPEaJ0VWOh5Pzkbw/RetuzehGM7QRRX5he4fPHx2rdKMB256ehJCkX+XRQm16eZLqLNS8RSZXZw==", "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "js-tokens": { @@ -1679,6 +4223,12 @@ "integrity": "sha512-5IZ7sY9dBAYSV+YjQ0Ovb540Ku7AO9Z5o2Cg789xj167iQuZ2cG+z0f3Uct6WeYLbU6aQiM2pCs7sZ+4dotydw==", "dev": true }, + "js-string-escape": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/js-string-escape/-/js-string-escape-1.0.1.tgz", + "integrity": "sha1-4mJbrbwNZ8dTPp7cEGjFh65BN+8=", + "dev": true + }, "js-tokens": { "version": "3.0.2", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-3.0.2.tgz", @@ -1691,8 +4241,8 @@ "integrity": "sha1-yhrNNCPsJ10SFAp7q1HbAVugs8A=", "dev": true, "requires": { - "argparse": "1.0.10", - "esprima": "2.2.0" + "argparse": "~1.0.2", + "esprima": "~2.2.0" }, "dependencies": { "esprima": { @@ -1714,7 +4264,7 @@ "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-0.1.4.tgz", "integrity": "sha1-tdQLipAJ6S8Vf3wHnbCXABgw4B4=", "requires": { - "bignumber.js": "1.1.1" + "bignumber.js": "~1.1.1" }, "dependencies": { "bignumber.js": { @@ -1724,6 +4274,18 @@ } } }, + "json-buffer": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/json-buffer/-/json-buffer-3.0.0.tgz", + "integrity": "sha1-Wx85evx11ne96Lz8Dkfh+aPZqJg=", + "dev": true + }, + "json-parse-better-errors": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/json-parse-better-errors/-/json-parse-better-errors-1.0.2.tgz", + "integrity": "sha512-mrqyZKfX5EhL7hvqcV6WG1yYjnjeuYDzDhhcAAUrq8Po85NBQBJP+ZDUT75qZQ98IkUoBqdkExkukOU7Ts2wrw==", + "dev": true + }, "json-schema-traverse": { "version": "0.4.1", "resolved": "https://registry.npmjs.org/json-schema-traverse/-/json-schema-traverse-0.4.1.tgz", @@ -1736,6 +4298,23 @@ "integrity": "sha1-nbe1lJatPzz+8wp1FC0tkwrXJlE=", "dev": true }, + "json5": { + "version": "2.1.1", + "resolved": "https://registry.npmjs.org/json5/-/json5-2.1.1.tgz", + "integrity": "sha512-l+3HXD0GEI3huGq1njuqtzYK8OYJyXMkOLtQ53pjWh89tvWS2h6l+1zMkYWqlb57+SiQodKZyvMEFb2X+KrFhQ==", + "dev": true, + "requires": { + "minimist": "^1.2.0" + }, + "dependencies": { + "minimist": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.2.0.tgz", + "integrity": "sha1-o1AIsg9BOD7sH7kU9M1d95omQoQ=", + "dev": true + } + } + }, "jsonc-parser": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/jsonc-parser/-/jsonc-parser-2.0.3.tgz", @@ -1748,7 +4327,25 @@ "integrity": "sha1-6AGxs5mF4g//yHtA43SAgOLcrH8=", "dev": true, "requires": { - "array-includes": "3.0.3" + "array-includes": "^3.0.3" + } + }, + "keyv": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/keyv/-/keyv-3.1.0.tgz", + "integrity": "sha512-9ykJ/46SN/9KPM/sichzQ7OvXyGDYKGTaDlKMGCAlg2UK8KRy4jb0d8sFc+0Tt0YYnThq8X2RZgCg74RPxgcVA==", + "dev": true, + "requires": { + "json-buffer": "3.0.0" + } + }, + "latest-version": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/latest-version/-/latest-version-5.1.0.tgz", + "integrity": "sha512-weT+r0kTkRQdCdYCNtkMwWXQTMEswKrFBkm4ckQOMVhhqhIMI1UT2hMj+1iigIhgSZm5gTmrRXBNoGUgaTY1xA==", + "dev": true, + "requires": { + "package-json": "^6.3.0" } }, "levn": { @@ -1757,8 +4354,8 @@ "integrity": "sha1-OwmSTt+fCDwEkP3UwLxEIeBHZO4=", "dev": true, "requires": { - "prelude-ls": "1.1.2", - "type-check": "0.3.2" + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" } }, "load-json-file": { @@ -1767,10 +4364,10 @@ "integrity": "sha1-eUfkIUmvgNaWy/eXvKq8/h/inKg=", "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "2.2.0", - "pify": "2.3.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^2.2.0", + "pify": "^2.0.0", + "strip-bom": "^3.0.0" } }, "locate-path": { @@ -1779,8 +4376,8 @@ "integrity": "sha1-K1aLJl7slExtnA3pw9u7ygNUzY4=", "dev": true, "requires": { - "p-locate": "2.0.0", - "path-exists": "3.0.0" + "p-locate": "^2.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -1794,18 +4391,42 @@ "integrity": "sha1-soqmKIorn8ZRA1x3EfZathkDMaY=", "dev": true }, + "lodash.clonedeep": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/lodash.clonedeep/-/lodash.clonedeep-4.5.0.tgz", + "integrity": "sha1-4j8/nE+Pvd6HJSnBBxhXoIblzO8=", + "dev": true + }, + "lodash.flattendeep": { + "version": "4.4.0", + "resolved": "https://registry.npmjs.org/lodash.flattendeep/-/lodash.flattendeep-4.4.0.tgz", + "integrity": "sha1-+wMJF/hqMTTlvJvsDWngAT3f7bI=", + "dev": true + }, "lodash.get": { "version": "4.4.2", "resolved": "https://registry.npmjs.org/lodash.get/-/lodash.get-4.4.2.tgz", "integrity": "sha1-LRd/ZS+jHpObRDjVNBSZ36OCXpk=", "dev": true }, + "lodash.islength": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/lodash.islength/-/lodash.islength-4.0.1.tgz", + "integrity": "sha1-Tpho1FJXXXUK/9NYyXlUPcIO1Xc=", + "dev": true + }, "lodash.kebabcase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.kebabcase/-/lodash.kebabcase-4.1.1.tgz", "integrity": "sha1-hImxyw0p/4gZXM7KRI/21swpXDY=", "dev": true }, + "lodash.merge": { + "version": "4.6.2", + "resolved": "https://registry.npmjs.org/lodash.merge/-/lodash.merge-4.6.2.tgz", + "integrity": "sha512-0KpjqXRVvrYyCsX1swR/XTK0va6VQkQM6MNo7PqW77ByjAhoARA8EfrP1N4+KlKj8YS0ZUCtRT/YUuhyYDujIQ==", + "dev": true + }, "lodash.snakecase": { "version": "4.1.1", "resolved": "https://registry.npmjs.org/lodash.snakecase/-/lodash.snakecase-4.1.1.tgz", @@ -1824,34 +4445,233 @@ "integrity": "sha1-7GZi5IlkCO1KtsVCo5kLcswIACA=", "dev": true }, + "log-symbols": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-2.2.0.tgz", + "integrity": "sha512-VeIAFslyIerEJLXHziedo2basKbMKtTw3vfn5IzG0XTjhAVEJyNHnL2p7vc+wBDSdQuUpNw3M2u6xb9QsAY5Eg==", + "dev": true, + "requires": { + "chalk": "^2.0.1" + } + }, "loose-envify": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/loose-envify/-/loose-envify-1.4.0.tgz", "integrity": "sha512-lyuxPGr/Wfhrlem2CL/UcnUc1zcqKAImBDzukY7Y5F/yQiNdko6+fRLevlw1HgMySw7f611UIY408EtxRSoK3Q==", "dev": true, "requires": { - "js-tokens": "3.0.2" + "js-tokens": "^3.0.0 || ^4.0.0" + } + }, + "loud-rejection": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-2.2.0.tgz", + "integrity": "sha512-S0FayMXku80toa5sZ6Ro4C+s+EtFDCsyJNG/AzFMfX3AxD5Si4dZsgzm/kKnbOxHl5Cv8jBlno8+3XYIh2pNjQ==", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.2" + } + }, + "lowercase-keys": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/lowercase-keys/-/lowercase-keys-1.0.1.tgz", + "integrity": "sha512-G2Lj61tXDnVFFOi8VZds+SoQjtQC3dgokKdDG2mTm1tx4m50NUHBOZSBwQQHyy0V12A0JTG4icfZQH+xPyh8VA==", + "dev": true + }, + "lru-cache": { + "version": "4.1.5", + "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-4.1.5.tgz", + "integrity": "sha512-sWZlbEP2OsHNkXrMl5GYk/jKk70MBng6UU4YI/qGDYbgf6YbP4EvmqISbXCoJiRKs+1bSpFHVgQxvJ17F2li5g==", + "dev": true, + "requires": { + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" + } + }, + "make-dir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/make-dir/-/make-dir-3.0.0.tgz", + "integrity": "sha512-grNJDhb8b1Jm1qeqW5R/O63wUo4UXo2v2HMic6YT9i/HBlF93S8jkMgH7yugvY9ABDShH4VZMn8I+U8+fCNegw==", + "dev": true, + "requires": { + "semver": "^6.0.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } } }, + "map-obj": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/map-obj/-/map-obj-2.0.0.tgz", + "integrity": "sha1-plzSkIepJZi4eRJXpSPgISIqwfk=", + "dev": true + }, "marked": { "version": "0.3.19", "resolved": "https://registry.npmjs.org/marked/-/marked-0.3.19.tgz", "integrity": "sha512-ea2eGWOqNxPcXv8dyERdSr/6FmzvWwzjMxpfGB/sbMccXoct+xY+YukPD+QTUZwyvK7BZwcr4m21WBOW41pAkg==", "dev": true }, + "matcher": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/matcher/-/matcher-2.0.0.tgz", + "integrity": "sha512-nlmfSlgHBFx36j/Pl/KQPbIaqE8Zf0TqmSMjsuddHDg6PMSVgmyW9HpkLs0o0M1n2GIZ/S2BZBLIww/xjhiGng==", + "dev": true, + "requires": { + "escape-string-regexp": "^2.0.0" + }, + "dependencies": { + "escape-string-regexp": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-2.0.0.tgz", + "integrity": "sha512-UpzcLCXolUWcNu5HtVMHYdXJjArjsF9C0aNnquZYY4uW/Vu0miy5YoWvbV345HauVvcAUnpRuhMMcqTcGOY2+w==", + "dev": true + } + } + }, + "md5-hex": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/md5-hex/-/md5-hex-3.0.1.tgz", + "integrity": "sha512-BUiRtTtV39LIJwinWBjqVsU9xhdnz7/i889V859IBFpuqGAj6LuOvHv5XLbgZ2R7ptJoJaEcxkv88/h25T7Ciw==", + "dev": true, + "requires": { + "blueimp-md5": "^2.10.0" + } + }, + "md5-o-matic": { + "version": "0.1.1", + "resolved": "https://registry.npmjs.org/md5-o-matic/-/md5-o-matic-0.1.1.tgz", + "integrity": "sha1-givM1l4RfFFPqxdrJZRdVBAKA8M=", + "dev": true + }, + "meow": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/meow/-/meow-5.0.0.tgz", + "integrity": "sha512-CbTqYU17ABaLefO8vCU153ZZlprKYWDljcndKKDCFcYQITzWCXZAVk4QMFZPgvzrnUQ3uItnIE/LoUOwrT15Ig==", + "dev": true, + "requires": { + "camelcase-keys": "^4.0.0", + "decamelize-keys": "^1.0.0", + "loud-rejection": "^1.0.0", + "minimist-options": "^3.0.1", + "normalize-package-data": "^2.3.4", + "read-pkg-up": "^3.0.0", + "redent": "^2.0.0", + "trim-newlines": "^2.0.0", + "yargs-parser": "^10.0.0" + }, + "dependencies": { + "load-json-file": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-4.0.0.tgz", + "integrity": "sha1-L19Fq5HjMhYjT9U62rZo607AmTs=", + "dev": true, + "requires": { + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" + } + }, + "loud-rejection": { + "version": "1.6.0", + "resolved": "https://registry.npmjs.org/loud-rejection/-/loud-rejection-1.6.0.tgz", + "integrity": "sha1-W0b4AUft7leIcPCG0Eghz5mOVR8=", + "dev": true, + "requires": { + "currently-unhandled": "^0.4.1", + "signal-exit": "^3.0.0" + } + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "path-type": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/path-type/-/path-type-3.0.0.tgz", + "integrity": "sha512-T2ZUsdZFHgA3u4e5PfPbjd7HDDpxPnQb5jN0SrDsjNSuVXHJqtwTnWqG0B1jZrgmJ/7lj1EmVIByWt1gxGkWvg==", + "dev": true, + "requires": { + "pify": "^3.0.0" + } + }, + "pify": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-3.0.0.tgz", + "integrity": "sha1-5aSs0sEB/fPZpNB/DbxNtJ3SgXY=", + "dev": true + }, + "read-pkg": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg/-/read-pkg-3.0.0.tgz", + "integrity": "sha1-nLxoaXj+5l0WwA4rGcI3/Pbjg4k=", + "dev": true, + "requires": { + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" + } + }, + "read-pkg-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/read-pkg-up/-/read-pkg-up-3.0.0.tgz", + "integrity": "sha1-PtSWaF26D4/hGNBpHcUfSh/5bwc=", + "dev": true, + "requires": { + "find-up": "^2.0.0", + "read-pkg": "^3.0.0" + } + } + } + }, + "merge2": { + "version": "1.3.0", + "resolved": "https://registry.npmjs.org/merge2/-/merge2-1.3.0.tgz", + "integrity": "sha512-2j4DAdlBOkiSZIsaXk4mTE3sRS02yBHAtfy127xRV3bQUFqXkjHCHLW6Scv7DwNRbIWNHH8zpnz9zMaKXIdvYw==", + "dev": true + }, + "micromatch": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/micromatch/-/micromatch-4.0.2.tgz", + "integrity": "sha512-y7FpHSbMUMoyPbYUSzO6PaZ6FyRnQOpHuKwbo1G+Knck95XVU4QAiKdGEnj5wwoS7PlOgthX/09u5iFJ+aYf5Q==", + "dev": true, + "requires": { + "braces": "^3.0.1", + "picomatch": "^2.0.5" + } + }, "mimic-fn": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/mimic-fn/-/mimic-fn-1.2.0.tgz", "integrity": "sha512-jf84uxzwiuiIVKiOLpfYk7N46TSy8ubTonmneY9vrpHNAnp0QBt2BxWV9dO3/j+BoVAb+a5G6YDPW3M5HOdMWQ==", "dev": true }, + "mimic-response": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/mimic-response/-/mimic-response-1.0.1.tgz", + "integrity": "sha512-j5EctnkH7amfV/q5Hgmoal1g2QHFJRraOtmx0JpIqkxhBhI/lJSl1nMpQ45hVarwNETOoWEimndZ4QK0RHxuxQ==", + "dev": true + }, "minimatch": { "version": "3.0.4", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.0.4.tgz", "integrity": "sha512-yJHVQEhyqPLUTgt9B83PXu6W3rx4MvvHvSUvToogpwoGDOUQ+yDrR0HRot+yOCdCO7u4hX3pWft6kWBBcqh0UA==", "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -1859,6 +4679,16 @@ "resolved": "https://registry.npmjs.org/minimist/-/minimist-1.1.3.tgz", "integrity": "sha1-O+39kaktOQFvz6ocaB6Pqhoe/ag=" }, + "minimist-options": { + "version": "3.0.2", + "resolved": "https://registry.npmjs.org/minimist-options/-/minimist-options-3.0.2.tgz", + "integrity": "sha512-FyBrT/d0d4+uiZRbqznPXqw3IpZZG3gl3wKWiX784FycUKVwBt0uLBFkQrtE4tZOrgo78nZp2jnKz3L65T5LdQ==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "is-plain-obj": "^1.1.0" + } + }, "mkdirp": { "version": "0.5.1", "resolved": "https://registry.npmjs.org/mkdirp/-/mkdirp-0.5.1.tgz", @@ -1876,41 +4706,6 @@ } } }, - "mocha": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-5.2.0.tgz", - "integrity": "sha512-2IUgKDhc3J7Uug+FxMXuqIyYzH7gJjXECKe/w43IGgQHTSj3InJi+yAA7T24L9bQMRKiUEHxEX37G5JpVUGLcQ==", - "dev": true, - "requires": { - "browser-stdout": "1.3.1", - "commander": "2.15.1", - "debug": "3.1.0", - "diff": "3.5.0", - "escape-string-regexp": "1.0.5", - "glob": "7.1.2", - "growl": "1.10.5", - "he": "1.1.1", - "minimatch": "3.0.4", - "mkdirp": "0.5.1", - "supports-color": "5.4.0" - }, - "dependencies": { - "glob": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/glob/-/glob-7.1.2.tgz", - "integrity": "sha512-MJTUg1kjuLeQCJ+ccE4Vpa6kKVXkPYJ2mOCQyUuKLcLQsdrMCpBPUi8qVE6+YuaJkozeA9NusTAw3hLr8Xe5EQ==", - "dev": true, - "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" - } - } - } - }, "ms": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/ms/-/ms-2.0.0.tgz", @@ -1923,10 +4718,10 @@ "integrity": "sha1-nHkGoi+0wCkZ4vX3UWG0zb1LKis=", "dev": true, "requires": { - "array-differ": "1.0.0", - "array-union": "1.0.2", - "arrify": "1.0.1", - "minimatch": "3.0.4" + "array-differ": "^1.0.0", + "array-union": "^1.0.1", + "arrify": "^1.0.0", + "minimatch": "^3.0.0" } }, "mute-stream": { @@ -1959,10 +4754,31 @@ "integrity": "sha512-/5CMN3T0R4XTj4DcGaexo+roZSdSFW/0AOOTROrjxzCG1wrWXEsGbRKevjlIL+ZDE4sZlJr5ED4YW0yqmkK+eA==", "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "resolve": "1.10.0", - "semver": "5.6.0", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" + } + }, + "normalize-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", + "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", + "dev": true + }, + "normalize-url": { + "version": "4.5.0", + "resolved": "https://registry.npmjs.org/normalize-url/-/normalize-url-4.5.0.tgz", + "integrity": "sha512-2s47yzUxdexf1OhyRi4Em83iQk0aPvwTddtFz4hnSSw9dCEsLEGf6SwIO8ss/19S9iBb5sJaOuTvTGDeZI00BQ==", + "dev": true + }, + "npm-run-path": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/npm-run-path/-/npm-run-path-2.0.2.tgz", + "integrity": "sha1-NakjLfo11wZ7TLLd8jV7GHFTbF8=", + "dev": true, + "requires": { + "path-key": "^2.0.0" } }, "nyc": { @@ -1971,30 +4787,30 @@ "integrity": "sha512-P+FwIuro2aFG6B0Esd9ZDWUd51uZrAEoGutqZxzrVmYl3qSfkLgcQpBPBjtDFsUQLFY1dvTQJPOyeqr8S9GF8w==", "dev": true, "requires": { - "archy": "1.0.0", - "arrify": "1.0.1", - "caching-transform": "3.0.1", - "convert-source-map": "1.6.0", - "find-cache-dir": "2.0.0", - "find-up": "3.0.0", - "foreground-child": "1.5.6", - "glob": "7.1.3", - "istanbul-lib-coverage": "2.0.3", - "istanbul-lib-hook": "2.0.3", - "istanbul-lib-instrument": "3.1.0", - "istanbul-lib-report": "2.0.4", - "istanbul-lib-source-maps": "3.0.2", - "istanbul-reports": "2.1.1", - "make-dir": "1.3.0", - "merge-source-map": "1.1.0", - "resolve-from": "4.0.0", - "rimraf": "2.6.3", - "signal-exit": "3.0.2", - "spawn-wrap": "1.4.2", - "test-exclude": "5.1.0", - "uuid": "3.3.2", - "yargs": "12.0.5", - "yargs-parser": "11.1.1" + "archy": "^1.0.0", + "arrify": "^1.0.1", + "caching-transform": "^3.0.1", + "convert-source-map": "^1.6.0", + "find-cache-dir": "^2.0.0", + "find-up": "^3.0.0", + "foreground-child": "^1.5.6", + "glob": "^7.1.3", + "istanbul-lib-coverage": "^2.0.3", + "istanbul-lib-hook": "^2.0.3", + "istanbul-lib-instrument": "^3.1.0", + "istanbul-lib-report": "^2.0.4", + "istanbul-lib-source-maps": "^3.0.2", + "istanbul-reports": "^2.1.1", + "make-dir": "^1.3.0", + "merge-source-map": "^1.1.0", + "resolve-from": "^4.0.0", + "rimraf": "^2.6.3", + "signal-exit": "^3.0.2", + "spawn-wrap": "^1.4.2", + "test-exclude": "^5.1.0", + "uuid": "^3.3.2", + "yargs": "^12.0.5", + "yargs-parser": "^11.1.1" }, "dependencies": { "ansi-regex": { @@ -2007,7 +4823,7 @@ "bundled": true, "dev": true, "requires": { - "default-require-extensions": "2.0.0" + "default-require-extensions": "^2.0.0" } }, "archy": { @@ -2025,7 +4841,7 @@ "bundled": true, "dev": true, "requires": { - "lodash": "4.17.11" + "lodash": "^4.17.11" } }, "balanced-match": { @@ -2038,7 +4854,7 @@ "bundled": true, "dev": true, "requires": { - "balanced-match": "1.0.0", + "balanced-match": "^1.0.0", "concat-map": "0.0.1" } }, @@ -2047,10 +4863,10 @@ "bundled": true, "dev": true, "requires": { - "hasha": "3.0.0", - "make-dir": "1.3.0", - "package-hash": "3.0.0", - "write-file-atomic": "2.4.2" + "hasha": "^3.0.0", + "make-dir": "^1.3.0", + "package-hash": "^3.0.0", + "write-file-atomic": "^2.3.0" } }, "camelcase": { @@ -2063,9 +4879,9 @@ "bundled": true, "dev": true, "requires": { - "string-width": "2.1.1", - "strip-ansi": "4.0.0", - "wrap-ansi": "2.1.0" + "string-width": "^2.1.1", + "strip-ansi": "^4.0.0", + "wrap-ansi": "^2.0.0" } }, "code-point-at": { @@ -2094,7 +4910,7 @@ "bundled": true, "dev": true, "requires": { - "safe-buffer": "5.1.2" + "safe-buffer": "~5.1.1" } }, "cross-spawn": { @@ -2102,8 +4918,8 @@ "bundled": true, "dev": true, "requires": { - "lru-cache": "4.1.5", - "which": "1.3.1" + "lru-cache": "^4.0.1", + "which": "^1.2.9" } }, "debug": { @@ -2111,7 +4927,7 @@ "bundled": true, "dev": true, "requires": { - "ms": "2.1.1" + "ms": "^2.1.1" } }, "decamelize": { @@ -2124,7 +4940,7 @@ "bundled": true, "dev": true, "requires": { - "strip-bom": "3.0.0" + "strip-bom": "^3.0.0" } }, "end-of-stream": { @@ -2132,7 +4948,7 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0" + "once": "^1.4.0" } }, "error-ex": { @@ -2140,7 +4956,7 @@ "bundled": true, "dev": true, "requires": { - "is-arrayish": "0.2.1" + "is-arrayish": "^0.2.1" } }, "es6-error": { @@ -2153,13 +4969,13 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "6.0.5", - "get-stream": "4.1.0", - "is-stream": "1.1.0", - "npm-run-path": "2.0.2", - "p-finally": "1.0.0", - "signal-exit": "3.0.2", - "strip-eof": "1.0.0" + "cross-spawn": "^6.0.0", + "get-stream": "^4.0.0", + "is-stream": "^1.1.0", + "npm-run-path": "^2.0.0", + "p-finally": "^1.0.0", + "signal-exit": "^3.0.0", + "strip-eof": "^1.0.0" }, "dependencies": { "cross-spawn": { @@ -2167,11 +4983,11 @@ "bundled": true, "dev": true, "requires": { - "nice-try": "1.0.5", - "path-key": "2.0.1", - "semver": "5.6.0", - "shebang-command": "1.2.0", - "which": "1.3.1" + "nice-try": "^1.0.4", + "path-key": "^2.0.1", + "semver": "^5.5.0", + "shebang-command": "^1.2.0", + "which": "^1.2.9" } } } @@ -2181,9 +4997,9 @@ "bundled": true, "dev": true, "requires": { - "commondir": "1.0.1", - "make-dir": "1.3.0", - "pkg-dir": "3.0.0" + "commondir": "^1.0.1", + "make-dir": "^1.0.0", + "pkg-dir": "^3.0.0" } }, "find-up": { @@ -2191,7 +5007,7 @@ "bundled": true, "dev": true, "requires": { - "locate-path": "3.0.0" + "locate-path": "^3.0.0" } }, "foreground-child": { @@ -2199,8 +5015,8 @@ "bundled": true, "dev": true, "requires": { - "cross-spawn": "4.0.2", - "signal-exit": "3.0.2" + "cross-spawn": "^4", + "signal-exit": "^3.0.0" } }, "fs.realpath": { @@ -2218,7 +5034,7 @@ "bundled": true, "dev": true, "requires": { - "pump": "3.0.0" + "pump": "^3.0.0" } }, "glob": { @@ -2226,12 +5042,12 @@ "bundled": true, "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } }, "graceful-fs": { @@ -2244,10 +5060,10 @@ "bundled": true, "dev": true, "requires": { - "async": "2.6.2", - "optimist": "0.6.1", - "source-map": "0.6.1", - "uglify-js": "3.4.9" + "async": "^2.5.0", + "optimist": "^0.6.1", + "source-map": "^0.6.1", + "uglify-js": "^3.1.4" }, "dependencies": { "source-map": { @@ -2267,7 +5083,7 @@ "bundled": true, "dev": true, "requires": { - "is-stream": "1.1.0" + "is-stream": "^1.0.1" } }, "hosted-git-info": { @@ -2285,8 +5101,8 @@ "bundled": true, "dev": true, "requires": { - "once": "1.4.0", - "wrappy": "1.0.2" + "once": "^1.3.0", + "wrappy": "1" } }, "inherits": { @@ -2329,7 +5145,7 @@ "bundled": true, "dev": true, "requires": { - "append-transform": "1.0.0" + "append-transform": "^1.0.0" } }, "istanbul-lib-report": { @@ -2337,9 +5153,9 @@ "bundled": true, "dev": true, "requires": { - "istanbul-lib-coverage": "2.0.3", - "make-dir": "1.3.0", - "supports-color": "6.1.0" + "istanbul-lib-coverage": "^2.0.3", + "make-dir": "^1.3.0", + "supports-color": "^6.0.0" }, "dependencies": { "supports-color": { @@ -2347,7 +5163,7 @@ "bundled": true, "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } } } @@ -2357,11 +5173,11 @@ "bundled": true, "dev": true, "requires": { - "debug": "4.1.1", - "istanbul-lib-coverage": "2.0.3", - "make-dir": "1.3.0", - "rimraf": "2.6.3", - "source-map": "0.6.1" + "debug": "^4.1.1", + "istanbul-lib-coverage": "^2.0.3", + "make-dir": "^1.3.0", + "rimraf": "^2.6.2", + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -2376,7 +5192,7 @@ "bundled": true, "dev": true, "requires": { - "handlebars": "4.1.0" + "handlebars": "^4.1.0" } }, "json-parse-better-errors": { @@ -2389,7 +5205,7 @@ "bundled": true, "dev": true, "requires": { - "invert-kv": "2.0.0" + "invert-kv": "^2.0.0" } }, "load-json-file": { @@ -2397,10 +5213,10 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "parse-json": "4.0.0", - "pify": "3.0.0", - "strip-bom": "3.0.0" + "graceful-fs": "^4.1.2", + "parse-json": "^4.0.0", + "pify": "^3.0.0", + "strip-bom": "^3.0.0" } }, "locate-path": { @@ -2408,8 +5224,8 @@ "bundled": true, "dev": true, "requires": { - "p-locate": "3.0.0", - "path-exists": "3.0.0" + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" } }, "lodash": { @@ -2427,8 +5243,8 @@ "bundled": true, "dev": true, "requires": { - "pseudomap": "1.0.2", - "yallist": "2.1.2" + "pseudomap": "^1.0.2", + "yallist": "^2.1.2" } }, "make-dir": { @@ -2436,7 +5252,7 @@ "bundled": true, "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "map-age-cleaner": { @@ -2444,7 +5260,7 @@ "bundled": true, "dev": true, "requires": { - "p-defer": "1.0.0" + "p-defer": "^1.0.0" } }, "mem": { @@ -2452,9 +5268,9 @@ "bundled": true, "dev": true, "requires": { - "map-age-cleaner": "0.1.3", - "mimic-fn": "1.2.0", - "p-is-promise": "2.0.0" + "map-age-cleaner": "^0.1.1", + "mimic-fn": "^1.0.0", + "p-is-promise": "^2.0.0" } }, "merge-source-map": { @@ -2462,7 +5278,7 @@ "bundled": true, "dev": true, "requires": { - "source-map": "0.6.1" + "source-map": "^0.6.1" }, "dependencies": { "source-map": { @@ -2482,7 +5298,7 @@ "bundled": true, "dev": true, "requires": { - "brace-expansion": "1.1.11" + "brace-expansion": "^1.1.7" } }, "minimist": { @@ -2520,10 +5336,10 @@ "bundled": true, "dev": true, "requires": { - "hosted-git-info": "2.7.1", - "resolve": "1.10.0", - "semver": "5.6.0", - "validate-npm-package-license": "3.0.4" + "hosted-git-info": "^2.1.4", + "resolve": "^1.10.0", + "semver": "2 || 3 || 4 || 5", + "validate-npm-package-license": "^3.0.1" } }, "npm-run-path": { @@ -2531,7 +5347,7 @@ "bundled": true, "dev": true, "requires": { - "path-key": "2.0.1" + "path-key": "^2.0.0" } }, "number-is-nan": { @@ -2544,7 +5360,7 @@ "bundled": true, "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "optimist": { @@ -2552,8 +5368,8 @@ "bundled": true, "dev": true, "requires": { - "minimist": "0.0.10", - "wordwrap": "0.0.3" + "minimist": "~0.0.1", + "wordwrap": "~0.0.2" } }, "os-homedir": { @@ -2566,9 +5382,9 @@ "bundled": true, "dev": true, "requires": { - "execa": "1.0.0", - "lcid": "2.0.0", - "mem": "4.1.0" + "execa": "^1.0.0", + "lcid": "^2.0.0", + "mem": "^4.0.0" } }, "p-defer": { @@ -2591,7 +5407,7 @@ "bundled": true, "dev": true, "requires": { - "p-try": "2.0.0" + "p-try": "^2.0.0" } }, "p-locate": { @@ -2599,7 +5415,7 @@ "bundled": true, "dev": true, "requires": { - "p-limit": "2.1.0" + "p-limit": "^2.0.0" } }, "p-try": { @@ -2612,10 +5428,10 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "hasha": "3.0.0", - "lodash.flattendeep": "4.4.0", - "release-zalgo": "1.0.0" + "graceful-fs": "^4.1.15", + "hasha": "^3.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" } }, "parse-json": { @@ -2623,8 +5439,8 @@ "bundled": true, "dev": true, "requires": { - "error-ex": "1.3.2", - "json-parse-better-errors": "1.0.2" + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" } }, "path-exists": { @@ -2652,7 +5468,7 @@ "bundled": true, "dev": true, "requires": { - "pify": "3.0.0" + "pify": "^3.0.0" } }, "pify": { @@ -2665,7 +5481,7 @@ "bundled": true, "dev": true, "requires": { - "find-up": "3.0.0" + "find-up": "^3.0.0" } }, "pseudomap": { @@ -2678,8 +5494,8 @@ "bundled": true, "dev": true, "requires": { - "end-of-stream": "1.4.1", - "once": "1.4.0" + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "read-pkg": { @@ -2687,9 +5503,9 @@ "bundled": true, "dev": true, "requires": { - "load-json-file": "4.0.0", - "normalize-package-data": "2.5.0", - "path-type": "3.0.0" + "load-json-file": "^4.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^3.0.0" } }, "read-pkg-up": { @@ -2697,8 +5513,8 @@ "bundled": true, "dev": true, "requires": { - "find-up": "3.0.0", - "read-pkg": "3.0.0" + "find-up": "^3.0.0", + "read-pkg": "^3.0.0" } }, "release-zalgo": { @@ -2706,7 +5522,7 @@ "bundled": true, "dev": true, "requires": { - "es6-error": "4.1.1" + "es6-error": "^4.0.1" } }, "require-directory": { @@ -2724,7 +5540,7 @@ "bundled": true, "dev": true, "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.6" } }, "resolve-from": { @@ -2737,7 +5553,7 @@ "bundled": true, "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.1.3" } }, "safe-buffer": { @@ -2760,7 +5576,7 @@ "bundled": true, "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -2778,12 +5594,12 @@ "bundled": true, "dev": true, "requires": { - "foreground-child": "1.5.6", - "mkdirp": "0.5.1", - "os-homedir": "1.0.2", - "rimraf": "2.6.3", - "signal-exit": "3.0.2", - "which": "1.3.1" + "foreground-child": "^1.5.6", + "mkdirp": "^0.5.0", + "os-homedir": "^1.0.1", + "rimraf": "^2.6.2", + "signal-exit": "^3.0.2", + "which": "^1.3.0" } }, "spdx-correct": { @@ -2791,8 +5607,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.3" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -2805,8 +5621,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.3" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -2819,8 +5635,8 @@ "bundled": true, "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -2828,7 +5644,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -2846,10 +5662,10 @@ "bundled": true, "dev": true, "requires": { - "arrify": "1.0.1", - "minimatch": "3.0.4", - "read-pkg-up": "4.0.0", - "require-main-filename": "1.0.1" + "arrify": "^1.0.1", + "minimatch": "^3.0.4", + "read-pkg-up": "^4.0.0", + "require-main-filename": "^1.0.1" } }, "uglify-js": { @@ -2858,8 +5674,8 @@ "dev": true, "optional": true, "requires": { - "commander": "2.17.1", - "source-map": "0.6.1" + "commander": "~2.17.1", + "source-map": "~0.6.1" }, "dependencies": { "source-map": { @@ -2880,8 +5696,8 @@ "bundled": true, "dev": true, "requires": { - "spdx-correct": "3.1.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "which": { @@ -2889,7 +5705,7 @@ "bundled": true, "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" } }, "which-module": { @@ -2907,8 +5723,8 @@ "bundled": true, "dev": true, "requires": { - "string-width": "1.0.2", - "strip-ansi": "3.0.1" + "string-width": "^1.0.1", + "strip-ansi": "^3.0.1" }, "dependencies": { "ansi-regex": { @@ -2921,7 +5737,7 @@ "bundled": true, "dev": true, "requires": { - "number-is-nan": "1.0.1" + "number-is-nan": "^1.0.0" } }, "string-width": { @@ -2929,9 +5745,9 @@ "bundled": true, "dev": true, "requires": { - "code-point-at": "1.1.0", - "is-fullwidth-code-point": "1.0.0", - "strip-ansi": "3.0.1" + "code-point-at": "^1.0.0", + "is-fullwidth-code-point": "^1.0.0", + "strip-ansi": "^3.0.0" } }, "strip-ansi": { @@ -2939,7 +5755,7 @@ "bundled": true, "dev": true, "requires": { - "ansi-regex": "2.1.1" + "ansi-regex": "^2.0.0" } } } @@ -2954,9 +5770,9 @@ "bundled": true, "dev": true, "requires": { - "graceful-fs": "4.1.15", - "imurmurhash": "0.1.4", - "signal-exit": "3.0.2" + "graceful-fs": "^4.1.11", + "imurmurhash": "^0.1.4", + "signal-exit": "^3.0.2" } }, "y18n": { @@ -2974,18 +5790,18 @@ "bundled": true, "dev": true, "requires": { - "cliui": "4.1.0", - "decamelize": "1.2.0", - "find-up": "3.0.0", - "get-caller-file": "1.0.3", - "os-locale": "3.1.0", - "require-directory": "2.1.1", - "require-main-filename": "1.0.1", - "set-blocking": "2.0.0", - "string-width": "2.1.1", - "which-module": "2.0.0", - "y18n": "4.0.0", - "yargs-parser": "11.1.1" + "cliui": "^4.0.0", + "decamelize": "^1.2.0", + "find-up": "^3.0.0", + "get-caller-file": "^1.0.1", + "os-locale": "^3.0.0", + "require-directory": "^2.1.1", + "require-main-filename": "^1.0.1", + "set-blocking": "^2.0.0", + "string-width": "^2.0.0", + "which-module": "^2.0.0", + "y18n": "^3.2.1 || ^4.0.0", + "yargs-parser": "^11.1.1" } }, "yargs-parser": { @@ -2993,8 +5809,8 @@ "bundled": true, "dev": true, "requires": { - "camelcase": "5.0.0", - "decamelize": "1.2.0" + "camelcase": "^5.0.0", + "decamelize": "^1.2.0" } } } @@ -3005,22 +5821,50 @@ "integrity": "sha1-IQmtx5ZYh8/AXLvUQsrIv7s2CGM=", "dev": true }, + "object-is": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/object-is/-/object-is-1.0.1.tgz", + "integrity": "sha1-CqYOyZiaCz7Xlc9NBvYs8a1lObY=", + "dev": true + }, "object-keys": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/object-keys/-/object-keys-1.1.0.tgz", "integrity": "sha512-6OO5X1+2tYkNyNEx6TsCxEqFfRWaqx6EtMiSbGrw8Ob8v9Ne+Hl8rBAgLBZn5wjEz3s/s6U1WXFUFOcxxAwUpg==", "dev": true }, + "object.assign": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/object.assign/-/object.assign-4.1.0.tgz", + "integrity": "sha512-exHJeq6kBKj58mqGyTQ9DFvrZC/eR6OwxzoM9YRoGBqrXYonaFyGiFMuc9VZrXf7DarreEwMpurG3dd+CNyW5w==", + "dev": true, + "requires": { + "define-properties": "^1.1.2", + "function-bind": "^1.1.1", + "has-symbols": "^1.0.0", + "object-keys": "^1.0.11" + } + }, "object.fromentries": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/object.fromentries/-/object.fromentries-2.0.0.tgz", "integrity": "sha512-9iLiI6H083uiqUuvzyY6qrlmc/Gz8hLQFOcb/Ri/0xXFkSNS3ctV+CbE6yM2+AnkYfOB3dGjdzC0wrMLIhQICA==", "dev": true, "requires": { - "define-properties": "1.1.3", - "es-abstract": "1.13.0", - "function-bind": "1.1.1", - "has": "1.0.3" + "define-properties": "^1.1.2", + "es-abstract": "^1.11.0", + "function-bind": "^1.1.1", + "has": "^1.0.1" + } + }, + "observable-to-promise": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/observable-to-promise/-/observable-to-promise-1.0.0.tgz", + "integrity": "sha512-cqnGUrNsE6vdVDTPAX9/WeVzwy/z37vdxupdQXU8vgTXRFH72KCZiZga8aca2ulRPIeem8W3vW9rQHBwfIl2WA==", + "dev": true, + "requires": { + "is-observable": "^2.0.0", + "symbol-observable": "^1.0.4" } }, "once": { @@ -3029,7 +5873,7 @@ "integrity": "sha1-WDsap3WWHUsROsF9nFC6753Xa9E=", "dev": true, "requires": { - "wrappy": "1.0.2" + "wrappy": "1" } }, "onetime": { @@ -3038,7 +5882,7 @@ "integrity": "sha1-BnQoIw/WdEOyeUsiu6UotoZ5YtQ=", "dev": true, "requires": { - "mimic-fn": "1.2.0" + "mimic-fn": "^1.0.0" } }, "optionator": { @@ -3047,12 +5891,43 @@ "integrity": "sha1-NkxeQJ0/TWMB1sC0wFu6UBgK62Q=", "dev": true, "requires": { - "deep-is": "0.1.3", - "fast-levenshtein": "2.0.6", - "levn": "0.3.0", - "prelude-ls": "1.1.2", - "type-check": "0.3.2", - "wordwrap": "1.0.0" + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.4", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "wordwrap": "~1.0.0" + } + }, + "ora": { + "version": "3.4.0", + "resolved": "https://registry.npmjs.org/ora/-/ora-3.4.0.tgz", + "integrity": "sha512-eNwHudNbO1folBP3JsZ19v9azXWtQZjICdr3Q0TDPIaeBQ3mXLrh54wM+er0+hSp+dWKf+Z8KM58CYzEyIYxYg==", + "dev": true, + "requires": { + "chalk": "^2.4.2", + "cli-cursor": "^2.1.0", + "cli-spinners": "^2.0.0", + "log-symbols": "^2.2.0", + "strip-ansi": "^5.2.0", + "wcwidth": "^1.0.1" + }, + "dependencies": { + "ansi-regex": { + "version": "4.1.0", + "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-4.1.0.tgz", + "integrity": "sha512-1apePfXM1UOSqw0o9IiFAovVz9M5S1Dg+4TrDwfMewQ6p/rmMueb7tWZjQ1rx4Loy1ArBggoqGpfqqdI4rondg==", + "dev": true + }, + "strip-ansi": { + "version": "5.2.0", + "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-5.2.0.tgz", + "integrity": "sha512-DuRs1gKbBqsMKIZlrffwlug8MHkcnpjs5VPmL1PAh+mA30U0DTotfDZ0d2UUsXpPmPmMMJ6W773MaA3J+lbiWA==", + "dev": true, + "requires": { + "ansi-regex": "^4.1.0" + } + } } }, "os-tmpdir": { @@ -3061,13 +5936,25 @@ "integrity": "sha1-u+Z0BseaqFxc/sdm/lc0VV36EnQ=", "dev": true }, + "p-cancelable": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/p-cancelable/-/p-cancelable-1.1.0.tgz", + "integrity": "sha512-s73XxOZ4zpt1edZYZzvhqFa6uvQc1vwUa0K0BdtIZgQMAJj9IbebH+JkgKZc9h+B05PKHLOTl4ajG1BmNrVZlw==", + "dev": true + }, + "p-finally": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/p-finally/-/p-finally-1.0.0.tgz", + "integrity": "sha1-P7z7FbiZpEEjs0ttzBi3JDNqLK4=", + "dev": true + }, "p-limit": { "version": "1.3.0", "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-1.3.0.tgz", "integrity": "sha512-vvcXsLAJ9Dr5rQOPk7toZQZJApBl2K4J6dANSsEuh6QI41JYcsS/qhTGa9ErIUUgK3WNQoJYvylxvjqmiqEA9Q==", "dev": true, "requires": { - "p-try": "1.0.0" + "p-try": "^1.0.0" } }, "p-locate": { @@ -3076,22 +5963,60 @@ "integrity": "sha1-IKAQOyIqcMj9OcwuWAaA893l7EM=", "dev": true, "requires": { - "p-limit": "1.3.0" + "p-limit": "^1.1.0" } }, + "p-map": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/p-map/-/p-map-2.1.0.tgz", + "integrity": "sha512-y3b8Kpd8OAN444hxfBbFfj1FY/RjtTd8tzYwhUqNYXx0fXx2iX4maP4Qr6qhIKbQXI02wTLAda4fYUbDagTUFw==", + "dev": true + }, "p-try": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/p-try/-/p-try-1.0.0.tgz", "integrity": "sha1-y8ec26+P1CKOE/Yh8rGiN8GyB7M=", "dev": true }, + "package-hash": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/package-hash/-/package-hash-4.0.0.tgz", + "integrity": "sha512-whdkPIooSu/bASggZ96BWVvZTRMOFxnyUG5PnTSGKoJE2gd5mbVNmR2Nj20QFzxYYgAXpoqC+AiXzl+UMRh7zQ==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "hasha": "^5.0.0", + "lodash.flattendeep": "^4.4.0", + "release-zalgo": "^1.0.0" + } + }, + "package-json": { + "version": "6.5.0", + "resolved": "https://registry.npmjs.org/package-json/-/package-json-6.5.0.tgz", + "integrity": "sha512-k3bdm2n25tkyxcjSKzB5x8kfVxlMdgsbPr0GkZcwHsLpba6cBjqCt1KlcChKEvxHIcTB1FVMuwoijZ26xex5MQ==", + "dev": true, + "requires": { + "got": "^9.6.0", + "registry-auth-token": "^4.0.0", + "registry-url": "^5.0.0", + "semver": "^6.2.0" + }, + "dependencies": { + "semver": { + "version": "6.3.0", + "resolved": "https://registry.npmjs.org/semver/-/semver-6.3.0.tgz", + "integrity": "sha512-b39TBaTSfV6yBrapU89p5fKekE2m/NwnDocOVruQFS1/veMgdzuPcnOM34M6CwxW8jH/lxEa5rBoDeUwu5HHTw==", + "dev": true + } + } + }, "parent-module": { "version": "1.0.0", "resolved": "https://registry.npmjs.org/parent-module/-/parent-module-1.0.0.tgz", "integrity": "sha512-8Mf5juOMmiE4FcmzYc4IaiS9L3+9paz2KOiXzkRviCP6aDmN49Hz6EMWz0lGNp9pX80GvvAuLADtyGfW/Em3TA==", "dev": true, "requires": { - "callsites": "3.0.0" + "callsites": "^3.0.0" } }, "parse-json": { @@ -3100,9 +6025,15 @@ "integrity": "sha1-9ID0BDTvgHQfhGkJn43qGPVaTck=", "dev": true, "requires": { - "error-ex": "1.3.2" + "error-ex": "^1.2.0" } }, + "parse-ms": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/parse-ms/-/parse-ms-2.1.0.tgz", + "integrity": "sha512-kHt7kzLoS9VBZfUsiKjv43mr91ea+U05EyKkEtqp7vNbHxmaVuEqN7XxeEVnGrMtYOAxGrDElSi96K7EgO1zCA==", + "dev": true + }, "path-exists": { "version": "3.0.0", "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-3.0.0.tgz", @@ -3139,22 +6070,133 @@ "integrity": "sha1-8BLMuEFbcJb8LaoQVMPXI4lZTHM=", "dev": true, "requires": { - "pify": "2.3.0" + "pify": "^2.0.0" + } + }, + "picomatch": { + "version": "2.0.7", + "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.0.7.tgz", + "integrity": "sha512-oLHIdio3tZ0qH76NybpeneBhYVj0QFTfXEFTc/B3zKQspYfYYkWYgFsmzo+4kvId/bQRcNkVeguI3y+CD22BtA==", + "dev": true + }, + "pify": { + "version": "2.3.0", + "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", + "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", + "dev": true + }, + "pinkie": { + "version": "2.0.4", + "resolved": "https://registry.npmjs.org/pinkie/-/pinkie-2.0.4.tgz", + "integrity": "sha1-clVrgM+g1IqXToDnckjoDtT3+HA=", + "dev": true + }, + "pinkie-promise": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/pinkie-promise/-/pinkie-promise-2.0.1.tgz", + "integrity": "sha1-ITXW36ejWMBprJsXh3YogihFD/o=", + "dev": true, + "requires": { + "pinkie": "^2.0.0" + } + }, + "pkg-conf": { + "version": "3.1.0", + "resolved": "https://registry.npmjs.org/pkg-conf/-/pkg-conf-3.1.0.tgz", + "integrity": "sha512-m0OTbR/5VPNPqO1ph6Fqbj7Hv6QU7gR/tQW40ZqrL1rjgCU85W6C1bJn0BItuJqnR98PWzw7Z8hHeChD1WrgdQ==", + "dev": true, + "requires": { + "find-up": "^3.0.0", + "load-json-file": "^5.2.0" + }, + "dependencies": { + "find-up": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/find-up/-/find-up-3.0.0.tgz", + "integrity": "sha512-1yD6RmLI1XBfxugvORwlck6f75tYL+iR0jqwsOrOxMZyGYqUuDhJ0l4AXdO1iX/FTs9cBAMEk1gWSEx1kSbylg==", + "dev": true, + "requires": { + "locate-path": "^3.0.0" + } + }, + "load-json-file": { + "version": "5.3.0", + "resolved": "https://registry.npmjs.org/load-json-file/-/load-json-file-5.3.0.tgz", + "integrity": "sha512-cJGP40Jc/VXUsp8/OrnyKyTZ1y6v/dphm3bioS+RrKXjK2BB6wHUd6JptZEFDGgGahMT+InnZO5i1Ei9mpC8Bw==", + "dev": true, + "requires": { + "graceful-fs": "^4.1.15", + "parse-json": "^4.0.0", + "pify": "^4.0.1", + "strip-bom": "^3.0.0", + "type-fest": "^0.3.0" + } + }, + "locate-path": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-3.0.0.tgz", + "integrity": "sha512-7AO748wWnIhNqAuaty2ZWHkQHRSNfPVIsPIfwEOWO22AmaoVrWavlOcMR5nzTLNYvp36X220/maaRsrec1G65A==", + "dev": true, + "requires": { + "p-locate": "^3.0.0", + "path-exists": "^3.0.0" + } + }, + "p-limit": { + "version": "2.2.1", + "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-2.2.1.tgz", + "integrity": "sha512-85Tk+90UCVWvbDavCLKPOLC9vvY8OwEX/RtKF+/1OADJMVlFfEHOiMTPVyxg7mk/dKa+ipdHm0OUkTvCpMTuwg==", + "dev": true, + "requires": { + "p-try": "^2.0.0" + } + }, + "p-locate": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-3.0.0.tgz", + "integrity": "sha512-x+12w/To+4GFfgJhBEpiDcLozRJGegY+Ei7/z0tSLkMmxGZNybVMSfWj9aJn8Z5Fc7dBUNJOOVgPv2H7IwulSQ==", + "dev": true, + "requires": { + "p-limit": "^2.0.0" + } + }, + "p-try": { + "version": "2.2.0", + "resolved": "https://registry.npmjs.org/p-try/-/p-try-2.2.0.tgz", + "integrity": "sha512-R4nPAVTAU0B9D35/Gk3uJf/7XYbQcyohSKdvAxIRSNghFl4e71hVoGnBNQz9cWaXxO2I10KTC+3jMdvvoKw6dQ==", + "dev": true + }, + "parse-json": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/parse-json/-/parse-json-4.0.0.tgz", + "integrity": "sha1-vjX1Qlvh9/bHRxhPmKeIy5lHfuA=", + "dev": true, + "requires": { + "error-ex": "^1.3.1", + "json-parse-better-errors": "^1.0.1" + } + }, + "pify": { + "version": "4.0.1", + "resolved": "https://registry.npmjs.org/pify/-/pify-4.0.1.tgz", + "integrity": "sha512-uB80kBFb/tfd68bVleG9T5GGsGPjJrLAUpR5PZIrhBnIaRTQRjqdJSsIKkOP6OAIFbj7GOrcudc5pNjZ+geV2g==", + "dev": true + }, + "type-fest": { + "version": "0.3.1", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.3.1.tgz", + "integrity": "sha512-cUGJnCdr4STbePCgqNFbpVNCepa+kAVohJs1sLhxzdH+gnEoOd8VhbYa7pD3zZYGiURWM2xzEII3fQcRizDkYQ==", + "dev": true + } } }, - "pify": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/pify/-/pify-2.3.0.tgz", - "integrity": "sha1-7RQaasBDqEnqWISY59yosVMw6Qw=", - "dev": true - }, "pkg-dir": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/pkg-dir/-/pkg-dir-2.0.0.tgz", "integrity": "sha1-9tXREJ4Z1j7fQo4L1X4Sd3YVM0s=", "dev": true, "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" } }, "pkg-up": { @@ -3163,7 +6205,16 @@ "integrity": "sha1-yBmscoBZpGHKscOImivjxJoATX8=", "dev": true, "requires": { - "find-up": "2.1.0" + "find-up": "^2.1.0" + } + }, + "plur": { + "version": "3.1.1", + "resolved": "https://registry.npmjs.org/plur/-/plur-3.1.1.tgz", + "integrity": "sha512-t1Ax8KUvV3FFII8ltczPn2tJdjqbd1sIzu6t4JL7nQ3EyeL/lTrj5PWKb06ic5/6XYDr65rQ4uzQEGN70/6X5w==", + "dev": true, + "requires": { + "irregular-plurals": "^2.0.0" } }, "prelude-ls": { @@ -3172,12 +6223,27 @@ "integrity": "sha1-IZMqVJ9eUv/ZqCf1cOBL5iqX2lQ=", "dev": true }, + "prepend-http": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/prepend-http/-/prepend-http-2.0.0.tgz", + "integrity": "sha1-6SQ0v6XqjBn0HN/UAddBo8gZ2Jc=", + "dev": true + }, "prettier": { "version": "1.11.1", "resolved": "https://registry.npmjs.org/prettier/-/prettier-1.11.1.tgz", "integrity": "sha512-T/KD65Ot0PB97xTrG8afQ46x3oiVhnfGjGESSI9NWYcG92+OUPZKkwHqGWXH2t9jK1crnQjubECW0FuOth+hxw==", "dev": true }, + "pretty-ms": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/pretty-ms/-/pretty-ms-5.0.0.tgz", + "integrity": "sha512-94VRYjL9k33RzfKiGokPBPpsmloBYSf5Ri+Pq19zlsEcUKFob+admeXr5eFDRuPjFmEOcjJvPGdillYOJyvZ7Q==", + "dev": true, + "requires": { + "parse-ms": "^2.1.0" + } + }, "progress": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/progress/-/progress-2.0.3.tgz", @@ -3190,9 +6256,25 @@ "integrity": "sha512-8QQikdH7//R2vurIJSutZ1smHYTcLpRWEOlHnzcWHmBYrOGUysKwSsrC89BCiFj3CbrfJ/nXFdJepOVrY1GCHQ==", "dev": true, "requires": { - "loose-envify": "1.4.0", - "object-assign": "4.1.1", - "react-is": "16.8.3" + "loose-envify": "^1.4.0", + "object-assign": "^4.1.1", + "react-is": "^16.8.1" + } + }, + "pseudomap": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/pseudomap/-/pseudomap-1.0.2.tgz", + "integrity": "sha1-8FKijacOYYkX7wqKw0wa5aaChrM=", + "dev": true + }, + "pump": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/pump/-/pump-3.0.0.tgz", + "integrity": "sha512-LwZy+p3SFs1Pytd/jYct4wpv49HiYCqd9Rlc5ZVdk0V+8Yzv6jR5Blk3TRmPL1ft69TxP0IMZGJ+WPFU2BFhww==", + "dev": true, + "requires": { + "end-of-stream": "^1.1.0", + "once": "^1.3.1" } }, "punycode": { @@ -3201,6 +6283,12 @@ "integrity": "sha512-XRsRjdf+j5ml+y/6GKHPZbrF/8p2Yga0JPtdqTIY2Xe5ohJPD9saDJJLPvp9+NSBprVvevdXZybnj2cv8OEd0A==", "dev": true }, + "quick-lru": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/quick-lru/-/quick-lru-1.1.0.tgz", + "integrity": "sha1-Q2CxfGETatOAeDl/8RQW4Ybc+7g=", + "dev": true + }, "ramda": { "version": "0.25.0", "resolved": "https://registry.npmjs.org/ramda/-/ramda-0.25.0.tgz", @@ -3212,10 +6300,10 @@ "resolved": "https://registry.npmjs.org/rc/-/rc-1.2.8.tgz", "integrity": "sha512-y3bGgqKj3QBdxLbLkomlohkvsA8gdAiUQlSBJnBhfn+BPxg4bc62d8TcBW15wavDfgexCgccckhcZvywyQYPOw==", "requires": { - "deep-extend": "0.6.0", - "ini": "1.3.5", - "minimist": "1.2.0", - "strip-json-comments": "2.0.1" + "deep-extend": "^0.6.0", + "ini": "~1.3.0", + "minimist": "^1.2.0", + "strip-json-comments": "~2.0.1" }, "dependencies": { "minimist": { @@ -3237,9 +6325,9 @@ "integrity": "sha1-jvHAYjxqbbDcZxPEv6xGMysjaPg=", "dev": true, "requires": { - "load-json-file": "2.0.0", - "normalize-package-data": "2.5.0", - "path-type": "2.0.0" + "load-json-file": "^2.0.0", + "normalize-package-data": "^2.3.2", + "path-type": "^2.0.0" } }, "read-pkg-up": { @@ -3248,8 +6336,50 @@ "integrity": "sha1-a3KoBImE4MQeeVEP1en6mbO1Sb4=", "dev": true, "requires": { - "find-up": "2.1.0", - "read-pkg": "2.0.0" + "find-up": "^2.0.0", + "read-pkg": "^2.0.0" + } + }, + "readdirp": { + "version": "3.1.3", + "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.1.3.tgz", + "integrity": "sha512-ZOsfTGkjO2kqeR5Mzr5RYDbTGYneSkdNKX2fOX2P5jF7vMrd/GNnIAUtDldeHHumHUCQ3V05YfWUdxMPAsRu9Q==", + "dev": true, + "requires": { + "picomatch": "^2.0.4" + } + }, + "redent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/redent/-/redent-2.0.0.tgz", + "integrity": "sha1-wbIAe0LVfrE4kHmzyDM2OdXhzKo=", + "dev": true, + "requires": { + "indent-string": "^3.0.0", + "strip-indent": "^2.0.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + } + } + }, + "regenerate": { + "version": "1.4.0", + "resolved": "https://registry.npmjs.org/regenerate/-/regenerate-1.4.0.tgz", + "integrity": "sha512-1G6jJVDWrt0rK99kBjvEtziZNCICAuvIPkSiUFIQxVP06RCVpq3dmDo2oi6ABpYaDYaTRr67BEhL8r1wgEZZKg==", + "dev": true + }, + "regenerate-unicode-properties": { + "version": "8.1.0", + "resolved": "https://registry.npmjs.org/regenerate-unicode-properties/-/regenerate-unicode-properties-8.1.0.tgz", + "integrity": "sha512-LGZzkgtLY79GeXLm8Dp0BVLdQlWICzBnJz/ipWUgo59qBaZ+BHtq51P2q1uVZlppMuUAT37SDk39qUbjTWB7bA==", + "dev": true, + "requires": { + "regenerate": "^1.4.0" } }, "regenerator-runtime": { @@ -3258,18 +6388,98 @@ "integrity": "sha512-MguG95oij0fC3QV3URf4V2SDYGJhJnJGqvIIgdECeODCT98wSWDAJ94SSuVpYQUoTcGUIL6L4yNB7j1DFFHSBg==", "dev": true }, + "regexp.prototype.flags": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/regexp.prototype.flags/-/regexp.prototype.flags-1.2.0.tgz", + "integrity": "sha512-ztaw4M1VqgMwl9HlPpOuiYgItcHlunW0He2fE6eNfT6E/CF2FtYi9ofOYe4mKntstYk0Fyh/rDRBdS3AnxjlrA==", + "dev": true, + "requires": { + "define-properties": "^1.1.2" + } + }, "regexpp": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/regexpp/-/regexpp-2.0.1.tgz", "integrity": "sha512-lv0M6+TkDVniA3aD1Eg0DVpfU/booSu7Eev3TDO/mZKHBfVjgCGTV4t4buppESEYDtkArYFOxTJWv6S5C+iaNw==", "dev": true }, + "regexpu-core": { + "version": "4.6.0", + "resolved": "https://registry.npmjs.org/regexpu-core/-/regexpu-core-4.6.0.tgz", + "integrity": "sha512-YlVaefl8P5BnFYOITTNzDvan1ulLOiXJzCNZxduTIosN17b87h3bvG9yHMoHaRuo88H4mQ06Aodj5VtYGGGiTg==", + "dev": true, + "requires": { + "regenerate": "^1.4.0", + "regenerate-unicode-properties": "^8.1.0", + "regjsgen": "^0.5.0", + "regjsparser": "^0.6.0", + "unicode-match-property-ecmascript": "^1.0.4", + "unicode-match-property-value-ecmascript": "^1.1.0" + } + }, + "registry-auth-token": { + "version": "4.0.0", + "resolved": "https://registry.npmjs.org/registry-auth-token/-/registry-auth-token-4.0.0.tgz", + "integrity": "sha512-lpQkHxd9UL6tb3k/aHAVfnVtn+Bcs9ob5InuFLLEDqSqeq+AljB8GZW9xY0x7F+xYwEcjKe07nyoxzEYz6yvkw==", + "dev": true, + "requires": { + "rc": "^1.2.8", + "safe-buffer": "^5.0.1" + } + }, + "registry-url": { + "version": "5.1.0", + "resolved": "https://registry.npmjs.org/registry-url/-/registry-url-5.1.0.tgz", + "integrity": "sha512-8acYXXTI0AkQv6RAOjE3vOaIXZkT9wo4LOFbBKYQEEnnMNBpKqdUrI6S4NT0KPIo/WVvJ5tE/X5LF/TQUf0ekw==", + "dev": true, + "requires": { + "rc": "^1.2.8" + } + }, + "regjsgen": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/regjsgen/-/regjsgen-0.5.0.tgz", + "integrity": "sha512-RnIrLhrXCX5ow/E5/Mh2O4e/oa1/jW0eaBKTSy3LaCj+M3Bqvm97GWDp2yUtzIs4LEn65zR2yiYGFqb2ApnzDA==", + "dev": true + }, + "regjsparser": { + "version": "0.6.0", + "resolved": "https://registry.npmjs.org/regjsparser/-/regjsparser-0.6.0.tgz", + "integrity": "sha512-RQ7YyokLiQBomUJuUG8iGVvkgOLxwyZM8k6d3q5SAXpg4r5TZJZigKFvC6PpD+qQ98bCDC5YelPeA3EucDoNeQ==", + "dev": true, + "requires": { + "jsesc": "~0.5.0" + }, + "dependencies": { + "jsesc": { + "version": "0.5.0", + "resolved": "https://registry.npmjs.org/jsesc/-/jsesc-0.5.0.tgz", + "integrity": "sha1-597mbjXW/Bb3EP6R1c9p9w8IkR0=", + "dev": true + } + } + }, + "release-zalgo": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/release-zalgo/-/release-zalgo-1.0.0.tgz", + "integrity": "sha1-CXALflB0Mpc5Mw5TXFqQ+2eFFzA=", + "dev": true, + "requires": { + "es6-error": "^4.0.1" + } + }, "req-all": { "version": "0.1.0", "resolved": "https://registry.npmjs.org/req-all/-/req-all-0.1.0.tgz", "integrity": "sha1-EwBR4qzligLqy/ydRIV3pzapJzo=", "dev": true }, + "require-precompiled": { + "version": "0.1.0", + "resolved": "https://registry.npmjs.org/require-precompiled/-/require-precompiled-0.1.0.tgz", + "integrity": "sha1-WhtS63Dr7UPrmC6XTIWrWVceVvo=", + "dev": true + }, "requireindex": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/requireindex/-/requireindex-1.2.0.tgz", @@ -3282,7 +6492,24 @@ "integrity": "sha512-3sUr9aq5OfSg2S9pNtPA9hL1FVEAjvfOC4leW0SNf/mpnaakz2a9femSd6LqAww2RaFctwyf1lCqnTHuF1rxDg==", "dev": true, "requires": { - "path-parse": "1.0.6" + "path-parse": "^1.0.6" + } + }, + "resolve-cwd": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/resolve-cwd/-/resolve-cwd-3.0.0.tgz", + "integrity": "sha512-OrZaX2Mb+rJCpH/6CpSqt9xFVpN++x01XnN2ie9g6P5/3xelLAkXWVADpdz1IHD/KFfEXyE6V0U01OQ3UO2rEg==", + "dev": true, + "requires": { + "resolve-from": "^5.0.0" + }, + "dependencies": { + "resolve-from": { + "version": "5.0.0", + "resolved": "https://registry.npmjs.org/resolve-from/-/resolve-from-5.0.0.tgz", + "integrity": "sha512-qYg9KP24dD5qka9J47d0aVky0N+b4fTU89LN9iDnjB5waksiC49rvMB0PrUJQGoTmH50XPiqOvAjDfaijGxYZw==", + "dev": true + } } }, "resolve-from": { @@ -3291,14 +6518,23 @@ "integrity": "sha512-pb/MYmXstAkysRFx8piNI1tGFNQIFA3vkE3Gq4EuA1dF6gHp/+vgZqsCGJapvy8N3Q+4o7FwvquPJcnZ7RYy4g==", "dev": true }, + "responselike": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/responselike/-/responselike-1.0.2.tgz", + "integrity": "sha1-kYcg7ztjHFZCvgaPFa3lpG9Loec=", + "dev": true, + "requires": { + "lowercase-keys": "^1.0.0" + } + }, "restore-cursor": { "version": "2.0.0", "resolved": "https://registry.npmjs.org/restore-cursor/-/restore-cursor-2.0.0.tgz", "integrity": "sha1-n37ih/gv0ybU/RYpI9YhKe7g368=", "dev": true, "requires": { - "onetime": "2.0.1", - "signal-exit": "3.0.2" + "onetime": "^2.0.0", + "signal-exit": "^3.0.2" } }, "ret": { @@ -3307,13 +6543,19 @@ "integrity": "sha512-TTlYpa+OL+vMMNG24xSlQGEJ3B/RzEfUlLct7b5G/ytav+wPrplCpVMFuwzXbkecJrb6IYo1iFb0S9v37754mg==", "dev": true }, + "reusify": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/reusify/-/reusify-1.0.4.tgz", + "integrity": "sha512-U9nH88a3fc/ekCF1l0/UP1IosiuIjyTh7hBvXVMHYgVcfGvt897Xguj2UOLDeI5BG2m7/uwyaLVT6fbtCwTyzw==", + "dev": true + }, "rimraf": { "version": "2.6.3", "resolved": "https://registry.npmjs.org/rimraf/-/rimraf-2.6.3.tgz", "integrity": "sha512-mwqeW5XsA2qAejG46gYdENaxXjx9onRNCfn7L0duuP4hCuTIi/QO7PDK07KJfp1d+izWPrzEJDcSqBa0OZQriA==", "dev": true, "requires": { - "glob": "7.1.3" + "glob": "^7.1.3" }, "dependencies": { "glob": { @@ -3322,12 +6564,12 @@ "integrity": "sha512-vcfuiIxogLV4DlGBHIUOwI0IbrJ8HWPc4MU7HzviGeNho/UJDfi6B5p3sHeWIQ0KGIU0Jpxi5ZHxemQfLkkAwQ==", "dev": true, "requires": { - "fs.realpath": "1.0.0", - "inflight": "1.0.6", - "inherits": "2.0.3", - "minimatch": "3.0.4", - "once": "1.4.0", - "path-is-absolute": "1.0.1" + "fs.realpath": "^1.0.0", + "inflight": "^1.0.4", + "inherits": "2", + "minimatch": "^3.0.4", + "once": "^1.3.0", + "path-is-absolute": "^1.0.0" } } } @@ -3338,25 +6580,37 @@ "integrity": "sha1-A3GrSuC91yDUFm19/aZP96RFpsA=", "dev": true, "requires": { - "is-promise": "2.1.0" + "is-promise": "^2.1.0" } }, + "run-parallel": { + "version": "1.1.9", + "resolved": "https://registry.npmjs.org/run-parallel/-/run-parallel-1.1.9.tgz", + "integrity": "sha512-DEqnSRTDw/Tc3FXf49zedI638Z9onwUotBMiUFKmrO2sdFKIbXamXGQ3Axd4qgphxKB4kw/qP1w5kTxnfU1B9Q==", + "dev": true + }, "rxjs": { "version": "6.4.0", "resolved": "https://registry.npmjs.org/rxjs/-/rxjs-6.4.0.tgz", "integrity": "sha512-Z9Yfa11F6B9Sg/BK9MnqnQ+aQYicPLtilXBp2yUtDt2JRCE0h26d33EnfO3ZxoNxG0T92OUucP3Ct7cpfkdFfw==", "dev": true, "requires": { - "tslib": "1.9.3" + "tslib": "^1.9.0" } }, + "safe-buffer": { + "version": "5.1.2", + "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.1.2.tgz", + "integrity": "sha512-Gd2UZBJDkXlY7GbJxfsE8/nvKkUEU1G38c1siN6QP6a9PT9MmHB8GnpscSmMJSoF8LOIrt8ud/wPtojys4G6+g==", + "dev": true + }, "safe-regex": { "version": "1.1.0", "resolved": "https://registry.npmjs.org/safe-regex/-/safe-regex-1.1.0.tgz", "integrity": "sha1-QKNmnzsHfR6UPURinhV91IAjvy4=", "dev": true, "requires": { - "ret": "0.1.15" + "ret": "~0.1.10" } }, "safer-buffer": { @@ -3371,13 +6625,28 @@ "integrity": "sha512-RS9R6R35NYgQn++fkDWaOmqGoj4Ek9gGs+DPxNUZKuwE183xjJroKvyo1IzVFeXvUrvmALy6FWD5xrdJT25gMg==", "dev": true }, + "semver-diff": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/semver-diff/-/semver-diff-2.1.0.tgz", + "integrity": "sha1-S7uEN8jTfksM8aaP1ybsbWRdbTY=", + "dev": true, + "requires": { + "semver": "^5.0.3" + } + }, + "serialize-error": { + "version": "2.1.0", + "resolved": "https://registry.npmjs.org/serialize-error/-/serialize-error-2.1.0.tgz", + "integrity": "sha1-ULZ51WNc34Rme9yOWa9OW4HV9go=", + "dev": true + }, "shebang-command": { "version": "1.2.0", "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-1.2.0.tgz", "integrity": "sha1-RKrGW2lbAzmJaMOfNj/uXer98eo=", "dev": true, "requires": { - "shebang-regex": "1.0.0" + "shebang-regex": "^1.0.0" } }, "shebang-regex": { @@ -3401,7 +6670,7 @@ "formatio": "1.1.1", "lolex": "1.1.0", "samsam": "1.1.2", - "util": "0.10.3" + "util": ">=0.10.3 <1" }, "dependencies": { "formatio": { @@ -3410,7 +6679,7 @@ "integrity": "sha1-XtPM1jZVEJc4NGXZlhmRAOhhYek=", "dev": true, "requires": { - "samsam": "1.1.2" + "samsam": "~1.1" } }, "lolex": { @@ -3456,9 +6725,9 @@ "integrity": "sha512-Qu+VC3EwYLldKa1fCxuuvULvSJOKEgk9pi8dZeCVK7TqBfUNTH4sFkk4joj8afVSfAYgJoSOetjx9QWOJ5mYoQ==", "dev": true, "requires": { - "ansi-styles": "3.2.1", - "astral-regex": "1.0.0", - "is-fullwidth-code-point": "2.0.0" + "ansi-styles": "^3.2.0", + "astral-regex": "^1.0.0", + "is-fullwidth-code-point": "^2.0.0" } }, "source-map": { @@ -3467,14 +6736,32 @@ "integrity": "sha1-igOdLRAh0i0eoUyA2OpGi6LvP8w=", "dev": true }, + "source-map-support": { + "version": "0.5.13", + "resolved": "https://registry.npmjs.org/source-map-support/-/source-map-support-0.5.13.tgz", + "integrity": "sha512-SHSKFHadjVA5oR4PPqhtAVdcBWwRYVd6g6cAXnIbRiIwc2EhPrTuKUBdSLvlEKyIP3GCf89fltvcZiP9MMFA1w==", + "dev": true, + "requires": { + "buffer-from": "^1.0.0", + "source-map": "^0.6.0" + }, + "dependencies": { + "source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "dev": true + } + } + }, "spdx-correct": { "version": "3.1.0", "resolved": "https://registry.npmjs.org/spdx-correct/-/spdx-correct-3.1.0.tgz", "integrity": "sha512-lr2EZCctC2BNR7j7WzJ2FpDznxky1sjfxvvYEyzxNyb6lZXHODmEoJeFu4JupYlkfha1KZpJyoqiJ7pgA1qq8Q==", "dev": true, "requires": { - "spdx-expression-parse": "3.0.0", - "spdx-license-ids": "3.0.3" + "spdx-expression-parse": "^3.0.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-exceptions": { @@ -3489,8 +6776,8 @@ "integrity": "sha512-Yg6D3XpRD4kkOmTpdgbUiEJFKghJH03fiC1OPll5h/0sO6neh2jqRDVHOQ4o/LMea0tgCkbMgea5ip/e+MkWyg==", "dev": true, "requires": { - "spdx-exceptions": "2.2.0", - "spdx-license-ids": "3.0.3" + "spdx-exceptions": "^2.1.0", + "spdx-license-ids": "^3.0.0" } }, "spdx-license-ids": { @@ -3505,14 +6792,20 @@ "integrity": "sha1-BOaSb2YolTVPPdAVIDYzuFcpfiw=", "dev": true }, + "stack-utils": { + "version": "1.0.2", + "resolved": "https://registry.npmjs.org/stack-utils/-/stack-utils-1.0.2.tgz", + "integrity": "sha512-MTX+MeG5U994cazkjd/9KNAapsHnibjMLnfXodlkXw76JEea0UiNzrqidzo1emMwk7w5Qhc9jd4Bn9TBb1MFwA==", + "dev": true + }, "string-width": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/string-width/-/string-width-2.1.1.tgz", "integrity": "sha512-nOqH59deCq9SRHlxq1Aw85Jnt4w6KvLKqWVik6oA9ZklXLNIOlqg4F2yrT1MVaTjAqvVwdfeZ7w7aCvJD7ugkw==", "dev": true, "requires": { - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "4.0.0" + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^4.0.0" } }, "strip-ansi": { @@ -3521,7 +6814,7 @@ "integrity": "sha1-qEeQIusaw2iocTibY1JixQXuNo8=", "dev": true, "requires": { - "ansi-regex": "3.0.0" + "ansi-regex": "^3.0.0" } }, "strip-bom": { @@ -3530,30 +6823,88 @@ "integrity": "sha1-IzTBjpx1n3vdVv3vfprj1YjmjtM=", "dev": true }, + "strip-bom-buf": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-bom-buf/-/strip-bom-buf-2.0.0.tgz", + "integrity": "sha512-gLFNHucd6gzb8jMsl5QmZ3QgnUJmp7qn4uUSHNwEXumAp7YizoGYw19ZUVfuq4aBOQUtyn2k8X/CwzWB73W2lQ==", + "dev": true, + "requires": { + "is-utf8": "^0.2.1" + } + }, + "strip-eof": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/strip-eof/-/strip-eof-1.0.0.tgz", + "integrity": "sha1-u0P/VZim6wXYm1n80SnJgzE2Br8=", + "dev": true + }, + "strip-indent": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/strip-indent/-/strip-indent-2.0.0.tgz", + "integrity": "sha1-XvjbKV0B5u1sv3qrlpmNeCJSe2g=", + "dev": true + }, "strip-json-comments": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-2.0.1.tgz", "integrity": "sha1-PFMZQukIwml8DsNEhYwobHygpgo=" }, + "supertap": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/supertap/-/supertap-1.0.0.tgz", + "integrity": "sha512-HZJ3geIMPgVwKk2VsmO5YHqnnJYl6bV5A9JW2uzqV43WmpgliNEYbuvukfor7URpaqpxuw3CfZ3ONdVbZjCgIA==", + "dev": true, + "requires": { + "arrify": "^1.0.1", + "indent-string": "^3.2.0", + "js-yaml": "^3.10.0", + "serialize-error": "^2.1.0", + "strip-ansi": "^4.0.0" + }, + "dependencies": { + "indent-string": { + "version": "3.2.0", + "resolved": "https://registry.npmjs.org/indent-string/-/indent-string-3.2.0.tgz", + "integrity": "sha1-Sl/W0nzDMvN+VBmlBNu4NxBckok=", + "dev": true + }, + "js-yaml": { + "version": "3.13.1", + "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-3.13.1.tgz", + "integrity": "sha512-YfbcO7jXDdyj0DGxYVSlSeQNHbD7XPWvrVWeVUujrQEoZzWJIRrCPoyk6kL6IAjAG2IolMK4T0hNUe0HOUs5Jw==", + "dev": true, + "requires": { + "argparse": "^1.0.7", + "esprima": "^4.0.0" + } + } + } + }, "supports-color": { "version": "5.4.0", "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-5.4.0.tgz", "integrity": "sha512-zjaXglF5nnWpsq470jSv6P9DwPvgLkuapYmfDm3JWOm0vkNTVF2tI4UrN2r6jH1qM/uc/WtxYY1hYoA2dOKj5w==", "dev": true, "requires": { - "has-flag": "3.0.0" + "has-flag": "^3.0.0" } }, + "symbol-observable": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/symbol-observable/-/symbol-observable-1.2.0.tgz", + "integrity": "sha512-e900nM8RRtGhlV36KGEU9k65K3mPb1WV70OdjfxlG2EAuM1noi/E/BaW/uMhL7bPEssK8QV57vN3esixjUvcXQ==", + "dev": true + }, "table": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/table/-/table-5.2.3.tgz", "integrity": "sha512-N2RsDAMvDLvYwFcwbPyF3VmVSSkuF+G1e+8inhBLtHpvwXGw4QRPEZhihQNeEN0i1up6/f6ObCJXNdlRG3YVyQ==", "dev": true, "requires": { - "ajv": "6.10.0", - "lodash": "4.17.11", - "slice-ansi": "2.1.0", - "string-width": "3.0.0" + "ajv": "^6.9.1", + "lodash": "^4.17.11", + "slice-ansi": "^2.1.0", + "string-width": "^3.0.0" }, "dependencies": { "ansi-regex": { @@ -3574,9 +6925,9 @@ "integrity": "sha512-rr8CUxBbvOZDUvc5lNIJ+OC1nPVpz+Siw9VBtUjB9b6jZehZLFt0JMCZzShFHIsI8cbhm0EsNIfWJMFV3cu3Ew==", "dev": true, "requires": { - "emoji-regex": "7.0.3", - "is-fullwidth-code-point": "2.0.0", - "strip-ansi": "5.0.0" + "emoji-regex": "^7.0.1", + "is-fullwidth-code-point": "^2.0.0", + "strip-ansi": "^5.0.0" } }, "strip-ansi": { @@ -3585,7 +6936,7 @@ "integrity": "sha512-Uu7gQyZI7J7gn5qLn1Np3G9vcYGTVqB+lFTytnDJv83dd8T22aGH451P3jueT2/QemInJDfxHB5Tde5OzgG1Ow==", "dev": true, "requires": { - "ansi-regex": "4.0.0" + "ansi-regex": "^4.0.0" } } } @@ -3596,9 +6947,18 @@ "integrity": "sha512-CKncqSF7sH6p4rzCgkb/z/Pcos5efl0DmolzvlqRQUNcpRIruOhY9+T1FsIlyEbfWd7MsFpodROOwHYh2BaXzw==", "dev": true, "requires": { - "https-proxy-agent": "2.2.1", - "node-fetch": "2.3.0", - "uuid": "3.3.2" + "https-proxy-agent": "^2.2.1", + "node-fetch": "^2.2.0", + "uuid": "^3.3.2" + } + }, + "term-size": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/term-size/-/term-size-1.2.0.tgz", + "integrity": "sha1-RYuDiH8oj8Vtb/+/rSYuJmOO+mk=", + "dev": true, + "requires": { + "execa": "^0.7.0" } }, "text-table": { @@ -3613,13 +6973,19 @@ "integrity": "sha1-DdTJ/6q8NXlgsbckEV1+Doai4fU=", "dev": true }, + "time-zone": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/time-zone/-/time-zone-1.0.0.tgz", + "integrity": "sha1-mcW/VZWJZq9tBtg73zgA3IL67F0=", + "dev": true + }, "tmp": { "version": "0.0.33", "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.0.33.tgz", "integrity": "sha512-jRCJlojKnZ3addtTOjdIqoRuPEKBvNXcGYqzO6zWZX8KfKEpnGY5jfggJQ3EjKuu8D4bJRr0y+cYJFmYbImXGw==", "dev": true, "requires": { - "os-tmpdir": "1.0.2" + "os-tmpdir": "~1.0.2" } }, "to-fast-properties": { @@ -3628,6 +6994,33 @@ "integrity": "sha1-3F5pjL0HkmW8c+A3doGk5Og/YW4=", "dev": true }, + "to-readable-stream": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/to-readable-stream/-/to-readable-stream-1.0.0.tgz", + "integrity": "sha512-Iq25XBt6zD5npPhlLVXGFN3/gyR2/qODcKNNyTMd4vbm39HUaOiAM4PMq0eMVC/Tkxz+Zjdsc55g9yyz+Yq00Q==", + "dev": true + }, + "to-regex-range": { + "version": "5.0.1", + "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", + "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", + "dev": true, + "requires": { + "is-number": "^7.0.0" + } + }, + "trim-newlines": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/trim-newlines/-/trim-newlines-2.0.0.tgz", + "integrity": "sha1-tAPQuRvlDDMd/EuC7s6yLD3hbSA=", + "dev": true + }, + "trim-off-newlines": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/trim-off-newlines/-/trim-off-newlines-1.0.1.tgz", + "integrity": "sha1-n5up2e+odkw4dpi8v+sshI8RrbM=", + "dev": true + }, "trim-right": { "version": "1.0.1", "resolved": "https://registry.npmjs.org/trim-right/-/trim-right-1.0.1.tgz", @@ -3646,7 +7039,96 @@ "integrity": "sha1-WITKtRLPHTVeP7eE8wgEsrUg23I=", "dev": true, "requires": { - "prelude-ls": "1.1.2" + "prelude-ls": "~1.1.2" + } + }, + "type-fest": { + "version": "0.5.2", + "resolved": "https://registry.npmjs.org/type-fest/-/type-fest-0.5.2.tgz", + "integrity": "sha512-DWkS49EQKVX//Tbupb9TFa19c7+MK1XmzkrZUR8TAktmE/DizXoaoJV6TZ/tSIPXipqNiRI6CyAe7x69Jb6RSw==", + "dev": true + }, + "typedarray-to-buffer": { + "version": "3.1.5", + "resolved": "https://registry.npmjs.org/typedarray-to-buffer/-/typedarray-to-buffer-3.1.5.tgz", + "integrity": "sha512-zdu8XMNEDepKKR+XYOXAVPtWui0ly0NtohUscw+UmaHiAWT8hrV1rr//H6V+0DvJ3OQ19S979M0laLfX8rm82Q==", + "dev": true, + "requires": { + "is-typedarray": "^1.0.0" + } + }, + "uid2": { + "version": "0.0.3", + "resolved": "https://registry.npmjs.org/uid2/-/uid2-0.0.3.tgz", + "integrity": "sha1-SDEm4Rd03y9xuLY53NeZw3YWK4I=", + "dev": true + }, + "unicode-canonical-property-names-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-canonical-property-names-ecmascript/-/unicode-canonical-property-names-ecmascript-1.0.4.tgz", + "integrity": "sha512-jDrNnXWHd4oHiTZnx/ZG7gtUTVp+gCcTTKr8L0HjlwphROEW3+Him+IpvC+xcJEFegapiMZyZe02CyuOnRmbnQ==", + "dev": true + }, + "unicode-match-property-ecmascript": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/unicode-match-property-ecmascript/-/unicode-match-property-ecmascript-1.0.4.tgz", + "integrity": "sha512-L4Qoh15vTfntsn4P1zqnHulG0LdXgjSO035fEpdtp6YxXhMT51Q6vgM5lYdG/5X3MjS+k/Y9Xw4SFCY9IkR0rg==", + "dev": true, + "requires": { + "unicode-canonical-property-names-ecmascript": "^1.0.4", + "unicode-property-aliases-ecmascript": "^1.0.4" + } + }, + "unicode-match-property-value-ecmascript": { + "version": "1.1.0", + "resolved": "https://registry.npmjs.org/unicode-match-property-value-ecmascript/-/unicode-match-property-value-ecmascript-1.1.0.tgz", + "integrity": "sha512-hDTHvaBk3RmFzvSl0UVrUmC3PuW9wKVnpoUDYH0JDkSIovzw+J5viQmeYHxVSBptubnr7PbH2e0fnpDRQnQl5g==", + "dev": true + }, + "unicode-property-aliases-ecmascript": { + "version": "1.0.5", + "resolved": "https://registry.npmjs.org/unicode-property-aliases-ecmascript/-/unicode-property-aliases-ecmascript-1.0.5.tgz", + "integrity": "sha512-L5RAqCfXqAwR3RriF8pM0lU0w4Ryf/GgzONwi6KnL1taJQa7x1TCxdJnILX59WIGOwR57IVxn7Nej0fz1Ny6fw==", + "dev": true + }, + "unique-string": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-string/-/unique-string-1.0.0.tgz", + "integrity": "sha1-nhBXzKhRq7kzmPizOuGHuZyuwRo=", + "dev": true, + "requires": { + "crypto-random-string": "^1.0.0" + } + }, + "unique-temp-dir": { + "version": "1.0.0", + "resolved": "https://registry.npmjs.org/unique-temp-dir/-/unique-temp-dir-1.0.0.tgz", + "integrity": "sha1-bc6VsmgcoAPuv7MEpBX5y6vMU4U=", + "dev": true, + "requires": { + "mkdirp": "^0.5.1", + "os-tmpdir": "^1.0.1", + "uid2": "0.0.3" + } + }, + "update-notifier": { + "version": "3.0.1", + "resolved": "https://registry.npmjs.org/update-notifier/-/update-notifier-3.0.1.tgz", + "integrity": "sha512-grrmrB6Zb8DUiyDIaeRTBCkgISYUgETNe7NglEbVsrLWXeESnlCSP50WfRSj/GmzMPl6Uchj24S/p80nP/ZQrQ==", + "dev": true, + "requires": { + "boxen": "^3.0.0", + "chalk": "^2.0.1", + "configstore": "^4.0.0", + "has-yarn": "^2.1.0", + "import-lazy": "^2.1.0", + "is-ci": "^2.0.0", + "is-installed-globally": "^0.1.0", + "is-npm": "^3.0.0", + "is-yarn-global": "^0.3.0", + "latest-version": "^5.0.0", + "semver-diff": "^2.0.0", + "xdg-basedir": "^3.0.0" } }, "uri-js": { @@ -3655,7 +7137,16 @@ "integrity": "sha512-KY9Frmirql91X2Qgjry0Wd4Y+YTdrdZheS8TFwvkbLWf/G5KNJDCh6pKL5OZctEW4+0Baa5idK2ZQuELRwPznQ==", "dev": true, "requires": { - "punycode": "2.1.1" + "punycode": "^2.1.0" + } + }, + "url-parse-lax": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/url-parse-lax/-/url-parse-lax-3.0.0.tgz", + "integrity": "sha1-FrXK/Afb42dsGxmZF3gj1lA6yww=", + "dev": true, + "requires": { + "prepend-http": "^2.0.0" } }, "urlgrey": { @@ -3676,8 +7167,8 @@ "integrity": "sha512-DpKm2Ui/xN7/HQKCtpZxoRWBhZ9Z0kqtygG8XCgNQ8ZlDnxuQmWhj566j8fN4Cu3/JmbhsDo7fcAJq4s9h27Ew==", "dev": true, "requires": { - "spdx-correct": "3.1.0", - "spdx-expression-parse": "3.0.0" + "spdx-correct": "^3.0.0", + "spdx-expression-parse": "^3.0.0" } }, "vscode-json-languageservice": { @@ -3686,10 +7177,10 @@ "integrity": "sha512-ee9MJ70/xR55ywvm0bZsDLhA800HCRE27AYgMNTU14RSg20Y+ngHdQnUt6OmiTXrQDI/7sne6QUOtHIN0hPQYA==", "dev": true, "requires": { - "jsonc-parser": "2.0.3", - "vscode-languageserver-types": "3.14.0", - "vscode-nls": "4.0.0", - "vscode-uri": "1.0.6" + "jsonc-parser": "^2.0.2", + "vscode-languageserver-types": "^3.13.0", + "vscode-nls": "^4.0.0", + "vscode-uri": "^1.0.6" } }, "vscode-languageserver-types": { @@ -3710,13 +7201,37 @@ "integrity": "sha512-sLI2L0uGov3wKVb9EB+vIQBl9tVP90nqRvxSoJ35vI3NjxE8jfsE5DSOhWgSunHSZmKS4OCi2jrtfxK7uyp2ww==", "dev": true }, + "wcwidth": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/wcwidth/-/wcwidth-1.0.1.tgz", + "integrity": "sha1-8LDc+RW8X/FSivrbLA4XtTLaL+g=", + "dev": true, + "requires": { + "defaults": "^1.0.3" + } + }, + "well-known-symbols": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/well-known-symbols/-/well-known-symbols-2.0.0.tgz", + "integrity": "sha512-ZMjC3ho+KXo0BfJb7JgtQ5IBuvnShdlACNkKkdsqBmYw3bPAaJfPeYUo6tLUaT5tG/Gkh7xkpBhKRQ9e7pyg9Q==", + "dev": true + }, "which": { "version": "1.3.1", "resolved": "https://registry.npmjs.org/which/-/which-1.3.1.tgz", "integrity": "sha512-HxJdYWq1MTIQbJ3nw0cqssHoTNU267KlrDuGZ1WYlxDStUtKUhOaJmh112/TZmHxxUfuJqPXSOm7tDyas0OSIQ==", "dev": true, "requires": { - "isexe": "2.0.0" + "isexe": "^2.0.0" + } + }, + "widest-line": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/widest-line/-/widest-line-2.0.1.tgz", + "integrity": "sha512-Ba5m9/Fa4Xt9eb2ELXt77JxVDV8w7qQrH0zS/TWSJdLyAwQjWoOzpzj5lwVftDz6n/EOu3tNACS84v509qwnJA==", + "dev": true, + "requires": { + "string-width": "^2.1.1" } }, "wordwrap": { @@ -3737,7 +7252,46 @@ "integrity": "sha512-/lg70HAjtkUgWPVZhZcm+T4hkL8Zbtp1nFNOn3lRrxnlv50SRBv7cR7RqR+GMsd3hUXy9hWBo4CHTbFTcOYwig==", "dev": true, "requires": { - "mkdirp": "0.5.1" + "mkdirp": "^0.5.1" + } + }, + "write-file-atomic": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/write-file-atomic/-/write-file-atomic-3.0.0.tgz", + "integrity": "sha512-EIgkf60l2oWsffja2Sf2AL384dx328c0B+cIYPTQq5q2rOYuDV00/iPFBOUiDKKwKMOhkymH8AidPaRvzfxY+Q==", + "dev": true, + "requires": { + "imurmurhash": "^0.1.4", + "is-typedarray": "^1.0.0", + "signal-exit": "^3.0.2", + "typedarray-to-buffer": "^3.1.5" + } + }, + "xdg-basedir": { + "version": "3.0.0", + "resolved": "https://registry.npmjs.org/xdg-basedir/-/xdg-basedir-3.0.0.tgz", + "integrity": "sha1-SWsswQnsqNus/i3HK2A8F8WHCtQ=", + "dev": true + }, + "xtend": { + "version": "4.0.2", + "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", + "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", + "dev": true + }, + "yallist": { + "version": "2.1.2", + "resolved": "https://registry.npmjs.org/yallist/-/yallist-2.1.2.tgz", + "integrity": "sha1-HBH5IY8HYImkfdUS+TxmmaaoHVI=", + "dev": true + }, + "yargs-parser": { + "version": "10.1.0", + "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-10.1.0.tgz", + "integrity": "sha512-VCIyR1wJoEBZUqk5PA+oOBF6ypbwh5aNB3I50guxAL/quggdfs4TtNHQrSazFA3fYZ+tEqfs0zIGlv0c/rgjbQ==", + "dev": true, + "requires": { + "camelcase": "^4.1.0" } } } diff --git a/package.json b/package.json index c7f7c3a..2ea7e1f 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "license": "MIT", "scripts": { - "test": "mocha --recursive ./test", + "test": "ava --serial", "cover": "nyc npm run test", "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint src test bin/dogapi examples", @@ -44,6 +44,7 @@ }, "devDependencies": { "@coorpacademy/eslint-plugin-coorpacademy": "^8.1.1", + "ava": "^2.4.0", "bignumber.js": "^2.0.7", "codecov": "^3.2.0", "docast": "^0.1.1", @@ -51,7 +52,6 @@ "glob": "^6.0.0", "js-yaml": "^3.2.7", "marked": "^0.3.9", - "mocha": "^5.2.0", "nyc": "^13.3.0", "sinon": "^1.15.4" } diff --git a/test/api.embed.test.js b/test/api.embed.test.js new file mode 100644 index 0000000..7d970d5 --- /dev/null +++ b/test/api.embed.test.js @@ -0,0 +1,66 @@ +const querystring = require('querystring'); +const test = require('ava'); +const sinon = require('sinon'); +const Client = require('../src/client'); +const Embed = require('../src/api/embed'); + +const client = new Client({}); +const embed = Embed(client); + +let stub_request; +test.beforeEach(() => { + stub_request = sinon.stub(client, 'request'); +}); +test.afterEach(() => { + stub_request.restore(); + stub_request = null; +}); +test('should make a valid api call', t => { + const graphJSON = {viz: 'timeseries', requests: [{q: 'system.cpu.idle{*}'}]}; + const options = { + timeframe: '1_hour', + size: 'large', + legend: 'yes', + title: 'test graph embed' + }; + + // Make our api call + embed.create(graphJSON, options); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + t.is(call_args[0], 'POST'); + t.is(call_args[1], '/graph/embed'); + + // Properly formatted body and content-type + const params = call_args[2]; + const expectedBody = { + graph_json: JSON.stringify(graphJSON), + timeframe: '1_hour', + size: 'large', + legend: 'yes', + title: 'test graph embed' + }; + t.deepEqual(querystring.parse(params.body), expectedBody); + t.is(params.contentType, 'application/x-www-form-urlencoded'); +}); + +test('should only require graph_json', t => { + const graphJSON = {viz: 'timeseries', requests: [{q: 'system.cpu.idle{*}'}]}; + + // Make our api call + embed.create(graphJSON); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + + // Properly formatted body + const params = call_args[2]; + const expectedBody = { + graph_json: JSON.stringify(graphJSON) + }; + t.deepEqual(querystring.parse(params.body), expectedBody); +}); diff --git a/test/api.metric-send-all.test.js b/test/api.metric-send-all.test.js new file mode 100644 index 0000000..33b9d5d --- /dev/null +++ b/test/api.metric-send-all.test.js @@ -0,0 +1,157 @@ +const test = require('ava'); +const sinon = require('sinon'); +const Client = require('../src/client'); +const Metric = require('../src/api/metric'); + +const client = new Client({}); +const metric = Metric(client); + +let stub_request; +test.beforeEach(() => { + stub_request = sinon.stub(client, 'request'); +}); +test.afterEach(() => { + stub_request.restore(); + stub_request = null; +}); + +test('should make a valid api call', t => { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + const metrics = [{metric: 'metric.send_all', points: [[now, 500]]}]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + t.is(call_args[0], 'POST'); + t.is(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send_all", host: undefined, tags: undefined, type: undefined} ] } + // DEV: host/tags/type are optional and should be undefined for this case + const data = call_args[2]; + t.true(data.hasOwnProperty('body')); + t.true(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metric.send_all'); + t.true(Array.isArray(first_series.points)); + t.deepEqual(first_series.points, [[now, 500]]); +}); + +test('should properly normalize metric points', t => { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + const metrics = [ + {metric: 'metric.send_all.normalize', points: [[now, 500]]}, + {metric: 'metric.send_all.normalize', points: [500, 1000]}, + {metric: 'metric.send_all.normalize', points: 1000} + ]; + metric.send_all(metrics); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 3); + + // points = [ [<timestamp>, 500] ] + let points = body.series[0].points; + t.true(Array.isArray(points)); + t.is(points.length, 1); + t.is(points[0].length, 2); + t.is(points[0][1], 500); + + // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] + points = body.series[1].points; + t.true(Array.isArray(points)); + t.is(points.length, 2); + t.is(points[0].length, 2); + t.is(points[0][1], 500); + t.is(points[1].length, 2); + t.is(points[1][1], 1000); + + // points = [ [<timestamp>, 1000] ] + points = body.series[2].points; + t.true(Array.isArray(points)); + t.is(points.length, 1); + t.is(points[0].length, 2); + t.is(points[0][1], 1000); +}); + +test('should properly send metric type', t => { + // Make our api call + const metrics = [{metric: 'metric.send.counter', points: 5, type: 'count'}]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + t.is(call_args[0], 'POST'); + t.is(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } + // DEV: host/tags are optional and should be undefined for this case + const data = call_args[2]; + t.true(data.hasOwnProperty('body')); + t.true(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metric.send.counter'); + t.true(Array.isArray(first_series.points)); + t.deepEqual(first_series.type, 'count'); +}); + +test('should properly send metric_type as type', t => { + // Make our api call + const metrics = [{metric: 'metric.send.counter', points: 5, metric_type: 'count'}]; + metric.send_all(metrics); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + t.is(call_args[0], 'POST'); + t.is(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } + // DEV: host/tags are optional and should be undefined for this case + const data = call_args[2]; + t.true(data.hasOwnProperty('body')); + t.true(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metric.send.counter'); + t.true(Array.isArray(first_series.points)); + t.deepEqual(first_series.type, 'count'); +}); diff --git a/test/api.metric-send.test.js b/test/api.metric-send.test.js new file mode 100644 index 0000000..1fe3991 --- /dev/null +++ b/test/api.metric-send.test.js @@ -0,0 +1,182 @@ +const test = require('ava'); +const sinon = require('sinon'); +const Client = require('../src/client'); +const Metric = require('../src/api/metric'); + +const client = new Client({}); +const metric = Metric(client); + +let stub_request; +test.beforeEach(() => { + stub_request = sinon.stub(client, 'request'); +}); +test.afterEach(() => { + stub_request.restore(); + stub_request = null; +}); + +test('#send should make a valid api call', t => { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + metric.send('metric.send', [[now, 500]]); + + // Assert we properly called `client.request` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // Method and endpoint are correct + t.is(call_args[0], 'POST'); + t.is(call_args[1], '/series'); + + // Properly formatted body + // { body: series: [ {metric: "metric.send", host: undefined, tags: undefined, type: undefined} ] } + // DEV: host/tags/type are optional and should be undefined for this case + const data = call_args[2]; + t.true(data.hasOwnProperty('body')); + t.true(data.body.hasOwnProperty('series')); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = data.body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metric.send'); + t.true(Array.isArray(first_series.points)); + t.deepEqual(first_series.points, [[now, 500]]); + + // These keys are optional and should be set, but undefined + t.true(first_series.hasOwnProperty('host')); + t.is(first_series.host, undefined); + t.true(first_series.hasOwnProperty('tags')); + t.is(first_series.tags, undefined); + t.true(first_series.hasOwnProperty('type')); + t.is(first_series.type, undefined); +}); + +test('should properly normalize values to points', t => { + // Make our api call + metric.send('metrics.send.normalize', 500); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 1); + + // points = [ [<timestamp>, 500] ] + const points = body.series[0].points; + t.true(Array.isArray(points)); + t.is(points.length, 1); + + // point = [<timestamp>, 500] + const point = points[0]; + t.true(Array.isArray(point)); + t.is(point.length, 2); + t.is(point[1], 500); +}); + +test('should properly normalize array of values to points', t => { + // Make our api call + metric.send('metrics.send.normalize', [500, 1000]); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 1); + + // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] + const points = body.series[0].points; + t.true(Array.isArray(points)); + t.is(points.length, 2); + + // point = [<timestamp>, 500] + let point = points[0]; + t.true(Array.isArray(point)); + t.is(point.length, 2); + t.is(point[1], 500); + + // point = [<timestamp>, 1000] + point = points[1]; + t.true(Array.isArray(point)); + t.is(point.length, 2); + t.is(point[1], 1000); +}); + +test('should not normalize correctly formatted points', t => { + // Make our api call + const now = parseInt(new Date().getTime() / 1000); + metric.send('metrics.send.normalize', [[now, 1000]]); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 1); + + // points = [ [<timestamp>, 1000], ] + const points = body.series[0].points; + t.true(Array.isArray(points)); + t.is(points.length, 1); + + // point = [<timestamp>, 500] + const point = points[0]; + t.true(Array.isArray(point)); + t.deepEqual(point, [now, 1000]); +}); + +test('should properly set metric type', t => { + // Make our api call + metric.send('metrics.send.counter', 5, {type: 'count'}); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 1); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metrics.send.counter'); + t.true(first_series.hasOwnProperty('type')); + t.is(first_series.type, 'count'); +}); + +test('should properly set convert metric_type to type', t => { + // Make our api call + metric.send('metrics.send.counter', 5, {metric_type: 'count'}); + + // Assert we called `client.request` with the correct `points` + t.true(stub_request.calledOnce); + const call_args = stub_request.getCall(0).args; + // { body: series: [ {points: [], }, ] } + const body = call_args[2].body; + t.is(body.series.length, 1); + + // Assert we have only 1 series + // series = [ {metric: "", ...}, ... ] + const series = body.series; + t.true(Array.isArray(series)); + t.is(series.length, 1); + + // Assert the first series is properly formatted + // first_series = {metric: "", type: "count", points: [], ...} + const first_series = series[0]; + t.is(first_series.metric, 'metrics.send.counter'); + t.true(first_series.hasOwnProperty('type')); + t.is(first_series.type, 'count'); +}); diff --git a/test/api/embed.js b/test/api/embed.js deleted file mode 100644 index 7edf9e4..0000000 --- a/test/api/embed.js +++ /dev/null @@ -1,86 +0,0 @@ -const assert = require('assert'); -const querystring = require('querystring'); -const sinon = require('sinon'); -const Client = require('../../src/client'); -const Embed = require('../../src/api/embed'); - -describe('api/embed', function() { - const client = new Client({}); - const embed = Embed(client); - let stub_request; - - describe('#create', function() { - beforeEach(function() { - // Setup `client.request` as a stub - stub_request = sinon.stub(client, 'request'); - }); - afterEach(function() { - // Reset the original `client.request` - stub_request.restore(); - stub_request = null; - }); - it('should make a valid api call', function() { - const graphJSON = { - viz: 'timeseries', - requests: [ - { - q: 'system.cpu.idle{*}' - } - ] - }; - const options = { - timeframe: '1_hour', - size: 'large', - legend: 'yes', - title: 'test graph embed' - }; - - // Make our api call - embed.create(graphJSON, options); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], 'POST'); - assert.equal(call_args[1], '/graph/embed'); - - // Properly formatted body and content-type - const params = call_args[2]; - const expectedBody = { - graph_json: JSON.stringify(graphJSON), - timeframe: '1_hour', - size: 'large', - legend: 'yes', - title: 'test graph embed' - }; - assert.deepEqual(querystring.parse(params.body), expectedBody); - assert(params.contentType, 'application/x-form-urlencoded'); - }); - - it('should only require graph_json', function() { - const graphJSON = { - viz: 'timeseries', - requests: [ - { - q: 'system.cpu.idle{*}' - } - ] - }; - - // Make our api call - embed.create(graphJSON); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - - // Properly formatted body - const params = call_args[2]; - const expectedBody = { - graph_json: JSON.stringify(graphJSON) - }; - assert.deepEqual(querystring.parse(params.body), expectedBody); - }); - }); -}); diff --git a/test/api/metric.js b/test/api/metric.js deleted file mode 100644 index 13702ab..0000000 --- a/test/api/metric.js +++ /dev/null @@ -1,355 +0,0 @@ -const assert = require('assert'); -const sinon = require('sinon'); -const Client = require('../../src/client'); -const Metric = require('../../src/api/metric'); - -describe('api/metrics', function() { - const client = new Client({}); - const metric = Metric(client); - let stub_request; - beforeEach(function() { - // Setup `client.request` as a stub - stub_request = sinon.stub(client, 'request'); - }); - afterEach(function() { - // Reset the original `client.request` - stub_request.restore(); - stub_request = null; - }); - describe('#send', function() { - it('should make a valid api call', function() { - // Make our api call - const now = parseInt(new Date().getTime() / 1000); - metric.send('metric.send', [[now, 500]]); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], 'POST'); - assert.equal(call_args[1], '/series'); - - // Properly formatted body - // { body: series: [ {metric: "metric.send", host: undefined, tags: undefined, type: undefined} ] } - // DEV: host/tags/type are optional and should be undefined for this case - const data = call_args[2]; - assert(data.hasOwnProperty('body')); - assert(data.body.hasOwnProperty('series')); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metric.send'); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.points, [[now, 500]]); - - // These keys are optional and should be set, but undefined - assert(first_series.hasOwnProperty('host')); - assert.equal(first_series.host, undefined); - assert(first_series.hasOwnProperty('tags')); - assert.equal(first_series.tags, undefined); - assert(first_series.hasOwnProperty('type')); - assert.equal(first_series.type, undefined); - }); - - it('should properly normalize values to points', function() { - // Make our api call - metric.send('metrics.send.normalize', 500); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 500] ] - const points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - - // point = [<timestamp>, 500] - const point = points[0]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 500); - }); - - it('should properly normalize array of values to points', function() { - // Make our api call - metric.send('metrics.send.normalize', [500, 1000]); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] - const points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 2); - - // point = [<timestamp>, 500] - let point = points[0]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 500); - - // point = [<timestamp>, 1000] - point = points[1]; - assert(Array.isArray(point)); - assert.equal(point.length, 2); - assert.equal(point[1], 1000); - }); - - it('should not normalize correctly formatted points', function() { - // Make our api call - const now = parseInt(new Date().getTime() / 1000); - metric.send('metrics.send.normalize', [[now, 1000]]); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 1); - - // points = [ [<timestamp>, 1000], ] - const points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - - // point = [<timestamp>, 500] - const point = points[0]; - assert(Array.isArray(point)); - assert.deepEqual(point, [now, 1000]); - }); - - it('should properly set metric type', function() { - // Make our api call - metric.send('metrics.send.counter', 5, {type: 'count'}); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 1); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metrics.send.counter'); - assert(first_series.hasOwnProperty('type')); - assert.equal(first_series.type, 'count'); - }); - - it('should properly set convert metric_type to type', function() { - // Make our api call - metric.send('metrics.send.counter', 5, {metric_type: 'count'}); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 1); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metrics.send.counter'); - assert(first_series.hasOwnProperty('type')); - assert.equal(first_series.type, 'count'); - }); - }); - - describe('#send_all', function() { - it('should make a valid api call', function() { - // Make our api call - const now = parseInt(new Date().getTime() / 1000); - const metrics = [ - { - metric: 'metric.send_all', - points: [[now, 500]] - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], 'POST'); - assert.equal(call_args[1], '/series'); - - // Properly formatted body - // { body: series: [ {metric: "metric.send_all", host: undefined, tags: undefined, type: undefined} ] } - // DEV: host/tags/type are optional and should be undefined for this case - const data = call_args[2]; - assert(data.hasOwnProperty('body')); - assert(data.body.hasOwnProperty('series')); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metric.send_all'); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.points, [[now, 500]]); - }); - - it('should properly normalize metric points', function() { - // Make our api call - const now = parseInt(new Date().getTime() / 1000); - const metrics = [ - { - metric: 'metric.send_all.normalize', - points: [[now, 500]] - }, - { - metric: 'metric.send_all.normalize', - points: [500, 1000] - }, - { - metric: 'metric.send_all.normalize', - points: 1000 - } - ]; - metric.send_all(metrics); - - // Assert we called `client.request` with the correct `points` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // { body: series: [ {points: [], }, ] } - const body = call_args[2].body; - assert.equal(body.series.length, 3); - - // points = [ [<timestamp>, 500] ] - let points = body.series[0].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 500); - - // points = [ [<timestamp>, 500], [<timestamp>, 1000] ] - points = body.series[1].points; - assert(Array.isArray(points)); - assert.equal(points.length, 2); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 500); - assert.equal(points[1].length, 2); - assert.equal(points[1][1], 1000); - - // points = [ [<timestamp>, 1000] ] - points = body.series[2].points; - assert(Array.isArray(points)); - assert.equal(points.length, 1); - assert.equal(points[0].length, 2); - assert.equal(points[0][1], 1000); - }); - - it('should properly send metric type', function() { - // Make our api call - const metrics = [ - { - metric: 'metric.send.counter', - points: 5, - type: 'count' - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], 'POST'); - assert.equal(call_args[1], '/series'); - - // Properly formatted body - // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } - // DEV: host/tags are optional and should be undefined for this case - const data = call_args[2]; - assert(data.hasOwnProperty('body')); - assert(data.body.hasOwnProperty('series')); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metric.send.counter'); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.type, 'count'); - }); - - it('should properly send metric_type as type', function() { - // Make our api call - const metrics = [ - { - metric: 'metric.send.counter', - points: 5, - metric_type: 'count' - } - ]; - metric.send_all(metrics); - - // Assert we properly called `client.request` - assert(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; - // Method and endpoint are correct - assert.equal(call_args[0], 'POST'); - assert.equal(call_args[1], '/series'); - - // Properly formatted body - // { body: series: [ {metric: "metric.send.counter", host: undefined, tags: undefined, type: "count"} ] } - // DEV: host/tags are optional and should be undefined for this case - const data = call_args[2]; - assert(data.hasOwnProperty('body')); - assert(data.body.hasOwnProperty('series')); - - // Assert we have only 1 series - // series = [ {metric: "", ...}, ... ] - const series = data.body.series; - assert(Array.isArray(series)); - assert.equal(series.length, 1); - - // Assert the first series is properly formatted - // first_series = {metric: "", type: "count", points: [], ...} - const first_series = series[0]; - assert.equal(first_series.metric, 'metric.send.counter'); - assert(Array.isArray(first_series.points)); - assert.deepEqual(first_series.type, 'count'); - }); - }); -}); From c0d3657248e8d39b53eca7914ad095ffd4231ebe Mon Sep 17 00:00:00 2001 From: Adriean Khisbe <adriean.khisbe@live.fr> Date: Fri, 11 Oct 2019 16:18:14 +0200 Subject: [PATCH 24/24] Replace stubing by spying so that test can be parallel :detective: --- package.json | 2 +- test/api.embed.test.js | 31 ++++++++++----------- test/api.metric-send-all.test.js | 39 ++++++++++++++------------- test/api.metric-send.test.js | 46 +++++++++++++++++--------------- 4 files changed, 60 insertions(+), 58 deletions(-) diff --git a/package.json b/package.json index 2ea7e1f..3e88350 100644 --- a/package.json +++ b/package.json @@ -12,7 +12,7 @@ ], "license": "MIT", "scripts": { - "test": "ava --serial", + "test": "ava", "cover": "nyc npm run test", "publish-coverage": "nyc report --reporter=text-lcov > coverage.lcov && codecov", "lint": "eslint src test bin/dogapi examples", diff --git a/test/api.embed.test.js b/test/api.embed.test.js index 7d970d5..3027a34 100644 --- a/test/api.embed.test.js +++ b/test/api.embed.test.js @@ -4,18 +4,16 @@ const sinon = require('sinon'); const Client = require('../src/client'); const Embed = require('../src/api/embed'); -const client = new Client({}); -const embed = Embed(client); - -let stub_request; -test.beforeEach(() => { - stub_request = sinon.stub(client, 'request'); -}); -test.afterEach(() => { - stub_request.restore(); - stub_request = null; +test.beforeEach(t => { + const client = new Client({}); + const spy = sinon.spy(client, 'request'); + const embed = Embed(client); // + t.context.embed = embed; + t.context.spy = spy; }); + test('should make a valid api call', t => { + const {spy, embed} = t.context; const graphJSON = {viz: 'timeseries', requests: [{q: 'system.cpu.idle{*}'}]}; const options = { timeframe: '1_hour', @@ -28,8 +26,8 @@ test('should make a valid api call', t => { embed.create(graphJSON, options); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Method and endpoint are correct t.is(call_args[0], 'POST'); t.is(call_args[1], '/graph/embed'); @@ -48,19 +46,18 @@ test('should make a valid api call', t => { }); test('should only require graph_json', t => { + const {spy, embed} = t.context; const graphJSON = {viz: 'timeseries', requests: [{q: 'system.cpu.idle{*}'}]}; // Make our api call embed.create(graphJSON); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Properly formatted body const params = call_args[2]; - const expectedBody = { - graph_json: JSON.stringify(graphJSON) - }; + const expectedBody = {graph_json: JSON.stringify(graphJSON)}; t.deepEqual(querystring.parse(params.body), expectedBody); }); diff --git a/test/api.metric-send-all.test.js b/test/api.metric-send-all.test.js index 33b9d5d..8f3c620 100644 --- a/test/api.metric-send-all.test.js +++ b/test/api.metric-send-all.test.js @@ -3,27 +3,24 @@ const sinon = require('sinon'); const Client = require('../src/client'); const Metric = require('../src/api/metric'); -const client = new Client({}); -const metric = Metric(client); - -let stub_request; -test.beforeEach(() => { - stub_request = sinon.stub(client, 'request'); -}); -test.afterEach(() => { - stub_request.restore(); - stub_request = null; +test.beforeEach(t => { + const client = new Client({}); + const spy = sinon.spy(client, 'request'); + const metric = Metric(client); // + t.context.metric = metric; + t.context.spy = spy; }); test('should make a valid api call', t => { + const {metric, spy} = t.context; // Make our api call const now = parseInt(new Date().getTime() / 1000); const metrics = [{metric: 'metric.send_all', points: [[now, 500]]}]; metric.send_all(metrics); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Method and endpoint are correct t.is(call_args[0], 'POST'); t.is(call_args[1], '/series'); @@ -50,6 +47,8 @@ test('should make a valid api call', t => { }); test('should properly normalize metric points', t => { + const {metric, spy} = t.context; + // Make our api call const now = parseInt(new Date().getTime() / 1000); const metrics = [ @@ -60,8 +59,8 @@ test('should properly normalize metric points', t => { metric.send_all(metrics); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 3); @@ -91,13 +90,15 @@ test('should properly normalize metric points', t => { }); test('should properly send metric type', t => { + const {metric, spy} = t.context; + // Make our api call const metrics = [{metric: 'metric.send.counter', points: 5, type: 'count'}]; metric.send_all(metrics); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Method and endpoint are correct t.is(call_args[0], 'POST'); t.is(call_args[1], '/series'); @@ -124,13 +125,15 @@ test('should properly send metric type', t => { }); test('should properly send metric_type as type', t => { + const {metric, spy} = t.context; + // Make our api call const metrics = [{metric: 'metric.send.counter', points: 5, metric_type: 'count'}]; metric.send_all(metrics); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Method and endpoint are correct t.is(call_args[0], 'POST'); t.is(call_args[1], '/series'); diff --git a/test/api.metric-send.test.js b/test/api.metric-send.test.js index 1fe3991..8d5217c 100644 --- a/test/api.metric-send.test.js +++ b/test/api.metric-send.test.js @@ -3,26 +3,23 @@ const sinon = require('sinon'); const Client = require('../src/client'); const Metric = require('../src/api/metric'); -const client = new Client({}); -const metric = Metric(client); - -let stub_request; -test.beforeEach(() => { - stub_request = sinon.stub(client, 'request'); -}); -test.afterEach(() => { - stub_request.restore(); - stub_request = null; +test.beforeEach(t => { + const client = new Client({}); + const spy = sinon.spy(client, 'request'); + const metric = Metric(client); // + t.context.metric = metric; + t.context.spy = spy; }); test('#send should make a valid api call', t => { + const {metric, spy} = t.context; // Make our api call const now = parseInt(new Date().getTime() / 1000); metric.send('metric.send', [[now, 500]]); // Assert we properly called `client.request` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // Method and endpoint are correct t.is(call_args[0], 'POST'); t.is(call_args[1], '/series'); @@ -57,12 +54,13 @@ test('#send should make a valid api call', t => { }); test('should properly normalize values to points', t => { + const {metric, spy} = t.context; // Make our api call metric.send('metrics.send.normalize', 500); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 1); @@ -80,12 +78,13 @@ test('should properly normalize values to points', t => { }); test('should properly normalize array of values to points', t => { + const {metric, spy} = t.context; // Make our api call metric.send('metrics.send.normalize', [500, 1000]); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 1); @@ -109,13 +108,14 @@ test('should properly normalize array of values to points', t => { }); test('should not normalize correctly formatted points', t => { + const {metric, spy} = t.context; // Make our api call const now = parseInt(new Date().getTime() / 1000); metric.send('metrics.send.normalize', [[now, 1000]]); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 1); @@ -132,12 +132,13 @@ test('should not normalize correctly formatted points', t => { }); test('should properly set metric type', t => { + const {metric, spy} = t.context; // Make our api call metric.send('metrics.send.counter', 5, {type: 'count'}); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 1); @@ -157,12 +158,13 @@ test('should properly set metric type', t => { }); test('should properly set convert metric_type to type', t => { + const {metric, spy} = t.context; // Make our api call metric.send('metrics.send.counter', 5, {metric_type: 'count'}); // Assert we called `client.request` with the correct `points` - t.true(stub_request.calledOnce); - const call_args = stub_request.getCall(0).args; + t.true(spy.calledOnce); + const call_args = spy.getCall(0).args; // { body: series: [ {points: [], }, ] } const body = call_args[2].body; t.is(body.series.length, 1);