Skip to content

Commit

Permalink
Style: Run linter
Browse files Browse the repository at this point in the history
  • Loading branch information
J-Hoplin committed Sep 16, 2024
1 parent 1699364 commit b615ee6
Show file tree
Hide file tree
Showing 46 changed files with 48 additions and 48 deletions.
2 changes: 1 addition & 1 deletion src/ai_handler.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Handler } from 'aws-lambda';
import { Module } from '@nestjs/common';
import { ConfigModule } from '@nestjs/config';
import { NestFactory } from '@nestjs/core';
import { Handler } from 'aws-lambda';
import { DatabaseModule } from './infrastructure';
import { AiModule } from './infrastructure/ai/ai.module';
import { AiClassificationPayload } from './infrastructure/aws-lambda/type';
Expand Down
2 changes: 1 addition & 1 deletion src/bootstrap.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import express from 'express';
import { NestFactory } from '@nestjs/core';
import { ExpressAdapter } from '@nestjs/platform-express';
import express from 'express';
import { nestAppConfig, nestResponseConfig } from './app.config';
import { AppModule } from './app.module';
import { nestSwaggerConfig } from './app.swagger';
Expand Down
2 changes: 1 addition & 1 deletion src/common/decorators/getUser.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Request } from 'express';
import {
ExecutionContext,
UnauthorizedException,
createParamDecorator,
} from '@nestjs/common';
import { Request } from 'express';
import { ReqUserPayload } from '../types/type';

