1
0
Fork 0

fix(module): be selective about gitlab client options

This commit is contained in:
ssube 2021-08-03 23:03:17 -05:00
parent b26fb78ff7
commit be153a8149
Signed by: ssube
GPG Key ID: 3EED7B957D362AF1
2 changed files with 7 additions and 5 deletions

View File

@ -15,9 +15,10 @@ export class RemoteModule extends Module {
}
@Provides(INJECT_GITLAB)
public async createGitlab(options: GitlabOptions, ...others: Array<unknown>) {
/* 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,
});
}
}

View File

@ -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;
}