refactor: enum casing (#19946)

This commit is contained in:
Jason Rasmussen
2025-07-15 14:50:13 -04:00
committed by GitHub
parent 920d7de349
commit e73abe0762
174 changed files with 2675 additions and 2459 deletions
+11 -11
View File
@@ -19,7 +19,7 @@ export const albumStub = {
sharedLinks: [],
albumUsers: [],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
sharedWithUser: Object.freeze({
@@ -38,11 +38,11 @@ export const albumStub = {
albumUsers: [
{
user: userStub.user1,
role: AlbumUserRole.EDITOR,
role: AlbumUserRole.Editor,
},
],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
sharedWithMultiple: Object.freeze({
@@ -61,15 +61,15 @@ export const albumStub = {
albumUsers: [
{
user: userStub.user1,
role: AlbumUserRole.EDITOR,
role: AlbumUserRole.Editor,
},
{
user: userStub.user2,
role: AlbumUserRole.EDITOR,
role: AlbumUserRole.Editor,
},
],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
sharedWithAdmin: Object.freeze({
@@ -88,11 +88,11 @@ export const albumStub = {
albumUsers: [
{
user: userStub.admin,
role: AlbumUserRole.EDITOR,
role: AlbumUserRole.Editor,
},
],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
oneAsset: Object.freeze({
@@ -110,7 +110,7 @@ export const albumStub = {
sharedLinks: [],
albumUsers: [],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
twoAssets: Object.freeze({
@@ -128,7 +128,7 @@ export const albumStub = {
sharedLinks: [],
albumUsers: [],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
emptyWithValidThumbnail: Object.freeze({
@@ -146,7 +146,7 @@ export const albumStub = {
sharedLinks: [],
albumUsers: [],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
updateId: '42',
}),
};
+70 -70
View File
@@ -8,19 +8,19 @@ import { userStub } from 'test/fixtures/user.stub';
export const previewFile: AssetFile = {
id: 'file-1',
type: AssetFileType.PREVIEW,
type: AssetFileType.Preview,
path: '/uploads/user-id/thumbs/path.jpg',
};
const thumbnailFile: AssetFile = {
id: 'file-2',
type: AssetFileType.THUMBNAIL,
type: AssetFileType.Thumbnail,
path: '/uploads/user-id/webp/path.ext',
};
const fullsizeFile: AssetFile = {
id: 'file-3',
type: AssetFileType.FULLSIZE,
type: AssetFileType.FullSize,
path: '/uploads/user-id/fullsize/path.webp',
};
@@ -44,7 +44,7 @@ export const assetStub = {
id: 'asset-id',
ownerId: 'user-id',
livePhotoVideoId: null,
type: AssetType.IMAGE,
type: AssetType.Image,
isExternal: false,
checksum: Buffer.from('file hash'),
timeZone: null,
@@ -57,7 +57,7 @@ export const assetStub = {
}),
noResizePath: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
originalFileName: 'IMG_123.jpg',
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -68,7 +68,7 @@ export const assetStub = {
originalPath: 'upload/library/IMG_123.jpg',
files: [thumbnailFile],
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -89,12 +89,12 @@ export const assetStub = {
libraryId: null,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
noWebpPath: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -104,7 +104,7 @@ export const assetStub = {
originalPath: 'upload/library/IMG_456.jpg',
files: [previewFile],
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -128,12 +128,12 @@ export const assetStub = {
libraryId: null,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
noThumbhash: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -143,7 +143,7 @@ export const assetStub = {
originalPath: '/original/path.ext',
files,
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: null,
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -164,12 +164,12 @@ export const assetStub = {
libraryId: null,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
primaryImage: Object.freeze({
id: 'primary-asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -179,7 +179,7 @@ export const assetStub = {
originalPath: '/original/path.jpg',
checksum: Buffer.from('file hash', 'utf8'),
files,
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -210,12 +210,12 @@ export const assetStub = {
isOffline: false,
updateId: '42',
libraryId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
image: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -225,7 +225,7 @@ export const assetStub = {
originalPath: '/original/path.jpg',
files,
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -256,7 +256,7 @@ export const assetStub = {
projectionType: null,
height: 3840,
width: 2160,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
trashed: Object.freeze({
@@ -269,7 +269,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.jpg',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -293,16 +293,16 @@ export const assetStub = {
} as Exif,
duplicateId: null,
isOffline: false,
status: AssetStatus.TRASHED,
status: AssetStatus.Trashed,
libraryId: null,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
trashedOffline: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -311,7 +311,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.jpg',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -338,11 +338,11 @@ export const assetStub = {
isOffline: true,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
archived: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -351,7 +351,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.jpg',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -378,12 +378,12 @@ export const assetStub = {
libraryId: null,
stackId: null,
updateId: '42',
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
external: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -392,7 +392,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/data/user1/photo.jpg',
checksum: Buffer.from('path hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -418,12 +418,12 @@ export const assetStub = {
updateId: '42',
stackId: null,
stack: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
image1: Object.freeze({
id: 'asset-id-1',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -432,7 +432,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.ext',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -458,12 +458,12 @@ export const assetStub = {
stackId: null,
libraryId: null,
stack: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
imageFrom2015: Object.freeze({
id: 'asset-id-1',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2015-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2015-02-23T05:06:29.716Z'),
@@ -473,7 +473,7 @@ export const assetStub = {
originalPath: '/original/path.ext',
files,
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
createdAt: new Date('2015-02-23T05:06:29.716Z'),
@@ -494,12 +494,12 @@ export const assetStub = {
deletedAt: null,
duplicateId: null,
isOffline: false,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
video: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
originalFileName: 'asset-id.ext',
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -509,7 +509,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.ext',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.VIDEO,
type: AssetType.Video,
files: [previewFile],
thumbhash: null,
encodedVideoPath: null,
@@ -535,15 +535,15 @@ export const assetStub = {
updateId: '42',
libraryId: null,
stackId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
livePhotoMotionAsset: Object.freeze({
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
id: fileStub.livePhotoMotion.uuid,
originalPath: fileStub.livePhotoMotion.originalPath,
ownerId: authStub.user1.user.id,
type: AssetType.VIDEO,
type: AssetType.Video,
fileModifiedAt: new Date('2022-06-19T23:41:36.910Z'),
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
exifInfo: {
@@ -551,15 +551,15 @@ export const assetStub = {
timeZone: `America/New_York`,
},
libraryId: null,
visibility: AssetVisibility.HIDDEN,
visibility: AssetVisibility.Hidden,
} as MapAsset & { faces: AssetFace[]; files: AssetFile[]; exifInfo: Exif }),
livePhotoStillAsset: Object.freeze({
id: 'live-photo-still-asset',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
originalPath: fileStub.livePhotoStill.originalPath,
ownerId: authStub.user1.user.id,
type: AssetType.IMAGE,
type: AssetType.Image,
livePhotoVideoId: 'live-photo-motion-asset',
fileModifiedAt: new Date('2022-06-19T23:41:36.910Z'),
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
@@ -569,16 +569,16 @@ export const assetStub = {
},
files,
faces: [] as AssetFace[],
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
} as MapAsset & { faces: AssetFace[] }),
livePhotoWithOriginalFileName: Object.freeze({
id: 'live-photo-still-asset',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
originalPath: fileStub.livePhotoStill.originalPath,
originalFileName: fileStub.livePhotoStill.originalName,
ownerId: authStub.user1.user.id,
type: AssetType.IMAGE,
type: AssetType.Image,
livePhotoVideoId: 'live-photo-motion-asset',
fileModifiedAt: new Date('2022-06-19T23:41:36.910Z'),
fileCreatedAt: new Date('2022-06-19T23:41:36.910Z'),
@@ -588,12 +588,12 @@ export const assetStub = {
},
libraryId: null,
faces: [] as AssetFace[],
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
} as MapAsset & { faces: AssetFace[] }),
withLocation: Object.freeze({
id: 'asset-with-favorite-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-22T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-22T05:06:29.716Z'),
@@ -603,7 +603,7 @@ export const assetStub = {
checksum: Buffer.from('file hash', 'utf8'),
originalPath: '/original/path.ext',
sidecarPath: null,
type: AssetType.IMAGE,
type: AssetType.Image,
files: [previewFile],
thumbhash: null,
encodedVideoPath: null,
@@ -633,12 +633,12 @@ export const assetStub = {
duplicateId: null,
isOffline: false,
tags: [],
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
sidecar: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -648,7 +648,7 @@ export const assetStub = {
originalPath: '/original/path.ext',
thumbhash: null,
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files: [previewFile],
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -669,12 +669,12 @@ export const assetStub = {
updateId: 'foo',
libraryId: null,
stackId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
sidecarWithoutExt: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -684,7 +684,7 @@ export const assetStub = {
originalPath: '/original/path.ext',
thumbhash: null,
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files: [previewFile],
encodedVideoPath: null,
createdAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -702,12 +702,12 @@ export const assetStub = {
deletedAt: null,
duplicateId: null,
isOffline: false,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
hasEncodedVideo: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
originalFileName: 'asset-id.ext',
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -717,7 +717,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.ext',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.VIDEO,
type: AssetType.Video,
files: [previewFile],
thumbhash: null,
encodedVideoPath: '/encoded/video/path.mp4',
@@ -742,12 +742,12 @@ export const assetStub = {
libraryId: null,
stackId: null,
stack: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
hasFileExtension: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -756,7 +756,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/data/user1/photo.jpg',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -779,12 +779,12 @@ export const assetStub = {
} as Exif,
duplicateId: null,
isOffline: false,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
imageDng: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -793,7 +793,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.dng',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -820,12 +820,12 @@ export const assetStub = {
updateId: '42',
libraryId: null,
stackId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
imageHif: Object.freeze({
id: 'asset-id',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
deviceAssetId: 'device-asset-id',
fileModifiedAt: new Date('2023-02-23T05:06:29.716Z'),
fileCreatedAt: new Date('2023-02-23T05:06:29.716Z'),
@@ -834,7 +834,7 @@ export const assetStub = {
deviceId: 'device-id',
originalPath: '/original/path.hif',
checksum: Buffer.from('file hash', 'utf8'),
type: AssetType.IMAGE,
type: AssetType.Image,
files,
thumbhash: Buffer.from('blablabla', 'base64'),
encodedVideoPath: null,
@@ -861,6 +861,6 @@ export const assetStub = {
updateId: '42',
libraryId: null,
stackId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
}),
};
+8 -8
View File
@@ -20,7 +20,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
faceSearch: { faceId: 'assetFaceId1', embedding: '[1, 2, 3, 4]' },
deletedAt: new Date(),
}),
@@ -36,7 +36,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
faceSearch: { faceId: 'assetFaceId2', embedding: '[1, 2, 3, 4]' },
deletedAt: null,
}),
@@ -52,7 +52,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
faceSearch: { faceId: 'assetFaceId3', embedding: '[1, 2, 3, 4]' },
deletedAt: null,
}),
@@ -68,7 +68,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
faceSearch: { faceId: 'assetFaceId8', embedding: '[1, 2, 3, 4]' },
deletedAt: null,
}),
@@ -84,7 +84,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
faceSearch: { faceId: 'assetFaceId9', embedding: '[1, 2, 3, 4]' },
deletedAt: null,
}),
@@ -100,7 +100,7 @@ export const faceStub = {
boundingBoxY2: 200,
imageHeight: 500,
imageWidth: 400,
sourceType: SourceType.EXIF,
sourceType: SourceType.Exif,
deletedAt: null,
}),
fromExif2: Object.freeze({
@@ -115,7 +115,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.EXIF,
sourceType: SourceType.Exif,
deletedAt: null,
}),
withBirthDate: Object.freeze({
@@ -130,7 +130,7 @@ export const faceStub = {
boundingBoxY2: 1,
imageHeight: 1024,
imageWidth: 1024,
sourceType: SourceType.MACHINE_LEARNING,
sourceType: SourceType.MachineLearning,
deletedAt: null,
}),
};
+7 -7
View File
@@ -176,7 +176,7 @@ export const personThumbnailStub = {
y2: 505,
oldHeight: 2880,
oldWidth: 2160,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.jpg',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -189,7 +189,7 @@ export const personThumbnailStub = {
y2: 200,
oldHeight: 500,
oldWidth: 400,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.jpg',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -202,7 +202,7 @@ export const personThumbnailStub = {
y2: 495,
oldHeight: 500,
oldWidth: 500,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.jpg',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -215,7 +215,7 @@ export const personThumbnailStub = {
y2: 200,
oldHeight: 500,
oldWidth: 400,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.dng',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -228,7 +228,7 @@ export const personThumbnailStub = {
y2: 251,
oldHeight: 1440,
oldWidth: 2162,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.jpg',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -241,7 +241,7 @@ export const personThumbnailStub = {
y2: 152,
oldHeight: 1440,
oldWidth: 2162,
type: AssetType.IMAGE,
type: AssetType.Image,
originalPath: '/original/path.jpg',
exifOrientation: '1',
previewPath: previewFile.path,
@@ -254,7 +254,7 @@ export const personThumbnailStub = {
y2: 200,
oldHeight: 500,
oldWidth: 400,
type: AssetType.VIDEO,
type: AssetType.Video,
originalPath: '/original/path.mp4',
exifOrientation: '1',
previewPath: previewFile.path,
+16 -16
View File
@@ -49,7 +49,7 @@ const assetResponse: AssetResponseDto = {
deviceAssetId: 'device_asset_id_1',
ownerId: 'user_id_1',
deviceId: 'device_id_1',
type: AssetType.VIDEO,
type: AssetType.Video,
originalMimeType: 'image/jpeg',
originalPath: 'fake_path/jpeg',
originalFileName: 'asset_1.jpeg',
@@ -70,12 +70,12 @@ const assetResponse: AssetResponseDto = {
isTrashed: false,
libraryId: 'library-id',
hasMetadata: true,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
};
const assetResponseWithoutMetadata = {
id: 'id_1',
type: AssetType.VIDEO,
type: AssetType.Video,
originalMimeType: 'image/jpeg',
thumbhash: null,
localDateTime: today,
@@ -99,7 +99,7 @@ const albumResponse: AlbumResponseDto = {
assets: [],
assetCount: 1,
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
};
export const sharedLinkStub = {
@@ -107,7 +107,7 @@ export const sharedLinkStub = {
id: '123',
userId: authStub.admin.user.id,
key: sharedLinkBytes,
type: SharedLinkType.INDIVIDUAL,
type: SharedLinkType.Individual,
createdAt: today,
expiresAt: tomorrow,
allowUpload: true,
@@ -124,7 +124,7 @@ export const sharedLinkStub = {
userId: authStub.admin.user.id,
user: userStub.admin,
key: sharedLinkBytes,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
createdAt: today,
expiresAt: tomorrow,
allowUpload: true,
@@ -141,7 +141,7 @@ export const sharedLinkStub = {
userId: authStub.admin.user.id,
user: userStub.admin,
key: sharedLinkBytes,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
createdAt: today,
expiresAt: yesterday,
allowUpload: true,
@@ -157,7 +157,7 @@ export const sharedLinkStub = {
id: '123',
userId: authStub.admin.user.id,
key: sharedLinkBytes,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
createdAt: today,
expiresAt: tomorrow,
allowUpload: false,
@@ -182,16 +182,16 @@ export const sharedLinkStub = {
albumUsers: [],
sharedLinks: [],
isActivityEnabled: true,
order: AssetOrder.DESC,
order: AssetOrder.Desc,
assets: [
{
id: 'id_1',
status: AssetStatus.ACTIVE,
status: AssetStatus.Active,
owner: undefined as unknown as UserAdmin,
ownerId: 'user_id_1',
deviceAssetId: 'device_asset_id_1',
deviceId: 'device_id_1',
type: AssetType.VIDEO,
type: AssetType.Video,
originalPath: 'fake_path/jpeg',
checksum: Buffer.from('file hash', 'utf8'),
fileModifiedAt: today,
@@ -251,7 +251,7 @@ export const sharedLinkStub = {
updateId: '42',
libraryId: null,
stackId: null,
visibility: AssetVisibility.TIMELINE,
visibility: AssetVisibility.Timeline,
},
],
},
@@ -260,7 +260,7 @@ export const sharedLinkStub = {
id: '123',
userId: authStub.admin.user.id,
key: sharedLinkBytes,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
createdAt: today,
expiresAt: tomorrow,
allowUpload: true,
@@ -286,7 +286,7 @@ export const sharedLinkResponseStub = {
id: '123',
key: sharedLinkBytes.toString('base64url'),
showMetadata: true,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
userId: 'admin_id',
}),
expired: Object.freeze<SharedLinkResponseDto>({
@@ -301,14 +301,14 @@ export const sharedLinkResponseStub = {
id: '123',
key: sharedLinkBytes.toString('base64url'),
showMetadata: true,
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
userId: 'admin_id',
}),
readonlyNoMetadata: Object.freeze<SharedLinkResponseDto>({
id: '123',
userId: 'admin_id',
key: sharedLinkBytes.toString('base64url'),
type: SharedLinkType.ALBUM,
type: SharedLinkType.Album,
createdAt: today,
expiresAt: tomorrow,
description: null,
+3 -3
View File
@@ -5,7 +5,7 @@ import { authStub } from 'test/fixtures/auth.stub';
export const userStub = {
admin: <UserAdmin>{
...authStub.admin.user,
status: UserStatus.ACTIVE,
status: UserStatus.Active,
profileChangedAt: new Date('2021-01-01'),
name: 'admin_name',
id: 'admin_id',
@@ -23,7 +23,7 @@ export const userStub = {
},
user1: <UserAdmin>{
...authStub.user1.user,
status: UserStatus.ACTIVE,
status: UserStatus.Active,
profileChangedAt: new Date('2021-01-01'),
name: 'immich_name',
storageLabel: null,
@@ -40,7 +40,7 @@ export const userStub = {
},
user2: <UserAdmin>{
...authStub.user2.user,
status: UserStatus.ACTIVE,
status: UserStatus.Active,
profileChangedAt: new Date('2021-01-01'),
metadata: [],
name: 'immich_name',