Skip to content

Commit

Permalink
perf(backend): Change paths for @
Browse files Browse the repository at this point in the history
  • Loading branch information
aXenDeveloper committed Feb 29, 2024
1 parent b2e4047 commit fb32ef5
Show file tree
Hide file tree
Showing 174 changed files with 429 additions and 432 deletions.
2 changes: 1 addition & 1 deletion backend/.swcrc
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@
"dynamicImport": true
},
"paths": {
"@/*": ["./*"],
"@/*": ["./src/*"],
"~/*": ["../*"]
},
"baseUrl": "./"
Expand Down
2 changes: 1 addition & 1 deletion backend/src/database/database.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { registerEnumType } from "@nestjs/graphql";

import { DatabaseService } from "./database.service";

import { SortDirectionEnum } from "@/src/types/database/sortDirection.type";
import { SortDirectionEnum } from "@/types/database/sortDirection.type";

registerEnumType(SortDirectionEnum, {
name: "SortDirectionEnum"
Expand Down
2 changes: 1 addition & 1 deletion backend/src/functions/config/rebuild-required.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import * as fs from "fs";

import { ConfigType, configPath, getConfigFile } from "./get-config-file";

import { CustomError } from "@/src/utils/errors/CustomError";
import { CustomError } from "@/utils/errors/CustomError";

export const setRebuildRequired = async ({
set
Expand Down
2 changes: 1 addition & 1 deletion backend/src/functions/database/inputSorting.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { SortDirectionEnum } from "@/src/types/database/sortDirection.type";
import { SortDirectionEnum } from "@/types/database/sortDirection.type";

interface Args<T> {
sortBy:
Expand Down
8 changes: 4 additions & 4 deletions backend/src/functions/database/pagination.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { AnyColumn, SQL, and, asc, desc, eq, gt, lt, or } from "drizzle-orm";
import { PgTableWithColumns, TableConfig } from "drizzle-orm/pg-core";

import { PageInfo } from "@/src/types/database/pagination.type";
import { CustomError } from "@/src/utils/errors/CustomError";
import { DatabaseService } from "@/src/database/database.service";
import { SortDirectionEnum } from "@/src/types/database/sortDirection.type";
import { PageInfo } from "@/types/database/pagination.type";
import { CustomError } from "@/utils/errors/CustomError";
import { DatabaseService } from "@/database/database.service";
import { SortDirectionEnum } from "@/types/database/sortDirection.type";

type DataInterface<T> = T & {
id: number;
Expand Down
2 changes: 1 addition & 1 deletion backend/src/main.ts
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import cookieParser from "cookie-parser";
import { AppModule } from "./modules/app.module";
import { RedisIoAdapter } from "./redis.adapter";

import { graphqlUploadExpress } from "@/src/utils/graphql-upload/graphqlUploadExpress";
import { graphqlUploadExpress } from "@/utils/graphql-upload/graphqlUploadExpress";

async function bootstrap() {
const app = await NestFactory.create(AppModule);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { CreateAdminGroupsService } from "./create.service";
import { CreateAdminGroupsArgs } from "./dto/create.args";
import { ShowAdminGroups } from "../show/dto/show.obj";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class CreateAdminGroupsResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,12 +3,12 @@ import { Injectable } from "@nestjs/common";
import { ShowAdminGroups } from "../show/dto/show.obj";
import { CreateAdminGroupsArgs } from "./dto/create.args";

import { currentDate } from "@/src/functions/date";
import { DatabaseService } from "@/src/database/database.service";
import { currentDate } from "@/functions/date";
import { DatabaseService } from "@/database/database.service";
import {
core_groups,
core_groups_names
} from "@/src/modules/admin/core/database/schema/groups";
} from "@/modules/admin/core/database/schema/groups";

@Injectable()
export class CreateAdminGroupsService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
IsTextLanguageInput,
TextLanguageInput,
TransformTextLanguageInput
} from "@/src/types/database/text-language.type";
} from "@/types/database/text-language.type";

@ArgsType()
export class CreateAdminGroupsArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UseGuards } from "@nestjs/common";
import { DeleteAdminGroupsService } from "./delete.service";
import { DeleteAdminGroupsArgs } from "./dto/delete.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class DeleteAdminGroupsResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { eq } from "drizzle-orm";

import { DeleteAdminGroupsArgs } from "./dto/delete.args";

import { DatabaseService } from "@/src/database/database.service";
import { NotFoundError } from "@/src/utils/errors/not-found-error";
import { core_users } from "@/src/modules/admin/core/database/schema/users";
import { core_groups } from "@/src/modules/admin/core/database/schema/groups";
import { DatabaseService } from "@/database/database.service";
import { NotFoundError } from "@/utils/errors/not-found-error";
import { core_users } from "@/modules/admin/core/database/schema/users";
import { core_groups } from "@/modules/admin/core/database/schema/groups";

@Injectable()
export class DeleteAdminGroupsService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ import {
IsTextLanguageInput,
TextLanguageInput,
TransformTextLanguageInput
} from "@/src/types/database/text-language.type";
} from "@/types/database/text-language.type";

@ArgsType()
export class EditAdminGroupsArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ShowAdminGroups } from "../show/dto/show.obj";
import { EditAdminGroupsService } from "./edit.service";
import { EditAdminGroupsArgs } from "./dto/edit.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class EditAdminGroupsResolver {
Expand Down
10 changes: 5 additions & 5 deletions backend/src/modules/admin/core/groups/edit/edit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,14 +4,14 @@ import { count, eq } from "drizzle-orm";
import { EditAdminGroupsArgs } from "./dto/edit.args";
import { ShowAdminGroups } from "../show/dto/show.obj";

import { currentDate } from "@/src/functions/date";
import { DatabaseService } from "@/src/database/database.service";
import { NotFoundError } from "@/src/utils/errors/not-found-error";
import { currentDate } from "@/functions/date";
import { DatabaseService } from "@/database/database.service";
import { NotFoundError } from "@/utils/errors/not-found-error";
import {
core_groups,
core_groups_names
} from "@/src/modules/admin/core/database/schema/groups";
import { core_users } from "@/src/modules/admin/core/database/schema/users";
} from "@/modules/admin/core/database/schema/groups";
import { core_users } from "@/modules/admin/core/database/schema/users";

