mirror of
https://github.com/turt2live/matrix-dimension.git
synced 2024-10-01 01:05:53 -04:00
28 lines
932 B
TypeScript
28 lines
932 B
TypeScript
import { Injectable } from "@angular/core";
|
|
import { AuthedApi } from "../authed-api";
|
|
import { FE_DimensionConfig, FE_DimensionVersion } from "../../models/admin-responses";
|
|
import { HttpClient } from "@angular/common/http";
|
|
|
|
@Injectable()
|
|
export class AdminApiService extends AuthedApi {
|
|
constructor(http: HttpClient) {
|
|
super(http);
|
|
}
|
|
|
|
public isAdmin(): Promise<any> {
|
|
return this.authedGet("/api/v1/dimension/admin/check").toPromise();
|
|
}
|
|
|
|
public getConfig(): Promise<FE_DimensionConfig> {
|
|
return this.authedGet<FE_DimensionConfig>("/api/v1/dimension/admin/config").toPromise();
|
|
}
|
|
|
|
public getVersion(): Promise<FE_DimensionVersion> {
|
|
return this.authedGet<FE_DimensionVersion>("/api/v1/dimension/admin/version").toPromise();
|
|
}
|
|
|
|
public logoutAll(): Promise<any> {
|
|
return this.authedPost("/api/v1/dimension/admin/sessions/logout/all").toPromise();
|
|
}
|
|
}
|