UNPKG

n8n-nodes-octavehq

Version:

Octave is the AI-powered messaging brain for B2B go-to-market teams, helping articulate product value, synthesize customer interaction data, and deploy consistent, effective messaging across all channels.

191 lines 9.17 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.Octave = void 0; const router_1 = require("./actions/router"); const loadOptions_1 = require("./methods/loadOptions"); const AgentDescription_1 = require("./descriptions/AgentDescription"); const ApiKeyDescription_1 = require("./descriptions/ApiKeyDescription"); const AsyncDescription_1 = require("./descriptions/AsyncDescription"); const HeadlessDescription_1 = require("./descriptions/HeadlessDescription"); const PersonaDescription_1 = require("./descriptions/PersonaDescription"); const PlaybookDescription_1 = require("./descriptions/PlaybookDescription"); const ProductDescription_1 = require("./descriptions/ProductDescription"); const ReferenceDescription_1 = require("./descriptions/ReferenceDescription"); const UseCaseDescription_1 = require("./descriptions/UseCaseDescription"); const buildWorkspace_operation_1 = require("./actions/agent/buildWorkspace.operation"); const enrichCompany_operation_1 = require("./actions/agent/enrichCompany.operation"); const enrichPerson_operation_1 = require("./actions/agent/enrichPerson.operation"); const generateContent_operation_1 = require("./actions/agent/generateContent.operation"); const list_operation_1 = require("./actions/agent/list.operation"); const personalizeTemplate_operation_1 = require("./actions/agent/personalizeTemplate.operation"); const qualifyCompany_operation_1 = require("./actions/agent/qualifyCompany.operation"); const qualifyPerson_operation_1 = require("./actions/agent/qualifyPerson.operation"); const runProspector_operation_1 = require("./actions/agent/runProspector.operation"); const runSequence_operation_1 = require("./actions/agent/runSequence.operation"); const create_operation_1 = require("./actions/playbook/create.operation"); const get_operation_1 = require("./actions/playbook/get.operation"); const list_operation_2 = require("./actions/playbook/list.operation"); const list_operation_3 = require("./actions/apiKey/list.operation"); const get_operation_2 = require("./actions/product/get.operation"); const list_operation_4 = require("./actions/product/list.operation"); const get_operation_3 = require("./actions/persona/get.operation"); const list_operation_5 = require("./actions/persona/list.operation"); const create_operation_2 = require("./actions/reference/create.operation"); const get_operation_4 = require("./actions/reference/get.operation"); const list_operation_6 = require("./actions/reference/list.operation"); const get_operation_5 = require("./actions/useCase/get.operation"); const list_operation_7 = require("./actions/useCase/list.operation"); const generateHeadlessEmails_operation_1 = require("./actions/async/generateHeadlessEmails.operation"); const runAgent_operation_1 = require("./actions/async/runAgent.operation"); const generateEmails_operation_1 = require("./actions/headless/generateEmails.operation"); class Octave { constructor() { this.description = { displayName: 'Octave', name: 'octave', icon: 'file:octave.svg', group: ['ai'], version: 1, subtitle: '={{$parameter["operation"].replace(/([A-Z])/g, " $1").replace(/^./, c => c.toUpperCase()) }}', description: 'Interact with the Octave V2 API', defaults: { name: 'Octave', }, usableAsTool: true, inputs: ["main"], outputs: ["main"], credentials: [ { name: 'octaveApi', required: true, }, ], properties: [ { displayName: 'Resource', name: 'resource', type: 'options', noDataExpression: true, options: [ { name: 'Agent', value: 'agent', }, { name: 'API Key', value: 'apiKey', }, { name: 'Async', value: 'async', }, { name: 'Headless', value: 'headless', }, { name: 'Persona', value: 'persona', }, { name: 'Playbook', value: 'playbook', }, { name: 'Product', value: 'product', }, { name: 'Reference', value: 'reference', }, { name: 'Use Case', value: 'useCase', }, ], default: 'agent', }, ...AgentDescription_1.agentOperations, ...PlaybookDescription_1.playbookOperations, ...ApiKeyDescription_1.apiKeyOperations, ...ProductDescription_1.productOperations, ...PersonaDescription_1.personaOperations, ...ReferenceDescription_1.referenceOperations, ...UseCaseDescription_1.useCaseOperations, ...AsyncDescription_1.asyncOperations, ...HeadlessDescription_1.headlessOperations, ...list_operation_1.exportedProperties, ...enrichCompany_operation_1.exportedProperties, ...enrichPerson_operation_1.exportedProperties, ...generateContent_operation_1.exportedProperties, ...runSequence_operation_1.exportedProperties, ...personalizeTemplate_operation_1.exportedProperties, ...runProspector_operation_1.exportedProperties, ...qualifyCompany_operation_1.exportedProperties, ...qualifyPerson_operation_1.exportedProperties, ...buildWorkspace_operation_1.exportedProperties, ...list_operation_2.exportedProperties, ...get_operation_1.exportedProperties, ...create_operation_1.exportedProperties, ...list_operation_3.exportedProperties, ...list_operation_4.exportedProperties, ...get_operation_2.exportedProperties, ...list_operation_5.exportedProperties, ...get_operation_3.exportedProperties, ...list_operation_6.exportedProperties, ...get_operation_4.exportedProperties, ...create_operation_2.exportedProperties, ...list_operation_7.exportedProperties, ...get_operation_5.exportedProperties, ...runAgent_operation_1.exportedProperties, ...generateHeadlessEmails_operation_1.exportedProperties, ...generateEmails_operation_1.exportedProperties, ], }; this.methods = { loadOptions: { getAgents: loadOptions_1.getAgents, getPlaybooks: loadOptions_1.getPlaybooks, getPersonas: loadOptions_1.getPersonas, }, }; } async execute() { const items = this.getInputData(); const returnData = []; for (let i = 0; i < items.length; i++) { try { const result = await router_1.router.call(this, i); if (result && result.length > 0 && result[0].length > 0) { returnData.push(...result[0]); } } catch (error) { if (this.continueOnFail()) { const errorJson = { error: error.message }; if (error.context) errorJson.context = error.context; if (error.response && error.response.body) { try { errorJson.apiResponse = typeof error.response.body === 'string' ? JSON.parse(error.response.body) : error.response.body; } catch (parseError) { errorJson.apiResponse = error.response.body; errorJson.parseError = 'Failed to parse API response body.'; } } else if (error.cause) { errorJson.cause = error.cause; } returnData.push({ json: errorJson, pairedItem: i }); continue; } throw error; } } return [returnData]; } } exports.Octave = Octave; //# sourceMappingURL=Octave.node.js.map