UNPKG

pegasys-orchestrate

Version:

The PegaSys Orchestrate library provides convenient access to the Codefi Orchestrate API from applications written in server-side JavaScript

34 lines (33 loc) 1.66 kB
#!/usr/bin/env node "use strict"; Object.defineProperty(exports, "__esModule", { value: true }); const commander_1 = require("commander"); const helpers_1 = require("./helpers"); const program = new commander_1.Command(); program .command('register') .description('Registers a new contract in the remote registry') .requiredOption('-n, --name <str>', 'Name of the contract') .requiredOption('-f, --filepath <filepath>', 'Location of the artifact.json file of the contract') .requiredOption('-e, --endpoint <host:port>', 'Contract registry endpoint in the form host:port') .option('-t, --tag <str>', 'Tag to be attached to the contract') .action(helpers_1.registerContractHandler); program .command('catalog') .description('Returns all the registered contract names') .requiredOption('-e, --endpoint <host:port>', 'Contract registry endpoint in the form host:port') .action(helpers_1.getCatalogHandler); program .command('contract') .description('Returns the registered contract by name and tag') .requiredOption('-n, --name <str>', 'Name of the contract') .requiredOption('-e, --endpoint <host:port>', 'Contract registry endpoint in the form host:port') .option('-t, --tag <str>', '(optional) Tag of the contract') .action(helpers_1.getContractHandler); program .command('tags') .description('Returns all the registered tags of a given contract') .requiredOption('-n, --name <str>', 'Name of the contract') .requiredOption('-e, --endpoint <host:port>', 'Contract registry endpoint in the form host:port') .action(helpers_1.getTagsHandler); program.parse(process.argv);