UNPKG

fh-fhc

Version:

A Command Line Interface for FeedHenry

34 lines (31 loc) 979 B
/* globals i18n */ var fhreq = require("../../../../../utils/request"); var common = require("../../../../../common"); module.exports = { 'desc' : i18n._('Add Store Item into App Store'), 'examples' : [{ cmd : 'fhc admin appstore storeitems add --id=<id>', desc : i18n._('Add store item with <id> to the App Store') }], 'demand' : ['id'], 'alias' : { 'id' : 'i', 'json' : 'j', 0 :'id' }, 'describe' : { 'id' : i18n._("Unique 24 character GUID of the store item."), 'json' : i18n._('Output into json format') }, 'customCmd': function(params, cb) { common.doApiCall(fhreq.getFeedHenryUrl(), "/box/srv/1.1/admin/appstore/additem", {"guid": params.id}, i18n._("Error updating store item: "), function(err,data) { if (err) { return cb(err); } if (!params.json && data.status === "ok") { return cb(null, i18n._('Item Store added successfully.')); } return cb(null, data); }); } };