2026-05-29 14:02:07 -04:00
|
|
|
import { WorkflowTrigger } from '@immich/plugin-sdk';
|
2026-03-11 16:17:31 +01:00
|
|
|
import { ShallowDehydrateObject } from 'kysely';
|
2025-03-28 10:40:09 -04:00
|
|
|
import { SystemConfig } from 'src/config';
|
2025-05-20 09:36:43 -04:00
|
|
|
import { VECTOR_EXTENSIONS } from 'src/constants';
|
2026-05-18 11:09:33 -04:00
|
|
|
import { AssetFile } from 'src/database';
|
2025-09-02 14:26:12 -05:00
|
|
|
import { UploadFieldName } from 'src/dtos/asset-media.dto';
|
|
|
|
|
import { AuthDto } from 'src/dtos/auth.dto';
|
2026-01-09 17:59:52 -05:00
|
|
|
import { AssetEditActionItem } from 'src/dtos/editing.dto';
|
feat: restore database backups (#23978)
* feat: ProcessRepository#createSpawnDuplexStream
* test: write tests for ProcessRepository#createSpawnDuplexStream
* feat: StorageRepository#createGzip,createGunzip,createPlainReadStream
* feat: backups util (args, create, restore, progress)
* feat: wait on maintenance operation lock on boot
* chore: use backup util from backup.service.ts
test: update backup.service.ts tests with new util
* feat: list/delete backups (maintenance services)
* chore: open api
fix: missing action in cli.service.ts
* chore: add missing repositories to MaintenanceModule
* refactor: move logSecret into module init
* feat: initialise StorageCore in maintenance mode
* feat: authenticate websocket requests in maintenance mode
* test: add mock for new storage fns
* feat: add MaintenanceEphemeralStateRepository
refactor: cache the secret in memory
* test: update service worker tests
* feat: add external maintenance mode status
* feat: synchronised status, restore db action
* test: backup restore service tests
* refactor: DRY end maintenance
* feat: list and delete backup routes
* feat: start action on boot
* fix: should set status on restore end
* refactor: add maintenanceStore to hold writables
* feat: sync status to web app
* feat: web impl.
* test: various utils for testings
* test: web e2e tests
* test: e2e maintenance spec
* test: update cli spec
* chore: e2e lint
* chore: lint fixes
* chore: lint fixes
* feat: start restore flow route
* test: update e2e tests
* chore: remove neon lights on maintenance action pages
* fix: use 'startRestoreFlow' on onboarding page
* chore: ignore any library folder in `docker/`
* fix: load status on boot
* feat: upload backups
* refactor: permit any .sql(.gz) to be listed/restored
* feat: download backups from list
* fix: permit uploading just .sql files
* feat: restore just .sql files
* fix: don't show backups list if logged out
* feat: system integrity check in restore flow
* test: not providing failed backups in API anymore
* test: util should also not try to use failedBackups
* fix: actually assign inputStream
* test: correct test backup prep.
* fix: ensure task is defined to show error
* test: fix docker cp command
* test: update e2e web spec to select next button
* test: update e2e api tests
* test: refactor timeouts
* chore: remove `showDelete` from maint. settings
* chore: lint
* chore: lint
* fix: make sure backups are correctly sorted for clean up
* test: update service spec
* test: adjust e2e timeout
* test: increase web timeouts for ci
* chore: move gitignore changes
* chore: additional filename validation
* refactor: better typings for integrity API
* feat: higher accuracy progress tracking
* chore: delay lock retry
* refactor: remove old maintenance settings
* refactor: clean up tailwind classes
* refactor: use while loop rather than recursive calls
* test: update service specs
* chore: check canParse too
* chore: lint
* fix: logic error causing infinite loop
* refactor: use <ProgressBar /> from ui library
* fix: create or overwrite file
* chore: i18n pass, update progress bar
* fix: wrong translation string
* chore: update colour variables
* test: update web test for new maint. page
* chore: format, fix key
* test: update tests to be more linter complaint & use new routines
* chore: update onClick -> onAction, title -> breadcrumbs
* fix: use wrench icon in admin settings sidebar
* chore: add translation strings to accordion
* chore: lint
* refactor: move maintenance worker init into service
* refactor: `maintenanceStatus` -> `getMaintenanceStatus`
refactor: `integrityCheck` -> `detectPriorInstall`
chore: add `v2.4.0` version
refactor: `/backups/list` -> `/backups`
refactor: use sendFile in download route
refactor: use separate backups permissions
chore: correct descriptions
refactor: permit handler that doesn't return promise for sendfile
* refactor: move status impl into service
refactor: add active flag to maintenance status
* refactor: split into database backup controller
* test: split api e2e tests and passing
* fix: move end button into authed default maint page
* fix: also show in restore flow
* fix: import getMaintenanceStatus
* test: split web e2e tests
* refactor: ensure detect install is consistently named
* chore: ensure admin for detect install while out of maint.
* refactor: remove state repository
* test: update maint. worker service spec
* test: split backup service spec
* refactor: rename db backup routes
* refactor: instead of param, allow bulk backup deletion
* test: update sdk use in e2e test
* test: correct deleteBackup call
* fix: correct type for serverinstall response dto
* chore: validate filename for deletion
* test: wip
* test: backups no longer take path param
* refactor: scope util to database-backups instead of backups
* fix: update worker controller with new route
* chore: use new admin page actions
* chore: remove stray comment
* test: rename outdated test
* refactor: getter pattern for maintenance secret
* refactor: `createSpawnDuplexStream` -> `spawnDuplexStream`
* refactor: prefer `Object.assign`
* refactor: remove useless try {} block
* refactor: prefer `type Props`
refactor: prefer arrow function
* refactor: use luxon API for minutesAgo
* chore: remove change to gitignore
* refactor: prefer `type Props`
* refactor: remove async from onMount
* refactor: use luxon toRelative for relative time
* refactor: duplicate logic check
* chore: open api
* refactor: begin moving code into web//services
* refactor: don't use template string with $t
* test: use dialog role to match prompt
* refactor: split actions into flow/restore
* test: fix action value
* refactor: move more service calls into web//services
* chore: should void fn return
* chore: bump 2.4.0 to 2.5.0 in controller
* chore: bump 2.4.0 to 2.5.0 in controller
* refactor: use events for web//services
* chore: open api
* chore: open api
* refactor: don't await returned promise
* refactor: remove redundant check
* refactor: add `type: command` to actions
* refactor: split backup entries into own component
* refactor: split restore flow into separate components
* refactor(web): split BackupDelete event
* chore: stylings
* chore: stylings
* fix: don't log query failure on first boot
* feat: support pg_dumpall backups
* feat: display information about each backup
* chore: i18n
* feat: rollback to restore point on migrations failure
* feat: health check after restore
* chore: format
* refactor: split health check into separate function
* refactor: split health into repository
test: write tests covering rollbacks
* fix: omit 'health' requirement from createDbBackup
* test(e2e): rollback test
* fix: wrap text in backup entry
* fix: don't shrink context menu button
* fix: correct CREATE DB syntax for postgres
* test: rename backups generated by test
* feat: add filesize to backup response dto
* feat: restore list
* feat: ui work
* fix: e2e test
* fix: e2e test
* pr feedback
* pr feedback
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-01-20 15:22:28 +00:00
|
|
|
import { SetMaintenanceModeDto } from 'src/dtos/maintenance.dto';
|
2025-02-11 17:15:56 -05:00
|
|
|
import {
|
2026-05-01 13:03:49 -04:00
|
|
|
AacProfile,
|
2025-06-06 06:31:34 +02:00
|
|
|
AssetOrder,
|
2025-03-07 14:30:01 -05:00
|
|
|
AssetType,
|
2026-05-01 13:03:49 -04:00
|
|
|
Av1Profile,
|
|
|
|
|
ColorMatrix,
|
|
|
|
|
ColorPrimaries,
|
|
|
|
|
ColorTransfer,
|
|
|
|
|
DvProfile,
|
|
|
|
|
DvSignalCompatibility,
|
2025-02-11 17:15:56 -05:00
|
|
|
ExifOrientation,
|
2026-05-01 13:03:49 -04:00
|
|
|
H264Profile,
|
|
|
|
|
HevcProfile,
|
2025-02-11 17:15:56 -05:00
|
|
|
ImageFormat,
|
2026-06-10 21:02:27 +02:00
|
|
|
IntegrityReport,
|
2025-02-11 17:15:56 -05:00
|
|
|
JobName,
|
2025-03-28 10:40:09 -04:00
|
|
|
MemoryType,
|
2025-02-11 17:15:56 -05:00
|
|
|
QueueName,
|
2025-03-28 10:40:09 -04:00
|
|
|
StorageFolder,
|
2025-02-21 04:37:57 +00:00
|
|
|
SyncEntityType,
|
2025-03-28 10:40:09 -04:00
|
|
|
SystemMetadataKey,
|
2025-02-11 17:15:56 -05:00
|
|
|
TranscodeTarget,
|
2025-04-09 11:45:30 -04:00
|
|
|
UserMetadataKey,
|
2026-05-18 11:09:33 -04:00
|
|
|
WorkflowType,
|
2025-02-11 17:15:56 -05:00
|
|
|
} from 'src/enum';
|
2025-01-10 14:02:12 -05:00
|
|
|
|
2026-05-18 11:09:33 -04:00
|
|
|
export type DeepPartial<T> = T extends Date
|
|
|
|
|
? T
|
|
|
|
|
: T extends Record<string, unknown>
|
2026-01-23 09:54:04 -06:00
|
|
|
? { [K in keyof T]?: DeepPartial<T[K]> }
|
|
|
|
|
: T extends Array<infer R>
|
|
|
|
|
? DeepPartial<R>[]
|
|
|
|
|
: T;
|
2025-01-21 16:47:48 -05:00
|
|
|
|
2025-01-15 23:31:26 -05:00
|
|
|
export type RepositoryInterface<T extends object> = Pick<T, keyof T>;
|
|
|
|
|
|
2026-01-23 09:54:04 -06:00
|
|
|
export type FullsizeImageOptions = {
|
2025-04-01 01:24:28 +08:00
|
|
|
format: ImageFormat;
|
|
|
|
|
quality: number;
|
|
|
|
|
enabled: boolean;
|
2026-01-24 00:18:02 -05:00
|
|
|
progressive?: boolean;
|
2026-01-23 09:54:04 -06:00
|
|
|
};
|
2025-04-01 01:24:28 +08:00
|
|
|
|
2026-01-23 09:54:04 -06:00
|
|
|
export type ImageOptions = {
|
2025-01-22 17:11:07 -05:00
|
|
|
format: ImageFormat;
|
|
|
|
|
quality: number;
|
|
|
|
|
size: number;
|
2026-01-24 00:18:02 -05:00
|
|
|
progressive?: boolean;
|
2026-01-23 09:54:04 -06:00
|
|
|
};
|
2025-01-22 17:11:07 -05:00
|
|
|
|
2026-01-23 09:54:04 -06:00
|
|
|
export type RawImageInfo = {
|
2025-01-22 17:11:07 -05:00
|
|
|
width: number;
|
|
|
|
|
height: number;
|
|
|
|
|
channels: 1 | 2 | 3 | 4;
|
2026-01-23 09:54:04 -06:00
|
|
|
};
|
2025-01-22 17:11:07 -05:00
|
|
|
|
2026-01-23 09:54:04 -06:00
|
|
|
type DecodeImageOptions = {
|
2025-01-22 17:11:07 -05:00
|
|
|
colorspace: string;
|
|
|
|
|
processInvalidImages: boolean;
|
|
|
|
|
raw?: RawImageInfo;
|
2026-01-09 17:59:52 -05:00
|
|
|
edits?: AssetEditActionItem[];
|
2026-01-23 09:54:04 -06:00
|
|
|
};
|
2025-01-22 17:11:07 -05:00
|
|
|
|
|
|
|
|
export interface DecodeToBufferOptions extends DecodeImageOptions {
|
2025-04-01 01:24:28 +08:00
|
|
|
size?: number;
|
2025-01-22 17:11:07 -05:00
|
|
|
orientation?: ExifOrientation;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-23 19:35:07 -05:00
|
|
|
export type GenerateThumbnailOptions = Pick<ImageOptions, 'format' | 'quality' | 'progressive'> & DecodeToBufferOptions;
|
2025-01-22 17:11:07 -05:00
|
|
|
export type GenerateThumbhashOptions = DecodeImageOptions;
|
|
|
|
|
|
|
|
|
|
export interface GenerateThumbnailsOptions {
|
|
|
|
|
colorspace: string;
|
|
|
|
|
preview?: ImageOptions;
|
|
|
|
|
processInvalidImages: boolean;
|
|
|
|
|
thumbhash?: boolean;
|
|
|
|
|
thumbnail?: ImageOptions;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoStreamInfo {
|
|
|
|
|
index: number;
|
|
|
|
|
height: number;
|
|
|
|
|
width: number;
|
|
|
|
|
rotation: number;
|
2026-05-04 09:04:29 -04:00
|
|
|
codecName: string | null;
|
|
|
|
|
profile: H264Profile | HevcProfile | Av1Profile | null;
|
|
|
|
|
level: number | null;
|
2025-01-22 17:11:07 -05:00
|
|
|
frameCount: number;
|
2026-05-04 09:04:29 -04:00
|
|
|
frameRate: number | null;
|
|
|
|
|
timeBase: number | null;
|
2025-01-22 17:11:07 -05:00
|
|
|
bitrate: number;
|
|
|
|
|
pixelFormat: string;
|
2026-05-01 13:03:49 -04:00
|
|
|
colorPrimaries: ColorPrimaries;
|
|
|
|
|
colorMatrix: ColorMatrix;
|
|
|
|
|
colorTransfer: ColorTransfer;
|
2026-05-04 09:04:29 -04:00
|
|
|
dvProfile: DvProfile | null;
|
|
|
|
|
dvLevel: number | null;
|
|
|
|
|
dvBlSignalCompatibilityId: DvSignalCompatibility | null;
|
2025-01-22 17:11:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface AudioStreamInfo {
|
|
|
|
|
index: number;
|
2026-05-04 09:04:29 -04:00
|
|
|
codecName: string | null;
|
|
|
|
|
profile: AacProfile | null;
|
2025-05-20 05:33:28 +08:00
|
|
|
bitrate: number;
|
2025-01-22 17:11:07 -05:00
|
|
|
}
|
|
|
|
|
|
2026-05-01 13:03:49 -04:00
|
|
|
/** Packet-derived video data needed for accurate HLS playlists. */
|
|
|
|
|
export interface VideoPacketInfo {
|
|
|
|
|
/** Sum of source packet duration across all packets (includes discard). */
|
|
|
|
|
totalDuration: number;
|
|
|
|
|
/** Post-discard packet count. */
|
|
|
|
|
packetCount: number;
|
|
|
|
|
/** Output CFR frame count at `packetCount / format.duration`. */
|
|
|
|
|
outputFrames: number;
|
|
|
|
|
/** All keyframe PTS in source ticks, including pre-roll discard keyframes. */
|
|
|
|
|
keyframePts: number[];
|
|
|
|
|
/** Cumulative packet duration through each keyframe, inclusive. */
|
|
|
|
|
keyframeAccDuration: number[];
|
|
|
|
|
/** Each keyframe's own packet duration (needed for VFR). */
|
|
|
|
|
keyframeOwnDuration: number[];
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-22 17:11:07 -05:00
|
|
|
export interface VideoFormat {
|
|
|
|
|
formatName?: string;
|
|
|
|
|
formatLongName?: string;
|
|
|
|
|
duration: number;
|
|
|
|
|
bitrate: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ImageDimensions {
|
|
|
|
|
width: number;
|
|
|
|
|
height: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface InputDimensions extends ImageDimensions {
|
|
|
|
|
inputPath: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoInfo {
|
|
|
|
|
format: VideoFormat;
|
|
|
|
|
videoStreams: VideoStreamInfo[];
|
|
|
|
|
audioStreams: AudioStreamInfo[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface TranscodeCommand {
|
|
|
|
|
inputOptions: string[];
|
|
|
|
|
outputOptions: string[];
|
|
|
|
|
twoPass: boolean;
|
|
|
|
|
progress: {
|
|
|
|
|
frameCount: number;
|
|
|
|
|
percentInterval: number;
|
|
|
|
|
};
|
|
|
|
|
}
|
|
|
|
|
|
2026-06-01 14:52:29 -04:00
|
|
|
export interface VideoTuning {
|
|
|
|
|
strictGop: boolean;
|
|
|
|
|
lowLatency: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface HlsCommandOptions {
|
|
|
|
|
initFilename: string;
|
|
|
|
|
inputPath: string;
|
|
|
|
|
packetCount: number;
|
|
|
|
|
playlistFilename: string;
|
|
|
|
|
seekSeconds?: number;
|
|
|
|
|
segmentDuration: number;
|
|
|
|
|
segmentFilename: string;
|
|
|
|
|
startSegment: number;
|
|
|
|
|
target: TranscodeTarget;
|
|
|
|
|
timeBase: number;
|
|
|
|
|
totalDuration: number;
|
|
|
|
|
}
|
|
|
|
|
|
2025-01-22 17:11:07 -05:00
|
|
|
export interface BitrateDistribution {
|
|
|
|
|
max: number;
|
|
|
|
|
target: number;
|
|
|
|
|
min: number;
|
|
|
|
|
unit: string;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ImageBuffer {
|
|
|
|
|
data: Buffer;
|
|
|
|
|
info: RawImageInfo;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoCodecSWConfig {
|
|
|
|
|
getCommand(
|
|
|
|
|
target: TranscodeTarget,
|
2026-06-01 14:52:29 -04:00
|
|
|
video: VideoStreamInfo,
|
|
|
|
|
audio?: AudioStreamInfo,
|
2025-01-22 17:11:07 -05:00
|
|
|
format?: VideoFormat,
|
|
|
|
|
): TranscodeCommand;
|
2026-06-01 14:52:29 -04:00
|
|
|
getHlsCommand(options: HlsCommandOptions, video: VideoStreamInfo, audio?: AudioStreamInfo): string[];
|
2025-01-22 17:11:07 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ProbeOptions {
|
|
|
|
|
countFrames: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface VideoInterfaces {
|
|
|
|
|
dri: string[];
|
|
|
|
|
mali: boolean;
|
|
|
|
|
}
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
export type ConcurrentQueueName = Exclude<
|
|
|
|
|
QueueName,
|
2025-07-15 14:50:13 -04:00
|
|
|
| QueueName.StorageTemplateMigration
|
|
|
|
|
| QueueName.FacialRecognition
|
|
|
|
|
| QueueName.DuplicateDetection
|
|
|
|
|
| QueueName.BackupDatabase
|
2025-02-11 17:15:56 -05:00
|
|
|
>;
|
|
|
|
|
|
|
|
|
|
export type Jobs = { [K in JobItem['name']]: (JobItem & { name: K })['data'] };
|
|
|
|
|
export type JobOf<T extends JobName> = Jobs[T];
|
|
|
|
|
|
|
|
|
|
export interface IBaseJob {
|
|
|
|
|
force?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IDelayedJob extends IBaseJob {
|
|
|
|
|
/** The minimum time to wait to execute this job, in milliseconds. */
|
|
|
|
|
delay?: number;
|
|
|
|
|
}
|
|
|
|
|
|
2026-01-09 17:59:52 -05:00
|
|
|
export type JobSource = 'upload' | 'sidecar-write' | 'copy' | 'edit';
|
2025-02-11 17:15:56 -05:00
|
|
|
export interface IEntityJob extends IBaseJob {
|
|
|
|
|
id: string;
|
2025-04-30 17:02:53 -04:00
|
|
|
source?: JobSource;
|
2025-02-11 17:15:56 -05:00
|
|
|
notify?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IAssetDeleteJob extends IEntityJob {
|
|
|
|
|
deleteOnDisk: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
2025-03-06 16:00:18 +01:00
|
|
|
export interface ILibraryFileJob {
|
|
|
|
|
libraryId: string;
|
|
|
|
|
paths: string[];
|
|
|
|
|
progressCounter?: number;
|
|
|
|
|
totalAssets?: number;
|
2025-02-11 17:15:56 -05:00
|
|
|
}
|
|
|
|
|
|
2025-03-06 16:00:18 +01:00
|
|
|
export interface ILibraryBulkIdsJob {
|
|
|
|
|
libraryId: string;
|
2025-02-11 17:15:56 -05:00
|
|
|
importPaths: string[];
|
|
|
|
|
exclusionPatterns: string[];
|
2025-03-06 16:00:18 +01:00
|
|
|
assetIds: string[];
|
|
|
|
|
progressCounter: number;
|
|
|
|
|
totalAssets: number;
|
2025-02-11 17:15:56 -05:00
|
|
|
}
|
|
|
|
|
|
2025-03-06 16:00:18 +01:00
|
|
|
export interface IBulkEntityJob {
|
2025-02-11 17:15:56 -05:00
|
|
|
ids: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IDeleteFilesJob extends IBaseJob {
|
|
|
|
|
files: Array<string | null | undefined>;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ISidecarWriteJob extends IEntityJob {
|
|
|
|
|
tags?: true;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IDeferrableJob extends IEntityJob {
|
|
|
|
|
deferred?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface INightlyJob extends IBaseJob {
|
|
|
|
|
nightly?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type EmailImageAttachment = {
|
|
|
|
|
filename: string;
|
|
|
|
|
path: string;
|
|
|
|
|
cid: string;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
export interface IEmailJob {
|
|
|
|
|
to: string;
|
|
|
|
|
subject: string;
|
|
|
|
|
html: string;
|
|
|
|
|
text: string;
|
|
|
|
|
imageAttachments?: EmailImageAttachment[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface INotifySignupJob extends IEntityJob {
|
2025-09-10 09:11:42 -04:00
|
|
|
password?: string;
|
2025-02-11 17:15:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface INotifyAlbumInviteJob extends IEntityJob {
|
|
|
|
|
recipientId: string;
|
2026-04-22 16:52:23 +02:00
|
|
|
senderName: string;
|
2025-02-11 17:15:56 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface INotifyAlbumUpdateJob extends IEntityJob, IDelayedJob {
|
2025-04-30 22:45:35 +01:00
|
|
|
recipientId: string;
|
2025-02-11 17:15:56 -05:00
|
|
|
}
|
|
|
|
|
|
2026-05-18 11:09:33 -04:00
|
|
|
export type IWorkflowJob<T extends WorkflowType = WorkflowType> = {
|
2025-11-14 14:05:05 -06:00
|
|
|
id: string;
|
2026-05-18 11:09:33 -04:00
|
|
|
trigger: WorkflowTrigger;
|
2025-11-14 14:05:05 -06:00
|
|
|
type: T;
|
2026-05-18 11:09:33 -04:00
|
|
|
};
|
2025-11-14 14:05:05 -06:00
|
|
|
|
2026-06-10 21:02:27 +02:00
|
|
|
export interface IIntegrityJob {
|
|
|
|
|
refreshOnly?: boolean;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityDeleteReportTypeJob {
|
|
|
|
|
type?: IntegrityReport;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityDeleteReportsJob {
|
|
|
|
|
reports: {
|
|
|
|
|
id: string;
|
|
|
|
|
assetId: string | null;
|
|
|
|
|
fileAssetId: string | null;
|
|
|
|
|
path: string;
|
|
|
|
|
}[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityUntrackedFilesJob {
|
|
|
|
|
type: 'asset' | 'asset_file';
|
|
|
|
|
paths: string[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityMissingFilesJob {
|
|
|
|
|
items: ({ path: string; reportId: string | null } & (
|
2026-07-16 20:14:05 +02:00
|
|
|
{ assetId: string; fileAssetId: null } | { assetId: null; fileAssetId: string }
|
2026-06-10 21:02:27 +02:00
|
|
|
))[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityPathWithReportJob {
|
|
|
|
|
items: { path: string; reportId: string | null }[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IIntegrityPathWithChecksumJob {
|
|
|
|
|
items: { path: string; reportId: string | null; checksum?: string | null }[];
|
|
|
|
|
}
|
|
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
export interface JobCounts {
|
|
|
|
|
active: number;
|
|
|
|
|
completed: number;
|
|
|
|
|
failed: number;
|
|
|
|
|
delayed: number;
|
|
|
|
|
waiting: number;
|
|
|
|
|
paused: number;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type JobItem =
|
2025-09-03 18:50:27 -04:00
|
|
|
// Audit
|
|
|
|
|
| { name: JobName.AuditTableCleanup; data?: IBaseJob }
|
|
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
// Backups
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.DatabaseBackup; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Transcoding
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetEncodeVideoQueueAll; data: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetEncodeVideo; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Thumbnails
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetGenerateThumbnailsQueueAll; data: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetGenerateThumbnails; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// User
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.UserDeleteCheck; data?: IBaseJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.UserDelete; data: IEntityJob }
|
|
|
|
|
| { name: JobName.UserSyncUsage; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Storage Template
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.StorageTemplateMigration; data?: IBaseJob }
|
|
|
|
|
| { name: JobName.StorageTemplateMigrationSingle; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Migration
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.FileMigrationQueueAll; data?: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetFileMigration; data: IEntityJob }
|
|
|
|
|
| { name: JobName.PersonFileMigration; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Metadata Extraction
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetExtractMetadataQueueAll; data: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetExtractMetadata; data: IEntityJob }
|
2025-04-28 10:36:14 -04:00
|
|
|
|
|
|
|
|
// Notifications
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.NotificationsCleanup; data?: IBaseJob }
|
2025-04-28 10:36:14 -04:00
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
// Sidecar Scanning
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.SidecarQueueAll; data: IBaseJob }
|
2025-09-04 12:23:58 -04:00
|
|
|
| { name: JobName.SidecarCheck; data: IEntityJob }
|
2026-01-21 09:30:45 -06:00
|
|
|
| { name: JobName.SidecarWrite; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Facial Recognition
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetDetectFacesQueueAll; data: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetDetectFaces; data: IEntityJob }
|
|
|
|
|
| { name: JobName.FacialRecognitionQueueAll; data: INightlyJob }
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.FacialRecognition; data: IDeferrableJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.PersonGenerateThumbnail; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Smart Search
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.SmartSearchQueueAll; data: IBaseJob }
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.SmartSearch; data: IEntityJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetEmptyTrash; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Duplicate Detection
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetDetectDuplicatesQueueAll; data: IBaseJob }
|
|
|
|
|
| { name: JobName.AssetDetectDuplicates; data: IEntityJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
2025-02-21 13:31:37 -05:00
|
|
|
// Memories
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.MemoryCleanup; data?: IBaseJob }
|
|
|
|
|
| { name: JobName.MemoryGenerate; data?: IBaseJob }
|
2025-02-21 13:31:37 -05:00
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
// Filesystem
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.FileDelete; data: IDeleteFilesJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Cleanup
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.SessionCleanup; data?: IBaseJob }
|
2026-06-01 14:52:29 -04:00
|
|
|
| { name: JobName.HlsSessionCleanup; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Tags
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.TagCleanup; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Asset Deletion
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.PersonCleanup; data?: IBaseJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.AssetDelete; data: IAssetDeleteJob }
|
|
|
|
|
| { name: JobName.AssetDeleteCheck; data?: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Library Management
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.LibrarySyncFiles; data: ILibraryFileJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.LibrarySyncFilesQueueAll; data: IEntityJob }
|
|
|
|
|
| { name: JobName.LibrarySyncAssetsQueueAll; data: IEntityJob }
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.LibrarySyncAssets; data: ILibraryBulkIdsJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.LibraryRemoveAsset; data: ILibraryFileJob }
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.LibraryDelete; data: IEntityJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.LibraryScanQueueAll; data?: IBaseJob }
|
|
|
|
|
| { name: JobName.LibraryDeleteCheck; data: IBaseJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Notification
|
2025-07-15 14:50:13 -04:00
|
|
|
| { name: JobName.SendMail; data: IEmailJob }
|
|
|
|
|
| { name: JobName.NotifyAlbumInvite; data: INotifyAlbumInviteJob }
|
|
|
|
|
| { name: JobName.NotifyAlbumUpdate; data: INotifyAlbumUpdateJob }
|
2025-07-15 18:39:00 -04:00
|
|
|
| { name: JobName.NotifyUserSignup; data: INotifySignupJob }
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
// Version check
|
2025-10-27 22:09:55 +08:00
|
|
|
| { name: JobName.VersionCheck; data: IBaseJob }
|
|
|
|
|
|
|
|
|
|
// OCR
|
|
|
|
|
| { name: JobName.OcrQueueAll; data: IBaseJob }
|
2025-11-14 14:05:05 -06:00
|
|
|
| { name: JobName.Ocr; data: IEntityJob }
|
|
|
|
|
|
|
|
|
|
// Workflow
|
2026-05-28 17:23:49 -04:00
|
|
|
| { name: JobName.WorkflowAssetTrigger; data: { workflowId: string; assetId: string } }
|
2026-01-09 17:59:52 -05:00
|
|
|
|
2026-06-10 21:02:27 +02:00
|
|
|
// Integrity
|
|
|
|
|
| { name: JobName.IntegrityUntrackedFilesQueueAll; data?: IIntegrityJob }
|
|
|
|
|
| { name: JobName.IntegrityUntrackedFiles; data: IIntegrityUntrackedFilesJob }
|
|
|
|
|
| { name: JobName.IntegrityUntrackedFilesRefresh; data: IIntegrityPathWithReportJob }
|
|
|
|
|
| { name: JobName.IntegrityMissingFilesQueueAll; data?: IIntegrityJob }
|
|
|
|
|
| { name: JobName.IntegrityMissingFiles; data: IIntegrityPathWithReportJob }
|
|
|
|
|
| { name: JobName.IntegrityMissingFilesRefresh; data: IIntegrityPathWithReportJob }
|
|
|
|
|
| { name: JobName.IntegrityChecksumFiles; data?: IIntegrityJob }
|
|
|
|
|
| { name: JobName.IntegrityChecksumFilesRefresh; data?: IIntegrityPathWithChecksumJob }
|
|
|
|
|
| { name: JobName.IntegrityDeleteReportType; data: IIntegrityDeleteReportTypeJob }
|
|
|
|
|
| { name: JobName.IntegrityDeleteReports; data: IIntegrityDeleteReportsJob }
|
|
|
|
|
|
2026-01-09 17:59:52 -05:00
|
|
|
// Editor
|
|
|
|
|
| { name: JobName.AssetEditThumbnailGeneration; data: IEntityJob };
|
2025-02-11 17:15:56 -05:00
|
|
|
|
2025-05-20 09:36:43 -04:00
|
|
|
export type VectorExtension = (typeof VECTOR_EXTENSIONS)[number];
|
2025-02-11 17:15:56 -05:00
|
|
|
|
|
|
|
|
export interface ExtensionVersion {
|
2025-05-21 09:53:40 -04:00
|
|
|
name: VectorExtension;
|
2025-02-11 17:15:56 -05:00
|
|
|
availableVersion: string | null;
|
|
|
|
|
installedVersion: string | null;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface ImmichFile extends Express.Multer.File {
|
|
|
|
|
uuid: string;
|
2025-09-04 12:23:58 -04:00
|
|
|
/** sha1 hash of file */
|
2025-02-11 17:15:56 -05:00
|
|
|
checksum: Buffer;
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface UploadFile {
|
|
|
|
|
uuid: string;
|
|
|
|
|
checksum: Buffer;
|
|
|
|
|
originalPath: string;
|
|
|
|
|
originalName: string;
|
|
|
|
|
size: number;
|
|
|
|
|
}
|
|
|
|
|
|
2025-11-13 21:56:34 +05:30
|
|
|
export interface UploadBody {
|
|
|
|
|
filename?: string;
|
|
|
|
|
[key: string]: unknown;
|
|
|
|
|
}
|
|
|
|
|
|
2025-09-02 14:26:12 -05:00
|
|
|
export type UploadRequest = {
|
|
|
|
|
auth: AuthDto | null;
|
|
|
|
|
fieldName: UploadFieldName;
|
|
|
|
|
file: UploadFile;
|
2025-11-13 21:56:34 +05:30
|
|
|
body: UploadBody;
|
2025-09-02 14:26:12 -05:00
|
|
|
};
|
|
|
|
|
|
2025-02-11 17:15:56 -05:00
|
|
|
export interface UploadFiles {
|
|
|
|
|
assetData: ImmichFile[];
|
|
|
|
|
sidecarData: ImmichFile[];
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export interface IBulkAsset {
|
|
|
|
|
getAssetIds: (id: string, assetIds: string[]) => Promise<Set<string>>;
|
|
|
|
|
addAssetIds: (id: string, assetIds: string[]) => Promise<void>;
|
|
|
|
|
removeAssetIds: (id: string, assetIds: string[]) => Promise<void>;
|
|
|
|
|
}
|
2025-02-21 04:37:57 +00:00
|
|
|
|
|
|
|
|
export type SyncAck = {
|
|
|
|
|
type: SyncEntityType;
|
2025-02-27 14:22:02 +00:00
|
|
|
updateId: string;
|
2025-06-17 14:56:54 +01:00
|
|
|
extraId?: string;
|
2025-02-21 04:37:57 +00:00
|
|
|
};
|
2025-03-07 14:30:01 -05:00
|
|
|
|
|
|
|
|
export type StorageAsset = {
|
|
|
|
|
id: string;
|
|
|
|
|
ownerId: string;
|
|
|
|
|
livePhotoVideoId: string | null;
|
|
|
|
|
type: AssetType;
|
|
|
|
|
isExternal: boolean;
|
|
|
|
|
checksum: Buffer;
|
|
|
|
|
timeZone: string | null;
|
|
|
|
|
fileCreatedAt: Date;
|
|
|
|
|
originalPath: string;
|
|
|
|
|
originalFileName: string;
|
|
|
|
|
fileSizeInByte: number | null;
|
2025-12-02 19:31:43 +01:00
|
|
|
files: AssetFile[];
|
2025-12-29 16:55:06 -05:00
|
|
|
make: string | null;
|
|
|
|
|
model: string | null;
|
|
|
|
|
lensModel: string | null;
|
2025-03-07 14:30:01 -05:00
|
|
|
};
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
export type OnThisDayData = { year: number };
|
|
|
|
|
|
|
|
|
|
export interface MemoryData {
|
2025-07-15 14:50:13 -04:00
|
|
|
[MemoryType.OnThisDay]: OnThisDayData;
|
2025-03-28 10:40:09 -04:00
|
|
|
}
|
|
|
|
|
|
|
|
|
|
export type VersionCheckMetadata = { checkedAt: string; releaseVersion: string };
|
|
|
|
|
export type SystemFlags = { mountChecks: Record<StorageFolder, boolean> };
|
feat: restore database backups (#23978)
* feat: ProcessRepository#createSpawnDuplexStream
* test: write tests for ProcessRepository#createSpawnDuplexStream
* feat: StorageRepository#createGzip,createGunzip,createPlainReadStream
* feat: backups util (args, create, restore, progress)
* feat: wait on maintenance operation lock on boot
* chore: use backup util from backup.service.ts
test: update backup.service.ts tests with new util
* feat: list/delete backups (maintenance services)
* chore: open api
fix: missing action in cli.service.ts
* chore: add missing repositories to MaintenanceModule
* refactor: move logSecret into module init
* feat: initialise StorageCore in maintenance mode
* feat: authenticate websocket requests in maintenance mode
* test: add mock for new storage fns
* feat: add MaintenanceEphemeralStateRepository
refactor: cache the secret in memory
* test: update service worker tests
* feat: add external maintenance mode status
* feat: synchronised status, restore db action
* test: backup restore service tests
* refactor: DRY end maintenance
* feat: list and delete backup routes
* feat: start action on boot
* fix: should set status on restore end
* refactor: add maintenanceStore to hold writables
* feat: sync status to web app
* feat: web impl.
* test: various utils for testings
* test: web e2e tests
* test: e2e maintenance spec
* test: update cli spec
* chore: e2e lint
* chore: lint fixes
* chore: lint fixes
* feat: start restore flow route
* test: update e2e tests
* chore: remove neon lights on maintenance action pages
* fix: use 'startRestoreFlow' on onboarding page
* chore: ignore any library folder in `docker/`
* fix: load status on boot
* feat: upload backups
* refactor: permit any .sql(.gz) to be listed/restored
* feat: download backups from list
* fix: permit uploading just .sql files
* feat: restore just .sql files
* fix: don't show backups list if logged out
* feat: system integrity check in restore flow
* test: not providing failed backups in API anymore
* test: util should also not try to use failedBackups
* fix: actually assign inputStream
* test: correct test backup prep.
* fix: ensure task is defined to show error
* test: fix docker cp command
* test: update e2e web spec to select next button
* test: update e2e api tests
* test: refactor timeouts
* chore: remove `showDelete` from maint. settings
* chore: lint
* chore: lint
* fix: make sure backups are correctly sorted for clean up
* test: update service spec
* test: adjust e2e timeout
* test: increase web timeouts for ci
* chore: move gitignore changes
* chore: additional filename validation
* refactor: better typings for integrity API
* feat: higher accuracy progress tracking
* chore: delay lock retry
* refactor: remove old maintenance settings
* refactor: clean up tailwind classes
* refactor: use while loop rather than recursive calls
* test: update service specs
* chore: check canParse too
* chore: lint
* fix: logic error causing infinite loop
* refactor: use <ProgressBar /> from ui library
* fix: create or overwrite file
* chore: i18n pass, update progress bar
* fix: wrong translation string
* chore: update colour variables
* test: update web test for new maint. page
* chore: format, fix key
* test: update tests to be more linter complaint & use new routines
* chore: update onClick -> onAction, title -> breadcrumbs
* fix: use wrench icon in admin settings sidebar
* chore: add translation strings to accordion
* chore: lint
* refactor: move maintenance worker init into service
* refactor: `maintenanceStatus` -> `getMaintenanceStatus`
refactor: `integrityCheck` -> `detectPriorInstall`
chore: add `v2.4.0` version
refactor: `/backups/list` -> `/backups`
refactor: use sendFile in download route
refactor: use separate backups permissions
chore: correct descriptions
refactor: permit handler that doesn't return promise for sendfile
* refactor: move status impl into service
refactor: add active flag to maintenance status
* refactor: split into database backup controller
* test: split api e2e tests and passing
* fix: move end button into authed default maint page
* fix: also show in restore flow
* fix: import getMaintenanceStatus
* test: split web e2e tests
* refactor: ensure detect install is consistently named
* chore: ensure admin for detect install while out of maint.
* refactor: remove state repository
* test: update maint. worker service spec
* test: split backup service spec
* refactor: rename db backup routes
* refactor: instead of param, allow bulk backup deletion
* test: update sdk use in e2e test
* test: correct deleteBackup call
* fix: correct type for serverinstall response dto
* chore: validate filename for deletion
* test: wip
* test: backups no longer take path param
* refactor: scope util to database-backups instead of backups
* fix: update worker controller with new route
* chore: use new admin page actions
* chore: remove stray comment
* test: rename outdated test
* refactor: getter pattern for maintenance secret
* refactor: `createSpawnDuplexStream` -> `spawnDuplexStream`
* refactor: prefer `Object.assign`
* refactor: remove useless try {} block
* refactor: prefer `type Props`
refactor: prefer arrow function
* refactor: use luxon API for minutesAgo
* chore: remove change to gitignore
* refactor: prefer `type Props`
* refactor: remove async from onMount
* refactor: use luxon toRelative for relative time
* refactor: duplicate logic check
* chore: open api
* refactor: begin moving code into web//services
* refactor: don't use template string with $t
* test: use dialog role to match prompt
* refactor: split actions into flow/restore
* test: fix action value
* refactor: move more service calls into web//services
* chore: should void fn return
* chore: bump 2.4.0 to 2.5.0 in controller
* chore: bump 2.4.0 to 2.5.0 in controller
* refactor: use events for web//services
* chore: open api
* chore: open api
* refactor: don't await returned promise
* refactor: remove redundant check
* refactor: add `type: command` to actions
* refactor: split backup entries into own component
* refactor: split restore flow into separate components
* refactor(web): split BackupDelete event
* chore: stylings
* chore: stylings
* fix: don't log query failure on first boot
* feat: support pg_dumpall backups
* feat: display information about each backup
* chore: i18n
* feat: rollback to restore point on migrations failure
* feat: health check after restore
* chore: format
* refactor: split health check into separate function
* refactor: split health into repository
test: write tests covering rollbacks
* fix: omit 'health' requirement from createDbBackup
* test(e2e): rollback test
* fix: wrap text in backup entry
* fix: don't shrink context menu button
* fix: correct CREATE DB syntax for postgres
* test: rename backups generated by test
* feat: add filesize to backup response dto
* feat: restore list
* feat: ui work
* fix: e2e test
* fix: e2e test
* pr feedback
* pr feedback
---------
Co-authored-by: Alex <alex.tran1502@gmail.com>
Co-authored-by: Jason Rasmussen <jason@rasm.me>
2026-01-20 15:22:28 +00:00
|
|
|
export type MaintenanceModeState =
|
2026-07-16 20:14:05 +02:00
|
|
|
{ isMaintenanceMode: true; secret: string; action?: SetMaintenanceModeDto } | { isMaintenanceMode: false };
|
2025-03-28 10:40:09 -04:00
|
|
|
export type MemoriesState = {
|
|
|
|
|
/** memories have already been created through this date */
|
|
|
|
|
lastOnThisDayDate: string;
|
|
|
|
|
};
|
2025-07-18 10:57:29 -04:00
|
|
|
export type MediaLocation = { location: string };
|
2025-03-28 10:40:09 -04:00
|
|
|
|
|
|
|
|
export interface SystemMetadata extends Record<SystemMetadataKey, Record<string, any>> {
|
2025-07-15 14:50:13 -04:00
|
|
|
[SystemMetadataKey.AdminOnboarding]: { isOnboarded: boolean };
|
|
|
|
|
[SystemMetadataKey.FacialRecognitionState]: { lastRun?: string };
|
|
|
|
|
[SystemMetadataKey.License]: { licenseKey: string; activationKey: string; activatedAt: Date };
|
2025-11-17 17:15:44 +00:00
|
|
|
[SystemMetadataKey.MaintenanceMode]: MaintenanceModeState;
|
2025-07-18 10:57:29 -04:00
|
|
|
[SystemMetadataKey.MediaLocation]: MediaLocation;
|
2025-07-15 14:50:13 -04:00
|
|
|
[SystemMetadataKey.ReverseGeocodingState]: { lastUpdate?: string; lastImportFileName?: string };
|
|
|
|
|
[SystemMetadataKey.SystemConfig]: DeepPartial<SystemConfig>;
|
|
|
|
|
[SystemMetadataKey.SystemFlags]: DeepPartial<SystemFlags>;
|
|
|
|
|
[SystemMetadataKey.VersionCheckState]: VersionCheckMetadata;
|
|
|
|
|
[SystemMetadataKey.MemoriesState]: MemoriesState;
|
2026-06-10 21:02:27 +02:00
|
|
|
[SystemMetadataKey.IntegrityChecksumCheckpoint]: { date?: string };
|
2025-03-28 10:40:09 -04:00
|
|
|
}
|
2025-04-09 11:45:30 -04:00
|
|
|
|
2026-01-23 09:54:04 -06:00
|
|
|
export type UserPreferences = {
|
2025-06-06 06:31:34 +02:00
|
|
|
albums: {
|
|
|
|
|
defaultAssetOrder: AssetOrder;
|
|
|
|
|
};
|
2025-04-09 11:45:30 -04:00
|
|
|
folders: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
sidebarWeb: boolean;
|
|
|
|
|
};
|
|
|
|
|
memories: {
|
|
|
|
|
enabled: boolean;
|
2025-11-08 23:46:43 +01:00
|
|
|
duration: number;
|
2025-04-09 11:45:30 -04:00
|
|
|
};
|
|
|
|
|
people: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
sidebarWeb: boolean;
|
2026-06-02 09:05:55 -07:00
|
|
|
minimumFaces: number;
|
2025-04-09 11:45:30 -04:00
|
|
|
};
|
|
|
|
|
ratings: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
};
|
|
|
|
|
sharedLinks: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
sidebarWeb: boolean;
|
|
|
|
|
};
|
|
|
|
|
tags: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
sidebarWeb: boolean;
|
|
|
|
|
};
|
|
|
|
|
emailNotifications: {
|
|
|
|
|
enabled: boolean;
|
|
|
|
|
albumInvite: boolean;
|
|
|
|
|
albumUpdate: boolean;
|
|
|
|
|
};
|
|
|
|
|
download: {
|
|
|
|
|
archiveSize: number;
|
|
|
|
|
includeEmbeddedVideos: boolean;
|
|
|
|
|
};
|
|
|
|
|
purchase: {
|
|
|
|
|
showSupportBadge: boolean;
|
|
|
|
|
hideBuyButtonUntil: string;
|
|
|
|
|
};
|
2025-05-28 15:57:36 -05:00
|
|
|
cast: {
|
|
|
|
|
gCastEnabled: boolean;
|
|
|
|
|
};
|
2026-07-01 16:12:50 -07:00
|
|
|
recentlyAdded: {
|
|
|
|
|
sidebarWeb: boolean;
|
|
|
|
|
};
|
2026-01-23 09:54:04 -06:00
|
|
|
};
|
2025-04-09 11:45:30 -04:00
|
|
|
|
2025-08-27 14:31:23 -04:00
|
|
|
export type UserMetadataItem<T extends keyof UserMetadata = UserMetadataKey> = {
|
|
|
|
|
key: T;
|
|
|
|
|
value: UserMetadata[T];
|
|
|
|
|
};
|
|
|
|
|
|
2025-04-09 11:45:30 -04:00
|
|
|
export interface UserMetadata extends Record<UserMetadataKey, Record<string, any>> {
|
2025-07-15 14:50:13 -04:00
|
|
|
[UserMetadataKey.Preferences]: DeepPartial<UserPreferences>;
|
|
|
|
|
[UserMetadataKey.License]: { licenseKey: string; activationKey: string; activatedAt: string };
|
|
|
|
|
[UserMetadataKey.Onboarding]: { isOnboarded: boolean };
|
2025-04-09 11:45:30 -04:00
|
|
|
}
|
2026-03-11 16:17:31 +01:00
|
|
|
|
|
|
|
|
export type MaybeDehydrated<T> = T | ShallowDehydrateObject<T>;
|
2026-05-18 11:09:33 -04:00
|
|
|
|
|
|
|
|
export type JSONSchemaType = 'string' | 'number' | 'integer' | 'boolean' | 'object';
|
|
|
|
|
|
|
|
|
|
export type JSONSchemaProperty = {
|
|
|
|
|
type: JSONSchemaType;
|
|
|
|
|
description?: string;
|
|
|
|
|
default?: any;
|
|
|
|
|
enum?: string[];
|
|
|
|
|
array?: boolean;
|
|
|
|
|
properties?: Record<string, JSONSchemaProperty>;
|
|
|
|
|
required?: string[];
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
// eslint-disable-next-line @typescript-eslint/no-unsafe-function-type
|
|
|
|
|
export interface ClassConstructor<T = any> extends Function {
|
|
|
|
|
new (...args: any[]): T;
|
|
|
|
|
}
|