@Injectable()
export class EditAdminGroupsService {
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/admin/core/groups/show/dto/show.args.ts
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,8 @@ import {
} from "@nestjs/graphql";
import { Transform } from "class-transformer";

import { SortDirectionEnum } from "@/src/types/database/sortDirection.type";
import { TransformString } from "@/src/types/database/text-language.type";
import { SortDirectionEnum } from "@/types/database/sortDirection.type";
import { TransformString } from "@/types/database/text-language.type";

enum ShowAdminGroupsSortingColumnEnum {
created = "created",
Expand Down
4 changes: 2 additions & 2 deletions backend/src/modules/admin/core/groups/show/dto/show.obj.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { Field, Int, ObjectType } from "@nestjs/graphql";

import { PageInfo } from "@/src/types/database/pagination.type";
import { TextLanguage } from "@/src/types/database/text-language.type";
import { PageInfo } from "@/types/database/pagination.type";
import { TextLanguage } from "@/types/database/text-language.type";

@ObjectType()
export class ShowAdminGroupsObj {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ import { ShowAdminGroupsService } from "./show.service";
import { ShowAdminGroupsObj } from "./dto/show.obj";
import { ShowAdminGroupsArgs } from "./dto/show.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class ShowAdminGroupsResolver {
Expand Down
8 changes: 4 additions & 4 deletions backend/src/modules/admin/core/groups/show/show.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,16 +4,16 @@ import { and, count, eq, ilike, inArray } from "drizzle-orm";
import { ShowAdminGroupsArgs } from "./dto/show.args";
import { ShowAdminGroupsObj } from "./dto/show.obj";

import { DatabaseService } from "@/src/database/database.service";
import { DatabaseService } from "@/database/database.service";
import {
core_groups,
core_groups_names
} from "@/src/modules/admin/core/database/schema/groups";
} from "@/modules/admin/core/database/schema/groups";
import {
inputPaginationCursor,
outputPagination
} from "@/src/functions/database/pagination";
import { SortDirectionEnum } from "@/src/types/database/sortDirection.type";
} from "@/functions/database/pagination";
import { SortDirectionEnum } from "@/types/database/sortDirection.type";
import { core_users } from "../../database/schema/users";

@Injectable()
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,21 +3,21 @@ import * as fs from "fs";
import { Injectable } from "@nestjs/common";
import { count } from "drizzle-orm";

import { CustomError } from "@/src/utils/errors/CustomError";
import { AccessDeniedError } from "@/src/utils/errors/AccessDeniedError";
import { currentDate } from "@/src/functions/date";
import { DatabaseService } from "@/src/database/database.service";
import { core_languages } from "@/src/modules/admin/core/database/schema/languages";
import { CustomError } from "@/utils/errors/CustomError";
import { AccessDeniedError } from "@/utils/errors/AccessDeniedError";
import { currentDate } from "@/functions/date";
import { DatabaseService } from "@/database/database.service";
import { core_languages } from "@/modules/admin/core/database/schema/languages";
import {
core_groups,
core_groups_names
} from "@/src/modules/admin/core/database/schema/groups";
import { core_admin_permissions } from "@/src/modules/admin/core/database/schema/admins";
} from "@/modules/admin/core/database/schema/groups";
import { core_admin_permissions } from "@/modules/admin/core/database/schema/admins";
import { core_moderators_permissions } from "../../database/schema/moderators";
import { core_plugins } from "../../database/schema/plugins";
import { core_themes } from "../../database/schema/themes";
import { core_nav, core_nav_name } from "../../database/schema/nav";
import { getConfigFile } from "@/src/functions/config/get-config-file";
import { getConfigFile } from "@/functions/config/get-config-file";

