2017-12-24 04:02:57 -05:00
|
|
|
import { Injectable } from "@angular/core";
|
2018-03-24 19:16:52 -04:00
|
|
|
import { AuthedApi } from "../authed-api";
|
|
|
|
import { FE_DimensionConfig, FE_DimensionVersion } from "../../models/admin-responses";
|
2019-06-29 02:21:56 -04:00
|
|
|
import { HttpClient } from "@angular/common/http";
|
2017-12-24 04:02:57 -05:00
|
|
|
|
|
|
|
@Injectable()
|
|
|
|
export class AdminApiService extends AuthedApi {
|
2019-06-29 02:21:56 -04:00
|
|
|
constructor(http: HttpClient) {
|
2017-12-24 04:02:57 -05:00
|
|
|
super(http);
|
|
|
|
}
|
|
|
|
|
|
|
|
public isAdmin(): Promise<any> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedGet("/api/v1/dimension/admin/check").toPromise();
|
2017-12-24 04:02:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public getConfig(): Promise<FE_DimensionConfig> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedGet<FE_DimensionConfig>("/api/v1/dimension/admin/config").toPromise();
|
2017-12-24 04:02:57 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
public getVersion(): Promise<FE_DimensionVersion> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedGet<FE_DimensionVersion>("/api/v1/dimension/admin/version").toPromise();
|
2017-12-24 04:02:57 -05:00
|
|
|
}
|
2019-03-12 21:08:12 -04:00
|
|
|
|
|
|
|
public logoutAll(): Promise<any> {
|
2019-06-29 02:21:56 -04:00
|
|
|
return this.authedPost("/api/v1/dimension/admin/sessions/logout/all").toPromise();
|
2019-03-12 21:08:12 -04:00
|
|
|
}
|
2017-12-24 04:02:57 -05:00
|
|
|
}
|