Skip to content

Commit

Permalink
Restore GitLabDSL.api to be GitLabAPI instance
Browse files Browse the repository at this point in the history
Revert "Ensures that the Gitlab API is exposed properly through the dts"

This reverts commit e8d2052.

The breakage is between 10.6.5 and 10.6.6 version
  • Loading branch information
glensc committed Feb 7, 2023
1 parent 28d3099 commit 9c300e3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 7 deletions.
4 changes: 2 additions & 2 deletions source/dsl/GitLabDSL.ts
Original file line number Diff line number Diff line change
@@ -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
Expand All @@ -21,7 +21,7 @@ export interface GitLabDSL extends GitLabJSONDSL {
utils: {
fileContents(path: string, repoSlug?: string, ref?: string): Promise<string>
}
api: InstanceType<typeof Gitlab>
api: GitLabAPI
}

// ---
Expand Down
2 changes: 1 addition & 1 deletion source/platforms/GitLab.ts
Original file line number Diff line number Diff line change
Expand Up @@ -228,5 +228,5 @@ export const gitlabJSONToGitLabDSL = (gl: GitLabDSL, api: GitLabAPI): GitLabDSL
utils: {
fileContents: api.getFileContents,
},
api: api.apiInstance,
api,
})
4 changes: 0 additions & 4 deletions source/platforms/gitlab/GitLabAPI.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,10 +77,6 @@ class GitLabAPI {
return `${this.projectURL}/merge_requests/${this.prId}`
}

get apiInstance() {
return this.api
}

getUser = async (): Promise<GitLabUserProfile> => {
this.d("getUser")
const user = (await this.api.Users.current()) as GitLabUserProfile
Expand Down

0 comments on commit 9c300e3

Please sign in to comment.