From 3cac1d785920519d23530440d25ddd5f1ade476f Mon Sep 17 00:00:00 2001 From: Cedric Evers <12080057+CeEv@users.noreply.github.com> Date: Wed, 8 Nov 2023 10:57:23 +0100 Subject: [PATCH] resolve merge conflicts and cleanup path imports --- apps/server/src/infra/calendar/calendar.module.ts | 4 ++-- .../infra/calendar/mapper/calendar.mapper.spec.ts | 2 +- .../src/infra/calendar/mapper/calendar.mapper.ts | 2 +- .../infra/calendar/service/calendar.service.spec.ts | 4 ++-- .../src/infra/calendar/service/calendar.service.ts | 4 ++-- .../collaborative-storage-adapter.module.ts | 6 +++--- .../collaborative-storage.adapter.spec.ts | 8 ++++---- .../collaborative-storage.adapter.ts | 4 ++-- .../server/src/infra/collaborative-storage/index.ts | 3 ++- .../src/infra/collaborative-storage/mapper/index.ts | 1 + .../strategy/nextcloud/nextcloud.client.spec.ts | 2 +- .../strategy/nextcloud/nextcloud.strategy.spec.ts | 6 +++--- apps/server/src/infra/mail/mail.module.spec.ts | 2 +- .../oauth-provider/hydra/hydra.adapter.spec.ts | 4 ++-- .../oauth-provider/oauth-provider-service.module.ts | 4 ++-- apps/server/src/modules/authentication/index.ts | 1 + .../collaborative-storage.module.ts | 13 ++++++------- .../collaborative-storage/controller/index.ts | 1 + .../src/modules/collaborative-storage/index.ts | 4 ++-- .../modules/collaborative-storage/mapper/index.ts | 2 ++ .../src/modules/collaborative-storage/uc/index.ts | 1 + .../modules/deletion/repo/deletion-log.repo.spec.ts | 2 +- .../deletion/repo/deletion-request.repo.spec.ts | 2 +- .../files-storage/files-storage-test.module.ts | 7 +++---- .../modules/files-storage/files-storage.module.ts | 7 +++---- .../src/modules/files-storage/service/index.ts | 2 ++ .../controller/api-test/h5p-editor-ajax.api.spec.ts | 2 +- .../api-test/h5p-editor-delete.api.spec.ts | 2 +- .../api-test/h5p-editor-files.api.spec.ts | 2 +- .../api-test/h5p-editor-get-editor.api.spec.ts | 2 +- .../api-test/h5p-editor-get-player.api.spec.ts | 2 +- .../api-test/h5p-editor-save-create.api.spec.ts | 2 +- .../h5p-editor/controller/dto/h5p-file.dto.ts | 2 +- .../modules/h5p-editor/h5p-editor-test.module.ts | 4 ++-- .../src/modules/h5p-editor/h5p-editor.config.ts | 2 +- .../src/modules/h5p-editor/h5p-editor.module.ts | 6 +++--- .../repo/h5p-content.repo.integration.spec.ts | 2 +- .../modules/h5p-editor/repo/library.repo.spec.ts | 2 +- .../repo/temporary-file.repo.integration.spec.ts | 2 +- .../service/contentStorage.service.spec.ts | 2 +- .../h5p-editor/service/contentStorage.service.ts | 2 +- .../service/libraryStorage.service.spec.ts | 2 +- .../h5p-editor/service/libraryStorage.service.ts | 2 +- .../service/temporary-file-storage.service.spec.ts | 2 +- .../service/temporary-file-storage.service.ts | 2 +- .../src/modules/lesson/service/etherpad.service.ts | 2 +- .../modules/lesson/service/nexboard.service.spec.ts | 2 +- 47 files changed, 76 insertions(+), 70 deletions(-) create mode 100644 apps/server/src/infra/collaborative-storage/mapper/index.ts create mode 100644 apps/server/src/modules/collaborative-storage/controller/index.ts create mode 100644 apps/server/src/modules/collaborative-storage/mapper/index.ts create mode 100644 apps/server/src/modules/collaborative-storage/uc/index.ts create mode 100644 apps/server/src/modules/files-storage/service/index.ts diff --git a/apps/server/src/infra/calendar/calendar.module.ts b/apps/server/src/infra/calendar/calendar.module.ts index cedd08d0660..b4eddacef92 100644 --- a/apps/server/src/infra/calendar/calendar.module.ts +++ b/apps/server/src/infra/calendar/calendar.module.ts @@ -1,7 +1,7 @@ import { Module } from '@nestjs/common'; import { HttpModule } from '@nestjs/axios'; -import { CalendarService } from '@infra/calendar/service/calendar.service'; -import { CalendarMapper } from '@infra/calendar/mapper/calendar.mapper'; +import { CalendarService } from './service/calendar.service'; +import { CalendarMapper } from './mapper/calendar.mapper'; @Module({ imports: [HttpModule], diff --git a/apps/server/src/infra/calendar/mapper/calendar.mapper.spec.ts b/apps/server/src/infra/calendar/mapper/calendar.mapper.spec.ts index 421635d3c0c..9679ce0a4fa 100644 --- a/apps/server/src/infra/calendar/mapper/calendar.mapper.spec.ts +++ b/apps/server/src/infra/calendar/mapper/calendar.mapper.spec.ts @@ -1,6 +1,6 @@ import { ICalendarEvent } from '@infra/calendar/interface/calendar-event.interface'; import { Test, TestingModule } from '@nestjs/testing'; -import { CalendarMapper } from '@infra/calendar/mapper/calendar.mapper'; +import { CalendarMapper } from './calendar.mapper'; describe('CalendarMapper', () => { let module: TestingModule; diff --git a/apps/server/src/infra/calendar/mapper/calendar.mapper.ts b/apps/server/src/infra/calendar/mapper/calendar.mapper.ts index 14a2f794b94..a75ff01eae6 100644 --- a/apps/server/src/infra/calendar/mapper/calendar.mapper.ts +++ b/apps/server/src/infra/calendar/mapper/calendar.mapper.ts @@ -1,6 +1,6 @@ import { ICalendarEvent } from '@infra/calendar/interface/calendar-event.interface'; import { Injectable } from '@nestjs/common'; -import { CalendarEventDto } from '@infra/calendar/dto/calendar-event.dto'; +import { CalendarEventDto } from '../dto/calendar-event.dto'; @Injectable() export class CalendarMapper { diff --git a/apps/server/src/infra/calendar/service/calendar.service.spec.ts b/apps/server/src/infra/calendar/service/calendar.service.spec.ts index 9cd27fcc63f..ed6bb4620bc 100644 --- a/apps/server/src/infra/calendar/service/calendar.service.spec.ts +++ b/apps/server/src/infra/calendar/service/calendar.service.spec.ts @@ -4,11 +4,11 @@ import { HttpService } from '@nestjs/axios'; import { InternalServerErrorException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { CalendarEventDto, CalendarService } from '@infra/calendar'; -import { ICalendarEvent } from '@infra/calendar/interface/calendar-event.interface'; -import { CalendarMapper } from '@infra/calendar/mapper/calendar.mapper'; import { axiosResponseFactory } from '@shared/testing'; import { AxiosResponse } from 'axios'; import { of, throwError } from 'rxjs'; +import { CalendarMapper } from '../mapper/calendar.mapper'; +import { ICalendarEvent } from '../interface/calendar-event.interface'; describe('CalendarServiceSpec', () => { let module: TestingModule; diff --git a/apps/server/src/infra/calendar/service/calendar.service.ts b/apps/server/src/infra/calendar/service/calendar.service.ts index 5112c1b0640..3bf2a6576be 100644 --- a/apps/server/src/infra/calendar/service/calendar.service.ts +++ b/apps/server/src/infra/calendar/service/calendar.service.ts @@ -2,12 +2,12 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib'; import { HttpService } from '@nestjs/axios'; import { Injectable, InternalServerErrorException } from '@nestjs/common'; import { EntityId } from '@shared/domain'; -import { CalendarEventDto } from '@infra/calendar/dto/calendar-event.dto'; -import { CalendarMapper } from '@infra/calendar/mapper/calendar.mapper'; import { ErrorUtils } from '@src/core/error/utils'; import { AxiosRequestConfig, AxiosResponse } from 'axios'; import { Observable, firstValueFrom } from 'rxjs'; import { URL, URLSearchParams } from 'url'; +import { CalendarMapper } from '../mapper/calendar.mapper'; +import { CalendarEventDto } from '../dto/calendar-event.dto'; import { ICalendarEvent } from '../interface/calendar-event.interface'; @Injectable() diff --git a/apps/server/src/infra/collaborative-storage/collaborative-storage-adapter.module.ts b/apps/server/src/infra/collaborative-storage/collaborative-storage-adapter.module.ts index e2312757141..f60ff664654 100644 --- a/apps/server/src/infra/collaborative-storage/collaborative-storage-adapter.module.ts +++ b/apps/server/src/infra/collaborative-storage/collaborative-storage-adapter.module.ts @@ -1,14 +1,14 @@ import { Configuration } from '@hpi-schul-cloud/commons/lib'; import { HttpModule } from '@nestjs/axios'; import { Module, Provider } from '@nestjs/common'; -import { CollaborativeStorageAdapterMapper } from '@infra/collaborative-storage/mapper/collaborative-storage-adapter.mapper'; -import { NextcloudClient } from '@infra/collaborative-storage/strategy/nextcloud/nextcloud.client'; -import { NextcloudStrategy } from '@infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy'; import { LtiToolRepo } from '@shared/repo/ltitool/'; import { LoggerModule } from '@src/core/logger'; import { ToolModule } from '@modules/tool'; import { PseudonymModule } from '@modules/pseudonym'; import { UserModule } from '@modules/user'; +import { NextcloudStrategy } from './strategy/nextcloud/nextcloud.strategy'; +import { NextcloudClient } from './strategy/nextcloud/nextcloud.client'; +import { CollaborativeStorageAdapterMapper } from './mapper'; import { CollaborativeStorageAdapter } from './collaborative-storage.adapter'; const storageStrategy: Provider = { diff --git a/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.spec.ts b/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.spec.ts index 82e9b7b95bc..3b9ba2175e6 100644 --- a/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.spec.ts +++ b/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.spec.ts @@ -2,11 +2,11 @@ import { createMock } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { RoleName } from '@shared/domain'; -import { CollaborativeStorageAdapter } from '@infra/collaborative-storage/collaborative-storage.adapter'; -import { CollaborativeStorageAdapterMapper } from '@infra/collaborative-storage/mapper/collaborative-storage-adapter.mapper'; -import { ICollaborativeStorageStrategy } from '@infra/collaborative-storage/strategy/base.interface.strategy'; import { LegacyLogger } from '@src/core/logger'; -import { TeamDto } from '@modules/collaborative-storage/services/dto/team.dto'; +import { TeamDto } from '@modules/collaborative-storage/services/dto/team.dto'; // invalid import please fix +import { CollaborativeStorageAdapter } from './collaborative-storage.adapter'; +import { CollaborativeStorageAdapterMapper } from './mapper/collaborative-storage-adapter.mapper'; +import { ICollaborativeStorageStrategy } from './strategy/base.interface.strategy'; class TestStrategy implements ICollaborativeStorageStrategy { baseURL: string; diff --git a/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.ts b/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.ts index 7245801bf27..b50657f393e 100644 --- a/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.ts +++ b/apps/server/src/infra/collaborative-storage/collaborative-storage.adapter.ts @@ -1,10 +1,10 @@ import { TeamPermissionsDto } from '@modules/collaborative-storage/services/dto/team-permissions.dto'; import { TeamDto } from '@modules/collaborative-storage/services/dto/team.dto'; -import { ICollaborativeStorageStrategy } from '@infra/collaborative-storage/strategy/base.interface.strategy'; import { Inject, Injectable } from '@nestjs/common'; -import { CollaborativeStorageAdapterMapper } from '@infra/collaborative-storage/mapper/collaborative-storage-adapter.mapper'; import { LegacyLogger } from '@src/core/logger'; import { RoleDto } from '@modules/role/service/dto/role.dto'; +import { CollaborativeStorageAdapterMapper } from './mapper/collaborative-storage-adapter.mapper'; +import { ICollaborativeStorageStrategy } from './strategy/base.interface.strategy'; /** * Provides an Adapter to an external collaborative storage. diff --git a/apps/server/src/infra/collaborative-storage/index.ts b/apps/server/src/infra/collaborative-storage/index.ts index ea5aa25514c..49dea4522b3 100644 --- a/apps/server/src/infra/collaborative-storage/index.ts +++ b/apps/server/src/infra/collaborative-storage/index.ts @@ -1 +1,2 @@ -export * from './collaborative-storage.adapter'; +export { CollaborativeStorageAdapter } from './collaborative-storage.adapter'; +export { CollaborativeStorageAdapterModule } from './collaborative-storage-adapter.module'; diff --git a/apps/server/src/infra/collaborative-storage/mapper/index.ts b/apps/server/src/infra/collaborative-storage/mapper/index.ts new file mode 100644 index 00000000000..08f05350be2 --- /dev/null +++ b/apps/server/src/infra/collaborative-storage/mapper/index.ts @@ -0,0 +1 @@ +export * from './collaborative-storage-adapter.mapper'; diff --git a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts index 9abba6166af..225ddac258d 100644 --- a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts +++ b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.client.spec.ts @@ -3,11 +3,11 @@ import { ObjectId } from '@mikro-orm/mongodb'; import { HttpService } from '@nestjs/axios'; import { NotFoundException, NotImplementedException, UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { NextcloudClient } from '@infra/collaborative-storage/strategy/nextcloud/nextcloud.client'; import { axiosResponseFactory } from '@shared/testing'; import { LegacyLogger } from '@src/core/logger'; import { AxiosResponse } from 'axios'; import { Observable, of } from 'rxjs'; +import { NextcloudClient } from './nextcloud.client'; import { GroupUsers, GroupfoldersCreated, diff --git a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts index 21cce489ac8..706e360b700 100644 --- a/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts +++ b/apps/server/src/infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy.spec.ts @@ -3,9 +3,6 @@ import { UnprocessableEntityException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { LtiPrivacyPermission, LtiRoleType, Pseudonym, RoleName, User, UserDO } from '@shared/domain'; import { LtiToolDO } from '@shared/domain/domainobject/ltitool.do'; -import { TeamRolePermissionsDto } from '@infra/collaborative-storage/dto/team-role-permissions.dto'; -import { NextcloudClient } from '@infra/collaborative-storage/strategy/nextcloud/nextcloud.client'; -import { NextcloudStrategy } from '@infra/collaborative-storage/strategy/nextcloud/nextcloud.strategy'; import { LtiToolRepo } from '@shared/repo'; import { ltiToolDOFactory, pseudonymFactory, setupEntities, userDoFactory, userFactory } from '@shared/testing'; import { LegacyLogger } from '@src/core/logger'; @@ -13,6 +10,9 @@ import { TeamDto, TeamUserDto } from '@modules/collaborative-storage/services/dt import { PseudonymService } from '@modules/pseudonym'; import { ExternalToolService } from '@modules/tool/external-tool/service'; import { UserService } from '@modules/user'; +import { NextcloudStrategy } from './nextcloud.strategy'; +import { NextcloudClient } from './nextcloud.client'; +import { TeamRolePermissionsDto } from '../../dto/team-role-permissions.dto'; class NextcloudStrategySpec extends NextcloudStrategy { static specGenerateGroupId(dto: TeamRolePermissionsDto): string { diff --git a/apps/server/src/infra/mail/mail.module.spec.ts b/apps/server/src/infra/mail/mail.module.spec.ts index 9cbb72c8e4c..3514b0e1043 100644 --- a/apps/server/src/infra/mail/mail.module.spec.ts +++ b/apps/server/src/infra/mail/mail.module.spec.ts @@ -1,6 +1,6 @@ import { Configuration } from '@hpi-schul-cloud/commons'; import { Test, TestingModule } from '@nestjs/testing'; -import { RabbitMQWrapperTestModule } from '@infra/rabbitmq/rabbitmq.module'; +import { RabbitMQWrapperTestModule } from '@infra/rabbitmq'; import { MailModule } from './mail.module'; import { MailService } from './mail.service'; diff --git a/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts b/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts index b7cc28cc563..7e30c5668c7 100644 --- a/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts +++ b/apps/server/src/infra/oauth-provider/hydra/hydra.adapter.spec.ts @@ -12,11 +12,11 @@ import { ProviderRedirectResponse, RejectRequestBody, } from '@infra/oauth-provider/dto'; -import { ProviderConsentSessionResponse } from '@infra/oauth-provider/dto/response/consent-session.response'; -import { HydraAdapter } from '@infra/oauth-provider/hydra/hydra.adapter'; import { axiosResponseFactory } from '@shared/testing'; import { AxiosRequestConfig, Method, RawAxiosRequestHeaders } from 'axios'; import { of } from 'rxjs'; +import { HydraAdapter } from './hydra.adapter'; +import { ProviderConsentSessionResponse } from '../dto/response/consent-session.response'; import resetAllMocks = jest.resetAllMocks; class HydraAdapterSpec extends HydraAdapter { diff --git a/apps/server/src/infra/oauth-provider/oauth-provider-service.module.ts b/apps/server/src/infra/oauth-provider/oauth-provider-service.module.ts index 597c1147a7f..521f9216050 100644 --- a/apps/server/src/infra/oauth-provider/oauth-provider-service.module.ts +++ b/apps/server/src/infra/oauth-provider/oauth-provider-service.module.ts @@ -1,7 +1,7 @@ import { Module } from '@nestjs/common'; -import { OauthProviderService } from '@infra/oauth-provider/oauth-provider.service'; -import { HydraAdapter } from '@infra/oauth-provider/hydra/hydra.adapter'; import { HttpModule } from '@nestjs/axios'; +import { OauthProviderService } from './oauth-provider.service'; +import { HydraAdapter } from './hydra/hydra.adapter'; @Module({ imports: [HttpModule], diff --git a/apps/server/src/modules/authentication/index.ts b/apps/server/src/modules/authentication/index.ts index 904c64ff97b..59e749c7abc 100644 --- a/apps/server/src/modules/authentication/index.ts +++ b/apps/server/src/modules/authentication/index.ts @@ -1,2 +1,3 @@ export { ICurrentUser } from './interface'; export { JWT, CurrentUser, Authenticate } from './decorator'; +export { AuthenticationModule } from './authentication.module'; diff --git a/apps/server/src/modules/collaborative-storage/collaborative-storage.module.ts b/apps/server/src/modules/collaborative-storage/collaborative-storage.module.ts index c76f190c8e4..a654ff86bdc 100644 --- a/apps/server/src/modules/collaborative-storage/collaborative-storage.module.ts +++ b/apps/server/src/modules/collaborative-storage/collaborative-storage.module.ts @@ -1,14 +1,13 @@ import { Module } from '@nestjs/common'; -import { CollaborativeStorageAdapterModule } from '@infra/collaborative-storage/collaborative-storage-adapter.module'; +import { CollaborativeStorageAdapterModule } from '@infra/collaborative-storage'; import { TeamsRepo } from '@shared/repo'; import { LoggerModule } from '@src/core/logger'; import { AuthorizationModule } from '@modules/authorization'; -import { TeamPermissionsMapper } from '@modules/collaborative-storage/mapper/team-permissions.mapper'; -import { TeamMapper } from '@modules/collaborative-storage/mapper/team.mapper'; -import { CollaborativeStorageService } from '@modules/collaborative-storage/services/collaborative-storage.service'; -import { RoleModule } from '@modules/role/role.module'; -import { CollaborativeStorageController } from './controller/collaborative-storage.controller'; -import { CollaborativeStorageUc } from './uc/collaborative-storage.uc'; +import { RoleModule } from '@modules/role'; +import { CollaborativeStorageService } from './services'; +import { TeamPermissionsMapper, TeamMapper } from './mapper'; +import { CollaborativeStorageController } from './controller'; +import { CollaborativeStorageUc } from './uc'; @Module({ imports: [CollaborativeStorageAdapterModule, AuthorizationModule, LoggerModule, RoleModule], diff --git a/apps/server/src/modules/collaborative-storage/controller/index.ts b/apps/server/src/modules/collaborative-storage/controller/index.ts new file mode 100644 index 00000000000..6e3d2c24555 --- /dev/null +++ b/apps/server/src/modules/collaborative-storage/controller/index.ts @@ -0,0 +1 @@ +export * from './collaborative-storage.controller'; diff --git a/apps/server/src/modules/collaborative-storage/index.ts b/apps/server/src/modules/collaborative-storage/index.ts index 55ed293fd82..6a36bd891cf 100644 --- a/apps/server/src/modules/collaborative-storage/index.ts +++ b/apps/server/src/modules/collaborative-storage/index.ts @@ -1,2 +1,2 @@ -export * from './collaborative-storage.module'; -export * from './services'; +export { CollaborativeStorageModule } from './collaborative-storage.module'; +export { CollaborativeStorageService, TeamDto, TeamPermissionsDto, TeamUserDto } from './services'; diff --git a/apps/server/src/modules/collaborative-storage/mapper/index.ts b/apps/server/src/modules/collaborative-storage/mapper/index.ts new file mode 100644 index 00000000000..df052363bc4 --- /dev/null +++ b/apps/server/src/modules/collaborative-storage/mapper/index.ts @@ -0,0 +1,2 @@ +export * from './team-permissions.mapper'; +export * from './team.mapper'; diff --git a/apps/server/src/modules/collaborative-storage/uc/index.ts b/apps/server/src/modules/collaborative-storage/uc/index.ts new file mode 100644 index 00000000000..b08c347bf88 --- /dev/null +++ b/apps/server/src/modules/collaborative-storage/uc/index.ts @@ -0,0 +1 @@ +export * from './collaborative-storage.uc'; diff --git a/apps/server/src/modules/deletion/repo/deletion-log.repo.spec.ts b/apps/server/src/modules/deletion/repo/deletion-log.repo.spec.ts index 5bc151c3541..bba32408e84 100644 --- a/apps/server/src/modules/deletion/repo/deletion-log.repo.spec.ts +++ b/apps/server/src/modules/deletion/repo/deletion-log.repo.spec.ts @@ -1,7 +1,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test } from '@nestjs/testing'; import { TestingModule } from '@nestjs/testing/testing-module'; -import { MongoMemoryDatabaseModule } from '@shared/infra/database'; +import { MongoMemoryDatabaseModule } from '@infra/database'; import { cleanupCollections } from '@shared/testing'; import { DeletionLogMapper } from './mapper'; import { DeletionLogEntity } from '../entity'; diff --git a/apps/server/src/modules/deletion/repo/deletion-request.repo.spec.ts b/apps/server/src/modules/deletion/repo/deletion-request.repo.spec.ts index 579dc0ec403..c3018180218 100644 --- a/apps/server/src/modules/deletion/repo/deletion-request.repo.spec.ts +++ b/apps/server/src/modules/deletion/repo/deletion-request.repo.spec.ts @@ -1,7 +1,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { Test } from '@nestjs/testing'; import { TestingModule } from '@nestjs/testing/testing-module'; -import { MongoMemoryDatabaseModule } from '@shared/infra/database'; +import { MongoMemoryDatabaseModule } from '@infra/database'; import { cleanupCollections } from '@shared/testing'; import { DeletionRequestMapper } from './mapper'; import { DeletionRequestRepo } from './deletion-request.repo'; 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 c4dd4455ec2..f219c8bccac 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 @@ -1,11 +1,10 @@ import { DynamicModule, Module } from '@nestjs/common'; import { ALL_ENTITIES } from '@shared/domain'; -import { MongoMemoryDatabaseModule } from '@infra/database'; -import { MongoDatabaseModuleOptions } from '@infra/database/mongo-memory-database/types'; -import { RabbitMQWrapperTestModule } from '@infra/rabbitmq/rabbitmq.module'; +import { MongoMemoryDatabaseModule, MongoDatabaseModuleOptions } from '@infra/database'; +import { RabbitMQWrapperTestModule } from '@infra/rabbitmq'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; -import { AuthenticationModule } from '@modules/authentication/authentication.module'; +import { AuthenticationModule } from '@modules/authentication'; import { AuthorizationModule } from '@modules/authorization'; 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 8468ef08244..a7432172a21 100644 --- a/apps/server/src/modules/files-storage/files-storage.module.ts +++ b/apps/server/src/modules/files-storage/files-storage.module.ts @@ -4,17 +4,16 @@ import { MikroOrmModule, MikroOrmModuleSyncOptions } from '@mikro-orm/nestjs'; import { Module, NotFoundException } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { ALL_ENTITIES } from '@shared/domain'; -import { AntivirusModule } from '@infra/antivirus/antivirus.module'; +import { AntivirusModule } from '@infra/antivirus'; import { PreviewGeneratorProducerModule } from '@infra/preview-generator'; -import { RabbitMQWrapperModule } from '@infra/rabbitmq/rabbitmq.module'; +import { RabbitMQWrapperModule } from '@infra/rabbitmq'; import { S3ClientModule } from '@infra/s3-client'; import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config'; import { LoggerModule } from '@src/core/logger'; import { FileRecord, FileRecordSecurityCheck } from './entity'; import { config, s3Config } from './files-storage.config'; import { FileRecordRepo } from './repo'; -import { FilesStorageService } from './service/files-storage.service'; -import { PreviewService } from './service/preview.service'; +import { FilesStorageService, PreviewService } from './service'; const imports = [ LoggerModule, diff --git a/apps/server/src/modules/files-storage/service/index.ts b/apps/server/src/modules/files-storage/service/index.ts new file mode 100644 index 00000000000..f5f1eb61392 --- /dev/null +++ b/apps/server/src/modules/files-storage/service/index.ts @@ -0,0 +1,2 @@ +export * from './files-storage.service'; +export * from './preview.service'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts index 543db38ebbf..0c7251e6134 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-ajax.api.spec.ts @@ -3,7 +3,7 @@ import { H5PAjaxEndpoint } from '@lumieducation/h5p-server'; import { EntityManager } from '@mikro-orm/core'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; import { H5PEditorTestModule } from '../../h5p-editor-test.module'; import { H5P_CONTENT_S3_CONNECTION, H5P_LIBRARIES_S3_CONNECTION } from '../../h5p-editor.config'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-delete.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-delete.api.spec.ts index 9f3b0017d08..e2af08f3fd5 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-delete.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-delete.api.spec.ts @@ -3,7 +3,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { Permission } from '@shared/domain'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { cleanupCollections, mapUserToCurrentUser, roleFactory, schoolFactory, userFactory } from '@shared/testing'; import { ICurrentUser } from '@src/modules/authentication'; import { JwtAuthGuard } from '@src/modules/authentication/guard/jwt-auth.guard'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-files.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-files.api.spec.ts index 702aac1a717..05132888f71 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-files.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-files.api.spec.ts @@ -4,7 +4,7 @@ import { ContentMetadata } from '@lumieducation/h5p-server/build/src/ContentMeta import { EntityManager } from '@mikro-orm/mongodb'; import { HttpStatus, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { courseFactory, h5pContentFactory, diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-editor.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-editor.api.spec.ts index 737266f300d..3f738fd67c0 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-editor.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-editor.api.spec.ts @@ -3,7 +3,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { Permission } from '@shared/domain'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { cleanupCollections, mapUserToCurrentUser, roleFactory, schoolFactory, userFactory } from '@shared/testing'; import { ICurrentUser } from '@src/modules/authentication'; import { JwtAuthGuard } from '@src/modules/authentication/guard/jwt-auth.guard'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-player.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-player.api.spec.ts index 708dfef968a..6e98bb6905a 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-player.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-get-player.api.spec.ts @@ -4,7 +4,7 @@ import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { ExecutionContext, INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; import { Permission } from '@shared/domain'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { cleanupCollections, mapUserToCurrentUser, roleFactory, schoolFactory, userFactory } from '@shared/testing'; import { ICurrentUser } from '@src/modules/authentication'; import { JwtAuthGuard } from '@src/modules/authentication/guard/jwt-auth.guard'; diff --git a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts index 9981a13e81f..0e1d5a13686 100644 --- a/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts +++ b/apps/server/src/modules/h5p-editor/controller/api-test/h5p-editor-save-create.api.spec.ts @@ -3,7 +3,7 @@ import { IContentMetadata } from '@lumieducation/h5p-server'; import { EntityManager, ObjectId } from '@mikro-orm/mongodb'; import { INestApplication } from '@nestjs/common'; import { Test } from '@nestjs/testing'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { TestApiClient, UserAndAccountTestFactory } from '@shared/testing'; import { H5PContentParentType } from '../../entity'; import { H5PEditorTestModule } from '../../h5p-editor-test.module'; diff --git a/apps/server/src/modules/h5p-editor/controller/dto/h5p-file.dto.ts b/apps/server/src/modules/h5p-editor/controller/dto/h5p-file.dto.ts index 1ac4fc092e3..277c233dfa4 100644 --- a/apps/server/src/modules/h5p-editor/controller/dto/h5p-file.dto.ts +++ b/apps/server/src/modules/h5p-editor/controller/dto/h5p-file.dto.ts @@ -1,5 +1,5 @@ import { Readable } from 'stream'; -import { File } from '@shared/infra/s3-client'; +import { File } from '@infra/s3-client'; export class H5pFileDto implements File { constructor(file: H5pFileDto) { diff --git a/apps/server/src/modules/h5p-editor/h5p-editor-test.module.ts b/apps/server/src/modules/h5p-editor/h5p-editor-test.module.ts index b364fc25124..49d53c57726 100644 --- a/apps/server/src/modules/h5p-editor/h5p-editor-test.module.ts +++ b/apps/server/src/modules/h5p-editor/h5p-editor-test.module.ts @@ -5,10 +5,10 @@ import { RabbitMQWrapperTestModule } from '@infra/rabbitmq'; import { S3ClientModule } from '@infra/s3-client'; import { CoreModule } from '@src/core'; import { LoggerModule } from '@src/core/logger'; -import { AuthenticationModule } from '@modules/authentication/authentication.module'; +import { AuthenticationModule } from '@modules/authentication'; import { AuthorizationReferenceModule } from '@modules/authorization/authorization-reference.module'; import { UserModule } from '@modules/user'; -import { AuthenticationApiModule } from '../authentication/authentication-api.module'; +import { AuthenticationApiModule } from '@modules/authentication/authentication-api.module'; import { H5PEditorModule } from './h5p-editor.module'; import { H5PContentRepo, LibraryRepo, TemporaryFileRepo } from './repo'; import { ContentStorage, LibraryStorage, TemporaryFileStorage } from './service'; diff --git a/apps/server/src/modules/h5p-editor/h5p-editor.config.ts b/apps/server/src/modules/h5p-editor/h5p-editor.config.ts index f02084aa4e5..9509cf66a76 100644 --- a/apps/server/src/modules/h5p-editor/h5p-editor.config.ts +++ b/apps/server/src/modules/h5p-editor/h5p-editor.config.ts @@ -1,5 +1,5 @@ import { Configuration } from '@hpi-schul-cloud/commons'; -import { S3Config } from '@shared/infra/s3-client'; +import { S3Config } from '@infra/s3-client'; const h5pEditorConfig = { NEST_LOG_LEVEL: Configuration.get('NEST_LOG_LEVEL') as string, 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 34efcedd69e..c80ff8bd6c0 100644 --- a/apps/server/src/modules/h5p-editor/h5p-editor.module.ts +++ b/apps/server/src/modules/h5p-editor/h5p-editor.module.ts @@ -3,14 +3,14 @@ import { MikroOrmModule, MikroOrmModuleSyncOptions } from '@mikro-orm/nestjs'; import { Module, NotFoundException } from '@nestjs/common'; import { ConfigModule } from '@nestjs/config'; import { ALL_ENTITIES } from '@shared/domain'; -import { RabbitMQWrapperModule } from '@shared/infra/rabbitmq'; +import { RabbitMQWrapperModule } from '@infra/rabbitmq'; import { DB_PASSWORD, DB_URL, DB_USERNAME, createConfigModuleOptions } from '@src/config'; import { CoreModule } from '@src/core'; import { Logger } from '@src/core/logger'; import { AuthorizationReferenceModule } from '@modules/authorization/authorization-reference.module'; import { UserModule } from '@modules/user'; -import { S3ClientModule } from '@shared/infra/s3-client'; -import { AuthenticationModule } from '../authentication/authentication.module'; +import { S3ClientModule } from '@infra/s3-client'; +import { AuthenticationModule } from '@modules/authentication'; import { H5PEditorController } from './controller/h5p-editor.controller'; import { H5PContent, InstalledLibrary, H5pEditorTempFile } from './entity'; import { config, s3ConfigContent, s3ConfigLibraries } from './h5p-editor.config'; diff --git a/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts b/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts index e06836ced99..f9672ffb3ce 100644 --- a/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts +++ b/apps/server/src/modules/h5p-editor/repo/h5p-content.repo.integration.spec.ts @@ -1,6 +1,6 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { MongoMemoryDatabaseModule } from '@shared/infra/database'; +import { MongoMemoryDatabaseModule } from '@infra/database'; import { cleanupCollections, h5pContentFactory } from '@shared/testing'; import { H5PContent } from '../entity'; import { H5PContentRepo } from './h5p-content.repo'; diff --git a/apps/server/src/modules/h5p-editor/repo/library.repo.spec.ts b/apps/server/src/modules/h5p-editor/repo/library.repo.spec.ts index 78d219aa557..79bcde09fe9 100644 --- a/apps/server/src/modules/h5p-editor/repo/library.repo.spec.ts +++ b/apps/server/src/modules/h5p-editor/repo/library.repo.spec.ts @@ -1,7 +1,7 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { cleanupCollections } from '@shared/testing'; -import { MongoMemoryDatabaseModule } from '@shared/infra/database'; +import { MongoMemoryDatabaseModule } from '@infra/database'; import { ILibraryMetadata } from '@lumieducation/h5p-server'; import { LibraryRepo } from './library.repo'; diff --git a/apps/server/src/modules/h5p-editor/repo/temporary-file.repo.integration.spec.ts b/apps/server/src/modules/h5p-editor/repo/temporary-file.repo.integration.spec.ts index ccaff625d66..e5e763b6216 100644 --- a/apps/server/src/modules/h5p-editor/repo/temporary-file.repo.integration.spec.ts +++ b/apps/server/src/modules/h5p-editor/repo/temporary-file.repo.integration.spec.ts @@ -1,6 +1,6 @@ import { EntityManager } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; -import { MongoMemoryDatabaseModule } from '@shared/infra/database'; +import { MongoMemoryDatabaseModule } from '@infra/database'; import { cleanupCollections, h5pTemporaryFileFactory } from '@shared/testing'; import { H5pEditorTempFile } from '../entity'; import { TemporaryFileRepo } from './temporary-file.repo'; diff --git a/apps/server/src/modules/h5p-editor/service/contentStorage.service.spec.ts b/apps/server/src/modules/h5p-editor/service/contentStorage.service.spec.ts index a02c8867cd0..df19f05ae21 100644 --- a/apps/server/src/modules/h5p-editor/service/contentStorage.service.spec.ts +++ b/apps/server/src/modules/h5p-editor/service/contentStorage.service.spec.ts @@ -4,7 +4,7 @@ import { IContentMetadata, ILibraryName, IUser, LibraryName } from '@lumieducati import { HttpException, InternalServerErrorException, NotFoundException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; import { IEntity } from '@shared/domain'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { ObjectID } from 'bson'; import { Readable } from 'stream'; import { GetH5PFileResponse } from '../controller/dto'; diff --git a/apps/server/src/modules/h5p-editor/service/contentStorage.service.ts b/apps/server/src/modules/h5p-editor/service/contentStorage.service.ts index 95895b867c8..753f40201e3 100644 --- a/apps/server/src/modules/h5p-editor/service/contentStorage.service.ts +++ b/apps/server/src/modules/h5p-editor/service/contentStorage.service.ts @@ -17,7 +17,7 @@ import { NotFoundException, UnprocessableEntityException, } from '@nestjs/common'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { ErrorUtils } from '@src/core/error/utils'; import { Readable } from 'stream'; import { H5pFileDto } from '../controller/dto/h5p-file.dto'; diff --git a/apps/server/src/modules/h5p-editor/service/libraryStorage.service.spec.ts b/apps/server/src/modules/h5p-editor/service/libraryStorage.service.spec.ts index afde26d59b0..1b7910f057d 100644 --- a/apps/server/src/modules/h5p-editor/service/libraryStorage.service.spec.ts +++ b/apps/server/src/modules/h5p-editor/service/libraryStorage.service.spec.ts @@ -6,7 +6,7 @@ import { H5pError, ILibraryMetadata, ILibraryName } from '@lumieducation/h5p-ser import { NotFoundException } from '@nestjs/common'; import { Test, TestingModule } from '@nestjs/testing'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { FileMetadata, InstalledLibrary } from '../entity/library.entity'; import { H5P_LIBRARIES_S3_CONNECTION } from '../h5p-editor.config'; import { LibraryRepo } from '../repo/library.repo'; diff --git a/apps/server/src/modules/h5p-editor/service/libraryStorage.service.ts b/apps/server/src/modules/h5p-editor/service/libraryStorage.service.ts index 6839a9d2a27..aff2b76ae16 100644 --- a/apps/server/src/modules/h5p-editor/service/libraryStorage.service.ts +++ b/apps/server/src/modules/h5p-editor/service/libraryStorage.service.ts @@ -10,7 +10,7 @@ import { type ILibraryStorage, } from '@lumieducation/h5p-server'; import { ConflictException, Inject, Injectable, NotFoundException } from '@nestjs/common'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import mime from 'mime'; import path from 'node:path/posix'; import { Readable } from 'stream'; diff --git a/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.spec.ts b/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.spec.ts index bcbdfa9945c..b7d65e25cb4 100644 --- a/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.spec.ts +++ b/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.spec.ts @@ -2,7 +2,7 @@ import { ServiceOutputTypes } from '@aws-sdk/client-s3'; import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { IUser } from '@lumieducation/h5p-server'; import { Test, TestingModule } from '@nestjs/testing'; -import { File, S3ClientAdapter } from '@shared/infra/s3-client'; +import { File, S3ClientAdapter } from '@infra/s3-client'; import { ReadStream } from 'fs'; import { Readable } from 'node:stream'; import { GetH5pFileResponse } from '../controller/dto'; diff --git a/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.ts b/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.ts index 6bfa164e630..7921b52a27b 100644 --- a/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.ts +++ b/apps/server/src/modules/h5p-editor/service/temporary-file-storage.service.ts @@ -1,6 +1,6 @@ import { ITemporaryFile, ITemporaryFileStorage, IUser } from '@lumieducation/h5p-server'; import { Inject, Injectable, NotAcceptableException } from '@nestjs/common'; -import { S3ClientAdapter } from '@shared/infra/s3-client'; +import { S3ClientAdapter } from '@infra/s3-client'; import { ReadStream } from 'fs'; import { Readable } from 'stream'; import { H5pFileDto } from '../controller/dto/h5p-file.dto'; diff --git a/apps/server/src/modules/lesson/service/etherpad.service.ts b/apps/server/src/modules/lesson/service/etherpad.service.ts index 66ef8279297..62e0773071b 100644 --- a/apps/server/src/modules/lesson/service/etherpad.service.ts +++ b/apps/server/src/modules/lesson/service/etherpad.service.ts @@ -1,6 +1,6 @@ import { Injectable } from '@nestjs/common'; import { EntityId } from '@shared/domain/types'; -import { FeathersServiceProvider } from '@infra/feathers/feathers-service.provider'; +import { FeathersServiceProvider } from '@infra/feathers'; import { LegacyLogger } from '@src/core/logger'; export type PadResponse = { data: { padID: string } }; diff --git a/apps/server/src/modules/lesson/service/nexboard.service.spec.ts b/apps/server/src/modules/lesson/service/nexboard.service.spec.ts index 24e1da4481b..8085a5fdd89 100644 --- a/apps/server/src/modules/lesson/service/nexboard.service.spec.ts +++ b/apps/server/src/modules/lesson/service/nexboard.service.spec.ts @@ -2,7 +2,7 @@ import { createMock, DeepMocked } from '@golevelup/ts-jest'; import { ObjectId } from '@mikro-orm/mongodb'; import { Test, TestingModule } from '@nestjs/testing'; import { EntityId } from '@shared/domain'; -import { FeathersServiceProvider } from '@infra/feathers/feathers-service.provider'; +import { FeathersServiceProvider } from '@infra/feathers'; import { LegacyLogger } from '@src/core/logger'; import { NexboardService } from './nexboard.service';