G I T H U B

This commit is contained in:
Travis Ralston 2021-11-30 19:23:54 -07:00
parent 2870f264d0
commit 089925ee4c
3 changed files with 11 additions and 13 deletions

View File

@ -26,7 +26,7 @@ interface BridgeResponse {
* Administrative API for configuring Hookshot Github bridge instances.
*/
@Path("/api/v1/dimension/admin/hookshot/github")
export class AdminTelegramService {
export class AdminHookshotGithubService {
@Context
private context: ServiceContext;
@ -51,15 +51,15 @@ export class AdminTelegramService {
@Path(":bridgeId")
@Security([ROLE_USER, ROLE_ADMIN])
public async getBridge(@PathParam("bridgeId") bridgeId: number): Promise<BridgeResponse> {
const telegramBridge = await HookshotGithubBridgeRecord.findByPk(bridgeId);
if (!telegramBridge) throw new ApiError(404, "Github Bridge not found");
const githubBridge = await HookshotGithubBridgeRecord.findByPk(bridgeId);
if (!githubBridge) throw new ApiError(404, "Github Bridge not found");
return {
id: telegramBridge.id,
upstreamId: telegramBridge.upstreamId,
provisionUrl: telegramBridge.provisionUrl,
sharedSecret: telegramBridge.sharedSecret,
isEnabled: telegramBridge.isEnabled,
id: githubBridge.id,
upstreamId: githubBridge.upstreamId,
provisionUrl: githubBridge.provisionUrl,
sharedSecret: githubBridge.sharedSecret,
isEnabled: githubBridge.isEnabled,
};
}
@ -101,7 +101,7 @@ export class AdminTelegramService {
sharedSecret: request.sharedSecret,
isEnabled: true,
});
LogService.info("AdminTelegramService", userId + " created a new Hookshot Github Bridge with provisioning URL " + request.provisionUrl);
LogService.info("AdminHookshotGithubService", userId + " created a new Hookshot Github Bridge with provisioning URL " + request.provisionUrl);
Cache.for(CACHE_HOOKSHOT_GITHUB_BRIDGE).clear();
Cache.for(CACHE_INTEGRATIONS).clear();

View File

@ -4,7 +4,6 @@ import {
AdminHookshotGithubBridgeManageSelfhostedComponent,
ManageSelfhostedHookshotGithubBridgeDialogContext
} from "./manage-selfhosted/manage-selfhosted.component";
import { FE_TelegramBridge } from "../../../shared/models/telegram";
import { TranslateService } from "@ngx-translate/core";
import { NgbModal } from "@ng-bootstrap/ng-bootstrap";
import { AdminHookshotGithubApiService } from "../../../shared/services/admin/admin-hookshot-github-api.service";
@ -18,7 +17,7 @@ export class AdminHookshotGithubBridgeComponent implements OnInit {
public isLoading = true;
public isUpdating = false;
public configurations: FE_TelegramBridge[] = [];
public configurations: FE_HookshotGithubBridge[] = [];
constructor(private hookshotApi: AdminHookshotGithubApiService,
private toaster: ToasterService,

View File

@ -1,7 +1,6 @@
import { Injectable } from "@angular/core";
import { AuthedApi } from "../authed-api";
import { FE_Upstream } from "../../models/admin-responses";
import { FE_TelegramBridge, FE_TelegramBridgeOptions } from "../../models/telegram";
import { HttpClient } from "@angular/common/http";
import { FE_HookshotGithubBridge } from "../../models/hookshot_github";
@ -31,7 +30,7 @@ export class AdminHookshotGithubApiService extends AuthedApi {
}
public updateSelfhosted(bridgeId: number, provisionUrl: string, sharedSecret: string): Promise<FE_HookshotGithubBridge> {
return this.authedPost<FE_TelegramBridge>("/api/v1/dimension/admin/hookshot/github/" + bridgeId, {
return this.authedPost<FE_HookshotGithubBridge>("/api/v1/dimension/admin/hookshot/github/" + bridgeId, {
provisionUrl: provisionUrl,
sharedSecret: sharedSecret,
}).toPromise();