jira-datacenter-api-client 1.0.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/LICENSE +21 -0
- package/README.md +274 -0
- package/dist/index.d.mts +1929 -0
- package/dist/index.d.ts +1929 -0
- package/dist/index.js +886 -0
- package/dist/index.mjs +863 -0
- package/package.json +51 -0
package/dist/index.d.mts
ADDED
|
@@ -0,0 +1,1929 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* A Jira project version (release).
|
|
3
|
+
*/
|
|
4
|
+
interface JiraVersion {
|
|
5
|
+
/** URL of the version resource */
|
|
6
|
+
self?: string;
|
|
7
|
+
/** Numeric string ID */
|
|
8
|
+
id?: string;
|
|
9
|
+
/** Version name */
|
|
10
|
+
name: string;
|
|
11
|
+
/** Version description */
|
|
12
|
+
description?: string;
|
|
13
|
+
/** Whether this version has been archived */
|
|
14
|
+
archived?: boolean;
|
|
15
|
+
/** Whether this version has been released */
|
|
16
|
+
released?: boolean;
|
|
17
|
+
/** Release date in `YYYY-MM-DD` format */
|
|
18
|
+
releaseDate?: string;
|
|
19
|
+
/** Whether the release date is overdue */
|
|
20
|
+
overdue?: boolean;
|
|
21
|
+
/** User-facing release date string */
|
|
22
|
+
userReleaseDate?: string;
|
|
23
|
+
/** Project ID this version belongs to */
|
|
24
|
+
projectId?: number;
|
|
25
|
+
}
|
|
26
|
+
/**
|
|
27
|
+
* Issue counts associated with a version.
|
|
28
|
+
*/
|
|
29
|
+
interface JiraVersionIssueCounts {
|
|
30
|
+
/** URL of the resource */
|
|
31
|
+
self: string;
|
|
32
|
+
/** Number of issues that use this version in the fixVersions field */
|
|
33
|
+
issuesFixedCount: number;
|
|
34
|
+
/** Number of issues that use this version in the affectedVersions field */
|
|
35
|
+
issuesAffectedCount: number;
|
|
36
|
+
/** Number of issues with a Fix Version of this version whose status is done */
|
|
37
|
+
issueCountWithCustomFieldsShowingVersion: number;
|
|
38
|
+
/** URL to query for a custom field showing this version */
|
|
39
|
+
customFieldUsage: Array<{
|
|
40
|
+
fieldName: string;
|
|
41
|
+
customFieldId: number;
|
|
42
|
+
issueCountWithVersionInCustomField: number;
|
|
43
|
+
}>;
|
|
44
|
+
}
|
|
45
|
+
/**
|
|
46
|
+
* Unresolved issue count for a version.
|
|
47
|
+
*/
|
|
48
|
+
interface JiraVersionUnresolvedIssueCount {
|
|
49
|
+
/** URL of the resource */
|
|
50
|
+
self: string;
|
|
51
|
+
/** Number of unresolved issues fixed in this version */
|
|
52
|
+
issuesUnresolvedCount: number;
|
|
53
|
+
}
|
|
54
|
+
|
|
55
|
+
/**
|
|
56
|
+
* Query parameters for user search.
|
|
57
|
+
*/
|
|
58
|
+
interface UserSearchParams {
|
|
59
|
+
/** Username to search for */
|
|
60
|
+
username?: string;
|
|
61
|
+
/** Maximum number of results to return */
|
|
62
|
+
maxResults?: number;
|
|
63
|
+
/** Index of the first result (0-based) */
|
|
64
|
+
startAt?: number;
|
|
65
|
+
}
|
|
66
|
+
/**
|
|
67
|
+
* A Jira user.
|
|
68
|
+
*/
|
|
69
|
+
interface JiraUser {
|
|
70
|
+
/** URL of the user resource */
|
|
71
|
+
self: string;
|
|
72
|
+
/** Unique key identifying the user */
|
|
73
|
+
key: string;
|
|
74
|
+
/** Username */
|
|
75
|
+
name: string;
|
|
76
|
+
/** Email address */
|
|
77
|
+
emailAddress: string;
|
|
78
|
+
/** Full display name */
|
|
79
|
+
displayName: string;
|
|
80
|
+
/** Whether the user account is active */
|
|
81
|
+
active: boolean;
|
|
82
|
+
/** User's time zone (e.g. `'America/New_York'`) */
|
|
83
|
+
timeZone?: string;
|
|
84
|
+
/** Avatar URLs keyed by size (e.g. `'16x16'`, `'48x48'`) */
|
|
85
|
+
avatarUrls?: Record<string, string>;
|
|
86
|
+
/** Groups the user belongs to */
|
|
87
|
+
groups?: {
|
|
88
|
+
size: number;
|
|
89
|
+
items: Array<{
|
|
90
|
+
name: string;
|
|
91
|
+
self: string;
|
|
92
|
+
}>;
|
|
93
|
+
};
|
|
94
|
+
}
|
|
95
|
+
|
|
96
|
+
/**
|
|
97
|
+
* A Jira project component.
|
|
98
|
+
*/
|
|
99
|
+
interface JiraComponent {
|
|
100
|
+
/** URL of the component resource */
|
|
101
|
+
self?: string;
|
|
102
|
+
/** Numeric string ID */
|
|
103
|
+
id?: string;
|
|
104
|
+
/** Component name */
|
|
105
|
+
name: string;
|
|
106
|
+
/** Component description */
|
|
107
|
+
description?: string;
|
|
108
|
+
/** The user designated as the component lead */
|
|
109
|
+
lead?: JiraUser;
|
|
110
|
+
/** Assignee type for issues created with this component */
|
|
111
|
+
assigneeType?: 'PROJECT_DEFAULT' | 'COMPONENT_LEAD' | 'PROJECT_LEAD' | 'UNASSIGNED';
|
|
112
|
+
/** The auto-assigned user for this component */
|
|
113
|
+
assignee?: JiraUser;
|
|
114
|
+
/** The real assignee for this component */
|
|
115
|
+
realAssignee?: JiraUser;
|
|
116
|
+
/** Whether the real assignee is enabled */
|
|
117
|
+
realAssigneeType?: string;
|
|
118
|
+
/** Whether the component is enabled */
|
|
119
|
+
isAssigneeTypeValid?: boolean;
|
|
120
|
+
/** Project key this component belongs to */
|
|
121
|
+
project?: string;
|
|
122
|
+
/** Project ID this component belongs to */
|
|
123
|
+
projectId?: number;
|
|
124
|
+
}
|
|
125
|
+
|
|
126
|
+
/**
|
|
127
|
+
* The category a status belongs to (e.g. To Do, In Progress, Done).
|
|
128
|
+
*/
|
|
129
|
+
interface JiraStatusCategory {
|
|
130
|
+
/** URL of the status category resource */
|
|
131
|
+
self: string;
|
|
132
|
+
/** Numeric ID */
|
|
133
|
+
id: number;
|
|
134
|
+
/** Machine-readable key (e.g. `'new'`, `'indeterminate'`, `'done'`) */
|
|
135
|
+
key: string;
|
|
136
|
+
/** Human-readable name */
|
|
137
|
+
name: string;
|
|
138
|
+
/** Display color name */
|
|
139
|
+
colorName?: string;
|
|
140
|
+
}
|
|
141
|
+
/**
|
|
142
|
+
* A Jira workflow status.
|
|
143
|
+
*/
|
|
144
|
+
interface JiraStatus {
|
|
145
|
+
/** URL of the status resource */
|
|
146
|
+
self: string;
|
|
147
|
+
/** Numeric string ID */
|
|
148
|
+
id: string;
|
|
149
|
+
/** Status name */
|
|
150
|
+
name: string;
|
|
151
|
+
/** Status description */
|
|
152
|
+
description?: string;
|
|
153
|
+
/** URL of the status icon */
|
|
154
|
+
iconUrl?: string;
|
|
155
|
+
/** The category this status belongs to */
|
|
156
|
+
statusCategory?: JiraStatusCategory;
|
|
157
|
+
}
|
|
158
|
+
|
|
159
|
+
/**
|
|
160
|
+
* A Jira issue priority.
|
|
161
|
+
*/
|
|
162
|
+
interface JiraPriority {
|
|
163
|
+
/** URL of the priority resource */
|
|
164
|
+
self: string;
|
|
165
|
+
/** Numeric string ID */
|
|
166
|
+
id: string;
|
|
167
|
+
/** Priority name (e.g. `'Highest'`, `'High'`, `'Medium'`, `'Low'`, `'Lowest'`) */
|
|
168
|
+
name: string;
|
|
169
|
+
/** Priority description */
|
|
170
|
+
description?: string;
|
|
171
|
+
/** URL of the priority icon */
|
|
172
|
+
iconUrl?: string;
|
|
173
|
+
/** Hex status color */
|
|
174
|
+
statusColor?: string;
|
|
175
|
+
}
|
|
176
|
+
|
|
177
|
+
/**
|
|
178
|
+
* A Jira issue type (e.g. Story, Bug, Task, Epic).
|
|
179
|
+
*/
|
|
180
|
+
interface JiraIssueType {
|
|
181
|
+
/** URL of the issue type resource */
|
|
182
|
+
self: string;
|
|
183
|
+
/** Numeric string ID */
|
|
184
|
+
id: string;
|
|
185
|
+
/** Issue type name */
|
|
186
|
+
name: string;
|
|
187
|
+
/** Issue type description */
|
|
188
|
+
description?: string;
|
|
189
|
+
/** URL of the issue type icon */
|
|
190
|
+
iconUrl?: string;
|
|
191
|
+
/** Whether this issue type is a sub-task */
|
|
192
|
+
subtask: boolean;
|
|
193
|
+
/** Hierarchy level (0 = standard, -1 = subtask, 1 = epic) */
|
|
194
|
+
hierarchyLevel?: number;
|
|
195
|
+
/** Avatar ID for this issue type */
|
|
196
|
+
avatarId?: number;
|
|
197
|
+
}
|
|
198
|
+
|
|
199
|
+
/**
|
|
200
|
+
* A file attachment on a Jira issue.
|
|
201
|
+
*/
|
|
202
|
+
interface JiraAttachment {
|
|
203
|
+
/** URL of the attachment resource */
|
|
204
|
+
self: string;
|
|
205
|
+
/** Numeric string ID */
|
|
206
|
+
id: string;
|
|
207
|
+
/** Original file name */
|
|
208
|
+
filename: string;
|
|
209
|
+
/** User who uploaded the attachment */
|
|
210
|
+
author?: JiraUser;
|
|
211
|
+
/** ISO 8601 date the attachment was created */
|
|
212
|
+
created: string;
|
|
213
|
+
/** File size in bytes */
|
|
214
|
+
size: number;
|
|
215
|
+
/** MIME type */
|
|
216
|
+
mimeType: string;
|
|
217
|
+
/** URL to download the attachment content */
|
|
218
|
+
content: string;
|
|
219
|
+
/** URL to the thumbnail (images only) */
|
|
220
|
+
thumbnail?: string;
|
|
221
|
+
}
|
|
222
|
+
|
|
223
|
+
/**
|
|
224
|
+
* The type of a link between two Jira issues.
|
|
225
|
+
*/
|
|
226
|
+
interface JiraIssueLinkType {
|
|
227
|
+
/** URL of the link type resource */
|
|
228
|
+
self?: string;
|
|
229
|
+
/** Numeric string ID */
|
|
230
|
+
id: string;
|
|
231
|
+
/** Machine-readable name (e.g. `'Blocks'`) */
|
|
232
|
+
name: string;
|
|
233
|
+
/** Inward description (e.g. `'is blocked by'`) */
|
|
234
|
+
inward: string;
|
|
235
|
+
/** Outward description (e.g. `'blocks'`) */
|
|
236
|
+
outward: string;
|
|
237
|
+
}
|
|
238
|
+
/**
|
|
239
|
+
* A minimal reference to a Jira issue (used inside link objects).
|
|
240
|
+
*/
|
|
241
|
+
interface JiraIssueRef {
|
|
242
|
+
/** URL of the issue resource */
|
|
243
|
+
self: string;
|
|
244
|
+
/** Issue key (e.g. `'PROJ-42'`) */
|
|
245
|
+
key: string;
|
|
246
|
+
/** Issue ID */
|
|
247
|
+
id: string;
|
|
248
|
+
/** Basic issue fields */
|
|
249
|
+
fields?: {
|
|
250
|
+
summary: string;
|
|
251
|
+
status?: {
|
|
252
|
+
name: string;
|
|
253
|
+
iconUrl?: string;
|
|
254
|
+
};
|
|
255
|
+
priority?: {
|
|
256
|
+
name: string;
|
|
257
|
+
iconUrl?: string;
|
|
258
|
+
};
|
|
259
|
+
issuetype?: {
|
|
260
|
+
name: string;
|
|
261
|
+
iconUrl?: string;
|
|
262
|
+
subtask: boolean;
|
|
263
|
+
};
|
|
264
|
+
};
|
|
265
|
+
}
|
|
266
|
+
/**
|
|
267
|
+
* A link between two Jira issues.
|
|
268
|
+
*/
|
|
269
|
+
interface JiraIssueLink {
|
|
270
|
+
/** URL of the link resource */
|
|
271
|
+
self: string;
|
|
272
|
+
/** Numeric string ID */
|
|
273
|
+
id: string;
|
|
274
|
+
/** The link type */
|
|
275
|
+
type: JiraIssueLinkType;
|
|
276
|
+
/** The inward linked issue (the issue referenced by the link) */
|
|
277
|
+
inwardIssue?: JiraIssueRef;
|
|
278
|
+
/** The outward linked issue (the issue that is the target of the link) */
|
|
279
|
+
outwardIssue?: JiraIssueRef;
|
|
280
|
+
}
|
|
281
|
+
|
|
282
|
+
/**
|
|
283
|
+
* Common query parameters for paginated endpoints.
|
|
284
|
+
*/
|
|
285
|
+
interface PaginationParams {
|
|
286
|
+
/** Index of the first item to return (0-based). Default: 0 */
|
|
287
|
+
startAt?: number;
|
|
288
|
+
/** Maximum number of items to return. Default varies by endpoint */
|
|
289
|
+
maxResults?: number;
|
|
290
|
+
}
|
|
291
|
+
/**
|
|
292
|
+
* Generic paged response returned by list endpoints.
|
|
293
|
+
*
|
|
294
|
+
* @template T - The type of items in the page
|
|
295
|
+
*/
|
|
296
|
+
interface PagedResponse<T> {
|
|
297
|
+
/** Index of the first item in this page */
|
|
298
|
+
startAt: number;
|
|
299
|
+
/** Maximum number of items requested */
|
|
300
|
+
maxResults: number;
|
|
301
|
+
/** Total number of items matching the query */
|
|
302
|
+
total: number;
|
|
303
|
+
/** Whether this is the last page (used by Agile endpoints) */
|
|
304
|
+
isLast?: boolean;
|
|
305
|
+
/** The items in this page */
|
|
306
|
+
values: T[];
|
|
307
|
+
}
|
|
308
|
+
|
|
309
|
+
/**
|
|
310
|
+
* Query parameters for listing issue comments.
|
|
311
|
+
*/
|
|
312
|
+
interface CommentsParams extends PaginationParams {
|
|
313
|
+
/** Field to order results by (e.g. `'created'`) */
|
|
314
|
+
orderBy?: string;
|
|
315
|
+
/** Fields to expand (e.g. `'renderedBody'`) */
|
|
316
|
+
expand?: string;
|
|
317
|
+
}
|
|
318
|
+
/**
|
|
319
|
+
* A comment on a Jira issue.
|
|
320
|
+
*/
|
|
321
|
+
interface JiraComment {
|
|
322
|
+
/** URL of the comment resource */
|
|
323
|
+
self: string;
|
|
324
|
+
/** Numeric string ID */
|
|
325
|
+
id: string;
|
|
326
|
+
/** User who created the comment */
|
|
327
|
+
author?: JiraUser;
|
|
328
|
+
/** Comment body text */
|
|
329
|
+
body: string;
|
|
330
|
+
/** Rendered HTML body (when `expand=renderedBody` is used) */
|
|
331
|
+
renderedBody?: string;
|
|
332
|
+
/** User who last updated the comment */
|
|
333
|
+
updateAuthor?: JiraUser;
|
|
334
|
+
/** ISO 8601 date the comment was created */
|
|
335
|
+
created: string;
|
|
336
|
+
/** ISO 8601 date the comment was last updated */
|
|
337
|
+
updated: string;
|
|
338
|
+
/** Visibility restriction for the comment */
|
|
339
|
+
visibility?: JiraCommentVisibility;
|
|
340
|
+
}
|
|
341
|
+
/**
|
|
342
|
+
* Visibility restriction on a comment.
|
|
343
|
+
*/
|
|
344
|
+
interface JiraCommentVisibility {
|
|
345
|
+
/** Restriction type: `'role'` or `'group'` */
|
|
346
|
+
type: 'role' | 'group';
|
|
347
|
+
/** Role or group name */
|
|
348
|
+
value: string;
|
|
349
|
+
}
|
|
350
|
+
/**
|
|
351
|
+
* Paged wrapper returned by `GET /rest/api/latest/issue/{key}/comment`.
|
|
352
|
+
*/
|
|
353
|
+
interface JiraCommentResponse {
|
|
354
|
+
/** Comments in this page */
|
|
355
|
+
comments: JiraComment[];
|
|
356
|
+
/** Index of the first comment */
|
|
357
|
+
startAt: number;
|
|
358
|
+
/** Maximum number of comments returned */
|
|
359
|
+
maxResults: number;
|
|
360
|
+
/** Total number of comments */
|
|
361
|
+
total: number;
|
|
362
|
+
}
|
|
363
|
+
|
|
364
|
+
/**
|
|
365
|
+
* Query parameters for listing issue worklogs.
|
|
366
|
+
*/
|
|
367
|
+
interface WorklogsParams extends PaginationParams {
|
|
368
|
+
/** Fields to expand */
|
|
369
|
+
expand?: string;
|
|
370
|
+
}
|
|
371
|
+
/**
|
|
372
|
+
* A worklog entry on a Jira issue.
|
|
373
|
+
*/
|
|
374
|
+
interface JiraWorklog {
|
|
375
|
+
/** URL of the worklog resource */
|
|
376
|
+
self: string;
|
|
377
|
+
/** User who created the worklog */
|
|
378
|
+
author?: JiraUser;
|
|
379
|
+
/** User who last updated the worklog */
|
|
380
|
+
updateAuthor?: JiraUser;
|
|
381
|
+
/** Comment / description of work done */
|
|
382
|
+
comment?: string;
|
|
383
|
+
/** ISO 8601 date the worklog was created */
|
|
384
|
+
created: string;
|
|
385
|
+
/** ISO 8601 date the worklog was last updated */
|
|
386
|
+
updated: string;
|
|
387
|
+
/** ISO 8601 date/time when the work was started */
|
|
388
|
+
started: string;
|
|
389
|
+
/** Time spent in Jira notation (e.g. `'3h 30m'`) */
|
|
390
|
+
timeSpent: string;
|
|
391
|
+
/** Time spent in seconds */
|
|
392
|
+
timeSpentSeconds: number;
|
|
393
|
+
/** Numeric string ID of the worklog */
|
|
394
|
+
id: string;
|
|
395
|
+
/** Numeric string ID of the issue */
|
|
396
|
+
issueId: string;
|
|
397
|
+
/** Visibility restriction */
|
|
398
|
+
visibility?: {
|
|
399
|
+
type: 'role' | 'group';
|
|
400
|
+
value: string;
|
|
401
|
+
};
|
|
402
|
+
}
|
|
403
|
+
/**
|
|
404
|
+
* Paged wrapper returned by `GET /rest/api/latest/issue/{key}/worklog`.
|
|
405
|
+
*/
|
|
406
|
+
interface JiraWorklogResponse {
|
|
407
|
+
/** Worklogs in this page */
|
|
408
|
+
worklogs: JiraWorklog[];
|
|
409
|
+
/** Index of the first worklog */
|
|
410
|
+
startAt: number;
|
|
411
|
+
/** Maximum number of worklogs returned */
|
|
412
|
+
maxResults: number;
|
|
413
|
+
/** Total number of worklogs */
|
|
414
|
+
total: number;
|
|
415
|
+
}
|
|
416
|
+
|
|
417
|
+
/**
|
|
418
|
+
* Query parameters for listing projects.
|
|
419
|
+
*/
|
|
420
|
+
interface ProjectsParams {
|
|
421
|
+
/** Fields to expand (e.g. `'description,lead,issueTypes,url,projectKeys'`) */
|
|
422
|
+
expand?: string;
|
|
423
|
+
/** Filter by project IDs */
|
|
424
|
+
recent?: number;
|
|
425
|
+
}
|
|
426
|
+
/**
|
|
427
|
+
* A minimal project reference used inside other objects.
|
|
428
|
+
*/
|
|
429
|
+
interface JiraProjectRef {
|
|
430
|
+
/** URL of the project resource */
|
|
431
|
+
self: string;
|
|
432
|
+
/** Numeric string ID */
|
|
433
|
+
id: string;
|
|
434
|
+
/** Project key */
|
|
435
|
+
key: string;
|
|
436
|
+
/** Project name */
|
|
437
|
+
name: string;
|
|
438
|
+
/** Avatar URLs */
|
|
439
|
+
avatarUrls?: Record<string, string>;
|
|
440
|
+
}
|
|
441
|
+
/**
|
|
442
|
+
* A Jira project.
|
|
443
|
+
*/
|
|
444
|
+
interface JiraProject {
|
|
445
|
+
/** URL of the project resource */
|
|
446
|
+
self: string;
|
|
447
|
+
/** Numeric string ID */
|
|
448
|
+
id: string;
|
|
449
|
+
/** Project key (e.g. `'PROJ'`) */
|
|
450
|
+
key: string;
|
|
451
|
+
/** Project name */
|
|
452
|
+
name: string;
|
|
453
|
+
/** Project description */
|
|
454
|
+
description?: string;
|
|
455
|
+
/** Project type key (e.g. `'software'`, `'business'`, `'service_desk'`) */
|
|
456
|
+
projectTypeKey?: string;
|
|
457
|
+
/** Whether this is a simplified (next-gen) project */
|
|
458
|
+
simplified?: boolean;
|
|
459
|
+
/** Project lead */
|
|
460
|
+
lead?: JiraUser;
|
|
461
|
+
/** Assignee type for new issues */
|
|
462
|
+
assigneeType?: 'PROJECT_LEAD' | 'UNASSIGNED';
|
|
463
|
+
/** Avatar URLs keyed by size */
|
|
464
|
+
avatarUrls?: Record<string, string>;
|
|
465
|
+
/** Issue types available in this project */
|
|
466
|
+
issueTypes?: JiraIssueType[];
|
|
467
|
+
/** Components defined in this project */
|
|
468
|
+
components?: JiraComponent[];
|
|
469
|
+
/** Versions defined in this project */
|
|
470
|
+
versions?: JiraVersion[];
|
|
471
|
+
/** Project roles keyed by role name, values are role URLs */
|
|
472
|
+
roles?: Record<string, string>;
|
|
473
|
+
/** Project links */
|
|
474
|
+
links?: Record<string, unknown>;
|
|
475
|
+
/** Project URL (homepage) */
|
|
476
|
+
url?: string;
|
|
477
|
+
/** Email used for email-to-issue */
|
|
478
|
+
email?: string;
|
|
479
|
+
/** Whether issues in the project can be viewed by anonymous users */
|
|
480
|
+
isPrivate?: boolean;
|
|
481
|
+
}
|
|
482
|
+
/**
|
|
483
|
+
* A status entry returned by `GET /rest/api/latest/project/{key}/statuses`.
|
|
484
|
+
*/
|
|
485
|
+
interface JiraProjectStatus {
|
|
486
|
+
/** URL of the issue type resource */
|
|
487
|
+
self: string;
|
|
488
|
+
/** Issue type ID */
|
|
489
|
+
id: string;
|
|
490
|
+
/** Issue type name */
|
|
491
|
+
name: string;
|
|
492
|
+
/** Whether the issue type is a subtask */
|
|
493
|
+
subtask: boolean;
|
|
494
|
+
/** Statuses available for this issue type */
|
|
495
|
+
statuses: JiraStatus[];
|
|
496
|
+
}
|
|
497
|
+
/**
|
|
498
|
+
* A role in a Jira project.
|
|
499
|
+
*/
|
|
500
|
+
interface JiraProjectRole {
|
|
501
|
+
/** URL of the role resource */
|
|
502
|
+
self: string;
|
|
503
|
+
/** Role name */
|
|
504
|
+
name: string;
|
|
505
|
+
/** Numeric role ID */
|
|
506
|
+
id: number;
|
|
507
|
+
/** Role description */
|
|
508
|
+
description?: string;
|
|
509
|
+
/** Actors (users and groups) with this role */
|
|
510
|
+
actors?: JiraProjectRoleActor[];
|
|
511
|
+
}
|
|
512
|
+
/**
|
|
513
|
+
* An actor (user or group) in a project role.
|
|
514
|
+
*/
|
|
515
|
+
interface JiraProjectRoleActor {
|
|
516
|
+
/** Numeric ID */
|
|
517
|
+
id: number;
|
|
518
|
+
/** Display name */
|
|
519
|
+
displayName: string;
|
|
520
|
+
/** Actor type: `'atlassian-user-role-actor'` or `'atlassian-group-role-actor'` */
|
|
521
|
+
type: string;
|
|
522
|
+
/** Actor name (username or group name) */
|
|
523
|
+
name: string;
|
|
524
|
+
/** Avatar URL (for user actors) */
|
|
525
|
+
avatarUrl?: string;
|
|
526
|
+
}
|
|
527
|
+
|
|
528
|
+
/**
|
|
529
|
+
* Vote information for a Jira issue.
|
|
530
|
+
*/
|
|
531
|
+
interface JiraVotes {
|
|
532
|
+
/** URL of the votes resource */
|
|
533
|
+
self: string;
|
|
534
|
+
/** Total number of votes */
|
|
535
|
+
votes: number;
|
|
536
|
+
/** Whether the authenticated user has voted */
|
|
537
|
+
hasVoted: boolean;
|
|
538
|
+
/** Users who have voted (only returned when expanding votes) */
|
|
539
|
+
voters?: JiraUser[];
|
|
540
|
+
}
|
|
541
|
+
|
|
542
|
+
/**
|
|
543
|
+
* Watcher information for a Jira issue.
|
|
544
|
+
*/
|
|
545
|
+
interface JiraWatchers {
|
|
546
|
+
/** URL of the watchers resource */
|
|
547
|
+
self: string;
|
|
548
|
+
/** Whether the authenticated user is watching the issue */
|
|
549
|
+
isWatching: boolean;
|
|
550
|
+
/** Total number of watchers */
|
|
551
|
+
watchCount: number;
|
|
552
|
+
/** Users watching the issue (only returned when expanding watchers) */
|
|
553
|
+
watchers?: JiraUser[];
|
|
554
|
+
}
|
|
555
|
+
|
|
556
|
+
/**
|
|
557
|
+
* Query parameters for fetching an issue.
|
|
558
|
+
*/
|
|
559
|
+
interface IssueParams {
|
|
560
|
+
/** Comma-separated list of fields to include (e.g. `'summary,status,assignee'`).
|
|
561
|
+
* Use `'*all'` for all fields. Default: all navigable fields. */
|
|
562
|
+
fields?: string;
|
|
563
|
+
/** Fields to expand (e.g. `'changelog,renderedFields,transitions'`) */
|
|
564
|
+
expand?: string;
|
|
565
|
+
/** Properties to include */
|
|
566
|
+
properties?: string;
|
|
567
|
+
/** Whether to update the view count */
|
|
568
|
+
updateHistory?: boolean;
|
|
569
|
+
}
|
|
570
|
+
/**
|
|
571
|
+
* Time tracking information on a Jira issue.
|
|
572
|
+
*/
|
|
573
|
+
interface JiraTimeTracking {
|
|
574
|
+
/** Original estimate in Jira notation (e.g. `'2h 30m'`) */
|
|
575
|
+
originalEstimate?: string;
|
|
576
|
+
/** Remaining estimate in Jira notation */
|
|
577
|
+
remainingEstimate?: string;
|
|
578
|
+
/** Time spent in Jira notation */
|
|
579
|
+
timeSpent?: string;
|
|
580
|
+
/** Original estimate in seconds */
|
|
581
|
+
originalEstimateSeconds?: number;
|
|
582
|
+
/** Remaining estimate in seconds */
|
|
583
|
+
remainingEstimateSeconds?: number;
|
|
584
|
+
/** Time spent in seconds */
|
|
585
|
+
timeSpentSeconds?: number;
|
|
586
|
+
}
|
|
587
|
+
/**
|
|
588
|
+
* A minimal subtask reference used inside issue fields.
|
|
589
|
+
*/
|
|
590
|
+
interface JiraSubtask {
|
|
591
|
+
/** URL of the issue resource */
|
|
592
|
+
self: string;
|
|
593
|
+
/** Issue key */
|
|
594
|
+
key: string;
|
|
595
|
+
/** Issue ID */
|
|
596
|
+
id: string;
|
|
597
|
+
/** Basic subtask fields */
|
|
598
|
+
fields: {
|
|
599
|
+
summary: string;
|
|
600
|
+
status: JiraStatus;
|
|
601
|
+
priority?: JiraPriority;
|
|
602
|
+
issuetype: JiraIssueType;
|
|
603
|
+
};
|
|
604
|
+
}
|
|
605
|
+
/**
|
|
606
|
+
* A resolution object on a Jira issue.
|
|
607
|
+
*/
|
|
608
|
+
interface JiraResolution {
|
|
609
|
+
/** URL of the resolution resource */
|
|
610
|
+
self: string;
|
|
611
|
+
/** Numeric string ID */
|
|
612
|
+
id: string;
|
|
613
|
+
/** Resolution name (e.g. `'Fixed'`, `'Won\'t Fix'`) */
|
|
614
|
+
name: string;
|
|
615
|
+
/** Resolution description */
|
|
616
|
+
description?: string;
|
|
617
|
+
}
|
|
618
|
+
/**
|
|
619
|
+
* The core issue fields returned by the Jira REST API.
|
|
620
|
+
*
|
|
621
|
+
* Common system fields are typed explicitly; custom fields
|
|
622
|
+
* and any other keys are accessible via the index signature.
|
|
623
|
+
*/
|
|
624
|
+
interface JiraIssueFields {
|
|
625
|
+
/** Issue summary */
|
|
626
|
+
summary: string;
|
|
627
|
+
/** Issue description */
|
|
628
|
+
description?: string | null;
|
|
629
|
+
/** Current workflow status */
|
|
630
|
+
status: JiraStatus;
|
|
631
|
+
/** Issue type */
|
|
632
|
+
issuetype: JiraIssueType;
|
|
633
|
+
/** Issue priority */
|
|
634
|
+
priority?: JiraPriority | null;
|
|
635
|
+
/** Assigned user */
|
|
636
|
+
assignee?: JiraUser | null;
|
|
637
|
+
/** Reporter user */
|
|
638
|
+
reporter?: JiraUser | null;
|
|
639
|
+
/** Creator user */
|
|
640
|
+
creator?: JiraUser | null;
|
|
641
|
+
/** The project this issue belongs to */
|
|
642
|
+
project: JiraProjectRef;
|
|
643
|
+
/** ISO 8601 creation timestamp */
|
|
644
|
+
created: string;
|
|
645
|
+
/** ISO 8601 last update timestamp */
|
|
646
|
+
updated: string;
|
|
647
|
+
/** ISO 8601 resolution timestamp */
|
|
648
|
+
resolutiondate?: string | null;
|
|
649
|
+
/** Resolution */
|
|
650
|
+
resolution?: JiraResolution | null;
|
|
651
|
+
/** Labels */
|
|
652
|
+
labels?: string[];
|
|
653
|
+
/** Components */
|
|
654
|
+
components?: JiraComponent[];
|
|
655
|
+
/** Fix versions */
|
|
656
|
+
fixVersions?: JiraVersion[];
|
|
657
|
+
/** Affected versions */
|
|
658
|
+
versions?: JiraVersion[];
|
|
659
|
+
/** Sub-tasks */
|
|
660
|
+
subtasks?: JiraSubtask[];
|
|
661
|
+
/** Parent issue (for sub-tasks or issues in epics) */
|
|
662
|
+
parent?: JiraIssueRef | null;
|
|
663
|
+
/** Issue links */
|
|
664
|
+
issuelinks?: JiraIssueLink[];
|
|
665
|
+
/** File attachments */
|
|
666
|
+
attachment?: JiraAttachment[];
|
|
667
|
+
/** Embedded comment page */
|
|
668
|
+
comment?: JiraCommentResponse;
|
|
669
|
+
/** Embedded worklog page */
|
|
670
|
+
worklog?: JiraWorklogResponse;
|
|
671
|
+
/** Time tracking */
|
|
672
|
+
timetracking?: JiraTimeTracking;
|
|
673
|
+
/** Votes */
|
|
674
|
+
votes?: JiraVotes;
|
|
675
|
+
/** Watches */
|
|
676
|
+
watches?: JiraWatchers;
|
|
677
|
+
/** Due date in `YYYY-MM-DD` format */
|
|
678
|
+
duedate?: string | null;
|
|
679
|
+
/** Environment description */
|
|
680
|
+
environment?: string | null;
|
|
681
|
+
/** Any additional fields (custom fields, etc.) */
|
|
682
|
+
[key: string]: unknown;
|
|
683
|
+
}
|
|
684
|
+
/**
|
|
685
|
+
* A Jira issue.
|
|
686
|
+
*/
|
|
687
|
+
interface JiraIssue {
|
|
688
|
+
/** Numeric string ID */
|
|
689
|
+
id: string;
|
|
690
|
+
/** Issue key (e.g. `'PROJ-42'`) */
|
|
691
|
+
key: string;
|
|
692
|
+
/** URL of the issue resource */
|
|
693
|
+
self: string;
|
|
694
|
+
/** Issue fields */
|
|
695
|
+
fields: JiraIssueFields;
|
|
696
|
+
}
|
|
697
|
+
|
|
698
|
+
/**
|
|
699
|
+
* Query parameters for listing issue changelog entries.
|
|
700
|
+
*/
|
|
701
|
+
interface ChangelogParams extends PaginationParams {
|
|
702
|
+
}
|
|
703
|
+
/**
|
|
704
|
+
* A single field change within a changelog entry.
|
|
705
|
+
*/
|
|
706
|
+
interface JiraChangelogItem {
|
|
707
|
+
/** The field that was changed */
|
|
708
|
+
field: string;
|
|
709
|
+
/** Whether the change was to a `jira` or `custom` field */
|
|
710
|
+
fieldtype: 'jira' | 'custom';
|
|
711
|
+
/** Field ID */
|
|
712
|
+
fieldId?: string;
|
|
713
|
+
/** Previous string value */
|
|
714
|
+
from?: string | null;
|
|
715
|
+
/** Previous display value */
|
|
716
|
+
fromString?: string | null;
|
|
717
|
+
/** New string value */
|
|
718
|
+
to?: string | null;
|
|
719
|
+
/** New display value */
|
|
720
|
+
toString?: string | null;
|
|
721
|
+
}
|
|
722
|
+
/**
|
|
723
|
+
* A single changelog history entry representing a set of changes made at one point in time.
|
|
724
|
+
*/
|
|
725
|
+
interface JiraChangelogEntry {
|
|
726
|
+
/** Numeric string ID of this history entry */
|
|
727
|
+
id: string;
|
|
728
|
+
/** User who made the changes */
|
|
729
|
+
author: JiraUser;
|
|
730
|
+
/** ISO 8601 date the change was made */
|
|
731
|
+
created: string;
|
|
732
|
+
/** The list of individual field changes */
|
|
733
|
+
items: JiraChangelogItem[];
|
|
734
|
+
}
|
|
735
|
+
/**
|
|
736
|
+
* Paged response returned by `GET /rest/api/latest/issue/{key}/changelog`.
|
|
737
|
+
*/
|
|
738
|
+
interface JiraChangelogResponse {
|
|
739
|
+
/** Index of the first entry */
|
|
740
|
+
startAt: number;
|
|
741
|
+
/** Maximum number of entries returned */
|
|
742
|
+
maxResults: number;
|
|
743
|
+
/** Total number of changelog entries */
|
|
744
|
+
total: number;
|
|
745
|
+
/** Changelog entries in this page */
|
|
746
|
+
histories: JiraChangelogEntry[];
|
|
747
|
+
}
|
|
748
|
+
|
|
749
|
+
/**
|
|
750
|
+
* Query parameters for listing issue transitions.
|
|
751
|
+
*/
|
|
752
|
+
interface TransitionsParams {
|
|
753
|
+
/** Transition ID to return a single transition */
|
|
754
|
+
transitionId?: string;
|
|
755
|
+
/** Fields to expand */
|
|
756
|
+
expand?: string;
|
|
757
|
+
/** Whether to skip remapping of issues during transition */
|
|
758
|
+
skipRemoteOnlyCondition?: boolean;
|
|
759
|
+
}
|
|
760
|
+
/**
|
|
761
|
+
* A workflow transition available for a Jira issue.
|
|
762
|
+
*/
|
|
763
|
+
interface JiraTransition {
|
|
764
|
+
/** Transition ID */
|
|
765
|
+
id: string;
|
|
766
|
+
/** Transition name */
|
|
767
|
+
name: string;
|
|
768
|
+
/** The status the issue will move to */
|
|
769
|
+
to: JiraStatus;
|
|
770
|
+
/** Whether this transition has a screen associated with it */
|
|
771
|
+
hasScreen: boolean;
|
|
772
|
+
/** Whether this is a global transition (appears from any status) */
|
|
773
|
+
isGlobal: boolean;
|
|
774
|
+
/** Whether this is the initial transition */
|
|
775
|
+
isInitial: boolean;
|
|
776
|
+
/** Whether this transition is conditionally available */
|
|
777
|
+
isAvailable?: boolean;
|
|
778
|
+
/** Whether this is a conditional transition */
|
|
779
|
+
isConditional?: boolean;
|
|
780
|
+
/** Whether the transition is looped */
|
|
781
|
+
isLooped?: boolean;
|
|
782
|
+
/** Fields required by the transition screen */
|
|
783
|
+
fields?: Record<string, JiraTransitionField>;
|
|
784
|
+
}
|
|
785
|
+
/**
|
|
786
|
+
* A field required by a transition screen.
|
|
787
|
+
*/
|
|
788
|
+
interface JiraTransitionField {
|
|
789
|
+
/** Whether the field is required */
|
|
790
|
+
required: boolean;
|
|
791
|
+
/** Field schema information */
|
|
792
|
+
schema?: {
|
|
793
|
+
type: string;
|
|
794
|
+
system?: string;
|
|
795
|
+
custom?: string;
|
|
796
|
+
customId?: number;
|
|
797
|
+
};
|
|
798
|
+
/** Field name */
|
|
799
|
+
name: string;
|
|
800
|
+
/** Field key */
|
|
801
|
+
key?: string;
|
|
802
|
+
/** Whether the field has a default value */
|
|
803
|
+
hasDefaultValue?: boolean;
|
|
804
|
+
/** Allowed values for the field */
|
|
805
|
+
allowedValues?: unknown[];
|
|
806
|
+
}
|
|
807
|
+
|
|
808
|
+
/**
|
|
809
|
+
* A remote link (e.g. to a web URL) associated with a Jira issue.
|
|
810
|
+
*/
|
|
811
|
+
interface JiraRemoteLink {
|
|
812
|
+
/** URL of the remote link resource */
|
|
813
|
+
self: string;
|
|
814
|
+
/** Numeric ID */
|
|
815
|
+
id: number;
|
|
816
|
+
/** Global unique ID used for deduplication across systems */
|
|
817
|
+
globalId?: string;
|
|
818
|
+
/** Application info for the linked external system */
|
|
819
|
+
application?: {
|
|
820
|
+
type?: string;
|
|
821
|
+
name?: string;
|
|
822
|
+
};
|
|
823
|
+
/** Relationship description (e.g. `'is implemented by'`) */
|
|
824
|
+
relationship?: string;
|
|
825
|
+
/** The linked remote object */
|
|
826
|
+
object: JiraRemoteLinkObject;
|
|
827
|
+
}
|
|
828
|
+
/**
|
|
829
|
+
* The remote object referenced by a {@link JiraRemoteLink}.
|
|
830
|
+
*/
|
|
831
|
+
interface JiraRemoteLinkObject {
|
|
832
|
+
/** URL of the remote resource */
|
|
833
|
+
url: string;
|
|
834
|
+
/** Title of the remote resource */
|
|
835
|
+
title: string;
|
|
836
|
+
/** Summary / description */
|
|
837
|
+
summary?: string;
|
|
838
|
+
/** Icon for the remote resource */
|
|
839
|
+
icon?: {
|
|
840
|
+
url16x16?: string;
|
|
841
|
+
title?: string;
|
|
842
|
+
link?: string;
|
|
843
|
+
};
|
|
844
|
+
/** Status of the remote resource */
|
|
845
|
+
status?: {
|
|
846
|
+
resolved?: boolean;
|
|
847
|
+
icon?: {
|
|
848
|
+
url16x16?: string;
|
|
849
|
+
title?: string;
|
|
850
|
+
link?: string;
|
|
851
|
+
};
|
|
852
|
+
};
|
|
853
|
+
}
|
|
854
|
+
|
|
855
|
+
/** @internal */
|
|
856
|
+
type RequestFn = <T>(path: string, params?: Record<string, string | number | boolean>, options?: {
|
|
857
|
+
apiPath?: string;
|
|
858
|
+
}) => Promise<T>;
|
|
859
|
+
/**
|
|
860
|
+
* Represents a Jira issue resource with chainable async methods.
|
|
861
|
+
*
|
|
862
|
+
* Implements `PromiseLike<JiraIssue>` so it can be awaited directly
|
|
863
|
+
* to fetch the issue, while also exposing sub-resource methods.
|
|
864
|
+
*
|
|
865
|
+
* @example
|
|
866
|
+
* ```typescript
|
|
867
|
+
* // Await directly to get issue info
|
|
868
|
+
* const issue = await jiraClient.issue('PROJ-42');
|
|
869
|
+
*
|
|
870
|
+
* // Get issue with specific fields
|
|
871
|
+
* const issue = await jiraClient.issue('PROJ-42').get({ fields: 'summary,status,assignee' });
|
|
872
|
+
*
|
|
873
|
+
* // Get comments
|
|
874
|
+
* const comments = await jiraClient.issue('PROJ-42').comments();
|
|
875
|
+
*
|
|
876
|
+
* // Get worklogs
|
|
877
|
+
* const worklogs = await jiraClient.issue('PROJ-42').worklogs();
|
|
878
|
+
*
|
|
879
|
+
* // Get changelog
|
|
880
|
+
* const changelog = await jiraClient.issue('PROJ-42').changelog();
|
|
881
|
+
*
|
|
882
|
+
* // Get available transitions
|
|
883
|
+
* const transitions = await jiraClient.issue('PROJ-42').transitions();
|
|
884
|
+
*
|
|
885
|
+
* // Get remote links
|
|
886
|
+
* const remoteLinks = await jiraClient.issue('PROJ-42').remotelinks();
|
|
887
|
+
*
|
|
888
|
+
* // Get votes
|
|
889
|
+
* const votes = await jiraClient.issue('PROJ-42').votes();
|
|
890
|
+
*
|
|
891
|
+
* // Get watchers
|
|
892
|
+
* const watchers = await jiraClient.issue('PROJ-42').watchers();
|
|
893
|
+
* ```
|
|
894
|
+
*/
|
|
895
|
+
declare class IssueResource implements PromiseLike<JiraIssue> {
|
|
896
|
+
private readonly request;
|
|
897
|
+
private readonly basePath;
|
|
898
|
+
/** @internal */
|
|
899
|
+
constructor(request: RequestFn, issueIdOrKey: string);
|
|
900
|
+
/**
|
|
901
|
+
* Allows the resource to be awaited directly, resolving with the issue.
|
|
902
|
+
* Delegates to {@link IssueResource.get}.
|
|
903
|
+
*/
|
|
904
|
+
then<TResult1 = JiraIssue, TResult2 = never>(onfulfilled?: ((value: JiraIssue) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
905
|
+
/**
|
|
906
|
+
* Fetches the issue.
|
|
907
|
+
*
|
|
908
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}`
|
|
909
|
+
*
|
|
910
|
+
* @param params - Optional: `fields`, `expand`, `properties`, `updateHistory`
|
|
911
|
+
* @returns The issue object
|
|
912
|
+
*/
|
|
913
|
+
get(params?: IssueParams): Promise<JiraIssue>;
|
|
914
|
+
/**
|
|
915
|
+
* Fetches comments for this issue.
|
|
916
|
+
*
|
|
917
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/comment`
|
|
918
|
+
*
|
|
919
|
+
* @param params - Optional: `startAt`, `maxResults`, `orderBy`, `expand`
|
|
920
|
+
* @returns A paged response of comments
|
|
921
|
+
*/
|
|
922
|
+
comments(params?: CommentsParams): Promise<JiraCommentResponse>;
|
|
923
|
+
/**
|
|
924
|
+
* Fetches a single comment by ID.
|
|
925
|
+
*
|
|
926
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/comment/{id}`
|
|
927
|
+
*
|
|
928
|
+
* @param commentId - The numeric comment ID
|
|
929
|
+
* @returns The comment object
|
|
930
|
+
*/
|
|
931
|
+
comment(commentId: string | number): Promise<JiraComment>;
|
|
932
|
+
/**
|
|
933
|
+
* Fetches worklogs for this issue.
|
|
934
|
+
*
|
|
935
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/worklog`
|
|
936
|
+
*
|
|
937
|
+
* @param params - Optional: `startAt`, `maxResults`, `expand`
|
|
938
|
+
* @returns A paged response of worklogs
|
|
939
|
+
*/
|
|
940
|
+
worklogs(params?: WorklogsParams): Promise<JiraWorklogResponse>;
|
|
941
|
+
/**
|
|
942
|
+
* Fetches a single worklog by ID.
|
|
943
|
+
*
|
|
944
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/worklog/{id}`
|
|
945
|
+
*
|
|
946
|
+
* @param worklogId - The numeric worklog ID
|
|
947
|
+
* @returns The worklog object
|
|
948
|
+
*/
|
|
949
|
+
worklog(worklogId: string | number): Promise<JiraWorklog>;
|
|
950
|
+
/**
|
|
951
|
+
* Fetches the changelog for this issue.
|
|
952
|
+
*
|
|
953
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/changelog`
|
|
954
|
+
*
|
|
955
|
+
* @param params - Optional: `startAt`, `maxResults`
|
|
956
|
+
* @returns A paged response of changelog entries
|
|
957
|
+
*/
|
|
958
|
+
changelog(params?: ChangelogParams): Promise<JiraChangelogResponse>;
|
|
959
|
+
/**
|
|
960
|
+
* Fetches the available workflow transitions for this issue.
|
|
961
|
+
*
|
|
962
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/transitions`
|
|
963
|
+
*
|
|
964
|
+
* @param params - Optional: `transitionId`, `expand`, `skipRemoteOnlyCondition`
|
|
965
|
+
* @returns An object containing the list of transitions
|
|
966
|
+
*/
|
|
967
|
+
transitions(params?: TransitionsParams): Promise<{
|
|
968
|
+
transitions: JiraTransition[];
|
|
969
|
+
}>;
|
|
970
|
+
/**
|
|
971
|
+
* Fetches the remote links (external URLs) for this issue.
|
|
972
|
+
*
|
|
973
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/remotelink`
|
|
974
|
+
*
|
|
975
|
+
* @param globalId - Optional global ID to filter by a specific remote link
|
|
976
|
+
* @returns An array of remote links
|
|
977
|
+
*/
|
|
978
|
+
remotelinks(globalId?: string): Promise<JiraRemoteLink[]>;
|
|
979
|
+
/**
|
|
980
|
+
* Fetches the vote information for this issue.
|
|
981
|
+
*
|
|
982
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/votes`
|
|
983
|
+
*
|
|
984
|
+
* @returns The votes object
|
|
985
|
+
*/
|
|
986
|
+
votes(): Promise<JiraVotes>;
|
|
987
|
+
/**
|
|
988
|
+
* Fetches the watcher information for this issue.
|
|
989
|
+
*
|
|
990
|
+
* `GET /rest/api/latest/issue/{issueIdOrKey}/watchers`
|
|
991
|
+
*
|
|
992
|
+
* @returns The watchers object
|
|
993
|
+
*/
|
|
994
|
+
watchers(): Promise<JiraWatchers>;
|
|
995
|
+
}
|
|
996
|
+
|
|
997
|
+
/**
|
|
998
|
+
* Represents a Jira project resource with chainable async methods.
|
|
999
|
+
*
|
|
1000
|
+
* Implements `PromiseLike<JiraProject>` so it can be awaited directly
|
|
1001
|
+
* to fetch the project, while also exposing sub-resource methods.
|
|
1002
|
+
*
|
|
1003
|
+
* @example
|
|
1004
|
+
* ```typescript
|
|
1005
|
+
* // Await directly to get project info
|
|
1006
|
+
* const project = await jiraClient.project('PROJ');
|
|
1007
|
+
*
|
|
1008
|
+
* // Get components
|
|
1009
|
+
* const components = await jiraClient.project('PROJ').components();
|
|
1010
|
+
*
|
|
1011
|
+
* // Get versions
|
|
1012
|
+
* const versions = await jiraClient.project('PROJ').versions();
|
|
1013
|
+
*
|
|
1014
|
+
* // Get statuses per issue type
|
|
1015
|
+
* const statuses = await jiraClient.project('PROJ').statuses();
|
|
1016
|
+
*
|
|
1017
|
+
* // Get project roles
|
|
1018
|
+
* const roles = await jiraClient.project('PROJ').roles();
|
|
1019
|
+
* ```
|
|
1020
|
+
*/
|
|
1021
|
+
declare class ProjectResource implements PromiseLike<JiraProject> {
|
|
1022
|
+
private readonly request;
|
|
1023
|
+
private readonly basePath;
|
|
1024
|
+
/** @internal */
|
|
1025
|
+
constructor(request: RequestFn, projectIdOrKey: string);
|
|
1026
|
+
/**
|
|
1027
|
+
* Allows the resource to be awaited directly, resolving with the project.
|
|
1028
|
+
* Delegates to {@link ProjectResource.get}.
|
|
1029
|
+
*/
|
|
1030
|
+
then<TResult1 = JiraProject, TResult2 = never>(onfulfilled?: ((value: JiraProject) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
1031
|
+
/**
|
|
1032
|
+
* Fetches the project details.
|
|
1033
|
+
*
|
|
1034
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}`
|
|
1035
|
+
*
|
|
1036
|
+
* @param params - Optional: `expand`
|
|
1037
|
+
* @returns The project object
|
|
1038
|
+
*/
|
|
1039
|
+
get(params?: ProjectsParams): Promise<JiraProject>;
|
|
1040
|
+
/**
|
|
1041
|
+
* Fetches the components defined in this project.
|
|
1042
|
+
*
|
|
1043
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}/components`
|
|
1044
|
+
*
|
|
1045
|
+
* @returns An array of project components
|
|
1046
|
+
*/
|
|
1047
|
+
components(): Promise<JiraComponent[]>;
|
|
1048
|
+
/**
|
|
1049
|
+
* Fetches the versions defined in this project.
|
|
1050
|
+
*
|
|
1051
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}/versions`
|
|
1052
|
+
*
|
|
1053
|
+
* @param expand - Optional: `'operations'`
|
|
1054
|
+
* @returns An array of project versions
|
|
1055
|
+
*/
|
|
1056
|
+
versions(expand?: string): Promise<JiraVersion[]>;
|
|
1057
|
+
/**
|
|
1058
|
+
* Fetches the statuses available in this project, grouped by issue type.
|
|
1059
|
+
*
|
|
1060
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}/statuses`
|
|
1061
|
+
*
|
|
1062
|
+
* @returns An array of issue type → statuses mappings
|
|
1063
|
+
*/
|
|
1064
|
+
statuses(): Promise<JiraProjectStatus[]>;
|
|
1065
|
+
/**
|
|
1066
|
+
* Fetches the roles defined in this project.
|
|
1067
|
+
*
|
|
1068
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}/role`
|
|
1069
|
+
*
|
|
1070
|
+
* @returns A record mapping role names to their resource URLs
|
|
1071
|
+
*/
|
|
1072
|
+
roles(): Promise<Record<string, string>>;
|
|
1073
|
+
/**
|
|
1074
|
+
* Fetches a single role by ID, including the list of actors.
|
|
1075
|
+
*
|
|
1076
|
+
* `GET /rest/api/latest/project/{projectIdOrKey}/role/{id}`
|
|
1077
|
+
*
|
|
1078
|
+
* @param roleId - The numeric role ID
|
|
1079
|
+
* @returns The project role object with actors
|
|
1080
|
+
*/
|
|
1081
|
+
role(roleId: number): Promise<JiraProjectRole>;
|
|
1082
|
+
}
|
|
1083
|
+
|
|
1084
|
+
/**
|
|
1085
|
+
* Query parameters for listing boards.
|
|
1086
|
+
*/
|
|
1087
|
+
interface BoardsParams {
|
|
1088
|
+
/** Index of the first result (0-based) */
|
|
1089
|
+
startAt?: number;
|
|
1090
|
+
/** Maximum number of results */
|
|
1091
|
+
maxResults?: number;
|
|
1092
|
+
/** Filter boards by type: `'scrum'` or `'kanban'` */
|
|
1093
|
+
type?: 'scrum' | 'kanban';
|
|
1094
|
+
/** Filter boards by name (contains match) */
|
|
1095
|
+
name?: string;
|
|
1096
|
+
/** Filter boards by project key or ID */
|
|
1097
|
+
projectKeyOrId?: string;
|
|
1098
|
+
}
|
|
1099
|
+
/**
|
|
1100
|
+
* The project associated with a board's filter.
|
|
1101
|
+
*/
|
|
1102
|
+
interface JiraBoardProject {
|
|
1103
|
+
/** Numeric string project ID */
|
|
1104
|
+
id: string;
|
|
1105
|
+
/** Project key */
|
|
1106
|
+
key: string;
|
|
1107
|
+
/** Project name */
|
|
1108
|
+
name: string;
|
|
1109
|
+
/** URL of the project resource */
|
|
1110
|
+
self: string;
|
|
1111
|
+
}
|
|
1112
|
+
/**
|
|
1113
|
+
* The filter associated with a Jira board.
|
|
1114
|
+
*/
|
|
1115
|
+
interface JiraBoardFilter {
|
|
1116
|
+
/** Numeric string filter ID */
|
|
1117
|
+
id: string;
|
|
1118
|
+
/** URL of the filter resource */
|
|
1119
|
+
self: string;
|
|
1120
|
+
}
|
|
1121
|
+
/**
|
|
1122
|
+
* A Jira Software board (Scrum or Kanban).
|
|
1123
|
+
*/
|
|
1124
|
+
interface JiraBoard {
|
|
1125
|
+
/** Numeric board ID */
|
|
1126
|
+
id: number;
|
|
1127
|
+
/** URL of the board resource */
|
|
1128
|
+
self: string;
|
|
1129
|
+
/** Board name */
|
|
1130
|
+
name: string;
|
|
1131
|
+
/** Board type: `'scrum'` or `'kanban'` */
|
|
1132
|
+
type: 'scrum' | 'kanban';
|
|
1133
|
+
/** Filter configuration for the board */
|
|
1134
|
+
filter?: JiraBoardFilter;
|
|
1135
|
+
/** The location (project) this board belongs to */
|
|
1136
|
+
location?: {
|
|
1137
|
+
projectId?: number;
|
|
1138
|
+
displayName?: string;
|
|
1139
|
+
projectName?: string;
|
|
1140
|
+
projectKey?: string;
|
|
1141
|
+
projectTypeKey?: string;
|
|
1142
|
+
avatarURI?: string;
|
|
1143
|
+
name?: string;
|
|
1144
|
+
};
|
|
1145
|
+
}
|
|
1146
|
+
/**
|
|
1147
|
+
* Query parameters for listing issues on a board.
|
|
1148
|
+
*/
|
|
1149
|
+
interface BoardIssuesParams {
|
|
1150
|
+
/** Index of the first result (0-based) */
|
|
1151
|
+
startAt?: number;
|
|
1152
|
+
/** Maximum number of results */
|
|
1153
|
+
maxResults?: number;
|
|
1154
|
+
/** JQL query to filter issues */
|
|
1155
|
+
jql?: string;
|
|
1156
|
+
/** Whether to validate the JQL query */
|
|
1157
|
+
validateQuery?: boolean;
|
|
1158
|
+
/** Comma-separated list of fields to include */
|
|
1159
|
+
fields?: string;
|
|
1160
|
+
/** Fields to expand */
|
|
1161
|
+
expand?: string;
|
|
1162
|
+
}
|
|
1163
|
+
|
|
1164
|
+
/**
|
|
1165
|
+
* Query parameters for listing sprints on a board.
|
|
1166
|
+
*/
|
|
1167
|
+
interface SprintsParams {
|
|
1168
|
+
/** Index of the first result (0-based) */
|
|
1169
|
+
startAt?: number;
|
|
1170
|
+
/** Maximum number of results */
|
|
1171
|
+
maxResults?: number;
|
|
1172
|
+
/** Filter by sprint state: `'future'`, `'active'`, or `'closed'` */
|
|
1173
|
+
state?: 'future' | 'active' | 'closed';
|
|
1174
|
+
}
|
|
1175
|
+
/**
|
|
1176
|
+
* A Jira Software sprint.
|
|
1177
|
+
*/
|
|
1178
|
+
interface JiraSprint {
|
|
1179
|
+
/** Numeric sprint ID */
|
|
1180
|
+
id: number;
|
|
1181
|
+
/** URL of the sprint resource */
|
|
1182
|
+
self: string;
|
|
1183
|
+
/** Sprint state: `'future'`, `'active'`, or `'closed'` */
|
|
1184
|
+
state: 'future' | 'active' | 'closed';
|
|
1185
|
+
/** Sprint name */
|
|
1186
|
+
name: string;
|
|
1187
|
+
/** ISO 8601 start date */
|
|
1188
|
+
startDate?: string;
|
|
1189
|
+
/** ISO 8601 end date */
|
|
1190
|
+
endDate?: string;
|
|
1191
|
+
/** ISO 8601 date the sprint was completed */
|
|
1192
|
+
completeDate?: string;
|
|
1193
|
+
/** ID of the board this sprint belongs to */
|
|
1194
|
+
originBoardId?: number;
|
|
1195
|
+
/** Sprint goal */
|
|
1196
|
+
goal?: string;
|
|
1197
|
+
}
|
|
1198
|
+
|
|
1199
|
+
/**
|
|
1200
|
+
* Query parameters for `GET /rest/api/latest/search`.
|
|
1201
|
+
*/
|
|
1202
|
+
interface SearchParams {
|
|
1203
|
+
/** JQL query string (e.g. `'project = PROJ AND status = Open ORDER BY created DESC'`) */
|
|
1204
|
+
jql?: string;
|
|
1205
|
+
/** Index of the first result (0-based) */
|
|
1206
|
+
startAt?: number;
|
|
1207
|
+
/** Maximum number of results to return (max 50 by default, up to 100) */
|
|
1208
|
+
maxResults?: number;
|
|
1209
|
+
/** Whether to validate the JQL query (`'strict'`, `'warn'`, `'none'`) */
|
|
1210
|
+
validateQuery?: 'strict' | 'warn' | 'none';
|
|
1211
|
+
/** Comma-separated list of fields to include.
|
|
1212
|
+
* Use `'*all'` for all fields, `'*navigable'` for navigable fields (default). */
|
|
1213
|
+
fields?: string;
|
|
1214
|
+
/** Fields to expand (e.g. `'changelog,renderedFields,names'`) */
|
|
1215
|
+
expand?: string;
|
|
1216
|
+
/** List of issue properties to return */
|
|
1217
|
+
properties?: string;
|
|
1218
|
+
/** Whether to return field IDs instead of field names */
|
|
1219
|
+
fieldsByKeys?: boolean;
|
|
1220
|
+
}
|
|
1221
|
+
/**
|
|
1222
|
+
* Response body from `GET /rest/api/latest/search` or `POST /rest/api/latest/search`.
|
|
1223
|
+
*/
|
|
1224
|
+
interface JiraSearchResponse {
|
|
1225
|
+
/** URL used to perform the search */
|
|
1226
|
+
expand?: string;
|
|
1227
|
+
/** Index of the first result */
|
|
1228
|
+
startAt: number;
|
|
1229
|
+
/** Maximum number of results requested */
|
|
1230
|
+
maxResults: number;
|
|
1231
|
+
/** Total number of issues matching the query */
|
|
1232
|
+
total: number;
|
|
1233
|
+
/** Issues in this page */
|
|
1234
|
+
issues: JiraIssue[];
|
|
1235
|
+
/** Warning messages from the JQL validator */
|
|
1236
|
+
warningMessages?: string[];
|
|
1237
|
+
/** Field name → display name mapping (when `expand=names`) */
|
|
1238
|
+
names?: Record<string, string>;
|
|
1239
|
+
}
|
|
1240
|
+
|
|
1241
|
+
/**
|
|
1242
|
+
* Represents a Jira Software sprint resource.
|
|
1243
|
+
*
|
|
1244
|
+
* Implements `PromiseLike<JiraSprint>` so it can be awaited directly
|
|
1245
|
+
* to fetch the sprint, while also exposing sub-resource methods.
|
|
1246
|
+
*
|
|
1247
|
+
* @example
|
|
1248
|
+
* ```typescript
|
|
1249
|
+
* // Await directly to get sprint info
|
|
1250
|
+
* const sprint = await jiraClient.board(42).sprint(10);
|
|
1251
|
+
*
|
|
1252
|
+
* // Get sprint issues
|
|
1253
|
+
* const issues = await jiraClient.board(42).sprint(10).issues({ maxResults: 50 });
|
|
1254
|
+
* ```
|
|
1255
|
+
*/
|
|
1256
|
+
declare class SprintResource implements PromiseLike<JiraSprint> {
|
|
1257
|
+
private readonly request;
|
|
1258
|
+
private readonly agileApiPath;
|
|
1259
|
+
private readonly basePath;
|
|
1260
|
+
/** @internal */
|
|
1261
|
+
constructor(request: RequestFn, agileApiPath: string, sprintId: number);
|
|
1262
|
+
/**
|
|
1263
|
+
* Allows the resource to be awaited directly, resolving with the sprint.
|
|
1264
|
+
* Delegates to {@link SprintResource.get}.
|
|
1265
|
+
*/
|
|
1266
|
+
then<TResult1 = JiraSprint, TResult2 = never>(onfulfilled?: ((value: JiraSprint) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
1267
|
+
/**
|
|
1268
|
+
* Fetches the sprint details.
|
|
1269
|
+
*
|
|
1270
|
+
* `GET /rest/agile/latest/sprint/{sprintId}`
|
|
1271
|
+
*
|
|
1272
|
+
* @returns The sprint object
|
|
1273
|
+
*/
|
|
1274
|
+
get(): Promise<JiraSprint>;
|
|
1275
|
+
/**
|
|
1276
|
+
* Fetches issues in this sprint.
|
|
1277
|
+
*
|
|
1278
|
+
* `GET /rest/agile/latest/sprint/{sprintId}/issue`
|
|
1279
|
+
*
|
|
1280
|
+
* @param params - Optional: `startAt`, `maxResults`, `jql`, `fields`, `expand`
|
|
1281
|
+
* @returns A search response containing the sprint's issues
|
|
1282
|
+
*/
|
|
1283
|
+
issues(params?: BoardIssuesParams): Promise<JiraSearchResponse>;
|
|
1284
|
+
}
|
|
1285
|
+
|
|
1286
|
+
/**
|
|
1287
|
+
* Represents a Jira Software board resource with chainable async methods.
|
|
1288
|
+
*
|
|
1289
|
+
* Implements `PromiseLike<JiraBoard>` so it can be awaited directly
|
|
1290
|
+
* to fetch the board, while also exposing sub-resource methods.
|
|
1291
|
+
*
|
|
1292
|
+
* @example
|
|
1293
|
+
* ```typescript
|
|
1294
|
+
* // Await directly to get board info
|
|
1295
|
+
* const board = await jiraClient.board(42);
|
|
1296
|
+
*
|
|
1297
|
+
* // Get sprints
|
|
1298
|
+
* const sprints = await jiraClient.board(42).sprints({ state: 'active' });
|
|
1299
|
+
*
|
|
1300
|
+
* // Get board issues
|
|
1301
|
+
* const issues = await jiraClient.board(42).issues({ jql: 'status = Open' });
|
|
1302
|
+
*
|
|
1303
|
+
* // Get backlog
|
|
1304
|
+
* const backlog = await jiraClient.board(42).backlog({ maxResults: 50 });
|
|
1305
|
+
*
|
|
1306
|
+
* // Navigate to a sprint
|
|
1307
|
+
* const sprint = await jiraClient.board(42).sprint(10);
|
|
1308
|
+
* const sprintIssues = await jiraClient.board(42).sprint(10).issues();
|
|
1309
|
+
* ```
|
|
1310
|
+
*/
|
|
1311
|
+
declare class BoardResource implements PromiseLike<JiraBoard> {
|
|
1312
|
+
private readonly request;
|
|
1313
|
+
private readonly agileApiPath;
|
|
1314
|
+
private readonly basePath;
|
|
1315
|
+
/** @internal */
|
|
1316
|
+
constructor(request: RequestFn, agileApiPath: string, boardId: number);
|
|
1317
|
+
/**
|
|
1318
|
+
* Allows the resource to be awaited directly, resolving with the board.
|
|
1319
|
+
* Delegates to {@link BoardResource.get}.
|
|
1320
|
+
*/
|
|
1321
|
+
then<TResult1 = JiraBoard, TResult2 = never>(onfulfilled?: ((value: JiraBoard) => TResult1 | PromiseLike<TResult1>) | null, onrejected?: ((reason: unknown) => TResult2 | PromiseLike<TResult2>) | null): PromiseLike<TResult1 | TResult2>;
|
|
1322
|
+
/**
|
|
1323
|
+
* Fetches the board details.
|
|
1324
|
+
*
|
|
1325
|
+
* `GET /rest/agile/latest/board/{boardId}`
|
|
1326
|
+
*
|
|
1327
|
+
* @returns The board object
|
|
1328
|
+
*/
|
|
1329
|
+
get(): Promise<JiraBoard>;
|
|
1330
|
+
/**
|
|
1331
|
+
* Fetches sprints for this board.
|
|
1332
|
+
*
|
|
1333
|
+
* `GET /rest/agile/latest/board/{boardId}/sprint`
|
|
1334
|
+
*
|
|
1335
|
+
* @param params - Optional: `startAt`, `maxResults`, `state`
|
|
1336
|
+
* @returns A paged response of sprints
|
|
1337
|
+
*/
|
|
1338
|
+
sprints(params?: SprintsParams): Promise<PagedResponse<JiraSprint>>;
|
|
1339
|
+
/**
|
|
1340
|
+
* Fetches all issues on this board (across all sprints and the backlog).
|
|
1341
|
+
*
|
|
1342
|
+
* `GET /rest/agile/latest/board/{boardId}/issue`
|
|
1343
|
+
*
|
|
1344
|
+
* @param params - Optional: `startAt`, `maxResults`, `jql`, `fields`, `expand`
|
|
1345
|
+
* @returns A search response containing the board's issues
|
|
1346
|
+
*/
|
|
1347
|
+
issues(params?: BoardIssuesParams): Promise<JiraSearchResponse>;
|
|
1348
|
+
/**
|
|
1349
|
+
* Fetches the backlog issues for this board.
|
|
1350
|
+
*
|
|
1351
|
+
* `GET /rest/agile/latest/board/{boardId}/backlog`
|
|
1352
|
+
*
|
|
1353
|
+
* @param params - Optional: `startAt`, `maxResults`, `jql`, `fields`, `expand`
|
|
1354
|
+
* @returns A search response containing the backlog issues
|
|
1355
|
+
*/
|
|
1356
|
+
backlog(params?: BoardIssuesParams): Promise<JiraSearchResponse>;
|
|
1357
|
+
/**
|
|
1358
|
+
* Returns a {@link SprintResource} for a given sprint ID.
|
|
1359
|
+
*
|
|
1360
|
+
* The returned resource can be awaited directly to fetch sprint info,
|
|
1361
|
+
* or chained to access sprint issues.
|
|
1362
|
+
*
|
|
1363
|
+
* @param sprintId - The numeric sprint ID
|
|
1364
|
+
* @returns A chainable sprint resource
|
|
1365
|
+
*
|
|
1366
|
+
* @example
|
|
1367
|
+
* ```typescript
|
|
1368
|
+
* const sprint = await jiraClient.board(42).sprint(10);
|
|
1369
|
+
* const sprintIssues = await jiraClient.board(42).sprint(10).issues();
|
|
1370
|
+
* ```
|
|
1371
|
+
*/
|
|
1372
|
+
sprint(sprintId: number): SprintResource;
|
|
1373
|
+
}
|
|
1374
|
+
|
|
1375
|
+
/**
|
|
1376
|
+
* A Jira issue field (system or custom).
|
|
1377
|
+
*/
|
|
1378
|
+
interface JiraField {
|
|
1379
|
+
/** Unique field ID (e.g. `'summary'`, `'customfield_10000'`) */
|
|
1380
|
+
id: string;
|
|
1381
|
+
/** Human-readable name */
|
|
1382
|
+
name: string;
|
|
1383
|
+
/** Whether this is a custom field */
|
|
1384
|
+
custom: boolean;
|
|
1385
|
+
/** Whether the field is orderable */
|
|
1386
|
+
orderable: boolean;
|
|
1387
|
+
/** Whether the field is navigable */
|
|
1388
|
+
navigable: boolean;
|
|
1389
|
+
/** Whether the field is searchable */
|
|
1390
|
+
searchable: boolean;
|
|
1391
|
+
/** Clause names used in JQL */
|
|
1392
|
+
clauseNames: string[];
|
|
1393
|
+
/** Field schema */
|
|
1394
|
+
schema?: {
|
|
1395
|
+
type: string;
|
|
1396
|
+
system?: string;
|
|
1397
|
+
custom?: string;
|
|
1398
|
+
customId?: number;
|
|
1399
|
+
items?: string;
|
|
1400
|
+
};
|
|
1401
|
+
}
|
|
1402
|
+
|
|
1403
|
+
/**
|
|
1404
|
+
* A saved Jira filter.
|
|
1405
|
+
*/
|
|
1406
|
+
interface JiraFilter {
|
|
1407
|
+
/** URL of the filter resource */
|
|
1408
|
+
self: string;
|
|
1409
|
+
/** Numeric string ID */
|
|
1410
|
+
id: string;
|
|
1411
|
+
/** Filter name */
|
|
1412
|
+
name: string;
|
|
1413
|
+
/** Filter description */
|
|
1414
|
+
description?: string;
|
|
1415
|
+
/** User who created the filter */
|
|
1416
|
+
owner?: JiraUser;
|
|
1417
|
+
/** The JQL query string */
|
|
1418
|
+
jql: string;
|
|
1419
|
+
/** URL to view the filter results */
|
|
1420
|
+
viewUrl?: string;
|
|
1421
|
+
/** URL to the filter REST resource */
|
|
1422
|
+
searchUrl?: string;
|
|
1423
|
+
/** Whether the filter is a favourite of the authenticated user */
|
|
1424
|
+
favourite?: boolean;
|
|
1425
|
+
/** Number of users who have marked this filter as a favourite */
|
|
1426
|
+
favouritedCount?: number;
|
|
1427
|
+
/** Shared permissions */
|
|
1428
|
+
sharePermissions?: JiraFilterPermission[];
|
|
1429
|
+
/** Subscriptions to this filter */
|
|
1430
|
+
subscriptions?: {
|
|
1431
|
+
size: number;
|
|
1432
|
+
items: unknown[];
|
|
1433
|
+
};
|
|
1434
|
+
}
|
|
1435
|
+
/**
|
|
1436
|
+
* A permission entry for a shared filter.
|
|
1437
|
+
*/
|
|
1438
|
+
interface JiraFilterPermission {
|
|
1439
|
+
/** Numeric ID */
|
|
1440
|
+
id: number;
|
|
1441
|
+
/** Permission type (e.g. `'global'`, `'project'`, `'group'`, `'role'`) */
|
|
1442
|
+
type: string;
|
|
1443
|
+
/** Project permission details */
|
|
1444
|
+
project?: {
|
|
1445
|
+
id: string;
|
|
1446
|
+
key: string;
|
|
1447
|
+
name: string;
|
|
1448
|
+
};
|
|
1449
|
+
/** Role permission details */
|
|
1450
|
+
role?: {
|
|
1451
|
+
id: number;
|
|
1452
|
+
name: string;
|
|
1453
|
+
};
|
|
1454
|
+
/** Group permission details */
|
|
1455
|
+
group?: {
|
|
1456
|
+
name: string;
|
|
1457
|
+
};
|
|
1458
|
+
}
|
|
1459
|
+
|
|
1460
|
+
/**
|
|
1461
|
+
* Payload emitted on every HTTP request made by {@link JiraClient}.
|
|
1462
|
+
*/
|
|
1463
|
+
interface RequestEvent {
|
|
1464
|
+
/** Full URL that was requested */
|
|
1465
|
+
url: string;
|
|
1466
|
+
/** HTTP method used */
|
|
1467
|
+
method: 'GET' | 'POST';
|
|
1468
|
+
/** Timestamp when the request started */
|
|
1469
|
+
startedAt: Date;
|
|
1470
|
+
/** Timestamp when the request finished (success or error) */
|
|
1471
|
+
finishedAt: Date;
|
|
1472
|
+
/** Total duration in milliseconds */
|
|
1473
|
+
durationMs: number;
|
|
1474
|
+
/** HTTP status code returned by the server, if a response was received */
|
|
1475
|
+
statusCode?: number;
|
|
1476
|
+
/** Error thrown, if the request failed */
|
|
1477
|
+
error?: Error;
|
|
1478
|
+
}
|
|
1479
|
+
/** Map of supported client events to their callback signatures */
|
|
1480
|
+
interface JiraClientEvents {
|
|
1481
|
+
request: (event: RequestEvent) => void;
|
|
1482
|
+
}
|
|
1483
|
+
/**
|
|
1484
|
+
* Constructor options for {@link JiraClient}.
|
|
1485
|
+
*/
|
|
1486
|
+
interface JiraClientOptions {
|
|
1487
|
+
/** The host URL of the Jira Data Center instance (e.g., `https://jira.example.com`) */
|
|
1488
|
+
apiUrl: string;
|
|
1489
|
+
/**
|
|
1490
|
+
* The REST API path to prepend to every core request.
|
|
1491
|
+
* @default `'rest/api/latest'`
|
|
1492
|
+
*/
|
|
1493
|
+
apiPath?: string;
|
|
1494
|
+
/**
|
|
1495
|
+
* The Agile (Software) REST API path used for boards and sprints.
|
|
1496
|
+
* @default `'rest/agile/latest'`
|
|
1497
|
+
*/
|
|
1498
|
+
agileApiPath?: string;
|
|
1499
|
+
/** The username to authenticate with */
|
|
1500
|
+
user: string;
|
|
1501
|
+
/** The personal access token or password to authenticate with */
|
|
1502
|
+
token: string;
|
|
1503
|
+
}
|
|
1504
|
+
/**
|
|
1505
|
+
* Main entry point for the Jira Data Center REST API client.
|
|
1506
|
+
*
|
|
1507
|
+
* @example
|
|
1508
|
+
* ```typescript
|
|
1509
|
+
* const jira = new JiraClient({
|
|
1510
|
+
* apiUrl: 'https://jira.example.com',
|
|
1511
|
+
* user: 'pilmee',
|
|
1512
|
+
* token: 'my-token',
|
|
1513
|
+
* });
|
|
1514
|
+
*
|
|
1515
|
+
* // Search issues with JQL
|
|
1516
|
+
* const results = await jira.search({ jql: 'project = PROJ AND status = Open', maxResults: 50 });
|
|
1517
|
+
*
|
|
1518
|
+
* // Get a single issue
|
|
1519
|
+
* const issue = await jira.issue('PROJ-42');
|
|
1520
|
+
*
|
|
1521
|
+
* // Get issue comments
|
|
1522
|
+
* const comments = await jira.issue('PROJ-42').comments();
|
|
1523
|
+
*
|
|
1524
|
+
* // Get issue changelog
|
|
1525
|
+
* const changelog = await jira.issue('PROJ-42').changelog();
|
|
1526
|
+
*
|
|
1527
|
+
* // Get a project
|
|
1528
|
+
* const project = await jira.project('PROJ');
|
|
1529
|
+
*
|
|
1530
|
+
* // Get project components
|
|
1531
|
+
* const components = await jira.project('PROJ').components();
|
|
1532
|
+
*
|
|
1533
|
+
* // Get all projects
|
|
1534
|
+
* const projects = await jira.projects();
|
|
1535
|
+
*
|
|
1536
|
+
* // Get a board and its sprints
|
|
1537
|
+
* const sprints = await jira.board(42).sprints({ state: 'active' });
|
|
1538
|
+
*
|
|
1539
|
+
* // Get sprint issues
|
|
1540
|
+
* const sprintIssues = await jira.board(42).sprint(10).issues();
|
|
1541
|
+
*
|
|
1542
|
+
* // Get current user
|
|
1543
|
+
* const me = await jira.currentUser();
|
|
1544
|
+
* ```
|
|
1545
|
+
*/
|
|
1546
|
+
declare class JiraClient {
|
|
1547
|
+
private readonly security;
|
|
1548
|
+
private readonly apiPath;
|
|
1549
|
+
private readonly agileApiPath;
|
|
1550
|
+
private readonly listeners;
|
|
1551
|
+
/**
|
|
1552
|
+
* @param options - Connection and authentication options
|
|
1553
|
+
* @throws {TypeError} If `apiUrl` is not a valid URL
|
|
1554
|
+
*/
|
|
1555
|
+
constructor({ apiUrl, apiPath, agileApiPath, user, token }: JiraClientOptions);
|
|
1556
|
+
/**
|
|
1557
|
+
* Subscribes to a client event.
|
|
1558
|
+
*
|
|
1559
|
+
* @example
|
|
1560
|
+
* ```typescript
|
|
1561
|
+
* jira.on('request', (event) => {
|
|
1562
|
+
* console.log(`${event.method} ${event.url} — ${event.durationMs}ms`);
|
|
1563
|
+
* if (event.error) console.error('Request failed:', event.error);
|
|
1564
|
+
* });
|
|
1565
|
+
* ```
|
|
1566
|
+
*/
|
|
1567
|
+
on<K extends keyof JiraClientEvents>(event: K, callback: JiraClientEvents[K]): this;
|
|
1568
|
+
private emit;
|
|
1569
|
+
/**
|
|
1570
|
+
* Performs an authenticated GET request to the Jira REST API.
|
|
1571
|
+
* @internal
|
|
1572
|
+
*/
|
|
1573
|
+
private request;
|
|
1574
|
+
private requestPost;
|
|
1575
|
+
/**
|
|
1576
|
+
* Returns an {@link IssueResource} for a given issue key or ID, providing access
|
|
1577
|
+
* to issue data and sub-resources (comments, changelog, transitions, etc.).
|
|
1578
|
+
*
|
|
1579
|
+
* The returned resource can be awaited directly to fetch the issue,
|
|
1580
|
+
* or chained to access nested resources.
|
|
1581
|
+
*
|
|
1582
|
+
* @param issueIdOrKey - The issue key (e.g., `'PROJ-42'`) or numeric ID
|
|
1583
|
+
* @returns A chainable issue resource
|
|
1584
|
+
*
|
|
1585
|
+
* @example
|
|
1586
|
+
* ```typescript
|
|
1587
|
+
* const issue = await jira.issue('PROJ-42');
|
|
1588
|
+
* const comments = await jira.issue('PROJ-42').comments();
|
|
1589
|
+
* const changelog = await jira.issue('PROJ-42').changelog();
|
|
1590
|
+
* const transitions = await jira.issue('PROJ-42').transitions();
|
|
1591
|
+
* ```
|
|
1592
|
+
*/
|
|
1593
|
+
issue(issueIdOrKey: string): IssueResource;
|
|
1594
|
+
/**
|
|
1595
|
+
* Searches for issues using JQL.
|
|
1596
|
+
*
|
|
1597
|
+
* `GET /rest/api/latest/search`
|
|
1598
|
+
*
|
|
1599
|
+
* @param params - Optional: `jql`, `startAt`, `maxResults`, `fields`, `expand`, `validateQuery`
|
|
1600
|
+
* @returns A search response containing matching issues
|
|
1601
|
+
*
|
|
1602
|
+
* @example
|
|
1603
|
+
* ```typescript
|
|
1604
|
+
* const results = await jira.search({
|
|
1605
|
+
* jql: 'project = PROJ AND status = Open ORDER BY created DESC',
|
|
1606
|
+
* maxResults: 50,
|
|
1607
|
+
* fields: 'summary,status,assignee,priority',
|
|
1608
|
+
* });
|
|
1609
|
+
* ```
|
|
1610
|
+
*/
|
|
1611
|
+
search(params?: SearchParams): Promise<JiraSearchResponse>;
|
|
1612
|
+
/**
|
|
1613
|
+
* Fetches all projects accessible to the authenticated user.
|
|
1614
|
+
*
|
|
1615
|
+
* `GET /rest/api/latest/project`
|
|
1616
|
+
*
|
|
1617
|
+
* @param params - Optional: `expand`, `recent`
|
|
1618
|
+
* @returns An array of projects
|
|
1619
|
+
*/
|
|
1620
|
+
projects(params?: ProjectsParams): Promise<JiraProject[]>;
|
|
1621
|
+
/**
|
|
1622
|
+
* Returns a {@link ProjectResource} for a given project key or ID.
|
|
1623
|
+
*
|
|
1624
|
+
* The returned resource can be awaited directly to fetch project info,
|
|
1625
|
+
* or chained to access nested resources.
|
|
1626
|
+
*
|
|
1627
|
+
* @param projectIdOrKey - The project key (e.g., `'PROJ'`) or numeric ID
|
|
1628
|
+
* @returns A chainable project resource
|
|
1629
|
+
*
|
|
1630
|
+
* @example
|
|
1631
|
+
* ```typescript
|
|
1632
|
+
* const project = await jira.project('PROJ');
|
|
1633
|
+
* const components = await jira.project('PROJ').components();
|
|
1634
|
+
* const versions = await jira.project('PROJ').versions();
|
|
1635
|
+
* const statuses = await jira.project('PROJ').statuses();
|
|
1636
|
+
* ```
|
|
1637
|
+
*/
|
|
1638
|
+
project(projectIdOrKey: string): ProjectResource;
|
|
1639
|
+
/**
|
|
1640
|
+
* Searches for users.
|
|
1641
|
+
*
|
|
1642
|
+
* `GET /rest/api/latest/user/search`
|
|
1643
|
+
*
|
|
1644
|
+
* @param params - Optional: `username`, `startAt`, `maxResults`
|
|
1645
|
+
* @returns An array of users
|
|
1646
|
+
*/
|
|
1647
|
+
users(params?: UserSearchParams): Promise<JiraUser[]>;
|
|
1648
|
+
/**
|
|
1649
|
+
* Fetches a single user by username or key.
|
|
1650
|
+
*
|
|
1651
|
+
* `GET /rest/api/latest/user`
|
|
1652
|
+
*
|
|
1653
|
+
* @param username - The username (login name) to look up
|
|
1654
|
+
* @returns The user object
|
|
1655
|
+
*
|
|
1656
|
+
* @example
|
|
1657
|
+
* ```typescript
|
|
1658
|
+
* const user = await jira.user('pilmee');
|
|
1659
|
+
* ```
|
|
1660
|
+
*/
|
|
1661
|
+
user(username: string): Promise<JiraUser>;
|
|
1662
|
+
/**
|
|
1663
|
+
* Fetches the currently authenticated user.
|
|
1664
|
+
*
|
|
1665
|
+
* `GET /rest/api/latest/myself`
|
|
1666
|
+
*
|
|
1667
|
+
* @returns The authenticated user object
|
|
1668
|
+
*
|
|
1669
|
+
* @example
|
|
1670
|
+
* ```typescript
|
|
1671
|
+
* const me = await jira.currentUser();
|
|
1672
|
+
* ```
|
|
1673
|
+
*/
|
|
1674
|
+
currentUser(): Promise<JiraUser>;
|
|
1675
|
+
/**
|
|
1676
|
+
* Fetches all boards accessible to the authenticated user.
|
|
1677
|
+
*
|
|
1678
|
+
* `GET /rest/agile/latest/board`
|
|
1679
|
+
*
|
|
1680
|
+
* @param params - Optional: `startAt`, `maxResults`, `type`, `name`, `projectKeyOrId`
|
|
1681
|
+
* @returns A paged response of boards
|
|
1682
|
+
*/
|
|
1683
|
+
boards(params?: BoardsParams): Promise<PagedResponse<JiraBoard>>;
|
|
1684
|
+
/**
|
|
1685
|
+
* Returns a {@link BoardResource} for a given board ID.
|
|
1686
|
+
*
|
|
1687
|
+
* The returned resource can be awaited directly to fetch board info,
|
|
1688
|
+
* or chained to access nested resources (sprints, issues, backlog).
|
|
1689
|
+
*
|
|
1690
|
+
* @param boardId - The numeric board ID
|
|
1691
|
+
* @returns A chainable board resource
|
|
1692
|
+
*
|
|
1693
|
+
* @example
|
|
1694
|
+
* ```typescript
|
|
1695
|
+
* const board = await jira.board(42);
|
|
1696
|
+
* const sprints = await jira.board(42).sprints({ state: 'active' });
|
|
1697
|
+
* const backlog = await jira.board(42).backlog({ maxResults: 50 });
|
|
1698
|
+
* const sprintIssues = await jira.board(42).sprint(10).issues();
|
|
1699
|
+
* ```
|
|
1700
|
+
*/
|
|
1701
|
+
board(boardId: number): BoardResource;
|
|
1702
|
+
/**
|
|
1703
|
+
* Fetches all issue types available to the authenticated user.
|
|
1704
|
+
*
|
|
1705
|
+
* `GET /rest/api/latest/issuetype`
|
|
1706
|
+
*
|
|
1707
|
+
* @returns An array of issue types
|
|
1708
|
+
*/
|
|
1709
|
+
issuetypes(): Promise<JiraIssueType[]>;
|
|
1710
|
+
/**
|
|
1711
|
+
* Fetches a single issue type by ID.
|
|
1712
|
+
*
|
|
1713
|
+
* `GET /rest/api/latest/issuetype/{id}`
|
|
1714
|
+
*
|
|
1715
|
+
* @param id - The issue type ID
|
|
1716
|
+
* @returns The issue type object
|
|
1717
|
+
*/
|
|
1718
|
+
issuetype(id: string): Promise<JiraIssueType>;
|
|
1719
|
+
/**
|
|
1720
|
+
* Fetches all priorities.
|
|
1721
|
+
*
|
|
1722
|
+
* `GET /rest/api/latest/priority`
|
|
1723
|
+
*
|
|
1724
|
+
* @returns An array of priorities
|
|
1725
|
+
*/
|
|
1726
|
+
priorities(): Promise<JiraPriority[]>;
|
|
1727
|
+
/**
|
|
1728
|
+
* Fetches a single priority by ID.
|
|
1729
|
+
*
|
|
1730
|
+
* `GET /rest/api/latest/priority/{id}`
|
|
1731
|
+
*
|
|
1732
|
+
* @param id - The priority ID
|
|
1733
|
+
* @returns The priority object
|
|
1734
|
+
*/
|
|
1735
|
+
priority(id: string): Promise<JiraPriority>;
|
|
1736
|
+
/**
|
|
1737
|
+
* Fetches all statuses.
|
|
1738
|
+
*
|
|
1739
|
+
* `GET /rest/api/latest/status`
|
|
1740
|
+
*
|
|
1741
|
+
* @returns An array of statuses
|
|
1742
|
+
*/
|
|
1743
|
+
statuses(): Promise<JiraStatus[]>;
|
|
1744
|
+
/**
|
|
1745
|
+
* Fetches a single status by ID or name.
|
|
1746
|
+
*
|
|
1747
|
+
* `GET /rest/api/latest/status/{idOrName}`
|
|
1748
|
+
*
|
|
1749
|
+
* @param idOrName - The status ID or name
|
|
1750
|
+
* @returns The status object
|
|
1751
|
+
*/
|
|
1752
|
+
status(idOrName: string): Promise<JiraStatus>;
|
|
1753
|
+
/**
|
|
1754
|
+
* Fetches all issue fields (system and custom).
|
|
1755
|
+
*
|
|
1756
|
+
* `GET /rest/api/latest/field`
|
|
1757
|
+
*
|
|
1758
|
+
* @returns An array of fields
|
|
1759
|
+
*/
|
|
1760
|
+
fields(): Promise<JiraField[]>;
|
|
1761
|
+
/**
|
|
1762
|
+
* Fetches all issue link types.
|
|
1763
|
+
*
|
|
1764
|
+
* `GET /rest/api/latest/issueLinkType`
|
|
1765
|
+
*
|
|
1766
|
+
* @returns An object with the list of issue link types
|
|
1767
|
+
*/
|
|
1768
|
+
issueLinkTypes(): Promise<{
|
|
1769
|
+
issueLinkTypes: JiraIssueLinkType[];
|
|
1770
|
+
}>;
|
|
1771
|
+
/**
|
|
1772
|
+
* Fetches the authenticated user's favourite filters.
|
|
1773
|
+
*
|
|
1774
|
+
* `GET /rest/api/latest/filter/favourite`
|
|
1775
|
+
*
|
|
1776
|
+
* @returns An array of filters
|
|
1777
|
+
*/
|
|
1778
|
+
favouriteFilters(): Promise<JiraFilter[]>;
|
|
1779
|
+
/**
|
|
1780
|
+
* Fetches a single filter by ID.
|
|
1781
|
+
*
|
|
1782
|
+
* `GET /rest/api/latest/filter/{id}`
|
|
1783
|
+
*
|
|
1784
|
+
* @param filterId - The numeric filter ID
|
|
1785
|
+
* @returns The filter object
|
|
1786
|
+
*/
|
|
1787
|
+
filter(filterId: string | number): Promise<JiraFilter>;
|
|
1788
|
+
/**
|
|
1789
|
+
* Fetches issues using a `POST` search, which supports larger JQL queries
|
|
1790
|
+
* and additional options such as specifying the fields list as an array.
|
|
1791
|
+
*
|
|
1792
|
+
* `POST /rest/api/latest/search`
|
|
1793
|
+
*
|
|
1794
|
+
* @param body - Search request body
|
|
1795
|
+
* @returns A search response containing matching issues
|
|
1796
|
+
*
|
|
1797
|
+
* @example
|
|
1798
|
+
* ```typescript
|
|
1799
|
+
* const results = await jira.searchPost({
|
|
1800
|
+
* jql: 'project = PROJ AND status = Open',
|
|
1801
|
+
* maxResults: 100,
|
|
1802
|
+
* fields: ['summary', 'status', 'assignee'],
|
|
1803
|
+
* });
|
|
1804
|
+
* ```
|
|
1805
|
+
*/
|
|
1806
|
+
searchPost(body: {
|
|
1807
|
+
jql?: string;
|
|
1808
|
+
startAt?: number;
|
|
1809
|
+
maxResults?: number;
|
|
1810
|
+
fields?: string[];
|
|
1811
|
+
expand?: string[];
|
|
1812
|
+
validateQuery?: 'strict' | 'warn' | 'none';
|
|
1813
|
+
fieldsByKeys?: boolean;
|
|
1814
|
+
properties?: string[];
|
|
1815
|
+
}): Promise<JiraSearchResponse>;
|
|
1816
|
+
/**
|
|
1817
|
+
* Fetches a single component by ID.
|
|
1818
|
+
*
|
|
1819
|
+
* `GET /rest/api/latest/component/{id}`
|
|
1820
|
+
*
|
|
1821
|
+
* @param componentId - The component ID
|
|
1822
|
+
* @returns The component object
|
|
1823
|
+
*/
|
|
1824
|
+
component(componentId: string): Promise<JiraComponent>;
|
|
1825
|
+
/**
|
|
1826
|
+
* Fetches a single version by ID.
|
|
1827
|
+
*
|
|
1828
|
+
* `GET /rest/api/latest/version/{id}`
|
|
1829
|
+
*
|
|
1830
|
+
* @param versionId - The version ID
|
|
1831
|
+
* @returns The version object
|
|
1832
|
+
*/
|
|
1833
|
+
version(versionId: string): Promise<JiraVersion>;
|
|
1834
|
+
/**
|
|
1835
|
+
* Fetches the related issue counts for a version.
|
|
1836
|
+
*
|
|
1837
|
+
* `GET /rest/api/latest/version/{id}/relatedIssueCounts`
|
|
1838
|
+
*
|
|
1839
|
+
* @param versionId - The version ID
|
|
1840
|
+
* @returns Issue counts by type
|
|
1841
|
+
*/
|
|
1842
|
+
versionIssueCounts(versionId: string): Promise<JiraVersionIssueCounts>;
|
|
1843
|
+
/**
|
|
1844
|
+
* Fetches the number of unresolved issues for a version.
|
|
1845
|
+
*
|
|
1846
|
+
* `GET /rest/api/latest/version/{id}/unresolvedIssueCount`
|
|
1847
|
+
*
|
|
1848
|
+
* @param versionId - The version ID
|
|
1849
|
+
* @returns The unresolved issue count
|
|
1850
|
+
*/
|
|
1851
|
+
versionUnresolvedIssueCount(versionId: string): Promise<JiraVersionUnresolvedIssueCount>;
|
|
1852
|
+
}
|
|
1853
|
+
|
|
1854
|
+
/**
|
|
1855
|
+
* Thrown when the Jira Data Center API returns a non-2xx response.
|
|
1856
|
+
*
|
|
1857
|
+
* @example
|
|
1858
|
+
* ```typescript
|
|
1859
|
+
* import { JiraApiError } from 'jira-datacenter-api-client';
|
|
1860
|
+
*
|
|
1861
|
+
* try {
|
|
1862
|
+
* await jira.issue('NONEXISTENT-1');
|
|
1863
|
+
* } catch (err) {
|
|
1864
|
+
* if (err instanceof JiraApiError) {
|
|
1865
|
+
* console.log(err.status); // 404
|
|
1866
|
+
* console.log(err.statusText); // 'Not Found'
|
|
1867
|
+
* console.log(err.message); // 'Jira API error: 404 Not Found'
|
|
1868
|
+
* }
|
|
1869
|
+
* }
|
|
1870
|
+
* ```
|
|
1871
|
+
*/
|
|
1872
|
+
declare class JiraApiError extends Error {
|
|
1873
|
+
/** HTTP status code (e.g. `404`, `401`, `403`) */
|
|
1874
|
+
readonly status: number;
|
|
1875
|
+
/** HTTP status text (e.g. `'Not Found'`, `'Unauthorized'`) */
|
|
1876
|
+
readonly statusText: string;
|
|
1877
|
+
constructor(status: number, statusText: string);
|
|
1878
|
+
}
|
|
1879
|
+
|
|
1880
|
+
/**
|
|
1881
|
+
* Handles Basic Authentication for Jira Data Center REST API requests.
|
|
1882
|
+
*
|
|
1883
|
+
* @example
|
|
1884
|
+
* ```typescript
|
|
1885
|
+
* const security = new Security(
|
|
1886
|
+
* 'https://jira.example.com',
|
|
1887
|
+
* 'my-user',
|
|
1888
|
+
* 'my-token'
|
|
1889
|
+
* );
|
|
1890
|
+
*
|
|
1891
|
+
* const headers = security.getHeaders();
|
|
1892
|
+
* // { Authorization: 'Basic <base64>', 'Content-Type': 'application/json', Accept: 'application/json' }
|
|
1893
|
+
* ```
|
|
1894
|
+
*/
|
|
1895
|
+
declare class Security {
|
|
1896
|
+
private readonly apiUrl;
|
|
1897
|
+
private readonly authorizationHeader;
|
|
1898
|
+
/**
|
|
1899
|
+
* Creates a new Security instance with Basic Authentication credentials.
|
|
1900
|
+
*
|
|
1901
|
+
* @param apiUrl - The base URL of the Jira Data Center instance (e.g., `https://jira.example.com`).
|
|
1902
|
+
* Must be a valid URL; throws if it cannot be parsed.
|
|
1903
|
+
* @param user - The username to authenticate with
|
|
1904
|
+
* @param token - The personal access token or password to authenticate with
|
|
1905
|
+
*
|
|
1906
|
+
* @throws {TypeError} If `apiUrl` is not a valid URL
|
|
1907
|
+
*/
|
|
1908
|
+
constructor(apiUrl: string, user: string, token: string);
|
|
1909
|
+
/**
|
|
1910
|
+
* Returns the base URL of the Jira Data Center instance, without a trailing slash.
|
|
1911
|
+
*
|
|
1912
|
+
* @returns The API base URL
|
|
1913
|
+
*/
|
|
1914
|
+
getApiUrl(): string;
|
|
1915
|
+
/**
|
|
1916
|
+
* Returns the value of the `Authorization` header for Basic Authentication.
|
|
1917
|
+
*
|
|
1918
|
+
* @returns The Authorization header value in the format `Basic <base64-encoded-credentials>`
|
|
1919
|
+
*/
|
|
1920
|
+
getAuthorizationHeader(): string;
|
|
1921
|
+
/**
|
|
1922
|
+
* Returns the full set of HTTP headers required for authenticated API requests.
|
|
1923
|
+
*
|
|
1924
|
+
* @returns An object containing `Authorization`, `Content-Type`, and `Accept` headers
|
|
1925
|
+
*/
|
|
1926
|
+
getHeaders(): Record<string, string>;
|
|
1927
|
+
}
|
|
1928
|
+
|
|
1929
|
+
export { type BoardIssuesParams, BoardResource, type BoardsParams, type ChangelogParams, type CommentsParams, type IssueParams, IssueResource, JiraApiError, type JiraAttachment, type JiraBoard, type JiraBoardFilter, type JiraBoardProject, type JiraChangelogEntry, type JiraChangelogItem, type JiraChangelogResponse, JiraClient, type JiraClientEvents, type JiraClientOptions, type JiraComment, type JiraCommentResponse, type JiraCommentVisibility, type JiraComponent, type JiraField, type JiraFilter, type JiraFilterPermission, type JiraIssue, type JiraIssueFields, type JiraIssueLink, type JiraIssueLinkType, type JiraIssueRef, type JiraIssueType, type JiraPriority, type JiraProject, type JiraProjectRef, type JiraProjectRole, type JiraProjectRoleActor, type JiraProjectStatus, type JiraRemoteLink, type JiraRemoteLinkObject, type JiraResolution, type JiraSearchResponse, type JiraSprint, type JiraStatus, type JiraStatusCategory, type JiraSubtask, type JiraTimeTracking, type JiraTransition, type JiraTransitionField, type JiraUser, type JiraVersion, type JiraVersionIssueCounts, type JiraVersionUnresolvedIssueCount, type JiraVotes, type JiraWatchers, type JiraWorklog, type JiraWorklogResponse, type PagedResponse, type PaginationParams, ProjectResource, type ProjectsParams, type RequestEvent, type SearchParams, Security, SprintResource, type SprintsParams, type TransitionsParams, type UserSearchParams, type WorklogsParams };
|