Skip to content

Commit

Permalink
resolve merge conflicts and cleanup path imports
Browse files Browse the repository at this point in the history
  • Loading branch information
CeEv committed Nov 8, 2023
1 parent e6c4239 commit 3cac1d7
Show file tree
Hide file tree
Showing 47 changed files with 76 additions and 70 deletions.
4 changes: 2 additions & 2 deletions apps/server/src/infra/calendar/calendar.module.ts
Original file line number Diff line number Diff line change
@@ -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],
Expand Down
Original file line number Diff line number Diff line change
@@ -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;
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/infra/calendar/mapper/calendar.mapper.ts
Original file line number Diff line number Diff line change
@@ -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 {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/infra/calendar/service/calendar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down
Original file line number Diff line number Diff line change
@@ -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 = {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down
Original file line number Diff line number Diff line change
@@ -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.
Expand Down
3 changes: 2 additions & 1 deletion apps/server/src/infra/collaborative-storage/index.ts
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
export * from './collaborative-storage.adapter';
export { CollaborativeStorageAdapter } from './collaborative-storage.adapter';
export { CollaborativeStorageAdapterModule } from './collaborative-storage-adapter.module';
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './collaborative-storage-adapter.mapper';
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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';
import { TeamDto, TeamUserDto } from '@modules/collaborative-storage/services/dto/team.dto';
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 {
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/infra/mail/mail.module.spec.ts
Original file line number Diff line number Diff line change
@@ -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';

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down
Original file line number Diff line number Diff line change
@@ -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],
Expand Down
1 change: 1 addition & 0 deletions apps/server/src/modules/authentication/index.ts
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
export { ICurrentUser } from './interface';
export { JWT, CurrentUser, Authenticate } from './decorator';
export { AuthenticationModule } from './authentication.module';
Original file line number Diff line number Diff line change
@@ -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],
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './collaborative-storage.controller';
4 changes: 2 additions & 2 deletions apps/server/src/modules/collaborative-storage/index.ts
Original file line number Diff line number Diff line change
@@ -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';
2 changes: 2 additions & 0 deletions apps/server/src/modules/collaborative-storage/mapper/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './team-permissions.mapper';
export * from './team.mapper';
1 change: 1 addition & 0 deletions apps/server/src/modules/collaborative-storage/uc/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
export * from './collaborative-storage.uc';
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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';
Expand Down
7 changes: 3 additions & 4 deletions apps/server/src/modules/files-storage/files-storage.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
2 changes: 2 additions & 0 deletions apps/server/src/modules/files-storage/service/index.ts
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
export * from './files-storage.service';
export * from './preview.service';
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
Original file line number Diff line number Diff line change
@@ -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) {
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/modules/h5p-editor/h5p-editor-test.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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';
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/modules/h5p-editor/h5p-editor.config.ts
Original file line number Diff line number Diff line change
@@ -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,
Expand Down
Loading

0 comments on commit 3cac1d7

Please sign in to comment.