refactor: deprecate /server-info and replace with /server-info/storage (#9645)

This commit is contained in:
Zack Pollard 2024-05-22 10:25:55 +01:00 committed by GitHub
parent a341ab0050
commit a3e7e8cc31
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
19 changed files with 265 additions and 99 deletions

View file

@ -4337,6 +4337,8 @@
},
"/server-info": {
"get": {
"deprecated": true,
"description": "This property was deprecated in v1.106.0",
"operationId": "getServerInfo",
"parameters": [],
"responses": {
@ -4344,7 +4346,7 @@
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServerInfoResponseDto"
"$ref": "#/components/schemas/ServerStorageResponseDto"
}
}
},
@ -4363,8 +4365,12 @@
}
],
"tags": [
"Server Info"
]
"Server Info",
"Deprecated"
],
"x-immich-lifecycle": {
"deprecatedAt": "v1.106.0"
}
}
},
"/server-info/config": {
@ -4483,6 +4489,38 @@
]
}
},
"/server-info/storage": {
"get": {
"operationId": "getStorage",
"parameters": [],
"responses": {
"200": {
"content": {
"application/json": {
"schema": {
"$ref": "#/components/schemas/ServerStorageResponseDto"
}
}
},
"description": ""
}
},
"security": [
{
"bearer": []
},
{
"cookie": []
},
{
"api_key": []
}
],
"tags": [
"Server Info"
]
}
},
"/server-info/theme": {
"get": {
"operationId": "getTheme",
@ -9487,45 +9525,6 @@
],
"type": "object"
},
"ServerInfoResponseDto": {
"properties": {
"diskAvailable": {
"type": "string"
},
"diskAvailableRaw": {
"format": "int64",
"type": "integer"
},
"diskSize": {
"type": "string"
},
"diskSizeRaw": {
"format": "int64",
"type": "integer"
},
"diskUsagePercentage": {
"format": "float",
"type": "number"
},
"diskUse": {
"type": "string"
},
"diskUseRaw": {
"format": "int64",
"type": "integer"
}
},
"required": [
"diskAvailable",
"diskAvailableRaw",
"diskSize",
"diskSizeRaw",
"diskUsagePercentage",
"diskUse",
"diskUseRaw"
],
"type": "object"
},
"ServerMediaTypesResponseDto": {
"properties": {
"image": {
@ -9606,6 +9605,45 @@
],
"type": "object"
},
"ServerStorageResponseDto": {
"properties": {
"diskAvailable": {
"type": "string"
},
"diskAvailableRaw": {
"format": "int64",
"type": "integer"
},
"diskSize": {
"type": "string"
},
"diskSizeRaw": {
"format": "int64",
"type": "integer"
},
"diskUsagePercentage": {
"format": "float",
"type": "number"
},
"diskUse": {
"type": "string"
},
"diskUseRaw": {
"format": "int64",
"type": "integer"
}
},
"required": [
"diskAvailable",
"diskAvailableRaw",
"diskSize",
"diskSizeRaw",
"diskUsagePercentage",
"diskUse",
"diskUseRaw"
],
"type": "object"
},
"ServerThemeDto": {
"properties": {
"customCss": {

View file

@ -732,7 +732,7 @@ export type SmartSearchDto = {
withDeleted?: boolean;
withExif?: boolean;
};
export type ServerInfoResponseDto = {
export type ServerStorageResponseDto = {
diskAvailable: string;
diskAvailableRaw: number;
diskSize: string;
@ -2245,10 +2245,13 @@ export function getSearchSuggestions({ country, make, model, state, $type }: {
...opts
}));
}
/**
* This property was deprecated in v1.106.0
*/
export function getServerInfo(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ServerInfoResponseDto;
data: ServerStorageResponseDto;
}>("/server-info", {
...opts
}));
@ -2293,6 +2296,14 @@ export function getServerStatistics(opts?: Oazapfts.RequestOpts) {
...opts
}));
}
export function getStorage(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;
data: ServerStorageResponseDto;
}>("/server-info/storage", {
...opts
}));
}
export function getTheme(opts?: Oazapfts.RequestOpts) {
return oazapfts.ok(oazapfts.fetchJson<{
status: 200;