@or2ooo/bitbucket-mcp 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +154 -0
- package/dist/bitbucket/client.d.ts +20 -0
- package/dist/bitbucket/client.d.ts.map +1 -0
- package/dist/bitbucket/client.js +123 -0
- package/dist/bitbucket/client.js.map +1 -0
- package/dist/bitbucket/types.d.ts +221 -0
- package/dist/bitbucket/types.d.ts.map +1 -0
- package/dist/bitbucket/types.js +2 -0
- package/dist/bitbucket/types.js.map +1 -0
- package/dist/config.d.ts +11 -0
- package/dist/config.d.ts.map +1 -0
- package/dist/config.js +23 -0
- package/dist/config.js.map +1 -0
- package/dist/formatting.d.ts +21 -0
- package/dist/formatting.d.ts.map +1 -0
- package/dist/formatting.js +156 -0
- package/dist/formatting.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +30 -0
- package/dist/index.js.map +1 -0
- package/dist/safety.d.ts +10 -0
- package/dist/safety.d.ts.map +1 -0
- package/dist/safety.js +43 -0
- package/dist/safety.js.map +1 -0
- package/dist/toolsets/context.d.ts +5 -0
- package/dist/toolsets/context.d.ts.map +1 -0
- package/dist/toolsets/context.js +45 -0
- package/dist/toolsets/context.js.map +1 -0
- package/dist/toolsets/issues.d.ts +5 -0
- package/dist/toolsets/issues.d.ts.map +1 -0
- package/dist/toolsets/issues.js +140 -0
- package/dist/toolsets/issues.js.map +1 -0
- package/dist/toolsets/pipelines.d.ts +5 -0
- package/dist/toolsets/pipelines.d.ts.map +1 -0
- package/dist/toolsets/pipelines.js +125 -0
- package/dist/toolsets/pipelines.js.map +1 -0
- package/dist/toolsets/pullRequests.d.ts +5 -0
- package/dist/toolsets/pullRequests.d.ts.map +1 -0
- package/dist/toolsets/pullRequests.js +398 -0
- package/dist/toolsets/pullRequests.js.map +1 -0
- package/dist/toolsets/repos.d.ts +5 -0
- package/dist/toolsets/repos.d.ts.map +1 -0
- package/dist/toolsets/repos.js +221 -0
- package/dist/toolsets/repos.js.map +1 -0
- package/package.json +40 -0
package/LICENSE
ADDED
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
MIT License
|
|
2
|
+
|
|
3
|
+
Copyright (c) 2026 Or Booky
|
|
4
|
+
|
|
5
|
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
|
6
|
+
of this software and associated documentation files (the "Software"), to deal
|
|
7
|
+
in the Software without restriction, including without limitation the rights
|
|
8
|
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
|
9
|
+
copies of the Software, and to permit persons to whom the Software is
|
|
10
|
+
furnished to do so, subject to the following conditions:
|
|
11
|
+
|
|
12
|
+
The above copyright notice and this permission notice shall be included in all
|
|
13
|
+
copies or substantial portions of the Software.
|
|
14
|
+
|
|
15
|
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
|
16
|
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
|
17
|
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
|
18
|
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
|
19
|
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
|
20
|
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
|
|
21
|
+
SOFTWARE.
|
package/README.md
ADDED
|
@@ -0,0 +1,154 @@
|
|
|
1
|
+
# Bitbucket Cloud MCP Server
|
|
2
|
+
|
|
3
|
+
A Model Context Protocol (MCP) server for the Bitbucket Cloud REST API v2.0, designed for Claude Code integration. Provides 26 tools across 5 toolsets with safety controls and compact LLM-optimized output.
|
|
4
|
+
|
|
5
|
+
## Setup
|
|
6
|
+
|
|
7
|
+
### Prerequisites
|
|
8
|
+
|
|
9
|
+
- Node.js v24+
|
|
10
|
+
- Atlassian API token (see below)
|
|
11
|
+
|
|
12
|
+
### Create an API Token
|
|
13
|
+
|
|
14
|
+
1. Go to [Atlassian API Tokens](https://id.atlassian.com/manage-profile/security/api-tokens)
|
|
15
|
+
2. Click **"Create API token with scopes"**
|
|
16
|
+
3. Name the token (e.g., "Bitbucket MCP") and set expiration
|
|
17
|
+
4. Select app: **Bitbucket**
|
|
18
|
+
5. Enable the scopes listed below
|
|
19
|
+
6. Click **Create** and copy the token
|
|
20
|
+
|
|
21
|
+
**Read-only scopes** (6 scopes — sufficient when using `BITBUCKET_READONLY=true`):
|
|
22
|
+
|
|
23
|
+
| Scope | Enables |
|
|
24
|
+
|-------|---------|
|
|
25
|
+
| `read:user:bitbucket` | `bb_whoami` |
|
|
26
|
+
| `read:workspace:bitbucket` | `bb_list_workspaces` |
|
|
27
|
+
| `read:repository:bitbucket` | `bb_list_repositories`, `bb_get_repository`, `bb_list_branches`, `bb_list_commits`, `bb_get_file` |
|
|
28
|
+
| `read:pullrequest:bitbucket` | `bb_list_pull_requests`, `bb_get_pull_request`, `bb_get_pull_request_diff`, `bb_get_pull_request_diffstat`, `bb_list_pull_request_activity` |
|
|
29
|
+
| `read:issue:bitbucket` | `bb_list_issues`, `bb_get_issue` |
|
|
30
|
+
| `read:pipeline:bitbucket` | `bb_list_pipelines`, `bb_get_pipeline` |
|
|
31
|
+
|
|
32
|
+
**Write scopes** (add these 4 for full access):
|
|
33
|
+
|
|
34
|
+
| Scope | Enables |
|
|
35
|
+
|-------|---------|
|
|
36
|
+
| `write:repository:bitbucket` | `bb_create_commit_files` |
|
|
37
|
+
| `write:pullrequest:bitbucket` | `bb_create_pull_request`, `bb_add_pull_request_comment`, `bb_approve_pull_request`, `bb_request_changes_pull_request`, `bb_merge_pull_request`, `bb_decline_pull_request` |
|
|
38
|
+
| `write:issue:bitbucket` | `bb_create_issue`, `bb_comment_issue` |
|
|
39
|
+
| `write:pipeline:bitbucket` | `bb_trigger_pipeline` |
|
|
40
|
+
|
|
41
|
+
### Add to Claude Code
|
|
42
|
+
|
|
43
|
+
One command — no clone or build needed:
|
|
44
|
+
|
|
45
|
+
```bash
|
|
46
|
+
claude mcp add bitbucket \
|
|
47
|
+
-e ATLASSIAN_USER_EMAIL=your-email@example.com \
|
|
48
|
+
-e ATLASSIAN_API_TOKEN=your-api-token \
|
|
49
|
+
-e BITBUCKET_DEFAULT_WORKSPACE=your-workspace \
|
|
50
|
+
-e BITBUCKET_READONLY=false \
|
|
51
|
+
-- npx -y @or2ooo/bitbucket-mcp@latest
|
|
52
|
+
```
|
|
53
|
+
|
|
54
|
+
Verify with:
|
|
55
|
+
```bash
|
|
56
|
+
claude mcp list
|
|
57
|
+
```
|
|
58
|
+
|
|
59
|
+
<details>
|
|
60
|
+
<summary>From source (for development)</summary>
|
|
61
|
+
|
|
62
|
+
```bash
|
|
63
|
+
git clone https://github.com/or2ooo/bitbucket-mcp.git
|
|
64
|
+
cd bitbucket-mcp
|
|
65
|
+
npm install && npm run build
|
|
66
|
+
|
|
67
|
+
claude mcp add bitbucket \
|
|
68
|
+
-e ATLASSIAN_USER_EMAIL=your-email@example.com \
|
|
69
|
+
-e ATLASSIAN_API_TOKEN=your-api-token \
|
|
70
|
+
-e BITBUCKET_DEFAULT_WORKSPACE=your-workspace \
|
|
71
|
+
-e BITBUCKET_READONLY=true \
|
|
72
|
+
-- node $(pwd)/dist/index.js
|
|
73
|
+
```
|
|
74
|
+
|
|
75
|
+
</details>
|
|
76
|
+
|
|
77
|
+
## Environment Variables
|
|
78
|
+
|
|
79
|
+
| Variable | Required | Description |
|
|
80
|
+
|----------|----------|-------------|
|
|
81
|
+
| `ATLASSIAN_USER_EMAIL` | Yes | Atlassian account email |
|
|
82
|
+
| `ATLASSIAN_API_TOKEN` | Yes | Atlassian API token (see [Create an API Token](#create-an-api-token)) |
|
|
83
|
+
| `BITBUCKET_DEFAULT_WORKSPACE` | No | Default workspace slug |
|
|
84
|
+
| `BITBUCKET_ALLOWED_WORKSPACES` | No | Comma-separated allowlist of workspace slugs |
|
|
85
|
+
| `BITBUCKET_ALLOWED_REPOS` | No | Comma-separated allowlist (`slug` or `workspace/slug`) |
|
|
86
|
+
| `BITBUCKET_READONLY` | No | `true` to block all write operations |
|
|
87
|
+
| `BITBUCKET_BASE_URL` | No | Override API base URL |
|
|
88
|
+
|
|
89
|
+
## Safety Controls
|
|
90
|
+
|
|
91
|
+
- **Readonly mode**: Set `BITBUCKET_READONLY=true` to prevent any write operations.
|
|
92
|
+
- **Workspace allowlist**: Restrict access to specific workspaces.
|
|
93
|
+
- **Repository allowlist**: Restrict access to specific repositories.
|
|
94
|
+
- **Destructive action confirmation**: Merge and decline PR tools require explicit `confirm: true`.
|
|
95
|
+
|
|
96
|
+
## Tool Reference
|
|
97
|
+
|
|
98
|
+
### Context (2 tools)
|
|
99
|
+
| Tool | Description |
|
|
100
|
+
|------|-------------|
|
|
101
|
+
| `bb_whoami` | Get current authenticated user |
|
|
102
|
+
| `bb_list_workspaces` | List accessible workspaces |
|
|
103
|
+
|
|
104
|
+
### Repositories (6 tools)
|
|
105
|
+
| Tool | Description |
|
|
106
|
+
|------|-------------|
|
|
107
|
+
| `bb_list_repositories` | List repositories in a workspace |
|
|
108
|
+
| `bb_get_repository` | Get repository details |
|
|
109
|
+
| `bb_list_branches` | List branches |
|
|
110
|
+
| `bb_list_commits` | List commits (optionally for a branch/tag) |
|
|
111
|
+
| `bb_get_file` | Get file content at a specific revision |
|
|
112
|
+
| `bb_create_commit_files` | Create a commit with file changes (write) |
|
|
113
|
+
|
|
114
|
+
### Pull Requests (11 tools)
|
|
115
|
+
| Tool | Description |
|
|
116
|
+
|------|-------------|
|
|
117
|
+
| `bb_list_pull_requests` | List PRs with optional state filter |
|
|
118
|
+
| `bb_get_pull_request` | Get PR details |
|
|
119
|
+
| `bb_create_pull_request` | Create a new PR (write) |
|
|
120
|
+
| `bb_get_pull_request_diff` | Get PR diff (raw text) |
|
|
121
|
+
| `bb_get_pull_request_diffstat` | Get PR diffstat summary |
|
|
122
|
+
| `bb_list_pull_request_activity` | List PR activity (comments, approvals, updates) |
|
|
123
|
+
| `bb_add_pull_request_comment` | Add a comment to a PR (write) |
|
|
124
|
+
| `bb_approve_pull_request` | Approve a PR (write) |
|
|
125
|
+
| `bb_request_changes_pull_request` | Request changes on a PR (write) |
|
|
126
|
+
| `bb_merge_pull_request` | Merge a PR (destructive, requires confirm) |
|
|
127
|
+
| `bb_decline_pull_request` | Decline a PR (destructive, requires confirm) |
|
|
128
|
+
|
|
129
|
+
### Issues (4 tools)
|
|
130
|
+
| Tool | Description |
|
|
131
|
+
|------|-------------|
|
|
132
|
+
| `bb_list_issues` | List issues with optional query |
|
|
133
|
+
| `bb_get_issue` | Get issue details |
|
|
134
|
+
| `bb_create_issue` | Create a new issue (write) |
|
|
135
|
+
| `bb_comment_issue` | Add a comment to an issue (write) |
|
|
136
|
+
|
|
137
|
+
### Pipelines (3 tools)
|
|
138
|
+
| Tool | Description |
|
|
139
|
+
|------|-------------|
|
|
140
|
+
| `bb_list_pipelines` | List recent pipelines |
|
|
141
|
+
| `bb_get_pipeline` | Get pipeline details |
|
|
142
|
+
| `bb_trigger_pipeline` | Trigger a pipeline run (write) |
|
|
143
|
+
|
|
144
|
+
## Development
|
|
145
|
+
|
|
146
|
+
```bash
|
|
147
|
+
npm test # Run tests
|
|
148
|
+
npm run lint # Lint
|
|
149
|
+
npm run build # Compile
|
|
150
|
+
```
|
|
151
|
+
|
|
152
|
+
## License
|
|
153
|
+
|
|
154
|
+
MIT
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
import { Config } from "../config.js";
|
|
2
|
+
export declare class BitbucketApiError extends Error {
|
|
3
|
+
statusCode: number;
|
|
4
|
+
constructor(statusCode: number, message: string);
|
|
5
|
+
}
|
|
6
|
+
export declare class BitbucketClient {
|
|
7
|
+
private authHeader;
|
|
8
|
+
private baseUrl;
|
|
9
|
+
private timeout;
|
|
10
|
+
constructor(config: Config, timeout?: number);
|
|
11
|
+
private request;
|
|
12
|
+
get<T>(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<T>;
|
|
13
|
+
getRaw(path: string, params?: Record<string, string | number | boolean | undefined>): Promise<string>;
|
|
14
|
+
post<T>(path: string, body?: unknown): Promise<T>;
|
|
15
|
+
put<T>(path: string, body?: unknown): Promise<T>;
|
|
16
|
+
del<T>(path: string): Promise<T>;
|
|
17
|
+
postFormData<T>(path: string, formData: FormData): Promise<T>;
|
|
18
|
+
paginateAll<T>(path: string, params?: Record<string, string | number | boolean | undefined>, maxPages?: number): Promise<T[]>;
|
|
19
|
+
}
|
|
20
|
+
//# sourceMappingURL=client.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.d.ts","sourceRoot":"","sources":["../../src/bitbucket/client.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,cAAc,CAAC;AAGtC,qBAAa,iBAAkB,SAAQ,KAAK;IAEjC,UAAU,EAAE,MAAM;gBAAlB,UAAU,EAAE,MAAM,EACzB,OAAO,EAAE,MAAM;CAKlB;AAED,qBAAa,eAAe;IAC1B,OAAO,CAAC,UAAU,CAAS;IAC3B,OAAO,CAAC,OAAO,CAAS;IACxB,OAAO,CAAC,OAAO,CAAS;gBAEZ,MAAM,EAAE,MAAM,EAAE,OAAO,SAAQ;YAM7B,OAAO;IAuFf,GAAG,CAAC,CAAC,EACT,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAC7D,OAAO,CAAC,CAAC,CAAC;IAIP,MAAM,CACV,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,GAC7D,OAAO,CAAC,MAAM,CAAC;IAIZ,IAAI,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIjD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,IAAI,CAAC,EAAE,OAAO,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhD,GAAG,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAIhC,YAAY,CAAC,CAAC,EAAE,IAAI,EAAE,MAAM,EAAE,QAAQ,EAAE,QAAQ,GAAG,OAAO,CAAC,CAAC,CAAC;IAI7D,WAAW,CAAC,CAAC,EACjB,IAAI,EAAE,MAAM,EACZ,MAAM,CAAC,EAAE,MAAM,CAAC,MAAM,EAAE,MAAM,GAAG,MAAM,GAAG,OAAO,GAAG,SAAS,CAAC,EAC9D,QAAQ,SAAK,GACZ,OAAO,CAAC,CAAC,EAAE,CAAC;CAwBhB"}
|
|
@@ -0,0 +1,123 @@
|
|
|
1
|
+
export class BitbucketApiError extends Error {
|
|
2
|
+
statusCode;
|
|
3
|
+
constructor(statusCode, message) {
|
|
4
|
+
super(message);
|
|
5
|
+
this.statusCode = statusCode;
|
|
6
|
+
this.name = "BitbucketApiError";
|
|
7
|
+
}
|
|
8
|
+
}
|
|
9
|
+
export class BitbucketClient {
|
|
10
|
+
authHeader;
|
|
11
|
+
baseUrl;
|
|
12
|
+
timeout;
|
|
13
|
+
constructor(config, timeout = 30000) {
|
|
14
|
+
this.authHeader = `Basic ${btoa(config.email + ":" + config.apiToken)}`;
|
|
15
|
+
this.baseUrl = config.baseUrl.replace(/\/+$/, "");
|
|
16
|
+
this.timeout = timeout;
|
|
17
|
+
}
|
|
18
|
+
async request(method, path, options = {}) {
|
|
19
|
+
let url;
|
|
20
|
+
if (path.startsWith("http://") || path.startsWith("https://")) {
|
|
21
|
+
url = path;
|
|
22
|
+
}
|
|
23
|
+
else {
|
|
24
|
+
url = `${this.baseUrl}${path.startsWith("/") ? "" : "/"}${path}`;
|
|
25
|
+
}
|
|
26
|
+
if (options.params) {
|
|
27
|
+
const searchParams = new URLSearchParams();
|
|
28
|
+
for (const [key, value] of Object.entries(options.params)) {
|
|
29
|
+
if (value !== undefined) {
|
|
30
|
+
searchParams.set(key, String(value));
|
|
31
|
+
}
|
|
32
|
+
}
|
|
33
|
+
const qs = searchParams.toString();
|
|
34
|
+
if (qs)
|
|
35
|
+
url += `?${qs}`;
|
|
36
|
+
}
|
|
37
|
+
const headers = {
|
|
38
|
+
Authorization: this.authHeader,
|
|
39
|
+
};
|
|
40
|
+
let bodyPayload;
|
|
41
|
+
if (options.formData) {
|
|
42
|
+
bodyPayload = options.formData;
|
|
43
|
+
}
|
|
44
|
+
else if (options.body !== undefined) {
|
|
45
|
+
headers["Content-Type"] = "application/json";
|
|
46
|
+
bodyPayload = JSON.stringify(options.body);
|
|
47
|
+
}
|
|
48
|
+
const controller = new AbortController();
|
|
49
|
+
const timeoutId = setTimeout(() => controller.abort(), this.timeout);
|
|
50
|
+
try {
|
|
51
|
+
const response = await fetch(url, {
|
|
52
|
+
method,
|
|
53
|
+
headers,
|
|
54
|
+
body: bodyPayload,
|
|
55
|
+
signal: controller.signal,
|
|
56
|
+
});
|
|
57
|
+
if (!response.ok) {
|
|
58
|
+
const text = await response.text();
|
|
59
|
+
const truncated = text.length > 2000 ? text.substring(0, 2000) + "..." : text;
|
|
60
|
+
throw new BitbucketApiError(response.status, `Bitbucket API error ${response.status}: ${truncated}`);
|
|
61
|
+
}
|
|
62
|
+
if (options.rawResponse) {
|
|
63
|
+
const text = await response.text();
|
|
64
|
+
return text;
|
|
65
|
+
}
|
|
66
|
+
const contentType = response.headers.get("content-type") || "";
|
|
67
|
+
if (contentType.includes("application/json")) {
|
|
68
|
+
return (await response.json());
|
|
69
|
+
}
|
|
70
|
+
const text = await response.text();
|
|
71
|
+
return text;
|
|
72
|
+
}
|
|
73
|
+
catch (error) {
|
|
74
|
+
if (error instanceof BitbucketApiError)
|
|
75
|
+
throw error;
|
|
76
|
+
if (error instanceof DOMException && error.name === "AbortError") {
|
|
77
|
+
throw new BitbucketApiError(408, "Request timed out");
|
|
78
|
+
}
|
|
79
|
+
throw new BitbucketApiError(0, `Network error: ${error instanceof Error ? error.message : String(error)}`);
|
|
80
|
+
}
|
|
81
|
+
finally {
|
|
82
|
+
clearTimeout(timeoutId);
|
|
83
|
+
}
|
|
84
|
+
}
|
|
85
|
+
async get(path, params) {
|
|
86
|
+
return this.request("GET", path, { params });
|
|
87
|
+
}
|
|
88
|
+
async getRaw(path, params) {
|
|
89
|
+
return this.request("GET", path, { params, rawResponse: true });
|
|
90
|
+
}
|
|
91
|
+
async post(path, body) {
|
|
92
|
+
return this.request("POST", path, { body });
|
|
93
|
+
}
|
|
94
|
+
async put(path, body) {
|
|
95
|
+
return this.request("PUT", path, { body });
|
|
96
|
+
}
|
|
97
|
+
async del(path) {
|
|
98
|
+
return this.request("DELETE", path);
|
|
99
|
+
}
|
|
100
|
+
async postFormData(path, formData) {
|
|
101
|
+
return this.request("POST", path, { formData });
|
|
102
|
+
}
|
|
103
|
+
async paginateAll(path, params, maxPages = 10) {
|
|
104
|
+
const allValues = [];
|
|
105
|
+
let currentPath = path;
|
|
106
|
+
let currentParams = params;
|
|
107
|
+
let page = 0;
|
|
108
|
+
while (currentPath && page < maxPages) {
|
|
109
|
+
const response = await this.get(currentPath, currentParams);
|
|
110
|
+
allValues.push(...response.values);
|
|
111
|
+
if (response.next) {
|
|
112
|
+
currentPath = response.next;
|
|
113
|
+
currentParams = undefined; // next URL includes params
|
|
114
|
+
}
|
|
115
|
+
else {
|
|
116
|
+
break;
|
|
117
|
+
}
|
|
118
|
+
page++;
|
|
119
|
+
}
|
|
120
|
+
return allValues;
|
|
121
|
+
}
|
|
122
|
+
}
|
|
123
|
+
//# sourceMappingURL=client.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"client.js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,CAAC,MAAM,CAAC,CAAC;YAEnC,IAAI,QAAQ,CAAC,IAAI,EAAE,CAAC;gBAClB,WAAW,GAAG,QAAQ,CAAC,IAAI,CAAC;gBAC5B,aAAa,GAAG,SAAS,CAAC,CAAC,2BAA2B;YACxD,CAAC;iBAAM,CAAC;gBACN,MAAM;YACR,CAAC;YACD,IAAI,EAAE,CAAC;QACT,CAAC;QAED,OAAO,SAAS,CAAC;IACnB,CAAC;CACF"}
|
|
@@ -0,0 +1,221 @@
|
|
|
1
|
+
export interface PaginatedResponse<T> {
|
|
2
|
+
values: T[];
|
|
3
|
+
next?: string;
|
|
4
|
+
page: number;
|
|
5
|
+
size: number;
|
|
6
|
+
pagelen: number;
|
|
7
|
+
}
|
|
8
|
+
export interface Link {
|
|
9
|
+
href: string;
|
|
10
|
+
name?: string;
|
|
11
|
+
}
|
|
12
|
+
export interface Links {
|
|
13
|
+
self?: Link;
|
|
14
|
+
html?: Link;
|
|
15
|
+
avatar?: Link;
|
|
16
|
+
[key: string]: Link | undefined;
|
|
17
|
+
}
|
|
18
|
+
export interface User {
|
|
19
|
+
display_name: string;
|
|
20
|
+
uuid: string;
|
|
21
|
+
nickname: string;
|
|
22
|
+
account_id?: string;
|
|
23
|
+
links?: Links;
|
|
24
|
+
type: string;
|
|
25
|
+
}
|
|
26
|
+
export interface Workspace {
|
|
27
|
+
uuid: string;
|
|
28
|
+
name: string;
|
|
29
|
+
slug: string;
|
|
30
|
+
links?: Links;
|
|
31
|
+
type: string;
|
|
32
|
+
}
|
|
33
|
+
export interface Project {
|
|
34
|
+
key: string;
|
|
35
|
+
name: string;
|
|
36
|
+
uuid: string;
|
|
37
|
+
type: string;
|
|
38
|
+
}
|
|
39
|
+
export interface Repository {
|
|
40
|
+
uuid: string;
|
|
41
|
+
name: string;
|
|
42
|
+
full_name: string;
|
|
43
|
+
slug: string;
|
|
44
|
+
description: string;
|
|
45
|
+
is_private: boolean;
|
|
46
|
+
language: string;
|
|
47
|
+
created_on: string;
|
|
48
|
+
updated_on: string;
|
|
49
|
+
size: number;
|
|
50
|
+
mainbranch?: {
|
|
51
|
+
name: string;
|
|
52
|
+
type: string;
|
|
53
|
+
};
|
|
54
|
+
project?: Project;
|
|
55
|
+
links?: Links;
|
|
56
|
+
type: string;
|
|
57
|
+
}
|
|
58
|
+
export interface Branch {
|
|
59
|
+
name: string;
|
|
60
|
+
target: Commit;
|
|
61
|
+
type: string;
|
|
62
|
+
}
|
|
63
|
+
export interface Commit {
|
|
64
|
+
hash: string;
|
|
65
|
+
message: string;
|
|
66
|
+
date: string;
|
|
67
|
+
author: {
|
|
68
|
+
raw: string;
|
|
69
|
+
user?: User;
|
|
70
|
+
};
|
|
71
|
+
parents?: {
|
|
72
|
+
hash: string;
|
|
73
|
+
}[];
|
|
74
|
+
type: string;
|
|
75
|
+
}
|
|
76
|
+
export interface Participant {
|
|
77
|
+
user: User;
|
|
78
|
+
role: string;
|
|
79
|
+
approved: boolean;
|
|
80
|
+
state: string | null;
|
|
81
|
+
}
|
|
82
|
+
export interface PullRequest {
|
|
83
|
+
id: number;
|
|
84
|
+
title: string;
|
|
85
|
+
description: string;
|
|
86
|
+
state: string;
|
|
87
|
+
author: User;
|
|
88
|
+
source: {
|
|
89
|
+
branch: {
|
|
90
|
+
name: string;
|
|
91
|
+
};
|
|
92
|
+
repository?: {
|
|
93
|
+
full_name: string;
|
|
94
|
+
};
|
|
95
|
+
};
|
|
96
|
+
destination: {
|
|
97
|
+
branch: {
|
|
98
|
+
name: string;
|
|
99
|
+
};
|
|
100
|
+
repository?: {
|
|
101
|
+
full_name: string;
|
|
102
|
+
};
|
|
103
|
+
};
|
|
104
|
+
merge_commit?: {
|
|
105
|
+
hash: string;
|
|
106
|
+
};
|
|
107
|
+
close_source_branch: boolean;
|
|
108
|
+
created_on: string;
|
|
109
|
+
updated_on: string;
|
|
110
|
+
comment_count: number;
|
|
111
|
+
task_count: number;
|
|
112
|
+
reason: string;
|
|
113
|
+
participants: Participant[];
|
|
114
|
+
reviewers: User[];
|
|
115
|
+
links?: Links;
|
|
116
|
+
type: string;
|
|
117
|
+
}
|
|
118
|
+
export interface PullRequestComment {
|
|
119
|
+
id: number;
|
|
120
|
+
content: {
|
|
121
|
+
raw: string;
|
|
122
|
+
markup: string;
|
|
123
|
+
html: string;
|
|
124
|
+
};
|
|
125
|
+
created_on: string;
|
|
126
|
+
updated_on: string;
|
|
127
|
+
user: User;
|
|
128
|
+
inline?: {
|
|
129
|
+
path: string;
|
|
130
|
+
from?: number | null;
|
|
131
|
+
to?: number | null;
|
|
132
|
+
};
|
|
133
|
+
parent?: {
|
|
134
|
+
id: number;
|
|
135
|
+
};
|
|
136
|
+
deleted: boolean;
|
|
137
|
+
type: string;
|
|
138
|
+
}
|
|
139
|
+
export interface PullRequestActivity {
|
|
140
|
+
approval?: any;
|
|
141
|
+
update?: {
|
|
142
|
+
state: string;
|
|
143
|
+
title: string;
|
|
144
|
+
date: string;
|
|
145
|
+
author: User;
|
|
146
|
+
};
|
|
147
|
+
comment?: PullRequestComment;
|
|
148
|
+
}
|
|
149
|
+
export interface DiffStatEntry {
|
|
150
|
+
status: string;
|
|
151
|
+
old?: {
|
|
152
|
+
path: string;
|
|
153
|
+
};
|
|
154
|
+
new?: {
|
|
155
|
+
path: string;
|
|
156
|
+
};
|
|
157
|
+
lines_added: number;
|
|
158
|
+
lines_removed: number;
|
|
159
|
+
type: string;
|
|
160
|
+
}
|
|
161
|
+
export interface Issue {
|
|
162
|
+
id: number;
|
|
163
|
+
title: string;
|
|
164
|
+
state: string;
|
|
165
|
+
priority: string;
|
|
166
|
+
kind: string;
|
|
167
|
+
content: {
|
|
168
|
+
raw: string;
|
|
169
|
+
markup: string;
|
|
170
|
+
html: string;
|
|
171
|
+
};
|
|
172
|
+
reporter: User;
|
|
173
|
+
assignee?: User;
|
|
174
|
+
created_on: string;
|
|
175
|
+
updated_on: string;
|
|
176
|
+
votes: number;
|
|
177
|
+
watches: number;
|
|
178
|
+
links?: Links;
|
|
179
|
+
type: string;
|
|
180
|
+
}
|
|
181
|
+
export interface IssueComment {
|
|
182
|
+
id: number;
|
|
183
|
+
content: {
|
|
184
|
+
raw: string;
|
|
185
|
+
markup: string;
|
|
186
|
+
html: string;
|
|
187
|
+
};
|
|
188
|
+
created_on: string;
|
|
189
|
+
updated_on: string;
|
|
190
|
+
user: User;
|
|
191
|
+
type: string;
|
|
192
|
+
}
|
|
193
|
+
export interface PipelineTarget {
|
|
194
|
+
ref_type?: string;
|
|
195
|
+
ref_name?: string;
|
|
196
|
+
selector?: {
|
|
197
|
+
type: string;
|
|
198
|
+
pattern: string;
|
|
199
|
+
};
|
|
200
|
+
type: string;
|
|
201
|
+
}
|
|
202
|
+
export interface Pipeline {
|
|
203
|
+
uuid: string;
|
|
204
|
+
build_number: number;
|
|
205
|
+
state: {
|
|
206
|
+
name: string;
|
|
207
|
+
result?: {
|
|
208
|
+
name: string;
|
|
209
|
+
};
|
|
210
|
+
stage?: {
|
|
211
|
+
name: string;
|
|
212
|
+
};
|
|
213
|
+
};
|
|
214
|
+
target: PipelineTarget;
|
|
215
|
+
creator: User;
|
|
216
|
+
created_on: string;
|
|
217
|
+
completed_on?: string;
|
|
218
|
+
duration_in_seconds?: number;
|
|
219
|
+
type: string;
|
|
220
|
+
}
|
|
221
|
+
//# sourceMappingURL=types.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.d.ts","sourceRoot":"","sources":["../../src/bitbucket/types.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,iBAAiB,CAAC,CAAC;IAClC,MAAM,EAAE,CAAC,EAAE,CAAC;IACZ,IAAI,CAAC,EAAE,MAAM,CAAC;IACd,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,EAAE,MAAM,CAAC;IACb,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,MAAM,WAAW,IAAI;IACnB,IAAI,EAAE,MAAM,CAAC;IACb,IAAI,CAAC,EAAE,MAAM,CAAC;CACf;AAED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AM,CAAC;IACb,YAAY,EAAE,MAAM,CAAC;IACrB,KAAK,EAAE;QACL,IAAI,EAAE,MAAM,CAAC;QACb,MAAM,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;QAC1B,KAAK,CAAC,EAAE;YAAE,IAAI,EAAE,MAAM,CAAA;SAAE,CAAC;KAC1B,CAAC;IACF,MAAM,EAAE,cAAc,CAAC;IACvB,OAAO,EAAE,IAAI,CAAC;IACd,UAAU,EAAE,MAAM,CAAC;IACnB,YAAY,CAAC,EAAE,MAAM,CAAC;IACtB,mBAAmB,CAAC,EAAE,MAAM,CAAC;IAC7B,IAAI,EAAE,MAAM,CAAC;CACd"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"types.js","sourceRoot":"","sources":["../../src/bitbucket/types.ts"],"names":[],"mappings":""}
|
package/dist/config.d.ts
ADDED
|
@@ -0,0 +1,11 @@
|
|
|
1
|
+
export interface Config {
|
|
2
|
+
email: string;
|
|
3
|
+
apiToken: string;
|
|
4
|
+
defaultWorkspace: string | undefined;
|
|
5
|
+
allowedWorkspaces: string[] | undefined;
|
|
6
|
+
allowedRepos: string[] | undefined;
|
|
7
|
+
readonly: boolean;
|
|
8
|
+
baseUrl: string;
|
|
9
|
+
}
|
|
10
|
+
export declare function loadConfig(): Config;
|
|
11
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,MAAM,WAAW,MAAM;IACrB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;IACjB,gBAAgB,EAAE,MAAM,GAAG,SAAS,CAAC;IACrC,iBAAiB,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACxC,YAAY,EAAE,MAAM,EAAE,GAAG,SAAS,CAAC;IACnC,QAAQ,EAAE,OAAO,CAAC;IAClB,OAAO,EAAE,MAAM,CAAC;CACjB;AAED,wBAAgB,UAAU,IAAI,MAAM,CA2BnC"}
|
package/dist/config.js
ADDED
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
export function loadConfig() {
|
|
2
|
+
const email = process.env.ATLASSIAN_USER_EMAIL;
|
|
3
|
+
const apiToken = process.env.ATLASSIAN_API_TOKEN;
|
|
4
|
+
if (!email || !apiToken) {
|
|
5
|
+
throw new Error("ATLASSIAN_USER_EMAIL and ATLASSIAN_API_TOKEN environment variables are required");
|
|
6
|
+
}
|
|
7
|
+
const allowedWorkspacesRaw = process.env.BITBUCKET_ALLOWED_WORKSPACES;
|
|
8
|
+
const allowedReposRaw = process.env.BITBUCKET_ALLOWED_REPOS;
|
|
9
|
+
return {
|
|
10
|
+
email,
|
|
11
|
+
apiToken,
|
|
12
|
+
defaultWorkspace: process.env.BITBUCKET_DEFAULT_WORKSPACE || undefined,
|
|
13
|
+
allowedWorkspaces: allowedWorkspacesRaw
|
|
14
|
+
? allowedWorkspacesRaw.split(",").map((s) => s.trim().toLowerCase())
|
|
15
|
+
: undefined,
|
|
16
|
+
allowedRepos: allowedReposRaw
|
|
17
|
+
? allowedReposRaw.split(",").map((s) => s.trim().toLowerCase())
|
|
18
|
+
: undefined,
|
|
19
|
+
readonly: process.env.BITBUCKET_READONLY === "true",
|
|
20
|
+
baseUrl: process.env.BITBUCKET_BASE_URL || "https://api.bitbucket.org/2.0",
|
|
21
|
+
};
|
|
22
|
+
}
|
|
23
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAUA,MAAM,UAAU,UAAU;IACxB,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,oBAAoB,CAAC;IAC/C,MAAM,QAAQ,GAAG,OAAO,CAAC,GAAG,CAAC,mBAAmB,CAAC;IAEjD,IAAI,CAAC,KAAK,IAAI,CAAC,QAAQ,EAAE,CAAC;QACxB,MAAM,IAAI,KAAK,CACb,iFAAiF,CAClF,CAAC;IACJ,CAAC;IAED,MAAM,oBAAoB,GAAG,OAAO,CAAC,GAAG,CAAC,4BAA4B,CAAC;IACtE,MAAM,eAAe,GAAG,OAAO,CAAC,GAAG,CAAC,uBAAuB,CAAC;IAE5D,OAAO;QACL,KAAK;QACL,QAAQ;QACR,gBAAgB,EAAE,OAAO,CAAC,GAAG,CAAC,2BAA2B,IAAI,SAAS;QACtE,iBAAiB,EAAE,oBAAoB;YACrC,CAAC,CAAC,oBAAoB,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YACpE,CAAC,CAAC,SAAS;QACb,YAAY,EAAE,eAAe;YAC3B,CAAC,CAAC,eAAe,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,GAAG,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,CAAC,CAAC,IAAI,EAAE,CAAC,WAAW,EAAE,CAAC;YAC/D,CAAC,CAAC,SAAS;QACb,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,kBAAkB,KAAK,MAAM;QACnD,OAAO,EACL,OAAO,CAAC,GAAG,CAAC,kBAAkB,IAAI,+BAA+B;KACpE,CAAC;AACJ,CAAC"}
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
import type { User, Workspace, Repository, Branch, Commit, PullRequest, PullRequestComment, PullRequestActivity, DiffStatEntry, Issue, IssueComment, Pipeline } from "./bitbucket/types.js";
|
|
2
|
+
export declare function formatUser(user: User): string;
|
|
3
|
+
export declare function formatWorkspace(ws: Workspace): string;
|
|
4
|
+
export declare function formatWorkspaceList(workspaces: Workspace[]): string;
|
|
5
|
+
export declare function formatRepository(repo: Repository): string;
|
|
6
|
+
export declare function formatRepositoryList(repos: Repository[]): string;
|
|
7
|
+
export declare function formatBranch(branch: Branch): string;
|
|
8
|
+
export declare function formatBranchList(branches: Branch[]): string;
|
|
9
|
+
export declare function formatCommit(commit: Commit): string;
|
|
10
|
+
export declare function formatCommitList(commits: Commit[]): string;
|
|
11
|
+
export declare function formatPullRequest(pr: PullRequest): string;
|
|
12
|
+
export declare function formatPullRequestList(prs: PullRequest[]): string;
|
|
13
|
+
export declare function formatPRComment(comment: PullRequestComment): string;
|
|
14
|
+
export declare function formatPRActivity(activities: PullRequestActivity[]): string;
|
|
15
|
+
export declare function formatDiffStat(entries: DiffStatEntry[]): string;
|
|
16
|
+
export declare function formatIssue(issue: Issue): string;
|
|
17
|
+
export declare function formatIssueList(issues: Issue[]): string;
|
|
18
|
+
export declare function formatIssueComment(comment: IssueComment): string;
|
|
19
|
+
export declare function formatPipeline(pipeline: Pipeline): string;
|
|
20
|
+
export declare function formatPipelineList(pipelines: Pipeline[]): string;
|
|
21
|
+
//# sourceMappingURL=formatting.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"formatting.d.ts","sourceRoot":"","sources":["../src/formatting.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EACV,IAAI,EACJ,SAAS,EACT,UAAU,EACV,MAAM,EACN,MAAM,EACN,WAAW,EACX,kBAAkB,EAClB,mBAAmB,EACnB,aAAa,EACb,KAAK,EACL,YAAY,EACZ,QAAQ,EAET,MAAM,sBAAsB,CAAC;AAE9B,wBAAgB,UAAU,CAAC,IAAI,EAAE,IAAI,GAAG,MAAM,CAE7C;AAED,wBAAgB,eAAe,CAAC,EAAE,EAAE,SAAS,GAAG,MAAM,CAErD;AAED,wBAAgB,mBAAmB,CAAC,UAAU,EAAE,SAAS,EAAE,GAAG,MAAM,CAGnE;AAED,wBAAgB,gBAAgB,CAAC,IAAI,EAAE,UAAU,GAAG,MAAM,CAUzD;AAED,wBAAgB,oBAAoB,CAAC,KAAK,EAAE,UAAU,EAAE,GAAG,MAAM,CAQhE;AAED,wBAAgB,YAAY,CAAC,MAAM,E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