// api/troubleshooting/troubleshooting.operations.ts
import { INodeProperties } from 'n8n-workflow';
import { actioncommandOperations } from './actioncommand/actioncommand.methods';
import { troubleshootingOperations as troubleshootingOps } from './troubleshooting/troubleshooting.methods';

// Export operations
export const troubleshootingOperations = {
	actioncommand: actioncommandOperations,
	troubleshooting: troubleshootingOps,
};

// Resource selector for Troubleshooting domain
const resourceSelector: INodeProperties = {
	displayName: 'Resource',
	name: 'resource',
	type: 'options',
	noDataExpression: true,
	displayOptions: {
		show: {
			domain: ['troubleshooting'],
		},
	},
	options: [
		{
			name: 'Action Command',
			value: 'actioncommand',
			description: 'Execute action commands for troubleshooting',
		},
		{
			name: 'Troubleshooting',
			value: 'troubleshooting',
			description: 'General troubleshooting operations',
		},
	],
	default: 'troubleshooting',
};

// Import all resource description files
import { actioncommandDescriptions } from './actioncommand/actioncommand.descriptions';
import { troubleshootingDescriptions as troubleshootingDescs } from './troubleshooting/troubleshooting.descriptions';

// Export descriptions with resource selector
export const troubleshootingDescriptions: INodeProperties[] = [
	resourceSelector,
	...(Array.isArray(actioncommandDescriptions) ? actioncommandDescriptions : []),
	...(Array.isArray(troubleshootingDescs) ? troubleshootingDescs : []),
];
