From dcda2fa46ec6824005156eee82fe297aa2eeeb82 Mon Sep 17 00:00:00 2001 From: Travis Ralston Date: Sat, 24 Mar 2018 22:02:40 -0600 Subject: [PATCH] Translate the Dimension integration types to go-neb types This only applies to Travis CI and the RSS Bot. --- src/neb/NebClient.ts | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/src/neb/NebClient.ts b/src/neb/NebClient.ts index 634af7f..4b6755f 100644 --- a/src/neb/NebClient.ts +++ b/src/neb/NebClient.ts @@ -15,6 +15,13 @@ export class NebClient { return user.accessToken; } + private getNebType(type: string): string { + if (type === "rss") return "rssbot"; + if (type === "travisci") return "travis-ci"; + + return type; + } + public async updateUser(userId: string, isEnabled: boolean, sync = true, autoAcceptInvites = true): Promise { const nebRequest: Client = { UserID: userId, @@ -30,7 +37,7 @@ export class NebClient { public async setServiceConfig(serviceId: string, userId: string, type: string, serviceConfig: any): Promise { const nebRequest: Service = { ID: serviceId, - Type: type, + Type: this.getNebType(type), UserID: userId, Config: serviceConfig, };