chore(server): use absolute import paths (#8080)
update server to use absolute import paths
This commit is contained in:
+5
-5
@@ -1,8 +1,8 @@
|
||||
import { ActivityEntity } from '@app/infra/entities';
|
||||
import { albumStub } from './album.stub';
|
||||
import { assetStub } from './asset.stub';
|
||||
import { authStub } from './auth.stub';
|
||||
import { userStub } from './user.stub';
|
||||
import { ActivityEntity } from 'src/infra/entities/activity.entity';
|
||||
import { albumStub } from 'test/fixtures/album.stub';
|
||||
import { assetStub } from 'test/fixtures/asset.stub';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const activityStub = {
|
||||
oneComment: Object.freeze<ActivityEntity>({
|
||||
|
||||
Vendored
+4
-4
@@ -1,7 +1,7 @@
|
||||
import { AlbumEntity, AssetOrder } from '@app/infra/entities';
|
||||
import { assetStub } from './asset.stub';
|
||||
import { authStub } from './auth.stub';
|
||||
import { userStub } from './user.stub';
|
||||
import { AlbumEntity, AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { assetStub } from 'test/fixtures/asset.stub';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const albumStub = {
|
||||
empty: Object.freeze<AlbumEntity>({
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { APIKeyEntity } from '@app/infra/entities';
|
||||
import { authStub } from './auth.stub';
|
||||
import { userStub } from './user.stub';
|
||||
import { APIKeyEntity } from 'src/infra/entities/api-key.entity';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const keyStub = {
|
||||
admin: Object.freeze({
|
||||
|
||||
Vendored
+7
-5
@@ -1,8 +1,10 @@
|
||||
import { AssetEntity, AssetStackEntity, AssetType, ExifEntity } from '@app/infra/entities';
|
||||
import { authStub } from './auth.stub';
|
||||
import { fileStub } from './file.stub';
|
||||
import { libraryStub } from './library.stub';
|
||||
import { userStub } from './user.stub';
|
||||
import { AssetStackEntity } from 'src/infra/entities/asset-stack.entity';
|
||||
import { AssetEntity, AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { ExifEntity } from 'src/infra/entities/exif.entity';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
import { fileStub } from 'test/fixtures/file.stub';
|
||||
import { libraryStub } from 'test/fixtures/library.stub';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const assetStackStub = (stackId: string, assets: AssetEntity[]): AssetStackEntity => {
|
||||
return {
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { AuditEntity, DatabaseAction, EntityType } from '@app/infra/entities';
|
||||
import { authStub } from './auth.stub';
|
||||
import { AuditEntity, DatabaseAction, EntityType } from 'src/infra/entities/audit.entity';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
|
||||
export const auditStub = {
|
||||
create: Object.freeze<AuditEntity>({
|
||||
|
||||
Vendored
+4
-2
@@ -1,5 +1,7 @@
|
||||
import { AuthDto } from '@app/domain';
|
||||
import { SharedLinkEntity, UserEntity, UserTokenEntity } from '../../src/infra/entities';
|
||||
import { AuthDto } from 'src/domain/auth/auth.dto';
|
||||
import { SharedLinkEntity } from 'src/infra/entities/shared-link.entity';
|
||||
import { UserTokenEntity } from 'src/infra/entities/user-token.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
|
||||
export const adminSignupStub = {
|
||||
name: 'Immich Admin',
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { AssetFaceEntity } from '@app/infra/entities';
|
||||
import { assetStub } from './asset.stub';
|
||||
import { personStub } from './person.stub';
|
||||
import { AssetFaceEntity } from 'src/infra/entities/asset-face.entity';
|
||||
import { assetStub } from 'test/fixtures/asset.stub';
|
||||
import { personStub } from 'test/fixtures/person.stub';
|
||||
|
||||
type NonNullableProperty<T> = { [P in keyof T]: NonNullable<T[P]> };
|
||||
|
||||
|
||||
Vendored
-18
@@ -1,18 +0,0 @@
|
||||
export * from './album.stub';
|
||||
export * from './api-key.stub';
|
||||
export * from './asset.stub';
|
||||
export * from './audit.stub';
|
||||
export * from './auth.stub';
|
||||
export * from './error.stub';
|
||||
export * from './face.stub';
|
||||
export * from './file.stub';
|
||||
export * from './library.stub';
|
||||
export * from './media.stub';
|
||||
export * from './partner.stub';
|
||||
export * from './person.stub';
|
||||
export * from './shared-link.stub';
|
||||
export * from './system-config.stub';
|
||||
export * from './tag.stub';
|
||||
export * from './user-token.stub';
|
||||
export * from './user.stub';
|
||||
export * from './uuid.stub';
|
||||
Vendored
+4
-3
@@ -1,7 +1,8 @@
|
||||
import { APP_MEDIA_LOCATION, THUMBNAIL_DIR } from '@app/domain';
|
||||
import { LibraryEntity, LibraryType } from '@app/infra/entities';
|
||||
import { join } from 'node:path';
|
||||
import { userStub } from './user.stub';
|
||||
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';
|
||||
|
||||
export const libraryStub = {
|
||||
uploadLibrary1: Object.freeze<LibraryEntity>({
|
||||
|
||||
Vendored
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { AudioStreamInfo, VideoFormat, VideoInfo, VideoStreamInfo } from '@app/domain';
|
||||
import { AudioStreamInfo, VideoFormat, VideoInfo, VideoStreamInfo } from 'src/domain/repositories/media.repository';
|
||||
|
||||
const probeStubDefaultFormat: VideoFormat = {
|
||||
formatName: 'mov,mp4,m4a,3gp,3g2,mj2',
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { PartnerEntity } from '@app/infra/entities';
|
||||
import { userStub } from './user.stub';
|
||||
import { PartnerEntity } from 'src/infra/entities/partner.entity';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const partnerStub = {
|
||||
adminToUser1: Object.freeze<PartnerEntity>({
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { PersonEntity } from '@app/infra/entities';
|
||||
import { userStub } from './user.stub';
|
||||
import { PersonEntity } from 'src/infra/entities/person.entity';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const personStub = {
|
||||
noName: Object.freeze<PersonEntity>({
|
||||
|
||||
+13
-6
@@ -1,9 +1,16 @@
|
||||
import { AlbumResponseDto, AssetResponseDto, ExifResponseDto, mapUser, SharedLinkResponseDto } from '@app/domain';
|
||||
import { AssetOrder, AssetType, SharedLinkEntity, SharedLinkType, UserEntity } from '@app/infra/entities';
|
||||
import { assetStub } from './asset.stub';
|
||||
import { authStub } from './auth.stub';
|
||||
import { libraryStub } from './library.stub';
|
||||
import { userStub } from './user.stub';
|
||||
import { AlbumResponseDto } from 'src/domain/album/album-response.dto';
|
||||
import { AssetResponseDto } from 'src/domain/asset/response-dto/asset-response.dto';
|
||||
import { ExifResponseDto } from 'src/domain/asset/response-dto/exif-response.dto';
|
||||
import { SharedLinkResponseDto } from 'src/domain/shared-link/shared-link-response.dto';
|
||||
import { mapUser } from 'src/domain/user/response-dto/user-response.dto';
|
||||
import { AssetOrder } from 'src/infra/entities/album.entity';
|
||||
import { AssetType } from 'src/infra/entities/asset.entity';
|
||||
import { SharedLinkEntity, SharedLinkType } from 'src/infra/entities/shared-link.entity';
|
||||
import { UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { assetStub } from 'test/fixtures/asset.stub';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
import { libraryStub } from 'test/fixtures/library.stub';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
const today = new Date();
|
||||
const tomorrow = new Date();
|
||||
|
||||
+1
-1
@@ -1,4 +1,4 @@
|
||||
import { SystemConfigEntity, SystemConfigKey } from '@app/infra/entities';
|
||||
import { SystemConfigEntity, SystemConfigKey } from 'src/infra/entities/system-config.entity';
|
||||
|
||||
export const systemConfigStub: Record<string, SystemConfigEntity[]> = {
|
||||
defaults: [],
|
||||
|
||||
Vendored
+3
-3
@@ -1,6 +1,6 @@
|
||||
import { TagResponseDto } from '@app/domain';
|
||||
import { TagEntity, TagType } from '@app/infra/entities';
|
||||
import { userStub } from './user.stub';
|
||||
import { TagResponseDto } from 'src/domain/tag/tag-response.dto';
|
||||
import { TagEntity, TagType } from 'src/infra/entities/tag.entity';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const tagStub = {
|
||||
tag1: Object.freeze<TagEntity>({
|
||||
|
||||
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { UserTokenEntity } from '@app/infra/entities';
|
||||
import { userStub } from './user.stub';
|
||||
import { UserTokenEntity } from 'src/infra/entities/user-token.entity';
|
||||
import { userStub } from 'test/fixtures/user.stub';
|
||||
|
||||
export const userTokenStub = {
|
||||
userToken: Object.freeze<UserTokenEntity>({
|
||||
|
||||
Vendored
+2
-2
@@ -1,5 +1,5 @@
|
||||
import { UserAvatarColor, UserEntity } from '@app/infra/entities';
|
||||
import { authStub } from './auth.stub';
|
||||
import { UserAvatarColor, UserEntity } from 'src/infra/entities/user.entity';
|
||||
import { authStub } from 'test/fixtures/auth.stub';
|
||||
|
||||
export const userDto = {
|
||||
user1: {
|
||||
|
||||
@@ -1,2 +0,0 @@
|
||||
export * from './fixtures';
|
||||
export * from './repositories';
|
||||
@@ -1,4 +1,5 @@
|
||||
import { AccessCore, IAccessRepository } from '@app/domain';
|
||||
import { AccessCore } from 'src/domain/access/access.core';
|
||||
import { IAccessRepository } from 'src/domain/repositories/access.repository';
|
||||
|
||||
export interface IAccessRepositoryMock {
|
||||
activity: jest.Mocked<IAccessRepository['activity']>;
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IActivityRepository } from '@app/domain';
|
||||
import { IActivityRepository } from 'src/domain/repositories/activity.repository';
|
||||
|
||||
export const newActivityRepositoryMock = (): jest.Mocked<IActivityRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAlbumRepository } from '@app/domain';
|
||||
import { IAlbumRepository } from 'src/domain/repositories/album.repository';
|
||||
|
||||
export const newAlbumRepositoryMock = (): jest.Mocked<IAlbumRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IKeyRepository } from '@app/domain';
|
||||
import { IKeyRepository } from 'src/domain/repositories/api-key.repository';
|
||||
|
||||
export const newKeyRepositoryMock = (): jest.Mocked<IKeyRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAssetStackRepository } from '@app/domain';
|
||||
import { IAssetStackRepository } from 'src/domain/repositories/asset-stack.repository';
|
||||
|
||||
export const newAssetStackRepositoryMock = (): jest.Mocked<IAssetStackRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAssetRepository } from '@app/domain';
|
||||
import { IAssetRepository } from 'src/domain/repositories/asset.repository';
|
||||
|
||||
export const newAssetRepositoryMock = (): jest.Mocked<IAssetRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IAuditRepository } from '@app/domain';
|
||||
import { IAuditRepository } from 'src/domain/repositories/audit.repository';
|
||||
|
||||
export const newAuditRepositoryMock = (): jest.Mocked<IAuditRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ICommunicationRepository } from '@app/domain';
|
||||
import { ICommunicationRepository } from 'src/domain/repositories/communication.repository';
|
||||
|
||||
export const newCommunicationRepositoryMock = (): jest.Mocked<ICommunicationRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ICryptoRepository } from '@app/domain';
|
||||
import { ICryptoRepository } from 'src/domain/repositories/crypto.repository';
|
||||
|
||||
export const newCryptoRepositoryMock = (): jest.Mocked<ICryptoRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { IDatabaseRepository, Version } from '@app/domain';
|
||||
import { Version } from 'src/domain/domain.constant';
|
||||
import { IDatabaseRepository } from 'src/domain/repositories/database.repository';
|
||||
|
||||
export const newDatabaseRepositoryMock = (): jest.Mocked<IDatabaseRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,26 +0,0 @@
|
||||
export * from './access.repository.mock';
|
||||
export * from './album.repository.mock';
|
||||
export * from './api-key.repository.mock';
|
||||
export * from './asset-stack.repository.mock';
|
||||
export * from './asset.repository.mock';
|
||||
export * from './audit.repository.mock';
|
||||
export * from './communication.repository.mock';
|
||||
export * from './crypto.repository.mock';
|
||||
export * from './database.repository.mock';
|
||||
export * from './job.repository.mock';
|
||||
export * from './library.repository.mock';
|
||||
export * from './machine-learning.repository.mock';
|
||||
export * from './media.repository.mock';
|
||||
export * from './metadata.repository.mock';
|
||||
export * from './move.repository.mock';
|
||||
export * from './partner.repository.mock';
|
||||
export * from './person.repository.mock';
|
||||
export * from './search.repository.mock';
|
||||
export * from './shared-link.repository.mock';
|
||||
export * from './storage.repository.mock';
|
||||
export * from './system-config.repository.mock';
|
||||
export * from './system-info.repository.mock';
|
||||
export * from './system-metadata.repository.mock';
|
||||
export * from './tag.repository.mock';
|
||||
export * from './user-token.repository.mock';
|
||||
export * from './user.repository.mock';
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IJobRepository } from '@app/domain';
|
||||
import { IJobRepository } from 'src/domain/repositories/job.repository';
|
||||
|
||||
export const newJobRepositoryMock = (): jest.Mocked<IJobRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ILibraryRepository } from '@app/domain';
|
||||
import { ILibraryRepository } from 'src/domain/repositories/library.repository';
|
||||
|
||||
export const newLibraryRepositoryMock = (): jest.Mocked<ILibraryRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IMachineLearningRepository } from '@app/domain';
|
||||
import { IMachineLearningRepository } from 'src/domain/repositories/machine-learning.repository';
|
||||
|
||||
export const newMachineLearningRepositoryMock = (): jest.Mocked<IMachineLearningRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IMediaRepository } from '@app/domain';
|
||||
import { IMediaRepository } from 'src/domain/repositories/media.repository';
|
||||
|
||||
export const newMediaRepositoryMock = (): jest.Mocked<IMediaRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IMetadataRepository } from '@app/domain';
|
||||
import { IMetadataRepository } from 'src/domain/repositories/metadata.repository';
|
||||
|
||||
export const newMetadataRepositoryMock = (): jest.Mocked<IMetadataRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IMoveRepository } from '@app/domain';
|
||||
import { IMoveRepository } from 'src/domain/repositories/move.repository';
|
||||
|
||||
export const newMoveRepositoryMock = (): jest.Mocked<IMoveRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IPartnerRepository } from '@app/domain';
|
||||
import { IPartnerRepository } from 'src/domain/repositories/partner.repository';
|
||||
|
||||
export const newPartnerRepositoryMock = (): jest.Mocked<IPartnerRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IPersonRepository } from '@app/domain';
|
||||
import { IPersonRepository } from 'src/domain/repositories/person.repository';
|
||||
|
||||
export const newPersonRepositoryMock = (): jest.Mocked<IPersonRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ISearchRepository } from '@app/domain';
|
||||
import { ISearchRepository } from 'src/domain/repositories/search.repository';
|
||||
|
||||
export const newSearchRepositoryMock = (): jest.Mocked<ISearchRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ISharedLinkRepository } from '@app/domain';
|
||||
import { ISharedLinkRepository } from 'src/domain/repositories/shared-link.repository';
|
||||
|
||||
export const newSharedLinkRepositoryMock = (): jest.Mocked<ISharedLinkRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,5 +1,6 @@
|
||||
import { IStorageRepository, StorageCore, StorageEventType, WatchEvents } from '@app/domain';
|
||||
import { WatchOptions } from 'chokidar';
|
||||
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 }>;
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { ISystemConfigRepository, SystemConfigCore } from '@app/domain';
|
||||
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<ISystemConfigRepository> => {
|
||||
if (reset) {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IServerInfoRepository } from '@app/domain';
|
||||
import { IServerInfoRepository } from 'src/domain/repositories/server-info.repository';
|
||||
|
||||
export const newServerInfoRepositoryMock = (): jest.Mocked<IServerInfoRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ISystemMetadataRepository } from '@app/domain';
|
||||
import { ISystemMetadataRepository } from 'src/domain/repositories/system-metadata.repository';
|
||||
|
||||
export const newSystemMetadataRepositoryMock = (): jest.Mocked<ISystemMetadataRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { ITagRepository } from '@app/domain';
|
||||
import { ITagRepository } from 'src/domain/repositories/tag.repository';
|
||||
|
||||
export const newTagRepositoryMock = (): jest.Mocked<ITagRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,4 @@
|
||||
import { IUserTokenRepository } from '@app/domain';
|
||||
import { IUserTokenRepository } from 'src/domain/repositories/user-token.repository';
|
||||
|
||||
export const newUserTokenRepositoryMock = (): jest.Mocked<IUserTokenRepository> => {
|
||||
return {
|
||||
|
||||
@@ -1,4 +1,5 @@
|
||||
import { IUserRepository, UserCore } from '@app/domain';
|
||||
import { IUserRepository } from 'src/domain/repositories/user.repository';
|
||||
import { UserCore } from 'src/domain/user/user.core';
|
||||
|
||||
export const newUserRepositoryMock = (reset = true): jest.Mocked<IUserRepository> => {
|
||||
if (reset) {
|
||||
|
||||
Reference in New Issue
Block a user