UNPKG

n8n-nodes-amocrm

Version:
25 lines 984 B
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.execute = void 0; const transport_1 = require("../../../transport"); async function execute(index) { const body = {}; const qs = {}; const returnAll = this.getNodeParameter('returnAll', 0); if (!returnAll) { const page = this.getNodeParameter('page', 0); qs.page = page; } const limit = this.getNodeParameter('limit', 0); qs.limit = limit; const requestMethod = 'GET'; const endpoint = `catalogs`; if (returnAll) { const responseData = await await transport_1.apiRequestAllItems.call(this, requestMethod, endpoint, body, qs); return this.helpers.returnJsonArray(responseData); } const responseData = await transport_1.apiRequest.call(this, requestMethod, endpoint, body, qs); return this.helpers.returnJsonArray(responseData); } exports.execute = execute; //# sourceMappingURL=execute.js.map