Browse Source

refactor: merge modules

Signed-off-by: Pranav C <pranavxc@gmail.com>
pull/5444/head
Pranav C 2 years ago
parent
commit
5580f4d99a
  1. 88
      packages/nocodb-nest/src/app.module.ts
  2. 2
      packages/nocodb-nest/src/controllers/api-docs/api-docs.controller.spec.ts
  3. 2
      packages/nocodb-nest/src/controllers/api-docs/api-docs.controller.ts
  4. 2
      packages/nocodb-nest/src/controllers/data-alias.controller.spec.ts
  5. 8
      packages/nocodb-nest/src/controllers/data-alias.controller.ts
  6. 2
      packages/nocodb-nest/src/controllers/datas.controller.spec.ts
  7. 6
      packages/nocodb-nest/src/controllers/datas.controller.ts
  8. 0
      packages/nocodb-nest/src/controllers/imports/helpers/EntityMap.ts
  9. 0
      packages/nocodb-nest/src/controllers/imports/helpers/NocoSyncDestAdapter.ts
  10. 0
      packages/nocodb-nest/src/controllers/imports/helpers/NocoSyncSourceAdapter.ts
  11. 0
      packages/nocodb-nest/src/controllers/imports/helpers/fetchAT.ts
  12. 2
      packages/nocodb-nest/src/controllers/imports/helpers/job.ts
  13. 0
      packages/nocodb-nest/src/controllers/imports/helpers/readAndProcessData.ts
  14. 0
      packages/nocodb-nest/src/controllers/imports/helpers/syncMap.ts
  15. 2
      packages/nocodb-nest/src/controllers/imports/import.controller.spec.ts
  16. 18
      packages/nocodb-nest/src/controllers/imports/import.controller.ts
  17. 2
      packages/nocodb-nest/src/controllers/project-users.controller.spec.ts
  18. 6
      packages/nocodb-nest/src/controllers/project-users.controller.ts
  19. 0
      packages/nocodb-nest/src/controllers/test/TestResetService/index.ts
  20. 0
      packages/nocodb-nest/src/controllers/test/TestResetService/resetMetaSakilaSqliteProject.ts
  21. 0
      packages/nocodb-nest/src/controllers/test/TestResetService/resetMysqlSakilaProject.ts
  22. 0
      packages/nocodb-nest/src/controllers/test/TestResetService/resetPgSakilaProject.ts
  23. 2
      packages/nocodb-nest/src/controllers/test/test.controller.spec.ts
  24. 3
      packages/nocodb-nest/src/controllers/test/test.controller.ts
  25. 0
      packages/nocodb-nest/src/controllers/users/ui/auth/emailVerify.ts
  26. 0
      packages/nocodb-nest/src/controllers/users/ui/auth/resetPassword.ts
  27. 0
      packages/nocodb-nest/src/controllers/users/ui/emailTemplates/forgotPassword.ts
  28. 0
      packages/nocodb-nest/src/controllers/users/ui/emailTemplates/invite.ts
  29. 0
      packages/nocodb-nest/src/controllers/users/ui/emailTemplates/verify.ts
  30. 2
      packages/nocodb-nest/src/controllers/users/users.controller.spec.ts
  31. 4
      packages/nocodb-nest/src/controllers/users/users.controller.ts
  32. 9
      packages/nocodb-nest/src/modules/api-tokens/api-tokens.module.ts
  33. 20
      packages/nocodb-nest/src/modules/attachments/attachments.module.ts
  34. 9
      packages/nocodb-nest/src/modules/audits/audits.module.ts
  35. 14
      packages/nocodb-nest/src/modules/auth/auth.module.ts
  36. 4
      packages/nocodb-nest/src/modules/auth/constants.ts
  37. 9
      packages/nocodb-nest/src/modules/bases/bases.module.ts
  38. 9
      packages/nocodb-nest/src/modules/caches/caches.module.ts
  39. 9
      packages/nocodb-nest/src/modules/columns/columns.module.ts
  40. 23
      packages/nocodb-nest/src/modules/datas/datas.module.ts
  41. 9
      packages/nocodb-nest/src/modules/filters/filters.module.ts
  42. 9
      packages/nocodb-nest/src/modules/form-columns/form-columns.module.ts
  43. 9
      packages/nocodb-nest/src/modules/forms/forms.module.ts
  44. 9
      packages/nocodb-nest/src/modules/galleries/galleries.module.ts
  45. 5
      packages/nocodb-nest/src/modules/global/global.module.ts
  46. 9
      packages/nocodb-nest/src/modules/grid-columns/grid-columns.module.ts
  47. 9
      packages/nocodb-nest/src/modules/grids/grids.module.ts
  48. 9
      packages/nocodb-nest/src/modules/hook-filters/hook-filters.module.ts
  49. 9
      packages/nocodb-nest/src/modules/hooks/hooks.module.ts
  50. 41
      packages/nocodb-nest/src/modules/import/import.module.ts
  51. 9
      packages/nocodb-nest/src/modules/kanbans/kanbans.module.ts
  52. 9
      packages/nocodb-nest/src/modules/maps/maps.module.ts
  53. 9
      packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.module.ts
  54. 11
      packages/nocodb-nest/src/modules/meta/meta.module.ts
  55. 157
      packages/nocodb-nest/src/modules/metas/metas.module.ts
  56. 9
      packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.module.ts
  57. 9
      packages/nocodb-nest/src/modules/org-lcense/org-lcense.module.ts
  58. 10
      packages/nocodb-nest/src/modules/org-tokens/org-tokens.module.ts
  59. 10
      packages/nocodb-nest/src/modules/org-users/org-users.module.ts
  60. 9
      packages/nocodb-nest/src/modules/plugins/plugins.module.ts
  61. 9
      packages/nocodb-nest/src/modules/project-users/project-users.module.ts
  62. 10
      packages/nocodb-nest/src/modules/projects/projects.module.ts
  63. 9
      packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.module.ts
  64. 20
      packages/nocodb-nest/src/modules/public-datas/public-datas.module.ts
  65. 9
      packages/nocodb-nest/src/modules/public-metas/public-metas.module.ts
  66. 9
      packages/nocodb-nest/src/modules/shared-bases/shared-bases.module.ts
  67. 9
      packages/nocodb-nest/src/modules/sorts/sorts.module.ts
  68. 9
      packages/nocodb-nest/src/modules/sync/sync.module.ts
  69. 10
      packages/nocodb-nest/src/modules/tables/tables.module.ts
  70. 4
      packages/nocodb-nest/src/modules/test/test.module.ts
  71. 19
      packages/nocodb-nest/src/modules/test/test.service.spec.ts
  72. 4
      packages/nocodb-nest/src/modules/test/test.service.ts
  73. 7
      packages/nocodb-nest/src/modules/users/user.spec.ts
  74. 1
      packages/nocodb-nest/src/modules/users/user.ts
  75. 6
      packages/nocodb-nest/src/modules/users/users.module.ts
  76. 9
      packages/nocodb-nest/src/modules/utils/utils.module.ts
  77. 9
      packages/nocodb-nest/src/modules/view-columns/view-columns.module.ts
  78. 11
      packages/nocodb-nest/src/modules/views/views.module.ts
  79. 0
      packages/nocodb-nest/src/services/api-docs/api-docs.service.spec.ts
  80. 4
      packages/nocodb-nest/src/services/api-docs/api-docs.service.ts
  81. 4
      packages/nocodb-nest/src/services/api-docs/swagger/getPaths.ts
  82. 4
      packages/nocodb-nest/src/services/api-docs/swagger/getSchemas.ts
  83. 6
      packages/nocodb-nest/src/services/api-docs/swagger/getSwaggerColumnMetas.ts
  84. 4
      packages/nocodb-nest/src/services/api-docs/swagger/getSwaggerJSON.ts
  85. 0
      packages/nocodb-nest/src/services/api-docs/swagger/swagger-base.json
  86. 0
      packages/nocodb-nest/src/services/api-docs/swagger/templates/headers.ts
  87. 2
      packages/nocodb-nest/src/services/api-docs/swagger/templates/params.ts
  88. 0
      packages/nocodb-nest/src/services/api-docs/swagger/templates/paths.ts
  89. 0
      packages/nocodb-nest/src/services/api-docs/swagger/templates/schemas.ts
  90. 4
      packages/nocodb-nest/src/services/auth.service.ts
  91. 19
      packages/nocodb-nest/src/services/import.service.spec.ts
  92. 4
      packages/nocodb-nest/src/services/import.service.ts
  93. 2
      packages/nocodb-nest/src/services/org-users.service.ts
  94. 0
      packages/nocodb-nest/src/services/project-users/project-users.service.spec.ts
  95. 0
      packages/nocodb-nest/src/services/project-users/project-users.service.ts
  96. 0
      packages/nocodb-nest/src/services/project-users/ui/auth/emailVerify.ts
  97. 0
      packages/nocodb-nest/src/services/project-users/ui/auth/resetPassword.ts
  98. 0
      packages/nocodb-nest/src/services/project-users/ui/emailTemplates/forgotPassword.ts
  99. 0
      packages/nocodb-nest/src/services/project-users/ui/emailTemplates/invite.ts
  100. 0
      packages/nocodb-nest/src/services/project-users/ui/emailTemplates/verify.ts
  101. Some files were not shown because too many files have changed in this diff Show More

