Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

BC-3513 Remove I-Prefix #4514

Merged
merged 119 commits into from
Nov 20, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
119 commits
Select commit Hold shift + click to select a range
a534f54
IErrorType -> ErrorType
wolfganggreschus Nov 2, 2023
fac77e3
ICoreModuleConfig -> CoreModuleConfig
wolfganggreschus Nov 2, 2023
6ef26a5
IInterceptorConfig -> InterceptorConfig
wolfganggreschus Nov 2, 2023
0d9cad5
ILoggerConfig -> LoggerConfig
wolfganggreschus Nov 2, 2023
4b1b2c8
IAccountConfig -> AccountConfig
wolfganggreschus Nov 2, 2023
8ea67c4
ClassEntityProps, RepoLoader
wolfganggreschus Nov 2, 2023
4c60045
FileStorageConfig
wolfganggreschus Nov 2, 2023
3e830fd
FileRecordSecurityCheckProperties, ParentInfo, FileRecordProperties
wolfganggreschus Nov 2, 2023
bc2271f
CopyFileDomainObjectProps, FileDomainObjectProps, CopyFilesRequestInf…
wolfganggreschus Nov 2, 2023
48b3328
FilesStorageClientConfig, FilesStorageClientConfig, CopyFileDomainObj…
wolfganggreschus Nov 2, 2023
5f38b88
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 13, 2023
af9b2cf
solved some merge conflicts
wolfganggreschus Nov 13, 2023
9b463e0
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 13, 2023
14da120
ILgecyLogger named temp LegacyLoggerInterface
wolfganggreschus Nov 13, 2023
d4db152
ICalendarEvent -> CalendarEvent
wolfganggreschus Nov 13, 2023
94b8412
ICollaborativeStorageStrategy -> CollaborativeStorageStrategy
wolfganggreschus Nov 13, 2023
1127a05
IEncryptionService -> EncryptionService
wolfganggreschus Nov 13, 2023
7ec975b
CollaborativeStorageStrategy - ModuleName changed
wolfganggreschus Nov 13, 2023
200c67a
IIdentityManagementConfig -> IdentityManagementConfig
wolfganggreschus Nov 13, 2023
58aa01a
IKeycloakSettings -> KeycloakSettingsInterface (temp)
wolfganggreschus Nov 13, 2023
4a0d98e
renamed RetryOptions, MigrationOptions, CleanOptions
wolfganggreschus Nov 13, 2023
00d9269
IJsonAccount -> JsonAccount
wolfganggreschus Nov 13, 2023
b71afc5
IJsonUser -> JsonUser
wolfganggreschus Nov 13, 2023
e1c6ca5
IKeycloakConfigurationInputFiles -> KeycloakConfigurationInputFilesIn…
wolfganggreschus Nov 13, 2023
142afeb
ICopyFilesOfParentParams > CopyFilesOfParentParams
wolfganggreschus Nov 13, 2023
7eed3b2
IMailConfig -> MailConfig
wolfganggreschus Nov 13, 2023
0c98f35
ICopyFileDO -> CopyFileDO
wolfganggreschus Nov 13, 2023
9ce7e25
IFileDO -> FileDO
wolfganggreschus Nov 13, 2023
7e4f9b2
ICurrentUserInterface -> CurrentUserInterface
wolfganggreschus Nov 13, 2023
ea5cdc6
ICurrentUser -> CurrentUserInterface (temp)
wolfganggreschus Nov 13, 2023
09200ba
ITemporaryFileProperties -> TemporaryFileProperties
wolfganggreschus Nov 13, 2023
acd279f
ICommonCartridgeFileBuilder -> CommonCartridgeFileBuilderInterface
wolfganggreschus Nov 13, 2023
b56b63e
ICommonCartridgeConfig -> CommonCartridgeConfig
wolfganggreschus Nov 13, 2023
dc069f5
ExternalToolPseudonymEntityProps
wolfganggreschus Nov 13, 2023
86206af
IServerConfig -> ServerConfig
wolfganggreschus Nov 13, 2023
6009a7e
IShareTokenProperties -> ShareTokenProperties
wolfganggreschus Nov 13, 2023
8cd0e5e
IToolFeatures -> ToolFeaturesInterface
wolfganggreschus Nov 13, 2023
cd50137
IContextExternalToolProperties -> ContextExternalToolProperties
wolfganggreschus Nov 13, 2023
c31f625
ISchoolExternalToolProperties -> SchoolExternalToolProperties
wolfganggreschus Nov 13, 2023
02a6036
IToolLaunchParams -> ToolLaunchParams
wolfganggreschus Nov 13, 2023
c6ef423
IToolLaunchStrategy -> ToolLaunchStrategy
wolfganggreschus Nov 13, 2023
969aec9
IUserConfig -> UserConfig
wolfganggreschus Nov 13, 2023
bb67f5e
IBbbSettings -> BbbSettingsInterface
wolfganggreschus Nov 13, 2023
d42576b
IVideoConferenceSettings -> VideoConferenceSettingsInterface
wolfganggreschus Nov 13, 2023
6ae052a
IScopeInfo -> ScopeInfo
wolfganggreschus Nov 13, 2023
76df21b
ICourseProperties -> CourseProperties
wolfganggreschus Nov 13, 2023
dee5fdf
ICourseGroupProperties -> CourseGroupProperties
wolfganggreschus Nov 14, 2023
0d72efc
IImportUserProperties -> ImportUserProperties
wolfganggreschus Nov 14, 2023
d55a0db
ILessonProperties -> LessonProperties
wolfganggreschus Nov 14, 2023
95fe19b
IComponentTextProperties -> ComponentTextProperties
wolfganggreschus Nov 14, 2023
88cd247
IComponentTextProperties -> ComponentTextProperties
wolfganggreschus Nov 14, 2023
78be73a
IComponentLernstoreProperties -> ComponentLernstoreProperties
wolfganggreschus Nov 14, 2023
4422b51
IComponentEtherpadProperties -> ComponentEtherpadProperties
wolfganggreschus Nov 14, 2023
121b3e1
IComponentInternalProperties -> ComponentInternalProperties
wolfganggreschus Nov 14, 2023
8b96f09
IComponentProperties -> ComponentProperties
wolfganggreschus Nov 14, 2023
987dd80
ILessonParent -> LessonParent
wolfganggreschus Nov 14, 2023
0bb7e44
ILearnroomElement -> LearnroomElement
wolfganggreschus Nov 14, 2023
8fefd28
ITargetGroupProperties -> TargetGroupProperties
wolfganggreschus Nov 14, 2023
b8ea871
IRelatedResourceProperties -> RelatedResourceProperties
wolfganggreschus Nov 14, 2023
46abb7f
IMaterialProperties -> MaterialProperties
wolfganggreschus Nov 14, 2023
7301828
NewsProperties -> INewsProperties
wolfganggreschus Nov 14, 2023
8df48ca
IRoleProperties -> RoleProperties
wolfganggreschus Nov 14, 2023
ec9f180
SchoolProperties -> SchoolProperties
wolfganggreschus Nov 14, 2023
5bf58d7
ISchoolYearProperties -> SchoolYearProperties
wolfganggreschus Nov 14, 2023
86e655c
IStorageProviderProperties -> StorageProviderProperties
wolfganggreschus Nov 14, 2023
b2f3347
ISubmissionProperties -> SubmissionProperties
wolfganggreschus Nov 14, 2023
f6d0f7e
ISystemProperties -> SystemProperties
wolfganggreschus Nov 14, 2023
5546597
ITaskParent -> TaskParent
wolfganggreschus Nov 14, 2023
6661570
ITeamProperties -> TeamProperties
wolfganggreschus Nov 14, 2023
b7c692e
ITeamUserProperties -> TeamUserProperties
wolfganggreschus Nov 14, 2023
7860052
IUserProperties -> IUserProperties
wolfganggreschus Nov 14, 2023
9963fb6
IPagination -> Pagination
wolfganggreschus Nov 14, 2023
3ad7af3
IFindOptions -> FindOptions
wolfganggreschus Nov 14, 2023
90927a2
ILearnroom -> Learnroom
wolfganggreschus Nov 14, 2023
1762501
IImportUserScope -> ImportUserScopeInterface
wolfganggreschus Nov 14, 2023
da74cea
INameMatch -> NameMatch
wolfganggreschus Nov 14, 2023
d89840a
ICreateNews -> CreateNews
wolfganggreschus Nov 14, 2023
b68b0e7
INewsScope -> NewsScopeInterface
wolfganggreschus Nov 14, 2023
db66c2b
ITaskUpdate -> TaskUpdate
wolfganggreschus Nov 14, 2023
761df72
ITaskCreate -> TaskCreate
wolfganggreschus Nov 14, 2023
5b0a1cd
ITaskProperties -> TaskProperties
wolfganggreschus Nov 14, 2023
334af4b
ITaskStatus -> TaskStatus
wolfganggreschus Nov 14, 2023
3618dff
ITestEntityProperties -> TestEntityProperties
wolfganggreschus Nov 14, 2023
7f2de12
IDashboardRepo -> DashboardRepoInterface
wolfganggreschus Nov 14, 2023
da116d0
IToolLaunchParams -> ToolLaunchParams
wolfganggreschus Nov 14, 2023
1423df1
IEntityWithSchool -> EntityWithSchool
wolfganggreschus Nov 14, 2023
e93ea00
IEntity -> EntityInterface
wolfganggreschus Nov 14, 2023
b60b401
test adjusted
wolfganggreschus Nov 14, 2023
7eaeb93
tests adjusted
wolfganggreschus Nov 14, 2023
a81e636
test adjusted
wolfganggreschus Nov 15, 2023
b5b2efd
Revert "IFindOptions -> FindOptions"
wolfganggreschus Nov 15, 2023
5a68047
solved more conflicts caused by revert
wolfganggreschus Nov 15, 2023
0a0202b
merged main solved conflicts
wolfganggreschus Nov 15, 2023
184089d
merged more conflicts caused by main-merge
wolfganggreschus Nov 15, 2023
3e482c4
adjusted tests
wolfganggreschus Nov 15, 2023
a5b511b
Adjusted more tests
wolfganggreschus Nov 15, 2023
b0b84db
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 15, 2023
4cb6514
specs adjusted
wolfganggreschus Nov 16, 2023
87c3979
Merge branch 'BC-3513-remove-i-prefix-in-interfaces' of github.com:hp…
wolfganggreschus Nov 16, 2023
b4345b6
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 16, 2023
e8460df
CurrentUserInterface -> ICurrentUser
wolfganggreschus Nov 16, 2023
1b9eeae
LegacyLoggerInterface -> ILegacyLogger
wolfganggreschus Nov 16, 2023
bcc1c17
KeycloakSettingsInterface -> IKeycloakSettings
wolfganggreschus Nov 16, 2023
0787195
KeycloakConfigurationInputFilesInterface -> IKeycloakConfigurationInp…
wolfganggreschus Nov 16, 2023
e95966e
ErrorInterface -> IError
wolfganggreschus Nov 16, 2023
1f191ce
ICommonCartridgeOrganizationBuilderInterface -> ICommonCartridgeOrgan…
wolfganggreschus Nov 16, 2023
1496805
CommonCartridgeFileBuilderInterface -> ICommonCartridgeFileBuilder
wolfganggreschus Nov 16, 2023
a250f22
ToolFeaturesInterface -> IToolFeatures
wolfganggreschus Nov 16, 2023
76aa032
BbbSettingsInterface -> IBbbSettings
wolfganggreschus Nov 16, 2023
02b5679
VideoConferenceSettingsInterface -> IVideoConferenceSettings
wolfganggreschus Nov 16, 2023
e70e5da
GridElementInterface -> IGridElement
wolfganggreschus Nov 16, 2023
991c351
EntityInterface -> IEntity
wolfganggreschus Nov 16, 2023
b547df5
ImportUserScopeInterface -> IImportUserScope
wolfganggreschus Nov 16, 2023
51ac47d
TaskInterface -> ITask
wolfganggreschus Nov 16, 2023
d7cc56d
NewsScopeInterface -> INewsScope
wolfganggreschus Nov 16, 2023
f9de095
DashboardRepoInterface -> IDashboardRepo
wolfganggreschus Nov 16, 2023
468fb83
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 16, 2023
8982698
Merge branch 'main' into BC-3513-remove-i-prefix-in-interfaces
wolfganggreschus Nov 17, 2023
3681a49
solved merge conflicts from main
wolfganggreschus Nov 20, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
2 changes: 1 addition & 1 deletion TODO.md
Original file line number Diff line number Diff line change
Expand Up @@ -88,4 +88,4 @@
- naming of dtos and dto-files: api vs domain, we leave out "dto" suffix for simplicity (we know that they are dtos) and instead append a specific suffix:
e.g.
api: <PaginationParams, pagination.params.ts>, <CreatNewsParams, create-news.params.ts>, <NewsResponse, news.response.ts>
domain: <ICreateNews, create-news.interface.ts>, <News, news.entity.ts>
domain: <CreateNews, create-news.interface.ts>, <News, news.entity.ts>
2 changes: 1 addition & 1 deletion apps/server/src/core/error/filter/global-error.filter.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import { IError, RpcMessage } from '@infra/rabbitmq/rpc-message';
import { ArgumentsHost, Catch, ExceptionFilter, HttpException, InternalServerErrorException } from '@nestjs/common';
import { ApiValidationError, BusinessError } from '@shared/common';
import { IError, RpcMessage } from '@infra/rabbitmq/rpc-message';
import { ErrorLogger, Loggable } from '@src/core/logger';
import { LoggingUtils } from '@src/core/logger/logging.utils';
import { Response } from 'express';
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface IErrorType {
export interface ErrorType {
readonly type: string;
readonly title: string;
readonly defaultMessage: string;
Expand Down
10 changes: 5 additions & 5 deletions apps/server/src/core/error/server-error-types.ts
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
/**
* all errors defined in the application require a definition,
* implementing the @IErrorType where their type is unambigious within of the application.
* implementing the @ErrorType where their type is unambigious within of the application.
* */

import legacyErrorTypes = require('../../../../../src/errors/commonErrorTypes');
import { IErrorType } from './interface/error-type.interface';
import { ErrorType } from './interface/error-type.interface';

// check legacy error typing is matching IErrorType
const serverErrorTypes: { [index: string]: IErrorType } = legacyErrorTypes;
// check legacy error typing is matching ErrorType
const serverErrorTypes: { [index: string]: ErrorType } = legacyErrorTypes;

// re-use legacy error types
export const { INTERNAL_SERVER_ERROR_TYPE, ASSERTION_ERROR_TYPE, API_VALIDATION_ERROR_TYPE, FORBIDDEN_ERROR_TYPE } =
serverErrorTypes;

// further error types

export const NOT_FOUND_ERROR_TYPE: IErrorType = {
export const NOT_FOUND_ERROR_TYPE: ErrorType = {
type: 'NOT_FOUND_ERROR',
title: 'Not Found',
defaultMessage: 'The requested ressource has not been found.',
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/core/interceptor/interceptor.module.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
import { ClassSerializerInterceptor, Module } from '@nestjs/common';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { IInterceptorConfig, TimeoutInterceptor } from '@shared/common';
import { ConfigService } from '@nestjs/config';
import { APP_INTERCEPTOR } from '@nestjs/core';
import { InterceptorConfig, TimeoutInterceptor } from '@shared/common';

/** *********************************************
* Global Interceptor setup
Expand All @@ -18,7 +18,7 @@ import { ConfigService } from '@nestjs/config';
},
{
provide: APP_INTERCEPTOR, // TODO remove (for testing)
useFactory: (configService: ConfigService<IInterceptorConfig, true>) => {
useFactory: (configService: ConfigService<InterceptorConfig, true>) => {
const timeout = configService.get<number>('INCOMING_REQUEST_TIMEOUT');
return new TimeoutInterceptor(timeout);
},
Expand Down
6 changes: 3 additions & 3 deletions apps/server/src/core/interfaces/core-module-config.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
import { IInterceptorConfig } from '@shared/common';
import { ILoggerConfig } from '../logger';
import { InterceptorConfig } from '@shared/common';
import { LoggerConfig } from '../logger';

export interface ICoreModuleConfig extends IInterceptorConfig, ILoggerConfig {}
export interface CoreModuleConfig extends InterceptorConfig, LoggerConfig {}
2 changes: 1 addition & 1 deletion apps/server/src/core/logger/interfaces/logger-config.ts
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
export interface ILoggerConfig {
export interface LoggerConfig {
NEST_LOG_LEVEL: string;
}
4 changes: 2 additions & 2 deletions apps/server/src/core/logger/logger.module.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,14 +3,14 @@ import { ConfigService } from '@nestjs/config';
import { utilities, WinstonModule } from 'nest-winston';
import winston from 'winston';
import { ErrorLogger } from './error-logger';
import { ILoggerConfig } from './interfaces';
import { LoggerConfig } from './interfaces';
import { LegacyLogger } from './legacy-logger.service';
import { Logger } from './logger';

@Module({
imports: [
WinstonModule.forRootAsync({
useFactory: (configService: ConfigService<ILoggerConfig, true>) => {
useFactory: (configService: ConfigService<LoggerConfig, true>) => {
return {
levels: winston.config.syslog.levels,
level: configService.get<string>('NEST_LOG_LEVEL'),
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface ICalendarEvent {
export interface CalendarEvent {
data: {
attributes: {
summary: string;
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/infra/calendar/mapper/calendar.mapper.spec.ts
Original file line number Diff line number Diff line change
@@ -1,12 +1,12 @@
import { ICalendarEvent } from '@infra/calendar/interface/calendar-event.interface';
import { CalendarEvent } from '@infra/calendar/interface/calendar-event.interface';
import { Test, TestingModule } from '@nestjs/testing';
import { CalendarMapper } from './calendar.mapper';

describe('CalendarMapper', () => {
let module: TestingModule;
let mapper: CalendarMapper;

const event: ICalendarEvent = {
const event: CalendarEvent = {
data: [
{
attributes: {
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/infra/calendar/mapper/calendar.mapper.ts
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
import { ICalendarEvent } from '@infra/calendar/interface/calendar-event.interface';
import { CalendarEvent } from '@infra/calendar/interface/calendar-event.interface';
import { Injectable } from '@nestjs/common';
import { CalendarEventDto } from '../dto/calendar-event.dto';

@Injectable()
export class CalendarMapper {
mapToDto(event: ICalendarEvent): CalendarEventDto {
mapToDto(event: CalendarEvent): CalendarEventDto {
const { attributes } = event.data[0];
return new CalendarEventDto({
teamId: attributes['x-sc-teamid'],
Expand Down
10 changes: 5 additions & 5 deletions apps/server/src/infra/calendar/service/calendar.service.spec.ts
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { DeepMocked, createMock } from '@golevelup/ts-jest';
import { createMock, DeepMocked } from '@golevelup/ts-jest';
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { CalendarEventDto, CalendarService } from '@infra/calendar';
import { HttpService } from '@nestjs/axios';
import { InternalServerErrorException } from '@nestjs/common';
import { Test, TestingModule } from '@nestjs/testing';
import { CalendarEventDto, CalendarService } from '@infra/calendar';
import { axiosResponseFactory } from '@shared/testing';
import { AxiosResponse } from 'axios';
import { of, throwError } from 'rxjs';
import { CalendarEvent } from '../interface/calendar-event.interface';
import { CalendarMapper } from '../mapper/calendar.mapper';
import { ICalendarEvent } from '../interface/calendar-event.interface';

describe('CalendarServiceSpec', () => {
let module: TestingModule;
Expand Down Expand Up @@ -56,7 +56,7 @@ describe('CalendarServiceSpec', () => {
const title = 'eventTitle';
const teamId = 'teamId';

const event: ICalendarEvent = {
const event: CalendarEvent = {
data: [
{
attributes: {
Expand All @@ -66,7 +66,7 @@ describe('CalendarServiceSpec', () => {
},
],
};
const axiosResponse: AxiosResponse<ICalendarEvent> = axiosResponseFactory.build({
const axiosResponse: AxiosResponse<CalendarEvent> = axiosResponseFactory.build({
data: event,
});
httpService.get.mockReturnValue(of(axiosResponse));
Expand Down
10 changes: 5 additions & 5 deletions apps/server/src/infra/calendar/service/calendar.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@ import { Injectable, InternalServerErrorException } from '@nestjs/common';
import { EntityId } from '@shared/domain';
import { ErrorUtils } from '@src/core/error/utils';
import { AxiosRequestConfig, AxiosResponse } from 'axios';
import { Observable, firstValueFrom } from 'rxjs';
import { firstValueFrom, Observable } 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';
import { CalendarEvent } from '../interface/calendar-event.interface';
import { CalendarMapper } from '../mapper/calendar.mapper';

@Injectable()
export class CalendarService {
Expand All @@ -34,7 +34,7 @@ export class CalendarService {
timeout: this.timeoutMs,
})
)
.then((resp: AxiosResponse<ICalendarEvent>) => this.calendarMapper.mapToDto(resp.data))
.then((resp: AxiosResponse<CalendarEvent>) => this.calendarMapper.mapToDto(resp.data))
.catch((error) => {
throw new InternalServerErrorException(
null,
Expand All @@ -47,7 +47,7 @@ export class CalendarService {
path: string,
queryParams: URLSearchParams,
config: AxiosRequestConfig
): Observable<AxiosResponse<ICalendarEvent>> {
): Observable<AxiosResponse<CalendarEvent>> {
const url: URL = new URL(this.baseURL);
url.pathname = path;
url.search = queryParams.toString();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,18 +1,18 @@
import { Configuration } from '@hpi-schul-cloud/commons/lib';
import { PseudonymModule } from '@modules/pseudonym';
import { ToolModule } from '@modules/tool';
import { UserModule } from '@modules/user';
import { HttpModule } from '@nestjs/axios';
import { Module, Provider } from '@nestjs/common';
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';
import { CollaborativeStorageAdapterMapper } from './mapper';
import { NextcloudClient } from './strategy/nextcloud/nextcloud.client';
import { NextcloudStrategy } from './strategy/nextcloud/nextcloud.strategy';

const storageStrategy: Provider = {
provide: 'ICollaborativeStorageStrategy',
provide: 'CollaborativeStorageStrategy',
useExisting: NextcloudStrategy,
};

Expand Down
Original file line number Diff line number Diff line change
@@ -1,14 +1,14 @@
import { createMock } from '@golevelup/ts-jest';
import { ObjectId } from '@mikro-orm/mongodb';
import { TeamDto } from '@modules/collaborative-storage/services/dto/team.dto'; // invalid import please fix
import { Test, TestingModule } from '@nestjs/testing';
import { RoleName } from '@shared/domain';
import { LegacyLogger } from '@src/core/logger';
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';
import { CollaborativeStorageStrategy } from './strategy/base.interface.strategy';

class TestStrategy implements ICollaborativeStorageStrategy {
class TestStrategy implements CollaborativeStorageStrategy {
baseURL: string;

constructor() {
Expand Down Expand Up @@ -38,7 +38,7 @@ class TestStrategy implements ICollaborativeStorageStrategy {
describe('CollaborativeStorage Adapter', () => {
let module: TestingModule;
let adapter: CollaborativeStorageAdapter;
let strategy: ICollaborativeStorageStrategy;
let strategy: CollaborativeStorageStrategy;

beforeAll(async () => {
module = await Test.createTestingModule({
Expand All @@ -50,8 +50,8 @@ describe('CollaborativeStorage Adapter', () => {
useValue: createMock<LegacyLogger>(),
},
{
provide: 'ICollaborativeStorageStrategy',
useValue: createMock<ICollaborativeStorageStrategy>(),
provide: 'CollaborativeStorageStrategy',
useValue: createMock<CollaborativeStorageStrategy>(),
},
],
}).compile();
Expand Down
Original file line number Diff line number Diff line change
@@ -1,21 +1,21 @@
import { TeamPermissionsDto } from '@modules/collaborative-storage/services/dto/team-permissions.dto';
import { TeamDto } from '@modules/collaborative-storage/services/dto/team.dto';
import { RoleDto } from '@modules/role/service/dto/role.dto';
import { Inject, Injectable } from '@nestjs/common';
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';
import { CollaborativeStorageStrategy } from './strategy/base.interface.strategy';

/**
* Provides an Adapter to an external collaborative storage.
* It loads an appropriate strategy and applies that to the given data.
*/
@Injectable()
export class CollaborativeStorageAdapter {
strategy: ICollaborativeStorageStrategy;
strategy: CollaborativeStorageStrategy;

constructor(
@Inject('ICollaborativeStorageStrategy') strategy: ICollaborativeStorageStrategy,
@Inject('CollaborativeStorageStrategy') strategy: CollaborativeStorageStrategy,
private mapper: CollaborativeStorageAdapterMapper,
private logger: LegacyLogger
) {
Expand All @@ -27,7 +27,7 @@ export class CollaborativeStorageAdapter {
* Set the strategy that should be used by the adapter
* @param strategy The strategy
*/
setStrategy(strategy: ICollaborativeStorageStrategy) {
setStrategy(strategy: CollaborativeStorageStrategy) {
this.strategy = strategy;
}

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -4,7 +4,7 @@ import { TeamRolePermissionsDto } from '../dto/team-role-permissions.dto';
/**
* base interface for all CollaborativeStorage Strategies
*/
export interface ICollaborativeStorageStrategy {
export interface CollaborativeStorageStrategy {
/**
* Updates The Permissions for the given Role in the given Team
* @param dto The DTO to be processed
Expand Down
Original file line number Diff line number Diff line change
@@ -1,24 +1,24 @@
import { TeamDto, TeamUserDto } from '@modules/collaborative-storage';
import { PseudonymService } from '@modules/pseudonym';
import { ExternalTool } from '@modules/tool/external-tool/domain';
import { ExternalToolService } from '@modules/tool/external-tool/service';
import { UserService } from '@modules/user';
import { Injectable, UnprocessableEntityException } from '@nestjs/common';
import { Pseudonym, UserDO } from '@shared/domain/';
import { LtiToolDO } from '@shared/domain/domainobject/ltitool.do';
import { LtiToolRepo } from '@shared/repo/ltitool/';
import { LegacyLogger } from '@src/core/logger';
import { TeamDto, TeamUserDto } from '@modules/collaborative-storage';
import { PseudonymService } from '@modules/pseudonym';
import { UserService } from '@modules/user';
import { ExternalToolService } from '@modules/tool/external-tool/service';
import { ExternalTool } from '@modules/tool/external-tool/domain';
import { TeamRolePermissionsDto } from '../../dto/team-role-permissions.dto';
import { ICollaborativeStorageStrategy } from '../base.interface.strategy';
import { CollaborativeStorageStrategy } from '../base.interface.strategy';
import { NextcloudClient } from './nextcloud.client';

/**
* Nextcloud Strategy Implementation for Collaborative Storage
*
* @implements {ICollaborativeStorageStrategy}
* @implements {CollaborativeStorageStrategy}
*/
@Injectable()
export class NextcloudStrategy implements ICollaborativeStorageStrategy {
export class NextcloudStrategy implements CollaborativeStorageStrategy {
constructor(
private readonly logger: LegacyLogger,
private readonly client: NextcloudClient,
Expand Down
2 changes: 1 addition & 1 deletion apps/server/src/infra/encryption/encryption.interface.ts
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
export const DefaultEncryptionService = Symbol('DefaultEncryptionService');
export const LdapEncryptionService = Symbol('LdapEncryptionService');

export interface IEncryptionService {
export interface EncryptionService {
encrypt(data: string): string;
decrypt(data: string): string;
}
6 changes: 3 additions & 3 deletions apps/server/src/infra/encryption/encryption.module.spec.ts
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
import { ConfigModule } from '@nestjs/config';
import { Test, TestingModule } from '@nestjs/testing';
import { DefaultEncryptionService, EncryptionModule, IEncryptionService, LdapEncryptionService } from '.';
import { DefaultEncryptionService, EncryptionModule, EncryptionService, LdapEncryptionService } from '.';

describe('EncryptionModule', () => {
let module: TestingModule;
let defaultService: IEncryptionService;
let ldapService: IEncryptionService;
let defaultService: EncryptionService;
let ldapService: EncryptionService;

beforeAll(async () => {
module = await Test.createTestingModule({
Expand Down
4 changes: 2 additions & 2 deletions apps/server/src/infra/encryption/encryption.service.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@ import CryptoJs from 'crypto-js';

import { Injectable } from '@nestjs/common';
import { LegacyLogger } from '@src/core/logger';
import { IEncryptionService } from './encryption.interface';
import { EncryptionService } from './encryption.interface';

@Injectable()
export class SymetricKeyEncryptionService implements IEncryptionService {
export class SymetricKeyEncryptionService implements EncryptionService {
constructor(private logger: LegacyLogger, private key?: string) {
if (!this.key) {
this.logger.warn('No AES key defined. Encryption will no work');
Expand Down
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
export interface IIdentityManagementConfig {
export interface IdentityManagementConfig {
FEATURE_IDENTITY_MANAGEMENT_ENABLED: boolean;
FEATURE_IDENTITY_MANAGEMENT_STORE_ENABLED: boolean;
FEATURE_IDENTITY_MANAGEMENT_LOGIN_ENABLED: boolean;
Expand Down
Loading
Loading