UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

26 lines 901 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.clearbitApiRequest = clearbitApiRequest; const n8n_workflow_1 = require("n8n-workflow"); async function clearbitApiRequest(method, api, resource, body = {}, qs = {}, uri, option = {}) { const credentials = await this.getCredentials('clearbitApi'); let options = { headers: { Authorization: `Bearer ${credentials.apiKey}` }, method, qs, body, uri: uri || `https://${api}.clearbit.com${resource}`, json: true, }; options = Object.assign({}, options, option); if (Object.keys(options.body).length === 0) { delete options.body; } try { return await this.helpers.request(options); } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } //# sourceMappingURL=GenericFunctions.js.map