n8n-nodes-smartsuite
Version:
n8n community node for SmartSuite
23 lines • 1.01 kB
JavaScript
;
// src/nodes/SmartSuite/actions/table/getTable.operation.ts
Object.defineProperty(exports, "__esModule", { value: true });
exports.execute = execute;
const n8n_workflow_1 = require("n8n-workflow");
const utils_1 = require("../../helpers/utils");
const smartSuiteApi_1 = require("../../transport/smartSuiteApi");
const validation_1 = require("../../helpers/validation");
async function execute() {
(0, utils_1.debugLog)('[Table] getTable.execute called', this.getNode().parameters, 2);
const returnData = [];
const tableId = await validation_1.getTableId.call(this, 0);
try {
const response = await smartSuiteApi_1.apiRequest.call(this, 'GET', `/applications/${tableId}/`);
(0, utils_1.debugLog)('[Table] getTable.response', response, 2);
returnData.push({ json: response });
}
catch (err) {
throw new n8n_workflow_1.NodeOperationError(this.getNode(), err.message);
}
return returnData;
}
//# sourceMappingURL=getTable.operation.js.map