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.
43 lines • 1.74 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.exportedProperties = void 0;
exports.execute = execute;
const n8n_workflow_1 = require("n8n-workflow");
const OctaveApiRequest_1 = require("../../transport/OctaveApiRequest");
const utils_1 = require("../utils");
const properties = [
{
displayName: 'Solution OId',
name: 'oId',
type: 'string',
required: true,
default: '',
description: 'OId of the solution to update',
},
{
displayName: 'Data (JSON)',
name: 'data',
type: 'json',
required: true,
default: '{}',
description: 'Solution data fields to update (name, internalName, description, qualifyingQuestions, data: {summary, capabilities, keyOutcomes, customerBenefits, challengesAddressed, statusQuo, differentiatedValue, customFields})',
typeOptions: { rows: 10 },
},
];
const displayOptions = {
show: {
resource: ['solution'],
operation: ['update'],
},
};
exports.exportedProperties = (0, utils_1.applyDisplayOptions)(displayOptions, properties);
async function execute(itemIndex) {
const oId = this.getNodeParameter('oId', itemIndex);
if (!oId) {
throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'OId is required.', { itemIndex });
}
const data = utils_1.parseJsonParameter.call(this, 'data', itemIndex, '{}');
const responseData = await OctaveApiRequest_1.octaveApiRequest.call(this, 'POST', '/api/v2/solution/update', { oId, data });
return [this.helpers.constructExecutionMetaData(this.helpers.returnJsonArray([responseData]), { itemData: { item: itemIndex } })];
}
//# sourceMappingURL=update.operation.js.map