UNPKG

@apillon/cli

Version:
49 lines 2.06 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.createIpnsCommands = void 0; const ipns_service_1 = require("./ipns.service"); function createIpnsCommands(storageCli) { const ipns = storageCli .command('ipns') .requiredOption('-b, --bucket-uuid <uuid>', 'UUID of bucket') .description('Subcommands for manipulating IPNS records in a storage bucket'); ipns .command('list') .description('List all IPNS records for this bucket') .action(async function () { await (0, ipns_service_1.listIpnsNames)(this.optsWithGlobals()); }); ipns .command('create') .description('Create a new IPNS record for this bucket') .requiredOption('-n, --name <name>', 'Name of the IPNS record') .option('-d, --description <description>', 'Description of the IPNS record') .option('-c, --cid <cid>', 'Targeted CID') .action(async function () { await (0, ipns_service_1.createIpns)(this.optsWithGlobals()); }); ipns .command('get') .description('Get IPNS details') .requiredOption('-i, --ipns-uuid <uuid>', 'UUID of the IPNS record') .action(async function () { await (0, ipns_service_1.getIpns)(this.optsWithGlobals()); }); ipns .command('publish') .description('Publish an IPNS record to IPFS and link it to a CID') .requiredOption('-i, --ipns-uuid <uuid>', 'UUID of the IPNS record') .requiredOption('-c, --cid <string>', 'Targeted CID') .action(async function () { await (0, ipns_service_1.publishIpns)(this.optsWithGlobals()); }); ipns .command('delete') .description('Delete an IPNS record from the bucket') .requiredOption('-i, --ipns-uuid <uuid>', 'UUID of the IPNS record') .action(async function () { await (0, ipns_service_1.deleteIpns)(this.optsWithGlobals()); }); } exports.createIpnsCommands = createIpnsCommands; //# sourceMappingURL=ipns.commands.js.map