@apify/n8n-nodes-apify
Version:
n8n nodes for Apify
29 lines • 1.39 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.actorRunsRouter = actorRunsRouter;
const n8n_workflow_1 = require("n8n-workflow");
const index_1 = require("./index");
const get_run_1 = require("./get-run");
const get_user_runs_list_1 = require("./get-user-runs-list");
const get_actor_runs_1 = require("./get-actor-runs");
const execute_1 = require("./get-run/execute");
const execute_2 = require("./get-user-runs-list/execute");
const execute_3 = require("./get-actor-runs/execute");
async function actorRunsRouter(i) {
const resource = this.getNodeParameter('resource', i);
const operation = this.getNodeParameter('operation', i);
if (resource !== index_1.name) {
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Resource ${resource} is not valid for ${index_1.name}. Please use correct resource.`);
}
switch (operation) {
case get_run_1.name:
return await execute_1.getRun.call(this, i);
case get_user_runs_list_1.name:
return await execute_2.getUserRunsList.call(this, i);
case get_actor_runs_1.name:
return await execute_3.getActorRuns.call(this, i);
default:
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation ${operation} not found. Please use correct operation.`);
}
}
//# sourceMappingURL=router.js.map