@poli-digital/n8n-nodes-poli
Version:
Nó para interagir com a API da Poli
20 lines • 887 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.listWebhooks = exports.createWebhook = void 0;
const base_1 = require("../resources/base");
async function createWebhook(i) {
const body = {
applicationId: this.getNodeParameter('applicationId', i),
url: this.getNodeParameter('url', i),
subscriptions: this.getNodeParameter('subscriptions', i),
};
return await base_1.BaseResource.makeRequest(this, 'POST', '/webhooks', body, i);
}
exports.createWebhook = createWebhook;
async function listWebhooks(i) {
const applicationId = this.getNodeParameter('applicationId', i);
const response = await base_1.BaseResource.makeRequest(this, 'GET', `/applications/${applicationId}/webhooks`, {}, i);
return response.webhooks || [];
}
exports.listWebhooks = listWebhooks;
//# sourceMappingURL=webhookOperations.js.map