Comparing version 2.3.3 to 2.3.4
{ | ||
"name": "akkeris", | ||
"version": "2.3.3", | ||
"version": "2.3.4", | ||
"description": "Akkeris CLI", | ||
@@ -5,0 +5,0 @@ "main": "aka.js", |
@@ -127,2 +127,27 @@ "use strict" | ||
function update_blueprint(args, blueprint) { | ||
let bp = JSON.parse(JSON.stringify(blueprint)) | ||
if(args.logo) { | ||
bp.logo = args.logo | ||
} | ||
if(args.name) { | ||
bp.name = args.name | ||
} | ||
if(args['success-url']) { | ||
bp.success_url = args['success-url'] | ||
} | ||
if(args.env && Array.isArray(args.env)) { | ||
args.env.forEach((env) => { | ||
if(bp.env[env]) { | ||
delete bp.env[env].value | ||
bp.env[env].required = true | ||
} else { | ||
bp.env[env] = {required:true, "description":""} | ||
} | ||
}) | ||
} | ||
return bp | ||
} | ||
function blueprint(appkit, args) { | ||
@@ -133,3 +158,3 @@ appkit.api.get('/apps/' + args.app + '/app-setups', (err, definition) => { | ||
} | ||
console.log(JSON.stringify(definition, null, 2)); | ||
console.log(JSON.stringify(update_blueprint(args, definition), null, 2)); | ||
}); | ||
@@ -145,3 +170,3 @@ } | ||
} | ||
console.log('https://<akkeris ui host>/app-setups?blueprint=' + encodeURIComponent(JSON.stringify(definition))); | ||
console.log('https://<akkeris ui host>/app-setups?blueprint=' + encodeURIComponent(JSON.stringify(update_blueprint(args, definition)))); | ||
}); | ||
@@ -301,2 +326,3 @@ } else { | ||
} | ||
let blueprint_app_option = { | ||
@@ -307,12 +333,32 @@ 'app':{ | ||
'string':true, | ||
'description':'The app to act on.' | ||
} | ||
} | ||
let oneclick_app_option = { | ||
'app':{ | ||
'alias':'a', | ||
'description':'The app to use as a base definition.' | ||
}, | ||
'logo':{ | ||
'alias':'l', | ||
'demand':false, | ||
'string':true, | ||
'description':'The app to act on.' | ||
'description':'The url of this applications logo.' | ||
}, | ||
'name':{ | ||
'alias':'n', | ||
'demand':false, | ||
'string':true, | ||
'description':'The human readable name of the application (not the app name).' | ||
}, | ||
'success-url':{ | ||
'alias':'s', | ||
'demand':false, | ||
'string':true, | ||
'description':'The relative url to send the user once the one-click has been released.' | ||
}, | ||
'env':{ | ||
'alias':'e', | ||
'demand':false, | ||
'string':true, | ||
'type':'array', | ||
'description':'A list of environment variables that will be required.' | ||
} | ||
} | ||
let oneclick_app_option = Object.assign(blueprint_app_option, { | ||
'file':{ | ||
@@ -324,3 +370,3 @@ 'alias':'f', | ||
} | ||
} | ||
}) | ||
appkit.args | ||
@@ -341,3 +387,9 @@ .command('apps', 'list available apps', filter_app_option, list.bind(null, appkit)) | ||
.command('apps:blueprint', 'generates a blueprint (app.json definition) to recreate this app.', blueprint_app_option, blueprint.bind(null, appkit)) | ||
.command('blueprint', false, blueprint_app_option, blueprint.bind(null, appkit)) | ||
.command('apps:blue-print', false, blueprint_app_option, blueprint.bind(null, appkit)) | ||
.command('blue-print', false, 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:oneclick', false, oneclick_app_option, oneclick.bind(null, appkit)) | ||
.command('oneclick', false, oneclick_app_option, oneclick.bind(null, appkit)) | ||
.command('one-click', false, oneclick_app_option, oneclick.bind(null, appkit)) | ||
.command('apps:info', 'show detailed app information', require_app_option, info.bind(null, appkit)) | ||
@@ -344,0 +396,0 @@ .command('info', false, require_app_option, info.bind(null, appkit)) |
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
147925
4400