UNPKG

n8n-nodes-brightdata

Version:

Community node to work with BrightData service for scraping purposes

28 lines 878 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.brightdataApiRequest = void 0; const n8n_workflow_1 = require("n8n-workflow"); async function brightdataApiRequest(method, endpoint, body, query, option = {}) { const options = { method, headers: { 'User-Agent': 'n8n', }, body, qs: query, url: 'https://api.brightdata.com', json: true, }; if (Object.keys(option).length !== 0) { Object.assign(options, option); } options.url += endpoint; try { return await this.helpers.requestWithAuthentication.call(this, 'brightdataApi', options); } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } exports.brightdataApiRequest = brightdataApiRequest; //# sourceMappingURL=GenericFunctions.js.map