@jagadeesh52423/atlassian-mcp-server 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.
Files changed (40) hide show
  1. package/.env.example +26 -0
  2. package/LICENSE +21 -0
  3. package/README.md +349 -0
  4. package/dist/atlassian-client.d.ts +10 -0
  5. package/dist/atlassian-client.d.ts.map +1 -0
  6. package/dist/atlassian-client.js +38 -0
  7. package/dist/atlassian-client.js.map +1 -0
  8. package/dist/config.d.ts +11 -0
  9. package/dist/config.d.ts.map +1 -0
  10. package/dist/config.js +60 -0
  11. package/dist/config.js.map +1 -0
  12. package/dist/confluence-client.d.ts +11 -0
  13. package/dist/confluence-client.d.ts.map +1 -0
  14. package/dist/confluence-client.js +47 -0
  15. package/dist/confluence-client.js.map +1 -0
  16. package/dist/index.d.ts +3 -0
  17. package/dist/index.d.ts.map +1 -0
  18. package/dist/index.js +2592 -0
  19. package/dist/index.js.map +1 -0
  20. package/dist/jira-client.d.ts +11 -0
  21. package/dist/jira-client.d.ts.map +1 -0
  22. package/dist/jira-client.js +47 -0
  23. package/dist/jira-client.js.map +1 -0
  24. package/dist/services/bitbucket.d.ts +21 -0
  25. package/dist/services/bitbucket.d.ts.map +1 -0
  26. package/dist/services/bitbucket.js +176 -0
  27. package/dist/services/bitbucket.js.map +1 -0
  28. package/dist/services/confluence.d.ts +41 -0
  29. package/dist/services/confluence.d.ts.map +1 -0
  30. package/dist/services/confluence.js +348 -0
  31. package/dist/services/confluence.js.map +1 -0
  32. package/dist/services/jira.d.ts +58 -0
  33. package/dist/services/jira.d.ts.map +1 -0
  34. package/dist/services/jira.js +1115 -0
  35. package/dist/services/jira.js.map +1 -0
  36. package/dist/types.d.ts +120 -0
  37. package/dist/types.d.ts.map +1 -0
  38. package/dist/types.js +2 -0
  39. package/dist/types.js.map +1 -0
  40. package/package.json +61 -0