88
packages/nocodb-nest/src/app.module.ts

@ -7,59 +7,23 @@ import { GlobalExceptionFilter } from './filters/global-exception/global-excepti
import NcPluginMgrv2 from './helpers/NcPluginMgrv2'; import NcPluginMgrv2 from './helpers/NcPluginMgrv2';
import { GlobalMiddleware } from './middlewares/global/global.middleware'; import { GlobalMiddleware } from './middlewares/global/global.middleware';
import { GuiMiddleware } from './middlewares/gui/gui.middleware'; import { GuiMiddleware } from './middlewares/gui/gui.middleware';
import { DatasModule } from './modules/datas/datas.module';
import { AuthService } from './services/auth.service'; import { AuthService } from './services/auth.service';
import { UsersModule } from './modules/users/users.module'; import { UsersModule } from './modules/users/users.module';
import { MetaService } from './meta/meta.service'; import { MetaService } from './meta/meta.service';
import { UtilsModule } from './modules/utils/utils.module';
import { ProjectsModule } from './modules/projects/projects.module';
import Noco from './Noco'; import Noco from './Noco';
import { TablesModule } from './modules/tables/tables.module';
import { ViewsModule } from './modules/views/views.module';
import { FiltersModule } from './modules/filters/filters.module';
import { SortsModule } from './modules/sorts/sorts.module';
import { ColumnsModule } from './modules/columns/columns.module';
import { ViewColumnsModule } from './modules/view-columns/view-columns.module';
import { BasesModule } from './modules/bases/bases.module';
import { HooksModule } from './modules/hooks/hooks.module';
import { SharedBasesModule } from './modules/shared-bases/shared-bases.module';
import { FormsModule } from './modules/forms/forms.module';
import { GridsModule } from './modules/grids/grids.module';
import { KanbansModule } from './modules/kanbans/kanbans.module';
import { GalleriesModule } from './modules/galleries/galleries.module';
import { FormColumnsModule } from './modules/form-columns/form-columns.module';
import { GridColumnsModule } from './modules/grid-columns/grid-columns.module';
import { MapsModule } from './modules/maps/maps.module';
import { ProjectUsersModule } from './modules/project-users/project-users.module';
import { ModelVisibilitiesModule } from './modules/model-visibilities/model-visibilities.module';
import { HookFiltersModule } from './modules/hook-filters/hook-filters.module';
import { ApiTokensModule } from './modules/api-tokens/api-tokens.module';
import { AttachmentsModule } from './modules/attachments/attachments.module';
import { OrgLcenseModule } from './modules/org-lcense/org-lcense.module';
import { OrgTokensModule } from './modules/org-tokens/org-tokens.module';
import { OrgUsersModule } from './modules/org-users/org-users.module';
import { MetaDiffsModule } from './modules/meta-diffs/meta-diffs.module';
import { AuditsModule } from './modules/audits/audits.module';
import { DatasModule } from './modules/datas/datas.module';
import { ApiDocsModule } from './modules/api-docs/api-docs.module';
import { PublicMetasModule } from './modules/public-metas/public-metas.module';
import { PublicDatasModule } from './modules/public-datas/public-datas.module';
import { PublicDatasExportModule } from './modules/public-datas-export/public-datas-export.module';
import { SyncModule } from './modules/sync/sync.module';
import { ImportModule } from './modules/import/import.module';
import { CachesModule } from './modules/caches/caches.module';
import { TestModule } from './modules/test/test.module'; import { TestModule } from './modules/test/test.module';
import { PluginsModule } from './modules/plugins/plugins.module';
import { GlobalModule } from './modules/global/global.module'; import { GlobalModule } from './modules/global/global.module';
import { LocalStrategy } from './strategies/local.strategy'; import { LocalStrategy } from './strategies/local.strategy';
import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy'; import { AuthTokenStrategy } from './strategies/authtoken.strategy/authtoken.strategy';
import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy'; import { BaseViewStrategy } from './strategies/base-view.strategy/base-view.strategy';
import { GoogleStrategy } from './strategies/google.strategy/google.strategy'; import { GoogleStrategy } from './strategies/google.strategy/google.strategy';
import NcUpgrader from './version-upgrader/NcUpgrader'; import NcUpgrader from './version-upgrader/NcUpgrader';
import { MetasModule } from './modules/metas/metas.module';
import type { import type {
MiddlewareConsumer, MiddlewareConsumer,
OnApplicationBootstrap, OnApplicationBootstrap,
} from '@nestjs/common'; } from '@nestjs/common';
import { MetaModule } from './modules/meta/meta.module';
@Module({ @Module({
imports: [ imports: [
@ -67,66 +31,22 @@ import { MetaModule } from './modules/meta/meta.module';
rootPath: join(process.cwd(), 'public'), rootPath: join(process.cwd(), 'public'),
}), }),
GlobalModule, GlobalModule,
// AuthModule,
UsersModule, UsersModule,
UtilsModule,
ProjectsModule,
TablesModule,
ViewsModule,
FiltersModule,
SortsModule,
ColumnsModule,
ViewColumnsModule,
BasesModule,
HooksModule,
SharedBasesModule,
FormsModule,
GridsModule,
KanbansModule,
GalleriesModule,
FormColumnsModule,
GridColumnsModule,
MapsModule,
ProjectUsersModule,
ModelVisibilitiesModule,
HookFiltersModule,
ApiTokensModule,
AttachmentsModule,
OrgLcenseModule,
OrgTokensModule,
OrgUsersModule,
MetaDiffsModule,
AuditsModule,
DatasModule,
ApiDocsModule,
PublicMetasModule,
PublicDatasModule,
PublicDatasExportModule,
SyncModule,
ImportModule,
CachesModule,
...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []), ...(process.env['PLAYWRIGHT_TEST'] === 'true' ? [TestModule] : []),
PluginsModule, MetasModule,
MetaModule, DatasModule,
], ],
controllers: [], controllers: [],
providers: [ providers: [
// {
// provide: APP_GUARD,
// useClass: GlobalGuard,
// },
AuthService, AuthService,
{ {
provide: APP_FILTER, provide: APP_FILTER,
useClass: GlobalExceptionFilter, useClass: GlobalExceptionFilter,
}, },
// JwtStrategyProvider,
LocalStrategy, LocalStrategy,
// ExtractProjectIdMiddleware,
AuthTokenStrategy, AuthTokenStrategy,
BaseViewStrategy, BaseViewStrategy,
GoogleStrategy, GoogleStrategy,
// GlobalGuard,
], ],
}) })
export class AppModule implements OnApplicationBootstrap { export class AppModule implements OnApplicationBootstrap {

2
packages/nocodb-nest/src/controllers/api-docs/api-docs.controller.spec.ts

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import { ApiDocsController } from './api-docs.controller'; import { ApiDocsController } from './api-docs.controller';
import { ApiDocsService } from '../../modules/api-docs.service'; import { ApiDocsService } from '../../services/api-docs/api-docs.service';
import type { TestingModule } from '@nestjs/testing'; import type { TestingModule } from '@nestjs/testing';
describe('ApiDocsController', () => { describe('ApiDocsController', () => {

2
packages/nocodb-nest/src/controllers/api-docs/api-docs.controller.ts

@ -11,7 +11,7 @@ import {
Acl, Acl,
ExtractProjectIdMiddleware, ExtractProjectIdMiddleware,
} from '../../middlewares/extract-project-id/extract-project-id.middleware'; } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { ApiDocsService } from '../../modules/api-docs.service'; import { ApiDocsService } from '../../services/api-docs/api-docs.service';
import getSwaggerHtml from './template/swaggerHtml'; import getSwaggerHtml from './template/swaggerHtml';
import getRedocHtml from './template/redocHtml'; import getRedocHtml from './template/redocHtml';

2
packages/nocodb-nest/src/modules/datas/data-alias.controller.spec.ts → packages/nocodb-nest/src/controllers/data-alias.controller.spec.ts

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import { DataAliasController } from './data-alias.controller'; import { DataAliasController } from './data-alias.controller';
import { DatasService } from '../../services/datas.service'; import { DatasService } from '../services/datas.service';
import type { TestingModule } from '@nestjs/testing'; import type { TestingModule } from '@nestjs/testing';
describe('DataAliasController', () => { describe('DataAliasController', () => {

8
packages/nocodb-nest/src/modules/datas/data-alias.controller.ts → packages/nocodb-nest/src/controllers/data-alias.controller.ts

@ -12,13 +12,13 @@ import {
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
import { GlobalGuard } from '../../guards/global/global.guard'; import { GlobalGuard } from '../guards/global/global.guard';
import { parseHrtimeToSeconds } from '../../helpers'; import { parseHrtimeToSeconds } from '../helpers';
import { import {
Acl, Acl,
ExtractProjectIdMiddleware, ExtractProjectIdMiddleware,
} from '../../middlewares/extract-project-id/extract-project-id.middleware'; } from '../middlewares/extract-project-id/extract-project-id.middleware';
import { DatasService } from '../../services/datas.service'; import { DatasService } from '../services/datas.service';
@Controller() @Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard) @UseGuards(ExtractProjectIdMiddleware, GlobalGuard)

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

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

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

@ -10,12 +10,12 @@ import {
Request, Request,
UseGuards, UseGuards,
} from '@nestjs/common'; } from '@nestjs/common';
import { GlobalGuard } from '../../guards/global/global.guard'; import { GlobalGuard } from '../guards/global/global.guard';
import { import {
Acl, Acl,
ExtractProjectIdMiddleware, ExtractProjectIdMiddleware,
} from '../../middlewares/extract-project-id/extract-project-id.middleware'; } from '../middlewares/extract-project-id/extract-project-id.middleware';
import { DatasService } from '../../services/datas.service'; import { DatasService } from '../services/datas.service';
@Controller() @Controller()
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard) @UseGuards(ExtractProjectIdMiddleware, GlobalGuard)

0
packages/nocodb-nest/src/modules/sync/helpers/EntityMap.ts → packages/nocodb-nest/src/controllers/imports/helpers/EntityMap.ts

0
packages/nocodb-nest/src/modules/sync/helpers/NocoSyncDestAdapter.ts → packages/nocodb-nest/src/controllers/imports/helpers/NocoSyncDestAdapter.ts

0
packages/nocodb-nest/src/modules/sync/helpers/NocoSyncSourceAdapter.ts → packages/nocodb-nest/src/controllers/imports/helpers/NocoSyncSourceAdapter.ts

0
packages/nocodb-nest/src/modules/sync/helpers/fetchAT.ts → packages/nocodb-nest/src/controllers/imports/helpers/fetchAT.ts

2
packages/nocodb-nest/src/modules/sync/helpers/job.ts → packages/nocodb-nest/src/controllers/imports/helpers/job.ts

@ -15,7 +15,7 @@ import { FiltersService } from '../../../services/filters.service';
import { FormColumnsService } from '../../../services/form-columns.service'; import { FormColumnsService } from '../../../services/form-columns.service';
import { GalleriesService } from '../../../services/galleries.service'; import { GalleriesService } from '../../../services/galleries.service';
import { GridsService } from '../../../services/grids.service'; import { GridsService } from '../../../services/grids.service';
import { ProjectUsersService } from '../../project-users/project-users.service'; import { ProjectUsersService } from '../../../services/project-users/project-users.service';
import { ProjectsService } from '../../../services/projects.service'; import { ProjectsService } from '../../../services/projects.service';
import { SortsService } from '../../../services/sorts.service'; import { SortsService } from '../../../services/sorts.service';
import { TablesService } from '../../../services/tables.service'; import { TablesService } from '../../../services/tables.service';

0
packages/nocodb-nest/src/modules/sync/helpers/readAndProcessData.ts → packages/nocodb-nest/src/controllers/imports/helpers/readAndProcessData.ts

0
packages/nocodb-nest/src/modules/sync/helpers/syncMap.ts → packages/nocodb-nest/src/controllers/imports/helpers/syncMap.ts

2
packages/nocodb-nest/src/controllers/import.controller.spec.ts → packages/nocodb-nest/src/controllers/imports/import.controller.spec.ts

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

18
packages/nocodb-nest/src/controllers/import.controller.ts → packages/nocodb-nest/src/controllers/imports/import.controller.ts

@ -1,15 +1,14 @@
import { Controller, HttpCode, Post, Request, UseGuards } from '@nestjs/common'; import { Controller, HttpCode, Post, Request, UseGuards } from '@nestjs/common';
import { forwardRef, Inject } from '@nestjs/common'; import { forwardRef, Inject } from '@nestjs/common';
import { ModuleRef } from '@nestjs/core'; import { ModuleRef } from '@nestjs/core';
import { GlobalGuard } from '../guards/global/global.guard'; import { GlobalGuard } from '../../guards/global/global.guard';
import { NcError } from '../helpers/catchError'; import { NcError } from '../../helpers/catchError';
import { ExtractProjectIdMiddleware } from '../middlewares/extract-project-id/extract-project-id.middleware'; import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { SyncSource } from '../models'; import { SyncSource } from '../../models';
import NocoJobs from '../jobs/NocoJobs'; import NocoJobs from '../../jobs/NocoJobs';
import { SocketService } from '../services/socket.service'; import { SocketService } from '../../services/socket.service';
import airtableSyncJob from '../modules/sync/helpers/job'; import airtableSyncJob from './helpers/job';
import { ImportService } from '../services/import.service'; import type { AirtableSyncConfig } from './helpers/job';
import type { AirtableSyncConfig } from '../modules/sync/helpers/job';
import type { Server } from 'socket.io'; import type { Server } from 'socket.io';
@ -79,7 +78,6 @@ const initJob = (sv: Server, jobs: { [p: string]: { last_message: any } }) => {
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard) @UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
export class ImportController { export class ImportController {
constructor( constructor(
private readonly importService: ImportService,
private readonly socketService: SocketService, private readonly socketService: SocketService,
@Inject(forwardRef(() => ModuleRef)) private readonly moduleRef: ModuleRef, @Inject(forwardRef(() => ModuleRef)) private readonly moduleRef: ModuleRef,
) {} ) {}

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

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import { ProjectUsersController } from './project-users.controller'; import { ProjectUsersController } from './project-users.controller';
import { ProjectUsersService } from './project-users.service'; import { ProjectUsersService } from '../services/project-users/project-users.service';
import type { TestingModule } from '@nestjs/testing'; import type { TestingModule } from '@nestjs/testing';
describe('ProjectUsersController', () => { describe('ProjectUsersController', () => {

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

@ -12,12 +12,12 @@ import {
} from '@nestjs/common'; } from '@nestjs/common';
import { ProjectUserReqType } from 'nocodb-sdk'; import { ProjectUserReqType } from 'nocodb-sdk';
import { AuthGuard } from '@nestjs/passport'; import { AuthGuard } from '@nestjs/passport';
import { GlobalGuard } from '../../guards/global/global.guard'; import { GlobalGuard } from '../guards/global/global.guard';
import { import {
Acl, Acl,
ExtractProjectIdMiddleware, ExtractProjectIdMiddleware,
} from '../../middlewares/extract-project-id/extract-project-id.middleware'; } from '../middlewares/extract-project-id/extract-project-id.middleware';
import { ProjectUsersService } from './project-users.service'; import { ProjectUsersService } from '../services/project-users/project-users.service';
@UseGuards(ExtractProjectIdMiddleware, GlobalGuard) @UseGuards(ExtractProjectIdMiddleware, GlobalGuard)
@Controller() @Controller()

0
packages/nocodb-nest/src/modules/test/TestResetService/index.ts → packages/nocodb-nest/src/controllers/test/TestResetService/index.ts

0
packages/nocodb-nest/src/modules/test/TestResetService/resetMetaSakilaSqliteProject.ts → packages/nocodb-nest/src/controllers/test/TestResetService/resetMetaSakilaSqliteProject.ts

0
packages/nocodb-nest/src/modules/test/TestResetService/resetMysqlSakilaProject.ts → packages/nocodb-nest/src/controllers/test/TestResetService/resetMysqlSakilaProject.ts

0
packages/nocodb-nest/src/modules/test/TestResetService/resetPgSakilaProject.ts → packages/nocodb-nest/src/controllers/test/TestResetService/resetPgSakilaProject.ts

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

@ -1,6 +1,6 @@
import { Test } from '@nestjs/testing'; import { Test } from '@nestjs/testing';
import { TestController } from './test.controller'; import { TestController } from './test.controller';
import { TestService } from './test.service'; import { TestService } from '../../modules/test/test.service';
import type { TestingModule } from '@nestjs/testing'; import type { TestingModule } from '@nestjs/testing';
describe('TestController', () => { describe('TestController', () => {

3
packages/nocodb-nest/src/modules/test/test.controller.ts → packages/nocodb-nest/src/controllers/test/test.controller.ts

@ -1,10 +1,9 @@
import { Controller, HttpCode, Post, Req } from '@nestjs/common'; import { Controller, HttpCode, Post, Req } from '@nestjs/common';
import { TestService } from './test.service';
import { TestResetService } from './TestResetService'; import { TestResetService } from './TestResetService';
@Controller() @Controller()
export class TestController { export class TestController {
constructor(private readonly testService: TestService) {} constructor() {}
@Post('/api/v1/meta/test/reset') @Post('/api/v1/meta/test/reset')
@HttpCode(200) @HttpCode(200)

0
packages/nocodb-nest/src/modules/project-users/ui/auth/emailVerify.ts → packages/nocodb-nest/src/controllers/users/ui/auth/emailVerify.ts

0
packages/nocodb-nest/src/modules/project-users/ui/auth/resetPassword.ts → packages/nocodb-nest/src/controllers/users/ui/auth/resetPassword.ts

0
packages/nocodb-nest/src/modules/project-users/ui/emailTemplates/forgotPassword.ts → packages/nocodb-nest/src/controllers/users/ui/emailTemplates/forgotPassword.ts

0
packages/nocodb-nest/src/modules/project-users/ui/emailTemplates/invite.ts → packages/nocodb-nest/src/controllers/users/ui/emailTemplates/invite.ts

0
packages/nocodb-nest/src/modules/project-users/ui/emailTemplates/verify.ts → packages/nocodb-nest/src/controllers/users/ui/emailTemplates/verify.ts

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

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

4
packages/nocodb-nest/src/modules/users/users.controller.ts → packages/nocodb-nest/src/controllers/users/users.controller.ts

@ -22,8 +22,8 @@ import {
import Noco from '../../Noco'; import Noco from '../../Noco';
import extractRolesObj from '../../utils/extractRolesObj'; import extractRolesObj from '../../utils/extractRolesObj';
import { Audit, User } from '../../models'; import { Audit, User } from '../../models';
import { genJwt, randomTokenString, setTokenCookie } from './helpers'; import { genJwt, randomTokenString, setTokenCookie } from '../../services/users/helpers';
import { UsersService } from './users.service'; import { UsersService } from '../../services/users/users.service';
@Controller() @Controller()
export class UsersController { export class UsersController {

9
packages/nocodb-nest/src/modules/api-tokens/api-tokens.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { ApiTokensService } from '../../services/api-tokens.service';
import { ApiTokensController } from '../../controllers/api-tokens.controller';
@Module({
controllers: [ApiTokensController],
providers: [ApiTokensService],
})
export class ApiTokensModule {}

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

@ -1,20 +0,0 @@
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 '../../services/attachments.service';
import { AttachmentsController } from '../../controllers/attachments.controller';
@Module({
imports: [
MulterModule.register({
storage: multer.diskStorage({}),
limits: {
fieldSize: NC_ATTACHMENT_FIELD_SIZE,
},
}),
],
controllers: [AttachmentsController],
providers: [AttachmentsService],
})
export class AttachmentsModule {}

9
packages/nocodb-nest/src/modules/audits/audits.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { AuditsService } from '../../services/audits.service';
import { AuditsController } from '../../controllers/audits.controller';
@Module({
controllers: [AuditsController],
providers: [AuditsService],
})
export class AuditsModule {}

14
packages/nocodb-nest/src/modules/auth/auth.module.ts

@ -1,14 +0,0 @@
import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { PassportModule } from '@nestjs/passport';
import { LocalStrategy } from '../../strategies/local.strategy';
import { UsersModule } from '../users/users.module';
import { AuthService } from '../../services/auth.service';
import { AuthController } from '../../controllers/auth.controller';
@Module({
controllers: [AuthController],
imports: [UsersModule, PassportModule],
providers: [AuthService, LocalStrategy],
})
export class AuthModule {}

4
packages/nocodb-nest/src/modules/auth/constants.ts

@ -1,4 +0,0 @@
export const jwtConstants = {
// read from .env file
secret: 'some_random_key',
};

9
packages/nocodb-nest/src/modules/bases/bases.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { BasesService } from '../../services/bases.service';
import { BasesController } from '../../controllers/bases.controller';
@Module({
controllers: [BasesController],
providers: [BasesService],
})
export class BasesModule {}

9
packages/nocodb-nest/src/modules/caches/caches.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { CachesService } from '../../services/caches.service';
import { CachesController } from '../../controllers/caches.controller';
@Module({
controllers: [CachesController],
providers: [CachesService],
})
export class CachesModule {}

9
packages/nocodb-nest/src/modules/columns/columns.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { ColumnsService } from '../../services/columns.service';
import { ColumnsController } from '../../controllers/columns.controller';
@Module({
controllers: [ColumnsController],
providers: [ColumnsService],
})
export class ColumnsModule {}

23
packages/nocodb-nest/src/modules/datas/datas.module.ts

@ -1,7 +1,12 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { DataAliasController } from './data-alias.controller'; import { MulterModule } from '@nestjs/platform-express'
import multer from 'multer'
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants'
import { DataAliasController } from '../../controllers/data-alias.controller';
import { PublicDatasExportController } from '../../controllers/public-datas-export.controller'
import { PublicDatasController } from '../../controllers/public-datas.controller'
import { DatasService } from '../../services/datas.service'; import { DatasService } from '../../services/datas.service';
import { DatasController } from './datas.controller'; import { DatasController } from '../../controllers/datas.controller';
import { BulkDataAliasController } from '../../controllers/bulk-data-alias.controller'; import { BulkDataAliasController } from '../../controllers/bulk-data-alias.controller';
import { DataAliasExportController } from '../../controllers/data-alias-export.controller'; import { DataAliasExportController } from '../../controllers/data-alias-export.controller';
import { DataAliasNestedController } from '../../controllers/data-alias-nested.controller'; import { DataAliasNestedController } from '../../controllers/data-alias-nested.controller';
@ -9,8 +14,18 @@ import { OldDatasController } from '../../controllers/old-datas/old-datas.contro
import { BulkDataAliasService } from '../../services/bulk-data-alias.service'; import { BulkDataAliasService } from '../../services/bulk-data-alias.service';
import { DataAliasNestedService } from '../../services/data-alias-nested.service'; import { DataAliasNestedService } from '../../services/data-alias-nested.service';
import { OldDatasService } from '../../controllers/old-datas/old-datas.service'; import { OldDatasService } from '../../controllers/old-datas/old-datas.service';
import { PublicDatasExportService } from '../../services/public-datas-export.service'
import { PublicDatasService } from '../../services/public-datas.service'
@Module({ @Module({
imports: [
MulterModule.register({
storage: multer.diskStorage({}),
limits: {
fieldSize: NC_ATTACHMENT_FIELD_SIZE,
},
}),
],
controllers: [ controllers: [
DatasController, DatasController,
BulkDataAliasController, BulkDataAliasController,
@ -18,12 +33,16 @@ import { OldDatasService } from '../../controllers/old-datas/old-datas.service';
DataAliasNestedController, DataAliasNestedController,
DataAliasExportController, DataAliasExportController,
OldDatasController, OldDatasController,
PublicDatasController,
PublicDatasExportController
], ],
providers: [ providers: [
DatasService, DatasService,
BulkDataAliasService, BulkDataAliasService,
DataAliasNestedService, DataAliasNestedService,
OldDatasService, OldDatasService,
PublicDatasService,
PublicDatasExportService
], ],
}) })
export class DatasModule {} export class DatasModule {}

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

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { FiltersService } from '../../services/filters.service';
import { FiltersController } from '../../controllers/filters.controller';
@Module({
controllers: [FiltersController],
providers: [FiltersService],
})
export class FiltersModule {}

9
packages/nocodb-nest/src/modules/form-columns/form-columns.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { FormColumnsService } from '../../services/form-columns.service';
import { FormColumnsController } from '../../controllers/form-columns.controller';
@Module({
controllers: [FormColumnsController],
providers: [FormColumnsService],
})
export class FormColumnsModule {}

9
packages/nocodb-nest/src/modules/forms/forms.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { FormsService } from '../../services/forms.service';
import { FormsController } from '../../controllers/forms.controller';
@Module({
controllers: [FormsController],
providers: [FormsService],
})
export class FormsModule {}

9
packages/nocodb-nest/src/modules/galleries/galleries.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { GalleriesService } from '../../services/galleries.service';
import { GalleriesController } from '../../controllers/galleries.controller';
@Module({
controllers: [GalleriesController],
providers: [GalleriesService],
})
export class GalleriesModule {}

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

@ -7,9 +7,7 @@ import { MetaService } from '../../meta/meta.service';
import { SocketService } from '../../services/socket.service'; import { SocketService } from '../../services/socket.service';
import { JwtStrategy } from '../../strategies/jwt.strategy'; import { JwtStrategy } from '../../strategies/jwt.strategy';
import NcConfigFactory from '../../utils/NcConfigFactory'; import NcConfigFactory from '../../utils/NcConfigFactory';
import { jwtConstants } from '../auth/constants'; import { UsersService } from '../../services/users/users.service';
import { UsersModule } from '../users/users.module';
import { UsersService } from '../users/users.service';
import type { Provider } from '@nestjs/common'; import type { Provider } from '@nestjs/common';
export const JwtStrategyProvider: Provider = { export const JwtStrategyProvider: Provider = {
@ -45,7 +43,6 @@ export const JwtStrategyProvider: Provider = {
exports: [ exports: [
Connection, Connection,
MetaService, MetaService,
// JwtService,
JwtStrategyProvider, JwtStrategyProvider,
UsersService, UsersService,
GlobalGuard, GlobalGuard,

9
packages/nocodb-nest/src/modules/grid-columns/grid-columns.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { GridColumnsService } from '../../services/grid-columns.service';
import { GridColumnsController } from '../../controllers/grid-columns.controller';
@Module({
controllers: [GridColumnsController],
providers: [GridColumnsService],
})
export class GridColumnsModule {}

9
packages/nocodb-nest/src/modules/grids/grids.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { GridsService } from '../../services/grids.service';
import { GridsController } from '../../controllers/grids.controller';
@Module({
controllers: [GridsController],
providers: [GridsService],
})
export class GridsModule {}

9
packages/nocodb-nest/src/modules/hook-filters/hook-filters.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { HookFiltersService } from '../../services/hook-filters.service';
import { HookFiltersController } from '../../controllers/hook-filters.controller';
@Module({
controllers: [HookFiltersController],
providers: [HookFiltersService],
})
export class HookFiltersModule {}

9
packages/nocodb-nest/src/modules/hooks/hooks.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { HooksService } from '../../services/hooks.service';
import { HooksController } from '../../controllers/hooks.controller';
@Module({
controllers: [HooksController],
providers: [HooksService],
})
export class HooksModule {}

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

@ -1,41 +0,0 @@
import { Module } from '@nestjs/common';
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 '../../services/grids.service';
import { ProjectUsersService } from '../project-users/project-users.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 { ImportService } from '../../services/import.service';
import { ImportController } from '../../controllers/import.controller';
@Module({
imports: [GlobalModule],
controllers: [ImportController],
providers: [
ImportService,
TablesService,
ViewsService,
ProjectsService,
AttachmentsService,
ColumnsService,
FiltersService,
FormColumnsService,
FormsService,
GalleriesService,
ProjectUsersService,
ViewColumnsService,
SortsService,
GridsService,
BulkDataAliasService,
],
})
export class ImportModule {}

9
packages/nocodb-nest/src/modules/kanbans/kanbans.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { KanbansService } from '../../services/kanbans.service';
import { KanbansController } from '../../controllers/kanbans.controller';
@Module({
controllers: [KanbansController],
providers: [KanbansService],
})
export class KanbansModule {}

9
packages/nocodb-nest/src/modules/maps/maps.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { MapsService } from '../../services/maps.service';
import { MapsController } from '../../controllers/maps.controller';
@Module({
controllers: [MapsController],
providers: [MapsService],
})
export class MapsModule {}

9
packages/nocodb-nest/src/modules/meta-diffs/meta-diffs.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { MetaDiffsService } from '../../services/meta-diffs.service';
import { MetaDiffsController } from '../../controllers/meta-diffs.controller';
@Module({
controllers: [MetaDiffsController],
providers: [MetaDiffsService],
})
export class MetaDiffsModule {}

11
packages/nocodb-nest/src/modules/meta/meta.module.ts

@ -1,11 +0,0 @@
import { Module } from '@nestjs/common';
import { ApiDocsController } from '../../controllers/api-docs/api-docs.controller'
import { ApiTokensController } from '../../controllers/api-tokens.controller'
import { ApiTokensService } from '../../services/api-tokens.service'
import { ApiDocsService } from '../api-docs.service'
@Module({})
export class MetaModule {
controllers: [ApiDocsController, ApiTokensController],
providers: [ApiDocsService, ApiTokensService],
}

157
packages/nocodb-nest/src/modules/metas/metas.module.ts

@ -0,0 +1,157 @@
import { Module } from '@nestjs/common';
import { MulterModule } from '@nestjs/platform-express';
import multer from 'multer';
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants';
import { ApiDocsController } from '../../controllers/api-docs/api-docs.controller';
import { ApiTokensController } from '../../controllers/api-tokens.controller';
import { AttachmentsController } from '../../controllers/attachments.controller';
import { AuditsController } from '../../controllers/audits.controller';
import { BasesController } from '../../controllers/bases.controller';
import { CachesController } from '../../controllers/caches.controller';
import { ColumnsController } from '../../controllers/columns.controller';
import { FiltersController } from '../../controllers/filters.controller'
import { FormColumnsController } from '../../controllers/form-columns.controller'
import { FormsController } from '../../controllers/forms.controller'
import { GalleriesController } from '../../controllers/galleries.controller'
import { GridColumnsController } from '../../controllers/grid-columns.controller'
import { GridsController } from '../../controllers/grids.controller'
import { HooksController } from '../../controllers/hooks.controller'
import { ImportController } from '../../controllers/imports/import.controller'
import { KanbansController } from '../../controllers/kanbans.controller'
import { MapsController } from '../../controllers/maps.controller'
import { MetaDiffsController } from '../../controllers/meta-diffs.controller'
import { ModelVisibilitiesController } from '../../controllers/model-visibilities.controller'
import { OrgLcenseController } from '../../controllers/org-lcense.controller'
import { OrgTokensController } from '../../controllers/org-tokens.controller'
import { OrgUsersController } from '../../controllers/org-users.controller'
import { PluginsController } from '../../controllers/plugins.controller'
import { ProjectsController } from '../../controllers/projects.controller'
import { PublicMetasController } from '../../controllers/public-metas.controller'
import { SharedBasesController } from '../../controllers/shared-bases.controller'
import { SortsController } from '../../controllers/sorts.controller'
import { SyncController } from '../../controllers/sync.controller'
import { TablesController } from '../../controllers/tables.controller'
import { UtilsController } from '../../controllers/utils.controller'
import { ViewColumnsController } from '../../controllers/view-columns.controller'
import { ViewsController } from '../../controllers/views.controller'
import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware'
import { ApiTokensService } from '../../services/api-tokens.service';
import { AttachmentsService } from '../../services/attachments.service';
import { AuditsService } from '../../services/audits.service';
import { BasesService } from '../../services/bases.service';
import { CachesService } from '../../services/caches.service';
import { ColumnsService } from '../../services/columns.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 { GridColumnsService } from '../../services/grid-columns.service'
import { GridsService } from '../../services/grids.service'
import { HooksService } from '../../services/hooks.service'
import { KanbansService } from '../../services/kanbans.service'
import { MapsService } from '../../services/maps.service'
import { MetaDiffsService } from '../../services/meta-diffs.service'
import { ModelVisibilitiesService } from '../../services/model-visibilities.service'
import { OrgLcenseService } from '../../services/org-lcense.service'
import { OrgTokensEeService } from '../../services/org-tokens-ee.service'
import { OrgTokensService } from '../../services/org-tokens.service'
import { OrgUsersService } from '../../services/org-users.service'
import { PluginsService } from '../../services/plugins.service'
import { ProjectsService } from '../../services/projects.service'
import { PublicMetasService } from '../../services/public-metas.service'
import { SharedBasesService } from '../../services/shared-bases.service'
import { SortsService } from '../../services/sorts.service'
import { SyncService } from '../../services/sync.service'
import { TablesService } from '../../services/tables.service'
import { UtilsService } from '../../services/utils.service'
import { ViewColumnsService } from '../../services/view-columns.service'
import { ViewsService } from '../../services/views.service'
import { ApiDocsService } from '../../services/api-docs/api-docs.service';
import { GlobalModule } from '../global/global.module'
import { ProjectUsersController } from '../../controllers/project-users.controller'
import { ProjectUsersService } from '../../services/project-users/project-users.service'
@Module({
imports: [
MulterModule.register({
storage: multer.diskStorage({}),
limits: {
fieldSize: NC_ATTACHMENT_FIELD_SIZE,
},
}),
GlobalModule,
],
controllers: [
ApiDocsController,
ApiTokensController,
AttachmentsController,
AuditsController,
BasesController,
CachesController,
ColumnsController,
FiltersController,
FormColumnsController,
FormsController,
GalleriesController,
GridColumnsController,
GridsController,
HooksController,
ImportController,
KanbansController,
MapsController,
MetaDiffsController,
ModelVisibilitiesController,
OrgLcenseController,
OrgTokensController,
OrgUsersController,
PluginsController,
ProjectUsersController,
ProjectsController,
PublicMetasController,
ViewsController,
ViewColumnsController,
UtilsController,
TablesController,
SyncController,
SortsController,
SharedBasesController
],
providers: [
ApiDocsService,
ApiTokensService,
AttachmentsService,
AuditsService,
BasesService,
CachesService,
ColumnsService,
FiltersService,
FormColumnsService,
FormsService,
GalleriesService,
GridColumnsService,
GridsService,
HooksService,
KanbansService,
MapsService,
MetaDiffsService,
ModelVisibilitiesService,
OrgLcenseService,
OrgTokensEeService,
OrgTokensService,
OrgUsersService,
ProjectUsersService,
PluginsService,
ProjectUsersService,
ProjectsService,
ExtractProjectIdMiddleware,
PublicMetasService,
ViewsService,
ViewColumnsService,
UtilsService,
TablesService,
SyncService,
SortsService,
SharedBasesService,
],
})
export class MetasModule {}

9
packages/nocodb-nest/src/modules/model-visibilities/model-visibilities.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { ModelVisibilitiesService } from '../../services/model-visibilities.service';
import { ModelVisibilitiesController } from '../../controllers/model-visibilities.controller';
@Module({
controllers: [ModelVisibilitiesController],
providers: [ModelVisibilitiesService],
})
export class ModelVisibilitiesModule {}

9
packages/nocodb-nest/src/modules/org-lcense/org-lcense.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { OrgLcenseService } from '../../services/org-lcense.service';
import { OrgLcenseController } from '../../controllers/org-lcense.controller';
@Module({
controllers: [OrgLcenseController],
providers: [OrgLcenseService],
})
export class OrgLcenseModule {}

10
packages/nocodb-nest/src/modules/org-tokens/org-tokens.module.ts

@ -1,10 +0,0 @@
import { Module } from '@nestjs/common';
import { OrgTokensEeService } from '../../services/org-tokens-ee.service';
import { OrgTokensService } from '../../services/org-tokens.service';
import { OrgTokensController } from '../../controllers/org-tokens.controller';
@Module({
controllers: [OrgTokensController],
providers: [OrgTokensEeService, OrgTokensService],
})
export class OrgTokensModule {}

10
packages/nocodb-nest/src/modules/org-users/org-users.module.ts

@ -1,10 +0,0 @@
import { Module } from '@nestjs/common';
import { ProjectUsersService } from '../project-users/project-users.service';
import { OrgUsersService } from '../../services/org-users.service';
import { OrgUsersController } from '../../controllers/org-users.controller';
@Module({
controllers: [OrgUsersController],
providers: [OrgUsersService, ProjectUsersService],
})
export class OrgUsersModule {}

9
packages/nocodb-nest/src/modules/plugins/plugins.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { PluginsService } from '../../services/plugins.service';
import { PluginsController } from '../../controllers/plugins.controller';
@Module({
controllers: [PluginsController],
providers: [PluginsService],
})
export class PluginsModule {}

9
packages/nocodb-nest/src/modules/project-users/project-users.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { ProjectUsersService } from './project-users.service';
import { ProjectUsersController } from './project-users.controller';
@Module({
controllers: [ProjectUsersController],
providers: [ProjectUsersService],
})
export class ProjectUsersModule {}

10
packages/nocodb-nest/src/modules/projects/projects.module.ts

@ -1,10 +0,0 @@
import { Module } from '@nestjs/common';
import { ExtractProjectIdMiddleware } from '../../middlewares/extract-project-id/extract-project-id.middleware';
import { ProjectsService } from '../../services/projects.service';
import { ProjectsController } from '../../controllers/projects.controller';
@Module({
controllers: [ProjectsController],
providers: [ProjectsService, ExtractProjectIdMiddleware],
})
export class ProjectsModule {}

9
packages/nocodb-nest/src/modules/public-datas-export/public-datas-export.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { PublicDatasExportService } from '../../services/public-datas-export.service';
import { PublicDatasExportController } from '../../controllers/public-datas-export.controller';
@Module({
controllers: [PublicDatasExportController],
providers: [PublicDatasExportService],
})
export class PublicDatasExportModule {}

20
packages/nocodb-nest/src/modules/public-datas/public-datas.module.ts

@ -1,20 +0,0 @@
import multer from 'multer';
import { Module } from '@nestjs/common';
import { MulterModule } from '@nestjs/platform-express';
import { NC_ATTACHMENT_FIELD_SIZE } from '../../constants';
import { PublicDatasService } from '../../services/public-datas.service';
import { PublicDatasController } from '../../controllers/public-datas.controller';
@Module({
imports: [
MulterModule.register({
storage: multer.diskStorage({}),
limits: {
fieldSize: NC_ATTACHMENT_FIELD_SIZE,
},
}),
],
controllers: [PublicDatasController],
providers: [PublicDatasService],
})
export class PublicDatasModule {}

9
packages/nocodb-nest/src/modules/public-metas/public-metas.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { PublicMetasService } from '../../services/public-metas.service';
import { PublicMetasController } from '../../controllers/public-metas.controller';
@Module({
controllers: [PublicMetasController],
providers: [PublicMetasService],
})
export class PublicMetasModule {}

9
packages/nocodb-nest/src/modules/shared-bases/shared-bases.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { SharedBasesService } from '../../services/shared-bases.service';
import { SharedBasesController } from '../../controllers/shared-bases.controller';
@Module({
controllers: [SharedBasesController],
providers: [SharedBasesService],
})
export class SharedBasesModule {}

9
packages/nocodb-nest/src/modules/sorts/sorts.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { SortsService } from '../../services/sorts.service';
import { SortsController } from '../../controllers/sorts.controller';
@Module({
controllers: [SortsController],
providers: [SortsService],
})
export class SortsModule {}

9
packages/nocodb-nest/src/modules/sync/sync.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { SyncService } from '../../services/sync.service';
import { SyncController } from '../../controllers/sync.controller';
@Module({
controllers: [SyncController],
providers: [SyncService],
})
export class SyncModule {}

10
packages/nocodb-nest/src/modules/tables/tables.module.ts

@ -1,10 +0,0 @@
import { Module } from '@nestjs/common';
import { TablesService } from '../../services/tables.service';
import { TablesController } from '../../controllers/tables.controller';
@Module({
controllers: [TablesController],
providers: [TablesService],
exports: [TablesService],
})
export class TablesModule {}

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

@ -1,9 +1,7 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { TestService } from './test.service'; import { TestController } from '../../controllers/test/test.controller';
import { TestController } from './test.controller';
@Module({ @Module({
controllers: [TestController], controllers: [TestController],
providers: [TestService],
}) })
export class TestModule {} export class TestModule {}

19
packages/nocodb-nest/src/modules/test/test.service.spec.ts

@ -1,19 +0,0 @@
import { Test } from '@nestjs/testing';
import { TestService } from './test.service';
import type { TestingModule } from '@nestjs/testing';
describe('TestService', () => {
let service: TestService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [TestService],
}).compile();
service = module.get<TestService>(TestService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

4
packages/nocodb-nest/src/modules/test/test.service.ts

@ -1,4 +0,0 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class TestService {}

7
packages/nocodb-nest/src/modules/users/user.spec.ts

@ -1,7 +0,0 @@
import { User } from './user';
describe('User', () => {
it('should be defined', () => {
expect(new User()).toBeDefined();
});
});

1
packages/nocodb-nest/src/modules/users/user.ts

@ -1 +0,0 @@
export class User {}

6
packages/nocodb-nest/src/modules/users/users.module.ts

@ -1,9 +1,7 @@
import { Module } from '@nestjs/common'; import { Module } from '@nestjs/common';
import { JwtModule } from '@nestjs/jwt';
import { jwtConstants } from '../auth/constants';
import { GlobalModule } from '../global/global.module'; import { GlobalModule } from '../global/global.module';
import { UsersService } from './users.service'; import { UsersService } from '../../services/users/users.service';
import { UsersController } from './users.controller'; import { UsersController } from '../../controllers/users/users.controller';
@Module({ @Module({
imports: [GlobalModule], imports: [GlobalModule],

9
packages/nocodb-nest/src/modules/utils/utils.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { UtilsService } from '../../services/utils.service';
import { UtilsController } from '../../controllers/utils.controller';
@Module({
controllers: [UtilsController],
providers: [UtilsService],
})
export class UtilsModule {}

9
packages/nocodb-nest/src/modules/view-columns/view-columns.module.ts

@ -1,9 +0,0 @@
import { Module } from '@nestjs/common';
import { ViewColumnsService } from '../../services/view-columns.service';
import { ViewColumnsController } from '../../controllers/view-columns.controller';
@Module({
controllers: [ViewColumnsController],
providers: [ViewColumnsService],
})
export class ViewColumnsModule {}

11
packages/nocodb-nest/src/modules/views/views.module.ts

@ -1,11 +0,0 @@
import { Module } from '@nestjs/common';
import { TablesModule } from '../tables/tables.module';
import { ViewsService } from '../../services/views.service';
import { ViewsController } from '../../controllers/views.controller';
@Module({
controllers: [ViewsController],
providers: [ViewsService],
imports: [TablesModule],
})
export class ViewsModule {}

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

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

@ -1,6 +1,6 @@
import { Injectable } from '@nestjs/common'; import { Injectable } from '@nestjs/common';
import { NcError } from '../helpers/catchError'; import { NcError } from '../../helpers/catchError';
import { Model, Project } from '../models'; import { Model, Project } from '../../models';
import getSwaggerJSON from './swagger/getSwaggerJSON'; import getSwaggerJSON from './swagger/getSwaggerJSON';
@Injectable() @Injectable()

4
packages/nocodb-nest/src/modules/swagger/getPaths.ts → packages/nocodb-nest/src/services/api-docs/swagger/getPaths.ts

@ -1,6 +1,6 @@
import Noco from '../../Noco'; import Noco from '../../../Noco';
import { getModelPaths, getViewPaths } from './templates/paths'; import { getModelPaths, getViewPaths } from './templates/paths';
import type { Model, Project } from '../../models'; import type { Model, Project } from '../../../models';
import type { SwaggerColumn } from './getSwaggerColumnMetas'; import type { SwaggerColumn } from './getSwaggerColumnMetas';
import type { SwaggerView } from './getSwaggerJSON'; import type { SwaggerView } from './getSwaggerJSON';

4
packages/nocodb-nest/src/modules/swagger/getSchemas.ts → packages/nocodb-nest/src/services/api-docs/swagger/getSchemas.ts

@ -1,6 +1,6 @@
import Noco from '../../Noco'; import Noco from '../../../Noco';
import { getModelSchemas, getViewSchemas } from './templates/schemas'; import { getModelSchemas, getViewSchemas } from './templates/schemas';
import type { Model, Project } from '../../models'; import type { Model, Project } from '../../../models';
import type { SwaggerColumn } from './getSwaggerColumnMetas'; import type { SwaggerColumn } from './getSwaggerColumnMetas';
import type { SwaggerView } from './getSwaggerJSON'; import type { SwaggerView } from './getSwaggerJSON';

6
packages/nocodb-nest/src/modules/swagger/getSwaggerColumnMetas.ts → packages/nocodb-nest/src/services/api-docs/swagger/getSwaggerColumnMetas.ts

@ -1,11 +1,11 @@
import { UITypes } from 'nocodb-sdk'; import { UITypes } from 'nocodb-sdk';
import SwaggerTypes from '../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes'; import SwaggerTypes from '../../../db/sql-mgr/code/routers/xc-ts/SwaggerTypes';
import Noco from '../../Noco'; import Noco from '../../../Noco';
import type { import type {
Column, Column,
LinkToAnotherRecordColumn, LinkToAnotherRecordColumn,
Project, Project,
} from '../../models'; } from '../../../models';
export default async ( export default async (
columns: Column[], columns: Column[],

4
packages/nocodb-nest/src/modules/swagger/getSwaggerJSON.ts → packages/nocodb-nest/src/services/api-docs/swagger/getSwaggerJSON.ts

@ -1,5 +1,5 @@
import { ViewTypes } from 'nocodb-sdk'; import { ViewTypes } from 'nocodb-sdk';
import Noco from '../../Noco'; import Noco from '../../../Noco';
import swaggerBase from './swagger-base.json'; import swaggerBase from './swagger-base.json';
import getPaths from './getPaths'; import getPaths from './getPaths';
import getSchemas from './getSchemas'; import getSchemas from './getSchemas';
@ -11,7 +11,7 @@ import type {
Model, Model,
Project, Project,
View, View,
} from '../../models'; } from '../../../models';
export default async function getSwaggerJSON( export default async function getSwaggerJSON(
project: Project, project: Project,

0
packages/nocodb-nest/src/modules/swagger/swagger-base.json → packages/nocodb-nest/src/services/api-docs/swagger/swagger-base.json

0
packages/nocodb-nest/src/modules/swagger/templates/headers.ts → packages/nocodb-nest/src/services/api-docs/swagger/templates/headers.ts

2
packages/nocodb-nest/src/modules/swagger/templates/params.ts → packages/nocodb-nest/src/services/api-docs/swagger/templates/params.ts

@ -1,5 +1,5 @@
import { RelationTypes, UITypes } from 'nocodb-sdk'; import { RelationTypes, UITypes } from 'nocodb-sdk';
import type { LinkToAnotherRecordColumn } from '../../../models'; import type { LinkToAnotherRecordColumn } from '../../../../models';
import type { SwaggerColumn } from '../getSwaggerColumnMetas'; import type { SwaggerColumn } from '../getSwaggerColumnMetas';
export const rowIdParam = { export const rowIdParam = {

0
packages/nocodb-nest/src/modules/swagger/templates/paths.ts → packages/nocodb-nest/src/services/api-docs/swagger/templates/paths.ts

0
packages/nocodb-nest/src/modules/swagger/templates/schemas.ts → packages/nocodb-nest/src/services/api-docs/swagger/templates/schemas.ts

4
packages/nocodb-nest/src/services/auth.service.ts

@ -5,8 +5,8 @@ import * as bcrypt from 'bcryptjs';
import { v4 as uuidv4 } from 'uuid'; import { v4 as uuidv4 } from 'uuid';
import Noco from '../Noco'; import Noco from '../Noco';
import { genJwt } from '../modules/users/helpers'; import { genJwt } from './users/helpers';
import { UsersService } from '../modules/users/users.service'; import { UsersService } from './users/users.service';
import { Connection } from '../connection/connection'; import { Connection } from '../connection/connection';
import type { CreateUserDto } from '../controllers/auth.controller'; import type { CreateUserDto } from '../controllers/auth.controller';

19
packages/nocodb-nest/src/services/import.service.spec.ts

@ -1,19 +0,0 @@
import { Test } from '@nestjs/testing';
import { ImportService } from './import.service';
import type { TestingModule } from '@nestjs/testing';
describe('ImportService', () => {
let service: ImportService;
beforeEach(async () => {
const module: TestingModule = await Test.createTestingModule({
providers: [ImportService],
}).compile();
service = module.get<ImportService>(ImportService);
});
it('should be defined', () => {
expect(service).toBeDefined();
});
});

4
packages/nocodb-nest/src/services/import.service.ts

@ -1,4 +0,0 @@
import { Injectable } from '@nestjs/common';
@Injectable()
export class ImportService {}

2
packages/nocodb-nest/src/services/org-users.service.ts

@ -18,7 +18,7 @@ import { Audit, ProjectUser, Store, SyncSource, User } from '../models';
import Noco from '../Noco'; import Noco from '../Noco';
import extractRolesObj from '../utils/extractRolesObj'; import extractRolesObj from '../utils/extractRolesObj';
import { MetaTable } from '../utils/globals'; import { MetaTable } from '../utils/globals';
import { ProjectUsersService } from '../modules/project-users/project-users.service'; import { ProjectUsersService } from './project-users/project-users.service';
import type { UserType } from 'nocodb-sdk'; import type { UserType } from 'nocodb-sdk';
@Injectable() @Injectable()

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

0
packages/nocodb-nest/src/modules/project-users/project-users.service.ts → packages/nocodb-nest/src/services/project-users/project-users.service.ts

0
packages/nocodb-nest/src/modules/users/ui/auth/emailVerify.ts → packages/nocodb-nest/src/services/project-users/ui/auth/emailVerify.ts

0
packages/nocodb-nest/src/modules/users/ui/auth/resetPassword.ts → packages/nocodb-nest/src/services/project-users/ui/auth/resetPassword.ts

0
packages/nocodb-nest/src/modules/users/ui/emailTemplates/forgotPassword.ts → packages/nocodb-nest/src/services/project-users/ui/emailTemplates/forgotPassword.ts

0
packages/nocodb-nest/src/modules/users/ui/emailTemplates/invite.ts → packages/nocodb-nest/src/services/project-users/ui/emailTemplates/invite.ts

0
packages/nocodb-nest/src/modules/users/ui/emailTemplates/verify.ts → packages/nocodb-nest/src/services/project-users/ui/emailTemplates/verify.ts

Some files were not shown because too many files have changed in this diff Show More

Loading…
Cancel
Save