n8n-nodes-tulip
Version:
n8n nodes for sending data to the Tulip API
20 lines • 757 B
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.apiRequest = apiRequest;
async function apiRequest(method, endpoint, body = {}, query = {}, resolveWithFullResponse = false) {
const credentials = await this.getCredentials('tulipApi');
const baseUrl = credentials.factoryUrl.replace(/\/$/, '');
const options = {
method,
body,
qs: query,
url: `${baseUrl}/api/v3/${endpoint}`,
headers: {
'content-type': 'application/json; charset=utf-8',
},
json: true,
resolveWithFullResponse: resolveWithFullResponse,
};
return await this.helpers.requestWithAuthentication.call(this, 'tulipApi', options);
}
//# sourceMappingURL=index.js.map