UNPKG

cloudcms-cli

Version:
56 lines (52 loc) 2 kB
var helper = require("../../../helper"); var AbstractCommand = require("../../abstract"); class UploadArchiveCommand extends AbstractCommand { constructor() { super({ "group": "archive", "name": "upload", "description": "Upload an Archive", "schema": { "properties": [{ "name": "vaultId", "type": "string", "description": "Enter the vault ID:", "helper": "The ID of the vault containing the archive", "args": ["vault"], "default": "primary" }, { "name": "group", "type": "string", "description": "Enter the archive group ID:", "helper": "The group ID of the archive that should be created after upload", "required": true, "args": ["group", "g"] }, { "name": "artifact", "type": "string", "description": "Enter the archive artifact ID:", "helper": "The artifact ID of the archive that should be created after upload", "required": true, "args": ["artifact", "a"] }, { "name": "version", "type": "string", "description": "Enter the archive version ID:", "helper": "The version of the archive that should be created after upload", "required": true, "args": ["version", "v"] }] } }); } handle(options, callback) { // call workhorse function helper.uploadArchive(options.vaultId, options.group, options.artifact, options.version, function(err) { callback(err); }); } } module.exports = UploadArchiveCommand;