import { BaseApi } from './base.js'; import type { GetDefaultBranchParams, RestDefaultBranch } from '../types/branch.js'; import type { CheckRepositoryPermissionsParams, CreateRepositoryParams, DeleteRepositoryParams, DownloadAttachmentParams, GetAttachmentMetadataParams, GetRepositoryParams, ListRepositoriesParams, RepositoriesResponse, RepositoryPermissions, RestAttachmentMetadata, RestRepository, UpdateRepositoryParams, UploadAttachmentParams, UploadAttachmentResult } from '../types/repository.js'; /** * Repositories API for Bitbucket Server. * Provides methods for repository-related operations. */ export declare class RepositoriesApi extends BaseApi { /** * List repositories with optional filters. * When projectkey is specified, uses the project-scoped endpoint for * compatibility with Bitbucket Server versions before 8.0. */ list(params?: ListRepositoriesParams): Promise; /** * Get a repository by project key and slug */ get(params: GetRepositoryParams): Promise; /** * Create a new repository in a project. Bitbucket derives the slug from * the name and returns the full repository object on success. */ create(params: CreateRepositoryParams): Promise; /** * Update an existing repository. Only provided fields are sent; * Bitbucket leaves omitted fields unchanged. Renaming the repo causes * Bitbucket to regenerate the slug. */ update(params: UpdateRepositoryParams): Promise; /** * Delete a repository. Bitbucket responds 202 and removes it asynchronously. */ delete(params: DeleteRepositoryParams): Promise; /** * Get the default branch configured for a repository. */ getDefaultBranch(params: GetDefaultBranchParams): Promise; /** * Download an attachment binary from a repository and write it to disk. */ downloadAttachment(params: DownloadAttachmentParams): Promise; /** * Get metadata for a repository attachment. */ getAttachmentMetadata(params: GetAttachmentMetadataParams): Promise; /** * Upload a file as an attachment to a repository. * * IMPORTANT: This uses an undocumented Bitbucket endpoint that is NOT in the official REST API swagger. * The endpoint lives at POST /projects/{key}/repos/{slug}/attachments (no /rest/api/latest/ prefix). * It was discovered by inspecting the Bitbucket UI's network traffic. Atlassian has confirmed it exists * but makes no stability guarantees. It may change without warning in future Bitbucket versions. * * We use axios.create() instead of this.client because the default client sets Content-Type: application/json * in its headers, and Bitbucket's attachment endpoint returns 405 if the Content-Type doesn't match * the multipart/form-data boundary. A clean axios instance avoids this header conflict. */ uploadAttachment(params: UploadAttachmentParams): Promise; /** * Check repository permissions for the authenticated token. * Returns read/write access flags without modifying anything. */ checkPermissions(params: CheckRepositoryPermissionsParams): Promise; } //# sourceMappingURL=repositories.d.ts.map