ams-ssk
Version:
NestJS AMS Library for file management
140 lines • 5.42 kB
JavaScript
;
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.BroadcastResponseDto = exports.ConfigurationResponseDto = exports.BotStatusResponseDto = exports.BroadcastMessageDto = exports.MessageType = void 0;
const swagger_1 = require("@nestjs/swagger");
const class_validator_1 = require("class-validator");
var MessageType;
(function (MessageType) {
MessageType["TEXT"] = "text";
MessageType["PHOTO"] = "photo";
MessageType["VIDEO"] = "video";
})(MessageType || (exports.MessageType = MessageType = {}));
class BroadcastMessageDto {
constructor() {
this.type = MessageType.TEXT;
}
}
exports.BroadcastMessageDto = BroadcastMessageDto;
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Message text or caption for media',
example: 'Hello everyone! Check out this photo.',
}),
(0, class_validator_1.IsString)(),
(0, class_validator_1.IsNotEmpty)(),
__metadata("design:type", String)
], BroadcastMessageDto.prototype, "message", void 0);
__decorate([
(0, swagger_1.ApiPropertyOptional)({
enum: MessageType,
default: MessageType.TEXT,
description: 'Type of message to broadcast',
}),
(0, class_validator_1.IsEnum)(MessageType),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], BroadcastMessageDto.prototype, "type", void 0);
__decorate([
(0, swagger_1.ApiPropertyOptional)({
description: 'URL of the media to be sent (required for photo/video types)',
example: 'https://example.com/image.jpg',
}),
(0, class_validator_1.IsUrl)({ protocols: ['http', 'https'], require_protocol: true }),
(0, class_validator_1.IsOptional)(),
__metadata("design:type", String)
], BroadcastMessageDto.prototype, "mediaUrl", void 0);
class BotStatusResponseDto {
}
exports.BotStatusResponseDto = BotStatusResponseDto;
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Unique identifier for the bot',
example: 1,
}),
__metadata("design:type", Number)
], BotStatusResponseDto.prototype, "id", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Number of current active operations',
example: 5,
}),
__metadata("design:type", Number)
], BotStatusResponseDto.prototype, "activeOperations", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Maximum allowed concurrent operations',
example: 10,
}),
__metadata("design:type", Number)
], BotStatusResponseDto.prototype, "maxOperations", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Current utilization percentage',
example: 50,
}),
__metadata("design:type", Number)
], BotStatusResponseDto.prototype, "utilizationPercentage", void 0);
class ConfigurationResponseDto {
}
exports.ConfigurationResponseDto = ConfigurationResponseDto;
__decorate([
(0, swagger_1.ApiProperty)({
description: 'List of allowed media types',
example: ['photo', 'video'],
isArray: true,
}),
(0, swagger_1.ApiProperty)({
description: 'Whether the target channel is properly configured',
example: true,
}),
__metadata("design:type", Boolean)
], ConfigurationResponseDto.prototype, "channelConfigured", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Total number of configured bots',
example: 3,
}),
__metadata("design:type", Number)
], ConfigurationResponseDto.prototype, "botsCount", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Maximum concurrent operations allowed per bot',
example: 10,
}),
__metadata("design:type", Number)
], ConfigurationResponseDto.prototype, "maxOperationsPerBot", void 0);
class BroadcastResponseDto {
}
exports.BroadcastResponseDto = BroadcastResponseDto;
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Whether the broadcast was successful',
example: true,
}),
__metadata("design:type", Boolean)
], BroadcastResponseDto.prototype, "success", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Message ID in the channel (if available)',
example: '12345',
required: false,
}),
__metadata("design:type", String)
], BroadcastResponseDto.prototype, "messageId", void 0);
__decorate([
(0, swagger_1.ApiProperty)({
description: 'Timestamp of the broadcast',
example: '2025-05-01T12:00:00Z',
}),
__metadata("design:type", String)
], BroadcastResponseDto.prototype, "timestamp", void 0);
//# sourceMappingURL=bot.dto.js.map