Browse Source

refactor: group all service and controller

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
09fe2c8700
  1. 2
      packages/nocodb-nest/src/controllers/attachments.controller.spec.ts
  2. 6
      packages/nocodb-nest/src/controllers/attachments.controller.ts
  3. 2
      packages/nocodb-nest/src/controllers/filters.controller.spec.ts
  4. 8
      packages/nocodb-nest/src/controllers/filters.controller.ts
  5. 4
      packages/nocodb-nest/src/modules/attachments/attachments.module.ts
  6. 4
      packages/nocodb-nest/src/modules/filters/filters.module.ts
  7. 2
      packages/nocodb-nest/src/modules/global/global.module.ts
  8. 30
      packages/nocodb-nest/src/modules/import/import.module.ts
  9. 26
      packages/nocodb-nest/src/modules/sync/helpers/job.ts
  10. 0
      packages/nocodb-nest/src/services/attachments.service.spec.ts
  11. 6
      packages/nocodb-nest/src/services/attachments.service.ts
  12. 0
      packages/nocodb-nest/src/services/filters.service.spec.ts
  13. 4
      packages/nocodb-nest/src/services/filters.service.ts
  14. 0
      packages/nocodb-nest/src/services/socket.service.spec.ts
  15. 4
      packages/nocodb-nest/src/services/socket.service.ts

