UNPKG

n8n

Version:

n8n Workflow Automation Tool

65 lines 3.16 kB
"use strict"; var __decorate = (this && this.__decorate) || function (decorators, target, key, desc) { var c = arguments.length, r = c < 3 ? target : desc === null ? desc = Object.getOwnPropertyDescriptor(target, key) : desc, d; if (typeof Reflect === "object" && typeof Reflect.decorate === "function") r = Reflect.decorate(decorators, target, key, desc); else for (var i = decorators.length - 1; i >= 0; i--) if (d = decorators[i]) r = (c < 3 ? d(r) : c > 3 ? d(target, key, r) : d(target, key)) || r; return c > 3 && r && Object.defineProperty(target, key, r), r; }; var __metadata = (this && this.__metadata) || function (k, v) { if (typeof Reflect === "object" && typeof Reflect.metadata === "function") return Reflect.metadata(k, v); }; Object.defineProperty(exports, "__esModule", { value: true }); exports.OrchestrationController = void 0; const decorators_1 = require("../decorators"); const orchestration_service_1 = require("../services/orchestration.service"); const License_1 = require("../License"); let OrchestrationController = class OrchestrationController { constructor(orchestrationService, licenseService) { this.orchestrationService = orchestrationService; this.licenseService = licenseService; } async getWorkersStatus(req) { if (!this.licenseService.isWorkerViewLicensed()) return; const id = req.params.id; return await this.orchestrationService.getWorkerStatus(id); } async getWorkersStatusAll() { if (!this.licenseService.isWorkerViewLicensed()) return; return await this.orchestrationService.getWorkerStatus(); } async getWorkerIdsAll() { if (!this.licenseService.isWorkerViewLicensed()) return; return await this.orchestrationService.getWorkerIds(); } }; exports.OrchestrationController = OrchestrationController; __decorate([ (0, decorators_1.GlobalScope)('orchestration:read'), (0, decorators_1.Post)('/worker/status/:id'), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", Promise) ], OrchestrationController.prototype, "getWorkersStatus", null); __decorate([ (0, decorators_1.GlobalScope)('orchestration:read'), (0, decorators_1.Post)('/worker/status'), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], OrchestrationController.prototype, "getWorkersStatusAll", null); __decorate([ (0, decorators_1.GlobalScope)('orchestration:list'), (0, decorators_1.Post)('/worker/ids'), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], OrchestrationController.prototype, "getWorkerIdsAll", null); exports.OrchestrationController = OrchestrationController = __decorate([ (0, decorators_1.RestController)('/orchestration'), __metadata("design:paramtypes", [orchestration_service_1.OrchestrationService, License_1.License]) ], OrchestrationController); //# sourceMappingURL=orchestration.controller.js.map