@mcp-monorepo/jira 1.2.0 → 1.4.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/README.md +93 -11
- package/dist/index.js +21 -5
- package/dist/index.js.map +1 -1
- package/dist/lib/adf-utils.d.ts +19 -0
- package/dist/lib/adf-utils.d.ts.map +1 -0
- package/dist/lib/adf-utils.js +52 -0
- package/dist/lib/adf-utils.js.map +1 -0
- package/dist/lib/jira-env.d.ts +12 -3
- package/dist/lib/jira-env.d.ts.map +1 -1
- package/dist/lib/jira-env.js +19 -7
- package/dist/lib/jira-env.js.map +1 -1
- package/dist/lib/jira.service.d.ts +29 -2
- package/dist/lib/jira.service.d.ts.map +1 -1
- package/dist/lib/jira.service.js +168 -14
- package/dist/lib/jira.service.js.map +1 -1
- package/dist/lib/types.d.ts +91 -3
- package/dist/lib/types.d.ts.map +1 -1
- package/dist/tools/add-comment.d.ts +3 -0
- package/dist/tools/add-comment.d.ts.map +1 -0
- package/dist/tools/add-comment.js +38 -0
- package/dist/tools/add-comment.js.map +1 -0
- package/dist/tools/create-issue.d.ts +3 -0
- package/dist/tools/create-issue.d.ts.map +1 -0
- package/dist/tools/create-issue.js +48 -0
- package/dist/tools/create-issue.js.map +1 -0
- package/dist/tools/execute-jql.d.ts.map +1 -1
- package/dist/tools/execute-jql.js +39 -12
- package/dist/tools/execute-jql.js.map +1 -1
- package/dist/tools/get-create-metadata.d.ts +3 -0
- package/dist/tools/get-create-metadata.d.ts.map +1 -0
- package/dist/tools/get-create-metadata.js +59 -0
- package/dist/tools/get-create-metadata.js.map +1 -0
- package/dist/tools/get-current-profile.js +1 -1
- package/dist/tools/get-current-profile.js.map +1 -1
- package/dist/tools/get-issue.d.ts.map +1 -1
- package/dist/tools/get-issue.js +3 -2
- package/dist/tools/get-issue.js.map +1 -1
- package/dist/tools/update-issue.d.ts +3 -0
- package/dist/tools/update-issue.d.ts.map +1 -0
- package/dist/tools/update-issue.js +43 -0
- package/dist/tools/update-issue.js.map +1 -0
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -1,12 +1,12 @@
|
|
|
1
1
|
<!--
|
|
2
2
|
DO NOT EDIT THIS FILE DIRECTLY.
|
|
3
3
|
IT IS AUTOMATICALLY GENERATED.
|
|
4
|
-
Last generated: 2026-
|
|
4
|
+
Last generated: 2026-02-18T12:57:56.494Z
|
|
5
5
|
-->
|
|
6
6
|
|
|
7
7
|
# @mcp-monorepo/jira
|
|
8
8
|
|
|
9
|
-
 
