UNPKG

plazbot-cli

Version:
28 lines (27 loc) 1.09 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clearLinksCommand = void 0; const commander_1 = require("commander"); const plazbot_1 = require("plazbot"); const credentials_1 = require("../../utils/credentials"); exports.clearLinksCommand = new commander_1.Command('clear-links') .description('Eliminar todos los enlaces del portal') .argument('<portalId>', 'ID del portal') .option('--dev', 'Usar entorno de desarrollo') .action(async (portalId, options) => { try { const credentials = await (0, credentials_1.getStoredCredentials)(); const portal = new plazbot_1.Portal({ workspaceId: credentials.workspace, apiKey: credentials.apiKey, zone: credentials.zone, ...(options.dev && { customUrl: "http://localhost:5090" }) }); await portal.clearLinks(portalId); console.log('✅ Enlaces eliminados exitosamente'); } catch (error) { console.error('❌ Error al eliminar los enlaces:', error.message); process.exit(1); } });