/**
Expand Down
2 changes: 1 addition & 1 deletion src/common/dto/pagination.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Exclude, Expose, Type } from 'class-transformer';
import { IsEnum, IsNumber, IsOptional, Min } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export enum OrderType {
asc = 'asc',
Expand Down
4 changes: 2 additions & 2 deletions src/common/filter/base.filter.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { captureException } from '@sentry/node';
import { Response } from 'express';
import {
ArgumentsHost,
Catch,
ExceptionFilter,
HttpException,
} from '@nestjs/common';
import { captureException } from '@sentry/node';
import { Response } from 'express';
import { DiscordErrorWebhookProvider } from '@src/infrastructure/discord/discord-error-webhook.provider';
import { RootException, createException } from '../error';
import { ExceptionPayload, ICommonResponse } from '../types/type';
Expand Down
2 changes: 1 addition & 1 deletion src/common/interceptor/response.interceptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Observable, map } from 'rxjs';
import { CallHandler, ExecutionContext, NestInterceptor } from '@nestjs/common';
import { Observable, map } from 'rxjs';
import { ICommonResponse } from '../types/type';

export class CommonResponseInterceptor implements NestInterceptor {
Expand Down
2 changes: 1 addition & 1 deletion src/common/middlewares/logging.interceptor.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { NextFunction, Request, Response } from 'express';
import { Injectable, Logger, NestMiddleware } from '@nestjs/common';
import { NextFunction, Request, Response } from 'express';

@Injectable()
export class LoggerMiddleware implements NestMiddleware {
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/ai/ai.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import OpenAI, { OpenAIError, RateLimitError } from 'openai';
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import OpenAI, { OpenAIError, RateLimitError } from 'openai';
import { DiscordAIWebhookProvider } from '../discord/discord-ai-webhook.provider';
import { gptVersion } from './ai.constant';
import { SummarizeURLContentDto } from './dto';
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/aws-lambda/aws-lambda.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda';
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { InvokeCommand, LambdaClient } from '@aws-sdk/client-lambda';
import { AiClassificationPayload } from './type';

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { BaseDocument } from './base.schema';

@Schema({
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/folder.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { FolderType } from '@src/infrastructure/database/types/folder-type.enum';
import { BaseDocument } from './base.schema';

Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/keyword.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Document } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document } from 'mongoose';

@Schema({ collection: 'keywords', versionKey: false })
export class Keyword {
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/metrics.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';
import { BaseDocument } from './base.schema';

@Schema({ collection: 'metrics', timestamps: true, versionKey: false })
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/post.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { PostAiStatus } from '@src/modules/posts/posts.constant';
import { AIClassification } from './AIClassification.schema';
import { BaseDocument } from './base.schema';
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/postKeyword.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument, Schema as MongooseSchema } from 'mongoose';

@Schema({ collection: 'post_keywords', versionKey: false })
export class PostKeyword {
Expand Down
2 changes: 1 addition & 1 deletion src/infrastructure/database/schema/user.schema.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { HydratedDocument } from 'mongoose';
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { HydratedDocument } from 'mongoose';

@Schema({ collection: 'users', timestamps: true, versionKey: false })
export class User {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/classification/classification.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model, Types } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model, Types } from 'mongoose';
import { AIClassification, Folder } from '@src/infrastructure';
import { FolderType } from '@src/infrastructure/database/types/folder-type.enum';
import { ClassificationFolderWithCount } from './dto/classification.dto';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/classification/classification.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Types } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { BadRequestException } from '@nestjs/common';
import { Types } from 'mongoose';
import { PaginationQuery } from '@src/common';
import { sum } from '@src/common';
import { PostsRepository } from '../posts/posts.repository';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/classification/dto/classification.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsMongoId, IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsMongoId, IsNotEmpty } from 'class-validator';
import { PostAiStatus } from '@src/modules/posts/posts.constant';

export interface ClassificationFolderWithCount {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/classification/dto/getAIFolderNameLIst.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';
import { FolderDocument } from '@src/infrastructure';

export class AIFolderNameServiceDto {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/folders/dto/delete-custom-folder.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class DeleteCustomFolderDto {
@IsString()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/folders/dto/mutate-folder.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsArray, IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsArray, IsNotEmpty, IsString } from 'class-validator';

export class CreateFolderDto {
@IsArray()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/folders/folders.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FilterQuery, Model } from 'mongoose';
import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { FilterQuery, Model } from 'mongoose';
import { Folder, FolderDocument } from '@src/infrastructure';
import { FolderType } from '@src/infrastructure/database/types/folder-type.enum';
import { F002 } from './error';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/folders/folders.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { BadRequestException, Injectable } from '@nestjs/common';
import { Types } from 'mongoose';
import { sum } from '@src/common';
import { FolderType } from '@src/infrastructure/database/types/folder-type.enum';
import { PostsRepository } from '../posts/posts.repository';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/folders/responses/post.response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { ApiProperty } from '@nestjs/swagger';
import { Types } from 'mongoose';
import { Keyword, Post } from '@src/infrastructure';
import { PostAiStatus } from '@src/modules/posts/posts.constant';
import { KeywordItem } from '@src/modules/posts/response/keyword-list.response';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/keywords/keyword.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Keyword } from '@src/infrastructure';

@Injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/metrics/metrics.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { Metrics } from '@src/infrastructure';

@Injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboard/dto/onboard.query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Type } from 'class-transformer';
import { IsNumber, IsOptional, Min } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class OnBoardQuery {
@ApiProperty({
Expand Down
2 changes: 1 addition & 1 deletion src/modules/onboard/onboard.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import * as _ from 'lodash';
import { Injectable } from '@nestjs/common';
import * as _ from 'lodash';
import { OnBoardQuery } from './dto';
import { onBoardCategoryList } from './onboard.const';

Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/docs/createPost.docs.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { Types } from 'mongoose';
import { applyDecorators } from '@nestjs/common';
import {
ApiNotFoundResponse,
ApiOperation,
ApiResponse,
} from '@nestjs/swagger';
import { Types } from 'mongoose';

export const CreatePostDocs = applyDecorators(
ApiOperation({
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/countPost.query.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsBoolean, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';

export class CountPostQueryDto {
@ApiProperty({
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/create-post.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsMongoId, IsNotEmpty, IsUrl } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsMongoId, IsNotEmpty, IsUrl } from 'class-validator';

export class CreatePostDto {
@IsMongoId()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/find-in-folder.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsBoolean, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { PaginationQuery } from '@src/common';

export class GetPostQueryDto extends PaginationQuery {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/list-post.dto.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { ApiProperty } from '@nestjs/swagger';
import { Transform } from 'class-transformer';
import { IsBoolean, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { PaginationQuery } from '@src/common';

export class ListPostQueryDto extends PaginationQuery {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/updatePost.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsBoolean, IsDateString, IsOptional } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsBoolean, IsDateString, IsOptional } from 'class-validator';
import { PostUpdateableFields } from '../type/type';

export class UpdatePostDto implements PostUpdateableFields {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/dto/updatePostFolder.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsMongoId, IsNotEmpty } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsMongoId, IsNotEmpty } from 'class-validator';

export class UpdatePostFolderDto {
@IsNotEmpty()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/postKeywords.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model, Types } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model, Types } from 'mongoose';
import { PostKeyword } from '@src/infrastructure/database/schema/postKeyword.schema';

@Injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/posts.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FilterQuery, Model, Types } from 'mongoose';
import { Injectable, NotFoundException } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { FilterQuery, Model, Types } from 'mongoose';
import { OrderType } from '@src/common';
import { AIClassification, Post, PostDocument } from '@src/infrastructure';
import { PostAiStatus } from '@src/modules/posts/posts.constant';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/posts.service.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { FlattenMaps, Types } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { FlattenMaps, Types } from 'mongoose';
import { parseLinkTitleAndContent } from '@src/common';
import { IS_LOCAL } from '@src/common/constant';
import { Keyword, Post } from '@src/infrastructure';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/response/keyword-list.response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { ApiProperty } from '@nestjs/swagger';
import { Types } from 'mongoose';
import { Keyword } from '@src/infrastructure';

export class KeywordItem {
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/response/listPost.response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { ApiProperty } from '@nestjs/swagger';
import { Types } from 'mongoose';
import { PaginationMetadata } from '@src/common';
import { Keyword, Post } from '@src/infrastructure';
import { PostAiStatus } from '@src/modules/posts/posts.constant';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/posts/response/retrievePost.response.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { Types } from 'mongoose';
import { ApiProperty } from '@nestjs/swagger';
import { Types } from 'mongoose';
import { Post } from '@src/infrastructure';
import { PostAiStatus } from '../posts.constant';
import { KeywordItem } from './keyword-list.response';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/users/dto/createUser.dto.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { IsNotEmpty, IsString } from 'class-validator';
import { ApiProperty } from '@nestjs/swagger';
import { IsNotEmpty, IsString } from 'class-validator';

export class CreateUserDto {
@IsString()
Expand Down
4 changes: 2 additions & 2 deletions src/modules/users/guards/strategy/jwt.strategy.ts
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
import { Model } from 'mongoose';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { Injectable, UnauthorizedException } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import { InjectModel } from '@nestjs/mongoose';
import { PassportStrategy } from '@nestjs/passport';
import { Model } from 'mongoose';
import { ExtractJwt, Strategy } from 'passport-jwt';
import { JwtPayload, ReqUserPayload } from '@src/common/types/type';
import { User } from '@src/infrastructure';
import { JWT_STRATEGY_TOKEN } from './strategy.token';
Expand Down
2 changes: 1 addition & 1 deletion src/modules/users/users.repository.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Model } from 'mongoose';
import { Injectable } from '@nestjs/common';
import { InjectModel } from '@nestjs/mongoose';
import { Model } from 'mongoose';
import { User } from '@src/infrastructure';

@Injectable()
Expand Down
2 changes: 1 addition & 1 deletion src/modules/users/users.service.ts
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
import { JwtPayload } from 'src/common/types/type';
import { Injectable } from '@nestjs/common';
import { JwtPayload } from 'src/common/types/type';
import { FolderType } from '@src/infrastructure/database/types/folder-type.enum';
import { AuthService } from '../auth/auth.service';
import { FolderRepository } from '../folders/folders.repository';
Expand Down

0 comments on commit b615ee6

Please sign in to comment.