|
|
10
10
|
|
|
11
11
|
MCP server for Jira tools (JQL, issue management, etc.).
|
|
12
12
|
|
|
@@ -19,6 +19,13 @@ This package provides a set of tools for interacting with a Jira instance. It al
|
|
|
19
19
|
- **Discovery**: List available status transitions for an issue and find recently created projects.
|
|
20
20
|
- **User Information**: Retrieve the profile details of the currently authenticated user.
|
|
21
21
|
|
|
22
|
+
### Authentication
|
|
23
|
+
|
|
24
|
+
Two authentication modes are supported. Exactly one must be configured:
|
|
25
|
+
|
|
26
|
+
- **Personal Access Token (PAT)**: Set `JIRA_TOKEN` with a valid Jira PAT.
|
|
27
|
+
- **Cookie-based authentication**: Set `JIRA_COOKIE` with the raw Cookie header value from an authenticated Jira session.
|
|
28
|
+
|
|
22
29
|
|
|
23
30
|
## Usage
|
|
24
31
|
|
|
@@ -42,6 +49,8 @@ To integrate this server with a compatible AI model (like Claude), provide the f
|
|
|
42
49
|
"env": {
|
|
43
50
|
"JIRA_BASE_URL": "<Your JIRA_BASE_URL Here>",
|
|
44
51
|
"JIRA_TOKEN": "<Your JIRA_TOKEN Here>",
|
|
52
|
+
"JIRA_COOKIE": "<Your JIRA_COOKIE Here>",
|
|
53
|
+
"JIRA_API_VERSION": "2",
|
|
45
54
|
"JIRA_INSECURE_SKIP_VERIFY": "false"
|
|
46
55
|
}
|
|
47
56
|
}
|
|
@@ -54,7 +63,9 @@ To integrate this server with a compatible AI model (like Claude), provide the f
|
|
|
54
63
|
| Variable | Description | Default |
|
|
55
64
|
| :--- | :--- | :--- |
|
|
56
65
|
| `JIRA_BASE_URL` | The base URL for your Jira instance (e.g., https://your-company.atlassian.net). | `<required>` |
|
|
57
|
-
| `JIRA_TOKEN` | A Jira Personal Access Token (PAT) with appropriate permissions to read and modify issues. | `<
|
|
66
|
+
| `JIRA_TOKEN` | A Jira Personal Access Token (PAT) with appropriate permissions to read and modify issues. Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set. | `<optional>` |
|
|
67
|
+
| `JIRA_COOKIE` | A Jira session cookie value (e.g., the full Cookie header string). Useful for environments where a PAT is not available. Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set. | `<optional>` |
|
|
68
|
+
| `JIRA_API_VERSION` | The Jira REST API version to use: '2' (default) or '3'. API v3 includes: (1) Issue descriptions in Atlassian Document Format (ADF) which are automatically converted to Markdown, (2) User emailAddress may be null due to GDPR privacy settings, (3) Enhanced JQL search endpoint with nextPageToken-based pagination for better performance with large result sets. Use v3 to access newer features and ADF support for rich text formatting in issue descriptions. | `2` |
|
|
58
69
|
| `JIRA_INSECURE_SKIP_VERIFY` | Set to 'true' to disable TLS certificate validation. Use with caution, as this is a security risk. Recommended only for self-hosted Jira instances with self-signed certificates. | `false` |
|
|
59
70
|
|
|
60
71
|
## Tools
|
|
@@ -72,7 +83,7 @@ To integrate this server with a compatible AI model (like Claude), provide the f
|
|
|
72
83
|
|
|
73
84
|
### `execute-jql`
|
|
74
85
|
|
|
75
|
-
**Execute Jira JQL** - Execute a Jira Query Language (JQL) search and return issues.
|
|
86
|
+
**Execute Jira JQL** - Execute a Jira Query Language (JQL) search and return issues. In API v3, uses enhanced search with nextPageToken pagination. In API v2, uses legacy search with startAt pagination.
|
|
76
87
|
|
|
77
88
|
**Input Schema**
|
|
78
89
|
|
|
@@ -80,7 +91,8 @@ To integrate this server with a compatible AI model (like Claude), provide the f
|
|
|
80
91
|
| :--- | :--- | :--- |
|
|
81
92
|
| `jql` | `string` | JQL query string |
|
|
82
93
|
| `maxResults` | `integer` | Maximum number of results to return (default: 50) |
|
|
83
|
-
| `startAt` | `integer` | Index of first result for pagination (default: 0) |
|
|
94
|
+
| `startAt` | `integer` | Index of first result for pagination (v2 only, default: 0) |
|
|
95
|
+
| `nextPageToken` | `string` | Token for next page of results (v3 only) |
|
|
84
96
|
| `fields` | `array of string` | Fields to include in results (default: [summary, status, assignee]) |
|
|
85
97
|
|
|
86
98
|
|
|
@@ -141,6 +153,75 @@ To integrate this server with a compatible AI model (like Claude), provide the f
|
|
|
141
153
|
| `issueIdOrKey` | `string` | Jira issue key or numeric ID |
|
|
142
154
|
|
|
143
155
|
|
|
156
|
+
---
|
|
157
|
+
|
|
158
|
+
### `get-create-metadata`
|
|
159
|
+
|
|
160
|
+
**Get Jira Create Issue Metadata** - Get metadata about fields required to create issues in a project. Returns issue types, priorities, and field requirements. Use this to find valid issueTypeId and priorityId values for creating issues.
|
|
161
|
+
|
|
162
|
+
**Input Schema**
|
|
163
|
+
|
|
164
|
+
| Property | Type | Description |
|
|
165
|
+
| :--- | :--- | :--- |
|
|
166
|
+
| `projectKey` | `string` | Filter by project key (e.g., "PROJ") |
|
|
167
|
+
| `issueTypeId` | `string` | Filter by specific issue type ID |
|
|
168
|
+
|
|
169
|
+
|
|
170
|
+
---
|
|
171
|
+
|
|
172
|
+
### `create-issue`
|
|
173
|
+
|
|
174
|
+
**Create Jira Issue** - Create a new Jira issue. Use get-create-metadata to find valid issueTypeId and priorityId values for your project.
|
|
175
|
+
|
|
176
|
+
**Input Schema**
|
|
177
|
+
|
|
178
|
+
| Property | Type | Description |
|
|
179
|
+
| :--- | :--- | :--- |
|
|
180
|
+
| `projectKey` | `string` | Project key (e.g., "PROJ") |
|
|
181
|
+
| `issueTypeId` | `string` | Issue type ID (use get-create-metadata to find valid IDs) |
|
|
182
|
+
| `summary` | `string` | Issue title/summary |
|
|
183
|
+
| `description` | `string` | Issue description (supports Markdown formatting in API v3, plain text in v2) |
|
|
184
|
+
| `assigneeId` | `string` | Assignee account ID (leave empty for unassigned) |
|
|
185
|
+
| `priorityId` | `string` | Priority ID (use get-create-metadata to find valid IDs) |
|
|
186
|
+
| `labels` | `array of string` | Labels for the issue |
|
|
187
|
+
| `parentKey` | `string` | Parent issue key (required for creating subtasks) |
|
|
188
|
+
|
|
189
|
+
|
|
190
|
+
---
|
|
191
|
+
|
|
192
|
+
### `update-issue`
|
|
193
|
+
|
|
194
|
+
**Update Jira Issue** - Update fields of an existing Jira issue. Only provided fields will be updated, others remain unchanged.
|
|
195
|
+
|
|
196
|
+
**Input Schema**
|
|
197
|
+
|
|
198
|
+
| Property | Type | Description |
|
|
199
|
+
| :--- | :--- | :--- |
|
|
200
|
+
| `issueIdOrKey` | `string` | Issue key or ID (e.g., "PROJ-123") |
|
|
201
|
+
| `summary` | `string` | New issue title/summary |
|
|
202
|
+
| `description` | `string` | New description (supports Markdown formatting in API v3, plain text in v2) |
|
|
203
|
+
| `assigneeId` | `any` | Assignee account ID (null to unassign, undefined to leave unchanged) |
|
|
204
|
+
| `priorityId` | `string` | New priority ID |
|
|
205
|
+
| `labels` | `array of string` | New labels (replaces existing labels) |
|
|
206
|
+
|
|
207
|
+
|
|
208
|
+
---
|
|
209
|
+
|
|
210
|
+
### `add-comment`
|
|
211
|
+
|
|
212
|
+
**Add Comment to Jira Issue** - Add a comment to an existing Jira issue.
|
|
213
|
+
|
|
214
|
+
**Input Schema**
|
|
215
|
+
|
|
216
|
+
| Property | Type | Description |
|
|
217
|
+
| :--- | :--- | :--- |
|
|
218
|
+
| `issueIdOrKey` | `string` | Issue key or ID (e.g., "PROJ-123") |
|
|
219
|
+
| `comment` | `string` | Comment text (supports Markdown formatting in API v3, plain text in v2) |
|
|
220
|
+
| `visibility` | `object` | Restrict comment visibility to a specific role or group (optional) |
|
|
221
|
+
| `visibility.type` | `string` | Visibility type: role or group |
|
|
222
|
+
| `visibility.value` | `string` | Role name or group name |
|
|
223
|
+
|
|
224
|
+
|
|
144
225
|
## Other MCP Servers
|
|
145
226
|
|
|
146
227
|
This monorepo contains several other MCP server packages available on npm. Each provides a distinct set of tools for use with the Model Context Protocol.
|
|
@@ -150,6 +231,7 @@ This monorepo contains several other MCP server packages available on npm. Each
|
|
|
150
231
|
- **[@mcp-monorepo/ics](https://www.npmjs.com/package/@mcp-monorepo/ics)**: MCP server for calendar tools using ICS/ical feeds
|
|
151
232
|
- **[@mcp-monorepo/location](https://www.npmjs.com/package/@mcp-monorepo/location)**: MCP server for location-based tools using IP address lookup
|
|
152
233
|
- **[@mcp-monorepo/mail](https://www.npmjs.com/package/@mcp-monorepo/mail)**: MCP server for mail tools (fetch, read, search, mark as seen).
|
|
234
|
+
- **[@mcp-monorepo/maps](https://www.npmjs.com/package/@mcp-monorepo/maps)**: MCP server providing geospatial tools powered by the Stadia Maps API.
|
|
153
235
|
- **[@mcp-monorepo/notion-query](https://www.npmjs.com/package/@mcp-monorepo/notion-query)**: MCP server for querying Notion data sources.
|
|
154
236
|
- **[@mcp-monorepo/npm](https://www.npmjs.com/package/@mcp-monorepo/npm)**: MCP server for npm command tools (run scripts, install packages, list scripts)
|
|
155
237
|
- **[@mcp-monorepo/slack](https://www.npmjs.com/package/@mcp-monorepo/slack)**: Slack MCP to access workspace without bot account or app
|
|
@@ -157,17 +239,17 @@ This monorepo contains several other MCP server packages available on npm. Each
|
|
|
157
239
|
|
|
158
240
|
## Recent Changes
|
|
159
241
|
|
|
160
|
-
### Version 1.
|
|
242
|
+
### Version 1.3.0
|
|
161
243
|
|
|
162
|
-
-
|
|
244
|
+
- 397cff4: add cookie-based authentication and require exactly one of JIRA_TOKEN or JIRA_COOKIE
|
|
163
245
|
|
|
164
|
-
### Version 1.
|
|
246
|
+
### Version 1.2.0
|
|
165
247
|
|
|
166
|
-
-
|
|
248
|
+
- 7f6ee0a: generate READMEs for packages via MCP introspection, add docgen and scripts, bump zod to v4 with schema fixes, improve syslog/logger graceful shutdown
|
|
167
249
|
|
|
168
|
-
### Version 1.1.
|
|
250
|
+
### Version 1.1.3
|
|
169
251
|
|
|
170
|
-
-
|
|
252
|
+
- fd22b00: Fixed yarn versioning during publish
|
|
171
253
|
|
|
172
254
|
---
|
|
173
255
|
## Authors
|
package/dist/index.js
CHANGED
|
@@ -1,13 +1,17 @@
|
|
|
1
1
|
#!/usr/bin/env node
|
|
2
2
|
import { createMcpServer, logger } from '@mcp-monorepo/shared';
|
|
3
|
-
import {
|
|
3
|
+
import { getJiraApiVersion, getJiraAuthMode, getJiraBaseUrl } from './lib/jira-env.js';
|
|
4
4
|
import { getCurrentProfile } from './lib/jira.service.js';
|
|
5
|
+
import { registerAddCommentTool } from './tools/add-comment.js';
|
|
6
|
+
import { registerCreateIssueTool } from './tools/create-issue.js';
|
|
5
7
|
import { registerExecuteJqlTool } from './tools/execute-jql.js';
|
|
8
|
+
import { registerGetCreateMetadataTool } from './tools/get-create-metadata.js';
|
|
6
9
|
import { registerGetCurrentProfileTool } from './tools/get-current-profile.js';
|
|
7
10
|
import { registerGetIssueTool } from './tools/get-issue.js';
|
|
8
11
|
import { registerGetLatestProjectsTool } from './tools/get-latest-projects.js';
|
|
9
12
|
import { registerGetTicketTransitionsTool } from './tools/get-ticket-transitions.js';
|
|
10
13
|
import { registerSetIssueStatusTool } from './tools/set-issue-status.js';
|
|
14
|
+
import { registerUpdateIssueTool } from './tools/update-issue.js';
|
|
11
15
|
createMcpServer({
|
|
12
16
|
name: 'jira',
|
|
13
17
|
importMetaPath: import.meta.filename,
|
|
@@ -19,6 +23,10 @@ createMcpServer({
|
|
|
19
23
|
registerGetIssueTool,
|
|
20
24
|
registerSetIssueStatusTool,
|
|
21
25
|
registerGetTicketTransitionsTool,
|
|
26
|
+
registerGetCreateMetadataTool,
|
|
27
|
+
registerCreateIssueTool,
|
|
28
|
+
registerUpdateIssueTool,
|
|
29
|
+
registerAddCommentTool,
|
|
22
30
|
],
|
|
23
31
|
async onReady() {
|
|
24
32
|
if (process.env.JIRA_INSECURE_SKIP_VERIFY === 'true') {
|
|
@@ -27,16 +35,24 @@ createMcpServer({
|
|
|
27
35
|
}
|
|
28
36
|
// Eagerly validate environment variables to fail fast on startup.
|
|
29
37
|
getJiraBaseUrl();
|
|
30
|
-
|
|
38
|
+
const auth = getJiraAuthMode();
|
|
39
|
+
const apiVersion = getJiraApiVersion();
|
|
40
|
+
logger.info(`Using Jira REST API version ${apiVersion}`);
|
|
41
|
+
logger.info(`Using Jira authentication mode: ${auth.type}`);
|
|
42
|
+
if (apiVersion === '3') {
|
|
43
|
+
logger.info('API v3 features: Issue descriptions are converted from Atlassian Document Format (ADF) to Markdown. ' +
|
|
44
|
+
'User emailAddress may be null due to GDPR privacy settings. ' +
|
|
45
|
+
'JQL search uses enhanced endpoint with nextPageToken pagination.');
|
|
46
|
+
}
|
|
31
47
|
// Perform a test API call to ensure credentials are valid and the service is reachable.
|
|
32
48
|
try {
|
|
33
49
|
logger.info('Verifying Jira connection and credentials...');
|
|
34
50
|
const profile = await getCurrentProfile();
|
|
35
|
-
|
|
51
|
+
const emailDisplay = profile.emailAddress || '<email hidden>';
|
|
52
|
+
logger.info(`Successfully connected to Jira as "${profile.displayName}" (${emailDisplay}).`);
|
|
36
53
|
}
|
|
37
54
|
catch (error) {
|
|
38
|
-
logger.error('Failed to connect to Jira. Please check JIRA_BASE_URL, JIRA_TOKEN, and TLS settings.', error);
|
|
39
|
-
// Re-throw to prevent the server from starting in a bad state.
|
|
55
|
+
logger.error('Failed to connect to Jira. Please check JIRA_BASE_URL, JIRA_TOKEN/JIRA_COOKIE, and TLS settings.', error);
|
|
40
56
|
throw new Error('Jira connection verification failed.');
|
|
41
57
|
}
|
|
42
58
|
},
|
package/dist/index.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"index.js","sourceRoot":"","sources":["../src/index.ts"],"names":[],"mappings":";AAEA,OAAO,EAAE,eAAe,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAE9D,OAAO,EAAE,
|
|
1
|
+
{"version":3,"file":"index.js","sourceRo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LAAmL,CACpL,CAAA;QACH,CAAC;QAED,kEAAkE;QAClE,cAAc,EAAE,CAAA;QAChB,MAAM,IAAI,GAAG,eAAe,EAAE,CAAA;QAC9B,MAAM,UAAU,GAAG,iBAAiB,EAAE,CAAA;QAEtC,MAAM,CAAC,IAAI,CAAC,+BAA+B,UAAU,EAAE,CAAC,CAAA;QACxD,MAAM,CAAC,IAAI,CAAC,mCAAmC,IAAI,CAAC,IAAI,EAAE,CAAC,CAAA;QAE3D,IAAI,UAAU,KAAK,GAAG,EAAE,CAAC;YACvB,MAAM,CAAC,IAAI,CACT,sGAAsG;gBACpG,8DAA8D;gBAC9D,kEAAkE,CACrE,CAAA;QACH,CAAC;QAED,wFAAwF;QACxF,IAAI,CAAC;YACH,MAAM,CAAC,IAAI,CAAC,8CAA8C,CAAC,CAAA;YAC3D,MAAM,OAAO,GAAG,MAAM,iBAAiB,EAAE,CAAA;YACzC,MAAM,YAAY,GAAG,OAAO,CAAC,YAAY,IAAI,gBAAgB,CAAA;YAC7D,MAAM,CAAC,IAAI,CAAC,sCAAsC,OAAO,CAAC,WAAW,MAAM,YAAY,IAAI,CAAC,CAAA;QAC9F,CAAC;QAAC,OAAO,KAAK,EAAE,CAAC;YACf,MAAM,CAAC,KAAK,CACV,kGAAkG,EAClG,KAAK,CACN,CAAA;YACD,MAAM,IAAI,KAAK,CAAC,sCAAsC,CAAC,CAAA;QACzD,CAAC;IACH,CAAC;CACF,CAAC,CAAC,KAAK,CAAC,CAAC,CAAC,EAAE,EAAE,CAAC,MAAM,CAAC,KAAK,CAAC,6BAA6B,EAAE,CAAC,CAAC,CAAC,CAAA"}
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for converting between Atlassian Document Format (ADF) and Markdown
|
|
3
|
+
*/
|
|
4
|
+
import { type ADFDocument } from 'extended-markdown-adf-parser';
|
|
5
|
+
/**
|
|
6
|
+
* Convert ADF to Markdown string
|
|
7
|
+
* Returns undefined if input is undefined, empty string if conversion fails
|
|
8
|
+
*/
|
|
9
|
+
export declare function adfToMd(adf: ADFDocument | string | undefined): string | undefined;
|
|
10
|
+
/**
|
|
11
|
+
* Convert Markdown string to ADF
|
|
12
|
+
* Returns undefined if input is undefined
|
|
13
|
+
*/
|
|
14
|
+
export declare function mdToAdf(markdown: string | undefined): ADFDocument | undefined;
|
|
15
|
+
/**
|
|
16
|
+
* Check if a value is an ADF object
|
|
17
|
+
*/
|
|
18
|
+
export declare function isAdf(value: unknown): value is ADFDocument;
|
|
19
|
+
//# sourceMappingURL=adf-utils.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adf-utils.d.ts","sourceRoot":"","sources":["../../src/lib/adf-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAGH,OAAO,EAAE,KAAK,WAAW,EAA4C,MAAM,8BAA8B,CAAA;AAKzG;;;GAGG;AACH,wBAAgB,OAAO,CAAC,GAAG,EAAE,WAAW,GAAG,MAAM,GAAG,SAAS,GAAG,MAAM,GAAG,SAAS,CAUjF;AAED;;;GAGG;AACH,wBAAgB,OAAO,CAAC,QAAQ,EAAE,MAAM,GAAG,SAAS,GAAG,WAAW,GAAG,SAAS,CAS7E;AAED;;GAEG;AACH,wBAAgB,KAAK,CAAC,KAAK,EAAE,OAAO,GAAG,KAAK,IAAI,WAAW,CAU1D"}
|
|
@@ -0,0 +1,52 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Utility functions for converting between Atlassian Document Format (ADF) and Markdown
|
|
3
|
+
*/
|
|
4
|
+
import { logger } from '@mcp-monorepo/shared';
|
|
5
|
+
import { AdfToMarkdownEngine, MarkdownToAdfEngine } from 'extended-markdown-adf-parser';
|
|
6
|
+
const adfToMarkdownEngine = new AdfToMarkdownEngine();
|
|
7
|
+
const markdownToAdfEngine = new MarkdownToAdfEngine();
|
|
8
|
+
/**
|
|
9
|
+
* Convert ADF to Markdown string
|
|
10
|
+
* Returns undefined if input is undefined, empty string if conversion fails
|
|
11
|
+
*/
|
|
12
|
+
export function adfToMd(adf) {
|
|
13
|
+
if (!adf)
|
|
14
|
+
return undefined;
|
|
15
|
+
if (typeof adf === 'string')
|
|
16
|
+
return adf; // Already a string (v2 format)
|
|
17
|
+
try {
|
|
18
|
+
return adfToMarkdownEngine.convert(adf);
|
|
19
|
+
}
|
|
20
|
+
catch (error) {
|
|
21
|
+
logger.error('Failed to convert ADF to Markdown:', error);
|
|
22
|
+
return ''; // Return empty string on error
|
|
23
|
+
}
|
|
24
|
+
}
|
|
25
|
+
/**
|
|
26
|
+
* Convert Markdown string to ADF
|
|
27
|
+
* Returns undefined if input is undefined
|
|
28
|
+
*/
|
|
29
|
+
export function mdToAdf(markdown) {
|
|
30
|
+
if (!markdown)
|
|
31
|
+
return undefined;
|
|
32
|
+
try {
|
|
33
|
+
return markdownToAdfEngine.convert(markdown);
|
|
34
|
+
}
|
|
35
|
+
catch (error) {
|
|
36
|
+
logger.error('Failed to convert Markdown to ADF:', error);
|
|
37
|
+
return undefined;
|
|
38
|
+
}
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Check if a value is an ADF object
|
|
42
|
+
*/
|
|
43
|
+
export function isAdf(value) {
|
|
44
|
+
return (typeof value === 'object' &&
|
|
45
|
+
// eslint-disable-next-line no-restricted-syntax
|
|
46
|
+
value != null &&
|
|
47
|
+
'type' in value &&
|
|
48
|
+
value.type === 'doc' &&
|
|
49
|
+
'version' in value &&
|
|
50
|
+
'content' in value);
|
|
51
|
+
}
|
|
52
|
+
//# sourceMappingURL=adf-utils.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"adf-utils.js","sourceRoot":"","sources":["../../src/lib/adf-utils.ts"],"names":[],"mappings":"AAAA;;GAEG;AAEH,OAAO,EAAE,MAAM,EAAE,MAAM,sBAAsB,CAAA;AAC7C,OAAO,EAAoB,mBAAmB,EAAE,mBAAmB,EAAE,MAAM,8BAA8B,CAAA;AAEzG,MAAM,m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ers.
|
|
3
|
+
* Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set.
|
|
4
4
|
*/
|
|
5
|
+
export type JiraAuthMode = {
|
|
6
|
+
type: 'token';
|
|
7
|
+
value: string;
|
|
8
|
+
} | {
|
|
9
|
+
type: 'cookie';
|
|
10
|
+
value: string;
|
|
11
|
+
};
|
|
12
|
+
export type JiraApiVersion = '2' | '3';
|
|
5
13
|
export declare function getJiraBaseUrl(): string;
|
|
6
|
-
export declare function
|
|
14
|
+
export declare function getJiraAuthMode(): JiraAuthMode;
|
|
15
|
+
export declare function getJiraApiVersion(): JiraApiVersion;
|
|
7
16
|
//# sourceMappingURL=jira-env.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-env.d.ts","sourceRoot":"","sources":["../../src/lib/jira-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED,wBAAgB,YAAY,IAAI,
|
|
1
|
+
{"version":3,"file":"jira-env.d.ts","sourceRoot":"","sources":["../../src/lib/jira-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAEH,MAAM,MAAM,YAAY,GAAG;IAAE,IAAI,EAAE,OAAO,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,GAAG;IAAE,IAAI,EAAE,QAAQ,CAAC;IAAC,KAAK,EAAE,MAAM,CAAA;CAAE,CAAA;AAC/F,MAAM,MAAM,cAAc,GAAG,GAAG,GAAG,GAAG,CAAA;AAEtC,wBAAgB,cAAc,IAAI,MAAM,CAIvC;AAED,wBAAgB,eAAe,IAAI,YAAY,CAY9C;AAED,wBAAgB,iBAAiB,IAAI,cAAc,CAMlD"}
|
package/dist/lib/jira-env.js
CHANGED
|
@@ -1,17 +1,29 @@
|
|
|
1
1
|
/**
|
|
2
|
-
* Jira environment variable helpers
|
|
3
|
-
*
|
|
2
|
+
* Jira environment variable helpers.
|
|
3
|
+
* Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set.
|
|
4
4
|
*/
|
|
5
5
|
export function getJiraBaseUrl() {
|
|
6
6
|
const url = process.env.JIRA_BASE_URL;
|
|
7
7
|
if (!url)
|
|
8
8
|
throw new Error('JIRA_BASE_URL env variable is required');
|
|
9
|
-
return url.replace(/\/$/, '');
|
|
9
|
+
return url.replace(/\/$/, '');
|
|
10
10
|
}
|
|
11
|
-
export function
|
|
11
|
+
export function getJiraAuthMode() {
|
|
12
12
|
const token = process.env.JIRA_TOKEN;
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
13
|
+
const cookie = process.env.JIRA_COOKIE;
|
|
14
|
+
if (token && cookie) {
|
|
15
|
+
throw new Error('Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set, but both are defined.');
|
|
16
|
+
}
|
|
17
|
+
if (!token && !cookie) {
|
|
18
|
+
throw new Error('Exactly one of JIRA_TOKEN or JIRA_COOKIE must be set, but neither is defined.');
|
|
19
|
+
}
|
|
20
|
+
return token ? { type: 'token', value: token } : { type: 'cookie', value: cookie };
|
|
21
|
+
}
|
|
22
|
+
export function getJiraApiVersion() {
|
|
23
|
+
const version = process.env.JIRA_API_VERSION;
|
|
24
|
+
if (version && version !== '2' && version !== '3') {
|
|
25
|
+
throw new Error('JIRA_API_VERSION must be either "2" or "3"');
|
|
26
|
+
}
|
|
27
|
+
return (version || '2'); // Default: v2
|
|
16
28
|
}
|
|
17
29
|
//# sourceMappingURL=jira-env.js.map
|
package/dist/lib/jira-env.js.map
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira-env.js","sourceRoot":"","sources":["../../src/lib/jira-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;
|
|
1
|
+
{"version":3,"file":"jira-env.js","sourceRoot":"","sources":["../../src/lib/jira-env.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAKH,MAAM,UAAU,cAAc;IAC5B,MAAM,GAAG,GAAG,OAAO,CAAC,GAAG,CAAC,aAAa,CAAA;IACrC,IAAI,CAAC,GAAG;QAAE,MAAM,IAAI,KAAK,CAAC,wCAAwC,CAAC,CAAA;IACnE,OAAO,GAAG,CAAC,OAAO,CAAC,KAAK,EAAE,EAAE,CAAC,CAAA;AAC/B,CAAC;AAED,MAAM,UAAU,eAAe;IAC7B,MAAM,KAAK,GAAG,OAAO,CAAC,GAAG,CAAC,UAAU,CAAA;IACpC,MAAM,MAAM,GAAG,OAAO,CAAC,GAAG,CAAC,WAAW,CAAA;IAEtC,IAAI,KAAK,IAAI,MAAM,EAAE,CAAC;QACpB,MAAM,IAAI,KAAK,CAAC,6EAA6E,CAAC,CAAA;IAChG,CAAC;IACD,IAAI,CAAC,KAAK,IAAI,CAAC,MAAM,EAAE,CAAC;QACtB,MAAM,IAAI,KAAK,CAAC,+EAA+E,CAAC,CAAA;IAClG,CAAC;IAED,OAAO,KAAK,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,OAAO,EAAE,KAAK,EAAE,KAAK,EAAE,CAAC,CAAC,CAAC,EAAE,IAAI,EAAE,QAAQ,EAAE,KAAK,EAAE,MAAgB,EAAE,CAAA;AAC9F,CAAC;AAED,MAAM,UAAU,iBAAiB;IAC/B,MAAM,OAAO,GAAG,OAAO,CAAC,GAAG,CAAC,gBAAgB,CAAA;IAC5C,IAAI,OAAO,IAAI,OAAO,KAAK,GAAG,IAAI,OAAO,KAAK,GAAG,EAAE,CAAC;QAClD,MAAM,IAAI,KAAK,CAAC,4CAA4C,CAAC,CAAA;IAC/D,CAAC;IACD,OAAO,CAAC,OAAO,IAAI,GAAG,CAAmB,CAAA,CAAC,cAAc;AAC1D,CAAC"}
|
|
@@ -1,9 +1,36 @@
|
|
|
1
|
-
import type { JiraIssue, JiraJqlResponse, JiraProfileResponse, JiraProjectsListResponse, JiraTransitionsResponse } from './types.js';
|
|
1
|
+
import type { JiraComment, JiraCreateIssueResponse, JiraCreateMetadata, JiraEnhancedJqlResponse, JiraIssue, JiraJqlResponse, JiraProfileResponse, JiraProjectsListResponse, JiraTransitionsResponse } from './types.js';
|
|
2
2
|
export declare const getIssue: (issueIdOrKey: string, fields?: string[], expand?: string[]) => Promise<JiraIssue>;
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Execute JQL search using enhanced search endpoint (v3) or legacy search (v2)
|
|
5
|
+
* In v3, uses /rest/api/3/search/jql with nextPageToken pagination
|
|
6
|
+
* In v2, uses /rest/api/2/search with startAt pagination
|
|
7
|
+
*/
|
|
8
|
+
export declare const executeJql: (jql: string, maxResults?: number, startAt?: number, fields?: string[], nextPageToken?: string) => Promise<JiraEnhancedJqlResponse> | Promise<JiraJqlResponse>;
|
|
4
9
|
export declare const getLatestProjects: (maxResults?: number) => Promise<JiraProjectsListResponse>;
|
|
5
10
|
export declare const getCurrentProfile: () => Promise<JiraProfileResponse>;
|
|
6
11
|
export declare const getTicketTransitions: (issueIdOrKey: string) => Promise<JiraTransitionsResponse>;
|
|
7
12
|
export declare const setIssueStatus: (issueIdOrKey: string, transitionId: string, comment?: string) => Promise<void>;
|
|
8
13
|
export declare const findTransitionIdByName: (issueIdOrKey: string, statusName: string) => Promise<string | undefined>;
|
|
14
|
+
export declare const getCreateMetadata: (projectKey?: string, issueTypeId?: string) => Promise<JiraCreateMetadata>;
|
|
15
|
+
export declare const createIssue: (params: {
|
|
16
|
+
projectKey: string;
|
|
17
|
+
issueTypeId: string;
|
|
18
|
+
summary: string;
|
|
19
|
+
description?: string;
|
|
20
|
+
assigneeId?: string;
|
|
21
|
+
priorityId?: string;
|
|
22
|
+
labels?: string[];
|
|
23
|
+
parentKey?: string;
|
|
24
|
+
}) => Promise<JiraCreateIssueResponse>;
|
|
25
|
+
export declare const updateIssue: (issueIdOrKey: string, updates: {
|
|
26
|
+
summary?: string;
|
|
27
|
+
description?: string;
|
|
28
|
+
assigneeId?: string | null;
|
|
29
|
+
priorityId?: string;
|
|
30
|
+
labels?: string[];
|
|
31
|
+
}) => Promise<void>;
|
|
32
|
+
export declare const addComment: (issueIdOrKey: string, commentText: string, visibility?: {
|
|
33
|
+
type: "role" | "group";
|
|
34
|
+
value: string;
|
|
35
|
+
}) => Promise<JiraComment>;
|
|
9
36
|
//# sourceMappingURL=jira.service.d.ts.map
|
|
@@ -1 +1 @@
|
|
|
1
|
-
{"version":3,"file":"jira.service.d.ts","sourceRoot":"","sources":["../../src/lib/jira.service.ts"],"names":[],"mappings":"
|
|
1
|
+
{"version":3,"file":"jira.service.d.ts","sourceRoot":"","sources":["../../src/lib/jira.service.ts"],"names":[],"mappings":"AAGA,OAAO,KAAK,EACV,WAAW,EACX,uBAAuB,EACvB,kBAAkB,EAClB,uBAAuB,EACvB,SAAS,EACT,eAAe,EACf,mBAAmB,EACnB,wBAAwB,EACxB,uBAAuB,EACxB,MAAM,YAAY,CAAA;AAkEnB,eAAO,MAAM,QAAQ,GAAI,cAAc,MAAM,EAAE,SAAS,MAAM,EAAE,EAAE,SAAS,MAAM,EAAE,uBAKlF,CAAA;AAED;;;;GAIG;AACH,eAAO,MAAM,UAAU,GAAI,KAAK,MAAM,EAAE,mBAAe,EAAE,gBAAW,EAAE,SAAS,MAAM,EAAE,EAAE,gBAAgB,MAAM,gEAqB9G,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAI,mBAAe,sCAIhD,CAAA;AAED,eAAO,MAAM,iBAAiB,oCAE7B,CAAA;AAED,eAAO,MAAM,oBAAoB,GAAI,cAAc,MAAM,qCAExD,CAAA;AAED,eAAO,MAAM,cAAc,GAAU,cAAc,MAAM,EAAE,cAAc,MAAM,EAAE,UAAU,MAAM,kBAShG,CAAA;AAED,eAAO,MAAM,sBAAsB,GAAU,cAAc,MAAM,EAAE,YAAY,MAAM,KAAG,OAAO,CAAC,MAAM,GAAG,SAAS,CAIjH,CAAA;AAED,eAAO,MAAM,iBAAiB,GAAU,aAAa,MAAM,EAAE,cAAc,MAAM,gCAOhF,CAAA;AAED,eAAO,MAAM,WAAW,GAAU,QAAQ;IACxC,UAAU,EAAE,MAAM,CAAA;IAClB,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