Skip to content

Commit

Permalink
refactor: ➖ remove unused dependencies
Browse files Browse the repository at this point in the history
  • Loading branch information
cestoliv committed Nov 2, 2022
1 parent c0bbe59 commit da62b53
Show file tree
Hide file tree
Showing 13 changed files with 6,243 additions and 4,549 deletions.
10,740 changes: 6,222 additions & 4,518 deletions package-lock.json

Large diffs are not rendered by default.

12 changes: 1 addition & 11 deletions package.json
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,6 @@
"@nestjs/common": "^9.0.0",
"@nestjs/config": "^2.2.0",
"@nestjs/core": "^9.0.0",
"@nestjs/mapped-types": "^1.2.0",
"@nestjs/mongoose": "^9.2.0",
"@nestjs/passport": "^9.0.0",
"@nestjs/platform-express": "^9.0.0",
Expand All @@ -35,6 +34,7 @@
"class-transformer": "^0.5.1",
"class-validator": "^0.13.2",
"luxon": "^3.1.0",
"mongodb": "^4.11.0",
"mongoose": "^6.6.7",
"passport": "^0.6.0",
"passport-headerapikey": "^1.2.2",
Expand All @@ -44,27 +44,17 @@
},
"devDependencies": {
"@nestjs/cli": "^9.0.0",
"@nestjs/schematics": "^9.0.0",
"@nestjs/testing": "^9.0.0",
"@types/bcrypt": "^5.0.0",
"@types/express": "^4.17.13",
"@types/jest": "28.1.8",
"@types/luxon": "^3.0.2",
"@types/node": "^16.0.0",
"@types/supertest": "^2.0.11",
"@typescript-eslint/eslint-plugin": "^5.0.0",
"@typescript-eslint/parser": "^5.0.0",
"eslint": "^8.0.1",
"eslint-config-prettier": "^8.3.0",
"eslint-plugin-prettier": "^4.0.0",
"jest": "28.1.3",
"prettier": "^2.3.2",
"source-map-support": "^0.5.20",
"supertest": "^6.1.3",
"ts-jest": "28.0.8",
"ts-loader": "^9.2.3",
"ts-node": "^10.0.0",
"tsconfig-paths": "4.1.0",
"typescript": "^4.7.4"
},
"jest": {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/auth.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Module } from '@nestjs/common';
import { PassportModule } from '@nestjs/passport';
import { HeaderApiKeyStrategy } from './api-key.strategy';
import { AuthService } from './auth.service';
import { UsersModule } from 'src/users/users.module';
import { UsersModule } from '../users/users.module';

