diff --git a/server/src/domain/access/access.core.ts b/server/src/cores/access.core.ts similarity index 100% rename from server/src/domain/access/access.core.ts rename to server/src/cores/access.core.ts diff --git a/server/src/domain/storage/storage.core.ts b/server/src/cores/storage.core.ts similarity index 99% rename from server/src/domain/storage/storage.core.ts rename to server/src/cores/storage.core.ts index 1768227eaf..4e501dd834 100644 --- a/server/src/domain/storage/storage.core.ts +++ b/server/src/cores/storage.core.ts @@ -1,4 +1,5 @@ import { dirname, join, resolve } from 'node:path'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { APP_MEDIA_LOCATION } from 'src/domain/domain.constant'; import { IAssetRepository } from 'src/domain/repositories/asset.repository'; import { ICryptoRepository } from 'src/domain/repositories/crypto.repository'; @@ -6,7 +7,6 @@ import { IMoveRepository } from 'src/domain/repositories/move.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetEntity } from 'src/infra/entities/asset.entity'; import { AssetPathType, PathType, PersonPathType } from 'src/infra/entities/move.entity'; import { PersonEntity } from 'src/infra/entities/person.entity'; diff --git a/server/src/domain/system-config/system-config.core.ts b/server/src/cores/system-config.core.ts similarity index 100% rename from server/src/domain/system-config/system-config.core.ts rename to server/src/cores/system-config.core.ts diff --git a/server/src/domain/user/user.core.ts b/server/src/cores/user.core.ts similarity index 100% rename from server/src/domain/user/user.core.ts rename to server/src/cores/user.core.ts diff --git a/server/src/domain/activity/activity.service.ts b/server/src/domain/activity/activity.service.ts index f8727141c5..cc1fef2c13 100644 --- a/server/src/domain/activity/activity.service.ts +++ b/server/src/domain/activity/activity.service.ts @@ -1,5 +1,5 @@ import { Inject, Injectable } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { ActivityCreateDto, ActivityDto, diff --git a/server/src/domain/album/album.service.ts b/server/src/domain/album/album.service.ts index d54680fe42..5cd026cb34 100644 --- a/server/src/domain/album/album.service.ts +++ b/server/src/domain/album/album.service.ts @@ -1,5 +1,5 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { AlbumCountResponseDto, AlbumResponseDto, diff --git a/server/src/domain/asset/asset.service.ts b/server/src/domain/asset/asset.service.ts index 2d514a9371..d6d2d76fbd 100644 --- a/server/src/domain/asset/asset.service.ts +++ b/server/src/domain/asset/asset.service.ts @@ -3,7 +3,9 @@ import _ from 'lodash'; import { DateTime, Duration } from 'luxon'; import { extname } from 'node:path'; import sanitize from 'sanitize-filename'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { AssetJobName, AssetJobsDto } from 'src/domain/asset/dto/asset-ids.dto'; import { UpdateStackParentDto } from 'src/domain/asset/dto/asset-stack.dto'; import { AssetStatsDto, mapStats } from 'src/domain/asset/dto/asset-statistics.dto'; @@ -32,8 +34,6 @@ import { IPartnerRepository } from 'src/domain/repositories/partner.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; import { IUserRepository } from 'src/domain/repositories/user.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetEntity } from 'src/infra/entities/asset.entity'; import { LibraryType } from 'src/infra/entities/library.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/audit/audit.service.ts b/server/src/domain/audit/audit.service.ts index c72d1d8cf1..d375aa082e 100644 --- a/server/src/domain/audit/audit.service.ts +++ b/server/src/domain/audit/audit.service.ts @@ -1,7 +1,8 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { DateTime } from 'luxon'; import { resolve } from 'node:path'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; import { AuditDeletesDto, AuditDeletesResponseDto, @@ -21,7 +22,6 @@ import { JobStatus } from 'src/domain/repositories/job.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { IUserRepository } from 'src/domain/repositories/user.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; import { DatabaseAction } from 'src/infra/entities/audit.entity'; import { AssetPathType, PersonPathType, UserPathType } from 'src/infra/entities/move.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/auth/auth.service.ts b/server/src/domain/auth/auth.service.ts index e66a6d0d70..bad5780139 100644 --- a/server/src/domain/auth/auth.service.ts +++ b/server/src/domain/auth/auth.service.ts @@ -10,7 +10,9 @@ import cookieParser from 'cookie'; import { DateTime } from 'luxon'; import { IncomingHttpHeaders } from 'node:http'; import { ClientMetadata, Issuer, UserinfoResponse, custom, generators } from 'openid-client'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; +import { UserCore } from 'src/cores/user.core'; import { AuthType, IMMICH_ACCESS_COOKIE, @@ -42,9 +44,7 @@ import { ISharedLinkRepository } from 'src/domain/repositories/shared-link.repos import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; import { IUserTokenRepository } from 'src/domain/repositories/user-token.repository'; import { IUserRepository } from 'src/domain/repositories/user.repository'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto'; -import { UserCore } from 'src/domain/user/user.core'; import { SystemConfig } from 'src/infra/entities/system-config.entity'; import { UserEntity } from 'src/infra/entities/user.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/download/download.service.ts b/server/src/domain/download/download.service.ts index 13f513c9be..7a0fc2ca61 100644 --- a/server/src/domain/download/download.service.ts +++ b/server/src/domain/download/download.service.ts @@ -1,6 +1,6 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { parse } from 'node:path'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { AssetIdsDto } from 'src/domain/asset/dto/asset-ids.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { mimeTypes } from 'src/domain/domain.constant'; diff --git a/server/src/domain/job/job.service.spec.ts b/server/src/domain/job/job.service.spec.ts index 7fc8cc86ee..2dee51cd66 100644 --- a/server/src/domain/job/job.service.spec.ts +++ b/server/src/domain/job/job.service.spec.ts @@ -1,4 +1,5 @@ import { BadRequestException } from '@nestjs/common'; +import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core'; import { JobCommand, JobName, QueueName } from 'src/domain/job/job.constants'; import { JobService } from 'src/domain/job/job.service'; import { IAssetRepository } from 'src/domain/repositories/asset.repository'; @@ -6,7 +7,6 @@ import { ICommunicationRepository } from 'src/domain/repositories/communication. import { IJobRepository, JobHandler, JobItem, JobStatus } from 'src/domain/repositories/job.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { FeatureFlag, SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { SystemConfig, SystemConfigKey } from 'src/infra/entities/system-config.entity'; import { assetStub } from 'test/fixtures/asset.stub'; import { newAssetRepositoryMock } from 'test/repositories/asset.repository.mock'; diff --git a/server/src/domain/job/job.service.ts b/server/src/domain/job/job.service.ts index bccb897d31..b50d26de41 100644 --- a/server/src/domain/job/job.service.ts +++ b/server/src/domain/job/job.service.ts @@ -1,4 +1,5 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; +import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core'; import { mapAsset } from 'src/domain/asset/response-dto/asset-response.dto'; import { ConcurrentQueueName, JobCommand, JobName, QueueName } from 'src/domain/job/job.constants'; import { AllJobStatusResponseDto, JobCommandDto, JobStatusDto } from 'src/domain/job/job.dto'; @@ -7,7 +8,6 @@ import { ClientEvent, ICommunicationRepository } from 'src/domain/repositories/c import { IJobRepository, JobHandler, JobItem, JobStatus, QueueCleanType } from 'src/domain/repositories/job.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { FeatureFlag, SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetType } from 'src/infra/entities/asset.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/library/library.service.spec.ts b/server/src/domain/library/library.service.spec.ts index bfa3102d97..c1f2cc38c9 100644 --- a/server/src/domain/library/library.service.spec.ts +++ b/server/src/domain/library/library.service.spec.ts @@ -2,6 +2,7 @@ import { BadRequestException } from '@nestjs/common'; import { when } from 'jest-when'; import { R_OK } from 'node:constants'; import { Stats } from 'node:fs'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { JobName } from 'src/domain/job/job.constants'; import { ILibraryFileJob, ILibraryRefreshJob } from 'src/domain/job/job.interface'; import { mapLibrary } from 'src/domain/library/library.dto'; @@ -13,7 +14,6 @@ import { IJobRepository, JobStatus } from 'src/domain/repositories/job.repositor import { ILibraryRepository } from 'src/domain/repositories/library.repository'; import { IStorageRepository, StorageEventType } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetType } from 'src/infra/entities/asset.entity'; import { LibraryType } from 'src/infra/entities/library.entity'; import { SystemConfig, SystemConfigKey } from 'src/infra/entities/system-config.entity'; diff --git a/server/src/domain/library/library.service.ts b/server/src/domain/library/library.service.ts index 46b4d11f5b..30b1d19757 100644 --- a/server/src/domain/library/library.service.ts +++ b/server/src/domain/library/library.service.ts @@ -6,6 +6,8 @@ import { EventEmitter } from 'node:events'; import { Stats } from 'node:fs'; import path, { basename, parse } from 'node:path'; import picomatch from 'picomatch'; +import { StorageCore } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { mimeTypes } from 'src/domain/domain.constant'; import { JOBS_ASSET_PAGINATION_SIZE, JobName } from 'src/domain/job/job.constants'; import { IBaseJob, IEntityJob, ILibraryFileJob, ILibraryRefreshJob } from 'src/domain/job/job.interface'; @@ -29,8 +31,6 @@ import { IJobRepository, JobStatus } from 'src/domain/repositories/job.repositor import { ILibraryRepository } from 'src/domain/repositories/library.repository'; import { IStorageRepository, StorageEventType } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { StorageCore } from 'src/domain/storage/storage.core'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetType } from 'src/infra/entities/asset.entity'; import { LibraryEntity, LibraryType } from 'src/infra/entities/library.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/media/media.service.ts b/server/src/domain/media/media.service.ts index f06f9ed28d..8678203d71 100644 --- a/server/src/domain/media/media.service.ts +++ b/server/src/domain/media/media.service.ts @@ -1,4 +1,6 @@ import { Inject, Injectable, UnsupportedMediaTypeException } from '@nestjs/common'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from 'src/domain/job/job.constants'; import { IBaseJob, IEntityJob } from 'src/domain/job/job.interface'; import { @@ -24,9 +26,7 @@ import { IMoveRepository } from 'src/domain/repositories/move.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; import { SystemConfigFFmpegDto } from 'src/domain/system-config/dto/system-config-ffmpeg.dto'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity'; import { AssetPathType } from 'src/infra/entities/move.entity'; import { diff --git a/server/src/domain/metadata/metadata.service.ts b/server/src/domain/metadata/metadata.service.ts index 360f916acb..68b813eae6 100644 --- a/server/src/domain/metadata/metadata.service.ts +++ b/server/src/domain/metadata/metadata.service.ts @@ -6,6 +6,8 @@ import { Duration } from 'luxon'; import { constants } from 'node:fs/promises'; import path from 'node:path'; import { Subscription } from 'rxjs'; +import { StorageCore } from 'src/cores/storage.core'; +import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core'; import { JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from 'src/domain/job/job.constants'; import { IBaseJob, IEntityJob, ISidecarWriteJob } from 'src/domain/job/job.interface'; import { IAlbumRepository } from 'src/domain/repositories/album.repository'; @@ -20,8 +22,6 @@ import { IMoveRepository } from 'src/domain/repositories/move.repository'; import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { StorageCore } from 'src/domain/storage/storage.core'; -import { FeatureFlag, SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity'; import { ExifEntity } from 'src/infra/entities/exif.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/partner/partner.service.ts b/server/src/domain/partner/partner.service.ts index 74cafbcbae..9bf305b2b4 100644 --- a/server/src/domain/partner/partner.service.ts +++ b/server/src/domain/partner/partner.service.ts @@ -1,5 +1,5 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { PartnerResponseDto, UpdatePartnerDto } from 'src/domain/partner/partner.dto'; import { IAccessRepository } from 'src/domain/repositories/access.repository'; diff --git a/server/src/domain/person/person.service.ts b/server/src/domain/person/person.service.ts index 46538e04f3..62b13452a4 100644 --- a/server/src/domain/person/person.service.ts +++ b/server/src/domain/person/person.service.ts @@ -1,5 +1,7 @@ import { BadRequestException, Inject, Injectable, NotFoundException } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; +import { StorageCore } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { BulkIdErrorReason, BulkIdResponseDto } from 'src/domain/asset/response-dto/asset-ids-response.dto'; import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-response.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; @@ -33,8 +35,6 @@ import { IPersonRepository, UpdateFacesData } from 'src/domain/repositories/pers import { ISearchRepository } from 'src/domain/repositories/search.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { StorageCore } from 'src/domain/storage/storage.core'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { PersonPathType } from 'src/infra/entities/move.entity'; import { PersonEntity } from 'src/infra/entities/person.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/search/search.service.ts b/server/src/domain/search/search.service.ts index bb7e31bfaf..ae8738cb66 100644 --- a/server/src/domain/search/search.service.ts +++ b/server/src/domain/search/search.service.ts @@ -1,4 +1,5 @@ import { Inject, Injectable } from '@nestjs/common'; +import { FeatureFlag, SystemConfigCore } from 'src/cores/system-config.core'; import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-response.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { PersonResponseDto } from 'src/domain/person/person.dto'; @@ -20,7 +21,6 @@ import { mapPlaces, } from 'src/domain/search/dto/search.dto'; import { SearchResponseDto } from 'src/domain/search/response-dto/search-response.dto'; -import { FeatureFlag, SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetOrder } from 'src/infra/entities/album.entity'; import { AssetEntity } from 'src/infra/entities/asset.entity'; diff --git a/server/src/domain/server-info/server-info.dto.ts b/server/src/domain/server-info/server-info.dto.ts index 07f99a874d..0cbfbe773d 100644 --- a/server/src/domain/server-info/server-info.dto.ts +++ b/server/src/domain/server-info/server-info.dto.ts @@ -1,8 +1,8 @@ import { ApiProperty, ApiResponseProperty } from '@nestjs/swagger'; import type { DateTime } from 'luxon'; +import { FeatureFlags } from 'src/cores/system-config.core'; import { IVersion, VersionType } from 'src/domain/domain.constant'; import { SystemConfigThemeDto } from 'src/domain/system-config/dto/system-config-theme.dto'; -import { FeatureFlags } from 'src/domain/system-config/system-config.core'; export class ServerPingResponse { @ApiResponseProperty({ type: String, example: 'pong' }) diff --git a/server/src/domain/server-info/server-info.service.ts b/server/src/domain/server-info/server-info.service.ts index 3ceb3039d9..9e72c71085 100644 --- a/server/src/domain/server-info/server-info.service.ts +++ b/server/src/domain/server-info/server-info.service.ts @@ -1,5 +1,7 @@ import { Inject, Injectable } from '@nestjs/common'; import { DateTime } from 'luxon'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { Version, isDev, mimeTypes, serverVersion } from 'src/domain/domain.constant'; import { ClientEvent, ICommunicationRepository } from 'src/domain/repositories/communication.repository'; import { IServerInfoRepository } from 'src/domain/repositories/server-info.repository'; @@ -16,8 +18,6 @@ import { ServerStatsResponseDto, UsageByUserDto, } from 'src/domain/server-info/server-info.dto'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { SystemMetadataKey } from 'src/infra/entities/system-metadata.entity'; import { ImmichLogger } from 'src/infra/logger'; import { asHumanReadable } from 'src/utils'; diff --git a/server/src/domain/shared-link/shared-link.service.ts b/server/src/domain/shared-link/shared-link.service.ts index b550854922..a62acb6bf4 100644 --- a/server/src/domain/shared-link/shared-link.service.ts +++ b/server/src/domain/shared-link/shared-link.service.ts @@ -1,5 +1,5 @@ import { BadRequestException, ForbiddenException, Inject, Injectable, UnauthorizedException } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { AssetIdsDto } from 'src/domain/asset/dto/asset-ids.dto'; import { AssetIdErrorReason, AssetIdsResponseDto } from 'src/domain/asset/response-dto/asset-ids-response.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; diff --git a/server/src/domain/smart-info/smart-info.service.ts b/server/src/domain/smart-info/smart-info.service.ts index fdf9862f8c..333c8faaf2 100644 --- a/server/src/domain/smart-info/smart-info.service.ts +++ b/server/src/domain/smart-info/smart-info.service.ts @@ -1,4 +1,5 @@ import { Inject, Injectable } from '@nestjs/common'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { JOBS_ASSET_PAGINATION_SIZE, JobName, QueueName } from 'src/domain/job/job.constants'; import { IBaseJob, IEntityJob } from 'src/domain/job/job.interface'; import { IAssetRepository, WithoutProperty } from 'src/domain/repositories/asset.repository'; @@ -7,7 +8,6 @@ import { IJobRepository, JobStatus } from 'src/domain/repositories/job.repositor import { IMachineLearningRepository } from 'src/domain/repositories/machine-learning.repository'; import { ISearchRepository } from 'src/domain/repositories/search.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { ImmichLogger } from 'src/infra/logger'; import { usePagination } from 'src/utils'; 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 f737090350..ce378bf9b7 100644 --- a/server/src/domain/storage-template/storage-template.service.spec.ts +++ b/server/src/domain/storage-template/storage-template.service.spec.ts @@ -1,5 +1,6 @@ import { when } from 'jest-when'; import { Stats } from 'node:fs'; +import { SystemConfigCore, defaults } from 'src/cores/system-config.core'; import { IAlbumRepository } from 'src/domain/repositories/album.repository'; import { IAssetRepository } from 'src/domain/repositories/asset.repository'; import { ICryptoRepository } from 'src/domain/repositories/crypto.repository'; @@ -11,7 +12,6 @@ import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; import { IUserRepository } from 'src/domain/repositories/user.repository'; import { StorageTemplateService } from 'src/domain/storage-template/storage-template.service'; -import { SystemConfigCore, defaults } from 'src/domain/system-config/system-config.core'; import { AssetPathType } from 'src/infra/entities/move.entity'; import { SystemConfig, SystemConfigKey } from 'src/infra/entities/system-config.entity'; import { assetStub } from 'test/fixtures/asset.stub'; diff --git a/server/src/domain/storage-template/storage-template.service.ts b/server/src/domain/storage-template/storage-template.service.ts index f3e24c056d..b79426b1f7 100644 --- a/server/src/domain/storage-template/storage-template.service.ts +++ b/server/src/domain/storage-template/storage-template.service.ts @@ -4,6 +4,8 @@ import handlebar from 'handlebars'; import { DateTime } from 'luxon'; import path from 'node:path'; import sanitize from 'sanitize-filename'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { JOBS_ASSET_PAGINATION_SIZE } from 'src/domain/job/job.constants'; import { IEntityJob } from 'src/domain/job/job.interface'; import { IAlbumRepository } from 'src/domain/repositories/album.repository'; @@ -17,7 +19,6 @@ import { IPersonRepository } from 'src/domain/repositories/person.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; import { IUserRepository } from 'src/domain/repositories/user.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; import { supportedDayTokens, supportedHourTokens, @@ -27,7 +28,6 @@ import { supportedWeekTokens, supportedYearTokens, } from 'src/domain/system-config/system-config.constants'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity'; import { AssetPathType } from 'src/infra/entities/move.entity'; import { SystemConfig } from 'src/infra/entities/system-config.entity'; diff --git a/server/src/domain/storage/storage.service.ts b/server/src/domain/storage/storage.service.ts index 08010231e6..5c75a99219 100644 --- a/server/src/domain/storage/storage.service.ts +++ b/server/src/domain/storage/storage.service.ts @@ -1,8 +1,8 @@ import { Inject, Injectable } from '@nestjs/common'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; import { IDeleteFilesJob } from 'src/domain/job/job.interface'; import { JobStatus } from 'src/domain/repositories/job.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; import { ImmichLogger } from 'src/infra/logger'; @Injectable() 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 ccaea8421c..4eb1619ee2 100644 --- a/server/src/domain/system-config/system-config.service.spec.ts +++ b/server/src/domain/system-config/system-config.service.spec.ts @@ -1,9 +1,9 @@ import { BadRequestException } from '@nestjs/common'; +import { defaults } from 'src/cores/system-config.core'; import { QueueName } from 'src/domain/job/job.constants'; import { ICommunicationRepository, ServerEvent } from 'src/domain/repositories/communication.repository'; import { ISearchRepository } from 'src/domain/repositories/search.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { defaults } from 'src/domain/system-config/system-config.core'; import { SystemConfigService } from 'src/domain/system-config/system-config.service'; import { AudioCodec, diff --git a/server/src/domain/system-config/system-config.service.ts b/server/src/domain/system-config/system-config.service.ts index 2c4e1eacce..856e80d498 100644 --- a/server/src/domain/system-config/system-config.service.ts +++ b/server/src/domain/system-config/system-config.service.ts @@ -2,6 +2,7 @@ import { BadRequestException, Inject, Injectable } from '@nestjs/common'; import { OnEvent } from '@nestjs/event-emitter'; import { instanceToPlain } from 'class-transformer'; import _ from 'lodash'; +import { SystemConfigCore } from 'src/cores/system-config.core'; import { ClientEvent, ICommunicationRepository, @@ -23,7 +24,6 @@ import { supportedWeekTokens, supportedYearTokens, } from 'src/domain/system-config/system-config.constants'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { LogLevel, SystemConfig } from 'src/infra/entities/system-config.entity'; import { ImmichLogger } from 'src/infra/logger'; diff --git a/server/src/domain/trash/trash.service.ts b/server/src/domain/trash/trash.service.ts index aa95a48897..2ae09c1049 100644 --- a/server/src/domain/trash/trash.service.ts +++ b/server/src/domain/trash/trash.service.ts @@ -1,6 +1,6 @@ import { Inject } from '@nestjs/common'; import { DateTime } from 'luxon'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { BulkIdsDto } from 'src/domain/asset/response-dto/asset-ids-response.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { JOBS_ASSET_PAGINATION_SIZE, JobName } from 'src/domain/job/job.constants'; diff --git a/server/src/domain/user/user.service.ts b/server/src/domain/user/user.service.ts index 6eca5ff559..022b93492e 100644 --- a/server/src/domain/user/user.service.ts +++ b/server/src/domain/user/user.service.ts @@ -1,6 +1,9 @@ import { BadRequestException, ForbiddenException, Inject, Injectable, NotFoundException } from '@nestjs/common'; import { DateTime } from 'luxon'; import { randomBytes } from 'node:crypto'; +import { StorageCore, StorageFolder } from 'src/cores/storage.core'; +import { SystemConfigCore } from 'src/cores/system-config.core'; +import { UserCore } from 'src/cores/user.core'; import { AuthDto } from 'src/domain/auth/auth.dto'; import { JobName } from 'src/domain/job/job.constants'; import { IEntityJob } from 'src/domain/job/job.interface'; @@ -11,8 +14,6 @@ import { ILibraryRepository } from 'src/domain/repositories/library.repository'; import { IStorageRepository } from 'src/domain/repositories/storage.repository'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; import { IUserRepository, UserFindOptions } from 'src/domain/repositories/user.repository'; -import { StorageCore, StorageFolder } from 'src/domain/storage/storage.core'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; import { CreateUserDto } from 'src/domain/user/dto/create-user.dto'; import { DeleteUserDto } from 'src/domain/user/dto/delete-user.dto'; import { UpdateUserDto } from 'src/domain/user/dto/update-user.dto'; @@ -21,7 +22,6 @@ import { mapCreateProfileImageResponse, } from 'src/domain/user/response-dto/create-profile-image-response.dto'; import { UserResponseDto, mapUser } from 'src/domain/user/response-dto/user-response.dto'; -import { UserCore } from 'src/domain/user/user.core'; import { UserEntity, UserStatus } from 'src/infra/entities/user.entity'; import { ImmichLogger } from 'src/infra/logger'; import { CacheControl, ImmichFileResponse } from 'src/utils'; diff --git a/server/src/immich/api-v1/asset/asset.service.ts b/server/src/immich/api-v1/asset/asset.service.ts index 613e8f2ed4..aa157aaed0 100644 --- a/server/src/immich/api-v1/asset/asset.service.ts +++ b/server/src/immich/api-v1/asset/asset.service.ts @@ -5,7 +5,7 @@ import { InternalServerErrorException, NotFoundException, } from '@nestjs/common'; -import { AccessCore, Permission } from 'src/domain/access/access.core'; +import { AccessCore, Permission } from 'src/cores/access.core'; import { UploadFile } from 'src/domain/asset/asset.service'; import { AssetResponseDto, mapAsset } from 'src/domain/asset/response-dto/asset-response.dto'; import { AuthDto } from 'src/domain/auth/auth.dto'; diff --git a/server/test/fixtures/library.stub.ts b/server/test/fixtures/library.stub.ts index d112d0fb4d..0c5296595f 100644 --- a/server/test/fixtures/library.stub.ts +++ b/server/test/fixtures/library.stub.ts @@ -1,6 +1,6 @@ import { join } from 'node:path'; +import { THUMBNAIL_DIR } from 'src/cores/storage.core'; import { APP_MEDIA_LOCATION } from 'src/domain/domain.constant'; -import { THUMBNAIL_DIR } from 'src/domain/storage/storage.core'; import { LibraryEntity, LibraryType } from 'src/infra/entities/library.entity'; import { userStub } from 'test/fixtures/user.stub'; diff --git a/server/test/repositories/access.repository.mock.ts b/server/test/repositories/access.repository.mock.ts index 4491d6e70c..686d9bc855 100644 --- a/server/test/repositories/access.repository.mock.ts +++ b/server/test/repositories/access.repository.mock.ts @@ -1,4 +1,4 @@ -import { AccessCore } from 'src/domain/access/access.core'; +import { AccessCore } from 'src/cores/access.core'; import { IAccessRepository } from 'src/domain/repositories/access.repository'; export interface IAccessRepositoryMock { diff --git a/server/test/repositories/storage.repository.mock.ts b/server/test/repositories/storage.repository.mock.ts index a2851e9e1c..071b733a82 100644 --- a/server/test/repositories/storage.repository.mock.ts +++ b/server/test/repositories/storage.repository.mock.ts @@ -1,6 +1,6 @@ import { WatchOptions } from 'chokidar'; +import { StorageCore } from 'src/cores/storage.core'; import { IStorageRepository, StorageEventType, WatchEvents } from 'src/domain/repositories/storage.repository'; -import { StorageCore } from 'src/domain/storage/storage.core'; interface MockWatcherOptions { items?: Array<{ event: 'change' | 'add' | 'unlink' | 'error'; value: string }>; diff --git a/server/test/repositories/system-config.repository.mock.ts b/server/test/repositories/system-config.repository.mock.ts index 6fb4520f83..537182b2e8 100644 --- a/server/test/repositories/system-config.repository.mock.ts +++ b/server/test/repositories/system-config.repository.mock.ts @@ -1,5 +1,5 @@ +import { SystemConfigCore } from 'src/cores/system-config.core'; import { ISystemConfigRepository } from 'src/domain/repositories/system-config.repository'; -import { SystemConfigCore } from 'src/domain/system-config/system-config.core'; export const newSystemConfigRepositoryMock = (reset = true): jest.Mocked => { if (reset) { diff --git a/server/test/repositories/user.repository.mock.ts b/server/test/repositories/user.repository.mock.ts index e6772d2b1f..57e0148301 100644 --- a/server/test/repositories/user.repository.mock.ts +++ b/server/test/repositories/user.repository.mock.ts @@ -1,5 +1,5 @@ +import { UserCore } from 'src/cores/user.core'; import { IUserRepository } from 'src/domain/repositories/user.repository'; -import { UserCore } from 'src/domain/user/user.core'; export const newUserRepositoryMock = (reset = true): jest.Mocked => { if (reset) {