n8n-nodes-base
Version:
Base nodes of n8n
31 lines • 894 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.dropcontactApiRequest = dropcontactApiRequest;
exports.mapPairedItemsFrom = mapPairedItemsFrom;
/**
* Make an authenticated API request to Bubble.
*/
async function dropcontactApiRequest(method, endpoint, body, qs) {
const options = {
method,
uri: `https://api.dropcontact.io${endpoint}`,
qs,
body,
json: true,
};
if (!Object.keys(body).length) {
delete options.body;
}
if (!Object.keys(qs).length) {
delete options.qs;
}
return await this.helpers.requestWithAuthentication.call(this, 'dropcontactApi', options);
}
function mapPairedItemsFrom(iterable) {
return Array.from(iterable, (_, i) => i).map((index) => {
return {
item: index,
};
});
}
//# sourceMappingURL=GenericFunction.js.map