@generacy-ai/generacy-plugin-jira 0.0.0-preview-20260304013206
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 +191 -0
- package/dist/client.d.ts +81 -0
- package/dist/client.d.ts.map +1 -0
- package/dist/client.js +163 -0
- package/dist/client.js.map +1 -0
- package/dist/index.d.ts +19 -0
- package/dist/index.d.ts.map +1 -0
- package/dist/index.js +26 -0
- package/dist/index.js.map +1 -0
- package/dist/operations/comments.d.ts +35 -0
- package/dist/operations/comments.d.ts.map +1 -0
- package/dist/operations/comments.js +128 -0
- package/dist/operations/comments.js.map +1 -0
- package/dist/operations/custom-fields.d.ts +48 -0
- package/dist/operations/custom-fields.d.ts.map +1 -0
- package/dist/operations/custom-fields.js +184 -0
- package/dist/operations/custom-fields.js.map +1 -0
- package/dist/operations/issues.d.ts +34 -0
- package/dist/operations/issues.d.ts.map +1 -0
- package/dist/operations/issues.js +215 -0
- package/dist/operations/issues.js.map +1 -0
- package/dist/operations/search.d.ts +47 -0
- package/dist/operations/search.d.ts.map +1 -0
- package/dist/operations/search.js +174 -0
- package/dist/operations/search.js.map +1 -0
- package/dist/operations/sprints.d.ts +54 -0
- package/dist/operations/sprints.d.ts.map +1 -0
- package/dist/operations/sprints.js +196 -0
- package/dist/operations/sprints.js.map +1 -0
- package/dist/operations/transitions.d.ts +41 -0
- package/dist/operations/transitions.d.ts.map +1 -0
- package/dist/operations/transitions.js +135 -0
- package/dist/operations/transitions.js.map +1 -0
- package/dist/plugin.d.ts +221 -0
- package/dist/plugin.d.ts.map +1 -0
- package/dist/plugin.js +403 -0
- package/dist/plugin.js.map +1 -0
- package/dist/types/config.d.ts +149 -0
- package/dist/types/config.d.ts.map +1 -0
- package/dist/types/config.js +33 -0
- package/dist/types/config.js.map +1 -0
- package/dist/types/custom-fields.d.ts +48 -0
- package/dist/types/custom-fields.d.ts.map +1 -0
- package/dist/types/custom-fields.js +2 -0
- package/dist/types/custom-fields.js.map +1 -0
- package/dist/types/events.d.ts +250 -0
- package/dist/types/events.d.ts.map +1 -0
- package/dist/types/events.js +2 -0
- package/dist/types/events.js.map +1 -0
- package/dist/types/index.d.ts +9 -0
- package/dist/types/index.d.ts.map +1 -0
- package/dist/types/index.js +2 -0
- package/dist/types/index.js.map +1 -0
- package/dist/types/issues.d.ts +139 -0
- package/dist/types/issues.d.ts.map +1 -0
- package/dist/types/issues.js +2 -0
- package/dist/types/issues.js.map +1 -0
- package/dist/types/projects.d.ts +48 -0
- package/dist/types/projects.d.ts.map +1 -0
- package/dist/types/projects.js +2 -0
- package/dist/types/projects.js.map +1 -0
- package/dist/types/sprints.d.ts +26 -0
- package/dist/types/sprints.d.ts.map +1 -0
- package/dist/types/sprints.js +2 -0
- package/dist/types/sprints.js.map +1 -0
- package/dist/types/workflows.d.ts +60 -0
- package/dist/types/workflows.d.ts.map +1 -0
- package/dist/types/workflows.js +2 -0
- package/dist/types/workflows.js.map +1 -0
- package/dist/utils/adf.d.ts +26 -0
- package/dist/utils/adf.d.ts.map +1 -0
- package/dist/utils/adf.js +104 -0
- package/dist/utils/adf.js.map +1 -0
- package/dist/utils/errors.d.ts +60 -0
- package/dist/utils/errors.d.ts.map +1 -0
- package/dist/utils/errors.js +117 -0
- package/dist/utils/errors.js.map +1 -0
- package/dist/utils/jql-builder.d.ts +148 -0
- package/dist/utils/jql-builder.d.ts.map +1 -0
- package/dist/utils/jql-builder.js +264 -0
- package/dist/utils/jql-builder.js.map +1 -0
- package/dist/utils/validation.d.ts +31 -0
- package/dist/utils/validation.d.ts.map +1 -0
- package/dist/utils/validation.js +75 -0
- package/dist/utils/validation.js.map +1 -0
- package/dist/webhooks/handler.d.ts +80 -0
- package/dist/webhooks/handler.d.ts.map +1 -0
- package/dist/webhooks/handler.js +130 -0
- package/dist/webhooks/handler.js.map +1 -0
- package/dist/webhooks/parser.d.ts +34 -0
- package/dist/webhooks/parser.d.ts.map +1 -0
- package/dist/webhooks/parser.js +155 -0
- package/dist/webhooks/parser.js.map +1 -0
- package/dist/webhooks/types.d.ts +94 -0
- package/dist/webhooks/types.d.ts.map +1 -0
- package/dist/webhooks/types.js +2 -0
- package/dist/webhooks/types.js.map +1 -0
- package/dist/webhooks/verify.d.ts +53 -0
- package/dist/webhooks/verify.d.ts.map +1 -0
- package/dist/webhooks/verify.js +140 -0
- package/dist/webhooks/verify.js.map +1 -0
- package/package.json +58 -0
package/dist/plugin.js
ADDED
|
@@ -0,0 +1,403 @@
|
|
|
1
|
+
import { AbstractIssueTrackerPlugin } from '@generacy-ai/latency-plugin-issue-tracker';
|
|
2
|
+
import { createClient } from './client.js';
|
|
3
|
+
import { createIssueOperations } from './operations/issues.js';
|
|
4
|
+
import { createSearchOperations } from './operations/search.js';
|
|
5
|
+
import { createCommentOperations } from './operations/comments.js';
|
|
6
|
+
import { createTransitionOperations } from './operations/transitions.js';
|
|
7
|
+
import { createCustomFieldOperations } from './operations/custom-fields.js';
|
|
8
|
+
import { createSprintOperations } from './operations/sprints.js';
|
|
9
|
+
import { createWebhookHandler, } from './webhooks/handler.js';
|
|
10
|
+
/**
|
|
11
|
+
* Jira Plugin for Generacy
|
|
12
|
+
*
|
|
13
|
+
* Extends AbstractIssueTrackerPlugin to provide the standard IssueTracker interface
|
|
14
|
+
* while also exposing Jira-specific functionality.
|
|
15
|
+
*
|
|
16
|
+
* Provides programmatic access to Jira functionality including:
|
|
17
|
+
* - Issue CRUD operations (via IssueTracker interface)
|
|
18
|
+
* - JQL search with async iteration
|
|
19
|
+
* - Workflow transitions
|
|
20
|
+
* - Custom field management
|
|
21
|
+
* - Sprint operations
|
|
22
|
+
* - Webhook event processing
|
|
23
|
+
*/
|
|
24
|
+
export class JiraPlugin extends AbstractIssueTrackerPlugin {
|
|
25
|
+
client;
|
|
26
|
+
issueOps;
|
|
27
|
+
searchOps;
|
|
28
|
+
commentOps;
|
|
29
|
+
transitionOps;
|
|
30
|
+
customFieldOps;
|
|
31
|
+
sprintOps;
|
|
32
|
+
webhookHandler;
|
|
33
|
+
defaultProjectKey;
|
|
34
|
+
constructor(config) {
|
|
35
|
+
super({ cacheTimeout: config.cacheTimeout ?? 60000 });
|
|
36
|
+
this.client = createClient(config);
|
|
37
|
+
this.defaultProjectKey = config.projectKey;
|
|
38
|
+
this.issueOps = createIssueOperations(this.client);
|
|
39
|
+
this.searchOps = createSearchOperations(this.client);
|
|
40
|
+
this.commentOps = createCommentOperations(this.client);
|
|
41
|
+
this.transitionOps = createTransitionOperations(this.client);
|
|
42
|
+
this.customFieldOps = createCustomFieldOperations(this.client);
|
|
43
|
+
this.sprintOps = createSprintOperations(this.client);
|
|
44
|
+
const webhookConfig = {
|
|
45
|
+
webhookSecret: config.webhookSecret,
|
|
46
|
+
};
|
|
47
|
+
this.webhookHandler = createWebhookHandler(webhookConfig);
|
|
48
|
+
}
|
|
49
|
+
// ==========================================================================
|
|
50
|
+
// AbstractIssueTrackerPlugin abstract method implementations
|
|
51
|
+
// ==========================================================================
|
|
52
|
+
/**
|
|
53
|
+
* Fetch a single issue from Jira (implements abstract method)
|
|
54
|
+
*/
|
|
55
|
+
async fetchIssue(id) {
|
|
56
|
+
const issue = await this.issueOps.get(id);
|
|
57
|
+
return this.mapToLatencyIssue(issue);
|
|
58
|
+
}
|
|
59
|
+
/**
|
|
60
|
+
* Create a new issue in Jira (implements abstract method)
|
|
61
|
+
*/
|
|
62
|
+
async doCreateIssue(spec) {
|
|
63
|
+
if (!this.defaultProjectKey) {
|
|
64
|
+
throw new Error('projectKey is required to create issues');
|
|
65
|
+
}
|
|
66
|
+
const params = {
|
|
67
|
+
projectKey: this.defaultProjectKey,
|
|
68
|
+
summary: spec.title,
|
|
69
|
+
description: spec.body,
|
|
70
|
+
issueType: 'Task', // Default issue type
|
|
71
|
+
labels: spec.labels,
|
|
72
|
+
assignee: spec.assignees?.[0],
|
|
73
|
+
};
|
|
74
|
+
const issue = await this.issueOps.create(params);
|
|
75
|
+
return this.mapToLatencyIssue(issue);
|
|
76
|
+
}
|
|
77
|
+
/**
|
|
78
|
+
* Update an existing issue (implements abstract method)
|
|
79
|
+
*/
|
|
80
|
+
async doUpdateIssue(id, update) {
|
|
81
|
+
const params = {
|
|
82
|
+
summary: update.title,
|
|
83
|
+
description: update.body,
|
|
84
|
+
labels: update.labels,
|
|
85
|
+
assignee: update.assignees?.[0] ?? null,
|
|
86
|
+
};
|
|
87
|
+
// Handle state changes via transitions
|
|
88
|
+
if (update.state) {
|
|
89
|
+
const targetStatus = update.state === 'closed' ? 'Done' : 'To Do';
|
|
90
|
+
try {
|
|
91
|
+
await this.transitionOps.transitionToStatus(id, targetStatus);
|
|
92
|
+
}
|
|
93
|
+
catch {
|
|
94
|
+
// Transition may not be available - continue with other updates
|
|
95
|
+
}
|
|
96
|
+
}
|
|
97
|
+
const issue = await this.issueOps.update(id, params);
|
|
98
|
+
return this.mapToLatencyIssue(issue);
|
|
99
|
+
}
|
|
100
|
+
/**
|
|
101
|
+
* List issues matching the query (implements abstract method)
|
|
102
|
+
*/
|
|
103
|
+
async doListIssues(query) {
|
|
104
|
+
const jqlParts = [];
|
|
105
|
+
if (query.state && query.state !== 'all') {
|
|
106
|
+
jqlParts.push(query.state === 'closed'
|
|
107
|
+
? 'statusCategory = Done'
|
|
108
|
+
: 'statusCategory != Done');
|
|
109
|
+
}
|
|
110
|
+
if (query.labels && query.labels.length > 0) {
|
|
111
|
+
const labelClauses = query.labels.map((l) => `labels = "${l}"`);
|
|
112
|
+
jqlParts.push(`(${labelClauses.join(' AND ')})`);
|
|
113
|
+
}
|
|
114
|
+
if (query.assignee) {
|
|
115
|
+
jqlParts.push(`assignee = "${query.assignee}"`);
|
|
116
|
+
}
|
|
117
|
+
const jql = jqlParts.length > 0 ? jqlParts.join(' AND ') : 'ORDER BY created DESC';
|
|
118
|
+
const options = {
|
|
119
|
+
pageSize: query.limit ?? 30,
|
|
120
|
+
startAt: query.offset ?? 0,
|
|
121
|
+
};
|
|
122
|
+
const issues = await this.searchOps.searchAll(jql, options);
|
|
123
|
+
const latencyIssues = issues.map((issue) => this.mapToLatencyIssue(issue));
|
|
124
|
+
return {
|
|
125
|
+
items: latencyIssues,
|
|
126
|
+
total: latencyIssues.length,
|
|
127
|
+
hasMore: issues.length === (query.limit ?? 30),
|
|
128
|
+
};
|
|
129
|
+
}
|
|
130
|
+
/**
|
|
131
|
+
* Add a comment to an issue (implements abstract method)
|
|
132
|
+
*/
|
|
133
|
+
async doAddComment(issueId, comment) {
|
|
134
|
+
const jiraComment = await this.commentOps.add(issueId, comment);
|
|
135
|
+
return this.mapToLatencyComment(jiraComment);
|
|
136
|
+
}
|
|
137
|
+
/**
|
|
138
|
+
* List comments for an issue (implements abstract method)
|
|
139
|
+
*/
|
|
140
|
+
async doListComments(issueId) {
|
|
141
|
+
const comments = await this.commentOps.list(issueId);
|
|
142
|
+
return comments.map((c) => this.mapToLatencyComment(c));
|
|
143
|
+
}
|
|
144
|
+
// ==========================================================================
|
|
145
|
+
// Jira-specific public API (for backwards compatibility)
|
|
146
|
+
// ==========================================================================
|
|
147
|
+
/**
|
|
148
|
+
* Create a new issue (Jira-specific version with full return type)
|
|
149
|
+
*/
|
|
150
|
+
async createJiraIssue(params) {
|
|
151
|
+
return this.issueOps.create(params);
|
|
152
|
+
}
|
|
153
|
+
/**
|
|
154
|
+
* Get an issue by key or ID (Jira-specific version with full return type)
|
|
155
|
+
*/
|
|
156
|
+
async getJiraIssue(keyOrId) {
|
|
157
|
+
return this.issueOps.get(keyOrId);
|
|
158
|
+
}
|
|
159
|
+
/**
|
|
160
|
+
* Update an issue (Jira-specific version)
|
|
161
|
+
*/
|
|
162
|
+
async updateJiraIssue(keyOrId, params) {
|
|
163
|
+
return this.issueOps.update(keyOrId, params);
|
|
164
|
+
}
|
|
165
|
+
/**
|
|
166
|
+
* Delete an issue
|
|
167
|
+
*/
|
|
168
|
+
async deleteIssue(keyOrId, deleteSubtasks = false) {
|
|
169
|
+
return this.issueOps.delete(keyOrId, deleteSubtasks);
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Assign an issue to a user
|
|
173
|
+
*/
|
|
174
|
+
async assignIssue(keyOrId, accountId) {
|
|
175
|
+
return this.issueOps.assign(keyOrId, accountId);
|
|
176
|
+
}
|
|
177
|
+
// ==================== Search Operations ====================
|
|
178
|
+
/**
|
|
179
|
+
* Search issues using JQL (returns async iterator)
|
|
180
|
+
*/
|
|
181
|
+
searchJiraIssues(jql, options) {
|
|
182
|
+
return this.searchOps.search(jql, options);
|
|
183
|
+
}
|
|
184
|
+
/**
|
|
185
|
+
* Search issues and return all results as array
|
|
186
|
+
*/
|
|
187
|
+
async searchJiraIssuesAll(jql, options) {
|
|
188
|
+
return this.searchOps.searchAll(jql, options);
|
|
189
|
+
}
|
|
190
|
+
/**
|
|
191
|
+
* Count issues matching a JQL query
|
|
192
|
+
*/
|
|
193
|
+
async countIssues(jql) {
|
|
194
|
+
return this.searchOps.count(jql);
|
|
195
|
+
}
|
|
196
|
+
async addJiraComment(issueKey, bodyOrParams) {
|
|
197
|
+
if (typeof bodyOrParams === 'string' || ('version' in bodyOrParams && bodyOrParams.version === 1)) {
|
|
198
|
+
return this.commentOps.add(issueKey, bodyOrParams);
|
|
199
|
+
}
|
|
200
|
+
return this.commentOps.add(issueKey, bodyOrParams);
|
|
201
|
+
}
|
|
202
|
+
/**
|
|
203
|
+
* Get all comments for an issue
|
|
204
|
+
*/
|
|
205
|
+
async getComments(issueKey) {
|
|
206
|
+
return this.commentOps.list(issueKey);
|
|
207
|
+
}
|
|
208
|
+
/**
|
|
209
|
+
* Update a comment
|
|
210
|
+
*/
|
|
211
|
+
async updateComment(issueKey, commentId, body) {
|
|
212
|
+
return this.commentOps.update(issueKey, commentId, body);
|
|
213
|
+
}
|
|
214
|
+
/**
|
|
215
|
+
* Delete a comment
|
|
216
|
+
*/
|
|
217
|
+
async deleteComment(issueKey, commentId) {
|
|
218
|
+
return this.commentOps.delete(issueKey, commentId);
|
|
219
|
+
}
|
|
220
|
+
// ==================== Transition Operations ====================
|
|
221
|
+
/**
|
|
222
|
+
* Get available transitions for an issue
|
|
223
|
+
*/
|
|
224
|
+
async getTransitions(issueKey) {
|
|
225
|
+
return this.transitionOps.getTransitions(issueKey);
|
|
226
|
+
}
|
|
227
|
+
async transitionIssue(issueKey, transitionIdOrParams, options) {
|
|
228
|
+
if (typeof transitionIdOrParams === 'string') {
|
|
229
|
+
return this.transitionOps.transition(issueKey, transitionIdOrParams, options);
|
|
230
|
+
}
|
|
231
|
+
return this.transitionOps.transition(issueKey, transitionIdOrParams);
|
|
232
|
+
}
|
|
233
|
+
/**
|
|
234
|
+
* Transition an issue to a specific status by name
|
|
235
|
+
*/
|
|
236
|
+
async transitionToStatus(issueKey, statusName, options) {
|
|
237
|
+
return this.transitionOps.transitionToStatus(issueKey, statusName, options);
|
|
238
|
+
}
|
|
239
|
+
// ==================== Custom Field Operations ====================
|
|
240
|
+
/**
|
|
241
|
+
* Get all custom fields
|
|
242
|
+
*/
|
|
243
|
+
async getCustomFields() {
|
|
244
|
+
return this.customFieldOps.getAll();
|
|
245
|
+
}
|
|
246
|
+
/**
|
|
247
|
+
* Get a custom field by ID
|
|
248
|
+
*/
|
|
249
|
+
async getCustomField(fieldId) {
|
|
250
|
+
return this.customFieldOps.get(fieldId);
|
|
251
|
+
}
|
|
252
|
+
/**
|
|
253
|
+
* Set a custom field value
|
|
254
|
+
*/
|
|
255
|
+
async setCustomField(issueKey, fieldId, value) {
|
|
256
|
+
return this.customFieldOps.setValue(issueKey, fieldId, value);
|
|
257
|
+
}
|
|
258
|
+
// ==================== Sprint Operations ====================
|
|
259
|
+
/**
|
|
260
|
+
* Get the active sprint for a board
|
|
261
|
+
*/
|
|
262
|
+
async getActiveSprint(boardId) {
|
|
263
|
+
return this.sprintOps.getActiveSprint(boardId);
|
|
264
|
+
}
|
|
265
|
+
/**
|
|
266
|
+
* Get all sprints for a board
|
|
267
|
+
*/
|
|
268
|
+
async getSprintsForBoard(boardId) {
|
|
269
|
+
return this.sprintOps.getSprintsForBoard(boardId);
|
|
270
|
+
}
|
|
271
|
+
/**
|
|
272
|
+
* Add an issue to a sprint
|
|
273
|
+
*/
|
|
274
|
+
async addToSprint(issueKey, sprintId) {
|
|
275
|
+
return this.sprintOps.addIssueToSprint(issueKey, sprintId);
|
|
276
|
+
}
|
|
277
|
+
/**
|
|
278
|
+
* Get boards for a project
|
|
279
|
+
*/
|
|
280
|
+
async getBoardsForProject(projectKey) {
|
|
281
|
+
return this.sprintOps.getBoardsForProject(projectKey);
|
|
282
|
+
}
|
|
283
|
+
// ==================== Webhook Operations ====================
|
|
284
|
+
/**
|
|
285
|
+
* Handle a webhook event
|
|
286
|
+
* Returns the parsed action from the event
|
|
287
|
+
*/
|
|
288
|
+
async handleWebhook(event) {
|
|
289
|
+
const result = await this.webhookHandler.processEvent(event);
|
|
290
|
+
return result.action;
|
|
291
|
+
}
|
|
292
|
+
/**
|
|
293
|
+
* Handle a raw webhook payload
|
|
294
|
+
*/
|
|
295
|
+
async handleRawWebhook(payload) {
|
|
296
|
+
const result = await this.webhookHandler.handle(payload);
|
|
297
|
+
return result.action;
|
|
298
|
+
}
|
|
299
|
+
// ==================== Utility Methods ====================
|
|
300
|
+
/**
|
|
301
|
+
* Verify authentication
|
|
302
|
+
*/
|
|
303
|
+
async verifyAuth() {
|
|
304
|
+
return this.client.verifyAuth();
|
|
305
|
+
}
|
|
306
|
+
/**
|
|
307
|
+
* Check connectivity
|
|
308
|
+
*/
|
|
309
|
+
async checkConnection() {
|
|
310
|
+
return this.client.checkConnection();
|
|
311
|
+
}
|
|
312
|
+
/**
|
|
313
|
+
* Get the Jira host URL
|
|
314
|
+
*/
|
|
315
|
+
get host() {
|
|
316
|
+
return this.client.host;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* Get the default project key
|
|
320
|
+
*/
|
|
321
|
+
get projectKey() {
|
|
322
|
+
return this.client.projectKey;
|
|
323
|
+
}
|
|
324
|
+
/**
|
|
325
|
+
* Access to underlying operations for advanced usage
|
|
326
|
+
*/
|
|
327
|
+
get operations() {
|
|
328
|
+
return {
|
|
329
|
+
issues: this.issueOps,
|
|
330
|
+
search: this.searchOps,
|
|
331
|
+
comments: this.commentOps,
|
|
332
|
+
transitions: this.transitionOps,
|
|
333
|
+
customFields: this.customFieldOps,
|
|
334
|
+
sprints: this.sprintOps,
|
|
335
|
+
};
|
|
336
|
+
}
|
|
337
|
+
/**
|
|
338
|
+
* Access to webhook handler for advanced usage
|
|
339
|
+
*/
|
|
340
|
+
get webhook() {
|
|
341
|
+
return this.webhookHandler;
|
|
342
|
+
}
|
|
343
|
+
// ==========================================================================
|
|
344
|
+
// Private helper methods
|
|
345
|
+
// ==========================================================================
|
|
346
|
+
/**
|
|
347
|
+
* Map a Jira Issue to the Latency Issue type
|
|
348
|
+
*/
|
|
349
|
+
mapToLatencyIssue(issue) {
|
|
350
|
+
const isClosed = issue.status.statusCategory.key === 'done';
|
|
351
|
+
return {
|
|
352
|
+
id: issue.key,
|
|
353
|
+
title: issue.summary,
|
|
354
|
+
body: this.adfToString(issue.description),
|
|
355
|
+
state: isClosed ? 'closed' : 'open',
|
|
356
|
+
labels: issue.labels,
|
|
357
|
+
assignees: issue.assignee ? [issue.assignee.displayName] : [],
|
|
358
|
+
createdAt: new Date(issue.created),
|
|
359
|
+
updatedAt: new Date(issue.updated),
|
|
360
|
+
};
|
|
361
|
+
}
|
|
362
|
+
/**
|
|
363
|
+
* Map a Jira Comment to the Latency Comment type
|
|
364
|
+
*/
|
|
365
|
+
mapToLatencyComment(comment) {
|
|
366
|
+
return {
|
|
367
|
+
id: comment.id,
|
|
368
|
+
body: this.adfToString(comment.body),
|
|
369
|
+
author: comment.author.displayName,
|
|
370
|
+
createdAt: new Date(comment.created),
|
|
371
|
+
};
|
|
372
|
+
}
|
|
373
|
+
/**
|
|
374
|
+
* Convert ADF document to plain string
|
|
375
|
+
*/
|
|
376
|
+
adfToString(adf) {
|
|
377
|
+
if (!adf)
|
|
378
|
+
return '';
|
|
379
|
+
if (typeof adf === 'string')
|
|
380
|
+
return adf;
|
|
381
|
+
// Simple ADF to string conversion - extract text content
|
|
382
|
+
const extractText = (nodes) => {
|
|
383
|
+
return nodes.map((node) => {
|
|
384
|
+
const n = node;
|
|
385
|
+
if (n.type === 'text' && n.text) {
|
|
386
|
+
return n.text;
|
|
387
|
+
}
|
|
388
|
+
if (n.content && Array.isArray(n.content)) {
|
|
389
|
+
return extractText(n.content);
|
|
390
|
+
}
|
|
391
|
+
return '';
|
|
392
|
+
}).join('');
|
|
393
|
+
};
|
|
394
|
+
return extractText(adf.content);
|
|
395
|
+
}
|
|
396
|
+
}
|
|
397
|
+
/**
|
|
398
|
+
* Create a new Jira plugin instance
|
|
399
|
+
*/
|
|
400
|
+
export function createPlugin(config) {
|
|
401
|
+
return new JiraPlugin(config);
|
|
402
|
+
}
|
|
403
|
+
//# sourceMappingURL=plugin.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"plugin.js","sourceRoot":"","sources":["../src/plugin.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,0BAA0B,EAAE,MAAM,2CAA2C,CAAC;AAgBvF,OAAO,EAAc,YAAY,EAAE,MAAM,aAAa,CAAC;AACvD,OAAO,EAAmB,qBAAqB,EAAE,MAAM,wBAAwB,CAAC;AAChF,OAAO,EAAoB,sBAAsB,EAAE,MAAM,wBAAwB,CAAC;AAClF,OAAO,EAAqB,uBAAuB,EAAE,MAAM,0BAA0B,CAAC;AACtF,OAAO,EAAwB,0BAA0B,EAAE,MAAM,6BAA6B,CAAC;AAC/F,OAAO,EAAyB,2BAA2B,EAAE,MAAM,+BAA+B,CAAC;AACnG,OAAO,EAAoB,sBAAsB,EAAE,MAAM,yBAAyB,CAAC;AACnF,OAAO,EAEL,oBAAoB,GAErB,MAAM,uBAAuB,CAAC;AAG/B;;;;;;;;;;;;;GAaG;AACH,MAAM,OAAO,UAAW,SAAQ,0BAA0B;IACvC,MAAM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AAED;;GAEG;AACH,MAAM,UAAU,YAAY,CAAC,MAAkB;IAC7C,OAAO,IAAI,UAAU,CAAC,MAAM,CAAC,CAAC;AAChC,CAAC"}
|
|
@@ -0,0 +1,149 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Jira plugin configuration
|
|
4
|
+
*/
|
|
5
|
+
export interface JiraConfig {
|
|
6
|
+
/** Jira Cloud host URL (e.g., "https://company.atlassian.net") */
|
|
7
|
+
host: string;
|
|
8
|
+
/** Atlassian account email */
|
|
9
|
+
email: string;
|
|
10
|
+
/** Jira API token */
|
|
11
|
+
apiToken: string;
|
|
12
|
+
/** Default project key for operations */
|
|
13
|
+
projectKey?: string;
|
|
14
|
+
/** Map Generacy issue types to Jira issue types */
|
|
15
|
+
issueTypeMapping?: {
|
|
16
|
+
feature: string;
|
|
17
|
+
bug: string;
|
|
18
|
+
task: string;
|
|
19
|
+
epic: string;
|
|
20
|
+
};
|
|
21
|
+
/** Map workflow states to Jira status IDs */
|
|
22
|
+
workflowMapping?: {
|
|
23
|
+
todo: string;
|
|
24
|
+
inProgress: string;
|
|
25
|
+
done: string;
|
|
26
|
+
};
|
|
27
|
+
/** Webhook secret for signature verification */
|
|
28
|
+
webhookSecret?: string;
|
|
29
|
+
/** Timeout for API requests (ms) */
|
|
30
|
+
timeout?: number;
|
|
31
|
+
/** Cache TTL in milliseconds for issue caching (default: 60000) */
|
|
32
|
+
cacheTimeout?: number;
|
|
33
|
+
}
|
|
34
|
+
/**
|
|
35
|
+
* Issue type mapping configuration schema
|
|
36
|
+
*/
|
|
37
|
+
export declare const IssueTypeMappingSchema: z.ZodObject<{
|
|
38
|
+
feature: z.ZodDefault<z.ZodString>;
|
|
39
|
+
bug: z.ZodDefault<z.ZodString>;
|
|
40
|
+
task: z.ZodDefault<z.ZodString>;
|
|
41
|
+
epic: z.ZodDefault<z.ZodString>;
|
|
42
|
+
}, "strip", z.ZodTypeAny, {
|
|
43
|
+
feature: string;
|
|
44
|
+
bug: string;
|
|
45
|
+
task: string;
|
|
46
|
+
epic: string;
|
|
47
|
+
}, {
|
|
48
|
+
feature?: string | undefined;
|
|
49
|
+
bug?: string | undefined;
|
|
50
|
+
task?: string | undefined;
|
|
51
|
+
epic?: string | undefined;
|
|
52
|
+
}>;
|
|
53
|
+
/**
|
|
54
|
+
* Workflow mapping configuration schema
|
|
55
|
+
*/
|
|
56
|
+
export declare const WorkflowMappingSchema: z.ZodObject<{
|
|
57
|
+
todo: z.ZodString;
|
|
58
|
+
inProgress: z.ZodString;
|
|
59
|
+
done: z.ZodString;
|
|
60
|
+
}, "strip", z.ZodTypeAny, {
|
|
61
|
+
todo: string;
|
|
62
|
+
inProgress: string;
|
|
63
|
+
done: string;
|
|
64
|
+
}, {
|
|
65
|
+
todo: string;
|
|
66
|
+
inProgress: string;
|
|
67
|
+
done: string;
|
|
68
|
+
}>;
|
|
69
|
+
/**
|
|
70
|
+
* Zod schema for configuration validation
|
|
71
|
+
*/
|
|
72
|
+
export declare const JiraConfigSchema: z.ZodObject<{
|
|
73
|
+
host: z.ZodString;
|
|
74
|
+
email: z.ZodString;
|
|
75
|
+
apiToken: z.ZodString;
|
|
76
|
+
projectKey: z.ZodOptional<z.ZodString>;
|
|
77
|
+
issueTypeMapping: z.ZodOptional<z.ZodObject<{
|
|
78
|
+
feature: z.ZodDefault<z.ZodString>;
|
|
79
|
+
bug: z.ZodDefault<z.ZodString>;
|
|
80
|
+
task: z.ZodDefault<z.ZodString>;
|
|
81
|
+
epic: z.ZodDefault<z.ZodString>;
|
|
82
|
+
}, "strip", z.ZodTypeAny, {
|
|
83
|
+
feature: string;
|
|
84
|
+
bug: string;
|
|
85
|
+
task: string;
|
|
86
|
+
epic: string;
|
|
87
|
+
}, {
|
|
88
|
+
feature?: string | undefined;
|
|
89
|
+
bug?: string | undefined;
|
|
90
|
+
task?: string | undefined;
|
|
91
|
+
epic?: string | undefined;
|
|
92
|
+
}>>;
|
|
93
|
+
workflowMapping: z.ZodOptional<z.ZodObject<{
|
|
94
|
+
todo: z.ZodString;
|
|
95
|
+
inProgress: z.ZodString;
|
|
96
|
+
done: z.ZodString;
|
|
97
|
+
}, "strip", z.ZodTypeAny, {
|
|
98
|
+
todo: string;
|
|
99
|
+
inProgress: string;
|
|
100
|
+
done: string;
|
|
101
|
+
}, {
|
|
102
|
+
todo: string;
|
|
103
|
+
inProgress: string;
|
|
104
|
+
done: string;
|
|
105
|
+
}>>;
|
|
106
|
+
webhookSecret: z.ZodOptional<z.ZodString>;
|
|
107
|
+
timeout: z.ZodOptional<z.ZodNumber>;
|
|
108
|
+
cacheTimeout: z.ZodOptional<z.ZodNumber>;
|
|
109
|
+
}, "strip", z.ZodTypeAny, {
|
|
110
|
+
host: string;
|
|
111
|
+
email: string;
|
|
112
|
+
apiToken: string;
|
|
113
|
+
projectKey?: string | undefined;
|
|
114
|
+
issueTypeMapping?: {
|
|
115
|
+
feature: string;
|
|
116
|
+
bug: string;
|
|
117
|
+
task: string;
|
|
118
|
+
epic: string;
|
|
119
|
+
} | undefined;
|
|
120
|
+
workflowMapping?: {
|
|
121
|
+
todo: string;
|
|
122
|
+
inProgress: string;
|
|
123
|
+
done: string;
|
|
124
|
+
} | undefined;
|
|
125
|
+
webhookSecret?: string | undefined;
|
|
126
|
+
timeout?: number | undefined;
|
|
127
|
+
cacheTimeout?: number | undefined;
|
|
128
|
+
}, {
|
|
129
|
+
host: string;
|
|
130
|
+
email: string;
|
|
131
|
+
apiToken: string;
|
|
132
|
+
projectKey?: string | undefined;
|
|
133
|
+
issueTypeMapping?: {
|
|
134
|
+
feature?: string | undefined;
|
|
135
|
+
bug?: string | undefined;
|
|
136
|
+
task?: string | undefined;
|
|
137
|
+
epic?: string | undefined;
|
|
138
|
+
} | undefined;
|
|
139
|
+
workflowMapping?: {
|
|
140
|
+
todo: string;
|
|
141
|
+
inProgress: string;
|
|
142
|
+
done: string;
|
|
143
|
+
} | undefined;
|
|
144
|
+
webhookSecret?: string | undefined;
|
|
145
|
+
timeout?: number | undefined;
|
|
146
|
+
cacheTimeout?: number | undefined;
|
|
147
|
+
}>;
|
|
148
|
+
export type ValidatedJiraConfig = z.infer<typeof JiraConfigSchema>;
|
|
149
|
+
//# sourceMappingURL=config.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.d.ts","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,KAAK,CAAC;AAExB;;GAEG;AACH,MAAM,WAAW,UAAU;IACzB,kEAAkE;IAClE,IAAI,EAAE,MAAM,CAAC;IAEb,8BAA8B;IAC9B,KAAK,EAAE,MAAM,CAAC;IAEd,qBAAqB;IACrB,QAAQ,EAAE,MAAM,CAAC;IAEjB,yCAAyC;IACzC,UAAU,CAAC,EAAE,MAAM,CAAC;IAEpB,mDAAmD;IACnD,gBAAgB,CAAC,EAAE;QACjB,OAAO,EAAE,MAAM,CAAC;QAChB,GAAG,EAAE,MAAM,CAAC;QACZ,IAAI,EAAE,MAAM,CAAC;QACb,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,6CAA6C;IAC7C,eAAe,CAAC,EAAE;QAChB,IAAI,EAAE,MAAM,CAAC;QACb,UAAU,EAAE,MAAM,CAAC;QACnB,IAAI,EAAE,MAAM,CAAC;KACd,CAAC;IAEF,gDAAgD;IAChD,aAAa,CAAC,EAAE,MAAM,CAAC;IAEvB,oCAAoC;IACpC,OAAO,CAAC,EAAE,MAAM,CAAC;IAEjB,mEAAmE;IACnE,YAAY,CAAC,EAAE,MAAM,CAAC;CACvB;AAED;;GAEG;AACH,eAAO,MAAM,sBAAsB;;;;;;;;;;;;;;;EAKjC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,qBAAqB;;;;;;;;;;;;EAIhC,CAAC;AAEH;;GAEG;AACH,eAAO,MAAM,gBAAgB;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;EAU3B,CAAC;AAEH,MAAM,MAAM,mBAAmB,GAAG,CAAC,CAAC,KAAK,CAAC,OAAO,gBAAgB,CAAC,CAAC"}
|
|
@@ -0,0 +1,33 @@
|
|
|
1
|
+
import { z } from 'zod';
|
|
2
|
+
/**
|
|
3
|
+
* Issue type mapping configuration schema
|
|
4
|
+
*/
|
|
5
|
+
export const IssueTypeMappingSchema = z.object({
|
|
6
|
+
feature: z.string().default('Story'),
|
|
7
|
+
bug: z.string().default('Bug'),
|
|
8
|
+
task: z.string().default('Task'),
|
|
9
|
+
epic: z.string().default('Epic'),
|
|
10
|
+
});
|
|
11
|
+
/**
|
|
12
|
+
* Workflow mapping configuration schema
|
|
13
|
+
*/
|
|
14
|
+
export const WorkflowMappingSchema = z.object({
|
|
15
|
+
todo: z.string(),
|
|
16
|
+
inProgress: z.string(),
|
|
17
|
+
done: z.string(),
|
|
18
|
+
});
|
|
19
|
+
/**
|
|
20
|
+
* Zod schema for configuration validation
|
|
21
|
+
*/
|
|
22
|
+
export const JiraConfigSchema = z.object({
|
|
23
|
+
host: z.string().url('Host must be a valid URL'),
|
|
24
|
+
email: z.string().email('Valid email required'),
|
|
25
|
+
apiToken: z.string().min(1, 'API token is required'),
|
|
26
|
+
projectKey: z.string().regex(/^[A-Z][A-Z0-9_]*$/, 'Project key must start with uppercase letter').optional(),
|
|
27
|
+
issueTypeMapping: IssueTypeMappingSchema.optional(),
|
|
28
|
+
workflowMapping: WorkflowMappingSchema.optional(),
|
|
29
|
+
webhookSecret: z.string().optional(),
|
|
30
|
+
timeout: z.number().positive().optional(),
|
|
31
|
+
cacheTimeout: z.number().positive().optional(),
|
|
32
|
+
});
|
|
33
|
+
//# sourceMappingURL=config.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"config.js","sourceRoot":"","sources":["../../src/types/config.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,CAAC,EAAE,MAAM,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EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;IACzC,YAAY,EAAE,CAAC,CAAC,MAAM,EAAE,CAAC,QAAQ,EAAE,CAAC,QAAQ,EAAE;CAC/C,CAAC,CAAC"}
|
|
@@ -0,0 +1,48 @@
|
|
|
1
|
+
import type { FieldSchema } from './workflows.js';
|
|
2
|
+
/**
|
|
3
|
+
* Custom field type identifiers
|
|
4
|
+
*/
|
|
5
|
+
export type CustomFieldType = 'string' | 'number' | 'date' | 'datetime' | 'user' | 'select' | 'multiselect' | 'labels' | 'cascadingselect' | 'array';
|
|
6
|
+
/**
|
|
7
|
+
* Custom field definition
|
|
8
|
+
*/
|
|
9
|
+
export interface CustomField {
|
|
10
|
+
/** Field ID (e.g., "customfield_10001") */
|
|
11
|
+
id: string;
|
|
12
|
+
/** Field key (e.g., "com.atlassian.jira.plugin.system.customfieldtypes:textfield") */
|
|
13
|
+
key: string;
|
|
14
|
+
/** Human-readable name */
|
|
15
|
+
name: string;
|
|
16
|
+
/** Field description */
|
|
17
|
+
description: string | null;
|
|
18
|
+
/** Semantic type */
|
|
19
|
+
type: CustomFieldType;
|
|
20
|
+
/** Schema definition */
|
|
21
|
+
schema: FieldSchema;
|
|
22
|
+
}
|
|
23
|
+
/**
|
|
24
|
+
* Custom field option (for select fields)
|
|
25
|
+
*/
|
|
26
|
+
export interface CustomFieldOption {
|
|
27
|
+
id: string;
|
|
28
|
+
value: string;
|
|
29
|
+
disabled?: boolean;
|
|
30
|
+
}
|
|
31
|
+
/**
|
|
32
|
+
* Custom field context (where the field is available)
|
|
33
|
+
*/
|
|
34
|
+
export interface CustomFieldContext {
|
|
35
|
+
id: string;
|
|
36
|
+
name: string;
|
|
37
|
+
projectIds?: string[];
|
|
38
|
+
issueTypeIds?: string[];
|
|
39
|
+
}
|
|
40
|
+
/**
|
|
41
|
+
* Parameters for setting a custom field value
|
|
42
|
+
*/
|
|
43
|
+
export interface SetCustomFieldParams {
|
|
44
|
+
issueKey: string;
|
|
45
|
+
fieldId: string;
|
|
46
|
+
value: unknown;
|
|
47
|
+
}
|
|
48
|
+
//# sourceMappingURL=custom-fields.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-fields.d.ts","sourceRoot":"","sources":["../../src/types/custom-fields.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,WAAW,EAAE,MAAM,gBAAgB,CAAC;AAElD;;GAEG;AACH,MAAM,MAAM,eAAe,GACvB,QAAQ,GACR,QAAQ,GACR,MAAM,GACN,UAAU,GACV,MAAM,GACN,QAAQ,GACR,aAAa,GACb,QAAQ,GACR,iBAAiB,GACjB,OAAO,CAAC;AAEZ;;GAEG;AACH,MAAM,WAAW,WAAW;IAC1B,2CAA2C;IAC3C,EAAE,EAAE,MAAM,CAAC;IAEX,sFAAsF;IACtF,GAAG,EAAE,MAAM,CAAC;IAEZ,0BAA0B;IAC1B,IAAI,EAAE,MAAM,CAAC;IAEb,wBAAwB;IACxB,WAAW,EAAE,MAAM,GAAG,IAAI,CAAC;IAE3B,oBAAoB;IACpB,IAAI,EAAE,eAAe,CAAC;IAEtB,wBAAwB;IACxB,MAAM,EAAE,WAAW,CAAC;CACrB;AAED;;GAEG;AACH,MAAM,WAAW,iBAAiB;IAChC,EAAE,EAAE,MAAM,CAAC;IACX,KAAK,EAAE,MAAM,CAAC;IACd,QAAQ,CAAC,EAAE,OAAO,CAAC;CACpB;AAED;;GAEG;AACH,MAAM,WAAW,kBAAkB;IACjC,EAAE,EAAE,MAAM,CAAC;IACX,IAAI,EAAE,MAAM,CAAC;IACb,UAAU,CAAC,EAAE,MAAM,EAAE,CAAC;IACtB,YAAY,CAAC,EAAE,MAAM,EAAE,CAAC;CACzB;AAED;;GAEG;AACH,MAAM,WAAW,oBAAoB;IACnC,QAAQ,EAAE,MAAM,CAAC;IACjB,OAAO,EAAE,MAAM,CAAC;IAChB,KAAK,EAAE,OAAO,CAAC;CAChB"}
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-fields.js","sourceRoot":"","sources":["../../src/types/custom-fields.ts"],"names":[],"mappings":""}
|