Comparing version 2.3.2 to 2.3.3
{ | ||
"name": "akkeris", | ||
"version": "2.3.2", | ||
"version": "2.3.3", | ||
"description": "Akkeris CLI", | ||
@@ -5,0 +5,0 @@ "main": "aka.js", |
"use strict" | ||
const proc = require('child_process'); | ||
const fs = require('fs'); | ||
const rand = require('./random.js'); | ||
@@ -26,3 +27,2 @@ | ||
//TODO: Add 'addons', a list of plans auto created with the app. | ||
let create_apps_options = { | ||
@@ -40,15 +40,2 @@ "space":{ | ||
"description":"The organization to create the app under" | ||
}, | ||
"region":{ | ||
"alias":"r", | ||
"string":true, | ||
"choices":[undefined, "us"], | ||
"default":"us", | ||
"description":"The region to place this app under" | ||
}, | ||
"stack":{ | ||
"string":true, | ||
"choices":[undefined, "alamo-1"], | ||
"default":"alamo-1", | ||
"description":"The version or stack of the platform to use" | ||
} | ||
@@ -151,2 +138,22 @@ } | ||
function oneclick(appkit, args) { | ||
console.assert(args.app || args.file, 'Either an app or a file is required.') | ||
if(args.app) { | ||
appkit.api.get('/apps/' + args.app + '/app-setups', (err, definition) => { | ||
if(err) { | ||
return appkit.terminal.error(err); | ||
} | ||
console.log('https://<akkeris ui host>/app-setups?blueprint=' + encodeURIComponent(JSON.stringify(definition))); | ||
}); | ||
} else { | ||
try { | ||
let bp = JSON.parse(fs.readFileSync(args.file).toString('utf8')) | ||
bp = encodeURIComponent(JSON.stringify(bp)) | ||
console.log('https://<akkeris ui host>/app-setups?blueprint=' + bp); | ||
} catch (e) { | ||
return appkit.terminal.error("The specified file didnt exist or wasnt a valid JSON file.") | ||
} | ||
} | ||
} | ||
function info(appkit, args) { | ||
@@ -293,3 +300,3 @@ console.assert(args.app && args.app !== '', 'An application name was not provided.'); | ||
} | ||
}; | ||
} | ||
let blueprint_app_option = { | ||
@@ -301,8 +308,16 @@ 'app':{ | ||
'description':'The app to act on.' | ||
} | ||
} | ||
let oneclick_app_option = { | ||
'app':{ | ||
'alias':'a', | ||
'demand':false, | ||
'string':true, | ||
'description':'The app to act on.' | ||
}, | ||
'url':{ | ||
'alias':'u', | ||
'boolean':true, | ||
'default':false, | ||
'description':'Output a one-click url to re-create the app rather than the json blueprint.' | ||
'file':{ | ||
'alias':'f', | ||
'demand':false, | ||
'string':true, | ||
'description':'The file containing the blueprint (app.json) of the app.' | ||
} | ||
@@ -324,3 +339,4 @@ } | ||
.command('apps:fork NAME', 'fork an existing app into a new one', fork_app_option, fork.bind(null, appkit)) | ||
.command('apps:blueprint', 'generates an app.json or one-click url button to re-create this app.', blueprint_app_option, blueprint.bind(null, appkit)) | ||
.command('apps:blueprint', 'generates a blueprint (app.json definition) to recreate this app.', blueprint_app_option, blueprint.bind(null, appkit)) | ||
.command('apps:one-click', 'generates a one-click url from an app or blueprint that when clicked will recreate the app.', oneclick_app_option, oneclick.bind(null, appkit)) | ||
.command('apps:info', 'show detailed app information', require_app_option, info.bind(null, appkit)) | ||
@@ -327,0 +343,0 @@ .command('info', false, require_app_option, info.bind(null, appkit)) |
@@ -77,3 +77,3 @@ "use strict" | ||
if(args.shell) { | ||
keys.forEach(config_var => console.log(config_var + "=" + config_vars[config_var])) | ||
keys.forEach(config_var => console.log(config_var + "=\"" + config_vars[config_var].replace(/\"/g, '\\"') + "\"")) | ||
} else if (args.json) { | ||
@@ -80,0 +80,0 @@ var kv = keys.map(config_var => ` "${config_var.replace('"', '\\"')}":"${config_vars[config_var].replace('"', '\\"')}"`) |
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
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
New author
Supply chain riskA new npm collaborator published a version of the package for the first time. New collaborators are usually benign additions to a project, but do indicate a change to the security surface area of a package.
Found 1 instance in 1 package
15
146175
26
4352
31