/*! * Copyright Adaptavist 2022 (c) All rights reserved */ import { Headers, Response, BaseApiCore, ErrorStrategyOptionType, PlatformImplementation } from '@managed-api/commons-core'; import { CustomError } from './common'; import { CommonError, ErrorStrategyHandlers, ErrorStrategyOption } from './errorStrategy'; import { ErrorStrategyBuilder } from './builders/errorStrategy'; import { CreateUserRequest, CreateUserResponseOK, DeleteUserRequest, DeleteUserResponseOK, GetUsersRequest, GetUsersResponseOK, UpdateCurrentUserRequest, UpdateCurrentUserResponseOK } from './types/user'; import { CreateProjectRequest, CreateProjectResponseOK, DeleteProjectRequest, DeleteProjectResponseOK, GetProjectRequest, GetProjectResponseOK, GetProjectsRequest, GetProjectsResponseOK, UpdateProjectRequest, UpdateProjectResponseOK } from './types/project'; import { CreateRepositoryRequest, CreateRepositoryResponseOK, DeleteRepositoryRequest, DeleteRepositoryResponseOK, GetRepositoriesRequest, GetRepositoriesResponseOK, GetRepositoryRequest, GetRepositoryResponseOK } from './types/repository'; import { ChangeRepositoryPullRequestStatusRequest, ChangeRepositoryPullRequestStatusResponseOK, CreateRepositoryPullRequestRequest, CreateRepositoryPullRequestResponseOK, DeclineRepositoryPullRequestRequest, DeclineRepositoryPullRequestResponseOK, DeleteRepositoryPullRequestRequest, DeleteRepositoryPullRequestResponseOK, GetRepositoryPullRequestActivitiesRequest, GetRepositoryPullRequestActivitiesResponseOK, GetRepositoryPullRequestRequest, GetRepositoryPullRequestResponseOK, GetRepositoryPullRequestsRequest, GetRepositoryPullRequestsResponseOK, MergeRepositoryPullRequestRequest, MergeRepositoryPullRequestResponseOK, ReopenRepositoryPullRequestRequest, ReopenRepositoryPullRequestResponseOK, UpdateRepositoryPullRequestRequest, UpdateRepositoryPullRequestResponseOK } from './types/repository/pullRequest'; import { CreateRepositoryPullRequestCommentRequest, CreateRepositoryPullRequestCommentResponseOK, DeleteRepositoryPullRequestCommentRequest, DeleteRepositoryPullRequestCommentResponseOK, GetRepositoryPullRequestCommentRequest, GetRepositoryPullRequestCommentResponseOK, GetRepositoryPullRequestCommentsRequest, GetRepositoryPullRequestCommentsResponseOK, UpdateRepositoryPullRequestCommentRequest, UpdateRepositoryPullRequestCommentResponseOK } from './types/repository/pullRequest/comment'; import { GetRepositoryPullRequestCommitsRequest, GetRepositoryPullRequestCommitsResponseOK } from './types/repository/pullRequest/commit'; import { GetRepositoryCommitRequest, GetRepositoryCommitResponseOK, GetRepositoryCommitsRequest, GetRepositoryCommitsResponseOK } from './types/repository/commit'; export interface BitbucketOnPremiseApiCoreOptions extends ErrorStrategyOption { } declare type GetGlobalErrorStrategy = () => ErrorStrategyOptionType<CommonError, CustomError, ErrorStrategyHandlers, ErrorStrategyBuilder> | undefined; export declare abstract class BitbucketOnPremiseApiCore extends BaseApiCore { private options?; Repository: RepositoryGroup; Project: ProjectGroup; User: UserGroup; All: AllGroup; constructor(options?: BitbucketOnPremiseApiCoreOptions); setGlobalErrorStrategy(errorStrategy: ErrorStrategyOptionType<CommonError, CustomError, ErrorStrategyHandlers, ErrorStrategyBuilder>): void; protected buildResponse(url: string, status: number, statusText: string, headers: Headers, body?: string | ArrayBuffer): Response<any>; private getGlobalErrorStrategy; } declare class AllGroup { private Repository; private Project; private User; constructor(Repository: RepositoryGroup, Project: ProjectGroup, User: UserGroup); /** * This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects. * Retrieve a page of commits from a given starting commit or "between" two commits. * If no explicit commit is specified, the tip of the repository's default branch is assumed. * Commits may be identified by branch or tag name or by ID. * A path may be supplied to restrict the returned commits to only those which affect that path. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Alternative usage: Repository.Commit.getRepositoryCommits * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp222 * @param options Request options. */ getRepositoryCommits<T = GetRepositoryCommitsResponseOK>(options: GetRepositoryCommitsRequest): Promise<GetRepositoryCommitsResponseOK | T>; /** * This API can also be invoked via a user-centric URL when addressing repositories in personal projects. * Retrieve a single commit identified by its ID. In general, that ID is a SHA1. From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Alternative usage: Repository.Commit.getCommit * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp224 * @param options Request options. */ getRepositoryCommit<T = GetRepositoryCommitResponseOK>(options: GetRepositoryCommitRequest): Promise<GetRepositoryCommitResponseOK | T>; /** * Retrieve a page of users. * The authenticated user must have the LICENSED_USER permission to call this resource. * Alternative usage: User.getUsers * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp17 * @param options Request options. */ getUsers<T = GetUsersResponseOK>(options?: GetUsersRequest): Promise<GetUsersResponseOK | T>; /** * Deletes the specified user, removing them from the system. This also removes any permissions that may have been granted to the user. * A user may not delete themselves, and a user with ADMIN permissions may not delete a user with SYS_ADMINpermissions. * The authenticated user must have the ADMIN permission to call this resource. * Alternative usage: User.deleteUser * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp18 * @param options Request options. */ deleteUser<T = DeleteUserResponseOK>(options: DeleteUserRequest): Promise<DeleteUserResponseOK | T>; /** * Creates a new user from the assembled query parameters. * The default group can be used to control initial permissions for new users, such as granting users the ability to login or providing read access to certain projects or repositories. If the user is not added to the default group, they may not be able to login after their account is created until explicit permissions are configured. * The authenticated user must have the ADMIN permission to call this resource. * Alternative usage: User.createUser * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp19 * @param options Request options. */ createUser<T = CreateUserResponseOK>(options: CreateUserRequest): Promise<CreateUserResponseOK | T>; /** * Update a user's details. * The authenticated user must have the ADMIN permission to call this resource. * Alternative usage: User.updateCurrentUser * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp20 * @param options Request options. */ updateCurrentUser<T = UpdateCurrentUserResponseOK>(options: UpdateCurrentUserRequest): Promise<UpdateCurrentUserResponseOK | T>; /** * Create a new project. * To include a custom avatar for the project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format: * ``` * data:(content type, e.g. image/png);base64,(data) * ``` * If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail. * The authenticated user must have PROJECT_CREATE permission to call this resource. * Alternative usage: Project.createProject * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp148 * @param options Request options. */ createProject<T = CreateProjectResponseOK>(options: CreateProjectRequest): Promise<CreateProjectResponseOK | T>; /** * Retrieve a page of projects. * Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned. * Alternative usage: Project.getProjects * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp149 * @param options Request options. */ getProjects<T = GetProjectsResponseOK>(options?: GetProjectsRequest): Promise<GetProjectsResponseOK | T>; /** * Delete the project matching the supplied projectKey. * The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource. * Alternative usage: Project.deleteProject * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp151 * @param options Request options. */ deleteProject<T = DeleteProjectResponseOK>(options: DeleteProjectRequest): Promise<DeleteProjectResponseOK | T>; /** * Update the project matching the projectKey supplied in the resource path. * To include a custom avatar for the updated project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format: data:(content type, e.g. image/png);base64,(data) If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail. * The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource. * Alternative usage: Project.updateProject * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp152 * @param options Request options. */ updateProject<T = UpdateProjectResponseOK>(options: UpdateProjectRequest): Promise<UpdateProjectResponseOK | T>; /** * Retrieve the project matching the supplied projectKey. * The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource. * Alternative usage: Project.getProject * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp153 * @param options Request options. */ getProject<T = GetProjectResponseOK>(options: GetProjectRequest): Promise<GetProjectResponseOK | T>; /** * Create a new repository. Requires an existing project in which this repository will be created. The only parameters which will be used are name and scmId. * The authenticated user must have PROJECT_ADMIN permission for the context project to call this resource. * Alternative usage: Repository.createRepository * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp174 * @param options Request options. */ createRepository<T = CreateRepositoryResponseOK>(options: CreateRepositoryRequest): Promise<CreateRepositoryResponseOK | T>; /** * Retrieve repositories from the project corresponding to the supplied projectKey. * The authenticated user must have REPO_READ permission for the specified project to call this resource. * Alternative usage: Repository.getRepositories * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp175 * @param options Request options. */ getRepositories<T = GetRepositoriesResponseOK>(options: GetRepositoriesRequest): Promise<GetRepositoriesResponseOK | T>; /** * Schedule the repository matching the supplied projectKey and repositorySlug to be deleted. If the request repository is not present * The authenticated user must have sufficient permissions specified by the repository delete policy to call this resource. The default permission required is REPO_ADMIN permission. * Alternative usage: Repository.deleteRepository * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp177 * @param options Request options. */ deleteRepository<T = DeleteRepositoryResponseOK>(options: DeleteRepositoryRequest): Promise<DeleteRepositoryResponseOK | T>; /** * Retrieve the repository matching the supplied projectKey and repositorySlug. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Alternative usage: Repository.getRepository * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp179 * @param options Request options. */ getRepository<T = GetRepositoryResponseOK>(options: GetRepositoryRequest): Promise<GetRepositoryResponseOK | T>; /** * Retrieve a page of pull requests to or from the specified repository. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. Optionally clients can specify PR participant filters. Each filter has a mandatory username.N parameter, and the optional role.N and approved.N parameters. ** username.N - the "root" of a single participant filter, where "N" is a natural number starting from 1. This allows clients to specify multiple participant filters, by providing consecutive filters as username.1, username.2 etc. Note that the filters numbering has to start with 1 and be continuous for all filters to be processed. The total allowed number of participant filters is 10 and all filters exceeding that limit will be dropped. ** role.N(optional) the role associated with username.N. This must be one of AUTHOR, REVIEWER, orPARTICIPANT ** approved.N(optional) the approved status associated with username.N. That is whether username.N has approved the PR. Either true, or false * Alternative usage: Repository.PullRequest.getPullRequests * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp292 * @param options Request options. */ getRepositoryPullRequests<T = GetRepositoryPullRequestsResponseOK>(options: GetRepositoryPullRequestsRequest): Promise<GetRepositoryPullRequestsResponseOK | T>; /** * Create a new pull request between two branches. The branches may be in the same repository, or different ones. When using different repositories, they must still be in the same {@link Repository#getHierarchyId() hierarchy}. * The authenticated user must have REPO_READ permission for the "from" and "to"repositories to call this resource. * Alternative usage: Repository.PullRequest.createPullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp293 * @param options Request options. */ createRepositoryPullRequest<T = CreateRepositoryPullRequestResponseOK>(options: CreateRepositoryPullRequestRequest): Promise<CreateRepositoryPullRequestResponseOK | T>; /** * Retrieve a pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.getPullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp295 * @param options Request options. */ getRepositoryPullRequest<T = GetRepositoryPullRequestResponseOK>(options: GetRepositoryPullRequestRequest): Promise<GetRepositoryPullRequestResponseOK | T>; /** * Update the title, description, reviewers or destination branch of an existing pull request. * Note: the reviewers list may be updated using this resource. However the author and participants list may not. * The authenticated user must either: ** be the author of the pull request and have the REPO_READ permission for the repository that this pull request targets; or ** have the REPO_WRITE permission for the repository that this pull request targets * * to call this resource. * Alternative usage: Repository.PullRequest.updatePullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp296 * @param options Request options. */ updateRepositoryPullRequest<T = UpdateRepositoryPullRequestResponseOK>(options: UpdateRepositoryPullRequestRequest): Promise<UpdateRepositoryPullRequestResponseOK | T>; /** * Deletes a pull request. * To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must: ** be the pull request author, if the system is configured to allow authors to delete their own pull requests (this is the default) OR ** have repository administrator permission for the repository the pull request is targeting * * A body containing the version of the pull request must be provided with this request. * Alternative usage: Repository.PullRequest.deletePullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp297 * @param options Request options. */ deleteRepositoryPullRequest<T = DeleteRepositoryPullRequestResponseOK>(options: DeleteRepositoryPullRequestRequest): Promise<DeleteRepositoryPullRequestResponseOK | T>; /** * Retrieve a page of activity associated with a pull request. * Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more. * Different types of activity items may be introduced in newer versions of Stash or by user installed plugins, so clients should be flexible enough to handle unexpected entity shapes in the returned page. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.getActivities * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp303 * @param options Request options. */ getRepositoryPullRequestActivities<T = GetRepositoryPullRequestActivitiesResponseOK>(options: GetRepositoryPullRequestActivitiesRequest): Promise<GetRepositoryPullRequestActivitiesResponseOK | T>; /** * Decline a pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.declinePullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp305 * @param options Request options. */ declineRepositoryPullRequest<T = DeclineRepositoryPullRequestResponseOK>(options: DeclineRepositoryPullRequestRequest): Promise<DeclineRepositoryPullRequestResponseOK | T>; /** * Merge the specified pull request. * The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.mergePullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp308 * @param options Request options. */ mergeRepositoryPullRequest<T = MergeRepositoryPullRequestResponseOK>(options: MergeRepositoryPullRequestRequest): Promise<MergeRepositoryPullRequestResponseOK | T>; /** * Re-open a declined pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.reopenPullRequest * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp310 * @param options Request options. */ reopenRepositoryPullRequest<T = MergeRepositoryPullRequestResponseOK>(options: MergeRepositoryPullRequestRequest): Promise<MergeRepositoryPullRequestResponseOK | T>; /** * Change the current user's status for a pull request. Implicitly adds the user as a participant if they are not already. If the current user is the author, this method will fail. * The possible values for status are UNAPPROVED, NEEDS_WORK, or APPROVED. * If the new status is NEEDS_WORK or APPROVED then the lastReviewedCommit for the participant will be updated to the latest commit of the source branch of the pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.changeStatus * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp345 * @param options Request options. */ changeRepositoryPullRequestStatus<T = ChangeRepositoryPullRequestStatusResponseOK>(options: ChangeRepositoryPullRequestStatusRequest): Promise<ChangeRepositoryPullRequestStatusResponseOK | T>; /** * Gets comments for the specified pull request and path. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.Comment.getComments * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp324 * @param options Request options. */ getRepositoryPullRequestComments<T = GetRepositoryPullRequestCommentsResponseOK>(options: GetRepositoryPullRequestCommentsRequest): Promise<GetRepositoryPullRequestCommentsResponseOK | T>; /** * Add a new comment. Comments can be added in a few places by setting different attributes. * If the current user is not a participant the user is added as a watcher of the pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.Comment.createComment * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp325 * @param options Request options. */ createRepositoryPullRequestComment<T = CreateRepositoryPullRequestCommentResponseOK>(options: CreateRepositoryPullRequestCommentRequest): Promise<CreateRepositoryPullRequestCommentResponseOK | T>; /** * Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.Comment.deleteComment * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp327 * @param options Request options. */ deleteRepositoryPullRequestComment<T = DeleteRepositoryPullRequestCommentResponseOK>(options: DeleteRepositoryPullRequestCommentRequest): Promise<DeleteRepositoryPullRequestCommentResponseOK | T>; /** * Update a comment, with the following restrictions: ** only the author of the comment may update the text of the comment ** only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment * * Convert a comment to a task or vice versa. The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Note: the supplied JSON object must contain a version that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure. * Alternative usage: Repository.PullRequest.Comment.updateComment * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp328 * @param options Request options. */ updateRepositoryPullRequestComment<T = UpdateRepositoryPullRequestCommentResponseOK>(options: UpdateRepositoryPullRequestCommentRequest): Promise<UpdateRepositoryPullRequestCommentResponseOK | T>; /** * Retrieves a pull request comment. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.Comment.getComment * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp329 * @param options Request options. */ getRepositoryPullRequestComment<T = GetRepositoryPullRequestCommentResponseOK>(options: GetRepositoryPullRequestCommentRequest): Promise<GetRepositoryPullRequestCommentResponseOK | T>; /** * Retrieve commits for the specified pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Alternative usage: Repository.PullRequest.Commit.getCommits * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp333 * @param options Request options. */ getRepositoryPullRequestCommits<T = GetRepositoryPullRequestCommitsResponseOK>(options: GetRepositoryPullRequestCommitsRequest): Promise<GetRepositoryPullRequestCommitsResponseOK | T>; } declare class RepositoryGroup { private implementation; private getGlobalErrorStrategy; PullRequest: RepositoryPullRequestGroup; Commit: RepositoryCommitGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Create a new repository. Requires an existing project in which this repository will be created. The only parameters which will be used are name and scmId. * The authenticated user must have PROJECT_ADMIN permission for the context project to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp174 * @param options Request options. */ createRepository<T = CreateRepositoryResponseOK>(options: CreateRepositoryRequest): Promise<CreateRepositoryResponseOK | T>; /** * Retrieve repositories from the project corresponding to the supplied projectKey. * The authenticated user must have REPO_READ permission for the specified project to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp175 * @param options Request options. */ getRepositories<T = GetRepositoriesResponseOK>(options: GetRepositoriesRequest): Promise<GetRepositoriesResponseOK | T>; /** * Schedule the repository matching the supplied projectKey and repositorySlug to be deleted. If the request repository is not present * The authenticated user must have sufficient permissions specified by the repository delete policy to call this resource. The default permission required is REPO_ADMIN permission. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp177 * @param options Request options. */ deleteRepository<T = DeleteRepositoryResponseOK>(options: DeleteRepositoryRequest): Promise<DeleteRepositoryResponseOK | T>; /** * Retrieve the repository matching the supplied projectKey and repositorySlug. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp179 * @param options Request options. */ getRepository<T = GetRepositoryResponseOK>(options: GetRepositoryRequest): Promise<GetRepositoryResponseOK | T>; } declare class RepositoryPullRequestGroup { private implementation; private getGlobalErrorStrategy; Comment: RepositoryPullRequestCommentGroup; Commit: RepositoryPullRequestCommitGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Retrieve a page of pull requests to or from the specified repository. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. Optionally clients can specify PR participant filters. Each filter has a mandatory username.N parameter, and the optional role.N and approved.N parameters. ** username.N - the "root" of a single participant filter, where "N" is a natural number starting from 1. This allows clients to specify multiple participant filters, by providing consecutive filters as username.1, username.2 etc. Note that the filters numbering has to start with 1 and be continuous for all filters to be processed. The total allowed number of participant filters is 10 and all filters exceeding that limit will be dropped. ** role.N(optional) the role associated with username.N. This must be one of AUTHOR, REVIEWER, orPARTICIPANT ** approved.N(optional) the approved status associated with username.N. That is whether username.N has approved the PR. Either true, or false * * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp292 * @param options Request options. */ getPullRequests<T = GetRepositoryPullRequestsResponseOK>(options: GetRepositoryPullRequestsRequest): Promise<GetRepositoryPullRequestsResponseOK | T>; /** * Create a new pull request between two branches. The branches may be in the same repository, or different ones. When using different repositories, they must still be in the same {@link Repository#getHierarchyId() hierarchy}. * The authenticated user must have REPO_READ permission for the "from" and "to"repositories to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp293 * @param options Request options. */ createPullRequest<T = CreateRepositoryPullRequestResponseOK>(options: CreateRepositoryPullRequestRequest): Promise<CreateRepositoryPullRequestResponseOK | T>; /** * Retrieve a pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp295 * @param options Request options. */ getPullRequest<T = GetRepositoryPullRequestResponseOK>(options: GetRepositoryPullRequestRequest): Promise<GetRepositoryPullRequestResponseOK | T>; /** * Update the title, description, reviewers or destination branch of an existing pull request. * Note: the reviewers list may be updated using this resource. However the author and participants list may not. * The authenticated user must either: ** be the author of the pull request and have the REPO_READ permission for the repository that this pull request targets; or ** have the REPO_WRITE permission for the repository that this pull request targets * * to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp296 * @param options Request options. */ updatePullRequest<T = UpdateRepositoryPullRequestResponseOK>(options: UpdateRepositoryPullRequestRequest): Promise<UpdateRepositoryPullRequestResponseOK | T>; /** * Deletes a pull request. * To call this resource, users must be authenticated and have permission to view the pull request. Additionally, they must: ** be the pull request author, if the system is configured to allow authors to delete their own pull requests (this is the default) OR ** have repository administrator permission for the repository the pull request is targeting * * A body containing the version of the pull request must be provided with this request. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp297 * @param options Request options. */ deletePullRequest<T = DeleteRepositoryPullRequestResponseOK>(options: DeleteRepositoryPullRequestRequest): Promise<DeleteRepositoryPullRequestResponseOK | T>; /** * Retrieve a page of activity associated with a pull request. * Activity items include comments, approvals, rescopes (i.e. adding and removing of commits), merges and more. * Different types of activity items may be introduced in newer versions of Stash or by user installed plugins, so clients should be flexible enough to handle unexpected entity shapes in the returned page. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp303 * @param options Request options. */ getActivities<T = GetRepositoryPullRequestActivitiesResponseOK>(options: GetRepositoryPullRequestActivitiesRequest): Promise<GetRepositoryPullRequestActivitiesResponseOK | T>; /** * Decline a pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp305 * @param options Request options. */ declinePullRequest<T = DeclineRepositoryPullRequestResponseOK>(options: DeclineRepositoryPullRequestRequest): Promise<DeclineRepositoryPullRequestResponseOK | T>; /** * Merge the specified pull request. * The authenticated user must have REPO_WRITE permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp308 * @param options Request options. */ mergePullRequest<T = MergeRepositoryPullRequestResponseOK>(options: MergeRepositoryPullRequestRequest): Promise<MergeRepositoryPullRequestResponseOK | T>; /** * Re-open a declined pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp310 * @param options Request options. */ reopenPullRequest<T = ReopenRepositoryPullRequestResponseOK>(options: ReopenRepositoryPullRequestRequest): Promise<ReopenRepositoryPullRequestResponseOK | T>; /** * Change the current user's status for a pull request. Implicitly adds the user as a participant if they are not already. If the current user is the author, this method will fail. * The possible values for status are UNAPPROVED, NEEDS_WORK, or APPROVED. * If the new status is NEEDS_WORK or APPROVED then the lastReviewedCommit for the participant will be updated to the latest commit of the source branch of the pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp345 * @param options Request options. */ changeStatus<T = ChangeRepositoryPullRequestStatusResponseOK>(options: ChangeRepositoryPullRequestStatusRequest): Promise<ChangeRepositoryPullRequestStatusResponseOK | T>; } declare class RepositoryCommitGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * This is a paged API. This API can also be invoked via a user-centric URL when addressing repositories in personal projects. * Retrieve a page of commits from a given starting commit or "between" two commits. * If no explicit commit is specified, the tip of the repository's default branch is assumed. * Commits may be identified by branch or tag name or by ID. * A path may be supplied to restrict the returned commits to only those which affect that path. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp222 * @param options Request options. */ getRepositoryCommits<T = GetRepositoryCommitsResponseOK>(options: GetRepositoryCommitsRequest): Promise<GetRepositoryCommitsResponseOK | T>; /** * This API can also be invoked via a user-centric URL when addressing repositories in personal projects. * Retrieve a single commit identified by its ID. In general, that ID is a SHA1. From 2.11, ref names like "refs/heads/master" are no longer accepted by this resource. * The authenticated user must have REPO_READ permission for the specified repository to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp224 * @param options Request options. */ getCommit<T = GetRepositoryCommitResponseOK>(options: GetRepositoryCommitRequest): Promise<GetRepositoryCommitResponseOK | T>; } declare class RepositoryPullRequestCommentGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Gets comments for the specified pull request and path. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp324 * @param options Request options. */ getComments<T = GetRepositoryPullRequestCommentsResponseOK>(options: GetRepositoryPullRequestCommentsRequest): Promise<GetRepositoryPullRequestCommentsResponseOK | T>; /** * Add a new comment. Comments can be added in a few places by setting different attributes. * If the current user is not a participant the user is added as a watcher of the pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp325 * @param options Request options. */ createComment<T = CreateRepositoryPullRequestCommentResponseOK>(options: CreateRepositoryPullRequestCommentRequest): Promise<CreateRepositoryPullRequestCommentResponseOK | T>; /** * Delete a pull request comment. Anyone can delete their own comment. Only users with REPO_ADMIN and above may delete comments created by other users. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp327 * @param options Request options. */ deleteComment<T = DeleteRepositoryPullRequestCommentResponseOK>(options: DeleteRepositoryPullRequestCommentRequest): Promise<DeleteRepositoryPullRequestCommentResponseOK | T>; /** * Update a comment, with the following restrictions: ** only the author of the comment may update the text of the comment ** only the author of the comment, the author of the pull request or repository admins and above may update the other fields of a comment * * Convert a comment to a task or vice versa. The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Note: the supplied JSON object must contain a version that must match the server's version of the comment or the update will fail. To determine the current version of the comment, the comment should be fetched from the server prior to the update. Look for the 'version' attribute in the returned JSON structure. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp328 * @param options Request options. */ updateComment<T = UpdateRepositoryPullRequestCommentResponseOK>(options: UpdateRepositoryPullRequestCommentRequest): Promise<UpdateRepositoryPullRequestCommentResponseOK | T>; /** * Retrieves a pull request comment. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp329 * @param options Request options. */ getComment<T = GetRepositoryPullRequestCommentResponseOK>(options: GetRepositoryPullRequestCommentRequest): Promise<GetRepositoryPullRequestCommentResponseOK | T>; } declare class RepositoryPullRequestCommitGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Retrieve commits for the specified pull request. * The authenticated user must have REPO_READ permission for the repository that this pull request targets to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp333 * @param options Request options. */ getCommits<T = GetRepositoryPullRequestCommitsResponseOK>(options: GetRepositoryPullRequestCommitsRequest): Promise<GetRepositoryPullRequestCommitsResponseOK | T>; } declare class ProjectGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Create a new project. * To include a custom avatar for the project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format: * ``` * data:(content type, e.g. image/png);base64,(data) * ``` * If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail. * The authenticated user must have PROJECT_CREATE permission to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp148 * @param options Request options. */ createProject<T = CreateProjectResponseOK>(options: CreateProjectRequest): Promise<CreateProjectResponseOK | T>; /** * Retrieve a page of projects. * Only projects for which the authenticated user has the PROJECT_VIEW permission will be returned. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp149 * @param options Request options. */ getProjects<T = GetProjectsResponseOK>(options?: GetProjectsRequest): Promise<GetProjectsResponseOK | T>; /** * Delete the project matching the supplied projectKey. * The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp151 * @param options Request options. */ deleteProject<T = DeleteProjectResponseOK>(options: DeleteProjectRequest): Promise<DeleteProjectResponseOK | T>; /** * Update the project matching the projectKey supplied in the resource path. * To include a custom avatar for the updated project, the project definition should contain an additional attribute with the key avatar and the value a data URI containing Base64-encoded image data. The URI should be in the following format: data:(content type, e.g. image/png);base64,(data) If the data is not Base64-encoded, or if a character set is defined in the URI, or the URI is otherwise invalid, project creation will fail. * The authenticated user must have PROJECT_ADMIN permission for the specified project to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp152 * @param options Request options. */ updateProject<T = UpdateProjectResponseOK>(options: UpdateProjectRequest): Promise<UpdateProjectResponseOK | T>; /** * Retrieve the project matching the supplied projectKey. * The authenticated user must have PROJECT_VIEW permission for the specified project to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp153 * @param options Request options. */ getProject<T = GetProjectResponseOK>(options: GetProjectRequest): Promise<GetProjectResponseOK | T>; } declare class UserGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Retrieve a page of users. * The authenticated user must have the LICENSED_USER permission to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp17 * @param options Request options. */ getUsers<T = GetUsersResponseOK>(options?: GetUsersRequest): Promise<GetUsersResponseOK | T>; /** * Deletes the specified user, removing them from the system. This also removes any permissions that may have been granted to the user. * A user may not delete themselves, and a user with ADMIN permissions may not delete a user with SYS_ADMINpermissions. * The authenticated user must have the ADMIN permission to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp18 * @param options Request options. */ deleteUser<T = DeleteUserResponseOK>(options: DeleteUserRequest): Promise<DeleteUserResponseOK | T>; /** * Creates a new user from the assembled query parameters. * The default group can be used to control initial permissions for new users, such as granting users the ability to login or providing read access to certain projects or repositories. If the user is not added to the default group, they may not be able to login after their account is created until explicit permissions are configured. * The authenticated user must have the ADMIN permission to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp19 * @param options Request options. */ createUser<T = CreateUserResponseOK>(options: CreateUserRequest): Promise<CreateUserResponseOK | T>; /** * Update a user's details. * The authenticated user must have the ADMIN permission to call this resource. * Documentation: https://docs.atlassian.com/bitbucket-server/rest/7.11.1/bitbucket-rest.html#idp20 * @param options Request options. */ updateCurrentUser<T = UpdateCurrentUserResponseOK>(options: UpdateCurrentUserRequest): Promise<UpdateCurrentUserResponseOK | T>; } export {}; //# sourceMappingURL=index.d.ts.map