Skip to content

Commit dc5b6e9

Browse files
committed
removed unused imports
1 parent f1414c7 commit dc5b6e9

File tree

9 files changed

+63
-68
lines changed

9 files changed

+63
-68
lines changed

source/api/v1/database/InitDataSource.ts

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { DataSource } from "typeorm";
2-
import {UserEntity} from "./entities/User";
3-
import {NoteEntity} from "./entities/Note";
2+
import { UserEntity } from "./entities/User";
3+
import { NoteEntity } from "./entities/Note";
44

55
export const initAndGetDataSource = (
66
host: string,
Lines changed: 56 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -1,58 +1,57 @@
1-
import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn, ManyToMany, JoinTable } from "typeorm"
2-
import { DeepOptional } from "typing-assets"
3-
import { Note } from "./Note"
4-
5-
export namespace UserEntity {
6-
7-
@Entity()
8-
export class User {
9-
@PrimaryColumn("varchar")
10-
public login: string
11-
12-
@Column("varchar", {
13-
length: 60,
14-
nullable: false
15-
})
16-
public email: string
17-
18-
@Column("text")
19-
public password: string
20-
21-
@Column("varchar", {
22-
length: 32
23-
})
24-
public username: string
25-
26-
@Column("varchar", {
27-
length: 7,
28-
nullable: false
29-
})
30-
public personalColor: string
31-
32-
@Column("boolean", {
33-
nullable: false
34-
})
35-
public isCollaborating: boolean
36-
37-
// @Column("text", {
38-
// nullable: true
39-
// })
40-
// public validToken: string
41-
42-
43-
44-
@CreateDateColumn({ type: "timestamp", default: () => "CURRENT_TIMESTAMP(6)" })
45-
public createdAt: Date;
46-
47-
@UpdateDateColumn({ type: "timestamp", default: () => "CURRENT_TIMESTAMP(6)", onUpdate: "CURRENT_TIMESTAMP(6)" })
48-
public updatedAt: Date;
49-
}
50-
}
51-
52-
export type User = UserEntity.User
53-
export type UserUpdate = DeepOptional<
54-
Omit<User, "updatedAt" | "createdAt" | "email" | "login">
55-
>
56-
export type UserCredentials = Pick<User, "email" | "password">
57-
export type UserWithoutSensetives = Omit<User, "password">
1+
import { Entity, Column, PrimaryColumn, CreateDateColumn, UpdateDateColumn } from "typeorm"
2+
import { DeepOptional } from "typing-assets"
3+
4+
export namespace UserEntity {
5+
6+
@Entity()
7+
export class User {
8+
@PrimaryColumn("varchar")
9+
public login: string
10+
11+
@Column("varchar", {
12+
length: 60,
13+
nullable: false
14+
})
15+
public email: string
16+
17+
@Column("text")
18+
public password: string
19+
20+
@Column("varchar", {
21+
length: 32
22+
})
23+
public username: string
24+
25+
@Column("varchar", {
26+
length: 7,
27+
nullable: false
28+
})
29+
public personalColor: string
30+
31+
@Column("boolean", {
32+
nullable: false
33+
})
34+
public isCollaborating: boolean
35+
36+
// @Column("text", {
37+
// nullable: true
38+
// })
39+
// public validToken: string
40+
41+
42+
43+
@CreateDateColumn({ type: "timestamp", default: () => "CURRENT_TIMESTAMP(6)" })
44+
public createdAt: Date;
45+
46+
@UpdateDateColumn({ type: "timestamp", default: () => "CURRENT_TIMESTAMP(6)", onUpdate: "CURRENT_TIMESTAMP(6)" })
47+
public updatedAt: Date;
48+
}
49+
}
50+
51+
export type User = UserEntity.User
52+
export type UserUpdate = DeepOptional<
53+
Omit<User, "updatedAt" | "createdAt" | "email" | "login">
54+
>
55+
export type UserCredentials = Pick<User, "email" | "password">
56+
export type UserWithoutSensetives = Omit<User, "password">
5857
export type UserWithoutMetadata = Omit<User, "updatedAt" | "createdAt" >