2
packages/nocodb-nest/src/modules/attachments/attachments.controller.spec.ts → packages/nocodb-nest/src/controllers/attachments.controller.spec.ts

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing';
import { AttachmentsController } from './attachments.controller';
import { AttachmentsService } from './attachments.service';
import { AttachmentsService } from '../services/attachments.service';
import type { TestingModule } from '@nestjs/testing';
describe('AttachmentsController', () => {

6
packages/nocodb-nest/src/modules/attachments/attachments.controller.ts → packages/nocodb-nest/src/controllers/attachments.controller.ts

@ -14,9 +14,9 @@ import {
UseInterceptors,
} from '@nestjs/common';
import { AnyFilesInterceptor } from '@nestjs/platform-express';
import { GlobalGuard } from '../../guards/global/global.guard';
import { UploadAllowedInterceptor } from '../../interceptors/is-upload-allowed/is-upload-allowed.interceptor';
import { AttachmentsService } from './attachments.service';
import { GlobalGuard } from '../guards/global/global.guard';
import { UploadAllowedInterceptor } from '../interceptors/is-upload-allowed/is-upload-allowed.interceptor';
import { AttachmentsService } from '../services/attachments.service';
@Controller()
export class AttachmentsController {

2
packages/nocodb-nest/src/modules/filters/filters.controller.spec.ts → packages/nocodb-nest/src/controllers/filters.controller.spec.ts

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing';
import { FiltersController } from './filters.controller';
import { FiltersService } from './filters.service';
import { FiltersService } from '../services/filters.service';
import type { TestingModule } from '@nestjs/testing';
describe('FiltersController', () => {

8
packages/nocodb-nest/src/modules/filters/filters.controller.ts → packages/nocodb-nest/src/controllers/filters.controller.ts

@ -11,14 +11,14 @@ import {
} from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport';
import { FilterReqType } from 'nocodb-sdk';
import { GlobalGuard } from '../../guards/global/global.guard';
import { PagedResponseImpl } from '../../helpers/PagedResponse';
import { GlobalGuard } from '../guards/global/global.guard';
import { PagedResponseImpl } from '../helpers/PagedResponse';
import {
Acl,
ExtractProjectIdMiddleware,
UseAclMiddleware,
} from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { FiltersService } from './filters.service';
} from '../middlewares/extract-project-id/extract-project-id.middleware';
import { FiltersService } from '../services/filters.service';
@Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard)

4
packages/nocodb-nest/src/modules/attachments/attachments.module.ts

@ -2,8 +2,8 @@ import { Module } from '@nestjs/common';
import { MulterModule } from '@nestjs/platform-express';
import multer from 'multer';
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants';
import { AttachmentsService } from './attachments.service';
import { AttachmentsController } from './attachments.controller';
import { AttachmentsService } from '../../services/attachments.service';
import { AttachmentsController } from '../../controllers/attachments.controller';
@Module({
imports: [

4
packages/nocodb-nest/src/modules/filters/filters.module.ts

@ -1,6 +1,6 @@
import { Module } from '@nestjs/common';
import { FiltersService } from './filters.service';
import { FiltersController } from './filters.controller';
import { FiltersService } from '../../services/filters.service';
import { FiltersController } from '../../controllers/filters.controller';
@Module({
controllers: [FiltersController],

2
packages/nocodb-nest/src/modules/global/global.module.ts

@ -4,7 +4,7 @@ import { ExtractJwt } from 'passport-jwt';
import { Connection } from '../../connection/connection';
import { GlobalGuard } from '../../guards/global/global.guard';
import { MetaService } from '../../meta/meta.service';
import { SocketService } from '../../services/client/socket.service';
import { SocketService } from '../../services/socket.service';
import { JwtStrategy } from '../../strategies/jwt.strategy';
import NcConfigFactory from '../../utils/NcConfigFactory';
import { jwtConstants } from '../auth/constants';

30
packages/nocodb-nest/src/modules/import/import.module.ts

@ -1,21 +1,21 @@
import { Module } from '@nestjs/common';
import { AttachmentsService } from '../attachments/attachments.service';
import { ColumnsService } from '../columns/columns.service';
import { BulkDataAliasService } from '../datas/bulk-data-alias/bulk-data-alias.service';
import { FiltersService } from '../filters/filters.service';
import { FormColumnsService } from '../form-columns/form-columns.service';
import { FormsService } from '../forms/forms.service';
import { GalleriesService } from '../galleries/galleries.service';
import { AttachmentsService } from '../../services/attachments.service';
import { ColumnsService } from '../../services/columns.service';
import { BulkDataAliasService } from '../../services/bulk-data-alias.service';
import { FiltersService } from '../../services/filters.service';
import { FormColumnsService } from '../../services/form-columns.service';
import { FormsService } from '../../services/forms.service';
import { GalleriesService } from '../../services/galleries.service';
import { GlobalModule } from '../global/global.module';
import { GridsService } from '../grids/grids.service';
import { GridsService } from '../../services/grids.service';
import { ProjectUsersService } from '../project-users/project-users.service';
import { ProjectsService } from '../projects/projects.service';
import { SortsService } from '../sorts/sorts.service';
import { TablesService } from '../tables/tables.service';
import { ViewColumnsService } from '../view-columns/view-columns.service';
import { ViewsService } from '../views/views.service';
import { ImportService } from './import.service';
import { ImportController } from './import.controller';
import { ProjectsService } from '../../services/projects.service';
import { SortsService } from '../../services/sorts.service';
import { TablesService } from '../../services/tables.service';
import { ViewColumnsService } from '../../services/view-columns.service';
import { ViewsService } from '../../services/views.service';
import { ImportService } from '../../services/import.service';
import { ImportController } from '../../controllers/import.controller';
@Module({
imports: [GlobalModule],

26
packages/nocodb-nest/src/modules/sync/helpers/job.ts

@ -8,19 +8,19 @@ import dayjs from 'dayjs';
import utc from 'dayjs/plugin/utc';
import tinycolor from 'tinycolor2';
import extractRolesObj from '../../../utils/extractRolesObj';
import { AttachmentsService } from '../../attachments/attachments.service';
import { ColumnsService } from '../../columns/columns.service';
import { BulkDataAliasService } from '../../datas/bulk-data-alias/bulk-data-alias.service';
import { FiltersService } from '../../filters/filters.service';
import { FormColumnsService } from '../../form-columns/form-columns.service';
import { GalleriesService } from '../../galleries/galleries.service';
import { GridsService } from '../../grids/grids.service';
import { AttachmentsService } from '../../../services/attachments.service';
import { ColumnsService } from '../../../services/columns.service';
import { BulkDataAliasService } from '../../../services/bulk-data-alias.service';
import { FiltersService } from '../../../services/filters.service';
import { FormColumnsService } from '../../../services/form-columns.service';
import { GalleriesService } from '../../../services/galleries.service';
import { GridsService } from '../../../services/grids.service';
import { ProjectUsersService } from '../../project-users/project-users.service';
import { ProjectsService } from '../../projects/projects.service';
import { SortsService } from '../../sorts/sorts.service';
import { TablesService } from '../../tables/tables.service';
import { ViewColumnsService } from '../../view-columns/view-columns.service';
import { ViewsService } from '../../views/views.service';
import { ProjectsService } from '../../../services/projects.service';
import { SortsService } from '../../../services/sorts.service';
import { TablesService } from '../../../services/tables.service';
import { ViewColumnsService } from '../../../services/view-columns.service';
import { ViewsService } from '../../../services/views.service';
// import {
// attachmentService,
// columnService,
@ -38,7 +38,7 @@ import { ViewsService } from '../../views/views.service';
// // eslint-disable-next-line @typescript-eslint/ban-ts-comment
// // @ts-ignore
// } from '../..';
import { FormsService } from '../../../modules/forms/forms.service';
import { FormsService } from '../../../services/forms.service';
import FetchAT from './fetchAT';
import { importData, importLTARData } from './readAndProcessData';
import EntityMap from './EntityMap';

0
packages/nocodb-nest/src/modules/attachments/attachments.service.spec.ts → packages/nocodb-nest/src/services/attachments.service.spec.ts

6
packages/nocodb-nest/src/modules/attachments/attachments.service.ts → packages/nocodb-nest/src/services/attachments.service.ts

@ -3,9 +3,9 @@ import { Injectable } from '@nestjs/common';
import { nanoid } from 'nanoid';
import slash from 'slash';
import { T } from 'nc-help';
import NcPluginMgrv2 from '../../helpers/NcPluginMgrv2';
import Local from '../../plugins/storage/Local';
import mimetypes, { mimeIcons } from '../../utils/mimeTypes';
import NcPluginMgrv2 from '../helpers/NcPluginMgrv2';
import Local from '../plugins/storage/Local';
import mimetypes, { mimeIcons } from '../utils/mimeTypes';
@Injectable()
export class AttachmentsService {

0
packages/nocodb-nest/src/modules/filters/filters.service.spec.ts → packages/nocodb-nest/src/services/filters.service.spec.ts

4
packages/nocodb-nest/src/modules/filters/filters.service.ts → packages/nocodb-nest/src/services/filters.service.ts

@ -1,7 +1,7 @@
import { Injectable } from '@nestjs/common';
import { T } from 'nc-help';
import { validatePayload } from '../../helpers';
import { Filter } from '../../models';
import { validatePayload } from '../helpers';
import { Filter } from '../models';
import type { FilterReqType } from 'nocodb-sdk';
@Injectable()

0
packages/nocodb-nest/src/services/client/socket.service.spec.ts → packages/nocodb-nest/src/services/socket.service.spec.ts

4
packages/nocodb-nest/src/services/client/socket.service.ts → packages/nocodb-nest/src/services/socket.service.ts

@ -5,8 +5,8 @@ import { T } from 'nc-help';
import { Server } from 'socket.io';
import { AuthGuard } from '@nestjs/passport';
import { ExecutionContextHost } from '@nestjs/core/helpers/execution-context-host';
import Noco from '../../Noco';
import { JwtStrategy } from '../../strategies/jwt.strategy';
import Noco from '../Noco';
import { JwtStrategy } from '../strategies/jwt.strategy';
import type { OnModuleInit } from '@nestjs/common';
import type { Socket } from 'socket.io';
Loading…
Cancel
Save