powerplatform-mcp
Version:
PowerPlatform Model Context Protocol server
21 lines (20 loc) • 965 B
JavaScript
import { outputResult } from '../output.js';
export function registerDependencyCommands(program, registry) {
program
.command('check-dependencies <componentId> <componentType>')
.description('Check dependencies for a component before deletion')
.action(async (componentId, componentType, _opts, command) => {
const ctx = registry.getContext(command.optsWithGlobals().env);
const service = ctx.getDependencyService();
const result = await service.checkDeleteEligibility(componentId, parseInt(componentType, 10));
outputResult({
fileName: `dependency-${componentId}`,
data: result,
summary: [
`Dependency check for component ${componentId} (type: ${componentType}):`,
` Can delete: ${result.canDelete}`,
` Dependencies: ${result.dependencies.length}`,
].join('\n'),
}, ctx.environmentName);
});
}