UNPKG

n8n-nodes-base

Version:

Base nodes of n8n

26 lines 905 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.demioApiRequest = demioApiRequest; const n8n_workflow_1 = require("n8n-workflow"); async function demioApiRequest(method, resource, body = {}, qs = {}, uri, option = {}) { try { const credentials = await this.getCredentials('demioApi'); let options = { headers: { 'Api-Key': credentials.apiKey, 'Api-Secret': credentials.apiSecret, }, method, qs, body, uri: uri || `https://my.demio.com/api/v1${resource}`, json: true, }; options = Object.assign({}, options, option); return await this.helpers.request(options); } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } //# sourceMappingURL=GenericFunctions.js.map