homebox/frontend/lib/api/user.ts
Hayden 6dc2ae1bea
feat: asset tags/ids (#142)
* add schema

* run db migration

* bulk seed asset IDs

* breaking: update runtime options

* conditionally increment asset IDs

* update API endpoints

* fix import asset id assignment

* refactor display + marshal/unmarshal

* add docs page

* add to form field

* hide 000-000 values

* update ENV vars
2022-11-13 14:17:55 -09:00

45 lines
1.1 KiB
TypeScript

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";
import { ActionsAPI } from "./classes/actions";
import { Requests } from "~~/lib/requests";
export class UserClient extends BaseAPI {
locations: LocationsApi;
labels: LabelsApi;
items: ItemsApi;
group: GroupApi;
user: UserApi;
actions: ActionsAPI;
constructor(requests: Requests) {
super(requests);
this.locations = new LocationsApi(requests);
this.labels = new LabelsApi(requests);
this.items = new ItemsApi(requests);
this.group = new GroupApi(requests);
this.user = new UserApi(requests);
this.actions = new ActionsAPI(requests);
Object.freeze(this);
}
/** @deprecated use this.user.self() */
public self() {
return this.user.self();
}
/** @deprecated use this.user.logout() */
public logout() {
return this.user.logout();
}
/** @deprecated use this.user.delete() */
public deleteAccount() {
return this.user.delete();
}
}