backlog-js 0.12.4 → 0.12.5

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/dist/backlog.d.ts DELETED
@@ -1,750 +0,0 @@
1
- declare module 'backlog-js' {
2
-
3
- class Request {
4
- private configure;
5
- constructor(configure: {
6
- host: string;
7
- apiKey?: string;
8
- accessToken?: string;
9
- timeout?: number;
10
- });
11
- get<T>(path: string, params?: any): Promise<T>;
12
- post<T>(path: string, params?: any): Promise<T>;
13
- put<T>(path: string, params: any): Promise<T>;
14
- patch<T>(path: string, params: any): Promise<T>;
15
- delete<T>(path: string, params?: any): Promise<T>;
16
- request(options: {
17
- method: string;
18
- path: string;
19
- params?: Params | FormData;
20
- }): Promise<Response>;
21
- checkStatus(response: Response): Promise<Response>;
22
- parseJSON<T>(response: Response): Promise<T>;
23
- private toFormData(params);
24
- private toQueryString(params);
25
- webAppBaseURL: string;
26
- restBaseURL: string;
27
- }
28
-
29
- type Params = {
30
- [index: string]: number | string | number[] | string[];
31
- };
32
-
33
- export class Backlog extends Request {
34
- constructor(configure: {
35
- host: string;
36
- apiKey?: string;
37
- accessToken?: string;
38
- timeout?: number;
39
- });
40
- getSpace(): Promise<any>;
41
- getSpaceActivities(params: Option.Space.GetActivitiesParams): Promise<any>;
42
- getSpaceIcon(): Promise<Entity.File.FileData>;
43
- getSpaceNotification(): Promise<any>;
44
- putSpaceNotification(params: Option.Space.PutSpaceNotificationParams): Promise<any>;
45
- getSpaceDiskUsage(): Promise<any>;
46
- postSpaceAttachment(form: FormData): Promise<any>;
47
- getUsers(): Promise<any>;
48
- getUser(userId: number): Promise<any>;
49
- postUser(params: Option.User.PostUserParams): Promise<any>;
50
- patchUser(userId: number, params: Option.User.PatchUserParams): Promise<any>;
51
- deleteUser(userId: number): Promise<any>;
52
- getMyself(): Promise<any>;
53
- getUserIcon(userId: number): Promise<Entity.File.FileData>;
54
- getUserActivities(userId: number, params: Option.User.GetUserActivitiesParams): Promise<any>;
55
- getUserStars(userId: number, params: Option.User.GetUserStarsParams): Promise<any>;
56
- getUserStarsCount(userId: number, params: Option.User.GetUserStarsCountParams): Promise<any>;
57
- getRecentlyViewedIssues(params: Option.User.GetRecentlyViewedParams): Promise<any>;
58
- getRecentlyViewedProjects(params: Option.User.GetRecentlyViewedParams): Promise<any>;
59
- getRecentlyViewedWikis(params: Option.User.GetRecentlyViewedParams): Promise<any>;
60
- /** @deprecated */
61
- getGroups(params: Option.Group.GetGroupsParams): Promise<any>;
62
- /** @deprecated */
63
- postGroups(params: Option.Group.PostGroupsParams): Promise<any>;
64
- /** @deprecated */
65
- getGroup(groupId: number): Promise<any>;
66
- /** @deprecated */
67
- patchGroup(groupId: number, params: Option.Group.PatchGroupParams): Promise<any>;
68
- /** @deprecated */
69
- deleteGroup(groupId: number): Promise<any>;
70
- /** @deprecated */
71
- getStatuses(): Promise<any>;
72
- getProjectStatuses(projectIdOrKey: string | number): Promise<any>;
73
- getResolutions(): Promise<any>;
74
- getPriorities(): Promise<any>;
75
- getProjects(params?: Option.Project.GetProjectsParams): Promise<any>;
76
- postProject(params: Option.Project.PostProjectParams): Promise<any>;
77
- getProject(projectIdOrKey: string | number): Promise<any>;
78
- patchProject(projectIdOrKey: string | number, params: Option.Project.PatchProjectParams): Promise<any>;
79
- deleteProject(projectIdOrKey: string | number): Promise<any>;
80
- getProjectIcon(projectIdOrKey: string | number): Promise<Entity.File.FileData>;
81
- getProjectActivities(projectIdOrKey: string | number, params: Option.Space.GetActivitiesParams): Promise<any>;
82
- postProjectUser(projectIdOrKey: string | number, userId: string): Promise<any>;
83
- getProjectUsers(projectIdOrKey: string | number): Promise<any>;
84
- deleteProjectUsers(projectIdOrKey: string | number, params: Option.Project.DeleteProjectUsersParams): Promise<any>;
85
- postProjectAdministrators(projectIdOrKey: string | number, params: Option.Project.PostProjectAdministrators): Promise<any>;
86
- getProjectAdministrators(projectIdOrKey: string | number): Promise<any>;
87
- deleteProjectAdministrators(projectIdOrKey: string | number, params: Option.Project.DeleteProjectAdministrators): Promise<any>;
88
- postProjectStatus(projectIdOrKey: string | number, params: Option.Project.PostStatusParams): Promise<any>;
89
- patchProjectStatus(projectIdOrKey: string | number, id: number, params: Option.Project.PatchStatusParams): Promise<any>;
90
- deleteProjectStatus(projectIdOrKey: string | number, id: number, substituteStatusId: number): Promise<any>;
91
- patchProjectStatusOrder(projectIdOrKey: string | number, statusId: number[]): Promise<any>;
92
- getIssueTypes(projectIdOrKey: string | number): Promise<any>;
93
- postIssueType(projectIdOrKey: string | number, params: Option.Project.PostIssueTypeParams): Promise<any>;
94
- patchIssueType(projectIdOrKey: string | number, id: number, params: Option.Project.PatchIssueTypeParams): Promise<any>;
95
- deleteIssueType(projectIdOrKey: string | number, id: number, params: Option.Project.DeleteIssueTypeParams): Promise<any>;
96
- getCategories(projectIdOrKey: string | number): Promise<any>;
97
- postCategories(projectIdOrKey: string | number, params: Option.Project.PostCategoriesParams): Promise<any>;
98
- patchCategories(projectIdOrKey: string | number, id: number, params: Option.Project.PatchCategoriesParams): Promise<any>;
99
- deleteCategories(projectIdOrKey: string | number, id: number): Promise<any>;
100
- getVersions(projectIdOrKey: string | number): Promise<any>;
101
- postVersions(projectIdOrKey: string | number, params: Option.Project.PostVersionsParams): Promise<any>;
102
- patchVersions(projectIdOrKey: string | number, id: number, params: Option.Project.PatchVersionsParams): Promise<any>;
103
- deleteVersions(projectIdOrKey: string | number, id: number): Promise<any>;
104
- getCustomFields(projectIdOrKey: string | number): Promise<any>;
105
- postCustomField(projectIdOrKey: string | number, params: Option.Project.PostCustomFieldParams | Option.Project.PostCustomFieldWithNumericParams | Option.Project.PostCustomFieldWithDateParams | Option.Project.PostCustomFieldWithListParams): Promise<any>;
106
- patchCustomField(projectIdOrKey: string | number, id: number, params: Option.Project.PatchCustomFieldParams | Option.Project.PatchCustomFieldWithNumericParams | Option.Project.PatchCustomFieldWithDateParams | Option.Project.PatchCustomFieldWithListParams): Promise<any>;
107
- deleteCustomField(projectIdOrKey: string | number, id: number): Promise<any>;
108
- postCustomFieldItem(projectIdOrKey: string | number, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
109
- patchCustomFieldItem(projectIdOrKey: string | number, id: number, itemId: number, params: Option.Project.PatchCustomFieldItemParams): Promise<any>;
110
- deleteCustomFieldItem(projectIdOrKey: string | number, id: number, params: Option.Project.PostCustomFieldItemParams): Promise<any>;
111
- getSharedFiles(projectIdOrKey: string | number, path: string, params: Option.Project.GetSharedFilesParams): Promise<any>;
112
- getSharedFile(projectIdOrKey: string | number, sharedFileId: number): Promise<Entity.File.FileData>;
113
- getProjectsDiskUsage(projectIdOrKey: string | number): Promise<any>;
114
- getWebhooks(projectIdOrKey: string | number): Promise<any>;
115
- postWebhook(projectIdOrKey: string | number, params: Option.Project.PostWebhookParams): Promise<any>;
116
- getWebhook(projectIdOrKey: string | number, webhookId: string): Promise<any>;
117
- patchWebhook(projectIdOrKey: string | number, webhookId: string, params: Option.Project.PatchWebhookParams): Promise<any>;
118
- deleteWebhook(projectIdOrKey: string | number, webhookId: string): Promise<any>;
119
- getIssues(params?: Option.Issue.GetIssuesParams): Promise<any>;
120
- getIssuesCount(params?: Option.Issue.GetIssuesParams): Promise<any>;
121
- postIssue(params: Option.Issue.PostIssueParams): Promise<any>;
122
- patchIssue(issueIdOrKey: string | number, params: Option.Issue.PatchIssueParams): Promise<any>;
123
- getIssue(issueIdOrKey: string | number): Promise<any>;
124
- deleteIssuesCount(issueIdOrKey: string | number): Promise<any>;
125
- getIssueComments(issueIdOrKey: string | number, params: Option.Issue.GetIssueCommentsParams): Promise<any>;
126
- postIssueComments(issueIdOrKey: string | number, params: Option.Issue.PostIssueCommentsParams): Promise<any>;
127
- getIssueCommentsCount(issueIdOrKey: string | number): Promise<any>;
128
- getIssueComment(issueIdOrKey: string | number, commentId: number): Promise<any>;
129
- deleteIssueComment(issueIdOrKey: string | number, commentId: number): Promise<any>;
130
- patchIssueComment(issueIdOrKey: string | number, commentId: number, params: Option.Issue.PatchIssueCommentParams): Promise<any>;
131
- getIssueCommentNotifications(issueIdOrKey: string | number, commentId: number): Promise<any>;
132
- postIssueCommentNotifications(issueIdOrKey: string | number, commentId: number, prams: Option.Issue.IssueCommentNotifications): Promise<any>;
133
- getIssueAttachments(issueIdOrKey: string | number): Promise<any>;
134
- getIssueAttachment(issueIdOrKey: string | number, attachmentId: number): Promise<Entity.File.FileData>;
135
- deleteIssueAttachment(issueIdOrKey: string | number, attachmentId: string): Promise<any>;
136
- getIssueParticipants(issueIdOrKey: string | number): Promise<any>;
137
- getIssueSharedFiles(issueIdOrKey: string | number): Promise<any>;
138
- linkIssueSharedFiles(issueIdOrKey: string | number, params: Option.Issue.LinkIssueSharedFilesParams): Promise<any>;
139
- unlinkIssueSharedFile(issueIdOrKey: string | number, id: number): Promise<any>;
140
- getWikis(params: Option.Wiki.GetWikiParams): Promise<any>;
141
- getWikisCount(projectIdOrKey: string | number): Promise<any>;
142
- getWikisTags(projectIdOrKey: string | number): Promise<any>;
143
- postWiki(params: Option.Wiki.PostWikiParams): Promise<any>;
144
- getWiki(wikiId: number): Promise<any>;
145
- patchWiki(wikiId: number, params: Option.Wiki.PatchWikiParams): Promise<any>;
146
- deleteWiki(wikiId: number, mailNotify: boolean): Promise<any>;
147
- getWikisAttachments(wikiId: number): Promise<any>;
148
- postWikisAttachments(wikiId: number, attachmentId: number[]): Promise<any>;
149
- getWikiAttachment(wikiId: number, attachmentId: number): Promise<Entity.File.FileData>;
150
- deleteWikisAttachments(wikiId: number, attachmentId: number): Promise<any>;
151
- getWikisSharedFiles(wikiId: number): Promise<any>;
152
- linkWikisSharedFiles(wikiId: number, fileId: number[]): Promise<any>;
153
- unlinkWikisSharedFiles(wikiId: number, id: number): Promise<any>;
154
- getWikisHistory(wikiId: number, params: Option.Wiki.GetWikisHistoryParams): Promise<any>;
155
- getWikisStars(wikiId: number): Promise<any>;
156
- postStar(params: Option.Project.PostStarParams): Promise<any>;
157
- getNotifications(params: Option.Notification.GetNotificationsParams): Promise<any>;
158
- getNotificationsCount(params: Option.Notification.GetNotificationsCountParams): Promise<any>;
159
- resetNotificationsMarkAsRead(): Promise<any>;
160
- markAsReadNotification(id: number): Promise<any>;
161
- getGitRepositories(projectIdOrKey: string | number): Promise<any>;
162
- getGitRepository(projectIdOrKey: string | number, repoIdOrName: string): Promise<any>;
163
- getPullRequests(projectIdOrKey: string | number, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
164
- getPullRequestsCount(projectIdOrKey: string | number, repoIdOrName: string, params: Option.PullRequest.GetPullRequestsParams): Promise<any>;
165
- postPullRequest(projectIdOrKey: string | number, repoIdOrName: string, params: Option.PullRequest.PostPullRequestParams): Promise<any>;
166
- getPullRequest(projectIdOrKey: string | number, repoIdOrName: string, number: number): Promise<any>;
167
- patchPullRequest(projectIdOrKey: string | number, repoIdOrName: string, number: number, params: Option.PullRequest.PatchPullRequestParams): Promise<any>;
168
- getPullRequestComments(projectIdOrKey: string | number, repoIdOrName: string, number: number, params: Option.PullRequest.GetPullRequestCommentsParams): Promise<any>;
169
- postPullRequestComments(projectIdOrKey: string | number, repoIdOrName: string, number: number, params: Option.PullRequest.PostPullRequestCommentsParams): Promise<any>;
170
- getPullRequestCommentsCount(projectIdOrKey: string | number, repoIdOrName: string, number: number): Promise<any>;
171
- patchPullRequestComments(projectIdOrKey: string | number, repoIdOrName: string, number: number, commentId: number, params: Option.PullRequest.PatchPullRequestCommentsParams): Promise<any>;
172
- getPullRequestAttachments(projectIdOrKey: string | number, repoIdOrName: string, number: number): Promise<any>;
173
- getPullRequestAttachment(projectIdOrKey: string | number, repoIdOrName: string, number: number, attachmentId: number): Promise<Entity.File.FileData>;
174
- deletePullRequestAttachment(projectIdOrKey: string | number, repoIdOrName: string, number: number, attachmentId: number): Promise<any>;
175
- getWatchingListItems(userId: number): Promise<any>;
176
- getWatchingListCount(userId: number): Promise<any>;
177
- getWatchingListItem(watchId: number): Promise<any>;
178
- postWatchingListItem(params: any): Promise<any>;
179
- patchWatchingListItem(watchId: number, note: string): Promise<any>;
180
- deletehWatchingListItem(watchId: number): Promise<any>;
181
- resetWatchingListItemAsRead(watchId: number): Promise<undefined>;
182
- /** @deprecated */
183
- getProjectGroupList(projectIdOrKey: string | number): Promise<any>;
184
- /** @deprecated */
185
- postProjectGroup(projectIdOrKey: string | number, params: any): Promise<any>;
186
- /** @deprecated */
187
- deleteProjectGroup(projectIdOrKey: string | number): Promise<any>;
188
- /** @deprecated */
189
- getGroupIcon(groupId: string): Promise<any>;
190
- getLicence(): Promise<any>;
191
- getTeams(params?: Option.Team.GetTeamsParams): Promise<any>;
192
- postTeam(members: number[]): Promise<any>;
193
- getTeam(teamId: number): Promise<any>;
194
- patchTeam(teamId: number, params: Option.Team.PatchTeamParams): Promise<any>;
195
- deleteTeam(teamId: number): Promise<any>;
196
- getTeamIcon(teamId: number): Promise<Entity.File.FileData>;
197
- getProjectTeams(projectIdOrKey: string | number): Promise<any>;
198
- postProjectTeam(projectIdOrKey: string | number, teamId: number): Promise<any>;
199
- deleteProjectTeam(projectIdOrKey: string | number, teamId: number): Promise<any>;
200
- getRateLimit(): Promise<any>;
201
- private download;
202
- private upload;
203
- private parseFileData;
204
- }
205
-
206
- export class OAuth2 {
207
- private credentials;
208
- private timeout;
209
- constructor(credentials: Option.OAuth2.Credentials, timeout?: number);
210
- getAuthorizationURL(options: {
211
- host: string;
212
- redirectUri?: string;
213
- state?: string;
214
- }): string;
215
- getAccessToken(options: {
216
- host: string;
217
- code: string;
218
- redirectUri?: string;
219
- }): Promise<Entity.OAuth2.AccessToken>;
220
- refreshAccessToken(options: {
221
- host: string;
222
- refreshToken: string;
223
- }): Promise<Entity.OAuth2.AccessToken>;
224
- }
225
-
226
- import { PassThrough } from 'stream';
227
- export namespace Entity {
228
- export namespace File {
229
- export type FileData = NodeFileData | BrowserFileData;
230
- export interface NodeFileData {
231
- body: PassThrough;
232
- url: string;
233
- filename: string;
234
- }
235
- export interface BrowserFileData {
236
- body: any;
237
- url: string;
238
- blob?: () => Promise<Blob>;
239
- }
240
- }
241
- export namespace OAuth2 {
242
- export interface AccessToken {
243
- access_token: string;
244
- token_type: string;
245
- expires_in: number;
246
- refresh_token: string;
247
- }
248
- }
249
- }
250
-
251
-
252
- export namespace Option {
253
- export type Order = "asc" | "desc";
254
- export enum ActivityType {
255
- Undefined = -1,
256
- IssueCreated = 1,
257
- IssueUpdated = 2,
258
- IssueCommented = 3,
259
- IssueDeleted = 4,
260
- WikiCreated = 5,
261
- WikiUpdated = 6,
262
- WikiDeleted = 7,
263
- FileAdded = 8,
264
- FileUpdated = 9,
265
- FileDeleted = 10,
266
- SvnCommitted = 11,
267
- GitPushed = 12,
268
- GitRepositoryCreated = 13,
269
- IssueMultiUpdated = 14,
270
- ProjectUserAdded = 15,
271
- ProjectUserRemoved = 16,
272
- NotifyAdded = 17,
273
- PullRequestAdded = 18,
274
- PullRequestUpdated = 19,
275
- PullRequestCommented = 20,
276
- PullRequestMerged = 21,
277
- }
278
- export namespace Notification {
279
- export interface GetNotificationsParams {
280
- minId?: number;
281
- maxId?: number;
282
- count?: number;
283
- order?: Order;
284
- }
285
- export interface GetNotificationsCountParams {
286
- alreadyRead: boolean;
287
- resourceAlreadyRead: boolean;
288
- }
289
- }
290
- export namespace Space {
291
- export interface GetActivitiesParams {
292
- activityTypeId?: ActivityType[];
293
- minId?: number;
294
- maxId?: number;
295
- count?: number;
296
- order?: Order;
297
- }
298
- export interface PutSpaceNotificationParams {
299
- content: string;
300
- }
301
- }
302
- export namespace User {
303
- export interface PostUserParams {
304
- userId: string;
305
- password: string;
306
- name: string;
307
- mailAddress: string;
308
- roleType: RoleType;
309
- }
310
- export interface PatchUserParams {
311
- password?: string;
312
- name?: string;
313
- mailAddress?: string;
314
- roleType?: RoleType;
315
- }
316
- export enum RoleType {
317
- Admin = 1,
318
- User = 2,
319
- Reporter = 3,
320
- Viewer = 4,
321
- GuestReporter = 5,
322
- GuestViewer = 6,
323
- }
324
- export interface GetUserActivitiesParams {
325
- activityTypeId?: ActivityType[];
326
- minId?: number;
327
- maxId?: number;
328
- count?: number;
329
- order?: Order;
330
- }
331
- export interface GetUserStarsParams {
332
- minId?: number;
333
- maxId?: number;
334
- count?: number;
335
- order?: Order;
336
- }
337
- export interface GetUserStarsCountParams {
338
- since?: string;
339
- until?: string;
340
- }
341
- export interface GetRecentlyViewedParams {
342
- order?: Order;
343
- offset?: number;
344
- count?: number;
345
- }
346
- }
347
- export namespace Group {
348
- export interface GetGroupsParams {
349
- order?: Order;
350
- offset?: number;
351
- count?: number;
352
- }
353
- export interface PostGroupsParams {
354
- name: string;
355
- members?: string[];
356
- }
357
- export interface PatchGroupParams {
358
- name?: string;
359
- members?: string[];
360
- }
361
- }
362
- export namespace Team {
363
- export interface GetTeamsParams {
364
- order?: Order;
365
- offset?: number;
366
- count?: number;
367
- }
368
- export interface PatchTeamParams {
369
- name?: string;
370
- members?: number[];
371
- }
372
- }
373
- export namespace Project {
374
- export type TextFormattingRule = "backlog" | "markdown";
375
- export interface PostProjectParams {
376
- name: string;
377
- key: string;
378
- chartEnabled: boolean;
379
- projectLeaderCanEditProjectLeader?: boolean;
380
- subtaskingEnabled: boolean;
381
- textFormattingRule: TextFormattingRule;
382
- }
383
- export interface PatchProjectParams {
384
- name?: string;
385
- key?: string;
386
- chartEnabled?: boolean;
387
- subtaskingEnabled?: boolean;
388
- projectLeaderCanEditProjectLeader?: boolean;
389
- textFormattingRule?: TextFormattingRule;
390
- archived?: boolean;
391
- }
392
- export interface GetProjectsParams {
393
- archived?: boolean;
394
- all?: boolean;
395
- }
396
- export interface DeleteProjectUsersParams {
397
- userId: number;
398
- }
399
- export interface PostProjectAdministrators {
400
- userId: number;
401
- }
402
- export interface DeleteProjectAdministrators {
403
- userId: number;
404
- }
405
- export type IssueTypeColor = "#e30000" | "#990000" | "#934981" | "#814fbc" | "#2779ca" | "#007e9a" | "#7ea800" | "#ff9200" | "#ff3265" | "#666665";
406
- export interface PostIssueTypeParams {
407
- name: string;
408
- color: IssueTypeColor;
409
- }
410
- export interface PatchIssueTypeParams {
411
- name?: string;
412
- color?: IssueTypeColor;
413
- }
414
- export interface DeleteIssueTypeParams {
415
- substituteIssueTypeId: number;
416
- }
417
- export interface PostCategoriesParams {
418
- name: string;
419
- }
420
- export interface PatchCategoriesParams {
421
- name: string;
422
- }
423
- export interface PostVersionsParams {
424
- name: string;
425
- description: string;
426
- startDate: string;
427
- releaseDueDate: string;
428
- }
429
- export interface PatchVersionsParams {
430
- name: string;
431
- description?: string;
432
- startDate?: string;
433
- releaseDueDate?: string;
434
- archived?: boolean;
435
- }
436
- export interface PostCustomFieldParams {
437
- typeId: FieldType;
438
- name: string;
439
- applicableIssueTypes?: number[];
440
- description?: string;
441
- required?: boolean;
442
- }
443
- export interface PostCustomFieldWithNumericParams extends PostCustomFieldParams {
444
- min?: number;
445
- max?: number;
446
- initialValue?: number;
447
- unit?: string;
448
- }
449
- export interface PostCustomFieldWithDateParams extends PostCustomFieldParams {
450
- min?: string;
451
- max?: string;
452
- initialValueType?: number;
453
- initialDate?: string;
454
- initialShift?: number;
455
- }
456
- export interface PostCustomFieldWithListParams extends PostCustomFieldParams {
457
- items?: string[];
458
- allowInput?: boolean;
459
- allowAddItem?: boolean;
460
- }
461
- export interface PatchCustomFieldParams {
462
- name?: string;
463
- applicableIssueTypes?: number[];
464
- description?: string;
465
- required?: boolean;
466
- }
467
- export interface PatchCustomFieldWithNumericParams extends PatchCustomFieldParams {
468
- min?: number;
469
- max?: number;
470
- initialValue?: number;
471
- unit?: string;
472
- }
473
- export interface PatchCustomFieldWithDateParams extends PatchCustomFieldParams {
474
- min?: string;
475
- max?: string;
476
- initialValueType?: number;
477
- initialDate?: string;
478
- initialShift?: number;
479
- }
480
- export interface PatchCustomFieldWithListParams extends PatchCustomFieldParams {
481
- items?: string[];
482
- allowInput?: boolean;
483
- allowAddItem?: boolean;
484
- }
485
- export interface PostCustomFieldItemParams {
486
- name: string;
487
- }
488
- export interface PatchCustomFieldItemParams {
489
- name: string;
490
- }
491
- export interface GetSharedFilesParams {
492
- order?: Order;
493
- offset?: number;
494
- count?: number;
495
- }
496
- export interface PostWebhookParams {
497
- name?: string;
498
- description?: string;
499
- hookUrl?: string;
500
- allEvent?: boolean;
501
- activityTypeIds?: number[];
502
- }
503
- export interface PatchWebhookParams {
504
- name?: string;
505
- description?: string;
506
- hookUrl?: string;
507
- allEvent?: boolean;
508
- activityTypeIds?: number[];
509
- }
510
- export enum FieldType {
511
- Text = 1,
512
- TextArea = 2,
513
- Numeric = 3,
514
- Date = 4,
515
- SingleList = 5,
516
- MultipleList = 6,
517
- CheckBox = 7,
518
- Radio = 8,
519
- }
520
- export interface PostStarParams {
521
- issueId?: number;
522
- commentId?: number;
523
- wikiId?: number;
524
- pullRequestId?: number;
525
- pullRequestCommentId?: number;
526
- }
527
- export type ProjectStatusColor = "#ea2c00" | "#e87758" | "#e07b9a" | "#868cb7" | "#3b9dbd" | "#4caf93" | "#b0be3c" | "#eda62a" | "#f42858" | "#393939";
528
- export interface PostStatusParams {
529
- name: string;
530
- color: ProjectStatusColor;
531
- }
532
- export interface PatchStatusParams {
533
- name?: string;
534
- color?: ProjectStatusColor;
535
- }
536
- }
537
- export namespace Issue {
538
- export interface PostIssueParams {
539
- projectId: number;
540
- summary: string;
541
- priorityId: number;
542
- issueTypeId: number;
543
- parentIssueId?: number;
544
- description?: string;
545
- startDate?: string;
546
- dueDate?: string;
547
- estimatedHours?: number;
548
- actualHours?: number;
549
- categoryId?: number[];
550
- versionId?: number[];
551
- milestoneId?: number[];
552
- assigneeId?: number;
553
- notifiedUserId?: number[];
554
- attachmentId?: number[];
555
- [customField_: string]: any;
556
- }
557
- export interface PatchIssueParams {
558
- summary?: string;
559
- parentIssueId?: number;
560
- description?: string;
561
- statusId?: number;
562
- resolutionId?: number;
563
- startDate?: string;
564
- dueDate?: string;
565
- estimatedHours?: number;
566
- actualHours?: number;
567
- issueTypeId?: number;
568
- categoryId?: number[];
569
- versionId?: number[];
570
- milestoneId?: number[];
571
- priorityId?: number;
572
- assigneeId?: number;
573
- notifiedUserId?: number[];
574
- attachmentId?: number[];
575
- comment?: string;
576
- [customField_: string]: any;
577
- }
578
- export interface GetIssuesParams {
579
- projectId?: number[];
580
- issueTypeId?: number[];
581
- categoryId?: number[];
582
- versionId?: number[];
583
- milestoneId?: number[];
584
- statusId?: number[];
585
- priorityId?: number[];
586
- assigneeId?: number[];
587
- createdUserId?: number[];
588
- resolutionId?: number[];
589
- parentChild?: ParentChildType;
590
- attachment?: boolean;
591
- sharedFile?: boolean;
592
- sort?: SortKey;
593
- order?: Order;
594
- offset?: number;
595
- count?: number;
596
- createdSince?: string;
597
- createdUntil?: string;
598
- updatedSince?: string;
599
- updatedUntil?: string;
600
- startDateSince?: string;
601
- startDateUntil?: string;
602
- dueDateSince?: string;
603
- dueDateUntil?: string;
604
- id?: number[];
605
- parentIssueId?: number[];
606
- keyword?: string;
607
- [customField_: string]: any;
608
- }
609
- export enum ParentChildType {
610
- All = 0,
611
- NotChild = 1,
612
- Child = 2,
613
- NotChildNotParent = 3,
614
- Parent = 4,
615
- }
616
- export type SortKey = "issueType" | "category" | "version" | "milestone" | "summary" | "status" | "priority" | "attachment" | "sharedFile" | "created" | "createdUser" | "updated" | "updatedUser" | "assignee" | "startDate" | "dueDate" | "estimatedHours" | "actualHours" | "childIssue";
617
- export interface GetIssueCommentsParams {
618
- minId?: number;
619
- maxId?: number;
620
- count?: number;
621
- order?: Order;
622
- }
623
- export interface PostIssueCommentsParams {
624
- content: string;
625
- notifiedUserId?: number[];
626
- attachmentId?: number[];
627
- }
628
- export interface PatchIssueCommentParams {
629
- content: string;
630
- }
631
- export interface IssueCommentNotifications {
632
- notifiedUserId: number[];
633
- }
634
- export interface LinkIssueSharedFilesParams {
635
- fileId: number[];
636
- }
637
- }
638
- export namespace PullRequest {
639
- export interface GetPullRequestsParams {
640
- statusId?: number[];
641
- assigneeId?: number[];
642
- issueId?: number[];
643
- createdUserId?: number[];
644
- offset?: number;
645
- count?: number;
646
- }
647
- export interface PostPullRequestParams {
648
- summary: string;
649
- description: string;
650
- base: string;
651
- branch: string;
652
- issueId?: number;
653
- assigneeId?: number;
654
- notifiedUserId?: number[];
655
- attachmentId?: number[];
656
- }
657
- export interface PatchPullRequestParams {
658
- summary?: string;
659
- description?: string;
660
- issueId?: number;
661
- assigneeId?: number;
662
- notifiedUserId?: number[];
663
- comment?: string[];
664
- }
665
- export interface GetPullRequestCommentsParams {
666
- minId?: number;
667
- maxId?: number;
668
- count?: number;
669
- order?: Order;
670
- }
671
- export interface PostPullRequestCommentsParams {
672
- content: string;
673
- notifiedUserId?: number[];
674
- }
675
- export interface PatchPullRequestCommentsParams {
676
- content: string;
677
- }
678
- }
679
- export namespace Wiki {
680
- export interface GetWikiParams {
681
- projectIdOrKey: string | number;
682
- keyword?: string;
683
- }
684
- export interface PostWikiParams {
685
- projectId: number;
686
- name: string;
687
- content: string;
688
- mailNotify?: boolean;
689
- }
690
- export interface PatchWikiParams {
691
- name?: string;
692
- content?: string;
693
- mailNotify?: boolean;
694
- }
695
- export interface GetWikisHistoryParams {
696
- minId?: number;
697
- maxId?: number;
698
- count?: number;
699
- order?: Order;
700
- }
701
- }
702
- export namespace OAuth2 {
703
- export interface Credentials {
704
- clientId: string;
705
- clientSecret: string;
706
- }
707
- }
708
- }
709
-
710
- export namespace Error {
711
- export class BacklogError extends global.Error {
712
- private _name;
713
- private _url;
714
- private _status;
715
- private _body;
716
- private _response;
717
- constructor(name: BacklogErrorNameType, response: Response, body?: {
718
- errors: BacklogErrorMessage[];
719
- });
720
- name: BacklogErrorNameType;
721
- url: string;
722
- status: number;
723
- body: {
724
- errors: BacklogErrorMessage[];
725
- };
726
- response: Response;
727
- }
728
- export class BacklogApiError extends BacklogError {
729
- constructor(response: Response, body?: {
730
- errors: BacklogErrorMessage[];
731
- });
732
- }
733
- export class BacklogAuthError extends BacklogError {
734
- constructor(response: Response, body?: {
735
- errors: BacklogErrorMessage[];
736
- });
737
- }
738
- export class UnexpectedError extends BacklogError {
739
- constructor(response: Response);
740
- }
741
- export interface BacklogErrorMessage {
742
- message: string;
743
- code: number;
744
- errorInfo: string;
745
- moreInfo: string;
746
- }
747
- export type BacklogErrorNameType = 'BacklogApiError' | 'BacklogAuthError' | 'UnexpectedError';
748
- }
749
-
750
- }