### Example Repository Name Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Provides an example of a repository's name. ```text My repo ``` -------------------------------- ### Example Repository Description Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Provides an example of a repository's description. ```text My repo description ``` -------------------------------- ### Install @coderabbitai/bitbucket Source: https://coderabbitai.github.io/bitbucket/index.html Install the package using pnpm. This is the initial step before using the client. ```bash pnpm add @coderabbitai/bitbucket ``` -------------------------------- ### Example: User Name Source: https://coderabbitai.github.io/bitbucket/functions/server.isSchemaRestPullRequestActivityUpdated.html Provides an example of a user's login name. ```typescript jcitizen ``` -------------------------------- ### Advanced Search Query Example Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Demonstrates how to construct a search query to find specific code within a particular repository. This example searches for 'foo' only within the 'demo' repository. ```text search_query=foo+repo:demo ``` -------------------------------- ### Example Repository Default Branch Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Provides an example of a repository's default branch name. ```text main ``` -------------------------------- ### Example Parent Path Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html The directory path containing the file. ```text path/to ``` -------------------------------- ### Example: User Display Name Source: https://coderabbitai.github.io/bitbucket/functions/server.isSchemaRestPullRequestActivityUpdated.html Provides an example of a user's display name. ```typescript Jane Citizen ``` -------------------------------- ### Example File Extension Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html The file extension for a given file path. ```text txt ``` -------------------------------- ### Example Repository Hierarchy ID Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Provides an example of a repository's hierarchy ID. ```text e3c939f9ef4a7fae272e ``` -------------------------------- ### Example: User ID Source: https://coderabbitai.github.io/bitbucket/functions/server.isSchemaRestPullRequestActivityUpdated.html Shows an example of a user's unique identifier. ```typescript 101 ``` -------------------------------- ### Example File Name Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html The name of the file, including its extension. ```text file.txt ``` -------------------------------- ### Example: Activity ID Source: https://coderabbitai.github.io/bitbucket/functions/server.isSchemaRestPullRequestActivityUpdated.html Shows an example of a pull request activity ID. ```typescript 1 ``` -------------------------------- ### Pull Request From Ref Latest Commit Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Example of the latest commit SHA for the 'from' reference of a pull request. ```text babecafebabecafebabecafebabecafebabecafe ``` -------------------------------- ### Example Created Date Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Timestamp indicating when the comment was created. ```plaintext 1359075920 ``` -------------------------------- ### Example Path Components Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html An array representing the hierarchical components of a file path. ```json [ "path", "to", "file.txt" ] ``` -------------------------------- ### Get Pipeline Step Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Retrieves details about a specific step within a Bitbucket Cloud pipeline. This includes its state, start and completion times, and associated commands. ```APIDOC ## GET /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid} ### Description Retrieves details for a specific pipeline step. ### Method GET ### Endpoint /repositories/{workspace}/{repo_slug}/pipelines/{pipeline_uuid}/steps/{step_uuid} ### Parameters #### Path Parameters - **workspace** (string) - Required - The workspace ID. - **repo_slug** (string) - Required - The repository slug. - **pipeline_uuid** (string) - Required - The UUID of the pipeline. - **step_uuid** (string) - Required - The UUID of the step. ### Response #### Success Response (200) - **uuid** (string) - The unique identifier for the step. - **state** (object) - The current state of the step. - **started_on** (string) - The timestamp when the step started. - **completed_on** (string) - The timestamp when the step completed. - **image** (object) - Information about the Docker image used for the step. - **setup_commands** (array) - A list of setup commands executed for the step. - **script_commands** (array) - A list of script commands executed for the step. #### Response Example ```json { "uuid": "step-uuid-123", "state": { "type": "completed" }, "started_on": "2023-10-27T10:00:00Z", "completed_on": "2023-10-27T10:05:00Z", "image": { "name": "docker-image-name" }, "setup_commands": [ { "name": "setup-script", "command": "echo 'setting up'" } ], "script_commands": [ { "name": "run-script", "command": "echo 'running script'" } ] } ``` ``` -------------------------------- ### Pull Request Title Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html An example of a pull request title. ```text Talking Nerdy ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Details on how to initialize the Bitbucket Cloud Client with necessary parameters. ```APIDOC ## BitbucketCloudClient Initialization ### Description Initializes the Bitbucket Cloud Client with configuration options. ### Parameters #### Path Parameters - **environment_uuid** (string) - Required - The UUID of the environment. - **repo_slug** (string) - Required - The slug of the repository. - **workspace** (string) - Required - The workspace ID. #### Request Body This method does not accept a request body. #### Request Example ```json { "example": "No request body" } ``` ### Response #### Success Response (204) - **headers** (Readonly>) - Headers associated with the successful response. #### Error Response (404) - **content** (object) - Contains error details. - **application/json** (object) - **error** (object) - Optional - Detailed error information. - **data** (...) - Optional - Additional data related to the error. - **detail** (...) - Optional - Specific details about the error. - **message** (string) - The error message. - **type** (string) - The type of error. - **headers** (Readonly>) - Headers associated with the error response. #### Response Example (Success) ```json { "example": "No response body, only headers" } ``` #### Response Example (Error) ```json { "example": { "error": { "message": "Repository not found.", "type": "NotFoundError" }, "type": "Error" } } ``` ``` -------------------------------- ### Pull Request Description Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html An example of a pull request description. ```text It is a kludge, but put the tuple from the database in the cache. ``` -------------------------------- ### BitbucketCloudClient.constructor Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Initializes the Bitbucket Cloud Client. It requires configuration options including base URL, fetch implementation, headers, and middleware. ```APIDOC ## BitbucketCloudClient.constructor ### Description Initializes the Bitbucket Cloud Client with provided configuration options. ### Parameters * `init` (object) - Configuration object for the client. * `baseUrl` (string, optional) - The base URL for the Bitbucket Cloud API. * `fetch` (function, optional) - A custom fetch implementation. * `headers` (HeadersOptions, optional) - Custom headers to be sent with requests. * `middleware` (Middleware[], optional) - An array of middleware functions to process requests and responses. * `pathSerializer` (PathSerializer, optional) - Serializer for path parameters. * `querySerializer` (QuerySerializerOptions | QuerySerializer, optional) - Serializer for query parameters. * `bodySerializer` (BodySerializer, optional) - Serializer for request bodies. * `parseAs` (keyof BodyType, optional) - Specifies how to parse the response body. * `[key: string]: unknown` - Allows for additional, arbitrary properties. ``` -------------------------------- ### BitbucketCloudClient Constructor Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Initializes a new instance of the BitbucketCloudClient. ```APIDOC ## constructor * new BitbucketCloudClient(clientOptions?: ClientOptions): BitbucketCloudClient ### Parameters * `Optional`clientOptions: ClientOptions ### Returns BitbucketCloudClient ``` -------------------------------- ### Create Bitbucket Server Client with openapi-fetch Source: https://coderabbitai.github.io/bitbucket/index.html Initialize the Bitbucket Server client using `createBitbucketServerClient` for openapi-fetch. Requires the server URL and a Bearer token for authentication. ```typescript import { createBitbucketServerClient } from "@coderabbitai/bitbucket/server" import { BITBUCKET_SERVER_TOKEN, BITBUCKET_SERVER_URL } from "./env.js" const client = createBitbucketServerClient({ baseUrl: BITBUCKET_SERVER_URL, headers: { Accept: "application/json", Authorization: `Bearer ${BITBUCKET_SERVER_TOKEN}`, }, }) ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html This snippet shows the parameters required for initializing the BitbucketCloudClient. It includes path parameters like `app_key`, `property_name`, and `selected_user`, and also details the structure of the request body for operations. ```APIDOC ## BitbucketCloudClient Initialization ### Description Initializes the Bitbucket Cloud Client with necessary parameters. ### Parameters #### Path Parameters - **app_key** (string) - Required - The application key for authentication. - **property_name** (string) - Required - The name of the property to access. - **selected_user** (string) - Required - The user whose data is being accessed. #### Request Body - **_attributes** (object) - Optional - Attributes for the request body. - **[iterator]** (object) - Optional - Iterator attributes. - **[unscopables]** (object) - Optional - Unscopable attributes. - **at** (object) - Optional - Attributes for the 'at' property. - **concat** (object) - Optional - Attributes for the 'concat' property. - **entries** (object) - Optional - Attributes for the 'entries' property. - **every** (object) - Optional - Attributes for the 'every' property. - **filter** (object) - Optional - Attributes for the 'filter' property. - **find** (object) - Optional - Attributes for the 'find' property. - **findIndex** (object) - Optional - Attributes for the 'findIndex' property. - **findLast** (object) - Optional - Attributes for the 'findLast' property. - **findLastIndex** (object) - Optional - Attributes for the 'findLastIndex' property. - **flat** (object) - Optional - Attributes for the 'flat' property. - **flatMap** (object) - Optional - Attributes for the 'flatMap' property. - **forEach** (object) - Optional - Attributes for the 'forEach' property. - **includes** (object) - Optional - Attributes for the 'includes' property. - **indexOf** (object) - Optional - Attributes for the 'indexOf' property. - **join** (object) - Optional - Attributes for the 'join' property. - **keys** (object) - Optional - Attributes for the 'keys' property. - **lastIndexOf** (object) - Optional - Attributes for the 'lastIndexOf' property. - **length** (number) - Optional - The length of the array. - **map** (object) - Optional - Attributes for the 'map' property. - **reduce** (object) - Optional - Attributes for the 'reduce' property. - **reduceRight** (object) - Optional - Attributes for the 'reduceRight' property. - **slice** (object) - Optional - Attributes for the 'slice' property. - **some** (object) - Optional - Attributes for the 'some' property. - **toLocaleString** (object) - Optional - Attributes for the 'toLocaleString' property. - **toReversed** (object) - Optional - Attributes for the 'toReversed' property. - **toSorted** (object) - Optional - Attributes for the 'toSorted' property. - **toSpliced** (object) - Optional - Attributes for the 'toSpliced' property. - **toString** (object) - Optional - Attributes for the 'toString' property. - **values** (object) - Optional - Attributes for the 'values' property. - **with** (object) - Optional - Attributes for the 'with' property. - **readonly [key: number]** (string) - Optional - Readonly attribute for array elements. - **readonly [key: string]** (unknown) - Optional - Readonly attribute for string keys. ### Returns Promise Returns a promise that resolves with the fetch response. #### Success Response (204) - **content** (undefined) - No content is returned. - **headers** (object) - Readonly> - Headers of the response. ``` -------------------------------- ### Pull Request From Ref ID Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Example of the ID for the 'from' reference of a pull request. ```text refs/heads/feature-ABC-123 ``` -------------------------------- ### Pull Request Created Date Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Example of a Unix timestamp for the pull request created date. ```int64 13590759200 ``` -------------------------------- ### Example: User Email Address Source: https://coderabbitai.github.io/bitbucket/functions/server.isSchemaRestPullRequestActivityUpdated.html Illustrates the format for a user's email address. ```typescript jane@example.com ``` -------------------------------- ### Pull Request From Ref Display ID Example Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Example of the display ID for the 'from' reference of a pull request. ```text feature-ABC-1233 ``` -------------------------------- ### Create Bitbucket Cloud Client with openapi-fetch Source: https://coderabbitai.github.io/bitbucket/index.html Initialize the Bitbucket Cloud client using the `createBitbucketCloudClient` function for openapi-fetch integration. Requires base URL and authentication headers. ```typescript import { createBitbucketCloudClient } from "@coderabbitai/bitbucket/cloud" import { toBase64 } from "@coderabbitai/bitbucket" import { BITBUCKET_CLOUD_APP_PASSWORD, BITBUCKET_CLOUD_URL, BITBUCKET_CLOUD_USERNAME, } from "./env.js" const basic = toBase64( BITBUCKET_CLOUD_USERNAME + ":" + BITBUCKET_CLOUD_APP_PASSWORD, ) const client = createBitbucketCloudClient({ baseUrl: BITBUCKET_CLOUD_URL.toString(), headers: { Accept: "application/json", Authorization: `Basic ${basic}` }, }) ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html This snippet shows the parameters required for initializing the Bitbucket Cloud Client, including path parameters for specifying the workspace, repository slug, and known host UUID. ```APIDOC ## BitbucketCloudClient Initialization ### Description Initializes the Bitbucket Cloud Client with necessary configuration. ### Parameters #### Path Parameters - **workspace** (string) - Required - The workspace ID for Bitbucket. - **repo_slug** (string) - Required - The repository slug. - **known_host_uuid** (string) - Required - The UUID of the known host. #### Request Example ```json { "workspace": "your_workspace", "repo_slug": "your_repo", "known_host_uuid": "your_host_uuid" } ``` ### Returns Promise Returns a Promise that resolves to a FetchResponse containing the details of the known host, or an error if not found. ``` -------------------------------- ### Get Repository Hosted Property Value Source: https://coderabbitai.github.io/bitbucket/interfaces/cloud.OpenApi.operations.html Retrieves the value of a specific hosted property for a given repository. This can be used to get information like repository visibility or other custom properties. ```APIDOC ## GET /repositories/{workspace}/{repo_slug}/properties/{property_name} ### Description Retrieves the value of a specific hosted property for a given repository. ### Method GET ### Endpoint /repositories/{workspace}/{repo_slug}/properties/{property_name} ### Parameters #### Path Parameters - **workspace** (string) - Required - The workspace ID or name. - **repo_slug** (string) - Required - The repository slug. - **property_name** (string) - Required - The name of the property to retrieve. ``` -------------------------------- ### createBitbucketServerClient Source: https://coderabbitai.github.io/bitbucket/variables/server.createBitbucketServerClient.html Initializes an `openapi-fetch` client for Bitbucket Server. This client can be used to make requests to the Bitbucket Server API. ```APIDOC ## createBitbucketServerClient ### Description Creates an `openapi-fetch` client using `createClient` for Bitbucket Server interactions. ### Method `createBitbucketServerClient` ### Parameters #### clientOptions - `clientOptions` (ClientOptions) - Optional - Configuration options for the client, such as base URL and headers. ### Returns - `Client` - An `openapi-fetch` client instance configured for Bitbucket Server. ### Example ```javascript const client = createBitbucketServerClient({ baseUrl: "https://example.org/rest", headers: { Accept: "application/json", Authorization: `Bearer ${BITBUCKET_SERVER_TOKEN}`, }, }); ``` ``` -------------------------------- ### Example Comment Text Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html The actual content of the comment. ```plaintext An insightful comment. ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html This snippet shows how to initialize the BitbucketCloudClient with necessary parameters. It includes path parameters like workspace, repo_slug, pullrequest_id, and app_key, along with optional request body content. ```APIDOC ## BitbucketCloudClient Initialization ### Description Initializes the BitbucketCloudClient with configuration details. ### Parameters #### Path Parameters - **workspace** (string) - Required - The workspace ID. - **repo_slug** (string) - Required - The repository slug. - **pullrequest_id** (string) - Required - The pull request ID. - **app_key** (string) - Required - The application key. #### Request Body - **_attributes** (object) - Optional - Internal attributes for the request. ### Request Example ```json { "_attributes": {} } ``` ### Response #### Success Response (204) - **headers** (object) - Headers of the response. ### Response Example ```json { "headers": {} } ``` ``` -------------------------------- ### Example Resolved Date Source: https://coderabbitai.github.io/bitbucket/interfaces/server.SchemaRestPullRequestActivityCommented.html Timestamp indicating when the comment was resolved. ```plaintext 1239075920 ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Initializes the Bitbucket Cloud Client with necessary parameters. This method is used to set up the client for making API requests. ```APIDOC ## BitbucketCloudClient Constructor ### Description Initializes the Bitbucket Cloud Client. ### Parameters #### Path Parameters - **workspace** (string) - Required - The workspace ID for Bitbucket. #### Request Body This method does not accept a request body. #### Other Options - **baseUrl** (string) - Optional - The base URL for the Bitbucket API. - **fetch** (function) - Optional - A custom fetch function. - **headers** (HeadersOptions) - Optional - Custom headers for requests. - **middleware** (Middleware[]) - Optional - Middleware to apply to requests. - **parseAs** (keyof BodyType) - Optional - Specifies how to parse the response body. - **pathSerializer** (PathSerializer) - Optional - Serializer for path parameters. - **querySerializer** (QuerySerializerOptions | QuerySerializer<...>) - Optional - Serializer for query parameters. ### Returns Promise> - A promise that resolves with the fetch response. ``` -------------------------------- ### BitbucketCloudClient Initialization Source: https://coderabbitai.github.io/bitbucket/classes/cloud.BitbucketCloudClient.html Initializes the BitbucketCloudClient with necessary parameters. This method sets up the client for making authenticated requests to the Bitbucket Cloud API. ```APIDOC ## BitbucketCloudClient Constructor ### Description Initializes the BitbucketCloudClient. This is the primary entry point for interacting with the Bitbucket Cloud API. ### Parameters * `init` (object) - Required - Configuration object for the client. * `params` (object) - Parameters for the API request. * `path` (object) - Required - Path parameters. * `selected_user` (string) - The user whose resources will be accessed. * `baseUrl` (string) - Optional - The base URL for the API requests. * `fetch` (function) - Optional - A custom fetch function. * `headers` (object) - Optional - Custom headers for requests. * `middleware` (array) - Optional - Middleware to apply to requests. * `parseAs` (string) - Optional - Specifies how to parse the response. * `pathSerializer` (function) - Optional - Custom path serializer. * `querySerializer` (object) - Optional - Custom query serializer. ### Returns * `Promise>` - A promise that resolves with the fetch response, containing the API data. ### Response Example (200 OK) ```json { "next": "string", "page": number, "pagelen": number, "previous": "string", "size": number, "values": [ { "type": "...", "key": "...", "secured": "...", "uuid": "...", "value": "..." } ] } ``` ```