/*! * Copyright Adaptavist 2022 (c) All rights reserved */ import { FindRepositoryStepsForPipelineRequest, FindRepositoryStepsForPipelineResponseOK } from "./types/repository/pipeline/step"; import { RetrieveRepositoryStepForPipelineRequest, RetrieveRepositoryStepForPipelineResponseOK } from "./types/repository/pipeline/step"; import { UpdateRepositoryPipelineConfigurationBuildNumberRequest, UpdateRepositoryPipelineConfigurationBuildNumberResponseOK } from "./types/repository/pipeline/configuration/build"; import { CreateRepositoryPipelineConfigurationScheduleRequest, CreateRepositoryPipelineConfigurationScheduleResponseOK } from "./types/repository/pipeline/configuration/schedule"; import { RetrieveRepositoryPipelineConfigurationSchedulesRequest, RetrieveRepositoryPipelineConfigurationSchedulesResponseOK } from "./types/repository/pipeline/configuration/schedule"; import { UpdateRepositoryPipelineConfigurationScheduleRequest, UpdateRepositoryPipelineConfigurationScheduleResponseOK } from "./types/repository/pipeline/configuration/schedule"; import { RetrieveRepositoryPipelineConfigurationScheduleRequest, RetrieveRepositoryPipelineConfigurationScheduleResponseOK } from "./types/repository/pipeline/configuration/schedule"; import { DeleteRepositoryPipelineConfigurationScheduleRequest, DeleteRepositoryPipelineConfigurationScheduleResponseOK } from "./types/repository/pipeline/configuration/schedule"; import { GetRepositoryPipelineConfigurationVariablesRequest, GetRepositoryPipelineConfigurationVariablesResponseOK } from "./types/repository/pipeline/configuration/variable"; import { CreateRepositoryPipelineConfigurationVariableRequest, CreateRepositoryPipelineConfigurationVariableResponseOK } from "./types/repository/pipeline/configuration/variable"; import { GetRepositoryPipelineConfigurationVariableRequest, GetRepositoryPipelineConfigurationVariableResponseOK } from "./types/repository/pipeline/configuration/variable"; import { UpdateRepositoryPipelineConfigurationVariableRequest, UpdateRepositoryPipelineConfigurationVariableResponseOK } from "./types/repository/pipeline/configuration/variable"; import { DeleteRepositoryPipelineConfigurationVariableRequest, DeleteRepositoryPipelineConfigurationVariableResponseOK } from "./types/repository/pipeline/configuration/variable"; import { UpdateRepositoryPipelineConfigurationRequest, UpdateRepositoryPipelineConfigurationResponseOK } from "./types/repository/pipeline/configuration"; import { RetrieveRepositoryPipelineConfigurationRequest, RetrieveRepositoryPipelineConfigurationResponseOK } from "./types/repository/pipeline/configuration"; import { CreateAndInitiateRepositoryPipelineRequest, CreateAndInitiateRepositoryPipelineResponseOK } from "./types/repository/pipeline"; import { FindRepositoryPipelinesRequest, FindRepositoryPipelinesResponseOK } from "./types/repository/pipeline"; import { RetrieveRepositoryPipelineRequest, RetrieveRepositoryPipelineResponseOK } from "./types/repository/pipeline"; import { StopRepositoryPipelineRequest, StopRepositoryPipelineResponseOK } from "./types/repository/pipeline"; import { GetRepositoryPullrequestCommentsRequest, GetRepositoryPullrequestCommentsResponseOK } from "./types/repository/pullrequest/comment"; import { CreateRepositoryPullrequestCommentRequest, CreateRepositoryPullrequestCommentResponseOK } from "./types/repository/pullrequest/comment"; import { DeleteRepositoryPullrequestCommentRequest, DeleteRepositoryPullrequestCommentResponseOK } from "./types/repository/pullrequest/comment"; import { GetRepositoryPullrequestCommentRequest, GetRepositoryPullrequestCommentResponseOK } from "./types/repository/pullrequest/comment"; import { UpdateRepositoryPullrequestCommentRequest, UpdateRepositoryPullrequestCommentResponseOK } from "./types/repository/pullrequest/comment"; import { GetRepositoryPullrequestCommitsRequest, GetRepositoryPullrequestCommitsResponseOK } from "./types/repository/pullrequest/commit"; import { GetRepositoryPullrequestsRequest, GetRepositoryPullrequestsResponseOK } from "./types/repository/pullrequest"; import { CreateRepositoryPullrequestRequest, CreateRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { GetRepositoryPullrequestActivityLogRequest, GetRepositoryPullrequestActivityLogResponseOK } from "./types/repository/pullrequest"; import { GetRepositoryPullrequestRequest, GetRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { MutateRepositoryPullrequestRequest, MutateRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { ApproveRepositoryPullrequestRequest, ApproveRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { DeclineRepositoryPullrequestRequest, DeclineRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { MergeRepositoryPullrequestRequest, MergeRepositoryPullrequestResponseOK } from "./types/repository/pullrequest"; import { GetRepositoryPullrequestStatusesRequest, GetRepositoryPullrequestStatusesResponseOK } from "./types/repository/pullrequest"; import { GetRepositoryBranchRestrictionsRequest, GetRepositoryBranchRestrictionsResponseOK } from "./types/repository/branch/restriction"; import { CreateRepositoryBranchRestrictionRequest, CreateRepositoryBranchRestrictionResponseOK } from "./types/repository/branch/restriction"; import { GetRepositoryBranchRestrictionRequest, GetRepositoryBranchRestrictionResponseOK } from "./types/repository/branch/restriction"; import { UpdateRepositoryBranchRestrictionRequest, UpdateRepositoryBranchRestrictionResponseOK } from "./types/repository/branch/restriction"; import { DeleteRepositoryBranchRestrictionRequest, DeleteRepositoryBranchRestrictionResponseOK } from "./types/repository/branch/restriction"; import { GetRepositoryOpenBranchesRequest, GetRepositoryOpenBranchesResponseOK } from "./types/repository/branch"; import { CreateRepositoryBranchResponseOK, CreateRepositoryBranchRequest } from "./types/repository/branch"; import { GetRepositoryBranchRequest, GetRepositoryBranchResponseOK } from "./types/repository/branch"; import { DeleteRepositoryBranchRequest, DeleteRepositoryBranchResponseOK } from "./types/repository/branch"; import { ApproveRepositoryCommitRequest, ApproveRepositoryCommitResponseOK } from "./types/repository/commit/approval"; import { RedactRepositoryCommitApprovalRequest, RedactRepositoryCommitApprovalResponseOK } from "./types/repository/commit/approval"; import { GetRepositoryCommitCommentsRequest, GetRepositoryCommitCommentsResponseOK } from "./types/repository/commit/comment"; import { GetRepositoryCommitCommentRequest, GetRepositoryCommitCommentResponseOK } from "./types/repository/commit/comment"; import { GetRepositoryCommitStatusesRequest, GetRepositoryCommitStatusesResponseOK } from "./types/repository/commit/status"; import { CreateRepositoryCommitStatusRequest, CreateRepositoryCommitStatusResponseOK } from "./types/repository/commit/status"; import { GetRepositoryCommitStatusRequest, GetRepositoryCommitStatusResponseOK } from "./types/repository/commit/status"; import { GetRepositoryCommitRequest, GetRepositoryCommitResponseOK } from "./types/repository/commit"; import { GetRepositoryCommitsByFileRequest, GetRepositoryCommitsByFileResponseOK } from "./types/repository/commit"; import { GetRepositoryCommitsResponseOK, GetRepositoryCommitsRequest } from "./types/repository/commit"; import { GetRepositoryDefaultReviewersRequest, GetRepositoryDefaultReviewersResponseOK } from "./types/repository/reviewer/default"; import { GetRepositoryDefaultReviewerRequest, GetRepositoryDefaultReviewerResponseOK } from "./types/repository/reviewer/default"; import { AddRepositoryDefaultReviewerRequest, AddRepositoryDefaultReviewerResponseOK } from "./types/repository/reviewer/default"; import { RemoveRepositoryDefaultReviewerRequest, RemoveRepositoryDefaultReviewerResponseOK } from "./types/repository/reviewer/default"; import { GetRepositoryTagsRequest, GetRepositoryTagsResponseOK } from "./types/repository/tag"; import { CreateRepositoryTagRequest, CreateRepositoryTagResponseOK } from "./types/repository/tag"; import { GetRepositoryTagRequest, GetRepositoryTagResponseOK } from "./types/repository/tag"; import { DeleteRepositoryTagRequest, DeleteRepositoryTagResponseOK } from "./types/repository/tag"; import { GetRepositoryEnvironmentVariablesRequest, GetRepositoryEnvironmentVariablesResponseOK } from "./types/repository/environment/variable"; import { CreateRepositoryEnvironmentVariableRequest, CreateRepositoryEnvironmentVariableResponseOK } from "./types/repository/environment/variable"; import { UpdateRepositoryEnvironmentVariableRequest, UpdateRepositoryEnvironmentVariableResponseOK } from "./types/repository/environment/variable"; import { DeleteRepositoryEnvironmentVariableRequest, DeleteRepositoryEnvironmentVariableResponseOK } from "./types/repository/environment/variable"; import { GetRepositoryEnvironmentsRequest, GetRepositoryEnvironmentsResponseOK } from "./types/repository/environment"; import { CreateRepositoryEnvironmentRequest, CreateRepositoryEnvironmentResponseOK } from "./types/repository/environment"; import { GetRepositoryEnvironmentRequest, GetRepositoryEnvironmentResponseOK } from "./types/repository/environment"; import { DeleteRepositoryEnvironmentRequest, DeleteRepositoryEnvironmentResponseOK } from "./types/repository/environment"; import { GetRepositoryForksRequest, GetRepositoryForksResponseOK } from "./types/repository/fork"; import { CreateRepositoryForkRequest, CreateRepositoryForkResponseOK } from "./types/repository/fork"; import { GetRepositoryDeploymentsRequest, GetRepositoryDeploymentsResponseOK } from "./types/repository/deployment"; import { GetRepositoryDeploymentRequest, GetRepositoryDeploymentResponseOK } from "./types/repository/deployment"; import { GetRepositoriesRequest, GetRepositoriesResponseOK } from "./types/repository"; import { GetRepositoriesByWorkspaceRequest, GetRepositoriesByWorkspaceResponseOK } from "./types/repository"; import { GetRepositoryRequest, GetRepositoryResponseOK } from "./types/repository"; import { UpdateRepositoryRequest, UpdateRepositoryResponseOK } from "./types/repository"; import { CreateRepositoryRequest, CreateRepositoryResponseOK } from "./types/repository"; import { DeleteRepositoryRequest, DeleteRepositoryResponseOK } from "./types/repository"; import { GetRepositoryBranchesAndTagsRequest, GetRepositoryBranchesAndTagsResponseOK } from "./types/repository"; import { GetCurrentUserRepositoryPermissionsRequest, GetCurrentUserRepositoryPermissionsResponseOK } from "./types/user/permission"; import { GetCurrentUserWorkspaceMembershipsRequest, GetCurrentUserWorkspaceMembershipsResponseOK } from "./types/user/permission"; import { GetUserSSHKeysRequest, GetUserSSHKeysResponseOK } from "./types/user/ssh"; import { AddUserSSHKeyRequest, AddUserSSHKeyResponseOK } from "./types/user/ssh"; import { GetUserSSHKeyRequest, GetUserSSHKeyResponseOK } from "./types/user/ssh"; import { UpdateUserSSHKeyRequest, UpdateUserSSHKeyResponseOK } from "./types/user/ssh"; import { DeleteUserSSHKeyRequest, DeleteUserSSHKeyResponseOK } from "./types/user/ssh"; import { GetCurrentUserRequest, GetCurrentUserResponseOK } from "./types/user"; import { GetCurrentUserEmailsRequest, GetCurrentUserEmailsResponseOK } from "./types/user"; import { GetUserRequest, GetUserResponseOK } from "./types/user"; import { GetCurrentUserEmailRequest, GetCurrentUserEmailResponseOK } from "./types/user"; import { SearchCodeInWorkspaceProjectsRequest, SearchCodeInWorkspaceProjectsResponseOK } from "./types/workspace/project/search"; import { GetWorkspaceProjectsRequest, GetWorkspaceProjectsResponseOK } from "./types/workspace/project"; import { CreateWorkspaceProjectRequest, CreateWorkspaceProjectResponseOK } from "./types/workspace/project"; import { DeleteWorkspaceProjectRequest, DeleteWorkspaceProjectResponseOK } from "./types/workspace/project"; import { GetWorkspaceProjectRequest, GetWorkspaceProjectResponseOK } from "./types/workspace/project"; import { GetWorkspaceVariablesRequest, GetWorkspaceVariablesResponseOK } from "./types/workspace/variable"; import { CreateWorkspaceVariableRequest, CreateWorkspaceVariableResponseOK } from "./types/workspace/variable"; import { GetWorkspaceVariableRequest, GetWorkspaceVariableResponseOK } from "./types/workspace/variable"; import { UpdateWorkspaceVariableRequest, UpdateWorkspaceVariableResponseOK } from "./types/workspace/variable"; import { DeleteWorkspaceVariableRequest, DeleteWorkspaceVariableResponseOK } from "./types/workspace/variable"; import { GetWorkspacesRequest, GetWorkspacesResponseOK } from "./types/workspace"; import { GetWorkspaceRequest, GetWorkspaceResponseOK } from "./types/workspace"; import { BaseApiCore, Headers, Response, ErrorStrategyOptionType, PlatformImplementation } from "@managed-api/commons-core"; import { CommonError, AdditionalErrorTypes, ErrorStrategyHandlers, ErrorStrategyOption } from "./errorStrategy"; import { ErrorStrategyBuilder } from "./builders/errorStrategy"; export interface BitbucketCloudApiCoreOptions extends ErrorStrategyOption { } declare type GetGlobalErrorStrategy = () => ErrorStrategyOptionType | undefined; export declare abstract class BitbucketCloudApiCore extends BaseApiCore { private options?; Repository: RepositoryGroup; User: UserGroup; Workspace: WorkspaceGroup; All: AllGroup; constructor(options?: BitbucketCloudApiCoreOptions | undefined); setGlobalErrorStrategy(errorStrategy: ErrorStrategyOptionType): void; protected buildResponse(url: string, status: number, statusText: string, headers: Headers, body?: string | ArrayBuffer): Response; private getGlobalErrorStrategy; } declare class AllGroup { private Repository; private User; private Workspace; constructor(Repository: RepositoryGroup, User: UserGroup, Workspace: WorkspaceGroup); /** * Returns a paginated list of all public repositories. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Alternative usage: Repository.getRepositories * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-get * @param options Request options. */ getRepositories(options?: GetRepositoriesRequest): Promise; /** * Returns a paginated list of all repositories owned by the specified workspace. The result can be narrowed down based on the authenticated user's role. E.g. with `?role=contributor`, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access). This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Alternative usage: Repository.getRepositoriesByWorkspace * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get * @param options Request options. */ getRepositoriesByWorkspace(options: GetRepositoriesByWorkspaceRequest): Promise; /** * Returns the object describing this repository. * Alternative usage: Repository.getRepository * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get * @param options Request options. */ getRepository(options: GetRepositoryRequest): Promise; /** * Since this endpoint can be used to both update and to create a repository, the request body depends on the intent. #### Creation See the POST documentation for the repository endpoint for an example of the request body. #### Update Note: Changing the `name` of the repository will cause the location to be changed. This is because the URL of the repo is derived from the name (a process called slugification). In such a scenario, it is possible for the request to fail if the newly created slug conflicts with an existing repository's slug. But if there is no conflict, the new location will be returned in the `Location` header of the response. * Alternative usage: Repository.updateRepository * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-put * @param options Request options. */ updateRepository(options: UpdateRepositoryRequest): Promise; /** * Creates a new repository. Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below: ``` $ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "MARS" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` or ``` $ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "{ba516952-992a-4c2d-acbd-17d502922f96}" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` The project must be assigned for all repositories. If the project is not provided, the repository is automatically assigned to the oldest project in the workspace. Note: In the examples above, the workspace ID `teamsinspace`, and/or the repository name `hablanding` can be replaced by UUIDs. * Alternative usage: Repository.createRepository * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post * @param options Request options. */ createRepository(options: CreateRepositoryRequest): Promise; /** * Deletes the repository. This is an irreversible operation. This does not affect its forks. * Alternative usage: Repository.deleteRepository * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-delete * @param options Request options. */ deleteRepository(options: DeleteRepositoryRequest): Promise; /** * Returns the branches and tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git show-ref". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are sorted ["branch1", "branch10", "branch2", "v10", "v11", "v9"] instead of ["branch1", "branch2", "branch10", "v9", "v10", "v11"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Alternative usage: Repository.getBranchesAndTags * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-get * @param options Request options. */ getRepositoryBranchesAndTags(options: GetRepositoryBranchesAndTagsRequest): Promise; /** * Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated. # Trigger a Pipeline for a branch One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the `bitbucket-pipelines.yml` file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }' ``` # Trigger a Pipeline for a commit on a branch or tag You can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark). The specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference. The following reference types are supported: * `branch` * `named_branch` * `bookmark` * `tag` ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "type": "commit", "hash": "ce5b7431602f7cbba007062eeb55225c6e18e956" }, "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }' ``` # Trigger a specific pipeline definition for a commit You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type":"custom", "pattern":"Deploy to production" }, "type":"pipeline_commit_target" } }' ``` # Trigger a specific pipeline definition for a commit on a branch or tag You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit in the context of a specified reference. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type": "custom", "pattern": "Deploy to production" }, "type": "pipeline_ref_target", "ref_name": "master", "ref_type": "branch" } }' ``` # Trigger a custom pipeline with variables In addition to triggering a custom pipeline that is defined in your `bitbucket-pipelines.yml` file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured). ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_ref_target", "ref_type": "branch", "ref_name": "master", "selector": { "type": "custom", "pattern": "Deploy to production" } }, "variables": [ { "key": "var1key", "value": "var1value", "secured": true }, { "key": "var2key", "value": "var2value" } ] }' ``` # Trigger a pull request pipeline You can also initiate a pipeline for a specific pull request. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_pullrequest_target", "source": "pull-request-branch", "destination": "master", "destination_commit": { "hash": "9f848b7" }, "commit": { "hash": "1a372fc" }, "pullrequest": { "id": "3" }, "selector": { "type": "pull-requests", "pattern": "**" } } }' ``` * Alternative usage: Repository.Pipeline.createAndInitiatePipeline * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-post * @param options Request options. */ createAndInitiateRepositoryPipeline(options: CreateAndInitiateRepositoryPipelineRequest): Promise; /** * Find pipelines in a repository. Note that unlike other endpoints in the Bitbucket API, this endpoint utilizes query parameters to allow filtering and sorting of returned results. See [query parameters](#api-repositories-workspace-repo-slug-pipelines-get-request-Query%20parameters) for specific details. * Alternative usage: Repository.Pipeline.findPipelines * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-get * @param options Request options. */ findRepositoryPipelines(options: FindRepositoryPipelinesRequest): Promise; /** * Retrieve a specified pipeline * Alternative usage: Repository.Pipeline.retrievePipeline * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-get * @param options Request options. */ retrieveRepositoryPipeline(options: RetrieveRepositoryPipelineRequest): Promise; /** * Signal the stop of a pipeline and all of its steps that not have completed yet. * Alternative usage: Repository.Pipeline.stopPipeline * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-stoppipeline-post * @param options Request options. */ stopRepositoryPipeline(options: StopRepositoryPipelineRequest): Promise; /** * Find steps for the given pipeline. * Alternative usage: Repository.Pipeline.Step.findSteps * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-steps-get * @param options Request options. */ findRepositoryStepsForPipeline(options: FindRepositoryStepsForPipelineRequest): Promise; /** * Retrieve a given step of a pipeline. * Alternative usage: Repository.Pipeline.Step.retrieveStep * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-steps-step-uuid-get * @param options Request options. */ retrieveRepositoryStepForPipeline(options: RetrieveRepositoryStepForPipelineRequest): Promise; /** * Update the pipelines configuration for a repository. * Alternative usage: Repository.Pipeline.Configuration.updateConfiguration * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-put * @param options Request options. */ updateRepositoryPipelineConfiguration(options: UpdateRepositoryPipelineConfigurationRequest): Promise; /** * Retrieve the repository pipelines configuration. * Alternative usage: Repository.Pipeline.Configuration.retrieveConfiguration * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-get * @param options Request options. */ retrieveRepositoryPipelineConfiguration(options: RetrieveRepositoryPipelineConfigurationRequest): Promise; /** * Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository. * Alternative usage: Repository.Pipeline.Configuration.Build.updateBuildNumber * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-build-number-put * @param options Request options. */ updateRepositoryPipelineConfigurationBuildNumber(options: UpdateRepositoryPipelineConfigurationBuildNumberRequest): Promise; /** * Create a schedule for the given repository. * Alternative usage: Repository.Pipeline.Configuration.Schedule.createSchedule * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-post * @param options Request options. */ createRepositoryPipelineConfigurationSchedule(options: CreateRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Retrieve the configured schedules for the given repository. * Alternative usage: Repository.Pipeline.Configuration.Schedule.retrieveSchedules * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-get * @param options Request options. */ retrieveRepositoryPipelineConfigurationSchedules(options: RetrieveRepositoryPipelineConfigurationSchedulesRequest): Promise; /** * Update a schedule. * Alternative usage: Repository.Pipeline.Configuration.Schedule.updateSchedule * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-put * @param options Request options. */ updateRepositoryPipelineConfigurationSchedule(options: UpdateRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Retrieve a schedule by its UUID. * Alternative usage: Repository.Pipeline.Configuration.Schedule.retrieveSchedule * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-get * @param options Request options. */ retrieveRepositoryPipelineConfigurationSchedule(options: RetrieveRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Delete a schedule. * Alternative usage: Repository.Pipeline.Configuration.Schedule.deleteSchedule * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-delete * @param options Request options. */ deleteRepositoryPipelineConfigurationSchedule(options: DeleteRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Find repository level variables. * Alternative usage: Repository.Pipeline.Configuration.Variable.getVariables * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-get * @param options Request options. */ getRepositoryPipelineConfigurationVariables(options: GetRepositoryPipelineConfigurationVariablesRequest): Promise; /** * Create a repository level variable. * Alternative usage: Repository.Pipeline.Configuration.Variable.createVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-post * @param options Request options. */ createRepositoryPipelineConfigurationVariable(options: CreateRepositoryPipelineConfigurationVariableRequest): Promise; /** * Retrieve a repository level variable. * Alternative usage: Repository.Pipeline.Configuration.Variable.getVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-get * @param options Request options. */ getRepositoryPipelineConfigurationVariable(options: GetRepositoryPipelineConfigurationVariableRequest): Promise; /** * Update a repository level variable. * Alternative usage: Repository.Pipeline.Configuration.Variable.updateVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-put * @param options Request options. */ updateRepositoryPipelineConfigurationVariable(options: UpdateRepositoryPipelineConfigurationVariableRequest): Promise; /** * Delete a repository level variable. * Alternative usage: Repository.Pipeline.Configuration.Variable.deleteVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-delete * @param options Request options. */ deleteRepositoryPipelineConfigurationVariable(options: DeleteRepositoryPipelineConfigurationVariableRequest): Promise; /** * Returns all pull requests on the specified repository. By default only open pull requests are returned. This can be controlled using the `state` query parameter. To retrieve pull requests that are in one of multiple states, repeat the `state` parameter for each individual state. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Alternative usage: Repository.Pullrequest.getPullrequests * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get * @param options Request options. */ getRepositoryPullrequests(options: GetRepositoryPullrequestsRequest): Promise; /** * Creates a new pull request where the destination repository is this repository and the author is the authenticated user. The minimum required fields to create a pull request are `title` and `source`, specified by a branch name. ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/pullrequests \ -u my-username:my-password \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "title": "My Title", "source": { "branch": { "name": "staging" } } }' ``` If the pull request's `destination` is not specified, it will default to the `repository.mainbranch`. To open a pull request to a different branch, say from a feature branch to a staging branch, specify a `destination` (same format as the `source`): ``` { "title": "My Title", "source": { "branch": { "name": "my-feature-branch" } }, "destination": { "branch": { "name": "staging" } } } ``` Reviewers can be specified by adding an array of user objects as the `reviewers` property. ``` { "title": "My Title", "source": { "branch": { "name": "my-feature-branch" } }, "reviewers": [ { "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}" } ] } ``` Other fields: * `description` - a string * `close_source_branch` - boolean that specifies if the source branch should be closed upon merging * Alternative usage: Repository.Pullrequest.createPullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-post * @param options Request options. */ createRepositoryPullrequest(options: CreateRepositoryPullrequestRequest): Promise; /** * Returns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments, updates, approvals and request changes. The internal endpoint includes those plus tasks and attachments. Comments created on a file or a line of code have an inline property. Comment example: ``` { "pagelen": 20, "values": [ { "comment": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088" } }, "deleted": false, "pullrequest": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" }, "content": { "raw": "inline with to a dn from lines", "markup": "markdown", "html": "

inline with to a dn from lines

", "type": "rendered" }, "created_on": "2019-09-27T00:33:46.039178+00:00", "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "created_on": "2019-09-27T00:33:46.039178+00:00", "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "updated_on": "2019-09-27T00:33:46.055384+00:00", "inline": { "context_lines": "", "to": null, "path": "", "outdated": false, "from": 211 }, "type": "pullrequest_comment", "id": 118571088 }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` Updates include a state property of OPEN, MERGED, or DECLINED. Update example: ``` { "pagelen": 20, "values": [ { "update": { "description": "", "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it", "destination": { "commit": { "type": "commit", "hash": "6a2c16e4a152", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152" } } }, "branch": { "name": "master" }, "repository": { "name": "Atlaskit-MK-2", "type": "repository", "full_name": "atlassian/atlaskit-mk-2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B%7D?ts=js" } }, "uuid": "{}" } }, "reason": "", "source": { "commit": { "type": "commit", "hash": "728c8bad1813", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813" } } }, "branch": { "name": "username/NONE-add-onClick-prop-for-accessibility" }, "repository": { "name": "Atlaskit-MK-2", "type": "repository", "full_name": "atlassian/atlaskit-mk-2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B%7D?ts=js" } }, "uuid": "{}" } }, "state": "OPEN", "author": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "date": "2019-05-10T06:48:25.305565+00:00" }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` Approval example: ``` { "pagelen": 20, "values": [ { "approval": { "date": "2019-09-27T00:37:19.849534+00:00", "pullrequest": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" }, "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" } }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` * Alternative usage: Repository.Pullrequest.getActivityLog * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-activity-get * @param options Request options. */ getRepositoryPullrequestActivityLog(options: GetRepositoryPullrequestActivityLogRequest): Promise; /** * Returns the specified pull request. * Alternative usage: Repository.Pullrequest.getPullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get * @param options Request options. */ getRepositoryPullrequest(options: GetRepositoryPullrequestRequest): Promise; /** * Mutates the specified pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated. * Alternative usage: Repository.Pullrequest.mutatePullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-put * @param options Request options. */ mutateRepositoryPullrequest(options: MutateRepositoryPullrequestRequest): Promise; /** * Approve the specified pull request as the authenticated user. * Alternative usage: Repository.Pullrequest.approvePullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-post * @param options Request options. */ approveRepositoryPullrequest(options: ApproveRepositoryPullrequestRequest): Promise; /** * Declines the pull request. * Alternative usage: Repository.Pullrequest.declinePullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-decline-post * @param options Request options. */ declineRepositoryPullrequest(options: DeclineRepositoryPullrequestRequest): Promise; /** * Merges the pull request. * Alternative usage: Repository.Pullrequest.mergePullrequest * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post * @param options Request options. */ mergeRepositoryPullrequest(options: MergeRepositoryPullrequestRequest): Promise; /** * Returns all statuses (e.g. build results) for the given pull request. * Alternative usage: Repository.Pullrequest.getPullrequestStatuses * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-statuses-get * @param options Request options. */ getRepositoryPullrequestStatuses(options: GetRepositoryPullrequestStatusesRequest): Promise; /** * Returns a paginated list of the pull request's comments. This includes both global, inline comments and replies. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Alternative usage: Repository.Pullrequest.Comment.getComments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-get * @param options Request options. */ getRepositoryPullrequestComments(options: GetRepositoryPullrequestCommentsRequest): Promise; /** * Creates a new pull request comment. Returns the newly created pull request comment. * Alternative usage: Repository.Pullrequest.Comment.createComment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post * @param options Request options. */ createRepositoryPullrequestComment(options: CreateRepositoryPullrequestCommentRequest): Promise; /** * Deletes a specific pull request comment. * Alternative usage: Repository.Pullrequest.Comment.deleteComment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-delete * @param options Request options. */ deleteRepositoryPullrequestComment(options: DeleteRepositoryPullrequestCommentRequest): Promise; /** * Returns a specific pull request comment. * Alternative usage: Repository.Pullrequest.Comment.getComment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-get * @param options Request options. */ getRepositoryPullrequestComment(options: GetRepositoryPullrequestCommentRequest): Promise; /** * Updates a specific pull request comment. * Alternative usage: Repository.Pullrequest.Comment.updateComment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-put * @param options Request options. */ updateRepositoryPullrequestComment(options: UpdateRepositoryPullrequestCommentRequest): Promise; /** * Returns a paginated list of the pull request's commits. These are the commits that are being merged into the destination branch when the pull requests gets accepted. * Alternative usage: Repository.Pullrequest.Commit.getCommits * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-commits-get * @param options Request options. */ getRepositoryPullrequestCommits(options: GetRepositoryPullrequestCommitsRequest): Promise; /** * Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=1 | jq . { "pagelen": 1, "size": 187, "values": [ { "name": "issue-9.3/AUI-5343-assistive-class", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commits/issue-9.3/AUI-5343-assistive-class" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches/issue-9.3/AUI-5343-assistive-class" }, "html": { "href": "https://bitbucket.org/atlassian/aui/branch/issue-9.3/AUI-5343-assistive-class" } }, "default_merge_strategy": "squash", "merge_strategies": [ "merge_commit", "squash", "fast_forward" ], "type": "branch", "target": { "hash": "e5d1cde9069fcb9f0af90403a4de2150c125a148", "repository": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui" }, "html": { "href": "https://bitbucket.org/atlassian/aui" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B585074de-7b60-4fd1-81ed-e0bc7fafbda5%7D?ts=86317" } }, "type": "repository", "name": "aui", "full_name": "atlassian/aui", "uuid": "{585074de-7b60-4fd1-81ed-e0bc7fafbda5}" }, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/patch/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "html": { "href": "https://bitbucket.org/atlassian/aui/commits/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/diff/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/statuses" } }, "author": { "raw": "Marcin Konopka ", "type": "author", "user": { "display_name": "Marcin Konopka", "uuid": "{47cc24f4-2a05-4420-88fe-0417535a110a}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B47cc24f4-2a05-4420-88fe-0417535a110a%7D" }, "html": { "href": "https://bitbucket.org/%7B47cc24f4-2a05-4420-88fe-0417535a110a%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MK-1.png" } }, "nickname": "Marcin Konopka", "type": "user", "account_id": "60113d2b47a9540069f4de03" } }, "parents": [ { "hash": "87f7fc92b00464ae47b13ef65c91884e4ac9be51", "type": "commit", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/87f7fc92b00464ae47b13ef65c91884e4ac9be51" }, "html": { "href": "https://bitbucket.org/atlassian/aui/commits/87f7fc92b00464ae47b13ef65c91884e4ac9be51" } } } ], "date": "2021-04-13T13:44:49+00:00", "message": "wip ", "type": "commit" } } ], "page": 1, "next": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=1&page=2" } ``` Branches support [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) that can be used to search for specific branches. For instance, to find all branches that have "stab" in their name: ``` curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches -G --data-urlencode 'q=name ~ "stab"' ``` By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git branch --list". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted ["v10", "v11", "v9"] instead of ["v9", "v10", "v11"]. Sorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Alternative usage: Repository.Branch.getOpenBranches * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-get * @param options Request options. */ getRepositoryOpenBranches(options: GetRepositoryOpenBranchesRequest): Promise; /** * Creates a new branch in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \ -s -u seanfarley -X POST -H "Content-Type: application/json" \ -d '{ "name" : "smf/create-feature", "target" : { "hash" : "default", } }' ``` This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. The branch name should not include any prefixes (e.g. refs/heads). This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-post * @param options Request options. */ createRepositoryBranch(options: CreateRepositoryBranchRequest): Promise; /** * Returns a branch object within the specified repository. This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. For Git, the branch name should not include any prefixes (e.g. refs/heads). * Alternative usage: Repository.Branch.getBranch * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-get * @param options Request options. */ getRepositoryBranch(options: GetRepositoryBranchRequest): Promise; /** * Delete a branch in the specified repository. The main branch is not allowed to be deleted and will return a 400 response. The branch name should not include any prefixes (e.g. refs/heads). * Alternative usage: Repository.Branch.deleteBranch * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-delete * @param options Request options. */ deleteRepositoryBranch(options: DeleteRepositoryBranchRequest): Promise; /** * Returns a paginated list of all branch restrictions on the repository. * Alternative usage: Repository.Branch.Restriction.getRestrictions * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-group-branch-restrictions * @param options Request options. */ getRepositoryBranchRestrictions(options: GetRepositoryBranchRestrictionsRequest): Promise; /** * Creates a new branch restriction rule for a repository. `kind` describes what will be restricted. Allowed values include: `push`, `force`, `delete`, `restrict_merges`, `require_tasks_to_be_completed`, `require_approvals_to_merge`, `require_default_reviewer_approvals_to_merge`, `require_no_changes_requested`, `require_passing_builds_to_merge`, `require_commits_behind`, `reset_pullrequest_approvals_on_change`, `smart_reset_pullrequest_approvals`, `reset_pullrequest_changes_requested_on_change`, `require_all_dependencies_merged`, `enforce_merge_checks`, and `allow_auto_merge_when_builds_pass`. Different kinds of branch restrictions have different requirements: * `push` and `restrict_merges` require `users` and `groups` to be specified. Empty lists are allowed, in which case permission is denied for everybody. The restriction applies to all branches that match. There are two ways to match a branch. It is configured in `branch_match_kind`: 1. `glob`: Matches a branch against the `pattern`. A `'*'` in `pattern` will expand to match zero or more characters, and every other character matches itself. For example, `'foo*'` will match `'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all branches. 2. `branching_model`: Matches a branch against the repository's branching model. The `branch_type` controls the type of branch to match. Allowed values include: `production`, `development`, `bugfix`, `release`, `feature` and `hotfix`. The combination of `kind` and match must be unique. This means that two `glob` restrictions in a repository cannot have the same `kind` and `pattern`. Additionally, two `branching_model` restrictions in a repository cannot have the same `kind` and `branch_type`. `users` and `groups` are lists of users and groups that are except from the restriction. They can only be configured in `push` and `restrict_merges` restrictions. The `push` restriction stops a user pushing to matching branches unless that user is in `users` or is a member of a group in `groups`. The `restrict_merges` stops a user merging pull requests to matching branches unless that user is in `users` or is a member of a group in `groups`. Adding new users or groups to an existing restriction should be done via `PUT`. Note that branch restrictions with overlapping matchers is allowed, but the resulting behavior may be surprising. * Alternative usage: Repository.Branch.Restriction.createRestriction * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-post * @param options Request options. */ createRepositoryBranchRestriction(options: CreateRepositoryBranchRestrictionRequest): Promise; /** * Returns a specific branch restriction rule. * Alternative usage: Repository.Branch.Restriction.getRestriction * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-get * @param options Request options. */ getRepositoryBranchRestriction(options: GetRepositoryBranchRestrictionRequest): Promise; /** * Updates an existing branch restriction rule. Fields not present in the request body are ignored. See [`POST`](/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-post) for details. * Alternative usage: Repository.Branch.Restriction.updateRestriction * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-put * @param options Request options. */ updateRepositoryBranchRestriction(options: UpdateRepositoryBranchRestrictionRequest): Promise; /** * Deletes an existing branch restriction rule. * Alternative usage: Repository.Branch.Restriction.deleteRestriction * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-delete * @param options Request options. */ deleteRepositoryBranchRestriction(options: DeleteRepositoryBranchRestrictionRequest): Promise; /** * Returns the specified commit. * Alternative usage: Repository.Commit.getCommit * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-get * @param options Request options. */ getRepositoryCommit(options: GetRepositoryCommitRequest): Promise; /** * Returns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order. This is roughly equivalent to the following commands: $ git log --follow --date-order By default, Bitbucket will follow renames and the path name in the returned entries reflects that. This can be turned off using the `?renames=false` query parameter. Results are returned in descending chronological order by default, and like most endpoints you can [filter and sort](/cloud/bitbucket/rest/intro/#filtering) the response to only provide exactly the data you want. For example, if you wanted to find commits made before 2011-05-18 against a file named `README.rst`, but you only wanted the path and date, your query would look like this: ``` $ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\ '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18' { "values": [ { "commit": { "date": "2011-05-17T07:32:09+00:00" }, "path": "README.rst" }, { "commit": { "date": "2011-05-16T06:33:28+00:00" }, "path": "README.txt" }, { "commit": { "date": "2011-05-16T06:15:39+00:00" }, "path": "README.txt" } ] } ``` In the response you can see that the file was renamed to `README.rst` by the commit made on 2011-05-16, and was previously named `README.txt`. * Alternative usage: Repository.Commit.getCommitsByFile * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-filehistory-commit-path-get * @param options Request options. */ getRepositoryCommitsByFile(options: GetRepositoryCommitsByFileRequest): Promise; /** * Identical to `GET /repositories/{workspace}/{repo_slug}/commits`, except that POST allows clients to place the include and exclude parameters in the request body to avoid URL length issues. **Note that this resource does NOT support new commit creation.** * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commits-post * @param options Request options. */ getRepositoryCommits(options: GetRepositoryCommitsRequest): Promise; /** * Approve the specified commit as the authenticated user. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits. * Alternative usage: Repository.Commit.Approval.approveCommit * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-approve-post * @param options Request options. */ approveRepositoryCommit(options: ApproveRepositoryCommitRequest): Promise; /** * Redact the authenticated user's approval of the specified commit. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits. * Alternative usage: Repository.Commit.Approval.redactApproval * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-approve-delete * @param options Request options. */ redactRepositoryCommitApproval(options: RedactRepositoryCommitApprovalRequest): Promise; /** * Returns the commit's comments. This includes both global and inline comments. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. * Alternative usage: Repository.Commit.Comment.getComments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-get * @param options Request options. */ getRepositoryCommitComments(options: GetRepositoryCommitCommentsRequest): Promise; /** * Returns the specified commit comment. * Alternative usage: Repository.Commit.Comment.getComment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-comment-id-get * @param options Request options. */ getRepositoryCommitComment(options: GetRepositoryCommitCommentRequest): Promise; /** * Returns all statuses (e.g. build results) for a specific commit. * Alternative usage: Repository.Commit.Status.getStatuses * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-get * @param options Request options. */ getRepositoryCommitStatuses(options: GetRepositoryCommitStatusesRequest): Promise; /** * Creates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. Example: ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result" }' ``` When creating a new commit status, you can use a URI template for the URL. Templates are URLs that contain variable names that Bitbucket will evaluate at runtime whenever the URL is displayed anywhere similar to parameter substitution in [Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html). For example, one could use `https://foo.com/builds/{repository.full_name}` which Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time. The context variables available are `repository` and `commit`. To associate a commit status to a pull request, the refname field must be set to the source branch of the pull request. Example: ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result", "refname": "my-pr-branch" }' ``` * Alternative usage: Repository.Commit.Status.createStatus * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-build-post * @param options Request options. */ createRepositoryCommitStatus(options: CreateRepositoryCommitStatusRequest): Promise; /** * Returns the specified build status for a commit. * Alternative usage: Repository.Commit.Status.getStatus * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-build-key-get * @param options Request options. */ getRepositoryCommitStatus(options: GetRepositoryCommitStatusRequest): Promise; /** * Returns the repository's default reviewers. These are the users that are automatically added as reviewers on every new pull request that is created. To obtain the repository's default reviewers as well as the default reviewers inherited from the project, use the [effective-default-reveiwers](#api-repositories-workspace-repo-slug-effective-default-reviewers-get) endpoint. * Alternative usage: Repository.Reviewer.Default.getReviewers * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-get * @param options Request options. */ getRepositoryDefaultReviewers(options: GetRepositoryDefaultReviewersRequest): Promise; /** * Returns the specified reviewer. This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified user is not a default reviewer. * Alternative usage: Repository.Reviewer.Default.getReviewer * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-get * @param options Request options. */ getRepositoryDefaultReviewer(options: GetRepositoryDefaultReviewerRequest): Promise; /** * Adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect. * Alternative usage: Repository.Reviewer.Default.addReviewer * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-put * @param options Request options. */ addRepositoryDefaultReviewer(options: AddRepositoryDefaultReviewerRequest): Promise; /** * Removes a default reviewer from the repository. * Alternative usage: Repository.Reviewer.Default.removeReviewer * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-delete * @param options Request options. */ removeRepositoryDefaultReviewer(options: RemoveRepositoryDefaultReviewerRequest): Promise; /** * Returns the tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git tag --list". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted ["v10", "v11", "v9"] instead of ["v9", "v10", "v11"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Alternative usage: Repository.Tag.getTags * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-get * @param options Request options. */ getRepositoryTags(options: GetRepositoryTagsRequest): Promise; /** * Creates a new tag in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \ -s -u jdoe -X POST -H "Content-Type: application/json" \ -d '{ "name" : "new-tag-name", "target" : { "hash" : "a1b2c3d4e5f6", } }' ``` This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach. * Alternative usage: Repository.Tag.createTag * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-post * @param options Request options. */ createRepositoryTag(options: CreateRepositoryTagRequest): Promise; /** * Returns the specified tag. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq . { "name": "3.8", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/tag/3.8" } }, "tagger": { "raw": "Matt Mackall ", "type": "author", "user": { "username": "mpmselenic", "nickname": "mpmselenic", "display_name": "Matt Mackall", "type": "user", "uuid": "{a4934530-db4c-419c-a478-9ab4964c2ee7}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/mpmselenic" }, "html": { "href": "https://bitbucket.org/mpmselenic/" }, "avatar": { "href": "https://bitbucket.org/account/mpmselenic/avatar/32/" } } } }, "date": "2016-05-01T18:52:25+00:00", "message": "Added tag 3.8 for changeset f85de28eae32", "type": "tag", "target": { "hash": "f85de28eae32e7d3064b1a1321309071bbaaa069", "repository": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg" }, "html": { "href": "https://bitbucket.org/seanfarley/hg" }, "avatar": { "href": "https://bitbucket.org/seanfarley/hg/avatar/32/" } }, "type": "repository", "name": "hg", "full_name": "seanfarley/hg", "uuid": "{c75687fb-e99d-4579-9087-190dbd406d30}" }, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses" } }, "author": { "raw": "Sean Farley ", "type": "author", "user": { "username": "seanfarley", "nickname": "seanfarley", "display_name": "Sean Farley", "type": "user", "uuid": "{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/seanfarley" }, "html": { "href": "https://bitbucket.org/seanfarley/" }, "avatar": { "href": "https://bitbucket.org/account/seanfarley/avatar/32/" } } } }, "parents": [ { "hash": "9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2", "type": "commit", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2" } } } ], "date": "2016-05-01T04:21:17+00:00", "message": "debian: alphabetize build deps", "type": "commit" } } ``` * Alternative usage: Repository.Tag.getTag * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-name-get * @param options Request options. */ getRepositoryTag(options: GetRepositoryTagRequest): Promise; /** * Delete a tag in the specified repository. The tag name should not include any prefixes (e.g. refs/tags). * Alternative usage: Repository.Tag.deleteTag * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-name-delete * @param options Request options. */ deleteRepositoryTag(options: DeleteRepositoryTagRequest): Promise; /** * Find environments * Alternative usage: Repository.Environment.getEnvironments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-get * @param options Request options. */ getRepositoryEnvironments(options: GetRepositoryEnvironmentsRequest): Promise; /** * Create an environment. * Alternative usage: Repository.Environment.createEnvironment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-post * @param options Request options. */ createRepositoryEnvironment(options: CreateRepositoryEnvironmentRequest): Promise; /** * Retrieve an environment * Alternative usage: Repository.Environment.getEnvironment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-environment-uuid-get * @param options Request options. */ getRepositoryEnvironment(options: GetRepositoryEnvironmentRequest): Promise; /** * Delete an environment * Alternative usage: Repository.Environment.deleteEnvironment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-environment-uuid-delete * @param options Request options. */ deleteRepositoryEnvironment(options: DeleteRepositoryEnvironmentRequest): Promise; /** * Find deployment environment level variables. * Alternative usage: Repository.Environment.Variable.getVariables * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-get * @param options Request options. */ getRepositoryEnvironmentVariables(options: GetRepositoryEnvironmentVariablesRequest): Promise; /** * Create a deployment environment level variable. * Alternative usage: Repository.Environment.Variable.createVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-post * @param options Request options. */ createRepositoryEnvironmentVariable(options: CreateRepositoryEnvironmentVariableRequest): Promise; /** * Update a deployment environment level variable. * Alternative usage: Repository.Environment.Variable.updateVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-variable-uuid-put * @param options Request options. */ updateRepositoryEnvironmentVariable(options: UpdateRepositoryEnvironmentVariableRequest): Promise; /** * Delete a deployment environment level variable. * Alternative usage: Repository.Environment.Variable.deleteVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-variable-uuid-delete * @param options Request options. */ deleteRepositoryEnvironmentVariable(options: DeleteRepositoryEnvironmentVariableRequest): Promise; /** * Returns a paginated list of all the forks of the specified repository. * Alternative usage: Repository.Fork.getForks * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-forks-get * @param options Request options. */ getRepositoryForks(options: GetRepositoryForksRequest): Promise; /** * Creates a new fork of the specified repository. #### Forking a repository To create a fork, specify the workspace explicitly as part of the request body: ``` $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \ -H 'Content-Type: application/json' -d '{ "name": "bbql_fork", "workspace": { "slug": "atlassian" } }' ``` To fork a repository into the same workspace, also specify a new `name`. When you specify a value for `name`, it will also affect the `slug`. The `slug` is reflected in the repository URL of the new fork. It is derived from `name` by substituting non-ASCII characters, removes whitespace, and changes characters to lower case. For example, `My repo` would turn into `my_repo`. You need contributor access to create new forks within a workspace. #### Change the properties of a new fork By default the fork inherits most of its properties from the parent. However, since the optional POST body document follows the normal `repository` JSON schema and you can override the new fork's properties. Properties that can be overridden include: * description * fork_policy * language * mainbranch * is_private (note that a private repo's fork_policy might prohibit the creation of public forks, in which `is_private=False` would fail) * has_issues (to initialize or disable the new repo's issue tracker -- note that the actual contents of the parent repository's issue tracker are not copied during forking) * has_wiki (to initialize or disable the new repo's wiki -- note that the actual contents of the parent repository's wiki are not copied during forking) * project (when forking into a private project, the fork's `is_private` must be `true`) Properties that cannot be modified include: * scm * parent * full_name * Alternative usage: Repository.Fork.createFork * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-forks-post * @param options Request options. */ createRepositoryFork(options: CreateRepositoryForkRequest): Promise; /** * Find deployments * Alternative usage: Repository.Deployment.getDeployments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deployments-get * @param options Request options. */ getRepositoryDeployments(options: GetRepositoryDeploymentsRequest): Promise; /** * Retrieve a deployment * Alternative usage: Repository.Deployment.getDeployment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deployments-deployment-uuid-get * @param options Request options. */ getRepositoryDeployment(options: GetRepositoryDeploymentRequest): Promise; /** * Returns the currently logged in user. * Alternative usage: User.getCurrentUser * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user * @param options Request options. */ getCurrentUser(options?: GetCurrentUserRequest): Promise; /** * Returns all the authenticated user's email addresses. Both confirmed and unconfirmed. * Alternative usage: User.getCurrentUserEmails * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/emails * @param options Request options. */ getCurrentUserEmails(options?: GetCurrentUserEmailsRequest): Promise; /** * Gets the public information associated with a user account. If the user's profile is private, `location`, `website` and `created_on` elements are omitted. Note that the user object returned by this operation is changing significantly, due to privacy changes. See the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-bitbucket-user-objects) for details. * Alternative usage: User.getUser * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get * @param options Request options. */ getUser(options: GetUserRequest): Promise; /** * Returns details about a specific one of the authenticated user's email addresses. Details describe whether the address has been confirmed by the user and whether it is the user's primary address or not. * Alternative usage: User.getCurrentUserEmail * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-emails-email-get * @param options Request options. */ getCurrentUserEmail(options: GetCurrentUserEmailRequest): Promise; /** * Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between explicit and implicit privileges. Permissions can be: * `admin` * `write` * `read` Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by repository or permission by adding the following query string parameters: * `q=repository.name="geordi"` or `q=permission>"read"` * `sort=repository.name` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. * Alternative usage: User.Permission.getCurrentUserRepositoryPermissions * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-user-permissions-repositories-get * @param options Request options. */ getCurrentUserRepositoryPermissions(options?: GetCurrentUserRepositoryPermissionsRequest): Promise; /** * Returns an object for each workspace the caller is a member of, and their effective role - the highest level of privilege the caller has. If a user is a member of multiple groups with distinct roles, only the highest level is returned. Permissions can be: * `owner` * `collaborator` * `member` **The `collaborator` role is being removed from the Bitbucket Cloud API. For more information, see the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).** **When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on `workspace_membership` will no longer be present: `last_accessed` and `added_on`. See the [deprecation announcement](/cloud/bitbucket/announcement-breaking-change-workspace-membership/).** Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by workspace or permission by adding the following query string parameters: * `q=workspace.slug="bbworkspace1"` or `q=permission="owner"` * `sort=workspace.slug` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. * Alternative usage: User.Permission.getCurrentUserWorkspaceMemberships * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-user-permissions-workspaces-get * @param options Request options. */ getCurrentUserWorkspaceMemberships(options?: GetCurrentUserWorkspaceMembershipsRequest): Promise; /** * Returns a paginated list of the user's SSH public keys. * Alternative usage: User.SSH.getKeys * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-get * @param options Request options. */ getUserSshKeys(options: GetUserSSHKeysRequest): Promise; /** * Adds a new SSH public key to the specified user account and returns the resulting key. Example: ``` $ curl -X POST -H "Content-Type: application/json" -d '{"key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys ``` * Alternative usage: User.SSH.addKey * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-post * @param options Request options. */ addUserSshKey(options: AddUserSSHKeyRequest): Promise; /** * Returns a specific SSH public key belonging to a user. * Alternative usage: User.SSH.getKey * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-get * @param options Request options. */ getUserSshKey(options: GetUserSSHKeyRequest): Promise; /** * Updates a specific SSH public key on a user's account Note: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again. Example: ``` $ curl -X PUT -H "Content-Type: application/json" -d '{"label": "Work key"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a} ``` * Alternative usage: User.SSH.updateKey * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-put * @param options Request options. */ updateUserSshKey(options: UpdateUserSSHKeyRequest): Promise; /** * Deletes a specific SSH public key from a user's account. * Alternative usage: User.SSH.deleteKey * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-delete * @param options Request options. */ deleteUserSshKey(options: DeleteUserSSHKeyRequest): Promise; /** * Returns a list of workspaces accessible by the authenticated user. Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by workspace or permission by adding the following query string parameters: * `q=slug="bbworkspace1"` or `q=is_private=true` * `sort=created_on` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. **The `collaborator` role is being removed from the Bitbucket Cloud API. For more information, see the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).** * Alternative usage: Workspace.getWorkspaces * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces * @param options Request options. */ getWorkspaces(options?: GetWorkspacesRequest): Promise; /** * Returns the requested workspace. * Alternative usage: Workspace.getWorkspace * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-get * @param options Request options. */ getWorkspace(options: GetWorkspaceRequest): Promise; /** * Returns the list of projects in this workspace. * Alternative usage: Workspace.Project.getProjects * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-projects-get * @param options Request options. */ getWorkspaceProjects(options: GetWorkspaceProjectsRequest): Promise; /** * Creates a new project. Note that the avatar has to be embedded as either a data-url or a URL to an external image as shown in the examples below: ``` $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/..." } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document } ``` or even: ``` $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "http://i.imgur.com/72tRx4w.gif" } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document } ``` * Alternative usage: Workspace.Project.createProject * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-post * @param options Request options. */ createWorkspaceProject(options: CreateWorkspaceProjectRequest): Promise; /** * Deletes this project. This is an irreversible operation. You cannot delete a project that still contains repositories. To delete the project, [delete](/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-delete) or transfer the repositories first. Example: ``` $ curl -X DELETE https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects/PROJ ``` * Alternative usage: Workspace.Project.deleteProject * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-project-key-delete * @param options Request options. */ deleteWorkspaceProject(options: DeleteWorkspaceProjectRequest): Promise; /** * Returns the requested project. * Alternative usage: Workspace.Project.getProject * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-project-key-get * @param options Request options. */ getWorkspaceProject(options: GetWorkspaceProjectRequest): Promise; /** * Search for code in the repositories of the specified workspace. Note that searches can match in the file's text (`content_matches`), the path (`path_matches`), or both. You can use the same syntax for the search query as in the UI. E.g. to search for "foo" only within the repository "demo", use the query parameter `search_query=foo+repo:demo`. Similar to other APIs, you can request more fields using a `fields` query parameter. E.g. to get some more information about the repository of matched files, use the query parameter `search_query=foo&fields=%2Bvalues.file.commit.repository` (the `%2B` is a URL-encoded `+`). Try `fields=%2Bvalues.*.*.*.*` to get an idea what's possible. * Alternative usage: Workspace.Project.Search.searchCodeInProjects * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-other-operations/#api-workspaces-workspace-search-code-get * @param options Request options. */ searchCodeInWorkspaceProjects(options: SearchCodeInWorkspaceProjectsRequest): Promise; /** * Find workspace level variables. * Alternative usage: Workspace.Variable.getVariables * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-get * @param options Request options. */ getWorkspaceVariables(options: GetWorkspaceVariablesRequest): Promise; /** * Create a workspace level variable. * Alternative usage: Workspace.Variable.createVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-post * @param options Request options. */ createWorkspaceVariable(options: CreateWorkspaceVariableRequest): Promise; /** * Retrieve a workspace level variable. * Alternative usage: Workspace.Variable.getVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-get * @param options Request options. */ getWorkspaceVariable(options: GetWorkspaceVariableRequest): Promise; /** * Update a workspace level variable. * Alternative usage: Workspace.Variable.updateVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-put * @param options Request options. */ updateWorkspaceVariable(options: UpdateWorkspaceVariableRequest): Promise; /** * Delete a workspace level variable. * Alternative usage: Workspace.Variable.deleteVariable * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-delete * @param options Request options. */ deleteWorkspaceVariable(options: DeleteWorkspaceVariableRequest): Promise; } declare class RepositoryGroup { private implementation; private getGlobalErrorStrategy; Pipeline: RepositoryPipelineGroup; Pullrequest: RepositoryPullrequestGroup; Branch: RepositoryBranchGroup; Commit: RepositoryCommitGroup; Reviewer: RepositoryReviewerGroup; Tag: RepositoryTagGroup; Environment: RepositoryEnvironmentGroup; Fork: RepositoryForkGroup; Deployment: RepositoryDeploymentGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of all public repositories. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-get * @param options Request options. */ getRepositories(options?: GetRepositoriesRequest): Promise; /** * Returns a paginated list of all repositories owned by the specified workspace. The result can be narrowed down based on the authenticated user's role. E.g. with `?role=contributor`, only those repositories that the authenticated user has write access to are returned (this includes any repo the user is an admin on, as that implies write access). This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-get * @param options Request options. */ getRepositoriesByWorkspace(options: GetRepositoriesByWorkspaceRequest): Promise; /** * Returns the object describing this repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-get * @param options Request options. */ getRepository(options: GetRepositoryRequest): Promise; /** * Since this endpoint can be used to both update and to create a repository, the request body depends on the intent. #### Creation See the POST documentation for the repository endpoint for an example of the request body. #### Update Note: Changing the `name` of the repository will cause the location to be changed. This is because the URL of the repo is derived from the name (a process called slugification). In such a scenario, it is possible for the request to fail if the newly created slug conflicts with an existing repository's slug. But if there is no conflict, the new location will be returned in the `Location` header of the response. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-put * @param options Request options. */ updateRepository(options: UpdateRepositoryRequest): Promise; /** * Creates a new repository. Note: In order to set the project for the newly created repository, pass in either the project key or the project UUID as part of the request body as shown in the examples below: ``` $ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "MARS" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` or ``` $ curl -X POST -H "Content-Type: application/json" -d '{ "scm": "git", "project": { "key": "{ba516952-992a-4c2d-acbd-17d502922f96}" } }' https://api.bitbucket.org/2.0/repositories/teamsinspace/hablanding ``` The project must be assigned for all repositories. If the project is not provided, the repository is automatically assigned to the oldest project in the workspace. Note: In the examples above, the workspace ID `teamsinspace`, and/or the repository name `hablanding` can be replaced by UUIDs. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-post * @param options Request options. */ createRepository(options: CreateRepositoryRequest): Promise; /** * Deletes the repository. This is an irreversible operation. This does not affect its forks. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-delete * @param options Request options. */ deleteRepository(options: DeleteRepositoryRequest): Promise; /** * Returns the branches and tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git show-ref". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that refs are sorted ["branch1", "branch10", "branch2", "v10", "v11", "v9"] instead of ["branch1", "branch2", "branch10", "v9", "v10", "v11"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-get * @param options Request options. */ getBranchesAndTags(options: GetRepositoryBranchesAndTagsRequest): Promise; } declare class RepositoryPipelineGroup { private implementation; private getGlobalErrorStrategy; Step: RepositoryPipelineStepGroup; Configuration: RepositoryPipelineConfigurationGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Endpoint to create and initiate a pipeline. There are a couple of different options to initiate a pipeline, where the payload of the request will determine which type of pipeline will be instantiated. # Trigger a Pipeline for a branch One way to trigger pipelines is by specifying the branch for which you want to trigger a pipeline. The specified branch will be used to determine which pipeline definition from the `bitbucket-pipelines.yml` file will be applied to initiate the pipeline. The pipeline will then do a clone of the repository and checkout the latest revision of the specified branch. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }' ``` # Trigger a Pipeline for a commit on a branch or tag You can initiate a pipeline for a specific commit and in the context of a specified reference (e.g. a branch, tag or bookmark). The specified reference will be used to determine which pipeline definition from the bitbucket-pipelines.yml file will be applied to initiate the pipeline. The pipeline will clone the repository and then do a checkout the specified reference. The following reference types are supported: * `branch` * `named_branch` * `bookmark` * `tag` ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "type": "commit", "hash": "ce5b7431602f7cbba007062eeb55225c6e18e956" }, "ref_type": "branch", "type": "pipeline_ref_target", "ref_name": "master" } }' ``` # Trigger a specific pipeline definition for a commit You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition. The resulting pipeline will then clone the repository and checkout the specified revision. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type":"custom", "pattern":"Deploy to production" }, "type":"pipeline_commit_target" } }' ``` # Trigger a specific pipeline definition for a commit on a branch or tag You can trigger a specific pipeline that is defined in your `bitbucket-pipelines.yml` file for a specific commit in the context of a specified reference. In addition to the commit revision, you specify the type and pattern of the selector that identifies the pipeline definition, as well as the reference information. The resulting pipeline will then clone the repository a checkout the specified reference. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/jeroendr/meat-demo2/pipelines/ \ -d ' { "target": { "commit": { "hash":"a3c4e02c9a3755eccdc3764e6ea13facdf30f923", "type":"commit" }, "selector": { "type": "custom", "pattern": "Deploy to production" }, "type": "pipeline_ref_target", "ref_name": "master", "ref_type": "branch" } }' ``` # Trigger a custom pipeline with variables In addition to triggering a custom pipeline that is defined in your `bitbucket-pipelines.yml` file as shown in the examples above, you can specify variables that will be available for your build. In the request, provide a list of variables, specifying the following for each variable: key, value, and whether it should be secured or not (this field is optional and defaults to not secured). ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_ref_target", "ref_type": "branch", "ref_name": "master", "selector": { "type": "custom", "pattern": "Deploy to production" } }, "variables": [ { "key": "var1key", "value": "var1value", "secured": true }, { "key": "var2key", "value": "var2value" } ] }' ``` # Trigger a pull request pipeline You can also initiate a pipeline for a specific pull request. ### Example ``` $ curl -X POST -is -u username:password \ -H 'Content-Type: application/json' \ https://api.bitbucket.org/2.0/repositories/{workspace}/{repo_slug}/pipelines/ \ -d ' { "target": { "type": "pipeline_pullrequest_target", "source": "pull-request-branch", "destination": "master", "destination_commit": { "hash": "9f848b7" }, "commit": { "hash": "1a372fc" }, "pullrequest": { "id": "3" }, "selector": { "type": "pull-requests", "pattern": "**" } } }' ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-post * @param options Request options. */ createAndInitiatePipeline(options: CreateAndInitiateRepositoryPipelineRequest): Promise; /** * Find pipelines in a repository. Note that unlike other endpoints in the Bitbucket API, this endpoint utilizes query parameters to allow filtering and sorting of returned results. See [query parameters](#api-repositories-workspace-repo-slug-pipelines-get-request-Query%20parameters) for specific details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-get * @param options Request options. */ findPipelines(options: FindRepositoryPipelinesRequest): Promise; /** * Retrieve a specified pipeline * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-get * @param options Request options. */ retrievePipeline(options: RetrieveRepositoryPipelineRequest): Promise; /** * Signal the stop of a pipeline and all of its steps that not have completed yet. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-stoppipeline-post * @param options Request options. */ stopPipeline(options: StopRepositoryPipelineRequest): Promise; } declare class RepositoryPipelineStepGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find steps for the given pipeline. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-steps-get * @param options Request options. */ findSteps(options: FindRepositoryStepsForPipelineRequest): Promise; /** * Retrieve a given step of a pipeline. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-pipeline-uuid-steps-step-uuid-get * @param options Request options. */ retrieveStep(options: RetrieveRepositoryStepForPipelineRequest): Promise; } declare class RepositoryPipelineConfigurationGroup { private implementation; private getGlobalErrorStrategy; Build: RepositoryPipelineConfigurationBuildGroup; Schedule: RepositoryPipelineConfigurationScheduleGroup; Variable: RepositoryPipelineConfigurationVariableGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Update the pipelines configuration for a repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-put * @param options Request options. */ updateConfiguration(options: UpdateRepositoryPipelineConfigurationRequest): Promise; /** * Retrieve the repository pipelines configuration. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-get * @param options Request options. */ retrieveConfiguration(options: RetrieveRepositoryPipelineConfigurationRequest): Promise; } declare class RepositoryPipelineConfigurationBuildGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Update the next build number that should be assigned to a pipeline. The next build number that will be configured has to be strictly higher than the current latest build number for this repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-build-number-put * @param options Request options. */ updateBuildNumber(options: UpdateRepositoryPipelineConfigurationBuildNumberRequest): Promise; } declare class RepositoryPipelineConfigurationScheduleGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Create a schedule for the given repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-post * @param options Request options. */ createSchedule(options: CreateRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Retrieve the configured schedules for the given repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-get * @param options Request options. */ retrieveSchedules(options: RetrieveRepositoryPipelineConfigurationSchedulesRequest): Promise; /** * Update a schedule. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-put * @param options Request options. */ updateSchedule(options: UpdateRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Retrieve a schedule by its UUID. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-get * @param options Request options. */ retrieveSchedule(options: RetrieveRepositoryPipelineConfigurationScheduleRequest): Promise; /** * Delete a schedule. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-schedules-schedule-uuid-delete * @param options Request options. */ deleteSchedule(options: DeleteRepositoryPipelineConfigurationScheduleRequest): Promise; } declare class RepositoryPipelineConfigurationVariableGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find repository level variables. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-get * @param options Request options. */ getVariables(options: GetRepositoryPipelineConfigurationVariablesRequest): Promise; /** * Create a repository level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-post * @param options Request options. */ createVariable(options: CreateRepositoryPipelineConfigurationVariableRequest): Promise; /** * Retrieve a repository level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-get * @param options Request options. */ getVariable(options: GetRepositoryPipelineConfigurationVariableRequest): Promise; /** * Update a repository level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-put * @param options Request options. */ updateVariable(options: UpdateRepositoryPipelineConfigurationVariableRequest): Promise; /** * Delete a repository level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-pipelines-config-variables-variable-uuid-delete * @param options Request options. */ deleteVariable(options: DeleteRepositoryPipelineConfigurationVariableRequest): Promise; } declare class RepositoryPullrequestGroup { private implementation; private getGlobalErrorStrategy; Comment: RepositoryPullrequestCommentGroup; Commit: RepositoryPullrequestCommitGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns all pull requests on the specified repository. By default only open pull requests are returned. This can be controlled using the `state` query parameter. To retrieve pull requests that are in one of multiple states, repeat the `state` parameter for each individual state. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-get * @param options Request options. */ getPullrequests(options: GetRepositoryPullrequestsRequest): Promise; /** * Creates a new pull request where the destination repository is this repository and the author is the authenticated user. The minimum required fields to create a pull request are `title` and `source`, specified by a branch name. ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repository/pullrequests \ -u my-username:my-password \ --request POST \ --header 'Content-Type: application/json' \ --data '{ "title": "My Title", "source": { "branch": { "name": "staging" } } }' ``` If the pull request's `destination` is not specified, it will default to the `repository.mainbranch`. To open a pull request to a different branch, say from a feature branch to a staging branch, specify a `destination` (same format as the `source`): ``` { "title": "My Title", "source": { "branch": { "name": "my-feature-branch" } }, "destination": { "branch": { "name": "staging" } } } ``` Reviewers can be specified by adding an array of user objects as the `reviewers` property. ``` { "title": "My Title", "source": { "branch": { "name": "my-feature-branch" } }, "reviewers": [ { "uuid": "{504c3b62-8120-4f0c-a7bc-87800b9d6f70}" } ] } ``` Other fields: * `description` - a string * `close_source_branch` - boolean that specifies if the source branch should be closed upon merging * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-post * @param options Request options. */ createPullrequest(options: CreateRepositoryPullrequestRequest): Promise; /** * Returns a paginated list of the pull request's activity log. This handler serves both a v20 and internal endpoint. The v20 endpoint returns reviewer comments, updates, approvals and request changes. The internal endpoint includes those plus tasks and attachments. Comments created on a file or a line of code have an inline property. Comment example: ``` { "pagelen": 20, "values": [ { "comment": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695/comments/118571088" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695/_/diff#comment-118571088" } }, "deleted": false, "pullrequest": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" }, "content": { "raw": "inline with to a dn from lines", "markup": "markdown", "html": "

inline with to a dn from lines

", "type": "rendered" }, "created_on": "2019-09-27T00:33:46.039178+00:00", "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "created_on": "2019-09-27T00:33:46.039178+00:00", "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "updated_on": "2019-09-27T00:33:46.055384+00:00", "inline": { "context_lines": "", "to": null, "path": "", "outdated": false, "from": 211 }, "type": "pullrequest_comment", "id": 118571088 }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` Updates include a state property of OPEN, MERGED, or DECLINED. Update example: ``` { "pagelen": 20, "values": [ { "update": { "description": "", "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it", "destination": { "commit": { "type": "commit", "hash": "6a2c16e4a152", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/6a2c16e4a152" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/6a2c16e4a152" } } }, "branch": { "name": "master" }, "repository": { "name": "Atlaskit-MK-2", "type": "repository", "full_name": "atlassian/atlaskit-mk-2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B%7D?ts=js" } }, "uuid": "{}" } }, "reason": "", "source": { "commit": { "type": "commit", "hash": "728c8bad1813", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/commit/728c8bad1813" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/commits/728c8bad1813" } } }, "branch": { "name": "username/NONE-add-onClick-prop-for-accessibility" }, "repository": { "name": "Atlaskit-MK-2", "type": "repository", "full_name": "atlassian/atlaskit-mk-2", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B%7D?ts=js" } }, "uuid": "{}" } }, "state": "OPEN", "author": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" }, "date": "2019-05-10T06:48:25.305565+00:00" }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` Approval example: ``` { "pagelen": 20, "values": [ { "approval": { "date": "2019-09-27T00:37:19.849534+00:00", "pullrequest": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" }, "user": { "display_name": "Name Lastname", "uuid": "{}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B%7D" }, "html": { "href": "https://bitbucket.org/%7B%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/:/128" } }, "type": "user", "nickname": "Name", "account_id": "" } }, "pull_request": { "type": "pullrequest", "id": 5695, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/atlaskit-mk-2/pullrequests/5695" }, "html": { "href": "https://bitbucket.org/atlassian/atlaskit-mk-2/pull-requests/5695" } }, "title": "username/NONE: small change from onFocus to onClick to handle tabbing through the page and not expand the editor unless a click event triggers it" } } ] } ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-activity-get * @param options Request options. */ getActivityLog(options: GetRepositoryPullrequestActivityLogRequest): Promise; /** * Returns the specified pull request. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-get * @param options Request options. */ getPullrequest(options: GetRepositoryPullrequestRequest): Promise; /** * Mutates the specified pull request. This can be used to change the pull request's branches or description. Only open pull requests can be mutated. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-put * @param options Request options. */ mutatePullrequest(options: MutateRepositoryPullrequestRequest): Promise; /** * Approve the specified pull request as the authenticated user. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-approve-post * @param options Request options. */ approvePullrequest(options: ApproveRepositoryPullrequestRequest): Promise; /** * Declines the pull request. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-decline-post * @param options Request options. */ declinePullrequest(options: DeclineRepositoryPullrequestRequest): Promise; /** * Merges the pull request. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-merge-post * @param options Request options. */ mergePullrequest(options: MergeRepositoryPullrequestRequest): Promise; /** * Returns all statuses (e.g. build results) for the given pull request. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-statuses-get * @param options Request options. */ getPullrequestStatuses(options: GetRepositoryPullrequestStatusesRequest): Promise; } declare class RepositoryPullrequestCommentGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of the pull request's comments. This includes both global, inline comments and replies. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. This endpoint also supports filtering and sorting of the results. See [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) for more details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-get * @param options Request options. */ getComments(options: GetRepositoryPullrequestCommentsRequest): Promise; /** * Creates a new pull request comment. Returns the newly created pull request comment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-post * @param options Request options. */ createComment(options: CreateRepositoryPullrequestCommentRequest): Promise; /** * Deletes a specific pull request comment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-delete * @param options Request options. */ deleteComment(options: DeleteRepositoryPullrequestCommentRequest): Promise; /** * Returns a specific pull request comment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-get * @param options Request options. */ getComment(options: GetRepositoryPullrequestCommentRequest): Promise; /** * Updates a specific pull request comment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-comments-comment-id-put * @param options Request options. */ updateComment(options: UpdateRepositoryPullrequestCommentRequest): Promise; } declare class RepositoryPullrequestCommitGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of the pull request's commits. These are the commits that are being merged into the destination branch when the pull requests gets accepted. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-pullrequests-pull-request-id-commits-get * @param options Request options. */ getCommits(options: GetRepositoryPullrequestCommitsRequest): Promise; } declare class RepositoryBranchGroup { private implementation; private getGlobalErrorStrategy; Restriction: RepositoryBranchRestrictionGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a list of all open branches within the specified repository. Results will be in the order the source control manager returns them. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=1 | jq . { "pagelen": 1, "size": 187, "values": [ { "name": "issue-9.3/AUI-5343-assistive-class", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commits/issue-9.3/AUI-5343-assistive-class" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches/issue-9.3/AUI-5343-assistive-class" }, "html": { "href": "https://bitbucket.org/atlassian/aui/branch/issue-9.3/AUI-5343-assistive-class" } }, "default_merge_strategy": "squash", "merge_strategies": [ "merge_commit", "squash", "fast_forward" ], "type": "branch", "target": { "hash": "e5d1cde9069fcb9f0af90403a4de2150c125a148", "repository": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui" }, "html": { "href": "https://bitbucket.org/atlassian/aui" }, "avatar": { "href": "https://bytebucket.org/ravatar/%7B585074de-7b60-4fd1-81ed-e0bc7fafbda5%7D?ts=86317" } }, "type": "repository", "name": "aui", "full_name": "atlassian/aui", "uuid": "{585074de-7b60-4fd1-81ed-e0bc7fafbda5}" }, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/patch/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "html": { "href": "https://bitbucket.org/atlassian/aui/commits/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/diff/e5d1cde9069fcb9f0af90403a4de2150c125a148" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/e5d1cde9069fcb9f0af90403a4de2150c125a148/statuses" } }, "author": { "raw": "Marcin Konopka ", "type": "author", "user": { "display_name": "Marcin Konopka", "uuid": "{47cc24f4-2a05-4420-88fe-0417535a110a}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/%7B47cc24f4-2a05-4420-88fe-0417535a110a%7D" }, "html": { "href": "https://bitbucket.org/%7B47cc24f4-2a05-4420-88fe-0417535a110a%7D/" }, "avatar": { "href": "https://avatar-management--avatars.us-west-2.prod.public.atl-paas.net/initials/MK-1.png" } }, "nickname": "Marcin Konopka", "type": "user", "account_id": "60113d2b47a9540069f4de03" } }, "parents": [ { "hash": "87f7fc92b00464ae47b13ef65c91884e4ac9be51", "type": "commit", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/commit/87f7fc92b00464ae47b13ef65c91884e4ac9be51" }, "html": { "href": "https://bitbucket.org/atlassian/aui/commits/87f7fc92b00464ae47b13ef65c91884e4ac9be51" } } } ], "date": "2021-04-13T13:44:49+00:00", "message": "wip ", "type": "commit" } } ], "page": 1, "next": "https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches?pagelen=1&page=2" } ``` Branches support [filtering and sorting](/cloud/bitbucket/rest/intro/#filtering) that can be used to search for specific branches. For instance, to find all branches that have "stab" in their name: ``` curl -s https://api.bitbucket.org/2.0/repositories/atlassian/aui/refs/branches -G --data-urlencode 'q=name ~ "stab"' ``` By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git branch --list". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted ["v10", "v11", "v9"] instead of ["v9", "v10", "v11"]. Sorting can be changed using the ?q= query parameter. When using ?q=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-get * @param options Request options. */ getOpenBranches(options: GetRepositoryOpenBranchesRequest): Promise; /** * Creates a new branch in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/branches \ -s -u seanfarley -X POST -H "Content-Type: application/json" \ -d '{ "name" : "smf/create-feature", "target" : { "hash" : "default", } }' ``` This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. The branch name should not include any prefixes (e.g. refs/heads). This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-post * @param options Request options. */ createBranch(options: CreateRepositoryBranchRequest): Promise; /** * Returns a branch object within the specified repository. This call requires authentication. Private repositories require the caller to authenticate with an account that has appropriate authorization. For Git, the branch name should not include any prefixes (e.g. refs/heads). * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-get * @param options Request options. */ getBranch(options: GetRepositoryBranchRequest): Promise; /** * Delete a branch in the specified repository. The main branch is not allowed to be deleted and will return a 400 response. The branch name should not include any prefixes (e.g. refs/heads). * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-branches-name-delete * @param options Request options. */ deleteBranch(options: DeleteRepositoryBranchRequest): Promise; } declare class RepositoryBranchRestrictionGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of all branch restrictions on the repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-group-branch-restrictions * @param options Request options. */ getRestrictions(options: GetRepositoryBranchRestrictionsRequest): Promise; /** * Creates a new branch restriction rule for a repository. `kind` describes what will be restricted. Allowed values include: `push`, `force`, `delete`, `restrict_merges`, `require_tasks_to_be_completed`, `require_approvals_to_merge`, `require_default_reviewer_approvals_to_merge`, `require_no_changes_requested`, `require_passing_builds_to_merge`, `require_commits_behind`, `reset_pullrequest_approvals_on_change`, `smart_reset_pullrequest_approvals`, `reset_pullrequest_changes_requested_on_change`, `require_all_dependencies_merged`, `enforce_merge_checks`, and `allow_auto_merge_when_builds_pass`. Different kinds of branch restrictions have different requirements: * `push` and `restrict_merges` require `users` and `groups` to be specified. Empty lists are allowed, in which case permission is denied for everybody. The restriction applies to all branches that match. There are two ways to match a branch. It is configured in `branch_match_kind`: 1. `glob`: Matches a branch against the `pattern`. A `'*'` in `pattern` will expand to match zero or more characters, and every other character matches itself. For example, `'foo*'` will match `'foo'` and `'foobar'`, but not `'barfoo'`. `'*'` will match all branches. 2. `branching_model`: Matches a branch against the repository's branching model. The `branch_type` controls the type of branch to match. Allowed values include: `production`, `development`, `bugfix`, `release`, `feature` and `hotfix`. The combination of `kind` and match must be unique. This means that two `glob` restrictions in a repository cannot have the same `kind` and `pattern`. Additionally, two `branching_model` restrictions in a repository cannot have the same `kind` and `branch_type`. `users` and `groups` are lists of users and groups that are except from the restriction. They can only be configured in `push` and `restrict_merges` restrictions. The `push` restriction stops a user pushing to matching branches unless that user is in `users` or is a member of a group in `groups`. The `restrict_merges` stops a user merging pull requests to matching branches unless that user is in `users` or is a member of a group in `groups`. Adding new users or groups to an existing restriction should be done via `PUT`. Note that branch restrictions with overlapping matchers is allowed, but the resulting behavior may be surprising. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-post * @param options Request options. */ createRestriction(options: CreateRepositoryBranchRestrictionRequest): Promise; /** * Returns a specific branch restriction rule. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-get * @param options Request options. */ getRestriction(options: GetRepositoryBranchRestrictionRequest): Promise; /** * Updates an existing branch restriction rule. Fields not present in the request body are ignored. See [`POST`](/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-post) for details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-put * @param options Request options. */ updateRestriction(options: UpdateRepositoryBranchRestrictionRequest): Promise; /** * Deletes an existing branch restriction rule. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-branch-restrictions/#api-repositories-workspace-repo-slug-branch-restrictions-id-delete * @param options Request options. */ deleteRestriction(options: DeleteRepositoryBranchRestrictionRequest): Promise; } declare class RepositoryCommitGroup { private implementation; private getGlobalErrorStrategy; Approval: RepositoryCommitApprovalGroup; Comment: RepositoryCommitCommentGroup; Status: RepositoryCommitStatusGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the specified commit. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-get * @param options Request options. */ getCommit(options: GetRepositoryCommitRequest): Promise; /** * Returns a paginated list of commits that modified the specified file. Commits are returned in reverse chronological order. This is roughly equivalent to the following commands: $ git log --follow --date-order By default, Bitbucket will follow renames and the path name in the returned entries reflects that. This can be turned off using the `?renames=false` query parameter. Results are returned in descending chronological order by default, and like most endpoints you can [filter and sort](/cloud/bitbucket/rest/intro/#filtering) the response to only provide exactly the data you want. For example, if you wanted to find commits made before 2011-05-18 against a file named `README.rst`, but you only wanted the path and date, your query would look like this: ``` $ curl 'https://api.bitbucket.org/2.0/repositories/evzijst/dogslow/filehistory/master/README.rst'\ '?fields=values.next,values.path,values.commit.date&q=commit.date<=2011-05-18' { "values": [ { "commit": { "date": "2011-05-17T07:32:09+00:00" }, "path": "README.rst" }, { "commit": { "date": "2011-05-16T06:33:28+00:00" }, "path": "README.txt" }, { "commit": { "date": "2011-05-16T06:15:39+00:00" }, "path": "README.txt" } ] } ``` In the response you can see that the file was renamed to `README.rst` by the commit made on 2011-05-16, and was previously named `README.txt`. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-source/#api-repositories-workspace-repo-slug-filehistory-commit-path-get * @param options Request options. */ getCommitsByFile(options: GetRepositoryCommitsByFileRequest): Promise; /** * Identical to `GET /repositories/{workspace}/{repo_slug}/commits`, except that POST allows clients to place the include and exclude parameters in the request body to avoid URL length issues. **Note that this resource does NOT support new commit creation.** * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commits-post * @param options Request options. */ getCommits(options: GetRepositoryCommitsRequest): Promise; } declare class RepositoryCommitApprovalGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Approve the specified commit as the authenticated user. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-approve-post * @param options Request options. */ approveCommit(options: ApproveRepositoryCommitRequest): Promise; /** * Redact the authenticated user's approval of the specified commit. This operation is only available to users that have explicit access to the repository. In contrast, just the fact that a repository is publicly accessible to users does not give them the ability to approve commits. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-approve-delete * @param options Request options. */ redactApproval(options: RedactRepositoryCommitApprovalRequest): Promise; } declare class RepositoryCommitCommentGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the commit's comments. This includes both global and inline comments. The default sorting is oldest to newest and can be overridden with the `sort` query parameter. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-get * @param options Request options. */ getComments(options: GetRepositoryCommitCommentsRequest): Promise; /** * Returns the specified commit comment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commits/#api-repositories-workspace-repo-slug-commit-commit-comments-comment-id-get * @param options Request options. */ getComment(options: GetRepositoryCommitCommentRequest): Promise; } declare class RepositoryCommitStatusGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns all statuses (e.g. build results) for a specific commit. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-get * @param options Request options. */ getStatuses(options: GetRepositoryCommitStatusesRequest): Promise; /** * Creates a new build status against the specified commit. If the specified key already exists, the existing status object will be overwritten. Example: ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result" }' ``` When creating a new commit status, you can use a URI template for the URL. Templates are URLs that contain variable names that Bitbucket will evaluate at runtime whenever the URL is displayed anywhere similar to parameter substitution in [Bitbucket Connect](https://developer.atlassian.com/bitbucket/concepts/context-parameters.html). For example, one could use `https://foo.com/builds/{repository.full_name}` which Bitbucket will turn into `https://foo.com/builds/foo/bar` at render time. The context variables available are `repository` and `commit`. To associate a commit status to a pull request, the refname field must be set to the source branch of the pull request. Example: ``` curl https://api.bitbucket.org/2.0/repositories/my-workspace/my-repo/commit/e10dae226959c2194f2b07b077c07762d93821cf/statuses/build/ -X POST -u jdoe -H 'Content-Type: application/json' -d '{ "key": "MY-BUILD", "state": "SUCCESSFUL", "description": "42 tests passed", "url": "https://www.example.org/my-build-result", "refname": "my-pr-branch" }' ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-build-post * @param options Request options. */ createStatus(options: CreateRepositoryCommitStatusRequest): Promise; /** * Returns the specified build status for a commit. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-commit-statuses/#api-repositories-workspace-repo-slug-commit-commit-statuses-build-key-get * @param options Request options. */ getStatus(options: GetRepositoryCommitStatusRequest): Promise; } declare class RepositoryReviewerGroup { private implementation; private getGlobalErrorStrategy; Default: RepositoryReviewerDefaultGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); } declare class RepositoryReviewerDefaultGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the repository's default reviewers. These are the users that are automatically added as reviewers on every new pull request that is created. To obtain the repository's default reviewers as well as the default reviewers inherited from the project, use the [effective-default-reveiwers](#api-repositories-workspace-repo-slug-effective-default-reviewers-get) endpoint. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-get * @param options Request options. */ getReviewers(options: GetRepositoryDefaultReviewersRequest): Promise; /** * Returns the specified reviewer. This can be used to test whether a user is among the repository's default reviewers list. A 404 indicates that that specified user is not a default reviewer. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-get * @param options Request options. */ getReviewer(options: GetRepositoryDefaultReviewerRequest): Promise; /** * Adds the specified user to the repository's list of default reviewers. This method is idempotent. Adding a user a second time has no effect. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-put * @param options Request options. */ addReviewer(options: AddRepositoryDefaultReviewerRequest): Promise; /** * Removes a default reviewer from the repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pullrequests/#api-repositories-workspace-repo-slug-default-reviewers-target-username-delete * @param options Request options. */ removeReviewer(options: RemoveRepositoryDefaultReviewerRequest): Promise; } declare class RepositoryTagGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the tags in the repository. By default, results will be in the order the underlying source control system returns them and identical to the ordering one sees when running "$ git tag --list". Note that this follows simple lexical ordering of the ref names. This can be undesirable as it does apply any natural sorting semantics, meaning for instance that tags are sorted ["v10", "v11", "v9"] instead of ["v9", "v10", "v11"]. Sorting can be changed using the ?sort= query parameter. When using ?sort=name to explicitly sort on ref name, Bitbucket will apply natural sorting and interpret numerical values as numbers instead of strings. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-get * @param options Request options. */ getTags(options: GetRepositoryTagsRequest): Promise; /** * Creates a new tag in the specified repository. The payload of the POST should consist of a JSON document that contains the name of the tag and the target hash. ``` curl https://api.bitbucket.org/2.0/repositories/jdoe/myrepo/refs/tags \ -s -u jdoe -X POST -H "Content-Type: application/json" \ -d '{ "name" : "new-tag-name", "target" : { "hash" : "a1b2c3d4e5f6", } }' ``` This endpoint does support using short hash prefixes for the commit hash, but it may return a 400 response if the provided prefix is ambiguous. Using a full commit hash is the preferred approach. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-post * @param options Request options. */ createTag(options: CreateRepositoryTagRequest): Promise; /** * Returns the specified tag. ``` $ curl -s https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8 -G | jq . { "name": "3.8", "links": { "commits": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commits/3.8" }, "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/refs/tags/3.8" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/tag/3.8" } }, "tagger": { "raw": "Matt Mackall ", "type": "author", "user": { "username": "mpmselenic", "nickname": "mpmselenic", "display_name": "Matt Mackall", "type": "user", "uuid": "{a4934530-db4c-419c-a478-9ab4964c2ee7}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/mpmselenic" }, "html": { "href": "https://bitbucket.org/mpmselenic/" }, "avatar": { "href": "https://bitbucket.org/account/mpmselenic/avatar/32/" } } } }, "date": "2016-05-01T18:52:25+00:00", "message": "Added tag 3.8 for changeset f85de28eae32", "type": "tag", "target": { "hash": "f85de28eae32e7d3064b1a1321309071bbaaa069", "repository": { "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg" }, "html": { "href": "https://bitbucket.org/seanfarley/hg" }, "avatar": { "href": "https://bitbucket.org/seanfarley/hg/avatar/32/" } }, "type": "repository", "name": "hg", "full_name": "seanfarley/hg", "uuid": "{c75687fb-e99d-4579-9087-190dbd406d30}" }, "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "comments": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/comments" }, "patch": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/patch/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "diff": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/diff/f85de28eae32e7d3064b1a1321309071bbaaa069" }, "approve": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/approve" }, "statuses": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/f85de28eae32e7d3064b1a1321309071bbaaa069/statuses" } }, "author": { "raw": "Sean Farley ", "type": "author", "user": { "username": "seanfarley", "nickname": "seanfarley", "display_name": "Sean Farley", "type": "user", "uuid": "{a295f8a8-5876-4d43-89b5-3ad8c6c3c51d}", "links": { "self": { "href": "https://api.bitbucket.org/2.0/users/seanfarley" }, "html": { "href": "https://bitbucket.org/seanfarley/" }, "avatar": { "href": "https://bitbucket.org/account/seanfarley/avatar/32/" } } } }, "parents": [ { "hash": "9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2", "type": "commit", "links": { "self": { "href": "https://api.bitbucket.org/2.0/repositories/seanfarley/hg/commit/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2" }, "html": { "href": "https://bitbucket.org/seanfarley/hg/commits/9a98d0e5b07fc60887f9d3d34d9ac7d536f470d2" } } } ], "date": "2016-05-01T04:21:17+00:00", "message": "debian: alphabetize build deps", "type": "commit" } } ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-name-get * @param options Request options. */ getTag(options: GetRepositoryTagRequest): Promise; /** * Delete a tag in the specified repository. The tag name should not include any prefixes (e.g. refs/tags). * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-refs/#api-repositories-workspace-repo-slug-refs-tags-name-delete * @param options Request options. */ deleteTag(options: DeleteRepositoryTagRequest): Promise; } declare class RepositoryEnvironmentGroup { private implementation; private getGlobalErrorStrategy; Variable: RepositoryEnvironmentVariableGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find environments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-get * @param options Request options. */ getEnvironments(options: GetRepositoryEnvironmentsRequest): Promise; /** * Create an environment. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-post * @param options Request options. */ createEnvironment(options: CreateRepositoryEnvironmentRequest): Promise; /** * Retrieve an environment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-environment-uuid-get * @param options Request options. */ getEnvironment(options: GetRepositoryEnvironmentRequest): Promise; /** * Delete an environment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-environments-environment-uuid-delete * @param options Request options. */ deleteEnvironment(options: DeleteRepositoryEnvironmentRequest): Promise; } declare class RepositoryEnvironmentVariableGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find deployment environment level variables. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-get * @param options Request options. */ getVariables(options: GetRepositoryEnvironmentVariablesRequest): Promise; /** * Create a deployment environment level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-post * @param options Request options. */ createVariable(options: CreateRepositoryEnvironmentVariableRequest): Promise; /** * Update a deployment environment level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-variable-uuid-put * @param options Request options. */ updateVariable(options: UpdateRepositoryEnvironmentVariableRequest): Promise; /** * Delete a deployment environment level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-repositories-workspace-repo-slug-deployments-config-environments-environment-uuid-variables-variable-uuid-delete * @param options Request options. */ deleteVariable(options: DeleteRepositoryEnvironmentVariableRequest): Promise; } declare class RepositoryForkGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of all the forks of the specified repository. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-forks-get * @param options Request options. */ getForks(options: GetRepositoryForksRequest): Promise; /** * Creates a new fork of the specified repository. #### Forking a repository To create a fork, specify the workspace explicitly as part of the request body: ``` $ curl -X POST -u jdoe https://api.bitbucket.org/2.0/repositories/atlassian/bbql/forks \ -H 'Content-Type: application/json' -d '{ "name": "bbql_fork", "workspace": { "slug": "atlassian" } }' ``` To fork a repository into the same workspace, also specify a new `name`. When you specify a value for `name`, it will also affect the `slug`. The `slug` is reflected in the repository URL of the new fork. It is derived from `name` by substituting non-ASCII characters, removes whitespace, and changes characters to lower case. For example, `My repo` would turn into `my_repo`. You need contributor access to create new forks within a workspace. #### Change the properties of a new fork By default the fork inherits most of its properties from the parent. However, since the optional POST body document follows the normal `repository` JSON schema and you can override the new fork's properties. Properties that can be overridden include: * description * fork_policy * language * mainbranch * is_private (note that a private repo's fork_policy might prohibit the creation of public forks, in which `is_private=False` would fail) * has_issues (to initialize or disable the new repo's issue tracker -- note that the actual contents of the parent repository's issue tracker are not copied during forking) * has_wiki (to initialize or disable the new repo's wiki -- note that the actual contents of the parent repository's wiki are not copied during forking) * project (when forking into a private project, the fork's `is_private` must be `true`) Properties that cannot be modified include: * scm * parent * full_name * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-forks-post * @param options Request options. */ createFork(options: CreateRepositoryForkRequest): Promise; } declare class RepositoryDeploymentGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find deployments * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deployments-get * @param options Request options. */ getDeployments(options: GetRepositoryDeploymentsRequest): Promise; /** * Retrieve a deployment * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-deployments/#api-repositories-workspace-repo-slug-deployments-deployment-uuid-get * @param options Request options. */ getDeployment(options: GetRepositoryDeploymentRequest): Promise; } declare class UserGroup { private implementation; private getGlobalErrorStrategy; Permission: UserPermissionGroup; SSH: UserSSHGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the currently logged in user. * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user * @param options Request options. */ getCurrentUser(options?: GetCurrentUserRequest): Promise; /** * Returns all the authenticated user's email addresses. Both confirmed and unconfirmed. * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/user/emails * @param options Request options. */ getCurrentUserEmails(options?: GetCurrentUserEmailsRequest): Promise; /** * Gets the public information associated with a user account. If the user's profile is private, `location`, `website` and `created_on` elements are omitted. Note that the user object returned by this operation is changing significantly, due to privacy changes. See the [announcement](https://developer.atlassian.com/cloud/bitbucket/bitbucket-api-changes-gdpr/#changes-to-bitbucket-user-objects) for details. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-users-selected-user-get * @param options Request options. */ getUser(options: GetUserRequest): Promise; /** * Returns details about a specific one of the authenticated user's email addresses. Details describe whether the address has been confirmed by the user and whether it is the user's primary address or not. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-users/#api-user-emails-email-get * @param options Request options. */ getCurrentUserEmail(options: GetCurrentUserEmailRequest): Promise; } declare class UserPermissionGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns an object for each repository the caller has explicit access to and their effective permission — the highest level of permission the caller has. This does not return public repositories that the user was not granted any specific permission in, and does not distinguish between explicit and implicit privileges. Permissions can be: * `admin` * `write` * `read` Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by repository or permission by adding the following query string parameters: * `q=repository.name="geordi"` or `q=permission>"read"` * `sort=repository.name` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-repositories/#api-user-permissions-repositories-get * @param options Request options. */ getCurrentUserRepositoryPermissions(options?: GetCurrentUserRepositoryPermissionsRequest): Promise; /** * Returns an object for each workspace the caller is a member of, and their effective role - the highest level of privilege the caller has. If a user is a member of multiple groups with distinct roles, only the highest level is returned. Permissions can be: * `owner` * `collaborator` * `member` **The `collaborator` role is being removed from the Bitbucket Cloud API. For more information, see the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).** **When you move your administration from Bitbucket Cloud to admin.atlassian.com, the following fields on `workspace_membership` will no longer be present: `last_accessed` and `added_on`. See the [deprecation announcement](/cloud/bitbucket/announcement-breaking-change-workspace-membership/).** Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by workspace or permission by adding the following query string parameters: * `q=workspace.slug="bbworkspace1"` or `q=permission="owner"` * `sort=workspace.slug` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-user-permissions-workspaces-get * @param options Request options. */ getCurrentUserWorkspaceMemberships(options?: GetCurrentUserWorkspaceMembershipsRequest): Promise; } declare class UserSSHGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a paginated list of the user's SSH public keys. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-get * @param options Request options. */ getKeys(options: GetUserSSHKeysRequest): Promise; /** * Adds a new SSH public key to the specified user account and returns the resulting key. Example: ``` $ curl -X POST -H "Content-Type: application/json" -d '{"key": "ssh-ed25519 AAAAC3NzaC1lZDI1NTE5AAAAIKqP3Cr632C2dNhhgKVcon4ldUSAeKiku2yP9O9/bDtY user@myhost"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-post * @param options Request options. */ addKey(options: AddUserSSHKeyRequest): Promise; /** * Returns a specific SSH public key belonging to a user. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-get * @param options Request options. */ getKey(options: GetUserSSHKeyRequest): Promise; /** * Updates a specific SSH public key on a user's account Note: Only the 'comment' field can be updated using this API. To modify the key or comment values, you must delete and add the key again. Example: ``` $ curl -X PUT -H "Content-Type: application/json" -d '{"label": "Work key"}' https://api.bitbucket.org/2.0/users/{ed08f5e1-605b-4f4a-aee4-6c97628a673e}/ssh-keys/{b15b6026-9c02-4626-b4ad-b905f99f763a} ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-put * @param options Request options. */ updateKey(options: UpdateUserSSHKeyRequest): Promise; /** * Deletes a specific SSH public key from a user's account. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-ssh/#api-users-selected-user-ssh-keys-key-id-delete * @param options Request options. */ deleteKey(options: DeleteUserSSHKeyRequest): Promise; } declare class WorkspaceGroup { private implementation; private getGlobalErrorStrategy; Project: WorkspaceProjectGroup; Variable: WorkspaceVariableGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns a list of workspaces accessible by the authenticated user. Results may be further [filtered or sorted](/cloud/bitbucket/rest/intro/#filtering) by workspace or permission by adding the following query string parameters: * `q=slug="bbworkspace1"` or `q=is_private=true` * `sort=created_on` Note that the query parameter values need to be URL escaped so that `=` would become `%3D`. **The `collaborator` role is being removed from the Bitbucket Cloud API. For more information, see the [deprecation announcement](/cloud/bitbucket/deprecation-notice-collaborator-role/).** * Documentation: https://developer.atlassian.com/bitbucket/api/2/reference/resource/workspaces * @param options Request options. */ getWorkspaces(options?: GetWorkspacesRequest): Promise; /** * Returns the requested workspace. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-get * @param options Request options. */ getWorkspace(options: GetWorkspaceRequest): Promise; } declare class WorkspaceProjectGroup { private implementation; private getGlobalErrorStrategy; Search: WorkspaceProjectSearchGroup; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Returns the list of projects in this workspace. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-workspaces/#api-workspaces-workspace-projects-get * @param options Request options. */ getProjects(options: GetWorkspaceProjectsRequest): Promise; /** * Creates a new project. Note that the avatar has to be embedded as either a data-url or a URL to an external image as shown in the examples below: ``` $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "data:image/gif;base64,R0lGODlhEAAQAMQAAORHHOVSKudfOulrSOp3WOyDZu6QdvCchPGolfO0o/..." } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document } ``` or even: ``` $ body=$(cat << EOF { "name": "Mars Project", "key": "MARS", "description": "Software for colonizing mars.", "links": { "avatar": { "href": "http://i.imgur.com/72tRx4w.gif" } }, "is_private": false } EOF ) $ curl -H "Content-Type: application/json" \ -X POST \ -d "$body" \ https://api.bitbucket.org/2.0/workspaces/teams-in-space/projects/ | jq . { // Serialized project document } ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-post * @param options Request options. */ createProject(options: CreateWorkspaceProjectRequest): Promise; /** * Deletes this project. This is an irreversible operation. You cannot delete a project that still contains repositories. To delete the project, [delete](/cloud/bitbucket/rest/api-group-repositories/#api-repositories-workspace-repo-slug-delete) or transfer the repositories first. Example: ``` $ curl -X DELETE https://api.bitbucket.org/2.0/workspaces/bbworkspace1/projects/PROJ ``` * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-project-key-delete * @param options Request options. */ deleteProject(options: DeleteWorkspaceProjectRequest): Promise; /** * Returns the requested project. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-projects/#api-workspaces-workspace-projects-project-key-get * @param options Request options. */ getProject(options: GetWorkspaceProjectRequest): Promise; } declare class WorkspaceProjectSearchGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Search for code in the repositories of the specified workspace. Note that searches can match in the file's text (`content_matches`), the path (`path_matches`), or both. You can use the same syntax for the search query as in the UI. E.g. to search for "foo" only within the repository "demo", use the query parameter `search_query=foo+repo:demo`. Similar to other APIs, you can request more fields using a `fields` query parameter. E.g. to get some more information about the repository of matched files, use the query parameter `search_query=foo&fields=%2Bvalues.file.commit.repository` (the `%2B` is a URL-encoded `+`). Try `fields=%2Bvalues.*.*.*.*` to get an idea what's possible. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-other-operations/#api-workspaces-workspace-search-code-get * @param options Request options. */ searchCodeInProjects(options: SearchCodeInWorkspaceProjectsRequest): Promise; } declare class WorkspaceVariableGroup { private implementation; private getGlobalErrorStrategy; constructor(implementation: PlatformImplementation, getGlobalErrorStrategy: GetGlobalErrorStrategy); /** * Find workspace level variables. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-get * @param options Request options. */ getVariables(options: GetWorkspaceVariablesRequest): Promise; /** * Create a workspace level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-post * @param options Request options. */ createVariable(options: CreateWorkspaceVariableRequest): Promise; /** * Retrieve a workspace level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-get * @param options Request options. */ getVariable(options: GetWorkspaceVariableRequest): Promise; /** * Update a workspace level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-put * @param options Request options. */ updateVariable(options: UpdateWorkspaceVariableRequest): Promise; /** * Delete a workspace level variable. * Documentation: https://developer.atlassian.com/cloud/bitbucket/rest/api-group-pipelines/#api-workspaces-workspace-pipelines-config-variables-variable-uuid-delete * @param options Request options. */ deleteVariable(options: DeleteWorkspaceVariableRequest): Promise; } export {}; //# sourceMappingURL=index.d.ts.map