2022-10-06 18:54:09 -08:00
|
|
|
import { BaseAPI } from "./base";
|
2022-09-09 14:46:53 -08:00
|
|
|
import { ItemsApi } from "./classes/items";
|
|
|
|
import { LabelsApi } from "./classes/labels";
|
|
|
|
import { LocationsApi } from "./classes/locations";
|
2022-10-06 18:54:09 -08:00
|
|
|
import { GroupApi } from "./classes/group";
|
|
|
|
import { UserApi } from "./classes/users";
|
2022-11-13 14:17:55 -09:00
|
|
|
import { ActionsAPI } from "./classes/actions";
|
2022-12-05 12:36:32 -09:00
|
|
|
import { StatsAPI } from "./classes/stats";
|
2023-01-14 10:24:11 -08:00
|
|
|
import { AssetsApi } from "./classes/assets";
|
2023-02-13 10:00:29 -09:00
|
|
|
import { ReportsAPI } from "./classes/reports";
|
2022-09-09 14:46:53 -08:00
|
|
|
import { Requests } from "~~/lib/requests";
|
2022-08-30 16:06:57 -08:00
|
|
|
|
2022-10-06 18:54:09 -08:00
|
|
|
export class UserClient extends BaseAPI {
|
2022-08-30 21:22:10 -08:00
|
|
|
locations: LocationsApi;
|
2022-09-01 17:52:40 -08:00
|
|
|
labels: LabelsApi;
|
2022-09-03 01:17:57 -08:00
|
|
|
items: ItemsApi;
|
2022-10-06 18:54:09 -08:00
|
|
|
group: GroupApi;
|
|
|
|
user: UserApi;
|
2022-11-13 14:17:55 -09:00
|
|
|
actions: ActionsAPI;
|
2022-12-05 12:36:32 -09:00
|
|
|
stats: StatsAPI;
|
2023-01-14 10:24:11 -08:00
|
|
|
assets: AssetsApi;
|
2023-02-13 10:00:29 -09:00
|
|
|
reports: ReportsAPI;
|
2022-10-06 18:54:09 -08:00
|
|
|
|
2022-12-03 10:55:00 -09:00
|
|
|
constructor(requests: Requests, attachmentToken: string) {
|
|
|
|
super(requests, attachmentToken);
|
2022-08-30 21:22:10 -08:00
|
|
|
|
|
|
|
this.locations = new LocationsApi(requests);
|
2022-09-01 17:52:40 -08:00
|
|
|
this.labels = new LabelsApi(requests);
|
2023-01-14 10:24:11 -08:00
|
|
|
this.items = new ItemsApi(requests, attachmentToken);
|
2022-10-06 18:54:09 -08:00
|
|
|
this.group = new GroupApi(requests);
|
|
|
|
this.user = new UserApi(requests);
|
2022-11-13 14:17:55 -09:00
|
|
|
this.actions = new ActionsAPI(requests);
|
2022-12-05 12:36:32 -09:00
|
|
|
this.stats = new StatsAPI(requests);
|
2023-01-14 10:24:11 -08:00
|
|
|
this.assets = new AssetsApi(requests);
|
2023-02-13 10:00:29 -09:00
|
|
|
this.reports = new ReportsAPI(requests);
|
2022-08-30 21:22:10 -08:00
|
|
|
|
|
|
|
Object.freeze(this);
|
|
|
|
}
|
|
|
|
|
2022-10-06 18:54:09 -08:00
|
|
|
/** @deprecated use this.user.self() */
|
2022-08-30 18:11:36 -08:00
|
|
|
public self() {
|
2022-10-06 18:54:09 -08:00
|
|
|
return this.user.self();
|
2022-08-30 18:11:36 -08:00
|
|
|
}
|
|
|
|
|
2022-10-06 18:54:09 -08:00
|
|
|
/** @deprecated use this.user.logout() */
|
2022-08-30 18:11:36 -08:00
|
|
|
public logout() {
|
2022-10-06 18:54:09 -08:00
|
|
|
return this.user.logout();
|
2022-08-30 18:11:36 -08:00
|
|
|
}
|
2022-09-03 18:42:03 -08:00
|
|
|
|
2022-10-06 18:54:09 -08:00
|
|
|
/** @deprecated use this.user.delete() */
|
2022-09-03 18:42:03 -08:00
|
|
|
public deleteAccount() {
|
2022-10-06 18:54:09 -08:00
|
|
|
return this.user.delete();
|
2022-09-03 18:42:03 -08:00
|
|
|
}
|
2022-08-30 16:06:57 -08:00
|
|
|
}
|