From 4b263367646d0114684a1319b9bc60f704f0a2c1 Mon Sep 17 00:00:00 2001 From: Max Bischof <106820326+bischofmax@users.noreply.github.com> Date: Wed, 27 Nov 2024 16:34:44 +0100 Subject: [PATCH] BC-8460 - Solve circular imports in board collaboration module (#5359) Co-authored-by: Cedric Evers <12080057+CeEv@users.noreply.github.com> Co-authored-by: hoeppner.dataport --- .../src/apps/board-collaboration.app.ts | 10 ++--- .../src/modules/board/board-api.module.ts | 4 +- ...e.ts => board-collaboration.app.module.ts} | 42 +++++++++++++++---- .../board-collaboration.testing.module.ts | 39 ----------------- .../src/modules/board/board-ws-api.module.ts | 2 +- apps/server/src/modules/board/board.module.ts | 2 +- .../content-element-update-content.spec.ts | 4 +- .../board-collaboration.gateway.spec.ts | 8 ++-- .../internal/board-context.service.spec.ts | 10 ++--- .../service/internal/board-context.service.ts | 2 +- .../internal/column-board-copy.service.ts | 2 +- .../src/modules/board/uc/board.uc.spec.ts | 2 +- apps/server/src/modules/board/uc/board.uc.ts | 2 +- .../common-cartridge.module.ts | 2 +- .../deletion-console.app.module.ts | 2 +- .../deletion-execution.console.spec.ts | 2 +- .../deletion-queue.console.spec.ts | 2 +- .../files-storage-test.module.ts | 2 +- .../files-storage/files-storage.module.ts | 2 +- .../fwu-learning-contents.module.ts | 2 +- .../modules/h5p-editor/h5p-editor.module.ts | 2 +- .../idp-console/api/idp-sync-console.spec.ts | 2 +- .../idp-console/idp-console.app.module.ts | 2 +- .../management/management-server.module.ts | 2 +- .../modules/server/admin-api.server.module.ts | 2 +- .../src/modules/server/server.module.ts | 2 +- .../src/modules/tldraw/tldraw-api.module.ts | 2 +- .../modules/tldraw/tldraw-console.module.ts | 2 +- .../src/modules/tldraw/tldraw-ws.module.ts | 2 +- .../context-external-tool.module.ts | 6 +-- .../service/context-external-tool.service.ts | 2 +- .../service/external-tool.service.ts | 2 +- 32 files changed, 78 insertions(+), 93 deletions(-) rename apps/server/src/modules/board/{board-collaboration.module.ts => board-collaboration.app.module.ts} (50%) delete mode 100644 apps/server/src/modules/board/board-collaboration.testing.module.ts diff --git a/apps/server/src/apps/board-collaboration.app.ts b/apps/server/src/apps/board-collaboration.app.ts index 6251de954ee..d9ca6ca8c10 100644 --- a/apps/server/src/apps/board-collaboration.app.ts +++ b/apps/server/src/apps/board-collaboration.app.ts @@ -8,15 +8,15 @@ import { install as sourceMapInstall } from 'source-map-support'; // application imports import { SwaggerDocumentOptions } from '@nestjs/swagger'; import { LegacyLogger, Logger } from '@src/core/logger'; -import { RedisIoAdapter } from '@src/infra/socketio'; -import { BoardCollaborationModule } from '@src/modules/board/board-collaboration.module'; -import { enableOpenApiDocs } from '@src/shared/controller/swagger'; +import { RedisIoAdapter } from '@infra/socketio'; +import { BoardCollaborationModule } from '@modules/board/board-collaboration.app.module'; +import { enableOpenApiDocs } from '@shared/controller/swagger'; import express from 'express'; +import { ExpressAdapter } from '@nestjs/platform-express'; import { addPrometheusMetricsMiddlewaresIfEnabled, createAndStartPrometheusMetricsAppIfEnabled, -} from '@src/apps/helpers/prometheus-metrics'; -import { ExpressAdapter } from '@nestjs/platform-express'; +} from './helpers/prometheus-metrics'; async function bootstrap() { sourceMapInstall(); diff --git a/apps/server/src/modules/board/board-api.module.ts b/apps/server/src/modules/board/board-api.module.ts index f53defc4c28..3431851ef32 100644 --- a/apps/server/src/modules/board/board-api.module.ts +++ b/apps/server/src/modules/board/board-api.module.ts @@ -1,7 +1,8 @@ import { AuthorizationModule } from '@modules/authorization'; import { forwardRef, Module } from '@nestjs/common'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { LoggerModule } from '@src/core/logger'; +import { RoomMemberModule } from '../room-member'; import { BoardModule } from './board.module'; import { BoardController, @@ -12,7 +13,6 @@ import { } from './controller'; import { BoardNodePermissionService } from './service'; import { BoardUc, CardUc, ColumnUc, ElementUc, SubmissionItemUc } from './uc'; -import { RoomMemberModule } from '../room-member'; @Module({ imports: [BoardModule, LoggerModule, RoomMemberModule, forwardRef(() => AuthorizationModule)], diff --git a/apps/server/src/modules/board/board-collaboration.module.ts b/apps/server/src/modules/board/board-collaboration.app.module.ts similarity index 50% rename from apps/server/src/modules/board/board-collaboration.module.ts rename to apps/server/src/modules/board/board-collaboration.app.module.ts index 84354cdfa19..10995308119 100644 --- a/apps/server/src/modules/board/board-collaboration.module.ts +++ b/apps/server/src/modules/board/board-collaboration.app.module.ts @@ -1,22 +1,33 @@ import { AuthGuardModule, AuthGuardOptions } from '@infra/auth-guard'; +import { MongoMemoryDatabaseModule } from '@infra/database'; +import { RabbitMQWrapperModule } from '@infra/rabbitmq'; import { MikroOrmModule } from '@mikro-orm/nestjs'; import { Module } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; -import { ALL_ENTITIES } from '@shared/domain/entity'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; +import { ALL_ENTITIES } from '@shared/domain/entity/all-entities'; import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { CoreModule } from '@src/core'; -import { RabbitMQWrapperModule } from '@src/infra/rabbitmq'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { AuthenticationApiModule } from '../authentication/authentication-api.module'; import { AuthorizationModule } from '../authorization'; +import { serverConfig } from '../server'; import { config } from './board-collaboration.config'; import { BoardWsApiModule } from './board-ws-api.module'; import { BoardModule } from './board.module'; +const imports = [ + CoreModule, + RabbitMQWrapperModule, + BoardModule, + AuthorizationModule, + BoardWsApiModule, + AuthGuardModule.register([AuthGuardOptions.WS_JWT]), +]; + @Module({ imports: [ - CoreModule, + ...imports, ConfigModule.forRoot(createConfigModuleOptions(config)), - RabbitMQWrapperModule, MikroOrmModule.forRoot({ ...defaultMikroOrmOptions, type: 'mongo', @@ -25,12 +36,25 @@ import { BoardModule } from './board.module'; user: DB_USERNAME, entities: ALL_ENTITIES, }), - BoardModule, - AuthorizationModule, - BoardWsApiModule, - AuthGuardModule.register([AuthGuardOptions.WS_JWT]), ], providers: [], exports: [], }) export class BoardCollaborationModule {} + +const testConfig = () => { + return { ...serverConfig(), ...config() }; +}; + +@Module({ + imports: [ + ...imports, + ConfigModule.forRoot(createConfigModuleOptions(testConfig)), + AuthenticationApiModule, + MongoMemoryDatabaseModule.forRoot({ + ...defaultMikroOrmOptions, + entities: ALL_ENTITIES, + }), + ], +}) +export class BoardCollaborationTestModule {} diff --git a/apps/server/src/modules/board/board-collaboration.testing.module.ts b/apps/server/src/modules/board/board-collaboration.testing.module.ts deleted file mode 100644 index 4f0e78deed7..00000000000 --- a/apps/server/src/modules/board/board-collaboration.testing.module.ts +++ /dev/null @@ -1,39 +0,0 @@ -import { serverConfig } from '@modules/server'; -import { Module } from '@nestjs/common'; -import { ConfigModule } from '@nestjs/config'; -import { ALL_ENTITIES } from '@shared/domain/entity'; -import { createConfigModuleOptions } from '@src/config'; -import { CoreModule } from '@src/core'; -import { AuthGuardModule, AuthGuardOptions } from '@src/infra/auth-guard'; -import { MongoMemoryDatabaseModule } from '@src/infra/database'; -import { RabbitMQWrapperTestModule } from '@src/infra/rabbitmq'; -import { defaultMikroOrmOptions } from '@shared/common'; -import { AuthenticationApiModule } from '../authentication/authentication-api.module'; -import { AuthorizationModule } from '../authorization'; -import { config as boardCollaborationConfig } from './board-collaboration.config'; -import { BoardWsApiModule } from './board-ws-api.module'; -import { BoardModule } from './board.module'; - -const config = () => { - return { ...serverConfig(), ...boardCollaborationConfig() }; -}; - -@Module({ - imports: [ - CoreModule, - ConfigModule.forRoot(createConfigModuleOptions(config)), - RabbitMQWrapperTestModule, - MongoMemoryDatabaseModule.forRoot({ - ...defaultMikroOrmOptions, - entities: ALL_ENTITIES, - }), - BoardModule, - AuthorizationModule, - AuthenticationApiModule, - BoardWsApiModule, - AuthGuardModule.register([AuthGuardOptions.WS_JWT]), - ], - providers: [], - exports: [], -}) -export class BoardCollaborationTestingModule {} diff --git a/apps/server/src/modules/board/board-ws-api.module.ts b/apps/server/src/modules/board/board-ws-api.module.ts index 4a0bfe63cd4..1a39907dacd 100644 --- a/apps/server/src/modules/board/board-ws-api.module.ts +++ b/apps/server/src/modules/board/board-ws-api.module.ts @@ -1,7 +1,7 @@ import { AuthorizationModule } from '@modules/authorization'; import { UserModule } from '@modules/user'; import { forwardRef, Module } from '@nestjs/common'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { LoggerModule } from '@src/core/logger'; import { RoomMemberModule } from '../room-member'; import { BoardModule } from './board.module'; diff --git a/apps/server/src/modules/board/board.module.ts b/apps/server/src/modules/board/board.module.ts index 48a6296959c..7a2142e1204 100644 --- a/apps/server/src/modules/board/board.module.ts +++ b/apps/server/src/modules/board/board.module.ts @@ -7,7 +7,7 @@ import { UserModule } from '@modules/user'; import { HttpModule } from '@nestjs/axios'; import { Module } from '@nestjs/common'; import { CqrsModule } from '@nestjs/cqrs'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { LoggerModule } from '@src/core/logger'; import { AuthorizationModule } from '../authorization'; import { RoomMemberModule } from '../room-member'; diff --git a/apps/server/src/modules/board/controller/api-test/content-element-update-content.spec.ts b/apps/server/src/modules/board/controller/api-test/content-element-update-content.spec.ts index 66b7cb56a8d..fc5ee4ac7a0 100644 --- a/apps/server/src/modules/board/controller/api-test/content-element-update-content.spec.ts +++ b/apps/server/src/modules/board/controller/api-test/content-element-update-content.spec.ts @@ -2,11 +2,11 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { ServerTestModule } from '@modules/server/server.module'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { sanitizeRichText } from '@shared/controller'; +import { sanitizeRichText } from '@shared/controller/transformer/sanitize-html.transformer'; import { InputFormat } from '@shared/domain/types'; import { cleanupCollections, courseFactory, TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; -import { BoardNodeEntity } from '../../repo'; import { BoardExternalReferenceType, ContentElementType } from '../../domain'; +import { BoardNodeEntity } from '../../repo'; import { cardEntityFactory, columnBoardEntityFactory, diff --git a/apps/server/src/modules/board/gateway/api-test/board-collaboration.gateway.spec.ts b/apps/server/src/modules/board/gateway/api-test/board-collaboration.gateway.spec.ts index 1d35a9d10c8..0b587e5a9b5 100644 --- a/apps/server/src/modules/board/gateway/api-test/board-collaboration.gateway.spec.ts +++ b/apps/server/src/modules/board/gateway/api-test/board-collaboration.gateway.spec.ts @@ -3,18 +3,18 @@ import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { MongoIoAdapter } from '@infra/socketio'; -import { InputFormat } from '@shared/domain/types'; +import { InputFormat } from '@shared/domain/types/input-format.types'; import { cleanupCollections, courseFactory, userFactory } from '@shared/testing'; import { getSocketApiClient, waitForEvent } from '@shared/testing/test-socket-api-client'; import { Socket } from 'socket.io-client'; +import { BoardCollaborationTestModule } from '../../board-collaboration.app.module'; +import { BoardExternalReferenceType, CardProps, ContentElementType } from '../../domain'; import { cardEntityFactory, columnBoardEntityFactory, columnEntityFactory, richTextElementEntityFactory, } from '../../testing'; -import { BoardExternalReferenceType, CardProps, ContentElementType } from '../../domain'; -import { BoardCollaborationTestingModule } from '../../board-collaboration.testing.module'; import { BoardCollaborationGateway } from '../board-collaboration.gateway'; describe(BoardCollaborationGateway.name, () => { @@ -25,7 +25,7 @@ describe(BoardCollaborationGateway.name, () => { beforeAll(async () => { const testingModule = await Test.createTestingModule({ - imports: [BoardCollaborationTestingModule], + imports: [BoardCollaborationTestModule], }).compile(); app = testingModule.createNestApplication(); diff --git a/apps/server/src/modules/board/service/internal/board-context.service.spec.ts b/apps/server/src/modules/board/service/internal/board-context.service.spec.ts index c14ec70c1e1..a1f6f2341a5 100644 --- a/apps/server/src/modules/board/service/internal/board-context.service.spec.ts +++ b/apps/server/src/modules/board/service/internal/board-context.service.spec.ts @@ -1,15 +1,15 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { CourseRepo } from '@shared/repo'; -import { courseFactory, groupFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; -import { RoomMemberService } from '@src/modules/room-member'; -import { roomFactory } from '@src/modules/room/testing'; import { Permission, RoleName } from '@shared/domain/interface'; +import { CourseRepo } from '@shared/repo/course'; +import { courseFactory, groupFactory, roleFactory, setupEntities, userFactory } from '@shared/testing'; import { GroupTypes } from '@src/modules/group'; +import { RoomMemberService } from '@src/modules/room-member'; import { roomMemberFactory } from '@src/modules/room-member/testing'; -import { columnFactory, columnBoardFactory } from '../../testing'; +import { roomFactory } from '@src/modules/room/testing'; import { BoardExternalReferenceType, BoardRoles, UserWithBoardRoles } from '../../domain'; +import { columnBoardFactory, columnFactory } from '../../testing'; import { BoardContextService } from './board-context.service'; describe(`${BoardContextService.name}`, () => { diff --git a/apps/server/src/modules/board/service/internal/board-context.service.ts b/apps/server/src/modules/board/service/internal/board-context.service.ts index 99f5c346cad..66c78a1ac1f 100644 --- a/apps/server/src/modules/board/service/internal/board-context.service.ts +++ b/apps/server/src/modules/board/service/internal/board-context.service.ts @@ -1,7 +1,7 @@ import { Injectable } from '@nestjs/common'; import { Permission } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { RoomMemberService } from '@src/modules/room-member'; import { UserWithRoomRoles } from '@src/modules/room-member/do/room-member-authorizable.do'; import { AnyBoardNode, BoardExternalReferenceType, BoardRoles, UserWithBoardRoles } from '../../domain'; diff --git a/apps/server/src/modules/board/service/internal/column-board-copy.service.ts b/apps/server/src/modules/board/service/internal/column-board-copy.service.ts index 80136e2f832..a33c6a7b1e6 100644 --- a/apps/server/src/modules/board/service/internal/column-board-copy.service.ts +++ b/apps/server/src/modules/board/service/internal/column-board-copy.service.ts @@ -4,7 +4,7 @@ import { StorageLocation } from '@modules/files-storage/interface'; import { UserService } from '@modules/user'; import { Injectable, InternalServerErrorException, NotImplementedException } from '@nestjs/common'; import { EntityId } from '@shared/domain/types'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { BoardExternalReference, BoardExternalReferenceType, ColumnBoard, isColumnBoard } from '../../domain'; import { BoardNodeService } from '../board-node.service'; import { BoardNodeCopyContext } from './board-node-copy-context'; diff --git a/apps/server/src/modules/board/uc/board.uc.spec.ts b/apps/server/src/modules/board/uc/board.uc.spec.ts index 84e64021289..8b760cfa862 100644 --- a/apps/server/src/modules/board/uc/board.uc.spec.ts +++ b/apps/server/src/modules/board/uc/board.uc.spec.ts @@ -3,7 +3,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Action, AuthorizationService } from '@modules/authorization'; import { Test, TestingModule } from '@nestjs/testing'; import { Permission } from '@shared/domain/interface'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { setupEntities, userFactory } from '@shared/testing'; import { courseFactory } from '@shared/testing/factory'; import { LegacyLogger } from '@src/core/logger'; diff --git a/apps/server/src/modules/board/uc/board.uc.ts b/apps/server/src/modules/board/uc/board.uc.ts index 6a766370f74..8beb95d5260 100644 --- a/apps/server/src/modules/board/uc/board.uc.ts +++ b/apps/server/src/modules/board/uc/board.uc.ts @@ -3,7 +3,7 @@ import { CopyStatus } from '@modules/copy-helper'; import { forwardRef, Inject, Injectable } from '@nestjs/common'; import { Permission } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { CourseRepo } from '@shared/repo'; +import { CourseRepo } from '@shared/repo/course'; import { LegacyLogger } from '@src/core/logger'; import { RoomMemberService } from '@src/modules/room-member'; import { CreateBoardBodyParams } from '../controller/dto'; diff --git a/apps/server/src/modules/common-cartridge/common-cartridge.module.ts b/apps/server/src/modules/common-cartridge/common-cartridge.module.ts index 82f59b03f1d..c5beb84df62 100644 --- a/apps/server/src/modules/common-cartridge/common-cartridge.module.ts +++ b/apps/server/src/modules/common-cartridge/common-cartridge.module.ts @@ -5,7 +5,7 @@ import { Module } from '@nestjs/common'; import { ALL_ENTITIES } from '@shared/domain/entity'; import { DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { RabbitMQWrapperModule } from '@src/infra/rabbitmq'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { BoardClientModule } from './common-cartridge-client/board-client'; import { CoursesClientModule } from './common-cartridge-client/course-client'; import { CommonCartridgeExportService } from './service/common-cartridge-export.service'; diff --git a/apps/server/src/modules/deletion-console/deletion-console.app.module.ts b/apps/server/src/modules/deletion-console/deletion-console.app.module.ts index 17ec04df8c4..a86a163f6d7 100644 --- a/apps/server/src/modules/deletion-console/deletion-console.app.module.ts +++ b/apps/server/src/modules/deletion-console/deletion-console.app.module.ts @@ -8,7 +8,7 @@ import { UserModule } from '@modules/user'; import { ALL_ENTITIES } from '@shared/domain/entity'; import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config'; import { AccountModule } from '@modules/account'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { FileEntity } from '../files/entity'; import { DeletionClient } from './deletion-client'; import { DeletionQueueConsole } from './deletion-queue.console'; diff --git a/apps/server/src/modules/deletion-console/deletion-execution.console.spec.ts b/apps/server/src/modules/deletion-console/deletion-execution.console.spec.ts index e5374710405..833831c5b77 100644 --- a/apps/server/src/modules/deletion-console/deletion-execution.console.spec.ts +++ b/apps/server/src/modules/deletion-console/deletion-execution.console.spec.ts @@ -1,7 +1,7 @@ import { Test, TestingModule } from '@nestjs/testing'; import { DeepMocked } from '@golevelup/ts-jest'; import { MongoMemoryDatabaseModule } from '@infra/database'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { DeletionExecutionConsole } from './deletion-execution.console'; import { DeletionExecutionTriggerResultBuilder, TriggerDeletionExecutionOptionsBuilder } from './builder'; import { DeletionExecutionUc } from './uc'; diff --git a/apps/server/src/modules/deletion-console/deletion-queue.console.spec.ts b/apps/server/src/modules/deletion-console/deletion-queue.console.spec.ts index fe5789db379..c4436049b9b 100644 --- a/apps/server/src/modules/deletion-console/deletion-queue.console.spec.ts +++ b/apps/server/src/modules/deletion-console/deletion-queue.console.spec.ts @@ -2,7 +2,7 @@ import { ObjectId } from 'bson'; import fs from 'fs'; import { Test, TestingModule } from '@nestjs/testing'; import { MongoMemoryDatabaseModule } from '@infra/database'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { DeletionQueueConsole } from './deletion-queue.console'; import { PushDeleteRequestsOptionsBuilder } from './builder'; import { BatchDeletionUc } from './uc'; diff --git a/apps/server/src/modules/files-storage/files-storage-test.module.ts b/apps/server/src/modules/files-storage/files-storage-test.module.ts index 1c78abce3c0..1278b23b018 100644 --- a/apps/server/src/modules/files-storage/files-storage-test.module.ts +++ b/apps/server/src/modules/files-storage/files-storage-test.module.ts @@ -4,7 +4,7 @@ import { RabbitMQWrapperTestModule } from '@infra/rabbitmq'; import { ALL_ENTITIES } from '@shared/domain/entity'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { FileRecord } from './entity'; import { FilesStorageApiModule } from './files-storage-api.module'; diff --git a/apps/server/src/modules/files-storage/files-storage.module.ts b/apps/server/src/modules/files-storage/files-storage.module.ts index a4590a91ce4..f148bf2275e 100644 --- a/apps/server/src/modules/files-storage/files-storage.module.ts +++ b/apps/server/src/modules/files-storage/files-storage.module.ts @@ -8,7 +8,7 @@ import { Module } from '@nestjs/common'; import { ALL_ENTITIES } from '@shared/domain/entity'; import { DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { LoggerModule } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { FileRecord, FileRecordSecurityCheck } from './entity'; import { s3Config } from './files-storage.config'; import { FileRecordRepo } from './repo'; diff --git a/apps/server/src/modules/fwu-learning-contents/fwu-learning-contents.module.ts b/apps/server/src/modules/fwu-learning-contents/fwu-learning-contents.module.ts index cf37ee653a9..6a51543fbef 100644 --- a/apps/server/src/modules/fwu-learning-contents/fwu-learning-contents.module.ts +++ b/apps/server/src/modules/fwu-learning-contents/fwu-learning-contents.module.ts @@ -12,7 +12,7 @@ import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@sr import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; import { AccountEntity } from '@src/modules/account/domain/entity/account.entity'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { FwuLearningContentsController } from './controller/fwu-learning-contents.controller'; import { config, s3Config } from './fwu-learning-contents.config'; import { FwuLearningContentsUc } from './uc/fwu-learning-contents.uc'; diff --git a/apps/server/src/modules/h5p-editor/h5p-editor.module.ts b/apps/server/src/modules/h5p-editor/h5p-editor.module.ts index 92bb164504d..b08acc764cf 100644 --- a/apps/server/src/modules/h5p-editor/h5p-editor.module.ts +++ b/apps/server/src/modules/h5p-editor/h5p-editor.module.ts @@ -10,7 +10,7 @@ import { ALL_ENTITIES } from '@shared/domain/entity'; import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { CoreModule } from '@src/core'; import { Logger } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { H5PEditorController } from './controller/h5p-editor.controller'; import { H5PContent, InstalledLibrary } from './entity'; import { authorizationClientConfig, config, s3ConfigContent, s3ConfigLibraries } from './h5p-editor.config'; diff --git a/apps/server/src/modules/idp-console/api/idp-sync-console.spec.ts b/apps/server/src/modules/idp-console/api/idp-sync-console.spec.ts index 6a7bf1c6049..7f8bf1354e1 100644 --- a/apps/server/src/modules/idp-console/api/idp-sync-console.spec.ts +++ b/apps/server/src/modules/idp-console/api/idp-sync-console.spec.ts @@ -1,7 +1,7 @@ import { ObjectId } from 'bson'; import { Test, TestingModule } from '@nestjs/testing'; import { MongoMemoryDatabaseModule } from '@infra/database'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { IdpSyncConsole } from './idp-sync-console'; import { SystemType } from './interface'; import { UsersSyncOptionsBuilder } from '../testing'; diff --git a/apps/server/src/modules/idp-console/idp-console.app.module.ts b/apps/server/src/modules/idp-console/idp-console.app.module.ts index 00926079db0..a9dcfe1df47 100644 --- a/apps/server/src/modules/idp-console/idp-console.app.module.ts +++ b/apps/server/src/modules/idp-console/idp-console.app.module.ts @@ -11,7 +11,7 @@ import { ALL_ENTITIES } from '@shared/domain/entity'; import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { LoggerModule } from '@src/core/logger'; import { ConsoleModule } from 'nestjs-console'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { idpConsoleConfigConfig } from './idp-console.config'; import { IdpSyncConsole, SynchronizationUc } from './api'; diff --git a/apps/server/src/modules/management/management-server.module.ts b/apps/server/src/modules/management/management-server.module.ts index 366aef4af06..4622e748a46 100644 --- a/apps/server/src/modules/management/management-server.module.ts +++ b/apps/server/src/modules/management/management-server.module.ts @@ -4,7 +4,7 @@ import { MikroOrmModule } from '@mikro-orm/nestjs'; import { DynamicModule, Module } from '@nestjs/common'; import { ALL_ENTITIES } from '@shared/domain/entity'; import { DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { ManagementModule } from './management.module'; @Module({ diff --git a/apps/server/src/modules/server/admin-api.server.module.ts b/apps/server/src/modules/server/admin-api.server.module.ts index 10ef2ff0f1b..e8ab72ea612 100644 --- a/apps/server/src/modules/server/admin-api.server.module.ts +++ b/apps/server/src/modules/server/admin-api.server.module.ts @@ -15,7 +15,7 @@ import { LoggerModule } from '@src/core/logger'; import { MongoDatabaseModuleOptions, MongoMemoryDatabaseModule } from '@src/infra/database'; import { EtherpadClientModule } from '@src/infra/etherpad-client'; import { RabbitMQWrapperModule, RabbitMQWrapperTestModule } from '@src/infra/rabbitmq'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { AdminApiRegistrationPinModule } from '../registration-pin/admin-api-registration-pin.module'; import { adminApiServerConfig } from './admin-api-server.config'; diff --git a/apps/server/src/modules/server/server.module.ts b/apps/server/src/modules/server/server.module.ts index e95d93f2103..c33c920148a 100644 --- a/apps/server/src/modules/server/server.module.ts +++ b/apps/server/src/modules/server/server.module.ts @@ -47,7 +47,7 @@ import { ALL_ENTITIES } from '@shared/domain/entity'; import { createConfigModuleOptions, DB_PASSWORD, DB_URL, DB_USERNAME } from '@src/config'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { ServerConfigController, ServerController, ServerUc } from './api'; import { SERVER_CONFIG_TOKEN, serverConfig } from './server.config'; diff --git a/apps/server/src/modules/tldraw/tldraw-api.module.ts b/apps/server/src/modules/tldraw/tldraw-api.module.ts index 1e40e769924..531fea643bb 100644 --- a/apps/server/src/modules/tldraw/tldraw-api.module.ts +++ b/apps/server/src/modules/tldraw/tldraw-api.module.ts @@ -5,7 +5,7 @@ import { ConfigModule } from '@nestjs/config'; import { createConfigModuleOptions, DB_PASSWORD, DB_USERNAME } from '@src/config'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { config, TLDRAW_DB_URL } from './config'; import { TldrawController } from './controller'; import { TldrawDrawing } from './entities'; diff --git a/apps/server/src/modules/tldraw/tldraw-console.module.ts b/apps/server/src/modules/tldraw/tldraw-console.module.ts index 2fc741de464..596267bee22 100644 --- a/apps/server/src/modules/tldraw/tldraw-console.module.ts +++ b/apps/server/src/modules/tldraw/tldraw-console.module.ts @@ -9,7 +9,7 @@ import { createConfigModuleOptions, DB_PASSWORD, DB_USERNAME } from '@src/config import { CoreModule } from '@src/core'; import { Logger, LoggerModule } from '@src/core/logger'; import { ConsoleModule } from 'nestjs-console'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { FilesStorageClientModule } from '../files-storage-client'; import { config, TLDRAW_DB_URL, TldrawConfig, tldrawS3Config } from './config'; import { TldrawDrawing } from './entities'; diff --git a/apps/server/src/modules/tldraw/tldraw-ws.module.ts b/apps/server/src/modules/tldraw/tldraw-ws.module.ts index 307048ab233..ba2615ca465 100644 --- a/apps/server/src/modules/tldraw/tldraw-ws.module.ts +++ b/apps/server/src/modules/tldraw/tldraw-ws.module.ts @@ -6,7 +6,7 @@ import { initialisePerformanceObserver } from '@shared/common/measure-utils'; import { createConfigModuleOptions, DB_PASSWORD, DB_USERNAME } from '@src/config'; import { CoreModule } from '@src/core'; import { Logger, LoggerModule } from '@src/core/logger'; -import { defaultMikroOrmOptions } from '@shared/common'; +import { defaultMikroOrmOptions } from '@shared/common/defaultMikroOrmOptions'; import { config, TLDRAW_DB_URL, TldrawConfig } from './config'; import { TldrawWs } from './controller'; import { TldrawDrawing } from './entities'; diff --git a/apps/server/src/modules/tool/context-external-tool/context-external-tool.module.ts b/apps/server/src/modules/tool/context-external-tool/context-external-tool.module.ts index e447ea3e2b9..79e6cc63adc 100644 --- a/apps/server/src/modules/tool/context-external-tool/context-external-tool.module.ts +++ b/apps/server/src/modules/tool/context-external-tool/context-external-tool.module.ts @@ -1,6 +1,6 @@ import { AuthorizationModule } from '@modules/authorization'; import { UserLicenseModule } from '@modules/user-license'; -import { forwardRef, Module } from '@nestjs/common'; +import { Module } from '@nestjs/common'; import { LoggerModule } from '@src/core/logger'; import { CommonToolModule } from '../common'; import { ExternalToolModule } from '../external-tool'; @@ -12,8 +12,8 @@ import { ToolConfigurationStatusService } from './service/tool-configuration-sta @Module({ imports: [ - forwardRef(() => CommonToolModule), - forwardRef(() => ExternalToolModule), + CommonToolModule, + ExternalToolModule, SchoolExternalToolModule, LoggerModule, UserLicenseModule, diff --git a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool.service.ts b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool.service.ts index c1746cdf777..61d39f19ebb 100644 --- a/apps/server/src/modules/tool/context-external-tool/service/context-external-tool.service.ts +++ b/apps/server/src/modules/tool/context-external-tool/service/context-external-tool.service.ts @@ -1,7 +1,7 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { Injectable } from '@nestjs/common'; import { EntityId } from '@shared/domain/types'; -import { ContextExternalToolRepo } from '@shared/repo'; +import { ContextExternalToolRepo } from '@shared/repo/contextexternaltool'; import { CustomParameter, CustomParameterEntry } from '../../common/domain'; import { CommonToolDeleteService, CommonToolService } from '../../common/service'; import { ExternalTool } from '../../external-tool/domain'; diff --git a/apps/server/src/modules/tool/external-tool/service/external-tool.service.ts b/apps/server/src/modules/tool/external-tool/service/external-tool.service.ts index 1d320179cd6..50b07c0d41e 100644 --- a/apps/server/src/modules/tool/external-tool/service/external-tool.service.ts +++ b/apps/server/src/modules/tool/external-tool/service/external-tool.service.ts @@ -4,7 +4,7 @@ import { Injectable, UnprocessableEntityException } from '@nestjs/common'; import { Page } from '@shared/domain/domainobject'; import { IFindOptions } from '@shared/domain/interface'; import { EntityId } from '@shared/domain/types'; -import { ExternalToolRepo } from '@shared/repo'; +import { ExternalToolRepo } from '@shared/repo/externaltool'; import { LegacyLogger } from '@src/core/logger'; import { TokenEndpointAuthMethod } from '../../common/enum'; import { ExternalToolSearchQuery } from '../../common/interface';