@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
|
@@ -0,0 +1,128 @@
|
|
|
1
|
+
import { ensureIssueKey } from '../utils/validation.js';
|
|
2
|
+
import { wrapJiraError, JiraNotFoundError } from '../utils/errors.js';
|
|
3
|
+
import { ensureAdf } from '../utils/adf.js';
|
|
4
|
+
/**
|
|
5
|
+
* Map API response to JiraComment
|
|
6
|
+
*/
|
|
7
|
+
function mapComment(raw) {
|
|
8
|
+
return {
|
|
9
|
+
id: raw.id,
|
|
10
|
+
self: raw.self,
|
|
11
|
+
author: raw.author,
|
|
12
|
+
body: raw.body,
|
|
13
|
+
created: raw.created,
|
|
14
|
+
updated: raw.updated,
|
|
15
|
+
visibility: raw.visibility ?? null,
|
|
16
|
+
};
|
|
17
|
+
}
|
|
18
|
+
/**
|
|
19
|
+
* Comment operations
|
|
20
|
+
*/
|
|
21
|
+
export class CommentOperations {
|
|
22
|
+
client;
|
|
23
|
+
constructor(client) {
|
|
24
|
+
this.client = client;
|
|
25
|
+
}
|
|
26
|
+
async add(issueKey, bodyOrParams) {
|
|
27
|
+
const key = ensureIssueKey(issueKey);
|
|
28
|
+
let body;
|
|
29
|
+
let visibility;
|
|
30
|
+
if (typeof bodyOrParams === 'string') {
|
|
31
|
+
body = ensureAdf(bodyOrParams);
|
|
32
|
+
}
|
|
33
|
+
else if ('version' in bodyOrParams && bodyOrParams.version === 1) {
|
|
34
|
+
body = bodyOrParams;
|
|
35
|
+
}
|
|
36
|
+
else {
|
|
37
|
+
const params = bodyOrParams;
|
|
38
|
+
body = ensureAdf(params.body);
|
|
39
|
+
visibility = params.visibility;
|
|
40
|
+
}
|
|
41
|
+
try {
|
|
42
|
+
const response = await this.client.v3.issueComments.addComment({
|
|
43
|
+
issueIdOrKey: key,
|
|
44
|
+
comment: body,
|
|
45
|
+
visibility: visibility,
|
|
46
|
+
});
|
|
47
|
+
return mapComment(response);
|
|
48
|
+
}
|
|
49
|
+
catch (error) {
|
|
50
|
+
throw wrapJiraError(error, `Failed to add comment to ${key}`);
|
|
51
|
+
}
|
|
52
|
+
}
|
|
53
|
+
/**
|
|
54
|
+
* Get all comments for an issue
|
|
55
|
+
*/
|
|
56
|
+
async list(issueKey) {
|
|
57
|
+
const key = ensureIssueKey(issueKey);
|
|
58
|
+
try {
|
|
59
|
+
const response = await this.client.v3.issueComments.getComments({
|
|
60
|
+
issueIdOrKey: key,
|
|
61
|
+
orderBy: '-created',
|
|
62
|
+
});
|
|
63
|
+
return (response.comments ?? []).map((c) => mapComment(c));
|
|
64
|
+
}
|
|
65
|
+
catch (error) {
|
|
66
|
+
throw wrapJiraError(error, `Failed to get comments for ${key}`);
|
|
67
|
+
}
|
|
68
|
+
}
|
|
69
|
+
/**
|
|
70
|
+
* Get a specific comment by ID
|
|
71
|
+
*/
|
|
72
|
+
async get(issueKey, commentId) {
|
|
73
|
+
const key = ensureIssueKey(issueKey);
|
|
74
|
+
try {
|
|
75
|
+
const response = await this.client.v3.issueComments.getComment({
|
|
76
|
+
issueIdOrKey: key,
|
|
77
|
+
id: commentId,
|
|
78
|
+
});
|
|
79
|
+
return mapComment(response);
|
|
80
|
+
}
|
|
81
|
+
catch (error) {
|
|
82
|
+
if (typeof error === 'object' && error !== null && 'status' in error && error.status === 404) {
|
|
83
|
+
throw new JiraNotFoundError('Comment', commentId, error);
|
|
84
|
+
}
|
|
85
|
+
throw wrapJiraError(error, `Failed to get comment ${commentId}`);
|
|
86
|
+
}
|
|
87
|
+
}
|
|
88
|
+
/**
|
|
89
|
+
* Update a comment
|
|
90
|
+
*/
|
|
91
|
+
async update(issueKey, commentId, body) {
|
|
92
|
+
const key = ensureIssueKey(issueKey);
|
|
93
|
+
const adfBody = ensureAdf(body);
|
|
94
|
+
try {
|
|
95
|
+
const response = await this.client.v3.issueComments.updateComment({
|
|
96
|
+
issueIdOrKey: key,
|
|
97
|
+
id: commentId,
|
|
98
|
+
body: adfBody,
|
|
99
|
+
});
|
|
100
|
+
return mapComment(response);
|
|
101
|
+
}
|
|
102
|
+
catch (error) {
|
|
103
|
+
throw wrapJiraError(error, `Failed to update comment ${commentId}`);
|
|
104
|
+
}
|
|
105
|
+
}
|
|
106
|
+
/**
|
|
107
|
+
* Delete a comment
|
|
108
|
+
*/
|
|
109
|
+
async delete(issueKey, commentId) {
|
|
110
|
+
const key = ensureIssueKey(issueKey);
|
|
111
|
+
try {
|
|
112
|
+
await this.client.v3.issueComments.deleteComment({
|
|
113
|
+
issueIdOrKey: key,
|
|
114
|
+
id: commentId,
|
|
115
|
+
});
|
|
116
|
+
}
|
|
117
|
+
catch (error) {
|
|
118
|
+
throw wrapJiraError(error, `Failed to delete comment ${commentId}`);
|
|
119
|
+
}
|
|
120
|
+
}
|
|
121
|
+
}
|
|
122
|
+
/**
|
|
123
|
+
* Create comment operations instance
|
|
124
|
+
*/
|
|
125
|
+
export function createCommentOperations(client) {
|
|
126
|
+
return new CommentOperations(client);
|
|
127
|
+
}
|
|
128
|
+
//# sourceMappingURL=comments.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"comments.js","sourceRoot":"","sources":["../../src/operations/comments.ts"],"names":[],"mappings":"AAEA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AACtE,OAAO,EAAE,SAAS,EAAE,MAAM,iBAAiB,CAAC;AAE5C;;GAEG;AACH,SAAS,UAAU,CAAC,GAA4B;IAC9C,OAAO;QACL,EAAE,EAAE,GAAG,CAAC,EAAY;QACpB,IAAI,EAAE,GAAG,CAAC,IAA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, SetCustomFieldParams } from '../types/custom-fields.js';
|
|
3
|
+
/**
|
|
4
|
+
* Custom field operations
|
|
5
|
+
*/
|
|
6
|
+
export declare class CustomFieldOperations {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: JiraClient);
|
|
9
|
+
/**
|
|
10
|
+
* Get all custom fields in the Jira instance
|
|
11
|
+
*/
|
|
12
|
+
getAll(): Promise<CustomField[]>;
|
|
13
|
+
/**
|
|
14
|
+
* Get a specific custom field by ID
|
|
15
|
+
*/
|
|
16
|
+
get(fieldId: string): Promise<CustomField>;
|
|
17
|
+
/**
|
|
18
|
+
* Get a custom field by name
|
|
19
|
+
*/
|
|
20
|
+
getByName(name: string): Promise<CustomField>;
|
|
21
|
+
/**
|
|
22
|
+
* Get the value of a custom field for an issue
|
|
23
|
+
*/
|
|
24
|
+
getValue(issueKey: string, fieldId: string): Promise<unknown>;
|
|
25
|
+
/**
|
|
26
|
+
* Set the value of a custom field for an issue
|
|
27
|
+
*/
|
|
28
|
+
setValue(issueKey: string, fieldId: string, value: unknown): Promise<void>;
|
|
29
|
+
setValue(params: SetCustomFieldParams): Promise<void>;
|
|
30
|
+
/**
|
|
31
|
+
* Get options for a select/multiselect custom field
|
|
32
|
+
* Note: This uses the issue field configuration API
|
|
33
|
+
*/
|
|
34
|
+
getOptions(fieldId: string): Promise<CustomFieldOption[]>;
|
|
35
|
+
/**
|
|
36
|
+
* Set multiple custom fields at once
|
|
37
|
+
*/
|
|
38
|
+
setMultiple(issueKey: string, fields: Record<string, unknown>): Promise<void>;
|
|
39
|
+
/**
|
|
40
|
+
* Clear a custom field value
|
|
41
|
+
*/
|
|
42
|
+
clear(issueKey: string, fieldId: string): Promise<void>;
|
|
43
|
+
}
|
|
44
|
+
/**
|
|
45
|
+
* Create custom field operations instance
|
|
46
|
+
*/
|
|
47
|
+
export declare function createCustomFieldOperations(client: JiraClient): CustomFieldOperations;
|
|
48
|
+
//# sourceMappingURL=custom-fields.d.ts.map
|
|
@@ -0,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CAAC,MAAM,EAAE,UAAU,GAAG,qBAAqB,CAErF"}
|
|
@@ -0,0 +1,184 @@
|
|
|
1
|
+
import { ensureIssueKey } from '../utils/validation.js';
|
|
2
|
+
import { wrapJiraError, JiraNotFoundError } from '../utils/errors.js';
|
|
3
|
+
/**
|
|
4
|
+
* Map field type string to CustomFieldType
|
|
5
|
+
*/
|
|
6
|
+
function mapFieldType(schema) {
|
|
7
|
+
const typeMap = {
|
|
8
|
+
string: 'string',
|
|
9
|
+
number: 'number',
|
|
10
|
+
date: 'date',
|
|
11
|
+
datetime: 'datetime',
|
|
12
|
+
user: 'user',
|
|
13
|
+
option: 'select',
|
|
14
|
+
array: 'array',
|
|
15
|
+
};
|
|
16
|
+
// Check for specific custom field types
|
|
17
|
+
if (schema.custom) {
|
|
18
|
+
if (schema.custom.includes('multiselect'))
|
|
19
|
+
return 'multiselect';
|
|
20
|
+
if (schema.custom.includes('select'))
|
|
21
|
+
return 'select';
|
|
22
|
+
if (schema.custom.includes('cascadingselect'))
|
|
23
|
+
return 'cascadingselect';
|
|
24
|
+
if (schema.custom.includes('labels'))
|
|
25
|
+
return 'labels';
|
|
26
|
+
if (schema.custom.includes('userpicker'))
|
|
27
|
+
return 'user';
|
|
28
|
+
if (schema.custom.includes('datepicker'))
|
|
29
|
+
return 'date';
|
|
30
|
+
if (schema.custom.includes('datetime'))
|
|
31
|
+
return 'datetime';
|
|
32
|
+
}
|
|
33
|
+
return typeMap[schema.type] ?? 'string';
|
|
34
|
+
}
|
|
35
|
+
/**
|
|
36
|
+
* Map API response to CustomField
|
|
37
|
+
*/
|
|
38
|
+
function mapCustomField(raw) {
|
|
39
|
+
const schema = raw.schema;
|
|
40
|
+
return {
|
|
41
|
+
id: raw.id,
|
|
42
|
+
key: raw.key,
|
|
43
|
+
name: raw.name,
|
|
44
|
+
description: raw.description ?? null,
|
|
45
|
+
type: mapFieldType(schema),
|
|
46
|
+
schema,
|
|
47
|
+
};
|
|
48
|
+
}
|
|
49
|
+
/**
|
|
50
|
+
* Custom field operations
|
|
51
|
+
*/
|
|
52
|
+
export class CustomFieldOperations {
|
|
53
|
+
client;
|
|
54
|
+
constructor(client) {
|
|
55
|
+
this.client = client;
|
|
56
|
+
}
|
|
57
|
+
/**
|
|
58
|
+
* Get all custom fields in the Jira instance
|
|
59
|
+
*/
|
|
60
|
+
async getAll() {
|
|
61
|
+
try {
|
|
62
|
+
const response = await this.client.v3.issueFields.getFields();
|
|
63
|
+
return response
|
|
64
|
+
.filter((f) => f.id.startsWith('customfield_'))
|
|
65
|
+
.map((f) => mapCustomField(f));
|
|
66
|
+
}
|
|
67
|
+
catch (error) {
|
|
68
|
+
throw wrapJiraError(error, 'Failed to get custom fields');
|
|
69
|
+
}
|
|
70
|
+
}
|
|
71
|
+
/**
|
|
72
|
+
* Get a specific custom field by ID
|
|
73
|
+
*/
|
|
74
|
+
async get(fieldId) {
|
|
75
|
+
const fields = await this.getAll();
|
|
76
|
+
const field = fields.find((f) => f.id === fieldId);
|
|
77
|
+
if (!field) {
|
|
78
|
+
throw new JiraNotFoundError('Custom field', fieldId);
|
|
79
|
+
}
|
|
80
|
+
return field;
|
|
81
|
+
}
|
|
82
|
+
/**
|
|
83
|
+
* Get a custom field by name
|
|
84
|
+
*/
|
|
85
|
+
async getByName(name) {
|
|
86
|
+
const fields = await this.getAll();
|
|
87
|
+
const field = fields.find((f) => f.name.toLowerCase() === name.toLowerCase());
|
|
88
|
+
if (!field) {
|
|
89
|
+
throw new JiraNotFoundError('Custom field', name);
|
|
90
|
+
}
|
|
91
|
+
return field;
|
|
92
|
+
}
|
|
93
|
+
/**
|
|
94
|
+
* Get the value of a custom field for an issue
|
|
95
|
+
*/
|
|
96
|
+
async getValue(issueKey, fieldId) {
|
|
97
|
+
const key = ensureIssueKey(issueKey);
|
|
98
|
+
try {
|
|
99
|
+
const response = await this.client.v3.issues.getIssue({
|
|
100
|
+
issueIdOrKey: key,
|
|
101
|
+
fields: [fieldId],
|
|
102
|
+
});
|
|
103
|
+
const fields = response.fields;
|
|
104
|
+
return fields[fieldId];
|
|
105
|
+
}
|
|
106
|
+
catch (error) {
|
|
107
|
+
throw wrapJiraError(error, `Failed to get custom field ${fieldId} for ${key}`);
|
|
108
|
+
}
|
|
109
|
+
}
|
|
110
|
+
async setValue(issueKeyOrParams, fieldId, value) {
|
|
111
|
+
let key;
|
|
112
|
+
let field;
|
|
113
|
+
let fieldValue;
|
|
114
|
+
if (typeof issueKeyOrParams === 'string') {
|
|
115
|
+
key = ensureIssueKey(issueKeyOrParams);
|
|
116
|
+
field = fieldId;
|
|
117
|
+
fieldValue = value;
|
|
118
|
+
}
|
|
119
|
+
else {
|
|
120
|
+
key = ensureIssueKey(issueKeyOrParams.issueKey);
|
|
121
|
+
field = issueKeyOrParams.fieldId;
|
|
122
|
+
fieldValue = issueKeyOrParams.value;
|
|
123
|
+
}
|
|
124
|
+
try {
|
|
125
|
+
await this.client.v3.issues.editIssue({
|
|
126
|
+
issueIdOrKey: key,
|
|
127
|
+
fields: {
|
|
128
|
+
[field]: fieldValue,
|
|
129
|
+
},
|
|
130
|
+
});
|
|
131
|
+
}
|
|
132
|
+
catch (error) {
|
|
133
|
+
throw wrapJiraError(error, `Failed to set custom field ${field} for ${key}`);
|
|
134
|
+
}
|
|
135
|
+
}
|
|
136
|
+
/**
|
|
137
|
+
* Get options for a select/multiselect custom field
|
|
138
|
+
* Note: This uses the issue field configuration API
|
|
139
|
+
*/
|
|
140
|
+
async getOptions(fieldId) {
|
|
141
|
+
try {
|
|
142
|
+
// Get the field configuration which includes options for select fields
|
|
143
|
+
const fields = await this.getAll();
|
|
144
|
+
const field = fields.find((f) => f.id === fieldId);
|
|
145
|
+
if (!field) {
|
|
146
|
+
throw new JiraNotFoundError('Custom field', fieldId);
|
|
147
|
+
}
|
|
148
|
+
// For select fields, we need to query the field options
|
|
149
|
+
// This is a simplified implementation - full options require additional API calls
|
|
150
|
+
return [];
|
|
151
|
+
}
|
|
152
|
+
catch (error) {
|
|
153
|
+
throw wrapJiraError(error, `Failed to get options for custom field ${fieldId}`);
|
|
154
|
+
}
|
|
155
|
+
}
|
|
156
|
+
/**
|
|
157
|
+
* Set multiple custom fields at once
|
|
158
|
+
*/
|
|
159
|
+
async setMultiple(issueKey, fields) {
|
|
160
|
+
const key = ensureIssueKey(issueKey);
|
|
161
|
+
try {
|
|
162
|
+
await this.client.v3.issues.editIssue({
|
|
163
|
+
issueIdOrKey: key,
|
|
164
|
+
fields,
|
|
165
|
+
});
|
|
166
|
+
}
|
|
167
|
+
catch (error) {
|
|
168
|
+
throw wrapJiraError(error, `Failed to set custom fields for ${key}`);
|
|
169
|
+
}
|
|
170
|
+
}
|
|
171
|
+
/**
|
|
172
|
+
* Clear a custom field value
|
|
173
|
+
*/
|
|
174
|
+
async clear(issueKey, fieldId) {
|
|
175
|
+
await this.setValue(issueKey, fieldId, null);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Create custom field operations instance
|
|
180
|
+
*/
|
|
181
|
+
export function createCustomFieldOperations(client) {
|
|
182
|
+
return new CustomFieldOperations(client);
|
|
183
|
+
}
|
|
184
|
+
//# sourceMappingURL=custom-fields.js.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"custom-fields.js","sourceRoot":"","sources":["../../src/operations/custom-fields.ts"],"names":[],"mappings":"AAQA,OAAO,EAAE,cAAc,EAAE,MAAM,wBAAwB,CAAC;AACxD,OAAO,EAAE,aAAa,EAAE,iBAAiB,EAAE,MAAM,oBAAoB,CAAC;AAEtE;;GAEG;AACH,SAAS,YAAY,CAAC,MAAmB;IACvC,MAAM,OAAO,GAAoC;QAC/C,MAAM,EAAE,QAAQ;QAChB,MAAM,EAAE,QAAQ;QAChB,IAAI,EAAE,MAAM;QACZ,QAAQ,EAAE,UAAU;QACpB,IAAI,EAAE,MAAM;QACZ,MAAM,EAAE,QAAQ;QAChB,KAAK,EAAE,OAAO;KACf,CAAC;IAEF,wCAAwC;IAC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CACF;AAED;;GAEG;AACH,MAAM,UAAU,2BAA2B,CAAC,MAAkB;IAC5D,OAAO,IAAI,qBAAqB,CAAC,MAAM,CAAC,CAAC;AAC3C,CAAC"}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { JiraClient } from '../client.js';
|
|
2
|
+
import type { JiraIssue, CreateJiraIssueParams, UpdateJiraIssueParams } from '../types/issues.js';
|
|
3
|
+
/**
|
|
4
|
+
* Issue CRUD operations
|
|
5
|
+
*/
|
|
6
|
+
export declare class IssueOperations {
|
|
7
|
+
private readonly client;
|
|
8
|
+
constructor(client: JiraClient);
|
|
9
|
+
/**
|
|
10
|
+
* Create a new issue
|
|
11
|
+
*/
|
|
12
|
+
create(params: CreateJiraIssueParams): Promise<JiraIssue>;
|
|
13
|
+
/**
|
|
14
|
+
* Get an issue by key or ID
|
|
15
|
+
*/
|
|
16
|
+
get(keyOrId: string): Promise<JiraIssue>;
|
|
17
|
+
/**
|
|
18
|
+
* Update an issue
|
|
19
|
+
*/
|
|
20
|
+
update(keyOrId: string, params: UpdateJiraIssueParams): Promise<JiraIssue>;
|
|
21
|
+
/**
|
|
22
|
+
* Delete an issue
|
|
23
|
+
*/
|
|
24
|
+
delete(keyOrId: string, deleteSubtasks?: boolean): Promise<void>;
|
|
25
|
+
/**
|
|
26
|
+
* Assign an issue to a user
|
|
27
|
+
*/
|
|
28
|
+
assign(keyOrId: string, accountId: string | null): Promise<void>;
|
|
29
|
+
}
|
|
30
|
+
/**
|
|
31
|
+
* Create issue operations instance
|
|
32
|
+
*/
|
|
33
|
+
export declare function createIssueOperations(client: JiraClient): IssueOperations;
|
|
34
|
+
//# sourceMappingURL=issues.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"issues.d.ts","sourceRoot":"","sources":["../../src/operations/issues.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,EAAE,UAAU,EAAE,MAAM,cAAc,CAAC;AAC/C,OAAO,KAAK,EACV,SAAS,EACT,qBAAqB,EACrB,qBAAqB,EAOtB,MAAM,oBAAoB,CAAC;AAqE5B;;GAEG;AACH,qBAAa,eAAe;IACd,OAAO,CAAC,QAAQ,CAAC,MAAM;gBAAN,MAAM,EAAE,UAAU;IAE/C;;OAEG;IACG,MAAM,CAAC,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAqD/D;;OAEG;IACG,GAAG,CAAC,OAAO,EAAE,MAAM,GAAG,OAAO,CAAC,SAAS,CAAC;IAmB9C;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,MAAM,EAAE,qBAAqB,GAAG,OAAO,CAAC,SAAS,CAAC;IAkDhF;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,cAAc,UAAQ,GAAG,OAAO,CAAC,IAAI,CAAC;IAapE;;OAEG;IACG,MAAM,CAAC,OAAO,EAAE,MAAM,EAAE,SAAS,EAAE,MAAM,GAAG,IAAI,GAAG,OAAO,CAAC,IAAI,CAAC;CAYvE;AAED;;GAEG;AACH,wBAAgB,qBAAqB,CAAC,MAAM,EAAE,UAAU,GAAG,eAAe,CAEzE"}
|
|
@@ -0,0 +1,215 @@
|
|
|
1
|
+
import { ensureIssueKey, ensureProjectKey } from '../utils/validation.js';
|
|
2
|
+
import { wrapJiraError, JiraNotFoundError } from '../utils/errors.js';
|
|
3
|
+
import { ensureAdf } from '../utils/adf.js';
|
|
4
|
+
/**
|
|
5
|
+
* Map Jira API response to JiraIssue
|
|
6
|
+
*/
|
|
7
|
+
function mapIssue(raw) {
|
|
8
|
+
const fields = raw.fields;
|
|
9
|
+
return {
|
|
10
|
+
id: raw.id,
|
|
11
|
+
key: raw.key,
|
|
12
|
+
self: raw.self,
|
|
13
|
+
summary: fields.summary,
|
|
14
|
+
description: fields.description,
|
|
15
|
+
status: fields.status,
|
|
16
|
+
issueType: fields.issuetype,
|
|
17
|
+
priority: fields.priority,
|
|
18
|
+
reporter: fields.reporter,
|
|
19
|
+
assignee: fields.assignee,
|
|
20
|
+
project: fields.project,
|
|
21
|
+
parent: fields.parent,
|
|
22
|
+
subtasks: fields.subtasks ?? [],
|
|
23
|
+
linkedIssues: fields.issuelinks ?? [],
|
|
24
|
+
created: fields.created,
|
|
25
|
+
updated: fields.updated,
|
|
26
|
+
dueDate: fields.duedate,
|
|
27
|
+
sprint: extractSprint(fields),
|
|
28
|
+
labels: fields.labels ?? [],
|
|
29
|
+
components: fields.components ?? [],
|
|
30
|
+
customFields: extractCustomFields(fields),
|
|
31
|
+
};
|
|
32
|
+
}
|
|
33
|
+
/**
|
|
34
|
+
* Extract sprint from issue fields (usually in a custom field)
|
|
35
|
+
*/
|
|
36
|
+
function extractSprint(fields) {
|
|
37
|
+
// Sprint is typically in customfield_10020 or similar
|
|
38
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
39
|
+
if (key.startsWith('customfield_') && Array.isArray(value) && value.length > 0) {
|
|
40
|
+
const first = value[0];
|
|
41
|
+
if (first && typeof first === 'object' && 'state' in first && 'name' in first) {
|
|
42
|
+
return first;
|
|
43
|
+
}
|
|
44
|
+
}
|
|
45
|
+
}
|
|
46
|
+
return null;
|
|
47
|
+
}
|
|
48
|
+
/**
|
|
49
|
+
* Extract custom fields from issue fields
|
|
50
|
+
*/
|
|
51
|
+
function extractCustomFields(fields) {
|
|
52
|
+
const customFields = {};
|
|
53
|
+
for (const [key, value] of Object.entries(fields)) {
|
|
54
|
+
if (key.startsWith('customfield_')) {
|
|
55
|
+
customFields[key] = value;
|
|
56
|
+
}
|
|
57
|
+
}
|
|
58
|
+
return customFields;
|
|
59
|
+
}
|
|
60
|
+
/**
|
|
61
|
+
* Issue CRUD operations
|
|
62
|
+
*/
|
|
63
|
+
export class IssueOperations {
|
|
64
|
+
client;
|
|
65
|
+
constructor(client) {
|
|
66
|
+
this.client = client;
|
|
67
|
+
}
|
|
68
|
+
/**
|
|
69
|
+
* Create a new issue
|
|
70
|
+
*/
|
|
71
|
+
async create(params) {
|
|
72
|
+
const projectKey = ensureProjectKey(params.projectKey);
|
|
73
|
+
const fields = {
|
|
74
|
+
project: { key: projectKey },
|
|
75
|
+
summary: params.summary,
|
|
76
|
+
issuetype: { name: params.issueType },
|
|
77
|
+
};
|
|
78
|
+
if (params.description) {
|
|
79
|
+
fields.description = ensureAdf(params.description);
|
|
80
|
+
}
|
|
81
|
+
if (params.priority) {
|
|
82
|
+
fields.priority = { name: params.priority };
|
|
83
|
+
}
|
|
84
|
+
if (params.assignee) {
|
|
85
|
+
fields.assignee = { accountId: params.assignee };
|
|
86
|
+
}
|
|
87
|
+
if (params.labels) {
|
|
88
|
+
fields.labels = params.labels;
|
|
89
|
+
}
|
|
90
|
+
if (params.components) {
|
|
91
|
+
fields.components = params.components.map((name) => ({ name }));
|
|
92
|
+
}
|
|
93
|
+
if (params.dueDate) {
|
|
94
|
+
fields.duedate = params.dueDate;
|
|
95
|
+
}
|
|
96
|
+
if (params.parentKey) {
|
|
97
|
+
fields.parent = { key: params.parentKey };
|
|
98
|
+
}
|
|
99
|
+
if (params.customFields) {
|
|
100
|
+
Object.assign(fields, params.customFields);
|
|
101
|
+
}
|
|
102
|
+
try {
|
|
103
|
+
const response = await this.client.v3.issues.createIssue({
|
|
104
|
+
fields: fields,
|
|
105
|
+
});
|
|
106
|
+
// Fetch the full issue to return complete data
|
|
107
|
+
const createdIssue = response;
|
|
108
|
+
return this.get(createdIssue.key ?? createdIssue.id ?? '');
|
|
109
|
+
}
|
|
110
|
+
catch (error) {
|
|
111
|
+
throw wrapJiraError(error, 'Failed to create issue');
|
|
112
|
+
}
|
|
113
|
+
}
|
|
114
|
+
/**
|
|
115
|
+
* Get an issue by key or ID
|
|
116
|
+
*/
|
|
117
|
+
async get(keyOrId) {
|
|
118
|
+
// If it looks like a key (contains letters), validate as key; otherwise assume numeric ID
|
|
119
|
+
const isKey = /[A-Za-z]/.test(keyOrId);
|
|
120
|
+
const issueIdOrKey = isKey ? ensureIssueKey(keyOrId) : keyOrId;
|
|
121
|
+
try {
|
|
122
|
+
const response = await this.client.v3.issues.getIssue({
|
|
123
|
+
issueIdOrKey,
|
|
124
|
+
expand: 'names,transitions',
|
|
125
|
+
});
|
|
126
|
+
return mapIssue(response);
|
|
127
|
+
}
|
|
128
|
+
catch (error) {
|
|
129
|
+
if (typeof error === 'object' && error !== null && 'status' in error && error.status === 404) {
|
|
130
|
+
throw new JiraNotFoundError('Issue', keyOrId, error);
|
|
131
|
+
}
|
|
132
|
+
throw wrapJiraError(error, `Failed to get issue ${keyOrId}`);
|
|
133
|
+
}
|
|
134
|
+
}
|
|
135
|
+
/**
|
|
136
|
+
* Update an issue
|
|
137
|
+
*/
|
|
138
|
+
async update(keyOrId, params) {
|
|
139
|
+
// If it looks like a key (contains letters), validate as key; otherwise assume numeric ID
|
|
140
|
+
const isKey = /[A-Za-z]/.test(keyOrId);
|
|
141
|
+
const issueIdOrKey = isKey ? ensureIssueKey(keyOrId) : keyOrId;
|
|
142
|
+
const fields = {};
|
|
143
|
+
if (params.summary !== undefined) {
|
|
144
|
+
fields.summary = params.summary;
|
|
145
|
+
}
|
|
146
|
+
if (params.description !== undefined) {
|
|
147
|
+
fields.description = params.description ? ensureAdf(params.description) : null;
|
|
148
|
+
}
|
|
149
|
+
if (params.priority !== undefined) {
|
|
150
|
+
fields.priority = params.priority ? { name: params.priority } : null;
|
|
151
|
+
}
|
|
152
|
+
if (params.assignee !== undefined) {
|
|
153
|
+
fields.assignee = params.assignee ? { accountId: params.assignee } : null;
|
|
154
|
+
}
|
|
155
|
+
if (params.labels !== undefined) {
|
|
156
|
+
fields.labels = params.labels;
|
|
157
|
+
}
|
|
158
|
+
if (params.components !== undefined) {
|
|
159
|
+
fields.components = params.components.map((name) => ({ name }));
|
|
160
|
+
}
|
|
161
|
+
if (params.dueDate !== undefined) {
|
|
162
|
+
fields.duedate = params.dueDate;
|
|
163
|
+
}
|
|
164
|
+
if (params.customFields) {
|
|
165
|
+
Object.assign(fields, params.customFields);
|
|
166
|
+
}
|
|
167
|
+
try {
|
|
168
|
+
await this.client.v3.issues.editIssue({
|
|
169
|
+
issueIdOrKey,
|
|
170
|
+
fields,
|
|
171
|
+
});
|
|
172
|
+
return this.get(keyOrId);
|
|
173
|
+
}
|
|
174
|
+
catch (error) {
|
|
175
|
+
throw wrapJiraError(error, `Failed to update issue ${keyOrId}`);
|
|
176
|
+
}
|
|
177
|
+
}
|
|
178
|
+
/**
|
|
179
|
+
* Delete an issue
|
|
180
|
+
*/
|
|
181
|
+
async delete(keyOrId, deleteSubtasks = false) {
|
|
182
|
+
const issueIdOrKey = keyOrId.includes('-') ? ensureIssueKey(keyOrId) : keyOrId;
|
|
183
|
+
try {
|
|
184
|
+
await this.client.v3.issues.deleteIssue({
|
|
185
|
+
issueIdOrKey,
|
|
186
|
+
deleteSubtasks,
|
|
187
|
+
});
|
|
188
|
+
}
|
|
189
|
+
catch (error) {
|
|
190
|
+
throw wrapJiraError(error, `Failed to delete issue ${keyOrId}`);
|
|
191
|
+
}
|
|
192
|
+
}
|
|
193
|
+
/**
|
|
194
|
+
* Assign an issue to a user
|
|
195
|
+
*/
|
|
196
|
+
async assign(keyOrId, accountId) {
|
|
197
|
+
const issueIdOrKey = keyOrId.includes('-') ? ensureIssueKey(keyOrId) : keyOrId;
|
|
198
|
+
try {
|
|
199
|
+
await this.client.v3.issues.assignIssue({
|
|
200
|
+
issueIdOrKey,
|
|
201
|
+
accountId: accountId ?? '-1', // -1 unassigns in Jira
|
|
202
|
+
});
|
|
203
|
+
}
|
|
204
|
+
catch (error) {
|
|
205
|
+
throw wrapJiraError(error, `Failed to assign issue ${keyOrId}`);
|
|
206
|
+
}
|
|
207
|
+
}
|
|
208
|
+
}
|
|
209
|
+
/**
|
|
210
|
+
* Create issue operations instance
|
|
211
|
+
*/
|
|
212
|
+
export function createIssueOperations(client) {
|
|
213
|
+
return new IssueOperations(client);
|
|
214
|
+
}
|
|
215
|
+
//# sourceMappingURL=issues.js.map
|
|
@@ -0,0 +1 @@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