mirror of
https://github.com/samsonjs/immich.git
synced 2026-04-27 15:07:45 +00:00
feat(server): apk links API endpoint for Obtainium Android mobile-server version sync (#18700)
This commit is contained in:
parent
be247395db
commit
8ea40973a7
10 changed files with 94 additions and 0 deletions
BIN
mobile/openapi/README.md
generated
BIN
mobile/openapi/README.md
generated
Binary file not shown.
BIN
mobile/openapi/lib/api.dart
generated
BIN
mobile/openapi/lib/api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api/server_api.dart
generated
BIN
mobile/openapi/lib/api/server_api.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/api_client.dart
generated
BIN
mobile/openapi/lib/api_client.dart
generated
Binary file not shown.
BIN
mobile/openapi/lib/model/server_apk_links_dto.dart
generated
Normal file
BIN
mobile/openapi/lib/model/server_apk_links_dto.dart
generated
Normal file
Binary file not shown.
|
|
@ -5275,6 +5275,38 @@
|
||||||
]
|
]
|
||||||
}
|
}
|
||||||
},
|
},
|
||||||
|
"/server/android-links": {
|
||||||
|
"get": {
|
||||||
|
"operationId": "getAndroidLinks",
|
||||||
|
"parameters": [],
|
||||||
|
"responses": {
|
||||||
|
"200": {
|
||||||
|
"content": {
|
||||||
|
"application/json": {
|
||||||
|
"schema": {
|
||||||
|
"$ref": "#/components/schemas/ServerApkLinksDto"
|
||||||
|
}
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"description": ""
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"security": [
|
||||||
|
{
|
||||||
|
"bearer": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"cookie": []
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"api_key": []
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"tags": [
|
||||||
|
"Server"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
},
|
||||||
"/server/config": {
|
"/server/config": {
|
||||||
"get": {
|
"get": {
|
||||||
"operationId": "getServerConfig",
|
"operationId": "getServerConfig",
|
||||||
|
|
@ -11959,6 +11991,29 @@
|
||||||
],
|
],
|
||||||
"type": "object"
|
"type": "object"
|
||||||
},
|
},
|
||||||
|
"ServerApkLinksDto": {
|
||||||
|
"properties": {
|
||||||
|
"arm64v8a": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"armeabiv7a": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"universal": {
|
||||||
|
"type": "string"
|
||||||
|
},
|
||||||
|
"x86_64": {
|
||||||
|
"type": "string"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"required": [
|
||||||
|
"arm64v8a",
|
||||||
|
"armeabiv7a",
|
||||||
|
"universal",
|
||||||
|
"x86_64"
|
||||||
|
],
|
||||||
|
"type": "object"
|
||||||
|
},
|
||||||
"ServerConfigDto": {
|
"ServerConfigDto": {
|
||||||
"properties": {
|
"properties": {
|
||||||
"externalDomain": {
|
"externalDomain": {
|
||||||
|
|
|
||||||
|
|
@ -1004,6 +1004,12 @@ export type ServerAboutResponseDto = {
|
||||||
version: string;
|
version: string;
|
||||||
versionUrl: string;
|
versionUrl: string;
|
||||||
};
|
};
|
||||||
|
export type ServerApkLinksDto = {
|
||||||
|
arm64v8a: string;
|
||||||
|
armeabiv7a: string;
|
||||||
|
universal: string;
|
||||||
|
x86_64: string;
|
||||||
|
};
|
||||||
export type ServerConfigDto = {
|
export type ServerConfigDto = {
|
||||||
externalDomain: string;
|
externalDomain: string;
|
||||||
isInitialized: boolean;
|
isInitialized: boolean;
|
||||||
|
|
@ -2868,6 +2874,14 @@ export function getAboutInfo(opts?: Oazapfts.RequestOpts) {
|
||||||
...opts
|
...opts
|
||||||
}));
|
}));
|
||||||
}
|
}
|
||||||
|
export function getAndroidLinks(opts?: Oazapfts.RequestOpts) {
|
||||||
|
return oazapfts.ok(oazapfts.fetchJson<{
|
||||||
|
status: 200;
|
||||||
|
data: ServerApkLinksDto;
|
||||||
|
}>("/server/android-links", {
|
||||||
|
...opts
|
||||||
|
}));
|
||||||
|
}
|
||||||
export function getServerConfig(opts?: Oazapfts.RequestOpts) {
|
export function getServerConfig(opts?: Oazapfts.RequestOpts) {
|
||||||
return oazapfts.ok(oazapfts.fetchJson<{
|
return oazapfts.ok(oazapfts.fetchJson<{
|
||||||
status: 200;
|
status: 200;
|
||||||
|
|
|
||||||
|
|
@ -3,6 +3,7 @@ import { ApiNotFoundResponse, ApiTags } from '@nestjs/swagger';
|
||||||
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
||||||
import {
|
import {
|
||||||
ServerAboutResponseDto,
|
ServerAboutResponseDto,
|
||||||
|
ServerApkLinksDto,
|
||||||
ServerConfigDto,
|
ServerConfigDto,
|
||||||
ServerFeaturesDto,
|
ServerFeaturesDto,
|
||||||
ServerMediaTypesResponseDto,
|
ServerMediaTypesResponseDto,
|
||||||
|
|
@ -34,6 +35,12 @@ export class ServerController {
|
||||||
return this.service.getAboutInfo();
|
return this.service.getAboutInfo();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@Get('android-links')
|
||||||
|
@Authenticated()
|
||||||
|
getAndroidLinks(): ServerApkLinksDto {
|
||||||
|
return this.service.getAndroidLinks();
|
||||||
|
}
|
||||||
|
|
||||||
@Get('storage')
|
@Get('storage')
|
||||||
@Authenticated()
|
@Authenticated()
|
||||||
getStorage(): Promise<ServerStorageResponseDto> {
|
getStorage(): Promise<ServerStorageResponseDto> {
|
||||||
|
|
|
||||||
|
|
@ -37,6 +37,13 @@ export class ServerAboutResponseDto {
|
||||||
thirdPartySupportUrl?: string;
|
thirdPartySupportUrl?: string;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
export class ServerApkLinksDto {
|
||||||
|
arm64v8a!: string;
|
||||||
|
armeabiv7a!: string;
|
||||||
|
universal!: string;
|
||||||
|
x86_64!: string;
|
||||||
|
}
|
||||||
|
|
||||||
export class ServerStorageResponseDto {
|
export class ServerStorageResponseDto {
|
||||||
diskSize!: string;
|
diskSize!: string;
|
||||||
diskUse!: string;
|
diskUse!: string;
|
||||||
|
|
|
||||||
|
|
@ -5,6 +5,7 @@ import { OnEvent } from 'src/decorators';
|
||||||
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
import { LicenseKeyDto, LicenseResponseDto } from 'src/dtos/license.dto';
|
||||||
import {
|
import {
|
||||||
ServerAboutResponseDto,
|
ServerAboutResponseDto,
|
||||||
|
ServerApkLinksDto,
|
||||||
ServerConfigDto,
|
ServerConfigDto,
|
||||||
ServerFeaturesDto,
|
ServerFeaturesDto,
|
||||||
ServerMediaTypesResponseDto,
|
ServerMediaTypesResponseDto,
|
||||||
|
|
@ -48,6 +49,16 @@ export class ServerService extends BaseService {
|
||||||
};
|
};
|
||||||
}
|
}
|
||||||
|
|
||||||
|
getAndroidLinks(): ServerApkLinksDto {
|
||||||
|
const baseURL = `https://github.com/immich-app/immich/releases/download/v${serverVersion.toString()}`;
|
||||||
|
return {
|
||||||
|
arm64v8a: `${baseURL}/app-arm64-v8a-release.apk`,
|
||||||
|
armeabiv7a: `${baseURL}/app-armeabi-v7a-release.apk`,
|
||||||
|
universal: `${baseURL}/app-release.apk`,
|
||||||
|
x86_64: `${baseURL}/app-x86_64-release.apk`,
|
||||||
|
};
|
||||||
|
}
|
||||||
|
|
||||||
async getStorage(): Promise<ServerStorageResponseDto> {
|
async getStorage(): Promise<ServerStorageResponseDto> {
|
||||||
const libraryBase = StorageCore.getBaseFolder(StorageFolder.LIBRARY);
|
const libraryBase = StorageCore.getBaseFolder(StorageFolder.LIBRARY);
|
||||||
const diskInfo = await this.storageRepository.checkDiskUsage(libraryBase);
|
const diskInfo = await this.storageRepository.checkDiskUsage(libraryBase);
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue