diff --git a/server/src/domain/access/access.core.ts b/server/src/domain/access/access.core.ts index 502191fd89..7f75a76830 100644 --- a/server/src/domain/access/access.core.ts +++ b/server/src/domain/access/access.core.ts @@ -1,6 +1,6 @@ import { BadRequestException, UnauthorizedException } from '@nestjs/common'; import { AuthUserDto } from '../auth'; -import { IAccessRepository } from './access.repository'; +import { IAccessRepository } from '../repositories'; export enum Permission { // ASSET_CREATE = 'asset.create', diff --git a/server/src/domain/access/index.ts b/server/src/domain/access/index.ts index 24f84d67e0..80ae0c534a 100644 --- a/server/src/domain/access/index.ts +++ b/server/src/domain/access/index.ts @@ -1,2 +1 @@ export * from './access.core'; -export * from './access.repository'; diff --git a/server/src/domain/album/album.service.spec.ts b/server/src/domain/album/album.service.spec.ts index f1f5c2aee9..e326a27119 100644 --- a/server/src/domain/album/album.service.spec.ts +++ b/server/src/domain/album/album.service.spec.ts @@ -12,10 +12,9 @@ import { userStub, } from '@test'; import _ from 'lodash'; -import { BulkIdErrorReason, IAssetRepository } from '../asset'; -import { IJobRepository, JobName } from '../job'; -import { IUserRepository } from '../user'; -import { IAlbumRepository } from './album.repository'; +import { BulkIdErrorReason } from '../asset'; +import { JobName } from '../job'; +import { IAlbumRepository, IAssetRepository, IJobRepository, IUserRepository } from '../repositories'; import { AlbumService } from './album.service'; describe(AlbumService.name, () => { diff --git a/server/src/domain/album/album.service.ts b/server/src/domain/album/album.service.ts index 53bd0033c5..5da0b3440d 100644 --- a/server/src/domain/album/album.service.ts +++ b/server/src/domain/album/album.service.ts @@ -1,10 +1,17 @@ import { AlbumEntity, AssetEntity, UserEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; -import { AccessCore, IAccessRepository, Permission } from '../access'; -import { BulkIdErrorReason, BulkIdResponseDto, BulkIdsDto, IAssetRepository } from '../asset'; +import { AccessCore, Permission } from '../access'; +import { BulkIdErrorReason, BulkIdResponseDto, BulkIdsDto } from '../asset'; import { AuthUserDto } from '../auth'; -import { IJobRepository, JobName } from '../job'; -import { IUserRepository } from '../user'; +import { JobName } from '../job'; +import { + AlbumInfoOptions, + IAccessRepository, + IAlbumRepository, + IAssetRepository, + IJobRepository, + IUserRepository, +} from '../repositories'; import { AlbumCountResponseDto, AlbumResponseDto, @@ -12,7 +19,6 @@ import { mapAlbumWithAssets, mapAlbumWithoutAssets, } from './album-response.dto'; -import { AlbumInfoOptions, IAlbumRepository } from './album.repository'; import { AddUsersDto, AlbumInfoDto, CreateAlbumDto, GetAlbumsDto, UpdateAlbumDto } from './dto'; @Injectable() diff --git a/server/src/domain/album/index.ts b/server/src/domain/album/index.ts index 5042b0f446..f06f6d33c8 100644 --- a/server/src/domain/album/index.ts +++ b/server/src/domain/album/index.ts @@ -1,4 +1,3 @@ export * from './album-response.dto'; -export * from './album.repository'; export * from './album.service'; export * from './dto'; diff --git a/server/src/domain/api-key/api-key.service.spec.ts b/server/src/domain/api-key/api-key.service.spec.ts index eaf2ae38f4..adeb5dc010 100644 --- a/server/src/domain/api-key/api-key.service.spec.ts +++ b/server/src/domain/api-key/api-key.service.spec.ts @@ -1,7 +1,6 @@ import { BadRequestException } from '@nestjs/common'; import { authStub, keyStub, newCryptoRepositoryMock, newKeyRepositoryMock } from '@test'; -import { ICryptoRepository } from '../crypto'; -import { IKeyRepository } from './api-key.repository'; +import { ICryptoRepository, IKeyRepository } from '../repositories'; import { APIKeyService } from './api-key.service'; describe(APIKeyService.name, () => { diff --git a/server/src/domain/api-key/api-key.service.ts b/server/src/domain/api-key/api-key.service.ts index 34fe86e69f..a77fba7644 100644 --- a/server/src/domain/api-key/api-key.service.ts +++ b/server/src/domain/api-key/api-key.service.ts @@ -1,9 +1,8 @@ import { APIKeyEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto'; +import { ICryptoRepository, IKeyRepository } from '../repositories'; import { APIKeyCreateDto, APIKeyCreateResponseDto, APIKeyResponseDto } from './api-key.dto'; -import { IKeyRepository } from './api-key.repository'; @Injectable() export class APIKeyService { diff --git a/server/src/domain/api-key/index.ts b/server/src/domain/api-key/index.ts index 5fa9e5723f..94076f2a35 100644 --- a/server/src/domain/api-key/index.ts +++ b/server/src/domain/api-key/index.ts @@ -1,3 +1,2 @@ export * from './api-key.dto'; -export * from './api-key.repository'; export * from './api-key.service'; diff --git a/server/src/domain/asset/asset.service.spec.ts b/server/src/domain/asset/asset.service.spec.ts index 907892da6a..d2c0f7f3b8 100644 --- a/server/src/domain/asset/asset.service.spec.ts +++ b/server/src/domain/asset/asset.service.spec.ts @@ -15,12 +15,18 @@ import { } from '@test'; import { when } from 'jest-when'; import { Readable } from 'stream'; -import { ICommunicationRepository } from '../communication'; -import { ICryptoRepository } from '../crypto'; -import { IJobRepository, JobItem, JobName } from '../job'; -import { IStorageRepository } from '../storage'; -import { ISystemConfigRepository } from '../system-config'; -import { AssetStats, IAssetRepository, TimeBucketSize } from './asset.repository'; +import { JobName } from '../job'; +import { + AssetStats, + IAssetRepository, + ICommunicationRepository, + ICryptoRepository, + IJobRepository, + IStorageRepository, + ISystemConfigRepository, + JobItem, + TimeBucketSize, +} from '../repositories'; import { AssetService, UploadFieldName } from './asset.service'; import { AssetJobName, AssetStatsResponseDto, DownloadResponseDto } from './dto'; import { mapAsset } from './response-dto'; diff --git a/server/src/domain/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts index f6f7aeec07..87ab896fac 100644 --- a/server/src/domain/asset/asset.service.ts +++ b/server/src/domain/asset/asset.service.ts @@ -4,16 +4,24 @@ import _ from 'lodash'; import { DateTime, Duration } from 'luxon'; import { extname } from 'path'; import sanitize from 'sanitize-filename'; -import { AccessCore, IAccessRepository, Permission } from '../access'; +import { AccessCore, Permission } from '../access'; import { AuthUserDto } from '../auth'; -import { CommunicationEvent, ICommunicationRepository } from '../communication'; -import { ICryptoRepository } from '../crypto'; import { mimeTypes } from '../domain.constant'; import { HumanReadableSize, usePagination } from '../domain.util'; -import { IAssetDeletionJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; -import { IStorageRepository, ImmichReadStream, StorageCore, StorageFolder } from '../storage'; -import { ISystemConfigRepository, SystemConfigCore } from '../system-config'; -import { IAssetRepository } from './asset.repository'; +import { IAssetDeletionJob, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; +import { + CommunicationEvent, + IAccessRepository, + IAssetRepository, + ICommunicationRepository, + ICryptoRepository, + IJobRepository, + IStorageRepository, + ISystemConfigRepository, + ImmichReadStream, +} from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; +import { SystemConfigCore } from '../system-config'; import { AssetBulkDeleteDto, AssetBulkUpdateDto, diff --git a/server/src/domain/asset/dto/asset-statistics.dto.ts b/server/src/domain/asset/dto/asset-statistics.dto.ts index 38b5fe159b..a53e774f44 100644 --- a/server/src/domain/asset/dto/asset-statistics.dto.ts +++ b/server/src/domain/asset/dto/asset-statistics.dto.ts @@ -3,7 +3,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean } from 'class-validator'; import { Optional, toBoolean } from '../../domain.util'; -import { AssetStats } from '../asset.repository'; +import { AssetStats } from '../../repositories'; export class AssetStatsDto { @IsBoolean() diff --git a/server/src/domain/asset/dto/time-bucket.dto.ts b/server/src/domain/asset/dto/time-bucket.dto.ts index a21cd169a8..7c6b3253b2 100644 --- a/server/src/domain/asset/dto/time-bucket.dto.ts +++ b/server/src/domain/asset/dto/time-bucket.dto.ts @@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Transform } from 'class-transformer'; import { IsBoolean, IsEnum, IsNotEmpty, IsString } from 'class-validator'; import { Optional, ValidateUUID, toBoolean } from '../../domain.util'; -import { TimeBucketSize } from '../asset.repository'; +import { TimeBucketSize } from '../../repositories'; export class TimeBucketDto { @IsNotEmpty() diff --git a/server/src/domain/asset/index.ts b/server/src/domain/asset/index.ts index 833df4c56f..71ad3c8c48 100644 --- a/server/src/domain/asset/index.ts +++ b/server/src/domain/asset/index.ts @@ -1,4 +1,3 @@ -export * from './asset.repository'; export * from './asset.service'; export * from './dto'; export * from './response-dto'; diff --git a/server/src/domain/audit/audi.service.spec.ts b/server/src/domain/audit/audi.service.spec.ts index 8ca5cfed15..39b447330c 100644 --- a/server/src/domain/audit/audi.service.spec.ts +++ b/server/src/domain/audit/audi.service.spec.ts @@ -1,6 +1,6 @@ import { DatabaseAction, EntityType } from '@app/infra/entities'; import { IAccessRepositoryMock, auditStub, authStub, newAccessRepositoryMock, newAuditRepositoryMock } from '@test'; -import { IAuditRepository } from './audit.repository'; +import { IAuditRepository } from '../repositories'; import { AuditService } from './audit.service'; describe(AuditService.name, () => { diff --git a/server/src/domain/audit/audit.service.ts b/server/src/domain/audit/audit.service.ts index 3fa5316bc1..7e1574d485 100644 --- a/server/src/domain/audit/audit.service.ts +++ b/server/src/domain/audit/audit.service.ts @@ -1,11 +1,11 @@ import { DatabaseAction } from '@app/infra/entities'; import { Inject, Injectable } from '@nestjs/common'; import { DateTime } from 'luxon'; -import { AccessCore, IAccessRepository, Permission } from '../access'; +import { AccessCore, Permission } from '../access'; import { AuthUserDto } from '../auth'; import { AUDIT_LOG_MAX_DURATION } from '../domain.constant'; +import { IAccessRepository, IAuditRepository } from '../repositories'; import { AuditDeletesDto, AuditDeletesResponseDto } from './audit.dto'; -import { IAuditRepository } from './audit.repository'; @Injectable() export class AuditService { diff --git a/server/src/domain/audit/index.ts b/server/src/domain/audit/index.ts index 2074b86f38..febebf0f64 100644 --- a/server/src/domain/audit/index.ts +++ b/server/src/domain/audit/index.ts @@ -1,3 +1,2 @@ export * from './audit.dto'; -export * from './audit.repository'; export * from './audit.service'; diff --git a/server/src/domain/auth/auth.service.spec.ts b/server/src/domain/auth/auth.service.spec.ts index f1e99f322a..6ff7d77037 100644 --- a/server/src/domain/auth/auth.service.spec.ts +++ b/server/src/domain/auth/auth.service.spec.ts @@ -19,16 +19,18 @@ import { import { IncomingHttpHeaders } from 'http'; import { Issuer, generators } from 'openid-client'; import { Socket } from 'socket.io'; -import { IKeyRepository } from '../api-key'; -import { ICryptoRepository } from '../crypto/crypto.repository'; -import { ILibraryRepository } from '../library'; -import { ISharedLinkRepository } from '../shared-link'; -import { ISystemConfigRepository } from '../system-config'; -import { IUserRepository } from '../user'; +import { + ICryptoRepository, + IKeyRepository, + ILibraryRepository, + ISharedLinkRepository, + ISystemConfigRepository, + IUserRepository, + IUserTokenRepository, +} from '../repositories'; import { AuthType } from './auth.constant'; import { AuthService } from './auth.service'; import { AuthUserDto, SignUpDto } from './dto'; -import { IUserTokenRepository } from './user-token.repository'; // const token = Buffer.from('my-api-key', 'utf8').toString('base64'); diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index de18bc07c9..141abb0b7c 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -11,13 +11,17 @@ import cookieParser from 'cookie'; import { IncomingHttpHeaders } from 'http'; import { DateTime } from 'luxon'; import { ClientMetadata, Issuer, UserinfoResponse, custom, generators } from 'openid-client'; -import { IKeyRepository } from '../api-key'; -import { ICryptoRepository } from '../crypto/crypto.repository'; -import { ILibraryRepository } from '../library'; -import { ISharedLinkRepository } from '../shared-link'; -import { ISystemConfigRepository } from '../system-config'; +import { + ICryptoRepository, + IKeyRepository, + ILibraryRepository, + ISharedLinkRepository, + ISystemConfigRepository, + IUserRepository, + IUserTokenRepository, +} from '../repositories'; import { SystemConfigCore } from '../system-config/system-config.core'; -import { IUserRepository, UserCore, UserResponseDto } from '../user'; +import { UserCore, UserResponseDto } from '../user'; import { AuthType, IMMICH_ACCESS_COOKIE, @@ -38,7 +42,6 @@ import { mapLoginResponse, mapUserToken, } from './response-dto'; -import { IUserTokenRepository } from './user-token.repository'; export interface LoginDetails { isSecure: boolean; diff --git a/server/src/domain/auth/index.ts b/server/src/domain/auth/index.ts index 2f868537c0..d3aa704ba1 100644 --- a/server/src/domain/auth/index.ts +++ b/server/src/domain/auth/index.ts @@ -2,4 +2,3 @@ export * from './auth.constant'; export * from './auth.service'; export * from './dto'; export * from './response-dto'; -export * from './user-token.repository'; diff --git a/server/src/domain/communication/index.ts b/server/src/domain/communication/index.ts deleted file mode 100644 index 5339082c20..0000000000 --- a/server/src/domain/communication/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './communication.repository'; diff --git a/server/src/domain/crypto/index.ts b/server/src/domain/crypto/index.ts deleted file mode 100644 index 93bf8a30c2..0000000000 --- a/server/src/domain/crypto/index.ts +++ /dev/null @@ -1 +0,0 @@ -export * from './crypto.repository'; diff --git a/server/src/domain/index.ts b/server/src/domain/index.ts index 2915fa0770..f2b05ac76d 100644 --- a/server/src/domain/index.ts +++ b/server/src/domain/index.ts @@ -4,8 +4,6 @@ export * from './api-key'; export * from './asset'; export * from './audit'; export * from './auth'; -export * from './communication'; -export * from './crypto'; export * from './domain.config'; export * from './domain.constant'; export * from './domain.module'; @@ -16,6 +14,7 @@ export * from './media'; export * from './metadata'; export * from './partner'; export * from './person'; +export * from './repositories'; export * from './search'; export * from './server-info'; export * from './shared-link'; diff --git a/server/src/domain/job/index.ts b/server/src/domain/job/index.ts index f125b969af..44f617f0c4 100644 --- a/server/src/domain/job/index.ts +++ b/server/src/domain/job/index.ts @@ -1,5 +1,4 @@ export * from './job.constants'; export * from './job.dto'; export * from './job.interface'; -export * from './job.repository'; export * from './job.service'; diff --git a/server/src/domain/job/job.service.spec.ts b/server/src/domain/job/job.service.spec.ts index 505bca7f79..dac22a3ec2 100644 --- a/server/src/domain/job/job.service.spec.ts +++ b/server/src/domain/job/job.service.spec.ts @@ -9,13 +9,17 @@ import { newPersonRepositoryMock, newSystemConfigRepositoryMock, } from '@test'; -import { IAssetRepository } from '../asset'; -import { ICommunicationRepository } from '../communication'; -import { IPersonRepository } from '../person'; -import { ISystemConfigRepository } from '../system-config'; +import { + IAssetRepository, + ICommunicationRepository, + IJobRepository, + IPersonRepository, + ISystemConfigRepository, + JobHandler, + JobItem, +} from '../repositories'; import { SystemConfigCore } from '../system-config/system-config.core'; import { JobCommand, JobName, QueueName } from './job.constants'; -import { IJobRepository, JobHandler, JobItem } from './job.repository'; import { JobService } from './job.service'; const makeMockHandlers = (success: boolean) => { diff --git a/server/src/domain/job/job.service.ts b/server/src/domain/job/job.service.ts index 8c90de9726..7b65467af6 100644 --- a/server/src/domain/job/job.service.ts +++ b/server/src/domain/job/job.service.ts @@ -1,13 +1,19 @@ import { AssetType } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable, Logger } from '@nestjs/common'; -import { IAssetRepository, mapAsset } from '../asset'; -import { CommunicationEvent, ICommunicationRepository } from '../communication'; -import { IPersonRepository } from '../person'; -import { FeatureFlag, ISystemConfigRepository } from '../system-config'; -import { SystemConfigCore } from '../system-config/system-config.core'; +import { mapAsset } from '../asset'; +import { + CommunicationEvent, + IAssetRepository, + ICommunicationRepository, + IJobRepository, + IPersonRepository, + ISystemConfigRepository, + JobHandler, + JobItem, +} from '../repositories'; +import { FeatureFlag, SystemConfigCore } from '../system-config/system-config.core'; import { JobCommand, JobName, QueueName } from './job.constants'; import { AllJobStatusResponseDto, JobCommandDto, JobStatusDto } from './job.dto'; -import { IJobRepository, JobHandler, JobItem } from './job.repository'; @Injectable() export class JobService { diff --git a/server/src/domain/library/index.ts b/server/src/domain/library/index.ts index 8adc4449cb..da0d981f2e 100644 --- a/server/src/domain/library/index.ts +++ b/server/src/domain/library/index.ts @@ -1,3 +1,2 @@ export * from './library.dto'; -export * from './library.repository'; export * from './library.service'; diff --git a/server/src/domain/library/library.service.spec.ts b/server/src/domain/library/library.service.spec.ts index b70423b5a6..3f56c3100f 100644 --- a/server/src/domain/library/library.service.spec.ts +++ b/server/src/domain/library/library.service.spec.ts @@ -16,10 +16,15 @@ import { userStub, } from '@test'; import { Stats } from 'fs'; -import { IJobRepository, ILibraryFileJob, ILibraryRefreshJob, IOfflineLibraryFileJob, JobName } from '../job'; - -import { IAssetRepository, ICryptoRepository, IStorageRepository, IUserRepository } from '..'; -import { ILibraryRepository } from './library.repository'; +import { ILibraryFileJob, ILibraryRefreshJob, IOfflineLibraryFileJob, JobName } from '../job'; +import { + IAssetRepository, + ICryptoRepository, + IJobRepository, + ILibraryRepository, + IStorageRepository, + IUserRepository, +} from '../repositories'; import { LibraryService } from './library.service'; describe(LibraryService.name, () => { diff --git a/server/src/domain/library/library.service.ts b/server/src/domain/library/library.service.ts index 797859c0e2..44c60d4bc1 100644 --- a/server/src/domain/library/library.service.ts +++ b/server/src/domain/library/library.service.ts @@ -4,24 +4,29 @@ import { R_OK } from 'node:constants'; import { Stats } from 'node:fs'; import path from 'node:path'; import { basename, parse } from 'path'; -import { AccessCore, IAccessRepository, Permission } from '../access'; -import { IAssetRepository, WithProperty } from '../asset'; +import { AccessCore, Permission } from '../access'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto'; import { mimeTypes } from '../domain.constant'; import { usePagination } from '../domain.util'; import { IBaseJob, IEntityJob, - IJobRepository, ILibraryFileJob, ILibraryRefreshJob, IOfflineLibraryFileJob, JOBS_ASSET_PAGINATION_SIZE, JobName, } from '../job'; -import { IStorageRepository } from '../storage'; -import { IUserRepository } from '../user'; +import { + IAccessRepository, + IAssetRepository, + ICryptoRepository, + IJobRepository, + ILibraryRepository, + IStorageRepository, + IUserRepository, + WithProperty, +} from '../repositories'; import { CreateLibraryDto, LibraryResponseDto, @@ -30,7 +35,6 @@ import { UpdateLibraryDto, mapLibrary, } from './library.dto'; -import { ILibraryRepository } from './library.repository'; @Injectable() export class LibraryService { diff --git a/server/src/domain/media/index.ts b/server/src/domain/media/index.ts index ad52a4afbf..83a31567bd 100644 --- a/server/src/domain/media/index.ts +++ b/server/src/domain/media/index.ts @@ -1,3 +1,2 @@ export * from './media.constant'; -export * from './media.repository'; export * from './media.service'; diff --git a/server/src/domain/media/media.service.spec.ts b/server/src/domain/media/media.service.spec.ts index 753c4dd9e8..e798de9a1e 100644 --- a/server/src/domain/media/media.service.spec.ts +++ b/server/src/domain/media/media.service.spec.ts @@ -20,12 +20,16 @@ import { personStub, probeStub, } from '@test'; -import { IAssetRepository, WithoutProperty } from '../asset'; -import { IJobRepository, JobName } from '../job'; -import { IPersonRepository } from '../person'; -import { IStorageRepository } from '../storage'; -import { ISystemConfigRepository } from '../system-config'; -import { IMediaRepository } from './media.repository'; +import { JobName } from '../job'; +import { + IAssetRepository, + IJobRepository, + IMediaRepository, + IPersonRepository, + IStorageRepository, + ISystemConfigRepository, + WithoutProperty, +} from '../repositories'; import { MediaService } from './media.service'; describe(MediaService.name, () => { diff --git a/server/src/domain/media/media.service.ts b/server/src/domain/media/media.service.ts index ebf57de94c..9d06c9ad0e 100644 --- a/server/src/domain/media/media.service.ts +++ b/server/src/domain/media/media.service.ts @@ -1,13 +1,22 @@ import { AssetEntity, AssetType, Colorspace, TranscodeHWAccel, TranscodePolicy, VideoCodec } from '@app/infra/entities'; import { Inject, Injectable, Logger, UnsupportedMediaTypeException } from '@nestjs/common'; -import { IAssetRepository, WithoutProperty } from '../asset'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from '../job'; -import { IPersonRepository } from '../person'; -import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; -import { ISystemConfigRepository, SystemConfigFFmpegDto } from '../system-config'; +import { IBaseJob, IEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from '../job'; +import { + AudioStreamInfo, + IAssetRepository, + IJobRepository, + IMediaRepository, + IPersonRepository, + IStorageRepository, + ISystemConfigRepository, + VideoCodecHWConfig, + VideoStreamInfo, + WithoutProperty, +} from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; +import { SystemConfigFFmpegDto } from '../system-config'; import { SystemConfigCore } from '../system-config/system-config.core'; -import { AudioStreamInfo, IMediaRepository, VideoCodecHWConfig, VideoStreamInfo } from './media.repository'; import { H264Config, HEVCConfig, NVENCConfig, QSVConfig, ThumbnailConfig, VAAPIConfig, VP9Config } from './media.util'; @Injectable() diff --git a/server/src/domain/media/media.util.ts b/server/src/domain/media/media.util.ts index e28d78e31d..1ea2329dfc 100644 --- a/server/src/domain/media/media.util.ts +++ b/server/src/domain/media/media.util.ts @@ -1,5 +1,4 @@ import { CQMode, ToneMapping, TranscodeHWAccel, VideoCodec } from '@app/infra/entities'; -import { SystemConfigFFmpegDto } from '../system-config/dto'; import { AudioStreamInfo, BitrateDistribution, @@ -7,7 +6,8 @@ import { VideoCodecHWConfig, VideoCodecSWConfig, VideoStreamInfo, -} from './media.repository'; +} from '../repositories'; +import { SystemConfigFFmpegDto } from '../system-config/dto'; class BaseConfig implements VideoCodecSWConfig { presets = ['veryslow', 'slower', 'slow', 'medium', 'fast', 'faster', 'veryfast', 'superfast', 'ultrafast']; constructor(protected config: SystemConfigFFmpegDto) {} diff --git a/server/src/domain/metadata/index.ts b/server/src/domain/metadata/index.ts index 860bd17f2c..92c69e4505 100644 --- a/server/src/domain/metadata/index.ts +++ b/server/src/domain/metadata/index.ts @@ -1,2 +1 @@ -export * from './metadata.repository'; export * from './metadata.service'; diff --git a/server/src/domain/metadata/metadata.service.spec.ts b/server/src/domain/metadata/metadata.service.spec.ts index 6c0bc3629a..4f8b6d0172 100644 --- a/server/src/domain/metadata/metadata.service.spec.ts +++ b/server/src/domain/metadata/metadata.service.spec.ts @@ -12,13 +12,19 @@ import { import { randomBytes } from 'crypto'; import { Stats } from 'fs'; import { constants } from 'fs/promises'; -import { IAlbumRepository } from '../album'; -import { IAssetRepository, WithProperty, WithoutProperty } from '../asset'; -import { ICryptoRepository } from '../crypto'; -import { IJobRepository, JobName, QueueName } from '../job'; -import { IStorageRepository } from '../storage'; -import { ISystemConfigRepository } from '../system-config'; -import { IMetadataRepository, ImmichTags } from './metadata.repository'; +import { JobName, QueueName } from '../job'; +import { + IAlbumRepository, + IAssetRepository, + ICryptoRepository, + IJobRepository, + IMetadataRepository, + IStorageRepository, + ISystemConfigRepository, + ImmichTags, + WithProperty, + WithoutProperty, +} from '../repositories'; import { MetadataService } from './metadata.service'; describe(MetadataService.name, () => { diff --git a/server/src/domain/metadata/metadata.service.ts b/server/src/domain/metadata/metadata.service.ts index bbd00943df..7970b07266 100644 --- a/server/src/domain/metadata/metadata.service.ts +++ b/server/src/domain/metadata/metadata.service.ts @@ -4,14 +4,22 @@ import { ExifDateTime, Tags } from 'exiftool-vendored'; import { firstDateTime } from 'exiftool-vendored/dist/FirstDateTime'; import { constants } from 'fs/promises'; import { Duration } from 'luxon'; -import { IAlbumRepository } from '../album'; -import { IAssetRepository, WithProperty, WithoutProperty } from '../asset'; -import { ICryptoRepository } from '../crypto'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from '../job'; -import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; -import { FeatureFlag, ISystemConfigRepository, SystemConfigCore } from '../system-config'; -import { IMetadataRepository, ImmichTags } from './metadata.repository'; +import { IBaseJob, IEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from '../job'; +import { + IAlbumRepository, + IAssetRepository, + ICryptoRepository, + IJobRepository, + IMetadataRepository, + IStorageRepository, + ISystemConfigRepository, + ImmichTags, + WithProperty, + WithoutProperty, +} from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; +import { FeatureFlag, SystemConfigCore } from '../system-config'; interface DirectoryItem { Length?: number; diff --git a/server/src/domain/partner/index.ts b/server/src/domain/partner/index.ts index a1542198e1..f78ecb1cb9 100644 --- a/server/src/domain/partner/index.ts +++ b/server/src/domain/partner/index.ts @@ -1,2 +1 @@ -export * from './partner.repository'; export * from './partner.service'; diff --git a/server/src/domain/partner/partner.service.spec.ts b/server/src/domain/partner/partner.service.spec.ts index ac15abc8c0..2bc561194d 100644 --- a/server/src/domain/partner/partner.service.spec.ts +++ b/server/src/domain/partner/partner.service.spec.ts @@ -1,7 +1,7 @@ import { BadRequestException } from '@nestjs/common'; import { authStub, newPartnerRepositoryMock, partnerStub } from '@test'; import { UserResponseDto } from '../index'; -import { IPartnerRepository, PartnerDirection } from './partner.repository'; +import { IPartnerRepository, PartnerDirection } from '../repositories'; import { PartnerService } from './partner.service'; const responseDto = { diff --git a/server/src/domain/partner/partner.service.ts b/server/src/domain/partner/partner.service.ts index d7f75b5193..797938a8d1 100644 --- a/server/src/domain/partner/partner.service.ts +++ b/server/src/domain/partner/partner.service.ts @@ -1,7 +1,7 @@ import { PartnerEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable } from '@nestjs/common'; -import { IPartnerRepository, PartnerDirection, PartnerIds } from '.'; import { AuthUserDto } from '../auth'; +import { IPartnerRepository, PartnerDirection, PartnerIds } from '../repositories'; import { UserResponseDto, mapUser } from '../user'; @Injectable() diff --git a/server/src/domain/person/index.ts b/server/src/domain/person/index.ts index 9c1ae2f7eb..14a960467a 100644 --- a/server/src/domain/person/index.ts +++ b/server/src/domain/person/index.ts @@ -1,3 +1,2 @@ export * from './person.dto'; -export * from './person.repository'; export * from './person.service'; diff --git a/server/src/domain/person/person.service.spec.ts b/server/src/domain/person/person.service.spec.ts index 3bfea3b689..36aec20c5b 100644 --- a/server/src/domain/person/person.service.spec.ts +++ b/server/src/domain/person/person.service.spec.ts @@ -16,15 +16,20 @@ import { newSystemConfigRepositoryMock, personStub, } from '@test'; -import { BulkIdErrorReason, IAssetRepository, WithoutProperty } from '../asset'; -import { IJobRepository, JobName } from '../job'; -import { IMediaRepository } from '../media'; -import { ISearchRepository } from '../search'; -import { IMachineLearningRepository } from '../smart-info'; -import { IStorageRepository } from '../storage'; -import { ISystemConfigRepository } from '../system-config'; +import { BulkIdErrorReason } from '../asset'; +import { JobName } from '../job'; +import { + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + IMediaRepository, + IPersonRepository, + ISearchRepository, + IStorageRepository, + ISystemConfigRepository, + WithoutProperty, +} from '../repositories'; import { PersonResponseDto } from './person.dto'; -import { IPersonRepository } from './person.repository'; import { PersonService } from './person.service'; const responseDto: PersonResponseDto = { diff --git a/server/src/domain/person/person.service.ts b/server/src/domain/person/person.service.ts index c21e654b2a..528a6dd987 100644 --- a/server/src/domain/person/person.service.ts +++ b/server/src/domain/person/person.service.ts @@ -1,23 +1,30 @@ import { PersonEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common'; -import { AccessCore, IAccessRepository, Permission } from '../access'; -import { - AssetResponseDto, - BulkIdErrorReason, - BulkIdResponseDto, - IAssetRepository, - WithoutProperty, - mapAsset, -} from '../asset'; +import { AccessCore, Permission } from '../access'; +import { AssetResponseDto, BulkIdErrorReason, BulkIdResponseDto, mapAsset } from '../asset'; import { AuthUserDto } from '../auth'; import { mimeTypes } from '../domain.constant'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; -import { CropOptions, FACE_THUMBNAIL_SIZE, IMediaRepository } from '../media'; -import { ISearchRepository } from '../search'; -import { IMachineLearningRepository } from '../smart-info'; -import { IStorageRepository, ImmichReadStream, StorageCore, StorageFolder } from '../storage'; -import { ISystemConfigRepository, SystemConfigCore } from '../system-config'; +import { IBaseJob, IEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; +import { FACE_THUMBNAIL_SIZE } from '../media'; +import { + AssetFaceId, + CropOptions, + IAccessRepository, + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + IMediaRepository, + IPersonRepository, + ISearchRepository, + IStorageRepository, + ISystemConfigRepository, + ImmichReadStream, + UpdateFacesData, + WithoutProperty, +} from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; +import { SystemConfigCore } from '../system-config'; import { MergePersonDto, PeopleResponseDto, @@ -27,7 +34,6 @@ import { PersonUpdateDto, mapPerson, } from './person.dto'; -import { AssetFaceId, IPersonRepository, UpdateFacesData } from './person.repository'; @Injectable() export class PersonService { diff --git a/server/src/domain/access/access.repository.ts b/server/src/domain/repositories/access.repository.ts similarity index 100% rename from server/src/domain/access/access.repository.ts rename to server/src/domain/repositories/access.repository.ts diff --git a/server/src/domain/album/album.repository.ts b/server/src/domain/repositories/album.repository.ts similarity index 100% rename from server/src/domain/album/album.repository.ts rename to server/src/domain/repositories/album.repository.ts diff --git a/server/src/domain/api-key/api-key.repository.ts b/server/src/domain/repositories/api-key.repository.ts similarity index 100% rename from server/src/domain/api-key/api-key.repository.ts rename to server/src/domain/repositories/api-key.repository.ts diff --git a/server/src/domain/asset/asset.repository.ts b/server/src/domain/repositories/asset.repository.ts similarity index 100% rename from server/src/domain/asset/asset.repository.ts rename to server/src/domain/repositories/asset.repository.ts diff --git a/server/src/domain/audit/audit.repository.ts b/server/src/domain/repositories/audit.repository.ts similarity index 100% rename from server/src/domain/audit/audit.repository.ts rename to server/src/domain/repositories/audit.repository.ts diff --git a/server/src/domain/communication/communication.repository.ts b/server/src/domain/repositories/communication.repository.ts similarity index 100% rename from server/src/domain/communication/communication.repository.ts rename to server/src/domain/repositories/communication.repository.ts diff --git a/server/src/domain/crypto/crypto.repository.ts b/server/src/domain/repositories/crypto.repository.ts similarity index 100% rename from server/src/domain/crypto/crypto.repository.ts rename to server/src/domain/repositories/crypto.repository.ts diff --git a/server/src/domain/repositories/index.ts b/server/src/domain/repositories/index.ts new file mode 100644 index 0000000000..2a6ef62774 --- /dev/null +++ b/server/src/domain/repositories/index.ts @@ -0,0 +1,22 @@ +export * from './access.repository'; +export * from './album.repository'; +export * from './api-key.repository'; +export * from './asset.repository'; +export * from './audit.repository'; +export * from './communication.repository'; +export * from './crypto.repository'; +export * from './job.repository'; +export * from './library.repository'; +export * from './machine-learning.repository'; +export * from './media.repository'; +export * from './metadata.repository'; +export * from './partner.repository'; +export * from './person.repository'; +export * from './search.repository'; +export * from './shared-link.repository'; +export * from './smart-info.repository'; +export * from './storage.repository'; +export * from './system-config.repository'; +export * from './tag.repository'; +export * from './user-token.repository'; +export * from './user.repository'; diff --git a/server/src/domain/job/job.repository.ts b/server/src/domain/repositories/job.repository.ts similarity index 97% rename from server/src/domain/job/job.repository.ts rename to server/src/domain/repositories/job.repository.ts index be2ee7a901..0ba2b7c1ad 100644 --- a/server/src/domain/job/job.repository.ts +++ b/server/src/domain/repositories/job.repository.ts @@ -1,4 +1,4 @@ -import { JobName, QueueName } from './job.constants'; +import { JobName, QueueName } from '../job/job.constants'; import { IAssetDeletionJob, @@ -10,7 +10,7 @@ import { ILibraryFileJob, ILibraryRefreshJob, IOfflineLibraryFileJob, -} from './job.interface'; +} from '../job/job.interface'; export interface JobCounts { active: number; diff --git a/server/src/domain/library/library.repository.ts b/server/src/domain/repositories/library.repository.ts similarity index 94% rename from server/src/domain/library/library.repository.ts rename to server/src/domain/repositories/library.repository.ts index 46f75170ce..7ba6cd409f 100644 --- a/server/src/domain/library/library.repository.ts +++ b/server/src/domain/repositories/library.repository.ts @@ -1,5 +1,5 @@ import { LibraryEntity, LibraryType } from '@app/infra/entities'; -import { LibraryStatsResponseDto } from './library.dto'; +import { LibraryStatsResponseDto } from '../library/library.dto'; export const ILibraryRepository = 'ILibraryRepository'; diff --git a/server/src/domain/smart-info/machine-learning.interface.ts b/server/src/domain/repositories/machine-learning.repository.ts similarity index 97% rename from server/src/domain/smart-info/machine-learning.interface.ts rename to server/src/domain/repositories/machine-learning.repository.ts index 8e4b3789b4..839002883c 100644 --- a/server/src/domain/smart-info/machine-learning.interface.ts +++ b/server/src/domain/repositories/machine-learning.repository.ts @@ -1,4 +1,4 @@ -import { ClassificationConfig, CLIPConfig, RecognitionConfig } from './dto'; +import { ClassificationConfig, CLIPConfig, RecognitionConfig } from '../smart-info/dto'; export const IMachineLearningRepository = 'IMachineLearningRepository'; diff --git a/server/src/domain/media/media.repository.ts b/server/src/domain/repositories/media.repository.ts similarity index 100% rename from server/src/domain/media/media.repository.ts rename to server/src/domain/repositories/media.repository.ts diff --git a/server/src/domain/metadata/metadata.repository.ts b/server/src/domain/repositories/metadata.repository.ts similarity index 100% rename from server/src/domain/metadata/metadata.repository.ts rename to server/src/domain/repositories/metadata.repository.ts diff --git a/server/src/domain/partner/partner.repository.ts b/server/src/domain/repositories/partner.repository.ts similarity index 100% rename from server/src/domain/partner/partner.repository.ts rename to server/src/domain/repositories/partner.repository.ts diff --git a/server/src/domain/person/person.repository.ts b/server/src/domain/repositories/person.repository.ts similarity index 100% rename from server/src/domain/person/person.repository.ts rename to server/src/domain/repositories/person.repository.ts diff --git a/server/src/domain/search/search.repository.ts b/server/src/domain/repositories/search.repository.ts similarity index 100% rename from server/src/domain/search/search.repository.ts rename to server/src/domain/repositories/search.repository.ts diff --git a/server/src/domain/shared-link/shared-link.repository.ts b/server/src/domain/repositories/shared-link.repository.ts similarity index 100% rename from server/src/domain/shared-link/shared-link.repository.ts rename to server/src/domain/repositories/shared-link.repository.ts diff --git a/server/src/domain/smart-info/smart-info.repository.ts b/server/src/domain/repositories/smart-info.repository.ts similarity index 100% rename from server/src/domain/smart-info/smart-info.repository.ts rename to server/src/domain/repositories/smart-info.repository.ts diff --git a/server/src/domain/storage/storage.repository.ts b/server/src/domain/repositories/storage.repository.ts similarity index 100% rename from server/src/domain/storage/storage.repository.ts rename to server/src/domain/repositories/storage.repository.ts diff --git a/server/src/domain/system-config/system-config.repository.ts b/server/src/domain/repositories/system-config.repository.ts similarity index 100% rename from server/src/domain/system-config/system-config.repository.ts rename to server/src/domain/repositories/system-config.repository.ts diff --git a/server/src/domain/tag/tag.repository.ts b/server/src/domain/repositories/tag.repository.ts similarity index 100% rename from server/src/domain/tag/tag.repository.ts rename to server/src/domain/repositories/tag.repository.ts diff --git a/server/src/domain/auth/user-token.repository.ts b/server/src/domain/repositories/user-token.repository.ts similarity index 100% rename from server/src/domain/auth/user-token.repository.ts rename to server/src/domain/repositories/user-token.repository.ts diff --git a/server/src/domain/user/user.repository.ts b/server/src/domain/repositories/user.repository.ts similarity index 100% rename from server/src/domain/user/user.repository.ts rename to server/src/domain/repositories/user.repository.ts diff --git a/server/src/domain/search/index.ts b/server/src/domain/search/index.ts index 173a67d76f..717439d3cc 100644 --- a/server/src/domain/search/index.ts +++ b/server/src/domain/search/index.ts @@ -1,4 +1,3 @@ export * from './dto'; export * from './response-dto'; -export * from './search.repository'; export * from './search.service'; diff --git a/server/src/domain/search/search.service.spec.ts b/server/src/domain/search/search.service.spec.ts index 71c060bc5d..b655bbc61e 100644 --- a/server/src/domain/search/search.service.spec.ts +++ b/server/src/domain/search/search.service.spec.ts @@ -15,16 +15,18 @@ import { searchStub, } from '@test'; import { plainToInstance } from 'class-transformer'; -import { IAlbumRepository } from '../album/album.repository'; import { mapAsset } from '../asset'; -import { IAssetRepository } from '../asset/asset.repository'; import { JobName } from '../job'; -import { IJobRepository } from '../job/job.repository'; -import { IPersonRepository } from '../person/person.repository'; -import { IMachineLearningRepository } from '../smart-info'; -import { ISystemConfigRepository } from '../system-config'; +import { + IAlbumRepository, + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + IPersonRepository, + ISearchRepository, + ISystemConfigRepository, +} from '../repositories'; import { SearchDto } from './dto'; -import { ISearchRepository } from './search.repository'; import { SearchService } from './search.service'; jest.useFakeTimers(); diff --git a/server/src/domain/search/search.service.ts b/server/src/domain/search/search.service.ts index 1108977bad..049e0fe00a 100644 --- a/server/src/domain/search/search.service.ts +++ b/server/src/domain/search/search.service.ts @@ -1,25 +1,28 @@ import { AlbumEntity, AssetEntity, AssetFaceEntity } from '@app/infra/entities'; import { Inject, Injectable, Logger } from '@nestjs/common'; import { mapAlbumWithAssets } from '../album'; -import { IAlbumRepository } from '../album/album.repository'; import { AssetResponseDto, mapAsset } from '../asset'; -import { IAssetRepository } from '../asset/asset.repository'; import { AuthUserDto } from '../auth'; import { usePagination } from '../domain.util'; -import { IAssetFaceJob, IBulkEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; -import { AssetFaceId, IPersonRepository } from '../person'; -import { IMachineLearningRepository } from '../smart-info'; -import { FeatureFlag, ISystemConfigRepository, SystemConfigCore } from '../system-config'; -import { SearchDto } from './dto'; -import { SearchResponseDto } from './response-dto'; +import { IAssetFaceJob, IBulkEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; import { + AssetFaceId, + IAlbumRepository, + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + IPersonRepository, ISearchRepository, + ISystemConfigRepository, OwnedFaceEntity, SearchCollection, SearchExploreItem, SearchResult, SearchStrategy, -} from './search.repository'; +} from '../repositories'; +import { FeatureFlag, SystemConfigCore } from '../system-config'; +import { SearchDto } from './dto'; +import { SearchResponseDto } from './response-dto'; interface SyncQueue { upsert: Set; diff --git a/server/src/domain/server-info/server-info.service.spec.ts b/server/src/domain/server-info/server-info.service.spec.ts index b3db108829..53115594c9 100644 --- a/server/src/domain/server-info/server-info.service.spec.ts +++ b/server/src/domain/server-info/server-info.service.spec.ts @@ -1,8 +1,6 @@ import { newStorageRepositoryMock, newSystemConfigRepositoryMock, newUserRepositoryMock } from '@test'; import { serverVersion } from '../domain.constant'; -import { ISystemConfigRepository } from '../index'; -import { IStorageRepository } from '../storage'; -import { IUserRepository } from '../user'; +import { IStorageRepository, ISystemConfigRepository, IUserRepository } from '../repositories'; import { ServerInfoService } from './server-info.service'; describe(ServerInfoService.name, () => { diff --git a/server/src/domain/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts index d480def076..0d17ca3913 100644 --- a/server/src/domain/server-info/server-info.service.ts +++ b/server/src/domain/server-info/server-info.service.ts @@ -1,9 +1,9 @@ import { Inject, Injectable } from '@nestjs/common'; import { mimeTypes, serverVersion } from '../domain.constant'; import { asHumanReadable } from '../domain.util'; -import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; -import { ISystemConfigRepository, SystemConfigCore } from '../system-config'; -import { IUserRepository, UserStatsQueryResponse } from '../user'; +import { IStorageRepository, ISystemConfigRepository, IUserRepository, UserStatsQueryResponse } from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; +import { SystemConfigCore } from '../system-config'; import { ServerConfigDto, ServerFeaturesDto, diff --git a/server/src/domain/shared-link/index.ts b/server/src/domain/shared-link/index.ts index 78f9033464..0b47208507 100644 --- a/server/src/domain/shared-link/index.ts +++ b/server/src/domain/shared-link/index.ts @@ -1,4 +1,3 @@ export * from './shared-link-response.dto'; export * from './shared-link.dto'; -export * from './shared-link.repository'; export * from './shared-link.service'; diff --git a/server/src/domain/shared-link/shared-link.service.spec.ts b/server/src/domain/shared-link/shared-link.service.spec.ts index 3be71f919d..ae3a5a374a 100644 --- a/server/src/domain/shared-link/shared-link.service.spec.ts +++ b/server/src/domain/shared-link/shared-link.service.spec.ts @@ -1,3 +1,4 @@ +import { SharedLinkType } from '@app/infra/entities'; import { BadRequestException, ForbiddenException } from '@nestjs/common'; import { IAccessRepositoryMock, @@ -12,9 +13,8 @@ import { } from '@test'; import { when } from 'jest-when'; import _ from 'lodash'; -import { SharedLinkType } from '../../infra/entities/shared-link.entity'; -import { AssetIdErrorReason, ICryptoRepository } from '../index'; -import { ISharedLinkRepository } from './shared-link.repository'; +import { AssetIdErrorReason } from '../asset'; +import { ICryptoRepository, ISharedLinkRepository } from '../repositories'; import { SharedLinkService } from './shared-link.service'; describe(SharedLinkService.name, () => { diff --git a/server/src/domain/shared-link/shared-link.service.ts b/server/src/domain/shared-link/shared-link.service.ts index cdfcf01ccc..a3c19b8c40 100644 --- a/server/src/domain/shared-link/shared-link.service.ts +++ b/server/src/domain/shared-link/shared-link.service.ts @@ -1,12 +1,11 @@ import { AssetEntity, SharedLinkEntity, SharedLinkType } from '@app/infra/entities'; import { BadRequestException, ForbiddenException, Inject, Injectable } from '@nestjs/common'; -import { AccessCore, IAccessRepository, Permission } from '../access'; +import { AccessCore, Permission } from '../access'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto } from '../asset'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto'; +import { IAccessRepository, ICryptoRepository, ISharedLinkRepository } from '../repositories'; import { SharedLinkResponseDto, mapSharedLink, mapSharedLinkWithNoExif } from './shared-link-response.dto'; import { SharedLinkCreateDto, SharedLinkEditDto } from './shared-link.dto'; -import { ISharedLinkRepository } from './shared-link.repository'; @Injectable() export class SharedLinkService { diff --git a/server/src/domain/smart-info/dto/model-config.dto.ts b/server/src/domain/smart-info/dto/model-config.dto.ts index 3309ddfd93..3080da6232 100644 --- a/server/src/domain/smart-info/dto/model-config.dto.ts +++ b/server/src/domain/smart-info/dto/model-config.dto.ts @@ -2,7 +2,7 @@ import { ApiProperty } from '@nestjs/swagger'; import { Type } from 'class-transformer'; import { IsBoolean, IsEnum, IsNotEmpty, IsNumber, IsString, Max, Min } from 'class-validator'; import { Optional } from '../../domain.util'; -import { CLIPMode, ModelType } from '../machine-learning.interface'; +import { CLIPMode, ModelType } from '../../repositories'; export class ModelConfig { @IsBoolean() diff --git a/server/src/domain/smart-info/index.ts b/server/src/domain/smart-info/index.ts index b53b21428d..a0cbeecf4d 100644 --- a/server/src/domain/smart-info/index.ts +++ b/server/src/domain/smart-info/index.ts @@ -1,4 +1,2 @@ export * from './dto'; -export * from './machine-learning.interface'; -export * from './smart-info.repository'; export * from './smart-info.service'; diff --git a/server/src/domain/smart-info/smart-info.service.spec.ts b/server/src/domain/smart-info/smart-info.service.spec.ts index f6e20aa5f8..2a3dcd566a 100644 --- a/server/src/domain/smart-info/smart-info.service.spec.ts +++ b/server/src/domain/smart-info/smart-info.service.spec.ts @@ -7,11 +7,15 @@ import { newSmartInfoRepositoryMock, newSystemConfigRepositoryMock, } from '@test'; -import { IAssetRepository, WithoutProperty } from '../asset'; -import { IJobRepository, JobName } from '../job'; -import { ISystemConfigRepository } from '../system-config'; -import { IMachineLearningRepository } from './machine-learning.interface'; -import { ISmartInfoRepository } from './smart-info.repository'; +import { JobName } from '../job'; +import { + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + ISmartInfoRepository, + ISystemConfigRepository, + WithoutProperty, +} from '../repositories'; import { SmartInfoService } from './smart-info.service'; const asset = { diff --git a/server/src/domain/smart-info/smart-info.service.ts b/server/src/domain/smart-info/smart-info.service.ts index a490e19f3a..743e23b9f6 100644 --- a/server/src/domain/smart-info/smart-info.service.ts +++ b/server/src/domain/smart-info/smart-info.service.ts @@ -1,10 +1,15 @@ import { Inject, Injectable } from '@nestjs/common'; -import { IAssetRepository, WithoutProperty } from '../asset'; import { usePagination } from '../domain.util'; -import { IBaseJob, IEntityJob, IJobRepository, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; -import { ISystemConfigRepository, SystemConfigCore } from '../system-config'; -import { IMachineLearningRepository } from './machine-learning.interface'; -import { ISmartInfoRepository } from './smart-info.repository'; +import { IBaseJob, IEntityJob, JOBS_ASSET_PAGINATION_SIZE, JobName } from '../job'; +import { + IAssetRepository, + IJobRepository, + IMachineLearningRepository, + ISmartInfoRepository, + ISystemConfigRepository, + WithoutProperty, +} from '../repositories'; +import { SystemConfigCore } from '../system-config'; @Injectable() export class SmartInfoService { diff --git a/server/src/domain/storage-template/storage-template.service.spec.ts b/server/src/domain/storage-template/storage-template.service.spec.ts index f31edaf5df..f5a5a8b2a0 100644 --- a/server/src/domain/storage-template/storage-template.service.spec.ts +++ b/server/src/domain/storage-template/storage-template.service.spec.ts @@ -7,12 +7,9 @@ import { userStub, } from '@test'; import { when } from 'jest-when'; -import { StorageTemplateService } from '.'; -import { IAssetRepository } from '../asset'; -import { IStorageRepository } from '../storage/storage.repository'; -import { ISystemConfigRepository } from '../system-config'; +import { IAssetRepository, IStorageRepository, ISystemConfigRepository, IUserRepository } from '../repositories'; import { defaults } from '../system-config/system-config.core'; -import { IUserRepository } from '../user'; +import { StorageTemplateService } from './storage-template.service'; describe(StorageTemplateService.name, () => { let sut: StorageTemplateService; diff --git a/server/src/domain/storage-template/storage-template.service.ts b/server/src/domain/storage-template/storage-template.service.ts index 789c91d4d8..60439c575a 100644 --- a/server/src/domain/storage-template/storage-template.service.ts +++ b/server/src/domain/storage-template/storage-template.service.ts @@ -4,13 +4,12 @@ import handlebar from 'handlebars'; import * as luxon from 'luxon'; import path from 'node:path'; import sanitize from 'sanitize-filename'; -import { IAssetRepository } from '../asset/asset.repository'; import { getLivePhotoMotionFilename, usePagination } from '../domain.util'; import { IEntityJob, JOBS_ASSET_PAGINATION_SIZE } from '../job'; -import { IStorageRepository, StorageCore, StorageFolder } from '../storage'; +import { IAssetRepository, IStorageRepository, ISystemConfigRepository, IUserRepository } from '../repositories'; +import { StorageCore, StorageFolder } from '../storage'; import { INITIAL_SYSTEM_CONFIG, - ISystemConfigRepository, supportedDayTokens, supportedHourTokens, supportedMinuteTokens, @@ -20,7 +19,6 @@ import { supportedYearTokens, } from '../system-config'; import { SystemConfigCore } from '../system-config/system-config.core'; -import { IUserRepository } from '../user/user.repository'; export interface MoveAssetMetadata { storageLabel: string | null; diff --git a/server/src/domain/storage/index.ts b/server/src/domain/storage/index.ts index 7a28d7af8f..bdea086bd0 100644 --- a/server/src/domain/storage/index.ts +++ b/server/src/domain/storage/index.ts @@ -1,3 +1,2 @@ export * from './storage.core'; -export * from './storage.repository'; export * from './storage.service'; diff --git a/server/src/domain/storage/storage.core.ts b/server/src/domain/storage/storage.core.ts index 40f05a1867..15bdd04051 100644 --- a/server/src/domain/storage/storage.core.ts +++ b/server/src/domain/storage/storage.core.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; import { APP_MEDIA_LOCATION } from '../domain.constant'; -import { IStorageRepository } from './storage.repository'; +import { IStorageRepository } from '../repositories'; export enum StorageFolder { ENCODED_VIDEO = 'encoded-video', diff --git a/server/src/domain/storage/storage.service.spec.ts b/server/src/domain/storage/storage.service.spec.ts index e2a114b769..0c5531e5f6 100644 --- a/server/src/domain/storage/storage.service.spec.ts +++ b/server/src/domain/storage/storage.service.spec.ts @@ -1,5 +1,5 @@ import { newStorageRepositoryMock } from '@test'; -import { IStorageRepository } from '.'; +import { IStorageRepository } from '../repositories'; import { StorageService } from './storage.service'; describe(StorageService.name, () => { diff --git a/server/src/domain/storage/storage.service.ts b/server/src/domain/storage/storage.service.ts index d53449b08a..001c0c869e 100644 --- a/server/src/domain/storage/storage.service.ts +++ b/server/src/domain/storage/storage.service.ts @@ -1,7 +1,7 @@ import { Inject, Injectable, Logger } from '@nestjs/common'; import { IDeleteFilesJob } from '../job'; +import { IStorageRepository } from '../repositories'; import { StorageCore, StorageFolder } from './storage.core'; -import { IStorageRepository } from './storage.repository'; @Injectable() export class StorageService { diff --git a/server/src/domain/system-config/index.ts b/server/src/domain/system-config/index.ts index da270886b0..fb71613dd8 100644 --- a/server/src/domain/system-config/index.ts +++ b/server/src/domain/system-config/index.ts @@ -2,5 +2,4 @@ export * from './dto'; export * from './response-dto'; export * from './system-config.constants'; export * from './system-config.core'; -export * from './system-config.repository'; export * from './system-config.service'; diff --git a/server/src/domain/system-config/system-config.core.ts b/server/src/domain/system-config/system-config.core.ts index a97636e01c..428e29e50a 100644 --- a/server/src/domain/system-config/system-config.core.ts +++ b/server/src/domain/system-config/system-config.core.ts @@ -19,8 +19,8 @@ import * as _ from 'lodash'; import { Subject } from 'rxjs'; import { DeepPartial } from 'typeorm'; import { QueueName } from '../job/job.constants'; +import { ISystemConfigRepository } from '../repositories'; import { SystemConfigDto } from './dto'; -import { ISystemConfigRepository } from './system-config.repository'; export type SystemConfigValidator = (config: SystemConfig) => void | Promise; diff --git a/server/src/domain/system-config/system-config.service.spec.ts b/server/src/domain/system-config/system-config.service.spec.ts index 6f97c02f39..f82b38b475 100644 --- a/server/src/domain/system-config/system-config.service.spec.ts +++ b/server/src/domain/system-config/system-config.service.spec.ts @@ -13,10 +13,9 @@ import { } from '@app/infra/entities'; import { BadRequestException } from '@nestjs/common'; import { newCommunicationRepositoryMock, newJobRepositoryMock, newSystemConfigRepositoryMock } from '@test'; -import { ICommunicationRepository } from '../communication'; -import { IJobRepository, JobName, QueueName } from '../job'; +import { JobName, QueueName } from '../job'; +import { ICommunicationRepository, IJobRepository, ISystemConfigRepository } from '../repositories'; import { SystemConfigValidator, defaults } from './system-config.core'; -import { ISystemConfigRepository } from './system-config.repository'; import { SystemConfigService } from './system-config.service'; const updates: SystemConfigEntity[] = [ diff --git a/server/src/domain/system-config/system-config.service.ts b/server/src/domain/system-config/system-config.service.ts index 6d8e7be337..610a1dc298 100644 --- a/server/src/domain/system-config/system-config.service.ts +++ b/server/src/domain/system-config/system-config.service.ts @@ -1,7 +1,6 @@ import { Inject, Injectable } from '@nestjs/common'; -import { ISystemConfigRepository } from '.'; -import { CommunicationEvent, ICommunicationRepository } from '../communication'; -import { IJobRepository, JobName } from '../job'; +import { JobName } from '../job'; +import { CommunicationEvent, ICommunicationRepository, IJobRepository, ISystemConfigRepository } from '../repositories'; import { SystemConfigDto, mapConfig } from './dto/system-config.dto'; import { SystemConfigTemplateStorageOptionDto } from './response-dto/system-config-template-storage-option.dto'; import { diff --git a/server/src/domain/tag/index.ts b/server/src/domain/tag/index.ts index 0ea02172e1..38e9b389f8 100644 --- a/server/src/domain/tag/index.ts +++ b/server/src/domain/tag/index.ts @@ -1,4 +1,3 @@ export * from './tag-response.dto'; export * from './tag.dto'; -export * from './tag.repository'; export * from './tag.service'; diff --git a/server/src/domain/tag/tag.service.spec.ts b/server/src/domain/tag/tag.service.spec.ts index cc37b9c687..bb03f88f6d 100644 --- a/server/src/domain/tag/tag.service.spec.ts +++ b/server/src/domain/tag/tag.service.spec.ts @@ -3,7 +3,7 @@ import { BadRequestException } from '@nestjs/common'; import { assetStub, authStub, newTagRepositoryMock, tagResponseStub, tagStub } from '@test'; import { when } from 'jest-when'; import { AssetIdErrorReason } from '../asset'; -import { ITagRepository } from './tag.repository'; +import { ITagRepository } from '../repositories'; import { TagService } from './tag.service'; describe(TagService.name, () => { diff --git a/server/src/domain/tag/tag.service.ts b/server/src/domain/tag/tag.service.ts index 585fa4fa83..cf4bffdaa8 100644 --- a/server/src/domain/tag/tag.service.ts +++ b/server/src/domain/tag/tag.service.ts @@ -1,9 +1,9 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { AssetIdErrorReason, AssetIdsDto, AssetIdsResponseDto, AssetResponseDto, mapAsset } from '../asset'; import { AuthUserDto } from '../auth'; +import { ITagRepository } from '../repositories'; import { TagResponseDto, mapTag } from './tag-response.dto'; import { CreateTagDto, UpdateTagDto } from './tag.dto'; -import { ITagRepository } from './tag.repository'; @Injectable() export class TagService { diff --git a/server/src/domain/user/index.ts b/server/src/domain/user/index.ts index 8c14adf5f6..7248591973 100644 --- a/server/src/domain/user/index.ts +++ b/server/src/domain/user/index.ts @@ -1,5 +1,4 @@ export * from './dto'; export * from './response-dto'; export * from './user.core'; -export * from './user.repository'; export * from './user.service'; diff --git a/server/src/domain/user/user.core.ts b/server/src/domain/user/user.core.ts index 44d977b750..2597a2441e 100644 --- a/server/src/domain/user/user.core.ts +++ b/server/src/domain/user/user.core.ts @@ -11,9 +11,7 @@ import fs from 'fs/promises'; import path from 'path'; import sanitize from 'sanitize-filename'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto'; -import { ILibraryRepository } from '../library/library.repository'; -import { IUserRepository, UserListFilter } from './user.repository'; +import { ICryptoRepository, ILibraryRepository, IUserRepository, UserListFilter } from '../repositories'; const SALT_ROUNDS = 10; diff --git a/server/src/domain/user/user.service.spec.ts b/server/src/domain/user/user.service.spec.ts index 17b2f09405..d93bc66774 100644 --- a/server/src/domain/user/user.service.spec.ts +++ b/server/src/domain/user/user.service.spec.ts @@ -16,16 +16,19 @@ import { userStub, } from '@test'; import { when } from 'jest-when'; -import { IAlbumRepository } from '../album'; -import { IAssetRepository } from '../asset'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto'; -import { IJobRepository, JobName } from '../job'; -import { ILibraryRepository } from '../library'; -import { IStorageRepository } from '../storage'; +import { JobName } from '../job'; +import { + IAlbumRepository, + IAssetRepository, + ICryptoRepository, + IJobRepository, + ILibraryRepository, + IStorageRepository, + IUserRepository, +} from '../repositories'; import { UpdateUserDto } from './dto/update-user.dto'; import { UserResponseDto, mapUser } from './response-dto'; -import { IUserRepository } from './user.repository'; import { UserService } from './user.service'; const makeDeletedAt = (daysAgo: number) => { diff --git a/server/src/domain/user/user.service.ts b/server/src/domain/user/user.service.ts index dac75044a3..80be378e40 100644 --- a/server/src/domain/user/user.service.ts +++ b/server/src/domain/user/user.service.ts @@ -2,14 +2,18 @@ import { UserEntity } from '@app/infra/entities'; import { BadRequestException, Inject, Injectable, Logger, NotFoundException } from '@nestjs/common'; import { randomBytes } from 'crypto'; import { ReadStream } from 'fs'; -import { IAlbumRepository } from '../album/album.repository'; -import { IAssetRepository } from '../asset/asset.repository'; import { AuthUserDto } from '../auth'; -import { ICryptoRepository } from '../crypto/crypto.repository'; -import { IEntityJob, IJobRepository, JobName } from '../job'; -import { ILibraryRepository } from '../library/library.repository'; +import { IEntityJob, JobName } from '../job'; +import { + IAlbumRepository, + IAssetRepository, + ICryptoRepository, + IJobRepository, + ILibraryRepository, + IStorageRepository, + IUserRepository, +} from '../repositories'; import { StorageCore, StorageFolder } from '../storage'; -import { IStorageRepository } from '../storage/storage.repository'; import { CreateUserDto, UpdateUserDto, UserCountDto } from './dto'; import { CreateProfileImageResponseDto, @@ -20,7 +24,6 @@ import { mapUserCountResponse, } from './response-dto'; import { UserCore } from './user.core'; -import { IUserRepository } from './user.repository'; @Injectable() export class UserService {