@Injectable()
export class CreateDatabaseAdminInstallService {
Expand Down
12 changes: 6 additions & 6 deletions backend/src/modules/admin/core/install/layout/layout.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,12 @@ import {
LayoutAdminInstallObj
} from "./dto/layout.obj";

import { AccessDeniedError } from "@/src/utils/errors/AccessDeniedError";
import { DatabaseService } from "@/src/database/database.service";
import { core_users } from "@/src/modules/admin/core/database/schema/users";
import { core_sessions } from "@/src/modules/admin/core/database/schema/sessions";
import { core_admin_sessions } from "@/src/modules/admin/core/database/schema/admins";
import { core_languages } from "@/src/modules/admin/core/database/schema/languages";
import { AccessDeniedError } from "@/utils/errors/AccessDeniedError";
import { DatabaseService } from "@/database/database.service";
import { core_users } from "@/modules/admin/core/database/schema/users";
import { core_sessions } from "@/modules/admin/core/database/schema/sessions";
import { core_admin_sessions } from "@/modules/admin/core/database/schema/admins";
import { core_languages } from "@/modules/admin/core/database/schema/languages";

@Injectable()
export class LayoutAdminInstallService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { Args, Mutation, Resolver } from "@nestjs/graphql";
import { CreateAdminCoreLanguageService } from "./create.service";
import { CreateCoreAdminLanguagesArgs } from "./dto/edit.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { ShowCoreLanguages } from "@/src/modules/core/languages/show/dto/show.obj";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";
import { ShowCoreLanguages } from "@/modules/core/languages/show/dto/show.obj";

@Resolver()
export class CreateAdminCoreLanguagesResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -5,12 +5,12 @@ import { Injectable } from "@nestjs/common";

import { CreateCoreAdminLanguagesArgs } from "./dto/edit.args";

import { DatabaseService } from "@/src/database/database.service";
import { ShowCoreLanguages } from "@/src/modules/core/languages/show/dto/show.obj";
import { CustomError } from "@/src/utils/errors/CustomError";
import { DatabaseService } from "@/database/database.service";
import { ShowCoreLanguages } from "@/modules/core/languages/show/dto/show.obj";
import { CustomError } from "@/utils/errors/CustomError";
import { core_languages } from "../../database/schema/languages";
import { currentDate } from "@/src/functions/date";
import { setRebuildRequired } from "@/src/functions/config/rebuild-required";
import { currentDate } from "@/functions/date";
import { setRebuildRequired } from "@/functions/config/rebuild-required";

@Injectable()
export class CreateAdminCoreLanguageService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArgsType, Field } from "@nestjs/graphql";
import { Transform } from "class-transformer";

import { TransformString } from "@/src/types/database/text-language.type";
import { TransformString } from "@/types/database/text-language.type";

@ArgsType()
export class CreateCoreAdminLanguagesArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UseGuards } from "@nestjs/common";
import { DeleteAdminCoreLanguageService } from "./delete.service";
import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class DeleteAdminCoreLanguagesResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@ import { eq } from "drizzle-orm";

import { DeleteCoreAdminLanguagesArgs } from "./dto/delete.args";

