From be153a8149f49edc7a6f8367766295426594d416 Mon Sep 17 00:00:00 2001 From: ssube Date: Tue, 3 Aug 2021 23:03:17 -0500 Subject: [PATCH] fix(module): be selective about gitlab client options --- src/module/RemoteModule.ts | 9 +++++---- src/remote/gitlab.ts | 3 ++- 2 files changed, 7 insertions(+), 5 deletions(-) diff --git a/src/module/RemoteModule.ts b/src/module/RemoteModule.ts index 79352d3..6e809a9 100644 --- a/src/module/RemoteModule.ts +++ b/src/module/RemoteModule.ts @@ -15,9 +15,10 @@ export class RemoteModule extends Module { } @Provides(INJECT_GITLAB) - public async createGitlab(options: GitlabOptions, ...others: Array) { - /* eslint-disable-next-line */ - console.log('inject', options, others); - return new Gitlab(options); + public async createGitlab(options: GitlabOptions) { + return new Gitlab({ + host: options.host, + token: options.token, + }); } } diff --git a/src/remote/gitlab.ts b/src/remote/gitlab.ts index 76180ce..087fe20 100644 --- a/src/remote/gitlab.ts +++ b/src/remote/gitlab.ts @@ -1,5 +1,6 @@ import { mustExist } from '@apextoaster/js-utils'; import { Gitlab } from '@gitbeaker/node'; +import { BaseOptions } from 'noicejs'; import { CommentUpdate, IssueUpdate, LabelUpdate, ProjectQuery, Remote, RemoteOptions } from '.'; import { BaseRemote } from './base'; @@ -13,7 +14,7 @@ const client = new Gitlab({}); export const INJECT_GITLAB = Symbol('inject-gitlab'); -export interface GitlabOptions { +export interface GitlabOptions extends BaseOptions { host: string; token: string; }