mirror of
https://github.com/immich-app/immich.git
synced 2025-12-23 09:15:05 +03:00
refactor: split integrity out of maintenance controller/service
This commit is contained in:
@@ -40,9 +40,6 @@ export type ActivityStatisticsResponseDto = {
|
||||
comments: number;
|
||||
likes: number;
|
||||
};
|
||||
export type SetMaintenanceModeDto = {
|
||||
action: MaintenanceAction;
|
||||
};
|
||||
export type MaintenanceGetIntegrityReportDto = {
|
||||
"type": IntegrityReportType;
|
||||
};
|
||||
@@ -59,6 +56,9 @@ export type MaintenanceIntegrityReportSummaryResponseDto = {
|
||||
missing_file: number;
|
||||
orphan_file: number;
|
||||
};
|
||||
export type SetMaintenanceModeDto = {
|
||||
action: MaintenanceAction;
|
||||
};
|
||||
export type MaintenanceLoginDto = {
|
||||
token?: string;
|
||||
};
|
||||
@@ -1884,18 +1884,6 @@ export function unlinkAllOAuthAccountsAdmin(opts?: Oazapfts.RequestOpts) {
|
||||
method: "POST"
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* Set maintenance mode
|
||||
*/
|
||||
export function setMaintenanceMode({ setMaintenanceModeDto }: {
|
||||
setMaintenanceModeDto: SetMaintenanceModeDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/admin/maintenance", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: setMaintenanceModeDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* Get integrity report by type
|
||||
*/
|
||||
@@ -1905,7 +1893,7 @@ export function getIntegrityReport({ maintenanceGetIntegrityReportDto }: {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 201;
|
||||
data: MaintenanceIntegrityReportResponseDto;
|
||||
}>("/admin/maintenance/integrity/report", oazapfts.json({
|
||||
}>("/admin/integrity/report", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: maintenanceGetIntegrityReportDto
|
||||
@@ -1917,7 +1905,7 @@ export function getIntegrityReport({ maintenanceGetIntegrityReportDto }: {
|
||||
export function deleteIntegrityReport({ id }: {
|
||||
id: string;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText(`/admin/maintenance/integrity/report/${encodeURIComponent(id)}`, {
|
||||
return oazapfts.ok(oazapfts.fetchText(`/admin/integrity/report/${encodeURIComponent(id)}`, {
|
||||
...opts,
|
||||
method: "DELETE"
|
||||
}));
|
||||
@@ -1931,7 +1919,7 @@ export function getIntegrityReportFile({ id }: {
|
||||
return oazapfts.ok(oazapfts.fetchBlob<{
|
||||
status: 200;
|
||||
data: Blob;
|
||||
}>(`/admin/maintenance/integrity/report/${encodeURIComponent(id)}/file`, {
|
||||
}>(`/admin/integrity/report/${encodeURIComponent(id)}/file`, {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
@@ -1944,7 +1932,7 @@ export function getIntegrityReportCsv({ $type }: {
|
||||
return oazapfts.ok(oazapfts.fetchBlob<{
|
||||
status: 200;
|
||||
data: Blob;
|
||||
}>(`/admin/maintenance/integrity/report/${encodeURIComponent($type)}/csv`, {
|
||||
}>(`/admin/integrity/report/${encodeURIComponent($type)}/csv`, {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
@@ -1955,10 +1943,22 @@ export function getIntegrityReportSummary(opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchJson<{
|
||||
status: 200;
|
||||
data: MaintenanceIntegrityReportSummaryResponseDto;
|
||||
}>("/admin/maintenance/integrity/summary", {
|
||||
}>("/admin/integrity/summary", {
|
||||
...opts
|
||||
}));
|
||||
}
|
||||
/**
|
||||
* Set maintenance mode
|
||||
*/
|
||||
export function setMaintenanceMode({ setMaintenanceModeDto }: {
|
||||
setMaintenanceModeDto: SetMaintenanceModeDto;
|
||||
}, opts?: Oazapfts.RequestOpts) {
|
||||
return oazapfts.ok(oazapfts.fetchText("/admin/maintenance", oazapfts.json({
|
||||
...opts,
|
||||
method: "POST",
|
||||
body: setMaintenanceModeDto
|
||||
})));
|
||||
}
|
||||
/**
|
||||
* Log into maintenance mode
|
||||
*/
|
||||
@@ -5235,15 +5235,15 @@ export enum UserAvatarColor {
|
||||
Gray = "gray",
|
||||
Amber = "amber"
|
||||
}
|
||||
export enum MaintenanceAction {
|
||||
Start = "start",
|
||||
End = "end"
|
||||
}
|
||||
export enum IntegrityReportType {
|
||||
OrphanFile = "orphan_file",
|
||||
MissingFile = "missing_file",
|
||||
ChecksumMismatch = "checksum_mismatch"
|
||||
}
|
||||
export enum MaintenanceAction {
|
||||
Start = "start",
|
||||
End = "end"
|
||||
}
|
||||
export enum NotificationLevel {
|
||||
Success = "success",
|
||||
Error = "error",
|
||||
|
||||
Reference in New Issue
Block a user