import { Injectable } from "@angular/core"; import { AuthedApi } from "../authed-api"; import { FE_CustomSimpleBot, FE_CustomSimpleBotTemplate, FE_UserProfile } from "../../models/admin-responses"; import { HttpClient } from "@angular/common/http"; @Injectable() export class AdminCustomSimpleBotsApiService extends AuthedApi { constructor(http: HttpClient) { super(http); } public getBots(): Promise { return this.authedGet("/api/v1/dimension/admin/bots/simple/custom/all").toPromise(); } public getBot(id: number): Promise { return this.authedGet("/api/v1/dimension/admin/bots/simple/custom/" + id).toPromise(); } public updateBot(id: number, config: FE_CustomSimpleBotTemplate): Promise { return this.authedPost("/api/v1/dimension/admin/bots/simple/custom/" + id, config).toPromise(); } public createBot(config: FE_CustomSimpleBotTemplate): Promise { return this.authedPost("/api/v1/dimension/admin/bots/simple/custom/new", config).toPromise(); } public getProfile(userId: string): Promise { return this.authedGet("/api/v1/dimension/admin/bots/simple/custom/profile/" + userId).toPromise(); } }