import { DatabaseService } from "@/src/database/database.service";
import { NotFoundError } from "@/src/utils/errors/not-found-error";
import { DatabaseService } from "@/database/database.service";
import { NotFoundError } from "@/utils/errors/not-found-error";
import { core_languages } from "../../database/schema/languages";
import { CustomError } from "@/src/utils/errors/CustomError";
import { setRebuildRequired } from "@/src/functions/config/rebuild-required";
import { CustomError } from "@/utils/errors/CustomError";
import { setRebuildRequired } from "@/functions/config/rebuild-required";

@Injectable()
export class DeleteAdminCoreLanguageService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { UseGuards } from "@nestjs/common";
import { DownloadAdminCoreLanguageService } from "./download.service";
import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { CurrentUser, User } from "@/src/utils/decorators/user.decorator";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";
import { CurrentUser, User } from "@/utils/decorators/user.decorator";

@Resolver()
export class DownloadAdminCoreLanguagesResolver {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,13 +6,13 @@ import * as tar from "tar";

import { DownloadCoreAdminLanguagesArgs } from "./dto/download.args";

import { NotFoundError } from "@/src/utils/errors/not-found-error";
import { DatabaseService } from "@/src/database/database.service";
import { removeSpecialCharacters } from "@/src/functions/remove-special-characters";
import { User } from "@/src/utils/decorators/user.decorator";
import { generateRandomString } from "@/src/functions/generate-random-string";
import { currentDate } from "@/src/functions/date";
import { CustomError } from "@/src/utils/errors/CustomError";
import { NotFoundError } from "@/utils/errors/not-found-error";
import { DatabaseService } from "@/database/database.service";
import { removeSpecialCharacters } from "@/functions/remove-special-characters";
import { User } from "@/utils/decorators/user.decorator";
import { generateRandomString } from "@/functions/generate-random-string";
import { currentDate } from "@/functions/date";
import { CustomError } from "@/utils/errors/CustomError";

@Injectable()
export class DownloadAdminCoreLanguageService {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,8 +4,8 @@ import { UseGuards } from "@nestjs/common";
import { EditAdminCoreLanguagesService } from "./edit.service";
import { EditCoreAdminLanguagesArgs } from "./dto/edit.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { ShowCoreLanguages } from "@/src/modules/core/languages/show/dto/show.obj";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";
import { ShowCoreLanguages } from "@/modules/core/languages/show/dto/show.obj";

@Resolver()
export class EditAdminCoreLanguagesResolver {
Expand Down
8 changes: 4 additions & 4 deletions backend/src/modules/admin/core/languages/edit/edit.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,10 +3,10 @@ import { eq } from "drizzle-orm";

import { EditCoreAdminLanguagesArgs } from "./dto/edit.args";

import { DatabaseService } from "@/src/database/database.service";
import { NotFoundError } from "@/src/utils/errors/not-found-error";
import { core_languages } from "@/src/modules/admin/core/database/schema/languages";
import { ShowCoreLanguages } from "@/src/modules/core/languages/show/dto/show.obj";
import { DatabaseService } from "@/database/database.service";
import { NotFoundError } from "@/utils/errors/not-found-error";
import { core_languages } from "@/modules/admin/core/database/schema/languages";
import { ShowCoreLanguages } from "@/modules/core/languages/show/dto/show.obj";

@Injectable()
export class EditAdminCoreLanguagesService {
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ArgsType, Field } from "@nestjs/graphql";

import { GraphQLUpload } from "@/src/utils/graphql-upload/GraphQLUpload";
import { FileUpload } from "@/src/utils/graphql-upload/Upload";
import { GraphQLUpload } from "@/utils/graphql-upload/GraphQLUpload";
import { FileUpload } from "@/utils/graphql-upload/Upload";

@ArgsType()
export class UpdateCoreAdminLanguagesArgs {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { UseGuards } from "@nestjs/common";
import { UpdateAdminCoreLanguageService } from "./update.service";
import { UpdateCoreAdminLanguagesArgs } from "./dto/update.args";

import { AdminAuthGuards } from "@/src/utils/guards/admin-auth.guards";
import { AdminAuthGuards } from "@/utils/guards/admin-auth.guards";

@Resolver()
export class UpdateAdminCoreLanguagesResolver {
Expand Down
Loading

0 comments on commit fb32ef5

Please sign in to comment.