@Module({
imports: [UsersModule, PassportModule],
Expand Down
8 changes: 4 additions & 4 deletions src/auth/auth.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import { Injectable } from '@nestjs/common';
import { ConfigService } from '@nestjs/config';
import * as bcrypt from 'bcrypt';
import { Types } from 'mongoose';
import { Role } from 'src/users/enum/roles.enum';
import { IUser } from 'src/users/interface/user.interface';
import { UsersService } from 'src/users/users.service';
import { isValidObjectId } from 'src/utils';
import { Role } from '../users/enum/roles.enum';
import { IUser } from '../users/interface/user.interface';
import { UsersService } from '../users/users.service';
import { isValidObjectId } from '../utils';

@Injectable()
export class AuthService {
Expand Down
2 changes: 1 addition & 1 deletion src/auth/roles/roles.decorator.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SetMetadata } from '@nestjs/common';
import { Role } from 'src/users/enum/roles.enum';
import { Role } from '../../users/enum/roles.enum';

export const Roles = (...roles: Role[]) => SetMetadata('roles', roles);
2 changes: 1 addition & 1 deletion src/auth/roles/roles.guard.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Injectable, CanActivate, ExecutionContext } from '@nestjs/common';
import { Reflector } from '@nestjs/core';
import { Observable } from 'rxjs';
import { Role } from 'src/users/enum/roles.enum';
import { Role } from '../../users/enum/roles.enum';

@Injectable()
export class RolesGuard implements CanActivate {
Expand Down
4 changes: 2 additions & 2 deletions src/calendars/calendars.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -18,8 +18,8 @@ import {
ApiOkResponse,
ApiTags,
} from '@nestjs/swagger';
import { Roles } from 'src/auth/roles/roles.decorator';
import { RolesGuard } from 'src/auth/roles/roles.guard';
import { Roles } from '../auth/roles/roles.decorator';
import { RolesGuard } from '../auth/roles/roles.guard';
import { CreateCalendarDto } from './dto/create-calendar.dto';
import { UpdateCalendarDto } from './dto/update-calendar.dto';
import { Role } from '../users/enum/roles.enum';
Expand Down
2 changes: 1 addition & 1 deletion src/calendars/calendars.module.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Module } from '@nestjs/common';
import { MongooseModule } from '@nestjs/mongoose';
import { UsersModule } from 'src/users/users.module';
import { UsersModule } from '../users/users.module';
import { CalendarsController } from './calendars.controller';
import { CalendarsService } from './calendars.service';
import { Calendar, CalendarSchema } from './schemas/calendar.schema';
Expand Down
8 changes: 4 additions & 4 deletions src/calendars/calendars.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@ import { DateTime } from 'luxon';
import { CreateCalendarDto } from './dto/create-calendar.dto';
import { ICalendar } from './interface/calendar.interface';
import { UpdateCalendarDto } from './dto/update-calendar.dto';
import { isValidObjectId, sortMapByKeys } from 'src/utils';
import { UsersService } from 'src/users/users.service';
import { isValidObjectId, sortMapByKeys } from '../utils';
import { UsersService } from '../users/users.service';
import { State } from './enum/state.enum';
import { Role } from 'src/users/enum/roles.enum';
import { IUser } from 'src/users/interface/user.interface';
import { Role } from '../users/enum/roles.enum';
import { IUser } from '../users/interface/user.interface';
import { asCalendarAccess, checkCalendarAccess } from './calendars.utils';

@Injectable()
Expand Down
4 changes: 2 additions & 2 deletions src/calendars/calendars.utils.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { NotFoundException, UnauthorizedException } from '@nestjs/common';
import { Model } from 'mongoose';
import { Role } from 'src/users/enum/roles.enum';
import { IUser } from 'src/users/interface/user.interface';
import { Role } from '../users/enum/roles.enum';
import { IUser } from '../users/interface/user.interface';
import { ICalendar } from './interface/calendar.interface';

export function asCalendarAccess(user: IUser, calendar: ICalendar): void {
Expand Down
2 changes: 1 addition & 1 deletion src/calendars/schemas/calendar.schema.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { Prop, Schema, SchemaFactory } from '@nestjs/mongoose';
import { Document, Types, Schema as MongooseSchema } from 'mongoose';
import { User } from 'src/users/schemas/user.schema';
import { User } from '../../users/schemas/user.schema';

export type CalendarDocument = Calendar & Document;

Expand Down
4 changes: 2 additions & 2 deletions src/users/users.controller.ts
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@ import {
ApiOkResponse,
ApiTags,
} from '@nestjs/swagger';
import { Roles } from 'src/auth/roles/roles.decorator';
import { RolesGuard } from 'src/auth/roles/roles.guard';
import { Roles } from '../auth/roles/roles.decorator';
import { RolesGuard } from '../auth/roles/roles.guard';
import { CreateUserDto } from './dto/create-user.dto';
import { GetUserDto } from './dto/get-user.dto';
import { UpdateUserDto } from './dto/update-user.dto';
Expand Down
2 changes: 1 addition & 1 deletion src/users/users.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import * as crypto from 'crypto';
import { CreateUserDto } from './dto/create-user.dto';
import { IUser } from './interface/user.interface';
import { UpdateUserDto } from './dto/update-user.dto';
import { isValidObjectId } from 'src/utils';
import { isValidObjectId } from '../utils';

@Injectable()
export class UsersService {
Expand Down

0 comments on commit da62b53

Please sign in to comment.