Skip to content

Commit

Permalink
move code to @gitbeaker/node
Browse files Browse the repository at this point in the history
  • Loading branch information
ivankatliarchuk committed Oct 1, 2022
1 parent ad51f2b commit 507cb11
Show file tree
Hide file tree
Showing 4 changed files with 7 additions and 5 deletions.
1 change: 1 addition & 0 deletions package.json
Expand Up @@ -150,6 +150,7 @@
"debug": "^4.1.1",
"fast-json-patch": "^3.0.0-1",
"get-stdin": "^6.0.0",
"@gitbeaker/node": "21.3.0",
"gitlab": "^10.0.1",
"http-proxy-agent": "^2.1.0",
"https-proxy-agent": "^2.2.1",
Expand Down
2 changes: 1 addition & 1 deletion scripts/danger-dts.ts
Expand Up @@ -9,7 +9,7 @@ const createDTS = () => {
//
import { Octokit as GitHub } from "@octokit/rest"
import { Gitlab } from "gitlab"
import { Gitlab } from "@gitbeaker/node"
import { File } from "parse-diff"
`
Expand Down
2 changes: 1 addition & 1 deletion source/dsl/GitLabDSL.ts
@@ -1,7 +1,7 @@
// 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 "gitlab"
import { Gitlab } from "@gitbeaker/node"
import { RepoMetaData } from "./BitBucketServerDSL"

// getPlatformReviewDSLRepresentation
Expand Down
7 changes: 4 additions & 3 deletions source/platforms/gitlab/GitLabAPI.ts
Expand Up @@ -14,7 +14,7 @@ import {
GitLabApproval,
} from "../../dsl/GitLabDSL"

import { Gitlab } from "gitlab"
import { Gitlab } from "@gitbeaker/node"
import { Env } from "../../ci_source/ci_source"
import { debug } from "../../debug"

Expand Down Expand Up @@ -107,7 +107,7 @@ class GitLabAPI {
getMergeRequestApprovals = async (): Promise<GitLabApproval> => {
this.d(`getMergeRequestApprovals for repo: ${this.repoMetadata.repoSlug} pr: ${this.repoMetadata.pullRequestID}`)
const approvals = (await this.api.MergeRequests.approvals(this.repoMetadata.repoSlug, {
mergerequestIId: Number(this.repoMetadata.pullRequestID),
mergerequestIid: Number(this.repoMetadata.pullRequestID),
})) as GitLabApproval
this.d("getMergeRequestApprovals", approvals)
return approvals
Expand Down Expand Up @@ -137,7 +137,8 @@ class GitLabAPI {
getMergeRequestNotes = async (): Promise<GitLabNote[]> => {
this.d("getMergeRequestNotes", this.repoMetadata.repoSlug, this.repoMetadata.pullRequestID)
const api = this.api.MergeRequestNotes
const notes = (await api.all(this.repoMetadata.repoSlug, this.repoMetadata.pullRequestID)) as GitLabNote[]
// TODO: add pagination
const notes = (await api.all(this.repoMetadata.repoSlug, this.repoMetadata.pullRequestID, {})) as GitLabNote[]
this.d("getMergeRequestNotes", notes)
return notes
}
Expand Down

0 comments on commit 507cb11

Please sign in to comment.