import { Injectable } from "@angular/core"; import { Http } from "@angular/http"; import { AuthedApi } from "../authed-api"; import { FE_DimensionConfig, FE_DimensionVersion } from "../../models/admin-responses"; @Injectable() export class AdminApiService extends AuthedApi { constructor(http: Http) { super(http); } public isAdmin(): Promise { return this.authedGet("/api/v1/dimension/admin/check").map(r => r.json()).toPromise(); } public getConfig(): Promise { return this.authedGet("/api/v1/dimension/admin/config").map(r => r.json()).toPromise(); } public getVersion(): Promise { return this.authedGet("/api/v1/dimension/admin/version").map(r => r.json()).toPromise(); } public logoutAll(): Promise { return this.authedPost("/api/v1/dimension/admin/sessions/logout/all").map(r => r.json()).toPromise(); } }