UNPKG

n8n-nodes-cativa

Version:

This is an n8n community node to communicate with Cativa.

22 lines 970 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.resourceTriggerGroup = void 0; const GenericFunctions_1 = require("../GenericFunctions"); async function resourceTriggerGroup(operation, page) { const credentials = (await this.getCredentials('cativaApi')); const headers = { Authorization: `${credentials.apiKey}`, }; if (operation === 'onNewGroupPosts') { let endpoint = 'https://social-api.cativalab.digital/v1.1/post/feed?groupId={{groupId}}'; const groupId = this.getNodeParameter('groupId'); endpoint = endpoint.replace('{{groupId}}', groupId); const response = await GenericFunctions_1.apiRequest.call(this, 'GET', endpoint, {}, { page, pageNumber: page }, headers, true); return response; } else { throw new Error(''); } } exports.resourceTriggerGroup = resourceTriggerGroup; //# sourceMappingURL=GroupTriggerMethods.js.map