From 9c300e3084880db0a744061813d2650f45a066a6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Elan=20Ruusam=C3=A4e?= Date: Wed, 8 Feb 2023 01:52:28 +0200 Subject: [PATCH] Restore GitLabDSL.api to be GitLabAPI instance Revert "Ensures that the Gitlab API is exposed properly through the dts" This reverts commit e8d20521270e283df8572c103eb330d622ab04bd. The breakage is between 10.6.5 and 10.6.6 version --- source/dsl/GitLabDSL.ts | 4 ++-- source/platforms/GitLab.ts | 2 +- source/platforms/gitlab/GitLabAPI.ts | 4 ---- 3 files changed, 3 insertions(+), 7 deletions(-) diff --git a/source/dsl/GitLabDSL.ts b/source/dsl/GitLabDSL.ts index cb264c1b8..0bddef3c7 100644 --- a/source/dsl/GitLabDSL.ts +++ b/source/dsl/GitLabDSL.ts @@ -1,6 +1,6 @@ // Please don't have includes in here that aren't inside the DSL folder, or the d.ts/flow defs break // TODO: extract out from BitBucket specifically, or create our own type -import { Gitlab } from "@gitbeaker/node" +import GitLabAPI from "../platforms/gitlab/GitLabAPI" import { RepoMetaData } from "./BitBucketServerDSL" // getPlatformReviewDSLRepresentation @@ -21,7 +21,7 @@ export interface GitLabDSL extends GitLabJSONDSL { utils: { fileContents(path: string, repoSlug?: string, ref?: string): Promise } - api: InstanceType + api: GitLabAPI } // --- diff --git a/source/platforms/GitLab.ts b/source/platforms/GitLab.ts index 21316a582..7484858bf 100644 --- a/source/platforms/GitLab.ts +++ b/source/platforms/GitLab.ts @@ -228,5 +228,5 @@ export const gitlabJSONToGitLabDSL = (gl: GitLabDSL, api: GitLabAPI): GitLabDSL utils: { fileContents: api.getFileContents, }, - api: api.apiInstance, + api, }) diff --git a/source/platforms/gitlab/GitLabAPI.ts b/source/platforms/gitlab/GitLabAPI.ts index f070028c4..7d66d142f 100644 --- a/source/platforms/gitlab/GitLabAPI.ts +++ b/source/platforms/gitlab/GitLabAPI.ts @@ -77,10 +77,6 @@ class GitLabAPI { return `${this.projectURL}/merge_requests/${this.prId}` } - get apiInstance() { - return this.api - } - getUser = async (): Promise => { this.d("getUser") const user = (await this.api.Users.current()) as GitLabUserProfile