homebox/frontend/lib/api/user.ts

46 lines
1.1 KiB
TypeScript
Raw Normal View History

import { BaseAPI } from "./base";
import { ItemsApi } from "./classes/items";
import { LabelsApi } from "./classes/labels";
import { LocationsApi } from "./classes/locations";
import { GroupApi } from "./classes/group";
import { UserApi } from "./classes/users";
2022-11-13 03:57:51 +00:00
import { ActionsAPI } from "./classes/actions";
import { Requests } from "~~/lib/requests";
2022-08-31 00:06:57 +00:00
export class UserClient extends BaseAPI {
2022-08-31 05:22:10 +00:00
locations: LocationsApi;
2022-09-02 01:52:40 +00:00
labels: LabelsApi;
2022-09-03 09:17:57 +00:00
items: ItemsApi;
group: GroupApi;
user: UserApi;
2022-11-13 03:57:51 +00:00
actions: ActionsAPI;
2022-08-31 05:22:10 +00:00
constructor(requests: Requests) {
super(requests);
this.locations = new LocationsApi(requests);
2022-09-02 01:52:40 +00:00
this.labels = new LabelsApi(requests);
2022-09-03 09:17:57 +00:00
this.items = new ItemsApi(requests);
this.group = new GroupApi(requests);
this.user = new UserApi(requests);
2022-11-13 03:57:51 +00:00
this.actions = new ActionsAPI(requests);
2022-08-31 05:22:10 +00:00
Object.freeze(this);
}
/** @deprecated use this.user.self() */
2022-08-31 02:11:36 +00:00
public self() {
return this.user.self();
2022-08-31 02:11:36 +00:00
}
/** @deprecated use this.user.logout() */
2022-08-31 02:11:36 +00:00
public logout() {
return this.user.logout();
2022-08-31 02:11:36 +00:00
}
2022-09-04 02:42:03 +00:00
/** @deprecated use this.user.delete() */
2022-09-04 02:42:03 +00:00
public deleteAccount() {
return this.user.delete();
2022-09-04 02:42:03 +00:00
}
2022-08-31 00:06:57 +00:00
}