package/.env.example ADDED
@@ -0,0 +1,26 @@
1
+ # Confluence Configuration
2
+ CONFLUENCE_DOMAIN=your-domain.atlassian.net
3
+ CONFLUENCE_EMAIL=your-email@example.com
4
+ CONFLUENCE_API_TOKEN=your-confluence-api-token
5
+
6
+ # Jira Configuration
7
+ JIRA_DOMAIN=your-domain.atlassian.net
8
+ JIRA_EMAIL=your-email@example.com
9
+ JIRA_API_TOKEN=your-jira-api-token
10
+
11
+ # Optional: Jira OAuth Configuration (for advanced auth)
12
+ JIRA_CLIENT_ID=your-jira-client-id
13
+ JIRA_CLIENT_SECRET=your-jira-client-secret
14
+
15
+ # Bitbucket Configuration
16
+ BITBUCKET_WORKSPACE=your-workspace
17
+ BITBUCKET_USERNAME=your-username
18
+ BITBUCKET_API_TOKEN=your-bitbucket-api-token
19
+
20
+ # Legacy Fallback Configuration (optional)
21
+ # If service-specific tokens aren't provided, these will be used
22
+ ATLASSIAN_DOMAIN=your-domain.atlassian.net
23
+ ATLASSIAN_EMAIL=your-email@example.com
24
+ ATLASSIAN_API_TOKEN=your-fallback-api-token
25
+ ATLASSIAN_CLIENT_ID=your-client-id
26
+ ATLASSIAN_CLIENT_SECRET=your-client-secret
package/LICENSE ADDED
@@ -0,0 +1,21 @@
1
+ MIT License
2
+
3
+ Copyright (c) 2024 Jagadeesh Pulamarasetti
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,349 @@
1
+ # Atlassian MCP Server
2
+
3
+ [![npm version](https://badge.fury.io/js/@jagadeesh52423%2Fatlassian-mcp-server.svg)](https://www.npmjs.com/package/@jagadeesh52423/atlassian-mcp-server)
4
+ [![License: MIT](https://img.shields.io/badge/License-MIT-yellow.svg)](https://opensource.org/licenses/MIT)
5
+
6
+ A comprehensive Model Context Protocol (MCP) server that provides AI assistants with access to Atlassian APIs including Jira, Confluence, and Bitbucket.
7
+
8
+ ## Features
9
+
10
+ ### Confluence Integration
11
+ - Search pages by text query
12
+ - Get specific pages by ID
13
+ - Create new pages with content
14
+ - Update existing pages
15
+ - List spaces and pages within spaces
16
+ - Full support for Confluence storage format
17
+
18
+ ### Jira Integration
19
+ - Search issues by text query
20
+ - Get specific issues by key
21
+ - Create new issues with customizable fields
22
+ - Update existing issues
23
+ - Add comments to issues
24
+ - Transition issues between statuses with **Smart Field Handling**
25
+ - List projects and issue types
26
+ - Assign issues to users
27
+
28
+ #### Smart Field Handling
29
+ Advanced transition management with intelligent field suggestions:
30
+ - **Contextual Analysis**: Analyzes issue content to provide smart field suggestions
31
+ - **Pattern Recognition**: Recognizes common field patterns (DB scripts, test cases, etc.)
32
+ - **Auto-Suggestions**: Provides context-aware suggestions with reasoning
33
+ - **Enhanced Error Handling**: Returns detailed field information instead of cryptic errors
34
+
35
+ ### Bitbucket Integration
36
+ - List and search repositories
37
+ - Get repository details
38
+ - Create new repositories
39
+ - Manage branches and commits
40
+ - Handle pull requests (create, list, review)
41
+ - Issue tracking within repositories
42
+ - File content operations
43
+
44
+ ## Installation
45
+
46
+ ### Option 1: Install from npm (Recommended)
47
+
48
+ ```bash
49
+ npm install -g @jagadeesh52423/atlassian-mcp-server
50
+ ```
51
+
52
+ Or use with npx without installing:
53
+ ```bash
54
+ npx @jagadeesh52423/atlassian-mcp-server
55
+ ```
56
+
57
+ ### Option 2: Install from source
58
+
59
+ 1. Clone this repository:
60
+ ```bash
61
+ git clone https://github.com/jagadeeshpulamarasetti/atlassian-mcp-server.git
62
+ cd atlassian-mcp-server
63
+ ```
64
+
65
+ 2. Install dependencies:
66
+ ```bash
67
+ npm install
68
+ ```
69
+
70
+ 3. Build the project:
71
+ ```bash
72
+ npm run build
73
+ ```
74
+
75
+ ## Configuration
76
+
77
+ 1. Copy the environment template:
78
+ ```bash
79
+ cp .env.example .env
80
+ ```
81
+
82
+ 2. Fill in your Atlassian credentials in `.env`:
83
+
84
+ ```env
85
+ # Confluence Configuration
86
+ CONFLUENCE_DOMAIN=your-domain.atlassian.net
87
+ CONFLUENCE_EMAIL=your-email@example.com
88
+ CONFLUENCE_API_TOKEN=your-confluence-api-token
89
+
90
+ # Jira Configuration
91
+ JIRA_DOMAIN=your-domain.atlassian.net
92
+ JIRA_EMAIL=your-email@example.com
93
+ JIRA_API_TOKEN=your-jira-api-token
94
+
95
+ # Optional: OAuth Configuration (for advanced auth)
96
+ JIRA_CLIENT_ID=your-client-id
97
+ JIRA_CLIENT_SECRET=your-client-secret
98
+
99
+ # Bitbucket Configuration
100
+ BITBUCKET_WORKSPACE=your-workspace
101
+ BITBUCKET_USERNAME=your-username
102
+ BITBUCKET_API_TOKEN=your-bitbucket-api-token
103
+
104
+ # Legacy: Atlassian Configuration (backward compatibility)
105
+ ATLASSIAN_DOMAIN=your-domain.atlassian.net
106
+ ATLASSIAN_EMAIL=your-email@example.com
107
+ ATLASSIAN_API_TOKEN=your-api-token
108
+ ```
109
+
110
+ ### Getting API Tokens
111
+
112
+ #### Atlassian API Token
113
+ 1. Go to https://id.atlassian.com/manage-profile/security/api-tokens
114
+ 2. Click "Create API token"
115
+ 3. Give it a label and create
116
+ 4. Copy the token to your `.env` file
117
+
118
+ #### Bitbucket API Token
119
+ 1. Go to your Bitbucket settings → Personal access tokens
120
+ 2. Create a new API token with required scopes:
121
+ - Repositories: Read, Write
122
+ - Issues: Read, Write
123
+ - Pull requests: Read, Write
124
+ - Pipelines: Read (if needed)
125
+ 3. Copy the token to your `.env` file
126
+
127
+ **Note**: App passwords are deprecated as of September 9, 2025. Use API tokens instead.
128
+
129
+ ## Usage
130
+
131
+ ### Running the Server
132
+
133
+ If installed globally:
134
+ ```bash
135
+ atlassian-mcp-server
136
+ ```
137
+
138
+ If running from source:
139
+ ```bash
140
+ npm start
141
+ ```
142
+
143
+ For development with auto-reload:
144
+ ```bash
145
+ npm run dev
146
+ ```
147
+
148
+ ### Integration with Claude Desktop
149
+
150
+ Add the following to your Claude Desktop configuration file:
151
+
152
+ **macOS**: `~/Library/Application Support/Claude/claude_desktop_config.json`
153
+ **Windows**: `%APPDATA%/Claude/claude_desktop_config.json`
154
+
155
+ #### If installed globally via npm:
156
+ ```json
157
+ {
158
+ "mcpServers": {
159
+ "atlassian": {
160
+ "command": "atlassian-mcp-server",
161
+ "env": {
162
+ "CONFLUENCE_DOMAIN": "your-domain.atlassian.net",
163
+ "CONFLUENCE_EMAIL": "your-email@example.com",
164
+ "CONFLUENCE_API_TOKEN": "your-confluence-api-token",
165
+ "JIRA_DOMAIN": "your-domain.atlassian.net",
166
+ "JIRA_EMAIL": "your-email@example.com",
167
+ "JIRA_API_TOKEN": "your-jira-api-token",
168
+ "BITBUCKET_WORKSPACE": "your-workspace",
169
+ "BITBUCKET_USERNAME": "your-username",
170
+ "BITBUCKET_API_TOKEN": "your-bitbucket-api-token"
171
+ }
172
+ }
173
+ }
174
+ }
175
+ ```
176
+
177
+ #### If using npx:
178
+ ```json
179
+ {
180
+ "mcpServers": {
181
+ "atlassian": {
182
+ "command": "npx",
183
+ "args": ["-y", "@jagadeesh52423/atlassian-mcp-server"],
184
+ "env": {
185
+ "CONFLUENCE_DOMAIN": "your-domain.atlassian.net",
186
+ "CONFLUENCE_EMAIL": "your-email@example.com",
187
+ "CONFLUENCE_API_TOKEN": "your-confluence-api-token",
188
+ "JIRA_DOMAIN": "your-domain.atlassian.net",
189
+ "JIRA_EMAIL": "your-email@example.com",
190
+ "JIRA_API_TOKEN": "your-jira-api-token",
191
+ "BITBUCKET_WORKSPACE": "your-workspace",
192
+ "BITBUCKET_USERNAME": "your-username",
193
+ "BITBUCKET_API_TOKEN": "your-bitbucket-api-token"
194
+ }
195
+ }
196
+ }
197
+ }
198
+ ```
199
+
200
+ #### If installed from source:
201
+ ```json
202
+ {
203
+ "mcpServers": {
204
+ "atlassian": {
205
+ "command": "node",
206
+ "args": ["/path/to/your/atlassian-mcp-server/dist/index.js"]
207
+ }
208
+ }
209
+ }
210
+ ```
211
+
212
+ ## Available Tools
213
+
214
+ ### Confluence Tools
215
+
216
+ - `confluence_search_pages`: Search pages by text
217
+ - `confluence_get_page`: Get specific page by ID
218
+ - `confluence_create_page`: Create new page
219
+ - `confluence_update_page`: Update existing page
220
+ - `confluence_get_spaces`: List all spaces
221
+ - `confluence_get_pages_by_space`: Get pages from specific space
222
+
223
+ ### Jira Tools
224
+
225
+ - `jira_search_issues`: Search issues by text
226
+ - `jira_get_issue`: Get specific issue by key
227
+ - `jira_create_issue`: Create new issue
228
+ - `jira_update_issue`: Update existing issue
229
+ - `jira_add_comment`: Add comment to issue
230
+ - `jira_get_projects`: List all projects
231
+ - `jira_get_issue_transitions`: Get available transitions for an issue
232
+ - `jira_transition_issue`: Change issue status (basic)
233
+ - `jira_transition_issue_interactive`: Change issue status with smart field handling
234
+
235
+ ### Bitbucket Tools
236
+
237
+ - `bitbucket_get_repositories`: List repositories
238
+ - `bitbucket_get_repository`: Get specific repository
239
+ - `bitbucket_create_repository`: Create new repository
240
+ - `bitbucket_get_pull_requests`: List pull requests
241
+ - `bitbucket_create_pull_request`: Create new pull request
242
+ - `bitbucket_get_branches`: List branches
243
+ - `bitbucket_get_commits`: List commits
244
+ - `bitbucket_get_issues`: List repository issues
245
+ - `bitbucket_create_issue`: Create new issue
246
+
247
+ ## Example Usage with AI Assistant
248
+
249
+ ```
250
+ User: "Search for pages about API documentation in Confluence"
251
+ AI: Uses confluence_search_pages with query "API documentation"
252
+
253
+ User: "Create a new Jira issue for the bug I found"
254
+ AI: Uses jira_create_issue with appropriate project, summary, and description
255
+
256
+ User: "Move this Jira ticket to Code Review status"
257
+ AI: Uses jira_transition_issue_interactive which automatically:
258
+ - Analyzes the issue content for context
259
+ - Provides smart suggestions for required fields
260
+ - Handles transition with minimal user input
261
+
262
+ User: "What pull requests are open in my main repository?"
263
+ AI: Uses bitbucket_get_pull_requests with your repository name
264
+ ```
265
+
266
+ ### Smart Field Handling Examples
267
+
268
+ ```
269
+ Scenario: Transitioning a template configuration issue
270
+ Issue: "Update notification template to use 'Prefr App'"
271
+ Smart Suggestion: DB Script = "No" (Template changes use MOFU tool)
272
+ Test Cases = "No" (Template changes don't require separate tests)
273
+
274
+ Scenario: Transitioning a new feature development issue
275
+ Issue: "Implement user authentication system"
276
+ Smart Suggestion: DB Script = "Yes" (New features typically need database changes)
277
+ Test Cases = "Yes" (New features require comprehensive testing)
278
+ ```
279
+
280
+ ## Development
281
+
282
+ ### Project Structure
283
+ ```
284
+ src/
285
+ ├── index.ts # Main MCP server
286
+ ├── types.ts # TypeScript interfaces
287
+ ├── config.ts # Configuration management
288
+ ├── confluence-client.ts # Confluence API client
289
+ ├── jira-client.ts # Jira API client
290
+ ├── bitbucket-client.ts # Bitbucket API client
291
+ └── services/
292
+ ├── confluence.ts # Confluence API service
293
+ ├── jira.ts # Jira API service (with smart field handling)
294
+ └── bitbucket.ts # Bitbucket API service
295
+ ```
296
+
297
+ ### Building and Testing
298
+
299
+ ```bash
300
+ # Build
301
+ npm run build
302
+
303
+ # Development with auto-reload
304
+ npm run dev
305
+
306
+ # Clean build artifacts
307
+ npm run clean
308
+ ```
309
+
310
+ ## Security Considerations
311
+
312
+ - API tokens are stored in environment variables
313
+ - All API calls use HTTPS
314
+ - Tokens should have minimal required permissions
315
+ - Never commit `.env` files to version control
316
+
317
+ ## Error Handling
318
+
319
+ The server includes comprehensive error handling:
320
+ - API authentication errors
321
+ - Rate limiting responses
322
+ - Network connectivity issues
323
+ - Invalid parameters
324
+ - Resource not found errors
325
+
326
+ ## Rate Limiting
327
+
328
+ Respects Atlassian API rate limits:
329
+ - Jira Cloud: 10 requests per second
330
+ - Confluence Cloud: 10 requests per second
331
+ - Bitbucket Cloud: 1000 requests per hour
332
+
333
+ ## Contributing
334
+
335
+ 1. Fork the repository
336
+ 2. Create a feature branch
337
+ 3. Make your changes
338
+ 4. Add tests if applicable
339
+ 5. Submit a pull request
340
+
341
+ ## License
342
+
343
+ MIT License - see LICENSE file for details
344
+
345
+ ## Support
346
+
347
+ - **npm package**: [@jagadeesh52423/atlassian-mcp-server](https://www.npmjs.com/package/@jagadeesh52423/atlassian-mcp-server)
348
+ - **Issues & Feature Requests**: [GitHub Issues](https://github.com/jagadeeshpulamarasetti/atlassian-mcp-server/issues)
349
+ - **Source Code**: [GitHub Repository](https://github.com/jagadeeshpulamarasetti/atlassian-mcp-server)
@@ -0,0 +1,10 @@
1
+ export declare class AtlassianClient {
2
+ private client;
3
+ private baseUrl;
4
+ constructor();
5
+ get<T>(endpoint: string, params?: any): Promise<T>;
6
+ post<T>(endpoint: string, data: any): Promise<T>;
7
+ put<T>(endpoint: string, data: any): Promise<T>;
8
+ delete<T>(endpoint: string): Promise<T>;
9
+ }
10
+ //# sourceMappingURL=atlassian-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlassian-client.d.ts","sourceRoot":"","sources":["../src/atlassian-client.ts"],"names":[],"mappings":"AAGA,qBAAa,eAAe;IAC1B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAS;;IAsBlB,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKlD,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKhD,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAK/C,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;CAI9C"}
@@ -0,0 +1,38 @@
1
+ import axios from 'axios';
2
+ import { atlassianConfig, getAtlassianAuth } from './config.js';
3
+ export class AtlassianClient {
4
+ client;
5
+ baseUrl;
6
+ constructor() {
7
+ this.baseUrl = `https://${atlassianConfig.domain}`;
8
+ this.client = axios.create({
9
+ baseURL: this.baseUrl,
10
+ headers: {
11
+ 'Authorization': `Basic ${getAtlassianAuth()}`,
12
+ 'Accept': 'application/json',
13
+ 'Content-Type': 'application/json',
14
+ },
15
+ });
16
+ this.client.interceptors.response.use((response) => response, (error) => {
17
+ console.error('Atlassian API Error:', error.response?.data || error.message);
18
+ throw error;
19
+ });
20
+ }
21
+ async get(endpoint, params) {
22
+ const response = await this.client.get(endpoint, { params });
23
+ return response.data;
24
+ }
25
+ async post(endpoint, data) {
26
+ const response = await this.client.post(endpoint, data);
27
+ return response.data;
28
+ }
29
+ async put(endpoint, data) {
30
+ const response = await this.client.put(endpoint, data);
31
+ return response.data;
32
+ }
33
+ async delete(endpoint) {
34
+ const response = await this.client.delete(endpoint);
35
+ return response.data;
36
+ }
37
+ }
38
+ //# sourceMappingURL=atlassian-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"atlassian-client.js","sourceRoot":"","sources":["../src/atlassian-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AAC5D,OAAO,EAAE,eAAe,EAAE,gBAAgB,EAAE,MAAM,aAAa,CAAC;AAEhE,MAAM,OAAO,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AAC,IAAI,CAAC;IACvB,CAAC;IAED,KAAK,CAAC,MAAM,CAAI,QAAgB;QAC9B,MAAM,QAAQ,GAAqB,MAAM,IAAI,CAAC,MAAM,CAAC,MAAM,CAAC,QAAQ,CAAC,CAAC;QACtE,OAAO,QAAQ,CAAC,IAAI,CAAC;IACvB,CAAC;CACF"}
@@ -0,0 +1,11 @@
1
+ import { ConfluenceConfig, JiraConfig, AtlassianConfig, BitbucketConfig } from './types.js';
2
+ export declare const confluenceConfig: ConfluenceConfig;
3
+ export declare const jiraConfig: JiraConfig;
4
+ export declare const atlassianConfig: AtlassianConfig;
5
+ export declare const bitbucketConfig: BitbucketConfig;
6
+ export declare function validateConfig(): void;
7
+ export declare function getConfluenceAuth(): string;
8
+ export declare function getJiraAuth(): string;
9
+ export declare function getBitbucketAuth(): string;
10
+ export declare function getAtlassianAuth(): string;
11
+ //# sourceMappingURL=config.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AACA,OAAO,EAAE,gBAAgB,EAAE,UAAU,EAAE,eAAe,EAAE,eAAe,EAAE,MAAM,YAAY,CAAC;AAI5F,eAAO,MAAM,gBAAgB,EAAE,gBAI9B,CAAC;AAEF,eAAO,MAAM,UAAU,EAAE,UAMxB,CAAC;AAGF,eAAO,MAAM,eAAe,EAAE,eAM7B,CAAC;AAEF,eAAO,MAAM,eAAe,EAAE,eAI7B,CAAC;AAEF,wBAAgB,cAAc,IAAI,IAAI,CAmBrC;AAED,wBAAgB,iBAAiB,IAAI,MAAM,CAE1C;AAED,wBAAgB,WAAW,IAAI,MAAM,CAEpC;AAED,wBAAgB,gBAAgB,IAAI,MAAM,CAKzC;AAGD,wBAAgB,gBAAgB,IAAI,MAAM,CAEzC"}
package/dist/config.js ADDED
@@ -0,0 +1,60 @@
1
+ import dotenv from 'dotenv';
2
+ dotenv.config();
3
+ export const confluenceConfig = {
4
+ domain: process.env.CONFLUENCE_DOMAIN || process.env.ATLASSIAN_DOMAIN || '',
5
+ email: process.env.CONFLUENCE_EMAIL || process.env.ATLASSIAN_EMAIL || '',
6
+ apiToken: process.env.CONFLUENCE_API_TOKEN || process.env.ATLASSIAN_API_TOKEN || '',
7
+ };
8
+ export const jiraConfig = {
9
+ domain: process.env.JIRA_DOMAIN || process.env.ATLASSIAN_DOMAIN || '',
10
+ email: process.env.JIRA_EMAIL || process.env.ATLASSIAN_EMAIL || '',
11
+ apiToken: process.env.JIRA_API_TOKEN || process.env.ATLASSIAN_API_TOKEN || '',
12
+ clientId: process.env.JIRA_CLIENT_ID || process.env.ATLASSIAN_CLIENT_ID,
13
+ clientSecret: process.env.JIRA_CLIENT_SECRET || process.env.ATLASSIAN_CLIENT_SECRET,
14
+ };
15
+ // Legacy config for backward compatibility
16
+ export const atlassianConfig = {
17
+ domain: process.env.ATLASSIAN_DOMAIN || '',
18
+ email: process.env.ATLASSIAN_EMAIL || '',
19
+ apiToken: process.env.ATLASSIAN_API_TOKEN || '',
20
+ clientId: process.env.ATLASSIAN_CLIENT_ID,
21
+ clientSecret: process.env.ATLASSIAN_CLIENT_SECRET,
22
+ };
23
+ export const bitbucketConfig = {
24
+ workspace: process.env.BITBUCKET_WORKSPACE || '',
25
+ username: process.env.BITBUCKET_USERNAME || '',
26
+ apiToken: process.env.BITBUCKET_API_TOKEN || '',
27
+ };
28
+ export function validateConfig() {
29
+ const errors = [];
30
+ // Check if we have at least one service configured
31
+ const hasConfluence = process.env.CONFLUENCE_DOMAIN && process.env.CONFLUENCE_EMAIL && process.env.CONFLUENCE_API_TOKEN;
32
+ const hasJira = process.env.JIRA_DOMAIN && process.env.JIRA_EMAIL && process.env.JIRA_API_TOKEN;
33
+ const hasLegacy = process.env.ATLASSIAN_DOMAIN && process.env.ATLASSIAN_EMAIL && process.env.ATLASSIAN_API_TOKEN;
34
+ if (!hasConfluence && !hasLegacy) {
35
+ errors.push('Confluence configuration missing. Set CONFLUENCE_DOMAIN, CONFLUENCE_EMAIL, CONFLUENCE_API_TOKEN or fallback ATLASSIAN_* variables');
36
+ }
37
+ if (!hasJira && !hasLegacy) {
38
+ errors.push('Jira configuration missing. Set JIRA_DOMAIN, JIRA_EMAIL, JIRA_API_TOKEN or fallback ATLASSIAN_* variables');
39
+ }
40
+ if (errors.length > 0) {
41
+ throw new Error(`Configuration validation failed:\n${errors.join('\n')}`);
42
+ }
43
+ }
44
+ export function getConfluenceAuth() {
45
+ return Buffer.from(`${confluenceConfig.email}:${confluenceConfig.apiToken}`).toString('base64');
46
+ }
47
+ export function getJiraAuth() {
48
+ return Buffer.from(`${jiraConfig.email}:${jiraConfig.apiToken}`).toString('base64');
49
+ }
50
+ export function getBitbucketAuth() {
51
+ if (bitbucketConfig.username && bitbucketConfig.apiToken) {
52
+ return Buffer.from(`${bitbucketConfig.username}:${bitbucketConfig.apiToken}`).toString('base64');
53
+ }
54
+ return Buffer.from(`${atlassianConfig.email}:${atlassianConfig.apiToken}`).toString('base64');
55
+ }
56
+ // Legacy function for backward compatibility
57
+ export function getAtlassianAuth() {
58
+ return Buffer.from(`${atlassianConfig.email}:${atlassianConfig.apiToken}`).toString('base64');
59
+ }
60
+ //# sourceMappingURL=config.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"config.js","sourceRoot":"","sources":["../src/config.ts"],"names":[],"mappings":"AAAA,OAAO,MAAM,MAAM,QAAQ,CAAC;AAG5B,MAAM,CAAC,MAAM,EAAE,CAAC;AAEhB,MAAM,CAAC,MAAM,gBAAgB,GAAqB;IAChD,MAAM,EAAE,OAAO,CAAC,GAAG,CAAC,iBAAiB,IAAI,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,EAAE;IAC3E,KAAK,EAAE,OAAO,CAAC,GAAG,CAAC,gBAAgB,IAAI,OAAO,CAAC,GAAG,CAAC,eAAe,IAAI,EAAE;IACxE,QAAQ,EAAE,OAAO,CAAC,GAAG,CAAC,oBAAoB,IAAI,OAAO,CAAC,GAAG,CAAC,mBA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AC,QAAQ,EAAE,CAAC;QACzD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,QAAQ,IAAI,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;IACnG,CAAC;IACD,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,KAAK,IAAI,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChG,CAAC;AAED,6CAA6C;AAC7C,MAAM,UAAU,gBAAgB;IAC9B,OAAO,MAAM,CAAC,IAAI,CAAC,GAAG,eAAe,CAAC,KAAK,IAAI,eAAe,CAAC,QAAQ,EAAE,CAAC,CAAC,QAAQ,CAAC,QAAQ,CAAC,CAAC;AAChG,CAAC"}
@@ -0,0 +1,11 @@
1
+ export declare class ConfluenceClient {
2
+ private client;
3
+ private baseUrl;
4
+ constructor();
5
+ get<T>(endpoint: string, params?: any): Promise<T>;
6
+ post<T>(endpoint: string, data: any): Promise<T>;
7
+ put<T>(endpoint: string, data: any): Promise<T>;
8
+ delete<T>(endpoint: string): Promise<T>;
9
+ postFormData<T>(endpoint: string, formData: any): Promise<T>;
10
+ }
11
+ //# sourceMappingURL=confluence-client.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confluence-client.d.ts","sourceRoot":"","sources":["../src/confluence-client.ts"],"names":[],"mappings":"AAGA,qBAAa,gBAAgB;IAC3B,OAAO,CAAC,MAAM,CAAgB;IAC9B,OAAO,CAAC,OAAO,CAAS;;IAsBlB,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,MAAM,CAAC,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKlD,IAAI,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAKhD,GAAG,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,IAAI,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;IAK/C,MAAM,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,GAAG,OAAO,CAAC,CAAC,CAAC;IAKvC,YAAY,CAAC,CAAC,EAAE,QAAQ,EAAE,MAAM,EAAE,QAAQ,EAAE,GAAG,GAAG,OAAO,CAAC,CAAC,CAAC;CASnE"}
@@ -0,0 +1,47 @@
1
+ import axios from 'axios';
2
+ import { confluenceConfig, getConfluenceAuth } from './config.js';
3
+ export class ConfluenceClient {
4
+ client;
5
+ baseUrl;
6
+ constructor() {
7
+ this.baseUrl = `https://${confluenceConfig.domain}`;
8
+ this.client = axios.create({
9
+ baseURL: this.baseUrl,
10
+ headers: {
11
+ 'Authorization': `Basic ${getConfluenceAuth()}`,
12
+ 'Accept': 'application/json',
13
+ 'Content-Type': 'application/json',
14
+ },
15
+ });
16
+ this.client.interceptors.response.use((response) => response, (error) => {
17
+ console.error('Confluence API Error:', error.response?.data || error.message);
18
+ throw error;
19
+ });
20
+ }
21
+ async get(endpoint, params) {
22
+ const response = await this.client.get(endpoint, { params });
23
+ return response.data;
24
+ }
25
+ async post(endpoint, data) {
26
+ const response = await this.client.post(endpoint, data);
27
+ return response.data;
28
+ }
29
+ async put(endpoint, data) {
30
+ const response = await this.client.put(endpoint, data);
31
+ return response.data;
32
+ }
33
+ async delete(endpoint) {
34
+ const response = await this.client.delete(endpoint);
35
+ return response.data;
36
+ }
37
+ async postFormData(endpoint, formData) {
38
+ const response = await this.client.post(endpoint, formData, {
39
+ headers: {
40
+ ...formData.getHeaders(),
41
+ 'X-Atlassian-Token': 'no-check',
42
+ },
43
+ });
44
+ return response.data;
45
+ }
46
+ }
47
+ //# sourceMappingURL=confluence-client.js.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"confluence-client.js","sourceRoot":"","sources":["../src/confluence-client.ts"],"names":[],"mappings":"AAAA,OAAO,KAAuC,MAAM,OAAO,CAAC;AA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