mirror of
https://github.com/immich-app/immich
synced 2025-11-07 17:27:20 +00:00
Add OpenAPI Specs and Response DTOs (#320)
* Added swagger bearer auth method authentication accordingly * Update Auth endpoint * Added additional api information for authentication * Added Swagger CLI pluggin * Added DTO for /user endpoint * Added /device-info reponse DTOs * Implement server version * Added DTOs for /server-info * Added DTOs for /assets * Added album to Swagger group * Added generated specs file * Add Client API generator for web * Remove incorrectly placed node_modules * Created class to handle access token * Remove password and hash when getting all user * PR feedback * Fixed video from CLI doesn't get metadata extracted * Fixed issue with TSConfig to work with generated openAPI * PR feedback * Remove console.log
This commit is contained in:
parent
25985c732d
commit
7f236c5b18
59 changed files with 5477 additions and 226 deletions
34
web/src/lib/immich-api/index.ts
Normal file
34
web/src/lib/immich-api/index.ts
Normal file
|
|
@ -0,0 +1,34 @@
|
|||
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();
|
||||
|
||||
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 immichApi = new ImmichApi();
|
||||
Loading…
Add table
Add a link
Reference in a new issue