@gohcltech/bitbucket-mcp
Version:
Bitbucket integration for Claude via Model Context Protocol
221 lines • 7.9 kB
TypeScript
/**
* @fileoverview TypeScript types for Bitbucket repository operations.
*
* This module contains TypeScript interfaces that correspond to repository-related
* entities returned by the Bitbucket API v2.0. Repositories are the core containers
* for source code, documentation, and collaboration features in Bitbucket.
*
* These types are used throughout the MCP server for:
* - Parsing Bitbucket repository API responses
* - Ensuring type safety in repository operations
* - Providing IntelliSense support for repository data structures
* - Validating repository metadata and settings
* - Supporting repository creation, modification, and management workflows
*/
/**
* Bitbucket repository entity representing a source code repository.
*
* A repository is the fundamental unit of version control in Bitbucket,
* containing source code, documentation, issues, and collaboration features.
* Each repository belongs to a workspace and has comprehensive metadata
* including privacy settings, feature toggles, and ownership information.
*
* @example
* ```typescript
* const repository: Repository = {
* uuid: "{a1b2c3d4-e5f6-7890-abcd-ef1234567890}",
* name: "bitbucket-mcp",
* full_name: "gohcl/bitbucket-mcp",
* description: "MCP server for Bitbucket integration",
* is_private: true,
* fork_policy: "no_public_forks",
* created_on: "2025-09-22T10:30:00.000Z",
* updated_on: "2025-09-23T14:22:33.456Z",
* size: 1048576,
* language: "TypeScript",
* has_issues: true,
* has_wiki: false,
* mainbranch: { name: "master" },
* owner: {
* display_name: "Kurt Wolf",
* uuid: "{owner-uuid}"
* },
* workspace: {
* name: "Health Care Logistics",
* slug: "gohcl"
* },
* links: {
* html: {
* href: "https://bitbucket.org/gohcl/bitbucket-mcp"
* },
* clone: [
* {
* name: "https",
* href: "https://kurtwolf@bitbucket.org/gohcl/bitbucket-mcp.git"
* },
* {
* name: "ssh",
* href: "git@bitbucket.org:gohcl/bitbucket-mcp.git"
* }
* ]
* }
* };
* ```
*/
export interface Repository {
/**
* Unique UUID identifier for the repository.
*
* This is the immutable identifier assigned by Bitbucket when the repository
* is created. It remains constant even if the repository name or workspace changes.
* Format: {xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx}
*/
uuid: string;
/**
* Repository name within the workspace.
*
* This is the short name used in URLs and API calls. Must be unique within
* the workspace and follow Bitbucket's repository naming conventions.
* Contains only alphanumeric characters, hyphens, underscores, and dots.
*/
name: string;
/**
* Full repository name including workspace prefix.
*
* Format: workspace-slug/repository-name (e.g., "gohcl/bitbucket-mcp")
* This uniquely identifies the repository across all of Bitbucket and is
* commonly used in git clone URLs and API references.
*/
full_name: string;
/**
* Optional human-readable description of the repository.
*
* Can contain markdown formatting and provides context about the repository's
* purpose, usage, or other relevant information. Displayed in the repository
* overview page and search results.
*/
description?: string;
/**
* Privacy flag indicating repository visibility.
*
* When true, the repository is only accessible to authenticated users with
* explicit permissions. When false, the repository is publicly visible and
* can be cloned by anyone (though write access still requires permissions).
*/
is_private: boolean;
/**
* Policy governing how the repository can be forked.
*
* - 'allow_forks': Anyone can fork the repository
* - 'no_public_forks': Only workspace members can fork
* - 'no_forks': Forking is completely disabled
*/
fork_policy: 'allow_forks' | 'no_public_forks' | 'no_forks';
/**
* ISO 8601 timestamp indicating when the repository was created.
*
* This timestamp is set when the repository is first created and never
* changes. Useful for sorting repositories by age or audit purposes.
*/
created_on: string;
/**
* ISO 8601 timestamp indicating when the repository was last modified.
*
* This timestamp is updated when repository settings, metadata, or content
* changes. Includes pushes, settings changes, and administrative actions.
*/
updated_on: string;
/**
* Total repository size in bytes.
*
* Includes all git objects, files, and history. This size may be approximate
* and is updated periodically by Bitbucket's storage systems.
*/
size: number;
/**
* Primary programming language detected in the repository.
*
* Automatically detected by Bitbucket based on file extensions and content.
* Used for syntax highlighting, search categorization, and statistics.
* May be undefined if no language is detected or the repository is empty.
*/
language?: string;
/**
* Flag indicating whether the issue tracker is enabled.
*
* When true, users can create, view, and manage issues within the repository.
* When false, the issues tab and functionality are disabled.
*/
has_issues: boolean;
/**
* Flag indicating whether the wiki feature is enabled.
*
* When true, users can create and edit wiki pages for documentation.
* When false, the wiki tab and functionality are disabled.
*/
has_wiki: boolean;
/**
* Information about the repository's main/default branch.
*
* This is the branch that's checked out by default when cloning the repository
* and serves as the primary development branch. May be undefined for empty
* repositories that don't have any commits yet.
*/
mainbranch?: {
/** Name of the main branch (e.g., "main", "master", "develop") */
name: string;
};
/**
* Information about the repository owner.
*
* The owner is typically the user who created the repository, though ownership
* can be transferred. In workspace contexts, this often represents the
* individual user within the organization.
*/
owner: {
/** Human-readable display name of the owner */
display_name: string;
/** Unique UUID identifier for the owner */
uuid: string;
};
/**
* Information about the workspace containing this repository.
*
* Every repository belongs to exactly one workspace, which provides
* organizational structure, permissions, and billing context.
*/
workspace: {
/** Human-readable workspace name */
name: string;
/** URL-safe workspace identifier */
slug: string;
};
/**
* Collection of related URLs and clone endpoints for the repository.
*
* Provides direct access to the repository's web interface and various
* clone methods (HTTPS, SSH) for git operations.
*/
links: {
/**
* Direct link to the repository's main page in the Bitbucket web interface.
*/
html: {
/** Full URL to the repository page */
href: string;
};
/**
* Array of clone URLs for different protocols.
*
* Typically includes both HTTPS and SSH clone options, allowing users
* to choose their preferred authentication method.
*/
clone: Array<{
/** Protocol name (e.g., "https", "ssh") */
name: string;
/** Full clone URL for git operations */
href: string;
}>;
};
}
//# sourceMappingURL=types.d.ts.map