UNPKG

denwa-nest-shared

Version:

Shared NestJS module for DTO validation, RBAC, TypeORM query building, and OpenAPI client

849 lines • 34.3 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.SortFieldDto = exports.UpdateFilesResponse = exports.UpdateFilesRequest = exports.UpdateImagesResponse = exports.UpdateImagesRequest = exports.IdsDto = exports.InputPreparedFileDto = exports.InputPreparedImageDto = exports.PreparedFileDto = exports.PreparedImageDto = exports.AllImagesDto = exports.AllFilesDto = exports.AddTempImagesDto = exports.TempImagesDto = exports.TempFilesDto = exports.BadGatewayDto = exports.InternalErrorDto = exports.MethodNotAllowedDto = exports.NotFoundDto = exports.ForbiddenDto = exports.UnauthorizedDto = exports.BadRequestDto = exports.CreatedRequestDto = exports.OkRequestDto = exports.FileDto = exports.ImageFileDto = exports.DeleteDto = exports.Paginate = void 0; const graphql_1 = require("@nestjs/graphql"); const swagger_1 = require("@nestjs/swagger"); const class_transformer_1 = require("class-transformer"); const class_validator_1 = require("class-validator"); const decorators_1 = require("./decorators"); let Paginate = class Paginate { page; pages; previous; next; count; limit; }; exports.Paginate = Paginate; __decorate([ (0, swagger_1.ApiProperty)({ example: '1', description: 'Страница', }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], Paginate.prototype, "page", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '10', description: 'Всего страниц', }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], Paginate.prototype, "pages", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: '2', description: 'Предыдущая страница', }), (0, graphql_1.Field)(() => graphql_1.Int, { nullable: true }), __metadata("design:type", Number) ], Paginate.prototype, "previous", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: '3', description: 'Следующая страница', }), (0, graphql_1.Field)(() => graphql_1.Int, { nullable: true }), __metadata("design:type", Number) ], Paginate.prototype, "next", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '1000', description: 'Количество', }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], Paginate.prototype, "count", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '100', description: 'Лимит записей', }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], Paginate.prototype, "limit", void 0); exports.Paginate = Paginate = __decorate([ (0, graphql_1.ObjectType)() ], Paginate); let DeleteDto = class DeleteDto { id; }; exports.DeleteDto = DeleteDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '3422b448-2460-4fd2-9183-8000de6f8343', description: 'Уникальный идентификатор', }), (0, graphql_1.Field)(), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], DeleteDto.prototype, "id", void 0); exports.DeleteDto = DeleteDto = __decorate([ (0, graphql_1.InputType)() ], DeleteDto); class ImageFileDto { imageName; originalFileExtension; entityId; fullPathExample; folder; fileExtensions; prefixes; } exports.ImageFileDto = ImageFileDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert', description: 'Название файла' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], ImageFileDto.prototype, "imageName", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение исходного файла' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], ImageFileDto.prototype, "originalFileExtension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert', description: 'Id сущности' }), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], ImageFileDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], ImageFileDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], ImageFileDto.prototype, "folder", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[webp, jpg]', description: 'Расширения готовых файлов' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], ImageFileDto.prototype, "fileExtensions", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[original, 1280x720]', description: 'Префиксы файла' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], ImageFileDto.prototype, "prefixes", void 0); class FileDto { name; fullName; extension; entityId; fullPathExample; folder; } exports.FileDto = FileDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert', description: 'Название файла' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], FileDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert.jpg', description: 'Полное название файла' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], FileDto.prototype, "fullName", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение исходного файла' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], FileDto.prototype, "extension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Id сущности' }), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], FileDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], FileDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], FileDto.prototype, "folder", void 0); let OkRequestDto = class OkRequestDto { statusCode; message; }; exports.OkRequestDto = OkRequestDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '200', description: 'Статус код' }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], OkRequestDto.prototype, "statusCode", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Успех', description: 'Сообщение' }), (0, graphql_1.Field)({ nullable: true }), __metadata("design:type", String) ], OkRequestDto.prototype, "message", void 0); exports.OkRequestDto = OkRequestDto = __decorate([ (0, graphql_1.ObjectType)() ], OkRequestDto); let CreatedRequestDto = class CreatedRequestDto { statusCode; message; }; exports.CreatedRequestDto = CreatedRequestDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '201', description: 'Статус код' }), (0, graphql_1.Field)(() => graphql_1.Int), __metadata("design:type", Number) ], CreatedRequestDto.prototype, "statusCode", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Успех', description: 'Сообщение' }), (0, graphql_1.Field)({ nullable: true }), __metadata("design:type", String) ], CreatedRequestDto.prototype, "message", void 0); exports.CreatedRequestDto = CreatedRequestDto = __decorate([ (0, graphql_1.ObjectType)() ], CreatedRequestDto); class ErrorDto { message; messages; error; } __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Ошибка', description: 'Сообщение' }), __metadata("design:type", String) ], ErrorDto.prototype, "message", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: '["Ошибка в поле name"]', description: 'Массив сообщений' }), __metadata("design:type", Array) ], ErrorDto.prototype, "messages", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Bad Request', description: 'Сообщение ошибки' }), __metadata("design:type", String) ], ErrorDto.prototype, "error", void 0); class BadRequestDto extends ErrorDto { statusCode; } exports.BadRequestDto = BadRequestDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '400', description: 'Статус код' }), __metadata("design:type", Number) ], BadRequestDto.prototype, "statusCode", void 0); class UnauthorizedDto extends ErrorDto { statusCode; } exports.UnauthorizedDto = UnauthorizedDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '401', description: 'Статус код' }), __metadata("design:type", Number) ], UnauthorizedDto.prototype, "statusCode", void 0); class ForbiddenDto extends ErrorDto { statusCode; } exports.ForbiddenDto = ForbiddenDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '403', description: 'Статус код' }), __metadata("design:type", Number) ], ForbiddenDto.prototype, "statusCode", void 0); class NotFoundDto extends ErrorDto { statusCode; } exports.NotFoundDto = NotFoundDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '404', description: 'Статус код' }), __metadata("design:type", Number) ], NotFoundDto.prototype, "statusCode", void 0); class MethodNotAllowedDto extends ErrorDto { statusCode; } exports.MethodNotAllowedDto = MethodNotAllowedDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '405', description: 'Статус код' }), __metadata("design:type", Number) ], MethodNotAllowedDto.prototype, "statusCode", void 0); class InternalErrorDto extends ErrorDto { statusCode; } exports.InternalErrorDto = InternalErrorDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '500', description: 'Статус код' }), __metadata("design:type", Number) ], InternalErrorDto.prototype, "statusCode", void 0); class BadGatewayDto extends ErrorDto { statusCode; } exports.BadGatewayDto = BadGatewayDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '502', description: 'Статус код' }), __metadata("design:type", Number) ], BadGatewayDto.prototype, "statusCode", void 0); let TempFilesDto = class TempFilesDto { tempName; }; exports.TempFilesDto = TempFilesDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'test.jpg', description: 'Название файла в temp backet' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), (0, class_validator_1.Length)(1, 256), __metadata("design:type", String) ], TempFilesDto.prototype, "tempName", void 0); exports.TempFilesDto = TempFilesDto = __decorate([ (0, graphql_1.InputType)() ], TempFilesDto); let TempImagesDto = class TempImagesDto extends TempFilesDto { altRU; altEN; altAR; }; exports.TempImagesDto = TempImagesDto; __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Вид на Сочи', description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], TempImagesDto.prototype, "altRU", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], TempImagesDto.prototype, "altEN", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], TempImagesDto.prototype, "altAR", void 0); exports.TempImagesDto = TempImagesDto = __decorate([ (0, graphql_1.InputType)() ], TempImagesDto); let AddTempImagesDto = class AddTempImagesDto extends TempImagesDto { id; }; exports.AddTempImagesDto = AddTempImagesDto; __decorate([ (0, swagger_1.ApiProperty)({ example: '3422b448-2460-4fd2-9183-8000de6f8343', description: 'Уникальный идентификатор', }), (0, graphql_1.Field)(), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], AddTempImagesDto.prototype, "id", void 0); exports.AddTempImagesDto = AddTempImagesDto = __decorate([ (0, graphql_1.InputType)() ], AddTempImagesDto); let AllFilesDto = class AllFilesDto { name; tempName; }; exports.AllFilesDto = AllFilesDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'test', description: 'Название файла' }), (0, graphql_1.Field)(() => String, { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.Length)(1, 512), __metadata("design:type", String) ], AllFilesDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'test.jpg', description: 'Название файла в temp backet' }), (0, graphql_1.Field)(() => String, { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), (0, class_validator_1.Length)(1, 512), __metadata("design:type", String) ], AllFilesDto.prototype, "tempName", void 0); exports.AllFilesDto = AllFilesDto = __decorate([ (0, graphql_1.InputType)() ], AllFilesDto); let AllImagesDto = class AllImagesDto extends AllFilesDto { altRU; altEN; altAR; }; exports.AllImagesDto = AllImagesDto; __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Вид на Сочи', description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesDto.prototype, "altRU", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesDto.prototype, "altEN", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesDto.prototype, "altAR", void 0); exports.AllImagesDto = AllImagesDto = __decorate([ (0, graphql_1.InputType)() ], AllImagesDto); let PreparedImageDto = class PreparedImageDto { name; fileExtensions; prefixes; originalFileExtension; entityId; fullPathExample; folder; altRU; altEN; altAR; }; exports.PreparedImageDto = PreparedImageDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwer', description: 'Название файла' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[webp, jpg]', description: 'Расширения файла' }), (0, graphql_1.Field)(() => [String], { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], PreparedImageDto.prototype, "fileExtensions", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[original, 1280x720]', description: 'Префиксы файла' }), (0, graphql_1.Field)(() => [String], { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], PreparedImageDto.prototype, "prefixes", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение оригинального файла' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), (0, class_validator_1.Length)(1, 10), __metadata("design:type", String) ], PreparedImageDto.prototype, "originalFileExtension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '3422b448-2460-4fd2-9183-8000de6f8343', description: 'Уникальный идентификатор', }), (0, graphql_1.Field)(), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "folder", void 0); __decorate([ (0, swagger_1.ApiPropertyOptional)({ example: 'Яхта', description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "altRU", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "altEN", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedImageDto.prototype, "altAR", void 0); exports.PreparedImageDto = PreparedImageDto = __decorate([ (0, graphql_1.ObjectType)() ], PreparedImageDto); let PreparedFileDto = class PreparedFileDto { name; fullName; extension; entityId; fullPathExample; folder; }; exports.PreparedFileDto = PreparedFileDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert', description: 'Название файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert.jpg', description: 'Полное название файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "fullName", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение исходного файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "extension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Id сущности' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, graphql_1.Field)(() => String, { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], PreparedFileDto.prototype, "folder", void 0); exports.PreparedFileDto = PreparedFileDto = __decorate([ (0, graphql_1.ObjectType)() ], PreparedFileDto); let InputPreparedImageDto = class InputPreparedImageDto { name; fileExtensions; prefixes; originalFileExtension; entityId; fullPathExample; folder; altRU; altEN; altAR; }; exports.InputPreparedImageDto = InputPreparedImageDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwer', description: 'Название файла' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[webp, jpg]', description: 'Расширения файла' }), (0, graphql_1.Field)(() => [String]), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], InputPreparedImageDto.prototype, "fileExtensions", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '[original, 1280x720]', description: 'Префиксы файла' }), (0, graphql_1.Field)(() => [String]), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.IsString)({ each: true }), __metadata("design:type", Array) ], InputPreparedImageDto.prototype, "prefixes", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение оригинального файла' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), (0, class_validator_1.Length)(1, 10), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "originalFileExtension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: '3422b448-2460-4fd2-9183-8000de6f8343', description: 'Уникальный идентификатор', }), (0, graphql_1.Field)(), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, graphql_1.Field)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "folder", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'Яхта', description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "altRU", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "altEN", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание изображения' }), (0, graphql_1.Field)({ nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedImageDto.prototype, "altAR", void 0); exports.InputPreparedImageDto = InputPreparedImageDto = __decorate([ (0, graphql_1.InputType)() ], InputPreparedImageDto); let InputPreparedFileDto = class InputPreparedFileDto { name; fullName; extension; entityId; fullPathExample; folder; }; exports.InputPreparedFileDto = InputPreparedFileDto; __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert', description: 'Название файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert.jpg', description: 'Полное название файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "fullName", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'jpg', description: 'Расширение исходного файла' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "extension", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Id сущности' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsUUID)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "entityId", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'qwert/qwert.jpg', description: 'Пример пути к файлу' }), (0, graphql_1.Field)(() => String), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "fullPathExample", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'video', description: 'Внутренняя папка' }), (0, graphql_1.Field)(() => String, { nullable: true }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], InputPreparedFileDto.prototype, "folder", void 0); exports.InputPreparedFileDto = InputPreparedFileDto = __decorate([ (0, graphql_1.InputType)() ], InputPreparedFileDto); let IdsDto = class IdsDto { ids; }; exports.IdsDto = IdsDto; __decorate([ (0, decorators_1.ApiValidationProperty)({ type: 'string', example: '[3422b448-2460-4fd2-9183-8000de6f8343]', description: 'Массив с id', isArray: true, isUUID: true, }), __metadata("design:type", Array) ], IdsDto.prototype, "ids", void 0); exports.IdsDto = IdsDto = __decorate([ (0, graphql_1.InputType)() ], IdsDto); class AllImagesData { name; tempName; altRU; altEN; altAR; } __decorate([ (0, swagger_1.ApiProperty)({ description: 'Название фото' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesData.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Название нового фото' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesData.prototype, "tempName", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание фото' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesData.prototype, "altRU", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание фото' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesData.prototype, "altEN", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Описание фото' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllImagesData.prototype, "altAR", void 0); class UpdateImagesRequest { id; allImages; images; } exports.UpdateImagesRequest = UpdateImagesRequest; __decorate([ (0, swagger_1.ApiProperty)({ description: 'Id' }), (0, class_validator_1.IsUUID)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], UpdateImagesRequest.prototype, "id", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Информация о фотографиях' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.ValidateNested)({ each: true }), (0, class_transformer_1.Type)(() => AllImagesData), __metadata("design:type", Array) ], UpdateImagesRequest.prototype, "allImages", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Данные картинок' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], UpdateImagesRequest.prototype, "images", void 0); class UpdateImagesResponse { statusCode; message; } exports.UpdateImagesResponse = UpdateImagesResponse; __decorate([ (0, swagger_1.ApiProperty)({ example: '200', description: 'Статус код' }), __metadata("design:type", Number) ], UpdateImagesResponse.prototype, "statusCode", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'Фото обновлены', description: 'Сообщение' }), __metadata("design:type", String) ], UpdateImagesResponse.prototype, "message", void 0); class AllFilesData { name; tempName; } __decorate([ (0, swagger_1.ApiProperty)({ description: 'Название видео' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllFilesData.prototype, "name", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Название нового файла' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], AllFilesData.prototype, "tempName", void 0); class UpdateFilesRequest { id; allFiles; files; } exports.UpdateFilesRequest = UpdateFilesRequest; __decorate([ (0, swagger_1.ApiProperty)({ description: 'Id' }), (0, class_validator_1.IsUUID)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], UpdateFilesRequest.prototype, "id", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Информация о файлах' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsArray)(), (0, class_validator_1.ValidateNested)({ each: true }), (0, class_transformer_1.Type)(() => AllFilesData), __metadata("design:type", Array) ], UpdateFilesRequest.prototype, "allFiles", void 0); __decorate([ (0, swagger_1.ApiProperty)({ description: 'Данные файлов' }), (0, class_validator_1.IsOptional)(), (0, class_validator_1.IsString)(), __metadata("design:type", String) ], UpdateFilesRequest.prototype, "files", void 0); class UpdateFilesResponse { statusCode; message; } exports.UpdateFilesResponse = UpdateFilesResponse; __decorate([ (0, swagger_1.ApiProperty)({ example: '200', description: 'Статус код' }), __metadata("design:type", Number) ], UpdateFilesResponse.prototype, "statusCode", void 0); __decorate([ (0, swagger_1.ApiProperty)({ example: 'Файлы обновлены', description: 'Сообщение' }), __metadata("design:type", String) ], UpdateFilesResponse.prototype, "message", void 0); let SortFieldDto = class SortFieldDto { field; order; }; exports.SortFieldDto = SortFieldDto; __decorate([ (0, decorators_1.ApiValidationProperty)({ type: 'string', }), __metadata("design:type", String) ], SortFieldDto.prototype, "field", void 0); __decorate([ (0, decorators_1.ApiValidationProperty)({ type: 'string', }), __metadata("design:type", String) ], SortFieldDto.prototype, "order", void 0); exports.SortFieldDto = SortFieldDto = __decorate([ (0, graphql_1.InputType)() ], SortFieldDto); //# sourceMappingURL=dto.js.map