- volume-aware deletion: read-only volumes remove DB only, writable volumes soft-delete to trash with configurable grace period - trash page with restore, worker purge sweep (TRASH_RETENTION_DAYS) - album delete endpoint + sidebar trash icon - asset delete from timeline selection toolbar - all listing queries exclude trashed assets (deleted_at IS NULL) - timeline ordered by EXIF capture date, date-summary endpoint - README rewritten with features, setup, full env var table
139 lines
5.2 KiB
Rust
139 lines
5.2 KiB
Rust
use std::sync::Arc;
|
|
|
|
use application::{
|
|
catalog::{
|
|
CreateStackHandler, DeleteAssetHandler, DeleteStackHandler, DetectLivePhotosHandler,
|
|
GetAssetHandler, GetDateSummaryHandler, GetStackHandler, GetTimelineHandler,
|
|
ListDuplicatesHandler, ListStacksHandler, ListTrashHandler, ReadAssetFileHandler,
|
|
ReadDerivativeHandler, RegisterAssetHandler, ResolveDuplicateHandler,
|
|
RestoreAssetHandler, SearchAssetsHandler, UpdateMetadataHandler,
|
|
},
|
|
identity::{
|
|
GetProfileHandler, LoginUserHandler, LogoutHandler, RefreshTokenHandler,
|
|
RegisterUserHandler,
|
|
},
|
|
organization::{
|
|
CreateAlbumHandler, DeleteAlbumHandler, GetAlbumHandler, ListAlbumsHandler,
|
|
ManageAlbumEntriesHandler, TagAssetHandler, UpdateAlbumHandler,
|
|
},
|
|
processing::{
|
|
CompleteJobHandler, ConfigurePipelineHandler, EnqueueJobHandler, FailJobHandler,
|
|
ListJobsHandler, ListPipelinesHandler, ListPluginsHandler, ManagePluginHandler,
|
|
ReportBatchProgressHandler, StartJobHandler,
|
|
},
|
|
sharing::{
|
|
AccessSharedResourceHandler, GenerateShareLinkHandler, RevokeShareHandler,
|
|
ShareResourceHandler,
|
|
},
|
|
sidecar::{
|
|
DetectExternalChangesHandler, ExportSidecarHandler, FullExportHandler, FullImportHandler,
|
|
ImportSidecarHandler, ResolveConflictHandler,
|
|
},
|
|
storage::{
|
|
CheckQuotaHandler, DeleteLibraryPathHandler, DeleteVolumeHandler, IngestAssetHandler,
|
|
ListAllLibraryPathsHandler, ListIngestPathsHandler, ListVolumesHandler,
|
|
RegisterLibraryPathHandler, RegisterVolumeHandler,
|
|
},
|
|
};
|
|
use domain::ports::{RefreshTokenRepository, TokenIssuer};
|
|
|
|
#[derive(Clone)]
|
|
pub struct IdentityHandlers {
|
|
pub register: Arc<RegisterUserHandler>,
|
|
pub login: Arc<LoginUserHandler>,
|
|
pub get_profile: Arc<GetProfileHandler>,
|
|
pub refresh: Arc<RefreshTokenHandler>,
|
|
pub logout: Arc<LogoutHandler>,
|
|
pub refresh_token_repo: Arc<dyn RefreshTokenRepository>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct CatalogHandlers {
|
|
pub ingest_asset: Arc<IngestAssetHandler>,
|
|
pub get_asset: Arc<GetAssetHandler>,
|
|
pub get_timeline: Arc<GetTimelineHandler>,
|
|
pub get_date_summary: Arc<GetDateSummaryHandler>,
|
|
pub update_metadata: Arc<UpdateMetadataHandler>,
|
|
pub read_asset_file: Arc<ReadAssetFileHandler>,
|
|
pub read_derivative: Arc<ReadDerivativeHandler>,
|
|
pub register_asset: Arc<RegisterAssetHandler>,
|
|
pub delete_asset: Arc<DeleteAssetHandler>,
|
|
pub restore_asset: Arc<RestoreAssetHandler>,
|
|
pub list_trash: Arc<ListTrashHandler>,
|
|
pub search_assets: Arc<SearchAssetsHandler>,
|
|
pub list_duplicates: Arc<ListDuplicatesHandler>,
|
|
pub resolve_duplicate: Arc<ResolveDuplicateHandler>,
|
|
pub create_stack: Arc<CreateStackHandler>,
|
|
pub get_stack: Arc<GetStackHandler>,
|
|
pub delete_stack: Arc<DeleteStackHandler>,
|
|
pub detect_live_photos: Arc<DetectLivePhotosHandler>,
|
|
pub list_stacks: Arc<ListStacksHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct OrganizationHandlers {
|
|
pub create_album: Arc<CreateAlbumHandler>,
|
|
pub delete_album: Arc<DeleteAlbumHandler>,
|
|
pub get_album: Arc<GetAlbumHandler>,
|
|
pub list_albums: Arc<ListAlbumsHandler>,
|
|
pub manage_album_entries: Arc<ManageAlbumEntriesHandler>,
|
|
pub update_album: Arc<UpdateAlbumHandler>,
|
|
pub tag_asset: Arc<TagAssetHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct StorageHandlers {
|
|
pub register_volume: Arc<RegisterVolumeHandler>,
|
|
pub delete_volume: Arc<DeleteVolumeHandler>,
|
|
pub list_volumes: Arc<ListVolumesHandler>,
|
|
pub register_library_path: Arc<RegisterLibraryPathHandler>,
|
|
pub list_ingest_paths: Arc<ListIngestPathsHandler>,
|
|
pub list_all_library_paths: Arc<ListAllLibraryPathsHandler>,
|
|
pub delete_library_path: Arc<DeleteLibraryPathHandler>,
|
|
pub check_quota: Arc<CheckQuotaHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct SharingHandlers {
|
|
pub share_resource: Arc<ShareResourceHandler>,
|
|
pub generate_link: Arc<GenerateShareLinkHandler>,
|
|
pub revoke: Arc<RevokeShareHandler>,
|
|
pub access: Arc<AccessSharedResourceHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct SidecarHandlers {
|
|
pub export: Arc<ExportSidecarHandler>,
|
|
pub detect_changes: Arc<DetectExternalChangesHandler>,
|
|
pub import: Arc<ImportSidecarHandler>,
|
|
pub resolve: Arc<ResolveConflictHandler>,
|
|
pub full_export: Arc<FullExportHandler>,
|
|
pub full_import: Arc<FullImportHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct ProcessingHandlers {
|
|
pub enqueue_job: Arc<EnqueueJobHandler>,
|
|
pub start_job: Arc<StartJobHandler>,
|
|
pub complete_job: Arc<CompleteJobHandler>,
|
|
pub fail_job: Arc<FailJobHandler>,
|
|
pub list_jobs: Arc<ListJobsHandler>,
|
|
pub batch_progress: Arc<ReportBatchProgressHandler>,
|
|
pub manage_plugin: Arc<ManagePluginHandler>,
|
|
pub list_plugins: Arc<ListPluginsHandler>,
|
|
pub configure_pipeline: Arc<ConfigurePipelineHandler>,
|
|
pub list_pipelines: Arc<ListPipelinesHandler>,
|
|
}
|
|
|
|
#[derive(Clone)]
|
|
pub struct AppState {
|
|
pub identity: IdentityHandlers,
|
|
pub catalog: CatalogHandlers,
|
|
pub organization: OrganizationHandlers,
|
|
pub storage: StorageHandlers,
|
|
pub sharing: SharingHandlers,
|
|
pub sidecar: SidecarHandlers,
|
|
pub processing: ProcessingHandlers,
|
|
pub token_issuer: Arc<dyn TokenIssuer>,
|
|
}
|