@apify/n8n-nodes-apify
Version:
n8n nodes for Apify
25 lines • 1.22 kB
JavaScript
;
Object.defineProperty(exports, "__esModule", { value: true });
exports.actorTasksRouter = actorTasksRouter;
const n8n_workflow_1 = require("n8n-workflow");
const index_1 = require("./index");
const run_task_1 = require("./run-task");
const run_task_and_get_dataset_1 = require("./run-task-and-get-dataset");
const execute_1 = require("./run-task/execute");
const execute_2 = require("./run-task-and-get-dataset/execute");
async function actorTasksRouter(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 run_task_1.name:
return await execute_1.runTask.call(this, i);
case run_task_and_get_dataset_1.name:
return await execute_2.runTaskAndGetDataset.call(this, i);
default:
throw new n8n_workflow_1.NodeOperationError(this.getNode(), `Operation ${operation} not found. Please use correct operation.`);
}
}
//# sourceMappingURL=router.js.map