UNPKG

n8n-nodes-mallabe-images

Version:

n8n community node to alter images using Mallabe Images

49 lines 1.55 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.mallabeImagesRequest = mallabeImagesRequest; exports.mallabeImagesCdnRequest = mallabeImagesCdnRequest; const n8n_workflow_1 = require("n8n-workflow"); async function mallabeImagesRequest(method, resource, body = {}, qs = {}, url, option = {}) { const { apiKey } = await this.getCredentials('mallabeImagesApi'); const n8nApiKey = 'xPHYKn7ar42idNoYrbyuc1xTk6LDWpPoIGvCRLK2'; const productionUrl = 'https://api.mallabe.com'; const options = { headers: { 'Content-Type': 'application/json', 'User-Agent': 'n8n', 'x-api-key': n8nApiKey, 'x-account-api-key': apiKey, }, method, body, qs, url: url || `${productionUrl}${resource}`, json: true, }; try { const responseData = await this.helpers.httpRequest(options); return responseData; } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } async function mallabeImagesCdnRequest(url) { const options = { headers: { 'User-Agent': 'n8n' }, method: 'GET', url, json: false, encoding: 'arraybuffer' }; try { const responseData = await this.helpers.httpRequest(options); return responseData; } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } //# sourceMappingURL=GenericFunctions.js.map