UNPKG

ams-ssk

Version:

NestJS AMS Library for file management

93 lines 4.09 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 }); exports.botController = void 0; const common_1 = require("@nestjs/common"); const swagger_1 = require("@nestjs/swagger"); const bot_service_1 = require("./bot.service"); const bot_dto_1 = require("./dto/bot.dto"); let botController = class botController { constructor(botService) { this.botService = botService; } async broadcastMessage(messageDto) { return this.botService.broadcastMessage(messageDto); } async getBotStatus() { return this.botService.getBotStatus(); } async getConfiguration() { return this.botService.getConfiguration(); } }; exports.botController = botController; __decorate([ (0, common_1.Post)('broadcast'), (0, swagger_1.ApiOperation)({ summary: 'Broadcast a message to bot channel', description: 'Send a text, photo, or video message to the configured bot channel using load-balanced bots', }), (0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.OK, description: 'Message broadcasted successfully', type: bot_dto_1.BroadcastResponseDto, }), (0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.BAD_REQUEST, description: 'Invalid message format or missing required fields', }), (0, common_1.UsePipes)(new common_1.ValidationPipe({ transform: true })), __param(0, (0, common_1.Body)()), __metadata("design:type", Function), __metadata("design:paramtypes", [bot_dto_1.BroadcastMessageDto]), __metadata("design:returntype", Promise) ], botController.prototype, "broadcastMessage", null); __decorate([ (0, common_1.Get)('status'), (0, swagger_1.ApiOperation)({ summary: 'Get bot status', description: 'Retrieve current status of bot bots including active operations and utilization', }), (0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.OK, description: 'Bot status retrieved successfully', type: bot_dto_1.BotStatusResponseDto, isArray: true, }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], botController.prototype, "getBotStatus", null); __decorate([ (0, common_1.Get)('config'), (0, swagger_1.ApiOperation)({ summary: 'Get configuration info', description: 'Retrieve current configuration information including allowed media types and bot settings', }), (0, swagger_1.ApiResponse)({ status: common_1.HttpStatus.OK, description: 'Configuration retrieved successfully', type: bot_dto_1.ConfigurationResponseDto, }), __metadata("design:type", Function), __metadata("design:paramtypes", []), __metadata("design:returntype", Promise) ], botController.prototype, "getConfiguration", null); exports.botController = botController = __decorate([ (0, swagger_1.ApiTags)('bot'), (0, swagger_1.ApiSecurity)('api_key'), (0, common_1.Controller)('bot'), __metadata("design:paramtypes", [bot_service_1.botService]) ], botController); //# sourceMappingURL=bot.controller.js.map