n8n-nodes-dataforseo
Version:
DataForSEO is an SEO and marketing data provider, empowering businesses with invaluable insights via APIs and databases.
266 lines • 15.5 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.getGoogleBusinessInfoLive = getGoogleBusinessInfoLive;
exports.getGoogleBusinessInfo = getGoogleBusinessInfo;
exports.getGoogleBusinessUpdates = getGoogleBusinessUpdates;
exports.getGoogleHotelSearchesLive = getGoogleHotelSearchesLive;
exports.getGoogleHotelSearches = getGoogleHotelSearches;
exports.getLiveGoogleHotelInfoAdvanced = getLiveGoogleHotelInfoAdvanced;
exports.getLiveGoogleHotelInfoHtml = getLiveGoogleHotelInfoHtml;
exports.getGoogleHotelInfoAdvanced = getGoogleHotelInfoAdvanced;
exports.getGoogleHotelInfoHtml = getGoogleHotelInfoHtml;
exports.getGoogleReviews = getGoogleReviews;
exports.getExtendedGoogleReviews = getExtendedGoogleReviews;
exports.getBusinessQuestionsAndAnswers = getBusinessQuestionsAndAnswers;
exports.getLiveBusinessQuestionsAndAnswers = getLiveBusinessQuestionsAndAnswers;
const dataForSeoRequest_1 = require("../../../functions/dataForSeoRequest");
const generalFunctions_1 = require("../../../functions/generalFunctions");
async function getGoogleBusinessInfoLive(ef, i) {
const params = {
url: '/business_data/google/my_business_info/live',
body: [{
keyword: ef.getNodeParameter('keyword', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoRequest)(ef, params);
}
async function getGoogleBusinessInfo(ef, i) {
const params = {
url: '/business_data/google/my_business_info/task_post',
body: [{
keyword: ef.getNodeParameter('keyword', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
priority: ef.getNodeParameter('priority', i) || null,
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/my_business_info/task_get/');
}
async function getGoogleBusinessUpdates(ef, i) {
const params = {
url: '/business_data/google/my_business_updates/task_post',
body: [{
keyword: ef.getNodeParameter('keyword', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
priority: ef.getNodeParameter('priority', i) || null,
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/my_business_updates/task_get/');
}
async function getGoogleHotelSearchesLive(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const stars = ef.getNodeParameter('stars', i);
const parsedStars = (0, generalFunctions_1.parseMultiOptionItems)(stars);
const amenities = ef.getNodeParameter('amenities', i);
const params = {
url: '/business_data/google/hotel_searches/live',
body: [{
keyword: ef.getNodeParameter('keyword', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
depth: ef.getNodeParameter('depth_hotels', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null,
stars: parsedStars.length ? parsedStars : null,
min_rating: ef.getNodeParameter('min_rating', i) || null,
sort_by: ef.getNodeParameter('sort_by', i) || null,
min_price: ef.getNodeParameter('min_price', i) || null,
max_price: ef.getNodeParameter('max_price', i) || null,
free_cancellation: ef.getNodeParameter('free_cancellation', i),
is_vacation_rentals: ef.getNodeParameter('is_vacation_rentals', i),
amenities: amenities.length ? amenities : null
}]
};
return (0, dataForSeoRequest_1.dataForSeoRequest)(ef, params);
}
async function getGoogleHotelSearches(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const stars = ef.getNodeParameter('stars', i);
const parsedStars = (0, generalFunctions_1.parseMultiOptionItems)(stars);
const amenities = ef.getNodeParameter('amenities', i);
const params = {
url: '/business_data/google/hotel_searches/task_post',
body: [{
keyword: ef.getNodeParameter('keyword', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
priority: ef.getNodeParameter('priority', i),
depth: ef.getNodeParameter('depth_hotels', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null,
stars: parsedStars.length ? parsedStars : null,
min_rating: ef.getNodeParameter('min_rating', i) || null,
sort_by: ef.getNodeParameter('sort_by', i) || null,
min_price: ef.getNodeParameter('min_price', i) || null,
max_price: ef.getNodeParameter('max_price', i) || null,
free_cancellation: ef.getNodeParameter('free_cancellation', i),
is_vacation_rentals: ef.getNodeParameter('is_vacation_rentals', i),
amenities: amenities.length ? amenities : null
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/hotel_searches/task_get/');
}
async function getLiveGoogleHotelInfoAdvanced(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const params = {
url: '/business_data/google/hotel_info/live/advanced',
body: [{
hotel_identifier: ef.getNodeParameter('hotel_identifier', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null,
load_prices_by_dates: ef.getNodeParameter('load_prices_by_dates', i),
prices_start_date: ef.getNodeParameter('prices_start_date', i) || null,
prices_end_date: ef.getNodeParameter('prices_end_date', i) || null,
prices_date_range: ef.getNodeParameter('prices_date_range', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoRequest)(ef, params);
}
async function getLiveGoogleHotelInfoHtml(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const params = {
url: '/business_data/google/hotel_info/live/html',
body: [{
hotel_identifier: ef.getNodeParameter('hotel_identifier', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null
}]
};
return (0, dataForSeoRequest_1.dataForSeoRequest)(ef, params);
}
async function getGoogleHotelInfoAdvanced(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const params = {
url: '/business_data/google/hotel_info/task_post',
body: [{
hotel_identifier: ef.getNodeParameter('hotel_identifier', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null,
load_prices_by_dates: ef.getNodeParameter('load_prices_by_dates', i),
prices_start_date: ef.getNodeParameter('prices_start_date', i) || null,
prices_end_date: ef.getNodeParameter('prices_end_date', i) || null,
prices_date_range: ef.getNodeParameter('prices_date_range', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/hotel_info/task_get/advanced/');
}
async function getGoogleHotelInfoHtml(ef, i) {
const children = ef.getNodeParameter('children', i);
const parsedChildren = (0, generalFunctions_1.parseMultiOptionItems)(children);
const params = {
url: '/business_data/google/hotel_info/task_post',
body: [{
hotel_identifier: ef.getNodeParameter('hotel_identifier', i),
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
check_in: ef.getNodeParameter('check_in', i) || null,
check_out: ef.getNodeParameter('check_out', i) || null,
currency: ef.getNodeParameter('currency', i) || null,
adults: ef.getNodeParameter('adults', i) || null,
children: parsedChildren.length ? parsedChildren : null,
load_prices_by_dates: ef.getNodeParameter('load_prices_by_dates', i),
prices_start_date: ef.getNodeParameter('prices_start_date', i) || null,
prices_end_date: ef.getNodeParameter('prices_end_date', i) || null,
prices_date_range: ef.getNodeParameter('prices_date_range', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/hotel_info/task_get/html/');
}
async function getGoogleReviews(ef, i) {
const params = {
url: '/business_data/google/reviews/task_post',
body: [{
keyword: ef.getNodeParameter('search_by', i) == 'keyword' ? ef.getNodeParameter('keyword', i) : null,
cid: ef.getNodeParameter('search_by', i) == 'cid' ? ef.getNodeParameter('keyword', i) : null,
place_id: ef.getNodeParameter('search_by', i) == 'place_id' ? ef.getNodeParameter('keyword', i) : null,
priority: ef.getNodeParameter('priority', i) || null,
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
depth: ef.getNodeParameter('depth', i) || null,
sort_by: ef.getNodeParameter('sort_by_reviews', i) || null,
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/reviews/task_get/');
}
async function getExtendedGoogleReviews(ef, i) {
const params = {
url: '/business_data/google/extended_reviews/task_post',
body: [{
keyword: ef.getNodeParameter('search_by', i) == 'keyword' ? ef.getNodeParameter('keyword', i) : null,
cid: ef.getNodeParameter('search_by', i) == 'cid' ? ef.getNodeParameter('keyword', i) : null,
place_id: ef.getNodeParameter('search_by', i) == 'place_id' ? ef.getNodeParameter('keyword', i) : null,
priority: ef.getNodeParameter('priority', i) || null,
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
depth: ef.getNodeParameter('depth_extended_reviews', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/extended_reviews/task_get/');
}
async function getBusinessQuestionsAndAnswers(ef, i) {
const params = {
url: '/business_data/google/questions_and_answers/task_post',
body: [{
keyword: ef.getNodeParameter('keyword', i) || null,
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
priority: ef.getNodeParameter('priority', i) || null,
depth: ef.getNodeParameter('depth_questions', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoPOSTGETRequest)(ef, params, '/business_data/google/questions_and_answers/task_get/');
}
async function getLiveBusinessQuestionsAndAnswers(ef, i) {
const params = {
url: '/business_data/google/questions_and_answers/live',
body: [{
keyword: ef.getNodeParameter('keyword', i) || null,
location_name: ef.getNodeParameter('location_name', i),
language_name: ef.getNodeParameter('language_name', i),
location_coordinate: ef.getNodeParameter('location_coordinate', i) || null,
depth: ef.getNodeParameter('depth_questions', i) || null
}]
};
return (0, dataForSeoRequest_1.dataForSeoRequest)(ef, params);
}
//# sourceMappingURL=google.js.map