import { IExecuteFunctions } from 'n8n-workflow';
import { logger } from '../../../helpers/logger';
import { getInfo } from './operations/getInfo.methods';
import { postUsage } from './operations/postUsage.methods';

/**
 * All operations available for the vpn resource
 */
export const vpnOperations = {
	getInfo,
	postUsage,
};

/**
 * Check if a vpn operation exists
 *
 * @param operation Operation name to check
 * @returns boolean indicating if the operation exists
 */
export function hasVpnOperation(operation: string): boolean {
	const exists = !!vpnOperations[operation as keyof typeof vpnOperations];
	logger.debug(
		'monitoring:vpn:check',
		`Operation "${operation}" ${exists ? 'exists' : 'does not exist'}`,
	);
	return exists;
}
