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.
84 lines • 2.61 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: 'Resource Type',
name: 'resourceType',
type: 'options',
options: [
{ name: 'Any', value: '' },
{ name: 'Text', value: 'text' },
{ name: 'URL', value: 'url' },
{ name: 'Google Drive', value: 'google_drive' },
],
default: '',
description: 'Filter by resource type',
},
{
displayName: 'Status',
name: 'status',
type: 'options',
options: [
{ name: 'Any', value: '' },
{ name: 'Failed', value: 'failed' },
{ name: 'Indexed', value: 'indexed' },
{ name: 'Pending', value: 'pending' },
{ name: 'Uploading', value: 'uploading' },
],
default: '',
description: 'Filter by processing status',
},
{
displayName: 'Search',
name: 'search',
type: 'string',
default: '',
description: 'Search query',
},
{
displayName: 'Limit',
name: 'limit',
type: 'number',
description: 'Max number of results to return',
typeOptions: { minValue: 1 },
default: 50,
},
{
displayName: 'Offset',
name: 'offset',
type: 'number',
default: 0,
},
];
const displayOptions = {
show: {
resource: ['resource'],
operation: ['list'],
},
};
exports.exportedProperties = (0, utils_1.applyDisplayOptions)(displayOptions, properties);
async function execute(itemIndex) {
const resourceType = this.getNodeParameter('resourceType', itemIndex);
const status = this.getNodeParameter('status', itemIndex);
const search = this.getNodeParameter('search', itemIndex);
const limit = this.getNodeParameter('limit', itemIndex);
const offset = this.getNodeParameter('offset', itemIndex);
const qs = {};
if (resourceType)
qs.resourceType = resourceType;
if (status)
qs.status = status;
if (search)
qs.search = search;
if (limit)
qs.limit = limit;
if (offset)
qs.offset = offset;
const response = await OctaveApiRequest_1.octaveApiRequest.call(this, 'GET', '/api/v2/resource/list', {}, qs);
return [this.helpers.returnJsonArray(response.data || [])];
}
//# sourceMappingURL=list.operation.js.map