UNPKG

n8n-nodes-arubacentral

Version:

n8n community node for Aruba Central API integration with comprehensive monitoring, configuration, and management capabilities

58 lines (57 loc) 2.35 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.ArubaCentral = void 0; const executeOperation_1 = require("./helpers/executeOperation"); const descriptions_1 = require("./api/descriptions"); const logger_1 = require("./helpers/logger"); class ArubaCentral { constructor() { this.description = { displayName: 'Aruba Central', name: 'arubaCentral', icon: 'file:arubaCentral.svg', group: ['transform'], version: 1, subtitle: '={{$parameter["operation"] + ": " + $parameter["resource"]}}', description: 'Interact with the Aruba Central API', defaults: { name: 'Aruba Central', }, usableAsTool: true, inputs: ['main'], outputs: ['main'], credentials: [ { name: 'ArubaCentralOAuth2Api', required: true, }, ], // Use the consolidated descriptions from the API structure directly properties: descriptions_1.allDescriptions, }; } async execute() { logger_1.logger.info('node:execute', 'Starting Aruba Central node execution'); try { const domain = this.getNodeParameter('domain', 0); const resource = this.getNodeParameter('resource', 0); const operation = this.getNodeParameter('operation', 0); logger_1.logger.info('node:execute', `Executing operation: ${domain}.${resource}.${operation}`); const result = await executeOperation_1.executeOperation.call(this); logger_1.logger.debug('node:execute', `Operation completed successfully with ${result.length} items`); return [result]; } catch (error) { logger_1.logger.error('node:execute:error', error.message); if (this.continueOnFail()) { logger_1.logger.info('node:execute', 'Continuing execution despite error (continueOnFail is enabled)'); return [[{ json: { error: error.message } }]]; } throw error; } finally { logger_1.logger.debug('node:execute', 'Node execution completed'); } } } exports.ArubaCentral = ArubaCentral;