UNPKG

n8n-nodes-tenable-community

Version:

n8n node for the Tenable One platform

45 lines (44 loc) 1.78 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.TenableAttackPathAnalysis = void 0; const GenericFunctions_1 = require("./GenericFunctions"); const AttackPathAnalysis_node_options_1 = require("./AttackPathAnalysis.node.options"); class TenableAttackPathAnalysis { constructor() { this.description = { displayName: 'Tenable Attack Path Analysis', name: 'tenableAttackPathAnalysis', icon: 'file:tenable.svg', group: ['input'], version: 1, subtitle: '={{$parameter["operation"]}}', description: 'Interact with Tenable Attack Path Analysis API', defaults: { name: 'Tenable Attack Path Analysis', }, inputs: ["main" /* NodeConnectionType.Main */], outputs: ["main" /* NodeConnectionType.Main */], credentials: [ { name: 'tenableApi', required: true, }, ], properties: AttackPathAnalysis_node_options_1.attackPathAnalysisFields, }; } async execute() { const items = this.getInputData(); const returnData = []; const resource = this.getNodeParameter('resource', 0); const operation = this.getNodeParameter('operation', 0); for (let i = 0; i < items.length; i++) { const body = {}; const qs = {}; const response = await GenericFunctions_1.attackPathAnalysisApiRequest.call(this, resource, operation, body, qs); returnData.push(response); } return [this.helpers.returnJsonArray(returnData)]; } } exports.TenableAttackPathAnalysis = TenableAttackPathAnalysis;