import { Type } from '@nestjs/common'; import { ApiProperty, IntersectionType, OmitType, PartialType, PickType, } from '@nestjs/swagger'; import { PaginatedResponse, PaginationParams, } from '@aleksilassila/reiverr-shared/dist/src/old'; export const PickAndPartial = ( clazz: Type, pick: K[] = [], partial: K[] = [], ) => IntersectionType( OmitType(PickType(clazz, pick), partial), PickType(PartialType(clazz), partial), ); export class PaginatedResponseDto implements PaginatedResponse { @ApiProperty() total: number; @ApiProperty() page: number; @ApiProperty() itemsPerPage: number; // @ApiProperty() items: T[]; } export class PaginationDto implements PaginationParams { @ApiProperty() page: number; @ApiProperty() itemsPerPage: number; } export class SuccessResponseDto { @ApiProperty() success: boolean; } export enum MediaType { Movie = 'movie', Series = 'series', } export enum MediaTypeFull { Movie = 'movie', Series = 'series', Episode = 'episode', }