UNPKG

@apify/n8n-nodes-apify

Version:
31 lines 1.31 kB
"use strict"; Object.defineProperty(exports, "__esModule", { value: true }); exports.getActorRuns = getActorRuns; const n8n_workflow_1 = require("n8n-workflow"); const genericFunctions_1 = require("../../genericFunctions"); async function getActorRuns(i) { var _a, _b; const offset = this.getNodeParameter('offset', i, 0); const limit = this.getNodeParameter('limit', i, 50); const desc = this.getNodeParameter('desc', i); const status = this.getNodeParameter('status', i); const statusFilter = status === '' ? undefined : status; const actorId = this.getNodeParameter('userActorId', i, undefined, { extractValue: true, }); if (!actorId) { throw new n8n_workflow_1.NodeOperationError(this.getNode(), 'Actor ID is required'); } try { const apiResult = await genericFunctions_1.apiRequest.call(this, { method: 'GET', uri: `/v2/acts/${actorId}/runs`, qs: { limit, offset, desc, status: statusFilter }, }); return this.helpers.returnJsonArray((_b = (_a = apiResult.data) === null || _a === void 0 ? void 0 : _a.items) !== null && _b !== void 0 ? _b : []); } catch (error) { throw new n8n_workflow_1.NodeApiError(this.getNode(), error); } } //# sourceMappingURL=execute.js.map