n8n-nodes-brightdata
Version:
Community node to work with BrightData service for scraping purposes
40 lines (38 loc) • 1.72 kB
JavaScript
;
!function(){try{var e="undefined"!=typeof window?window:"undefined"!=typeof global?global:"undefined"!=typeof globalThis?globalThis:"undefined"!=typeof self?self:{},n=(new e.Error).stack;n&&(e._sentryDebugIds=e._sentryDebugIds||{},e._sentryDebugIds[n]="fdc79dc2-293c-58fa-8baf-7687ac26a812")}catch(e){}}();
Object.defineProperty(exports, "__esModule", { value: true });
exports.getActiveZones = getActiveZones;
exports.getCountries = getCountries;
exports.getDataSets = getDataSets;
const GenericFunctions_1 = require("./GenericFunctions");
async function getActiveZones() {
const responseData = await GenericFunctions_1.brightdataApiRequest.call(this, 'GET', '/zone/get_active_zones', {}, {});
const results = responseData.map((item) => ({
name: item.name,
value: item.name,
type: item.type,
}));
return { results };
}
async function getCountries() {
const responseData = await GenericFunctions_1.brightdataApiRequest.call(this, 'GET', '/countrieslist', {}, {});
const results = responseData.zone_type.DC_shared.country_codes.map((code) => ({
name: code,
value: code,
type: 'DC_shared',
}));
results.sort((a, b) => a.name.localeCompare(b.name));
return { results };
}
async function getDataSets() {
const responseData = await GenericFunctions_1.brightdataApiRequest.call(this, 'GET', '/datasets/list', {}, {});
const results = responseData.map((item) => ({
name: item.name,
value: item.id,
type: item.id,
}));
results.sort((a, b) => a.name.localeCompare(b.name));
return { results };
}
//# sourceMappingURL=SearchFunctions.js.map
//# debugId=fdc79dc2-293c-58fa-8baf-7687ac26a812