mirror of
https://github.com/KevinMidboe/immich.git
synced 2025-10-29 17:40:28 +00:00
* Use cookie for frontend request * Remove api helper to use SDK * Added error handling to status box * Remove additional places that check for session.user * Refactor sending password * prettier clean up * remove deadcode * Move all authentication requests to the client * refactor upload panel to only fetch assets after the upload panel disappear * Added keydown to remove focus on title change on album viewer
40 lines
998 B
TypeScript
40 lines
998 B
TypeScript
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;
|
|
}
|
|
|
|
public removeAccessToken() {
|
|
this.config.accessToken = undefined;
|
|
}
|
|
}
|
|
|
|
export const api = new ImmichApi();
|