mirror of
https://github.com/aleksilassila/reiverr.git
synced 2026-04-19 13:53:24 +02:00
feat: Add show stream plugin types
This commit is contained in:
@@ -1,6 +1,23 @@
|
||||
import { ApiProperty } from '@nestjs/swagger';
|
||||
import { Type } from '@nestjs/common';
|
||||
import {
|
||||
ApiProperty,
|
||||
IntersectionType,
|
||||
OmitType,
|
||||
PartialType,
|
||||
PickType,
|
||||
} from '@nestjs/swagger';
|
||||
import { PaginatedResponse, PaginationParams } from 'plugins/plugin-types';
|
||||
|
||||
export const PickAndPartial = <T, K extends keyof T>(
|
||||
clazz: Type<T>,
|
||||
pick: K[] = [],
|
||||
partial: K[] = [],
|
||||
) =>
|
||||
IntersectionType(
|
||||
OmitType(PickType(clazz, pick), partial),
|
||||
PickType(PartialType(clazz), partial),
|
||||
);
|
||||
|
||||
export class PaginatedResponseDto<T> implements PaginatedResponse<T> {
|
||||
@ApiProperty()
|
||||
total: number;
|
||||
@@ -26,4 +43,4 @@ export class PaginationParamsDto implements PaginationParams {
|
||||
export class SuccessResponseDto {
|
||||
@ApiProperty()
|
||||
success: boolean;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user