mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Refactor web to use OpenAPI SDK (#326)
* Refactor main index page * Refactor admin page * Refactor Auth endpoint * Refactor directory to prep for monorepo * Fixed refactoring path * Resolved file path in vite * Refactor photo index page * Refactor thumbnail * Fixed test * Refactor Video Viewer component * Refactor download file * Refactor navigation bar * Refactor upload file check * Simplify Upload Asset signature * PR feedback
This commit is contained in:
parent
7f236c5b18
commit
9a6dfacf9b
55 changed files with 516 additions and 691 deletions
35
web/src/api/api.ts
Normal file
35
web/src/api/api.ts
Normal file
|
|
@ -0,0 +1,35 @@
|
|||
import { serverEndpoint } from '$lib/constants';
|
||||
import {
|
||||
AlbumApi,
|
||||
AssetApi,
|
||||
AuthenticationApi,
|
||||
Configuration,
|
||||
DeviceInfoApi,
|
||||
ServerInfoApi,
|
||||
UserApi,
|
||||
} from './open-api';
|
||||
|
||||
class ImmichApi {
|
||||
public userApi: UserApi;
|
||||
public albumApi: AlbumApi;
|
||||
public assetApi: AssetApi;
|
||||
public authenticationApi: AuthenticationApi;
|
||||
public deviceInfoApi: DeviceInfoApi;
|
||||
public serverInfoApi: ServerInfoApi;
|
||||
private config = new Configuration({ basePath: serverEndpoint });
|
||||
|
||||
constructor() {
|
||||
this.userApi = new UserApi(this.config);
|
||||
this.albumApi = new AlbumApi(this.config);
|
||||
this.assetApi = new AssetApi(this.config);
|
||||
this.authenticationApi = new AuthenticationApi(this.config);
|
||||
this.deviceInfoApi = new DeviceInfoApi(this.config);
|
||||
this.serverInfoApi = new ServerInfoApi(this.config);
|
||||
}
|
||||
|
||||
public setAccessToken(accessToken: string) {
|
||||
this.config.accessToken = accessToken;
|
||||
}
|
||||
}
|
||||
|
||||
export const api = new ImmichApi();
|
||||
Loading…
Add table
Add a link
Reference in a new issue