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.
62 lines • 1.89 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.exportedProperties = void 0;
exports.execute = execute;
const OctaveApiRequest_1 = require("../../transport/OctaveApiRequest");
const utils_1 = require("../utils");
const properties = [
{
displayName: 'Text Search',
name: 'text',
type: 'string',
default: '',
description: 'Text search query',
},
{
displayName: 'Service OId',
name: 'serviceOId',
type: 'string',
default: '',
description: 'Filter list by a specific Service OId',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
typeOptions: { minValue: 1 },
default: 50,
description: 'Max number of results to return',
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
default: 0,
description: 'Number of results to skip',
},
];
const displayOptions = {
show: {
resource: ['service'],
operation: ['list'],
},
};
exports.exportedProperties = (0, utils_1.applyDisplayOptions)(displayOptions, properties);
async function execute(itemIndex) {
const text = this.getNodeParameter('text', itemIndex);
const serviceOId = this.getNodeParameter('serviceOId', itemIndex);
const limit = this.getNodeParameter('limit', itemIndex);
const offset = this.getNodeParameter('offset', itemIndex);
const qs = {};
if (text)
qs.text = text;
if (serviceOId)
qs.serviceOId = serviceOId;
if (limit)
qs.limit = limit;
if (offset)
qs.offset = offset;
const response = await OctaveApiRequest_1.octaveApiRequest.call(this, 'GET', '/api/v2/service/list', {}, qs);
return [this.helpers.returnJsonArray(response.data || [])];
}
//# sourceMappingURL=list.operation.js.map