* chore: convert basic RefreshToken model to TypeORM entity Co-authored-by: v1b3m <vibenjamin6@gmail.com> * Fix import Co-authored-by: v1b3m <vibenjamin6@gmail.com> --------- Co-authored-by: v1b3m <vibenjamin6@gmail.com>
42 lines
1021 B
TypeScript
42 lines
1021 B
TypeScript
import {
|
|
AutoResolverOpts,
|
|
PagingStrategies,
|
|
ReadResolverOpts,
|
|
} from '@ptc-org/nestjs-query-graphql';
|
|
import { SortDirection } from '@ptc-org/nestjs-query-core';
|
|
|
|
import { JwtAuthGuard } from 'src/guards/jwt.auth.guard';
|
|
|
|
import { RefreshToken } from './refresh-token.entity';
|
|
|
|
import { CreateRefreshTokenInput } from './dtos/create-refresh-token.input';
|
|
|
|
export const refreshTokenAutoResolverOpts: AutoResolverOpts<
|
|
any,
|
|
any,
|
|
unknown,
|
|
unknown,
|
|
ReadResolverOpts<any>,
|
|
PagingStrategies
|
|
>[] = [
|
|
{
|
|
EntityClass: RefreshToken,
|
|
DTOClass: RefreshToken,
|
|
CreateDTOClass: CreateRefreshTokenInput,
|
|
enableTotalCount: true,
|
|
pagingStrategy: PagingStrategies.CURSOR,
|
|
read: {
|
|
defaultSort: [{ field: 'id', direction: SortDirection.DESC }],
|
|
},
|
|
create: {
|
|
many: { disabled: true },
|
|
},
|
|
update: {
|
|
many: { disabled: true },
|
|
one: { disabled: true },
|
|
},
|
|
delete: { many: { disabled: true }, one: { disabled: true } },
|
|
guards: [JwtAuthGuard],
|
|
},
|
|
];
|