n8n-nodes-brightdata
Version:
Community node to work with BrightData service for scraping purposes
26 lines • 1.02 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getCountries = exports.getActiveZones = void 0;
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 };
}
exports.getActiveZones = getActiveZones;
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 };
}
exports.getCountries = getCountries;
//# sourceMappingURL=SearchFunctions.js.map