bbk-cli 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/.claude/bitbucket-config.local.md.example +58 -0
- package/.eslintcache +1 -0
- package/.github/dependabot.yml +15 -0
- package/.github/workflows/convetional-commit.yml +24 -0
- package/.github/workflows/publish-on-tag.yml +47 -0
- package/.github/workflows/release-please.yml +21 -0
- package/.github/workflows/run-tests.yml +75 -0
- package/.nvmrc +1 -0
- package/.prettierignore +2 -0
- package/.prettierrc.cjs +17 -0
- package/.release-please-manifest.json +3 -0
- package/CHANGELOG.md +21 -0
- package/LICENSE +202 -0
- package/README.md +381 -0
- package/dist/cli/index.d.ts +2 -0
- package/dist/cli/index.d.ts.map +1 -0
- package/dist/cli/index.js +2 -0
- package/dist/cli/index.js.map +1 -0
- package/dist/cli/wrapper.d.ts +38 -0
- package/dist/cli/wrapper.d.ts.map +1 -0
- package/dist/cli/wrapper.js +326 -0
- package/dist/cli/wrapper.js.map +1 -0
- package/dist/commands/helpers.d.ts +11 -0
- package/dist/commands/helpers.d.ts.map +1 -0
- package/dist/commands/helpers.js +40 -0
- package/dist/commands/helpers.js.map +1 -0
- package/dist/commands/index.d.ts +3 -0
- package/dist/commands/index.d.ts.map +1 -0
- package/dist/commands/index.js +3 -0
- package/dist/commands/index.js.map +1 -0
- package/dist/commands/runner.d.ts +7 -0
- package/dist/commands/runner.d.ts.map +1 -0
- package/dist/commands/runner.js +126 -0
- package/dist/commands/runner.js.map +1 -0
- package/dist/config/constants.d.ts +16 -0
- package/dist/config/constants.d.ts.map +1 -0
- package/dist/config/constants.js +171 -0
- package/dist/config/constants.js.map +1 -0
- package/dist/config/index.d.ts +2 -0
- package/dist/config/index.d.ts.map +1 -0
- package/dist/config/index.js +2 -0
- package/dist/config/index.js.map +1 -0
- package/dist/index.d.ts +3 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +24 -0
- package/dist/index.js.map +1 -0
- package/dist/utils/arg-parser.d.ts +7 -0
- package/dist/utils/arg-parser.d.ts.map +1 -0
- package/dist/utils/arg-parser.js +67 -0
- package/dist/utils/arg-parser.js.map +1 -0
- package/dist/utils/bitbucket-client.d.ts +122 -0
- package/dist/utils/bitbucket-client.d.ts.map +1 -0
- package/dist/utils/bitbucket-client.js +182 -0
- package/dist/utils/bitbucket-client.js.map +1 -0
- package/dist/utils/bitbucket-utils.d.ts +110 -0
- package/dist/utils/bitbucket-utils.d.ts.map +1 -0
- package/dist/utils/bitbucket-utils.js +491 -0
- package/dist/utils/bitbucket-utils.js.map +1 -0
- package/dist/utils/config-loader.d.ts +41 -0
- package/dist/utils/config-loader.d.ts.map +1 -0
- package/dist/utils/config-loader.js +76 -0
- package/dist/utils/config-loader.js.map +1 -0
- package/dist/utils/index.d.ts +5 -0
- package/dist/utils/index.d.ts.map +1 -0
- package/dist/utils/index.js +4 -0
- package/dist/utils/index.js.map +1 -0
- package/eslint.config.ts +15 -0
- package/package.json +62 -0
- package/release-please-config.json +33 -0
- package/tests/integration/cli-integration.test.ts +528 -0
- package/tests/unit/cli/wrapper.test.ts +727 -0
- package/tests/unit/commands/helpers.test.ts +268 -0
- package/tests/unit/commands/runner.test.ts +758 -0
- package/tests/unit/utils/arg-parser.test.ts +350 -0
- package/tests/unit/utils/config-loader.test.ts +158 -0
- package/vitest.config.ts +22 -0
|
@@ -0,0 +1,110 @@
|
|
|
1
|
+
import type { Config } from './config-loader.js';
|
|
2
|
+
/**
|
|
3
|
+
* Generic API result
|
|
4
|
+
*/
|
|
5
|
+
export interface ApiResult {
|
|
6
|
+
success: boolean;
|
|
7
|
+
result?: string;
|
|
8
|
+
data?: unknown;
|
|
9
|
+
error?: string;
|
|
10
|
+
}
|
|
11
|
+
/**
|
|
12
|
+
* Bitbucket API client options
|
|
13
|
+
*/
|
|
14
|
+
interface BitbucketClientAuth {
|
|
15
|
+
email: string;
|
|
16
|
+
apiToken: string;
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Bitbucket API Utility Module
|
|
20
|
+
* Provides core Bitbucket API operations with formatting using basic auth
|
|
21
|
+
*/
|
|
22
|
+
export declare class BitbucketUtil {
|
|
23
|
+
private readonly config;
|
|
24
|
+
private readonly authPool;
|
|
25
|
+
constructor(config: Config);
|
|
26
|
+
/**
|
|
27
|
+
* Get authentication for a profile
|
|
28
|
+
*/
|
|
29
|
+
getAuth(profileName: string): BitbucketClientAuth;
|
|
30
|
+
/**
|
|
31
|
+
* Make authenticated request to Bitbucket API
|
|
32
|
+
*/
|
|
33
|
+
private makeRequest;
|
|
34
|
+
/**
|
|
35
|
+
* Format data as JSON
|
|
36
|
+
*/
|
|
37
|
+
formatAsJson(data: unknown): string;
|
|
38
|
+
/**
|
|
39
|
+
* Format data as TOON (Token-Oriented Object Notation)
|
|
40
|
+
*/
|
|
41
|
+
formatAsToon(data: unknown): string;
|
|
42
|
+
/**
|
|
43
|
+
* Format result with specified format
|
|
44
|
+
*/
|
|
45
|
+
formatResult(data: unknown, format?: 'json' | 'toon'): string;
|
|
46
|
+
/**
|
|
47
|
+
* List all repositories in a workspace
|
|
48
|
+
*/
|
|
49
|
+
listRepositories(profileName: string, workspace: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
50
|
+
/**
|
|
51
|
+
* Get repository details
|
|
52
|
+
*/
|
|
53
|
+
getRepository(profileName: string, workspace: string, repoSlug: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
54
|
+
/**
|
|
55
|
+
* List pull requests in a repository
|
|
56
|
+
*/
|
|
57
|
+
listPullRequests(profileName: string, workspace: string, repoSlug: string, state?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
58
|
+
/**
|
|
59
|
+
* Get pull request details
|
|
60
|
+
*/
|
|
61
|
+
getPullRequest(profileName: string, workspace: string, repoSlug: string, pullRequestId: number, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
62
|
+
/**
|
|
63
|
+
* Get default reviewers for a repository
|
|
64
|
+
*/
|
|
65
|
+
getDefaultReviewers(profileName: string, workspace: string, repoSlug: string): Promise<Array<{
|
|
66
|
+
uuid: string;
|
|
67
|
+
}>>;
|
|
68
|
+
/**
|
|
69
|
+
* Create a new pull request
|
|
70
|
+
*/
|
|
71
|
+
createPullRequest(profileName: string, workspace: string, repoSlug: string, title: string, sourceBranch: string, destinationBranch: string, description?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
72
|
+
/**
|
|
73
|
+
* List branches in a repository
|
|
74
|
+
*/
|
|
75
|
+
listBranches(profileName: string, workspace: string, repoSlug: string, q?: string, sort?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
76
|
+
/**
|
|
77
|
+
* List commits in a repository
|
|
78
|
+
*/
|
|
79
|
+
listCommits(profileName: string, workspace: string, repoSlug: string, branch?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
80
|
+
/**
|
|
81
|
+
* List issues in a repository
|
|
82
|
+
*/
|
|
83
|
+
listIssues(profileName: string, workspace: string, repoSlug: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
84
|
+
/**
|
|
85
|
+
* Get issue details
|
|
86
|
+
*/
|
|
87
|
+
getIssue(profileName: string, workspace: string, repoSlug: string, issueId: number, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
88
|
+
/**
|
|
89
|
+
* Create a new issue
|
|
90
|
+
*/
|
|
91
|
+
createIssue(profileName: string, workspace: string, repoSlug: string, title: string, content?: string, kind?: string, priority?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
92
|
+
/**
|
|
93
|
+
* List pipelines in a repository
|
|
94
|
+
*/
|
|
95
|
+
listPipelines(profileName: string, workspace: string, repoSlug: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
96
|
+
/**
|
|
97
|
+
* Get user information
|
|
98
|
+
*/
|
|
99
|
+
getUser(profileName: string, username?: string, format?: 'json' | 'toon'): Promise<ApiResult>;
|
|
100
|
+
/**
|
|
101
|
+
* Test Bitbucket API connection
|
|
102
|
+
*/
|
|
103
|
+
testConnection(profileName: string): Promise<ApiResult>;
|
|
104
|
+
/**
|
|
105
|
+
* Clear all auth from the pool
|
|
106
|
+
*/
|
|
107
|
+
clearClients(): void;
|
|
108
|
+
}
|
|
109
|
+
export {};
|
|
110
|
+
//# sourceMappingURL=bitbucket-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucket-utils.d.ts","sourceRoot":"","sources":["../../src/utils/bitbucket-utils.ts"],"names":[],"mappings":"AAEA,OAAO,KAAK,EAAE,MAAM,EAAE,MAAM,oBAAoB,CAAC;AAKjD;;GAEG;AACH,MAAM,WAAW,SAAS;IACxB,OAAO,EAAE,OAAO,CAAC;IACjB,MAAM,CAAC,EAAE,MAAM,CAAC;IAChB,IAAI,CAAC,EAAE,OAAO,CAAC;IACf,KAAK,CAAC,EAAE,MAAM,CAAC;CAChB;AAED;;GAEG;AACH,UAAU,mBAAmB;IAC3B,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAkGD;;;GAGG;AACH,qBAAa,aAAa;IACxB,OAAO,CAAC,QAAQ,CAAC,MAAM,CAAS;IAChC,OAAO,CAAC,QAAQ,CAAC,QAAQ,CAAmC;gBAEhD,MAAM,EAAE,MAAM;IAK1B;;OAEG;IACH,OAAO,CAAC,WAAW,EAAE,MAAM,GAAG,mBAAmB;IAoBjD;;OAEG;YACW,WAAW;IAqCzB;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;IAInC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,GAAG,MAAM;IAQnC;;OAEG;IACH,YAAY,CAAC,IAAI,EAAE,OAAO,EAAE,MAAM,GAAE,MAAM,GAAG,MAAe,GAAG,MAAM;IAOrE;;OAEG;IACG,gBAAgB,CAAC,WAAW,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,EAAE,MAAM,GAAE,MAAM,GAAG,MAAe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AAG,OAAO,CAAC,SAAS,CAAC;IAmB7D;;OAEG;IACH,YAAY,IAAI,IAAI;CAGrB"}
|
|
@@ -0,0 +1,491 @@
|
|
|
1
|
+
import { encode } from '@toon-format/toon';
|
|
2
|
+
import { getBitbucketClientOptions } from './config-loader.js';
|
|
3
|
+
const BITBUCKET_API_BASE = 'https://api.bitbucket.org/2.0';
|
|
4
|
+
/**
|
|
5
|
+
* Bitbucket API Utility Module
|
|
6
|
+
* Provides core Bitbucket API operations with formatting using basic auth
|
|
7
|
+
*/
|
|
8
|
+
export class BitbucketUtil {
|
|
9
|
+
config;
|
|
10
|
+
authPool;
|
|
11
|
+
constructor(config) {
|
|
12
|
+
this.config = config;
|
|
13
|
+
this.authPool = new Map();
|
|
14
|
+
}
|
|
15
|
+
/**
|
|
16
|
+
* Get authentication for a profile
|
|
17
|
+
*/
|
|
18
|
+
getAuth(profileName) {
|
|
19
|
+
if (this.authPool.has(profileName)) {
|
|
20
|
+
return this.authPool.get(profileName);
|
|
21
|
+
}
|
|
22
|
+
const options = getBitbucketClientOptions(this.config, profileName);
|
|
23
|
+
if (!options.auth?.email || !options.auth?.apiToken) {
|
|
24
|
+
throw new Error(`Invalid authentication for profile "${profileName}"`);
|
|
25
|
+
}
|
|
26
|
+
const auth = {
|
|
27
|
+
email: options.auth.email,
|
|
28
|
+
apiToken: options.auth.apiToken,
|
|
29
|
+
};
|
|
30
|
+
this.authPool.set(profileName, auth);
|
|
31
|
+
return auth;
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Make authenticated request to Bitbucket API
|
|
35
|
+
*/
|
|
36
|
+
async makeRequest(profileName, endpoint, method = 'GET', body) {
|
|
37
|
+
const auth = this.getAuth(profileName);
|
|
38
|
+
const url = `${BITBUCKET_API_BASE}${endpoint}`;
|
|
39
|
+
// Create Basic Auth header
|
|
40
|
+
const authString = Buffer.from(`${auth.email}:${auth.apiToken}`).toString('base64');
|
|
41
|
+
const headers = {
|
|
42
|
+
Authorization: `Basic ${authString}`,
|
|
43
|
+
Accept: 'application/json',
|
|
44
|
+
'Content-Type': 'application/json',
|
|
45
|
+
};
|
|
46
|
+
const options = {
|
|
47
|
+
method,
|
|
48
|
+
headers,
|
|
49
|
+
};
|
|
50
|
+
if (body && (method === 'POST' || method === 'PUT')) {
|
|
51
|
+
options.body = JSON.stringify(body);
|
|
52
|
+
}
|
|
53
|
+
const response = await fetch(url, options);
|
|
54
|
+
if (!response.ok) {
|
|
55
|
+
const errorText = await response.text();
|
|
56
|
+
throw new Error(`Bitbucket API error (${response.status}): ${errorText}`);
|
|
57
|
+
}
|
|
58
|
+
return await response.json();
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Format data as JSON
|
|
62
|
+
*/
|
|
63
|
+
formatAsJson(data) {
|
|
64
|
+
return JSON.stringify(data, null, 2);
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* Format data as TOON (Token-Oriented Object Notation)
|
|
68
|
+
*/
|
|
69
|
+
formatAsToon(data) {
|
|
70
|
+
if (!data) {
|
|
71
|
+
return '';
|
|
72
|
+
}
|
|
73
|
+
return encode(data);
|
|
74
|
+
}
|
|
75
|
+
/**
|
|
76
|
+
* Format result with specified format
|
|
77
|
+
*/
|
|
78
|
+
formatResult(data, format = 'json') {
|
|
79
|
+
if (format === 'toon') {
|
|
80
|
+
return this.formatAsToon(data);
|
|
81
|
+
}
|
|
82
|
+
return this.formatAsJson(data);
|
|
83
|
+
}
|
|
84
|
+
/**
|
|
85
|
+
* List all repositories in a workspace
|
|
86
|
+
*/
|
|
87
|
+
async listRepositories(profileName, workspace, format = 'json') {
|
|
88
|
+
try {
|
|
89
|
+
const response = (await this.makeRequest(profileName, `/repositories/${workspace}`));
|
|
90
|
+
// Simplify repository data for display
|
|
91
|
+
const repos = response.values || [];
|
|
92
|
+
const simplifiedRepos = repos.map(r => ({
|
|
93
|
+
slug: r.slug,
|
|
94
|
+
name: r.name,
|
|
95
|
+
full_name: r.full_name,
|
|
96
|
+
description: r.description,
|
|
97
|
+
is_private: r.is_private,
|
|
98
|
+
created_on: r.created_on,
|
|
99
|
+
updated_on: r.updated_on,
|
|
100
|
+
}));
|
|
101
|
+
return {
|
|
102
|
+
success: true,
|
|
103
|
+
data: simplifiedRepos,
|
|
104
|
+
result: this.formatResult(simplifiedRepos, format),
|
|
105
|
+
};
|
|
106
|
+
}
|
|
107
|
+
catch (error) {
|
|
108
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
109
|
+
return {
|
|
110
|
+
success: false,
|
|
111
|
+
error: `ERROR: ${errorMessage}`,
|
|
112
|
+
};
|
|
113
|
+
}
|
|
114
|
+
}
|
|
115
|
+
/**
|
|
116
|
+
* Get repository details
|
|
117
|
+
*/
|
|
118
|
+
async getRepository(profileName, workspace, repoSlug, format = 'json') {
|
|
119
|
+
try {
|
|
120
|
+
const response = await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}`);
|
|
121
|
+
return {
|
|
122
|
+
success: true,
|
|
123
|
+
data: response,
|
|
124
|
+
result: this.formatResult(response, format),
|
|
125
|
+
};
|
|
126
|
+
}
|
|
127
|
+
catch (error) {
|
|
128
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
129
|
+
return {
|
|
130
|
+
success: false,
|
|
131
|
+
error: `ERROR: ${errorMessage}`,
|
|
132
|
+
};
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* List pull requests in a repository
|
|
137
|
+
*/
|
|
138
|
+
async listPullRequests(profileName, workspace, repoSlug, state, format = 'json') {
|
|
139
|
+
try {
|
|
140
|
+
let endpoint = `/repositories/${workspace}/${repoSlug}/pullrequests`;
|
|
141
|
+
if (state) {
|
|
142
|
+
endpoint += `?state=${state}`;
|
|
143
|
+
}
|
|
144
|
+
const response = (await this.makeRequest(profileName, endpoint));
|
|
145
|
+
const prs = response.values || [];
|
|
146
|
+
// Simplify PR data for display
|
|
147
|
+
const simplifiedPRs = prs.map(pr => ({
|
|
148
|
+
id: pr.id,
|
|
149
|
+
title: pr.title,
|
|
150
|
+
state: pr.state,
|
|
151
|
+
author: pr.author?.display_name || pr.author?.nickname,
|
|
152
|
+
source_branch: pr.source?.branch?.name,
|
|
153
|
+
destination_branch: pr.destination?.branch?.name,
|
|
154
|
+
created_on: pr.created_on,
|
|
155
|
+
updated_on: pr.updated_on,
|
|
156
|
+
}));
|
|
157
|
+
return {
|
|
158
|
+
success: true,
|
|
159
|
+
data: simplifiedPRs,
|
|
160
|
+
result: this.formatResult(simplifiedPRs, format),
|
|
161
|
+
};
|
|
162
|
+
}
|
|
163
|
+
catch (error) {
|
|
164
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
165
|
+
return {
|
|
166
|
+
success: false,
|
|
167
|
+
error: `ERROR: ${errorMessage}`,
|
|
168
|
+
};
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Get pull request details
|
|
173
|
+
*/
|
|
174
|
+
async getPullRequest(profileName, workspace, repoSlug, pullRequestId, format = 'json') {
|
|
175
|
+
try {
|
|
176
|
+
const response = await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/pullrequests/${pullRequestId}`);
|
|
177
|
+
return {
|
|
178
|
+
success: true,
|
|
179
|
+
data: response,
|
|
180
|
+
result: this.formatResult(response, format),
|
|
181
|
+
};
|
|
182
|
+
}
|
|
183
|
+
catch (error) {
|
|
184
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
185
|
+
return {
|
|
186
|
+
success: false,
|
|
187
|
+
error: `ERROR: ${errorMessage}`,
|
|
188
|
+
};
|
|
189
|
+
}
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* Get default reviewers for a repository
|
|
193
|
+
*/
|
|
194
|
+
async getDefaultReviewers(profileName, workspace, repoSlug) {
|
|
195
|
+
try {
|
|
196
|
+
const response = (await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/effective-default-reviewers`));
|
|
197
|
+
// Extract user UUIDs from the response
|
|
198
|
+
const reviewers = response.values || [];
|
|
199
|
+
return reviewers.map(reviewer => ({
|
|
200
|
+
uuid: reviewer.user?.uuid || reviewer.uuid || '',
|
|
201
|
+
}));
|
|
202
|
+
}
|
|
203
|
+
catch {
|
|
204
|
+
// Return empty array if fetching reviewers fails
|
|
205
|
+
return [];
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Create a new pull request
|
|
210
|
+
*/
|
|
211
|
+
async createPullRequest(profileName, workspace, repoSlug, title, sourceBranch, destinationBranch, description, format = 'json') {
|
|
212
|
+
try {
|
|
213
|
+
// Fetch the current authenticated user and default reviewers in parallel
|
|
214
|
+
const [currentUserResponse, defaultReviewers] = await Promise.all([
|
|
215
|
+
this.makeRequest(profileName, '/user'),
|
|
216
|
+
this.getDefaultReviewers(profileName, workspace, repoSlug),
|
|
217
|
+
]);
|
|
218
|
+
const currentUserUuid = currentUserResponse.uuid;
|
|
219
|
+
// Filter out the current user from reviewers (author cannot be a reviewer)
|
|
220
|
+
const filteredReviewers = defaultReviewers.filter(reviewer => reviewer.uuid !== currentUserUuid);
|
|
221
|
+
const body = {
|
|
222
|
+
type: 'pullrequest',
|
|
223
|
+
title,
|
|
224
|
+
source: {
|
|
225
|
+
branch: {
|
|
226
|
+
name: sourceBranch,
|
|
227
|
+
},
|
|
228
|
+
},
|
|
229
|
+
destination: {
|
|
230
|
+
branch: {
|
|
231
|
+
name: destinationBranch,
|
|
232
|
+
},
|
|
233
|
+
},
|
|
234
|
+
description: description || '',
|
|
235
|
+
};
|
|
236
|
+
// Add reviewers if any were found (excluding the author)
|
|
237
|
+
if (filteredReviewers.length > 0) {
|
|
238
|
+
body.reviewers = filteredReviewers;
|
|
239
|
+
}
|
|
240
|
+
const response = await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/pullrequests`, 'POST', body);
|
|
241
|
+
return {
|
|
242
|
+
success: true,
|
|
243
|
+
data: response,
|
|
244
|
+
result: this.formatResult(response, format),
|
|
245
|
+
};
|
|
246
|
+
}
|
|
247
|
+
catch (error) {
|
|
248
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
249
|
+
return {
|
|
250
|
+
success: false,
|
|
251
|
+
error: `ERROR: ${errorMessage}`,
|
|
252
|
+
};
|
|
253
|
+
}
|
|
254
|
+
}
|
|
255
|
+
/**
|
|
256
|
+
* List branches in a repository
|
|
257
|
+
*/
|
|
258
|
+
async listBranches(profileName, workspace, repoSlug, q, sort, format = 'json') {
|
|
259
|
+
try {
|
|
260
|
+
let endpoint = `/repositories/${workspace}/${repoSlug}/refs/branches`;
|
|
261
|
+
const params = [];
|
|
262
|
+
if (q && q.trim() !== '') {
|
|
263
|
+
params.push(`q=${encodeURIComponent(q)}`);
|
|
264
|
+
}
|
|
265
|
+
if (sort && sort.trim() !== '') {
|
|
266
|
+
params.push(`sort=${encodeURIComponent(sort)}`);
|
|
267
|
+
}
|
|
268
|
+
if (params.length > 0) {
|
|
269
|
+
endpoint += `?${params.join('&')}`;
|
|
270
|
+
}
|
|
271
|
+
const response = (await this.makeRequest(profileName, endpoint));
|
|
272
|
+
const branches = response.values || [];
|
|
273
|
+
const simplifiedBranches = branches.map(b => ({
|
|
274
|
+
name: b.name,
|
|
275
|
+
target: {
|
|
276
|
+
hash: b.target?.hash,
|
|
277
|
+
date: b.target?.date,
|
|
278
|
+
message: b.target?.message,
|
|
279
|
+
},
|
|
280
|
+
}));
|
|
281
|
+
return {
|
|
282
|
+
success: true,
|
|
283
|
+
data: simplifiedBranches,
|
|
284
|
+
result: this.formatResult(simplifiedBranches, format),
|
|
285
|
+
};
|
|
286
|
+
}
|
|
287
|
+
catch (error) {
|
|
288
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
289
|
+
return {
|
|
290
|
+
success: false,
|
|
291
|
+
error: `ERROR: ${errorMessage}`,
|
|
292
|
+
};
|
|
293
|
+
}
|
|
294
|
+
}
|
|
295
|
+
/**
|
|
296
|
+
* List commits in a repository
|
|
297
|
+
*/
|
|
298
|
+
async listCommits(profileName, workspace, repoSlug, branch, format = 'json') {
|
|
299
|
+
try {
|
|
300
|
+
let endpoint = `/repositories/${workspace}/${repoSlug}/commits`;
|
|
301
|
+
if (branch) {
|
|
302
|
+
endpoint += `/${branch}`;
|
|
303
|
+
}
|
|
304
|
+
const response = (await this.makeRequest(profileName, endpoint));
|
|
305
|
+
const commits = response.values || [];
|
|
306
|
+
const simplifiedCommits = commits.map(c => ({
|
|
307
|
+
hash: c.hash,
|
|
308
|
+
date: c.date,
|
|
309
|
+
message: c.message,
|
|
310
|
+
author: c.author?.user?.display_name || c.author?.raw,
|
|
311
|
+
}));
|
|
312
|
+
return {
|
|
313
|
+
success: true,
|
|
314
|
+
data: simplifiedCommits,
|
|
315
|
+
result: this.formatResult(simplifiedCommits, format),
|
|
316
|
+
};
|
|
317
|
+
}
|
|
318
|
+
catch (error) {
|
|
319
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
320
|
+
return {
|
|
321
|
+
success: false,
|
|
322
|
+
error: `ERROR: ${errorMessage}`,
|
|
323
|
+
};
|
|
324
|
+
}
|
|
325
|
+
}
|
|
326
|
+
/**
|
|
327
|
+
* List issues in a repository
|
|
328
|
+
*/
|
|
329
|
+
async listIssues(profileName, workspace, repoSlug, format = 'json') {
|
|
330
|
+
try {
|
|
331
|
+
const response = (await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/issues`));
|
|
332
|
+
const issues = response.values || [];
|
|
333
|
+
const simplifiedIssues = issues.map(i => ({
|
|
334
|
+
id: i.id,
|
|
335
|
+
title: i.title,
|
|
336
|
+
state: i.state,
|
|
337
|
+
kind: i.kind,
|
|
338
|
+
priority: i.priority,
|
|
339
|
+
created_on: i.created_on,
|
|
340
|
+
updated_on: i.updated_on,
|
|
341
|
+
}));
|
|
342
|
+
return {
|
|
343
|
+
success: true,
|
|
344
|
+
data: simplifiedIssues,
|
|
345
|
+
result: this.formatResult(simplifiedIssues, format),
|
|
346
|
+
};
|
|
347
|
+
}
|
|
348
|
+
catch (error) {
|
|
349
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
350
|
+
return {
|
|
351
|
+
success: false,
|
|
352
|
+
error: `ERROR: ${errorMessage}`,
|
|
353
|
+
};
|
|
354
|
+
}
|
|
355
|
+
}
|
|
356
|
+
/**
|
|
357
|
+
* Get issue details
|
|
358
|
+
*/
|
|
359
|
+
async getIssue(profileName, workspace, repoSlug, issueId, format = 'json') {
|
|
360
|
+
try {
|
|
361
|
+
const response = await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/issues/${issueId}`);
|
|
362
|
+
return {
|
|
363
|
+
success: true,
|
|
364
|
+
data: response,
|
|
365
|
+
result: this.formatResult(response, format),
|
|
366
|
+
};
|
|
367
|
+
}
|
|
368
|
+
catch (error) {
|
|
369
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
370
|
+
return {
|
|
371
|
+
success: false,
|
|
372
|
+
error: `ERROR: ${errorMessage}`,
|
|
373
|
+
};
|
|
374
|
+
}
|
|
375
|
+
}
|
|
376
|
+
/**
|
|
377
|
+
* Create a new issue
|
|
378
|
+
*/
|
|
379
|
+
async createIssue(profileName, workspace, repoSlug, title, content, kind, priority, format = 'json') {
|
|
380
|
+
try {
|
|
381
|
+
const issueData = { title };
|
|
382
|
+
if (content) {
|
|
383
|
+
issueData.content = { raw: content };
|
|
384
|
+
}
|
|
385
|
+
if (kind) {
|
|
386
|
+
issueData.kind = kind;
|
|
387
|
+
}
|
|
388
|
+
if (priority) {
|
|
389
|
+
issueData.priority = priority;
|
|
390
|
+
}
|
|
391
|
+
const response = await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/issues`, 'POST', issueData);
|
|
392
|
+
return {
|
|
393
|
+
success: true,
|
|
394
|
+
data: response,
|
|
395
|
+
result: this.formatResult(response, format),
|
|
396
|
+
};
|
|
397
|
+
}
|
|
398
|
+
catch (error) {
|
|
399
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
400
|
+
return {
|
|
401
|
+
success: false,
|
|
402
|
+
error: `ERROR: ${errorMessage}`,
|
|
403
|
+
};
|
|
404
|
+
}
|
|
405
|
+
}
|
|
406
|
+
/**
|
|
407
|
+
* List pipelines in a repository
|
|
408
|
+
*/
|
|
409
|
+
async listPipelines(profileName, workspace, repoSlug, format = 'json') {
|
|
410
|
+
try {
|
|
411
|
+
const response = (await this.makeRequest(profileName, `/repositories/${workspace}/${repoSlug}/pipelines/`));
|
|
412
|
+
const pipelines = response.values || [];
|
|
413
|
+
const simplifiedPipelines = pipelines.map(p => ({
|
|
414
|
+
uuid: p.uuid,
|
|
415
|
+
build_number: p.build_number,
|
|
416
|
+
state: p.state?.name,
|
|
417
|
+
created_on: p.created_on,
|
|
418
|
+
completed_on: p.completed_on,
|
|
419
|
+
target: p.target?.ref_name,
|
|
420
|
+
}));
|
|
421
|
+
return {
|
|
422
|
+
success: true,
|
|
423
|
+
data: simplifiedPipelines,
|
|
424
|
+
result: this.formatResult(simplifiedPipelines, format),
|
|
425
|
+
};
|
|
426
|
+
}
|
|
427
|
+
catch (error) {
|
|
428
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
429
|
+
return {
|
|
430
|
+
success: false,
|
|
431
|
+
error: `ERROR: ${errorMessage}`,
|
|
432
|
+
};
|
|
433
|
+
}
|
|
434
|
+
}
|
|
435
|
+
/**
|
|
436
|
+
* Get user information
|
|
437
|
+
*/
|
|
438
|
+
async getUser(profileName, username, format = 'json') {
|
|
439
|
+
try {
|
|
440
|
+
let endpoint;
|
|
441
|
+
if (username) {
|
|
442
|
+
endpoint = `/users/${username}`;
|
|
443
|
+
}
|
|
444
|
+
else {
|
|
445
|
+
// Get current authenticated user
|
|
446
|
+
endpoint = `/user`;
|
|
447
|
+
}
|
|
448
|
+
const response = await this.makeRequest(profileName, endpoint);
|
|
449
|
+
return {
|
|
450
|
+
success: true,
|
|
451
|
+
data: response,
|
|
452
|
+
result: this.formatResult(response, format),
|
|
453
|
+
};
|
|
454
|
+
}
|
|
455
|
+
catch (error) {
|
|
456
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
457
|
+
return {
|
|
458
|
+
success: false,
|
|
459
|
+
error: `ERROR: ${errorMessage}`,
|
|
460
|
+
};
|
|
461
|
+
}
|
|
462
|
+
}
|
|
463
|
+
/**
|
|
464
|
+
* Test Bitbucket API connection
|
|
465
|
+
*/
|
|
466
|
+
async testConnection(profileName) {
|
|
467
|
+
try {
|
|
468
|
+
// Test connection by getting current user
|
|
469
|
+
const response = (await this.makeRequest(profileName, '/user'));
|
|
470
|
+
return {
|
|
471
|
+
success: true,
|
|
472
|
+
data: { status: 'connected', user: response },
|
|
473
|
+
result: `Connection successful! Authenticated as: ${response.display_name || response.username}`,
|
|
474
|
+
};
|
|
475
|
+
}
|
|
476
|
+
catch (error) {
|
|
477
|
+
const errorMessage = error instanceof Error ? error.message : String(error);
|
|
478
|
+
return {
|
|
479
|
+
success: false,
|
|
480
|
+
error: `Connection failed: ${errorMessage}`,
|
|
481
|
+
};
|
|
482
|
+
}
|
|
483
|
+
}
|
|
484
|
+
/**
|
|
485
|
+
* Clear all auth from the pool
|
|
486
|
+
*/
|
|
487
|
+
clearClients() {
|
|
488
|
+
this.authPool.clear();
|
|
489
|
+
}
|
|
490
|
+
}
|
|
491
|
+
//# sourceMappingURL=bitbucket-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"bitbucket-utils.js","sourceRoot":"","sources":["../../src/utils/bitbucket-utils.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,mBAAmB,CAAC;AAG3C,OAAO,EAAE,yBAAyB,EAAE,MAAM,oBAAoB,CAAC;AAE/D,MAAM,kBAAkB,GAAG,+BAA+B,CAAC;AAoH3D;;;GAGG;AACH,MAAM,OAAO,aAAa;IACP,MAAM,CAAS;IACf,QAAQ,CAAmC;IAE5D,YAAY,MAAc;QAC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7C,MAAM,EAAE,4CAA4C,QAAQ,CAAC,YAAY,IAAI,QAAQ,CAAC,QAAQ,EAAE;aACjG,CAAC;QACJ,CAAC;QAAC,OAAO,KAAc,EAAE,CAAC;YACxB,MAAM,YAAY,GAAG,KAAK,YAAY,KAAK,CAAC,CAAC,CAAC,KAAK,CAAC,OAAO,CAAC,CAAC,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;YAC5E,OAAO;gBACL,OAAO,EAAE,KAAK;gBACd,KAAK,EAAE,sBAAsB,YAAY,EAAE;aAC5C,CAAC;QACJ,CAAC;IACH,CAAC;IAED;;OAEG;IACH,YAAY;QACV,IAAI,CAAC,QAAQ,CAAC,KAAK,EAAE,CAAC;IACxB,CAAC;CACF"}
|
|
@@ -0,0 +1,41 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Bitbucket connection profile configuration
|
|
3
|
+
*/
|
|
4
|
+
interface BitbucketProfile {
|
|
5
|
+
email: string;
|
|
6
|
+
apiToken: string;
|
|
7
|
+
}
|
|
8
|
+
/**
|
|
9
|
+
* Main configuration structure
|
|
10
|
+
*/
|
|
11
|
+
export interface Config {
|
|
12
|
+
profiles: Record<string, BitbucketProfile>;
|
|
13
|
+
defaultProfile: string;
|
|
14
|
+
defaultFormat: 'json' | 'toon';
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* Bitbucket client options for basic auth
|
|
18
|
+
*/
|
|
19
|
+
interface BitbucketClientOptions {
|
|
20
|
+
auth: {
|
|
21
|
+
email: string;
|
|
22
|
+
apiToken: string;
|
|
23
|
+
};
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Load Bitbucket connection profiles from .claude/bitbucket-config.local.md
|
|
27
|
+
*
|
|
28
|
+
* @param projectRoot - Project root directory
|
|
29
|
+
* @returns Configuration object with profiles and settings
|
|
30
|
+
*/
|
|
31
|
+
export declare function loadConfig(projectRoot: string): Config;
|
|
32
|
+
/**
|
|
33
|
+
* Get Bitbucket client options for a specific profile
|
|
34
|
+
*
|
|
35
|
+
* @param config - Configuration object
|
|
36
|
+
* @param profileName - Profile name
|
|
37
|
+
* @returns Bitbucket client options object with basic auth
|
|
38
|
+
*/
|
|
39
|
+
export declare function getBitbucketClientOptions(config: Config, profileName: string): BitbucketClientOptions;
|
|
40
|
+
export {};
|
|
41
|
+
//# sourceMappingURL=config-loader.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config-loader.d.ts","sourceRoot":"","sources":["../../src/utils/config-loader.ts"],"names":[],"mappings":"AAIA;;GAEG;AACH,UAAU,gBAAgB;IACxB,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,EAAE,MAAM,CAAC;CAClB;AAUD;;GAEG;AACH,MAAM,WAAW,MAAM;IACrB,QAAQ,EAAE,MAAM,CAAC,MAAM,EAAE,gBAAgB,CAAC,CAAC;IAC3C,cAAc,EAAE,MAAM,CAAC;IACvB,aAAa,EAAE,MAAM,GAAG,MAAM,CAAC;CAChC;AAED;;GAEG;AACH,UAAU,sBAAsB;IAC9B,IAAI,EAAE;QACJ,KAAK,EAAE,MAAM,CAAC;QACd,QAAQ,EAAE,MAAM,CAAC;KAClB,CAAC;CACH;AAED;;;;;GAKG;AACH,wBAAgB,UAAU,CAAC,WAAW,EAAE,MAAM,GAAG,MAAM,CA8CtD;AAED;;;;;;GAMG;AACH,wBAAgB,yBAAyB,CAAC,MAAM,EAAE,MAAM,EAAE,WAAW,EAAE,MAAM,GAAG,sBAAsB,CAkBrG"}
|