zapier-platform-cli
Version:
The CLI for apps in the Zapier Developer Platform.
23 lines (19 loc) • 2.4 kB
JavaScript
;
var colors = require('colors');
var utils = require('../utils');
var apps = function apps(context) {
return utils.listApps().then(function (data) {
context.line('All apps listed below.\n');
var ifEmpty = colors.grey('No apps found, maybe try the `zapier register "Example"` command?');
utils.printData(data.apps, [['Title', 'title'], ['Unique Slug', 'key'], ['Timestamp', 'date'], ['Linked', 'linked']], ifEmpty);
if (data.apps.length) {
context.line('\nTry linking the current directory to a different app with the `zapier link` command.');
}
});
};
apps.argsSpec = [];
apps.argOptsSpec = {};
apps.help = 'Lists all the apps you can access.';
apps.example = 'zapier apps';
apps.docs = '\nLists any apps that you have admin access to. Also checks the current directory for a linked app, which you can control with `zapier link`.\n\n**Arguments**\n\n' + utils.argsFragment(apps.argsSpec) + '\n' + utils.argOptsFragment(apps.argOptsSpec) + '\n' + utils.defaultArgOptsFragment() + '\n\n' + '```' + 'bash\n$ zapier apps\n# All apps listed below.\n#\n# \u250C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500-\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u252C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2510\n# \u2502 Title \u2502 Unique Slug \u2502 Timestamp \u2502 Linked \u2502\n# \u251C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500-\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u253C\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2524\n# \u2502 Example \u2502 Example \u2502 2016-01-01T22:19:28 \u2502 \u2714 \u2502\n# \u2514\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500-\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2534\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2500\u2518\n#\n# Try linking the current directory to a different app with the `zapier link` command.\n' + '```' + '\n';
module.exports = apps;