source/api/v1/exceptions/NoteExceptions.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import {Exception} from "../utils/typing/Exception";
1+
import { Exception } from "../utils/typing/Exception";
22

33
export const NOTE_EXCEPTIONS = {
44
NoteNotFound: {

source/api/v1/handlers/AuthHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FastifyInstance, FastifyReply, FastifyRequest, HookHandlerDoneFunction } from "fastify";
22
import { IAuthService } from "../services/interfaces/AuthServiceInterface";
3-
import { UserCredentials, UserWithoutMetadata } from "../database/entities/User";
3+
import { UserCredentials } from "../database/entities/User";
44
import { AUTH_EXCEPTIONS } from "../exceptions/AuthExceptions";
55
import { AuthUserSchema, ChangePasswordSchema } from "../validation/schemas/AuthSchemas";
66
import { extractJwtPayload } from "../auth/jwt/PayloadExtractor";

source/api/v1/handlers/NotesHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ import { Note, NoteCollaborators, NotePreview, NoteUpdate, NoteWithoutMetadata }
44
import { NOTE_EXCEPTIONS } from "../exceptions/NoteExceptions";
55
import { extractJwtPayload } from "../auth/jwt/PayloadExtractor";
66
import { extractToken } from "../utils/common/TokenExtractor";
7-
import {AddCollaboratorSchema, CreateNoteSchema, DeleteNoteSchema, GetNoteCollaboratorsSchema, GetNoteSchema, GetNotesSchema, RemoveCollaboratorSchema, UpdateNoteSchema } from "../validation/schemas/NoteSchemas";
7+
import { AddCollaboratorSchema, CreateNoteSchema, DeleteNoteSchema, GetNoteCollaboratorsSchema, GetNoteSchema, GetNotesSchema, RemoveCollaboratorSchema, UpdateNoteSchema } from "../validation/schemas/NoteSchemas";
88
import { isException } from "../utils/guards/ExceptionGuard";
99
import { USER_EXCEPTIONS } from "../exceptions/UserExceptions";
1010

source/api/v1/handlers/UsersHandlers.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
import { FastifyInstance, FastifyReply, FastifyRequest, HookHandlerDoneFunction } from "fastify";
22
import { IUsersService } from "../services/interfaces/UsersServiceInterface";
3-
import { User, UserUpdate, UserWithoutMetadata, UserWithoutSensetives } from "../database/entities/User";
3+
import { UserUpdate, UserWithoutMetadata, UserWithoutSensetives } from "../database/entities/User";
44
import { USER_EXCEPTIONS } from "../exceptions/UserExceptions";
55
import { CreateUserSchema, GetMyProfileSchema, GetUserSchema, UpdateUserSchema } from "../validation/schemas/UserSchemas";
66
import { UsersService } from "../services/UsersService";

source/api/v1/services/AuthService.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,4 @@
1-
import { User } from "../database/entities/User";
21
import { generateToken } from "../auth/jwt/TokenGenerator";
3-
import { Exception } from "../utils/typing/Exception";
42
import { IUsersService } from "./interfaces/UsersServiceInterface";
53
import { AUTH_EXCEPTIONS } from "../exceptions/AuthExceptions";
64
import { IAuthService } from "./interfaces/AuthServiceInterface";

source/api/v1/services/NotesService.ts

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,10 @@ import {
44
NotePreview,
55
NoteUpdate,
66
NoteEntity,
7-
NoteCollaborators
87
} from "../database/entities/Note";
98
import {
109
User,
1110
UserEntity,
12-
UserWithoutSensetives
1311
} from "../database/entities/User";
1412
import {IUsersService} from "./interfaces/UsersServiceInterface";
1513
import {INotesService, NotesSearchOptions} from "./interfaces/NotesServiceInterface";

source/api/v1/utils/guards/ExceptionGuard.ts

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
import { generateGuard } from "typing-assets";
1+
// import { generateGuard } from "typing-assets";
22
import { Exception } from "../typing/Exception";
33

44
// before generateGuard function was used to create guard

0 commit comments

Comments
 (0)