matrix-dimension/web/app/shared/services/integrations/hookshot-github-api.service.ts
Travis Ralston eb7dfb4f64 Initial support for matrix-hookshot#github
Missing:
* Bridge repo
* Unbridge repo
* Ignore hooks?
* List orgs and repos (or other sensible format)
* GH Auth
2021-11-25 16:24:50 -07:00

22 lines
790 B
TypeScript

import { Injectable } from "@angular/core";
import { AuthedApi } from "../authed-api";
import { HttpClient } from "@angular/common/http";
import { FE_HookshotGithubConnection } from "../../models/hookshot_github";
@Injectable()
export class HookshotGithubApiService extends AuthedApi {
constructor(http: HttpClient) {
super(http);
}
public bridgeRoom(roomId: string): Promise<FE_HookshotGithubConnection> {
return this.authedPost<FE_HookshotGithubConnection>("/api/v1/dimension/hookshot/github/room/" + roomId + "/connect", {
// TODO
}).toPromise();
}
public unbridgeRoom(roomId: string): Promise<any> {
return this.authedDelete("/api/v1/dimension/hookshot/github/room/" + roomId + "/connections/all").toPromise();
}
}