UNPKG

homebridge-config-ui-x

Version:

A web based management, configuration and control platform for Homebridge

84 lines 3.74 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); }; var __param = (this && this.__param) || function (paramIndex, decorator) { return function (target, key) { decorator(target, key, paramIndex); } }; Object.defineProperty(exports, "__esModule", { value: true }); const common_1 = require("@nestjs/common"); const plugins_service_1 = require("./plugins.service"); const passport_1 = require("@nestjs/passport"); const admin_guard_1 = require("../../core/auth/guards/admin.guard"); let PluginsController = class PluginsController { constructor(pluginsService) { this.pluginsService = pluginsService; } pluginsGet() { return this.pluginsService.getInstalledPlugins(); } pluginsSearch(param) { return this.pluginsService.searchNpmRegistry(param.query); } getPluginConfigSchema(param) { return this.pluginsService.getPluginConfigSchema(param.pluginName); } getPluginChangeLog(param) { return this.pluginsService.getPluginChangeLog(param.pluginName); } getPluginRelease(param) { return this.pluginsService.getPluginRelease(param.pluginName); } }; __decorate([ common_1.UseGuards(admin_guard_1.AdminGuard), common_1.Get(), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", void 0) ], PluginsController.prototype, "pluginsGet", null); __decorate([ common_1.UseGuards(admin_guard_1.AdminGuard), common_1.Get('search/:query'), __param(0, common_1.Param()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], PluginsController.prototype, "pluginsSearch", null); __decorate([ common_1.UseGuards(admin_guard_1.AdminGuard), common_1.Get('config-schema/:pluginName'), __param(0, common_1.Param()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], PluginsController.prototype, "getPluginConfigSchema", null); __decorate([ common_1.UseGuards(admin_guard_1.AdminGuard), common_1.Get('changelog/:pluginName'), __param(0, common_1.Param()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], PluginsController.prototype, "getPluginChangeLog", null); __decorate([ common_1.UseGuards(admin_guard_1.AdminGuard), common_1.Get('release/:pluginName'), __param(0, common_1.Param()), __metadata("design:type", Function), __metadata("design:paramtypes", [Object]), __metadata("design:returntype", void 0) ], PluginsController.prototype, "getPluginRelease", null); PluginsController = __decorate([ common_1.UseGuards(passport_1.AuthGuard()), common_1.Controller('plugins'), __metadata("design:paramtypes", [plugins_service_1.PluginsService]) ], PluginsController); exports.PluginsController = PluginsController; //# sourceMappingURL=plugins.controller.js.map