2023-01-21 11:11:55 -05:00
|
|
|
import {
|
2023-06-06 16:18:38 -04:00
|
|
|
IAccessRepository,
|
2023-11-01 04:13:34 +01:00
|
|
|
IActivityRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
IAlbumRepository,
|
|
|
|
IAssetRepository,
|
2024-01-27 18:52:14 +00:00
|
|
|
IAssetStackRepository,
|
2023-08-24 21:28:50 +02:00
|
|
|
IAuditRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
ICommunicationRepository,
|
2023-01-21 11:11:55 -05:00
|
|
|
ICryptoRepository,
|
2023-12-21 11:06:26 -05:00
|
|
|
IDatabaseRepository,
|
2023-01-21 11:11:55 -05:00
|
|
|
IJobRepository,
|
|
|
|
IKeyRepository,
|
2023-09-20 13:16:33 +02:00
|
|
|
ILibraryRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
IMachineLearningRepository,
|
|
|
|
IMediaRepository,
|
2023-09-27 20:44:51 +02:00
|
|
|
IMetadataRepository,
|
2023-10-11 04:14:44 +02:00
|
|
|
IMoveRepository,
|
2023-05-15 20:30:53 +03:00
|
|
|
IPartnerRepository,
|
2023-05-17 13:07:17 -04:00
|
|
|
IPersonRepository,
|
2023-10-24 17:05:42 +02:00
|
|
|
IServerInfoRepository,
|
2023-01-25 11:35:28 -05:00
|
|
|
ISharedLinkRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
ISmartInfoRepository,
|
2023-02-03 10:16:25 -05:00
|
|
|
IStorageRepository,
|
2023-01-21 11:11:55 -05:00
|
|
|
ISystemConfigRepository,
|
2023-11-25 18:53:30 +00:00
|
|
|
ISystemMetadataRepository,
|
2023-05-31 21:51:28 -04:00
|
|
|
ITagRepository,
|
2023-01-21 11:11:55 -05:00
|
|
|
IUserRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
IUserTokenRepository,
|
2023-09-27 20:44:51 +02:00
|
|
|
immichAppConfig,
|
2023-01-21 11:11:55 -05:00
|
|
|
} from '@app/domain';
|
2023-06-01 06:32:51 -04:00
|
|
|
import { BullModule } from '@nestjs/bullmq';
|
2023-01-11 21:34:36 -05:00
|
|
|
import { Global, Module, Provider } from '@nestjs/common';
|
2023-03-28 12:29:20 -04:00
|
|
|
import { ConfigModule } from '@nestjs/config';
|
2023-10-31 23:40:35 -05:00
|
|
|
import { ScheduleModule, SchedulerRegistry } from '@nestjs/schedule';
|
2023-01-11 21:34:36 -05:00
|
|
|
import { TypeOrmModule } from '@nestjs/typeorm';
|
2023-03-30 15:38:55 -04:00
|
|
|
import { databaseConfig } from './database.config';
|
|
|
|
import { databaseEntities } from './entities';
|
|
|
|
import { bullConfig, bullQueues } from './infra.config';
|
2023-02-01 15:55:06 -05:00
|
|
|
import {
|
2023-06-06 16:18:38 -04:00
|
|
|
AccessRepository,
|
2023-11-01 04:13:34 +01:00
|
|
|
ActivityRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
AlbumRepository,
|
2023-11-30 10:10:30 -05:00
|
|
|
ApiKeyRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
AssetRepository,
|
2024-01-27 18:52:14 +00:00
|
|
|
AssetStackRepository,
|
2023-08-24 21:28:50 +02:00
|
|
|
AuditRepository,
|
2023-03-30 15:38:55 -04:00
|
|
|
CommunicationRepository,
|
|
|
|
CryptoRepository,
|
2023-12-21 11:06:26 -05:00
|
|
|
DatabaseRepository,
|
2023-03-30 15:38:55 -04:00
|
|
|
FilesystemProvider,
|
|
|
|
JobRepository,
|
2023-09-20 13:16:33 +02:00
|
|
|
LibraryRepository,
|
2023-03-30 15:38:55 -04:00
|
|
|
MachineLearningRepository,
|
|
|
|
MediaRepository,
|
2023-09-27 20:44:51 +02:00
|
|
|
MetadataRepository,
|
2023-10-11 04:14:44 +02:00
|
|
|
MoveRepository,
|
2023-05-15 20:30:53 +03:00
|
|
|
PartnerRepository,
|
2023-05-17 13:07:17 -04:00
|
|
|
PersonRepository,
|
2023-10-24 17:05:42 +02:00
|
|
|
ServerInfoRepository,
|
2023-02-01 15:55:06 -05:00
|
|
|
SharedLinkRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
SmartInfoRepository,
|
2023-02-01 15:55:06 -05:00
|
|
|
SystemConfigRepository,
|
2023-11-25 18:53:30 +00:00
|
|
|
SystemMetadataRepository,
|
2023-05-31 21:51:28 -04:00
|
|
|
TagRepository,
|
2023-02-01 15:55:06 -05:00
|
|
|
UserRepository,
|
2023-02-25 09:12:03 -05:00
|
|
|
UserTokenRepository,
|
2023-03-30 15:38:55 -04:00
|
|
|
} from './repositories';
|
2023-01-11 21:34:36 -05:00
|
|
|
|
|
|
|
const providers: Provider[] = [
|
2023-11-01 04:13:34 +01:00
|
|
|
{ provide: IActivityRepository, useClass: ActivityRepository },
|
2023-06-06 16:18:38 -04:00
|
|
|
{ provide: IAccessRepository, useClass: AccessRepository },
|
2023-02-25 09:12:03 -05:00
|
|
|
{ provide: IAlbumRepository, useClass: AlbumRepository },
|
|
|
|
{ provide: IAssetRepository, useClass: AssetRepository },
|
2024-01-27 18:52:14 +00:00
|
|
|
{ provide: IAssetStackRepository, useClass: AssetStackRepository },
|
2023-08-24 21:28:50 +02:00
|
|
|
{ provide: IAuditRepository, useClass: AuditRepository },
|
2023-02-25 09:12:03 -05:00
|
|
|
{ provide: ICommunicationRepository, useClass: CommunicationRepository },
|
|
|
|
{ provide: ICryptoRepository, useClass: CryptoRepository },
|
2023-12-21 11:06:26 -05:00
|
|
|
{ provide: IDatabaseRepository, useClass: DatabaseRepository },
|
2023-01-21 11:11:55 -05:00
|
|
|
{ provide: IJobRepository, useClass: JobRepository },
|
2023-09-20 13:16:33 +02:00
|
|
|
{ provide: ILibraryRepository, useClass: LibraryRepository },
|
2023-11-30 10:10:30 -05:00
|
|
|
{ provide: IKeyRepository, useClass: ApiKeyRepository },
|
2023-02-25 09:12:03 -05:00
|
|
|
{ provide: IMachineLearningRepository, useClass: MachineLearningRepository },
|
2023-09-27 20:44:51 +02:00
|
|
|
{ provide: IMetadataRepository, useClass: MetadataRepository },
|
2023-10-11 04:14:44 +02:00
|
|
|
{ provide: IMoveRepository, useClass: MoveRepository },
|
2023-05-15 20:30:53 +03:00
|
|
|
{ provide: IPartnerRepository, useClass: PartnerRepository },
|
2023-05-17 13:07:17 -04:00
|
|
|
{ provide: IPersonRepository, useClass: PersonRepository },
|
2023-10-24 17:05:42 +02:00
|
|
|
{ provide: IServerInfoRepository, useClass: ServerInfoRepository },
|
2023-01-25 11:35:28 -05:00
|
|
|
{ provide: ISharedLinkRepository, useClass: SharedLinkRepository },
|
2023-02-25 09:12:03 -05:00
|
|
|
{ provide: ISmartInfoRepository, useClass: SmartInfoRepository },
|
2023-02-03 10:16:25 -05:00
|
|
|
{ provide: IStorageRepository, useClass: FilesystemProvider },
|
2023-01-21 11:11:55 -05:00
|
|
|
{ provide: ISystemConfigRepository, useClass: SystemConfigRepository },
|
2023-11-25 18:53:30 +00:00
|
|
|
{ provide: ISystemMetadataRepository, useClass: SystemMetadataRepository },
|
2023-05-31 21:51:28 -04:00
|
|
|
{ provide: ITagRepository, useClass: TagRepository },
|
2023-07-08 22:43:11 -04:00
|
|
|
{ provide: IMediaRepository, useClass: MediaRepository },
|
2023-01-11 21:34:36 -05:00
|
|
|
{ provide: IUserRepository, useClass: UserRepository },
|
2023-01-27 20:50:07 +00:00
|
|
|
{ provide: IUserTokenRepository, useClass: UserTokenRepository },
|
2023-10-31 23:40:35 -05:00
|
|
|
SchedulerRegistry,
|
2023-01-11 21:34:36 -05:00
|
|
|
];
|
|
|
|
|
|
|
|
@Global()
|
|
|
|
@Module({
|
2024-01-09 17:07:01 -05:00
|
|
|
imports: [
|
|
|
|
ConfigModule.forRoot(immichAppConfig),
|
|
|
|
TypeOrmModule.forRoot(databaseConfig),
|
|
|
|
TypeOrmModule.forFeature(databaseEntities),
|
|
|
|
ScheduleModule,
|
|
|
|
BullModule.forRoot(bullConfig),
|
|
|
|
BullModule.registerQueue(...bullQueues),
|
|
|
|
],
|
2023-10-06 15:48:11 -05:00
|
|
|
providers: [...providers],
|
2024-01-09 17:07:01 -05:00
|
|
|
exports: [...providers, BullModule],
|
2023-01-11 21:34:36 -05:00
|
|
|
})
|
|
|
|
export class InfraModule {}
|
2024-01-09 17:07:01 -05:00
|
|
|
|
|
|
|
@Global()
|
|
|
|
@Module({
|
|
|
|
imports: [
|
|
|
|
ConfigModule.forRoot(immichAppConfig),
|
|
|
|
TypeOrmModule.forRoot(databaseConfig),
|
|
|
|
TypeOrmModule.forFeature(databaseEntities),
|
|
|
|
ScheduleModule,
|
|
|
|
],
|
|
|
|
providers: [...providers],
|
|
|
|
exports: [...providers],
|
|
|
|
})
|
|
|
|
export class InfraTestModule {}
|