UNPKG

@poli-digital/n8n-nodes-poli

Version:
21 lines 1.08 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.listWebhooks = exports.createWebhook = void 0; const base_1 = require("../resources/base"); const parameterUtils_1 = require("../utils/parameterUtils"); async function createWebhook(i) { const body = { applicationId: (0, parameterUtils_1.getParameterSafe)(this, 'applicationId', i, '', true), url: (0, parameterUtils_1.getParameterSafe)(this, 'url', i, '', true), subscriptions: (0, parameterUtils_1.getParameterSafe)(this, 'subscriptions', i, [], true), }; return await base_1.BaseResource.makeRequest(this, 'POST', '/webhooks', body, i); } exports.createWebhook = createWebhook; async function listWebhooks(i) { const applicationId = (0, parameterUtils_1.getParameterSafe)(this, 'applicationId', i, '', true); const response = await base_1.BaseResource.makeRequest(this, 'GET', `/applications/${applicationId}/webhooks`, {}, i); return response.webhooks || []; } exports.listWebhooks = listWebhooks; //# sourceMappingURL=webhookOperations.js.map