@intentsolutions/blueprint 2.4.0 → 2.5.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.
@@ -0,0 +1,356 @@
1
+ /**
2
+ * Jira API Client
3
+ * REST client for Jira Cloud API
4
+ */
5
+ export class JiraClient {
6
+ baseUrl;
7
+ auth;
8
+ projectKey;
9
+ constructor(config) {
10
+ this.baseUrl = config.baseUrl.replace(/\/$/, '');
11
+ this.auth = Buffer.from(`${config.email}:${config.apiToken}`).toString('base64');
12
+ this.projectKey = config.projectKey;
13
+ }
14
+ /**
15
+ * Make an API request
16
+ */
17
+ async request(endpoint, options = {}) {
18
+ const url = endpoint.startsWith('http') ? endpoint : `${this.baseUrl}${endpoint}`;
19
+ const response = await fetch(url, {
20
+ ...options,
21
+ headers: {
22
+ 'Authorization': `Basic ${this.auth}`,
23
+ 'Content-Type': 'application/json',
24
+ 'Accept': 'application/json',
25
+ ...options.headers,
26
+ },
27
+ });
28
+ if (!response.ok) {
29
+ const errorBody = await response.text();
30
+ let errorMessage = `Jira API error: ${response.status} ${response.statusText}`;
31
+ try {
32
+ const errorJson = JSON.parse(errorBody);
33
+ if (errorJson.errorMessages) {
34
+ errorMessage += ` - ${errorJson.errorMessages.join(', ')}`;
35
+ }
36
+ if (errorJson.errors) {
37
+ errorMessage += ` - ${Object.values(errorJson.errors).join(', ')}`;
38
+ }
39
+ }
40
+ catch {
41
+ if (errorBody)
42
+ errorMessage += ` - ${errorBody}`;
43
+ }
44
+ throw new Error(errorMessage);
45
+ }
46
+ // Handle empty responses
47
+ const text = await response.text();
48
+ if (!text)
49
+ return {};
50
+ return JSON.parse(text);
51
+ }
52
+ /**
53
+ * Verify credentials and get current user
54
+ */
55
+ async verify() {
56
+ return this.request('/rest/api/3/myself');
57
+ }
58
+ /**
59
+ * Get project details
60
+ */
61
+ async getProject(projectKey) {
62
+ const key = projectKey || this.projectKey;
63
+ return this.request(`/rest/api/3/project/${key}`);
64
+ }
65
+ /**
66
+ * List all projects
67
+ */
68
+ async listProjects() {
69
+ const response = await this.request('/rest/api/3/project/search');
70
+ return response.values;
71
+ }
72
+ /**
73
+ * Get issue types for project
74
+ */
75
+ async getIssueTypes(projectKey) {
76
+ const key = projectKey || this.projectKey;
77
+ const project = await this.request(`/rest/api/3/project/${key}`);
78
+ return project.issueTypes;
79
+ }
80
+ /**
81
+ * Get available priorities
82
+ */
83
+ async getPriorities() {
84
+ return this.request('/rest/api/3/priority');
85
+ }
86
+ /**
87
+ * Get boards for project (Agile API)
88
+ */
89
+ async getBoards(projectKey) {
90
+ const key = projectKey || this.projectKey;
91
+ const response = await this.request(`/rest/agile/1.0/board?projectKeyOrId=${key}`);
92
+ return response.values;
93
+ }
94
+ /**
95
+ * Get sprints for a board
96
+ */
97
+ async getSprints(boardId, state) {
98
+ let endpoint = `/rest/agile/1.0/board/${boardId}/sprint`;
99
+ if (state)
100
+ endpoint += `?state=${state}`;
101
+ const response = await this.request(endpoint);
102
+ return response.values;
103
+ }
104
+ /**
105
+ * Create a sprint
106
+ */
107
+ async createSprint(input) {
108
+ return this.request('/rest/agile/1.0/sprint', {
109
+ method: 'POST',
110
+ body: JSON.stringify({
111
+ name: input.name,
112
+ originBoardId: input.boardId,
113
+ startDate: input.startDate,
114
+ endDate: input.endDate,
115
+ goal: input.goal,
116
+ }),
117
+ });
118
+ }
119
+ /**
120
+ * Get components for project
121
+ */
122
+ async getComponents(projectKey) {
123
+ const key = projectKey || this.projectKey;
124
+ return this.request(`/rest/api/3/project/${key}/components`);
125
+ }
126
+ /**
127
+ * Create a component
128
+ */
129
+ async createComponent(name, description, projectKey) {
130
+ const key = projectKey || this.projectKey;
131
+ return this.request('/rest/api/3/component', {
132
+ method: 'POST',
133
+ body: JSON.stringify({
134
+ name,
135
+ description,
136
+ project: key,
137
+ }),
138
+ });
139
+ }
140
+ /**
141
+ * Ensure components exist, create if missing
142
+ */
143
+ async ensureComponents(components, projectKey) {
144
+ const existing = await this.getComponents(projectKey);
145
+ const result = [];
146
+ for (const name of components) {
147
+ const found = existing.find(c => c.name.toLowerCase() === name.toLowerCase());
148
+ if (found) {
149
+ result.push(found);
150
+ }
151
+ else {
152
+ const created = await this.createComponent(name, undefined, projectKey);
153
+ result.push(created);
154
+ }
155
+ }
156
+ return result;
157
+ }
158
+ /**
159
+ * Get versions for project
160
+ */
161
+ async getVersions(projectKey) {
162
+ const key = projectKey || this.projectKey;
163
+ return this.request(`/rest/api/3/project/${key}/versions`);
164
+ }
165
+ /**
166
+ * Create a version (release)
167
+ */
168
+ async createVersion(input) {
169
+ return this.request('/rest/api/3/version', {
170
+ method: 'POST',
171
+ body: JSON.stringify({
172
+ name: input.name,
173
+ project: input.projectKey || this.projectKey,
174
+ description: input.description,
175
+ releaseDate: input.releaseDate,
176
+ released: input.released || false,
177
+ }),
178
+ });
179
+ }
180
+ /**
181
+ * Create an issue
182
+ */
183
+ async createIssue(input) {
184
+ const issueTypes = await this.getIssueTypes(input.projectKey);
185
+ const issueType = issueTypes.find(t => t.name.toLowerCase() === input.issueType.toLowerCase());
186
+ if (!issueType) {
187
+ throw new Error(`Issue type "${input.issueType}" not found in project. Available: ${issueTypes.map(t => t.name).join(', ')}`);
188
+ }
189
+ // Build the issue fields
190
+ const fields = {
191
+ project: { key: input.projectKey || this.projectKey },
192
+ summary: input.summary,
193
+ issuetype: { id: issueType.id },
194
+ };
195
+ // Add description in Atlassian Document Format (ADF)
196
+ if (input.description) {
197
+ fields.description = {
198
+ type: 'doc',
199
+ version: 1,
200
+ content: [
201
+ {
202
+ type: 'paragraph',
203
+ content: [
204
+ {
205
+ type: 'text',
206
+ text: input.description,
207
+ },
208
+ ],
209
+ },
210
+ ],
211
+ };
212
+ }
213
+ // Add parent for subtasks
214
+ if (input.parentKey) {
215
+ fields.parent = { key: input.parentKey };
216
+ }
217
+ // Add priority
218
+ if (input.priority) {
219
+ const priorities = await this.getPriorities();
220
+ const priority = priorities.find(p => p.name.toLowerCase() === input.priority.toLowerCase());
221
+ if (priority) {
222
+ fields.priority = { id: priority.id };
223
+ }
224
+ }
225
+ // Add labels
226
+ if (input.labels && input.labels.length > 0) {
227
+ fields.labels = input.labels;
228
+ }
229
+ // Add components
230
+ if (input.components && input.components.length > 0) {
231
+ const projectComponents = await this.getComponents(input.projectKey);
232
+ const componentIds = input.components
233
+ .map(name => projectComponents.find(c => c.name.toLowerCase() === name.toLowerCase()))
234
+ .filter((c) => !!c)
235
+ .map(c => ({ id: c.id }));
236
+ if (componentIds.length > 0) {
237
+ fields.components = componentIds;
238
+ }
239
+ }
240
+ // Add fix versions
241
+ if (input.fixVersions && input.fixVersions.length > 0) {
242
+ const versions = await this.getVersions(input.projectKey);
243
+ const versionIds = input.fixVersions
244
+ .map(name => versions.find(v => v.name.toLowerCase() === name.toLowerCase()))
245
+ .filter((v) => !!v)
246
+ .map(v => ({ id: v.id }));
247
+ if (versionIds.length > 0) {
248
+ fields.fixVersions = versionIds;
249
+ }
250
+ }
251
+ // Add custom fields
252
+ if (input.customFields) {
253
+ Object.assign(fields, input.customFields);
254
+ }
255
+ const response = await this.request('/rest/api/3/issue', {
256
+ method: 'POST',
257
+ body: JSON.stringify({ fields }),
258
+ });
259
+ // Fetch the created issue to get full details
260
+ return this.getIssue(response.key);
261
+ }
262
+ /**
263
+ * Get an issue by key
264
+ */
265
+ async getIssue(issueKey) {
266
+ return this.request(`/rest/api/3/issue/${issueKey}`);
267
+ }
268
+ /**
269
+ * Add issue to sprint
270
+ */
271
+ async addToSprint(sprintId, issueKeys) {
272
+ await this.request(`/rest/agile/1.0/sprint/${sprintId}/issue`, {
273
+ method: 'POST',
274
+ body: JSON.stringify({ issues: issueKeys }),
275
+ });
276
+ }
277
+ /**
278
+ * Link an issue to an epic
279
+ */
280
+ async linkToEpic(issueKey, epicKey) {
281
+ // In Jira Cloud, epic linking is done via the parent field for next-gen projects
282
+ // or via the Epic Link custom field for classic projects
283
+ // First, try to update the parent field (next-gen)
284
+ try {
285
+ await this.request(`/rest/api/3/issue/${issueKey}`, {
286
+ method: 'PUT',
287
+ body: JSON.stringify({
288
+ fields: {
289
+ parent: { key: epicKey },
290
+ },
291
+ }),
292
+ });
293
+ }
294
+ catch {
295
+ // If that fails, try the Epic Link approach (classic projects)
296
+ // Epic Link field ID varies by instance, commonly customfield_10014
297
+ try {
298
+ await this.request(`/rest/api/3/issue/${issueKey}`, {
299
+ method: 'PUT',
300
+ body: JSON.stringify({
301
+ fields: {
302
+ customfield_10014: epicKey,
303
+ },
304
+ }),
305
+ });
306
+ }
307
+ catch {
308
+ // Ignore epic linking errors - not all project types support it
309
+ }
310
+ }
311
+ }
312
+ /**
313
+ * Create multiple issues with hierarchy
314
+ */
315
+ async createIssuesWithHierarchy(tasks, options = {}) {
316
+ const issues = [];
317
+ for (const task of tasks) {
318
+ // Combine task-specific labels with global labels
319
+ const labels = [...(options.labels || []), ...(task.labels || [])];
320
+ const issue = await this.createIssue({
321
+ summary: task.summary,
322
+ description: task.description,
323
+ issueType: task.issueType,
324
+ projectKey: this.projectKey,
325
+ priority: task.priority,
326
+ labels: labels.length > 0 ? labels : undefined,
327
+ });
328
+ issues.push(issue);
329
+ // Link to epic if provided
330
+ if (options.epicKey && task.issueType !== 'Epic') {
331
+ await this.linkToEpic(issue.key, options.epicKey);
332
+ }
333
+ // Add to sprint if provided
334
+ if (options.sprintId) {
335
+ await this.addToSprint(options.sprintId, [issue.key]);
336
+ }
337
+ // Create subtasks
338
+ if (task.subtasks && task.subtasks.length > 0) {
339
+ for (const subtask of task.subtasks) {
340
+ const subIssue = await this.createIssue({
341
+ summary: subtask.summary,
342
+ description: subtask.description,
343
+ issueType: 'Sub-task',
344
+ projectKey: this.projectKey,
345
+ parentKey: issue.key,
346
+ priority: subtask.priority,
347
+ labels: labels.length > 0 ? labels : undefined,
348
+ });
349
+ issues.push(subIssue);
350
+ }
351
+ }
352
+ }
353
+ return issues;
354
+ }
355
+ }
356
+ //# sourceMappingURL=client.js.map
@@ -0,0 +1 @@
1
+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AAM,IAAI,CAAC,UAAU,CAAC,KAAK,CAAC,GAAG,EAAE,OAAO,CAAC,OAAO,CAAC,CAAC;YACpD,CAAC;YAED,4BAA4B;YAC5B,IAAI,OAAO,CAAC,QAAQ,EAAE,CAAC;gBACrB,MAAM,IAAI,CAAC,WAAW,CAAC,OAAO,CAAC,QAAQ,EAAE,CAAC,KAAK,CAAC,GAAG,CAAC,CAAC,CAAC;YACxD,CAAC;YAED,kBAAkB;YAClB,IAAI,IAAI,CAAC,QAAQ,IAAI,IAAI,CAAC,QAAQ,CAAC,MAAM,GAAG,CAAC,EAAE,CAAC;gBAC9C,KAAK,MAAM,OAAO,IAAI,IAAI,CAAC,QAAQ,EAAE,CAAC;oBACpC,MAAM,QAAQ,GAAG,MAAM,IAAI,CAAC,WAAW,CAAC;wBACtC,OAAO,EAAE,OAAO,CAAC,OAAO;wBACxB,WAAW,EAAE,OAAO,CAAC,WAAW;wBAChC,SAAS,EAAE,UAAU;wBACrB,UAAU,EAAE,IAAI,CAAC,UAAU;wBAC3B,SAAS,EAAE,KAAK,CAAC,GAAG;wBACpB,QAAQ,EAAE,OAAO,CAAC,QAAQ;wBAC1B,MAAM,EAAE,MAAM,CAAC,MAAM,GAAG,CAAC,CAAC,CAAC,CAAC,MAAM,CAAC,CAAC,CAAC,SAAS;qBAC/C,CAAC,CAAC;oBACH,MAAM,CAAC,IAAI,CAAC,QAAQ,CAAC,CAAC;gBACxB,CAAC;YACH,CAAC;QACH,CAAC;QAED,OAAO,MAAM,CAAC;IAChB,CAAC;CACF"}
@@ -0,0 +1,72 @@
1
+ /**
2
+ * Jira Exporter
3
+ * High-level export operations for Blueprint documents to Jira
4
+ */
5
+ import type { JiraConfig, JiraExportResult, JiraExportOptions } from './types.js';
6
+ export declare class JiraExporter {
7
+ private client;
8
+ private projectKey;
9
+ constructor(config: JiraConfig);
10
+ /**
11
+ * Export Blueprint documents to Jira
12
+ */
13
+ export(documents: Array<{
14
+ name: string;
15
+ content: string;
16
+ }>, options?: JiraExportOptions): Promise<JiraExportResult>;
17
+ /**
18
+ * Preview what would be created (dry run)
19
+ */
20
+ preview(documents: Array<{
21
+ name: string;
22
+ content: string;
23
+ }>, options?: JiraExportOptions): Promise<JiraExportResult>;
24
+ /**
25
+ * Create a preview issue object
26
+ */
27
+ private createPreviewIssue;
28
+ /**
29
+ * Extract project description from documents
30
+ */
31
+ private extractDescription;
32
+ /**
33
+ * Extract release phases from documents
34
+ */
35
+ private extractReleasePhases;
36
+ /**
37
+ * Extract task breakdowns from documents
38
+ */
39
+ private extractTaskBreakdowns;
40
+ /**
41
+ * Parse stories from markdown content
42
+ */
43
+ private parseStoriesFromMarkdown;
44
+ /**
45
+ * Extract priority from task text
46
+ */
47
+ private extractPriority;
48
+ /**
49
+ * Extract story points from task text
50
+ */
51
+ private extractStoryPoints;
52
+ /**
53
+ * Extract labels from task text
54
+ */
55
+ private extractLabels;
56
+ /**
57
+ * Clean task title by removing markers
58
+ */
59
+ private cleanTaskTitle;
60
+ /**
61
+ * Create issues from a task breakdown
62
+ */
63
+ private createIssuesFromBreakdown;
64
+ }
65
+ /**
66
+ * Export documents to Jira (convenience function)
67
+ */
68
+ export declare function exportToJira(config: JiraConfig, documents: Array<{
69
+ name: string;
70
+ content: string;
71
+ }>, options?: JiraExportOptions): Promise<JiraExportResult>;
72
+ //# sourceMappingURL=exporter.d.ts.map
@@ -0,0 +1 @@
1
+ {"version":3,"file":"exporter.d.ts","sourceRoot":"","sources":["../../../src/integrations/jira/exporter.ts"],"names":[],"mappings":"AAAA;;;GAGG;AAGH,OAAO,KAAK,EACV,UAAU,EAOV,gBAAgB,EAChB,iBAAiB,EAClB,MAAM,YAAY,CAAC;AAGpB,qBAAa,YAAY;IACvB,OAAO,CAAC,MAAM,CAAa;IAC3B,OAAO,CAAC,UAAU,CAAS;gBAEf,MAAM,EAAE,UAAU;IAK9B;;OAEG;IACG,MAAM,CACV,SAAS,EAAE,KAAK,CAAC;QAAE,IAAI,EAAE,MAAM,CAAC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