daplie-tools
Advanced tools
Comparing version 1.0.0-alpha.902 to 1.0.0-alpha.903
@@ -129,3 +129,5 @@ #!/usr/bin/env node | ||
if ('accounts' === cmd1 && !cmd2) { | ||
var all = {}; | ||
all['accounts'] = function () { | ||
console.log(""); | ||
@@ -139,6 +141,5 @@ console.log("Usage: daplie accounts:COMMAND [command-specific-options]"); | ||
console.log(""); | ||
return; | ||
} | ||
}; | ||
else if ('accounts:list' === cmd) { | ||
all['accounts:list'] = function () { | ||
if (helpme) { | ||
@@ -158,5 +159,5 @@ console.log(""); | ||
}); | ||
} | ||
}; | ||
else if ('auth' === cmd) { | ||
all['auth'] = function () { | ||
console.log(""); | ||
@@ -175,5 +176,5 @@ console.log("Usage: daplie auth"); | ||
console.log(""); | ||
} | ||
}; | ||
else if ('login' === cmd || 'auth:login' === cmd) { | ||
all['login'] = all['auth:login'] = function () { | ||
program | ||
@@ -205,5 +206,5 @@ .usage('auth:login # login through oauth3.org') | ||
}); | ||
} | ||
}; | ||
else if ('domains' === cmd1 && !cmd2) { | ||
all['domains'] = function () { | ||
console.log(""); | ||
@@ -214,9 +215,11 @@ console.log("Usage: daplie domains:COMMAND [command-specific-options]"); | ||
console.log(""); | ||
console.log(" domains:list # show domains purchased through daplie.domains"); | ||
console.log(" domains:search # search and purchase domains through daplie.domains"); | ||
console.log(" domains:attach # attach a device to a domain"); | ||
console.log(" domains:detach # detach a device from a domain"); | ||
console.log(" domains:list # show domains purchased through daplie.domains"); | ||
console.log(" domains:search # search and purchase domains through daplie.domains"); | ||
console.log(""); | ||
return; | ||
} | ||
}; | ||
else if ('domains:list' === cmd) { | ||
all['domains:list'] = function () { | ||
if (helpme) { | ||
@@ -251,9 +254,11 @@ console.log(""); | ||
}); | ||
} | ||
else if ('domains:search' === cmd) { | ||
}; | ||
all['domains:search'] = function () { | ||
program | ||
.usage('domains:search') | ||
.option('-d, --domains <values...>', 'Comma-separated list of domains to search') | ||
.option('-t, --tip <n>', 'A tip (in USD) in addition to the domain purchase price') | ||
.option('-n, --domainnames <values...>', 'Comma-separated list of domains to search') | ||
.option('--tip <n>', 'A tip (in USD) in addition to the domain purchase price') | ||
.option('--max-purchase-price <n>', 'Purchase domains in non-interactive mode if total <= n ($USD)') | ||
.option('-d, --domains <values...>', '(deprecated) Comma-separated list of domains to search') | ||
.parse(process.argv) | ||
@@ -269,3 +274,3 @@ ; | ||
provider: cliOptions.provider | ||
, domains: program.domains | ||
, domains: program.domainnames || program.domains | ||
, tip: program.tip | ||
@@ -281,4 +286,5 @@ , 'max-purchase-price': program['max-purchase-price'] || program.maxPurchasePrice | ||
}); | ||
} | ||
else if ('dns' === cmd1 && !cmd2) { | ||
}; | ||
all['dns'] = function () { | ||
console.log(""); | ||
@@ -294,5 +300,5 @@ console.log("Usage: daplie dns:COMMAND [command-specific-options]"); | ||
return; | ||
} | ||
}; | ||
else if ('dns:list' === cmd) { | ||
all['dns:list'] = function () { | ||
program | ||
@@ -359,5 +365,5 @@ .usage('dns:list -n <domainname>') | ||
}); | ||
} | ||
}; | ||
else if ('dns:set' === cmd) { | ||
all['dns:set'] = function () { | ||
// daplie dns:device add <DEVICE NAME> <IPv4 or IPv6> | ||
@@ -407,5 +413,5 @@ // daplie dns:device remove <DEVICE NAME> <IPv4 or IPv6> | ||
}); | ||
} | ||
}; | ||
else if ('dns:unset' === cmd) { | ||
all['dns:unset'] = function () { | ||
program | ||
@@ -436,5 +442,5 @@ .usage('dns:unset -n <domainname> -t <type> -a <answer>') | ||
}); | ||
} | ||
}; | ||
else if ('devices' === cmd1 && !cmd2) { | ||
all['devices'] = function () { | ||
console.log(""); | ||
@@ -445,2 +451,4 @@ console.log("Usage: daplie devices:COMMAND [command-specific-options]"); | ||
console.log(""); | ||
console.log(" devices:attach # attach a device to a domain"); | ||
console.log(" devices:detach # detach a device from a domain"); | ||
console.log(" devices:list # show all devices (and ip addresses)"); | ||
@@ -454,5 +462,5 @@ console.log(" devices:set # add or update a device (and related dns records)"); | ||
return; | ||
} | ||
}; | ||
else if ('devices:list' === cmd) { | ||
all['devices:list'] = function () { | ||
program | ||
@@ -500,5 +508,5 @@ .usage('devices:list') | ||
}); | ||
} | ||
}; | ||
else if ('devices:set' === cmd) { | ||
all['devices:set'] = function () { | ||
// set device + ip (for all associated domains) | ||
@@ -526,5 +534,5 @@ program | ||
}); | ||
} | ||
}; | ||
else if ('devices:unset' === cmd) { | ||
all['devices:unset'] = function () { | ||
// set device + ip (for all associated domains) | ||
@@ -551,5 +559,5 @@ program | ||
}); | ||
} | ||
}; | ||
else if ('devices:attach' === cmd) { | ||
all['devices:attach'] = all['domains:attach'] = function () { | ||
program | ||
@@ -578,5 +586,5 @@ .usage('devices:attach -d <devicename> -n <domainname>') | ||
}); | ||
} | ||
}; | ||
else if ('devices:detach' === cmd) { | ||
all['devices:detach'] = all['domains:detach'] = function () { | ||
program | ||
@@ -602,6 +610,6 @@ .usage('devices:detach -d <devicename> -n <domainname>') | ||
}); | ||
} | ||
}; | ||
/* | ||
else if ('devices:clone' === cmd) { | ||
all['devices:clone'] = function () { | ||
// for when you want to move copy all associated domains of one device to a new device | ||
@@ -627,3 +635,3 @@ // TODO devices:pair - two-way continuous clone | ||
else if ('devices:token' === cmd || 'dns:token' === cmd || 'domains:token' === cmd) { | ||
all['devices:token'] = all['dns:token'] = all['domains:token'] = function () { | ||
program | ||
@@ -652,5 +660,5 @@ .usage('dns:token -n <domainname>') | ||
}); | ||
} | ||
}; | ||
else if ('wallet' === cmd) { | ||
all['wallet'] = function () { | ||
console.log(""); | ||
@@ -668,5 +676,5 @@ console.log("Usage: daplie wallet:COMMAND [command-specific-options]"); | ||
return; | ||
} | ||
}; | ||
else if ('wallet:sources' === cmd) { | ||
all['wallet:sources'] = function () { | ||
program.provider = cliOptions.provider; | ||
@@ -676,5 +684,5 @@ var opts = program.opts(); | ||
listCards(opts, null); | ||
} | ||
}; | ||
else if ('wallet:sources:add' === cmd) { | ||
all['wallet:sources:add'] = function () { | ||
program | ||
@@ -711,5 +719,5 @@ .usage('wallet:sources:add') | ||
}); | ||
} | ||
}; | ||
else if ('wallet:sources:update' === cmd) { | ||
all['wallet:sources:update'] = function () { | ||
program | ||
@@ -741,3 +749,2 @@ .usage('wallet:sources:update --last4 <xxxx>') | ||
var opts = program.opts(); | ||
opts.ccPriority = opts.priority; | ||
@@ -765,5 +772,5 @@ opts.ccNick = opts.nick; | ||
}); | ||
} | ||
}; | ||
else if ('wallet:sources:remove' === cmd) { | ||
all['wallet:sources:remove'] = function () { | ||
program | ||
@@ -778,2 +785,3 @@ .usage('wallet:sources:remove --last4 <xxxx>') | ||
var opts = program.opts(); | ||
if (helpme) { | ||
@@ -802,8 +810,11 @@ program.help(); | ||
program.provider = cliOptions.provider; | ||
oauth3.Cards.remove(program.opts()).then(function (/*deletedCard*/) { | ||
opts.provider = cliOptions.provider; | ||
oauth3.Cards.remove(opts).then(function (/*deletedCard*/) { | ||
return listCards(opts, null); | ||
}); | ||
}; | ||
if (all[cmd]) { | ||
all[cmd](); | ||
} | ||
else { | ||
@@ -810,0 +821,0 @@ console.error("'" + cmd + "' Not Implemented Yet!"); |
{ | ||
"name": "daplie-tools", | ||
"version": "1.0.0-alpha.902", | ||
"version": "1.0.0-alpha.903", | ||
"description": "Taking back the Internet", | ||
@@ -35,5 +35,5 @@ "main": "index.js", | ||
"commander": "^2.9.0", | ||
"oauth3-cli": "git+https://github.com/OAuth3/oauth3-cli.git#v1.0.0-alpha.902", | ||
"oauth3-cli": "git+https://github.com/OAuth3/oauth3-cli.git#v1.0.0-alpha.903", | ||
"request": "^2.69.0" | ||
} | ||
} |
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
Git dependency
Supply chain riskContains a dependency which resolves to a remote git URL. Dependencies fetched from git URLs are not immutable can be used to inject untrusted code or reduce the likelihood of a reproducible install.
Found 1 instance in 1 package
26388
722