import * as node_fetch from "node-fetch"; import { Env } from "../../ci_source/ci_source"; import { api as fetch } from "../../api/fetch"; import { BitBucketCloudPRDSL, BitBucketCloudCommit, BitBucketCloudPRActivity, BitBucketCloudPRComment, BitBucketCloudAPIDSL } from "../../dsl/BitBucketCloudDSL"; import { Comment } from "../platform"; import { RepoMetaData } from "../../dsl/RepoMetaData"; export type BitBucketCloudCredentials = { /** Unique ID for this user, must be wrapped with brackets */ uuid?: string; } & (BitBucketCloudCredentialsOAuth | BitBucketCloudCredentialsPassword | BitBucketCloudCredentialsRepoAccessToken); interface BitBucketCloudCredentialsOAuth { type: "OAUTH"; oauthKey: string; oauthSecret: string; } interface BitBucketCloudCredentialsPassword { type: "PASSWORD"; username: string; password: string; } interface BitBucketCloudCredentialsRepoAccessToken { type: "REPO_ACCESS_TOKEN"; accessToken: string; } export declare function bitbucketCloudCredentialsFromEnv(env: Env): BitBucketCloudCredentials; export declare class BitBucketCloudAPI implements BitBucketCloudAPIDSL { readonly repoMetadata: RepoMetaData; readonly credentials: BitBucketCloudCredentials; fetch: typeof fetch; accessToken: string | undefined; uuid: string | undefined; private readonly d; private pr; private commits; private baseURL; private oauthURL; constructor(repoMetadata: RepoMetaData, credentials: BitBucketCloudCredentials); getBaseRepoURL(): string; getPRURL(): string; getPullRequestsFromBranch: (branch: string) => Promise; getPullRequestInfo: () => Promise; getPullRequestCommits: () => Promise; getPullRequestDiff: () => Promise; getPullRequestComments: () => Promise; getPullRequestActivities: () => Promise; getFileContents: (filePath: string, repoSlug?: string, ref?: string) => Promise; getDangerMainComments: (dangerID: string) => Promise; getDangerInlineComments: (dangerID: string) => Promise; postBuildStatus: (commitId: string, payload: { state: "SUCCESSFUL" | "FAILED" | "INPROGRESS" | "STOPPED"; key: string; name: string; url: string; description: string; }) => Promise; postPRComment: (comment: string) => Promise; postInlinePRComment: (comment: string, line: number, filePath: string) => Promise; deleteComment: (id: string) => Promise; updateComment: (id: string, comment: string) => Promise; private api; private performAPI; get: (url: string, headers?: any, suppressErrors?: boolean) => Promise; post: (url: string, headers?: any, body?: any, suppressErrors?: boolean) => Promise; put: (url: string, headers?: any, body?: any) => Promise; delete: (url: string, headers?: any, body?: any) => Promise; } export {};